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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMake/macros.cmake81
-rw-r--r--CMakeLists.txt272
-rw-r--r--SConstruct39
-rw-r--r--config/darwin-config.py82
-rw-r--r--config/irix6-config.py6
-rw-r--r--config/linux2-config.py45
-rw-r--r--config/linuxcross-config.py6
-rw-r--r--config/openbsd3-config.py6
-rw-r--r--config/sunos5-config.py8
-rw-r--r--config/win32-mingw-config.py48
-rw-r--r--config/win32-vc-config.py57
-rw-r--r--config/win64-vc-config.py19
-rw-r--r--extern/CMakeLists.txt3
-rw-r--r--extern/Makefile8
-rw-r--r--extern/SConscript4
-rw-r--r--extern/glew/CMakeLists.txt5
-rw-r--r--extern/libopenjpeg/CMakeLists.txt2
-rw-r--r--extern/libredcode/SConscript4
-rw-r--r--extern/lzma/Alloc.c127
-rw-r--r--extern/lzma/Alloc.h32
-rw-r--r--extern/lzma/CMakeLists.txt34
-rw-r--r--extern/lzma/LzFind.c751
-rw-r--r--extern/lzma/LzFind.h107
-rw-r--r--extern/lzma/LzHash.h54
-rw-r--r--extern/lzma/LzmaDec.c1007
-rw-r--r--extern/lzma/LzmaDec.h223
-rw-r--r--extern/lzma/LzmaEnc.c2281
-rw-r--r--extern/lzma/LzmaEnc.h72
-rw-r--r--extern/lzma/LzmaLib.c46
-rw-r--r--extern/lzma/LzmaLib.h135
-rw-r--r--extern/lzma/Makefile46
-rw-r--r--extern/lzma/SConscript9
-rw-r--r--extern/lzma/Types.h208
-rw-r--r--extern/lzma/history.txt236
-rw-r--r--extern/lzma/lzma.txt594
-rw-r--r--extern/lzma/make/msvc_9_0/lzma.vcproj (renamed from intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj)192
-rw-r--r--extern/lzo/CMakeLists.txt34
-rw-r--r--extern/lzo/SConscript9
-rw-r--r--extern/lzo/make/msvc_9_0/lzo.vcproj (renamed from intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj)140
-rw-r--r--extern/lzo/minilzo/COPYING340
-rw-r--r--extern/lzo/minilzo/Makefile40
-rw-r--r--extern/lzo/minilzo/README.LZO123
-rw-r--r--extern/lzo/minilzo/lzoconf.h417
-rw-r--r--extern/lzo/minilzo/lzodefs.h1807
-rw-r--r--extern/lzo/minilzo/minilzo.c4112
-rw-r--r--extern/lzo/minilzo/minilzo.h112
-rw-r--r--intern/CMakeLists.txt3
-rw-r--r--intern/Makefile2
-rw-r--r--intern/SConscript5
-rw-r--r--intern/SoundSystem/CMakeLists.txt42
-rw-r--r--intern/SoundSystem/SConscript20
-rw-r--r--intern/SoundSystem/SND_C-api.h354
-rw-r--r--intern/SoundSystem/SND_CDObject.h83
-rw-r--r--intern/SoundSystem/SND_DeviceManager.h79
-rw-r--r--intern/SoundSystem/SND_IAudioDevice.h343
-rw-r--r--intern/SoundSystem/SND_Scene.h104
-rw-r--r--intern/SoundSystem/SND_SoundListener.h82
-rw-r--r--intern/SoundSystem/SND_SoundObject.h159
-rw-r--r--intern/SoundSystem/SND_Utils.h111
-rw-r--r--intern/SoundSystem/SND_WaveCache.h66
-rw-r--r--intern/SoundSystem/SND_WaveSlot.h92
-rw-r--r--intern/SoundSystem/SND_test/Makefile48
-rw-r--r--intern/SoundSystem/SND_test/SND_test.c154
-rw-r--r--intern/SoundSystem/SoundDefines.h107
-rw-r--r--intern/SoundSystem/dummy/SND_DummyDevice.h93
-rw-r--r--intern/SoundSystem/intern/SND_AudioDevice.cpp242
-rw-r--r--intern/SoundSystem/intern/SND_AudioDevice.h115
-rw-r--r--intern/SoundSystem/intern/SND_C-api.cpp392
-rw-r--r--intern/SoundSystem/intern/SND_CDObject.cpp182
-rw-r--r--intern/SoundSystem/intern/SND_DeviceManager.cpp126
-rw-r--r--intern/SoundSystem/intern/SND_IdObject.cpp76
-rw-r--r--intern/SoundSystem/intern/SND_IdObject.h58
-rw-r--r--intern/SoundSystem/intern/SND_Scene.cpp544
-rw-r--r--intern/SoundSystem/intern/SND_SoundListener.cpp185
-rw-r--r--intern/SoundSystem/intern/SND_SoundObject.cpp508
-rw-r--r--intern/SoundSystem/intern/SND_Utils.cpp424
-rw-r--r--intern/SoundSystem/intern/SND_WaveCache.cpp138
-rw-r--r--intern/SoundSystem/intern/SND_WaveSlot.cpp180
-rw-r--r--intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp206
-rw-r--r--intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp103
-rw-r--r--intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp106
-rw-r--r--intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj339
-rw-r--r--intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj243
-rw-r--r--intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj249
-rw-r--r--intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj447
-rw-r--r--intern/SoundSystem/openal/SND_OpenALDevice.cpp864
-rw-r--r--intern/SoundSystem/openal/SND_OpenALDevice.h107
-rw-r--r--intern/SoundSystem/openal/pthread_cancel.cpp67
-rw-r--r--intern/SoundSystem/sdl/SND_SDLCDDevice.cpp171
-rw-r--r--intern/audaspace/CMakeLists.txt64
-rw-r--r--intern/audaspace/COPYING674
-rw-r--r--intern/audaspace/COPYING.LESSER165
-rw-r--r--intern/audaspace/FX/AUD_DelayFactory.cpp58
-rw-r--r--intern/audaspace/FX/AUD_DelayFactory.h70
-rw-r--r--intern/audaspace/FX/AUD_DelayReader.cpp111
-rw-r--r--intern/audaspace/FX/AUD_DelayReader.h73
-rw-r--r--intern/audaspace/FX/AUD_DoubleReader.cpp158
-rw-r--r--intern/audaspace/FX/AUD_DoubleReader.h83
-rw-r--r--intern/audaspace/FX/AUD_EffectFactory.cpp50
-rw-r--r--intern/audaspace/FX/AUD_EffectFactory.h76
-rw-r--r--intern/audaspace/FX/AUD_EffectReader.cpp78
-rw-r--r--intern/audaspace/FX/AUD_EffectReader.h66
-rw-r--r--intern/audaspace/FX/AUD_FaderFactory.cpp84
-rw-r--r--intern/audaspace/FX/AUD_FaderFactory.h111
-rw-r--r--intern/audaspace/FX/AUD_FaderReader.cpp133
-rw-r--r--intern/audaspace/FX/AUD_FaderReader.h86
-rw-r--r--intern/audaspace/FX/AUD_LimiterFactory.cpp67
-rw-r--r--intern/audaspace/FX/AUD_LimiterFactory.h84
-rw-r--r--intern/audaspace/FX/AUD_LimiterReader.cpp95
-rw-r--r--intern/audaspace/FX/AUD_LimiterReader.h64
-rw-r--r--intern/audaspace/FX/AUD_LoopFactory.cpp57
-rw-r--r--intern/audaspace/FX/AUD_LoopFactory.h74
-rw-r--r--intern/audaspace/FX/AUD_LoopReader.cpp107
-rw-r--r--intern/audaspace/FX/AUD_LoopReader.h69
-rw-r--r--intern/audaspace/FX/AUD_PingPongFactory.cpp67
-rw-r--r--intern/audaspace/FX/AUD_PingPongFactory.h51
-rw-r--r--intern/audaspace/FX/AUD_PitchFactory.cpp48
-rw-r--r--intern/audaspace/FX/AUD_PitchFactory.h70
-rw-r--r--intern/audaspace/FX/AUD_PitchReader.cpp39
-rw-r--r--intern/audaspace/FX/AUD_PitchReader.h54
-rw-r--r--intern/audaspace/FX/AUD_ReverseFactory.cpp43
-rw-r--r--intern/audaspace/FX/AUD_ReverseFactory.h50
-rw-r--r--intern/audaspace/FX/AUD_ReverseReader.cpp111
-rw-r--r--intern/audaspace/FX/AUD_ReverseReader.h74
-rw-r--r--intern/audaspace/FX/AUD_VolumeFactory.cpp57
-rw-r--r--intern/audaspace/FX/AUD_VolumeFactory.h72
-rw-r--r--intern/audaspace/FX/AUD_VolumeReader.cpp97
-rw-r--r--intern/audaspace/FX/AUD_VolumeReader.h72
-rw-r--r--intern/audaspace/FX/Makefile (renamed from intern/SoundSystem/dummy/Makefile)9
-rw-r--r--intern/audaspace/Makefile106
-rw-r--r--intern/audaspace/OpenAL/AUD_OpenALDevice.cpp1362
-rw-r--r--intern/audaspace/OpenAL/AUD_OpenALDevice.h171
-rw-r--r--intern/audaspace/OpenAL/Makefile39
-rw-r--r--intern/audaspace/SConscript34
-rw-r--r--intern/audaspace/SDL/AUD_SDLDevice.cpp90
-rw-r--r--intern/audaspace/SDL/AUD_SDLDevice.h66
-rw-r--r--intern/audaspace/SDL/AUD_SDLMixer.cpp83
-rw-r--r--intern/audaspace/SDL/AUD_SDLMixer.h76
-rw-r--r--intern/audaspace/SDL/AUD_SDLMixerFactory.cpp65
-rw-r--r--intern/audaspace/SDL/AUD_SDLMixerFactory.h45
-rw-r--r--intern/audaspace/SDL/AUD_SDLMixerReader.cpp216
-rw-r--r--intern/audaspace/SDL/AUD_SDLMixerReader.h128
-rw-r--r--intern/audaspace/SDL/Makefile (renamed from intern/SoundSystem/sdl/Makefile)6
-rw-r--r--intern/audaspace/SRC/AUD_SRCResampleFactory.cpp53
-rw-r--r--intern/audaspace/SRC/AUD_SRCResampleFactory.h46
-rw-r--r--intern/audaspace/SRC/AUD_SRCResampleReader.cpp119
-rw-r--r--intern/audaspace/SRC/AUD_SRCResampleReader.h102
-rw-r--r--intern/audaspace/SRC/Makefile (renamed from intern/SoundSystem/openal/Makefile)12
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp65
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h73
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp388
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGReader.h139
-rw-r--r--intern/audaspace/ffmpeg/Makefile (renamed from intern/SoundSystem/intern/Makefile)11
-rw-r--r--intern/audaspace/intern/AUD_Buffer.cpp67
-rw-r--r--intern/audaspace/intern/AUD_Buffer.h75
-rw-r--r--intern/audaspace/intern/AUD_BufferReader.cpp91
-rw-r--r--intern/audaspace/intern/AUD_BufferReader.h74
-rw-r--r--intern/audaspace/intern/AUD_C-API.cpp560
-rw-r--r--intern/audaspace/intern/AUD_C-API.h331
-rw-r--r--intern/audaspace/intern/AUD_ChannelMapperFactory.cpp125
-rw-r--r--intern/audaspace/intern/AUD_ChannelMapperFactory.h65
-rw-r--r--intern/audaspace/intern/AUD_ChannelMapperReader.cpp108
-rw-r--r--intern/audaspace/intern/AUD_ChannelMapperReader.h76
-rw-r--r--intern/audaspace/intern/AUD_ConverterFactory.cpp54
-rw-r--r--intern/audaspace/intern/AUD_ConverterFactory.h45
-rw-r--r--intern/audaspace/intern/AUD_ConverterFunctions.cpp502
-rw-r--r--intern/audaspace/intern/AUD_ConverterFunctions.h156
-rw-r--r--intern/audaspace/intern/AUD_ConverterReader.cpp260
-rw-r--r--intern/audaspace/intern/AUD_ConverterReader.h71
-rw-r--r--intern/audaspace/intern/AUD_FileFactory.cpp95
-rw-r--r--intern/audaspace/intern/AUD_FileFactory.h71
-rw-r--r--intern/audaspace/intern/AUD_FloatMixer.cpp172
-rw-r--r--intern/audaspace/intern/AUD_FloatMixer.h100
-rw-r--r--intern/audaspace/intern/AUD_I3DDevice.h103
-rw-r--r--intern/audaspace/intern/AUD_IDevice.h191
-rw-r--r--intern/audaspace/intern/AUD_IFactory.h55
-rw-r--r--intern/audaspace/intern/AUD_IMixer.h77
-rw-r--r--intern/audaspace/intern/AUD_IReader.h117
-rw-r--r--intern/audaspace/intern/AUD_MixerFactory.cpp109
-rw-r--r--intern/audaspace/intern/AUD_MixerFactory.h117
-rw-r--r--intern/audaspace/intern/AUD_NULLDevice.cpp108
-rw-r--r--intern/audaspace/intern/AUD_NULLDevice.h65
-rw-r--r--intern/audaspace/intern/AUD_ReadDevice.cpp64
-rw-r--r--intern/audaspace/intern/AUD_ReadDevice.h68
-rw-r--r--intern/audaspace/intern/AUD_Reference.h115
-rw-r--r--intern/audaspace/intern/AUD_ResampleFactory.h33
-rw-r--r--intern/audaspace/intern/AUD_SinusFactory.cpp51
-rw-r--r--intern/audaspace/intern/AUD_SinusFactory.h70
-rw-r--r--intern/audaspace/intern/AUD_SinusReader.cpp104
-rw-r--r--intern/audaspace/intern/AUD_SinusReader.h86
-rw-r--r--intern/audaspace/intern/AUD_SoftwareDevice.cpp444
-rw-r--r--intern/audaspace/intern/AUD_SoftwareDevice.h137
-rw-r--r--intern/audaspace/intern/AUD_SourceCaps.h41
-rw-r--r--intern/audaspace/intern/AUD_Space.h295
-rw-r--r--intern/audaspace/intern/AUD_StreamBufferFactory.cpp80
-rw-r--r--intern/audaspace/intern/AUD_StreamBufferFactory.h62
-rw-r--r--intern/audaspace/intern/Makefile70
-rw-r--r--intern/audaspace/jack/AUD_JackDevice.cpp149
-rw-r--r--intern/audaspace/jack/AUD_JackDevice.h92
-rw-r--r--intern/audaspace/jack/Makefile44
-rw-r--r--intern/audaspace/make/msvc_9_0/audaspace.vcproj767
-rw-r--r--intern/audaspace/sndfile/AUD_SndFileFactory.cpp67
-rw-r--r--intern/audaspace/sndfile/AUD_SndFileFactory.h71
-rw-r--r--intern/audaspace/sndfile/AUD_SndFileReader.cpp233
-rw-r--r--intern/audaspace/sndfile/AUD_SndFileReader.h131
-rw-r--r--intern/audaspace/sndfile/Makefile40
-rw-r--r--intern/elbeem/CMakeLists.txt2
-rw-r--r--intern/elbeem/intern/paraloopend.h6
-rw-r--r--intern/elbeem/intern/solver_init.cpp2
-rw-r--r--intern/ghost/CMakeLists.txt4
-rw-r--r--intern/ghost/intern/GHOST_EventManager.cpp9
-rw-r--r--intern/ghost/intern/GHOST_System.cpp3
-rw-r--r--intern/ghost/intern/GHOST_System.h2
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp15
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h8
-rw-r--r--intern/ghost/intern/GHOST_WindowManager.cpp1
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp32
-rw-r--r--intern/guardedalloc/BLO_sys_types.h2
-rw-r--r--intern/guardedalloc/CMakeLists.txt7
-rw-r--r--intern/guardedalloc/SConscript2
-rw-r--r--intern/guardedalloc/cpp/mallocn.cpp41
-rw-r--r--intern/memutil/SConscript2
-rw-r--r--intern/opennl/superlu/BLO_sys_types.h2
-rw-r--r--intern/smoke/CMakeLists.txt42
-rw-r--r--intern/smoke/Makefile (renamed from intern/SoundSystem/Makefile)42
-rw-r--r--intern/smoke/SConscript18
-rw-r--r--intern/smoke/extern/smoke_API.h79
-rw-r--r--intern/smoke/intern/EIGENVALUE_HELPER.h47
-rw-r--r--intern/smoke/intern/FFT_NOISE.h178
-rw-r--r--intern/smoke/intern/FLUID_3D.cpp714
-rw-r--r--intern/smoke/intern/FLUID_3D.h168
-rw-r--r--intern/smoke/intern/FLUID_3D_SOLVERS.cpp524
-rw-r--r--intern/smoke/intern/FLUID_3D_STATIC.cpp660
-rw-r--r--intern/smoke/intern/IMAGE.h277
-rw-r--r--intern/smoke/intern/INTERPOLATE.h227
-rw-r--r--intern/smoke/intern/LICENSE.txt674
-rw-r--r--intern/smoke/intern/LU_HELPER.h56
-rw-r--r--intern/smoke/intern/MERSENNETWISTER.h429
-rw-r--r--intern/smoke/intern/Makefile52
-rw-r--r--intern/smoke/intern/Makefile.FFT22
-rw-r--r--intern/smoke/intern/Makefile.cygwin23
-rw-r--r--intern/smoke/intern/Makefile.linux23
-rw-r--r--intern/smoke/intern/Makefile.mac35
-rw-r--r--intern/smoke/intern/OBSTACLE.h41
-rw-r--r--intern/smoke/intern/SPHERE.cpp50
-rw-r--r--intern/smoke/intern/SPHERE.h41
-rw-r--r--intern/smoke/intern/VEC3.h986
-rw-r--r--intern/smoke/intern/WAVELET_NOISE.h458
-rw-r--r--intern/smoke/intern/WTURBULENCE.cpp1013
-rw-r--r--intern/smoke/intern/WTURBULENCE.h141
-rw-r--r--intern/smoke/intern/smoke_API.cpp262
-rw-r--r--intern/smoke/intern/tnt/jama_eig.h1050
-rw-r--r--intern/smoke/intern/tnt/jama_lu.h319
-rw-r--r--intern/smoke/intern/tnt/tnt.h64
-rw-r--r--intern/smoke/intern/tnt/tnt_array1d.h278
-rw-r--r--intern/smoke/intern/tnt/tnt_array1d_utils.h230
-rw-r--r--intern/smoke/intern/tnt/tnt_array2d.h315
-rw-r--r--intern/smoke/intern/tnt/tnt_array2d_utils.h287
-rw-r--r--intern/smoke/intern/tnt/tnt_array3d.h296
-rw-r--r--intern/smoke/intern/tnt/tnt_array3d_utils.h236
-rw-r--r--intern/smoke/intern/tnt/tnt_cmat.h580
-rw-r--r--intern/smoke/intern/tnt/tnt_fortran_array1d.h267
-rw-r--r--intern/smoke/intern/tnt/tnt_fortran_array1d_utils.h242
-rw-r--r--intern/smoke/intern/tnt/tnt_fortran_array2d.h225
-rw-r--r--intern/smoke/intern/tnt/tnt_fortran_array2d_utils.h236
-rw-r--r--intern/smoke/intern/tnt/tnt_fortran_array3d.h223
-rw-r--r--intern/smoke/intern/tnt/tnt_fortran_array3d_utils.h249
-rw-r--r--intern/smoke/intern/tnt/tnt_i_refvec.h243
-rw-r--r--intern/smoke/intern/tnt/tnt_math_utils.h34
-rw-r--r--intern/smoke/intern/tnt/tnt_sparse_matrix_csr.h103
-rw-r--r--intern/smoke/intern/tnt/tnt_stopwatch.h95
-rw-r--r--intern/smoke/intern/tnt/tnt_subscript.h54
-rw-r--r--intern/smoke/intern/tnt/tnt_vec.h404
-rw-r--r--intern/smoke/intern/tnt/tnt_version.h39
-rw-r--r--intern/smoke/make/msvc_9_0/smoke.vcproj511
-rw-r--r--intern/string/STR_String.h10
-rw-r--r--projectfiles_vc9/blender/BPY_python/BPY_python.vcproj16
-rw-r--r--projectfiles_vc9/blender/blender.sln399
-rw-r--r--projectfiles_vc9/blender/blender.vcproj12
-rw-r--r--projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj44
-rw-r--r--projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj12
-rw-r--r--projectfiles_vc9/blender/editors/ED_editors.vcproj98
-rw-r--r--projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj12
-rw-r--r--projectfiles_vc9/blender/loader/BLO_loader.vcproj8
-rw-r--r--projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj4
-rw-r--r--projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj28
-rw-r--r--projectfiles_vc9/blender/makesrna/RNA_rna.vcproj8
-rw-r--r--projectfiles_vc9/blender/nodes/nodes.vcproj8
-rw-r--r--projectfiles_vc9/blender/render/BRE_render.vcproj40
-rw-r--r--projectfiles_vc9/gameengine/blenderhook/KX_blenderhook.vcproj4
-rw-r--r--projectfiles_vc9/gameengine/converter/KX_converter.vcproj13
-rw-r--r--projectfiles_vc9/gameengine/expression/EXP_expressions.vcproj12
-rw-r--r--projectfiles_vc9/gameengine/gamelogic/SCA_GameLogic.vcproj12
-rw-r--r--projectfiles_vc9/gameengine/gameplayer/axctl/GP_axctl.vcproj4
-rw-r--r--projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj9
-rw-r--r--projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj16
-rw-r--r--projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj21
-rw-r--r--projectfiles_vc9/gameengine/ketsji/network/KX_network.vcproj12
-rw-r--r--projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj12
-rw-r--r--projectfiles_vc9/gameengine/rasterizer/RAS_rasterizer.vcproj12
-rw-r--r--projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj4
-rw-r--r--release/Makefile16
-rw-r--r--release/datafiles/blenderbuttonsbin176743 -> 179274 bytes
-rw-r--r--release/datafiles/datatoc.c102
-rwxr-xr-xrelease/datafiles/datatoc.py75
-rw-r--r--release/datafiles/splash.jpgbin197158 -> 197165 bytes
-rw-r--r--release/io/engine_render_pov.py462
-rw-r--r--release/io/export_ply.py17
-rw-r--r--release/io/netrender/__init__.py9
-rw-r--r--release/io/netrender/client.py88
-rw-r--r--release/io/netrender/master.py601
-rw-r--r--release/io/netrender/model.py157
-rw-r--r--release/io/netrender/operators.py238
-rw-r--r--release/io/netrender/slave.py162
-rw-r--r--release/io/netrender/ui.py317
-rw-r--r--release/io/netrender/utils.py134
-rw-r--r--release/scripts/export_map.py8
-rw-r--r--release/scripts/help_getting_started.py50
-rw-r--r--release/scripts/help_manual.py48
-rw-r--r--release/scripts/help_release_notes.py47
-rw-r--r--release/scripts/help_tutorials.py47
-rw-r--r--release/scripts/help_web_blender.py48
-rw-r--r--release/scripts/help_web_devcomm.py47
-rw-r--r--release/scripts/help_web_eshop.py47
-rw-r--r--release/scripts/help_web_usercomm.py47
-rw-r--r--release/scripts/import_edl.py961
-rw-r--r--release/scripts/md2_export.py3
-rw-r--r--release/scripts/textplugin_convert_ge.py4
-rw-r--r--release/ui/bpy_ops.py28
-rw-r--r--release/ui/buttons_data_armature.py33
-rw-r--r--release/ui/buttons_data_bone.py34
-rw-r--r--release/ui/buttons_data_camera.py6
-rw-r--r--release/ui/buttons_data_curve.py75
-rw-r--r--release/ui/buttons_data_empty.py4
-rw-r--r--release/ui/buttons_data_lamp.py102
-rw-r--r--release/ui/buttons_data_lattice.py6
-rw-r--r--release/ui/buttons_data_mesh.py81
-rw-r--r--release/ui/buttons_data_metaball.py51
-rw-r--r--release/ui/buttons_data_modifier.py274
-rw-r--r--release/ui/buttons_data_text.py48
-rw-r--r--release/ui/buttons_game.py378
-rw-r--r--release/ui/buttons_material.py746
-rw-r--r--release/ui/buttons_object.py60
-rw-r--r--release/ui/buttons_object_constraint.py316
-rw-r--r--release/ui/buttons_particle.py192
-rw-r--r--release/ui/buttons_physics_cloth.py133
-rw-r--r--release/ui/buttons_physics_field.py304
-rw-r--r--release/ui/buttons_physics_fluid.py164
-rw-r--r--release/ui/buttons_physics_smoke.py226
-rw-r--r--release/ui/buttons_physics_softbody.py198
-rw-r--r--release/ui/buttons_scene.py178
-rw-r--r--release/ui/buttons_texture.py660
-rw-r--r--release/ui/buttons_world.py84
-rw-r--r--release/ui/space_buttons.py11
-rw-r--r--release/ui/space_console.py52
-rw-r--r--release/ui/space_filebrowser.py9
-rw-r--r--release/ui/space_image.py146
-rw-r--r--release/ui/space_info.py460
-rw-r--r--release/ui/space_logic.py24
-rw-r--r--release/ui/space_node.py120
-rw-r--r--release/ui/space_outliner.py11
-rw-r--r--release/ui/space_sequencer.py372
-rw-r--r--release/ui/space_text.py67
-rw-r--r--release/ui/space_time.py151
-rw-r--r--release/ui/space_userpref.py418
-rw-r--r--release/ui/space_view3d.py1220
-rw-r--r--release/ui/space_view3d_toolbar.py401
-rw-r--r--source/Makefile94
-rw-r--r--source/SConscript5
-rw-r--r--source/blender/blenfont/BLF_api.h31
-rw-r--r--source/blender/blenfont/CMakeLists.txt8
-rw-r--r--source/blender/blenfont/intern/blf.c95
-rw-r--r--source/blender/blenfont/intern/blf_dir.c3
-rw-r--r--source/blender/blenfont/intern/blf_font.c223
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c336
-rw-r--r--source/blender/blenfont/intern/blf_internal.h2
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h75
-rw-r--r--source/blender/blenkernel/BKE_action.h2
-rw-r--r--source/blender/blenkernel/BKE_animsys.h3
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/BKE_brush.h8
-rw-r--r--source/blender/blenkernel/BKE_cloth.h7
-rw-r--r--source/blender/blenkernel/BKE_constraint.h1
-rw-r--r--source/blender/blenkernel/BKE_context.h23
-rw-r--r--source/blender/blenkernel/BKE_global.h48
-rw-r--r--source/blender/blenkernel/BKE_library.h1
-rw-r--r--source/blender/blenkernel/BKE_mball.h1
-rw-r--r--source/blender/blenkernel/BKE_modifier.h6
-rw-r--r--source/blender/blenkernel/BKE_multires.h8
-rw-r--r--source/blender/blenkernel/BKE_nla.h1
-rw-r--r--source/blender/blenkernel/BKE_node.h10
-rw-r--r--source/blender/blenkernel/BKE_object.h5
-rw-r--r--source/blender/blenkernel/BKE_packedFile.h3
-rw-r--r--source/blender/blenkernel/BKE_paint.h (renamed from source/blender/blenkernel/BKE_sculpt.h)44
-rw-r--r--source/blender/blenkernel/BKE_particle.h50
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h216
-rw-r--r--source/blender/blenkernel/BKE_scene.h11
-rw-r--r--source/blender/blenkernel/BKE_sequence.h13
-rw-r--r--source/blender/blenkernel/BKE_shrinkwrap.h4
-rw-r--r--source/blender/blenkernel/BKE_smoke.h (renamed from intern/SoundSystem/SND_Object.h)34
-rw-r--r--source/blender/blenkernel/BKE_softbody.h3
-rw-r--r--source/blender/blenkernel/BKE_sound.h49
-rw-r--r--source/blender/blenkernel/BKE_texture.h12
-rw-r--r--source/blender/blenkernel/BKE_unit.h68
-rw-r--r--source/blender/blenkernel/BKE_utildefines.h7
-rw-r--r--source/blender/blenkernel/BKE_writeavi.h5
-rw-r--r--source/blender/blenkernel/BKE_writeffmpeg.h3
-rw-r--r--source/blender/blenkernel/BKE_writeframeserver.h3
-rw-r--r--source/blender/blenkernel/CMakeLists.txt25
-rw-r--r--source/blender/blenkernel/SConscript8
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c3
-rw-r--r--source/blender/blenkernel/intern/Makefile9
-rw-r--r--source/blender/blenkernel/intern/action.c55
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c148
-rw-r--r--source/blender/blenkernel/intern/armature.c6
-rw-r--r--source/blender/blenkernel/intern/blender.c10
-rw-r--r--source/blender/blenkernel/intern/boids.c4
-rw-r--r--source/blender/blenkernel/intern/brush.c71
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c41
-rw-r--r--source/blender/blenkernel/intern/cloth.c97
-rw-r--r--source/blender/blenkernel/intern/collision.c4
-rw-r--r--source/blender/blenkernel/intern/colortools.c18
-rw-r--r--source/blender/blenkernel/intern/constraint.c43
-rw-r--r--source/blender/blenkernel/intern/context.c77
-rw-r--r--source/blender/blenkernel/intern/displist.c4
-rw-r--r--source/blender/blenkernel/intern/exotic.c6
-rw-r--r--source/blender/blenkernel/intern/fcurve.c8
-rw-r--r--source/blender/blenkernel/intern/gpencil.c7
-rw-r--r--source/blender/blenkernel/intern/idprop.c2
-rw-r--r--source/blender/blenkernel/intern/image.c222
-rw-r--r--source/blender/blenkernel/intern/ipo.c31
-rw-r--r--source/blender/blenkernel/intern/key.c13
-rw-r--r--source/blender/blenkernel/intern/library.c16
-rw-r--r--source/blender/blenkernel/intern/material.c22
-rw-r--r--source/blender/blenkernel/intern/mball.c51
-rw-r--r--source/blender/blenkernel/intern/modifier.c135
-rw-r--r--source/blender/blenkernel/intern/multires.c25
-rw-r--r--source/blender/blenkernel/intern/nla.c27
-rw-r--r--source/blender/blenkernel/intern/node.c32
-rw-r--r--source/blender/blenkernel/intern/object.c137
-rw-r--r--source/blender/blenkernel/intern/packedFile.c57
-rw-r--r--source/blender/blenkernel/intern/paint.c189
-rw-r--r--source/blender/blenkernel/intern/particle.c443
-rw-r--r--source/blender/blenkernel/intern/particle_system.c190
-rw-r--r--source/blender/blenkernel/intern/pointcache.c1833
-rw-r--r--source/blender/blenkernel/intern/sca.c17
-rw-r--r--source/blender/blenkernel/intern/scene.c192
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c6
-rw-r--r--source/blender/blenkernel/intern/sequence.c186
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c2
-rw-r--r--source/blender/blenkernel/intern/smoke.c1472
-rw-r--r--source/blender/blenkernel/intern/softbody.c112
-rw-r--r--source/blender/blenkernel/intern/sound.c515
-rw-r--r--source/blender/blenkernel/intern/texture.c117
-rw-r--r--source/blender/blenkernel/intern/unit.c585
-rw-r--r--source/blender/blenkernel/intern/writeavi.c2
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c29
-rw-r--r--source/blender/blenkernel/intern/writeframeserver.c2
-rw-r--r--source/blender/blenlib/BLI_arithb.h56
-rw-r--r--source/blender/blenlib/BLI_kdopbvh.h8
-rw-r--r--source/blender/blenlib/BLI_vfontdata.h13
-rw-r--r--source/blender/blenlib/BLI_voxel.h (renamed from intern/SoundSystem/sdl/SND_SDLCDDevice.h)39
-rw-r--r--source/blender/blenlib/BLI_winstuff.h30
-rw-r--r--source/blender/blenlib/CMakeLists.txt3
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c148
-rw-r--r--source/blender/blenlib/intern/BLI_kdtree.c2
-rw-r--r--source/blender/blenlib/intern/arithb.c549
-rw-r--r--source/blender/blenlib/intern/boxpack2d.c59
-rw-r--r--source/blender/blenlib/intern/bpath.c2
-rw-r--r--source/blender/blenlib/intern/listbase.c4
-rw-r--r--source/blender/blenlib/intern/psfont.c2126
-rw-r--r--source/blender/blenlib/intern/storage.c11
-rw-r--r--source/blender/blenlib/intern/threads.c19
-rw-r--r--source/blender/blenlib/intern/util.c2
-rw-r--r--source/blender/blenlib/intern/voxel.c198
-rw-r--r--source/blender/blenloader/BLO_sys_types.h2
-rw-r--r--source/blender/blenloader/SConscript2
-rw-r--r--source/blender/blenloader/intern/readblenentry.c20
-rw-r--r--source/blender/blenloader/intern/readfile.c532
-rw-r--r--source/blender/blenloader/intern/readfile.h3
-rw-r--r--source/blender/blenloader/intern/writefile.c142
-rw-r--r--source/blender/blenpluginapi/SConscript2
-rw-r--r--source/blender/editors/CMakeLists.txt16
-rw-r--r--source/blender/editors/Makefile2
-rw-r--r--source/blender/editors/SConscript2
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c2266
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c (renamed from source/blender/editors/animation/anim_channels.c)531
-rw-r--r--source/blender/editors/animation/anim_deps.c2
-rw-r--r--source/blender/editors/animation/anim_filter.c182
-rw-r--r--source/blender/editors/animation/anim_intern.h30
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c29
-rw-r--r--source/blender/editors/animation/anim_ops.c16
-rw-r--r--source/blender/editors/animation/drivers.c38
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c52
-rw-r--r--source/blender/editors/animation/keyframes_draw.c37
-rw-r--r--source/blender/editors/animation/keyframes_edit.c31
-rw-r--r--source/blender/editors/animation/keyframes_general.c205
-rw-r--r--source/blender/editors/animation/keyframing.c134
-rw-r--r--source/blender/editors/animation/keyingsets.c288
-rw-r--r--source/blender/editors/armature/editarmature.c24
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c4
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c6
-rw-r--r--source/blender/editors/armature/meshlaplacian.c2
-rw-r--r--source/blender/editors/armature/poselib.c2
-rw-r--r--source/blender/editors/armature/poseobject.c41
-rw-r--r--source/blender/editors/curve/curve_ops.c5
-rw-r--r--source/blender/editors/datafiles/blenderbuttons.c11129
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c381
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c281
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c1726
-rw-r--r--source/blender/editors/gpencil/gpencil_intern.h32
-rw-r--r--source/blender/editors/gpencil/gpencil_ops.c86
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c1434
-rw-r--r--source/blender/editors/include/ED_anim_api.h111
-rw-r--r--source/blender/editors/include/ED_fileselect.h1
-rw-r--r--source/blender/editors/include/ED_gpencil.h36
-rw-r--r--source/blender/editors/include/ED_info.h (renamed from source/gameengine/Expressions/KX_Python_static.h)20
-rw-r--r--source/blender/editors/include/ED_keyframes_draw.h6
-rw-r--r--source/blender/editors/include/ED_keyframes_edit.h4
-rw-r--r--source/blender/editors/include/ED_keyframing.h14
-rw-r--r--source/blender/editors/include/ED_node.h9
-rw-r--r--source/blender/editors/include/ED_object.h7
-rw-r--r--source/blender/editors/include/ED_particle.h11
-rw-r--r--source/blender/editors/include/ED_previewrender.h7
-rw-r--r--source/blender/editors/include/ED_screen.h8
-rw-r--r--source/blender/editors/include/ED_screen_types.h17
-rw-r--r--source/blender/editors/include/ED_sound.h35
-rw-r--r--source/blender/editors/include/ED_space_api.h1
-rw-r--r--source/blender/editors/include/ED_view3d.h3
-rw-r--r--source/blender/editors/include/UI_icons.h14
-rw-r--r--source/blender/editors/include/UI_interface.h31
-rw-r--r--source/blender/editors/interface/Makefile1
-rw-r--r--source/blender/editors/interface/SConscript1
-rw-r--r--source/blender/editors/interface/interface.c163
-rw-r--r--source/blender/editors/interface/interface_anim.c32
-rw-r--r--source/blender/editors/interface/interface_handlers.c60
-rw-r--r--source/blender/editors/interface/interface_intern.h22
-rw-r--r--source/blender/editors/interface/interface_layout.c195
-rw-r--r--source/blender/editors/interface/interface_panel.c4
-rw-r--r--source/blender/editors/interface/interface_regions.c826
-rw-r--r--source/blender/editors/interface/interface_style.c19
-rw-r--r--source/blender/editors/interface/interface_templates.c159
-rw-r--r--source/blender/editors/interface/interface_utils.c88
-rw-r--r--source/blender/editors/interface/interface_widgets.c30
-rw-r--r--source/blender/editors/interface/resources.c10
-rw-r--r--source/blender/editors/interface/view2d_ops.c2
-rw-r--r--source/blender/editors/mesh/editmesh.c166
-rw-r--r--source/blender/editors/mesh/editmesh_add.c15
-rw-r--r--source/blender/editors/mesh/editmesh_loop.c1
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c52
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c34
-rw-r--r--source/blender/editors/mesh/mesh_layers.c19
-rw-r--r--source/blender/editors/mesh/mesh_ops.c4
-rw-r--r--source/blender/editors/mesh/meshtools.c2
-rw-r--r--source/blender/editors/object/editconstraint.c36
-rw-r--r--source/blender/editors/object/editkey.c6
-rw-r--r--source/blender/editors/object/object_edit.c586
-rw-r--r--source/blender/editors/object/object_intern.h17
-rw-r--r--source/blender/editors/object/object_modifier.c341
-rw-r--r--source/blender/editors/object/object_ops.c23
-rw-r--r--source/blender/editors/object/object_vgroup.c7
-rw-r--r--source/blender/editors/physics/ed_fluidsim.c2
-rw-r--r--source/blender/editors/physics/ed_pointcache.c248
-rw-r--r--source/blender/editors/physics/editparticle.c2182
-rw-r--r--source/blender/editors/physics/physics_boids.c5
-rw-r--r--source/blender/editors/preview/previewrender.c31
-rw-r--r--source/blender/editors/screen/CMakeLists.txt8
-rw-r--r--source/blender/editors/screen/Makefile5
-rw-r--r--source/blender/editors/screen/SConscript2
-rw-r--r--source/blender/editors/screen/area.c80
-rw-r--r--source/blender/editors/screen/screen_context.c24
-rw-r--r--source/blender/editors/screen/screen_edit.c116
-rw-r--r--source/blender/editors/screen/screen_ops.c258
-rw-r--r--source/blender/editors/screen/screendump.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c62
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h24
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c102
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c330
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c53
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c861
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c752
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h1
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_stroke.c274
-rw-r--r--source/blender/editors/sound/Makefile51
-rw-r--r--source/blender/editors/sound/SConscript14
-rw-r--r--source/blender/editors/sound/sound_intern.h37
-rw-r--r--source/blender/editors/sound/sound_ops.c293
-rw-r--r--source/blender/editors/space_action/action_draw.c925
-rw-r--r--source/blender/editors/space_action/action_edit.c138
-rw-r--r--source/blender/editors/space_action/action_header.c51
-rw-r--r--source/blender/editors/space_action/action_intern.h3
-rw-r--r--source/blender/editors/space_action/action_ops.c2
-rw-r--r--source/blender/editors/space_action/space_action.c3
-rw-r--r--source/blender/editors/space_api/spacetypes.c8
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c36
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c12
-rw-r--r--source/blender/editors/space_console/console_ops.c18
-rw-r--r--source/blender/editors/space_console/console_report.c8
-rw-r--r--source/blender/editors/space_console/space_console.c4
-rw-r--r--source/blender/editors/space_file/Makefile4
-rw-r--r--source/blender/editors/space_file/SConscript2
-rw-r--r--source/blender/editors/space_file/file_draw.c229
-rw-r--r--source/blender/editors/space_file/file_intern.h2
-rw-r--r--source/blender/editors/space_file/file_ops.c4
-rw-r--r--source/blender/editors/space_file/file_panels.c53
-rw-r--r--source/blender/editors/space_file/filelist.c22
-rw-r--r--source/blender/editors/space_file/filesel.c1
-rw-r--r--source/blender/editors/space_file/space_file.c9
-rw-r--r--source/blender/editors/space_file/writeimage.c2
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c2
-rw-r--r--source/blender/editors/space_graph/graph_draw.c551
-rw-r--r--source/blender/editors/space_graph/graph_edit.c69
-rw-r--r--source/blender/editors/space_graph/graph_header.c30
-rw-r--r--source/blender/editors/space_graph/graph_intern.h2
-rw-r--r--source/blender/editors/space_graph/space_graph.c12
-rw-r--r--source/blender/editors/space_image/Makefile4
-rw-r--r--source/blender/editors/space_image/SConscript2
-rw-r--r--source/blender/editors/space_image/image_buttons.c16
-rw-r--r--source/blender/editors/space_image/image_draw.c44
-rw-r--r--source/blender/editors/space_image/image_intern.h1
-rw-r--r--source/blender/editors/space_image/image_ops.c12
-rw-r--r--source/blender/editors/space_image/space_image.c16
-rw-r--r--source/blender/editors/space_info/info_intern.h3
-rw-r--r--source/blender/editors/space_info/info_stats.c434
-rw-r--r--source/blender/editors/space_info/space_info.c6
-rw-r--r--source/blender/editors/space_logic/logic_window.c114
-rw-r--r--source/blender/editors/space_logic/space_logic.c7
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c117
-rw-r--r--source/blender/editors/space_nla/nla_channels.c179
-rw-r--r--source/blender/editors/space_nla/nla_draw.c626
-rw-r--r--source/blender/editors/space_nla/nla_edit.c54
-rw-r--r--source/blender/editors/space_nla/nla_header.c11
-rw-r--r--source/blender/editors/space_nla/nla_intern.h2
-rw-r--r--source/blender/editors/space_nla/space_nla.c2
-rw-r--r--source/blender/editors/space_node/drawnode.c6
-rw-r--r--source/blender/editors/space_node/node_draw.c6
-rw-r--r--source/blender/editors/space_node/node_edit.c83
-rw-r--r--source/blender/editors/space_node/node_header.c650
-rw-r--r--source/blender/editors/space_node/node_intern.h5
-rw-r--r--source/blender/editors/space_node/node_state.c6
-rw-r--r--source/blender/editors/space_node/space_node.c50
-rw-r--r--source/blender/editors/space_outliner/outliner.c95
-rw-r--r--source/blender/editors/space_outliner/outliner_header.c4
-rw-r--r--source/blender/editors/space_sequencer/Makefile1
-rw-r--r--source/blender/editors/space_sequencer/SConscript1
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c140
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c115
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c57
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c4
-rw-r--r--source/blender/editors/space_text/space_text.c8
-rw-r--r--source/blender/editors/space_text/text_header.c24
-rw-r--r--source/blender/editors/space_text/text_ops.c45
-rw-r--r--source/blender/editors/space_text/text_python.c4
-rw-r--r--source/blender/editors/space_time/space_time.c29
-rw-r--r--source/blender/editors/space_time/time_header.c612
-rw-r--r--source/blender/editors/space_userpref/Makefile55
-rw-r--r--source/blender/editors/space_userpref/SConscript14
-rw-r--r--source/blender/editors/space_userpref/space_userpref.c188
-rw-r--r--source/blender/editors/space_userpref/userpref_intern.h34
-rw-r--r--source/blender/editors/space_userpref/userpref_ops.c33
-rw-r--r--source/blender/editors/space_view3d/Makefile2
-rw-r--r--source/blender/editors/space_view3d/SConscript2
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c20
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c11
-rw-r--r--source/blender/editors/space_view3d/drawobject.c316
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c304
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c16
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c267
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c208
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c21
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c2140
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h4
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c36
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c84
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c87
-rw-r--r--source/blender/editors/transform/transform.c40
-rw-r--r--source/blender/editors/transform/transform.h1
-rw-r--r--source/blender/editors/transform/transform_conversions.c201
-rw-r--r--source/blender/editors/transform/transform_generics.c105
-rw-r--r--source/blender/editors/transform/transform_manipulator.c28
-rw-r--r--source/blender/editors/transform/transform_ops.c15
-rw-r--r--source/blender/editors/transform/transform_orientations.c11
-rw-r--r--source/blender/editors/util/undo.c21
-rw-r--r--source/blender/gpu/GPU_draw.h11
-rw-r--r--source/blender/gpu/GPU_extensions.h3
-rw-r--r--source/blender/gpu/GPU_material.h2
-rw-r--r--source/blender/gpu/SConscript2
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c4
-rw-r--r--source/blender/gpu/intern/gpu_codegen.h2
-rw-r--r--source/blender/gpu/intern/gpu_draw.c49
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c67
-rw-r--r--source/blender/gpu/intern/gpu_material.c46
-rw-r--r--source/blender/imbuf/CMakeLists.txt4
-rw-r--r--source/blender/imbuf/intern/cineon/SConscript2
-rw-r--r--source/blender/imbuf/intern/dds/SConscript2
-rw-r--r--source/blender/imbuf/intern/openexr/Makefile3
-rw-r--r--source/blender/imbuf/intern/openexr/SConscript4
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp1
-rw-r--r--source/blender/imbuf/intern/targa.c5
-rw-r--r--source/blender/makesdna/DNA_action_types.h60
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h29
-rw-r--r--source/blender/makesdna/DNA_anim_types.h11
-rw-r--r--source/blender/makesdna/DNA_brush_types.h23
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h2
-rw-r--r--source/blender/makesdna/DNA_curve_types.h17
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h4
-rw-r--r--source/blender/makesdna/DNA_material_types.h68
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h2
-rw-r--r--source/blender/makesdna/DNA_meta_types.h15
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h24
-rw-r--r--source/blender/makesdna/DNA_object_force.h35
-rw-r--r--source/blender/makesdna/DNA_object_types.h28
-rw-r--r--source/blender/makesdna/DNA_particle_types.h13
-rw-r--r--source/blender/makesdna/DNA_scene_types.h107
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h3
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h6
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h125
-rw-r--r--source/blender/makesdna/DNA_sound_types.h157
-rw-r--r--source/blender/makesdna/DNA_space_types.h13
-rw-r--r--source/blender/makesdna/DNA_texture_types.h127
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h12
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h9
-rw-r--r--source/blender/makesdna/DNA_world_types.h10
-rw-r--r--source/blender/makesdna/SConscript2
-rw-r--r--source/blender/makesdna/intern/makesdna.c7
-rw-r--r--source/blender/makesrna/RNA_access.h42
-rw-r--r--source/blender/makesrna/RNA_define.h9
-rw-r--r--source/blender/makesrna/RNA_enum_types.h12
-rw-r--r--source/blender/makesrna/RNA_types.h65
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt20
-rw-r--r--source/blender/makesrna/intern/Makefile12
-rw-r--r--source/blender/makesrna/intern/SConscript12
-rw-r--r--source/blender/makesrna/intern/makesrna.c71
-rw-r--r--source/blender/makesrna/intern/rna_ID.c28
-rw-r--r--source/blender/makesrna/intern/rna_access.c157
-rw-r--r--source/blender/makesrna/intern/rna_action.c20
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c3
-rw-r--r--source/blender/makesrna/intern/rna_animation.c62
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c89
-rw-r--r--source/blender/makesrna/intern/rna_armature.c12
-rw-r--r--source/blender/makesrna/intern/rna_brush.c96
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c2
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c97
-rw-r--r--source/blender/makesrna/intern/rna_context.c32
-rw-r--r--source/blender/makesrna/intern/rna_curve.c135
-rw-r--r--source/blender/makesrna/intern/rna_define.c120
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c42
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c18
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c252
-rw-r--r--source/blender/makesrna/intern/rna_group.c2
-rw-r--r--source/blender/makesrna/intern/rna_image.c4
-rw-r--r--source/blender/makesrna/intern/rna_internal.h8
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h11
-rw-r--r--source/blender/makesrna/intern/rna_key.c29
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c16
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c4
-rw-r--r--source/blender/makesrna/intern/rna_main.c65
-rw-r--r--source/blender/makesrna/intern/rna_material.c544
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c180
-rw-r--r--source/blender/makesrna/intern/rna_meta.c51
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c196
-rw-r--r--source/blender/makesrna/intern/rna_nla.c64
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c2
-rw-r--r--source/blender/makesrna/intern/rna_object.c182
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c186
-rw-r--r--source/blender/makesrna/intern/rna_packedfile.c7
-rw-r--r--source/blender/makesrna/intern/rna_particle.c110
-rw-r--r--source/blender/makesrna/intern/rna_pose.c229
-rw-r--r--source/blender/makesrna/intern/rna_render.c16
-rw-r--r--source/blender/makesrna/intern/rna_rna.c69
-rw-r--r--source/blender/makesrna/intern/rna_scene.c385
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c100
-rw-r--r--source/blender/makesrna/intern/rna_screen.c19
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c229
-rw-r--r--source/blender/makesrna/intern/rna_sequence.c71
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c290
-rw-r--r--source/blender/makesrna/intern/rna_sound.c176
-rw-r--r--source/blender/makesrna/intern/rna_space.c223
-rw-r--r--source/blender/makesrna/intern/rna_texture.c483
-rw-r--r--source/blender/makesrna/intern/rna_timeline.c2
-rw-r--r--source/blender/makesrna/intern/rna_ui.c12
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c33
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c158
-rw-r--r--source/blender/makesrna/intern/rna_wm.c2
-rw-r--r--source/blender/makesrna/intern/rna_world.c20
-rw-r--r--source/blender/nodes/CMakeLists.txt5
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c4
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c2
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_at.c8
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_bricks.c20
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_checker.c16
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_compose.c6
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_coord.c8
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_curves.c13
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_decompose.c18
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_distance.c6
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c12
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_image.c8
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_invert.c6
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_math.c8
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c10
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_output.c133
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_proc.c86
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_rotate.c15
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_scale.c16
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_texture.c9
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_translate.c16
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c16
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c10
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_viewer.c2
-rw-r--r--source/blender/nodes/intern/TEX_util.c116
-rw-r--r--source/blender/nodes/intern/TEX_util.h24
-rw-r--r--source/blender/python/BPY_extern.h2
-rw-r--r--source/blender/python/epy_doc_gen.py288
-rw-r--r--source/blender/python/generic/BGL.c17
-rw-r--r--source/blender/python/generic/BGL.h16
-rw-r--r--source/blender/python/generic/Geometry.c8
-rw-r--r--source/blender/python/generic/Geometry.h2
-rw-r--r--source/blender/python/generic/Makefile2
-rw-r--r--source/blender/python/generic/Mathutils.c15
-rw-r--r--source/blender/python/generic/Mathutils.h6
-rw-r--r--source/blender/python/generic/bpy_internal_import.c18
-rw-r--r--source/blender/python/generic/bpy_internal_import.h10
-rw-r--r--source/blender/python/generic/euler.c10
-rw-r--r--source/blender/python/generic/euler.h1
-rw-r--r--source/blender/python/generic/matrix.c63
-rw-r--r--source/blender/python/generic/quat.c36
-rw-r--r--source/blender/python/generic/quat.h1
-rw-r--r--source/blender/python/generic/vector.c766
-rw-r--r--source/blender/python/generic/vector.h1
-rw-r--r--source/blender/python/intern/Makefile2
-rw-r--r--source/blender/python/intern/bpy_array.c235
-rw-r--r--source/blender/python/intern/bpy_compat.h126
-rw-r--r--source/blender/python/intern/bpy_interface.c253
-rw-r--r--source/blender/python/intern/bpy_operator.c36
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c18
-rw-r--r--source/blender/python/intern/bpy_rna.c976
-rw-r--r--source/blender/python/intern/bpy_rna.h17
-rw-r--r--source/blender/python/intern/bpy_ui.c9
-rw-r--r--source/blender/python/intern/bpy_util.c46
-rw-r--r--source/blender/python/intern/bpy_util.h11
-rw-r--r--source/blender/readblenfile/SConscript2
-rw-r--r--source/blender/render/CMakeLists.txt7
-rw-r--r--source/blender/render/SConscript2
-rw-r--r--source/blender/render/extern/include/RE_pipeline.h3
-rw-r--r--source/blender/render/extern/include/RE_shader_ext.h6
-rw-r--r--source/blender/render/intern/include/pointdensity.h (renamed from intern/SoundSystem/SND_DependKludge.h)32
-rw-r--r--source/blender/render/intern/include/render_types.h47
-rw-r--r--source/blender/render/intern/include/shading.h6
-rw-r--r--source/blender/render/intern/include/texture.h1
-rw-r--r--source/blender/render/intern/include/volume_precache.h (renamed from source/gameengine/Expressions/KX_Python_dynamic.h)15
-rw-r--r--source/blender/render/intern/include/volumetric.h47
-rw-r--r--source/blender/render/intern/include/voxeldata.h (renamed from intern/SoundSystem/dummy/SND_DummyDevice.cpp)35
-rw-r--r--source/blender/render/intern/source/Makefile2
-rw-r--r--source/blender/render/intern/source/convertblender.c94
-rw-r--r--source/blender/render/intern/source/occlusion.c4
-rw-r--r--source/blender/render/intern/source/pipeline.c130
-rw-r--r--source/blender/render/intern/source/pointdensity.c484
-rw-r--r--source/blender/render/intern/source/rayshade.c84
-rw-r--r--source/blender/render/intern/source/raytrace.c2
-rw-r--r--source/blender/render/intern/source/rendercore.c6
-rw-r--r--source/blender/render/intern/source/shadeinput.c57
-rw-r--r--source/blender/render/intern/source/shadeoutput.c7
-rw-r--r--source/blender/render/intern/source/strand.c4
-rw-r--r--source/blender/render/intern/source/texture.c198
-rw-r--r--source/blender/render/intern/source/volume_precache.c746
-rw-r--r--source/blender/render/intern/source/volumetric.c698
-rw-r--r--source/blender/render/intern/source/voxeldata.c346
-rw-r--r--source/blender/render/intern/source/zbuf.c12
-rw-r--r--source/blender/windowmanager/CMakeLists.txt10
-rw-r--r--source/blender/windowmanager/WM_api.h5
-rw-r--r--source/blender/windowmanager/WM_types.h16
-rw-r--r--source/blender/windowmanager/intern/Makefile3
-rw-r--r--source/blender/windowmanager/intern/wm.c6
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c107
-rw-r--r--source/blender/windowmanager/intern/wm_files.c64
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c53
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c85
-rw-r--r--source/blender/windowmanager/intern/wm_window.c27
-rw-r--r--source/blender/windowmanager/wm_window.h1
-rw-r--r--source/blenderplayer/CMakeLists.txt (renamed from blenderplayer/CMakeLists.txt)36
-rw-r--r--source/blenderplayer/bad_level_call_stubs/CMakeLists.txt40
-rw-r--r--source/blenderplayer/bad_level_call_stubs/Makefile45
-rw-r--r--source/blenderplayer/bad_level_call_stubs/SConscript13
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c200
-rw-r--r--source/creator/CMakeLists.txt319
-rw-r--r--source/creator/Makefile1
-rw-r--r--source/creator/creator.c80
-rw-r--r--source/darwin/Makefile5
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp49
-rw-r--r--source/gameengine/BlenderRoutines/CMakeLists.txt6
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.h11
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.cpp34
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.h4
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h10
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h11
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h11
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp8
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h11
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderSystem.h12
-rw-r--r--source/gameengine/BlenderRoutines/Makefile2
-rw-r--r--source/gameengine/BlenderRoutines/SConscript10
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp491
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.h25
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.cpp2
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.h7
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp108
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.h4
-rw-r--r--source/gameengine/Converter/BL_DeformableGameObject.h7
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.h7
-rw-r--r--source/gameengine/Converter/BL_ModifierDeformer.h6
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.cpp438
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.h23
-rw-r--r--source/gameengine/Converter/BL_ShapeDeformer.cpp4
-rw-r--r--source/gameengine/Converter/BL_ShapeDeformer.h6
-rw-r--r--source/gameengine/Converter/BL_SkinDeformer.h6
-rw-r--r--source/gameengine/Converter/BL_SkinMeshObject.cpp4
-rw-r--r--source/gameengine/Converter/BL_SkinMeshObject.h9
-rw-r--r--source/gameengine/Converter/BlenderWorldInfo.h7
-rw-r--r--source/gameengine/Converter/CMakeLists.txt10
-rw-r--r--source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp2
-rw-r--r--source/gameengine/Converter/KX_BlenderScalarInterpolator.h16
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp101
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.h27
-rw-r--r--source/gameengine/Converter/KX_ConvertActuators.cpp199
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.cpp11
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.h1
-rw-r--r--source/gameengine/Converter/KX_IpoConvert.cpp2
-rw-r--r--source/gameengine/Converter/Makefile4
-rw-r--r--source/gameengine/Converter/SConscript5
-rw-r--r--source/gameengine/Expressions/BoolValue.h7
-rw-r--r--source/gameengine/Expressions/ConstExpr.h7
-rw-r--r--source/gameengine/Expressions/EmptyValue.h7
-rw-r--r--source/gameengine/Expressions/ErrorValue.h7
-rw-r--r--source/gameengine/Expressions/Expression.h13
-rw-r--r--source/gameengine/Expressions/FloatValue.h6
-rw-r--r--source/gameengine/Expressions/IdentifierExpr.h7
-rw-r--r--source/gameengine/Expressions/IfExpr.h7
-rw-r--r--source/gameengine/Expressions/InputParser.h8
-rw-r--r--source/gameengine/Expressions/IntValue.h6
-rw-r--r--source/gameengine/Expressions/KX_HashedPtr.h11
-rw-r--r--source/gameengine/Expressions/KX_Python.h11
-rw-r--r--source/gameengine/Expressions/ListValue.cpp24
-rw-r--r--source/gameengine/Expressions/ListValue.h1
-rw-r--r--source/gameengine/Expressions/Operator1Expr.h7
-rw-r--r--source/gameengine/Expressions/Operator2Expr.h8
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp85
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h61
-rw-r--r--source/gameengine/Expressions/SConscript8
-rw-r--r--source/gameengine/Expressions/StringValue.h7
-rw-r--r--source/gameengine/Expressions/Value.cpp27
-rw-r--r--source/gameengine/Expressions/Value.h21
-rw-r--r--source/gameengine/Expressions/VectorValue.h7
-rw-r--r--source/gameengine/Expressions/VoidValue.h7
-rw-r--r--source/gameengine/GameLogic/CMakeLists.txt2
-rw-r--r--source/gameengine/GameLogic/SCA_2DFilterActuator.cpp42
-rw-r--r--source/gameengine/GameLogic/SCA_ANDController.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorEventManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorSensor.cpp47
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorSensor.h5
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysEventManager.h5
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysSensor.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_DelaySensor.cpp103
-rw-r--r--source/gameengine/GameLogic/SCA_DelaySensor.h8
-rw-r--r--source/gameengine/GameLogic/SCA_EventManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_ExpressionController.h7
-rw-r--r--source/gameengine/GameLogic/SCA_IActuator.h7
-rw-r--r--source/gameengine/GameLogic/SCA_IController.cpp128
-rw-r--r--source/gameengine/GameLogic/SCA_IController.h6
-rw-r--r--source/gameengine/GameLogic/SCA_IInputDevice.h10
-rw-r--r--source/gameengine/GameLogic/SCA_ILogicBrick.cpp51
-rw-r--r--source/gameengine/GameLogic/SCA_ILogicBrick.h4
-rw-r--r--source/gameengine/GameLogic/SCA_IObject.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_IScene.h13
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.cpp197
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.h15
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.h6
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.cpp288
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.h21
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardSensor.cpp205
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardSensor.h21
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_MouseSensor.cpp39
-rw-r--r--source/gameengine/GameLogic/SCA_MouseSensor.h8
-rw-r--r--source/gameengine/GameLogic/SCA_NANDController.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_NORController.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_ORController.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyActuator.cpp79
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyActuator.h8
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyEventManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_PropertySensor.cpp121
-rw-r--r--source/gameengine/GameLogic/SCA_PropertySensor.h12
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp94
-rw-r--r--source/gameengine/GameLogic/SCA_RandomActuator.cpp113
-rw-r--r--source/gameengine/GameLogic/SCA_RandomActuator.h10
-rw-r--r--source/gameengine/GameLogic/SCA_RandomEventManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_RandomNumberGenerator.h11
-rw-r--r--source/gameengine/GameLogic/SCA_RandomSensor.cpp50
-rw-r--r--source/gameengine/GameLogic/SCA_RandomSensor.h7
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.h7
-rw-r--r--source/gameengine/GameLogic/SCA_XNORController.cpp6
-rw-r--r--source/gameengine/GameLogic/SCA_XORController.cpp6
-rw-r--r--source/gameengine/GameLogic/SConscript6
-rw-r--r--source/gameengine/GamePlayer/common/CMakeLists.txt4
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Engine.cpp11
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Engine.h3
-rw-r--r--source/gameengine/GamePlayer/common/Makefile3
-rw-r--r--source/gameengine/GamePlayer/common/SConscript9
-rw-r--r--source/gameengine/GamePlayer/common/unix/Makefile2
-rw-r--r--source/gameengine/GamePlayer/common/windows/Makefile1
-rw-r--r--source/gameengine/GamePlayer/ghost/CMakeLists.txt4
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp41
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.h3
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp3
-rw-r--r--source/gameengine/GamePlayer/ghost/Makefile1
-rw-r--r--source/gameengine/GamePlayer/ghost/SConscript13
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.cpp2
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.h7
-rw-r--r--source/gameengine/Ketsji/BL_Material.h11
-rw-r--r--source/gameengine/Ketsji/BL_Shader.cpp42
-rw-r--r--source/gameengine/Ketsji/BL_Shader.h20
-rw-r--r--source/gameengine/Ketsji/BL_Texture.h6
-rw-r--r--source/gameengine/Ketsji/CMakeLists.txt7
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp91
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h7
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp96
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h9
-rw-r--r--source/gameengine/Ketsji/KXNetwork/SConscript9
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.cpp51
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h7
-rw-r--r--source/gameengine/Ketsji/KX_BulletPhysicsController.h7
-rw-r--r--source/gameengine/Ketsji/KX_CDActuator.cpp295
-rw-r--r--source/gameengine/Ketsji/KX_CDActuator.h101
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp146
-rw-r--r--source/gameengine/Ketsji/KX_Camera.h3
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.cpp175
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.h12
-rw-r--r--source/gameengine/Ketsji/KX_CameraIpoSGController.h7
-rw-r--r--source/gameengine/Ketsji/KX_ClientObjectInfo.h7
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.cpp349
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.h22
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.cpp42
-rw-r--r--source/gameengine/Ketsji/KX_Dome.h11
-rw-r--r--source/gameengine/Ketsji/KX_EmptyObject.h8
-rw-r--r--source/gameengine/Ketsji/KX_GameActuator.cpp79
-rw-r--r--source/gameengine/Ketsji/KX_GameActuator.h5
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp282
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h31
-rw-r--r--source/gameengine/Ketsji/KX_IInterpolator.h11
-rw-r--r--source/gameengine/Ketsji/KX_IPO_SGController.h6
-rw-r--r--source/gameengine/Ketsji/KX_IPhysicsController.h7
-rw-r--r--source/gameengine/Ketsji/KX_IScalarInterpolator.h11
-rw-r--r--source/gameengine/Ketsji/KX_ISceneConverter.h14
-rw-r--r--source/gameengine/Ketsji/KX_ISystem.h11
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.cpp282
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.h31
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp72
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h10
-rw-r--r--source/gameengine/Ketsji/KX_Light.cpp54
-rw-r--r--source/gameengine/Ketsji/KX_LightIpoSGController.h7
-rw-r--r--source/gameengine/Ketsji/KX_MaterialIpoController.h7
-rw-r--r--source/gameengine/Ketsji/KX_MeshProxy.cpp26
-rw-r--r--source/gameengine/Ketsji/KX_MotionState.h10
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.cpp97
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.h17
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.h3
-rw-r--r--source/gameengine/Ketsji/KX_ObColorIpoSGController.h7
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.cpp337
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.h23
-rw-r--r--source/gameengine/Ketsji/KX_OrientationInterpolator.h7
-rw-r--r--source/gameengine/Ketsji/KX_ParentActuator.cpp61
-rw-r--r--source/gameengine/Ketsji/KX_ParentActuator.h5
-rw-r--r--source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp42
-rw-r--r--source/gameengine/Ketsji/KX_PolyProxy.cpp16
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.cpp53
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.h5
-rw-r--r--source/gameengine/Ketsji/KX_PositionInterpolator.h7
-rw-r--r--source/gameengine/Ketsji/KX_PyConstraintBinding.cpp49
-rw-r--r--source/gameengine/Ketsji/KX_PyMath.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_PyMath.h9
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp252
-rw-r--r--source/gameengine/Ketsji/KX_PythonInitTypes.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_PythonSeq.cpp49
-rw-r--r--source/gameengine/Ketsji/KX_RadarSensor.cpp64
-rw-r--r--source/gameengine/Ketsji/KX_RadarSensor.h8
-rw-r--r--source/gameengine/Ketsji/KX_RayCast.h14
-rw-r--r--source/gameengine/Ketsji/KX_RayEventManager.h7
-rw-r--r--source/gameengine/Ketsji/KX_RaySensor.cpp77
-rw-r--r--source/gameengine/Ketsji/KX_RaySensor.h6
-rw-r--r--source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp215
-rw-r--r--source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h19
-rw-r--r--source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp45
-rw-r--r--source/gameengine/Ketsji/KX_SCA_DynamicActuator.h5
-rw-r--r--source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp55
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h15
-rw-r--r--source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h7
-rw-r--r--source/gameengine/Ketsji/KX_SG_NodeRelationships.h19
-rw-r--r--source/gameengine/Ketsji/KX_ScalarInterpolator.h7
-rw-r--r--source/gameengine/Ketsji/KX_ScalingInterpolator.h7
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp237
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h52
-rw-r--r--source/gameengine/Ketsji/KX_SceneActuator.cpp163
-rw-r--r--source/gameengine/Ketsji/KX_SceneActuator.h16
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp710
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.h76
-rw-r--r--source/gameengine/Ketsji/KX_StateActuator.cpp61
-rw-r--r--source/gameengine/Ketsji/KX_StateActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_TimeCategoryLogger.h6
-rw-r--r--source/gameengine/Ketsji/KX_TimeLogger.h11
-rw-r--r--source/gameengine/Ketsji/KX_TouchEventManager.h6
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.cpp114
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.h18
-rw-r--r--source/gameengine/Ketsji/KX_TrackToActuator.cpp133
-rw-r--r--source/gameengine/Ketsji/KX_TrackToActuator.h13
-rw-r--r--source/gameengine/Ketsji/KX_VehicleWrapper.cpp42
-rw-r--r--source/gameengine/Ketsji/KX_VertexProxy.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_VisibilityActuator.cpp33
-rw-r--r--source/gameengine/Ketsji/KX_VisibilityActuator.h5
-rw-r--r--source/gameengine/Ketsji/KX_WorldInfo.h11
-rw-r--r--source/gameengine/Ketsji/KX_WorldIpoController.h7
-rw-r--r--source/gameengine/Ketsji/Makefile6
-rw-r--r--source/gameengine/Ketsji/SConscript9
-rw-r--r--source/gameengine/Makefile2
-rw-r--r--source/gameengine/Network/LoopBackNetwork/SConscript2
-rw-r--r--source/gameengine/Network/NG_NetworkDeviceInterface.h7
-rw-r--r--source/gameengine/Network/NG_NetworkMessage.h11
-rw-r--r--source/gameengine/Network/NG_NetworkObject.h11
-rw-r--r--source/gameengine/Network/NG_NetworkScene.h13
-rw-r--r--source/gameengine/Network/SConscript2
-rw-r--r--source/gameengine/Physics/Bullet/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/Bullet/CcdGraphicController.h6
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp4
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.h23
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp4
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h6
-rw-r--r--source/gameengine/Physics/Bullet/Makefile1
-rw-r--r--source/gameengine/Physics/Bullet/SConscript9
-rw-r--r--source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h6
-rw-r--r--source/gameengine/Physics/Dummy/Makefile2
-rw-r--r--source/gameengine/Physics/Dummy/SConscript2
-rw-r--r--source/gameengine/Physics/common/Makefile3
-rw-r--r--source/gameengine/Physics/common/PHY_IController.h11
-rw-r--r--source/gameengine/Physics/common/PHY_IGraphicController.h7
-rw-r--r--source/gameengine/Physics/common/PHY_IMotionState.h14
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsController.h6
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h18
-rw-r--r--source/gameengine/Physics/common/PHY_IVehicle.h11
-rw-r--r--source/gameengine/Physics/common/SConscript8
-rw-r--r--source/gameengine/PyDoc/GameLogic.py9
-rw-r--r--source/gameengine/PyDoc/GameTypes.py94
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.h11
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp9
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.h6
-rw-r--r--source/gameengine/Rasterizer/RAS_Deformer.h10
-rw-r--r--source/gameengine/Rasterizer/RAS_FramingManager.h19
-rw-r--r--source/gameengine/Rasterizer/RAS_ICanvas.h11
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp18
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.h19
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h12
-rw-r--r--source/gameengine/Rasterizer/RAS_IRenderTools.h11
-rw-r--r--source/gameengine/Rasterizer/RAS_MaterialBucket.h23
-rw-r--r--source/gameengine/Rasterizer/RAS_MeshObject.cpp5
-rw-r--r--source/gameengine/Rasterizer/RAS_MeshObject.h10
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h7
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h7
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h6
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript8
-rw-r--r--source/gameengine/Rasterizer/RAS_Polygon.cpp15
-rw-r--r--source/gameengine/Rasterizer/RAS_Polygon.h11
-rw-r--r--source/gameengine/Rasterizer/RAS_Rect.h10
-rw-r--r--source/gameengine/Rasterizer/RAS_TexVert.h10
-rw-r--r--source/gameengine/Rasterizer/SConscript8
-rw-r--r--source/gameengine/SceneGraph/SConscript8
-rw-r--r--source/gameengine/SceneGraph/SG_BBox.h10
-rw-r--r--source/gameengine/SceneGraph/SG_Controller.h6
-rw-r--r--source/gameengine/SceneGraph/SG_DList.h11
-rw-r--r--source/gameengine/SceneGraph/SG_IObject.h7
-rw-r--r--source/gameengine/SceneGraph/SG_Node.h7
-rw-r--r--source/gameengine/SceneGraph/SG_ParentRelation.h8
-rw-r--r--source/gameengine/SceneGraph/SG_QList.h7
-rw-r--r--source/gameengine/SceneGraph/SG_Spatial.h7
-rw-r--r--source/gameengine/SceneGraph/SG_Tree.h13
-rw-r--r--source/gameengine/VideoTexture/CMakeLists.txt1
-rw-r--r--source/gameengine/VideoTexture/Exception.cpp8
-rw-r--r--source/gameengine/VideoTexture/FilterBlueScreen.cpp6
-rw-r--r--source/gameengine/VideoTexture/FilterColor.cpp18
-rw-r--r--source/gameengine/VideoTexture/FilterNormal.cpp6
-rw-r--r--source/gameengine/VideoTexture/FilterSource.cpp18
-rw-r--r--source/gameengine/VideoTexture/ImageBase.cpp8
-rw-r--r--source/gameengine/VideoTexture/ImageBuff.cpp6
-rw-r--r--source/gameengine/VideoTexture/ImageMix.cpp6
-rw-r--r--source/gameengine/VideoTexture/ImageRender.cpp12
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.cpp6
-rw-r--r--source/gameengine/VideoTexture/Makefile1
-rw-r--r--source/gameengine/VideoTexture/SConscript10
-rw-r--r--source/gameengine/VideoTexture/Texture.cpp6
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp12
-rw-r--r--source/gameengine/VideoTexture/blendVideoTex.cpp9
-rw-r--r--source/icons/SConscript2
-rw-r--r--source/kernel/SConscript2
-rw-r--r--source/kernel/gen_system/SYS_SingletonSystem.cpp2
-rw-r--r--source/kernel/gen_system/SYS_SingletonSystem.h1
-rw-r--r--source/nan_compile.mk6
-rw-r--r--source/nan_definitions.mk120
-rw-r--r--source/nan_link.mk46
-rw-r--r--tools/Blender.py74
-rwxr-xr-xtools/btools.py36
1214 files changed, 92353 insertions, 46979 deletions
diff --git a/CMake/macros.cmake b/CMake/macros.cmake
index eee51df6377..739e062f705 100644
--- a/CMake/macros.cmake
+++ b/CMake/macros.cmake
@@ -42,11 +42,28 @@ MACRO(SETUP_LIBDIRS)
if(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
- LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
- LINK_DIRECTORIES(${FREETYPE_LIBPATH})
+
+ LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
+
+ IF(WITH_PYTHON)
+ LINK_DIRECTORIES(${PYTHON_LIBPATH})
+ ENDIF(WITH_PYTHON)
IF(WITH_INTERNATIONAL)
+ LINK_DIRECTORIES(${ICONV_LIBPATH})
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
ENDIF(WITH_INTERNATIONAL)
+ IF(WITH_SDL)
+ LINK_DIRECTORIES(${SDL_LIBPATH})
+ ENDIF(WITH_SDL)
+ IF(WITH_FFMPEG)
+ LINK_DIRECTORIES(${FFMPEG_LIBPATH})
+ ENDIF(WITH_FFMPEG)
+ IF(WITH_OPENEXR)
+ LINK_DIRECTORIES(${OPENEXR_LIBPATH})
+ ENDIF(WITH_OPENEXR)
+ IF(WITH_QUICKTIME)
+ LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
+ ENDIF(WITH_QUICKTIME)
IF(WITH_OPENAL)
LINK_DIRECTORIES(${OPENAL_LIBPATH})
ENDIF(WITH_OPENAL)
@@ -55,6 +72,15 @@ MACRO(SETUP_LIBDIRS)
LINK_DIRECTORIES(${PCRE_LIBPATH})
LINK_DIRECTORIES(${EXPAT_LIBPATH})
ENDIF(WITH_OPENCOLLADA)
+ IF(WITH_JACK)
+ LINK_DIRECTORIES(${JACK_LIBPATH})
+ ENDIF(WITH_JACK)
+ IF(WITH_SNDFILE)
+ LINK_DIRECTORIES(${SNDFILE_LIBPATH})
+ ENDIF(WITH_SNDFILE)
+ IF(WITH_FFTW3)
+ LINK_DIRECTORIES(${FFTW3_LIBPATH})
+ ENDIF(WITH_FFTW3)
IF(WIN32)
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
@@ -64,48 +90,48 @@ ENDMACRO(SETUP_LIBDIRS)
MACRO(SETUP_LIBLINKS
target)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
- #TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
+ #TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIBRARY} ${LLIBS})
- TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIB} ${LLIBS})
+ TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
-
IF(WIN32)
-
- TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
-
- TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
-
+ TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
+ TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
ELSE(WIN32)
-
- TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
-
+ TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32)
-
-
- TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
- TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB})
+
+ TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${LLIBS})
+ TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
IF(WIN32)
-
- TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
-
- TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
-
- ELSE(WIN32)
-
- TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
-
+ TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
+ TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
+ ELSE(WIN32)
+ TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
ENDIF(WIN32)
IF(WITH_INTERNATIONAL)
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
ENDIF(WITH_INTERNATIONAL)
IF(WITH_OPENAL)
- TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIB})
+ TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
ENDIF(WITH_OPENAL)
+ IF(WITH_FFTW3)
+ TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
+ ENDIF(WITH_FFTW3)
+ IF(WITH_JACK)
+ TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
+ ENDIF(WITH_JACK)
+ IF(WITH_SNDFILE)
+ TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB})
+ ENDIF(WITH_SNDFILE)
+ IF(WITH_SDL)
+ TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
+ ENDIF(WITH_SDL)
IF(WIN32)
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
ENDIF(WIN32)
@@ -127,3 +153,4 @@ MACRO(SETUP_LIBLINKS
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
ENDIF(WIN32)
ENDMACRO(SETUP_LIBLINKS)
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd8d67c1dca..483fc64988f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,21 +53,27 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
#-----------------------------------------------------------------------------
# Set default config options
-OPTION(WITH_PLAYER "Build Player" OFF)
-OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
-OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
-OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
-OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
-OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
-OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
-OPTION(WITH_DDS "Enable DDS Support" ON)
-OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
-OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
-OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
-OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
-OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
-OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
-OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
+OPTION(WITH_PLAYER "Build Player" OFF)
+OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
+OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
+OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
+OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
+OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
+OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
+OPTION(WITH_DDS "Enable DDS Support" ON)
+OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
+OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
+OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
+OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
+OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
+OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
+OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
+OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF)
+OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
+OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
+OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
+# OPTION(WITH_BUILDINFO "Include extra build details" ON)
+OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
@@ -94,13 +100,25 @@ IF(UNIX AND NOT APPLE)
FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND)
SET(WITH_OPENAL ON)
- SET(OPENAL_LIB ${OPENAL_LIBRARY})
- SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
ELSE(OPENAL_FOUND)
SET(WITH_OPENAL OFF)
ENDIF(OPENAL_FOUND)
ENDIF(WITH_OPENAL)
+ IF(WITH_JACK)
+ SET(JACK /usr)
+ SET(JACK_INC ${JACK}/include/jack)
+ SET(JACK_LIB jack)
+ SET(JACK_LIBPATH ${JACK}/lib)
+ ENDIF(WITH_JACK)
+
+ IF(WITH_SNDFILE)
+ SET(SNDFILE /usr)
+ SET(SNDFILE_INC ${SNDFILE}/include)
+ SET(SNDFILE_LIB sndfile)
+ SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
+ ENDIF(WITH_SNDFILE)
+
FIND_LIBRARY(INTL_LIBRARY
NAMES intl
PATHS
@@ -111,34 +129,34 @@ IF(UNIX AND NOT APPLE)
PATHS
/sw/lib
)
+
IF(INTL_LIBRARY AND ICONV_LIBRARY)
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
-
- FIND_PATH(FREETYPE_INC
- freetype
- PATHS
- /usr/local/include/freetype2
- /usr/include/freetype2
- /sw/include/freetype2
- /opt/local/include/freetype2
- /opt/csw/include/freetype2
- /opt/include/freetype2
- NO_DEFAULT_PATH
- )
- SET(FREETYPE_LIB freetype)
- FIND_PACKAGE(PythonLibs)
- SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
- SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
- FIND_PACKAGE(PythonInterp)
- SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
+ FIND_PACKAGE(Freetype)
+ # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
+
+ # No way to set py31. remove for now.
+ # FIND_PACKAGE(PythonLibs)
+ SET(PYTHON /usr)
+ SET(PYTHON_VERSION 3.1)
+ SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
+ # SET(PYTHON_BINARY python) # not used yet
+ SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
+ SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
+
+ # FIND_PACKAGE(PythonInterp) # not used yet
+ # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
+
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
IF(WITH_SDL)
FIND_PACKAGE(SDL)
- SET(SDL_INC ${SDL_INCLUDE_DIR})
- SET(SDL_LIB ${SDL_LIBRARY})
+ # UNSET(SDLMAIN_LIBRARY CACHE)
+ IF(NOT SDL_FOUND)
+ SET(WITH_SDL OFF)
+ ENDIF(NOT SDL_FOUND)
ENDIF(WITH_SDL)
IF(WITH_OPENCOLLADA)
@@ -170,6 +188,18 @@ IF(UNIX AND NOT APPLE)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+
+ IF(WITH_FFTW3)
+ SET(FFTW3 /usr)
+ SET(FFTW3_INC ${FFTW3}/include)
+ SET(FFTW3_LIB fftw3)
+ SET(FFTW3_LIBPATH ${FFTW3}/lib)
+ ENDIF(WITH_FFTW3)
+
+ SET(LIBSAMPLERATE /usr)
+ SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
+ SET(LIBSAMPLERATE_LIB samplerate)
+ SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
FIND_PACKAGE(JPEG REQUIRED)
@@ -177,7 +207,13 @@ IF(UNIX AND NOT APPLE)
FIND_PACKAGE(ZLIB REQUIRED)
- SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11 -ldl")
+ # Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too
+ SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11")
+
+ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # BSD's dont use libdl.so
+ SET(LLIBS "${LLIBS} -ldl")
+ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(WITH_OPENMP)
SET(LLIBS "${LLIBS} -lgomp")
@@ -191,7 +227,8 @@ IF(UNIX AND NOT APPLE)
SET(PLATFORM_LINKFLAGS "-pthread")
# Better warnings
- SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement")
+ SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement")
+ SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
ENDIF(UNIX AND NOT APPLE)
@@ -210,10 +247,10 @@ IF(WIN32)
ENDIF(CMAKE_CL_64)
SET(PYTHON ${LIBDIR}/python)
- SET(PYTHON_VERSION 2.6)
+ SET(PYTHON_VERSION 3.1)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
- SET(PYTHON_BINARY python)
- SET(PYTHON_LIB python26)
+ # SET(PYTHON_BINARY python) # not used yet
+ SET(PYTHON_LIB python31)
SET(PYTHON_LIBPATH ${PYTHON}/lib)
IF(CMAKE_CL_64)
@@ -221,13 +258,27 @@ IF(WIN32)
ELSE(CMAKE_CL_64)
#SET(WITH_OPENAL ON)
SET(OPENAL ${LIBDIR}/openal)
- SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
- SET(OPENAL_LIB openal_static)
+ SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
+ SET(OPENAL_LIBRARY wrap_oal)
SET(OPENAL_LIBPATH ${OPENAL}/lib)
ENDIF(CMAKE_CL_64)
+ IF(WITH_JACK)
+ SET(JACK ${LIBDIR}/jack)
+ SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
+ SET(JACK_LIB libjack)
+ SET(JACK_LIBPATH ${JACK}/lib)
+ ENDIF(WITH_JACK)
+
+ IF(WITH_SNDFILE)
+ SET(SNDFILE ${LIBDIR}/sndfile)
+ SET(SNDFILE_INC ${SNDFILE}/include)
+ SET(SNDFILE_LIB libsndfile-1)
+ SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
+ ENDIF(WITH_SNDFILE)
+
IF(CMAKE_CL_64)
- SET(PNG_LIBRARIES libpng)
+ SET(PNG_LIBRARIES libpng)
ELSE(CMAKE_CL_64)
SET(PNG_LIBRARIES libpng_st)
ENDIF(CMAKE_CL_64)
@@ -235,7 +286,11 @@ IF(WIN32)
SET(ZLIB ${LIBDIR}/zlib)
SET(ZLIB_INC ${ZLIB}/include)
- SET(ZLIB_LIBRARIES zlib)
+ IF(CMAKE_CL_64)
+ SET(ZLIB_LIBRARIES libz)
+ ELSE(CMAKE_CL_64)
+ SET(ZLIB_LIBRARIES zlib)
+ ENDIF(CMAKE_CL_64)
SET(ZLIB_LIBPATH ${ZLIB}/lib)
SET(PTHREADS ${LIBDIR}/pthreads)
@@ -248,30 +303,37 @@ IF(WIN32)
SET(ICONV_LIB iconv)
SET(ICONV_LIBPATH ${ICONV}/lib)
+ IF(WITH_FFTW3)
+ SET(FFTW3 ${LIBDIR}/fftw3)
+ SET(FFTW3_INC ${FFTW3}/include)
+ SET(FFTW3_LIB libfftw)
+ SET(FFTW3_LIBPATH ${FFTW3}/lib)
+ ENDIF(WITH_FFTW3)
+
SET(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC ${GETTEXT}/include)
IF(CMAKE_CL_64)
- SET(GETTEXT_LIB gettextlib)
+ SET(GETTEXT_LIB gettext)
ELSE(CMAKE_CL_64)
- SET(GETTEXT_LIB gnu_gettext)
+ SET(GETTEXT_LIB gnu_gettext)
ENDIF(CMAKE_CL_64)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
SET(FREETYPE ${LIBDIR}/freetype)
- SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
+ SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
- SET(FREETYPE_LIB freetype2ST)
+ SET(FREETYPE_LIBRARY freetype2ST)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
IF (MSVC80)
- SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
+ SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
ELSE (MSVC80)
- SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
+ SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
ENDIF(MSVC80)
IF (MSVC90)
- SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
+ SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
ENDIF(MSVC90)
@@ -281,19 +343,20 @@ IF(WIN32)
SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
SET(FFMPEG ${LIBDIR}/ffmpeg)
- SET(FFMPEG_INC ${FFMPEG}/include)
+ SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+ SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
+ SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
+ SET(LIBSAMPLERATE_LIB libsamplerate)
+ SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+
IF(CMAKE_CL_64)
- SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
+ SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
ELSE(CMAKE_CL_64)
- SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
+ SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
ENDIF(CMAKE_CL_64)
-
- IF(WITH_OPENAL)
- SET(LLIBS ${LLIBS} dxguid)
- ENDIF(WITH_OPENAL)
SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
@@ -310,8 +373,8 @@ IF(WIN32)
ENDIF(WITH_OPENMP)
SET(SDL ${LIBDIR}/sdl)
- SET(SDL_INC ${SDL}/include)
- SET(SDL_LIB SDL)
+ SET(SDL_INCLUDE_DIR ${SDL}/include)
+ SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib)
SET(PNG "${LIBDIR}/png")
@@ -328,10 +391,11 @@ IF(WIN32)
SET(WINTAB_INC ${LIBDIR}/wintab/include)
IF(CMAKE_CL_64)
- SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
+ SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
ELSE(CMAKE_CL_64)
- SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
+ SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
ENDIF(CMAKE_CL_64)
+
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
ENDIF(WIN32)
@@ -346,13 +410,24 @@ IF(APPLE)
FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND)
SET(WITH_OPENAL ON)
- SET(OPENAL_LIB ${OPENAL_LIBRARY})
- SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
ELSE(OPENAL_FOUND)
SET(WITH_OPENAL OFF)
ENDIF(OPENAL_FOUND)
ENDIF(WITH_OPENAL)
+ IF(WITH_JACK)
+ SET(JACK /usr)
+ SET(JACK_INC ${JACK}/include/jack)
+ SET(JACK_LIB jack)
+ SET(JACK_LIBPATH ${JACK}/lib)
+ ENDIF(WITH_JACK)
+
+ IF(WITH_SNDFILE)
+ SET(SNDFILE /usr)
+ SET(SNDFILE_INC ${SNDFILE}/include)
+ SET(SNDFILE_LIB sndfile)
+ SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
+ ENDIF(WITH_SNDFILE)
SET(PYTHON_VERSION 3.1)
@@ -361,7 +436,7 @@ IF(APPLE)
SET(PYTHON ${LIBDIR}/python)
SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
- SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "")
+ # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") # not used yet
SET(PYTHON_LIB python${PYTHON_VERSION})
SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "")
# SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
@@ -371,7 +446,7 @@ IF(APPLE)
SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
SET(PYTHON_VERSION 2.5)
SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
- SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
+ # SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet
SET(PYTHON_LIB "")
SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
@@ -381,6 +456,13 @@ IF(APPLE)
SET(GETTEXT_INC "${GETTEXT}/include")
SET(GETTEXT_LIB intl iconv)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
+
+ IF(WITH_FFTW3)
+ SET(FFTW3 ${LIBDIR}/fftw3)
+ SET(FFTW3_INC ${FFTW3}/include)
+ SET(FFTW3_LIB libfftw)
+ SET(FFTW3_LIBPATH ${FFTW3}/lib)
+ ENDIF(WITH_FFTW3)
SET(PNG_LIBRARIES png)
SET(JPEG_LIBRARY jpeg)
@@ -390,19 +472,25 @@ IF(APPLE)
SET(ZLIB_LIBRARIES z)
SET(FREETYPE ${LIBDIR}/freetype)
- SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
+ SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
- SET(FREETYPE_LIB freetype)
+ SET(FREETYPE_LIBRARY freetype)
SET(OPENEXR ${LIBDIR}/openexr)
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
- IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
- SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
- ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
- SET(OPENEXR_LIB Iex Half IlmImf Imath)
- ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+ SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
+ SET(FFMPEG ${LIBDIR}/ffmpeg)
+ SET(FFMPEG_INC ${CMAKE_SOURCE_DIR}/extern/ffmpeg)
+ SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore)
+ SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+
+ SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
+ SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
+ SET(LIBSAMPLERATE_LIB samplerate)
+ SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
+
SET(LLIBS stdc++ SystemStubs)
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
@@ -415,8 +503,8 @@ IF(APPLE)
ENDIF(WITH_OPENMP)
SET(SDL ${LIBDIR}/sdl)
- SET(SDL_INC ${SDL}/include)
- SET(SDL_LIB SDL)
+ SET(SDL_INCLUDE_DIR ${SDL}/include)
+ SET(SDL_LIBRARY SDL)
SET(SDL_LIBPATH ${SDL}/lib)
SET(PNG "${LIBDIR}/png")
@@ -438,6 +526,17 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(BINRELOC_INC ${BINRELOC}/include)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+
+# TODO - buildinfo
+# IF(UNIX)
+# IF(WITH_BUILDINFO)
+# EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
+# EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)
+# EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
+# SET(BUILD_TYPE ${CMAKE_BUILD_TYPE})
+# ENDIF(WITH_BUILDINFO)
+# ENDIF(UNIX)
+
#-----------------------------------------------------------------------------
# Common.
@@ -460,16 +559,18 @@ ENDIF(WITH_WEBPLUGIN)
# Configure OpenGL.
FIND_PACKAGE(OpenGL)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
+# UNSET(OPENGL_LIBRARIES CACHE) # not compat with older cmake
+# UNSET(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
+
#-----------------------------------------------------------------------------
# Extra compile flags
-IF(WITH_GAMEENGINE)
- SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
-ENDIF(WITH_GAMEENGINE)
-IF(WITH_BULLET)
- SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
-ENDIF(WITH_BULLET)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
+
+# better not define flags here but this is a debugging option thats off by default.
+IF(WITH_CXX_GUARDEDALLOC)
+ SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}")
+ENDIF(WITH_CXX_GUARDEDALLOC)
#-----------------------------------------------------------------------------
# Libraries
@@ -487,5 +588,6 @@ ADD_SUBDIRECTORY(source/creator)
#-----------------------------------------------------------------------------
# Blender Player
IF(WITH_PLAYER)
- ADD_SUBDIRECTORY(blenderplayer)
+ ADD_SUBDIRECTORY(source/blenderplayer)
ENDIF(WITH_PLAYER)
+
diff --git a/SConstruct b/SConstruct
index b85bc799ea5..f322ae27e06 100644
--- a/SConstruct
+++ b/SConstruct
@@ -31,6 +31,7 @@
import platform as pltfrm
+# Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
if pltfrm.architecture()[0] == '64bit':
bitness = 64
else:
@@ -59,7 +60,6 @@ B = tools.Blender
platform = sys.platform
quickie = None
quickdebug = None
-nsis_build = None
##### BEGIN SETUP #####
@@ -207,7 +207,6 @@ if env['WITH_BF_OPENMP'] == 1:
env.Append(CCFLAGS=['-fopenmp'])
env.Append(CPPFLAGS=['-fopenmp'])
env.Append(CXXFLAGS=['-fopenmp'])
- # env.Append(LINKFLAGS=['-fprofile-generate'])
#check for additional debug libnames
@@ -301,7 +300,6 @@ if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-min
env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
-#B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
B.root_build_dir = env['BF_BUILDDIR']
B.doc_build_dir = env['BF_DOCDIR']
if not B.root_build_dir[-1]==os.sep:
@@ -392,7 +390,7 @@ SConscript(B.root_build_dir+'/source/SConscript')
# libraries to give as objects to linking phase
mainlist = []
for tp in B.possible_types:
- if not tp == 'player' and not tp == 'player2':
+ if not tp == 'player':
mainlist += B.create_blender_liblist(env, tp)
if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
@@ -402,14 +400,11 @@ dobj = B.buildinfo(env, "dynamic") + B.resources
thestatlibs, thelibincs = B.setup_staticlibs(env)
thesyslibs = B.setup_syslibs(env)
-if env['WITH_BF_PLAYER']:
- print("Warning: Game player may not build on 2.5")
-
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
- #env.BlenderProg(B.root_build_dir, "blender", dobj , [], mainlist + thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
if env['WITH_BF_PLAYER']:
playerlist = B.create_blender_liblist(env, 'player')
+ playerlist = playerlist[0:2] + [mainlist[0]] + mainlist[2:] + [playerlist[2]]
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
##### Now define some targets
@@ -424,8 +419,6 @@ if env['OURPLATFORM']=='darwin':
bundle = '%s.app' % prg[0]
bundledir = os.path.dirname(bundle)
for dp, dn, df in os.walk(bundle):
- if 'CVS' in dn:
- dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
@@ -442,8 +435,6 @@ scriptinstall = []
if env['OURPLATFORM']!='darwin':
for dp, dn, df in os.walk('bin/.blender'):
- if 'CVS' in dn:
- dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
@@ -470,8 +461,6 @@ if env['OURPLATFORM']!='darwin':
scriptpaths=['release/scripts', 'release/ui', 'release/io']
for scriptpath in scriptpaths:
for dp, dn, df in os.walk(scriptpath):
- if 'CVS' in dn:
- dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
@@ -484,8 +473,6 @@ if env['OURPLATFORM']=='linux2':
icontargetlist = []
for tp, tn, tf in os.walk('release/freedesktop/icons'):
- if 'CVS' in tn:
- tn.remove('CVS')
if '.svn' in tn:
tn.remove('.svn')
for f in tf:
@@ -508,8 +495,6 @@ if env['OURPLATFORM']=='linuxcross':
pluglist = []
plugtargetlist = []
for tp, tn, tf in os.walk('release/plugins'):
- if 'CVS' in tn:
- tn.remove('CVS')
if '.svn' in tn:
tn.remove('.svn')
for f in tf:
@@ -540,8 +525,6 @@ for targetdir,srcfile in zip(plugtargetlist, pluglist):
textlist = []
texttargetlist = []
for tp, tn, tf in os.walk('release/text'):
- if 'CVS' in tn:
- tn.remove('CVS')
if '.svn' in tn:
tn.remove('.svn')
for f in tf:
@@ -573,8 +556,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
if env['WITH_BF_PYTHON']:
ver = env["BF_PYTHON_VERSION"].replace(".", "")
- dllsources.append('#release/windows/extra/python' + ver + '.zip')
- dllsources.append('#release/windows/extra/zlib.pyd')
+ dllsources.append('${LCGDIR}/release/python' + ver + '.zip')
+ dllsources.append('${LCGDIR}/release/zlib.pyd')
if env['BF_DEBUG']:
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll')
else:
@@ -584,17 +567,19 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
pass # we link statically to iconv on win64
else:
dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
+ if env['WITH_BF_OPENAL']:
+ dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
+ dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
+ if env['WITH_BF_SNDFILE']:
+ dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
if env['WITH_BF_FFMPEG']:
dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll',
'${LCGDIR}/ffmpeg/lib/avformat-52.dll',
'${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
'${LCGDIR}/ffmpeg/lib/avutil-50.dll',
- '${LCGDIR}/ffmpeg/lib/libfaad-2.dll',
- '${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
- '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
- '${LCGDIR}/ffmpeg/lib/libx264-67.dll',
- '${LCGDIR}/ffmpeg/lib/xvidcore.dll',
'${LCGDIR}/ffmpeg/lib/swscale-0.dll']
+ if env['WITH_BF_JACK']:
+ dllsources += ['${LCGDIR}/jack/lib/libjack.dll']
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
allinstall += windlls
diff --git a/config/darwin-config.py b/config/darwin-config.py
index 14e6eb955ff..92f70d716fc 100644
--- a/config/darwin-config.py
+++ b/config/darwin-config.py
@@ -1,10 +1,3 @@
-#
-# Note : if you want to alter this file
-# copy it as a whole in the upper folder
-# as user-config.py
-# dont create a new file with only some
-# vars changed.
-
import commands
# IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs
@@ -27,27 +20,33 @@ else :
LCGDIR = '#../lib/darwin-8.x.i386'
LIBDIR = '${LCGDIR}'
+BF_PYTHON_VERSION = '3.1'
+
if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3':
MAC_MIN_VERS = '10.3'
MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
-elif MAC_CUR_VER=='10.4':
+else:
MAC_MIN_VERS = '10.4'
MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
-else:
- MAC_MIN_VERS = '10.5'
- MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
-BF_FFMPEG = "#extern/ffmpeg"
-BF_FFMPEG_INC = '${BF_FFMPEG}'
-if USE_SDK==True:
- BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
-#BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-#BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a'
-
-BF_PYTHON_VERSION = '3.1'
+FFMPEG_PRECOMPILED = False
+if FFMPEG_PRECOMPILED:
+ # use precompiled ffmpeg in /lib
+ BF_FFMPEG = LIBDIR + '/ffmpeg'
+ BF_FFMPEG_INC = "#extern/ffmpeg"
+ BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
+ BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore'
+else:
+ # use ffmpeg in extern
+ BF_FFMPEG = "#extern/ffmpeg"
+ BF_FFMPEG_INC = '${BF_FFMPEG}'
+ if USE_SDK==True:
+ BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
+ BF_XVIDCORE_CONFIG = '--disable-assembly' # currently causes errors, even with yasm installed
+ BF_X264_CONFIG = '--disable-pthread'
if BF_PYTHON_VERSION=='3.1':
# python 3.1 uses precompiled libraries in bf svn /lib by default
@@ -57,7 +56,7 @@ if BF_PYTHON_VERSION=='3.1':
# 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'
+ # BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
else:
# python 2.5 etc. uses built-in framework
@@ -73,18 +72,13 @@ else:
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'
- BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System -framework Python'
+ BF_PYTHON_LINKFLAGS = ['-u','_PyMac_Error','-framework','System','-framework','Python']
if MAC_CUR_VER=='10.3' or MAC_CUR_VER=='10.4':
- BF_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS
+ BF_PYTHON_LINKFLAGS = ['-u', '__dummy']+BF_PYTHON_LINKFLAGS
BF_QUIET = '1'
WITH_BF_OPENMP = '0'
-# Note : should be true, but openal simply dont work on intel
-if MAC_PROC == 'i386':
- WITH_BF_OPENAL = False
-else:
- WITH_BF_OPENAL = True
#different lib must be used following version of gcc
# for gcc 3.3
#BF_OPENAL = LIBDIR + '/openal'
@@ -106,6 +100,24 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
+# TODO - set proper paths here (add precompiled to lib/ ? )
+WITH_BF_JACK = False
+BF_JACK = '/usr'
+BF_JACK_INC = '${BF_JACK}/include/jack'
+BF_JACK_LIB = 'jack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = False
+BF_SNDFILE = LIBDIR + '/sndfile'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include'
+BF_SNDFILE_LIB = 'sndfile'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
+
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@@ -151,13 +163,19 @@ BF_GETTEXT_LIB = 'intl'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=True
-WITH_BF_PLAYER=True
+WITH_BF_PLAYER = False
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
+WITH_BF_FFTW3 = False
+BF_FFTW3 = LIBDIR + '/fftw3'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'libfftw3'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
@@ -193,14 +211,14 @@ BF_ICONV_LIB = 'iconv'
WITH_BF_STATICOPENGL = True
BF_OPENGL_LIB = 'GL GLU'
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
-BF_OPENGL_LINKFLAGS = '-framework OpenGL'
+BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
CFLAGS = ['-pipe','-fPIC','-funsigned-char']
CPPFLAGS = ['-fpascal-strings']
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
-PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
+PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','QuickTime']
#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
LLIBS = ['stdc++', 'SystemStubs']
@@ -209,12 +227,12 @@ LLIBS = ['stdc++', 'SystemStubs']
if MAC_MIN_VERS == '10.3':
CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
- PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
+ PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
LLIBS.append('crt3.o')
if USE_SDK==True:
SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]
- PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS
+ PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS, '-Wl,-syslibroot,' + MACOSX_SDK]+PLATFORM_LINKFLAGS
CCFLAGS=SDK_FLAGS+CCFLAGS
CXXFLAGS=SDK_FLAGS+CXXFLAGS
diff --git a/config/irix6-config.py b/config/irix6-config.py
index 87af6b29eb1..d38665f282a 100644
--- a/config/irix6-config.py
+++ b/config/irix6-config.py
@@ -24,6 +24,11 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = 'false'
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+BF_LIBSAMPLERATE = LCGDIR+'/samplerate'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
WITH_BF_SDL = 'true'
BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@@ -73,6 +78,7 @@ BF_GETTEXT_LIB = 'gettextpo intl'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE='false'
+WITH_BF_PLAYER = 'false'
WITH_BF_BULLET = 'true'
BF_BULLET = '#extern/bullet2/src'
diff --git a/config/linux2-config.py b/config/linux2-config.py
index 5724617e307..e50b8f70a5f 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -22,6 +22,23 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+BF_LIBSAMPLERATE = '/usr'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
+WITH_BF_JACK = False
+BF_JACK = '/usr'
+BF_JACK_INC = '${BF_JACK}/include/jack'
+BF_JACK_LIB = 'jack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = False
+BF_SNDFILE = '/usr'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
+BF_SNDFILE_LIB = 'sndfile'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
+
WITH_BF_SDL = True
BF_SDL = '/usr' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@@ -67,30 +84,13 @@ BF_GETTEXT_LIB = 'gettextlib'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True
-WITH_BF_PLAYER = True
+WITH_BF_PLAYER = False
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
-#WITH_BF_NSPR = True
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB =
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-#
-# Be paranoid regarding library creation (do not update archives)
-#BF_PARANOID = True
-
# enable freetype2 support for text objects
BF_FREETYPE = '/usr'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
@@ -130,6 +130,12 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+WITH_BF_FFTW3 = False
+BF_FFTW3 = LIBDIR + '/usr'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'fftw3'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
WITH_BF_REDCODE = False
BF_REDCODE = '#extern/libredcode'
BF_REDCODE_LIB = ''
@@ -178,8 +184,9 @@ REL_CCFLAGS = ['-O2']
##ARFLAGSQUIET = ru
##
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
-
CC_WARN = ['-Wall']
+CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
+
##FIX_STUBS_WARNINGS = -Wno-unused
diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py
index 5e5c44ecd69..a7ce2dc2908 100644
--- a/config/linuxcross-config.py
+++ b/config/linuxcross-config.py
@@ -22,6 +22,11 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
@@ -73,6 +78,7 @@ BF_GETTEXT_LIB = 'gnu_gettext'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = False
+WITH_BF_PLAYER = False
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
diff --git a/config/openbsd3-config.py b/config/openbsd3-config.py
index 2b0621e2ed3..95649321c07 100644
--- a/config/openbsd3-config.py
+++ b/config/openbsd3-config.py
@@ -16,6 +16,11 @@ WITH_BF_OPENAL = False
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+BF_LIBSAMPLERATE = '/usr/local'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
WITH_BF_SDL = True
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@@ -60,6 +65,7 @@ BF_GETTEXT_LIB = 'intl iconv'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=False
+WITH_BF_PLAYER = False
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
diff --git a/config/sunos5-config.py b/config/sunos5-config.py
index dc067b6f568..8af30e4f4f3 100644
--- a/config/sunos5-config.py
+++ b/config/sunos5-config.py
@@ -22,6 +22,11 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+BF_LIBSAMPLERATE = '/usr/local'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'samplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
WITH_BF_SDL = True
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
@@ -68,6 +73,7 @@ BF_GETTEXT_LIB = 'gettextlib'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=False
+WITH_BF_PLAYER = False
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
@@ -108,7 +114,7 @@ BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# enable ffmpeg support
-WITH_BF_FFMPEG = False # -DWITH_FFMPEG
+WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = '/usr/local'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py
index d9585d7cfda..e3834c41a81 100644
--- a/config/win32-mingw-config.py
+++ b/config/win32-mingw-config.py
@@ -3,31 +3,40 @@ LIBDIR = "${LCGDIR}"
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.1'
-#BF_PYTHON_VERSION = '2.6'
-#BF_PYTHON_VERSION = '2.6'
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
-#BF_PYTHON_LIB = 'python25'
-#BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/lib25_vs2005'
-#BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/lib25_vs2005/libpython25.a'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a'
WITH_BF_OPENAL = True
-WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'dxguid openal_static'
+BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
-# Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
WITH_BF_FFMPEG = False
-BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264'
-BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
-BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include'
+BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0'
+BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
+BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
+
+BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'libsamplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
+WITH_BF_JACK = False
+BF_JACK = LIBDIR + '/jack'
+BF_JACK_INC = '${BF_JACK}/include'
+BF_JACK_LIB = 'libjack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = False
+BF_SNDFILE = LIBDIR + '/sndfile'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include'
+BF_SNDFILE_LIB = 'libsndfile-1'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
@@ -81,6 +90,7 @@ BF_GETTEXT_LIB = 'gnu_gettext'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = False
+WITH_BF_PLAYER = False
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
@@ -90,20 +100,6 @@ BF_BULLET_LIB = 'extern_bullet'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
-#WITH_BF_NSPR = True
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB =
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-
# enable freetype2 support for text objects
BF_FREETYPE = LIBDIR + '/gcc/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py
index 2ba653aa355..40f749a7c6c 100644
--- a/config/win32-vc-config.py
+++ b/config/win32-vc-config.py
@@ -4,7 +4,7 @@ LIBDIR = '${LCGDIR}'
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = LIBDIR +'/ffmpeg'
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
@@ -16,18 +16,10 @@ BF_PYTHON_LIB = 'python31'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
-WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal'
-BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL '
-BF_OPENAL_LIB = 'dxguid openal_static'
+BF_OPENAL_INC = '${BF_OPENAL}/include '
+BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
-# Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
-
-# TODO - are these useful on win32?
-# BF_CXX = '/usr'
-# WITH_BF_STATICCXX = False
-# BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
WITH_BF_ICONV = True
BF_ICONV = LIBDIR + '/iconv'
@@ -35,6 +27,23 @@ BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
+BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'libsamplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
+WITH_BF_JACK = False
+BF_JACK = LIBDIR + '/jack'
+BF_JACK_INC = '${BF_JACK}/include'
+BF_JACK_LIB = 'libjack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = False
+BF_SNDFILE = LIBDIR + '/sndfile'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include'
+BF_SNDFILE_LIB = 'libsndfile-1'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
+
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
@@ -88,7 +97,7 @@ BF_GETTEXT_LIB = 'gnu_gettext'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True
-WITH_BF_PLAYER = True
+WITH_BF_PLAYER = False
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
@@ -100,23 +109,6 @@ BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
WITH_BF_BINRELOC = False
-#WITH_BF_NSPR = True
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB =
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-#
-# Be paranoid regarding library creation (do not update archives)
-#BF_PARANOID = True
-
# enable freetype2 support for text objects
BF_WITH_FREETYPE = True
BF_FREETYPE = LIBDIR + '/freetype'
@@ -136,6 +128,12 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+WITH_BF_FFTW3 = False
+BF_FFTW3 = LIBDIR + '/fftw3'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'libfftw'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
@@ -161,6 +159,7 @@ CXX = 'cl.exe'
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
CXXFLAGS = ['/EHsc']
+BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
diff --git a/config/win64-vc-config.py b/config/win64-vc-config.py
index 92cd5033d3e..0280417f980 100644
--- a/config/win64-vc-config.py
+++ b/config/win64-vc-config.py
@@ -16,13 +16,10 @@ BF_PYTHON_LIB = 'python31'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = False
-WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal'
-BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL '
-BF_OPENAL_LIB = 'dxguid openal_static'
+BF_OPENAL_INC = '${BF_OPENAL}/include '
+BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
-# Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
# TODO - are these useful on win32?
# BF_CXX = '/usr'
@@ -35,6 +32,11 @@ BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
+BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
+BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
+BF_LIBSAMPLERATE_LIB = 'libsamplerate'
+BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
+
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
@@ -139,6 +141,12 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+WITH_BF_FFTW3 = True
+BF_FFTW3 = LIBDIR + '/fftw3'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'libfftw'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
@@ -165,6 +173,7 @@ CXX = 'cl.exe'
CFLAGS = []
CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267']
CXXFLAGS = ['/EHsc']
+BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE2']
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt
index b6cfe3b113e..019cd9de28b 100644
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -37,3 +37,6 @@ ADD_SUBDIRECTORY(glew)
IF(WITH_OPENJPEG)
ADD_SUBDIRECTORY(libopenjpeg)
ENDIF(WITH_OPENJPEG)
+
+ADD_SUBDIRECTORY(lzo)
+ADD_SUBDIRECTORY(lzma)
diff --git a/extern/Makefile b/extern/Makefile
index 61499da8743..1bebf1e1994 100644
--- a/extern/Makefile
+++ b/extern/Makefile
@@ -54,6 +54,14 @@ ifeq ($(WITH_OPENJPEG), true)
DIRS += libopenjpeg
endif
+ifeq ($(WITH_LZO), true)
+ DIRS += lzo/minilzo
+endif
+
+ifeq ($(WITH_LZMA), true)
+ DIRS += lzma
+endif
+
TARGET = solid
all::
diff --git a/extern/SConscript b/extern/SConscript
index 175613c3d2b..20604d87e45 100644
--- a/extern/SConscript
+++ b/extern/SConscript
@@ -22,5 +22,5 @@ if env['WITH_BF_REDCODE'] and env['BF_REDCODE_LIB'] == '':
if env['OURPLATFORM'] == 'linux2':
SConscript(['binreloc/SConscript']);
-# FFTW not needed atm - dg
-# SConscript(['fftw/SConscript'])
+SConscript(['lzo/SConscript'])
+SConscript(['lzma/SConscript'])
diff --git a/extern/glew/CMakeLists.txt b/extern/glew/CMakeLists.txt
index 53ef014927c..eea34488e17 100644
--- a/extern/glew/CMakeLists.txt
+++ b/extern/glew/CMakeLists.txt
@@ -26,8 +26,13 @@
SET(INC include src)
+IF(UNIX)
+ SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
+ENDIF(UNIX)
+
SET(SRC
src/glew.c
)
BLENDERLIB(extern_glew "${SRC}" "${INC}")
+
diff --git a/extern/libopenjpeg/CMakeLists.txt b/extern/libopenjpeg/CMakeLists.txt
index c179d5328b9..0a985aceb37 100644
--- a/extern/libopenjpeg/CMakeLists.txt
+++ b/extern/libopenjpeg/CMakeLists.txt
@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-SET(INC . src ${FREETYPE_INC})
+SET(INC . src)
FILE(GLOB SRC *.c except t1_generate_luts.c)
ADD_DEFINITIONS(-DWITH_OPENJPEG)
diff --git a/extern/libredcode/SConscript b/extern/libredcode/SConscript
index 9fd25ad63c7..3fb78dbea0f 100644
--- a/extern/libredcode/SConscript
+++ b/extern/libredcode/SConscript
@@ -12,5 +12,5 @@ incs = '. ../libopenjpeg'
env.BlenderLib ( libname='extern_redcode',
sources=sources, includes=Split(incs),
defines=[],
- libtype=['core','intern','player'],
- priority=[5, 5, 200], compileflags = [])
+ libtype=['core','intern'],
+ priority=[5, 5], compileflags = [])
diff --git a/extern/lzma/Alloc.c b/extern/lzma/Alloc.c
new file mode 100644
index 00000000000..358a7b52650
--- /dev/null
+++ b/extern/lzma/Alloc.c
@@ -0,0 +1,127 @@
+/* Alloc.c -- Memory allocation functions
+2008-09-24
+Igor Pavlov
+Public domain */
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+#include <stdlib.h>
+
+#include "Alloc.h"
+
+/* #define _SZ_ALLOC_DEBUG */
+
+/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
+#ifdef _SZ_ALLOC_DEBUG
+#include <stdio.h>
+int g_allocCount = 0;
+int g_allocCountMid = 0;
+int g_allocCountBig = 0;
+#endif
+
+void *MyAlloc(size_t size)
+{
+ if (size == 0)
+ return 0;
+ #ifdef _SZ_ALLOC_DEBUG
+ {
+ void *p = malloc(size);
+ fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
+ return p;
+ }
+ #else
+ return malloc(size);
+ #endif
+}
+
+void MyFree(void *address)
+{
+ #ifdef _SZ_ALLOC_DEBUG
+ if (address != 0)
+ fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
+ #endif
+ free(address);
+}
+
+#ifdef _WIN32
+
+void *MidAlloc(size_t size)
+{
+ if (size == 0)
+ return 0;
+ #ifdef _SZ_ALLOC_DEBUG
+ fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++);
+ #endif
+ return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
+}
+
+void MidFree(void *address)
+{
+ #ifdef _SZ_ALLOC_DEBUG
+ if (address != 0)
+ fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid);
+ #endif
+ if (address == 0)
+ return;
+ VirtualFree(address, 0, MEM_RELEASE);
+}
+
+#ifndef MEM_LARGE_PAGES
+#undef _7ZIP_LARGE_PAGES
+#endif
+
+#ifdef _7ZIP_LARGE_PAGES
+SIZE_T g_LargePageSize = 0;
+typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
+#endif
+
+void SetLargePageSize()
+{
+ #ifdef _7ZIP_LARGE_PAGES
+ SIZE_T size = 0;
+ GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
+ GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
+ if (largePageMinimum == 0)
+ return;
+ size = largePageMinimum();
+ if (size == 0 || (size & (size - 1)) != 0)
+ return;
+ g_LargePageSize = size;
+ #endif
+}
+
+
+void *BigAlloc(size_t size)
+{
+ if (size == 0)
+ return 0;
+ #ifdef _SZ_ALLOC_DEBUG
+ fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++);
+ #endif
+
+ #ifdef _7ZIP_LARGE_PAGES
+ if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18))
+ {
+ void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
+ MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
+ if (res != 0)
+ return res;
+ }
+ #endif
+ return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
+}
+
+void BigFree(void *address)
+{
+ #ifdef _SZ_ALLOC_DEBUG
+ if (address != 0)
+ fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig);
+ #endif
+
+ if (address == 0)
+ return;
+ VirtualFree(address, 0, MEM_RELEASE);
+}
+
+#endif
diff --git a/extern/lzma/Alloc.h b/extern/lzma/Alloc.h
new file mode 100644
index 00000000000..ff0669cad8d
--- /dev/null
+++ b/extern/lzma/Alloc.h
@@ -0,0 +1,32 @@
+/* Alloc.h -- Memory allocation functions
+2008-03-13
+Igor Pavlov
+Public domain */
+
+#ifndef __COMMON_ALLOC_H
+#define __COMMON_ALLOC_H
+
+#include <stddef.h>
+
+void *MyAlloc(size_t size);
+void MyFree(void *address);
+
+#ifdef _WIN32
+
+void SetLargePageSize();
+
+void *MidAlloc(size_t size);
+void MidFree(void *address);
+void *BigAlloc(size_t size);
+void BigFree(void *address);
+
+#else
+
+#define MidAlloc(size) MyAlloc(size)
+#define MidFree(address) MyFree(address)
+#define BigAlloc(size) MyAlloc(size)
+#define BigFree(address) MyFree(address)
+
+#endif
+
+#endif
diff --git a/extern/lzma/CMakeLists.txt b/extern/lzma/CMakeLists.txt
new file mode 100644
index 00000000000..235cd8c7f8e
--- /dev/null
+++ b/extern/lzma/CMakeLists.txt
@@ -0,0 +1,34 @@
+# $Id$
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Daniel Genrich
+#
+# ***** END GPL LICENSE BLOCK *****
+
+SET(INC . )
+
+FILE(GLOB SRC ./*.c)
+
+
+
+BLENDERLIB(bf_lzma "${SRC}" "${INC}")
+#, libtype='blender', priority = 0 )
diff --git a/extern/lzma/LzFind.c b/extern/lzma/LzFind.c
new file mode 100644
index 00000000000..34f4f09ea58
--- /dev/null
+++ b/extern/lzma/LzFind.c
@@ -0,0 +1,751 @@
+/* LzFind.c -- Match finder for LZ algorithms
+2008-10-04 : Igor Pavlov : Public domain */
+
+#include <string.h>
+
+#include "LzFind.h"
+#include "LzHash.h"
+
+#define kEmptyHashValue 0
+#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
+#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
+#define kNormalizeMask (~(kNormalizeStepMin - 1))
+#define kMaxHistorySize ((UInt32)3 << 30)
+
+#define kStartMaxLen 3
+
+static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc)
+{
+ if (!p->directInput)
+ {
+ alloc->Free(alloc, p->bufferBase);
+ p->bufferBase = 0;
+ }
+}
+
+/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
+
+static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc)
+{
+ UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
+ if (p->directInput)
+ {
+ p->blockSize = blockSize;
+ return 1;
+ }
+ if (p->bufferBase == 0 || p->blockSize != blockSize)
+ {
+ LzInWindow_Free(p, alloc);
+ p->blockSize = blockSize;
+ p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize);
+ }
+ return (p->bufferBase != 0);
+}
+
+Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
+Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; }
+
+UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
+
+void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
+{
+ p->posLimit -= subValue;
+ p->pos -= subValue;
+ p->streamPos -= subValue;
+}
+
+static void MatchFinder_ReadBlock(CMatchFinder *p)
+{
+ if (p->streamEndWasReached || p->result != SZ_OK)
+ return;
+ for (;;)
+ {
+ Byte *dest = p->buffer + (p->streamPos - p->pos);
+ size_t size = (p->bufferBase + p->blockSize - dest);
+ if (size == 0)
+ return;
+ p->result = p->stream->Read(p->stream, dest, &size);
+ if (p->result != SZ_OK)
+ return;
+ if (size == 0)
+ {
+ p->streamEndWasReached = 1;
+ return;
+ }
+ p->streamPos += (UInt32)size;
+ if (p->streamPos - p->pos > p->keepSizeAfter)
+ return;
+ }
+}
+
+void MatchFinder_MoveBlock(CMatchFinder *p)
+{
+ memmove(p->bufferBase,
+ p->buffer - p->keepSizeBefore,
+ (size_t)(p->streamPos - p->pos + p->keepSizeBefore));
+ p->buffer = p->bufferBase + p->keepSizeBefore;
+}
+
+int MatchFinder_NeedMove(CMatchFinder *p)
+{
+ /* if (p->streamEndWasReached) return 0; */
+ return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
+}
+
+void MatchFinder_ReadIfRequired(CMatchFinder *p)
+{
+ if (p->streamEndWasReached)
+ return;
+ if (p->keepSizeAfter >= p->streamPos - p->pos)
+ MatchFinder_ReadBlock(p);
+}
+
+static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
+{
+ if (MatchFinder_NeedMove(p))
+ MatchFinder_MoveBlock(p);
+ MatchFinder_ReadBlock(p);
+}
+
+static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
+{
+ p->cutValue = 32;
+ p->btMode = 1;
+ p->numHashBytes = 4;
+ /* p->skipModeBits = 0; */
+ p->directInput = 0;
+ p->bigHash = 0;
+}
+
+#define kCrcPoly 0xEDB88320
+
+void MatchFinder_Construct(CMatchFinder *p)
+{
+ UInt32 i;
+ p->bufferBase = 0;
+ p->directInput = 0;
+ p->hash = 0;
+ MatchFinder_SetDefaultSettings(p);
+
+ for (i = 0; i < 256; i++)
+ {
+ UInt32 r = i;
+ int j;
+ for (j = 0; j < 8; j++)
+ r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
+ p->crc[i] = r;
+ }
+}
+
+static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc)
+{
+ alloc->Free(alloc, p->hash);
+ p->hash = 0;
+}
+
+void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc)
+{
+ MatchFinder_FreeThisClassMemory(p, alloc);
+ LzInWindow_Free(p, alloc);
+}
+
+static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc)
+{
+ size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
+ if (sizeInBytes / sizeof(CLzRef) != num)
+ return 0;
+ return (CLzRef *)alloc->Alloc(alloc, sizeInBytes);
+}
+
+int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
+ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
+ ISzAlloc *alloc)
+{
+ UInt32 sizeReserv;
+ if (historySize > kMaxHistorySize)
+ {
+ MatchFinder_Free(p, alloc);
+ return 0;
+ }
+ sizeReserv = historySize >> 1;
+ if (historySize > ((UInt32)2 << 30))
+ sizeReserv = historySize >> 2;
+ sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
+
+ p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
+ p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;
+ /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */
+ if (LzInWindow_Create(p, sizeReserv, alloc))
+ {
+ UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1;
+ UInt32 hs;
+ p->matchMaxLen = matchMaxLen;
+ {
+ p->fixedHashSize = 0;
+ if (p->numHashBytes == 2)
+ hs = (1 << 16) - 1;
+ else
+ {
+ hs = historySize - 1;
+ hs |= (hs >> 1);
+ hs |= (hs >> 2);
+ hs |= (hs >> 4);
+ hs |= (hs >> 8);
+ hs >>= 1;
+ /* hs >>= p->skipModeBits; */
+ hs |= 0xFFFF; /* don't change it! It's required for Deflate */
+ if (hs > (1 << 24))
+ {
+ if (p->numHashBytes == 3)
+ hs = (1 << 24) - 1;
+ else
+ hs >>= 1;
+ }
+ }
+ p->hashMask = hs;
+ hs++;
+ if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;
+ if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;
+ if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;
+ hs += p->fixedHashSize;
+ }
+
+ {
+ UInt32 prevSize = p->hashSizeSum + p->numSons;
+ UInt32 newSize;
+ p->historySize = historySize;
+ p->hashSizeSum = hs;
+ p->cyclicBufferSize = newCyclicBufferSize;
+ p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize);
+ newSize = p->hashSizeSum + p->numSons;
+ if (p->hash != 0 && prevSize == newSize)
+ return 1;
+ MatchFinder_FreeThisClassMemory(p, alloc);
+ p->hash = AllocRefs(newSize, alloc);
+ if (p->hash != 0)
+ {
+ p->son = p->hash + p->hashSizeSum;
+ return 1;
+ }
+ }
+ }
+ MatchFinder_Free(p, alloc);
+ return 0;
+}
+
+static void MatchFinder_SetLimits(CMatchFinder *p)
+{
+ UInt32 limit = kMaxValForNormalize - p->pos;
+ UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
+ if (limit2 < limit)
+ limit = limit2;
+ limit2 = p->streamPos - p->pos;
+ if (limit2 <= p->keepSizeAfter)
+ {
+ if (limit2 > 0)
+ limit2 = 1;
+ }
+ else
+ limit2 -= p->keepSizeAfter;
+ if (limit2 < limit)
+ limit = limit2;
+ {
+ UInt32 lenLimit = p->streamPos - p->pos;
+ if (lenLimit > p->matchMaxLen)
+ lenLimit = p->matchMaxLen;
+ p->lenLimit = lenLimit;
+ }
+ p->posLimit = p->pos + limit;
+}
+
+void MatchFinder_Init(CMatchFinder *p)
+{
+ UInt32 i;
+ for (i = 0; i < p->hashSizeSum; i++)
+ p->hash[i] = kEmptyHashValue;
+ p->cyclicBufferPos = 0;
+ p->buffer = p->bufferBase;
+ p->pos = p->streamPos = p->cyclicBufferSize;
+ p->result = SZ_OK;
+ p->streamEndWasReached = 0;
+ MatchFinder_ReadBlock(p);
+ MatchFinder_SetLimits(p);
+}
+
+static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
+{
+ return (p->pos - p->historySize - 1) & kNormalizeMask;
+}
+
+void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems)
+{
+ UInt32 i;
+ for (i = 0; i < numItems; i++)
+ {
+ UInt32 value = items[i];
+ if (value <= subValue)
+ value = kEmptyHashValue;
+ else
+ value -= subValue;
+ items[i] = value;
+ }
+}
+
+static void MatchFinder_Normalize(CMatchFinder *p)
+{
+ UInt32 subValue = MatchFinder_GetSubValue(p);
+ MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons);
+ MatchFinder_ReduceOffsets(p, subValue);
+}
+
+static void MatchFinder_CheckLimits(CMatchFinder *p)
+{
+ if (p->pos == kMaxValForNormalize)
+ MatchFinder_Normalize(p);
+ if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
+ MatchFinder_CheckAndMoveAndRead(p);
+ if (p->cyclicBufferPos == p->cyclicBufferSize)
+ p->cyclicBufferPos = 0;
+ MatchFinder_SetLimits(p);
+}
+
+static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
+ UInt32 *distances, UInt32 maxLen)
+{
+ son[_cyclicBufferPos] = curMatch;
+ for (;;)
+ {
+ UInt32 delta = pos - curMatch;
+ if (cutValue-- == 0 || delta >= _cyclicBufferSize)
+ return distances;
+ {
+ const Byte *pb = cur - delta;
+ curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
+ if (pb[maxLen] == cur[maxLen] && *pb == *cur)
+ {
+ UInt32 len = 0;
+ while (++len != lenLimit)
+ if (pb[len] != cur[len])
+ break;
+ if (maxLen < len)
+ {
+ *distances++ = maxLen = len;
+ *distances++ = delta - 1;
+ if (len == lenLimit)
+ return distances;
+ }
+ }
+ }
+ }
+}
+
+UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
+ UInt32 *distances, UInt32 maxLen)
+{
+ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
+ CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
+ UInt32 len0 = 0, len1 = 0;
+ for (;;)
+ {
+ UInt32 delta = pos - curMatch;
+ if (cutValue-- == 0 || delta >= _cyclicBufferSize)
+ {
+ *ptr0 = *ptr1 = kEmptyHashValue;
+ return distances;
+ }
+ {
+ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
+ const Byte *pb = cur - delta;
+ UInt32 len = (len0 < len1 ? len0 : len1);
+ if (pb[len] == cur[len])
+ {
+ if (++len != lenLimit && pb[len] == cur[len])
+ while (++len != lenLimit)
+ if (pb[len] != cur[len])
+ break;
+ if (maxLen < len)
+ {
+ *distances++ = maxLen = len;
+ *distances++ = delta - 1;
+ if (len == lenLimit)
+ {
+ *ptr1 = pair[0];
+ *ptr0 = pair[1];
+ return distances;
+ }
+ }
+ }
+ if (pb[len] < cur[len])
+ {
+ *ptr1 = curMatch;
+ ptr1 = pair + 1;
+ curMatch = *ptr1;
+ len1 = len;
+ }
+ else
+ {
+ *ptr0 = curMatch;
+ ptr0 = pair;
+ curMatch = *ptr0;
+ len0 = len;
+ }
+ }
+ }
+}
+
+static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
+{
+ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
+ CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
+ UInt32 len0 = 0, len1 = 0;
+ for (;;)
+ {
+ UInt32 delta = pos - curMatch;
+ if (cutValue-- == 0 || delta >= _cyclicBufferSize)
+ {
+ *ptr0 = *ptr1 = kEmptyHashValue;
+ return;
+ }
+ {
+ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
+ const Byte *pb = cur - delta;
+ UInt32 len = (len0 < len1 ? len0 : len1);
+ if (pb[len] == cur[len])
+ {
+ while (++len != lenLimit)
+ if (pb[len] != cur[len])
+ break;
+ {
+ if (len == lenLimit)
+ {
+ *ptr1 = pair[0];
+ *ptr0 = pair[1];
+ return;
+ }
+ }
+ }
+ if (pb[len] < cur[len])
+ {
+ *ptr1 = curMatch;
+ ptr1 = pair + 1;
+ curMatch = *ptr1;
+ len1 = len;
+ }
+ else
+ {
+ *ptr0 = curMatch;
+ ptr0 = pair;
+ curMatch = *ptr0;
+ len0 = len;
+ }
+ }
+ }
+}
+
+#define MOVE_POS \
+ ++p->cyclicBufferPos; \
+ p->buffer++; \
+ if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
+
+#define MOVE_POS_RET MOVE_POS return offset;
+
+static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
+
+#define GET_MATCHES_HEADER2(minLen, ret_op) \
+ UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \
+ lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
+ cur = p->buffer;
+
+#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)
+#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue)
+
+#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
+
+#define GET_MATCHES_FOOTER(offset, maxLen) \
+ offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \
+ distances + offset, maxLen) - distances); MOVE_POS_RET;
+
+#define SKIP_FOOTER \
+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
+
+static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 offset;
+ GET_MATCHES_HEADER(2)
+ HASH2_CALC;
+ curMatch = p->hash[hashValue];
+ p->hash[hashValue] = p->pos;
+ offset = 0;
+ GET_MATCHES_FOOTER(offset, 1)
+}
+
+UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 offset;
+ GET_MATCHES_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hashValue];
+ p->hash[hashValue] = p->pos;
+ offset = 0;
+ GET_MATCHES_FOOTER(offset, 2)
+}
+
+static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 hash2Value, delta2, maxLen, offset;
+ GET_MATCHES_HEADER(3)
+
+ HASH3_CALC;
+
+ delta2 = p->pos - p->hash[hash2Value];
+ curMatch = p->hash[kFix3HashSize + hashValue];
+
+ p->hash[hash2Value] =
+ p->hash[kFix3HashSize + hashValue] = p->pos;
+
+
+ maxLen = 2;
+ offset = 0;
+ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
+ {
+ for (; maxLen != lenLimit; maxLen++)
+ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
+ break;
+ distances[0] = maxLen;
+ distances[1] = delta2 - 1;
+ offset = 2;
+ if (maxLen == lenLimit)
+ {
+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
+ MOVE_POS_RET;
+ }
+ }
+ GET_MATCHES_FOOTER(offset, maxLen)
+}
+
+static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
+ GET_MATCHES_HEADER(4)
+
+ HASH4_CALC;
+
+ delta2 = p->pos - p->hash[ hash2Value];
+ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
+ curMatch = p->hash[kFix4HashSize + hashValue];
+
+ p->hash[ hash2Value] =
+ p->hash[kFix3HashSize + hash3Value] =
+ p->hash[kFix4HashSize + hashValue] = p->pos;
+
+ maxLen = 1;
+ offset = 0;
+ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
+ {
+ distances[0] = maxLen = 2;
+ distances[1] = delta2 - 1;
+ offset = 2;
+ }
+ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
+ {
+ maxLen = 3;
+ distances[offset + 1] = delta3 - 1;
+ offset += 2;
+ delta2 = delta3;
+ }
+ if (offset != 0)
+ {
+ for (; maxLen != lenLimit; maxLen++)
+ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
+ break;
+ distances[offset - 2] = maxLen;
+ if (maxLen == lenLimit)
+ {
+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
+ MOVE_POS_RET;
+ }
+ }
+ if (maxLen < 3)
+ maxLen = 3;
+ GET_MATCHES_FOOTER(offset, maxLen)
+}
+
+static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
+ GET_MATCHES_HEADER(4)
+
+ HASH4_CALC;
+
+ delta2 = p->pos - p->hash[ hash2Value];
+ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
+ curMatch = p->hash[kFix4HashSize + hashValue];
+
+ p->hash[ hash2Value] =
+ p->hash[kFix3HashSize + hash3Value] =
+ p->hash[kFix4HashSize + hashValue] = p->pos;
+
+ maxLen = 1;
+ offset = 0;
+ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
+ {
+ distances[0] = maxLen = 2;
+ distances[1] = delta2 - 1;
+ offset = 2;
+ }
+ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
+ {
+ maxLen = 3;
+ distances[offset + 1] = delta3 - 1;
+ offset += 2;
+ delta2 = delta3;
+ }
+ if (offset != 0)
+ {
+ for (; maxLen != lenLimit; maxLen++)
+ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
+ break;
+ distances[offset - 2] = maxLen;
+ if (maxLen == lenLimit)
+ {
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS_RET;
+ }
+ }
+ if (maxLen < 3)
+ maxLen = 3;
+ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
+ distances + offset, maxLen) - (distances));
+ MOVE_POS_RET
+}
+
+UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 offset;
+ GET_MATCHES_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hashValue];
+ p->hash[hashValue] = p->pos;
+ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
+ distances, 2) - (distances));
+ MOVE_POS_RET
+}
+
+static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ SKIP_HEADER(2)
+ HASH2_CALC;
+ curMatch = p->hash[hashValue];
+ p->hash[hashValue] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ SKIP_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hashValue];
+ p->hash[hashValue] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 hash2Value;
+ SKIP_HEADER(3)
+ HASH3_CALC;
+ curMatch = p->hash[kFix3HashSize + hashValue];
+ p->hash[hash2Value] =
+ p->hash[kFix3HashSize + hashValue] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 hash2Value, hash3Value;
+ SKIP_HEADER(4)
+ HASH4_CALC;
+ curMatch = p->hash[kFix4HashSize + hashValue];
+ p->hash[ hash2Value] =
+ p->hash[kFix3HashSize + hash3Value] = p->pos;
+ p->hash[kFix4HashSize + hashValue] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 hash2Value, hash3Value;
+ SKIP_HEADER(4)
+ HASH4_CALC;
+ curMatch = p->hash[kFix4HashSize + hashValue];
+ p->hash[ hash2Value] =
+ p->hash[kFix3HashSize + hash3Value] =
+ p->hash[kFix4HashSize + hashValue] = p->pos;
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS
+ }
+ while (--num != 0);
+}
+
+void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ SKIP_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hashValue];
+ p->hash[hashValue] = p->pos;
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS
+ }
+ while (--num != 0);
+}
+
+void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
+{
+ vTable->Init = (Mf_Init_Func)MatchFinder_Init;
+ vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte;
+ vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
+ vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
+ if (!p->btMode)
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
+ }
+ else if (p->numHashBytes == 2)
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
+ }
+ else if (p->numHashBytes == 3)
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
+ }
+ else
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
+ }
+}
diff --git a/extern/lzma/LzFind.h b/extern/lzma/LzFind.h
new file mode 100644
index 00000000000..5b9cebfdffe
--- /dev/null
+++ b/extern/lzma/LzFind.h
@@ -0,0 +1,107 @@
+/* LzFind.h -- Match finder for LZ algorithms
+2008-10-04 : Igor Pavlov : Public domain */
+
+#ifndef __LZFIND_H
+#define __LZFIND_H
+
+#include "Types.h"
+
+typedef UInt32 CLzRef;
+
+typedef struct _CMatchFinder
+{
+ Byte *buffer;
+ UInt32 pos;
+ UInt32 posLimit;
+ UInt32 streamPos;
+ UInt32 lenLimit;
+
+ UInt32 cyclicBufferPos;
+ UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
+
+ UInt32 matchMaxLen;
+ CLzRef *hash;
+ CLzRef *son;
+ UInt32 hashMask;
+ UInt32 cutValue;
+
+ Byte *bufferBase;
+ ISeqInStream *stream;
+ int streamEndWasReached;
+
+ UInt32 blockSize;
+ UInt32 keepSizeBefore;
+ UInt32 keepSizeAfter;
+
+ UInt32 numHashBytes;
+ int directInput;
+ int btMode;
+ /* int skipModeBits; */
+ int bigHash;
+ UInt32 historySize;
+ UInt32 fixedHashSize;
+ UInt32 hashSizeSum;
+ UInt32 numSons;
+ SRes result;
+ UInt32 crc[256];
+} CMatchFinder;
+
+#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
+#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)])
+
+#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
+
+int MatchFinder_NeedMove(CMatchFinder *p);
+Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
+void MatchFinder_MoveBlock(CMatchFinder *p);
+void MatchFinder_ReadIfRequired(CMatchFinder *p);
+
+void MatchFinder_Construct(CMatchFinder *p);
+
+/* Conditions:
+ historySize <= 3 GB
+ keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
+*/
+int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
+ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
+ ISzAlloc *alloc);
+void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
+void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
+void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
+
+UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
+ UInt32 *distances, UInt32 maxLen);
+
+/*
+Conditions:
+ Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
+ Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
+*/
+
+typedef void (*Mf_Init_Func)(void *object);
+typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
+typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
+typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
+typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
+typedef void (*Mf_Skip_Func)(void *object, UInt32);
+
+typedef struct _IMatchFinder
+{
+ Mf_Init_Func Init;
+ Mf_GetIndexByte_Func GetIndexByte;
+ Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
+ Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
+ Mf_GetMatches_Func GetMatches;
+ Mf_Skip_Func Skip;
+} IMatchFinder;
+
+void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
+
+void MatchFinder_Init(CMatchFinder *p);
+UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
+UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
+void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
+void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
+
+#endif
diff --git a/extern/lzma/LzHash.h b/extern/lzma/LzHash.h
new file mode 100644
index 00000000000..9f4173e7e33
--- /dev/null
+++ b/extern/lzma/LzHash.h
@@ -0,0 +1,54 @@
+/* LzHash.h -- HASH functions for LZ algorithms
+2008-10-04 : Igor Pavlov : Public domain */
+
+#ifndef __LZHASH_H
+#define __LZHASH_H
+
+#define kHash2Size (1 << 10)
+#define kHash3Size (1 << 16)
+#define kHash4Size (1 << 20)
+
+#define kFix3HashSize (kHash2Size)
+#define kFix4HashSize (kHash2Size + kHash3Size)
+#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
+
+#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8);
+
+#define HASH3_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ hash2Value = temp & (kHash2Size - 1); \
+ hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
+
+#define HASH4_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ hash2Value = temp & (kHash2Size - 1); \
+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
+ hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
+
+#define HASH5_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ hash2Value = temp & (kHash2Size - 1); \
+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
+ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \
+ hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \
+ hash4Value &= (kHash4Size - 1); }
+
+/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
+#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
+
+
+#define MT_HASH2_CALC \
+ hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
+
+#define MT_HASH3_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ hash2Value = temp & (kHash2Size - 1); \
+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
+
+#define MT_HASH4_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ hash2Value = temp & (kHash2Size - 1); \
+ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
+ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
+
+#endif
diff --git a/extern/lzma/LzmaDec.c b/extern/lzma/LzmaDec.c
new file mode 100644
index 00000000000..d87eb1914ea
--- /dev/null
+++ b/extern/lzma/LzmaDec.c
@@ -0,0 +1,1007 @@
+/* LzmaDec.c -- LZMA Decoder
+2008-11-06 : Igor Pavlov : Public domain */
+
+#include "LzmaDec.h"
+
+#include <string.h>
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+
+#define RC_INIT_SIZE 5
+
+#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
+
+#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
+#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
+#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
+#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
+ { UPDATE_0(p); i = (i + i); A0; } else \
+ { UPDATE_1(p); i = (i + i) + 1; A1; }
+#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
+
+#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
+#define TREE_DECODE(probs, limit, i) \
+ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
+
+/* #define _LZMA_SIZE_OPT */
+
+#ifdef _LZMA_SIZE_OPT
+#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
+#else
+#define TREE_6_DECODE(probs, i) \
+ { i = 1; \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ i -= 0x40; }
+#endif
+
+#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
+
+#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
+#define UPDATE_0_CHECK range = bound;
+#define UPDATE_1_CHECK range -= bound; code -= bound;
+#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
+ { UPDATE_0_CHECK; i = (i + i); A0; } else \
+ { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
+#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
+#define TREE_DECODE_CHECK(probs, limit, i) \
+ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
+
+
+#define kNumPosBitsMax 4
+#define kNumPosStatesMax (1 << kNumPosBitsMax)
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumMidBits 3
+#define kLenNumMidSymbols (1 << kLenNumMidBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+
+#define LenChoice 0
+#define LenChoice2 (LenChoice + 1)
+#define LenLow (LenChoice2 + 1)
+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+
+
+#define kNumStates 12
+#define kNumLitStates 7
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+
+#define kNumPosSlotBits 6
+#define kNumLenToPosStates 4
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+
+#define kMatchMinLen 2
+#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
+
+#define IsMatch 0
+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
+#define IsRepG0 (IsRep + kNumStates)
+#define IsRepG1 (IsRepG0 + kNumStates)
+#define IsRepG2 (IsRepG1 + kNumStates)
+#define IsRep0Long (IsRepG2 + kNumStates)
+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
+#define LenCoder (Align + kAlignTableSize)
+#define RepLenCoder (LenCoder + kNumLenProbs)
+#define Literal (RepLenCoder + kNumLenProbs)
+
+#define LZMA_BASE_SIZE 1846
+#define LZMA_LIT_SIZE 768
+
+#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
+
+#if Literal != LZMA_BASE_SIZE
+StopCompilingDueBUG
+#endif
+
+static const Byte kLiteralNextStates[kNumStates * 2] =
+{
+ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5,
+ 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10
+};
+
+#define LZMA_DIC_MIN (1 << 12)
+
+/* First LZMA-symbol is always decoded.
+And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization
+Out:
+ Result:
+ SZ_OK - OK
+ SZ_ERROR_DATA - Error
+ p->remainLen:
+ < kMatchSpecLenStart : normal remain
+ = kMatchSpecLenStart : finished
+ = kMatchSpecLenStart + 1 : Flush marker
+ = kMatchSpecLenStart + 2 : State Init Marker
+*/
+
+static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
+{
+ CLzmaProb *probs = p->probs;
+
+ unsigned state = p->state;
+ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
+ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
+ unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;
+ unsigned lc = p->prop.lc;
+
+ Byte *dic = p->dic;
+ SizeT dicBufSize = p->dicBufSize;
+ SizeT dicPos = p->dicPos;
+
+ UInt32 processedPos = p->processedPos;
+ UInt32 checkDicSize = p->checkDicSize;
+ unsigned len = 0;
+
+ const Byte *buf = p->buf;
+ UInt32 range = p->range;
+ UInt32 code = p->code;
+
+ do
+ {
+ CLzmaProb *prob;
+ UInt32 bound;
+ unsigned ttt;
+ unsigned posState = processedPos & pbMask;
+
+ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
+ IF_BIT_0(prob)
+ {
+ unsigned symbol;
+ UPDATE_0(prob);
+ prob = probs + Literal;
+ if (checkDicSize != 0 || processedPos != 0)
+ prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) +
+ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc))));
+
+ if (state < kNumLitStates)
+ {
+ symbol = 1;
+ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
+ }
+ else
+ {
+ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
+ unsigned offs = 0x100;
+ symbol = 1;
+ do
+ {
+ unsigned bit;
+ CLzmaProb *probLit;
+ matchByte <<= 1;
+ bit = (matchByte & offs);
+ probLit = prob + offs + bit + symbol;
+ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)
+ }
+ while (symbol < 0x100);
+ }
+ dic[dicPos++] = (Byte)symbol;
+ processedPos++;
+
+ state = kLiteralNextStates[state];
+ /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */
+ continue;
+ }
+ else
+ {
+ UPDATE_1(prob);
+ prob = probs + IsRep + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ state += kNumStates;
+ prob = probs + LenCoder;
+ }
+ else
+ {
+ UPDATE_1(prob);
+ if (checkDicSize == 0 && processedPos == 0)
+ return SZ_ERROR_DATA;
+ prob = probs + IsRepG0 + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
+ dicPos++;
+ processedPos++;
+ state = state < kNumLitStates ? 9 : 11;
+ continue;
+ }
+ UPDATE_1(prob);
+ }
+ else
+ {
+ UInt32 distance;
+ UPDATE_1(prob);
+ prob = probs + IsRepG1 + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ distance = rep1;
+ }
+ else
+ {
+ UPDATE_1(prob);
+ prob = probs + IsRepG2 + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ distance = rep2;
+ }
+ else
+ {
+ UPDATE_1(prob);
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ state = state < kNumLitStates ? 8 : 11;
+ prob = probs + RepLenCoder;
+ }
+ {
+ unsigned limit, offset;
+ CLzmaProb *probLen = prob + LenChoice;
+ IF_BIT_0(probLen)
+ {
+ UPDATE_0(probLen);
+ probLen = prob + LenLow + (posState << kLenNumLowBits);
+ offset = 0;
+ limit = (1 << kLenNumLowBits);
+ }
+ else
+ {
+ UPDATE_1(probLen);
+ probLen = prob + LenChoice2;
+ IF_BIT_0(probLen)
+ {
+ UPDATE_0(probLen);
+ probLen = prob + LenMid + (posState << kLenNumMidBits);
+ offset = kLenNumLowSymbols;
+ limit = (1 << kLenNumMidBits);
+ }
+ else
+ {
+ UPDATE_1(probLen);
+ probLen = prob + LenHigh;
+ offset = kLenNumLowSymbols + kLenNumMidSymbols;
+ limit = (1 << kLenNumHighBits);
+ }
+ }
+ TREE_DECODE(probLen, limit, len);
+ len += offset;
+ }
+
+ if (state >= kNumStates)
+ {
+ UInt32 distance;
+ prob = probs + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
+ TREE_6_DECODE(prob, distance);
+ if (distance >= kStartPosModelIndex)
+ {
+ unsigned posSlot = (unsigned)distance;
+ int numDirectBits = (int)(((distance >> 1) - 1));
+ distance = (2 | (distance & 1));
+ if (posSlot < kEndPosModelIndex)
+ {
+ distance <<= numDirectBits;
+ prob = probs + SpecPos + distance - posSlot - 1;
+ {
+ UInt32 mask = 1;
+ unsigned i = 1;
+ do
+ {
+ GET_BIT2(prob + i, i, ; , distance |= mask);
+ mask <<= 1;
+ }
+ while (--numDirectBits != 0);
+ }
+ }
+ else
+ {
+ numDirectBits -= kNumAlignBits;
+ do
+ {
+ NORMALIZE
+ range >>= 1;
+
+ {
+ UInt32 t;
+ code -= range;
+ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
+ distance = (distance << 1) + (t + 1);
+ code += range & t;
+ }
+ /*
+ distance <<= 1;
+ if (code >= range)
+ {
+ code -= range;
+ distance |= 1;
+ }
+ */
+ }
+ while (--numDirectBits != 0);
+ prob = probs + Align;
+ distance <<= kNumAlignBits;
+ {
+ unsigned i = 1;
+ GET_BIT2(prob + i, i, ; , distance |= 1);
+ GET_BIT2(prob + i, i, ; , distance |= 2);
+ GET_BIT2(prob + i, i, ; , distance |= 4);
+ GET_BIT2(prob + i, i, ; , distance |= 8);
+ }
+ if (distance == (UInt32)0xFFFFFFFF)
+ {
+ len += kMatchSpecLenStart;
+ state -= kNumStates;
+ break;
+ }
+ }
+ }
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ rep0 = distance + 1;
+ if (checkDicSize == 0)
+ {
+ if (distance >= processedPos)
+ return SZ_ERROR_DATA;
+ }
+ else if (distance >= checkDicSize)
+ return SZ_ERROR_DATA;
+ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
+ /* state = kLiteralNextStates[state]; */
+ }
+
+ len += kMatchMinLen;
+
+ if (limit == dicPos)
+ return SZ_ERROR_DATA;
+ {
+ SizeT rem = limit - dicPos;
+ unsigned curLen = ((rem < len) ? (unsigned)rem : len);
+ SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0);
+
+ processedPos += curLen;
+
+ len -= curLen;
+ if (pos + curLen <= dicBufSize)
+ {
+ Byte *dest = dic + dicPos;
+ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
+ const Byte *lim = dest + curLen;
+ dicPos += curLen;
+ do
+ *(dest) = (Byte)*(dest + src);
+ while (++dest != lim);
+ }
+ else
+ {
+ do
+ {
+ dic[dicPos++] = dic[pos];
+ if (++pos == dicBufSize)
+ pos = 0;
+ }
+ while (--curLen != 0);
+ }
+ }
+ }
+ }
+ while (dicPos < limit && buf < bufLimit);
+ NORMALIZE;
+ p->buf = buf;
+ p->range = range;
+ p->code = code;
+ p->remainLen = len;
+ p->dicPos = dicPos;
+ p->processedPos = processedPos;
+ p->reps[0] = rep0;
+ p->reps[1] = rep1;
+ p->reps[2] = rep2;
+ p->reps[3] = rep3;
+ p->state = state;
+
+ return SZ_OK;
+}
+
+static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
+{
+ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
+ {
+ Byte *dic = p->dic;
+ SizeT dicPos = p->dicPos;
+ SizeT dicBufSize = p->dicBufSize;
+ unsigned len = p->remainLen;
+ UInt32 rep0 = p->reps[0];
+ if (limit - dicPos < len)
+ len = (unsigned)(limit - dicPos);
+
+ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
+ p->checkDicSize = p->prop.dicSize;
+
+ p->processedPos += len;
+ p->remainLen -= len;
+ while (len-- != 0)
+ {
+ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
+ dicPos++;
+ }
+ p->dicPos = dicPos;
+ }
+}
+
+static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
+{
+ do
+ {
+ SizeT limit2 = limit;
+ if (p->checkDicSize == 0)
+ {
+ UInt32 rem = p->prop.dicSize - p->processedPos;
+ if (limit - p->dicPos > rem)
+ limit2 = p->dicPos + rem;
+ }
+ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit));
+ if (p->processedPos >= p->prop.dicSize)
+ p->checkDicSize = p->prop.dicSize;
+ LzmaDec_WriteRem(p, limit);
+ }
+ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);
+
+ if (p->remainLen > kMatchSpecLenStart)
+ {
+ p->remainLen = kMatchSpecLenStart;
+ }
+ return 0;
+}
+
+typedef enum
+{
+ DUMMY_ERROR, /* unexpected end of input stream */
+ DUMMY_LIT,
+ DUMMY_MATCH,
+ DUMMY_REP
+} ELzmaDummy;
+
+static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
+{
+ UInt32 range = p->range;
+ UInt32 code = p->code;
+ const Byte *bufLimit = buf + inSize;
+ CLzmaProb *probs = p->probs;
+ unsigned state = p->state;
+ ELzmaDummy res;
+
+ {
+ CLzmaProb *prob;
+ UInt32 bound;
+ unsigned ttt;
+ unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1);
+
+ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK
+
+ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */
+
+ prob = probs + Literal;
+ if (p->checkDicSize != 0 || p->processedPos != 0)
+ prob += (LZMA_LIT_SIZE *
+ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
+ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
+
+ if (state < kNumLitStates)
+ {
+ unsigned symbol = 1;
+ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);
+ }
+ else
+ {
+ unsigned matchByte = p->dic[p->dicPos - p->reps[0] +
+ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)];
+ unsigned offs = 0x100;
+ unsigned symbol = 1;
+ do
+ {
+ unsigned bit;
+ CLzmaProb *probLit;
+ matchByte <<= 1;
+ bit = (matchByte & offs);
+ probLit = prob + offs + bit + symbol;
+ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit)
+ }
+ while (symbol < 0x100);
+ }
+ res = DUMMY_LIT;
+ }
+ else
+ {
+ unsigned len;
+ UPDATE_1_CHECK;
+
+ prob = probs + IsRep + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ state = 0;
+ prob = probs + LenCoder;
+ res = DUMMY_MATCH;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ res = DUMMY_REP;
+ prob = probs + IsRepG0 + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ NORMALIZE_CHECK;
+ return DUMMY_REP;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ }
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ prob = probs + IsRepG1 + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ prob = probs + IsRepG2 + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ }
+ }
+ }
+ state = kNumStates;
+ prob = probs + RepLenCoder;
+ }
+ {
+ unsigned limit, offset;
+ CLzmaProb *probLen = prob + LenChoice;
+ IF_BIT_0_CHECK(probLen)
+ {
+ UPDATE_0_CHECK;
+ probLen = prob + LenLow + (posState << kLenNumLowBits);
+ offset = 0;
+ limit = 1 << kLenNumLowBits;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ probLen = prob + LenChoice2;
+ IF_BIT_0_CHECK(probLen)
+ {
+ UPDATE_0_CHECK;
+ probLen = prob + LenMid + (posState << kLenNumMidBits);
+ offset = kLenNumLowSymbols;
+ limit = 1 << kLenNumMidBits;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ probLen = prob + LenHigh;
+ offset = kLenNumLowSymbols + kLenNumMidSymbols;
+ limit = 1 << kLenNumHighBits;
+ }
+ }
+ TREE_DECODE_CHECK(probLen, limit, len);
+ len += offset;
+ }
+
+ if (state < 4)
+ {
+ unsigned posSlot;
+ prob = probs + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
+ kNumPosSlotBits);
+ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);
+ if (posSlot >= kStartPosModelIndex)
+ {
+ int numDirectBits = ((posSlot >> 1) - 1);
+
+ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */
+
+ if (posSlot < kEndPosModelIndex)
+ {
+ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1;
+ }
+ else
+ {
+ numDirectBits -= kNumAlignBits;
+ do
+ {
+ NORMALIZE_CHECK
+ range >>= 1;
+ code -= range & (((code - range) >> 31) - 1);
+ /* if (code >= range) code -= range; */
+ }
+ while (--numDirectBits != 0);
+ prob = probs + Align;
+ numDirectBits = kNumAlignBits;
+ }
+ {
+ unsigned i = 1;
+ do
+ {
+ GET_BIT_CHECK(prob + i, i);
+ }
+ while (--numDirectBits != 0);
+ }
+ }
+ }
+ }
+ }
+ NORMALIZE_CHECK;
+ return res;
+}
+
+
+static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
+{
+ p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);
+ p->range = 0xFFFFFFFF;
+ p->needFlush = 0;
+}
+
+void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState)
+{
+ p->needFlush = 1;
+ p->remainLen = 0;
+ p->tempBufSize = 0;
+
+ if (initDic)
+ {
+ p->processedPos = 0;
+ p->checkDicSize = 0;
+ p->needInitState = 1;
+ }
+ if (initState)
+ p->needInitState = 1;
+}
+
+void LzmaDec_Init(CLzmaDec *p)
+{
+ p->dicPos = 0;
+ LzmaDec_InitDicAndState(p, True, True);
+}
+
+static void LzmaDec_InitStateReal(CLzmaDec *p)
+{
+ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp));
+ UInt32 i;
+ CLzmaProb *probs = p->probs;
+ for (i = 0; i < numProbs; i++)
+ probs[i] = kBitModelTotal >> 1;
+ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;
+ p->state = 0;
+ p->needInitState = 0;
+}
+
+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
+ ELzmaFinishMode finishMode, ELzmaStatus *status)
+{
+ SizeT inSize = *srcLen;
+ (*srcLen) = 0;
+ LzmaDec_WriteRem(p, dicLimit);
+
+ *status = LZMA_STATUS_NOT_SPECIFIED;
+
+ while (p->remainLen != kMatchSpecLenStart)
+ {
+ int checkEndMarkNow;
+
+ if (p->needFlush != 0)
+ {
+ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)
+ p->tempBuf[p->tempBufSize++] = *src++;
+ if (p->tempBufSize < RC_INIT_SIZE)
+ {
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ if (p->tempBuf[0] != 0)
+ return SZ_ERROR_DATA;
+
+ LzmaDec_InitRc(p, p->tempBuf);
+ p->tempBufSize = 0;
+ }
+
+ checkEndMarkNow = 0;
+ if (p->dicPos >= dicLimit)
+ {
+ if (p->remainLen == 0 && p->code == 0)
+ {
+ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;
+ return SZ_OK;
+ }
+ if (finishMode == LZMA_FINISH_ANY)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_OK;
+ }
+ if (p->remainLen != 0)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_ERROR_DATA;
+ }
+ checkEndMarkNow = 1;
+ }
+
+ if (p->needInitState)
+ LzmaDec_InitStateReal(p);
+
+ if (p->tempBufSize == 0)
+ {
+ SizeT processed;
+ const Byte *bufLimit;
+ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
+ {
+ int dummyRes = LzmaDec_TryDummy(p, src, inSize);
+ if (dummyRes == DUMMY_ERROR)
+ {
+ memcpy(p->tempBuf, src, inSize);
+ p->tempBufSize = (unsigned)inSize;
+ (*srcLen) += inSize;
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_ERROR_DATA;
+ }
+ bufLimit = src;
+ }
+ else
+ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;
+ p->buf = src;
+ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)
+ return SZ_ERROR_DATA;
+ processed = (SizeT)(p->buf - src);
+ (*srcLen) += processed;
+ src += processed;
+ inSize -= processed;
+ }
+ else
+ {
+ unsigned rem = p->tempBufSize, lookAhead = 0;
+ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)
+ p->tempBuf[rem++] = src[lookAhead++];
+ p->tempBufSize = rem;
+ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
+ {
+ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);
+ if (dummyRes == DUMMY_ERROR)
+ {
+ (*srcLen) += lookAhead;
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_ERROR_DATA;
+ }
+ }
+ p->buf = p->tempBuf;
+ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)
+ return SZ_ERROR_DATA;
+ lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf));
+ (*srcLen) += lookAhead;
+ src += lookAhead;
+ inSize -= lookAhead;
+ p->tempBufSize = 0;
+ }
+ }
+ if (p->code == 0)
+ *status = LZMA_STATUS_FINISHED_WITH_MARK;
+ return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;
+}
+
+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
+{
+ SizeT outSize = *destLen;
+ SizeT inSize = *srcLen;
+ *srcLen = *destLen = 0;
+ for (;;)
+ {
+ SizeT inSizeCur = inSize, outSizeCur, dicPos;
+ ELzmaFinishMode curFinishMode;
+ SRes res;
+ if (p->dicPos == p->dicBufSize)
+ p->dicPos = 0;
+ dicPos = p->dicPos;
+ if (outSize > p->dicBufSize - dicPos)
+ {
+ outSizeCur = p->dicBufSize;
+ curFinishMode = LZMA_FINISH_ANY;
+ }
+ else
+ {
+ outSizeCur = dicPos + outSize;
+ curFinishMode = finishMode;
+ }
+
+ res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);
+ src += inSizeCur;
+ inSize -= inSizeCur;
+ *srcLen += inSizeCur;
+ outSizeCur = p->dicPos - dicPos;
+ memcpy(dest, p->dic + dicPos, outSizeCur);
+ dest += outSizeCur;
+ outSize -= outSizeCur;
+ *destLen += outSizeCur;
+ if (res != 0)
+ return res;
+ if (outSizeCur == 0 || outSize == 0)
+ return SZ_OK;
+ }
+}
+
+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
+{
+ alloc->Free(alloc, p->probs);
+ p->probs = 0;
+}
+
+static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc)
+{
+ alloc->Free(alloc, p->dic);
+ p->dic = 0;
+}
+
+void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc)
+{
+ LzmaDec_FreeProbs(p, alloc);
+ LzmaDec_FreeDict(p, alloc);
+}
+
+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
+{
+ UInt32 dicSize;
+ Byte d;
+
+ if (size < LZMA_PROPS_SIZE)
+ return SZ_ERROR_UNSUPPORTED;
+ else
+ dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
+
+ if (dicSize < LZMA_DIC_MIN)
+ dicSize = LZMA_DIC_MIN;
+ p->dicSize = dicSize;
+
+ d = data[0];
+ if (d >= (9 * 5 * 5))
+ return SZ_ERROR_UNSUPPORTED;
+
+ p->lc = d % 9;
+ d /= 9;
+ p->pb = d / 5;
+ p->lp = d % 5;
+
+ return SZ_OK;
+}
+
+static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
+{
+ UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
+ if (p->probs == 0 || numProbs != p->numProbs)
+ {
+ LzmaDec_FreeProbs(p, alloc);
+ p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb));
+ p->numProbs = numProbs;
+ if (p->probs == 0)
+ return SZ_ERROR_MEM;
+ }
+ return SZ_OK;
+}
+
+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)
+{
+ CLzmaProps propNew;
+ RINOK(LzmaProps_Decode(&propNew, props, propsSize));
+ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
+ p->prop = propNew;
+ return SZ_OK;
+}
+
+SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)
+{
+ CLzmaProps propNew;
+ SizeT dicBufSize;
+ RINOK(LzmaProps_Decode(&propNew, props, propsSize));
+ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
+ dicBufSize = propNew.dicSize;
+ if (p->dic == 0 || dicBufSize != p->dicBufSize)
+ {
+ LzmaDec_FreeDict(p, alloc);
+ p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize);
+ if (p->dic == 0)
+ {
+ LzmaDec_FreeProbs(p, alloc);
+ return SZ_ERROR_MEM;
+ }
+ }
+ p->dicBufSize = dicBufSize;
+ p->prop = propNew;
+ return SZ_OK;
+}
+
+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
+ ELzmaStatus *status, ISzAlloc *alloc)
+{
+ CLzmaDec p;
+ SRes res;
+ SizeT inSize = *srcLen;
+ SizeT outSize = *destLen;
+ *srcLen = *destLen = 0;
+ if (inSize < RC_INIT_SIZE)
+ return SZ_ERROR_INPUT_EOF;
+
+ LzmaDec_Construct(&p);
+ res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc);
+ if (res != 0)
+ return res;
+ p.dic = dest;
+ p.dicBufSize = outSize;
+
+ LzmaDec_Init(&p);
+
+ *srcLen = inSize;
+ res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
+
+ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
+ res = SZ_ERROR_INPUT_EOF;
+
+ (*destLen) = p.dicPos;
+ LzmaDec_FreeProbs(&p, alloc);
+ return res;
+}
diff --git a/extern/lzma/LzmaDec.h b/extern/lzma/LzmaDec.h
new file mode 100644
index 00000000000..98cdbe94949
--- /dev/null
+++ b/extern/lzma/LzmaDec.h
@@ -0,0 +1,223 @@
+/* LzmaDec.h -- LZMA Decoder
+2008-10-04 : Igor Pavlov : Public domain */
+
+#ifndef __LZMADEC_H
+#define __LZMADEC_H
+
+#include "Types.h"
+
+/* #define _LZMA_PROB32 */
+/* _LZMA_PROB32 can increase the speed on some CPUs,
+ but memory usage for CLzmaDec::probs will be doubled in that case */
+
+#ifdef _LZMA_PROB32
+#define CLzmaProb UInt32
+#else
+#define CLzmaProb UInt16
+#endif
+
+
+/* ---------- LZMA Properties ---------- */
+
+#define LZMA_PROPS_SIZE 5
+
+typedef struct _CLzmaProps
+{
+ unsigned lc, lp, pb;
+ UInt32 dicSize;
+} CLzmaProps;
+
+/* LzmaProps_Decode - decodes properties
+Returns:
+ SZ_OK
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+*/
+
+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
+
+
+/* ---------- LZMA Decoder state ---------- */
+
+/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
+ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
+
+#define LZMA_REQUIRED_INPUT_MAX 20
+
+typedef struct
+{
+ CLzmaProps prop;
+ CLzmaProb *probs;
+ Byte *dic;
+ const Byte *buf;
+ UInt32 range, code;
+ SizeT dicPos;
+ SizeT dicBufSize;
+ UInt32 processedPos;
+ UInt32 checkDicSize;
+ unsigned state;
+ UInt32 reps[4];
+ unsigned remainLen;
+ int needFlush;
+ int needInitState;
+ UInt32 numProbs;
+ unsigned tempBufSize;
+ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
+} CLzmaDec;
+
+#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
+
+void LzmaDec_Init(CLzmaDec *p);
+
+/* There are two types of LZMA streams:
+ 0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
+ 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
+
+typedef enum
+{
+ LZMA_FINISH_ANY, /* finish at any point */
+ LZMA_FINISH_END /* block must be finished at the end */
+} ELzmaFinishMode;
+
+/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
+
+ You must use LZMA_FINISH_END, when you know that current output buffer
+ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
+
+ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
+ and output value of destLen will be less than output buffer size limit.
+ You can check status result also.
+
+ You can use multiple checks to test data integrity after full decompression:
+ 1) Check Result and "status" variable.
+ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
+ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
+ You must use correct finish mode in that case. */
+
+typedef enum
+{
+ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
+ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
+ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
+ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
+} ELzmaStatus;
+
+/* ELzmaStatus is used only as output value for function call */
+
+
+/* ---------- Interfaces ---------- */
+
+/* There are 3 levels of interfaces:
+ 1) Dictionary Interface
+ 2) Buffer Interface
+ 3) One Call Interface
+ You can select any of these interfaces, but don't mix functions from different
+ groups for same object. */
+
+
+/* There are two variants to allocate state for Dictionary Interface:
+ 1) LzmaDec_Allocate / LzmaDec_Free
+ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
+ You can use variant 2, if you set dictionary buffer manually.
+ For Buffer Interface you must always use variant 1.
+
+LzmaDec_Allocate* can return:
+ SZ_OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+*/
+
+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
+
+SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
+void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
+
+/* ---------- Dictionary Interface ---------- */
+
+/* You can use it, if you want to eliminate the overhead for data copying from
+ dictionary to some other external buffer.
+ You must work with CLzmaDec variables directly in this interface.
+
+ STEPS:
+ LzmaDec_Constr()
+ LzmaDec_Allocate()
+ for (each new stream)
+ {
+ LzmaDec_Init()
+ while (it needs more decompression)
+ {
+ LzmaDec_DecodeToDic()
+ use data from CLzmaDec::dic and update CLzmaDec::dicPos
+ }
+ }
+ LzmaDec_Free()
+*/
+
+/* LzmaDec_DecodeToDic
+
+ The decoding to internal dictionary buffer (CLzmaDec::dic).
+ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
+
+finishMode:
+ It has meaning only if the decoding reaches output limit (dicLimit).
+ LZMA_FINISH_ANY - Decode just dicLimit bytes.
+ LZMA_FINISH_END - Stream must be finished after dicLimit.
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_NEEDS_MORE_INPUT
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
+ SZ_ERROR_DATA - Data error
+*/
+
+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+
+/* ---------- Buffer Interface ---------- */
+
+/* It's zlib-like interface.
+ See LzmaDec_DecodeToDic description for information about STEPS and return results,
+ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
+ to work with CLzmaDec variables manually.
+
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - Decode just destLen bytes.
+ LZMA_FINISH_END - Stream must be finished after (*destLen).
+*/
+
+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+
+/* ---------- One Call Interface ---------- */
+
+/* LzmaDecode
+
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - Decode just destLen bytes.
+ LZMA_FINISH_END - Stream must be finished after (*destLen).
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
+*/
+
+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
+ ELzmaStatus *status, ISzAlloc *alloc);
+
+#endif
diff --git a/extern/lzma/LzmaEnc.c b/extern/lzma/LzmaEnc.c
new file mode 100644
index 00000000000..9196c43f64b
--- /dev/null
+++ b/extern/lzma/LzmaEnc.c
@@ -0,0 +1,2281 @@
+/* LzmaEnc.c -- LZMA Encoder
+2009-02-02 : Igor Pavlov : Public domain */
+
+#include <string.h>
+
+/* #define SHOW_STAT */
+/* #define SHOW_STAT2 */
+
+#if defined(SHOW_STAT) || defined(SHOW_STAT2)
+#include <stdio.h>
+#endif
+
+#include "LzmaEnc.h"
+
+#include "LzFind.h"
+#ifdef COMPRESS_MF_MT
+#include "LzFindMt.h"
+#endif
+
+#ifdef SHOW_STAT
+static int ttt = 0;
+#endif
+
+#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1)
+
+#define kBlockSize (9 << 10)
+#define kUnpackBlockSize (1 << 18)
+#define kMatchArraySize (1 << 21)
+#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX)
+
+#define kNumMaxDirectBits (31)
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+#define kProbInitValue (kBitModelTotal >> 1)
+
+#define kNumMoveReducingBits 4
+#define kNumBitPriceShiftBits 4
+#define kBitPrice (1 << kNumBitPriceShiftBits)
+
+void LzmaEncProps_Init(CLzmaEncProps *p)
+{
+ p->level = 5;
+ p->dictSize = p->mc = 0;
+ p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1;
+ p->writeEndMark = 0;
+}
+
+void LzmaEncProps_Normalize(CLzmaEncProps *p)
+{
+ int level = p->level;
+ if (level < 0) level = 5;
+ p->level = level;
+ if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26)));
+ if (p->lc < 0) p->lc = 3;
+ if (p->lp < 0) p->lp = 0;
+ if (p->pb < 0) p->pb = 2;
+ if (p->algo < 0) p->algo = (level < 5 ? 0 : 1);
+ if (p->fb < 0) p->fb = (level < 7 ? 32 : 64);
+ if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);
+ if (p->numHashBytes < 0) p->numHashBytes = 4;
+ if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);
+ if (p->numThreads < 0)
+ p->numThreads =
+ #ifdef COMPRESS_MF_MT
+ ((p->btMode && p->algo) ? 2 : 1);
+ #else
+ 1;
+ #endif
+}
+
+UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)
+{
+ CLzmaEncProps props = *props2;
+ LzmaEncProps_Normalize(&props);
+ return props.dictSize;
+}
+
+/* #define LZMA_LOG_BSR */
+/* Define it for Intel's CPU */
+
+
+#ifdef LZMA_LOG_BSR
+
+#define kDicLogSizeMaxCompress 30
+
+#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); }
+
+UInt32 GetPosSlot1(UInt32 pos)
+{
+ UInt32 res;
+ BSR2_RET(pos, res);
+ return res;
+}
+#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
+#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); }
+
+#else
+
+#define kNumLogBits (9 + (int)sizeof(size_t) / 2)
+#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7)
+
+void LzmaEnc_FastPosInit(Byte *g_FastPos)
+{
+ int c = 2, slotFast;
+ g_FastPos[0] = 0;
+ g_FastPos[1] = 1;
+
+ for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++)
+ {
+ UInt32 k = (1 << ((slotFast >> 1) - 1));
+ UInt32 j;
+ for (j = 0; j < k; j++, c++)
+ g_FastPos[c] = (Byte)slotFast;
+ }
+}
+
+#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \
+ (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \
+ res = p->g_FastPos[pos >> i] + (i * 2); }
+/*
+#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \
+ p->g_FastPos[pos >> 6] + 12 : \
+ p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; }
+*/
+
+#define GetPosSlot1(pos) p->g_FastPos[pos]
+#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
+#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); }
+
+#endif
+
+
+#define LZMA_NUM_REPS 4
+
+typedef unsigned CState;
+
+typedef struct _COptimal
+{
+ UInt32 price;
+
+ CState state;
+ int prev1IsChar;
+ int prev2;
+
+ UInt32 posPrev2;
+ UInt32 backPrev2;
+
+ UInt32 posPrev;
+ UInt32 backPrev;
+ UInt32 backs[LZMA_NUM_REPS];
+} COptimal;
+
+#define kNumOpts (1 << 12)
+
+#define kNumLenToPosStates 4
+#define kNumPosSlotBits 6
+#define kDicLogSizeMin 0
+#define kDicLogSizeMax 32
+#define kDistTableSizeMax (kDicLogSizeMax * 2)
+
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+#define kAlignMask (kAlignTableSize - 1)
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex)
+
+#define kNumFullDistances (1 << (kEndPosModelIndex / 2))
+
+#ifdef _LZMA_PROB32
+#define CLzmaProb UInt32
+#else
+#define CLzmaProb UInt16
+#endif
+
+#define LZMA_PB_MAX 4
+#define LZMA_LC_MAX 8
+#define LZMA_LP_MAX 4
+
+#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX)
+
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumMidBits 3
+#define kLenNumMidSymbols (1 << kLenNumMidBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+
+#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
+
+#define LZMA_MATCH_LEN_MIN 2
+#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)
+
+#define kNumStates 12
+
+typedef struct
+{
+ CLzmaProb choice;
+ CLzmaProb choice2;
+ CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits];
+ CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits];
+ CLzmaProb high[kLenNumHighSymbols];
+} CLenEnc;
+
+typedef struct
+{
+ CLenEnc p;
+ UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal];
+ UInt32 tableSize;
+ UInt32 counters[LZMA_NUM_PB_STATES_MAX];
+} CLenPriceEnc;
+
+typedef struct _CRangeEnc
+{
+ UInt32 range;
+ Byte cache;
+ UInt64 low;
+ UInt64 cacheSize;
+ Byte *buf;
+ Byte *bufLim;
+ Byte *bufBase;
+ ISeqOutStream *outStream;
+ UInt64 processed;
+ SRes res;
+} CRangeEnc;
+
+typedef struct _CSeqInStreamBuf
+{
+ ISeqInStream funcTable;
+ const Byte *data;
+ SizeT rem;
+} CSeqInStreamBuf;
+
+static SRes MyRead(void *pp, void *data, size_t *size)
+{
+ size_t curSize = *size;
+ CSeqInStreamBuf *p = (CSeqInStreamBuf *)pp;
+ if (p->rem < curSize)
+ curSize = p->rem;
+ memcpy(data, p->data, curSize);
+ p->rem -= curSize;
+ p->data += curSize;
+ *size = curSize;
+ return SZ_OK;
+}
+
+typedef struct
+{
+ CLzmaProb *litProbs;
+
+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
+ CLzmaProb isRep[kNumStates];
+ CLzmaProb isRepG0[kNumStates];
+ CLzmaProb isRepG1[kNumStates];
+ CLzmaProb isRepG2[kNumStates];
+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
+
+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
+ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex];
+ CLzmaProb posAlignEncoder[1 << kNumAlignBits];
+
+ CLenPriceEnc lenEnc;
+ CLenPriceEnc repLenEnc;
+
+ UInt32 reps[LZMA_NUM_REPS];
+ UInt32 state;
+} CSaveState;
+
+typedef struct _CLzmaEnc
+{
+ IMatchFinder matchFinder;
+ void *matchFinderObj;
+
+ #ifdef COMPRESS_MF_MT
+ Bool mtMode;
+ CMatchFinderMt matchFinderMt;
+ #endif
+
+ CMatchFinder matchFinderBase;
+
+ #ifdef COMPRESS_MF_MT
+ Byte pad[128];
+ #endif
+
+ UInt32 optimumEndIndex;
+ UInt32 optimumCurrentIndex;
+
+ UInt32 longestMatchLength;
+ UInt32 numPairs;
+ UInt32 numAvail;
+ COptimal opt[kNumOpts];
+
+ #ifndef LZMA_LOG_BSR
+ Byte g_FastPos[1 << kNumLogBits];
+ #endif
+
+ UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
+ UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1];
+ UInt32 numFastBytes;
+ UInt32 additionalOffset;
+ UInt32 reps[LZMA_NUM_REPS];
+ UInt32 state;
+
+ UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax];
+ UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances];
+ UInt32 alignPrices[kAlignTableSize];
+ UInt32 alignPriceCount;
+
+ UInt32 distTableSize;
+
+ unsigned lc, lp, pb;
+ unsigned lpMask, pbMask;
+
+ CLzmaProb *litProbs;
+
+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
+ CLzmaProb isRep[kNumStates];
+ CLzmaProb isRepG0[kNumStates];
+ CLzmaProb isRepG1[kNumStates];
+ CLzmaProb isRepG2[kNumStates];
+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
+
+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
+ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex];
+ CLzmaProb posAlignEncoder[1 << kNumAlignBits];
+
+ CLenPriceEnc lenEnc;
+ CLenPriceEnc repLenEnc;
+
+ unsigned lclp;
+
+ Bool fastMode;
+
+ CRangeEnc rc;
+
+ Bool writeEndMark;
+ UInt64 nowPos64;
+ UInt32 matchPriceCount;
+ Bool finished;
+ Bool multiThread;
+
+ SRes result;
+ UInt32 dictSize;
+ UInt32 matchFinderCycles;
+
+ ISeqInStream *inStream;
+ CSeqInStreamBuf seqBufInStream;
+
+ CSaveState saveState;
+} CLzmaEnc;
+
+void LzmaEnc_SaveState(CLzmaEncHandle pp)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ CSaveState *dest = &p->saveState;
+ int i;
+ dest->lenEnc = p->lenEnc;
+ dest->repLenEnc = p->repLenEnc;
+ dest->state = p->state;
+
+ for (i = 0; i < kNumStates; i++)
+ {
+ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i]));
+ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i]));
+ }
+ for (i = 0; i < kNumLenToPosStates; i++)
+ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i]));
+ memcpy(dest->isRep, p->isRep, sizeof(p->isRep));
+ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0));
+ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1));
+ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2));
+ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders));
+ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder));
+ memcpy(dest->reps, p->reps, sizeof(p->reps));
+ memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb));
+}
+
+void LzmaEnc_RestoreState(CLzmaEncHandle pp)
+{
+ CLzmaEnc *dest = (CLzmaEnc *)pp;
+ const CSaveState *p = &dest->saveState;
+ int i;
+ dest->lenEnc = p->lenEnc;
+ dest->repLenEnc = p->repLenEnc;
+ dest->state = p->state;
+
+ for (i = 0; i < kNumStates; i++)
+ {
+ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i]));
+ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i]));
+ }
+ for (i = 0; i < kNumLenToPosStates; i++)
+ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i]));
+ memcpy(dest->isRep, p->isRep, sizeof(p->isRep));
+ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0));
+ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1));
+ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2));
+ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders));
+ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder));
+ memcpy(dest->reps, p->reps, sizeof(p->reps));
+ memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb));
+}
+
+SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ CLzmaEncProps props = *props2;
+ LzmaEncProps_Normalize(&props);
+
+ if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX ||
+ props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30))
+ return SZ_ERROR_PARAM;
+ p->dictSize = props.dictSize;
+ p->matchFinderCycles = props.mc;
+ {
+ unsigned fb = props.fb;
+ if (fb < 5)
+ fb = 5;
+ if (fb > LZMA_MATCH_LEN_MAX)
+ fb = LZMA_MATCH_LEN_MAX;
+ p->numFastBytes = fb;
+ }
+ p->lc = props.lc;
+ p->lp = props.lp;
+ p->pb = props.pb;
+ p->fastMode = (props.algo == 0);
+ p->matchFinderBase.btMode = props.btMode;
+ {
+ UInt32 numHashBytes = 4;
+ if (props.btMode)
+ {
+ if (props.numHashBytes < 2)
+ numHashBytes = 2;
+ else if (props.numHashBytes < 4)
+ numHashBytes = props.numHashBytes;
+ }
+ p->matchFinderBase.numHashBytes = numHashBytes;
+ }
+
+ p->matchFinderBase.cutValue = props.mc;
+
+ p->writeEndMark = props.writeEndMark;
+
+ #ifdef COMPRESS_MF_MT
+ /*
+ if (newMultiThread != _multiThread)
+ {
+ ReleaseMatchFinder();
+ _multiThread = newMultiThread;
+ }
+ */
+ p->multiThread = (props.numThreads > 1);
+ #endif
+
+ return SZ_OK;
+}
+
+static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
+static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
+static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
+static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
+
+#define IsCharState(s) ((s) < 7)
+
+#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)
+
+#define kInfinityPrice (1 << 30)
+
+static void RangeEnc_Construct(CRangeEnc *p)
+{
+ p->outStream = 0;
+ p->bufBase = 0;
+}
+
+#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize)
+
+#define RC_BUF_SIZE (1 << 16)
+static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc)
+{
+ if (p->bufBase == 0)
+ {
+ p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE);
+ if (p->bufBase == 0)
+ return 0;
+ p->bufLim = p->bufBase + RC_BUF_SIZE;
+ }
+ return 1;
+}
+
+static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc)
+{
+ alloc->Free(alloc, p->bufBase);
+ p->bufBase = 0;
+}
+
+static void RangeEnc_Init(CRangeEnc *p)
+{
+ /* Stream.Init(); */
+ p->low = 0;
+ p->range = 0xFFFFFFFF;
+ p->cacheSize = 1;
+ p->cache = 0;
+
+ p->buf = p->bufBase;
+
+ p->processed = 0;
+ p->res = SZ_OK;
+}
+
+static void RangeEnc_FlushStream(CRangeEnc *p)
+{
+ size_t num;
+ if (p->res != SZ_OK)
+ return;
+ num = p->buf - p->bufBase;
+ if (num != p->outStream->Write(p->outStream, p->bufBase, num))
+ p->res = SZ_ERROR_WRITE;
+ p->processed += num;
+ p->buf = p->bufBase;
+}
+
+static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p)
+{
+ if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0)
+ {
+ Byte temp = p->cache;
+ do
+ {
+ Byte *buf = p->buf;
+ *buf++ = (Byte)(temp + (Byte)(p->low >> 32));
+ p->buf = buf;
+ if (buf == p->bufLim)
+ RangeEnc_FlushStream(p);
+ temp = 0xFF;
+ }
+ while (--p->cacheSize != 0);
+ p->cache = (Byte)((UInt32)p->low >> 24);
+ }
+ p->cacheSize++;
+ p->low = (UInt32)p->low << 8;
+}
+
+static void RangeEnc_FlushData(CRangeEnc *p)
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ RangeEnc_ShiftLow(p);
+}
+
+static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits)
+{
+ do
+ {
+ p->range >>= 1;
+ p->low += p->range & (0 - ((value >> --numBits) & 1));
+ if (p->range < kTopValue)
+ {
+ p->range <<= 8;
+ RangeEnc_ShiftLow(p);
+ }
+ }
+ while (numBits != 0);
+}
+
+static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol)
+{
+ UInt32 ttt = *prob;
+ UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt;
+ if (symbol == 0)
+ {
+ p->range = newBound;
+ ttt += (kBitModelTotal - ttt) >> kNumMoveBits;
+ }
+ else
+ {
+ p->low += newBound;
+ p->range -= newBound;
+ ttt -= ttt >> kNumMoveBits;
+ }
+ *prob = (CLzmaProb)ttt;
+ if (p->range < kTopValue)
+ {
+ p->range <<= 8;
+ RangeEnc_ShiftLow(p);
+ }
+}
+
+static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol)
+{
+ symbol |= 0x100;
+ do
+ {
+ RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1);
+ symbol <<= 1;
+ }
+ while (symbol < 0x10000);
+}
+
+static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte)
+{
+ UInt32 offs = 0x100;
+ symbol |= 0x100;
+ do
+ {
+ matchByte <<= 1;
+ RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);
+ symbol <<= 1;
+ offs &= ~(matchByte ^ symbol);
+ }
+ while (symbol < 0x10000);
+}
+
+void LzmaEnc_InitPriceTables(UInt32 *ProbPrices)
+{
+ UInt32 i;
+ for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits))
+ {
+ const int kCyclesBits = kNumBitPriceShiftBits;
+ UInt32 w = i;
+ UInt32 bitCount = 0;
+ int j;
+ for (j = 0; j < kCyclesBits; j++)
+ {
+ w = w * w;
+ bitCount <<= 1;
+ while (w >= ((UInt32)1 << 16))
+ {
+ w >>= 1;
+ bitCount++;
+ }
+ }
+ ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount);
+ }
+}
+
+
+#define GET_PRICE(prob, symbol) \
+ p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
+
+#define GET_PRICEa(prob, symbol) \
+ ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
+
+#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits]
+#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
+
+#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits]
+#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
+
+static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices)
+{
+ UInt32 price = 0;
+ symbol |= 0x100;
+ do
+ {
+ price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1);
+ symbol <<= 1;
+ }
+ while (symbol < 0x10000);
+ return price;
+}
+
+static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices)
+{
+ UInt32 price = 0;
+ UInt32 offs = 0x100;
+ symbol |= 0x100;
+ do
+ {
+ matchByte <<= 1;
+ price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1);
+ symbol <<= 1;
+ offs &= ~(matchByte ^ symbol);
+ }
+ while (symbol < 0x10000);
+ return price;
+}
+
+
+static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
+{
+ UInt32 m = 1;
+ int i;
+ for (i = numBitLevels; i != 0;)
+ {
+ UInt32 bit;
+ i--;
+ bit = (symbol >> i) & 1;
+ RangeEnc_EncodeBit(rc, probs + m, bit);
+ m = (m << 1) | bit;
+ }
+}
+
+static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
+{
+ UInt32 m = 1;
+ int i;
+ for (i = 0; i < numBitLevels; i++)
+ {
+ UInt32 bit = symbol & 1;
+ RangeEnc_EncodeBit(rc, probs + m, bit);
+ m = (m << 1) | bit;
+ symbol >>= 1;
+ }
+}
+
+static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
+{
+ UInt32 price = 0;
+ symbol |= (1 << numBitLevels);
+ while (symbol != 1)
+ {
+ price += GET_PRICEa(probs[symbol >> 1], symbol & 1);
+ symbol >>= 1;
+ }
+ return price;
+}
+
+static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
+{
+ UInt32 price = 0;
+ UInt32 m = 1;
+ int i;
+ for (i = numBitLevels; i != 0; i--)
+ {
+ UInt32 bit = symbol & 1;
+ symbol >>= 1;
+ price += GET_PRICEa(probs[m], bit);
+ m = (m << 1) | bit;
+ }
+ return price;
+}
+
+
+static void LenEnc_Init(CLenEnc *p)
+{
+ unsigned i;
+ p->choice = p->choice2 = kProbInitValue;
+ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++)
+ p->low[i] = kProbInitValue;
+ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++)
+ p->mid[i] = kProbInitValue;
+ for (i = 0; i < kLenNumHighSymbols; i++)
+ p->high[i] = kProbInitValue;
+}
+
+static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState)
+{
+ if (symbol < kLenNumLowSymbols)
+ {
+ RangeEnc_EncodeBit(rc, &p->choice, 0);
+ RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol);
+ }
+ else
+ {
+ RangeEnc_EncodeBit(rc, &p->choice, 1);
+ if (symbol < kLenNumLowSymbols + kLenNumMidSymbols)
+ {
+ RangeEnc_EncodeBit(rc, &p->choice2, 0);
+ RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols);
+ }
+ else
+ {
+ RangeEnc_EncodeBit(rc, &p->choice2, 1);
+ RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols);
+ }
+ }
+}
+
+static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices)
+{
+ UInt32 a0 = GET_PRICE_0a(p->choice);
+ UInt32 a1 = GET_PRICE_1a(p->choice);
+ UInt32 b0 = a1 + GET_PRICE_0a(p->choice2);
+ UInt32 b1 = a1 + GET_PRICE_1a(p->choice2);
+ UInt32 i = 0;
+ for (i = 0; i < kLenNumLowSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices);
+ }
+ for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices);
+ }
+ for (; i < numSymbols; i++)
+ prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices);
+}
+
+static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices)
+{
+ LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices);
+ p->counters[posState] = p->tableSize;
+}
+
+static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices)
+{
+ UInt32 posState;
+ for (posState = 0; posState < numPosStates; posState++)
+ LenPriceEnc_UpdateTable(p, posState, ProbPrices);
+}
+
+static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices)
+{
+ LenEnc_Encode(&p->p, rc, symbol, posState);
+ if (updatePrice)
+ if (--p->counters[posState] == 0)
+ LenPriceEnc_UpdateTable(p, posState, ProbPrices);
+}
+
+
+
+
+static void MovePos(CLzmaEnc *p, UInt32 num)
+{
+ #ifdef SHOW_STAT
+ ttt += num;
+ printf("\n MovePos %d", num);
+ #endif
+ if (num != 0)
+ {
+ p->additionalOffset += num;
+ p->matchFinder.Skip(p->matchFinderObj, num);
+ }
+}
+
+static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes)
+{
+ UInt32 lenRes = 0, numPairs;
+ p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
+ numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches);
+ #ifdef SHOW_STAT
+ printf("\n i = %d numPairs = %d ", ttt, numPairs / 2);
+ ttt++;
+ {
+ UInt32 i;
+ for (i = 0; i < numPairs; i += 2)
+ printf("%2d %6d | ", p->matches[i], p->matches[i + 1]);
+ }
+ #endif
+ if (numPairs > 0)
+ {
+ lenRes = p->matches[numPairs - 2];
+ if (lenRes == p->numFastBytes)
+ {
+ const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ UInt32 distance = p->matches[numPairs - 1] + 1;
+ UInt32 numAvail = p->numAvail;
+ if (numAvail > LZMA_MATCH_LEN_MAX)
+ numAvail = LZMA_MATCH_LEN_MAX;
+ {
+ const Byte *pby2 = pby - distance;
+ for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++);
+ }
+ }
+ }
+ p->additionalOffset++;
+ *numDistancePairsRes = numPairs;
+ return lenRes;
+}
+
+
+#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False;
+#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False;
+#define IsShortRep(p) ((p)->backPrev == 0)
+
+static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState)
+{
+ return
+ GET_PRICE_0(p->isRepG0[state]) +
+ GET_PRICE_0(p->isRep0Long[state][posState]);
+}
+
+static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState)
+{
+ UInt32 price;
+ if (repIndex == 0)
+ {
+ price = GET_PRICE_0(p->isRepG0[state]);
+ price += GET_PRICE_1(p->isRep0Long[state][posState]);
+ }
+ else
+ {
+ price = GET_PRICE_1(p->isRepG0[state]);
+ if (repIndex == 1)
+ price += GET_PRICE_0(p->isRepG1[state]);
+ else
+ {
+ price += GET_PRICE_1(p->isRepG1[state]);
+ price += GET_PRICE(p->isRepG2[state], repIndex - 2);
+ }
+ }
+ return price;
+}
+
+static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState)
+{
+ return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] +
+ GetPureRepPrice(p, repIndex, state, posState);
+}
+
+static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur)
+{
+ UInt32 posMem = p->opt[cur].posPrev;
+ UInt32 backMem = p->opt[cur].backPrev;
+ p->optimumEndIndex = cur;
+ do
+ {
+ if (p->opt[cur].prev1IsChar)
+ {
+ MakeAsChar(&p->opt[posMem])
+ p->opt[posMem].posPrev = posMem - 1;
+ if (p->opt[cur].prev2)
+ {
+ p->opt[posMem - 1].prev1IsChar = False;
+ p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2;
+ p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2;
+ }
+ }
+ {
+ UInt32 posPrev = posMem;
+ UInt32 backCur = backMem;
+
+ backMem = p->opt[posPrev].backPrev;
+ posMem = p->opt[posPrev].posPrev;
+
+ p->opt[posPrev].backPrev = backCur;
+ p->opt[posPrev].posPrev = cur;
+ cur = posPrev;
+ }
+ }
+ while (cur != 0);
+ *backRes = p->opt[0].backPrev;
+ p->optimumCurrentIndex = p->opt[0].posPrev;
+ return p->optimumCurrentIndex;
+}
+
+#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300)
+
+static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)
+{
+ UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, lenEnd, len, cur;
+ UInt32 matchPrice, repMatchPrice, normalMatchPrice;
+ UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS];
+ UInt32 *matches;
+ const Byte *data;
+ Byte curByte, matchByte;
+ if (p->optimumEndIndex != p->optimumCurrentIndex)
+ {
+ const COptimal *opt = &p->opt[p->optimumCurrentIndex];
+ UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex;
+ *backRes = opt->backPrev;
+ p->optimumCurrentIndex = opt->posPrev;
+ return lenRes;
+ }
+ p->optimumCurrentIndex = p->optimumEndIndex = 0;
+
+ if (p->additionalOffset == 0)
+ mainLen = ReadMatchDistances(p, &numPairs);
+ else
+ {
+ mainLen = p->longestMatchLength;
+ numPairs = p->numPairs;
+ }
+
+ numAvail = p->numAvail;
+ if (numAvail < 2)
+ {
+ *backRes = (UInt32)(-1);
+ return 1;
+ }
+ if (numAvail > LZMA_MATCH_LEN_MAX)
+ numAvail = LZMA_MATCH_LEN_MAX;
+
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ repMaxIndex = 0;
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ UInt32 lenTest;
+ const Byte *data2;
+ reps[i] = p->reps[i];
+ data2 = data - (reps[i] + 1);
+ if (data[0] != data2[0] || data[1] != data2[1])
+ {
+ repLens[i] = 0;
+ continue;
+ }
+ for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++);
+ repLens[i] = lenTest;
+ if (lenTest > repLens[repMaxIndex])
+ repMaxIndex = i;
+ }
+ if (repLens[repMaxIndex] >= p->numFastBytes)
+ {
+ UInt32 lenRes;
+ *backRes = repMaxIndex;
+ lenRes = repLens[repMaxIndex];
+ MovePos(p, lenRes - 1);
+ return lenRes;
+ }
+
+ matches = p->matches;
+ if (mainLen >= p->numFastBytes)
+ {
+ *backRes = matches[numPairs - 1] + LZMA_NUM_REPS;
+ MovePos(p, mainLen - 1);
+ return mainLen;
+ }
+ curByte = *data;
+ matchByte = *(data - (reps[0] + 1));
+
+ if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2)
+ {
+ *backRes = (UInt32)-1;
+ return 1;
+ }
+
+ p->opt[0].state = (CState)p->state;
+
+ posState = (position & p->pbMask);
+
+ {
+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
+ p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) +
+ (!IsCharState(p->state) ?
+ LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) :
+ LitEnc_GetPrice(probs, curByte, p->ProbPrices));
+ }
+
+ MakeAsChar(&p->opt[1]);
+
+ matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]);
+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]);
+
+ if (matchByte == curByte)
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState);
+ if (shortRepPrice < p->opt[1].price)
+ {
+ p->opt[1].price = shortRepPrice;
+ MakeAsShortRep(&p->opt[1]);
+ }
+ }
+ lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]);
+
+ if (lenEnd < 2)
+ {
+ *backRes = p->opt[1].backPrev;
+ return 1;
+ }
+
+ p->opt[1].posPrev = 0;
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ p->opt[0].backs[i] = reps[i];
+
+ len = lenEnd;
+ do
+ p->opt[len--].price = kInfinityPrice;
+ while (len >= 2);
+
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ UInt32 repLen = repLens[i];
+ UInt32 price;
+ if (repLen < 2)
+ continue;
+ price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState);
+ do
+ {
+ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2];
+ COptimal *opt = &p->opt[repLen];
+ if (curAndLenPrice < opt->price)
+ {
+ opt->price = curAndLenPrice;
+ opt->posPrev = 0;
+ opt->backPrev = i;
+ opt->prev1IsChar = False;
+ }
+ }
+ while (--repLen >= 2);
+ }
+
+ normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]);
+
+ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);
+ if (len <= mainLen)
+ {
+ UInt32 offs = 0;
+ while (len > matches[offs])
+ offs += 2;
+ for (; ; len++)
+ {
+ COptimal *opt;
+ UInt32 distance = matches[offs + 1];
+
+ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN];
+ UInt32 lenToPosState = GetLenToPosState(len);
+ if (distance < kNumFullDistances)
+ curAndLenPrice += p->distancesPrices[lenToPosState][distance];
+ else
+ {
+ UInt32 slot;
+ GetPosSlot2(distance, slot);
+ curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot];
+ }
+ opt = &p->opt[len];
+ if (curAndLenPrice < opt->price)
+ {
+ opt->price = curAndLenPrice;
+ opt->posPrev = 0;
+ opt->backPrev = distance + LZMA_NUM_REPS;
+ opt->prev1IsChar = False;
+ }
+ if (len == matches[offs])
+ {
+ offs += 2;
+ if (offs == numPairs)
+ break;
+ }
+ }
+ }
+
+ cur = 0;
+
+ #ifdef SHOW_STAT2
+ if (position >= 0)
+ {
+ unsigned i;
+ printf("\n pos = %4X", position);
+ for (i = cur; i <= lenEnd; i++)
+ printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price);
+ }
+ #endif
+
+ for (;;)
+ {
+ UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen;
+ UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice;
+ Bool nextIsChar;
+ Byte curByte, matchByte;
+ const Byte *data;
+ COptimal *curOpt;
+ COptimal *nextOpt;
+
+ cur++;
+ if (cur == lenEnd)
+ return Backward(p, backRes, cur);
+
+ newLen = ReadMatchDistances(p, &numPairs);
+ if (newLen >= p->numFastBytes)
+ {
+ p->numPairs = numPairs;
+ p->longestMatchLength = newLen;
+ return Backward(p, backRes, cur);
+ }
+ position++;
+ curOpt = &p->opt[cur];
+ posPrev = curOpt->posPrev;
+ if (curOpt->prev1IsChar)
+ {
+ posPrev--;
+ if (curOpt->prev2)
+ {
+ state = p->opt[curOpt->posPrev2].state;
+ if (curOpt->backPrev2 < LZMA_NUM_REPS)
+ state = kRepNextStates[state];
+ else
+ state = kMatchNextStates[state];
+ }
+ else
+ state = p->opt[posPrev].state;
+ state = kLiteralNextStates[state];
+ }
+ else
+ state = p->opt[posPrev].state;
+ if (posPrev == cur - 1)
+ {
+ if (IsShortRep(curOpt))
+ state = kShortRepNextStates[state];
+ else
+ state = kLiteralNextStates[state];
+ }
+ else
+ {
+ UInt32 pos;
+ const COptimal *prevOpt;
+ if (curOpt->prev1IsChar && curOpt->prev2)
+ {
+ posPrev = curOpt->posPrev2;
+ pos = curOpt->backPrev2;
+ state = kRepNextStates[state];
+ }
+ else
+ {
+ pos = curOpt->backPrev;
+ if (pos < LZMA_NUM_REPS)
+ state = kRepNextStates[state];
+ else
+ state = kMatchNextStates[state];
+ }
+ prevOpt = &p->opt[posPrev];
+ if (pos < LZMA_NUM_REPS)
+ {
+ UInt32 i;
+ reps[0] = prevOpt->backs[pos];
+ for (i = 1; i <= pos; i++)
+ reps[i] = prevOpt->backs[i - 1];
+ for (; i < LZMA_NUM_REPS; i++)
+ reps[i] = prevOpt->backs[i];
+ }
+ else
+ {
+ UInt32 i;
+ reps[0] = (pos - LZMA_NUM_REPS);
+ for (i = 1; i < LZMA_NUM_REPS; i++)
+ reps[i] = prevOpt->backs[i - 1];
+ }
+ }
+ curOpt->state = (CState)state;
+
+ curOpt->backs[0] = reps[0];
+ curOpt->backs[1] = reps[1];
+ curOpt->backs[2] = reps[2];
+ curOpt->backs[3] = reps[3];
+
+ curPrice = curOpt->price;
+ nextIsChar = False;
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ curByte = *data;
+ matchByte = *(data - (reps[0] + 1));
+
+ posState = (position & p->pbMask);
+
+ curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]);
+ {
+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
+ curAnd1Price +=
+ (!IsCharState(state) ?
+ LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) :
+ LitEnc_GetPrice(probs, curByte, p->ProbPrices));
+ }
+
+ nextOpt = &p->opt[cur + 1];
+
+ if (curAnd1Price < nextOpt->price)
+ {
+ nextOpt->price = curAnd1Price;
+ nextOpt->posPrev = cur;
+ MakeAsChar(nextOpt);
+ nextIsChar = True;
+ }
+
+ matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]);
+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]);
+
+ if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0))
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState);
+ if (shortRepPrice <= nextOpt->price)
+ {
+ nextOpt->price = shortRepPrice;
+ nextOpt->posPrev = cur;
+ MakeAsShortRep(nextOpt);
+ nextIsChar = True;
+ }
+ }
+ numAvailFull = p->numAvail;
+ {
+ UInt32 temp = kNumOpts - 1 - cur;
+ if (temp < numAvailFull)
+ numAvailFull = temp;
+ }
+
+ if (numAvailFull < 2)
+ continue;
+ numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes);
+
+ if (!nextIsChar && matchByte != curByte) /* speed optimization */
+ {
+ /* try Literal + rep0 */
+ UInt32 temp;
+ UInt32 lenTest2;
+ const Byte *data2 = data - (reps[0] + 1);
+ UInt32 limit = p->numFastBytes + 1;
+ if (limit > numAvailFull)
+ limit = numAvailFull;
+
+ for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++);
+ lenTest2 = temp - 1;
+ if (lenTest2 >= 2)
+ {
+ UInt32 state2 = kLiteralNextStates[state];
+ UInt32 posStateNext = (position + 1) & p->pbMask;
+ UInt32 nextRepMatchPrice = curAnd1Price +
+ GET_PRICE_1(p->isMatch[state2][posStateNext]) +
+ GET_PRICE_1(p->isRep[state2]);
+ /* for (; lenTest2 >= 2; lenTest2--) */
+ {
+ UInt32 curAndLenPrice;
+ COptimal *opt;
+ UInt32 offset = cur + 1 + lenTest2;
+ while (lenEnd < offset)
+ p->opt[++lenEnd].price = kInfinityPrice;
+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
+ opt = &p->opt[offset];
+ if (curAndLenPrice < opt->price)
+ {
+ opt->price = curAndLenPrice;
+ opt->posPrev = cur + 1;
+ opt->backPrev = 0;
+ opt->prev1IsChar = True;
+ opt->prev2 = False;
+ }
+ }
+ }
+ }
+
+ startLen = 2; /* speed optimization */
+ {
+ UInt32 repIndex;
+ for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++)
+ {
+ UInt32 lenTest;
+ UInt32 lenTestTemp;
+ UInt32 price;
+ const Byte *data2 = data - (reps[repIndex] + 1);
+ if (data[0] != data2[0] || data[1] != data2[1])
+ continue;
+ for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++);
+ while (lenEnd < cur + lenTest)
+ p->opt[++lenEnd].price = kInfinityPrice;
+ lenTestTemp = lenTest;
+ price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState);
+ do
+ {
+ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2];
+ COptimal *opt = &p->opt[cur + lenTest];
+ if (curAndLenPrice < opt->price)
+ {
+ opt->price = curAndLenPrice;
+ opt->posPrev = cur;
+ opt->backPrev = repIndex;
+ opt->prev1IsChar = False;
+ }
+ }
+ while (--lenTest >= 2);
+ lenTest = lenTestTemp;
+
+ if (repIndex == 0)
+ startLen = lenTest + 1;
+
+ /* if (_maxMode) */
+ {
+ UInt32 lenTest2 = lenTest + 1;
+ UInt32 limit = lenTest2 + p->numFastBytes;
+ UInt32 nextRepMatchPrice;
+ if (limit > numAvailFull)
+ limit = numAvailFull;
+ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
+ lenTest2 -= lenTest + 1;
+ if (lenTest2 >= 2)
+ {
+ UInt32 state2 = kRepNextStates[state];
+ UInt32 posStateNext = (position + lenTest) & p->pbMask;
+ UInt32 curAndLenCharPrice =
+ price + p->repLenEnc.prices[posState][lenTest - 2] +
+ GET_PRICE_0(p->isMatch[state2][posStateNext]) +
+ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]),
+ data[lenTest], data2[lenTest], p->ProbPrices);
+ state2 = kLiteralNextStates[state2];
+ posStateNext = (position + lenTest + 1) & p->pbMask;
+ nextRepMatchPrice = curAndLenCharPrice +
+ GET_PRICE_1(p->isMatch[state2][posStateNext]) +
+ GET_PRICE_1(p->isRep[state2]);
+
+ /* for (; lenTest2 >= 2; lenTest2--) */
+ {
+ UInt32 curAndLenPrice;
+ COptimal *opt;
+ UInt32 offset = cur + lenTest + 1 + lenTest2;
+ while (lenEnd < offset)
+ p->opt[++lenEnd].price = kInfinityPrice;
+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
+ opt = &p->opt[offset];
+ if (curAndLenPrice < opt->price)
+ {
+ opt->price = curAndLenPrice;
+ opt->posPrev = cur + lenTest + 1;
+ opt->backPrev = 0;
+ opt->prev1IsChar = True;
+ opt->prev2 = True;
+ opt->posPrev2 = cur;
+ opt->backPrev2 = repIndex;
+ }
+ }
+ }
+ }
+ }
+ }
+ /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */
+ if (newLen > numAvail)
+ {
+ newLen = numAvail;
+ for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2);
+ matches[numPairs] = newLen;
+ numPairs += 2;
+ }
+ if (newLen >= startLen)
+ {
+ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);
+ UInt32 offs, curBack, posSlot;
+ UInt32 lenTest;
+ while (lenEnd < cur + newLen)
+ p->opt[++lenEnd].price = kInfinityPrice;
+
+ offs = 0;
+ while (startLen > matches[offs])
+ offs += 2;
+ curBack = matches[offs + 1];
+ GetPosSlot2(curBack, posSlot);
+ for (lenTest = /*2*/ startLen; ; lenTest++)
+ {
+ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN];
+ UInt32 lenToPosState = GetLenToPosState(lenTest);
+ COptimal *opt;
+ if (curBack < kNumFullDistances)
+ curAndLenPrice += p->distancesPrices[lenToPosState][curBack];
+ else
+ curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask];
+
+ opt = &p->opt[cur + lenTest];
+ if (curAndLenPrice < opt->price)
+ {
+ opt->price = curAndLenPrice;
+ opt->posPrev = cur;
+ opt->backPrev = curBack + LZMA_NUM_REPS;
+ opt->prev1IsChar = False;
+ }
+
+ if (/*_maxMode && */lenTest == matches[offs])
+ {
+ /* Try Match + Literal + Rep0 */
+ const Byte *data2 = data - (curBack + 1);
+ UInt32 lenTest2 = lenTest + 1;
+ UInt32 limit = lenTest2 + p->numFastBytes;
+ UInt32 nextRepMatchPrice;
+ if (limit > numAvailFull)
+ limit = numAvailFull;
+ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
+ lenTest2 -= lenTest + 1;
+ if (lenTest2 >= 2)
+ {
+ UInt32 state2 = kMatchNextStates[state];
+ UInt32 posStateNext = (position + lenTest) & p->pbMask;
+ UInt32 curAndLenCharPrice = curAndLenPrice +
+ GET_PRICE_0(p->isMatch[state2][posStateNext]) +
+ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]),
+ data[lenTest], data2[lenTest], p->ProbPrices);
+ state2 = kLiteralNextStates[state2];
+ posStateNext = (posStateNext + 1) & p->pbMask;
+ nextRepMatchPrice = curAndLenCharPrice +
+ GET_PRICE_1(p->isMatch[state2][posStateNext]) +
+ GET_PRICE_1(p->isRep[state2]);
+
+ /* for (; lenTest2 >= 2; lenTest2--) */
+ {
+ UInt32 offset = cur + lenTest + 1 + lenTest2;
+ UInt32 curAndLenPrice;
+ COptimal *opt;
+ while (lenEnd < offset)
+ p->opt[++lenEnd].price = kInfinityPrice;
+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
+ opt = &p->opt[offset];
+ if (curAndLenPrice < opt->price)
+ {
+ opt->price = curAndLenPrice;
+ opt->posPrev = cur + lenTest + 1;
+ opt->backPrev = 0;
+ opt->prev1IsChar = True;
+ opt->prev2 = True;
+ opt->posPrev2 = cur;
+ opt->backPrev2 = curBack + LZMA_NUM_REPS;
+ }
+ }
+ }
+ offs += 2;
+ if (offs == numPairs)
+ break;
+ curBack = matches[offs + 1];
+ if (curBack >= kNumFullDistances)
+ GetPosSlot2(curBack, posSlot);
+ }
+ }
+ }
+ }
+}
+
+#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist))
+
+static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes)
+{
+ UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i;
+ const Byte *data;
+ const UInt32 *matches;
+
+ if (p->additionalOffset == 0)
+ mainLen = ReadMatchDistances(p, &numPairs);
+ else
+ {
+ mainLen = p->longestMatchLength;
+ numPairs = p->numPairs;
+ }
+
+ numAvail = p->numAvail;
+ *backRes = (UInt32)-1;
+ if (numAvail < 2)
+ return 1;
+ if (numAvail > LZMA_MATCH_LEN_MAX)
+ numAvail = LZMA_MATCH_LEN_MAX;
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+
+ repLen = repIndex = 0;
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ UInt32 len;
+ const Byte *data2 = data - (p->reps[i] + 1);
+ if (data[0] != data2[0] || data[1] != data2[1])
+ continue;
+ for (len = 2; len < numAvail && data[len] == data2[len]; len++);
+ if (len >= p->numFastBytes)
+ {
+ *backRes = i;
+ MovePos(p, len - 1);
+ return len;
+ }
+ if (len > repLen)
+ {
+ repIndex = i;
+ repLen = len;
+ }
+ }
+
+ matches = p->matches;
+ if (mainLen >= p->numFastBytes)
+ {
+ *backRes = matches[numPairs - 1] + LZMA_NUM_REPS;
+ MovePos(p, mainLen - 1);
+ return mainLen;
+ }
+
+ mainDist = 0; /* for GCC */
+ if (mainLen >= 2)
+ {
+ mainDist = matches[numPairs - 1];
+ while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1)
+ {
+ if (!ChangePair(matches[numPairs - 3], mainDist))
+ break;
+ numPairs -= 2;
+ mainLen = matches[numPairs - 2];
+ mainDist = matches[numPairs - 1];
+ }
+ if (mainLen == 2 && mainDist >= 0x80)
+ mainLen = 1;
+ }
+
+ if (repLen >= 2 && (
+ (repLen + 1 >= mainLen) ||
+ (repLen + 2 >= mainLen && mainDist >= (1 << 9)) ||
+ (repLen + 3 >= mainLen && mainDist >= (1 << 15))))
+ {
+ *backRes = repIndex;
+ MovePos(p, repLen - 1);
+ return repLen;
+ }
+
+ if (mainLen < 2 || numAvail <= 2)
+ return 1;
+
+ p->longestMatchLength = ReadMatchDistances(p, &p->numPairs);
+ if (p->longestMatchLength >= 2)
+ {
+ UInt32 newDistance = matches[p->numPairs - 1];
+ if ((p->longestMatchLength >= mainLen && newDistance < mainDist) ||
+ (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) ||
+ (p->longestMatchLength > mainLen + 1) ||
+ (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist)))
+ return 1;
+ }
+
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ UInt32 len, limit;
+ const Byte *data2 = data - (p->reps[i] + 1);
+ if (data[0] != data2[0] || data[1] != data2[1])
+ continue;
+ limit = mainLen - 1;
+ for (len = 2; len < limit && data[len] == data2[len]; len++);
+ if (len >= limit)
+ return 1;
+ }
+ *backRes = mainDist + LZMA_NUM_REPS;
+ MovePos(p, mainLen - 2);
+ return mainLen;
+}
+
+static void WriteEndMarker(CLzmaEnc *p, UInt32 posState)
+{
+ UInt32 len;
+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);
+ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);
+ p->state = kMatchNextStates[p->state];
+ len = LZMA_MATCH_LEN_MIN;
+ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);
+ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1);
+ RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits);
+ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask);
+}
+
+static SRes CheckErrors(CLzmaEnc *p)
+{
+ if (p->result != SZ_OK)
+ return p->result;
+ if (p->rc.res != SZ_OK)
+ p->result = SZ_ERROR_WRITE;
+ if (p->matchFinderBase.result != SZ_OK)
+ p->result = SZ_ERROR_READ;
+ if (p->result != SZ_OK)
+ p->finished = True;
+ return p->result;
+}
+
+static SRes Flush(CLzmaEnc *p, UInt32 nowPos)
+{
+ /* ReleaseMFStream(); */
+ p->finished = True;
+ if (p->writeEndMark)
+ WriteEndMarker(p, nowPos & p->pbMask);
+ RangeEnc_FlushData(&p->rc);
+ RangeEnc_FlushStream(&p->rc);
+ return CheckErrors(p);
+}
+
+static void FillAlignPrices(CLzmaEnc *p)
+{
+ UInt32 i;
+ for (i = 0; i < kAlignTableSize; i++)
+ p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices);
+ p->alignPriceCount = 0;
+}
+
+static void FillDistancesPrices(CLzmaEnc *p)
+{
+ UInt32 tempPrices[kNumFullDistances];
+ UInt32 i, lenToPosState;
+ for (i = kStartPosModelIndex; i < kNumFullDistances; i++)
+ {
+ UInt32 posSlot = GetPosSlot1(i);
+ UInt32 footerBits = ((posSlot >> 1) - 1);
+ UInt32 base = ((2 | (posSlot & 1)) << footerBits);
+ tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices);
+ }
+
+ for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++)
+ {
+ UInt32 posSlot;
+ const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState];
+ UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState];
+ for (posSlot = 0; posSlot < p->distTableSize; posSlot++)
+ posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices);
+ for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++)
+ posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits);
+
+ {
+ UInt32 *distancesPrices = p->distancesPrices[lenToPosState];
+ UInt32 i;
+ for (i = 0; i < kStartPosModelIndex; i++)
+ distancesPrices[i] = posSlotPrices[i];
+ for (; i < kNumFullDistances; i++)
+ distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i];
+ }
+ }
+ p->matchPriceCount = 0;
+}
+
+void LzmaEnc_Construct(CLzmaEnc *p)
+{
+ RangeEnc_Construct(&p->rc);
+ MatchFinder_Construct(&p->matchFinderBase);
+ #ifdef COMPRESS_MF_MT
+ MatchFinderMt_Construct(&p->matchFinderMt);
+ p->matchFinderMt.MatchFinder = &p->matchFinderBase;
+ #endif
+
+ {
+ CLzmaEncProps props;
+ LzmaEncProps_Init(&props);
+ LzmaEnc_SetProps(p, &props);
+ }
+
+ #ifndef LZMA_LOG_BSR
+ LzmaEnc_FastPosInit(p->g_FastPos);
+ #endif
+
+ LzmaEnc_InitPriceTables(p->ProbPrices);
+ p->litProbs = 0;
+ p->saveState.litProbs = 0;
+}
+
+CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc)
+{
+ void *p;
+ p = alloc->Alloc(alloc, sizeof(CLzmaEnc));
+ if (p != 0)
+ LzmaEnc_Construct((CLzmaEnc *)p);
+ return p;
+}
+
+void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc)
+{
+ alloc->Free(alloc, p->litProbs);
+ alloc->Free(alloc, p->saveState.litProbs);
+ p->litProbs = 0;
+ p->saveState.litProbs = 0;
+}
+
+void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ #ifdef COMPRESS_MF_MT
+ MatchFinderMt_Destruct(&p->matchFinderMt, allocBig);
+ #endif
+ MatchFinder_Free(&p->matchFinderBase, allocBig);
+ LzmaEnc_FreeLits(p, alloc);
+ RangeEnc_Free(&p->rc, alloc);
+}
+
+void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig);
+ alloc->Free(alloc, p);
+}
+
+static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize)
+{
+ UInt32 nowPos32, startPos32;
+ if (p->inStream != 0)
+ {
+ p->matchFinderBase.stream = p->inStream;
+ p->matchFinder.Init(p->matchFinderObj);
+ p->inStream = 0;
+ }
+
+ if (p->finished)
+ return p->result;
+ RINOK(CheckErrors(p));
+
+ nowPos32 = (UInt32)p->nowPos64;
+ startPos32 = nowPos32;
+
+ if (p->nowPos64 == 0)
+ {
+ UInt32 numPairs;
+ Byte curByte;
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
+ return Flush(p, nowPos32);
+ ReadMatchDistances(p, &numPairs);
+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0);
+ p->state = kLiteralNextStates[p->state];
+ curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset);
+ LitEnc_Encode(&p->rc, p->litProbs, curByte);
+ p->additionalOffset--;
+ nowPos32++;
+ }
+
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0)
+ for (;;)
+ {
+ UInt32 pos, len, posState;
+
+ if (p->fastMode)
+ len = GetOptimumFast(p, &pos);
+ else
+ len = GetOptimum(p, nowPos32, &pos);
+
+ #ifdef SHOW_STAT2
+ printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos);
+ #endif
+
+ posState = nowPos32 & p->pbMask;
+ if (len == 1 && pos == (UInt32)-1)
+ {
+ Byte curByte;
+ CLzmaProb *probs;
+ const Byte *data;
+
+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0);
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
+ curByte = *data;
+ probs = LIT_PROBS(nowPos32, *(data - 1));
+ if (IsCharState(p->state))
+ LitEnc_Encode(&p->rc, probs, curByte);
+ else
+ LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1));
+ p->state = kLiteralNextStates[p->state];
+ }
+ else
+ {
+ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);
+ if (pos < LZMA_NUM_REPS)
+ {
+ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1);
+ if (pos == 0)
+ {
+ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0);
+ RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1));
+ }
+ else
+ {
+ UInt32 distance = p->reps[pos];
+ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1);
+ if (pos == 1)
+ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0);
+ else
+ {
+ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1);
+ RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2);
+ if (pos == 3)
+ p->reps[3] = p->reps[2];
+ p->reps[2] = p->reps[1];
+ }
+ p->reps[1] = p->reps[0];
+ p->reps[0] = distance;
+ }
+ if (len == 1)
+ p->state = kShortRepNextStates[p->state];
+ else
+ {
+ LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);
+ p->state = kRepNextStates[p->state];
+ }
+ }
+ else
+ {
+ UInt32 posSlot;
+ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);
+ p->state = kMatchNextStates[p->state];
+ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);
+ pos -= LZMA_NUM_REPS;
+ GetPosSlot(pos, posSlot);
+ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot);
+
+ if (posSlot >= kStartPosModelIndex)
+ {
+ UInt32 footerBits = ((posSlot >> 1) - 1);
+ UInt32 base = ((2 | (posSlot & 1)) << footerBits);
+ UInt32 posReduced = pos - base;
+
+ if (posSlot < kEndPosModelIndex)
+ RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced);
+ else
+ {
+ RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits);
+ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask);
+ p->alignPriceCount++;
+ }
+ }
+ p->reps[3] = p->reps[2];
+ p->reps[2] = p->reps[1];
+ p->reps[1] = p->reps[0];
+ p->reps[0] = pos;
+ p->matchPriceCount++;
+ }
+ }
+ p->additionalOffset -= len;
+ nowPos32 += len;
+ if (p->additionalOffset == 0)
+ {
+ UInt32 processed;
+ if (!p->fastMode)
+ {
+ if (p->matchPriceCount >= (1 << 7))
+ FillDistancesPrices(p);
+ if (p->alignPriceCount >= kAlignTableSize)
+ FillAlignPrices(p);
+ }
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
+ break;
+ processed = nowPos32 - startPos32;
+ if (useLimits)
+ {
+ if (processed + kNumOpts + 300 >= maxUnpackSize ||
+ RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize)
+ break;
+ }
+ else if (processed >= (1 << 15))
+ {
+ p->nowPos64 += nowPos32 - startPos32;
+ return CheckErrors(p);
+ }
+ }
+ }
+ p->nowPos64 += nowPos32 - startPos32;
+ return Flush(p, nowPos32);
+}
+
+#define kBigHashDicLimit ((UInt32)1 << 24)
+
+static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ UInt32 beforeSize = kNumOpts;
+ Bool btMode;
+ if (!RangeEnc_Alloc(&p->rc, alloc))
+ return SZ_ERROR_MEM;
+ btMode = (p->matchFinderBase.btMode != 0);
+ #ifdef COMPRESS_MF_MT
+ p->mtMode = (p->multiThread && !p->fastMode && btMode);
+ #endif
+
+ {
+ unsigned lclp = p->lc + p->lp;
+ if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp)
+ {
+ LzmaEnc_FreeLits(p, alloc);
+ p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb));
+ p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb));
+ if (p->litProbs == 0 || p->saveState.litProbs == 0)
+ {
+ LzmaEnc_FreeLits(p, alloc);
+ return SZ_ERROR_MEM;
+ }
+ p->lclp = lclp;
+ }
+ }
+
+ p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit);
+
+ if (beforeSize + p->dictSize < keepWindowSize)
+ beforeSize = keepWindowSize - p->dictSize;
+
+ #ifdef COMPRESS_MF_MT
+ if (p->mtMode)
+ {
+ RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig));
+ p->matchFinderObj = &p->matchFinderMt;
+ MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder);
+ }
+ else
+ #endif
+ {
+ if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig))
+ return SZ_ERROR_MEM;
+ p->matchFinderObj = &p->matchFinderBase;
+ MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder);
+ }
+ return SZ_OK;
+}
+
+void LzmaEnc_Init(CLzmaEnc *p)
+{
+ UInt32 i;
+ p->state = 0;
+ for (i = 0 ; i < LZMA_NUM_REPS; i++)
+ p->reps[i] = 0;
+
+ RangeEnc_Init(&p->rc);
+
+
+ for (i = 0; i < kNumStates; i++)
+ {
+ UInt32 j;
+ for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++)
+ {
+ p->isMatch[i][j] = kProbInitValue;
+ p->isRep0Long[i][j] = kProbInitValue;
+ }
+ p->isRep[i] = kProbInitValue;
+ p->isRepG0[i] = kProbInitValue;
+ p->isRepG1[i] = kProbInitValue;
+ p->isRepG2[i] = kProbInitValue;
+ }
+
+ {
+ UInt32 num = 0x300 << (p->lp + p->lc);
+ for (i = 0; i < num; i++)
+ p->litProbs[i] = kProbInitValue;
+ }
+
+ {
+ for (i = 0; i < kNumLenToPosStates; i++)
+ {
+ CLzmaProb *probs = p->posSlotEncoder[i];
+ UInt32 j;
+ for (j = 0; j < (1 << kNumPosSlotBits); j++)
+ probs[j] = kProbInitValue;
+ }
+ }
+ {
+ for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++)
+ p->posEncoders[i] = kProbInitValue;
+ }
+
+ LenEnc_Init(&p->lenEnc.p);
+ LenEnc_Init(&p->repLenEnc.p);
+
+ for (i = 0; i < (1 << kNumAlignBits); i++)
+ p->posAlignEncoder[i] = kProbInitValue;
+
+ p->optimumEndIndex = 0;
+ p->optimumCurrentIndex = 0;
+ p->additionalOffset = 0;
+
+ p->pbMask = (1 << p->pb) - 1;
+ p->lpMask = (1 << p->lp) - 1;
+}
+
+void LzmaEnc_InitPrices(CLzmaEnc *p)
+{
+ if (!p->fastMode)
+ {
+ FillDistancesPrices(p);
+ FillAlignPrices(p);
+ }
+
+ p->lenEnc.tableSize =
+ p->repLenEnc.tableSize =
+ p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN;
+ LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices);
+ LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices);
+}
+
+static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ UInt32 i;
+ for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++)
+ if (p->dictSize <= ((UInt32)1 << i))
+ break;
+ p->distTableSize = i * 2;
+
+ p->finished = False;
+ p->result = SZ_OK;
+ RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig));
+ LzmaEnc_Init(p);
+ LzmaEnc_InitPrices(p);
+ p->nowPos64 = 0;
+ return SZ_OK;
+}
+
+static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqInStream *inStream, ISeqOutStream *outStream,
+ ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ p->inStream = inStream;
+ p->rc.outStream = outStream;
+ return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig);
+}
+
+SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp,
+ ISeqInStream *inStream, UInt32 keepWindowSize,
+ ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ p->inStream = inStream;
+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
+}
+
+static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen)
+{
+ p->seqBufInStream.funcTable.Read = MyRead;
+ p->seqBufInStream.data = src;
+ p->seqBufInStream.rem = srcLen;
+}
+
+SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,
+ UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ LzmaEnc_SetInputBuf(p, src, srcLen);
+ p->inStream = &p->seqBufInStream.funcTable;
+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
+}
+
+void LzmaEnc_Finish(CLzmaEncHandle pp)
+{
+ #ifdef COMPRESS_MF_MT
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ if (p->mtMode)
+ MatchFinderMt_ReleaseStream(&p->matchFinderMt);
+ #else
+ pp = pp;
+ #endif
+}
+
+typedef struct _CSeqOutStreamBuf
+{
+ ISeqOutStream funcTable;
+ Byte *data;
+ SizeT rem;
+ Bool overflow;
+} CSeqOutStreamBuf;
+
+static size_t MyWrite(void *pp, const void *data, size_t size)
+{
+ CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp;
+ if (p->rem < size)
+ {
+ size = p->rem;
+ p->overflow = True;
+ }
+ memcpy(p->data, data, size);
+ p->rem -= size;
+ p->data += size;
+ return size;
+}
+
+
+UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp)
+{
+ const CLzmaEnc *p = (CLzmaEnc *)pp;
+ return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
+}
+
+const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp)
+{
+ const CLzmaEnc *p = (CLzmaEnc *)pp;
+ return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
+}
+
+SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,
+ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ UInt64 nowPos64;
+ SRes res;
+ CSeqOutStreamBuf outStream;
+
+ outStream.funcTable.Write = MyWrite;
+ outStream.data = dest;
+ outStream.rem = *destLen;
+ outStream.overflow = False;
+
+ p->writeEndMark = False;
+ p->finished = False;
+ p->result = SZ_OK;
+
+ if (reInit)
+ LzmaEnc_Init(p);
+ LzmaEnc_InitPrices(p);
+ nowPos64 = p->nowPos64;
+ RangeEnc_Init(&p->rc);
+ p->rc.outStream = &outStream.funcTable;
+
+ res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize);
+
+ *unpackSize = (UInt32)(p->nowPos64 - nowPos64);
+ *destLen -= outStream.rem;
+ if (outStream.overflow)
+ return SZ_ERROR_OUTPUT_EOF;
+
+ return res;
+}
+
+SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress,
+ ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ SRes res = SZ_OK;
+
+ #ifdef COMPRESS_MF_MT
+ Byte allocaDummy[0x300];
+ int i = 0;
+ for (i = 0; i < 16; i++)
+ allocaDummy[i] = (Byte)i;
+ #endif
+
+ RINOK(LzmaEnc_Prepare(pp, inStream, outStream, alloc, allocBig));
+
+ for (;;)
+ {
+ res = LzmaEnc_CodeOneBlock(p, False, 0, 0);
+ if (res != SZ_OK || p->finished != 0)
+ break;
+ if (progress != 0)
+ {
+ res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc));
+ if (res != SZ_OK)
+ {
+ res = SZ_ERROR_PROGRESS;
+ break;
+ }
+ }
+ }
+ LzmaEnc_Finish(pp);
+ return res;
+}
+
+SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ int i;
+ UInt32 dictSize = p->dictSize;
+ if (*size < LZMA_PROPS_SIZE)
+ return SZ_ERROR_PARAM;
+ *size = LZMA_PROPS_SIZE;
+ props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc);
+
+ for (i = 11; i <= 30; i++)
+ {
+ if (dictSize <= ((UInt32)2 << i))
+ {
+ dictSize = (2 << i);
+ break;
+ }
+ if (dictSize <= ((UInt32)3 << i))
+ {
+ dictSize = (3 << i);
+ break;
+ }
+ }
+
+ for (i = 0; i < 4; i++)
+ props[1 + i] = (Byte)(dictSize >> (8 * i));
+ return SZ_OK;
+}
+
+SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ SRes res;
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+
+ CSeqOutStreamBuf outStream;
+
+ LzmaEnc_SetInputBuf(p, src, srcLen);
+
+ outStream.funcTable.Write = MyWrite;
+ outStream.data = dest;
+ outStream.rem = *destLen;
+ outStream.overflow = False;
+
+ p->writeEndMark = writeEndMark;
+ res = LzmaEnc_Encode(pp, &outStream.funcTable, &p->seqBufInStream.funcTable,
+ progress, alloc, allocBig);
+
+ *destLen -= outStream.rem;
+ if (outStream.overflow)
+ return SZ_ERROR_OUTPUT_EOF;
+ return res;
+}
+
+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc);
+ SRes res;
+ if (p == 0)
+ return SZ_ERROR_MEM;
+
+ res = LzmaEnc_SetProps(p, props);
+ if (res == SZ_OK)
+ {
+ res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize);
+ if (res == SZ_OK)
+ res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen,
+ writeEndMark, progress, alloc, allocBig);
+ }
+
+ LzmaEnc_Destroy(p, alloc, allocBig);
+ return res;
+}
diff --git a/extern/lzma/LzmaEnc.h b/extern/lzma/LzmaEnc.h
new file mode 100644
index 00000000000..bfbc7d2b9c3
--- /dev/null
+++ b/extern/lzma/LzmaEnc.h
@@ -0,0 +1,72 @@
+/* LzmaEnc.h -- LZMA Encoder
+2008-10-04 : Igor Pavlov : Public domain */
+
+#ifndef __LZMAENC_H
+#define __LZMAENC_H
+
+#include "Types.h"
+
+#define LZMA_PROPS_SIZE 5
+
+typedef struct _CLzmaEncProps
+{
+ int level; /* 0 <= level <= 9 */
+ UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
+ (1 << 12) <= dictSize <= (1 << 30) for 64-bit version
+ default = (1 << 24) */
+ int lc; /* 0 <= lc <= 8, default = 3 */
+ int lp; /* 0 <= lp <= 4, default = 0 */
+ int pb; /* 0 <= pb <= 4, default = 2 */
+ int algo; /* 0 - fast, 1 - normal, default = 1 */
+ int fb; /* 5 <= fb <= 273, default = 32 */
+ int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
+ int numHashBytes; /* 2, 3 or 4, default = 4 */
+ UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
+ unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
+ int numThreads; /* 1 or 2, default = 2 */
+} CLzmaEncProps;
+
+void LzmaEncProps_Init(CLzmaEncProps *p);
+void LzmaEncProps_Normalize(CLzmaEncProps *p);
+UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
+
+
+/* ---------- CLzmaEncHandle Interface ---------- */
+
+/* LzmaEnc_* functions can return the following exit codes:
+Returns:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater in props
+ SZ_ERROR_WRITE - Write callback error.
+ SZ_ERROR_PROGRESS - some break from progress callback
+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
+*/
+
+typedef void * CLzmaEncHandle;
+
+CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
+void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
+SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
+SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
+SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
+SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
+
+/* ---------- One Call Interface ---------- */
+
+/* LzmaEncode
+Return code:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow
+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
+*/
+
+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
+
+#endif
diff --git a/extern/lzma/LzmaLib.c b/extern/lzma/LzmaLib.c
new file mode 100644
index 00000000000..02a511857c9
--- /dev/null
+++ b/extern/lzma/LzmaLib.c
@@ -0,0 +1,46 @@
+/* LzmaLib.c -- LZMA library wrapper
+2008-08-05
+Igor Pavlov
+Public domain */
+
+#include "LzmaEnc.h"
+#include "LzmaDec.h"
+#include "Alloc.h"
+#include "LzmaLib.h"
+
+static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
+static void SzFree(void *p, void *address) { p = p; MyFree(address); }
+static ISzAlloc g_Alloc = { SzAlloc, SzFree };
+
+MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
+ unsigned char *outProps, size_t *outPropsSize,
+ int level, /* 0 <= level <= 9, default = 5 */
+ unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */
+ int lc, /* 0 <= lc <= 8, default = 3 */
+ int lp, /* 0 <= lp <= 4, default = 0 */
+ int pb, /* 0 <= pb <= 4, default = 2 */
+ int fb, /* 5 <= fb <= 273, default = 32 */
+ int numThreads /* 1 or 2, default = 2 */
+)
+{
+ CLzmaEncProps props;
+ LzmaEncProps_Init(&props);
+ props.level = level;
+ props.dictSize = dictSize;
+ props.lc = lc;
+ props.lp = lp;
+ props.pb = pb;
+ props.fb = fb;
+ props.numThreads = numThreads;
+
+ return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,
+ NULL, &g_Alloc, &g_Alloc);
+}
+
+
+MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen,
+ const unsigned char *props, size_t propsSize)
+{
+ ELzmaStatus status;
+ return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);
+}
diff --git a/extern/lzma/LzmaLib.h b/extern/lzma/LzmaLib.h
new file mode 100644
index 00000000000..5c9eeec73ca
--- /dev/null
+++ b/extern/lzma/LzmaLib.h
@@ -0,0 +1,135 @@
+/* LzmaLib.h -- LZMA library interface
+2008-08-05
+Igor Pavlov
+Public domain */
+
+#ifndef __LZMALIB_H
+#define __LZMALIB_H
+
+#include "Types.h"
+
+#ifdef __cplusplus
+ #define MY_EXTERN_C extern "C"
+#else
+ #define MY_EXTERN_C extern
+#endif
+
+#define MY_STDAPI MY_EXTERN_C int MY_STD_CALL
+
+#define LZMA_PROPS_SIZE 5
+
+/*
+RAM requirements for LZMA:
+ for compression: (dictSize * 11.5 + 6 MB) + state_size
+ for decompression: dictSize + state_size
+ state_size = (4 + (1.5 << (lc + lp))) KB
+ by default (lc=3, lp=0), state_size = 16 KB.
+
+LZMA properties (5 bytes) format
+ Offset Size Description
+ 0 1 lc, lp and pb in encoded form.
+ 1 4 dictSize (little endian).
+*/
+
+/*
+LzmaCompress
+------------
+
+outPropsSize -
+ In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
+ Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
+
+ LZMA Encoder will use defult values for any parameter, if it is
+ -1 for any from: level, loc, lp, pb, fb, numThreads
+ 0 for dictSize
+
+level - compression level: 0 <= level <= 9;
+
+ level dictSize algo fb
+ 0: 16 KB 0 32
+ 1: 64 KB 0 32
+ 2: 256 KB 0 32
+ 3: 1 MB 0 32
+ 4: 4 MB 0 32
+ 5: 16 MB 1 32
+ 6: 32 MB 1 32
+ 7+: 64 MB 1 64
+
+ The default value for "level" is 5.
+
+ algo = 0 means fast method
+ algo = 1 means normal method
+
+dictSize - The dictionary size in bytes. The maximum value is
+ 128 MB = (1 << 27) bytes for 32-bit version
+ 1 GB = (1 << 30) bytes for 64-bit version
+ The default value is 16 MB = (1 << 24) bytes.
+ It's recommended to use the dictionary that is larger than 4 KB and
+ that can be calculated as (1 << N) or (3 << N) sizes.
+
+lc - The number of literal context bits (high bits of previous literal).
+ It can be in the range from 0 to 8. The default value is 3.
+ Sometimes lc=4 gives the gain for big files.
+
+lp - The number of literal pos bits (low bits of current position for literals).
+ It can be in the range from 0 to 4. The default value is 0.
+ The lp switch is intended for periodical data when the period is equal to 2^lp.
+ For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's
+ better to set lc=0, if you change lp switch.
+
+pb - The number of pos bits (low bits of current position).
+ It can be in the range from 0 to 4. The default value is 2.
+ The pb switch is intended for periodical data when the period is equal 2^pb.
+
+fb - Word size (the number of fast bytes).
+ It can be in the range from 5 to 273. The default value is 32.
+ Usually, a big number gives a little bit better compression ratio and
+ slower compression process.
+
+numThreads - The number of thereads. 1 or 2. The default value is 2.
+ Fast mode (algo = 0) can use only 1 thread.
+
+Out:
+ destLen - processed output size
+Returns:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow
+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
+*/
+
+MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
+ unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */
+ int level, /* 0 <= level <= 9, default = 5 */
+ unsigned dictSize, /* default = (1 << 24) */
+ int lc, /* 0 <= lc <= 8, default = 3 */
+ int lp, /* 0 <= lp <= 4, default = 0 */
+ int pb, /* 0 <= pb <= 4, default = 2 */
+ int fb, /* 5 <= fb <= 273, default = 32 */
+ int numThreads /* 1 or 2, default = 2 */
+ );
+
+/*
+LzmaUncompress
+--------------
+In:
+ dest - output data
+ destLen - output data size
+ src - input data
+ srcLen - input data size
+Out:
+ destLen - processed output size
+ srcLen - processed input size
+Returns:
+ SZ_OK - OK
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation arror
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
+*/
+
+MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,
+ const unsigned char *props, size_t propsSize);
+
+#endif
diff --git a/extern/lzma/Makefile b/extern/lzma/Makefile
new file mode 100644
index 00000000000..11d70dc7847
--- /dev/null
+++ b/extern/lzma/Makefile
@@ -0,0 +1,46 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License. See http://www.blender.org/BL/ for information
+# about this.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s):
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+#
+#
+
+LIBNAME = lzma
+DIR = $(OCGDIR)/extern/$(LIBNAME)
+
+include nan_compile.mk
+
+install: $(ALL_OR_DEBUG)
+ @[ -d $(NAN_LZMA) ] || mkdir -p $(NAN_LZMA)
+ @[ -d $(NAN_LZMA)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZMA)/lib/$(DEBUG_DIR)
+ @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZMA)/lib/$(DEBUG_DIR)
+ifeq ($(OS),darwin)
+ ranlib $(NAN_LZMA)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
+endif
+ @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZMA)
diff --git a/extern/lzma/SConscript b/extern/lzma/SConscript
new file mode 100644
index 00000000000..015cdfe339f
--- /dev/null
+++ b/extern/lzma/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('./*.c')
+
+defs = ''
+incs = ' . '
+
+env.BlenderLib ('bf_lzma', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] )
diff --git a/extern/lzma/Types.h b/extern/lzma/Types.h
new file mode 100644
index 00000000000..1af5cfc4d86
--- /dev/null
+++ b/extern/lzma/Types.h
@@ -0,0 +1,208 @@
+/* Types.h -- Basic types
+2008-11-23 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_TYPES_H
+#define __7Z_TYPES_H
+
+#include <stddef.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#define SZ_OK 0
+
+#define SZ_ERROR_DATA 1
+#define SZ_ERROR_MEM 2
+#define SZ_ERROR_CRC 3
+#define SZ_ERROR_UNSUPPORTED 4
+#define SZ_ERROR_PARAM 5
+#define SZ_ERROR_INPUT_EOF 6
+#define SZ_ERROR_OUTPUT_EOF 7
+#define SZ_ERROR_READ 8
+#define SZ_ERROR_WRITE 9
+#define SZ_ERROR_PROGRESS 10
+#define SZ_ERROR_FAIL 11
+#define SZ_ERROR_THREAD 12
+
+#define SZ_ERROR_ARCHIVE 16
+#define SZ_ERROR_NO_ARCHIVE 17
+
+typedef int SRes;
+
+#ifdef _WIN32
+typedef DWORD WRes;
+#else
+typedef int WRes;
+#endif
+
+#ifndef RINOK
+#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
+#endif
+
+typedef unsigned char Byte;
+typedef short Int16;
+typedef unsigned short UInt16;
+
+#ifdef _LZMA_UINT32_IS_ULONG
+typedef long Int32;
+typedef unsigned long UInt32;
+#else
+typedef int Int32;
+typedef unsigned int UInt32;
+#endif
+
+#ifdef _SZ_NO_INT_64
+
+/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
+ NOTES: Some code will work incorrectly in that case! */
+
+typedef long Int64;
+typedef unsigned long UInt64;
+
+#else
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+typedef __int64 Int64;
+typedef unsigned __int64 UInt64;
+#else
+typedef long long int Int64;
+typedef unsigned long long int UInt64;
+#endif
+
+#endif
+
+#ifdef _LZMA_NO_SYSTEM_SIZE_T
+typedef UInt32 SizeT;
+#else
+typedef size_t SizeT;
+#endif
+
+typedef int Bool;
+#define True 1
+#define False 0
+
+
+#ifdef _MSC_VER
+
+#if _MSC_VER >= 1300
+#define MY_NO_INLINE __declspec(noinline)
+#else
+#define MY_NO_INLINE
+#endif
+
+#define MY_CDECL __cdecl
+#define MY_STD_CALL __stdcall
+#define MY_FAST_CALL MY_NO_INLINE __fastcall
+
+#else
+
+#define MY_CDECL
+#define MY_STD_CALL
+#define MY_FAST_CALL
+
+#endif
+
+
+/* The following interfaces use first parameter as pointer to structure */
+
+typedef struct
+{
+ SRes (*Read)(void *p, void *buf, size_t *size);
+ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
+ (output(*size) < input(*size)) is allowed */
+} ISeqInStream;
+
+/* it can return SZ_ERROR_INPUT_EOF */
+SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
+SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
+SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);
+
+typedef struct
+{
+ size_t (*Write)(void *p, const void *buf, size_t size);
+ /* Returns: result - the number of actually written bytes.
+ (result < size) means error */
+} ISeqOutStream;
+
+typedef enum
+{
+ SZ_SEEK_SET = 0,
+ SZ_SEEK_CUR = 1,
+ SZ_SEEK_END = 2
+} ESzSeek;
+
+typedef struct
+{
+ SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
+ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
+} ISeekInStream;
+
+typedef struct
+{
+ SRes (*Look)(void *p, void **buf, size_t *size);
+ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
+ (output(*size) > input(*size)) is not allowed
+ (output(*size) < input(*size)) is allowed */
+ SRes (*Skip)(void *p, size_t offset);
+ /* offset must be <= output(*size) of Look */
+
+ SRes (*Read)(void *p, void *buf, size_t *size);
+ /* reads directly (without buffer). It's same as ISeqInStream::Read */
+ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
+} ILookInStream;
+
+SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);
+SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);
+
+/* reads via ILookInStream::Read */
+SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);
+SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);
+
+#define LookToRead_BUF_SIZE (1 << 14)
+
+typedef struct
+{
+ ILookInStream s;
+ ISeekInStream *realStream;
+ size_t pos;
+ size_t size;
+ Byte buf[LookToRead_BUF_SIZE];
+} CLookToRead;
+
+void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
+void LookToRead_Init(CLookToRead *p);
+
+typedef struct
+{
+ ISeqInStream s;
+ ILookInStream *realStream;
+} CSecToLook;
+
+void SecToLook_CreateVTable(CSecToLook *p);
+
+typedef struct
+{
+ ISeqInStream s;
+ ILookInStream *realStream;
+} CSecToRead;
+
+void SecToRead_CreateVTable(CSecToRead *p);
+
+typedef struct
+{
+ SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);
+ /* Returns: result. (result != SZ_OK) means break.
+ Value (UInt64)(Int64)-1 for size means unknown value. */
+} ICompressProgress;
+
+typedef struct
+{
+ void *(*Alloc)(void *p, size_t size);
+ void (*Free)(void *p, void *address); /* address can be 0 */
+} ISzAlloc;
+
+#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
+#define IAlloc_Free(p, a) (p)->Free((p), a)
+
+#endif
diff --git a/extern/lzma/history.txt b/extern/lzma/history.txt
new file mode 100644
index 00000000000..014186717da
--- /dev/null
+++ b/extern/lzma/history.txt
@@ -0,0 +1,236 @@
+HISTORY of the LZMA SDK
+-----------------------
+
+4.65 2009-02-03
+-------------------------
+- Some minor fixes
+
+
+4.63 2008-12-31
+-------------------------
+- Some minor fixes
+
+
+4.61 beta 2008-11-23
+-------------------------
+- The bug in ANSI-C LZMA Decoder was fixed:
+ If encoded stream was corrupted, decoder could access memory
+ outside of allocated range.
+- Some changes in ANSI-C 7z Decoder interfaces.
+- LZMA SDK is placed in the public domain.
+
+
+4.60 beta 2008-08-19
+-------------------------
+- Some minor fixes.
+
+
+4.59 beta 2008-08-13
+-------------------------
+- The bug was fixed:
+ LZMA Encoder in fast compression mode could access memory outside of
+ allocated range in some rare cases.
+
+
+4.58 beta 2008-05-05
+-------------------------
+- ANSI-C LZMA Decoder was rewritten for speed optimizations.
+- ANSI-C LZMA Encoder was included to LZMA SDK.
+- C++ LZMA code now is just wrapper over ANSI-C code.
+
+
+4.57 2007-12-12
+-------------------------
+- Speed optimizations in Ñ++ LZMA Decoder.
+- Small changes for more compatibility with some C/C++ compilers.
+
+
+4.49 beta 2007-07-05
+-------------------------
+- .7z ANSI-C Decoder:
+ - now it supports BCJ and BCJ2 filters
+ - now it supports files larger than 4 GB.
+ - now it supports "Last Write Time" field for files.
+- C++ code for .7z archives compressing/decompressing from 7-zip
+ was included to LZMA SDK.
+
+
+4.43 2006-06-04
+-------------------------
+- Small changes for more compatibility with some C/C++ compilers.
+
+
+4.42 2006-05-15
+-------------------------
+- Small changes in .h files in ANSI-C version.
+
+
+4.39 beta 2006-04-14
+-------------------------
+- The bug in versions 4.33b:4.38b was fixed:
+ C++ version of LZMA encoder could not correctly compress
+ files larger than 2 GB with HC4 match finder (-mfhc4).
+
+
+4.37 beta 2005-04-06
+-------------------------
+- Fixes in C++ code: code could no be compiled if _NO_EXCEPTIONS was defined.
+
+
+4.35 beta 2005-03-02
+-------------------------
+- The bug was fixed in C++ version of LZMA Decoder:
+ If encoded stream was corrupted, decoder could access memory
+ outside of allocated range.
+
+
+4.34 beta 2006-02-27
+-------------------------
+- Compressing speed and memory requirements for compressing were increased
+- LZMA now can use only these match finders: HC4, BT2, BT3, BT4
+
+
+4.32 2005-12-09
+-------------------------
+- Java version of LZMA SDK was included
+
+
+4.30 2005-11-20
+-------------------------
+- Compression ratio was improved in -a2 mode
+- Speed optimizations for compressing in -a2 mode
+- -fb switch now supports values up to 273
+- The bug in 7z_C (7zIn.c) was fixed:
+ It used Alloc/Free functions from different memory pools.
+ So if program used two memory pools, it worked incorrectly.
+- 7z_C: .7z format supporting was improved
+- LZMA# SDK (C#.NET version) was included
+
+
+4.27 (Updated) 2005-09-21
+-------------------------
+- Some GUIDs/interfaces in C++ were changed.
+ IStream.h:
+ ISequentialInStream::Read now works as old ReadPart
+ ISequentialOutStream::Write now works as old WritePart
+
+
+4.27 2005-08-07
+-------------------------
+- The bug in LzmaDecodeSize.c was fixed:
+ if _LZMA_IN_CB and _LZMA_OUT_READ were defined,
+ decompressing worked incorrectly.
+
+
+4.26 2005-08-05
+-------------------------
+- Fixes in 7z_C code and LzmaTest.c:
+ previous versions could work incorrectly,
+ if malloc(0) returns 0
+
+
+4.23 2005-06-29
+-------------------------
+- Small fixes in C++ code
+
+
+4.22 2005-06-10
+-------------------------
+- Small fixes
+
+
+4.21 2005-06-08
+-------------------------
+- Interfaces for ANSI-C LZMA Decoder (LzmaDecode.c) were changed
+- New additional version of ANSI-C LZMA Decoder with zlib-like interface:
+ - LzmaStateDecode.h
+ - LzmaStateDecode.c
+ - LzmaStateTest.c
+- ANSI-C LZMA Decoder now can decompress files larger than 4 GB
+
+
+4.17 2005-04-18
+-------------------------
+- New example for RAM->RAM compressing/decompressing:
+ LZMA + BCJ (filter for x86 code):
+ - LzmaRam.h
+ - LzmaRam.cpp
+ - LzmaRamDecode.h
+ - LzmaRamDecode.c
+ - -f86 switch for lzma.exe
+
+
+4.16 2005-03-29
+-------------------------
+- The bug was fixed in LzmaDecode.c (ANSI-C LZMA Decoder):
+ If _LZMA_OUT_READ was defined, and if encoded stream was corrupted,
+ decoder could access memory outside of allocated range.
+- Speed optimization of ANSI-C LZMA Decoder (now it's about 20% faster).
+ Old version of LZMA Decoder now is in file LzmaDecodeSize.c.
+ LzmaDecodeSize.c can provide slightly smaller code than LzmaDecode.c
+- Small speed optimization in LZMA C++ code
+- filter for SPARC's code was added
+- Simplified version of .7z ANSI-C Decoder was included
+
+
+4.06 2004-09-05
+-------------------------
+- The bug in v4.05 was fixed:
+ LZMA-Encoder didn't release output stream in some cases.
+
+
+4.05 2004-08-25
+-------------------------
+- Source code of filters for x86, IA-64, ARM, ARM-Thumb
+ and PowerPC code was included to SDK
+- Some internal minor changes
+
+
+4.04 2004-07-28
+-------------------------
+- More compatibility with some C++ compilers
+
+
+4.03 2004-06-18
+-------------------------
+- "Benchmark" command was added. It measures compressing
+ and decompressing speed and shows rating values.
+ Also it checks hardware errors.
+
+
+4.02 2004-06-10
+-------------------------
+- C++ LZMA Encoder/Decoder code now is more portable
+ and it can be compiled by GCC on Linux.
+
+
+4.01 2004-02-15
+-------------------------
+- Some detection of data corruption was enabled.
+ LzmaDecode.c / RangeDecoderReadByte
+ .....
+ {
+ rd->ExtraBytes = 1;
+ return 0xFF;
+ }
+
+
+4.00 2004-02-13
+-------------------------
+- Original version of LZMA SDK
+
+
+
+HISTORY of the LZMA
+-------------------
+ 2001-2008: Improvements to LZMA compressing/decompressing code,
+ keeping compatibility with original LZMA format
+ 1996-2001: Development of LZMA compression format
+
+ Some milestones:
+
+ 2001-08-30: LZMA compression was added to 7-Zip
+ 1999-01-02: First version of 7-Zip was released
+
+
+End of document
diff --git a/extern/lzma/lzma.txt b/extern/lzma/lzma.txt
new file mode 100644
index 00000000000..715792d6c17
--- /dev/null
+++ b/extern/lzma/lzma.txt
@@ -0,0 +1,594 @@
+LZMA SDK 4.65
+-------------
+
+LZMA SDK provides the documentation, samples, header files, libraries,
+and tools you need to develop applications that use LZMA compression.
+
+LZMA is default and general compression method of 7z format
+in 7-Zip compression program (www.7-zip.org). LZMA provides high
+compression ratio and very fast decompression.
+
+LZMA is an improved version of famous LZ77 compression algorithm.
+It was improved in way of maximum increasing of compression ratio,
+keeping high decompression speed and low memory requirements for
+decompressing.
+
+
+
+LICENSE
+-------
+
+LZMA SDK is written and placed in the public domain by Igor Pavlov.
+
+
+LZMA SDK Contents
+-----------------
+
+LZMA SDK includes:
+
+ - ANSI-C/C++/C#/Java source code for LZMA compressing and decompressing
+ - Compiled file->file LZMA compressing/decompressing program for Windows system
+
+
+UNIX/Linux version
+------------------
+To compile C++ version of file->file LZMA encoding, go to directory
+C++/7zip/Compress/LZMA_Alone
+and call make to recompile it:
+ make -f makefile.gcc clean all
+
+In some UNIX/Linux versions you must compile LZMA with static libraries.
+To compile with static libraries, you can use
+LIB = -lm -static
+
+
+Files
+---------------------
+lzma.txt - LZMA SDK description (this file)
+7zFormat.txt - 7z Format description
+7zC.txt - 7z ANSI-C Decoder description
+methods.txt - Compression method IDs for .7z
+lzma.exe - Compiled file->file LZMA encoder/decoder for Windows
+history.txt - history of the LZMA SDK
+
+
+Source code structure
+---------------------
+
+C/ - C files
+ 7zCrc*.* - CRC code
+ Alloc.* - Memory allocation functions
+ Bra*.* - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
+ LzFind.* - Match finder for LZ (LZMA) encoders
+ LzFindMt.* - Match finder for LZ (LZMA) encoders for multithreading encoding
+ LzHash.h - Additional file for LZ match finder
+ LzmaDec.* - LZMA decoding
+ LzmaEnc.* - LZMA encoding
+ LzmaLib.* - LZMA Library for DLL calling
+ Types.h - Basic types for another .c files
+ Threads.* - The code for multithreading.
+
+ LzmaLib - LZMA Library (.DLL for Windows)
+
+ LzmaUtil - LZMA Utility (file->file LZMA encoder/decoder).
+
+ Archive - files related to archiving
+ 7z - 7z ANSI-C Decoder
+
+CPP/ -- CPP files
+
+ Common - common files for C++ projects
+ Windows - common files for Windows related code
+
+ 7zip - files related to 7-Zip Project
+
+ Common - common files for 7-Zip
+
+ Compress - files related to compression/decompression
+
+ Copy - Copy coder
+ RangeCoder - Range Coder (special code of compression/decompression)
+ LZMA - LZMA compression/decompression on C++
+ LZMA_Alone - file->file LZMA compression/decompression
+ Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
+
+ Archive - files related to archiving
+
+ Common - common files for archive handling
+ 7z - 7z C++ Encoder/Decoder
+
+ Bundles - Modules that are bundles of other modules
+
+ Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
+ Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
+ Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.
+
+ UI - User Interface files
+
+ Client7z - Test application for 7za.dll, 7zr.dll, 7zxr.dll
+ Common - Common UI files
+ Console - Code for console archiver
+
+
+
+CS/ - C# files
+ 7zip
+ Common - some common files for 7-Zip
+ Compress - files related to compression/decompression
+ LZ - files related to LZ (Lempel-Ziv) compression algorithm
+ LZMA - LZMA compression/decompression
+ LzmaAlone - file->file LZMA compression/decompression
+ RangeCoder - Range Coder (special code of compression/decompression)
+
+Java/ - Java files
+ SevenZip
+ Compression - files related to compression/decompression
+ LZ - files related to LZ (Lempel-Ziv) compression algorithm
+ LZMA - LZMA compression/decompression
+ RangeCoder - Range Coder (special code of compression/decompression)
+
+
+C/C++ source code of LZMA SDK is part of 7-Zip project.
+7-Zip source code can be downloaded from 7-Zip's SourceForge page:
+
+ http://sourceforge.net/projects/sevenzip/
+
+
+
+LZMA features
+-------------
+ - Variable dictionary size (up to 1 GB)
+ - Estimated compressing speed: about 2 MB/s on 2 GHz CPU
+ - Estimated decompressing speed:
+ - 20-30 MB/s on 2 GHz Core 2 or AMD Athlon 64
+ - 1-2 MB/s on 200 MHz ARM, MIPS, PowerPC or other simple RISC
+ - Small memory requirements for decompressing (16 KB + DictionarySize)
+ - Small code size for decompressing: 5-8 KB
+
+LZMA decoder uses only integer operations and can be
+implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).
+
+Some critical operations that affect the speed of LZMA decompression:
+ 1) 32*16 bit integer multiply
+ 2) Misspredicted branches (penalty mostly depends from pipeline length)
+ 3) 32-bit shift and arithmetic operations
+
+The speed of LZMA decompressing mostly depends from CPU speed.
+Memory speed has no big meaning. But if your CPU has small data cache,
+overall weight of memory speed will slightly increase.
+
+
+How To Use
+----------
+
+Using LZMA encoder/decoder executable
+--------------------------------------
+
+Usage: LZMA <e|d> inputFile outputFile [<switches>...]
+
+ e: encode file
+
+ d: decode file
+
+ b: Benchmark. There are two tests: compressing and decompressing
+ with LZMA method. Benchmark shows rating in MIPS (million
+ instructions per second). Rating value is calculated from
+ measured speed and it is normalized with Intel's Core 2 results.
+ Also Benchmark checks possible hardware errors (RAM
+ errors in most cases). Benchmark uses these settings:
+ (-a1, -d21, -fb32, -mfbt4). You can change only -d parameter.
+ Also you can change the number of iterations. Example for 30 iterations:
+ LZMA b 30
+ Default number of iterations is 10.
+
+<Switches>
+
+
+ -a{N}: set compression mode 0 = fast, 1 = normal
+ default: 1 (normal)
+
+ d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB)
+ The maximum value for dictionary size is 1 GB = 2^30 bytes.
+ Dictionary size is calculated as DictionarySize = 2^N bytes.
+ For decompressing file compressed by LZMA method with dictionary
+ size D = 2^N you need about D bytes of memory (RAM).
+
+ -fb{N}: set number of fast bytes - [5, 273], default: 128
+ Usually big number gives a little bit better compression ratio
+ and slower compression process.
+
+ -lc{N}: set number of literal context bits - [0, 8], default: 3
+ Sometimes lc=4 gives gain for big files.
+
+ -lp{N}: set number of literal pos bits - [0, 4], default: 0
+ lp switch is intended for periodical data when period is
+ equal 2^N. For example, for 32-bit (4 bytes)
+ periodical data you can use lp=2. Often it's better to set lc0,
+ if you change lp switch.
+
+ -pb{N}: set number of pos bits - [0, 4], default: 2
+ pb switch is intended for periodical data
+ when period is equal 2^N.
+
+ -mf{MF_ID}: set Match Finder. Default: bt4.
+ Algorithms from hc* group doesn't provide good compression
+ ratio, but they often works pretty fast in combination with
+ fast mode (-a0).
+
+ Memory requirements depend from dictionary size
+ (parameter "d" in table below).
+
+ MF_ID Memory Description
+
+ bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing.
+ bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing.
+ bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing.
+ hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing.
+
+ -eos: write End Of Stream marker. By default LZMA doesn't write
+ eos marker, since LZMA decoder knows uncompressed size
+ stored in .lzma file header.
+
+ -si: Read data from stdin (it will write End Of Stream marker).
+ -so: Write data to stdout
+
+
+Examples:
+
+1) LZMA e file.bin file.lzma -d16 -lc0
+
+compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)
+and 0 literal context bits. -lc0 allows to reduce memory requirements
+for decompression.
+
+
+2) LZMA e file.bin file.lzma -lc0 -lp2
+
+compresses file.bin to file.lzma with settings suitable
+for 32-bit periodical data (for example, ARM or MIPS code).
+
+3) LZMA d file.lzma file.bin
+
+decompresses file.lzma to file.bin.
+
+
+Compression ratio hints
+-----------------------
+
+Recommendations
+---------------
+
+To increase the compression ratio for LZMA compressing it's desirable
+to have aligned data (if it's possible) and also it's desirable to locate
+data in such order, where code is grouped in one place and data is
+grouped in other place (it's better than such mixing: code, data, code,
+data, ...).
+
+
+Filters
+-------
+You can increase the compression ratio for some data types, using
+special filters before compressing. For example, it's possible to
+increase the compression ratio on 5-10% for code for those CPU ISAs:
+x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.
+
+You can find C source code of such filters in C/Bra*.* files
+
+You can check the compression ratio gain of these filters with such
+7-Zip commands (example for ARM code):
+No filter:
+ 7z a a1.7z a.bin -m0=lzma
+
+With filter for little-endian ARM code:
+ 7z a a2.7z a.bin -m0=arm -m1=lzma
+
+It works in such manner:
+Compressing = Filter_encoding + LZMA_encoding
+Decompressing = LZMA_decoding + Filter_decoding
+
+Compressing and decompressing speed of such filters is very high,
+so it will not increase decompressing time too much.
+Moreover, it reduces decompression time for LZMA_decoding,
+since compression ratio with filtering is higher.
+
+These filters convert CALL (calling procedure) instructions
+from relative offsets to absolute addresses, so such data becomes more
+compressible.
+
+For some ISAs (for example, for MIPS) it's impossible to get gain from such filter.
+
+
+LZMA compressed file format
+---------------------------
+Offset Size Description
+ 0 1 Special LZMA properties (lc,lp, pb in encoded form)
+ 1 4 Dictionary size (little endian)
+ 5 8 Uncompressed size (little endian). -1 means unknown size
+ 13 Compressed data
+
+
+ANSI-C LZMA Decoder
+~~~~~~~~~~~~~~~~~~~
+
+Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58.
+If you want to use old interfaces you can download previous version of LZMA SDK
+from sourceforge.net site.
+
+To use ANSI-C LZMA Decoder you need the following files:
+1) LzmaDec.h + LzmaDec.c + Types.h
+LzmaUtil/LzmaUtil.c is example application that uses these files.
+
+
+Memory requirements for LZMA decoding
+-------------------------------------
+
+Stack usage of LZMA decoding function for local variables is not
+larger than 200-400 bytes.
+
+LZMA Decoder uses dictionary buffer and internal state structure.
+Internal state structure consumes
+ state_size = (4 + (1.5 << (lc + lp))) KB
+by default (lc=3, lp=0), state_size = 16 KB.
+
+
+How To decompress data
+----------------------
+
+LZMA Decoder (ANSI-C version) now supports 2 interfaces:
+1) Single-call Decompressing
+2) Multi-call State Decompressing (zlib-like interface)
+
+You must use external allocator:
+Example:
+void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
+void SzFree(void *p, void *address) { p = p; free(address); }
+ISzAlloc alloc = { SzAlloc, SzFree };
+
+You can use p = p; operator to disable compiler warnings.
+
+
+Single-call Decompressing
+-------------------------
+When to use: RAM->RAM decompressing
+Compile files: LzmaDec.h + LzmaDec.c + Types.h
+Compile defines: no defines
+Memory Requirements:
+ - Input buffer: compressed size
+ - Output buffer: uncompressed size
+ - LZMA Internal Structures: state_size (16 KB for default settings)
+
+Interface:
+ int LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
+ ELzmaStatus *status, ISzAlloc *alloc);
+ In:
+ dest - output data
+ destLen - output data size
+ src - input data
+ srcLen - input data size
+ propData - LZMA properties (5 bytes)
+ propSize - size of propData buffer (5 bytes)
+ finishMode - It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - Decode just destLen bytes.
+ LZMA_FINISH_END - Stream must be finished after (*destLen).
+ You can use LZMA_FINISH_END, when you know that
+ current output buffer covers last bytes of stream.
+ alloc - Memory allocator.
+
+ Out:
+ destLen - processed output size
+ srcLen - processed input size
+
+ Output:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
+
+ If LZMA decoder sees end_marker before reaching output limit, it returns OK result,
+ and output value of destLen will be less than output buffer size limit.
+
+ You can use multiple checks to test data integrity after full decompression:
+ 1) Check Result and "status" variable.
+ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
+ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
+ You must use correct finish mode in that case. */
+
+
+Multi-call State Decompressing (zlib-like interface)
+----------------------------------------------------
+
+When to use: file->file decompressing
+Compile files: LzmaDec.h + LzmaDec.c + Types.h
+
+Memory Requirements:
+ - Buffer for input stream: any size (for example, 16 KB)
+ - Buffer for output stream: any size (for example, 16 KB)
+ - LZMA Internal Structures: state_size (16 KB for default settings)
+ - LZMA dictionary (dictionary size is encoded in LZMA properties header)
+
+1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header:
+ unsigned char header[LZMA_PROPS_SIZE + 8];
+ ReadFile(inFile, header, sizeof(header)
+
+2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties
+
+ CLzmaDec state;
+ LzmaDec_Constr(&state);
+ res = LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc);
+ if (res != SZ_OK)
+ return res;
+
+3) Init LzmaDec structure before any new LZMA stream. And call LzmaDec_DecodeToBuf in loop
+
+ LzmaDec_Init(&state);
+ for (;;)
+ {
+ ...
+ int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);
+ ...
+ }
+
+
+4) Free all allocated structures
+ LzmaDec_Free(&state, &g_Alloc);
+
+For full code example, look at C/LzmaUtil/LzmaUtil.c code.
+
+
+How To compress data
+--------------------
+
+Compile files: LzmaEnc.h + LzmaEnc.c + Types.h +
+LzFind.c + LzFind.h + LzFindMt.c + LzFindMt.h + LzHash.h
+
+Memory Requirements:
+ - (dictSize * 11.5 + 6 MB) + state_size
+
+Lzma Encoder can use two memory allocators:
+1) alloc - for small arrays.
+2) allocBig - for big arrays.
+
+For example, you can use Large RAM Pages (2 MB) in allocBig allocator for
+better compression speed. Note that Windows has bad implementation for
+Large RAM Pages.
+It's OK to use same allocator for alloc and allocBig.
+
+
+Single-call Compression with callbacks
+--------------------------------------
+
+Check C/LzmaUtil/LzmaUtil.c as example,
+
+When to use: file->file decompressing
+
+1) you must implement callback structures for interfaces:
+ISeqInStream
+ISeqOutStream
+ICompressProgress
+ISzAlloc
+
+static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
+static void SzFree(void *p, void *address) { p = p; MyFree(address); }
+static ISzAlloc g_Alloc = { SzAlloc, SzFree };
+
+ CFileSeqInStream inStream;
+ CFileSeqOutStream outStream;
+
+ inStream.funcTable.Read = MyRead;
+ inStream.file = inFile;
+ outStream.funcTable.Write = MyWrite;
+ outStream.file = outFile;
+
+
+2) Create CLzmaEncHandle object;
+
+ CLzmaEncHandle enc;
+
+ enc = LzmaEnc_Create(&g_Alloc);
+ if (enc == 0)
+ return SZ_ERROR_MEM;
+
+
+3) initialize CLzmaEncProps properties;
+
+ LzmaEncProps_Init(&props);
+
+ Then you can change some properties in that structure.
+
+4) Send LZMA properties to LZMA Encoder
+
+ res = LzmaEnc_SetProps(enc, &props);
+
+5) Write encoded properties to header
+
+ Byte header[LZMA_PROPS_SIZE + 8];
+ size_t headerSize = LZMA_PROPS_SIZE;
+ UInt64 fileSize;
+ int i;
+
+ res = LzmaEnc_WriteProperties(enc, header, &headerSize);
+ fileSize = MyGetFileLength(inFile);
+ for (i = 0; i < 8; i++)
+ header[headerSize++] = (Byte)(fileSize >> (8 * i));
+ MyWriteFileAndCheck(outFile, header, headerSize)
+
+6) Call encoding function:
+ res = LzmaEnc_Encode(enc, &outStream.funcTable, &inStream.funcTable,
+ NULL, &g_Alloc, &g_Alloc);
+
+7) Destroy LZMA Encoder Object
+ LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
+
+
+If callback function return some error code, LzmaEnc_Encode also returns that code.
+
+
+Single-call RAM->RAM Compression
+--------------------------------
+
+Single-call RAM->RAM Compression is similar to Compression with callbacks,
+but you provide pointers to buffers instead of pointers to stream callbacks:
+
+HRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
+
+Return code:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow
+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
+
+
+
+LZMA Defines
+------------
+
+_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.
+
+_LZMA_PROB32 - It can increase the speed on some 32-bit CPUs, but memory usage for
+ some structures will be doubled in that case.
+
+_LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler and long is 32-bit.
+
+_LZMA_NO_SYSTEM_SIZE_T - Define it if you don't want to use size_t type.
+
+
+C++ LZMA Encoder/Decoder
+~~~~~~~~~~~~~~~~~~~~~~~~
+C++ LZMA code use COM-like interfaces. So if you want to use it,
+you can study basics of COM/OLE.
+C++ LZMA code is just wrapper over ANSI-C code.
+
+
+C++ Notes
+~~~~~~~~~~~~~~~~~~~~~~~~
+If you use some C++ code folders in 7-Zip (for example, C++ code for .7z handling),
+you must check that you correctly work with "new" operator.
+7-Zip can be compiled with MSVC 6.0 that doesn't throw "exception" from "new" operator.
+So 7-Zip uses "CPP\Common\NewHandler.cpp" that redefines "new" operator:
+operator new(size_t size)
+{
+ void *p = ::malloc(size);
+ if (p == 0)
+ throw CNewException();
+ return p;
+}
+If you use MSCV that throws exception for "new" operator, you can compile without
+"NewHandler.cpp". So standard exception will be used. Actually some code of
+7-Zip catches any exception in internal code and converts it to HRESULT code.
+So you don't need to catch CNewException, if you call COM interfaces of 7-Zip.
+
+---
+
+http://www.7-zip.org
+http://www.7-zip.org/sdk.html
+http://www.7-zip.org/support.html
diff --git a/intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj b/extern/lzma/make/msvc_9_0/lzma.vcproj
index 2109d92d430..ec0676f6ca6 100644
--- a/intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj
+++ b/extern/lzma/make/msvc_9_0/lzma.vcproj
@@ -2,9 +2,9 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
- Name="INT_DummySoundSystem"
- ProjectGUID="{FAF46346-65CC-4DB2-85C4-B99826F79D0C}"
- RootNamespace="DummySoundSystem"
+ Name="EXT_lzma"
+ ProjectGUID="{79D0B232-208C-F208-DA71-79B4AC088602}"
+ RootNamespace="lzma"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -16,9 +16,9 @@
</ToolFiles>
<Configurations>
<Configuration
- Name="Blender Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy"
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -42,20 +42,20 @@
/>
<Tool
Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- DefaultCharIsUnsigned="true"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
+ ExceptionHandling="1"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\debug\lzma.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
+ WarningLevel="3"
SuppressStartupBanner="true"
+ DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
@@ -63,7 +63,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
+ PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
@@ -71,7 +71,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\libDummySoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\debug\lzma.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -91,9 +91,9 @@
/>
</Configuration>
<Configuration
- Name="Blender Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug"
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -117,20 +117,22 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- DefaultCharIsUnsigned="true"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\debug\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\lzma.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\"
+ WarningLevel="3"
SuppressStartupBanner="true"
- DebugInformationFormat="3"
+ DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
@@ -138,7 +140,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
+ PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
@@ -146,7 +148,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\debug\libDummySoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\lzma.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -166,9 +168,9 @@
/>
</Configuration>
<Configuration
- Name="3DPlugin Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll"
+ Name="3D Plugin Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -192,20 +194,20 @@
/>
<Tool
Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
- StringPooling="true"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- DefaultCharIsUnsigned="true"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\lzma.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
+ WarningLevel="3"
SuppressStartupBanner="true"
+ DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
@@ -213,7 +215,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
+ PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
@@ -221,7 +223,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libDummySoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\debug\lzma.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -241,9 +243,9 @@
/>
</Configuration>
<Configuration
- Name="3DPlugin Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug"
+ Name="3D Plugin Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -267,20 +269,22 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- DefaultCharIsUnsigned="true"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\dummy\mtdll\debug\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\lzma.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
+ WarningLevel="3"
SuppressStartupBanner="true"
- DebugInformationFormat="3"
+ DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
@@ -288,7 +292,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
+ PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
@@ -296,7 +300,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libDummySoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\lzma.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -321,19 +325,57 @@
<Files>
<Filter
Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath="..\..\..\dummy\SND_DummyDevice.cpp"
+ RelativePath="..\..\Alloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzFind.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzmaDec.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzmaEnc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzmaLib.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
- Filter="h;hpp;hxx;hm;inl"
>
<File
- RelativePath="..\..\..\dummy\SND_DummyDevice.h"
+ RelativePath="..\..\Alloc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzFind.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzHash.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzmaDec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzmaEnc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\LzmaLib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Types.h"
>
</File>
</Filter>
diff --git a/extern/lzo/CMakeLists.txt b/extern/lzo/CMakeLists.txt
new file mode 100644
index 00000000000..b640cf658da
--- /dev/null
+++ b/extern/lzo/CMakeLists.txt
@@ -0,0 +1,34 @@
+# $Id$
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Daniel Genrich
+#
+# ***** END GPL LICENSE BLOCK *****
+
+SET(INC include)
+
+FILE(GLOB SRC minilzo/*.c)
+
+
+
+BLENDERLIB(bf_minilzo "${SRC}" "${INC}")
+#, libtype='blender', priority = 0 )
diff --git a/extern/lzo/SConscript b/extern/lzo/SConscript
new file mode 100644
index 00000000000..81bedad25d8
--- /dev/null
+++ b/extern/lzo/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('minilzo/*.c')
+
+defs = ''
+incs = ' include '
+
+env.BlenderLib ('bf_minilzo', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] )
diff --git a/intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj b/extern/lzo/make/msvc_9_0/lzo.vcproj
index 5593f00cb2b..80516ef964e 100644
--- a/intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj
+++ b/extern/lzo/make/msvc_9_0/lzo.vcproj
@@ -2,9 +2,9 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
- Name="INT_OpenALSoundSystem"
- ProjectGUID="{213356A9-3A1F-41DA-9819-1297BCD17DEE}"
- RootNamespace="OpenALSoundSystem"
+ Name="EXT_lzo"
+ ProjectGUID="{8BFA4082-773B-D100-BC24-659083BA023F}"
+ RootNamespace="lzo"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -17,8 +17,8 @@
<Configurations>
<Configuration
Name="Blender Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -43,19 +43,19 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
+ ExceptionHandling="1"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
- DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\debug\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\debug\lzo.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
+ WarningLevel="3"
SuppressStartupBanner="true"
- DebugInformationFormat="3"
+ DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
@@ -71,7 +71,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\debug\libOpenALSoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\debug\lzo.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -92,8 +92,8 @@
</Configuration>
<Configuration
Name="Blender Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -117,20 +117,22 @@
/>
<Tool
Name="VCCLCompilerTool"
+ Optimization="2"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
StringPooling="true"
+ ExceptionHandling="0"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
- DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\lzo.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\"
+ WarningLevel="3"
SuppressStartupBanner="true"
+ DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
@@ -146,7 +148,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\libOpenALSoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\lzo.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -166,9 +168,9 @@
/>
</Configuration>
<Configuration
- Name="3DPlugin Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll"
+ Name="3D Plugin Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -192,20 +194,20 @@
/>
<Tool
Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
- StringPooling="true"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- DefaultCharIsUnsigned="true"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\lzo.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
+ WarningLevel="3"
SuppressStartupBanner="true"
+ DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
@@ -213,7 +215,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
+ PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
@@ -221,7 +223,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libOpenALSoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\debug\lzo.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -241,9 +243,9 @@
/>
</Configuration>
<Configuration
- Name="3DPlugin Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug"
+ Name="3D Plugin Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -267,20 +269,22 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- DefaultCharIsUnsigned="true"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_9\intern\soundsystem\openal\mtdll\debug\"
- WarningLevel="2"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\lzo.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
+ WarningLevel="3"
SuppressStartupBanner="true"
- DebugInformationFormat="3"
+ DebugInformationFormat="1"
CompileAs="0"
/>
<Tool
@@ -288,7 +292,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
+ PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
@@ -296,7 +300,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libOpenALSoundSystem.lib"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\lzo.lib"
SuppressStartupBanner="true"
/>
<Tool
@@ -321,27 +325,25 @@
<Files>
<Filter
Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath="..\..\..\openal\SND_OpenALDevice.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\sdl\SND_SDLCDDevice.cpp"
+ RelativePath="..\..\minilzo\minilzo.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
- Filter="h;hpp;hxx;hm;inl"
>
<File
- RelativePath="..\..\..\openal\SND_OpenALDevice.h"
+ RelativePath="..\..\minilzo\lzoconf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\minilzo\lzodefs.h"
>
</File>
<File
- RelativePath="..\..\..\sdl\SND_SDLCDDevice.h"
+ RelativePath="..\..\minilzo\minilzo.h"
>
</File>
</Filter>
diff --git a/extern/lzo/minilzo/COPYING b/extern/lzo/minilzo/COPYING
new file mode 100644
index 00000000000..5ee49f42e91
--- /dev/null
+++ b/extern/lzo/minilzo/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/extern/lzo/minilzo/Makefile b/extern/lzo/minilzo/Makefile
new file mode 100644
index 00000000000..8f3d5042579
--- /dev/null
+++ b/extern/lzo/minilzo/Makefile
@@ -0,0 +1,40 @@
+#
+# $Id:
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2009 Blender Foundation
+# All rights reserved.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+LIBNAME = minilzo
+DIR = $(OCGDIR)/extern/$(LIBNAME)
+
+include nan_compile.mk
+
+install: $(ALL_OR_DEBUG)
+ @[ -d $(NAN_LZO) ] || mkdir -p $(NAN_LZO)
+ @[ -d $(NAN_LZO)/minilzo ] || mkdir -p $(NAN_LZO)/minilzo
+ @[ -d $(NAN_LZO)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZO)/lib/$(DEBUG_DIR)
+ @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZO)/lib/$(DEBUG_DIR)
+ifeq ($(OS),darwin)
+ ranlib $(NAN_LZO)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
+endif
+ @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZO)/minilzo
diff --git a/extern/lzo/minilzo/README.LZO b/extern/lzo/minilzo/README.LZO
new file mode 100644
index 00000000000..3700f28e310
--- /dev/null
+++ b/extern/lzo/minilzo/README.LZO
@@ -0,0 +1,123 @@
+
+ ============================================================================
+ miniLZO -- mini subset of the LZO real-time data compression library
+ ============================================================================
+
+ Author : Markus Franz Xaver Johannes Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ Version : 2.03
+ Date : 30 Apr 2008
+
+ I've created miniLZO for projects where it is inconvenient to
+ include (or require) the full LZO source code just because you
+ want to add a little bit of data compression to your application.
+
+ miniLZO implements the LZO1X-1 compressor and both the standard and
+ safe LZO1X decompressor. Apart from fast compression it also useful
+ for situations where you want to use pre-compressed data files (which
+ must have been compressed with LZO1X-999).
+
+ miniLZO consists of one C source file and three header files:
+ minilzo.c
+ minilzo.h, lzoconf.h, lzodefs.h
+
+ To use miniLZO just copy these files into your source directory, add
+ minilzo.c to your Makefile and #include minilzo.h from your program.
+ Note: you also must distribute this file (`README.LZO') with your project.
+
+ minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and
+ the sources are about 30 kB when packed with zip - so there's no more
+ excuse that your application doesn't support data compression :-)
+
+ For more information, documentation, example programs and other support
+ files (like Makefiles and build scripts) please download the full LZO
+ package from
+ http://www.oberhumer.com/opensource/lzo/
+
+ Have fun,
+ Markus
+
+
+ P.S. minilzo.c is generated automatically from the LZO sources and
+ therefore functionality is completely identical
+
+
+ Appendix A: building miniLZO
+ ----------------------------
+ miniLZO is written such a way that it should compile and run
+ out-of-the-box on most machines.
+
+ If you are running on a very unusual architecture and lzo_init() fails then
+ you should first recompile with `-DLZO_DEBUG' to see what causes the failure.
+ The most probable case is something like `sizeof(char *) != sizeof(long)'.
+ After identifying the problem you can compile by adding some defines
+ like `-DSIZEOF_CHAR_P=8' to your Makefile.
+
+ The best solution is (of course) using Autoconf - if your project uses
+ Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler
+ flags when compiling minilzo.c. See the LZO distribution for an example
+ how to set up configure.in.
+
+
+ Appendix B: list of public functions available in miniLZO
+ ---------------------------------------------------------
+ Library initialization
+ lzo_init()
+
+ Compression
+ lzo1x_1_compress()
+
+ Decompression
+ lzo1x_decompress()
+ lzo1x_decompress_safe()
+
+ Checksum functions
+ lzo_adler32()
+
+ Version functions
+ lzo_version()
+ lzo_version_string()
+ lzo_version_date()
+
+ Portable (but slow) string functions
+ lzo_memcmp()
+ lzo_memcpy()
+ lzo_memmove()
+ lzo_memset()
+
+
+ Appendix C: suggested macros for `configure.in' when using Autoconf
+ -------------------------------------------------------------------
+ Checks for typedefs and structures
+ AC_CHECK_TYPE(ptrdiff_t,long)
+ AC_TYPE_SIZE_T
+ AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(int)
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(long long)
+ AC_CHECK_SIZEOF(__int64)
+ AC_CHECK_SIZEOF(void *)
+ AC_CHECK_SIZEOF(size_t)
+ AC_CHECK_SIZEOF(ptrdiff_t)
+
+ Checks for compiler characteristics
+ AC_C_CONST
+
+ Checks for library functions
+ AC_CHECK_FUNCS(memcmp memcpy memmove memset)
+
+
+ Appendix D: Copyright
+ ---------------------
+ LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer
+
+ LZO and miniLZO are distributed under the terms of the GNU General
+ Public License (GPL). See the file COPYING.
+
+ Special licenses for commercial and other applications which
+ are not willing to accept the GNU General Public License
+ are available by contacting the author.
+
+
diff --git a/extern/lzo/minilzo/lzoconf.h b/extern/lzo/minilzo/lzoconf.h
new file mode 100644
index 00000000000..cc437f1ebfe
--- /dev/null
+++ b/extern/lzo/minilzo/lzoconf.h
@@ -0,0 +1,417 @@
+/* lzoconf.h -- configuration for the LZO real-time data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library 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.
+
+ The LZO library 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 the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+
+#ifndef __LZOCONF_H_INCLUDED
+#define __LZOCONF_H_INCLUDED
+
+#define LZO_VERSION 0x2030
+#define LZO_VERSION_STRING "2.03"
+#define LZO_VERSION_DATE "Apr 30 2008"
+
+/* internal Autoconf configuration file - only used when building LZO */
+#if defined(LZO_HAVE_CONFIG_H)
+# include <config.h>
+#endif
+#include <limits.h>
+#include <stddef.h>
+
+
+/***********************************************************************
+// LZO requires a conforming <limits.h>
+************************************************************************/
+
+#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+# error "invalid CHAR_BIT"
+#endif
+#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
+# error "check your compiler installation"
+#endif
+#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
+# error "your limits.h macros are broken"
+#endif
+
+/* get OS and architecture defines */
+#ifndef __LZODEFS_H_INCLUDED
+#include "lzodefs.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+// some core defines
+************************************************************************/
+
+#if !defined(LZO_UINT32_C)
+# if (UINT_MAX < LZO_0xffffffffL)
+# define LZO_UINT32_C(c) c ## UL
+# else
+# define LZO_UINT32_C(c) ((c) + 0U)
+# endif
+#endif
+
+/* memory checkers */
+#if !defined(__LZO_CHECKER)
+# if defined(__BOUNDS_CHECKING_ON)
+# define __LZO_CHECKER 1
+# elif defined(__CHECKER__)
+# define __LZO_CHECKER 1
+# elif defined(__INSURE__)
+# define __LZO_CHECKER 1
+# elif defined(__PURIFY__)
+# define __LZO_CHECKER 1
+# endif
+#endif
+
+
+/***********************************************************************
+// integral and pointer types
+************************************************************************/
+
+/* lzo_uint should match size_t */
+#if !defined(LZO_UINT_MAX)
+# if defined(LZO_ABI_LLP64) /* WIN64 */
+# if defined(LZO_OS_WIN64)
+ typedef unsigned __int64 lzo_uint;
+ typedef __int64 lzo_int;
+# else
+ typedef unsigned long long lzo_uint;
+ typedef long long lzo_int;
+# endif
+# define LZO_UINT_MAX 0xffffffffffffffffull
+# define LZO_INT_MAX 9223372036854775807LL
+# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
+# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */
+ typedef unsigned int lzo_uint;
+ typedef int lzo_int;
+# define LZO_UINT_MAX UINT_MAX
+# define LZO_INT_MAX INT_MAX
+# define LZO_INT_MIN INT_MIN
+# elif (ULONG_MAX >= LZO_0xffffffffL)
+ typedef unsigned long lzo_uint;
+ typedef long lzo_int;
+# define LZO_UINT_MAX ULONG_MAX
+# define LZO_INT_MAX LONG_MAX
+# define LZO_INT_MIN LONG_MIN
+# else
+# error "lzo_uint"
+# endif
+#endif
+
+/* Integral types with 32 bits or more. */
+#if !defined(LZO_UINT32_MAX)
+# if (UINT_MAX >= LZO_0xffffffffL)
+ typedef unsigned int lzo_uint32;
+ typedef int lzo_int32;
+# define LZO_UINT32_MAX UINT_MAX
+# define LZO_INT32_MAX INT_MAX
+# define LZO_INT32_MIN INT_MIN
+# elif (ULONG_MAX >= LZO_0xffffffffL)
+ typedef unsigned long lzo_uint32;
+ typedef long lzo_int32;
+# define LZO_UINT32_MAX ULONG_MAX
+# define LZO_INT32_MAX LONG_MAX
+# define LZO_INT32_MIN LONG_MIN
+# else
+# error "lzo_uint32"
+# endif
+#endif
+
+/* The larger type of lzo_uint and lzo_uint32. */
+#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
+# define lzo_xint lzo_uint
+#else
+# define lzo_xint lzo_uint32
+#endif
+
+/* Memory model that allows to access memory at offsets of lzo_uint. */
+#if !defined(__LZO_MMODEL)
+# if (LZO_UINT_MAX <= UINT_MAX)
+# define __LZO_MMODEL
+# elif defined(LZO_HAVE_MM_HUGE_PTR)
+# define __LZO_MMODEL_HUGE 1
+# define __LZO_MMODEL __huge
+# else
+# define __LZO_MMODEL
+# endif
+#endif
+
+/* no typedef here because of const-pointer issues */
+#define lzo_bytep unsigned char __LZO_MMODEL *
+#define lzo_charp char __LZO_MMODEL *
+#define lzo_voidp void __LZO_MMODEL *
+#define lzo_shortp short __LZO_MMODEL *
+#define lzo_ushortp unsigned short __LZO_MMODEL *
+#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
+#define lzo_int32p lzo_int32 __LZO_MMODEL *
+#define lzo_uintp lzo_uint __LZO_MMODEL *
+#define lzo_intp lzo_int __LZO_MMODEL *
+#define lzo_xintp lzo_xint __LZO_MMODEL *
+#define lzo_voidpp lzo_voidp __LZO_MMODEL *
+#define lzo_bytepp lzo_bytep __LZO_MMODEL *
+/* deprecated - use `lzo_bytep' instead of `lzo_byte *' */
+#define lzo_byte unsigned char __LZO_MMODEL
+
+typedef int lzo_bool;
+
+
+/***********************************************************************
+// function types
+************************************************************************/
+
+/* name mangling */
+#if !defined(__LZO_EXTERN_C)
+# ifdef __cplusplus
+# define __LZO_EXTERN_C extern "C"
+# else
+# define __LZO_EXTERN_C extern
+# endif
+#endif
+
+/* calling convention */
+#if !defined(__LZO_CDECL)
+# define __LZO_CDECL __lzo_cdecl
+#endif
+
+/* DLL export information */
+#if !defined(__LZO_EXPORT1)
+# define __LZO_EXPORT1
+#endif
+#if !defined(__LZO_EXPORT2)
+# define __LZO_EXPORT2
+#endif
+
+/* __cdecl calling convention for public C and assembly functions */
+#if !defined(LZO_PUBLIC)
+# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
+#endif
+#if !defined(LZO_EXTERN)
+# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
+#endif
+#if !defined(LZO_PRIVATE)
+# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL
+#endif
+
+/* function types */
+typedef int
+(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+typedef int
+(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+typedef int
+(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+typedef int
+(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len );
+
+typedef int
+(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len );
+
+
+/* Callback interface. Currently only the progress indicator ("nprogress")
+ * is used, but this may change in a future release. */
+
+struct lzo_callback_t;
+typedef struct lzo_callback_t lzo_callback_t;
+#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
+
+/* malloc & free function types */
+typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
+ (lzo_callback_p self, lzo_uint items, lzo_uint size);
+typedef void (__LZO_CDECL *lzo_free_func_t)
+ (lzo_callback_p self, lzo_voidp ptr);
+
+/* a progress indicator callback function */
+typedef void (__LZO_CDECL *lzo_progress_func_t)
+ (lzo_callback_p, lzo_uint, lzo_uint, int);
+
+struct lzo_callback_t
+{
+ /* custom allocators (set to 0 to disable) */
+ lzo_alloc_func_t nalloc; /* [not used right now] */
+ lzo_free_func_t nfree; /* [not used right now] */
+
+ /* a progress indicator callback function (set to 0 to disable) */
+ lzo_progress_func_t nprogress;
+
+ /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress
+ * callbacks points back to this struct, so you are free to store
+ * some extra info in the following variables. */
+ lzo_voidp user1;
+ lzo_xint user2;
+ lzo_xint user3;
+};
+
+
+/***********************************************************************
+// error codes and prototypes
+************************************************************************/
+
+/* Error codes for the compression/decompression functions. Negative
+ * values are errors, positive values will be used for special but
+ * normal events.
+ */
+#define LZO_E_OK 0
+#define LZO_E_ERROR (-1)
+#define LZO_E_OUT_OF_MEMORY (-2) /* [not used right now] */
+#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
+#define LZO_E_INPUT_OVERRUN (-4)
+#define LZO_E_OUTPUT_OVERRUN (-5)
+#define LZO_E_LOOKBEHIND_OVERRUN (-6)
+#define LZO_E_EOF_NOT_FOUND (-7)
+#define LZO_E_INPUT_NOT_CONSUMED (-8)
+#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
+
+
+#ifndef lzo_sizeof_dict_t
+# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
+#endif
+
+/* lzo_init() should be the first function you call.
+ * Check the return code !
+ *
+ * lzo_init() is a macro to allow checking that the library and the
+ * compiler's view of various types are consistent.
+ */
+#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
+ (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
+ (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
+ (int)sizeof(lzo_callback_t))
+LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
+
+/* version functions (useful for shared libraries) */
+LZO_EXTERN(unsigned) lzo_version(void);
+LZO_EXTERN(const char *) lzo_version_string(void);
+LZO_EXTERN(const char *) lzo_version_date(void);
+LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
+LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
+
+/* string functions */
+LZO_EXTERN(int)
+lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
+LZO_EXTERN(lzo_voidp)
+lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
+LZO_EXTERN(lzo_voidp)
+lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
+LZO_EXTERN(lzo_voidp)
+lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
+
+/* checksum functions */
+LZO_EXTERN(lzo_uint32)
+lzo_adler32(lzo_uint32 _adler, const lzo_bytep _buf, lzo_uint _len);
+LZO_EXTERN(lzo_uint32)
+lzo_crc32(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len);
+LZO_EXTERN(const lzo_uint32p)
+lzo_get_crc32_table(void);
+
+/* misc. */
+LZO_EXTERN(int) _lzo_config_check(void);
+typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
+typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
+typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
+
+/* align a char pointer on a boundary that is a multiple of `size' */
+LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
+#define LZO_PTR_ALIGN_UP(_ptr,_size) \
+ ((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
+
+
+/***********************************************************************
+// deprecated macros - only for backward compatibility with LZO v1.xx
+************************************************************************/
+
+#if defined(LZO_CFG_COMPAT)
+
+#define __LZOCONF_H 1
+
+#if defined(LZO_ARCH_I086)
+# define __LZO_i386 1
+#elif defined(LZO_ARCH_I386)
+# define __LZO_i386 1
+#endif
+
+#if defined(LZO_OS_DOS16)
+# define __LZO_DOS 1
+# define __LZO_DOS16 1
+#elif defined(LZO_OS_DOS32)
+# define __LZO_DOS 1
+#elif defined(LZO_OS_WIN16)
+# define __LZO_WIN 1
+# define __LZO_WIN16 1
+#elif defined(LZO_OS_WIN32)
+# define __LZO_WIN 1
+#endif
+
+#define __LZO_CMODEL
+#define __LZO_DMODEL
+#define __LZO_ENTRY __LZO_CDECL
+#define LZO_EXTERN_CDECL LZO_EXTERN
+#define LZO_ALIGN LZO_PTR_ALIGN_UP
+
+#define lzo_compress_asm_t lzo_compress_t
+#define lzo_decompress_asm_t lzo_decompress_t
+
+#endif /* LZO_CFG_COMPAT */
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/extern/lzo/minilzo/lzodefs.h b/extern/lzo/minilzo/lzodefs.h
new file mode 100644
index 00000000000..180563723e5
--- /dev/null
+++ b/extern/lzo/minilzo/lzodefs.h
@@ -0,0 +1,1807 @@
+/* lzodefs.h -- architecture, OS and compiler specific defines
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library 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.
+
+ The LZO library 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 the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+
+#ifndef __LZODEFS_H_INCLUDED
+#define __LZODEFS_H_INCLUDED 1
+
+#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
+# define __CYGWIN__ __CYGWIN32__
+#endif
+#if defined(__IBMCPP__) && !defined(__IBMC__)
+# define __IBMC__ __IBMCPP__
+#endif
+#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
+# define __INTEL_COMPILER __ICL
+#endif
+#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
+# define _ALL_SOURCE 1
+#endif
+#if defined(__mips__) && defined(__R5900__)
+# if !defined(__LONG_MAX__)
+# define __LONG_MAX__ 9223372036854775807L
+# endif
+#endif
+#if defined(__INTEL_COMPILER) && defined(__linux__)
+# pragma warning(disable: 193)
+#endif
+#if defined(__KEIL__) && defined(__C166__)
+# pragma warning disable = 322
+#elif 0 && defined(__C251__)
+# pragma warning disable = 322
+#endif
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if (_MSC_VER >= 1300)
+# pragma warning(disable: 4668)
+# endif
+#endif
+#if 0 && defined(__WATCOMC__)
+# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
+# pragma warning 203 9
+# endif
+#endif
+#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
+# pragma option -h
+#endif
+#if 0
+#define LZO_0xffffL 0xfffful
+#define LZO_0xffffffffL 0xfffffffful
+#else
+#define LZO_0xffffL 65535ul
+#define LZO_0xffffffffL 4294967295ul
+#endif
+#if (LZO_0xffffL == LZO_0xffffffffL)
+# error "your preprocessor is broken 1"
+#endif
+#if (16ul * 16384ul != 262144ul)
+# error "your preprocessor is broken 2"
+#endif
+#if 0
+#if (32767 >= 4294967295ul)
+# error "your preprocessor is broken 3"
+#endif
+#if (65535u >= 4294967295ul)
+# error "your preprocessor is broken 4"
+#endif
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
+# if !defined(MSDOS)
+# define MSDOS 1
+# endif
+# if !defined(_MSDOS)
+# define _MSDOS 1
+# endif
+#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX)
+# if (__VERSION == 520) && (MB_LEN_MAX == 1)
+# if !defined(__AZTEC_C__)
+# define __AZTEC_C__ __VERSION
+# endif
+# if !defined(__DOS__)
+# define __DOS__ 1
+# endif
+# endif
+#endif
+#endif
+#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL)
+# define ptrdiff_t long
+# define _PTRDIFF_T_DEFINED
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+# if defined(__AZTEC_C__) && defined(__DOS__)
+# define __LZO_RENAME_A 1
+# elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define __LZO_RENAME_A 1
+# elif (_MSC_VER < 700)
+# define __LZO_RENAME_B 1
+# endif
+# elif defined(__TSC__) && defined(__OS2__)
+# define __LZO_RENAME_A 1
+# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
+# define __LZO_RENAME_A 1
+# elif defined(__PACIFIC__) && defined(DOS)
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# endif
+# if defined(__LZO_RENAME_A)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# elif defined(__LZO_RENAME_B)
+# if !defined(__cdecl)
+# define __cdecl _cdecl
+# endif
+# if !defined(__far)
+# define __far _far
+# endif
+# if !defined(__huge)
+# define __huge _huge
+# endif
+# if !defined(__near)
+# define __near _near
+# endif
+# if !defined(__pascal)
+# define __pascal _pascal
+# endif
+# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# endif
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__AZTEC_C__) && defined(__DOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+#elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# endif
+# if (_MSC_VER < 700)
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# define LZO_BROKEN_SIZEOF 1
+# endif
+#elif defined(__PACIFIC__) && defined(DOS)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#elif defined(__TURBOC__) && defined(__MSDOS__)
+# if (__TURBOC__ < 0x0150)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# endif
+# if (__TURBOC__ < 0x0200)
+# define LZO_BROKEN_SIZEOF 1
+# endif
+# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# endif
+#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_SIZEOF 1
+#endif
+#endif
+#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#endif
+#if defined(_CRAY) && defined(_CRAY1)
+# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1
+#endif
+#define LZO_PP_STRINGIZE(x) #x
+#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x)
+#define LZO_PP_CONCAT2(a,b) a ## b
+#define LZO_PP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b)
+#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c)
+#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d)
+#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e)
+#if 1
+#define LZO_CPP_STRINGIZE(x) #x
+#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x)
+#define LZO_CPP_CONCAT2(a,b) a ## b
+#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b)
+#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c)
+#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d)
+#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e)
+#endif
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o))
+#if 1 && defined(__cplusplus)
+# if !defined(__STDC_CONSTANT_MACROS)
+# define __STDC_CONSTANT_MACROS 1
+# endif
+# if !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS 1
+# endif
+#endif
+#if defined(__cplusplus)
+# define LZO_EXTERN_C extern "C"
+#else
+# define LZO_EXTERN_C extern
+#endif
+#if !defined(__LZO_OS_OVERRIDE)
+#if defined(LZO_OS_FREESTANDING)
+# define LZO_INFO_OS "freestanding"
+#elif defined(LZO_OS_EMBEDDED)
+# define LZO_INFO_OS "embedded"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_OS_EMBEDDED 1
+# define LZO_INFO_OS "embedded"
+#elif defined(__CYGWIN__) && defined(__GNUC__)
+# define LZO_OS_CYGWIN 1
+# define LZO_INFO_OS "cygwin"
+#elif defined(__EMX__) && defined(__GNUC__)
+# define LZO_OS_EMX 1
+# define LZO_INFO_OS "emx"
+#elif defined(__BEOS__)
+# define LZO_OS_BEOS 1
+# define LZO_INFO_OS "beos"
+#elif defined(__Lynx__)
+# define LZO_OS_LYNXOS 1
+# define LZO_INFO_OS "lynxos"
+#elif defined(__OS400__)
+# define LZO_OS_OS400 1
+# define LZO_INFO_OS "os400"
+#elif defined(__QNX__)
+# define LZO_OS_QNX 1
+# define LZO_INFO_OS "qnx"
+#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__BORLANDC__) && defined(__DPMI16__)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+#elif defined(__ZTC__) && defined(DOS386)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__OS2__) || defined(__OS2V2__)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_OS216 1
+# define LZO_INFO_OS "os216"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_OS2 1
+# define LZO_INFO_OS "os2"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
+# define LZO_OS_WIN64 1
+# define LZO_INFO_OS "win64"
+#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__MWERKS__) && defined(__INTEL__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_WIN16 1
+# define LZO_INFO_OS "win16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WATCOMC__)
+# if defined(__NT__) && (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif defined(__NT__) && (__WATCOMC__ < 1100)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# elif defined(__linux__) || defined(__LINUX__)
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+# else
+# error "please specify a target using the -bt compiler option"
+# endif
+#elif defined(__palmos__)
+# define LZO_OS_PALMOS 1
+# define LZO_INFO_OS "palmos"
+#elif defined(__TOS__) || defined(__atarist__)
+# define LZO_OS_TOS 1
+# define LZO_INFO_OS "tos"
+#elif defined(macintosh) && !defined(__ppc__)
+# define LZO_OS_MACCLASSIC 1
+# define LZO_INFO_OS "macclassic"
+#elif defined(__VMS)
+# define LZO_OS_VMS 1
+# define LZO_INFO_OS "vms"
+#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PS2 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "ps2"
+#elif (defined(__mips__) && defined(__psp__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PSP 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "psp"
+#else
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+#endif
+#if (LZO_OS_POSIX)
+# if defined(_AIX) || defined(__AIX__) || defined(__aix__)
+# define LZO_OS_POSIX_AIX 1
+# define LZO_INFO_OS_POSIX "aix"
+# elif defined(__FreeBSD__)
+# define LZO_OS_POSIX_FREEBSD 1
+# define LZO_INFO_OS_POSIX "freebsd"
+# elif defined(__hpux__) || defined(__hpux)
+# define LZO_OS_POSIX_HPUX 1
+# define LZO_INFO_OS_POSIX "hpux"
+# elif defined(__INTERIX)
+# define LZO_OS_POSIX_INTERIX 1
+# define LZO_INFO_OS_POSIX "interix"
+# elif defined(__IRIX__) || defined(__irix__)
+# define LZO_OS_POSIX_IRIX 1
+# define LZO_INFO_OS_POSIX "irix"
+# elif defined(__linux__) || defined(__linux) || defined(__LINUX__)
+# define LZO_OS_POSIX_LINUX 1
+# define LZO_INFO_OS_POSIX "linux"
+# elif defined(__APPLE__) || defined(__MACOS__)
+# define LZO_OS_POSIX_MACOSX 1
+# define LZO_INFO_OS_POSIX "macosx"
+# elif defined(__minix__) || defined(__minix)
+# define LZO_OS_POSIX_MINIX 1
+# define LZO_INFO_OS_POSIX "minix"
+# elif defined(__NetBSD__)
+# define LZO_OS_POSIX_NETBSD 1
+# define LZO_INFO_OS_POSIX "netbsd"
+# elif defined(__OpenBSD__)
+# define LZO_OS_POSIX_OPENBSD 1
+# define LZO_INFO_OS_POSIX "openbsd"
+# elif defined(__osf__)
+# define LZO_OS_POSIX_OSF 1
+# define LZO_INFO_OS_POSIX "osf"
+# elif defined(__solaris__) || defined(__sun)
+# if defined(__SVR4) || defined(__svr4__)
+# define LZO_OS_POSIX_SOLARIS 1
+# define LZO_INFO_OS_POSIX "solaris"
+# else
+# define LZO_OS_POSIX_SUNOS 1
+# define LZO_INFO_OS_POSIX "sunos"
+# endif
+# elif defined(__ultrix__) || defined(__ultrix)
+# define LZO_OS_POSIX_ULTRIX 1
+# define LZO_INFO_OS_POSIX "ultrix"
+# elif defined(_UNICOS)
+# define LZO_OS_POSIX_UNICOS 1
+# define LZO_INFO_OS_POSIX "unicos"
+# else
+# define LZO_OS_POSIX_UNKNOWN 1
+# define LZO_INFO_OS_POSIX "unknown"
+# endif
+#endif
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (UINT_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
+# define LZO_CC_CILLY 1
+# define LZO_INFO_CC "Cilly"
+# if defined(__CILLY__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
+# define LZO_CC_SDCC 1
+# define LZO_INFO_CC "sdcc"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC)
+#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
+# define LZO_INFO_CC "Pathscale C"
+# define LZO_INFO_CCVER __PATHSCALE__
+#elif defined(__INTEL_COMPILER)
+# define LZO_CC_INTELC 1
+# define LZO_INFO_CC "Intel C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
+# if defined(_WIN32) || defined(_WIN64)
+# define LZO_CC_SYNTAX_MSC 1
+# else
+# define LZO_CC_SYNTAX_GNUC 1
+# endif
+#elif defined(__POCC__) && defined(_WIN32)
+# define LZO_CC_PELLESC 1
+# define LZO_INFO_CC "Pelles C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__)
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# else
+# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# endif
+# define LZO_INFO_CC "llvm-gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__ACK__) && defined(_ACK)
+# define LZO_CC_ACK 1
+# define LZO_INFO_CC "Amsterdam Compiler Kit C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__AZTEC_C__)
+# define LZO_CC_AZTECC 1
+# define LZO_INFO_CC "Aztec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__BORLANDC__)
+# define LZO_CC_BORLANDC 1
+# define LZO_INFO_CC "Borland C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__)
+#elif defined(_CRAYC) && defined(_RELEASE)
+# define LZO_CC_CRAYC 1
+# define LZO_INFO_CC "Cray C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE)
+#elif defined(__DMC__) && defined(__SC__)
+# define LZO_CC_DMC 1
+# define LZO_INFO_CC "Digital Mars C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__)
+#elif defined(__DECC)
+# define LZO_CC_DECC 1
+# define LZO_INFO_CC "DEC C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC)
+#elif defined(__HIGHC__)
+# define LZO_CC_HIGHC 1
+# define LZO_INFO_CC "MetaWare High C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define LZO_CC_IARC 1
+# define LZO_INFO_CC "IAR C"
+# if defined(__VER__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__IBMC__)
+# define LZO_CC_IBMC 1
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__)
+#elif defined(__KEIL__) && defined(__C166__)
+# define LZO_CC_KEILC 1
+# define LZO_INFO_CC "Keil C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__)
+#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
+# define LZO_CC_LCCWIN32 1
+# define LZO_INFO_CC "lcc-win32"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__LCC__)
+# define LZO_CC_LCC 1
+# define LZO_INFO_CC "lcc"
+# if defined(__LCC_VERSION__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(_MSC_VER)
+# define LZO_CC_MSC 1
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
+# endif
+#elif defined(__MWERKS__)
+# define LZO_CC_MWERKS 1
+# define LZO_INFO_CC "Metrowerks C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__)
+#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
+# define LZO_CC_NDPC 1
+# define LZO_INFO_CC "Microway NDP C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PACIFIC__)
+# define LZO_CC_PACIFICC 1
+# define LZO_INFO_CC "Pacific C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
+# define LZO_CC_PGI 1
+# define LZO_INFO_CC "Portland Group PGI C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PUREC__) && defined(__TOS__)
+# define LZO_CC_PUREC 1
+# define LZO_INFO_CC "Pure C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__)
+#elif defined(__SC__) && defined(__ZTC__)
+# define LZO_CC_SYMANTECC 1
+# define LZO_INFO_CC "Symantec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__)
+#elif defined(__SUNPRO_C)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_C)+0 > 0)
+# define LZO_CC_SUNPROC __SUNPRO_C
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__SUNPRO_CC)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_CC)+0 > 0)
+# define LZO_CC_SUNPROC __SUNPRO_CC
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__TINYC__)
+# define LZO_CC_TINYC 1
+# define LZO_INFO_CC "Tiny C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__)
+#elif defined(__TSC__)
+# define LZO_CC_TOPSPEEDC 1
+# define LZO_INFO_CC "TopSpeed C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__)
+#elif defined(__WATCOMC__)
+# define LZO_CC_WATCOMC 1
+# define LZO_INFO_CC "Watcom C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__)
+#elif defined(__TURBOC__)
+# define LZO_CC_TURBOC 1
+# define LZO_INFO_CC "Turbo C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__)
+#elif defined(__ZTC__)
+# define LZO_CC_ZORTECHC 1
+# define LZO_INFO_CC "Zortech C"
+# if (__ZTC__ == 0x310)
+# define LZO_INFO_CCVER "0x310"
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__)
+# endif
+#else
+# define LZO_CC_UNKNOWN 1
+# define LZO_INFO_CC "unknown"
+# define LZO_INFO_CCVER "unknown"
+#endif
+#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
+# error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE) && !defined(LZO_ARCH_GENERIC) && defined(_CRAY)
+# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY)
+# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
+# define LZO_ARCH_CRAY_MPP 1
+# elif defined(_CRAY1)
+# define LZO_ARCH_CRAY_PVP 1
+# endif
+# endif
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE)
+#if defined(LZO_ARCH_GENERIC)
+# define LZO_INFO_ARCH "generic"
+#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086 1
+# define LZO_ARCH_IA16 1
+# define LZO_INFO_ARCH "i086"
+#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+# define LZO_ARCH_AMD64 1
+# define LZO_INFO_ARCH "amd64"
+#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
+# define LZO_ARCH_ARM 1
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
+# define LZO_ARCH_ARM 1
+# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
+# define LZO_INFO_ARCH "arm"
+# else
+# define LZO_INFO_ARCH "arm"
+# endif
+#elif defined(__arm__) || defined(_M_ARM)
+# define LZO_ARCH_ARM 1
+# define LZO_INFO_ARCH "arm"
+#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
+# define LZO_ARCH_AVR 1
+# define LZO_INFO_ARCH "avr"
+#elif defined(__bfin__)
+# define LZO_ARCH_BLACKFIN 1
+# define LZO_INFO_ARCH "blackfin"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__)
+# define LZO_ARCH_C166 1
+# define LZO_INFO_ARCH "c166"
+#elif defined(__cris__)
+# define LZO_ARCH_CRIS 1
+# define LZO_INFO_ARCH "cris"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
+# define LZO_ARCH_EZ80 1
+# define LZO_INFO_ARCH "ez80"
+#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_ARCH_H8300 1
+# define LZO_INFO_ARCH "h8300"
+#elif defined(__hppa__) || defined(__hppa)
+# define LZO_ARCH_HPPA 1
+# define LZO_INFO_ARCH "hppa"
+#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_CC_ZORTECHC && defined(__I86__))
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
+# define LZO_ARCH_IA64 1
+# define LZO_INFO_ARCH "ia64"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__)
+# define LZO_ARCH_M16C 1
+# define LZO_INFO_ARCH "m16c"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
+# define LZO_ARCH_M16C 1
+# define LZO_INFO_ARCH "m16c"
+#elif defined(__m32r__)
+# define LZO_ARCH_M32R 1
+# define LZO_INFO_ARCH "m32r"
+#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K)
+# define LZO_ARCH_M68K 1
+# define LZO_INFO_ARCH "m68k"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__)
+# define LZO_ARCH_MCS251 1
+# define LZO_INFO_ARCH "mcs251"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__)
+# define LZO_ARCH_MCS51 1
+# define LZO_INFO_ARCH "mcs51"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
+# define LZO_ARCH_MCS51 1
+# define LZO_INFO_ARCH "mcs51"
+#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
+# define LZO_ARCH_MIPS 1
+# define LZO_INFO_ARCH "mips"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
+# define LZO_ARCH_POWERPC 1
+# define LZO_INFO_ARCH "powerpc"
+#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
+# define LZO_ARCH_S390 1
+# define LZO_INFO_ARCH "s390"
+#elif defined(__sh__) || defined(_M_SH)
+# define LZO_ARCH_SH 1
+# define LZO_INFO_ARCH "sh"
+#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
+# define LZO_ARCH_SPARC 1
+# define LZO_INFO_ARCH "sparc"
+#elif defined(__SPU__)
+# define LZO_ARCH_SPU 1
+# define LZO_INFO_ARCH "spu"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
+# define LZO_ARCH_Z80 1
+# define LZO_INFO_ARCH "z80"
+#elif (LZO_ARCH_CRAY_PVP)
+# if defined(_CRAYSV1)
+# define LZO_ARCH_CRAY_SV1 1
+# define LZO_INFO_ARCH "cray_sv1"
+# elif (_ADDR64)
+# define LZO_ARCH_CRAY_T90 1
+# define LZO_INFO_ARCH "cray_t90"
+# elif (_ADDR32)
+# define LZO_ARCH_CRAY_YMP 1
+# define LZO_INFO_ARCH "cray_ymp"
+# else
+# define LZO_ARCH_CRAY_XMP 1
+# define LZO_INFO_ARCH "cray_xmp"
+# endif
+#else
+# define LZO_ARCH_UNKNOWN 1
+# define LZO_INFO_ARCH "unknown"
+#endif
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2)
+# error "FIXME - missing define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
+# error "FIXME - missing WIN32 define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
+# error "FIXME - missing WIN64 define for CPU architecture"
+#endif
+#if (LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#endif
+#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM)
+# error "this should not happen"
+#endif
+#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086)
+# error "this should not happen"
+#endif
+#if (LZO_ARCH_I086)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_ARCH_I386)
+# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if !defined(__LZO_MM_OVERRIDE)
+#if (LZO_ARCH_I086)
+#if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+#endif
+#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
+# define LZO_MM_TINY 1
+#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
+# define LZO_MM_HUGE 1
+#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
+# define LZO_MM_SMALL 1
+#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
+# define LZO_MM_MEDIUM 1
+#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
+# define LZO_MM_COMPACT 1
+#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
+# define LZO_MM_LARGE 1
+#elif (LZO_CC_AZTECC)
+# if defined(_LARGE_CODE) && defined(_LARGE_DATA)
+# define LZO_MM_LARGE 1
+# elif defined(_LARGE_CODE)
+# define LZO_MM_MEDIUM 1
+# elif defined(_LARGE_DATA)
+# define LZO_MM_COMPACT 1
+# else
+# define LZO_MM_SMALL 1
+# endif
+#elif (LZO_CC_ZORTECHC && defined(__VCM__))
+# define LZO_MM_LARGE 1
+#else
+# error "unknown memory model"
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#define LZO_HAVE_MM_HUGE_PTR 1
+#define LZO_HAVE_MM_HUGE_ARRAY 1
+#if (LZO_MM_TINY)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC)
+# undef LZO_HAVE_MM_HUGE_PTR
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_MSC && defined(_QC))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+# if (_MSC_VER < 600)
+# undef LZO_HAVE_MM_HUGE_PTR
+# endif
+#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR)
+# if (LZO_OS_DOS16)
+# error "this should not happen"
+# elif (LZO_CC_ZORTECHC)
+# else
+# error "this should not happen"
+# endif
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16)
+# define LZO_MM_AHSHIFT 12
+#elif (LZO_CC_WATCOMC)
+ extern unsigned char _HShift;
+# define LZO_MM_AHSHIFT ((unsigned) _HShift)
+#else
+# error "FIXME - implement LZO_MM_AHSHIFT"
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+#elif (LZO_ARCH_C166)
+#if !defined(__MODEL__)
+# error "FIXME - C166 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - C166 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS251)
+#if !defined(__MODEL__)
+# error "FIXME - MCS251 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS251 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS51)
+#if !defined(__MODEL__)
+# error "FIXME - MCS51 __MODEL__"
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS51 __MODEL__"
+#endif
+#elif (LZO_ARCH_CRAY_PVP)
+# define LZO_MM_PVP 1
+#else
+# define LZO_MM_FLAT 1
+#endif
+#if (LZO_MM_COMPACT)
+# define LZO_INFO_MM "compact"
+#elif (LZO_MM_FLAT)
+# define LZO_INFO_MM "flat"
+#elif (LZO_MM_HUGE)
+# define LZO_INFO_MM "huge"
+#elif (LZO_MM_LARGE)
+# define LZO_INFO_MM "large"
+#elif (LZO_MM_MEDIUM)
+# define LZO_INFO_MM "medium"
+#elif (LZO_MM_PVP)
+# define LZO_INFO_MM "pvp"
+#elif (LZO_MM_SMALL)
+# define LZO_INFO_MM "small"
+#elif (LZO_MM_TINY)
+# define LZO_INFO_MM "tiny"
+#else
+# error "unknown memory model"
+#endif
+#endif
+#if defined(SIZEOF_SHORT)
+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#endif
+#if defined(SIZEOF_INT)
+# define LZO_SIZEOF_INT (SIZEOF_INT)
+#endif
+#if defined(SIZEOF_LONG)
+# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#endif
+#if defined(SIZEOF_LONG_LONG)
+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#endif
+#if defined(SIZEOF___INT16)
+# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
+#endif
+#if defined(SIZEOF___INT32)
+# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
+#endif
+#if defined(SIZEOF___INT64)
+# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
+#endif
+#if defined(SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#endif
+#if defined(SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#endif
+#if defined(SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#endif
+#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
+#if !defined(LZO_SIZEOF_SHORT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_SHORT 8
+# elif (USHRT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,7) == 1)
+# define LZO_SIZEOF_SHORT 1
+# elif (__LZO_LSR(USHRT_MAX,15) == 1)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,31) == 1)
+# define LZO_SIZEOF_SHORT 4
+# elif (__LZO_LSR(USHRT_MAX,63) == 1)
+# define LZO_SIZEOF_SHORT 8
+# elif (__LZO_LSR(USHRT_MAX,127) == 1)
+# define LZO_SIZEOF_SHORT 16
+# else
+# error "LZO_SIZEOF_SHORT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_INT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_INT 8
+# elif (UINT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_INT 2
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,7) == 1)
+# define LZO_SIZEOF_INT 1
+# elif (__LZO_LSR(UINT_MAX,15) == 1)
+# define LZO_SIZEOF_INT 2
+# elif (__LZO_LSR(UINT_MAX,31) == 1)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,63) == 1)
+# define LZO_SIZEOF_INT 8
+# elif (__LZO_LSR(UINT_MAX,127) == 1)
+# define LZO_SIZEOF_INT 16
+# else
+# error "LZO_SIZEOF_INT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG)
+# if (ULONG_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,7) == 1)
+# define LZO_SIZEOF_LONG 1
+# elif (__LZO_LSR(ULONG_MAX,15) == 1)
+# define LZO_SIZEOF_LONG 2
+# elif (__LZO_LSR(ULONG_MAX,31) == 1)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,63) == 1)
+# define LZO_SIZEOF_LONG 8
+# elif (__LZO_LSR(ULONG_MAX,127) == 1)
+# define LZO_SIZEOF_LONG 16
+# else
+# error "LZO_SIZEOF_LONG"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
+# if (LZO_CC_GNUC >= 0x030300ul)
+# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
+# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG
+# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
+# define LZO_SIZEOF_LONG_LONG 4
+# endif
+# endif
+# endif
+#endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+#if (LZO_ARCH_I086 && LZO_CC_DMC)
+#elif (LZO_CC_CILLY) && defined(__GNUC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_OS_WIN64 || defined(_WIN64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_DMC))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2)
+#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define LZO_SIZEOF_LONG_LONG 8
+#endif
+#endif
+#endif
+#if defined(__cplusplus) && defined(LZO_CC_GNUC)
+# if (LZO_CC_GNUC < 0x020800ul)
+# undef LZO_SIZEOF_LONG_LONG
+# endif
+#endif
+#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if (LZO_ARCH_I086)
+# define __LZO_WORDSIZE 2
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+# define LZO_SIZEOF_VOID_P 2
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# error "LZO_MM"
+# endif
+#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
+# define __LZO_WORDSIZE 1
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430)
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 2
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define __LZO_WORDSIZE 2
+# define LZO_SIZEOF_VOID_P 2
+# endif
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4)
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT
+# endif
+#elif (LZO_ARCH_M16C)
+# define __LZO_WORDSIZE 2
+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define LZO_SIZEOF_VOID_P 2
+# endif
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# define __LZO_WORDSIZE LZO_SIZEOF_LONG
+# define LZO_SIZEOF_VOID_P 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_VOID_P 8
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (LZO_ARCH_SPU)
+# if 0
+# define __LZO_WORDSIZE 16
+# endif
+# define LZO_SIZEOF_VOID_P 4
+#else
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+#endif
+#endif
+#if !defined(LZO_WORDSIZE)
+# if defined(__LZO_WORDSIZE)
+# define LZO_WORDSIZE __LZO_WORDSIZE
+# else
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
+# endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
+#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
+# define LZO_SIZEOF_SIZE_T 2
+#else
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
+#if (LZO_ARCH_I086)
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE)
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE)
+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# define LZO_SIZEOF_PTRDIFF_T 4
+# else
+# define LZO_SIZEOF_PTRDIFF_T 2
+# endif
+# else
+# error "LZO_MM"
+# endif
+#else
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
+#endif
+#endif
+#if defined(LZO_ABI_NEUTRAL_ENDIAN)
+# undef LZO_ABI_BIG_ENDIAN
+# undef LZO_ABI_LITTLE_ENDIAN
+#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN)
+#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_M68K || LZO_ARCH_S390)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
+# if (__LITTLE_ENDIAN__ == 1)
+# define LZO_ABI_LITTLE_ENDIAN 1
+# else
+# define LZO_ABI_BIG_ENDIAN 1
+# endif
+#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#endif
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN)
+# error "this should not happen"
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "be"
+#elif defined(LZO_ABI_LITTLE_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "le"
+#elif defined(LZO_ABI_NEUTRAL_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "neutral"
+#endif
+#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_I8LP16 1
+# define LZO_INFO_ABI_PM "i8lp16"
+#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_ILP16 1
+# define LZO_INFO_ABI_PM "ilp16"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_ILP32 1
+# define LZO_INFO_ABI_PM "ilp32"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8)
+# define LZO_ABI_LLP64 1
+# define LZO_INFO_ABI_PM "llp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_LP64 1
+# define LZO_INFO_ABI_PM "lp64"
+#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_ILP64 1
+# define LZO_INFO_ABI_PM "ilp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_IP32L64 1
+# define LZO_INFO_ABI_PM "ip32l64"
+#endif
+#if !defined(__LZO_LIBC_OVERRIDE)
+#if defined(LZO_LIBC_NAKED)
+# define LZO_INFO_LIBC "naked"
+#elif defined(LZO_LIBC_FREESTANDING)
+# define LZO_INFO_LIBC "freestanding"
+#elif defined(LZO_LIBC_MOSTLY_FREESTANDING)
+# define LZO_INFO_LIBC "mfreestanding"
+#elif defined(LZO_LIBC_ISOC90)
+# define LZO_INFO_LIBC "isoc90"
+#elif defined(LZO_LIBC_ISOC99)
+# define LZO_INFO_LIBC "isoc99"
+#elif defined(__dietlibc__)
+# define LZO_LIBC_DIETLIBC 1
+# define LZO_INFO_LIBC "dietlibc"
+#elif defined(_NEWLIB_VERSION)
+# define LZO_LIBC_NEWLIB 1
+# define LZO_INFO_LIBC "newlib"
+#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
+# if defined(__UCLIBC_SUBLEVEL__)
+# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
+# else
+# define LZO_LIBC_UCLIBC 0x00090bL
+# endif
+# define LZO_INFO_LIBC "uclibc"
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
+# define LZO_INFO_LIBC "glibc"
+#elif (LZO_CC_MWERKS) && defined(__MSL__)
+# define LZO_LIBC_MSL __MSL__
+# define LZO_INFO_LIBC "msl"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
+#else
+# define LZO_LIBC_DEFAULT 1
+# define LZO_INFO_LIBC "default"
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#else
+# define __lzo_gnuc_extension__
+#endif
+#endif
+#if !defined(__lzo_ua_volatile)
+# define __lzo_ua_volatile volatile
+#endif
+#if !defined(__lzo_alignof)
+#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700))
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_alignof(e) __alignof(e)
+#endif
+#endif
+#if defined(__lzo_alignof)
+# define __lzo_HAVE_alignof 1
+#endif
+#if !defined(__lzo_constructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#endif
+#if defined(__lzo_constructor)
+# define __lzo_HAVE_constructor 1
+#endif
+#if !defined(__lzo_destructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#endif
+#if defined(__lzo_destructor)
+# define __lzo_HAVE_destructor 1
+#endif
+#if defined(__lzo_HAVE_destructor) && !defined(__lzo_HAVE_constructor)
+# error "this should not happen"
+#endif
+#if !defined(__lzo_inline)
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_inline __inline__
+#elif (LZO_CC_DMC)
+# define __lzo_inline __inline
+#elif (LZO_CC_INTELC)
+# define __lzo_inline __inline
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405))
+# define __lzo_inline __inline
+#elif (LZO_CC_MSC && (_MSC_VER >= 900))
+# define __lzo_inline __inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define __lzo_inline inline
+#endif
+#endif
+#if defined(__lzo_inline)
+# define __lzo_HAVE_inline 1
+#else
+# define __lzo_inline
+#endif
+#if !defined(__lzo_forceinline)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#endif
+#endif
+#if defined(__lzo_forceinline)
+# define __lzo_HAVE_forceinline 1
+#else
+# define __lzo_forceinline
+#endif
+#if !defined(__lzo_noinline)
+#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
+# define __lzo_noinline __attribute__((__noinline__,__used__))
+#elif (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC)
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# if defined(__cplusplus)
+# else
+# define __lzo_noinline __declspec(noinline)
+# endif
+#endif
+#endif
+#if defined(__lzo_noinline)
+# define __lzo_HAVE_noinline 1
+#else
+# define __lzo_noinline
+#endif
+#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__lzo_HAVE_inline)
+# error "this should not happen"
+#endif
+#if !defined(__lzo_noreturn)
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#endif
+#endif
+#if defined(__lzo_noreturn)
+# define __lzo_HAVE_noreturn 1
+#else
+# define __lzo_noreturn
+#endif
+#if !defined(__lzo_nothrow)
+#if (LZO_CC_GNUC >= 0x030300ul)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#endif
+#endif
+#if defined(__lzo_nothrow)
+# define __lzo_HAVE_nothrow 1
+#else
+# define __lzo_nothrow
+#endif
+#if !defined(__lzo_restrict)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_LLVM)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
+# define __lzo_restrict __restrict
+#endif
+#endif
+#if defined(__lzo_restrict)
+# define __lzo_HAVE_restrict 1
+#else
+# define __lzo_restrict
+#endif
+#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#endif
+#endif
+#if defined(__lzo_likely)
+# define __lzo_HAVE_likely 1
+#else
+# define __lzo_likely(e) (e)
+#endif
+#if defined(__lzo_unlikely)
+# define __lzo_HAVE_unlikely 1
+#else
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(LZO_UNUSED)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC)
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNUSED(var) ((void) var)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_KEILC)
+# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];}
+# elif (LZO_CC_PACIFICC)
+# define LZO_UNUSED(var) ((void) sizeof(var))
+# elif (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED(var) ((void) var)
+# else
+# define LZO_UNUSED(var) ((void) &var)
+# endif
+#endif
+#if !defined(LZO_UNUSED_FUNC)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC)
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_LLVM)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_MSC)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_KEILC || LZO_CC_PELLESC)
+# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# elif (LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if (0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
+# if 0
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
+# elif 0 && (LZO_CC_GNUC)
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
+# else
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)];
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)];
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];}
+# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# else
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];}
+# endif
+#endif
+#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC)
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit
+# define __lzo_cdecl_main __cdecl
+# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_qsort __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_qsort _stdcall
+# else
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# elif (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+# else
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit __cdecl
+# define __lzo_cdecl_main __cdecl
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC)
+# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_sighandler __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_sighandler _stdcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
+# define __lzo_cdecl_sighandler __clrcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
+# if defined(_DLL)
+# define __lzo_cdecl_sighandler _far _cdecl _loadds
+# elif defined(_MT)
+# define __lzo_cdecl_sighandler _far _cdecl
+# else
+# define __lzo_cdecl_sighandler _cdecl
+# endif
+# else
+# define __lzo_cdecl_sighandler __cdecl
+# endif
+#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# define __lzo_cdecl cdecl
+#endif
+#if !defined(__lzo_cdecl)
+# define __lzo_cdecl
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if !defined(LZO_CFG_NO_WINDOWS_H)
+#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
+# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul)))
+# else
+# define LZO_HAVE_WINDOWS_H 1
+# endif
+#endif
+#endif
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# define LZO_OPT_UNALIGNED64 1
+#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB)
+#elif (LZO_ARCH_ARM)
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_CRIS)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_I386)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_IA64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_PREFER_POSTINC 1
+#elif (LZO_ARCH_M68K)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(__mc68020__) && !defined(__mcoldfire__)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_MIPS)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_POWERPC)
+# define LZO_OPT_PREFER_PREINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_S390)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# if (LZO_SIZEOF_SIZE_T == 8)
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_SH)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+#endif
+#if !defined(LZO_CFG_NO_INLINE_ASM)
+#if defined(LZO_CC_LLVM)
+# define LZO_CFG_NO_INLINE_ASM 1
+#endif
+#endif
+#if !defined(LZO_CFG_NO_UNALIGNED)
+#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_UNALIGNED 1
+#endif
+#endif
+#if defined(LZO_CFG_NO_UNALIGNED)
+# undef LZO_OPT_UNALIGNED16
+# undef LZO_OPT_UNALIGNED32
+# undef LZO_OPT_UNALIGNED64
+#endif
+#if defined(LZO_CFG_NO_INLINE_ASM)
+#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+# define LZO_ASM_SYNTAX_MSC 1
+#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#endif
+#if (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZO_ASM_CLOBBER "ax"
+#elif (LZO_CC_INTELC)
+# define __LZO_ASM_CLOBBER "memory"
+#else
+# define __LZO_ASM_CLOBBER "cc", "memory"
+#endif
+#endif
+#if defined(__LZO_INFOSTR_MM)
+#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM))
+# define __LZO_INFOSTR_MM ""
+#elif defined(LZO_INFO_MM)
+# define __LZO_INFOSTR_MM "." LZO_INFO_MM
+#else
+# define __LZO_INFOSTR_MM ""
+#endif
+#if defined(__LZO_INFOSTR_PM)
+#elif defined(LZO_INFO_ABI_PM)
+# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM
+#else
+# define __LZO_INFOSTR_PM ""
+#endif
+#if defined(__LZO_INFOSTR_ENDIAN)
+#elif defined(LZO_INFO_ABI_ENDIAN)
+# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN
+#else
+# define __LZO_INFOSTR_ENDIAN ""
+#endif
+#if defined(__LZO_INFOSTR_OSNAME)
+#elif defined(LZO_INFO_OS_CONSOLE)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE
+#elif defined(LZO_INFO_OS_POSIX)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX
+#else
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS
+#endif
+#if defined(__LZO_INFOSTR_LIBC)
+#elif defined(LZO_INFO_LIBC)
+# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC
+#else
+# define __LZO_INFOSTR_LIBC ""
+#endif
+#if defined(__LZO_INFOSTR_CCVER)
+#elif defined(LZO_INFO_CCVER)
+# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER
+#else
+# define __LZO_INFOSTR_CCVER ""
+#endif
+#define LZO_INFO_STRING \
+ LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \
+ " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER
+
+#endif /* already included */
+
+/* vim:set ts=4 et: */
diff --git a/extern/lzo/minilzo/minilzo.c b/extern/lzo/minilzo/minilzo.c
new file mode 100644
index 00000000000..6a62b31b94a
--- /dev/null
+++ b/extern/lzo/minilzo/minilzo.c
@@ -0,0 +1,4112 @@
+/* minilzo.c -- mini subset of the LZO real-time data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library 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.
+
+ The LZO library 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 the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+/*
+ * NOTE:
+ * the full LZO package can be found at
+ * http://www.oberhumer.com/opensource/lzo/
+ */
+
+#define __LZO_IN_MINILZO
+#define LZO_BUILD
+
+#if defined(LZO_CFG_FREESTANDING)
+# undef MINILZO_HAVE_CONFIG_H
+# define LZO_LIBC_FREESTANDING 1
+# define LZO_OS_FREESTANDING 1
+#endif
+
+#ifdef MINILZO_HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <limits.h>
+#include <stddef.h>
+#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS)
+
+#ifndef __LZODEFS_H_INCLUDED
+#define __LZODEFS_H_INCLUDED 1
+
+#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
+# define __CYGWIN__ __CYGWIN32__
+#endif
+#if defined(__IBMCPP__) && !defined(__IBMC__)
+# define __IBMC__ __IBMCPP__
+#endif
+#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
+# define __INTEL_COMPILER __ICL
+#endif
+#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
+# define _ALL_SOURCE 1
+#endif
+#if defined(__mips__) && defined(__R5900__)
+# if !defined(__LONG_MAX__)
+# define __LONG_MAX__ 9223372036854775807L
+# endif
+#endif
+#if defined(__INTEL_COMPILER) && defined(__linux__)
+# pragma warning(disable: 193)
+#endif
+#if defined(__KEIL__) && defined(__C166__)
+# pragma warning disable = 322
+#elif 0 && defined(__C251__)
+# pragma warning disable = 322
+#endif
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if (_MSC_VER >= 1300)
+# pragma warning(disable: 4668)
+# endif
+#endif
+#if 0 && defined(__WATCOMC__)
+# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
+# pragma warning 203 9
+# endif
+#endif
+#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
+# pragma option -h
+#endif
+#if 0
+#define LZO_0xffffL 0xfffful
+#define LZO_0xffffffffL 0xfffffffful
+#else
+#define LZO_0xffffL 65535ul
+#define LZO_0xffffffffL 4294967295ul
+#endif
+#if (LZO_0xffffL == LZO_0xffffffffL)
+# error "your preprocessor is broken 1"
+#endif
+#if (16ul * 16384ul != 262144ul)
+# error "your preprocessor is broken 2"
+#endif
+#if 0
+#if (32767 >= 4294967295ul)
+# error "your preprocessor is broken 3"
+#endif
+#if (65535u >= 4294967295ul)
+# error "your preprocessor is broken 4"
+#endif
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
+# if !defined(MSDOS)
+# define MSDOS 1
+# endif
+# if !defined(_MSDOS)
+# define _MSDOS 1
+# endif
+#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX)
+# if (__VERSION == 520) && (MB_LEN_MAX == 1)
+# if !defined(__AZTEC_C__)
+# define __AZTEC_C__ __VERSION
+# endif
+# if !defined(__DOS__)
+# define __DOS__ 1
+# endif
+# endif
+#endif
+#endif
+#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL)
+# define ptrdiff_t long
+# define _PTRDIFF_T_DEFINED
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+# if defined(__AZTEC_C__) && defined(__DOS__)
+# define __LZO_RENAME_A 1
+# elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define __LZO_RENAME_A 1
+# elif (_MSC_VER < 700)
+# define __LZO_RENAME_B 1
+# endif
+# elif defined(__TSC__) && defined(__OS2__)
+# define __LZO_RENAME_A 1
+# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
+# define __LZO_RENAME_A 1
+# elif defined(__PACIFIC__) && defined(DOS)
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# endif
+# if defined(__LZO_RENAME_A)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# elif defined(__LZO_RENAME_B)
+# if !defined(__cdecl)
+# define __cdecl _cdecl
+# endif
+# if !defined(__far)
+# define __far _far
+# endif
+# if !defined(__huge)
+# define __huge _huge
+# endif
+# if !defined(__near)
+# define __near _near
+# endif
+# if !defined(__pascal)
+# define __pascal _pascal
+# endif
+# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# endif
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__AZTEC_C__) && defined(__DOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+#elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# endif
+# if (_MSC_VER < 700)
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# define LZO_BROKEN_SIZEOF 1
+# endif
+#elif defined(__PACIFIC__) && defined(DOS)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#elif defined(__TURBOC__) && defined(__MSDOS__)
+# if (__TURBOC__ < 0x0150)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# endif
+# if (__TURBOC__ < 0x0200)
+# define LZO_BROKEN_SIZEOF 1
+# endif
+# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# endif
+#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_SIZEOF 1
+#endif
+#endif
+#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#endif
+#if defined(_CRAY) && defined(_CRAY1)
+# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1
+#endif
+#define LZO_PP_STRINGIZE(x) #x
+#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x)
+#define LZO_PP_CONCAT2(a,b) a ## b
+#define LZO_PP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b)
+#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c)
+#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d)
+#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e)
+#if 1
+#define LZO_CPP_STRINGIZE(x) #x
+#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x)
+#define LZO_CPP_CONCAT2(a,b) a ## b
+#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b)
+#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c)
+#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d)
+#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e)
+#endif
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o))
+#if 1 && defined(__cplusplus)
+# if !defined(__STDC_CONSTANT_MACROS)
+# define __STDC_CONSTANT_MACROS 1
+# endif
+# if !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS 1
+# endif
+#endif
+#if defined(__cplusplus)
+# define LZO_EXTERN_C extern "C"
+#else
+# define LZO_EXTERN_C extern
+#endif
+#if !defined(__LZO_OS_OVERRIDE)
+#if defined(LZO_OS_FREESTANDING)
+# define LZO_INFO_OS "freestanding"
+#elif defined(LZO_OS_EMBEDDED)
+# define LZO_INFO_OS "embedded"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_OS_EMBEDDED 1
+# define LZO_INFO_OS "embedded"
+#elif defined(__CYGWIN__) && defined(__GNUC__)
+# define LZO_OS_CYGWIN 1
+# define LZO_INFO_OS "cygwin"
+#elif defined(__EMX__) && defined(__GNUC__)
+# define LZO_OS_EMX 1
+# define LZO_INFO_OS "emx"
+#elif defined(__BEOS__)
+# define LZO_OS_BEOS 1
+# define LZO_INFO_OS "beos"
+#elif defined(__Lynx__)
+# define LZO_OS_LYNXOS 1
+# define LZO_INFO_OS "lynxos"
+#elif defined(__OS400__)
+# define LZO_OS_OS400 1
+# define LZO_INFO_OS "os400"
+#elif defined(__QNX__)
+# define LZO_OS_QNX 1
+# define LZO_INFO_OS "qnx"
+#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__BORLANDC__) && defined(__DPMI16__)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+#elif defined(__ZTC__) && defined(DOS386)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__OS2__) || defined(__OS2V2__)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_OS216 1
+# define LZO_INFO_OS "os216"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_OS2 1
+# define LZO_INFO_OS "os2"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
+# define LZO_OS_WIN64 1
+# define LZO_INFO_OS "win64"
+#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__MWERKS__) && defined(__INTEL__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_WIN16 1
+# define LZO_INFO_OS "win16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WATCOMC__)
+# if defined(__NT__) && (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif defined(__NT__) && (__WATCOMC__ < 1100)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# elif defined(__linux__) || defined(__LINUX__)
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+# else
+# error "please specify a target using the -bt compiler option"
+# endif
+#elif defined(__palmos__)
+# define LZO_OS_PALMOS 1
+# define LZO_INFO_OS "palmos"
+#elif defined(__TOS__) || defined(__atarist__)
+# define LZO_OS_TOS 1
+# define LZO_INFO_OS "tos"
+#elif defined(macintosh) && !defined(__ppc__)
+# define LZO_OS_MACCLASSIC 1
+# define LZO_INFO_OS "macclassic"
+#elif defined(__VMS)
+# define LZO_OS_VMS 1
+# define LZO_INFO_OS "vms"
+#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PS2 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "ps2"
+#elif (defined(__mips__) && defined(__psp__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PSP 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "psp"
+#else
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+#endif
+#if (LZO_OS_POSIX)
+# if defined(_AIX) || defined(__AIX__) || defined(__aix__)
+# define LZO_OS_POSIX_AIX 1
+# define LZO_INFO_OS_POSIX "aix"
+# elif defined(__FreeBSD__)
+# define LZO_OS_POSIX_FREEBSD 1
+# define LZO_INFO_OS_POSIX "freebsd"
+# elif defined(__hpux__) || defined(__hpux)
+# define LZO_OS_POSIX_HPUX 1
+# define LZO_INFO_OS_POSIX "hpux"
+# elif defined(__INTERIX)
+# define LZO_OS_POSIX_INTERIX 1
+# define LZO_INFO_OS_POSIX "interix"
+# elif defined(__IRIX__) || defined(__irix__)
+# define LZO_OS_POSIX_IRIX 1
+# define LZO_INFO_OS_POSIX "irix"
+# elif defined(__linux__) || defined(__linux) || defined(__LINUX__)
+# define LZO_OS_POSIX_LINUX 1
+# define LZO_INFO_OS_POSIX "linux"
+# elif defined(__APPLE__) || defined(__MACOS__)
+# define LZO_OS_POSIX_MACOSX 1
+# define LZO_INFO_OS_POSIX "macosx"
+# elif defined(__minix__) || defined(__minix)
+# define LZO_OS_POSIX_MINIX 1
+# define LZO_INFO_OS_POSIX "minix"
+# elif defined(__NetBSD__)
+# define LZO_OS_POSIX_NETBSD 1
+# define LZO_INFO_OS_POSIX "netbsd"
+# elif defined(__OpenBSD__)
+# define LZO_OS_POSIX_OPENBSD 1
+# define LZO_INFO_OS_POSIX "openbsd"
+# elif defined(__osf__)
+# define LZO_OS_POSIX_OSF 1
+# define LZO_INFO_OS_POSIX "osf"
+# elif defined(__solaris__) || defined(__sun)
+# if defined(__SVR4) || defined(__svr4__)
+# define LZO_OS_POSIX_SOLARIS 1
+# define LZO_INFO_OS_POSIX "solaris"
+# else
+# define LZO_OS_POSIX_SUNOS 1
+# define LZO_INFO_OS_POSIX "sunos"
+# endif
+# elif defined(__ultrix__) || defined(__ultrix)
+# define LZO_OS_POSIX_ULTRIX 1
+# define LZO_INFO_OS_POSIX "ultrix"
+# elif defined(_UNICOS)
+# define LZO_OS_POSIX_UNICOS 1
+# define LZO_INFO_OS_POSIX "unicos"
+# else
+# define LZO_OS_POSIX_UNKNOWN 1
+# define LZO_INFO_OS_POSIX "unknown"
+# endif
+#endif
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (UINT_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
+# define LZO_CC_CILLY 1
+# define LZO_INFO_CC "Cilly"
+# if defined(__CILLY__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
+# define LZO_CC_SDCC 1
+# define LZO_INFO_CC "sdcc"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC)
+#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
+# define LZO_INFO_CC "Pathscale C"
+# define LZO_INFO_CCVER __PATHSCALE__
+#elif defined(__INTEL_COMPILER)
+# define LZO_CC_INTELC 1
+# define LZO_INFO_CC "Intel C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
+# if defined(_WIN32) || defined(_WIN64)
+# define LZO_CC_SYNTAX_MSC 1
+# else
+# define LZO_CC_SYNTAX_GNUC 1
+# endif
+#elif defined(__POCC__) && defined(_WIN32)
+# define LZO_CC_PELLESC 1
+# define LZO_INFO_CC "Pelles C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__)
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# else
+# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# endif
+# define LZO_INFO_CC "llvm-gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__ACK__) && defined(_ACK)
+# define LZO_CC_ACK 1
+# define LZO_INFO_CC "Amsterdam Compiler Kit C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__AZTEC_C__)
+# define LZO_CC_AZTECC 1
+# define LZO_INFO_CC "Aztec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__BORLANDC__)
+# define LZO_CC_BORLANDC 1
+# define LZO_INFO_CC "Borland C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__)
+#elif defined(_CRAYC) && defined(_RELEASE)
+# define LZO_CC_CRAYC 1
+# define LZO_INFO_CC "Cray C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE)
+#elif defined(__DMC__) && defined(__SC__)
+# define LZO_CC_DMC 1
+# define LZO_INFO_CC "Digital Mars C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__)
+#elif defined(__DECC)
+# define LZO_CC_DECC 1
+# define LZO_INFO_CC "DEC C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC)
+#elif defined(__HIGHC__)
+# define LZO_CC_HIGHC 1
+# define LZO_INFO_CC "MetaWare High C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define LZO_CC_IARC 1
+# define LZO_INFO_CC "IAR C"
+# if defined(__VER__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__IBMC__)
+# define LZO_CC_IBMC 1
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__)
+#elif defined(__KEIL__) && defined(__C166__)
+# define LZO_CC_KEILC 1
+# define LZO_INFO_CC "Keil C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__)
+#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
+# define LZO_CC_LCCWIN32 1
+# define LZO_INFO_CC "lcc-win32"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__LCC__)
+# define LZO_CC_LCC 1
+# define LZO_INFO_CC "lcc"
+# if defined(__LCC_VERSION__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(_MSC_VER)
+# define LZO_CC_MSC 1
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
+# endif
+#elif defined(__MWERKS__)
+# define LZO_CC_MWERKS 1
+# define LZO_INFO_CC "Metrowerks C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__)
+#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
+# define LZO_CC_NDPC 1
+# define LZO_INFO_CC "Microway NDP C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PACIFIC__)
+# define LZO_CC_PACIFICC 1
+# define LZO_INFO_CC "Pacific C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
+# define LZO_CC_PGI 1
+# define LZO_INFO_CC "Portland Group PGI C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PUREC__) && defined(__TOS__)
+# define LZO_CC_PUREC 1
+# define LZO_INFO_CC "Pure C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__)
+#elif defined(__SC__) && defined(__ZTC__)
+# define LZO_CC_SYMANTECC 1
+# define LZO_INFO_CC "Symantec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__)
+#elif defined(__SUNPRO_C)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_C)+0 > 0)
+# define LZO_CC_SUNPROC __SUNPRO_C
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__SUNPRO_CC)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_CC)+0 > 0)
+# define LZO_CC_SUNPROC __SUNPRO_CC
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__TINYC__)
+# define LZO_CC_TINYC 1
+# define LZO_INFO_CC "Tiny C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__)
+#elif defined(__TSC__)
+# define LZO_CC_TOPSPEEDC 1
+# define LZO_INFO_CC "TopSpeed C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__)
+#elif defined(__WATCOMC__)
+# define LZO_CC_WATCOMC 1
+# define LZO_INFO_CC "Watcom C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__)
+#elif defined(__TURBOC__)
+# define LZO_CC_TURBOC 1
+# define LZO_INFO_CC "Turbo C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__)
+#elif defined(__ZTC__)
+# define LZO_CC_ZORTECHC 1
+# define LZO_INFO_CC "Zortech C"
+# if (__ZTC__ == 0x310)
+# define LZO_INFO_CCVER "0x310"
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__)
+# endif
+#else
+# define LZO_CC_UNKNOWN 1
+# define LZO_INFO_CC "unknown"
+# define LZO_INFO_CCVER "unknown"
+#endif
+#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
+# error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE) && !defined(LZO_ARCH_GENERIC) && defined(_CRAY)
+# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY)
+# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
+# define LZO_ARCH_CRAY_MPP 1
+# elif defined(_CRAY1)
+# define LZO_ARCH_CRAY_PVP 1
+# endif
+# endif
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE)
+#if defined(LZO_ARCH_GENERIC)
+# define LZO_INFO_ARCH "generic"
+#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086 1
+# define LZO_ARCH_IA16 1
+# define LZO_INFO_ARCH "i086"
+#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+# define LZO_ARCH_AMD64 1
+# define LZO_INFO_ARCH "amd64"
+#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
+# define LZO_ARCH_ARM 1
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
+# define LZO_ARCH_ARM 1
+# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
+# define LZO_INFO_ARCH "arm"
+# else
+# define LZO_INFO_ARCH "arm"
+# endif
+#elif defined(__arm__) || defined(_M_ARM)
+# define LZO_ARCH_ARM 1
+# define LZO_INFO_ARCH "arm"
+#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
+# define LZO_ARCH_AVR 1
+# define LZO_INFO_ARCH "avr"
+#elif defined(__bfin__)
+# define LZO_ARCH_BLACKFIN 1
+# define LZO_INFO_ARCH "blackfin"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__)
+# define LZO_ARCH_C166 1
+# define LZO_INFO_ARCH "c166"
+#elif defined(__cris__)
+# define LZO_ARCH_CRIS 1
+# define LZO_INFO_ARCH "cris"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
+# define LZO_ARCH_EZ80 1
+# define LZO_INFO_ARCH "ez80"
+#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_ARCH_H8300 1
+# define LZO_INFO_ARCH "h8300"
+#elif defined(__hppa__) || defined(__hppa)
+# define LZO_ARCH_HPPA 1
+# define LZO_INFO_ARCH "hppa"
+#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_CC_ZORTECHC && defined(__I86__))
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
+# define LZO_ARCH_IA64 1
+# define LZO_INFO_ARCH "ia64"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__)
+# define LZO_ARCH_M16C 1
+# define LZO_INFO_ARCH "m16c"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
+# define LZO_ARCH_M16C 1
+# define LZO_INFO_ARCH "m16c"
+#elif defined(__m32r__)
+# define LZO_ARCH_M32R 1
+# define LZO_INFO_ARCH "m32r"
+#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K)
+# define LZO_ARCH_M68K 1
+# define LZO_INFO_ARCH "m68k"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__)
+# define LZO_ARCH_MCS251 1
+# define LZO_INFO_ARCH "mcs251"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__)
+# define LZO_ARCH_MCS51 1
+# define LZO_INFO_ARCH "mcs51"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
+# define LZO_ARCH_MCS51 1
+# define LZO_INFO_ARCH "mcs51"
+#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
+# define LZO_ARCH_MIPS 1
+# define LZO_INFO_ARCH "mips"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
+# define LZO_ARCH_POWERPC 1
+# define LZO_INFO_ARCH "powerpc"
+#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
+# define LZO_ARCH_S390 1
+# define LZO_INFO_ARCH "s390"
+#elif defined(__sh__) || defined(_M_SH)
+# define LZO_ARCH_SH 1
+# define LZO_INFO_ARCH "sh"
+#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
+# define LZO_ARCH_SPARC 1
+# define LZO_INFO_ARCH "sparc"
+#elif defined(__SPU__)
+# define LZO_ARCH_SPU 1
+# define LZO_INFO_ARCH "spu"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
+# define LZO_ARCH_Z80 1
+# define LZO_INFO_ARCH "z80"
+#elif (LZO_ARCH_CRAY_PVP)
+# if defined(_CRAYSV1)
+# define LZO_ARCH_CRAY_SV1 1
+# define LZO_INFO_ARCH "cray_sv1"
+# elif (_ADDR64)
+# define LZO_ARCH_CRAY_T90 1
+# define LZO_INFO_ARCH "cray_t90"
+# elif (_ADDR32)
+# define LZO_ARCH_CRAY_YMP 1
+# define LZO_INFO_ARCH "cray_ymp"
+# else
+# define LZO_ARCH_CRAY_XMP 1
+# define LZO_INFO_ARCH "cray_xmp"
+# endif
+#else
+# define LZO_ARCH_UNKNOWN 1
+# define LZO_INFO_ARCH "unknown"
+#endif
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2)
+# error "FIXME - missing define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
+# error "FIXME - missing WIN32 define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
+# error "FIXME - missing WIN64 define for CPU architecture"
+#endif
+#if (LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#endif
+#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM)
+# error "this should not happen"
+#endif
+#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086)
+# error "this should not happen"
+#endif
+#if (LZO_ARCH_I086)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_ARCH_I386)
+# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if !defined(__LZO_MM_OVERRIDE)
+#if (LZO_ARCH_I086)
+#if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+#endif
+#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
+# define LZO_MM_TINY 1
+#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
+# define LZO_MM_HUGE 1
+#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
+# define LZO_MM_SMALL 1
+#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
+# define LZO_MM_MEDIUM 1
+#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
+# define LZO_MM_COMPACT 1
+#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
+# define LZO_MM_LARGE 1
+#elif (LZO_CC_AZTECC)
+# if defined(_LARGE_CODE) && defined(_LARGE_DATA)
+# define LZO_MM_LARGE 1
+# elif defined(_LARGE_CODE)
+# define LZO_MM_MEDIUM 1
+# elif defined(_LARGE_DATA)
+# define LZO_MM_COMPACT 1
+# else
+# define LZO_MM_SMALL 1
+# endif
+#elif (LZO_CC_ZORTECHC && defined(__VCM__))
+# define LZO_MM_LARGE 1
+#else
+# error "unknown memory model"
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#define LZO_HAVE_MM_HUGE_PTR 1
+#define LZO_HAVE_MM_HUGE_ARRAY 1
+#if (LZO_MM_TINY)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC)
+# undef LZO_HAVE_MM_HUGE_PTR
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_MSC && defined(_QC))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+# if (_MSC_VER < 600)
+# undef LZO_HAVE_MM_HUGE_PTR
+# endif
+#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR)
+# if (LZO_OS_DOS16)
+# error "this should not happen"
+# elif (LZO_CC_ZORTECHC)
+# else
+# error "this should not happen"
+# endif
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16)
+# define LZO_MM_AHSHIFT 12
+#elif (LZO_CC_WATCOMC)
+ extern unsigned char _HShift;
+# define LZO_MM_AHSHIFT ((unsigned) _HShift)
+#else
+# error "FIXME - implement LZO_MM_AHSHIFT"
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+#elif (LZO_ARCH_C166)
+#if !defined(__MODEL__)
+# error "FIXME - C166 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - C166 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS251)
+#if !defined(__MODEL__)
+# error "FIXME - MCS251 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS251 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS51)
+#if !defined(__MODEL__)
+# error "FIXME - MCS51 __MODEL__"
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS51 __MODEL__"
+#endif
+#elif (LZO_ARCH_CRAY_PVP)
+# define LZO_MM_PVP 1
+#else
+# define LZO_MM_FLAT 1
+#endif
+#if (LZO_MM_COMPACT)
+# define LZO_INFO_MM "compact"
+#elif (LZO_MM_FLAT)
+# define LZO_INFO_MM "flat"
+#elif (LZO_MM_HUGE)
+# define LZO_INFO_MM "huge"
+#elif (LZO_MM_LARGE)
+# define LZO_INFO_MM "large"
+#elif (LZO_MM_MEDIUM)
+# define LZO_INFO_MM "medium"
+#elif (LZO_MM_PVP)
+# define LZO_INFO_MM "pvp"
+#elif (LZO_MM_SMALL)
+# define LZO_INFO_MM "small"
+#elif (LZO_MM_TINY)
+# define LZO_INFO_MM "tiny"
+#else
+# error "unknown memory model"
+#endif
+#endif
+#if defined(SIZEOF_SHORT)
+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#endif
+#if defined(SIZEOF_INT)
+# define LZO_SIZEOF_INT (SIZEOF_INT)
+#endif
+#if defined(SIZEOF_LONG)
+# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#endif
+#if defined(SIZEOF_LONG_LONG)
+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#endif
+#if defined(SIZEOF___INT16)
+# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
+#endif
+#if defined(SIZEOF___INT32)
+# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
+#endif
+#if defined(SIZEOF___INT64)
+# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
+#endif
+#if defined(SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#endif
+#if defined(SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#endif
+#if defined(SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#endif
+#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
+#if !defined(LZO_SIZEOF_SHORT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_SHORT 8
+# elif (USHRT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,7) == 1)
+# define LZO_SIZEOF_SHORT 1
+# elif (__LZO_LSR(USHRT_MAX,15) == 1)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,31) == 1)
+# define LZO_SIZEOF_SHORT 4
+# elif (__LZO_LSR(USHRT_MAX,63) == 1)
+# define LZO_SIZEOF_SHORT 8
+# elif (__LZO_LSR(USHRT_MAX,127) == 1)
+# define LZO_SIZEOF_SHORT 16
+# else
+# error "LZO_SIZEOF_SHORT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_INT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_INT 8
+# elif (UINT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_INT 2
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,7) == 1)
+# define LZO_SIZEOF_INT 1
+# elif (__LZO_LSR(UINT_MAX,15) == 1)
+# define LZO_SIZEOF_INT 2
+# elif (__LZO_LSR(UINT_MAX,31) == 1)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,63) == 1)
+# define LZO_SIZEOF_INT 8
+# elif (__LZO_LSR(UINT_MAX,127) == 1)
+# define LZO_SIZEOF_INT 16
+# else
+# error "LZO_SIZEOF_INT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG)
+# if (ULONG_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,7) == 1)
+# define LZO_SIZEOF_LONG 1
+# elif (__LZO_LSR(ULONG_MAX,15) == 1)
+# define LZO_SIZEOF_LONG 2
+# elif (__LZO_LSR(ULONG_MAX,31) == 1)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,63) == 1)
+# define LZO_SIZEOF_LONG 8
+# elif (__LZO_LSR(ULONG_MAX,127) == 1)
+# define LZO_SIZEOF_LONG 16
+# else
+# error "LZO_SIZEOF_LONG"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
+# if (LZO_CC_GNUC >= 0x030300ul)
+# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
+# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG
+# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
+# define LZO_SIZEOF_LONG_LONG 4
+# endif
+# endif
+# endif
+#endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+#if (LZO_ARCH_I086 && LZO_CC_DMC)
+#elif (LZO_CC_CILLY) && defined(__GNUC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_OS_WIN64 || defined(_WIN64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_DMC))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2)
+#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define LZO_SIZEOF_LONG_LONG 8
+#endif
+#endif
+#endif
+#if defined(__cplusplus) && defined(LZO_CC_GNUC)
+# if (LZO_CC_GNUC < 0x020800ul)
+# undef LZO_SIZEOF_LONG_LONG
+# endif
+#endif
+#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if (LZO_ARCH_I086)
+# define __LZO_WORDSIZE 2
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+# define LZO_SIZEOF_VOID_P 2
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# error "LZO_MM"
+# endif
+#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
+# define __LZO_WORDSIZE 1
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430)
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 2
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define __LZO_WORDSIZE 2
+# define LZO_SIZEOF_VOID_P 2
+# endif
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4)
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT
+# endif
+#elif (LZO_ARCH_M16C)
+# define __LZO_WORDSIZE 2
+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define LZO_SIZEOF_VOID_P 2
+# endif
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# define __LZO_WORDSIZE LZO_SIZEOF_LONG
+# define LZO_SIZEOF_VOID_P 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_VOID_P 8
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (LZO_ARCH_SPU)
+# if 0
+# define __LZO_WORDSIZE 16
+# endif
+# define LZO_SIZEOF_VOID_P 4
+#else
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+#endif
+#endif
+#if !defined(LZO_WORDSIZE)
+# if defined(__LZO_WORDSIZE)
+# define LZO_WORDSIZE __LZO_WORDSIZE
+# else
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
+# endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
+#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
+# define LZO_SIZEOF_SIZE_T 2
+#else
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
+#if (LZO_ARCH_I086)
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE)
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE)
+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# define LZO_SIZEOF_PTRDIFF_T 4
+# else
+# define LZO_SIZEOF_PTRDIFF_T 2
+# endif
+# else
+# error "LZO_MM"
+# endif
+#else
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
+#endif
+#endif
+#if defined(LZO_ABI_NEUTRAL_ENDIAN)
+# undef LZO_ABI_BIG_ENDIAN
+# undef LZO_ABI_LITTLE_ENDIAN
+#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN)
+#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_M68K || LZO_ARCH_S390)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
+# if (__LITTLE_ENDIAN__ == 1)
+# define LZO_ABI_LITTLE_ENDIAN 1
+# else
+# define LZO_ABI_BIG_ENDIAN 1
+# endif
+#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#endif
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN)
+# error "this should not happen"
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "be"
+#elif defined(LZO_ABI_LITTLE_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "le"
+#elif defined(LZO_ABI_NEUTRAL_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "neutral"
+#endif
+#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_I8LP16 1
+# define LZO_INFO_ABI_PM "i8lp16"
+#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_ILP16 1
+# define LZO_INFO_ABI_PM "ilp16"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_ILP32 1
+# define LZO_INFO_ABI_PM "ilp32"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8)
+# define LZO_ABI_LLP64 1
+# define LZO_INFO_ABI_PM "llp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_LP64 1
+# define LZO_INFO_ABI_PM "lp64"
+#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_ILP64 1
+# define LZO_INFO_ABI_PM "ilp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_IP32L64 1
+# define LZO_INFO_ABI_PM "ip32l64"
+#endif
+#if !defined(__LZO_LIBC_OVERRIDE)
+#if defined(LZO_LIBC_NAKED)
+# define LZO_INFO_LIBC "naked"
+#elif defined(LZO_LIBC_FREESTANDING)
+# define LZO_INFO_LIBC "freestanding"
+#elif defined(LZO_LIBC_MOSTLY_FREESTANDING)
+# define LZO_INFO_LIBC "mfreestanding"
+#elif defined(LZO_LIBC_ISOC90)
+# define LZO_INFO_LIBC "isoc90"
+#elif defined(LZO_LIBC_ISOC99)
+# define LZO_INFO_LIBC "isoc99"
+#elif defined(__dietlibc__)
+# define LZO_LIBC_DIETLIBC 1
+# define LZO_INFO_LIBC "dietlibc"
+#elif defined(_NEWLIB_VERSION)
+# define LZO_LIBC_NEWLIB 1
+# define LZO_INFO_LIBC "newlib"
+#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
+# if defined(__UCLIBC_SUBLEVEL__)
+# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
+# else
+# define LZO_LIBC_UCLIBC 0x00090bL
+# endif
+# define LZO_INFO_LIBC "uclibc"
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
+# define LZO_INFO_LIBC "glibc"
+#elif (LZO_CC_MWERKS) && defined(__MSL__)
+# define LZO_LIBC_MSL __MSL__
+# define LZO_INFO_LIBC "msl"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
+#else
+# define LZO_LIBC_DEFAULT 1
+# define LZO_INFO_LIBC "default"
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#else
+# define __lzo_gnuc_extension__
+#endif
+#endif
+#if !defined(__lzo_ua_volatile)
+# define __lzo_ua_volatile volatile
+#endif
+#if !defined(__lzo_alignof)
+#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700))
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_alignof(e) __alignof(e)
+#endif
+#endif
+#if defined(__lzo_alignof)
+# define __lzo_HAVE_alignof 1
+#endif
+#if !defined(__lzo_constructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#endif
+#if defined(__lzo_constructor)
+# define __lzo_HAVE_constructor 1
+#endif
+#if !defined(__lzo_destructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#endif
+#if defined(__lzo_destructor)
+# define __lzo_HAVE_destructor 1
+#endif
+#if defined(__lzo_HAVE_destructor) && !defined(__lzo_HAVE_constructor)
+# error "this should not happen"
+#endif
+#if !defined(__lzo_inline)
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_inline __inline__
+#elif (LZO_CC_DMC)
+# define __lzo_inline __inline
+#elif (LZO_CC_INTELC)
+# define __lzo_inline __inline
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405))
+# define __lzo_inline __inline
+#elif (LZO_CC_MSC && (_MSC_VER >= 900))
+# define __lzo_inline __inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define __lzo_inline inline
+#endif
+#endif
+#if defined(__lzo_inline)
+# define __lzo_HAVE_inline 1
+#else
+# define __lzo_inline
+#endif
+#if !defined(__lzo_forceinline)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#endif
+#endif
+#if defined(__lzo_forceinline)
+# define __lzo_HAVE_forceinline 1
+#else
+# define __lzo_forceinline
+#endif
+#if !defined(__lzo_noinline)
+#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
+# define __lzo_noinline __attribute__((__noinline__,__used__))
+#elif (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC)
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# if defined(__cplusplus)
+# else
+# define __lzo_noinline __declspec(noinline)
+# endif
+#endif
+#endif
+#if defined(__lzo_noinline)
+# define __lzo_HAVE_noinline 1
+#else
+# define __lzo_noinline
+#endif
+#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__lzo_HAVE_inline)
+# error "this should not happen"
+#endif
+#if !defined(__lzo_noreturn)
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#endif
+#endif
+#if defined(__lzo_noreturn)
+# define __lzo_HAVE_noreturn 1
+#else
+# define __lzo_noreturn
+#endif
+#if !defined(__lzo_nothrow)
+#if (LZO_CC_GNUC >= 0x030300ul)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#endif
+#endif
+#if defined(__lzo_nothrow)
+# define __lzo_HAVE_nothrow 1
+#else
+# define __lzo_nothrow
+#endif
+#if !defined(__lzo_restrict)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_LLVM)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
+# define __lzo_restrict __restrict
+#endif
+#endif
+#if defined(__lzo_restrict)
+# define __lzo_HAVE_restrict 1
+#else
+# define __lzo_restrict
+#endif
+#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#endif
+#endif
+#if defined(__lzo_likely)
+# define __lzo_HAVE_likely 1
+#else
+# define __lzo_likely(e) (e)
+#endif
+#if defined(__lzo_unlikely)
+# define __lzo_HAVE_unlikely 1
+#else
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(LZO_UNUSED)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC)
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNUSED(var) ((void) var)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_KEILC)
+# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];}
+# elif (LZO_CC_PACIFICC)
+# define LZO_UNUSED(var) ((void) sizeof(var))
+# elif (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED(var) ((void) var)
+# else
+# define LZO_UNUSED(var) ((void) &var)
+# endif
+#endif
+#if !defined(LZO_UNUSED_FUNC)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC)
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_LLVM)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_MSC)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_KEILC || LZO_CC_PELLESC)
+# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# elif (LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if (0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
+# if 0
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
+# elif 0 && (LZO_CC_GNUC)
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
+# else
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)];
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)];
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];}
+# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# else
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];}
+# endif
+#endif
+#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC)
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit
+# define __lzo_cdecl_main __cdecl
+# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_qsort __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_qsort _stdcall
+# else
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# elif (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+# else
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit __cdecl
+# define __lzo_cdecl_main __cdecl
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC)
+# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_sighandler __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_sighandler _stdcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
+# define __lzo_cdecl_sighandler __clrcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
+# if defined(_DLL)
+# define __lzo_cdecl_sighandler _far _cdecl _loadds
+# elif defined(_MT)
+# define __lzo_cdecl_sighandler _far _cdecl
+# else
+# define __lzo_cdecl_sighandler _cdecl
+# endif
+# else
+# define __lzo_cdecl_sighandler __cdecl
+# endif
+#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# define __lzo_cdecl cdecl
+#endif
+#if !defined(__lzo_cdecl)
+# define __lzo_cdecl
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if !defined(LZO_CFG_NO_WINDOWS_H)
+#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
+# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul)))
+# else
+# define LZO_HAVE_WINDOWS_H 1
+# endif
+#endif
+#endif
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# define LZO_OPT_UNALIGNED64 1
+#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB)
+#elif (LZO_ARCH_ARM)
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_CRIS)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_I386)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_IA64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_PREFER_POSTINC 1
+#elif (LZO_ARCH_M68K)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(__mc68020__) && !defined(__mcoldfire__)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_MIPS)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_POWERPC)
+# define LZO_OPT_PREFER_PREINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_S390)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# if (LZO_SIZEOF_SIZE_T == 8)
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_SH)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+#endif
+#if !defined(LZO_CFG_NO_INLINE_ASM)
+#if defined(LZO_CC_LLVM)
+# define LZO_CFG_NO_INLINE_ASM 1
+#endif
+#endif
+#if !defined(LZO_CFG_NO_UNALIGNED)
+#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_UNALIGNED 1
+#endif
+#endif
+#if defined(LZO_CFG_NO_UNALIGNED)
+# undef LZO_OPT_UNALIGNED16
+# undef LZO_OPT_UNALIGNED32
+# undef LZO_OPT_UNALIGNED64
+#endif
+#if defined(LZO_CFG_NO_INLINE_ASM)
+#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+# define LZO_ASM_SYNTAX_MSC 1
+#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#endif
+#if (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZO_ASM_CLOBBER "ax"
+#elif (LZO_CC_INTELC)
+# define __LZO_ASM_CLOBBER "memory"
+#else
+# define __LZO_ASM_CLOBBER "cc", "memory"
+#endif
+#endif
+#if defined(__LZO_INFOSTR_MM)
+#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM))
+# define __LZO_INFOSTR_MM ""
+#elif defined(LZO_INFO_MM)
+# define __LZO_INFOSTR_MM "." LZO_INFO_MM
+#else
+# define __LZO_INFOSTR_MM ""
+#endif
+#if defined(__LZO_INFOSTR_PM)
+#elif defined(LZO_INFO_ABI_PM)
+# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM
+#else
+# define __LZO_INFOSTR_PM ""
+#endif
+#if defined(__LZO_INFOSTR_ENDIAN)
+#elif defined(LZO_INFO_ABI_ENDIAN)
+# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN
+#else
+# define __LZO_INFOSTR_ENDIAN ""
+#endif
+#if defined(__LZO_INFOSTR_OSNAME)
+#elif defined(LZO_INFO_OS_CONSOLE)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE
+#elif defined(LZO_INFO_OS_POSIX)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX
+#else
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS
+#endif
+#if defined(__LZO_INFOSTR_LIBC)
+#elif defined(LZO_INFO_LIBC)
+# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC
+#else
+# define __LZO_INFOSTR_LIBC ""
+#endif
+#if defined(__LZO_INFOSTR_CCVER)
+#elif defined(LZO_INFO_CCVER)
+# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER
+#else
+# define __LZO_INFOSTR_CCVER ""
+#endif
+#define LZO_INFO_STRING \
+ LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \
+ " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER
+
+#endif
+
+#endif
+
+#undef LZO_HAVE_CONFIG_H
+#include "minilzo.h"
+
+#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2030)
+# error "version mismatch in miniLZO source files"
+#endif
+
+#ifdef MINILZO_HAVE_CONFIG_H
+# define LZO_HAVE_CONFIG_H
+#endif
+
+#ifndef __LZO_CONF_H
+#define __LZO_CONF_H
+
+#if !defined(__LZO_IN_MINILZO)
+#if defined(LZO_CFG_FREESTANDING)
+# define LZO_LIBC_FREESTANDING 1
+# define LZO_OS_FREESTANDING 1
+# define ACC_LIBC_FREESTANDING 1
+# define ACC_OS_FREESTANDING 1
+#endif
+#if defined(LZO_CFG_NO_UNALIGNED)
+# define ACC_CFG_NO_UNALIGNED 1
+#endif
+#if defined(LZO_ARCH_GENERIC)
+# define ACC_ARCH_GENERIC 1
+#endif
+#if defined(LZO_ABI_NEUTRAL_ENDIAN)
+# define ACC_ABI_NEUTRAL_ENDIAN 1
+#endif
+#if defined(LZO_HAVE_CONFIG_H)
+# define ACC_CONFIG_NO_HEADER 1
+#endif
+#if defined(LZO_CFG_EXTRA_CONFIG_HEADER)
+# include LZO_CFG_EXTRA_CONFIG_HEADER
+#endif
+#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED)
+# error "include this file first"
+#endif
+#include "lzo/lzoconf.h"
+#endif
+
+#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED)
+# error "version mismatch"
+#endif
+
+#if (LZO_CC_BORLANDC && LZO_ARCH_I086)
+# pragma option -h
+#endif
+
+#if (LZO_CC_MSC && (_MSC_VER >= 1000))
+# pragma warning(disable: 4127 4701)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1300))
+# pragma warning(disable: 4820)
+# pragma warning(disable: 4514 4710 4711)
+#endif
+
+#if (LZO_CC_SUNPROC)
+# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED)
+# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP)
+#endif
+
+#if defined(__LZO_MMODEL_HUGE) && (!LZO_HAVE_MM_HUGE_PTR)
+# error "this should not happen - check defines for __huge"
+#endif
+
+#if defined(__LZO_IN_MINILZO) || defined(LZO_CFG_FREESTANDING)
+#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# define ACC_WANT_ACC_INCD_H 1
+# define ACC_WANT_ACC_INCE_H 1
+# define ACC_WANT_ACC_INCI_H 1
+#elif 1
+# include <string.h>
+#else
+# define ACC_WANT_ACC_INCD_H 1
+#endif
+
+#if (LZO_ARCH_I086)
+# define ACC_MM_AHSHIFT LZO_MM_AHSHIFT
+# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
+# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
+# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
+#endif
+
+#if !defined(lzo_uintptr_t)
+# if defined(__LZO_MMODEL_HUGE)
+# define lzo_uintptr_t unsigned long
+# elif 1 && defined(LZO_OS_OS400) && (LZO_SIZEOF_VOID_P == 16)
+# define __LZO_UINTPTR_T_IS_POINTER 1
+ typedef char* lzo_uintptr_t;
+# define lzo_uintptr_t lzo_uintptr_t
+# elif (LZO_SIZEOF_SIZE_T == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t size_t
+# elif (LZO_SIZEOF_LONG == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t unsigned long
+# elif (LZO_SIZEOF_INT == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t unsigned int
+# elif (LZO_SIZEOF_LONG_LONG == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t unsigned long long
+# else
+# define lzo_uintptr_t size_t
+# endif
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+
+#if 1 && !defined(LZO_CFG_FREESTANDING)
+#if 1 && !defined(HAVE_STRING_H)
+#define HAVE_STRING_H 1
+#endif
+#if 1 && !defined(HAVE_MEMCMP)
+#define HAVE_MEMCMP 1
+#endif
+#if 1 && !defined(HAVE_MEMCPY)
+#define HAVE_MEMCPY 1
+#endif
+#if 1 && !defined(HAVE_MEMMOVE)
+#define HAVE_MEMMOVE 1
+#endif
+#if 1 && !defined(HAVE_MEMSET)
+#define HAVE_MEMSET 1
+#endif
+#endif
+
+#if 1 && defined(HAVE_STRING_H)
+#include <string.h>
+#endif
+
+#if defined(LZO_CFG_FREESTANDING)
+# undef HAVE_MEMCMP
+# undef HAVE_MEMCPY
+# undef HAVE_MEMMOVE
+# undef HAVE_MEMSET
+#endif
+
+#if !defined(HAVE_MEMCMP)
+# undef memcmp
+# define memcmp(a,b,c) lzo_memcmp(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memcmp(a,b,c) memcmp(a,b,c)
+#endif
+#if !defined(HAVE_MEMCPY)
+# undef memcpy
+# define memcpy(a,b,c) lzo_memcpy(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memcpy(a,b,c) memcpy(a,b,c)
+#endif
+#if !defined(HAVE_MEMMOVE)
+# undef memmove
+# define memmove(a,b,c) lzo_memmove(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memmove(a,b,c) memmove(a,b,c)
+#endif
+#if !defined(HAVE_MEMSET)
+# undef memset
+# define memset(a,b,c) lzo_memset(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memset(a,b,c) memset(a,b,c)
+#endif
+
+#undef NDEBUG
+#if defined(LZO_CFG_FREESTANDING)
+# undef LZO_DEBUG
+# define NDEBUG 1
+# undef assert
+# define assert(e) ((void)0)
+#else
+# if !defined(LZO_DEBUG)
+# define NDEBUG 1
+# endif
+# include <assert.h>
+#endif
+
+#if 0 && defined(__BOUNDS_CHECKING_ON)
+# include <unchecked.h>
+#else
+# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt
+# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr)
+#endif
+
+#if !defined(__lzo_inline)
+# define __lzo_inline
+#endif
+#if !defined(__lzo_forceinline)
+# define __lzo_forceinline
+#endif
+#if !defined(__lzo_noinline)
+# define __lzo_noinline
+#endif
+
+#if 1
+# define LZO_BYTE(x) ((unsigned char) (x))
+#else
+# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff))
+#endif
+
+#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b))
+#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b))
+#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c))
+#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c))
+
+#define lzo_sizeof(type) ((lzo_uint) (sizeof(type)))
+
+#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array))))
+
+#define LZO_SIZE(bits) (1u << (bits))
+#define LZO_MASK(bits) (LZO_SIZE(bits) - 1)
+
+#define LZO_LSIZE(bits) (1ul << (bits))
+#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1)
+
+#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits))
+#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1)
+
+#if !defined(DMUL)
+#if 0
+
+# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b)))
+#else
+# define DMUL(a,b) ((lzo_xint) ((a) * (b)))
+#endif
+#endif
+
+#if 1 && !defined(LZO_CFG_NO_UNALIGNED)
+#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# if (LZO_SIZEOF_SHORT == 2)
+# define LZO_UNALIGNED_OK_2
+# endif
+# if (LZO_SIZEOF_INT == 4)
+# define LZO_UNALIGNED_OK_4
+# endif
+#endif
+#endif
+
+#if defined(LZO_UNALIGNED_OK_2)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(short) == 2)
+#endif
+#if defined(LZO_UNALIGNED_OK_4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
+#elif defined(LZO_ALIGNED_OK_4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
+#endif
+
+#define MEMCPY8_DS(dest,src,len) \
+ lzo_memcpy(dest,src,len); dest += len; src += len
+
+#define BZERO8_PTR(s,l,n) \
+ lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
+
+#define MEMCPY_DS(dest,src,len) \
+ do *dest++ = *src++; while (--len > 0)
+
+__LZO_EXTERN_C int __lzo_init_done;
+__LZO_EXTERN_C const char __lzo_copyright[];
+LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
+
+#ifndef __LZO_PTR_H
+#define __LZO_PTR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(lzo_uintptr_t)
+# if defined(__LZO_MMODEL_HUGE)
+# define lzo_uintptr_t unsigned long
+# else
+# define lzo_uintptr_t acc_uintptr_t
+# ifdef __ACC_INTPTR_T_IS_POINTER
+# define __LZO_UINTPTR_T_IS_POINTER 1
+# endif
+# endif
+#endif
+
+#if (LZO_ARCH_I086)
+#define PTR(a) ((lzo_bytep) (a))
+#define PTR_ALIGNED_4(a) ((ACC_PTR_FP_OFF(a) & 3) == 0)
+#define PTR_ALIGNED2_4(a,b) (((ACC_PTR_FP_OFF(a) | ACC_PTR_FP_OFF(b)) & 3) == 0)
+#elif (LZO_MM_PVP)
+#define PTR(a) ((lzo_bytep) (a))
+#define PTR_ALIGNED_8(a) ((((lzo_uintptr_t)(a)) >> 61) == 0)
+#define PTR_ALIGNED2_8(a,b) ((((lzo_uintptr_t)(a)|(lzo_uintptr_t)(b)) >> 61) == 0)
+#else
+#define PTR(a) ((lzo_uintptr_t) (a))
+#define PTR_LINEAR(a) PTR(a)
+#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0)
+#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0)
+#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0)
+#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0)
+#endif
+
+#define PTR_LT(a,b) (PTR(a) < PTR(b))
+#define PTR_GE(a,b) (PTR(a) >= PTR(b))
+#define PTR_DIFF(a,b) (PTR(a) - PTR(b))
+#define pd(a,b) ((lzo_uint) ((a)-(b)))
+
+LZO_EXTERN(lzo_uintptr_t)
+__lzo_ptr_linear(const lzo_voidp ptr);
+
+typedef union
+{
+ char a_char;
+ unsigned char a_uchar;
+ short a_short;
+ unsigned short a_ushort;
+ int a_int;
+ unsigned int a_uint;
+ long a_long;
+ unsigned long a_ulong;
+ lzo_int a_lzo_int;
+ lzo_uint a_lzo_uint;
+ lzo_int32 a_lzo_int32;
+ lzo_uint32 a_lzo_uint32;
+ ptrdiff_t a_ptrdiff_t;
+ lzo_uintptr_t a_lzo_uintptr_t;
+ lzo_voidp a_lzo_voidp;
+ void * a_void_p;
+ lzo_bytep a_lzo_bytep;
+ lzo_bytepp a_lzo_bytepp;
+ lzo_uintp a_lzo_uintp;
+ lzo_uint * a_lzo_uint_p;
+ lzo_uint32p a_lzo_uint32p;
+ lzo_uint32 * a_lzo_uint32_p;
+ unsigned char * a_uchar_p;
+ char * a_char_p;
+}
+lzo_full_align_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#define LZO_DETERMINISTIC
+
+#define LZO_DICT_USE_PTR
+#if 0 && (LZO_ARCH_I086)
+# undef LZO_DICT_USE_PTR
+#endif
+
+#if defined(LZO_DICT_USE_PTR)
+# define lzo_dict_t const lzo_bytep
+# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+#else
+# define lzo_dict_t lzo_uint
+# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+#endif
+
+#endif
+
+#if !defined(MINILZO_CFG_SKIP_LZO_PTR)
+
+LZO_PUBLIC(lzo_uintptr_t)
+__lzo_ptr_linear(const lzo_voidp ptr)
+{
+ lzo_uintptr_t p;
+
+#if (LZO_ARCH_I086)
+ p = (((lzo_uintptr_t)(ACC_PTR_FP_SEG(ptr))) << (16 - ACC_MM_AHSHIFT)) + (ACC_PTR_FP_OFF(ptr));
+#elif (LZO_MM_PVP)
+ p = (lzo_uintptr_t) (ptr);
+ p = (p << 3) | (p >> 61);
+#else
+ p = (lzo_uintptr_t) PTR_LINEAR(ptr);
+#endif
+
+ return p;
+}
+
+LZO_PUBLIC(unsigned)
+__lzo_align_gap(const lzo_voidp ptr, lzo_uint size)
+{
+#if defined(__LZO_UINTPTR_T_IS_POINTER)
+ size_t n = (size_t) ptr;
+ n = (((n + size - 1) / size) * size) - n;
+#else
+ lzo_uintptr_t p, n;
+ p = __lzo_ptr_linear(ptr);
+ n = (((p + size - 1) / size) * size) - p;
+#endif
+
+ assert(size > 0);
+ assert((long)n >= 0);
+ assert(n <= size);
+ return (unsigned)n;
+}
+
+#endif
+
+/* If you use the LZO library in a product, I would appreciate that you
+ * keep this copyright string in the executable of your product.
+ */
+
+const char __lzo_copyright[] =
+#if !defined(__LZO_IN_MINLZO)
+ LZO_VERSION_STRING;
+#else
+ "\r\n\n"
+ "LZO data compression library.\n"
+ "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer\n"
+ "<markus@oberhumer.com>\n"
+ "http://www.oberhumer.com $\n\n"
+ "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n"
+ "$Built: " __DATE__ " " __TIME__ " $\n"
+ "$Info: " LZO_INFO_STRING " $\n";
+#endif
+
+LZO_PUBLIC(const lzo_bytep)
+lzo_copyright(void)
+{
+#if (LZO_OS_DOS16 && LZO_CC_TURBOC)
+ return (lzo_voidp) __lzo_copyright;
+#else
+ return (const lzo_bytep) __lzo_copyright;
+#endif
+}
+
+LZO_PUBLIC(unsigned)
+lzo_version(void)
+{
+ return LZO_VERSION;
+}
+
+LZO_PUBLIC(const char *)
+lzo_version_string(void)
+{
+ return LZO_VERSION_STRING;
+}
+
+LZO_PUBLIC(const char *)
+lzo_version_date(void)
+{
+ return LZO_VERSION_DATE;
+}
+
+LZO_PUBLIC(const lzo_charp)
+_lzo_version_string(void)
+{
+ return LZO_VERSION_STRING;
+}
+
+LZO_PUBLIC(const lzo_charp)
+_lzo_version_date(void)
+{
+ return LZO_VERSION_DATE;
+}
+
+#define LZO_BASE 65521u
+#define LZO_NMAX 5552
+
+#define LZO_DO1(buf,i) s1 += buf[i]; s2 += s1
+#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1);
+#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2);
+#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4);
+#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8);
+
+LZO_PUBLIC(lzo_uint32)
+lzo_adler32(lzo_uint32 adler, const lzo_bytep buf, lzo_uint len)
+{
+ lzo_uint32 s1 = adler & 0xffff;
+ lzo_uint32 s2 = (adler >> 16) & 0xffff;
+ unsigned k;
+
+ if (buf == NULL)
+ return 1;
+
+ while (len > 0)
+ {
+ k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX;
+ len -= k;
+ if (k >= 16) do
+ {
+ LZO_DO16(buf,0);
+ buf += 16;
+ k -= 16;
+ } while (k >= 16);
+ if (k != 0) do
+ {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k > 0);
+ s1 %= LZO_BASE;
+ s2 %= LZO_BASE;
+ }
+ return (s2 << 16) | s1;
+}
+
+#undef LZO_DO1
+#undef LZO_DO2
+#undef LZO_DO4
+#undef LZO_DO8
+#undef LZO_DO16
+
+#if !defined(MINILZO_CFG_SKIP_LZO_STRING)
+#undef lzo_memcmp
+#undef lzo_memcpy
+#undef lzo_memmove
+#undef lzo_memset
+#if !defined(__LZO_MMODEL_HUGE)
+# undef LZO_HAVE_MM_HUGE_PTR
+#endif
+#define lzo_hsize_t lzo_uint
+#define lzo_hvoid_p lzo_voidp
+#define lzo_hbyte_p lzo_bytep
+#define LZOLIB_PUBLIC(r,f) LZO_PUBLIC(r) f
+#define lzo_hmemcmp lzo_memcmp
+#define lzo_hmemcpy lzo_memcpy
+#define lzo_hmemmove lzo_memmove
+#define lzo_hmemset lzo_memset
+#define __LZOLIB_HMEMCPY_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCMP)
+ const lzo_hbyte_p p1 = (const lzo_hbyte_p) s1;
+ const lzo_hbyte_p p2 = (const lzo_hbyte_p) s2;
+ if __lzo_likely(len > 0) do
+ {
+ int d = *p1 - *p2;
+ if (d != 0)
+ return d;
+ p1++; p2++;
+ } while __lzo_likely(--len > 0);
+ return 0;
+#else
+ return memcmp(s1, s2, len);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY)
+ lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
+ const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
+ if (!(len > 0) || p1 == p2)
+ return dest;
+ do
+ *p1++ = *p2++;
+ while __lzo_likely(--len > 0);
+ return dest;
+#else
+ return memcpy(dest, src, len);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE)
+ lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
+ const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
+ if (!(len > 0) || p1 == p2)
+ return dest;
+ if (p1 < p2)
+ {
+ do
+ *p1++ = *p2++;
+ while __lzo_likely(--len > 0);
+ }
+ else
+ {
+ p1 += len;
+ p2 += len;
+ do
+ *--p1 = *--p2;
+ while __lzo_likely(--len > 0);
+ }
+ return dest;
+#else
+ return memmove(dest, src, len);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int c, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMSET)
+ lzo_hbyte_p p = (lzo_hbyte_p) s;
+ if __lzo_likely(len > 0) do
+ *p++ = (unsigned char) c;
+ while __lzo_likely(--len > 0);
+ return s;
+#else
+ return memset(s, c, len);
+#endif
+}
+#undef LZOLIB_PUBLIC
+#endif
+
+#if !defined(__LZO_IN_MINILZO)
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+
+ ACCCHK_ASSERT_IS_SIGNED_T(lzo_int)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint)
+
+ ACCCHK_ASSERT_IS_SIGNED_T(lzo_int32)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32)
+ ACCCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
+ ACCCHK_ASSERT(sizeof(lzo_uint32) >= 4)
+
+#if !defined(__LZO_UINTPTR_T_IS_POINTER)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
+#endif
+ ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint)
+ ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32))
+ ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint))
+ ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint))
+
+#endif
+#undef ACCCHK_ASSERT
+
+LZO_PUBLIC(int)
+_lzo_config_check(void)
+{
+ lzo_bool r = 1;
+ union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u;
+ lzo_uintptr_t p;
+
+#if !defined(LZO_CFG_NO_CONFIG_CHECK)
+#if defined(LZO_ABI_BIG_ENDIAN)
+ u.l[0] = u.l[1] = 0; u.c[sizeof(lzo_xint) - 1] = 128;
+ r &= (u.l[0] == 128);
+#endif
+#if defined(LZO_ABI_LITTLE_ENDIAN)
+ u.l[0] = u.l[1] = 0; u.c[0] = 128;
+ r &= (u.l[0] == 128);
+#endif
+#if defined(LZO_UNALIGNED_OK_2)
+ p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0];
+ u.l[0] = u.l[1] = 0;
+ r &= ((* (const lzo_ushortp) (p+1)) == 0);
+#endif
+#if defined(LZO_UNALIGNED_OK_4)
+ p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0];
+ u.l[0] = u.l[1] = 0;
+ r &= ((* (const lzo_uint32p) (p+1)) == 0);
+#endif
+#endif
+
+ LZO_UNUSED(u); LZO_UNUSED(p);
+ return r == 1 ? LZO_E_OK : LZO_E_ERROR;
+}
+
+int __lzo_init_done = 0;
+
+LZO_PUBLIC(int)
+__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
+ int s6, int s7, int s8, int s9)
+{
+ int r;
+
+#if defined(__LZO_IN_MINILZO)
+#elif (LZO_CC_MSC && ((_MSC_VER) < 700))
+#else
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+#endif
+#undef ACCCHK_ASSERT
+
+ __lzo_init_done = 1;
+
+ if (v == 0)
+ return LZO_E_ERROR;
+
+ r = (s1 == -1 || s1 == (int) sizeof(short)) &&
+ (s2 == -1 || s2 == (int) sizeof(int)) &&
+ (s3 == -1 || s3 == (int) sizeof(long)) &&
+ (s4 == -1 || s4 == (int) sizeof(lzo_uint32)) &&
+ (s5 == -1 || s5 == (int) sizeof(lzo_uint)) &&
+ (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) &&
+ (s7 == -1 || s7 == (int) sizeof(char *)) &&
+ (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) &&
+ (s9 == -1 || s9 == (int) sizeof(lzo_callback_t));
+ if (!r)
+ return LZO_E_ERROR;
+
+ r = _lzo_config_check();
+ if (r != LZO_E_OK)
+ return r;
+
+ return r;
+}
+
+#if !defined(__LZO_IN_MINILZO)
+
+#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD)
+
+#if 0
+BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment,
+ WORD wHeapSize, LPSTR lpszCmdLine )
+#else
+int __far __pascal LibMain ( int a, short b, short c, long d )
+#endif
+{
+ LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d);
+ return 1;
+}
+
+#endif
+
+#endif
+
+#define do_compress _lzo1x_1_do_compress
+
+#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS)
+
+#define LZO_NEED_DICT_H
+#define D_BITS 14
+#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5)
+#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
+
+#ifndef __LZO_CONFIG1X_H
+#define __LZO_CONFIG1X_H
+
+#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
+# define LZO1X
+#endif
+
+#if !defined(__LZO_IN_MINILZO)
+#include "lzo/lzo1x.h"
+#endif
+
+#define LZO_EOF_CODE
+#undef LZO_DETERMINISTIC
+
+#define M1_MAX_OFFSET 0x0400
+#ifndef M2_MAX_OFFSET
+#define M2_MAX_OFFSET 0x0800
+#endif
+#define M3_MAX_OFFSET 0x4000
+#define M4_MAX_OFFSET 0xbfff
+
+#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET)
+
+#define M1_MIN_LEN 2
+#define M1_MAX_LEN 2
+#define M2_MIN_LEN 3
+#ifndef M2_MAX_LEN
+#define M2_MAX_LEN 8
+#endif
+#define M3_MIN_LEN 3
+#define M3_MAX_LEN 33
+#define M4_MIN_LEN 3
+#define M4_MAX_LEN 9
+
+#define M1_MARKER 0
+#define M2_MARKER 64
+#define M3_MARKER 32
+#define M4_MARKER 16
+
+#ifndef MIN_LOOKAHEAD
+#define MIN_LOOKAHEAD (M2_MAX_LEN + 1)
+#endif
+
+#if defined(LZO_NEED_DICT_H)
+
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B
+#endif
+#define DL_MIN_LEN M2_MIN_LEN
+
+#ifndef __LZO_DICT_H
+#define __LZO_DICT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(D_BITS) && defined(DBITS)
+# define D_BITS DBITS
+#endif
+#if !defined(D_BITS)
+# error "D_BITS is not defined"
+#endif
+#if (D_BITS < 16)
+# define D_SIZE LZO_SIZE(D_BITS)
+# define D_MASK LZO_MASK(D_BITS)
+#else
+# define D_SIZE LZO_USIZE(D_BITS)
+# define D_MASK LZO_UMASK(D_BITS)
+#endif
+#define D_HIGH ((D_MASK >> 1) + 1)
+
+#if !defined(DD_BITS)
+# define DD_BITS 0
+#endif
+#define DD_SIZE LZO_SIZE(DD_BITS)
+#define DD_MASK LZO_MASK(DD_BITS)
+
+#if !defined(DL_BITS)
+# define DL_BITS (D_BITS - DD_BITS)
+#endif
+#if (DL_BITS < 16)
+# define DL_SIZE LZO_SIZE(DL_BITS)
+# define DL_MASK LZO_MASK(DL_BITS)
+#else
+# define DL_SIZE LZO_USIZE(DL_BITS)
+# define DL_MASK LZO_UMASK(DL_BITS)
+#endif
+
+#if (D_BITS != DL_BITS + DD_BITS)
+# error "D_BITS does not match"
+#endif
+#if (D_BITS < 8 || D_BITS > 18)
+# error "invalid D_BITS"
+#endif
+#if (DL_BITS < 8 || DL_BITS > 20)
+# error "invalid DL_BITS"
+#endif
+#if (DD_BITS < 0 || DD_BITS > 6)
+# error "invalid DD_BITS"
+#endif
+
+#if !defined(DL_MIN_LEN)
+# define DL_MIN_LEN 3
+#endif
+#if !defined(DL_SHIFT)
+# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN)
+#endif
+
+#define LZO_HASH_GZIP 1
+#define LZO_HASH_GZIP_INCREMENTAL 2
+#define LZO_HASH_LZO_INCREMENTAL_A 3
+#define LZO_HASH_LZO_INCREMENTAL_B 4
+
+#if !defined(LZO_HASH)
+# error "choose a hashing strategy"
+#endif
+
+#undef DM
+#undef DX
+
+#if (DL_MIN_LEN == 3)
+# define _DV2_A(p,shift1,shift2) \
+ (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2])
+# define _DV2_B(p,shift1,shift2) \
+ (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0])
+# define _DV3_B(p,shift1,shift2,shift3) \
+ ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0])
+#elif (DL_MIN_LEN == 2)
+# define _DV2_A(p,shift1,shift2) \
+ (( (lzo_xint)(p[0]) << shift1) ^ p[1])
+# define _DV2_B(p,shift1,shift2) \
+ (( (lzo_xint)(p[1]) << shift1) ^ p[2])
+#else
+# error "invalid DL_MIN_LEN"
+#endif
+#define _DV_A(p,shift) _DV2_A(p,shift,shift)
+#define _DV_B(p,shift) _DV2_B(p,shift,shift)
+#define DA2(p,s1,s2) \
+ (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0])
+#define DS2(p,s1,s2) \
+ (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0])
+#define DX2(p,s1,s2) \
+ (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0])
+#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0])
+#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0])
+#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0])
+#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s)))
+#define DM(v) DMS(v,0)
+
+#if (LZO_HASH == LZO_HASH_GZIP)
+# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT))
+
+#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL)
+# define __LZO_HASH_INCREMENTAL
+# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT)
+# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2])
+# define _DINDEX(dv,p) (dv)
+# define DVAL_LOOKAHEAD DL_MIN_LEN
+
+#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A)
+# define __LZO_HASH_INCREMENTAL
+# define DVAL_FIRST(dv,p) dv = _DV_A((p),5)
+# define DVAL_NEXT(dv,p) \
+ dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2])
+# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5)
+# define DVAL_LOOKAHEAD DL_MIN_LEN
+
+#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B)
+# define __LZO_HASH_INCREMENTAL
+# define DVAL_FIRST(dv,p) dv = _DV_B((p),5)
+# define DVAL_NEXT(dv,p) \
+ dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5)))
+# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5)
+# define DVAL_LOOKAHEAD DL_MIN_LEN
+
+#else
+# error "choose a hashing strategy"
+#endif
+
+#ifndef DINDEX
+#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS)
+#endif
+#if !defined(DINDEX1) && defined(D_INDEX1)
+#define DINDEX1 D_INDEX1
+#endif
+#if !defined(DINDEX2) && defined(D_INDEX2)
+#define DINDEX2 D_INDEX2
+#endif
+
+#if !defined(__LZO_HASH_INCREMENTAL)
+# define DVAL_FIRST(dv,p) ((void) 0)
+# define DVAL_NEXT(dv,p) ((void) 0)
+# define DVAL_LOOKAHEAD 0
+#endif
+
+#if !defined(DVAL_ASSERT)
+#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG)
+static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
+{
+ lzo_xint df;
+ DVAL_FIRST(df,(p));
+ assert(DINDEX(dv,p) == DINDEX(df,p));
+}
+#else
+# define DVAL_ASSERT(dv,p) ((void) 0)
+#endif
+#endif
+
+#if defined(LZO_DICT_USE_PTR)
+# define DENTRY(p,in) (p)
+# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex]
+#else
+# define DENTRY(p,in) ((lzo_uint) ((p)-(in)))
+# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex]
+#endif
+
+#if (DD_BITS == 0)
+
+# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in)
+# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in)
+# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in)
+
+#else
+
+# define UPDATE_D(dict,drun,dv,p,in) \
+ dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
+# define UPDATE_I(dict,drun,index,p,in) \
+ dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
+# define UPDATE_P(ptr,drun,p,in) \
+ (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK
+
+#endif
+
+#if defined(LZO_DICT_USE_PTR)
+
+#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
+ (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset)
+
+#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
+ (BOUNDS_CHECKING_OFF_IN_EXPR(( \
+ m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \
+ PTR_LT(m_pos,in) || \
+ (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) <= 0 || \
+ m_off > max_offset )))
+
+#else
+
+#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
+ (m_off == 0 || \
+ ((m_off = pd(ip, in) - m_off) > max_offset) || \
+ (m_pos = (ip) - (m_off), 0) )
+
+#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
+ (pd(ip, in) <= m_off || \
+ ((m_off = pd(ip, in) - m_off) > max_offset) || \
+ (m_pos = (ip) - (m_off), 0) )
+
+#endif
+
+#if defined(LZO_DETERMINISTIC)
+# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET
+#else
+# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
+
+#endif
+
+#define DO_COMPRESS lzo1x_1_compress
+
+static __lzo_noinline lzo_uint
+do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ register const lzo_bytep ip;
+ lzo_bytep op;
+ const lzo_bytep const in_end = in + in_len;
+ const lzo_bytep const ip_end = in + in_len - M2_MAX_LEN - 5;
+ const lzo_bytep ii;
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+
+ op = out;
+ ip = in;
+ ii = ip;
+
+ ip += 4;
+ for (;;)
+ {
+ register const lzo_bytep m_pos;
+ lzo_uint m_off;
+ lzo_uint m_len;
+ lzo_uint dindex;
+
+ DINDEX1(dindex,ip);
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
+ goto literal;
+#if 1
+ if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
+ goto try_match;
+ DINDEX2(dindex,ip);
+#endif
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
+ goto literal;
+ if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
+ goto try_match;
+ goto literal;
+
+try_match:
+#if 1 && defined(LZO_UNALIGNED_OK_2)
+ if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
+#else
+ if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
+#endif
+ {
+ }
+ else
+ {
+ if __lzo_likely(m_pos[2] == ip[2])
+ {
+#if 0
+ if (m_off <= M2_MAX_OFFSET)
+ goto match;
+ if (lit <= 3)
+ goto match;
+ if (lit == 3)
+ {
+ assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
+ *op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
+ goto code_match;
+ }
+ if (m_pos[3] == ip[3])
+#endif
+ goto match;
+ }
+ else
+ {
+#if 0
+#if 0
+ if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3)
+#else
+ if (m_off <= M1_MAX_OFFSET && lit == 3)
+#endif
+ {
+ register lzo_uint t;
+
+ t = lit;
+ assert(op - 2 > out); op[-2] |= LZO_BYTE(t);
+ do *op++ = *ii++; while (--t > 0);
+ assert(ii == ip);
+ m_off -= 1;
+ *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
+ ip += 2;
+ goto match_done;
+ }
+#endif
+ }
+ }
+
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ ++ip;
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ continue;
+
+match:
+ UPDATE_I(dict,0,dindex,ip,in);
+ if (pd(ip,ii) > 0)
+ {
+ register lzo_uint t = pd(ip,ii);
+
+ if (t <= 3)
+ {
+ assert(op - 2 > out);
+ op[-2] |= LZO_BYTE(t);
+ }
+ else if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ register lzo_uint tt = t - 18;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ *op++ = 0;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ do *op++ = *ii++; while (--t > 0);
+ }
+
+ assert(ii == ip);
+ ip += 3;
+ if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ ||
+ m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++
+#ifdef LZO1Y
+ || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++
+ || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++
+#endif
+ )
+ {
+ --ip;
+ m_len = pd(ip, ii);
+ assert(m_len >= 3); assert(m_len <= M2_MAX_LEN);
+
+ if (m_off <= M2_MAX_OFFSET)
+ {
+ m_off -= 1;
+#if defined(LZO1X)
+ *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
+#elif defined(LZO1Y)
+ *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
+#endif
+ }
+ else if (m_off <= M3_MAX_OFFSET)
+ {
+ m_off -= 1;
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ goto m3_m4_offset;
+ }
+ else
+#if defined(LZO1X)
+ {
+ m_off -= 0x4000;
+ assert(m_off > 0); assert(m_off <= 0x7fff);
+ *op++ = LZO_BYTE(M4_MARKER |
+ ((m_off & 0x4000) >> 11) | (m_len - 2));
+ goto m3_m4_offset;
+ }
+#elif defined(LZO1Y)
+ goto m4_match;
+#endif
+ }
+ else
+ {
+ {
+ const lzo_bytep end = in_end;
+ const lzo_bytep m = m_pos + M2_MAX_LEN + 1;
+ while (ip < end && *m == *ip)
+ m++, ip++;
+ m_len = pd(ip, ii);
+ }
+ assert(m_len > M2_MAX_LEN);
+
+ if (m_off <= M3_MAX_OFFSET)
+ {
+ m_off -= 1;
+ if (m_len <= 33)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ else
+ {
+ m_len -= 33;
+ *op++ = M3_MARKER | 0;
+ goto m3_m4_len;
+ }
+ }
+ else
+ {
+#if defined(LZO1Y)
+m4_match:
+#endif
+ m_off -= 0x4000;
+ assert(m_off > 0); assert(m_off <= 0x7fff);
+ if (m_len <= M4_MAX_LEN)
+ *op++ = LZO_BYTE(M4_MARKER |
+ ((m_off & 0x4000) >> 11) | (m_len - 2));
+ else
+ {
+ m_len -= M4_MAX_LEN;
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11));
+m3_m4_len:
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+ }
+
+m3_m4_offset:
+ *op++ = LZO_BYTE((m_off & 63) << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+
+#if 0
+match_done:
+#endif
+ ii = ip;
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ }
+
+ *out_len = pd(op, out);
+ return pd(in_end,ii);
+}
+
+LZO_PUBLIC(int)
+DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op = out;
+ lzo_uint t;
+
+ if __lzo_unlikely(in_len <= M2_MAX_LEN + 5)
+ t = in_len;
+ else
+ {
+ t = do_compress(in,in_len,op,out_len,wrkmem);
+ op += *out_len;
+ }
+
+ if (t > 0)
+ {
+ const lzo_bytep ii = in + in_len - t;
+
+ if (op == out && t <= 238)
+ *op++ = LZO_BYTE(17 + t);
+ else if (t <= 3)
+ op[-2] |= LZO_BYTE(t);
+ else if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ lzo_uint tt = t - 18;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ *op++ = 0;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ do *op++ = *ii++; while (--t > 0);
+ }
+
+ *op++ = M4_MARKER | 1;
+ *op++ = 0;
+ *op++ = 0;
+
+ *out_len = pd(op, out);
+ return LZO_E_OK;
+}
+
+#endif
+
+#undef do_compress
+#undef DO_COMPRESS
+#undef LZO_HASH
+
+#undef LZO_TEST_OVERRUN
+#undef DO_DECOMPRESS
+#define DO_DECOMPRESS lzo1x_decompress
+
+#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS)
+
+#if defined(LZO_TEST_OVERRUN)
+# if !defined(LZO_TEST_OVERRUN_INPUT)
+# define LZO_TEST_OVERRUN_INPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_OUTPUT)
+# define LZO_TEST_OVERRUN_OUTPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define LZO_TEST_OVERRUN_LOOKBEHIND
+# endif
+#endif
+
+#undef TEST_IP
+#undef TEST_OP
+#undef TEST_LB
+#undef TEST_LBO
+#undef NEED_IP
+#undef NEED_OP
+#undef HAVE_TEST_IP
+#undef HAVE_TEST_OP
+#undef HAVE_NEED_IP
+#undef HAVE_NEED_OP
+#undef HAVE_ANY_IP
+#undef HAVE_ANY_OP
+
+#if defined(LZO_TEST_OVERRUN_INPUT)
+# if (LZO_TEST_OVERRUN_INPUT >= 1)
+# define TEST_IP (ip < ip_end)
+# endif
+# if (LZO_TEST_OVERRUN_INPUT >= 2)
+# define NEED_IP(x) \
+ if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_OUTPUT)
+# if (LZO_TEST_OVERRUN_OUTPUT >= 1)
+# define TEST_OP (op <= op_end)
+# endif
+# if (LZO_TEST_OVERRUN_OUTPUT >= 2)
+# undef TEST_OP
+# define NEED_OP(x) \
+ if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun
+#else
+# define TEST_LB(m_pos) ((void) 0)
+# define TEST_LBO(m_pos,o) ((void) 0)
+#endif
+
+#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
+# define TEST_IP (ip < ip_end)
+#endif
+
+#if defined(TEST_IP)
+# define HAVE_TEST_IP
+#else
+# define TEST_IP 1
+#endif
+#if defined(TEST_OP)
+# define HAVE_TEST_OP
+#else
+# define TEST_OP 1
+#endif
+
+#if defined(NEED_IP)
+# define HAVE_NEED_IP
+#else
+# define NEED_IP(x) ((void) 0)
+#endif
+#if defined(NEED_OP)
+# define HAVE_NEED_OP
+#else
+# define NEED_OP(x) ((void) 0)
+#endif
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
+# define HAVE_ANY_IP
+#endif
+#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
+# define HAVE_ANY_OP
+#endif
+
+#undef __COPY4
+#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
+
+#undef COPY4
+#if defined(LZO_UNALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4(dst,src)
+#elif defined(LZO_ALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src))
+#endif
+
+#if defined(DO_DECOMPRESS)
+LZO_PUBLIC(int)
+DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+#endif
+{
+ register lzo_bytep op;
+ register const lzo_bytep ip;
+ register lzo_uint t;
+#if defined(COPY_DICT)
+ lzo_uint m_off;
+ const lzo_bytep dict_end;
+#else
+ register const lzo_bytep m_pos;
+#endif
+
+ const lzo_bytep const ip_end = in + in_len;
+#if defined(HAVE_ANY_OP)
+ lzo_bytep const op_end = out + *out_len;
+#endif
+#if defined(LZO1Z)
+ lzo_uint last_m_off = 0;
+#endif
+
+ LZO_UNUSED(wrkmem);
+
+#if defined(COPY_DICT)
+ if (dict)
+ {
+ if (dict_len > M4_MAX_OFFSET)
+ {
+ dict += dict_len - M4_MAX_OFFSET;
+ dict_len = M4_MAX_OFFSET;
+ }
+ dict_end = dict + dict_len;
+ }
+ else
+ {
+ dict_len = 0;
+ dict_end = NULL;
+ }
+#endif
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ while (TEST_IP && TEST_OP)
+ {
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (PTR_ALIGNED2_4(op,ip))
+ {
+#endif
+ COPY4(op,ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ COPY4(op,ip);
+ op += 4; ip += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *ip++; while (--t > 0);
+ }
+ else
+ do *op++ = *ip++; while (--t > 0);
+ }
+#if !defined(LZO_UNALIGNED_OK_4)
+ }
+ else
+#endif
+#endif
+#if !defined(LZO_UNALIGNED_OK_4)
+ {
+ *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
+ do *op++ = *ip++; while (--t > 0);
+ }
+#endif
+
+first_literal_run:
+
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(3);
+ t = 3; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - (1 + M2_MAX_OFFSET);
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(3);
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+
+ do {
+match:
+ if (t >= 64)
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1X)
+ m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ m_off = t & 0x1f;
+ if (m_off >= 0x1c)
+ m_off = last_m_off;
+ else
+ {
+ m_off = 1 + (m_off << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+ }
+ t = (t >> 5) - 1;
+#endif
+#else
+#if defined(LZO1X)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 3;
+ m_pos -= *ip++ << 2;
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ {
+ lzo_uint off = t & 0x1f;
+ m_pos = op;
+ if (off >= 0x1c)
+ {
+ assert(last_m_off > 0);
+ m_pos -= last_m_off;
+ }
+ else
+ {
+ off = 1 + (off << 6) + (*ip++ >> 2);
+ m_pos -= off;
+ last_m_off = off;
+ }
+ }
+ t = (t >> 5) - 1;
+#endif
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+ goto copy_match;
+#endif
+ }
+ else if (t >= 32)
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#else
+#if defined(LZO1Z)
+ {
+ lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ m_pos = op - off;
+ last_m_off = off;
+ }
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos = op - 1;
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos = op - 1;
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#endif
+ ip += 2;
+ }
+ else if (t >= 16)
+ {
+#if defined(COPY_DICT)
+ m_off = (t & 8) << 11;
+#else
+ m_pos = op;
+ m_pos -= (t & 8) << 11;
+#endif
+ t &= 7;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off += (ip[0] << 6) + (ip[1] >> 2);
+#else
+ m_off += (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_off == 0)
+ goto eof_found;
+ m_off += 0x4000;
+#if defined(LZO1Z)
+ last_m_off = m_off;
+#endif
+#else
+#if defined(LZO1Z)
+ m_pos -= (ip[0] << 6) + (ip[1] >> 2);
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_pos == op)
+ goto eof_found;
+ m_pos -= 0x4000;
+#if defined(LZO1Z)
+ last_m_off = pd((const lzo_bytep)op, m_pos);
+#endif
+#endif
+ }
+ else
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(2);
+ t = 2; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = 1 + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - 1;
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(2);
+ *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+ }
+
+#if defined(COPY_DICT)
+
+ NEED_OP(t+3-1);
+ t += 3-1; COPY_DICT(t,m_off)
+
+#else
+
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
+ {
+ assert((op - m_pos) >= 4);
+#else
+ if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
+ {
+#endif
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *m_pos++; while (--t > 0);
+ }
+ else
+#endif
+ {
+copy_match:
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ do *op++ = *m_pos++; while (--t > 0);
+ }
+
+#endif
+
+match_done:
+#if defined(LZO1Z)
+ t = ip[-1] & 3;
+#else
+ t = ip[-2] & 3;
+#endif
+ if (t == 0)
+ break;
+
+match_next:
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+#if 0
+ do *op++ = *ip++; while (--t > 0);
+#else
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+#endif
+ t = *ip++;
+ } while (TEST_IP && TEST_OP);
+ }
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
+#endif
+
+eof_found:
+ assert(t == 1);
+ *out_len = pd(op, out);
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+
+#if defined(HAVE_NEED_IP)
+input_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_INPUT_OVERRUN;
+#endif
+
+#if defined(HAVE_NEED_OP)
+output_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_OUTPUT_OVERRUN;
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+lookbehind_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_LOOKBEHIND_OVERRUN;
+#endif
+}
+
+#endif
+
+#define LZO_TEST_OVERRUN
+#undef DO_DECOMPRESS
+#define DO_DECOMPRESS lzo1x_decompress_safe
+
+#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS_SAFE)
+
+#if defined(LZO_TEST_OVERRUN)
+# if !defined(LZO_TEST_OVERRUN_INPUT)
+# define LZO_TEST_OVERRUN_INPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_OUTPUT)
+# define LZO_TEST_OVERRUN_OUTPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define LZO_TEST_OVERRUN_LOOKBEHIND
+# endif
+#endif
+
+#undef TEST_IP
+#undef TEST_OP
+#undef TEST_LB
+#undef TEST_LBO
+#undef NEED_IP
+#undef NEED_OP
+#undef HAVE_TEST_IP
+#undef HAVE_TEST_OP
+#undef HAVE_NEED_IP
+#undef HAVE_NEED_OP
+#undef HAVE_ANY_IP
+#undef HAVE_ANY_OP
+
+#if defined(LZO_TEST_OVERRUN_INPUT)
+# if (LZO_TEST_OVERRUN_INPUT >= 1)
+# define TEST_IP (ip < ip_end)
+# endif
+# if (LZO_TEST_OVERRUN_INPUT >= 2)
+# define NEED_IP(x) \
+ if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_OUTPUT)
+# if (LZO_TEST_OVERRUN_OUTPUT >= 1)
+# define TEST_OP (op <= op_end)
+# endif
+# if (LZO_TEST_OVERRUN_OUTPUT >= 2)
+# undef TEST_OP
+# define NEED_OP(x) \
+ if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun
+#else
+# define TEST_LB(m_pos) ((void) 0)
+# define TEST_LBO(m_pos,o) ((void) 0)
+#endif
+
+#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
+# define TEST_IP (ip < ip_end)
+#endif
+
+#if defined(TEST_IP)
+# define HAVE_TEST_IP
+#else
+# define TEST_IP 1
+#endif
+#if defined(TEST_OP)
+# define HAVE_TEST_OP
+#else
+# define TEST_OP 1
+#endif
+
+#if defined(NEED_IP)
+# define HAVE_NEED_IP
+#else
+# define NEED_IP(x) ((void) 0)
+#endif
+#if defined(NEED_OP)
+# define HAVE_NEED_OP
+#else
+# define NEED_OP(x) ((void) 0)
+#endif
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
+# define HAVE_ANY_IP
+#endif
+#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
+# define HAVE_ANY_OP
+#endif
+
+#undef __COPY4
+#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
+
+#undef COPY4
+#if defined(LZO_UNALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4(dst,src)
+#elif defined(LZO_ALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src))
+#endif
+
+#if defined(DO_DECOMPRESS)
+LZO_PUBLIC(int)
+DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+#endif
+{
+ register lzo_bytep op;
+ register const lzo_bytep ip;
+ register lzo_uint t;
+#if defined(COPY_DICT)
+ lzo_uint m_off;
+ const lzo_bytep dict_end;
+#else
+ register const lzo_bytep m_pos;
+#endif
+
+ const lzo_bytep const ip_end = in + in_len;
+#if defined(HAVE_ANY_OP)
+ lzo_bytep const op_end = out + *out_len;
+#endif
+#if defined(LZO1Z)
+ lzo_uint last_m_off = 0;
+#endif
+
+ LZO_UNUSED(wrkmem);
+
+#if defined(COPY_DICT)
+ if (dict)
+ {
+ if (dict_len > M4_MAX_OFFSET)
+ {
+ dict += dict_len - M4_MAX_OFFSET;
+ dict_len = M4_MAX_OFFSET;
+ }
+ dict_end = dict + dict_len;
+ }
+ else
+ {
+ dict_len = 0;
+ dict_end = NULL;
+ }
+#endif
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ while (TEST_IP && TEST_OP)
+ {
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (PTR_ALIGNED2_4(op,ip))
+ {
+#endif
+ COPY4(op,ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ COPY4(op,ip);
+ op += 4; ip += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *ip++; while (--t > 0);
+ }
+ else
+ do *op++ = *ip++; while (--t > 0);
+ }
+#if !defined(LZO_UNALIGNED_OK_4)
+ }
+ else
+#endif
+#endif
+#if !defined(LZO_UNALIGNED_OK_4)
+ {
+ *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
+ do *op++ = *ip++; while (--t > 0);
+ }
+#endif
+
+first_literal_run:
+
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(3);
+ t = 3; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - (1 + M2_MAX_OFFSET);
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(3);
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+
+ do {
+match:
+ if (t >= 64)
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1X)
+ m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ m_off = t & 0x1f;
+ if (m_off >= 0x1c)
+ m_off = last_m_off;
+ else
+ {
+ m_off = 1 + (m_off << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+ }
+ t = (t >> 5) - 1;
+#endif
+#else
+#if defined(LZO1X)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 3;
+ m_pos -= *ip++ << 2;
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ {
+ lzo_uint off = t & 0x1f;
+ m_pos = op;
+ if (off >= 0x1c)
+ {
+ assert(last_m_off > 0);
+ m_pos -= last_m_off;
+ }
+ else
+ {
+ off = 1 + (off << 6) + (*ip++ >> 2);
+ m_pos -= off;
+ last_m_off = off;
+ }
+ }
+ t = (t >> 5) - 1;
+#endif
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+ goto copy_match;
+#endif
+ }
+ else if (t >= 32)
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#else
+#if defined(LZO1Z)
+ {
+ lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ m_pos = op - off;
+ last_m_off = off;
+ }
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos = op - 1;
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos = op - 1;
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#endif
+ ip += 2;
+ }
+ else if (t >= 16)
+ {
+#if defined(COPY_DICT)
+ m_off = (t & 8) << 11;
+#else
+ m_pos = op;
+ m_pos -= (t & 8) << 11;
+#endif
+ t &= 7;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off += (ip[0] << 6) + (ip[1] >> 2);
+#else
+ m_off += (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_off == 0)
+ goto eof_found;
+ m_off += 0x4000;
+#if defined(LZO1Z)
+ last_m_off = m_off;
+#endif
+#else
+#if defined(LZO1Z)
+ m_pos -= (ip[0] << 6) + (ip[1] >> 2);
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_pos == op)
+ goto eof_found;
+ m_pos -= 0x4000;
+#if defined(LZO1Z)
+ last_m_off = pd((const lzo_bytep)op, m_pos);
+#endif
+#endif
+ }
+ else
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(2);
+ t = 2; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = 1 + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - 1;
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(2);
+ *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+ }
+
+#if defined(COPY_DICT)
+
+ NEED_OP(t+3-1);
+ t += 3-1; COPY_DICT(t,m_off)
+
+#else
+
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
+ {
+ assert((op - m_pos) >= 4);
+#else
+ if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
+ {
+#endif
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *m_pos++; while (--t > 0);
+ }
+ else
+#endif
+ {
+copy_match:
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ do *op++ = *m_pos++; while (--t > 0);
+ }
+
+#endif
+
+match_done:
+#if defined(LZO1Z)
+ t = ip[-1] & 3;
+#else
+ t = ip[-2] & 3;
+#endif
+ if (t == 0)
+ break;
+
+match_next:
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+#if 0
+ do *op++ = *ip++; while (--t > 0);
+#else
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+#endif
+ t = *ip++;
+ } while (TEST_IP && TEST_OP);
+ }
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
+#endif
+
+eof_found:
+ assert(t == 1);
+ *out_len = pd(op, out);
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+
+#if defined(HAVE_NEED_IP)
+input_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_INPUT_OVERRUN;
+#endif
+
+#if defined(HAVE_NEED_OP)
+output_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_OUTPUT_OVERRUN;
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+lookbehind_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_LOOKBEHIND_OVERRUN;
+#endif
+}
+
+#endif
+
+/***** End of minilzo.c *****/
+
diff --git a/extern/lzo/minilzo/minilzo.h b/extern/lzo/minilzo/minilzo.h
new file mode 100644
index 00000000000..93916bc89b2
--- /dev/null
+++ b/extern/lzo/minilzo/minilzo.h
@@ -0,0 +1,112 @@
+/* minilzo.h -- mini subset of the LZO real-time data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library 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.
+
+ The LZO library 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 the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+/*
+ * NOTE:
+ * the full LZO package can be found at
+ * http://www.oberhumer.com/opensource/lzo/
+ */
+
+
+#ifndef __MINILZO_H
+#define __MINILZO_H
+
+#define MINILZO_VERSION 0x2030
+
+#ifdef __LZOCONF_H
+# error "you cannot use both LZO and miniLZO"
+#endif
+
+#undef LZO_HAVE_CONFIG_H
+#include "lzoconf.h"
+
+#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
+# error "version mismatch in header files"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* Memory required for the wrkmem parameter.
+ * When the required size is 0, you can also pass a NULL pointer.
+ */
+
+#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
+#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1X_MEM_DECOMPRESS (0)
+
+
+/* compression */
+LZO_EXTERN(int)
+lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+/* decompression */
+LZO_EXTERN(int)
+lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+/* safe decompression with overrun testing */
+LZO_EXTERN(int)
+lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+#define LZO_OUT_LEN(size) ((size) + (size) / 16 + 64 + 3)
+
+#define LZO_HEAP_ALLOC(var,size) \
+ lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt
index 697d0b6b575..f33ce6a893c 100644
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-ADD_SUBDIRECTORY(SoundSystem)
+ADD_SUBDIRECTORY(audaspace)
ADD_SUBDIRECTORY(string)
ADD_SUBDIRECTORY(ghost)
ADD_SUBDIRECTORY(guardedalloc)
@@ -35,6 +35,7 @@ ADD_SUBDIRECTORY(decimation)
ADD_SUBDIRECTORY(iksolver)
ADD_SUBDIRECTORY(boolop)
ADD_SUBDIRECTORY(opennl)
+ADD_SUBDIRECTORY(smoke)
IF(WITH_ELBEEM)
ADD_SUBDIRECTORY(elbeem)
diff --git a/intern/Makefile b/intern/Makefile
index 995dc56c7d3..4bf18f987a4 100644
--- a/intern/Makefile
+++ b/intern/Makefile
@@ -32,7 +32,7 @@ SOURCEDIR = intern
# include nan_subdirs.mk
ALLDIRS = string ghost guardedalloc moto container memutil
-ALLDIRS += decimation iksolver bsp SoundSystem opennl elbeem boolop
+ALLDIRS += decimation iksolver bsp opennl elbeem boolop smoke audaspace
all::
@for i in $(ALLDIRS); do \
diff --git a/intern/SConscript b/intern/SConscript
index bb8525d5ce5..af5d0671c27 100644
--- a/intern/SConscript
+++ b/intern/SConscript
@@ -1,7 +1,7 @@
#!/usr/bin/python
Import ('env')
-SConscript(['SoundSystem/SConscript',
+SConscript(['audaspace/SConscript',
'string/SConscript',
'ghost/SConscript',
'guardedalloc/SConscript',
@@ -11,7 +11,8 @@ SConscript(['SoundSystem/SConscript',
'decimation/SConscript',
'iksolver/SConscript',
'boolop/SConscript',
- 'opennl/SConscript'])
+ 'opennl/SConscript',
+ 'smoke/SConscript'])
# NEW_CSG was intended for intern/csg, but
# getting it to compile is difficult
diff --git a/intern/SoundSystem/CMakeLists.txt b/intern/SoundSystem/CMakeLists.txt
deleted file mode 100644
index 9a370af2268..00000000000
--- a/intern/SoundSystem/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# $Id$
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-SET(INC . intern ../moto/include ../string dummy openal sdl)
-
-IF(WITH_OPENAL)
- FILE(GLOB SRC dummy/*.cpp intern/*.cpp openal/*.cpp sdl/*.cpp)
- INCLUDE_DIRECTORIES(${OPENAL_INC} ${SDL_INC})
- STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INC})
- IF(FRAMEWORK)
- ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX)
- ENDIF(FRAMEWORK)
-ELSE(WITH_OPENAL)
- FILE(GLOB SRC dummy/*.cpp intern/*.cpp)
- ADD_DEFINITIONS(-DNO_SOUND)
-ENDIF(WITH_OPENAL)
-
-BLENDERLIB(bf_soundsystem "${SRC}" "${INC}")
-#, libtype=['core','player'], priority = [20,140] )
diff --git a/intern/SoundSystem/SConscript b/intern/SoundSystem/SConscript
deleted file mode 100644
index 256b7904a0f..00000000000
--- a/intern/SoundSystem/SConscript
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-
-Import ('env')
-
-sources = env.Glob('dummy/*.cpp') + env.Glob('intern/*.cpp')
-
-incs = '. intern ../moto/include ../string dummy openal sdl'
-defs = ''
-if env['WITH_BF_OPENAL']:
- sources += env.Glob('openal/*.cpp') + env.Glob('sdl/*.cpp')
- incs += ' ' + env['BF_OPENAL_INC']
- incs += ' ' + env['BF_SDL_INC']
- defs = 'USE_OPENAL'
-else:
- defs = 'NO_SOUND'
-
-if not env['WITH_BF_SDL']:
- defs += ' DISABLE_SDL'
-
-env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['intern','player'], priority = [25,135] )
diff --git a/intern/SoundSystem/SND_C-api.h b/intern/SoundSystem/SND_C-api.h
deleted file mode 100644
index f8e439a9c26..00000000000
--- a/intern/SoundSystem/SND_C-api.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef SND_BLENDER_H
-#define SND_BLENDER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "SoundDefines.h"
-
-#define SND_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
-
-SND_DECLARE_HANDLE(SND_AudioDeviceInterfaceHandle);
-SND_DECLARE_HANDLE(SND_SceneHandle);
-SND_DECLARE_HANDLE(SND_ObjectHandle);
-SND_DECLARE_HANDLE(SND_ListenerHandle);
-
-/**
- * set the specified type
- */
-extern void SND_SetDeviceType(int device_type);
-
-/**
- * get an audiodevice
- */
-extern SND_AudioDeviceInterfaceHandle SND_GetAudioDevice(void);
-
-/**
- * and let go of it
- */
-extern void SND_ReleaseDevice(void);
-
-/**
- * check if playback is desired
- */
-extern int SND_IsPlaybackWanted(SND_SceneHandle scene);
-
-/**
- * add memlocation to cache
- */
-extern int SND_AddSample(SND_SceneHandle scene,
- const char* filename,
- void* memlocation,
- int size);
-
-/**
- * remove all samples
- */
-extern void SND_RemoveAllSamples(SND_SceneHandle scene);
-
-/**
- * forces the object to check its buffer, and fix it if it's wrong
- */
-extern int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object);
-
-/**
- * Creates a scene, initializes it and returns a handle to that scene.
- *
- * @param audiodevice: handle to the audiodevice.
- */
-extern SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice);
-
-/**
- * Stops all sounds, suspends the scene (so all resources will be freed) and deletes the scene.
- *
- * @param scene: handle to the soundscene.
- */
-extern void SND_DeleteScene(SND_SceneHandle scene);
-
-/**
- * Adds a soundobject to the scene, gets the buffer the sample is loaded into.
- *
- * @param scene: handle to the soundscene.
- * @param object: handle to soundobject.
- */
-extern void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object);
-
-/**
- * Removes a soundobject from the scene.
- *
- * @param scene: handle to the soundscene.
- * @param object: handle to soundobject.
- */
-extern void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object);
-
-/**
- * Removes all soundobjects from the scene.
- *
- * @param scene: handle to the soundscene.
- */
-extern void SND_RemoveAllSounds(SND_SceneHandle scene);
-
-/**
- * Stopss all soundobjects in the scene.
- *
- * @param scene: handle to the soundscene.
- */
-extern void SND_StopAllSounds(SND_SceneHandle scene);
-
-/**
- * Updates the listener, checks the status of all soundobjects, builds a list of all active
- * objects, updates the active objects.
- *
- * @param audiodevice: handle to the audiodevice.
- * @param scene: handle to the soundscene.
- */
-extern void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene);
-
-/**
- * Returns a handle to the listener.
- *
- * @param scene: handle to the soundscene.
- */
-extern SND_ListenerHandle SND_GetListener(SND_SceneHandle scene);
-
-/**
- * Sets the gain of the listener.
- *
- * @param scene: handle to the soundscene.
- * @param gain: factor the gain gets multiplied with.
- */
-extern void SND_SetListenerGain(SND_SceneHandle scene, double gain);
-
-/**
- * Sets a scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the
- * calculation.
- * @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
- * @attention f: frequency in sample (soundobject)
- * @attention f': effective Doppler shifted frequency
- *
- * @param object: handle to soundobject.
- * @param dopplerfactor: the dopplerfactor.
- */
-extern void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor);
-
-/**
- * Sets the value of the propagation speed relative to which the source velocities are interpreted.
- * @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$
- * @attention f: frequency in sample (soundobject)
- * @attention f': effective Doppler shifted frequency
- *
- * @param object: handle to soundobject.
- * @param dopplervelocity: the dopplervelocity.
- */
-extern void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity);
-
-/**
- * Creates a new soundobject and returns a handle to it.
- */
-extern SND_ObjectHandle SND_CreateSound(void);
-
-/**
- * Deletes a soundobject.
- *
- * @param object: handle to soundobject.
- */
-extern void SND_DeleteSound(SND_ObjectHandle object);
-
-/**
- * Sets a soundobject to SND_MUST_PLAY, so with the next proceed it will be updated and played.
- *
- * @param object: handle to soundobject.
- */
-extern void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object);
-
-/**
- * Sets a soundobject to SND_MUST_STOP, so with the next proceed it will be stopped.
- *
- * @param object: handle to soundobject.
- */
-extern void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object);
-
-/**
- * Sets a soundobject to SND_MUST_PAUSE, so with the next proceed it will be paused.
- *
- * @param object: handle to soundobject.
- */
-extern void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object);
-
-/**
- * Sets the name of the sample to reference the soundobject to it.
- *
- * @param object: handle to soundobject.
- * @param samplename: the name of the sample
- */
-extern void SND_SetSampleName(SND_ObjectHandle object, char* samplename);
-
-/**
- * Sets the gain of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param gain: factor the gain gets multiplied with.
- */
-extern void SND_SetGain(SND_ObjectHandle object, double gain);
-
-/**
- * Sets the minimum gain of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param minimumgain: lower threshold for the gain.
- */
-extern void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain);
-
-/**
- * Sets the maximum gain of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param maximumgain: upper threshold for the gain.
- */
-extern void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain);
-
-/**
- * Sets the rollofffactor. The rollofffactor is a per-Source parameter the application
- * can use to increase or decrease the range of a source by decreasing or increasing the
- * attenuation, respectively. The default value is 1. The implementation is free to optimize
- * for a rollofffactor value of 0, which indicates that the application does not wish any
- * distance attenuation on the respective Source.
- *
- * @param object: handle to soundobject.
- * @param rollofffactor: the rollofffactor.
- */
-extern void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor);
-
-/**
- * Sets the referencedistance at which the listener will experience gain.
- * @attention G_dB = gain - 20 * log10(1 + rollofffactor * (dist - referencedistance)/referencedistance);
- *
- * @param object: handle to soundobject.
- * @param distance: the reference distance.
- */
-extern void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance);
-
-/**
- * Sets the pitch of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param pitch: pitchingfactor: 2.0 for doubling the frequency, 0.5 for half the frequency.
- */
-extern void SND_SetPitch(SND_ObjectHandle object, double pitch);
-
-/**
- * Sets the position a soundobject.
- *
- * @param object: handle to soundobject.
- * @param position: position[3].
- */
-extern void SND_SetPosition(SND_ObjectHandle object, double* position);
-
-/**
- * Sets the velocity of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param velocity: velocity[3].
- */
-extern void SND_SetVelocity(SND_ObjectHandle object, double* velocity);
-
-/**
- * Sets the orientation of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param orientation: orientation[9].
- */
-extern void SND_SetOrientation(SND_ObjectHandle object, double* orientation);
-
-/**
- * Sets the loopmode of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param loopmode type of the loop (SND_LOOP_OFF, SND_LOOP_NORMAL, SND_LOOP_BIDIRECTIONAL);
- */
-extern void SND_SetLoopMode(SND_ObjectHandle object, int loopmode);
-
-/**
- * Sets the looppoints of a soundobject.
- *
- * @param object: handle to soundobject.
- * @param loopstart startpoint of the loop
- * @param loopend endpoint of the loop
- */
-extern void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend);
-
-/**
- * Gets the gain of a soundobject.
- *
- * @param object: handle to soundobject.
- */
-extern float SND_GetGain(SND_ObjectHandle object);
-
-/**
- * Gets the pitch of a soundobject.
- *
- * @param object: handle to soundobject.
- */
-extern float SND_GetPitch(SND_ObjectHandle object);
-
-/**
- * Gets the looping of a soundobject.
- * 0: SND_LOOP_OFF
- * 1: SND_LOOP_NORMAL
- * 2: SND_LOOP_BIDIRECTIONAL
- *
- * @param object: handle to soundobject.
- */
-extern int SND_GetLoopMode(SND_ObjectHandle object);
-
-/**
- * Gets the playstate of a soundobject.
- * SND_UNKNOWN = -1
- * SND_INITIAL
- * SND_MUST_PLAY
- * SND_PLAYING
- * SND_MUST_STOP
- * SND_STOPPED
- * SND_MUST_PAUSE
- * SND_PAUSED
- * SND_MUST_BE_DELETED
- *
- * @param object: handle to soundobject.
- */
-extern int SND_GetPlaystate(SND_ObjectHandle object);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/intern/SoundSystem/SND_CDObject.h b/intern/SoundSystem/SND_CDObject.h
deleted file mode 100644
index c79f62d9862..00000000000
--- a/intern/SoundSystem/SND_CDObject.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * SND_CDObject.h
- *
- * Implementation for CD playback
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __SND_CDOBJECT_H
-#define __SND_CDOBJECT_H
-
-#include "SND_Object.h"
-
-class SND_CDObject : public SND_Object
-{
-private:
-
- /**
- * Private to enforce singleton
- */
- SND_CDObject();
- SND_CDObject(const SND_CDObject&);
-
- static SND_CDObject* m_instance;
- MT_Scalar m_gain; /* the gain of the object */
- int m_playmode; /* the way CD is played back (all, random, track, trackloop) */
- int m_track; /* the track for 'track' and 'trackloop' */
- int m_playstate; /* flag for current state of object */
- bool m_modified;
- bool m_used; /* flag for checking if we used the cd, if not don't
- call the stop cd at the end */
-
-public:
- static bool CreateSystem();
- static bool DisposeSystem();
- static SND_CDObject* Instance();
-
- ~SND_CDObject();
-
- void SetGain(MT_Scalar gain);
- void SetPlaymode(int playmode);
- void SetTrack(int track);
- void SetPlaystate(int playstate);
- void SetModified(bool modified);
- void SetUsed();
- bool GetUsed();
-
- bool IsModified() const;
-
- int GetTrack() const;
- MT_Scalar GetGain() const;
- int GetPlaymode() const;
- int GetPlaystate() const;
-
-};
-
-#endif //__SND_CDOBJECT_H
-
diff --git a/intern/SoundSystem/SND_DeviceManager.h b/intern/SoundSystem/SND_DeviceManager.h
deleted file mode 100644
index 708db030519..00000000000
--- a/intern/SoundSystem/SND_DeviceManager.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * SND_DeviceManager.h
- *
- * singleton for creating, switching and deleting audiodevices
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __SND_DEVICEMANAGER_H
-#define __SND_DEVICEMANAGER_H
-
-#include "SND_IAudioDevice.h"
-
-class SND_DeviceManager
-{
-public :
-
- /**
- * a subscription is needed before instances are given away
- * applications must call subscribe first, get an instance, and
- * when they are finished with sound, unsubscribe
- */
- static void Subscribe();
- static void Unsubscribe();
-
- static SND_IAudioDevice* Instance();
- static void SetDeviceType(int device_type);
-
-private :
-
- /**
- * Private to enforce singleton
- */
- SND_DeviceManager();
- SND_DeviceManager(const SND_DeviceManager&);
- ~SND_DeviceManager();
-
- static SND_IAudioDevice* m_instance;
-
- /**
- * The type of device to be created on a call
- * to Instance().
- */
- static int m_device_type;
-
- /**
- * Remember the number of subscriptions.
- * if 0, delete the device
- */
- static int m_subscriptions;
-};
-
-#endif //__SND_DEVICEMANAGER_H
-
diff --git a/intern/SoundSystem/SND_IAudioDevice.h b/intern/SoundSystem/SND_IAudioDevice.h
deleted file mode 100644
index d6b3936e6ef..00000000000
--- a/intern/SoundSystem/SND_IAudioDevice.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef SND_IAUDIODEVICE
-#define SND_IAUDIODEVICE
-
-#include "SND_SoundObject.h"
-#include "SND_CDObject.h"
-#include "SND_WaveCache.h"
-#include "SND_WaveSlot.h"
-#include "MT_Matrix3x3.h"
-
-class SND_IAudioDevice
-{
-public:
-
- /**
- * constructor
- */
- SND_IAudioDevice() {};
-
- /**
- * destructor
- */
- virtual ~SND_IAudioDevice() {};
-
- /**
- * check to see if initialization was successfull
- *
- * @return indication of succes
- */
- virtual bool IsInitialized()=0;
-
- /**
- * get the wavecache (which does sample (un)loading)
- *
- * @return pointer to the wavecache
- */
- virtual SND_WaveCache* GetWaveCache() const =0;
-
- /**
- * loads a sample into the device
- *
- * @param samplename the name of the sample
- * @param memlocation pointer where the sample is stored
- * @param size size of the sample in memory
- *
- * @return pointer to the slot with sample data
- */
- virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
- void* memlocation,
- int size)=0;
-
- /**
- * remove a sample from the wavecache
- *
- * @param filename pointer to filename
- */
-// virtual void RemoveSample(const char* filename)=0;
-
- /**
- * remove all samples from the wavecache
- */
- virtual void RemoveAllSamples()=0;
-
- /**
- * get a new id from the device
- *
- * @param pObject pointer to soundobject
- *
- * @return indication of success
- */
- virtual bool GetNewId(SND_SoundObject* pObject)=0;
-
- /**
- * clear an id
- *
- * @param pObject pointer to soundobject
- */
- virtual void ClearId(SND_SoundObject* pObject)=0;
-
- /**
- * initialize the listener
- */
- virtual void InitListener()=0;
-
- /**
- * set the value of the propagation speed relative to which the
- * source velocities are interpreted.
- * f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Vl) / (DOPPLER_VELOCITY + Vo)
- * f: frequency in sample (soundobject)
- * f': effective Doppler shifted frequency
- * Vl: velocity listener
- * Vo: velocity soundobject
- *
- * @param dopplervelocity scaling factor for doppler effect
- */
- virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
-
- /**
- * set a scaling to exaggerate or deemphasize the Doppler (pitch)
- * shift resulting from the calculation.
- * f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Listener_velocity )/(DOPPLER_VELOCITY + object_velocity )
- *
- * @param dopplerfactor scaling factor for doppler effect
- */
- virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
-
- /**
- * set the roll-off factor
- *
- * @param rollofffactor a global volume scaling factor
- */
- virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
-
- /**
- * make the context the current one
- */
- virtual void MakeCurrent() const =0;
-
- /**
- * update the device
- */
- virtual void NextFrame() const =0;
-
- /**
- * set the volume of the listener.
- *
- * @param gain the mastergain
- */
- virtual void SetListenerGain(float gain) const =0;
-
- /**
- * connect the buffer with the source
- *
- * @param id the id of the object
- * @param buffer the buffer the sample is stored in
- */
- virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
-
- /**
- * pause playback of the cd
- * @param id the id of the object
- *
- * @return the state the object is in
- */
- virtual int GetPlayState(int id) =0;
-
- /**
- * play a sound belonging to an object.
- *
- * @param id the id of the object
- */
- virtual void PlayObject(int id) =0;
-
- /**
- * stop a sound belonging to an object.
- *
- * @param id the id of the object
- */
- virtual void StopObject(int id) const =0;
-
- /**
- * stop all sounds.
- */
- virtual void StopAllObjects()=0;
-
- /**
- * pause the sound belonging to an object.
- *
- * @param id the id of the object
- */
- virtual void PauseObject(int id) const =0;
-
- /**
- * set the sound to looping or non-looping.
- *
- * @param id the id of the object
- * @param loopmode type of looping (no loop, normal, bidirectional)
- */
- virtual void SetObjectLoop(int id, unsigned int loopmode) const =0;
-
- /**
- * set the looppoints of a sound
- *
- * @param id the id of the object
- * @param loopstart the startpoint of the loop (in samples)
- * @param loopend the endpoint of the loop (in samples)
- */
- virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
-
- /**
- * set the pitch of the sound.
- *
- * @param id the id of the object
- * @param pitch the pitch
- */
- virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
-
- /**
- * set the gain of the sound.
- *
- * @param id the id of the object
- * @param gain the gain
- */
- virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
-
- /**
- * ROLLOFF_FACTOR is per-Source parameter the application can use to increase or decrease
- * the range of a source by decreasing or increasing the attenuation, respectively. The
- * default value is 1. The implementation is free to optimize for a ROLLOFF_FACTOR value
- * of 0, which indicates that the application does not wish any distance attenuation on
- * the respective Source.
- *
- * @param id the id of the object
- * @param rolloff a per-source volume scaling factor
- */
- virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
-
- /**
- * min_gain indicates the minimal gain which is always guaranteed for this sound
- *
- * @param id the id of the object
- * @param mingain the minimum gain of the object
- */
- virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
-
- /**
- * max_gain indicates the maximal gain which is always guaranteed for this sound
- *
- * @param id the id of the object
- * @param maxgain the maximum gain of the object
- */
- virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
- /**
- * set the distance at which the Listener will experience gain.
- * G_dB = GAIN - 20*log10(1 + ROLLOFF_FACTOR*(dist-REFERENCE_DISTANCE)/REFERENCE_DISTANCE );
- *
- * @param id the id of the object
- * @param referencedistance the distance at which the listener will start hearing
- */
- virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
-
- /**
- * set the position, velocity and orientation of a sound.
- *
- * @param id the id of the object
- * @param position the position of the object
- * @param velocity the velocity of the object
- * @param orientation the orientation of the object
- * @param lisposition the position of the listener
- * @param rollofffactor the rollofffactor of the object
- */
- virtual void SetObjectTransform(int id,
- const MT_Vector3& position,
- const MT_Vector3& velocity,
- const MT_Matrix3x3& orientation,
- const MT_Vector3& lisposition,
- const MT_Scalar& rollofffactor) const =0;
-
- /**
- * make a sound 2D
- *
- * @param id the id of the object
- */
- virtual void ObjectIs2D(int id) const =0;
-
- /**
- * tell the device we want cd suppport
- */
- virtual void UseCD() const =0;
-
- /**
- * start playback of the cd
- *
- * @param track the tracknumber to start playback from
- */
- virtual void PlayCD(int track) const =0;
-
- /**
- * pause playback of the cd (true == pause, false == resume)
- */
- virtual void PauseCD(bool pause) const =0;
-
- /**
- * stop playback of the cd
- */
- virtual void StopCD() const =0;
-
- /**
- * set the playbackmode of the cd
- * SND_CD_ALL play all tracks
- * SND_CD_TRACK play one track
- * SND_CD_TRACKLOOP play one track looped
- * SND_CD_RANDOM play all tracks in random order
- *
- * @param playmode playmode
- */
- virtual void SetCDPlaymode(int playmode) const =0;
-
- /**
- * set the volume playback of the cd
- *
- * @param gain the gain
- */
- virtual void SetCDGain(MT_Scalar gain) const =0;
-
- virtual void StartUsingDSP() =0;
- virtual float* GetSpectrum() =0;
- virtual void StopUsingDSP() =0;
-
-protected:
-
- virtual void RevokeSoundObject(SND_SoundObject* pObject)=0;
-};
-
-#endif //SND_IAUDIODEVICE
-
diff --git a/intern/SoundSystem/SND_Scene.h b/intern/SoundSystem/SND_Scene.h
deleted file mode 100644
index bb3ff932bce..00000000000
--- a/intern/SoundSystem/SND_Scene.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * SND_Scene.h
- *
- * The scene for sounds.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WIN32
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-#ifndef __SND_SCENE_H
-#define __SND_SCENE_H
-
-#include "SoundDefines.h"
-#include "SND_SoundObject.h"
-#include "SND_CDObject.h"
-#include "SND_SoundListener.h"
-#include "SND_WaveSlot.h"
-
-#include "MT_Vector3.h"
-#include "MT_Matrix3x3.h"
-#include "STR_String.h"
-
-#include <set>
-
-
-class SND_Scene
-{
- std::set<class SND_SoundObject*> m_soundobjects;
-
- GEN_List m_activeobjects;
- class SND_IAudioDevice* m_audiodevice;
- class SND_WaveCache* m_wavecache;
- class SND_SoundListener m_listener;
- bool m_audio; // to check if audio works
- bool m_audioplayback; // to check if audioplayback is wanted
-
- void UpdateListener();
- void BuildActiveList(MT_Scalar curtime);
- void UpdateActiveObects();
- void UpdateCD();
-
-public:
- SND_Scene(SND_IAudioDevice* adi);
- ~SND_Scene();
-
- bool IsPlaybackWanted();
-
- void AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime);
- void RemoveActiveObject(SND_SoundObject* pObject);
- void DeleteObjectWhenFinished(SND_SoundObject* pObject);
-
- void Proceed();
-
- int LoadSample(const STR_String& samplename,
- void* memlocation,
- int size);
- void RemoveAllSamples();
- bool CheckBuffer(SND_SoundObject* pObject);
- bool IsSampleLoaded(STR_String& samplename);
-
- void AddObject(SND_SoundObject* pObject);
- bool SetCDObject(SND_CDObject* cdobject);
- void DeleteObject(SND_SoundObject* pObject);
- void RemoveAllObjects();
- void StopAllObjects();
- int GetObjectStatus(SND_SoundObject* pObject) const;
-
- void SetListenerTransform(const MT_Vector3& pos,
- const MT_Vector3& vel,
- const MT_Matrix3x3& mat);
-
- SND_SoundListener* GetListener();
-};
-
-#endif //__SND_SCENE_H
-
diff --git a/intern/SoundSystem/SND_SoundListener.h b/intern/SoundSystem/SND_SoundListener.h
deleted file mode 100644
index 2f6a6e8cddd..00000000000
--- a/intern/SoundSystem/SND_SoundListener.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * SND_SoundListener.h
- *
- * A SoundListener is for sound what a camera is for vision.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __SND_SOUNDLISTENER_H
-#define __SND_SOUNDLISTENER_H
-
-#include "SND_Object.h"
-
-class SND_SoundListener : public SND_Object
-{
-public:
- SND_SoundListener();
- virtual ~SND_SoundListener();
-
- void SetStateFlag(unsigned int stateflags);
- void SetGain(MT_Scalar gain);
- void SetPosition(const MT_Vector3& pos);
- void SetVelocity(const MT_Vector3& vel);
- void SetOrientation(const MT_Matrix3x3& ori);
- void SetDopplerFactor(MT_Scalar dopplerfactor);
- void SetDopplerVelocity(MT_Scalar dopplervelocity);
- void SetScale(MT_Scalar scale);
-
- void SetModified(bool modified);
- bool IsModified() const;
-
- unsigned int GetStateFlags() const;
- MT_Scalar GetGain() const;
- MT_Vector3 GetPosition() const;
- MT_Vector3 GetVelocity() const;
- MT_Matrix3x3 GetOrientation();
-
- MT_Scalar GetDopplerFactor() const;
- MT_Scalar GetDopplerVelocity() const;
- MT_Scalar GetScale() const;
-
-private:
- void* m_listener;
- bool m_modified;
-
- MT_Scalar m_gain; /* overall gain */
- MT_Vector3 m_position; /* position; left/right, up/down, in/out */
- MT_Vector3 m_velocity; /* velocity of the listener */
- MT_Matrix3x3 m_orientation; /* orientation of the listener */
-
- MT_Scalar m_dopplerfactor; /* scaling factor for the Doppler (pitch) shift */
- MT_Scalar m_dopplervelocity; /* factor for the reference velocity (for Dopplereffect) */
- MT_Scalar m_scale;
-};
-
-#endif //__SND_SOUNDLISTENER_H
-
diff --git a/intern/SoundSystem/SND_SoundObject.h b/intern/SoundSystem/SND_SoundObject.h
deleted file mode 100644
index 7bd43fb4e66..00000000000
--- a/intern/SoundSystem/SND_SoundObject.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * SND_SoundObject.h
- *
- * Implementation of the abstract sound object
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __SND_SOUNDOBJECT_H
-#define __SND_SOUNDOBJECT_H
-
-#include "SND_Object.h"
-#include "STR_String.h"
-
-/**
- * SND_SoundObject is a class for api independent sounddata storage conected to an actuator
- */
-
-class SND_SoundObject : public SND_Object
-{
-private:
- STR_String m_samplename; /* name of the sample */
- STR_String m_objectname; /* name of the object */
- unsigned int m_buffer;
-
- bool m_active; /* is the object active or not? */
- int m_id;
- MT_Scalar m_lifespan; /* the lifespan of the sound seconds */
- MT_Scalar m_timestamp;
-
- MT_Scalar m_length; /* length of the sample in seconds */
-
- MT_Scalar m_gain; /* the gain of the object */
- MT_Scalar m_rollofffactor; /* the scaling factor to increase or decrease the range
- of a source by decreasing or increasing the
- attenuation, respectively */
- MT_Scalar m_referencedistance;/* the distance at which the listener will experience
- gain */
- MT_Scalar m_mingain; /* indicates the minimal gain which is always guaranteed
- for this source */
- MT_Scalar m_maxgain; /* indicates the maximal gain which is always guaranteed
- for this source */
-
- MT_Scalar m_pitch; /* the pitch of the object */
- MT_Vector3 m_position; /* position; left/right, up/down, in/out */
- MT_Vector3 m_velocity; /* velocity of the object */
- MT_Matrix3x3 m_orientation; /* orientation of the object */
- unsigned int m_loopmode; /* loop normal or bidirectional? */
- unsigned int m_loopstart; /* start of looppoint in samples! */
- unsigned int m_loopend; /* end of looppoint in samples! */
- bool m_is3d; /* is the object 3D or 2D? */
- int m_playstate; /* flag for current state of object */
- bool m_modified;
- unsigned int m_running;
- bool m_highpriority; /* may the sound be ditched when we run out of voices? */
-
-public:
-
- SND_SoundObject();
- ~SND_SoundObject();
-
- void SetBuffer(unsigned int buffer);
- void SetActive(bool active);
-
- void StartSound();
- void StopSound();
- void PauseSound();
- void DeleteWhenFinished();
-
- void SetObjectName(STR_String objectname);
- void SetSampleName(STR_String samplename);
- void SetLength(MT_Scalar length);
-
- void SetPitch(MT_Scalar pitch);
- void SetGain(MT_Scalar gain);
- void SetMinGain(MT_Scalar mingain);
- void SetMaxGain(MT_Scalar maxgain);
- void SetRollOffFactor(MT_Scalar rollofffactor);
- void SetReferenceDistance(MT_Scalar distance);
- void SetPosition(const MT_Vector3& pos);
- void SetVelocity(const MT_Vector3& vel);
- void SetOrientation(const MT_Matrix3x3& orient);
- void SetLoopMode(unsigned int loopmode);
- void SetLoopStart(unsigned int loopstart);
- void SetLoopEnd(unsigned int loopend);
- void Set3D(bool threedee);
- void SetPlaystate(int playstate);
- void SetHighPriority(bool priority);
-
- void SetId(int id);
- void SetLifeSpan();
- void SetTimeStamp(MT_Scalar timestamp);
-
- void SetModified(bool modified);
-
- bool IsLifeSpanOver(MT_Scalar curtime) const;
- bool IsActive() const;
- bool IsModified() const;
- bool IsHighPriority() const;
-
- void InitRunning();
- bool IsRunning() const;
- void AddRunning();
-
- int GetId() const;
- MT_Scalar GetLifeSpan() const;
- MT_Scalar GetTimestamp() const;
-
- unsigned int GetBuffer();
- const STR_String& GetSampleName();
- const STR_String& GetObjectName();
-
- MT_Scalar GetLength() const;
- MT_Scalar GetGain() const;
- MT_Scalar GetPitch() const;
-
- MT_Scalar GetMinGain() const;
- MT_Scalar GetMaxGain() const;
- MT_Scalar GetRollOffFactor() const;
- MT_Scalar GetReferenceDistance() const;
-
- MT_Vector3 GetPosition() const;
- MT_Vector3 GetVelocity() const;
- MT_Matrix3x3 GetOrientation() const;
- unsigned int GetLoopMode() const;
- unsigned int GetLoopStart() const;
- unsigned int GetLoopEnd() const;
- bool Is3D() const;
- int GetPlaystate() const;
-
-};
-
-#endif //__SND_SOUNDOBJECT_H
-
diff --git a/intern/SoundSystem/SND_Utils.h b/intern/SoundSystem/SND_Utils.h
deleted file mode 100644
index 82b7c69a595..00000000000
--- a/intern/SoundSystem/SND_Utils.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef SND_UTILS_H
-#define SND_UTILS_H
-
-#include "SND_WaveSlot.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-typedef struct
-{
- unsigned char riff[4];
- signed int size;
- unsigned char type[4];
-} WavFileHeader;
-
-typedef struct
-{
- unsigned short format;
- unsigned short numberofchannels;
- unsigned int samplerate;
- unsigned int bytespersec;
- unsigned short blockalignment;
- unsigned short bitrate;
-} WavFmtHeader;
-
-typedef struct
-{
- unsigned short size;
- unsigned short samplesperblock;
-} WavFmtExHeader;
-
-typedef struct
-{
- unsigned int Manufacturer;
- unsigned int Product;
- unsigned int SamplePeriod;
- unsigned int Note;
- unsigned int FineTune;
- unsigned int SMPTEFormat;
- unsigned int SMPTEOffest;
- unsigned int loops;
- unsigned int SamplerData;
- struct
- {
- unsigned int Identifier;
- unsigned int Type;
- unsigned int Start;
- unsigned int End;
- unsigned int Fraction;
- unsigned int Count;
- } Loop[1];
-} WavSampleHeader;
-
-typedef struct
-{
- unsigned char id[4];
- unsigned int size;
-} WavChunkHeader;
-
-/**
- * loads a sample and returns a pointer
- */
-extern void* SND_LoadSample(char *filename);
-
-extern bool SND_IsSampleValid(const STR_String& name, void* memlocation);
-extern unsigned int SND_GetSampleFormat(void* sample);
-extern unsigned int SND_GetNumberOfChannels(void* sample);
-extern unsigned int SND_GetSampleRate(void* sample);
-extern unsigned int SND_GetBitRate(void* sample);
-extern unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length);
-extern unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length);
-extern unsigned int SND_GetExtraChunk(void* sample);
-
-extern void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/intern/SoundSystem/SND_WaveCache.h b/intern/SoundSystem/SND_WaveCache.h
deleted file mode 100644
index 2c457797768..00000000000
--- a/intern/SoundSystem/SND_WaveCache.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * SND_WaveCache.h
- *
- * abstract wavecache, a way to organize samples
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WIN32
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-#ifndef __SND_WAVECACHE_H
-#define __SND_WAVECACHE_H
-
-#include "SND_WaveSlot.h"
-#include "SoundDefines.h"
-#include "SND_SoundObject.h"
-#include <map>
-
-class SND_WaveCache
-{
-public:
- SND_WaveCache();
- virtual ~SND_WaveCache();
-
- SND_WaveSlot* GetWaveSlot(const STR_String& samplename);
-
- void RemoveAllSamples();
- void RemoveSample(const STR_String& samplename, int buffer);
-
-private:
- std::map<STR_String, SND_WaveSlot*> m_samplecache;
-
- SND_WaveSlot* m_bufferList[NUM_BUFFERS];
-
- void FreeSamples();
-};
-
-#endif //__SND_WAVECACHE_H
-
diff --git a/intern/SoundSystem/SND_WaveSlot.h b/intern/SoundSystem/SND_WaveSlot.h
deleted file mode 100644
index 75cddfa36d8..00000000000
--- a/intern/SoundSystem/SND_WaveSlot.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * SND_WaveSlot.cpp
- *
- * class for storing sample related information
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __SND_WAVESLOT_H
-#define __SND_WAVESLOT_H
-
-#include "STR_String.h"
-
-class SND_WaveSlot
-{
- STR_String m_samplename;
- bool m_loaded;
- void* m_data;
- unsigned int m_buffer;
- unsigned int m_sampleformat;
- unsigned int m_numberofchannels;
- unsigned int m_samplerate;
- unsigned int m_bitrate;
- unsigned int m_numberofsamples;
- unsigned int m_filesize;
-
-public:
-
- SND_WaveSlot(): m_loaded(false),
- m_data(NULL),
- m_buffer(0),
- m_sampleformat(0),
- m_numberofchannels(0),
- m_samplerate(0),
- m_bitrate(0),
- m_numberofsamples(0),
- m_filesize(0)
- {};
- ~SND_WaveSlot();
-
- void SetSampleName(STR_String samplename);
- void SetLoaded(bool loaded);
- void SetData(void* data);
- void SetBuffer(unsigned int buffer);
- void SetSampleFormat(unsigned int sampleformat);
- void SetNumberOfChannels(unsigned int numberofchannels);
- void SetSampleRate(unsigned int samplerate);
- void SetBitRate(unsigned int bitrate);
- void SetNumberOfSamples(unsigned int numberofsamples);
- void SetFileSize(unsigned int filesize);
-
-
- const STR_String& GetSampleName();
- bool IsLoaded() const;
- void* GetData();
- unsigned int GetBuffer() const;
- unsigned int GetSampleFormat() const;
- unsigned int GetNumberOfChannels() const;
- unsigned int GetSampleRate() const;
- unsigned int GetBitRate() const;
- unsigned int GetNumberOfSamples() const;
- unsigned int GetFileSize() const;
-
-};
-
-#endif //__SND_WAVESLOT_H
-
diff --git a/intern/SoundSystem/SND_test/Makefile b/intern/SoundSystem/SND_test/Makefile
deleted file mode 100644
index 279eeace0d8..00000000000
--- a/intern/SoundSystem/SND_test/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-#
-#
-
-LIBNAME = soundsystem
-DIR = $(OCGDIR)/intern/SoundSystem
-ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)SoundSystem
-
-include nan_compile.mk
-
-CPPFLAGS += $(NAN_LEVEL_1_WARNINGS)
-
-CPPFLAGS += -I$(NAN_MOTO)/include
-CPPFLAGS += -I.. -I../SND_BlenderWaveCache -I../SND_OpenAL
-
-TESTLIB = $(OCGDIR)/gameengine/OpenALSoundSystem/$(DEBUG_DIR)libOpenALSoundSystem.a
-TESTLIB += $(OCGDIR)/gameengine/BlenderWaveCache/$(DEBUG_DIR)libBlenderWaveCache.a
-TESTLIB += $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libsoundsystem.a
-TESTLIB += $(NAN_OPENAL)/lib/libopenal.a
-
-$(DIR)/$(DEBUG_DIR)SoundSystem: $(OBJS) $(TESTLIB)
- $(CC) $(LDFLAGS) -o $@ $(OBJS) $(TESTLIB) -lm -pthread -ldl -lstdc++
diff --git a/intern/SoundSystem/SND_test/SND_test.c b/intern/SoundSystem/SND_test/SND_test.c
deleted file mode 100644
index 0d19dc2e131..00000000000
--- a/intern/SoundSystem/SND_test/SND_test.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* SND_test.c nov 2000
-*
-* testfile for the SND module
-*
-* janco verduin
-*
-* $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "SND_C-api.h"
-#include "BlenderWaveCacheCApi.h"
-#include "OpenALC-Api.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#if defined(WIN32)
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-#include <fcntl.h>
-
-static int buf[3];
-
-float oPos[3]={3.0, 0.0,-1.0};
-float oVel[3]={0.0, 0.0, 1.0};
-float oOri[6]={0.0, 0.0, 1.0, 0.0, 1.0, 0.0};
-
-void* ReadFile(char *filename)
-{
- int file, filelen;
- void *data = NULL;
-
-#if defined(WIN32)
- file = open(filename, O_BINARY|O_RDONLY);
-#else
- file = open(filename, 0|O_RDONLY);
-#endif
-
- if (file == -1) {
- printf("can't open file.\n");
- printf("press q for quit.\n");
-
- }
- else {
- filelen = lseek(file, 0, SEEK_END);
- lseek(file, 0, SEEK_SET);
-
- if (filelen != 0){
- data = malloc(filelen);
- if (read(file, data, filelen) != filelen) {
- free(data);
- data = NULL;
- }
- }
- close(file);
-
- }
- return (data);
-}
-
-int main(int argc, char* argv[])
-{
- int ch;
- char* samplename = NULL;
- void* sampleinmemory = NULL;
- SND_CacheHandle wavecache = NULL;
- SND_SceneHandle scene = NULL;
- SND_ObjectHandle object = NULL;
-
- wavecache = SND_GetWaveCache();
- scene = SND_CreateOpenALScene(wavecache);
-
- samplename = "2.wav";
- sampleinmemory = ReadFile(samplename);
-
- if (sampleinmemory) {
-
- object = SND_CreateObject();
- SND_AddMemoryLocation(samplename, sampleinmemory);
- SND_SetSampleName(object, samplename);
- SND_AddObject(scene, object);
- printf("go your gang...\n");
- printf("1: play\n");
- printf("2: stop\n");
- printf("q: quit\n");
- }
- do
- {
- ch = getchar();
- ch = toupper(ch);
- switch (ch)
- {
- case '1':
- {
- SND_SetPitch(object, 1.0);
- SND_SetGain(object, 1.0);
- SND_StartSound(object);
- break;
- }
- case '2':
- {
- SND_StopSound(object);
- break;
- }
- default:
- break;
- }
-
- SND_Proceed(scene);
-
- } while (ch != 'Q');
-
- if (object) {
-
- SND_RemoveObject(scene, object);
- SND_DeleteObject(object);
- }
-
- SND_DeleteScene(scene);
- SND_DeleteCache();
-
- return 0;
-
-}
diff --git a/intern/SoundSystem/SoundDefines.h b/intern/SoundSystem/SoundDefines.h
deleted file mode 100644
index 5238507c866..00000000000
--- a/intern/SoundSystem/SoundDefines.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * SoundDefines.h
- *
- * this is where all kinds of defines are stored
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __SOUNDDEFINES_H
-#define __SOUNDDEFINES_H
-
-/* the types of devices */
-enum
-{
- snd_e_dummydevice = 0,
- snd_e_openaldevice
-};
-
-/* general stuff */
-#define NUM_BUFFERS 128
-#define NUM_SOURCES 24 /* 24 is the limit for openal on windows, was 16 in 2.47 and previous */
-
-/* openal related stuff */
-#define AL_LOOPING 0x1007
-
-/* activelist defines */
-enum
-{
- SND_REMOVE_ACTIVE_OBJECT = 0,
- SND_ADD_ACTIVE_OBJECT,
- SND_DO_NOTHING
-};
-
-/* playstate flags */
-enum
-{
- SND_UNKNOWN = -1,
- SND_INITIAL,
- SND_MUST_PLAY,
- SND_PLAYING,
- SND_MUST_STOP,
- SND_STOPPED,
- SND_MUST_PAUSE,
- SND_PAUSED,
- SND_MUST_RESUME,
- SND_MUST_STOP_WHEN_FINISHED,
- SND_MUST_BE_DELETED
-};
-
-/* loopmodes */
-enum
-{
- SND_LOOP_OFF = 0,
- SND_LOOP_NORMAL,
- SND_LOOP_BIDIRECTIONAL
-};
-
-
-/* cd playstate flags */
-enum
-{
- SND_CD_ALL = 0,
- SND_CD_TRACK,
- SND_CD_TRACKLOOP
-};
-
-/* sample types */
-enum
-{
- SND_WAVE_FORMAT_UNKNOWN = 0,
- SND_WAVE_FORMAT_PCM,
- SND_WAVE_FORMAT_ADPCM,
- SND_WAVE_FORMAT_ALAW = 6,
- SND_WAVE_FORMAT_MULAW,
- SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 17,
- SND_WAVE_FORMAT_CONTROL_RES_VQLPC = 34,
- SND_WAVE_FORMAT_GSM_610 = 49,
- SND_WAVE_FORMAT_MPEG3 = 85
-};
-
-#endif //__SOUNDDEFINES_H
-
diff --git a/intern/SoundSystem/dummy/SND_DummyDevice.h b/intern/SoundSystem/dummy/SND_DummyDevice.h
deleted file mode 100644
index 988f731d1bf..00000000000
--- a/intern/SoundSystem/dummy/SND_DummyDevice.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef SND_DUMMYDEVICE
-#define SND_DUMMYDEVICE
-
-#include "SND_AudioDevice.h"
-
-class SND_DummyDevice : public SND_AudioDevice
-{
-public:
- SND_DummyDevice();
- ~SND_DummyDevice();
-
- bool Init() { return false; }
-
- SND_WaveSlot* LoadSample(const STR_String& samplename,
- void* memlocation,
- int size) { return NULL; }
-
- void InitListener() {};
- void SetListenerGain(float gain) const {};
- void SetDopplerVelocity(MT_Scalar dopplervelocity) const {};
- void SetDopplerFactor(MT_Scalar dopplerfactor) const {};
- void SetListenerRollOffFactor(MT_Scalar rollofffactor) const {};
-
- void MakeCurrent() const {};
-
- void NextFrame() const {};
-
- void SetObjectBuffer(int id, unsigned int buffer) {};
-
- int GetPlayState(int id) { return SND_UNKNOWN; }
- void PlayObject(int id) {};
- void StopObject(int id) const {};
- void StopAllObjects() {};
- void PauseObject(int id) const {};
-
- void SetObjectLoop(int id, unsigned int loopmode) const {};
- void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const {};
- void SetObjectPitch(int id, MT_Scalar pitch) const {};
- void SetObjectGain(int id, MT_Scalar gain) const {};
- void SetObjectMinGain(int id, MT_Scalar mingain) const {};
- void SetObjectMaxGain(int id, MT_Scalar maxgain) const {};
- void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const {};
- void SetObjectReferenceDistance(int id, MT_Scalar distance) const {};
-
- void SetObjectTransform(int id,
- const MT_Vector3& position,
- const MT_Vector3& velocity,
- const MT_Matrix3x3& orientation,
- const MT_Vector3& lisposition,
- const MT_Scalar& rollofffactor) const {};
- void ObjectIs2D(int id) const {};
-
- void PlayCD(int track) const {};
- void PauseCD(bool pause) const {};
- void StopCD() const {};
- void SetCDPlaymode(int playmode) const {};
- void SetCDGain(MT_Scalar gain) const {};
-
- void StartUsingDSP() {};
- float* GetSpectrum() { return NULL; }
- void StopUsingDSP() {};
-};
-
-#endif //SND_DUMMYDEVICE
-
diff --git a/intern/SoundSystem/intern/SND_AudioDevice.cpp b/intern/SoundSystem/intern/SND_AudioDevice.cpp
deleted file mode 100644
index 4a5c0e2c498..00000000000
--- a/intern/SoundSystem/intern/SND_AudioDevice.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SND_AudioDevice.h"
-#include "SND_SoundObject.h"
-
-#ifdef WIN32
-// This warning tells us about truncation of __long__ stl-generated names.
-// It can occasionally cause DevStudio to have internal compiler warnings.
-#pragma warning( disable : 4786 )
-#endif
-
-
-SND_AudioDevice::SND_AudioDevice()
-{
- m_wavecache = NULL;
- m_audio = false;
-
- for (int i = 0; i < NUM_SOURCES; i++)
- {
- m_idObjectArray[i] = new SND_IdObject();
- m_idObjectArray[i]->SetId(i);
- m_idObjectArray[i]->SetSoundObject(NULL);
- m_idObjectList.addTail(m_idObjectArray[i]);
- }
-}
-
-
-
-SND_AudioDevice::~SND_AudioDevice()
-{
- for (int i = 0; i < NUM_SOURCES; i++)
- {
- delete m_idObjectArray[i];
- m_idObjectArray[i] = NULL;
- }
-
- if (m_wavecache)
- {
- delete m_wavecache;
- m_wavecache = NULL;
- }
-}
-
-
-
-bool SND_AudioDevice::IsInitialized()
-{
- return m_audio;
-}
-
-
-
-SND_WaveCache* SND_AudioDevice::GetWaveCache() const
-{
- return m_wavecache;
-}
-
-
-
-/* seeks an unused id and returns it */
-bool SND_AudioDevice::GetNewId(SND_SoundObject* pObject)
-{
-#ifdef ONTKEVER
- printf("SND_AudioDevice::GetNewId\n");
-#endif
-
- bool result = false;
-
- // first, get the oldest (the first) idobject
- SND_IdObject* pIdObject = (SND_IdObject*)m_idObjectList.getHead();
-
- if (pIdObject->isTail())
- {
- }
- else
- {
- // find the first id object which doesn't have a high priority soundobject
- bool ThisSoundMustStay = false;
- bool OutOfIds = false;
-
- do
- {
- // if no soundobject present, it's seat may be taken
- if (pIdObject->GetSoundObject())
- {
- // and also if it ain't highprio
- if (pIdObject->GetSoundObject()->IsHighPriority())
- {
- ThisSoundMustStay = true;
- pIdObject = (SND_IdObject*)pIdObject->getNext();
-
- // if the last one is a priority sound too, then there are no id's left
- // and we won't add any new sounds
- if (pIdObject->isTail())
- OutOfIds = true;
- }
- else
- {
- ThisSoundMustStay = false;
- }
- }
- else
- {
- ThisSoundMustStay = false;
- }
-
- } while (ThisSoundMustStay && !OutOfIds);
-
- if (!OutOfIds)
- {
- SND_SoundObject* oldobject = pIdObject->GetSoundObject();
-
- // revoke the old object if present
- if (oldobject)
- {
-#ifdef ONTKEVER
- printf("oldobject: %x\n", oldobject);
-#endif
- RevokeSoundObject(oldobject);
- }
-
- // set the new soundobject into the idobject
- pIdObject->SetSoundObject(pObject);
-
- // set the id into the soundobject
- int id = pIdObject->GetId();
- pObject->SetId(id);
-
- // connect the new id to the buffer the sample is stored in
- SetObjectBuffer(id, pObject->GetBuffer());
-
- // remove the idobject from the list and add it in the back again
- pIdObject->remove();
- m_idObjectList.addTail(pIdObject);
-
- result = true;
- }
- }
-
- return result;
-}
-
-
-
-void SND_AudioDevice::ClearId(SND_SoundObject* pObject)
-{
-#ifdef ONTKEVER
- printf("SND_AudioDevice::ClearId\n");
-#endif
-
- if (pObject)
- {
- int id = pObject->GetId();
-
- if (id != -1)
- {
- // lets get the idobject belonging to the soundobject
- SND_IdObject* pIdObject = m_idObjectArray[id];
- SND_SoundObject* oldobject = pIdObject->GetSoundObject();
-
- if (oldobject)
- {
- RevokeSoundObject(oldobject);
-
- // clear the idobject from the soundobject
- pIdObject->SetSoundObject(NULL);
- }
-
- // remove the idobject and place it in front
- pIdObject->remove();
- m_idObjectList.addHead(pIdObject);
- }
- }
-}
-
-
-
-void SND_AudioDevice::RevokeSoundObject(SND_SoundObject* pObject)
-{
-#ifdef ONTKEVER
- printf("SND_AudioDevice::RevokeSoundObject\n");
-#endif
-
- // stop the soundobject
- int id = pObject->GetId();
-
- if (id >= 0 && id < NUM_SOURCES)
- {
- StopObject(id);
-
- // remove the object from the 'activelist'
- pObject->SetActive(false);
-
-#ifdef ONTKEVER
- printf("pObject->remove();\n");
-#endif
- }
-
- // make sure its id is invalid
- pObject->SetId(-1);
-}
-
-/*
-void SND_AudioDevice::RemoveSample(const char* filename)
-{
- if (m_wavecache)
- m_wavecache->RemoveSample(filename);
-}
-*/
-
-void SND_AudioDevice::RemoveAllSamples()
-{
- if (m_wavecache)
- m_wavecache->RemoveAllSamples();
-}
-
diff --git a/intern/SoundSystem/intern/SND_AudioDevice.h b/intern/SoundSystem/intern/SND_AudioDevice.h
deleted file mode 100644
index 54e8feea90e..00000000000
--- a/intern/SoundSystem/intern/SND_AudioDevice.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef SND_AUDIODEVICE
-#define SND_AUDIODEVICE
-
-#include "SND_IAudioDevice.h"
-#include "SoundDefines.h"
-#include "SND_IdObject.h"
-
-class SND_AudioDevice : public SND_IAudioDevice
-{
-public:
- SND_AudioDevice();
- virtual ~SND_AudioDevice();
-
- virtual bool IsInitialized();
-
- SND_WaveCache* GetWaveCache() const;
-
- bool GetNewId(SND_SoundObject* pObject);
- void ClearId(SND_SoundObject* pObject);
-
- void UseCD() const {};
-
- /* to be implemented in derived class
-
- virtual SND_WaveSlot* LoadSample(const STR_String& samplename,
- void* memlocation,
- int size) =0;
- */
-// void RemoveSample(const char* filename);
- void RemoveAllSamples();
-
- /* to be implemented in derived class
-
- virtual void InitListener()=0;
- virtual void SetListenerGain(float gain) const =0;
- virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0;
- virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0;
- virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0;
-
- virtual void MakeCurrent() const =0;
-
- virtual void UpdateDevice() const =0;
-
- virtual void SetObjectBuffer(int id, unsigned int buffer)=0;
- virtual int GetPlayState(int id)=0;
- virtual void PlayObject(int id)=0;
- virtual void StopObject(int id) const =0;
- virtual void StopAllObjects()=0;
- virtual void PauseObject(int id) const =0;
-
- virtual void SetObjectLoop(int id, bool loop) const =0;
- virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0;
- virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0;
- virtual void SetObjectGain(int id, MT_Scalar gain) const =0;
- virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0;
- virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0;
- virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0;
- virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0;
-
- virtual void SetObjectTransform(int id,
- const MT_Vector3& position,
- const MT_Vector3& velocity,
- const MT_Matrix3x3& orientation,
- const MT_Vector3& lisposition,
- const MT_Scalar& rollofffactor) const =0;
- virtual void ObjectIs2D(int id) const =0;
-
- virtual void PlayCD(int track) const =0;
- virtual void PauseCD(bool pause) const =0;
- virtual void StopCD() const =0;
- virtual void SetCDPlaymode(int playmode) const =0;
- virtual void SetCDGain(MT_Scalar gain) const =0;
- virtual float* GetSpectrum() =0;
- */
-
-protected:
- bool m_audio;
- GEN_List m_idObjectList;
- SND_IdObject* m_idObjectArray[NUM_SOURCES];
- SND_WaveCache* m_wavecache;
-
-private:
- void RevokeSoundObject(SND_SoundObject* pObject);
-};
-
-#endif //SND_AUDIODEVICE
-
diff --git a/intern/SoundSystem/intern/SND_C-api.cpp b/intern/SoundSystem/intern/SND_C-api.cpp
deleted file mode 100644
index 09846269dcc..00000000000
--- a/intern/SoundSystem/intern/SND_C-api.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * SND_C-Api.cpp
- *
- * C Api for soundmodule
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "SND_C-api.h"
-#include "SND_DeviceManager.h"
-#include "SND_Scene.h"
-
-#ifdef WIN32
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-
-
-void SND_SetDeviceType(int device_type)
-{
- SND_DeviceManager::SetDeviceType(device_type);
-}
-
-
-
-SND_AudioDeviceInterfaceHandle SND_GetAudioDevice()
-{
- SND_IAudioDevice* audiodevice = NULL;
-
- SND_DeviceManager::Subscribe();
- audiodevice = SND_DeviceManager::Instance();
-
- if (!audiodevice->IsInitialized())
- {
- SND_DeviceManager::SetDeviceType(snd_e_dummydevice);
- audiodevice = SND_DeviceManager::Instance();
- }
-
- return (SND_AudioDeviceInterfaceHandle)audiodevice;
-}
-
-
-
-void SND_ReleaseDevice()
-{
- SND_DeviceManager::Unsubscribe();
-}
-
-
-
-int SND_IsPlaybackWanted(SND_SceneHandle scene)
-{
- assert(scene);
- bool result = ((SND_Scene*)scene)->IsPlaybackWanted();
-
- return (int)result;
-}
-
-
-
-// create a scene
-SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice)
-{
- // initialize sound scene and object
- SND_Scene* scene = new SND_Scene((SND_IAudioDevice*)audiodevice);
-
- return (SND_SceneHandle)scene;
-}
-
-
-
-void SND_DeleteScene(SND_SceneHandle scene)
-{
- assert(scene);
- delete (SND_Scene*)scene;
-}
-
-
-
-int SND_AddSample(SND_SceneHandle scene,
- const char* filename,
- void* memlocation,
- int size)
-{
- assert(scene);
- assert(memlocation);
- int buffer = ((SND_Scene*)scene)->LoadSample(filename, memlocation, size);
-
- return buffer;
-}
-
-
-
-void SND_RemoveAllSamples(SND_SceneHandle scene)
-{
- assert(scene);
- ((SND_Scene*)scene)->RemoveAllSamples();
-}
-
-
-
-int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object)
-{
- assert(scene);
- assert(object);
- int result = (int)((SND_Scene*)scene)->CheckBuffer((SND_SoundObject*)object);
-
- return result;
-}
-
-
-
-void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object)
-{
- assert(scene);
- assert(object);
- ((SND_Scene*)scene)->AddObject((SND_SoundObject *)object);
-}
-
-
-
-void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object)
-{
- assert(scene);
- assert(object);
- ((SND_Scene*)scene)->DeleteObject((SND_SoundObject *)object);
-}
-
-
-
-void SND_RemoveAllSounds(SND_SceneHandle scene)
-{
- assert(scene);
- ((SND_Scene*)scene)->RemoveAllObjects();
-}
-
-
-
-void SND_StopAllSounds(SND_SceneHandle scene)
-{
- assert(scene);
- ((SND_Scene*)scene)->StopAllObjects();
-}
-
-
-
-void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene)
-{
- assert(scene);
- ((SND_Scene*)scene)->Proceed();
- ((SND_IAudioDevice*)audiodevice)->NextFrame();
-}
-
-
-
-SND_ListenerHandle SND_GetListener(SND_SceneHandle scene)
-{
- assert(scene);
- return (SND_ListenerHandle)((SND_Scene*)scene)->GetListener();
-}
-
-
-
-void SND_SetListenerGain(SND_SceneHandle scene, double gain)
-{
- assert(scene);
- SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
- listener->SetGain((MT_Scalar)gain);
-}
-
-
-
-void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor)
-{
- assert(scene);
- SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
- listener->SetDopplerFactor(dopplerfactor);
-}
-
-
-
-void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity)
-{
- assert(scene);
- SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener();
- listener->SetDopplerVelocity(dopplervelocity);
-}
-
-
-
-// Object instantiation
-SND_ObjectHandle SND_CreateSound()
-{
- return (SND_ObjectHandle)new SND_SoundObject();
-}
-
-
-
-void SND_DeleteSound(SND_ObjectHandle object)
-{
- assert(object);
- delete (SND_SoundObject*)object;
-}
-
-
-
-// Object control
-void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object)
-{
- assert(scene);
- assert(object);
- ((SND_Scene*)scene)->AddActiveObject((SND_SoundObject*)object, 0);
-}
-
-
-
-void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object)
-{
- assert(scene);
- assert(object);
- ((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
-}
-
-
-
-void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object)
-{
- assert(scene);
- assert(object);
- ((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object);
-}
-
-
-
-void SND_SetSampleName(SND_ObjectHandle object, char* samplename)
-{
- assert(object);
- STR_String name = samplename;
- ((SND_SoundObject*)object)->SetSampleName(name);
-}
-
-
-
-void SND_SetGain(SND_ObjectHandle object, double gain)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetGain(gain);
-}
-
-
-
-void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetMinGain(minimumgain);
-}
-
-
-
-void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetMaxGain(maximumgain);
-}
-
-
-
-void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetRollOffFactor(rollofffactor);
-}
-
-
-
-void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetReferenceDistance(referencedistance);
-}
-
-
-
-void SND_SetPitch(SND_ObjectHandle object, double pitch)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetPitch(pitch);
-}
-
-
-
-void SND_SetPosition(SND_ObjectHandle object, double* position)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetPosition(position);
-}
-
-
-
-void SND_SetVelocity(SND_ObjectHandle object, double* velocity)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetVelocity(velocity);
-}
-
-
-
-void SND_SetOrientation(SND_ObjectHandle object, double* orientation)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetOrientation(orientation);
-}
-
-
-
-void SND_SetLoopMode(SND_ObjectHandle object, int loopmode)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetLoopMode(loopmode);
-}
-
-
-
-void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend)
-{
- assert(object);
- ((SND_SoundObject*)object)->SetLoopStart(loopstart);
- ((SND_SoundObject*)object)->SetLoopEnd(loopend);
-}
-
-
-
-float SND_GetGain(SND_ObjectHandle object)
-{
- assert(object);
- MT_Scalar gain = ((SND_SoundObject*)object)->GetGain();
- return (float) gain;
-}
-
-
-
-float SND_GetPitch(SND_ObjectHandle object)
-{
- assert(object);
- MT_Scalar pitch = ((SND_SoundObject*)object)->GetPitch();
- return (float) pitch;
-}
-
-
-
-int SND_GetLoopMode(SND_ObjectHandle object)
-{
- assert(object);
- return ((SND_SoundObject*)object)->GetLoopMode();
-}
-
-
-
-int SND_GetPlaystate(SND_ObjectHandle object)
-{
- assert(object);
- return ((SND_SoundObject*)object)->GetPlaystate();
-}
diff --git a/intern/SoundSystem/intern/SND_CDObject.cpp b/intern/SoundSystem/intern/SND_CDObject.cpp
deleted file mode 100644
index 089e0d554e4..00000000000
--- a/intern/SoundSystem/intern/SND_CDObject.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * SND_CDObject.cpp
- *
- * Implementation for CD playback
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SND_CDObject.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-SND_CDObject* SND_CDObject::m_instance = NULL;
-
-bool SND_CDObject::CreateSystem()
-{
- bool result = false;
-
- if (!m_instance)
- {
- m_instance = new SND_CDObject();
- result = true;
- }
-
- return result;
-}
-
-
-
-bool SND_CDObject::DisposeSystem()
-{
- bool result = false;
-
- if (m_instance)
- {
- delete m_instance;
- m_instance = NULL;
- result = true;
- }
-
- return result;
-}
-
-
-
-SND_CDObject* SND_CDObject::Instance()
-{
- return m_instance;
-}
-
-
-
-SND_CDObject::SND_CDObject()
-{
- m_gain = 1;
- m_playmode = SND_CD_ALL;
- m_track = 1;
- m_playstate = SND_STOPPED;
- m_used = false;
-
- // don't set the cd standard on modified:
- // if not used, we don't wanna touch it (performance)
- m_modified = false;
-}
-
-
-
-SND_CDObject::~SND_CDObject()
-{
-}
-
-
-
-void SND_CDObject::SetGain(MT_Scalar gain)
-{
- m_gain = gain;
- m_modified = true;
-}
-
-
-
-void SND_CDObject::SetPlaymode(int playmode)
-{
- m_playmode = playmode;
-}
-
-
-
-void SND_CDObject::SetPlaystate(int playstate)
-{
- m_playstate = playstate;
-}
-
-
-
-void SND_CDObject::SetTrack(int track)
-{
- m_track = track;
-}
-
-
-
-int SND_CDObject::GetTrack() const
-{
- return m_track;
-}
-
-
-
-MT_Scalar SND_CDObject::GetGain() const
-{
- return m_gain;
-}
-
-
-int SND_CDObject::GetPlaystate() const
-{
- return m_playstate;
-}
-
-
-
-bool SND_CDObject::IsModified() const
-{
- return m_modified;
-}
-
-
-
-void SND_CDObject::SetModified(bool modified)
-{
- m_modified = modified;
-}
-
-
-
-int SND_CDObject::GetPlaymode() const
-{
- return m_playmode;
-}
-
-
-
-void SND_CDObject::SetUsed()
-{
- m_used = true;
-}
-
-
-
-bool SND_CDObject::GetUsed()
-{
- return m_used;
-}
-
diff --git a/intern/SoundSystem/intern/SND_DeviceManager.cpp b/intern/SoundSystem/intern/SND_DeviceManager.cpp
deleted file mode 100644
index c4bc887dffe..00000000000
--- a/intern/SoundSystem/intern/SND_DeviceManager.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * SND_DeviceManager.h
- *
- * singleton for creating, switching and deleting audiodevices
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "SND_DeviceManager.h"
-#include "SND_DependKludge.h"
-#include "SND_DummyDevice.h"
-#ifdef USE_OPENAL
-#include "SND_OpenALDevice.h"
-#endif
-
-SND_IAudioDevice* SND_DeviceManager::m_instance = NULL;
-int SND_DeviceManager::m_subscriptions = 0;
-
-#ifdef USE_OPENAL
-int SND_DeviceManager::m_device_type = snd_e_openaldevice;
-#else
-int SND_DeviceManager::m_device_type = snd_e_dummydevice;
-#endif
-
-void SND_DeviceManager::Subscribe()
-{
- ++m_subscriptions;
-}
-
-
-
-void SND_DeviceManager::Unsubscribe()
-{
- --m_subscriptions;
-
- // only release memory if there is a m_instance but no subscriptions left
- if (m_subscriptions == 0 && m_instance)
- {
- delete m_instance;
- m_instance = NULL;
- }
-
- if (m_subscriptions < 0)
- m_subscriptions = 0;
-}
-
-
-
-SND_IAudioDevice* SND_DeviceManager::Instance()
-{
- // only give away an instance if there are subscriptions
- if (m_subscriptions)
- {
- // if there's no instance yet, set and create a new one
- if (m_instance == NULL)
- {
- SetDeviceType(m_device_type);
- }
-
- return m_instance;
- }
- else
- {
- return NULL;
- }
-}
-
-
-
-void SND_DeviceManager::SetDeviceType(int device_type)
-{
- // if we want to change devicetype, first delete the old one
- if (m_instance)
- {
- delete m_instance;
- m_instance = NULL;
- }
-
- // let's create the chosen device
- switch (device_type)
- {
-#ifdef USE_OPENAL
- case snd_e_openaldevice:
- {
- m_instance = new SND_OpenALDevice();
- m_device_type = device_type;
- break;
- }
-#endif
- default:
- {
- m_instance = new SND_DummyDevice();
- m_device_type = device_type;
- break;
- }
- }
-}
diff --git a/intern/SoundSystem/intern/SND_IdObject.cpp b/intern/SoundSystem/intern/SND_IdObject.cpp
deleted file mode 100644
index b261442db0a..00000000000
--- a/intern/SoundSystem/intern/SND_IdObject.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * SND_IdObject.cpp
- *
- * Object for storing runtime data, like id's, soundobjects etc
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SND_IdObject.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-SND_IdObject::SND_IdObject()
-{
-}
-
-
-
-SND_IdObject::~SND_IdObject()
-{
-}
-
-
-
-SND_SoundObject* SND_IdObject::GetSoundObject()
-{
- return m_soundObject;
-}
-
-
-
-void SND_IdObject::SetSoundObject(SND_SoundObject* pObject)
-{
- m_soundObject = pObject;
-}
-
-
-
-int SND_IdObject::GetId()
-{
- return m_id;
-}
-
-
-
-void SND_IdObject::SetId(int id)
-{
- m_id = id;
-}
diff --git a/intern/SoundSystem/intern/SND_IdObject.h b/intern/SoundSystem/intern/SND_IdObject.h
deleted file mode 100644
index 86611b026f0..00000000000
--- a/intern/SoundSystem/intern/SND_IdObject.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SND_IdObject.h
- *
- * Object for storing runtime data, like id's, soundobjects etc
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __SND_IDOBJECT_H
-#define __SND_IDOBJECT_H
-
-#include "SND_SoundObject.h"
-#include "GEN_List.h"
-#include "SoundDefines.h"
-
-class SND_IdObject : public GEN_Link
-{
- SND_SoundObject* m_soundObject;
- int m_id;
-
-public:
- SND_IdObject();
- virtual ~SND_IdObject();
-
- SND_SoundObject* GetSoundObject();
- void SetSoundObject(SND_SoundObject* pObject);
-
- int GetId();
- void SetId(int id);
-};
-
-#endif //__SND_OBJECT_H
-
diff --git a/intern/SoundSystem/intern/SND_Scene.cpp b/intern/SoundSystem/intern/SND_Scene.cpp
deleted file mode 100644
index af1b43a08aa..00000000000
--- a/intern/SoundSystem/intern/SND_Scene.cpp
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
-* SND_Scene.cpp
-*
-* The scene for sounds.
-*
-* $Id$
-*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef WIN32
-#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-#include "SND_Scene.h"
-#include "SND_DependKludge.h"
-#include "SND_IAudioDevice.h"
-
-#include <stdlib.h>
-#include <iostream>
-
-//static unsigned int tijd = 0;
-
-SND_Scene::SND_Scene(SND_IAudioDevice* audiodevice)
- : m_audiodevice(audiodevice)
-{
- if (m_audiodevice)
- m_wavecache = m_audiodevice->GetWaveCache();
-
- if (!m_wavecache || !audiodevice)
- {
- m_audio = false;
- }
- else
- {
- //if so, go ahead!
- m_audio = true;
-#ifdef ONTKEVER
- printf("SND_Scene::SND_Scene() m_audio == true\n");
-#endif
- m_audiodevice->InitListener();
- }
-
- IsPlaybackWanted();
-}
-
-
-
-SND_Scene::~SND_Scene()
-{
- StopAllObjects();
-}
-
-
-
-// check if audioplayback is wanted
-bool SND_Scene::IsPlaybackWanted()
-{
- /* Removed the functionality for checking if noaudio was provided on */
- /* the commandline. */
- if (m_audiodevice && m_wavecache)
- {
- m_audioplayback = true;
- }
- else
- {
- StopAllObjects();
- m_audioplayback = false;
- }
-
- return m_audioplayback;
-}
-
-
-
-int SND_Scene::LoadSample(const STR_String& samplename,
- void* memlocation,
- int size)
-{
- int result = -1;
-
- if (m_audiodevice)
- {
- SND_WaveSlot* waveslot = m_audiodevice->LoadSample(samplename, memlocation, size);
-
- if (waveslot)
- result = waveslot->GetBuffer();
- }
-
- return result;
-}
-
-
-
-void SND_Scene::RemoveAllSamples()
-{
- if (m_audio && m_audiodevice)
- m_audiodevice->RemoveAllSamples();
-}
-
-
-
-bool SND_Scene::CheckBuffer(SND_SoundObject* pObject)
-{
- bool result = false;
-
- if (pObject && m_wavecache)
- {
- SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(pObject->GetSampleName());
-
- if (waveslot)
- {
- pObject->SetBuffer(waveslot->GetBuffer());
-
- result = true;
- }
- }
-
- return result;
-}
-
-
-
-bool SND_Scene::IsSampleLoaded(STR_String& samplename)
-{
- bool result = false;
-
- if (samplename && m_wavecache)
- {
- SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(samplename);
-
- if (waveslot && waveslot->IsLoaded())
- result = true;
- }
-
- return result;
-}
-
-
-
-void SND_Scene::AddObject(SND_SoundObject* pObject)
-{
- if (m_audio)
- {
- STR_String samplename = pObject->GetSampleName();
- SND_WaveSlot* slot = NULL;
-
- // don't add the object if no valid sample is referenced
- if (samplename != "")
- {
- // check if the sample is already loaded
- slot = m_wavecache->GetWaveSlot(samplename);
- }
-
- if (slot)
- {
- pObject->SetBuffer(slot->GetBuffer());
-
- // needed for expected lifespan of the sample, but ain't necesary anymore i think
- MT_Scalar samplelength = slot->GetNumberOfSamples();
- MT_Scalar samplerate = slot->GetSampleRate();
- MT_Scalar soundlength = samplelength/samplerate;
- pObject->SetLength(soundlength);
-
- // add the object to the list
- m_soundobjects.insert((SND_SoundObject*)pObject);
- }
- }
-}
-
-
-
-void SND_Scene::SetListenerTransform(const MT_Vector3& pos,
- const MT_Vector3& vel,
- const MT_Matrix3x3& ori)
-{
- if (m_audio)
- {
- GetListener()->SetPosition(pos);
- GetListener()->SetVelocity(vel);
- GetListener()->SetOrientation(ori);
- }
-}
-
-
-
-void SND_Scene::UpdateListener()
-{
- // process the listener if modified
- if (m_listener.IsModified())
- {
- m_audiodevice->SetListenerGain(m_listener.GetGain());
- m_audiodevice->SetDopplerVelocity(m_listener.GetDopplerVelocity());
- m_audiodevice->SetDopplerFactor(m_listener.GetDopplerFactor());
- m_listener.SetModified(false);
- }
-}
-
-
-
-void SND_Scene::AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime)
-{
- if (m_audio)
- {
- if (pObject)
- {
-#ifdef ONTKEVER
- printf("SND_Scene::AddActiveObject\n");
-#endif
-
- // first check if the object is already on the list
- if (pObject->IsActive())
- {
- pObject->SetTimeStamp(curtime);
- pObject->StartSound();
- }
- else
- {
- pObject->SetTimeStamp(curtime);
-
- // compute the expected lifespan
- pObject->SetLifeSpan();
-
- // lets give the new active-to-be object an id
- if (m_audiodevice->GetNewId(pObject))
- {
- // and add the object
- m_activeobjects.addTail(pObject);
- pObject->StartSound();
- pObject->SetActive(true);
- }
- }
- }
- }
-}
-
-
-
-void SND_Scene::RemoveActiveObject(SND_SoundObject* pObject)
-{
- if (m_audio)
- {
- if (pObject)
- {
-#ifdef ONTKEVER
- printf("SND_Scene::RemoveActiveObject\n");
-#endif
- // if inactive, remove it from the list
- if (pObject->IsActive())
- {
- // first make sure it is stopped
- m_audiodevice->ClearId(pObject);
- }
- }
- }
-}
-
-
-
-void SND_Scene::UpdateActiveObects()
-{
-// ++tijd;
-
- SND_SoundObject* pObject;
- // update only the objects that need to be updated
- for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
- !pObject->isTail();
- pObject = (SND_SoundObject*)pObject->getNext())
- {
- int id = pObject->GetId();
-
- if (id >= 0)
- {
- if (pObject->Is3D())
- {
- // Get the global positions and velocity vectors
- // of the listener and soundobject
- MT_Vector3 op = pObject->GetPosition();
- MT_Vector3 lp = m_listener.GetPosition();
- MT_Vector3 position = op - lp;
-
- // Calculate relative velocity in global coordinates
- // of the sound with respect to the listener.
- MT_Vector3 ov = pObject->GetVelocity();
- MT_Vector3 lv = m_listener.GetVelocity();
- MT_Vector3 velocity = ov - lv;
-
- // Now map the object position and velocity into
- // the local coordinates of the listener.
- MT_Matrix3x3 lo = m_listener.GetOrientation();
-
- MT_Vector3 local_sound_pos = position * lo;
- MT_Vector3 local_sound_vel = velocity * lo;
-
- m_audiodevice->SetObjectTransform(
- id,
- local_sound_pos,
- local_sound_vel,
- pObject->GetOrientation(), // make relative to listener!
- lp,
- pObject->GetRollOffFactor());
- }
- else
- {
- m_audiodevice->ObjectIs2D(id);
- }
-
- // update the situation
- if (pObject->IsModified())
- {
- m_audiodevice->SetObjectPitch(id, pObject->GetPitch());
- m_audiodevice->SetObjectGain(id, pObject->GetGain());
- m_audiodevice->SetObjectMinGain(id, pObject->GetMinGain());
- m_audiodevice->SetObjectMaxGain(id, pObject->GetMaxGain());
- m_audiodevice->SetObjectReferenceDistance(id, pObject->GetReferenceDistance());
- m_audiodevice->SetObjectRollOffFactor(id, pObject->GetRollOffFactor());
- m_audiodevice->SetObjectLoop(id, pObject->GetLoopMode());
- m_audiodevice->SetObjectLoopPoints(id, pObject->GetLoopStart(), pObject->GetLoopEnd());
- pObject->SetModified(false);
- }
-
- pObject->AddRunning();
-
-#ifdef ONTKEVER
- STR_String naam = pObject->GetObjectName();
- STR_String sample = pObject->GetSampleName();
-
- int id = pObject->GetId();
- int buffer = pObject->GetBuffer();
-
- float gain = pObject->GetGain();
- float pitch = pObject->GetPitch();
- float timestamp = pObject->GetTimestamp();
-
- printf("naam: %s, sample: %s \n", naam.Ptr(), sample.Ptr());
- printf("id: %d, buffer: %d \n", id, buffer);
- printf("gain: %f, pitch: %f, ts: %f \n\n", gain, pitch, timestamp);
-#endif
-#ifdef USE_OPENAL
- // ok, properties Set. now see if it must play
- switch (pObject->GetPlaystate()){
- case SND_MUST_PLAY:
- m_audiodevice->PlayObject(id);
- pObject->SetPlaystate(SND_PLAYING);
- break;
- case SND_MUST_STOP:
- RemoveActiveObject(pObject);
- break;
- case SND_MUST_PAUSE:
- m_audiodevice->PauseObject(id);
- pObject->SetPlaystate(SND_PAUSED);
- break;
- }
-#endif
-
- // check to see if the sound is still playing
- // if not: release its id
- int playstate = m_audiodevice->GetPlayState(id);
-#ifdef ONTKEVER
- if (playstate != 2)
- printf("%d - ",playstate);
-#endif
-
- if ((playstate == SND_STOPPED) && !pObject->GetLoopMode())
- {
- RemoveActiveObject(pObject);
- }
- }
- }
-}
-
-
-
-void SND_Scene::UpdateCD()
-{
- if (m_audiodevice)
- {
- SND_CDObject* pCD = SND_CDObject::Instance();
-
- if (pCD)
- {
- int playstate = pCD->GetPlaystate();
-
- switch (playstate)
- {
- case SND_MUST_PLAY:
- {
- // initialize the cd only when you need it
- m_audiodevice->SetCDGain(pCD->GetGain());
- m_audiodevice->SetCDPlaymode(pCD->GetPlaymode());
- m_audiodevice->PlayCD(pCD->GetTrack());
- pCD->SetPlaystate(SND_PLAYING);
- pCD->SetUsed();
- break;
- }
- case SND_MUST_PAUSE:
- {
- m_audiodevice->PauseCD(true);
- pCD->SetPlaystate(SND_PAUSED);
- break;
- }
- case SND_MUST_RESUME:
- {
- m_audiodevice->PauseCD(false);
- pCD->SetPlaystate(SND_PLAYING);
- break;
- }
- case SND_MUST_STOP:
- {
- m_audiodevice->StopCD();
- pCD->SetPlaystate(SND_STOPPED);
- break;
- }
- default:
- {
- }
- }
-
- // this one is only for realtime modifying settings
- if (pCD->IsModified())
- {
- m_audiodevice->SetCDGain(pCD->GetGain());
- pCD->SetModified(false);
- }
- }
- }
-}
-
-
-
-void SND_Scene::Proceed()
-{
- if (m_audio && m_audioplayback)
- {
- m_audiodevice->MakeCurrent();
-
- UpdateListener();
- UpdateActiveObects();
- UpdateCD();
-
-// m_audiodevice->UpdateDevice();
- }
-}
-
-
-void SND_Scene::DeleteObject(SND_SoundObject* pObject)
-{
-#ifdef ONTKEVER
- printf("SND_Scene::DeleteObject\n");
-#endif
-
- if (pObject)
- {
- if (m_audiodevice)
- m_audiodevice->ClearId(pObject);
-
- // must remove object from m_activeList
- std::set<SND_SoundObject*>::iterator set_it;
- set_it = m_soundobjects.find(pObject);
-
- if (set_it != m_soundobjects.end())
- m_soundobjects.erase(set_it);
-
- // release the memory
- delete pObject;
- pObject = NULL;
- }
-}
-
-
-
-void SND_Scene::RemoveAllObjects()
-{
-#ifdef ONTKEVER
- printf("SND_Scene::RemoveAllObjects\n");
-#endif
-
- StopAllObjects();
-
- std::set<SND_SoundObject*>::iterator it = m_soundobjects.begin();
-
- while (it != m_soundobjects.end())
- {
- delete (*it);
- it++;
- }
-
- m_soundobjects.clear();
-}
-
-
-
-void SND_Scene::StopAllObjects()
-{
- if (m_audio)
- {
-#ifdef ONTKEVER
- printf("SND_Scene::StopAllObjects\n");
-#endif
-
- SND_SoundObject* pObject;
-
- for (pObject = (SND_SoundObject*)m_activeobjects.getHead();
- !pObject->isTail();
- pObject = (SND_SoundObject*)pObject->getNext())
- {
- m_audiodevice->ClearId(pObject);
- }
- }
-}
-
-
-
-SND_SoundListener* SND_Scene::GetListener()
-{
- return &m_listener;
-}
diff --git a/intern/SoundSystem/intern/SND_SoundListener.cpp b/intern/SoundSystem/intern/SND_SoundListener.cpp
deleted file mode 100644
index 26163e87765..00000000000
--- a/intern/SoundSystem/intern/SND_SoundListener.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * SND_SoundListener.cpp
- *
- * A SoundListener is for sound what a camera is for vision.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SND_SoundListener.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-SND_SoundListener::SND_SoundListener()
-{
- m_modified = true;
- m_gain = 1.0;
- m_dopplerfactor = 1.0;
- m_dopplervelocity = 1.0;
- m_scale = 1.0;
- m_position[0] = 0.0;
- m_position[1] = 0.0;
- m_position[2] = 0.0;
- m_velocity[0] = 0.0;
- m_velocity[1] = 0.0;
- m_velocity[2] = 0.0;
- m_orientation[0][0] = 1.0;
- m_orientation[0][1] = 0.0;
- m_orientation[0][2] = 0.0;
- m_orientation[1][0] = 0.0;
- m_orientation[1][1] = 1.0;
- m_orientation[1][2] = 0.0;
- m_orientation[2][0] = 0.0;
- m_orientation[2][1] = 0.0;
- m_orientation[2][2] = 1.0;
-}
-
-
-SND_SoundListener::~SND_SoundListener()
-{
- ; /* intentionally empty */
-
-}
-
-
-
-void SND_SoundListener::SetGain(MT_Scalar gain)
-{
- m_gain = gain;
- m_modified = true;
-}
-
-
-
-void SND_SoundListener::SetPosition (const MT_Vector3& pos)
-{
- m_position = pos;
-}
-
-
-
-void SND_SoundListener::SetVelocity(const MT_Vector3& vel)
-{
- m_velocity = vel;
-}
-
-
-
-void SND_SoundListener::SetOrientation(const MT_Matrix3x3& ori)
-{
- m_orientation = ori;
-}
-
-
-
-void SND_SoundListener::SetDopplerFactor(MT_Scalar dopplerfactor)
-{
- m_dopplerfactor = dopplerfactor;
- m_modified = true;
-}
-
-
-
-void SND_SoundListener::SetDopplerVelocity(MT_Scalar dopplervelocity)
-{
- m_dopplervelocity = dopplervelocity;
- m_modified = true;
-}
-
-
-
-void SND_SoundListener::SetScale(MT_Scalar scale)
-{
- m_scale = scale;
- m_modified = true;
-}
-
-
-
-MT_Scalar SND_SoundListener::GetGain() const
-{
- return m_gain;
-}
-
-
-
-MT_Vector3 SND_SoundListener::GetPosition() const
-{
- return m_position;
-}
-
-
-
-MT_Vector3 SND_SoundListener::GetVelocity() const
-{
- return m_velocity;
-}
-
-
-
-MT_Matrix3x3 SND_SoundListener::GetOrientation()
-{
- return m_orientation;
-}
-
-
-
-MT_Scalar SND_SoundListener::GetDopplerFactor() const
-{
- return m_dopplerfactor;
-}
-
-
-
-MT_Scalar SND_SoundListener::GetDopplerVelocity() const
-{
- return m_dopplervelocity;
-}
-
-
-
-MT_Scalar SND_SoundListener::GetScale() const
-{
- return m_scale;
-}
-
-
-
-bool SND_SoundListener::IsModified() const
-{
- return m_modified;
-}
-
-
-
-void SND_SoundListener::SetModified(bool modified)
-{
- m_modified = modified;
-}
diff --git a/intern/SoundSystem/intern/SND_SoundObject.cpp b/intern/SoundSystem/intern/SND_SoundObject.cpp
deleted file mode 100644
index 7a244b5090d..00000000000
--- a/intern/SoundSystem/intern/SND_SoundObject.cpp
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * SND_SoundObject.cpp
- *
- * Implementation of the abstract sound object
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SND_SoundObject.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-SND_SoundObject::SND_SoundObject()// : m_modified(true)
-{
- m_samplename = "";
- m_length = 0;
- m_buffer = 0;
-
- m_gain = 0.0;
- m_pitch = 1.0;
-
- m_mingain = 0.0;
- m_maxgain = 1.0;
- m_rollofffactor = 1.0;
- m_referencedistance = 1.0;
-
- m_position[0] = 0.0;
- m_position[1] = 0.0;
- m_position[2] = 0.0;
- m_velocity[0] = 0.0;
- m_velocity[1] = 0.0;
- m_velocity[2] = 0.0;
- m_orientation[0][0] = 1.0;
- m_orientation[0][1] = 0.0;
- m_orientation[0][2] = 0.0;
- m_orientation[1][0] = 0.0;
- m_orientation[1][1] = 1.0;
- m_orientation[1][2] = 0.0;
- m_orientation[2][0] = 0.0;
- m_orientation[2][1] = 0.0;
- m_orientation[2][2] = 1.0;
-
- m_loopstart = 0;
- m_loopend = 0;
- m_loopmode = SND_LOOP_NORMAL;
- m_is3d = true;
- m_playstate = SND_INITIAL;
- m_active = false;
- m_id = -1;
- m_lifespan = 0;
- m_timestamp = 0;
- m_modified = true;
- m_running = 0;
- m_highpriority = false;
-}
-
-
-
-SND_SoundObject::~SND_SoundObject()
-{
-}
-
-
-
-void SND_SoundObject::StartSound()
-{
- if (m_id >= 0)
- m_playstate = SND_MUST_PLAY;
-}
-
-
-
-void SND_SoundObject::StopSound()
-{
- if (m_id >= 0)
- m_playstate = SND_MUST_STOP;
-}
-
-
-
-void SND_SoundObject::PauseSound()
-{
- if (m_id >= 0)
- m_playstate = SND_MUST_PAUSE;
-}
-
-
-
-void SND_SoundObject::DeleteWhenFinished()
-{
- m_playstate = SND_MUST_BE_DELETED;
-}
-
-
-
-void SND_SoundObject::SetGain(MT_Scalar gain)
-{
- m_gain = gain;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetMinGain(MT_Scalar mingain)
-{
- m_mingain = mingain;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetMaxGain(MT_Scalar maxgain)
-{
- m_maxgain = maxgain;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetRollOffFactor(MT_Scalar rollofffactor)
-{
- m_rollofffactor = rollofffactor;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetReferenceDistance(MT_Scalar referencedistance)
-{
- m_referencedistance = referencedistance;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetPitch(MT_Scalar pitch)
-{
- m_pitch = pitch;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetLoopMode(unsigned int loopmode)
-{
- m_loopmode = loopmode;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetLoopStart(unsigned int loopstart)
-{
- m_loopstart = loopstart;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::SetLoopEnd(unsigned int loopend)
-{
- m_loopend = loopend;
- m_modified = true;
-}
-
-
-
-void SND_SoundObject::Set3D(bool threedee)
-{
- m_is3d = threedee;
-}
-
-
-
-void SND_SoundObject::SetLifeSpan()
-{
- m_lifespan = m_length / m_pitch;
-}
-
-
-
-bool SND_SoundObject::IsLifeSpanOver(MT_Scalar curtime) const
-{
- bool result = false;
-
- if ((curtime - m_timestamp) > m_lifespan)
- result = true;
-
- return result;
-}
-
-
-
-void SND_SoundObject::SetActive(bool active)
-{
- m_active = active;
-
- if (!active)
- {
- m_playstate = SND_STOPPED;
- (this)->remove();
- }
-}
-
-
-
-void SND_SoundObject::SetBuffer(unsigned int buffer)
-{
- m_buffer = buffer;
-}
-
-
-
-void SND_SoundObject::SetObjectName(STR_String objectname)
-{
- m_objectname = objectname;
-}
-
-
-
-void SND_SoundObject::SetSampleName(STR_String samplename)
-{
- m_samplename = samplename;
-}
-
-
-
-void SND_SoundObject::SetLength(MT_Scalar length)
-{
- m_length = length;
-}
-
-
-
-void SND_SoundObject::SetPosition(const MT_Vector3& pos)
-{
- m_position = pos;
-}
-
-
-
-void SND_SoundObject::SetVelocity(const MT_Vector3& vel)
-{
- m_velocity = vel;
-}
-
-
-
-void SND_SoundObject::SetOrientation(const MT_Matrix3x3& orient)
-{
- m_orientation = orient;
-}
-
-
-
-void SND_SoundObject::SetPlaystate(int playstate)
-{
- m_playstate = playstate;
-}
-
-
-
-void SND_SoundObject::SetId(int id)
-{
- m_id = id;
-}
-
-
-
-void SND_SoundObject::SetTimeStamp(MT_Scalar timestamp)
-{
- m_timestamp = timestamp;
-}
-
-
-
-void SND_SoundObject::SetHighPriority(bool priority)
-{
- m_highpriority = priority;
-}
-
-
-
-bool SND_SoundObject::IsHighPriority() const
-{
- return m_highpriority;
-}
-
-
-
-bool SND_SoundObject::IsActive()const
-{
- return m_active;
-}
-
-
-
-int SND_SoundObject::GetId()const
-{
- return m_id;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetLifeSpan()const
-{
- return m_lifespan;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetTimestamp()const
-{
- return m_timestamp;
-}
-
-
-
-unsigned int SND_SoundObject::GetBuffer()
-{
- return m_buffer;
-}
-
-
-
-const STR_String& SND_SoundObject::GetSampleName()
-{
- return m_samplename;
-}
-
-
-
-const STR_String& SND_SoundObject::GetObjectName()
-{
- return m_objectname;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetLength() const
-{
- return m_length;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetGain() const
-{
- return m_gain;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetPitch() const
-{
- return m_pitch;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetMinGain() const
-{
- return m_mingain;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetMaxGain() const
-{
- return m_maxgain;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetRollOffFactor() const
-{
- return m_rollofffactor;
-}
-
-
-
-MT_Scalar SND_SoundObject::GetReferenceDistance() const
-{
- return m_referencedistance;
-}
-
-
-
-MT_Vector3 SND_SoundObject::GetPosition() const
-{
- return m_position;
-}
-
-
-
-MT_Vector3 SND_SoundObject::GetVelocity() const
-{
- return m_velocity;
-}
-
-
-
-MT_Matrix3x3 SND_SoundObject::GetOrientation() const
-{
- return m_orientation;
-}
-
-
-
-unsigned int SND_SoundObject::GetLoopMode() const
-{
- return m_loopmode;
-}
-
-
-
-unsigned int SND_SoundObject::GetLoopStart() const
-{
- return m_loopstart;
-}
-
-
-
-unsigned int SND_SoundObject::GetLoopEnd() const
-{
- return m_loopend;
-}
-
-
-
-bool SND_SoundObject::Is3D() const
-{
- return m_is3d;
-}
-
-
-
-int SND_SoundObject::GetPlaystate() const
-{
- return m_playstate;
-}
-
-
-
-bool SND_SoundObject::IsModified() const
-{
- return m_modified;
-}
-
-
-
-void SND_SoundObject::SetModified(bool modified)
-{
- m_modified = modified;
-}
-
-
-
-void SND_SoundObject::InitRunning()
-{
- m_running = 0;
-}
-
-
-
-bool SND_SoundObject::IsRunning() const
-{
- bool result = false;
-
- if (m_running > 100)
- result = true;
-
- return result;
-}
-
-
-
-void SND_SoundObject::AddRunning()
-{
- ++m_running;
-}
diff --git a/intern/SoundSystem/intern/SND_Utils.cpp b/intern/SoundSystem/intern/SND_Utils.cpp
deleted file mode 100644
index dbc3135b35c..00000000000
--- a/intern/SoundSystem/intern/SND_Utils.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * SND_Utils.cpp
- *
- * Util functions for soundthingies
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SND_Utils.h"
-#include "SoundDefines.h"
-#include "SND_DependKludge.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <math.h>
-#include <string.h>
-
-#if defined(_WIN32)
-#include <io.h>
-#define open _open
-#define read _read
-#define close _close
-#define write _write
-#define lseek _lseek
-#else
-#include <unistd.h>
-#endif
-
-#define BUFFERSIZE 32
-
-
-/*****************************************************************************
- * Begin of temporary Endian stuff.
- * I think there should be a central place to handle endian conversion but for
- * the time being it suffices. Note that the defines come from the Blender
- * source.
- *****************************************************************************/
-typedef enum
-{
- SND_endianBig = 0,
- SND_endianLittle
-} SND_TEndian;
-
-#if defined(__BIG_ENDIAN__) || defined(__sparc) || defined(__sparc__)
-const SND_TEndian SND_fEndian = SND_endianBig;
-#else
-const SND_TEndian SND_fEndian = SND_endianLittle;
-#endif
-
-/* This one swaps the bytes in a short */
-#define SWITCH_SHORT(a) { \
- char s_i, *p_i; \
- p_i= (char *)&(a); \
- s_i=p_i[0]; \
- p_i[0] = p_i[1]; \
- p_i[1] = s_i; }
-
-/* This one rotates the bytes in an int */
-#define SWITCH_INT(a) { \
- char s_i, *p_i; \
- p_i= (char *)&(a); \
- s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
- s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
-/*****************************************************************************
- * End of temporary Endian stuff.
- *****************************************************************************/
-
-
-/* loads a file */
-void* SND_LoadSample(char *filename)
-{
- int file, filelen, buffersize = BUFFERSIZE;
- void* data = NULL;
-
-#if defined(WIN32)
- file = open(filename, O_BINARY|O_RDONLY);
-#else
- file = open(filename, 0|O_RDONLY);
-#endif
-
- if (file == -1)
- {
- //printf("can't open file.\n");
- //printf("press q for quit.\n");
- }
- else
- {
- filelen = lseek(file, 0, SEEK_END);
- lseek(file, 0, SEEK_SET);
-
- if (filelen != 0)
- {
- data = malloc(buffersize);
-
- if (read(file, data, buffersize) != buffersize)
- {
- free(data);
- data = NULL;
- }
- }
- close(file);
-
- }
- return (data);
-}
-
-
-
-bool SND_IsSampleValid(const STR_String& name, void* memlocation)
-{
- bool result = false;
- bool loadedsample = false;
- char buffer[BUFFERSIZE];
-
- if (!memlocation)
- {
- STR_String samplename = name;
- memlocation = SND_LoadSample(samplename.Ptr());
-
- if (memlocation)
- loadedsample = true;
- }
-
- if (memlocation)
- {
- memcpy(&buffer, memlocation, BUFFERSIZE);
-
- if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
- {
- /* This was endian unsafe. See top of the file for the define. */
- short shortbuf = *((short *) &buffer[20]);
- if (SND_fEndian == SND_endianBig) SWITCH_SHORT(shortbuf);
-
- if (shortbuf == SND_WAVE_FORMAT_PCM)
- result = true;
- }
- }
- if (loadedsample)
- {
- free(memlocation);
- memlocation = NULL;
- }
-
- return result;
-}
-
-
-
-/* checks if the passed pointer is a valid sample */
-static bool CheckSample(void* sample)
-{
- bool valid = false;
- char buffer[32];
-
- memcpy(buffer, sample, 16);
-
- if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8)))
- {
- valid = true;
- }
-
- return valid;
-}
-
-
-
-/* gets the type of the sample (0 == unknown, 1 == PCM etc */
-unsigned int SND_GetSampleFormat(void* sample)
-{
- short sampletype = 0;
-
- if (CheckSample(sample))
- {
- memcpy(&sampletype, ((char*)sample) + 20, 2);
- }
- /* This was endian unsafe. See top of the file for the define. */
- if (SND_fEndian == SND_endianBig) SWITCH_SHORT(sampletype);
-
- return (unsigned int)sampletype;
-}
-
-
-
-/* gets the number of channels in a sample */
-unsigned int SND_GetNumberOfChannels(void* sample)
-{
- short numberofchannels = 0;
-
- if (CheckSample(sample))
- {
- memcpy(&numberofchannels, ((char*)sample) + 22, 2);
- }
- /* This was endian unsafe. See top of the file for the define. */
- if (SND_fEndian == SND_endianBig) SWITCH_SHORT(numberofchannels);
-
- return (unsigned int)numberofchannels;
-}
-
-
-
-/* gets the samplerate of a sample */
-unsigned int SND_GetSampleRate(void* sample)
-{
- unsigned int samplerate = 0;
-
- if (CheckSample(sample))
- {
- memcpy(&samplerate, ((char*)sample) + 24, 4);
- }
- /* This was endian unsafe. See top of the file for the define. */
- if (SND_fEndian == SND_endianBig) SWITCH_INT(samplerate);
-
- return samplerate;
-}
-
-
-
-/* gets the bitrate of a sample */
-unsigned int SND_GetBitRate(void* sample)
-{
- short bitrate = 0;
-
- if (CheckSample(sample))
- {
- memcpy(&bitrate, ((char*)sample) + 34, 2);
- }
- /* This was endian unsafe. See top of the file for the define. */
- if (SND_fEndian == SND_endianBig) SWITCH_SHORT(bitrate);
-
- return (unsigned int)bitrate;
-}
-
-
-
-/* gets the length of the actual sample data (without the header) */
-unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length)
-{
- unsigned int chunklength, length = 0, offset;
- unsigned short block_align;
- if (CheckSample(sample))
- {
- memcpy(&chunklength, ((char*)sample) + 16, 4);
- memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */
-
- /* This was endian unsafe. See top of the file for the define. */
- if (SND_fEndian == SND_endianBig)
- {
- SWITCH_INT(chunklength);
- SWITCH_SHORT(block_align);
- }
-
- offset = 16 + chunklength + 4;
-
- /* This seems very unsafe, what if data is never found (f.i. corrupt file)... */
- // lets find "data"
- while (memcmp(((char*)sample) + offset, "data", 4))
- {
- offset += block_align;
-
- if (offset+block_align > sample_length) /* save us from crashing */
- return 0;
- }
- offset += 4;
- memcpy(&length, ((char*)sample) + offset, 4);
-
- /* This was endian unsafe. See top of the file for the define. */
- if (SND_fEndian == SND_endianBig) SWITCH_INT(length);
- }
-
- return length;
-}
-
-
-
-/* gets the size of the entire header (file - sampledata) */
-unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length)
-{
- unsigned int chunklength, headersize = 0, offset = 16;
- unsigned short block_align;
- if (CheckSample(sample))
- {
- memcpy(&chunklength, ((char*)sample) + offset, 4);
- memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */
-
- /* This was endian unsafe. See top of the file for the define. */
- if (SND_fEndian == SND_endianBig)
- {
- SWITCH_INT(chunklength);
- SWITCH_SHORT(block_align);
- }
- offset = offset + chunklength + 4;
-
- // lets find "data"
- while (memcmp(((char*)sample) + offset, "data", 4))
- {
- offset += block_align;
-
- if (offset+block_align > sample_length) /* save us from crashing */
- return 0;
- }
- headersize = offset + 8;
- }
-
- return headersize;
-}
-
-
-unsigned int SND_GetExtraChunk(void* sample)
-{
- unsigned int extrachunk = 0, chunklength, offset = 16;
- char data[4];
-
- if (CheckSample(sample))
- {
- memcpy(&chunklength, ((char*)sample) + offset, 4);
- offset = offset + chunklength + 4;
- memcpy(data, ((char*)sample) + offset, 4);
-
- // lets find "cue"
- while (memcmp(data, "cue", 3))
- {
- offset += 4;
- memcpy(data, ((char*)sample) + offset, 4);
- }
- }
-
- return extrachunk;
-}
-
-
-
-void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot)
-{
- WavFileHeader fileheader;
- WavFmtHeader fmtheader;
- WavFmtExHeader fmtexheader;
- WavSampleHeader sampleheader;
- WavChunkHeader chunkheader;
-
- if (CheckSample(sample))
- {
- memcpy(&fileheader, sample, sizeof(WavFileHeader));
- fileheader.size = SND_GetHeaderSize(sample, waveslot->GetFileSize());
- if (fileheader.size) { /* this may fail for corrupt files */
- sample += sizeof(WavFileHeader);
- fileheader.size = ((fileheader.size+1) & ~1) - 4;
-
- while ((fileheader.size > 0) && (memcpy(&chunkheader, sample, sizeof(WavChunkHeader))))
- {
- sample += sizeof(WavChunkHeader);
- if (!memcmp(chunkheader.id, "fmt ", 4))
- {
- memcpy(&fmtheader, sample, sizeof(WavFmtHeader));
- waveslot->SetSampleFormat(fmtheader.format);
-
- if (fmtheader.format == 0x0001)
- {
- waveslot->SetNumberOfChannels(fmtheader.numberofchannels);
- waveslot->SetBitRate(fmtheader.bitrate);
- waveslot->SetSampleRate(fmtheader.samplerate);
- sample += chunkheader.size;
- }
- else
- {
- memcpy(&fmtexheader, sample, sizeof(WavFmtExHeader));
- sample += chunkheader.size;
- }
- }
- else if (!memcmp(chunkheader.id, "data", 4))
- {
- if (fmtheader.format == 0x0001)
- {
- waveslot->SetNumberOfSamples(chunkheader.size);
- sample += chunkheader.size;
- }
- else if (fmtheader.format == 0x0011)
- {
- //IMA ADPCM
- }
- else if (fmtheader.format == 0x0055)
- {
- //MP3 WAVE
- }
- }
- else if (!memcmp(chunkheader.id, "smpl", 4))
- {
- memcpy(&sampleheader, sample, sizeof(WavSampleHeader));
- //loop = sampleheader.loops;
- sample += chunkheader.size;
- }
- else
- sample += chunkheader.size;
-
- sample += chunkheader.size & 1;
- fileheader.size -= (((chunkheader.size + 1) & ~1) + 8);
- }
- }
- }
-}
diff --git a/intern/SoundSystem/intern/SND_WaveCache.cpp b/intern/SoundSystem/intern/SND_WaveCache.cpp
deleted file mode 100644
index a678bd554bb..00000000000
--- a/intern/SoundSystem/intern/SND_WaveCache.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * SND_WaveCache.cpp
- *
- * abstract wavecache, a way to organize samples
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef WIN32
-#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-#include "SND_WaveCache.h"
-#include <stdio.h>
-
-#ifdef __APPLE__
-# include <sys/malloc.h>
-#else
-# ifdef __FreeBSD__
-# include <stdlib.h>
-# else
-# include <malloc.h>
-# endif
-#endif
-
-SND_WaveCache::SND_WaveCache()
-{
- // do the buffer administration
- for (int i = 0; i < NUM_BUFFERS; i++)
- m_bufferList[i] = NULL;
-}
-
-
-
-SND_WaveCache::~SND_WaveCache()
-{
- // clean up the mess
- FreeSamples();
- RemoveAllSamples();
-}
-
-
-
-SND_WaveSlot* SND_WaveCache::GetWaveSlot(const STR_String& samplename)
-{
- SND_WaveSlot* waveslot = NULL;
-
- std::map<STR_String, SND_WaveSlot*>::iterator find_result = m_samplecache.find(samplename);
-
- // let's see if we have already loaded this sample
- if (find_result != m_samplecache.end())
- {
- waveslot = (*find_result).second;
- }
- else
- {
- // so the sample wasn't loaded, so do it here
- for (int bufnum = 0; bufnum < NUM_BUFFERS; bufnum++)
- {
- // find an empty buffer
- if (m_bufferList[bufnum] == NULL)
- {
- waveslot = new SND_WaveSlot();
- waveslot->SetSampleName(samplename);
- waveslot->SetBuffer(bufnum);
- m_bufferList[bufnum] = waveslot;
- break;
- }
- }
- m_samplecache.insert(std::pair<STR_String, SND_WaveSlot*>(samplename, waveslot));
- }
-
- return waveslot;
-}
-
-
-
-void SND_WaveCache::RemoveAllSamples()
-{
- // remove all samples
- m_samplecache.clear();
-
- // reset the list of buffers
- for (int i = 0; i < NUM_BUFFERS; i++)
- m_bufferList[i] = NULL;
-}
-
-
-
-void SND_WaveCache::RemoveSample(const STR_String& samplename, int buffer)
-{
- m_samplecache.erase(samplename);
- m_bufferList[buffer] = NULL;
-}
-
-
-
-void SND_WaveCache::FreeSamples()
-{
- // iterate through the bufferlist and delete the waveslot if present
- for (int i = 0; i < NUM_BUFFERS; i++)
- {
- if (m_bufferList[i])
- {
- delete m_bufferList[i];
- m_bufferList[i] = NULL;
- }
- }
-}
diff --git a/intern/SoundSystem/intern/SND_WaveSlot.cpp b/intern/SoundSystem/intern/SND_WaveSlot.cpp
deleted file mode 100644
index 43b2bb55892..00000000000
--- a/intern/SoundSystem/intern/SND_WaveSlot.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SND_WaveSlot.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-SND_WaveSlot::~SND_WaveSlot()
-{
-#ifdef ONTKEVER
- printf("neeeeeee...\n");
-#endif
-}
-
-
-
-void SND_WaveSlot::SetSampleName(STR_String samplename)
-{
- m_samplename = samplename;
-}
-
-
-
-void SND_WaveSlot::SetLoaded(bool loaded)
-{
- m_loaded = loaded;
-}
-
-
-
-void SND_WaveSlot::SetData(void* data)
-{
- m_data = data;
-}
-
-
-
-void SND_WaveSlot::SetBuffer(unsigned int buffer)
-{
- m_buffer = buffer;
-}
-
-
-
-void SND_WaveSlot::SetSampleFormat(unsigned int sampleformat)
-{
- m_sampleformat = sampleformat;
-}
-
-
-
-void SND_WaveSlot::SetNumberOfChannels(unsigned int numberofchannels)
-{
- m_numberofchannels = numberofchannels;
-}
-
-
-
-void SND_WaveSlot::SetSampleRate(unsigned int samplerate)
-{
- m_samplerate = samplerate;
-}
-
-
-
-void SND_WaveSlot::SetBitRate(unsigned int bitrate)
-{
- m_bitrate = bitrate;
-}
-
-
-
-void SND_WaveSlot::SetNumberOfSamples(unsigned int numberofsamples)
-{
- m_numberofsamples = numberofsamples;
-}
-
-
-
-void SND_WaveSlot::SetFileSize(unsigned int filesize)
-{
- m_filesize = filesize;
-}
-
-
-
-const STR_String& SND_WaveSlot::GetSampleName()
-{
- return m_samplename;
-}
-
-
-
-bool SND_WaveSlot::IsLoaded() const
-{
- return m_loaded;
-}
-
-
-
-void* SND_WaveSlot::GetData()
-{
- return m_data;
-}
-
-
-
-unsigned int SND_WaveSlot::GetBuffer() const
-{
- return m_buffer;
-}
-
-
-
-unsigned int SND_WaveSlot::GetSampleFormat() const
-{
- return m_sampleformat;
-}
-
-
-
-unsigned int SND_WaveSlot::GetNumberOfChannels() const
-{
- return m_numberofchannels;
-}
-
-
-
-unsigned int SND_WaveSlot::GetSampleRate() const
-{
- return m_samplerate;
-}
-
-
-
-unsigned int SND_WaveSlot::GetBitRate() const
-{
- return m_bitrate;
-}
-
-
-
-unsigned int SND_WaveSlot::GetNumberOfSamples() const
-{
- return m_numberofsamples;
-}
-
-
-
-unsigned int SND_WaveSlot::GetFileSize() const
-{
- return m_filesize;
-}
diff --git a/intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp b/intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp
deleted file mode 100644
index 1bd973dfb6c..00000000000
--- a/intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp
+++ /dev/null
@@ -1,206 +0,0 @@
-# Microsoft Developer Studio Project File - Name="SoundSystem" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=SoundSystem - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "SoundSystem.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "SoundSystem.mak" CFG="SoundSystem - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "SoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "SoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "SoundSystem - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\..\..\obj\windows\intern\soundsystem"
-# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem"
-# PROP Target_Dir ""
-LINK32=link.exe -lib
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\..\obj\windows\intern\soundsystem\libSoundSystem.lib"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\*.a ECHO Done
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "SoundSystem - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "SoundSystem___Win32_Debug"
-# PROP BASE Intermediate_Dir "SoundSystem___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug"
-# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug"
-# PROP Target_Dir ""
-LINK32=link.exe -lib
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\..\obj\windows\intern\soundsystem\debug\libSoundSystem.lib"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\debug\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\debug\*.a ECHO Done
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "SoundSystem - Win32 Release"
-# Name "SoundSystem - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\intern\SND_AudioDevice.cpp
-# End Source File
-# Begin Source File
-
-SOURCE="..\..\intern\SND_C-api.cpp"
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_CDObject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_DeviceManager.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_IdObject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_Scene.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_SoundListener.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_SoundObject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_Utils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_WaveCache.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_WaveSlot.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\intern\SND_AudioDevice.h
-# End Source File
-# Begin Source File
-
-SOURCE="..\..\SND_C-api.h"
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_CDObject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_DependKludge.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_DeviceManager.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_IAudioDevice.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\intern\SND_IdObject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_Object.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_Scene.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_SoundListener.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_SoundObject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_Utils.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_WaveCache.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SND_WaveSlot.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\SoundDefines.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp b/intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp
deleted file mode 100644
index 2bf372d0382..00000000000
--- a/intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp
+++ /dev/null
@@ -1,103 +0,0 @@
-# Microsoft Developer Studio Project File - Name="DummySoundSystem" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=DummySoundSystem - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "DummySoundSystem.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "DummySoundSystem.mak" CFG="DummySoundSystem - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "DummySoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "DummySoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "DummySoundSystem - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy"
-# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy"
-# PROP Target_Dir ""
-LINK32=link.exe -lib
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\libDummySoundSystem.lib"
-
-!ELSEIF "$(CFG)" == "DummySoundSystem - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug"
-# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug"
-# PROP Target_Dir ""
-LINK32=link.exe -lib
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c
-# SUBTRACT CPP /Fr
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug\libDummySoundSystem.lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "DummySoundSystem - Win32 Release"
-# Name "DummySoundSystem - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\dummy\SND_DummyDevice.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\..\dummy\SND_DummyDevice.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp b/intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp
deleted file mode 100644
index ef0c10e8eff..00000000000
--- a/intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp
+++ /dev/null
@@ -1,106 +0,0 @@
-# Microsoft Developer Studio Project File - Name="OpenALSoundSystem" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=OpenALSoundSystem - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "OpenALSoundSystem.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "OpenALSoundSystem.mak" CFG="OpenALSoundSystem - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "OpenALSoundSystem - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "OpenALSoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "OpenALSoundSystem - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal"
-# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal"
-# PROP Target_Dir ""
-LINK32=link.exe -lib
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\openal\include" /I "..\..\..\..\..\..\lib\windows\sdl\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\libOpenALSoundSystem.lib"
-
-!ELSEIF "$(CFG)" == "OpenALSoundSystem - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "OpenALSoundSystem___Win32_Debug"
-# PROP BASE Intermediate_Dir "OpenALSoundSystem___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug"
-# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug"
-# PROP Target_Dir ""
-LINK32=link.exe -lib
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\sdl\include" /I "..\..\..\..\..\..\lib\windows\openal\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug\libOpenALSoundSystem.lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "OpenALSoundSystem - Win32 Release"
-# Name "OpenALSoundSystem - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\..\..\openal\SND_OpenALDevice.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\sdl\SND_SDLCDDevice.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\..\openal\SND_OpenALDevice.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj b/intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj
deleted file mode 100644
index f0952c582b7..00000000000
--- a/intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj
+++ /dev/null
@@ -1,339 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="SoundSystem"
- ProjectGUID="{98330220-47A6-42E0-9DE4-AD0FF5D204D6}"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Blender Debug|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug"
- IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
- ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\debug\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\debug\libSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library (debug target) to lib tree."
- CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-ECHO Done
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Blender Release|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem"
- IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
- ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\libSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library to lib tree."
- CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-ECHO Done
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="3DPlugin Release|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll"
- IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
- ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library to lib tree."
- CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-ECHO Done
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="3DPlugin Debug|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug"
- IntermediateDirectory="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
- ObjectFile="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\intern\soundsystem\mtdll\debug\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library (debug target) to lib tree."
- CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_7\intern\SoundSystem\include
-ECHO Done
-"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\intern\SND_AudioDevice.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_C-api.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_CDObject.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_DeviceManager.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_IdObject.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_Scene.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_SoundListener.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_SoundObject.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_Utils.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_WaveCache.cpp">
- </File>
- <File
- RelativePath="..\..\intern\SND_WaveSlot.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath="..\..\intern\SND_AudioDevice.h">
- </File>
- <File
- RelativePath="..\..\SND_C-api.h">
- </File>
- <File
- RelativePath="..\..\SND_CDObject.h">
- </File>
- <File
- RelativePath="..\..\SND_DependKludge.h">
- </File>
- <File
- RelativePath="..\..\SND_DeviceManager.h">
- </File>
- <File
- RelativePath="..\..\SND_IAudioDevice.h">
- </File>
- <File
- RelativePath="..\..\intern\SND_IdObject.h">
- </File>
- <File
- RelativePath="..\..\SND_Object.h">
- </File>
- <File
- RelativePath="..\..\SND_Scene.h">
- </File>
- <File
- RelativePath="..\..\SND_SoundListener.h">
- </File>
- <File
- RelativePath="..\..\SND_SoundObject.h">
- </File>
- <File
- RelativePath="..\..\SND_Utils.h">
- </File>
- <File
- RelativePath="..\..\SND_WaveCache.h">
- </File>
- <File
- RelativePath="..\..\SND_WaveSlot.h">
- </File>
- <File
- RelativePath="..\..\SoundDefines.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj b/intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj
deleted file mode 100644
index 103b589e732..00000000000
--- a/intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj
+++ /dev/null
@@ -1,243 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="DummySoundSystem"
- ProjectGUID="{FAF46346-65CC-4DB2-85C4-B99826F79D0C}"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Blender Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\libDummySoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Blender Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\debug\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\debug\libDummySoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="3DPlugin Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libDummySoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="3DPlugin Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\intern;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include"
- PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\DummySoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\dummy\mtdll\debug\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libDummySoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\dummy\SND_DummyDevice.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath="..\..\..\dummy\SND_DummyDevice.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj b/intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj
deleted file mode 100644
index 8ce971ac1aa..00000000000
--- a/intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj
+++ /dev/null
@@ -1,249 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="OpenALSoundSystem"
- ProjectGUID="{213356A9-3A1F-41DA-9819-1297BCD17DEE}"
- SccProjectName=""
- SccLocalPath="">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Blender Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\debug\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\debug\libOpenALSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Blender Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\libOpenALSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="3DPlugin Release|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\libOpenALSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="3DPlugin Debug|Win32"
- OutputDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug"
- IntermediateDirectory="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug"
- ConfigurationType="4"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..\sdl;..\..\..\intern;..\..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- DefaultCharIsUnsigned="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\OpenALSoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
- ObjectFile="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\..\build\msvc_7\intern\soundsystem\openal\mtdll\debug\"
- WarningLevel="2"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="3"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\..\build\msvc_7\libs\intern\mtdll\debug\libOpenALSoundSystem.lib"
- SuppressStartupBanner="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
- <File
- RelativePath="..\..\..\openal\SND_OpenALDevice.cpp">
- </File>
- <File
- RelativePath="..\..\..\sdl\SND_SDLCDDevice.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
- <File
- RelativePath="..\..\..\openal\SND_OpenALDevice.h">
- </File>
- <File
- RelativePath="..\..\..\sdl\SND_SDLCDDevice.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj b/intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj
deleted file mode 100644
index bd75fe88d43..00000000000
--- a/intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj
+++ /dev/null
@@ -1,447 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="INT_SoundSystem"
- ProjectGUID="{98330220-47A6-42E0-9DE4-AD0FF5D204D6}"
- RootNamespace="SoundSystem"
- TargetFrameworkVersion="131072"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Blender Debug|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug"
- IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- DefaultCharIsUnsigned="true"
- UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
- ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\debug\"
- WarningLevel="2"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\debug\libSoundSystem.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library (debug target) to lib tree."
- CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
- />
- </Configuration>
- <Configuration
- Name="Blender Release|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem"
- IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- DefaultCharIsUnsigned="true"
- UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
- ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\"
- WarningLevel="2"
- SuppressStartupBanner="true"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\libSoundSystem.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library to lib tree."
- CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
- />
- </Configuration>
- <Configuration
- Name="3DPlugin Release|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll"
- IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
- StringPooling="true"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- DefaultCharIsUnsigned="true"
- UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
- ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\"
- WarningLevel="2"
- SuppressStartupBanner="true"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libSoundSystem.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library to lib tree."
- CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
- />
- </Configuration>
- <Configuration
- Name="3DPlugin Debug|Win32"
- OutputDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug"
- IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug"
- ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..;..\..\dummy;..\..\openal;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- DefaultCharIsUnsigned="true"
- UsePrecompiledHeader="0"
- PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\SoundSystem.pch"
- AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
- ObjectFile="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
- ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\soundsystem\mtdll\debug\"
- WarningLevel="2"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- CompileAs="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libSoundSystem.lib"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description="Copying SND SoundSystem files library (debug target) to lib tree."
- CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include MKDIR ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;XCOPY /Y ..\..\*.h ..\..\..\..\..\build\msvc_9\intern\SoundSystem\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
- >
- <File
- RelativePath="..\..\intern\SND_AudioDevice.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_C-api.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_CDObject.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_DeviceManager.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_IdObject.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_Scene.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_SoundListener.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_SoundObject.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_Utils.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_WaveCache.cpp"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_WaveSlot.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl"
- >
- <File
- RelativePath="..\..\intern\SND_AudioDevice.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_C-api.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_CDObject.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_DependKludge.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_DeviceManager.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_IAudioDevice.h"
- >
- </File>
- <File
- RelativePath="..\..\intern\SND_IdObject.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_Object.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_Scene.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_SoundListener.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_SoundObject.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_Utils.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_WaveCache.h"
- >
- </File>
- <File
- RelativePath="..\..\SND_WaveSlot.h"
- >
- </File>
- <File
- RelativePath="..\..\SoundDefines.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/intern/SoundSystem/openal/SND_OpenALDevice.cpp b/intern/SoundSystem/openal/SND_OpenALDevice.cpp
deleted file mode 100644
index 424a05246ac..00000000000
--- a/intern/SoundSystem/openal/SND_OpenALDevice.cpp
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * SND_OpenALDevice derived from SND_IAudioDevice
- */
-
-#ifdef WIN32
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-#include "SND_OpenALDevice.h"
-#ifndef __APPLE__
-#include "SND_SDLCDDevice.h"
-#endif
-#include "SoundDefines.h"
-
-#include "SND_Utils.h"
-
-#ifdef APPLE_FRAMEWORK_FIX
-#include <al.h>
-#include <alc.h>
-#else
-#include <AL/al.h>
-#include <AL/alc.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#if defined(WIN32)
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-#include <fcntl.h>
-
-#include <signal.h>
-
-/*************************** ALUT replacement *****************************/
-
-/* instead of relying on alut, we just implement our own
- * WAV loading functions, hopefully more reliable */
-
-#include <stdlib.h>
-
-typedef struct /* WAV File-header */
-{
- ALubyte Id[4];
- ALsizei Size;
- ALubyte Type[4];
-} WAVFileHdr_Struct;
-
-typedef struct /* WAV Fmt-header */
-{
- ALushort Format;
- ALushort Channels;
- ALuint SamplesPerSec;
- ALuint BytesPerSec;
- ALushort BlockAlign;
- ALushort BitsPerSample;
-} WAVFmtHdr_Struct;
-
-typedef struct /* WAV FmtEx-header */
-{
- ALushort Size;
- ALushort SamplesPerBlock;
-} WAVFmtExHdr_Struct;
-
-typedef struct /* WAV Smpl-header */
-{
- ALuint Manufacturer;
- ALuint Product;
- ALuint SamplePeriod;
- ALuint Note;
- ALuint FineTune;
- ALuint SMPTEFormat;
- ALuint SMPTEOffest;
- ALuint Loops;
- ALuint SamplerData;
- struct
- {
- ALuint Identifier;
- ALuint Type;
- ALuint Start;
- ALuint End;
- ALuint Fraction;
- ALuint Count;
- } Loop[1];
-} WAVSmplHdr_Struct;
-
-typedef struct /* WAV Chunk-header */
-{
- ALubyte Id[4];
- ALuint Size;
-} WAVChunkHdr_Struct;
-
-static void *SND_loadFileIntoMemory(const char *filename, int *len_r)
-{
- FILE *fp= fopen(filename, "rb");
- void *data;
-
- if (!fp) {
- *len_r= -1;
- return NULL;
- }
-
- fseek(fp, 0L, SEEK_END);
- *len_r= ftell(fp);
- fseek(fp, 0L, SEEK_SET);
-
- data= malloc(*len_r);
- if (!data) {
- *len_r= -1;
- return NULL;
- }
-
- if (fread(data, *len_r, 1, fp)!=1) {
- *len_r= -1;
- free(data);
- return NULL;
- }
-
- return data;
-}
-
-#define TEST_SWITCH_INT(a) if(big_endian) { \
- char s_i, *p_i; \
- p_i= (char *)&(a); \
- s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
- s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
-
-#define TEST_SWITCH_SHORT(a) if(big_endian) { \
- char s_i, *p_i; \
- p_i= (char *)&(a); \
- s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; }
-
-static int stream_read(void *out, ALbyte **stream, ALsizei size, ALsizei *memsize)
-{
- if(size <= *memsize) {
- memcpy(out, *stream, size);
- return 1;
- }
- else {
- memset(out, 0, size);
- return 0;
- }
-}
-
-static int stream_skip(ALbyte **stream, ALsizei size, ALsizei *memsize)
-{
- if(size <= *memsize) {
- *stream += size;
- *memsize -= size;
- return 1;
- }
- else
- return 0;
-}
-
-ALvoid SND_alutLoadWAVMemory(ALbyte *memory,ALsizei memsize,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop)
-{
- WAVChunkHdr_Struct ChunkHdr;
- WAVFmtExHdr_Struct FmtExHdr;
- WAVFileHdr_Struct FileHdr;
- WAVSmplHdr_Struct SmplHdr;
- WAVFmtHdr_Struct FmtHdr;
- ALbyte *Stream= memory;
- int test_endian= 1;
- int big_endian= !((char*)&test_endian)[0];
-
- *format=AL_FORMAT_MONO16;
- *data=NULL;
- *size=0;
- *freq=22050;
- *loop=AL_FALSE;
-
- if(!Stream)
- return;
-
- stream_read(&FileHdr,&Stream,sizeof(WAVFileHdr_Struct),&memsize);
- stream_skip(&Stream,sizeof(WAVFileHdr_Struct),&memsize);
-
- TEST_SWITCH_INT(FileHdr.Size);
- FileHdr.Size=((FileHdr.Size+1)&~1)-4;
-
- while((FileHdr.Size!=0) && stream_read(&ChunkHdr,&Stream,sizeof(WAVChunkHdr_Struct),&memsize))
- {
- TEST_SWITCH_INT(ChunkHdr.Size);
- stream_skip(&Stream,sizeof(WAVChunkHdr_Struct),&memsize);
-
- if (!memcmp(ChunkHdr.Id,"fmt ",4))
- {
- stream_read(&FmtHdr,&Stream,sizeof(WAVFmtHdr_Struct),&memsize);
-
- TEST_SWITCH_SHORT(FmtHdr.Format);
- TEST_SWITCH_SHORT(FmtHdr.Channels);
- TEST_SWITCH_INT(FmtHdr.SamplesPerSec);
- TEST_SWITCH_INT(FmtHdr.BytesPerSec);
- TEST_SWITCH_SHORT(FmtHdr.BlockAlign);
- TEST_SWITCH_SHORT(FmtHdr.BitsPerSample);
-
- if (FmtHdr.Format==0x0001)
- {
- *format=(FmtHdr.Channels==1?
- (FmtHdr.BitsPerSample==8?AL_FORMAT_MONO8:AL_FORMAT_MONO16):
- (FmtHdr.BitsPerSample==8?AL_FORMAT_STEREO8:AL_FORMAT_STEREO16));
- *freq=FmtHdr.SamplesPerSec;
- }
- else
- {
- stream_read(&FmtExHdr,&Stream,sizeof(WAVFmtExHdr_Struct),&memsize);
- TEST_SWITCH_SHORT(FmtExHdr.Size);
- TEST_SWITCH_SHORT(FmtExHdr.SamplesPerBlock);
- }
- }
- else if (!memcmp(ChunkHdr.Id,"data",4))
- {
- if (FmtHdr.Format==0x0001)
- {
- if((ALsizei)ChunkHdr.Size <= memsize)
- {
- *size=ChunkHdr.Size;
- *data=malloc(ChunkHdr.Size+31);
-
- if (*data) {
- stream_read(*data,&Stream,ChunkHdr.Size,&memsize);
- memset(((char *)*data)+ChunkHdr.Size,0,31);
-
- if(FmtHdr.BitsPerSample == 16 && big_endian) {
- int a, len= *size/2;
- short *samples= (short*)*data;
-
- for(a=0; a<len; a++) {
- TEST_SWITCH_SHORT(samples[a])
- }
- }
- }
- }
- }
- else if (FmtHdr.Format==0x0011)
- {
- //IMA ADPCM
- }
- else if (FmtHdr.Format==0x0055)
- {
- //MP3 WAVE
- }
- }
- else if (!memcmp(ChunkHdr.Id,"smpl",4))
- {
- stream_read(&SmplHdr,&Stream,sizeof(WAVSmplHdr_Struct),&memsize);
-
- TEST_SWITCH_INT(SmplHdr.Manufacturer);
- TEST_SWITCH_INT(SmplHdr.Product);
- TEST_SWITCH_INT(SmplHdr.SamplePeriod);
- TEST_SWITCH_INT(SmplHdr.Note);
- TEST_SWITCH_INT(SmplHdr.FineTune);
- TEST_SWITCH_INT(SmplHdr.SMPTEFormat);
- TEST_SWITCH_INT(SmplHdr.SMPTEOffest);
- TEST_SWITCH_INT(SmplHdr.Loops);
- TEST_SWITCH_INT(SmplHdr.SamplerData);
-
- *loop = (SmplHdr.Loops ? AL_TRUE : AL_FALSE);
- }
-
- if(!stream_skip(&Stream, ChunkHdr.Size + (ChunkHdr.Size&1), &memsize))
- break;
-
- FileHdr.Size-=(((ChunkHdr.Size+1)&~1)+8);
- }
-}
-
-ALvoid SND_alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq)
-{
- if (data)
- free(data);
-}
-
-/************************ Device Implementation ****************************/
-
-SND_OpenALDevice::SND_OpenALDevice()
- : SND_AudioDevice(),
- m_context(NULL),
- m_device(NULL)
-{
- /* Removed the functionality for checking if noaudio was provided on */
- /* the commandline. */
- m_audio = true;
- m_context = NULL;
- m_buffersinitialized = false;
- m_sourcesinitialized = false;
-
- // let's check if we can get openal to initialize...
- if (m_audio)
- {
- m_audio = false;
-
- ALCdevice *dev = alcOpenDevice(NULL);
- if (dev) {
- m_context = alcCreateContext(dev, NULL);
-
- if (m_context) {
-#ifdef AL_VERSION_1_1
- alcMakeContextCurrent((ALCcontext*)m_context);
-#else
- alcMakeContextCurrent(m_context);
-#endif
- m_audio = true;
- m_device = dev;
-#ifdef __linux__
- /*
- * SIGHUP Hack:
- *
- * On Linux, alcDestroyContext generates a SIGHUP (Hangup) when killing the OpenAL
- * mixer thread, which kills Blender.
- *
- * So we set the signal to ignore....
- *
- * TODO: check if this applies to other platforms.
- *
- */
- signal(SIGHUP, SIG_IGN);
-#endif
- }
- }
-
- }
-
- // then try to generate some buffers
- if (m_audio)
- {
- // let openal generate its buffers
- alGenBuffers(NUM_BUFFERS, m_buffers);
- m_buffersinitialized = true;
-
- for (int i = 0; i < NUM_BUFFERS; i++)
- {
- if (!alIsBuffer(m_buffers[i]))
- {
- //printf("\n\n WARNING: OpenAL returned with an error. Continuing without audio.\n\n");
- m_audio = false;
- break;
- }
- }
- }
-
- // next: the sources
- if (m_audio)
- {
-#ifdef __APPLE__
- ALenum alc_error = ALC_NO_ERROR; // openal_2.12
-#elif defined(_WIN32)
- // alcGetError has no arguments on windows
- ALenum alc_error = alcGetError(); // openal_2.14+
-#else
- ALenum alc_error = alcGetError(NULL); // openal_2.14+
-#endif
-
- // let openal generate its sources
- if (alc_error == ALC_NO_ERROR)
- {
- int i;
-
- for (i=0;i<NUM_SOURCES;i++)
- m_sources[i] = 0;
- alGenSources(NUM_SOURCES, m_sources);
- m_sourcesinitialized = true;
- }
- }
-
- // let's get us a wavecache
- if (m_audio)
- {
- m_wavecache = new SND_WaveCache();
- }
-#ifndef __APPLE__
- m_cdrom = new SND_SDLCDDevice();
-#endif
-}
-
-void SND_OpenALDevice::UseCD(void) const
-{
- // we use SDL for CD, so we create the system
- SND_CDObject::CreateSystem();
-
-}
-
-void SND_OpenALDevice::MakeCurrent() const
-{
-#ifdef WIN32
- alcMakeContextCurrent(m_context);
-#endif
-}
-
-
-
-SND_OpenALDevice::~SND_OpenALDevice()
-{
- MakeCurrent();
-
- if (m_sourcesinitialized)
- {
- for (int i = 0; i < NUM_SOURCES; i++)
- alSourceStop(m_sources[i]);
-
- alDeleteSources(NUM_SOURCES, m_sources);
- m_sourcesinitialized = false;
- }
-
- if (m_buffersinitialized)
- {
- alDeleteBuffers(NUM_BUFFERS, m_buffers);
- m_buffersinitialized = false;
- }
-
- if (m_context) {
- MakeCurrent();
-#ifdef AL_VERSION_1_1
- alcDestroyContext((ALCcontext*)m_context);
-#else
- alcDestroyContext(m_context);
-#endif
- m_context = NULL;
- }
-
-#ifdef __linux__
- // restore the signal state above.
- signal(SIGHUP, SIG_DFL);
-#endif
- // let's see if we used the cd. if not, just leave it alone
- SND_CDObject* pCD = SND_CDObject::Instance();
-
- if (pCD)
- {
- this->StopCD();
- SND_CDObject::DisposeSystem();
- }
-#ifndef __APPLE__
- if (m_cdrom)
- delete m_cdrom;
-#endif
- if (m_device)
- alcCloseDevice((ALCdevice*) m_device);
-}
-
-
-SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
- void* memlocation,
- int size)
-{
- SND_WaveSlot* waveslot = NULL;
- STR_String samplename = name;
-
- if (m_audio)
- {
- /* create the waveslot */
- waveslot = m_wavecache->GetWaveSlot(samplename);
-
- /* do we support this sample? */
- if (SND_IsSampleValid(name, memlocation))
- {
- if (waveslot)
- {
- bool freemem = false;
- int buffer = waveslot->GetBuffer();
- void* data = NULL;
- char loop = 'a';
- int sampleformat, bitrate, numberofchannels;
- ALenum al_error = alGetError();
- ALsizei samplerate, numberofsamples; // openal_2.14+
-
- /* Give them some safe defaults just incase */
- bitrate = numberofchannels = 0;
-
- if (!(size && memlocation)) {
- memlocation = SND_loadFileIntoMemory(samplename.Ptr(), &size);
- freemem = true;
- }
-
- /* load the sample from memory? */
- if (size && memlocation)
- {
- waveslot->SetFileSize(size);
-
- /* what was (our) buffer? */
- int buffer = waveslot->GetBuffer();
-
- /* get some info out of the sample */
- SND_GetSampleInfo((signed char*)memlocation, waveslot);
- numberofchannels = SND_GetNumberOfChannels(memlocation);
- bitrate = SND_GetBitRate(memlocation);
-
- /* load the sample into openal */
- SND_alutLoadWAVMemory((ALbyte*)memlocation, size, &sampleformat, &data, &numberofsamples, &samplerate, &loop);
- /* put it in the buffer */
- alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
- }
-
- if(freemem)
- free(memlocation);
-
- /* fill the waveslot with info */
- al_error = alGetError();
- if (al_error == AL_NO_ERROR && m_buffers[buffer])
- {
- waveslot->SetData(data);
- waveslot->SetSampleFormat(sampleformat);
- waveslot->SetNumberOfChannels(numberofchannels);
- waveslot->SetSampleRate(samplerate);
- waveslot->SetBitRate(bitrate);
- waveslot->SetNumberOfSamples(numberofsamples);
-
- /* if the loading succeeded, mark the waveslot */
- waveslot->SetLoaded(true);
- }
- else
- {
- /* or when it failed, free the waveslot */
- m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
- waveslot = NULL;
- }
-
- /* and free the original stuff (copy was made in openal) */
- SND_alutUnloadWAV(sampleformat, data, numberofsamples, samplerate);
- }
- }
- else
- {
- /* sample not supported, remove waveslot */
- m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer());
- waveslot = NULL;
- }
- }
- return waveslot;
-}
-
-
-
-// listener's and general stuff //////////////////////////////////////////////////////
-
-
-
-/* sets the global dopplervelocity */
-void SND_OpenALDevice::SetDopplerVelocity(MT_Scalar dopplervelocity) const
-{
- alDopplerVelocity ((float)dopplervelocity);
-}
-
-
-
-/* sets the global dopplerfactor */
-void SND_OpenALDevice::SetDopplerFactor(MT_Scalar dopplerfactor) const
-{
- alDopplerFactor ((float)dopplerfactor);
-}
-
-
-
-/* sets the global rolloff factor */
-void SND_OpenALDevice::SetListenerRollOffFactor(MT_Scalar rollofffactor) const
-{
- // not implemented in openal
-}
-
-
-
-void SND_OpenALDevice::NextFrame() const
-{
- // CD
-#ifndef __APPLE__
- m_cdrom->NextFrame();
-#endif
- // not needed by openal
-}
-
-
-
-// set the gain for the listener
-void SND_OpenALDevice::SetListenerGain(float gain) const
-{
- alListenerf (AL_GAIN, gain);
-}
-
-
-
-void SND_OpenALDevice::InitListener()
-{
- // initialize the listener with these values that won't change
- // (as long as we can have only one listener)
- // now we can superimpose all listeners on each other (for they
- // have the same settings)
- float lispos[3] = {0,0,0};
- float lisvel[3] = {0,0,0};
-#ifdef WIN32
- float lisori[6] = {0,1,0,0,0,1};
-#else
- float lisori[6] = {0,0,1,0,-1,0};
-#endif
-
- alListenerfv(AL_POSITION, lispos);
- alListenerfv(AL_VELOCITY, lisvel);
- alListenerfv(AL_ORIENTATION, lisori);
-}
-
-
-
-// source playstate stuff ////////////////////////////////////////////////////////////
-
-
-
-/* sets the buffer */
-void SND_OpenALDevice::SetObjectBuffer(int id, unsigned int buffer)
-{
- alSourcei (m_sources[id], AL_BUFFER, m_buffers[buffer]);
-}
-
-
-
-// check if the sound's still playing
-int SND_OpenALDevice::GetPlayState(int id)
-{
- int alstate = 0;
- int result = 0;
-
-#ifdef __APPLE__
- alGetSourcei(m_sources[id], AL_SOURCE_STATE, &alstate);
-#else
- alGetSourceiv(m_sources[id], AL_SOURCE_STATE, &alstate);
-#endif
-
- switch(alstate)
- {
- case AL_INITIAL:
- {
- result = SND_INITIAL;
- break;
- }
- case AL_PLAYING:
- {
- result = SND_PLAYING;
- break;
- }
- case AL_PAUSED:
- {
- result = SND_PAUSED;
- break;
- }
- case AL_STOPPED:
- {
- result = SND_STOPPED;
- break;
- }
- default:
- result = SND_UNKNOWN;
- }
-
- return result;
-}
-
-
-
-// make the source play
-void SND_OpenALDevice::PlayObject(int id)
-{
- alSourcePlay(m_sources[id]);
-}
-
-
-
-// make the source stop
-void SND_OpenALDevice::StopObject(int id) const
-{
- float obpos[3] = {0,0,0};
- float obvel[3] = {0,0,0};
-
- alSourcefv(m_sources[id], AL_POSITION, obpos);
- alSourcefv(m_sources[id], AL_VELOCITY, obvel);
-
- alSourcef(m_sources[id], AL_GAIN, 1.0);
- alSourcef(m_sources[id], AL_PITCH, 1.0);
- alSourcei(m_sources[id], AL_LOOPING, AL_FALSE);
- alSourceStop(m_sources[id]);
-}
-
-
-
-// stop all sources
-void SND_OpenALDevice::StopAllObjects()
-{
- alSourceStopv(NUM_SOURCES, m_sources);
-}
-
-
-
-// pause the source
-void SND_OpenALDevice::PauseObject(int id) const
-{
- alSourcePause(m_sources[id]);
-}
-
-
-
-// source properties stuff ////////////////////////////////////////////////////////////
-
-
-
-// give openal the object's pitch
-void SND_OpenALDevice::SetObjectPitch(int id, MT_Scalar pitch) const
-{
- alSourcef (m_sources[id], AL_PITCH, (float)pitch);
-}
-
-
-
-// give openal the object's gain
-void SND_OpenALDevice::SetObjectGain(int id, MT_Scalar gain) const
-{
- alSourcef (m_sources[id], AL_GAIN, (float)gain);
-}
-
-
-
-// give openal the object's looping
-void SND_OpenALDevice::SetObjectLoop(int id, unsigned int loopmode) const
-{
- if (loopmode == SND_LOOP_OFF)
- {
- //printf("%d - ", id);
- alSourcei (m_sources[id], AL_LOOPING, AL_FALSE);
- }
- else
- alSourcei (m_sources[id], AL_LOOPING, AL_TRUE);
-}
-
-void SND_OpenALDevice::SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const
-{
-
-
-}
-
-
-void SND_OpenALDevice::SetObjectMinGain(int id, MT_Scalar mingain) const
-{
- alSourcef (m_sources[id], AL_MIN_GAIN, (float)mingain);
-}
-
-
-
-void SND_OpenALDevice::SetObjectMaxGain(int id, MT_Scalar maxgain) const
-{
- alSourcef (m_sources[id], AL_MAX_GAIN, (float)maxgain);
-}
-
-
-
-void SND_OpenALDevice::SetObjectRollOffFactor(int id, MT_Scalar rollofffactor) const
-{
- alSourcef (m_sources[id], AL_ROLLOFF_FACTOR, (float)rollofffactor);
-}
-
-
-
-void SND_OpenALDevice::SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const
-{
- alSourcef (m_sources[id], AL_REFERENCE_DISTANCE, (float)referencedistance);
-}
-
-
-
-// give openal the object's position
-void SND_OpenALDevice::ObjectIs2D(int id) const
-{
- float obpos[3] = {0,0,0};
- float obvel[3] = {0,0,0};
-
- alSourcefv(m_sources[id], AL_POSITION, obpos);
- alSourcefv(m_sources[id], AL_VELOCITY, obvel);
-}
-
-
-
-void SND_OpenALDevice::SetObjectTransform(int id,
- const MT_Vector3& position,
- const MT_Vector3& velocity,
- const MT_Matrix3x3& orientation,
- const MT_Vector3& lisposition,
- const MT_Scalar& rollofffactor) const
-{
- float obpos[3];
- float obvel[3];
-
- obpos[0] = (float)position[0] * (float)rollofffactor; //x (l/r)
- obpos[1] = (float)position[1] * (float)rollofffactor;
- obpos[2] = (float)position[2] * (float)rollofffactor;
-
- alSourcefv(m_sources[id], AL_POSITION, obpos);
-
- velocity.getValue(obvel);
- alSourcefv(m_sources[id], AL_VELOCITY, obvel);
-}
-
-void SND_OpenALDevice::PlayCD(int track) const
-{
-#ifndef __APPLE__
- m_cdrom->PlayCD(track);
-#endif
-}
-
-
-void SND_OpenALDevice::PauseCD(bool pause) const
-{
-#ifndef __APPLE__
- m_cdrom->PauseCD(pause);
-#endif
-}
-
-void SND_OpenALDevice::StopCD() const
-{
-#ifndef __APPLE__
- SND_CDObject* pCD = SND_CDObject::Instance();
-
- if (pCD && pCD->GetUsed())
- {
- m_cdrom->StopCD();
- }
-#endif
-}
-
-void SND_OpenALDevice::SetCDPlaymode(int playmode) const
-{
-#ifndef __APPLE__
- m_cdrom->SetCDPlaymode(playmode);
-#endif
-}
-
-void SND_OpenALDevice::SetCDGain(MT_Scalar gain) const
-{
-#ifndef __APPLE__
- m_cdrom->SetCDGain(gain);
-#endif
-}
diff --git a/intern/SoundSystem/openal/SND_OpenALDevice.h b/intern/SoundSystem/openal/SND_OpenALDevice.h
deleted file mode 100644
index a7b97cc314f..00000000000
--- a/intern/SoundSystem/openal/SND_OpenALDevice.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef SND_OPENALDEVICE
-#define SND_OPENALDEVICE
-
-#include "SND_AudioDevice.h"
-#include "SoundDefines.h"
-
-struct SDL_CD;
-
-class SND_OpenALDevice : public SND_AudioDevice
-{
-public:
- SND_OpenALDevice();
- virtual ~SND_OpenALDevice();
-
- SND_WaveSlot* LoadSample(const STR_String& samplename,
- void* memlocation,
- int size);
-
- void InitListener();
- void SetListenerGain(float gain) const;
- void SetDopplerVelocity(MT_Scalar dopplervelocity) const;
- void SetDopplerFactor(MT_Scalar dopplerfactor) const;
- void SetListenerRollOffFactor(MT_Scalar rollofffactor) const;
-
- void MakeCurrent() const;
-
- void NextFrame() const;
- void UseCD() const;
-
- void SetObjectBuffer(int id, unsigned int buffer);
-
- int GetPlayState(int id);
- void PlayObject(int id);
- void StopObject(int id) const;
- void StopAllObjects();
- void PauseObject(int id) const;
-
- void SetObjectLoop(int id, unsigned int loopmode) const;
- void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const;
- void SetObjectPitch(int id, MT_Scalar pitch) const;
- void SetObjectGain(int id, MT_Scalar gain) const;
- void SetObjectMinGain(int id, MT_Scalar mingain) const;
- void SetObjectMaxGain(int id, MT_Scalar maxgain) const;
- void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const;
- void SetObjectReferenceDistance(int id, MT_Scalar distance) const;
-
- void SetObjectTransform(int id,
- const MT_Vector3& position,
- const MT_Vector3& velocity,
- const MT_Matrix3x3& orientation,
- const MT_Vector3& lisposition,
- const MT_Scalar& rollofffactor) const;
- void ObjectIs2D(int id) const;
-
- void PlayCD(int track) const;
- void PauseCD(bool pause) const;
- void StopCD() const;
- void SetCDPlaymode(int playmode) const;
- void SetCDGain(MT_Scalar gain) const;
-
- void StartUsingDSP() {};
- float* GetSpectrum() { return NULL; }
- void StopUsingDSP() {};
-
-private:
- void* m_context;
- void* m_device;
-
- unsigned int m_buffers[NUM_BUFFERS];
- unsigned int m_sources[NUM_SOURCES];
- bool m_buffersinitialized;
- bool m_sourcesinitialized;
-#ifndef __APPLE__
- class SND_SDLCDDevice* m_cdrom;
-#endif
-};
-
-#endif //SND_OPENALDEVICE
-
diff --git a/intern/SoundSystem/openal/pthread_cancel.cpp b/intern/SoundSystem/openal/pthread_cancel.cpp
deleted file mode 100644
index bb36d1dd136..00000000000
--- a/intern/SoundSystem/openal/pthread_cancel.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * FreeBSD 3.4 does not yet have pthread_cancel (3.5 and above do)
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef __FreeBSD__
-
-#include <osreldate.h>
-
-#if (__FreeBSD_version < 350000)
-#include <pthread.h>
-
-#define FD_READ 0x1
-#define _FD_LOCK(_fd,_type,_ts) _thread_fd_lock(_fd, _type, _ts)
-#define _FD_UNLOCK(_fd,_type) _thread_fd_unlock(_fd, _type)
-
-int pthread_cancel(pthread_t pthread) {
- pthread_exit(NULL);
- return 0;
-}
-
-long fpathconf(int fd, int name)
-{
- long ret;
-
- if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
- ret = _thread_sys_fpathconf(fd, name);
- _FD_UNLOCK(fd, FD_READ);
- }
- return ret;
-}
-
-#endif
-
-int pthread_atfork(void *a, void *b, void *c) {
- return 0;
-}
-
-#endif
diff --git a/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp b/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp
deleted file mode 100644
index 5054c39e8a1..00000000000
--- a/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * SND_SDLCDDevice
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef WIN32
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-#include "MT_Scalar.h"
-
-#include "SND_SDLCDDevice.h"
-#include "SoundDefines.h"
-
-#ifndef DISABLE_SDL
-#include <SDL.h>
-#else
-#include <stdio.h>
-#endif
-
-SND_SDLCDDevice::SND_SDLCDDevice() :
- m_cdrom(NULL),
- m_cdplaying(false),
- m_cdtrack(0),
- m_cdplaymode(SND_CD_TRACK),
- m_frame(0)
-{
- init();
-}
-
-void SND_SDLCDDevice::init()
-{
-#ifdef DISABLE_SDL
- fprintf(stderr, "Blender compiled without SDL, no CDROM support\n");
- return;
-#else
- if (SDL_InitSubSystem(SDL_INIT_CDROM))
- {
- fprintf(stderr, "Error initializing CDROM\n");
- return;
- }
-
- /* Check for CD drives */
- if(!SDL_CDNumDrives())
- {
- /* None found */
- fprintf(stderr, "No CDROM devices available\n");
- return;
- }
-
- /* Open the default drive */
- m_cdrom = SDL_CDOpen(0);
-
- /* Did if open? Check if cdrom is NULL */
- if(!m_cdrom)
- {
- fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
- return;
- }
-#endif
-}
-
-SND_SDLCDDevice::~SND_SDLCDDevice()
-{
-#ifndef DISABLE_SDL
- StopCD();
- SDL_CDClose(m_cdrom);
-#endif
-}
-
-void SND_SDLCDDevice::NextFrame()
-{
-#ifndef DISABLE_SDL
- m_frame++;
- m_frame &= 127;
-
- if (!m_frame && m_cdrom && m_cdplaying && SDL_CDStatus(m_cdrom) == CD_STOPPED)
- {
- switch (m_cdplaymode)
- {
- case SND_CD_ALL:
- if (m_cdtrack < m_cdrom->numtracks)
- PlayCD(m_cdtrack + 1);
- else
- m_cdplaying = false;
- break;
- default:
- case SND_CD_TRACK:
- m_cdplaying = false;
- break;
- case SND_CD_TRACKLOOP:
- PlayCD(m_cdtrack);
- break;
- }
-
- }
-#endif
-}
-
-void SND_SDLCDDevice::PlayCD(int track)
-{
-#ifndef DISABLE_SDL
- if ( m_cdrom && CD_INDRIVE(SDL_CDStatus(m_cdrom)) ) {
- SDL_CDPlayTracks(m_cdrom, track-1, 0, track, 0);
- m_cdplaying = true;
- m_cdtrack = track;
- }
-#endif
-}
-
-
-void SND_SDLCDDevice::PauseCD(bool pause)
-{
-#ifndef DISABLE_SDL
- if (!m_cdrom)
- return;
-
- if (pause)
- SDL_CDPause(m_cdrom);
- else
- SDL_CDResume(m_cdrom);
-#endif
-}
-
-void SND_SDLCDDevice::StopCD()
-{
-#ifndef DISABLE_SDL
- if (m_cdrom)
- SDL_CDStop(m_cdrom);
- m_cdplaying = false;
-#endif
-}
-
-void SND_SDLCDDevice::SetCDPlaymode(int playmode)
-{
- m_cdplaymode = playmode;
-}
-
-void SND_SDLCDDevice::SetCDGain(MT_Scalar gain)
-{
-
-}
diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt
new file mode 100644
index 00000000000..1b48de3190b
--- /dev/null
+++ b/intern/audaspace/CMakeLists.txt
@@ -0,0 +1,64 @@
+# $Id$
+# ***** BEGIN LGPL LICENSE BLOCK *****
+#
+# Copyright 2009 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 Lesser General Public License as published by
+# the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+#
+# ***** END LGPL LICENSE BLOCK *****
+
+SET(INC . intern FX SRC ${PTHREADS_INC} ${LIBSAMPLERATE_INC})
+
+FILE(GLOB SRC intern/*.cpp intern/*.h FX/*.cpp SRC/*.cpp)
+
+IF(WITH_FFMPEG)
+ SET(INC ${INC} ffmpeg ${FFMPEG_INC})
+ FILE(GLOB FFMPEGSRC ffmpeg/*.cpp)
+ ADD_DEFINITIONS(-DWITH_FFMPEG)
+ENDIF(WITH_FFMPEG)
+
+IF(WITH_SDL)
+ SET(INC ${INC} SDL ${SDL_INCLUDE_DIR})
+ FILE(GLOB SDLSRC SDL/*.cpp)
+ ADD_DEFINITIONS(-DWITH_SDL)
+ENDIF(WITH_SDL)
+
+IF(WITH_OPENAL)
+ SET(INC ${INC} OpenAL ${OPENAL_INCLUDE_DIR})
+ FILE(GLOB OPENALSRC OpenAL/*.cpp)
+ ADD_DEFINITIONS(-DWITH_OPENAL)
+
+ STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INCLUDE_DIR})
+ IF(FRAMEWORK)
+ ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX)
+ ENDIF(FRAMEWORK)
+ENDIF(WITH_OPENAL)
+
+IF(WITH_JACK)
+ SET(INC ${INC} jack ${JACK_INC})
+ FILE(GLOB JACKSRC jack/*.cpp)
+ ADD_DEFINITIONS(-DWITH_JACK)
+ENDIF(WITH_JACK)
+
+IF(WITH_SNDFILE)
+ SET(INC ${INC} sndfile ${SNDFILE_INC})
+ FILE(GLOB SNDFILESRC sndfile/*.cpp)
+ ADD_DEFINITIONS(-DWITH_SNDFILE)
+ENDIF(WITH_SNDFILE)
+
+SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
+
+BLENDERLIB(bf_audaspace "${SRC}" "${INC}")
diff --git a/intern/audaspace/COPYING b/intern/audaspace/COPYING
new file mode 100644
index 00000000000..94a9ed024d3
--- /dev/null
+++ b/intern/audaspace/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/intern/audaspace/COPYING.LESSER b/intern/audaspace/COPYING.LESSER
new file mode 100644
index 00000000000..cca7fc278f5
--- /dev/null
+++ b/intern/audaspace/COPYING.LESSER
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/intern/audaspace/FX/AUD_DelayFactory.cpp b/intern/audaspace/FX/AUD_DelayFactory.cpp
new file mode 100644
index 00000000000..25ce4faed4c
--- /dev/null
+++ b/intern/audaspace/FX/AUD_DelayFactory.cpp
@@ -0,0 +1,58 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_DelayFactory.h"
+#include "AUD_DelayReader.h"
+#include "AUD_Space.h"
+
+AUD_DelayFactory::AUD_DelayFactory(AUD_IFactory* factory, float delay) :
+ AUD_EffectFactory(factory),
+ m_delay(delay) {}
+
+AUD_DelayFactory::AUD_DelayFactory(float delay) :
+ AUD_EffectFactory(0),
+ m_delay(delay) {}
+
+float AUD_DelayFactory::getDelay()
+{
+ return m_delay;
+}
+
+void AUD_DelayFactory::setDelay(float delay)
+{
+ m_delay = delay;
+}
+
+AUD_IReader* AUD_DelayFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ reader = new AUD_DelayReader(reader, m_delay); AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_DelayFactory.h b/intern/audaspace/FX/AUD_DelayFactory.h
new file mode 100644
index 00000000000..5ad4b9ab996
--- /dev/null
+++ b/intern/audaspace/FX/AUD_DelayFactory.h
@@ -0,0 +1,70 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_DELAYFACTORY
+#define AUD_DELAYFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory plays another factory delayed.
+ */
+class AUD_DelayFactory : public AUD_EffectFactory
+{
+private:
+ /**
+ * The delay in samples.
+ */
+ float m_delay;
+
+public:
+ /**
+ * Creates a new delay factory.
+ * \param factory The input factory.
+ * \param delay The desired delay in seconds.
+ */
+ AUD_DelayFactory(AUD_IFactory* factory = 0, float delay = 0);
+
+ /**
+ * Creates a new delay factory.
+ * \param delay The desired delay in seconds.
+ */
+ AUD_DelayFactory(float delay);
+
+ /**
+ * Returns the delay in seconds.
+ */
+ float getDelay();
+
+ /**
+ * Sets the delay.
+ * \param delay The new delay value in seconds.
+ */
+ void setDelay(float delay);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_DELAYFACTORY
diff --git a/intern/audaspace/FX/AUD_DelayReader.cpp b/intern/audaspace/FX/AUD_DelayReader.cpp
new file mode 100644
index 00000000000..38d3b893b5c
--- /dev/null
+++ b/intern/audaspace/FX/AUD_DelayReader.cpp
@@ -0,0 +1,111 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_DelayReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_DelayReader::AUD_DelayReader(AUD_IReader* reader, float delay) :
+ AUD_EffectReader(reader)
+{
+ m_delay = (int)(delay * reader->getSpecs().rate);
+ m_remdelay = m_delay;
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_DelayReader::~AUD_DelayReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+void AUD_DelayReader::seek(int position)
+{
+ if(position < 0)
+ return;
+
+ if(position < m_delay)
+ {
+ m_remdelay = m_delay - position;
+ m_reader->seek(0);
+ }
+ else
+ {
+ m_remdelay = 0;
+ m_reader->seek(position - m_delay);
+ }
+}
+
+int AUD_DelayReader::getLength()
+{
+ int len = m_reader->getLength();
+ if(len < 0)
+ return len;
+ return len+m_delay;
+}
+
+int AUD_DelayReader::getPosition()
+{
+ if(m_remdelay > 0)
+ return m_delay-m_remdelay;
+ return m_reader->getPosition() + m_delay;
+}
+
+void AUD_DelayReader::read(int & length, sample_t* & buffer)
+{
+ if(m_remdelay > 0)
+ {
+ int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
+
+ if(m_buffer->getSize() < length*samplesize)
+ m_buffer->resize(length*samplesize);
+
+ if(length > m_remdelay)
+ {
+ if(getSpecs().format == AUD_FORMAT_U8)
+ memset(m_buffer->getBuffer(), 0x80, m_remdelay*samplesize);
+ else
+ memset(m_buffer->getBuffer(), 0, m_remdelay*samplesize);
+ int len = length - m_remdelay;
+ m_reader->read(len, buffer);
+ memcpy(m_buffer->getBuffer()+m_remdelay*samplesize,
+ buffer, len*samplesize);
+ if(len < length-m_remdelay)
+ length = m_remdelay + len;
+ m_remdelay = 0;
+ }
+ else
+ {
+ if(getSpecs().format == AUD_FORMAT_U8)
+ memset(m_buffer->getBuffer(), 0x80, length*samplesize);
+ else
+ memset(m_buffer->getBuffer(), 0, length*samplesize);
+ m_remdelay -= length;
+ }
+ buffer = m_buffer->getBuffer();
+ }
+ else
+ m_reader->read(length, buffer);
+}
diff --git a/intern/audaspace/FX/AUD_DelayReader.h b/intern/audaspace/FX/AUD_DelayReader.h
new file mode 100644
index 00000000000..4662b455dfc
--- /dev/null
+++ b/intern/audaspace/FX/AUD_DelayReader.h
@@ -0,0 +1,73 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_DELAYREADER
+#define AUD_DELAYREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class reads another reader and changes it's delay.
+ */
+class AUD_DelayReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The delay level.
+ */
+ int m_delay;
+
+ /**
+ * The remaining delay for playback.
+ */
+ int m_remdelay;
+
+public:
+ /**
+ * Creates a new delay reader.
+ * \param reader The reader to read from.
+ * \param delay The delay in seconds.
+ * \exception AUD_Exception Thrown if the reader specified is NULL.
+ */
+ AUD_DelayReader(AUD_IReader* reader, float delay);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_DelayReader();
+
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_DELAYREADER
diff --git a/intern/audaspace/FX/AUD_DoubleReader.cpp b/intern/audaspace/FX/AUD_DoubleReader.cpp
new file mode 100644
index 00000000000..181e394da98
--- /dev/null
+++ b/intern/audaspace/FX/AUD_DoubleReader.cpp
@@ -0,0 +1,158 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_DoubleReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_DoubleReader::AUD_DoubleReader(AUD_IReader* reader1,
+ AUD_IReader* reader2) :
+ m_reader1(reader1), m_reader2(reader2)
+{
+ try
+ {
+ if(!reader1)
+ AUD_THROW(AUD_ERROR_READER);
+
+ if(!reader2)
+ AUD_THROW(AUD_ERROR_READER);
+
+ AUD_Specs s1, s2;
+ s1 = reader1->getSpecs();
+ s2 = reader2->getSpecs();
+ if(memcmp(&s1, &s2, sizeof(AUD_Specs)) != 0)
+ AUD_THROW(AUD_ERROR_READER);
+ }
+
+ catch(AUD_Exception e)
+ {
+ if(reader1)
+ {
+ delete reader1; AUD_DELETE("reader")
+ }
+ if(reader2)
+ {
+ delete reader2; AUD_DELETE("reader")
+ }
+
+ throw;
+ }
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+ m_finished1 = false;
+}
+
+AUD_DoubleReader::~AUD_DoubleReader()
+{
+ delete m_reader1; AUD_DELETE("reader")
+ delete m_reader2; AUD_DELETE("reader")
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+bool AUD_DoubleReader::isSeekable()
+{
+ return false;
+}
+
+void AUD_DoubleReader::seek(int position)
+{
+ int length1 = m_reader1->getLength();
+
+ if(position < 0)
+ position = 0;
+
+ if(position < length1)
+ {
+ m_reader1->seek(position);
+ m_reader2->seek(0);
+ m_finished1 = false;
+ }
+ else
+ {
+ m_reader2->seek(position-length1);
+ m_finished1 = true;
+ }
+}
+
+int AUD_DoubleReader::getLength()
+{
+ int len1 = m_reader1->getLength();
+ int len2 = m_reader2->getLength();
+ if(len1 < 0 || len2 < 0)
+ return -1;
+ return len1 + len2;
+}
+
+int AUD_DoubleReader::getPosition()
+{
+ return m_reader1->getPosition() + m_reader2->getPosition();
+}
+
+AUD_Specs AUD_DoubleReader::getSpecs()
+{
+ return m_reader1->getSpecs();
+}
+
+AUD_ReaderType AUD_DoubleReader::getType()
+{
+ if(m_reader1->getType() == AUD_TYPE_BUFFER &&
+ m_reader2->getType() == AUD_TYPE_BUFFER)
+ return AUD_TYPE_BUFFER;
+ return AUD_TYPE_STREAM;
+}
+
+bool AUD_DoubleReader::notify(AUD_Message &message)
+{
+ return m_reader1->notify(message) | m_reader2->notify(message);
+}
+
+void AUD_DoubleReader::read(int & length, sample_t* & buffer)
+{
+ if(!m_finished1)
+ {
+ int len = length;
+ m_reader1->read(len, buffer);
+ if(len < length)
+ {
+ int samplesize = AUD_SAMPLE_SIZE(m_reader1->getSpecs());
+ if(m_buffer->getSize() < length * samplesize)
+ m_buffer->resize(length * samplesize);
+ memcpy(m_buffer->getBuffer(), buffer, len*samplesize);
+ len = length - len;
+ length -= len;
+ m_reader2->read(len, buffer);
+ memcpy(m_buffer->getBuffer() + length*samplesize,
+ buffer, len*samplesize);
+ length += len;
+ buffer = m_buffer->getBuffer();
+ m_finished1 = true;
+ }
+ }
+ else
+ {
+ m_reader2->read(length, buffer);
+ }
+}
diff --git a/intern/audaspace/FX/AUD_DoubleReader.h b/intern/audaspace/FX/AUD_DoubleReader.h
new file mode 100644
index 00000000000..d82b81ec0ba
--- /dev/null
+++ b/intern/audaspace/FX/AUD_DoubleReader.h
@@ -0,0 +1,83 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_DOUBLEREADER
+#define AUD_DOUBLEREADER
+
+#include "AUD_IReader.h"
+class AUD_Buffer;
+
+/**
+ * This reader plays two readers with the same specs sequently.
+ */
+class AUD_DoubleReader : public AUD_IReader
+{
+private:
+ /**
+ * The first reader.
+ */
+ AUD_IReader* m_reader1;
+
+ /**
+ * The second reader.
+ */
+ AUD_IReader* m_reader2;
+
+ /**
+ * Whether we've reached the end of the first reader.
+ */
+ bool m_finished1;
+
+ /**
+ * The playback buffer for the intersecting part.
+ */
+ AUD_Buffer* m_buffer;
+
+public:
+ /**
+ * Creates a new ping pong reader.
+ * \param reader1 The first reader to read from.
+ * \param reader2 The second reader to read from.
+ * \exception AUD_Exception Thrown if one of the reader specified is NULL
+ * or the specs from the readers differ.
+ */
+ AUD_DoubleReader(AUD_IReader* reader1, AUD_IReader* reader2);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_DoubleReader();
+
+ virtual bool isSeekable();
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_DOUBLEREADER
diff --git a/intern/audaspace/FX/AUD_EffectFactory.cpp b/intern/audaspace/FX/AUD_EffectFactory.cpp
new file mode 100644
index 00000000000..882499416b7
--- /dev/null
+++ b/intern/audaspace/FX/AUD_EffectFactory.cpp
@@ -0,0 +1,50 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_EffectFactory.h"
+#include "AUD_IReader.h"
+
+AUD_IReader* AUD_EffectFactory::getReader()
+{
+ if(m_factory != 0)
+ return m_factory->createReader();
+
+ return 0;
+}
+
+AUD_EffectFactory::AUD_EffectFactory(AUD_IFactory* factory)
+{
+ m_factory = factory;
+}
+
+void AUD_EffectFactory::setFactory(AUD_IFactory* factory)
+{
+ m_factory = factory;
+}
+
+AUD_IFactory* AUD_EffectFactory::getFactory()
+{
+ return m_factory;
+}
diff --git a/intern/audaspace/FX/AUD_EffectFactory.h b/intern/audaspace/FX/AUD_EffectFactory.h
new file mode 100644
index 00000000000..67259b9e6c3
--- /dev/null
+++ b/intern/audaspace/FX/AUD_EffectFactory.h
@@ -0,0 +1,76 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_EFFECTFACTORY
+#define AUD_EFFECTFACTORY
+
+#include "AUD_IFactory.h"
+
+/**
+ * This factory is a base class for all effect factories that take one other
+ * factory as input.
+ */
+class AUD_EffectFactory : public AUD_IFactory
+{
+protected:
+ /**
+ * If there is no reader it is created out of this factory.
+ */
+ AUD_IFactory* m_factory;
+
+ /**
+ * Returns the reader created out of the factory.
+ * This method can be used for the createReader function of the implementing
+ * classes.
+ * \return The reader created out of the factory or NULL if there is none.
+ */
+ AUD_IReader* getReader();
+
+public:
+ /**
+ * Creates a new factory.
+ * \param factory The input factory.
+ */
+ AUD_EffectFactory(AUD_IFactory* factory);
+
+ /**
+ * Destroys the factory.
+ */
+ virtual ~AUD_EffectFactory() {}
+
+ /**
+ * Sets the input factory.
+ * \param factory The input factory.
+ */
+ void setFactory(AUD_IFactory* factory);
+
+ /**
+ * Returns the saved factory.
+ * \return The factory or NULL if there has no factory been saved.
+ */
+ AUD_IFactory* getFactory();
+};
+
+#endif //AUD_EFFECTFACTORY
diff --git a/intern/audaspace/FX/AUD_EffectReader.cpp b/intern/audaspace/FX/AUD_EffectReader.cpp
new file mode 100644
index 00000000000..47026b88440
--- /dev/null
+++ b/intern/audaspace/FX/AUD_EffectReader.cpp
@@ -0,0 +1,78 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_EffectReader.h"
+
+AUD_EffectReader::AUD_EffectReader(AUD_IReader* reader)
+{
+ if(!reader)
+ AUD_THROW(AUD_ERROR_READER);
+ m_reader = reader;
+}
+
+AUD_EffectReader::~AUD_EffectReader()
+{
+ delete m_reader; AUD_DELETE("reader")
+}
+
+bool AUD_EffectReader::isSeekable()
+{
+ return m_reader->isSeekable();
+}
+
+void AUD_EffectReader::seek(int position)
+{
+ m_reader->seek(position);
+}
+
+int AUD_EffectReader::getLength()
+{
+ return m_reader->getLength();
+}
+
+int AUD_EffectReader::getPosition()
+{
+ return m_reader->getPosition();
+}
+
+AUD_Specs AUD_EffectReader::getSpecs()
+{
+ return m_reader->getSpecs();
+}
+
+AUD_ReaderType AUD_EffectReader::getType()
+{
+ return m_reader->getType();
+}
+
+bool AUD_EffectReader::notify(AUD_Message &message)
+{
+ return m_reader->notify(message);
+}
+
+void AUD_EffectReader::read(int & length, sample_t* & buffer)
+{
+ m_reader->read(length, buffer);
+}
diff --git a/intern/audaspace/FX/AUD_EffectReader.h b/intern/audaspace/FX/AUD_EffectReader.h
new file mode 100644
index 00000000000..f64bf34077d
--- /dev/null
+++ b/intern/audaspace/FX/AUD_EffectReader.h
@@ -0,0 +1,66 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_EFFECTREADER
+#define AUD_EFFECTREADER
+
+#include "AUD_IReader.h"
+
+/**
+ * This reader is a base class for all effect readers that take one other reader
+ * as input.
+ */
+class AUD_EffectReader : public AUD_IReader
+{
+protected:
+ /**
+ * The reader to read from.
+ */
+ AUD_IReader* m_reader;
+
+public:
+ /**
+ * Creates a new effect reader.
+ * \param reader The reader to read from.
+ * \exception AUD_Exception Thrown if the reader specified is NULL.
+ */
+ AUD_EffectReader(AUD_IReader* reader);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_EffectReader();
+
+ virtual bool isSeekable();
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_EFFECTREADER
diff --git a/intern/audaspace/FX/AUD_FaderFactory.cpp b/intern/audaspace/FX/AUD_FaderFactory.cpp
new file mode 100644
index 00000000000..4357e11bd43
--- /dev/null
+++ b/intern/audaspace/FX/AUD_FaderFactory.cpp
@@ -0,0 +1,84 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_FaderFactory.h"
+#include "AUD_FaderReader.h"
+
+AUD_FaderFactory::AUD_FaderFactory(AUD_IFactory* factory, AUD_FadeType type,
+ float start, float length) :
+ AUD_EffectFactory(factory),
+ m_type(type),
+ m_start(start),
+ m_length(length) {}
+
+AUD_FaderFactory::AUD_FaderFactory(AUD_FadeType type,
+ float start, float length) :
+ AUD_EffectFactory(0),
+ m_type(type),
+ m_start(start),
+ m_length(length) {}
+
+AUD_FadeType AUD_FaderFactory::getType()
+{
+ return m_type;
+}
+
+void AUD_FaderFactory::setType(AUD_FadeType type)
+{
+ m_type = type;
+}
+
+float AUD_FaderFactory::getStart()
+{
+ return m_start;
+}
+
+void AUD_FaderFactory::setStart(float start)
+{
+ m_start = start;
+}
+
+float AUD_FaderFactory::getLength()
+{
+ return m_length;
+}
+
+void AUD_FaderFactory::setLength(float length)
+{
+ m_length = length;
+}
+
+AUD_IReader* AUD_FaderFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ reader = new AUD_FaderReader(reader, m_type, m_start, m_length);
+ AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_FaderFactory.h b/intern/audaspace/FX/AUD_FaderFactory.h
new file mode 100644
index 00000000000..4999ccac8f1
--- /dev/null
+++ b/intern/audaspace/FX/AUD_FaderFactory.h
@@ -0,0 +1,111 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_FADERFACTORY
+#define AUD_FADERFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory fades another factory.
+ * If the fading type is AUD_FADE_IN, everything before the fading start will be
+ * silenced, for AUD_FADE_OUT that's true for everything after fading ends.
+ */
+class AUD_FaderFactory : public AUD_EffectFactory
+{
+private:
+ /**
+ * The fading type.
+ */
+ AUD_FadeType m_type;
+
+ /**
+ * The fading start.
+ */
+ float m_start;
+
+ /**
+ * The fading length.
+ */
+ float m_length;
+
+public:
+ /**
+ * Creates a new fader factory.
+ * \param factory The input factory.
+ * \param type The fading type.
+ * \param start The time where fading should start in seconds.
+ * \param length How long fading should last in seconds.
+ */
+ AUD_FaderFactory(AUD_IFactory* factory = 0,
+ AUD_FadeType type = AUD_FADE_IN,
+ float start = 0.0f, float length = 1.0f);
+
+ /**
+ * Creates a new fader factory.
+ * \param type The fading type.
+ * \param start The time where fading should start in seconds.
+ * \param length How long fading should last in seconds.
+ */
+ AUD_FaderFactory(AUD_FadeType type = AUD_FADE_IN,
+ float start = 0.0f, float length = 1.0f);
+
+ /**
+ * Returns the fading type.
+ */
+ AUD_FadeType getType();
+
+ /**
+ * Sets the fading type.
+ * \param type The new fading type: AUD_FADE_IN or AUD_FADE_OUT.
+ */
+ void setType(AUD_FadeType type);
+
+ /**
+ * Returns the fading start.
+ */
+ float getStart();
+
+ /**
+ * Sets the fading start.
+ * \param start The new fading start.
+ */
+ void setStart(float start);
+
+ /**
+ * Returns the fading length.
+ */
+ float getLength();
+
+ /**
+ * Sets the fading length.
+ * \param start The new fading length.
+ */
+ void setLength(float length);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_FADERFACTORY
diff --git a/intern/audaspace/FX/AUD_FaderReader.cpp b/intern/audaspace/FX/AUD_FaderReader.cpp
new file mode 100644
index 00000000000..d5096e7fae1
--- /dev/null
+++ b/intern/audaspace/FX/AUD_FaderReader.cpp
@@ -0,0 +1,133 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_FaderReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_FaderReader::AUD_FaderReader(AUD_IReader* reader, AUD_FadeType type,
+ float start,float length) :
+ AUD_EffectReader(reader),
+ m_type(type),
+ m_start(start),
+ m_length(length)
+{
+ int bigendian = 1;
+ bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
+
+ switch(m_reader->getSpecs().format)
+ {
+ case AUD_FORMAT_S16:
+ m_adjust = AUD_volume_adjust<int16_t>;
+ break;
+ case AUD_FORMAT_S32:
+ m_adjust = AUD_volume_adjust<int32_t>;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_adjust = AUD_volume_adjust<float>;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_adjust = AUD_volume_adjust<double>;
+ break;
+ case AUD_FORMAT_U8:
+ m_adjust = AUD_volume_adjust_u8;
+ break;
+ case AUD_FORMAT_S24:
+ m_adjust = bigendian ? AUD_volume_adjust_s24_be :
+ AUD_volume_adjust_s24_le;
+ break;
+ default:
+ delete m_reader;
+ AUD_THROW(AUD_ERROR_READER);
+ }
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_FaderReader::~AUD_FaderReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+bool AUD_FaderReader::notify(AUD_Message &message)
+{
+ return m_reader->notify(message);
+}
+
+void AUD_FaderReader::read(int & length, sample_t* & buffer)
+{
+ int position = m_reader->getPosition();
+ AUD_Specs specs = m_reader->getSpecs();
+ int samplesize = AUD_SAMPLE_SIZE(specs);
+
+ m_reader->read(length, buffer);
+
+ if(m_buffer->getSize() < length * samplesize)
+ m_buffer->resize(length * samplesize);
+
+ if((position + length) / (float)specs.rate <= m_start)
+ {
+ if(m_type != AUD_FADE_OUT)
+ {
+ buffer = m_buffer->getBuffer();
+ memset(buffer,
+ specs.format == AUD_FORMAT_U8 ? 0x80 : 0,
+ length * samplesize);
+ }
+ }
+ else if(position / (float)specs.rate >= m_start+m_length)
+ {
+ if(m_type == AUD_FADE_OUT)
+ {
+ buffer = m_buffer->getBuffer();
+ memset(buffer,
+ specs.format == AUD_FORMAT_U8 ? 0x80 : 0,
+ length * samplesize);
+ }
+ }
+ else
+ {
+ sample_t* buf = m_buffer->getBuffer();
+ float volume;
+
+ for(int i = 0; i < length; i++)
+ {
+ volume = (((position+i)/(float)specs.rate)-m_start) / m_length;
+ if(volume > 1.0f)
+ volume = 1.0f;
+ else if(volume < 0.0f)
+ volume = 0.0f;
+
+ if(m_type == AUD_FADE_OUT)
+ volume = 1.0f - volume;
+
+ m_adjust(buf + i * samplesize, buffer + i * samplesize,
+ specs.channels, volume);
+ }
+
+ buffer = buf;
+ }
+}
diff --git a/intern/audaspace/FX/AUD_FaderReader.h b/intern/audaspace/FX/AUD_FaderReader.h
new file mode 100644
index 00000000000..773643b2f5d
--- /dev/null
+++ b/intern/audaspace/FX/AUD_FaderReader.h
@@ -0,0 +1,86 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_FADERREADER
+#define AUD_FADERREADER
+
+#include "AUD_EffectReader.h"
+#include "AUD_ConverterFunctions.h"
+class AUD_Buffer;
+
+/**
+ * This class fades another reader.
+ * If the fading type is AUD_FADE_IN, everything before the fading start will be
+ * silenced, for AUD_FADE_OUT that's true for everything after fading ends.
+ */
+class AUD_FaderReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The fading type.
+ */
+ AUD_FadeType m_type;
+
+ /**
+ * The fading start.
+ */
+ float m_start;
+
+ /**
+ * The fading length.
+ */
+ float m_length;
+
+ /**
+ * Volume adjustment function.
+ */
+ AUD_volume_adjust_f m_adjust;
+
+public:
+ /**
+ * Creates a new fader reader.
+ * \param type The fading type.
+ * \param start The time where fading should start in seconds.
+ * \param length How long fading should last in seconds.
+ * \exception AUD_Exception Thrown if the reader specified is NULL.
+ */
+ AUD_FaderReader(AUD_IReader* reader, AUD_FadeType type,
+ float start,float length);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_FaderReader();
+
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_FADERREADER
diff --git a/intern/audaspace/FX/AUD_LimiterFactory.cpp b/intern/audaspace/FX/AUD_LimiterFactory.cpp
new file mode 100644
index 00000000000..6f19575240a
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LimiterFactory.cpp
@@ -0,0 +1,67 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_LimiterFactory.h"
+#include "AUD_LimiterReader.h"
+#include "AUD_Space.h"
+
+AUD_LimiterFactory::AUD_LimiterFactory(AUD_IFactory* factory,
+ float start, float end) :
+ AUD_EffectFactory(factory),
+ m_start(start),
+ m_end(end) {}
+
+float AUD_LimiterFactory::getStart()
+{
+ return m_start;
+}
+
+void AUD_LimiterFactory::setStart(float start)
+{
+ m_start = start;
+}
+
+float AUD_LimiterFactory::getEnd()
+{
+ return m_end;
+}
+
+void AUD_LimiterFactory::setEnd(float end)
+{
+ m_end = end;
+}
+
+AUD_IReader* AUD_LimiterFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ reader = new AUD_LimiterReader(reader, m_start, m_end);
+ AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_LimiterFactory.h b/intern/audaspace/FX/AUD_LimiterFactory.h
new file mode 100644
index 00000000000..588fea6eb4b
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LimiterFactory.h
@@ -0,0 +1,84 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_LIMITERFACTORY
+#define AUD_LIMITERFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory limits another factory in start and end time.
+ */
+class AUD_LimiterFactory : public AUD_EffectFactory
+{
+private:
+ /**
+ * The start time.
+ */
+ float m_start;
+
+ /**
+ * The end time.
+ */
+ float m_end;
+
+public:
+ /**
+ * Creates a new limiter factory.
+ * \param factory The input factory.
+ * \param start The desired start time.
+ * \param end The desired end time, a negative value signals that it should
+ * play to the end.
+ */
+ AUD_LimiterFactory(AUD_IFactory* factory = 0,
+ float start = 0, float end = -1);
+
+ /**
+ * Returns the start time.
+ */
+ float getStart();
+
+ /**
+ * Sets the start time.
+ * \param start The new start time.
+ */
+ void setStart(float start);
+
+ /**
+ * Returns the end time.
+ */
+ float getEnd();
+
+ /**
+ * Sets the end time.
+ * \param end The new end time, a negative value signals that it should play
+ * to the end.
+ */
+ void setEnd(float end);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_LIMITERFACTORY
diff --git a/intern/audaspace/FX/AUD_LimiterReader.cpp b/intern/audaspace/FX/AUD_LimiterReader.cpp
new file mode 100644
index 00000000000..05882369001
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LimiterReader.cpp
@@ -0,0 +1,95 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_LimiterReader.h"
+#include "AUD_Buffer.h"
+
+#include <iostream>
+
+AUD_LimiterReader::AUD_LimiterReader(AUD_IReader* reader,
+ float start, float end) :
+ AUD_EffectReader(reader)
+{
+ m_end = (int)(end * reader->getSpecs().rate);
+
+ if(start <= 0)
+ m_start = 0;
+ else
+ {
+ m_start = (int)(start * reader->getSpecs().rate);
+ if(m_reader->isSeekable())
+ m_reader->seek(m_start);
+ else
+ {
+ // skip first m_start samples by reading them
+ int length;
+ sample_t* buffer;
+ for(int i = m_start;
+ i >= AUD_DEFAULT_BUFFER_SIZE;
+ i -= AUD_DEFAULT_BUFFER_SIZE)
+ {
+ length = AUD_DEFAULT_BUFFER_SIZE;
+ m_reader->read(length, buffer);
+ length = i;
+ }
+ m_reader->read(length, buffer);
+ }
+ }
+}
+
+void AUD_LimiterReader::seek(int position)
+{
+ m_reader->seek(position + m_start);
+}
+
+int AUD_LimiterReader::getLength()
+{
+ int len = m_reader->getLength();
+ if(m_reader->getType() != AUD_TYPE_BUFFER || len < 0 ||
+ (len > m_end && m_end >= 0))
+ len = m_end;
+ return len - m_start;
+}
+
+int AUD_LimiterReader::getPosition()
+{
+ return m_reader->getPosition() - m_start;
+}
+
+void AUD_LimiterReader::read(int & length, sample_t* & buffer)
+{
+ if(m_end >= 0)
+ {
+ int position = m_reader->getPosition();
+ if(position+length > m_end)
+ length = m_end - position;
+ if(length < 0)
+ {
+ length = 0;
+ return;
+ }
+ }
+ m_reader->read(length, buffer);
+}
diff --git a/intern/audaspace/FX/AUD_LimiterReader.h b/intern/audaspace/FX/AUD_LimiterReader.h
new file mode 100644
index 00000000000..9921f5ee1b0
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LimiterReader.h
@@ -0,0 +1,64 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_LIMITERREADER
+#define AUD_LIMITERREADER
+
+#include "AUD_EffectReader.h"
+
+/**
+ * This reader limits another reader in start and end sample.
+ */
+class AUD_LimiterReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The start sample: inclusive.
+ */
+ int m_start;
+
+ /**
+ * The end sample: exlusive.
+ */
+ int m_end;
+
+public:
+ /**
+ * Creates a new limiter reader.
+ * \param reader The reader to read from.
+ * \param start The desired start sample (inclusive).
+ * \param end The desired end sample (exklusive), a negative value signals
+ * that it should play to the end.
+ * \exception AUD_Exception Thrown if the reader specified is NULL.
+ */
+ AUD_LimiterReader(AUD_IReader* reader, float start = 0, float end = -1);
+
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_LIMITERREADER
diff --git a/intern/audaspace/FX/AUD_LoopFactory.cpp b/intern/audaspace/FX/AUD_LoopFactory.cpp
new file mode 100644
index 00000000000..90186f623ff
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LoopFactory.cpp
@@ -0,0 +1,57 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_LoopFactory.h"
+#include "AUD_LoopReader.h"
+
+AUD_LoopFactory::AUD_LoopFactory(AUD_IFactory* factory, int loop) :
+ AUD_EffectFactory(factory),
+ m_loop(loop) {}
+
+AUD_LoopFactory::AUD_LoopFactory(int loop) :
+ AUD_EffectFactory(0),
+ m_loop(loop) {}
+
+int AUD_LoopFactory::getLoop()
+{
+ return m_loop;
+}
+
+void AUD_LoopFactory::setLoop(int loop)
+{
+ m_loop = loop;
+}
+
+AUD_IReader* AUD_LoopFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ reader = new AUD_LoopReader(reader, m_loop); AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_LoopFactory.h b/intern/audaspace/FX/AUD_LoopFactory.h
new file mode 100644
index 00000000000..461d8c9ab69
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LoopFactory.h
@@ -0,0 +1,74 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_LOOPFACTORY
+#define AUD_LOOPFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory loops another factory.
+ * \note The reader has to be seekable.
+ */
+class AUD_LoopFactory : public AUD_EffectFactory
+{
+private:
+ /**
+ * The loop count.
+ */
+ float m_loop;
+
+public:
+ /**
+ * Creates a new loop factory.
+ * \param factory The input factory.
+ * \param loop The desired loop count, negative values result in endless
+ * looping.
+ */
+ AUD_LoopFactory(AUD_IFactory* factory = 0, int loop = -1);
+
+ /**
+ * Creates a new loop factory.
+ * \param loop The desired loop count, negative values result in endless
+ * looping.
+ */
+ AUD_LoopFactory(int loop);
+
+ /**
+ * Returns the loop count.
+ */
+ int getLoop();
+
+ /**
+ * Sets the loop count.
+ * \param loop The desired loop count, negative values result in endless
+ * looping.
+ */
+ void setLoop(int loop);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_LOOPFACTORY
diff --git a/intern/audaspace/FX/AUD_LoopReader.cpp b/intern/audaspace/FX/AUD_LoopReader.cpp
new file mode 100644
index 00000000000..9e270321013
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LoopReader.cpp
@@ -0,0 +1,107 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_LoopReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+#include <stdio.h>
+
+AUD_LoopReader::AUD_LoopReader(AUD_IReader* reader, int loop) :
+ AUD_EffectReader(reader), m_loop(loop)
+{
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_LoopReader::~AUD_LoopReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+AUD_ReaderType AUD_LoopReader::getType()
+{
+ if(m_loop < 0)
+ return AUD_TYPE_STREAM;
+ return m_reader->getType();
+}
+
+bool AUD_LoopReader::notify(AUD_Message &message)
+{
+ if(message.type == AUD_MSG_LOOP)
+ {
+ m_loop = message.loopcount;
+
+ m_reader->notify(message);
+
+ return true;
+ }
+ return m_reader->notify(message);
+}
+
+void AUD_LoopReader::read(int & length, sample_t* & buffer)
+{
+ int samplesize = AUD_SAMPLE_SIZE(m_reader->getSpecs());
+
+ int len = length;
+
+ m_reader->read(len, buffer);
+
+ if(len < length && m_loop != 0)
+ {
+ int pos = 0;
+
+ if(m_buffer->getSize() < length*samplesize)
+ m_buffer->resize(length*samplesize);
+
+ memcpy(m_buffer->getBuffer() + pos * samplesize,
+ buffer, len * samplesize);
+
+ pos += len;
+
+ while(pos < length && m_loop != 0)
+ {
+ if(m_loop > 0)
+ m_loop--;
+
+ m_reader->seek(0);
+
+ len = length - pos;
+ m_reader->read(len, buffer);
+ // prevent endless loop
+ if(!len)
+ break;
+
+ memcpy(m_buffer->getBuffer() + pos * samplesize,
+ buffer, len * samplesize);
+
+ pos += len;
+ }
+
+ length = pos;
+ buffer = m_buffer->getBuffer();
+ }
+ else
+ length = len;
+}
diff --git a/intern/audaspace/FX/AUD_LoopReader.h b/intern/audaspace/FX/AUD_LoopReader.h
new file mode 100644
index 00000000000..621ee3493ab
--- /dev/null
+++ b/intern/audaspace/FX/AUD_LoopReader.h
@@ -0,0 +1,69 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_LOOPREADER
+#define AUD_LOOPREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class reads another reader and loops it.
+ * \note The other reader must be seekable.
+ */
+class AUD_LoopReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The left loop count.
+ */
+ int m_loop;
+
+public:
+ /**
+ * Creates a new loop reader.
+ * \param reader The reader to read from.
+ * \param loop The desired loop count, negative values result in endless
+ * looping.
+ * \exception AUD_Exception Thrown if the reader specified is NULL.
+ */
+ AUD_LoopReader(AUD_IReader* reader, int loop);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_LoopReader();
+
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_LOOPREADER
diff --git a/intern/audaspace/FX/AUD_PingPongFactory.cpp b/intern/audaspace/FX/AUD_PingPongFactory.cpp
new file mode 100644
index 00000000000..a030d581b1a
--- /dev/null
+++ b/intern/audaspace/FX/AUD_PingPongFactory.cpp
@@ -0,0 +1,67 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_PingPongFactory.h"
+#include "AUD_DoubleReader.h"
+#include "AUD_ReverseFactory.h"
+
+AUD_PingPongFactory::AUD_PingPongFactory(AUD_IFactory* factory) :
+ AUD_EffectFactory(factory) {}
+
+AUD_IReader* AUD_PingPongFactory::createReader()
+{
+ if(m_factory == 0)
+ return 0;
+
+ AUD_IReader* reader = m_factory->createReader();
+
+ if(reader != 0)
+ {
+ AUD_IReader* reader2;
+ AUD_ReverseFactory factory(m_factory);
+
+ try
+ {
+ reader2 = factory.createReader();
+ }
+ catch(AUD_Exception e)
+ {
+ reader2 = 0;
+ }
+
+ if(reader2 != 0)
+ {
+ reader = new AUD_DoubleReader(reader, reader2);
+ AUD_NEW("reader")
+ }
+ else
+ {
+ delete reader; AUD_DELETE("reader")
+ reader = 0;
+ }
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_PingPongFactory.h b/intern/audaspace/FX/AUD_PingPongFactory.h
new file mode 100644
index 00000000000..b8854da550a
--- /dev/null
+++ b/intern/audaspace/FX/AUD_PingPongFactory.h
@@ -0,0 +1,51 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_PINGPONGFACTORY
+#define AUD_PINGPONGFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory plays another factory first normal, then reversed.
+ * \note Readers from the underlying factory must be from the buffer type.
+ */
+class AUD_PingPongFactory : public AUD_EffectFactory
+{
+public:
+ /**
+ * Creates a new ping pong factory.
+ * \param factory The input factory.
+ */
+ AUD_PingPongFactory(AUD_IFactory* factory = 0);
+
+ /**
+ * Destroys the factory.
+ */
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_PINGPONGFACTORY
diff --git a/intern/audaspace/FX/AUD_PitchFactory.cpp b/intern/audaspace/FX/AUD_PitchFactory.cpp
new file mode 100644
index 00000000000..5f814283c12
--- /dev/null
+++ b/intern/audaspace/FX/AUD_PitchFactory.cpp
@@ -0,0 +1,48 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_PitchFactory.h"
+#include "AUD_PitchReader.h"
+#include "AUD_Space.h"
+
+AUD_PitchFactory::AUD_PitchFactory(AUD_IFactory* factory, float pitch) :
+ AUD_EffectFactory(factory),
+ m_pitch(pitch) {}
+
+AUD_PitchFactory::AUD_PitchFactory(float pitch) :
+ AUD_EffectFactory(0),
+ m_pitch(pitch) {}
+
+AUD_IReader* AUD_PitchFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ reader = new AUD_PitchReader(reader, m_pitch); AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_PitchFactory.h b/intern/audaspace/FX/AUD_PitchFactory.h
new file mode 100644
index 00000000000..3209aa46983
--- /dev/null
+++ b/intern/audaspace/FX/AUD_PitchFactory.h
@@ -0,0 +1,70 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_PITCHFACTORY
+#define AUD_PITCHFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory changes the pitch of another factory.
+ */
+class AUD_PitchFactory : public AUD_EffectFactory
+{
+private:
+ /**
+ * The pitch.
+ */
+ float m_pitch;
+
+public:
+ /**
+ * Creates a new pitch factory.
+ * \param factory The input factory.
+ * \param pitch The desired pitch.
+ */
+ AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0);
+
+ /**
+ * Creates a new pitch factory.
+ * \param pitch The desired pitch.
+ */
+ AUD_PitchFactory(float pitch);
+
+ /**
+ * Returns the pitch.
+ */
+ float getPitch();
+
+ /**
+ * Sets the pitch.
+ * \param pitch The new pitch value. Should be between 0.0 and 1.0.
+ */
+ void setPitch(float pitch);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_PITCHFACTORY
diff --git a/intern/audaspace/FX/AUD_PitchReader.cpp b/intern/audaspace/FX/AUD_PitchReader.cpp
new file mode 100644
index 00000000000..c53264e1350
--- /dev/null
+++ b/intern/audaspace/FX/AUD_PitchReader.cpp
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_PitchReader.h"
+
+AUD_PitchReader::AUD_PitchReader(AUD_IReader* reader, float pitch) :
+ AUD_EffectReader(reader)
+{
+ m_pitch = pitch;
+}
+
+AUD_Specs AUD_PitchReader::getSpecs()
+{
+ AUD_Specs specs = m_reader->getSpecs();
+ specs.rate = (AUD_SampleRate)((int)(specs.rate * m_pitch));
+ return specs;
+}
diff --git a/intern/audaspace/FX/AUD_PitchReader.h b/intern/audaspace/FX/AUD_PitchReader.h
new file mode 100644
index 00000000000..440e9cc843c
--- /dev/null
+++ b/intern/audaspace/FX/AUD_PitchReader.h
@@ -0,0 +1,54 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_PITCHREADER
+#define AUD_PITCHREADER
+
+#include "AUD_EffectReader.h"
+
+/**
+ * This class reads another reader and changes it's pitch.
+ */
+class AUD_PitchReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The pitch level.
+ */
+ float m_pitch;
+
+public:
+ /**
+ * Creates a new pitch reader.
+ * \param reader The reader to read from.
+ * \param pitch The size of the buffer.
+ * \exception AUD_Exception Thrown if the reader specified is NULL.
+ */
+ AUD_PitchReader(AUD_IReader* reader, float pitch);
+
+ virtual AUD_Specs getSpecs();
+};
+
+#endif //AUD_PITCHREADER
diff --git a/intern/audaspace/FX/AUD_ReverseFactory.cpp b/intern/audaspace/FX/AUD_ReverseFactory.cpp
new file mode 100644
index 00000000000..1242641c350
--- /dev/null
+++ b/intern/audaspace/FX/AUD_ReverseFactory.cpp
@@ -0,0 +1,43 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_ReverseFactory.h"
+#include "AUD_ReverseReader.h"
+#include "AUD_Space.h"
+
+AUD_ReverseFactory::AUD_ReverseFactory(AUD_IFactory* factory) :
+ AUD_EffectFactory(factory) {}
+
+AUD_IReader* AUD_ReverseFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ reader = new AUD_ReverseReader(reader); AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_ReverseFactory.h b/intern/audaspace/FX/AUD_ReverseFactory.h
new file mode 100644
index 00000000000..4b664c47281
--- /dev/null
+++ b/intern/audaspace/FX/AUD_ReverseFactory.h
@@ -0,0 +1,50 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_REVERSEFACTORY
+#define AUD_REVERSEFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory reads another factory reverted.
+ * \note Readers from the underlying factory must be from the buffer type.
+ */
+class AUD_ReverseFactory : public AUD_EffectFactory
+{
+public:
+ /**
+ * Creates a new reverse factory.
+ * \param factory The input factory.
+ */
+ AUD_ReverseFactory(AUD_IFactory* factory = 0);
+
+ /**
+ * Destroys the factory.
+ */
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_REVERSEFACTORY
diff --git a/intern/audaspace/FX/AUD_ReverseReader.cpp b/intern/audaspace/FX/AUD_ReverseReader.cpp
new file mode 100644
index 00000000000..043480b91b9
--- /dev/null
+++ b/intern/audaspace/FX/AUD_ReverseReader.cpp
@@ -0,0 +1,111 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_ReverseReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_ReverseReader::AUD_ReverseReader(AUD_IReader* reader) :
+ AUD_EffectReader(reader)
+{
+ if(reader->getType() != AUD_TYPE_BUFFER)
+ AUD_THROW(AUD_ERROR_READER);
+
+ m_length = reader->getLength();
+ if(m_length < 0)
+ AUD_THROW(AUD_ERROR_READER);
+
+ m_position = 0;
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_ReverseReader::~AUD_ReverseReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+void AUD_ReverseReader::seek(int position)
+{
+ m_position = position;
+}
+
+int AUD_ReverseReader::getLength()
+{
+ return m_length;
+}
+
+int AUD_ReverseReader::getPosition()
+{
+ return m_position;
+}
+
+void AUD_ReverseReader::read(int & length, sample_t* & buffer)
+{
+ // first correct the length
+ if(m_position+length > m_length)
+ length = m_length-m_position;
+
+ if(length <= 0)
+ {
+ length = 0;
+ return;
+ }
+
+ int samplesize = AUD_SAMPLE_SIZE(getSpecs());
+
+ // resize buffer if needed
+ if(m_buffer->getSize() < length * samplesize)
+ m_buffer->resize(length * samplesize);
+
+ buffer = m_buffer->getBuffer();
+
+ sample_t* buf;
+ int len = length;
+
+ // read from reader
+ m_reader->seek(m_length-m_position-len);
+ m_reader->read(len, buf);
+
+ // set null if reader didn't give enough data
+ if(len < length)
+ {
+ if(getSpecs().format == AUD_FORMAT_U8)
+ memset(buffer, 0x80, (length-len)*samplesize);
+ else
+ memset(buffer, 0, (length-len)*samplesize);
+ buffer += length-len;
+ }
+
+ // copy the samples reverted
+ for(int i = 0; i < len; i++)
+ memcpy(buffer + i * samplesize,
+ buf + (len - 1 - i) * samplesize,
+ samplesize);
+
+ m_position += length;
+
+ buffer = m_buffer->getBuffer();
+}
diff --git a/intern/audaspace/FX/AUD_ReverseReader.h b/intern/audaspace/FX/AUD_ReverseReader.h
new file mode 100644
index 00000000000..045d2ac5a8e
--- /dev/null
+++ b/intern/audaspace/FX/AUD_ReverseReader.h
@@ -0,0 +1,74 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_REVERSEREADER
+#define AUD_REVERSEREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class reads another reader from back to front.
+ * \note The underlying reader must be a buffer.
+ */
+class AUD_ReverseReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The current position.
+ */
+ int m_position;
+
+ /**
+ * The sample count.
+ */
+ int m_length;
+
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer* m_buffer;
+
+public:
+ /**
+ * Creates a new reverse reader.
+ * \param reader The reader to read from.
+ * \exception AUD_Exception Thrown if the reader specified is NULL or not
+ * a buffer.
+ */
+ AUD_ReverseReader(AUD_IReader* reader);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_ReverseReader();
+
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_REVERSEREADER
diff --git a/intern/audaspace/FX/AUD_VolumeFactory.cpp b/intern/audaspace/FX/AUD_VolumeFactory.cpp
new file mode 100644
index 00000000000..fbde608aa12
--- /dev/null
+++ b/intern/audaspace/FX/AUD_VolumeFactory.cpp
@@ -0,0 +1,57 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_VolumeFactory.h"
+#include "AUD_VolumeReader.h"
+
+AUD_VolumeFactory::AUD_VolumeFactory(AUD_IFactory* factory, float volume) :
+ AUD_EffectFactory(factory),
+ m_volume(volume) {}
+
+AUD_VolumeFactory::AUD_VolumeFactory(float volume) :
+ AUD_EffectFactory(0),
+ m_volume(volume) {}
+
+float AUD_VolumeFactory::getVolume()
+{
+ return m_volume;
+}
+
+void AUD_VolumeFactory::setVolume(float volume)
+{
+ m_volume = volume;
+}
+
+AUD_IReader* AUD_VolumeFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ reader = new AUD_VolumeReader(reader, m_volume); AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/FX/AUD_VolumeFactory.h b/intern/audaspace/FX/AUD_VolumeFactory.h
new file mode 100644
index 00000000000..d2812536d83
--- /dev/null
+++ b/intern/audaspace/FX/AUD_VolumeFactory.h
@@ -0,0 +1,72 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_VOLUMEFACTORY
+#define AUD_VOLUMEFACTORY
+
+#include "AUD_EffectFactory.h"
+
+/**
+ * This factory changes the volume of another factory.
+ * The set volume should be a value between 0.0 and 1.0, higher values at your
+ * own risk!
+ */
+class AUD_VolumeFactory : public AUD_EffectFactory
+{
+private:
+ /**
+ * The volume.
+ */
+ float m_volume;
+
+public:
+ /**
+ * Creates a new volume factory.
+ * \param factory The input factory.
+ * \param volume The desired volume.
+ */
+ AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0);
+
+ /**
+ * Creates a new volume factory.
+ * \param volume The desired volume.
+ */
+ AUD_VolumeFactory(float volume);
+
+ /**
+ * Returns the volume.
+ */
+ float getVolume();
+
+ /**
+ * Sets the volume.
+ * \param volume The new volume value. Should be between 0.0 and 1.0.
+ */
+ void setVolume(float volume);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_VOLUMEFACTORY
diff --git a/intern/audaspace/FX/AUD_VolumeReader.cpp b/intern/audaspace/FX/AUD_VolumeReader.cpp
new file mode 100644
index 00000000000..fc3f20152a6
--- /dev/null
+++ b/intern/audaspace/FX/AUD_VolumeReader.cpp
@@ -0,0 +1,97 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_VolumeReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_VolumeReader::AUD_VolumeReader(AUD_IReader* reader, float volume) :
+ AUD_EffectReader(reader),
+ m_volume(volume)
+{
+ int bigendian = 1;
+ bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
+
+ switch(m_reader->getSpecs().format)
+ {
+ case AUD_FORMAT_S16:
+ m_adjust = AUD_volume_adjust<int16_t>;
+ break;
+ case AUD_FORMAT_S32:
+ m_adjust = AUD_volume_adjust<int32_t>;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_adjust = AUD_volume_adjust<float>;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_adjust = AUD_volume_adjust<double>;
+ break;
+ case AUD_FORMAT_U8:
+ m_adjust = AUD_volume_adjust_u8;
+ break;
+ case AUD_FORMAT_S24:
+ m_adjust = bigendian ? AUD_volume_adjust_s24_be :
+ AUD_volume_adjust_s24_le;
+ break;
+ default:
+ delete m_reader;
+ AUD_THROW(AUD_ERROR_READER);
+ }
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_VolumeReader::~AUD_VolumeReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+bool AUD_VolumeReader::notify(AUD_Message &message)
+{
+ if(message.type == AUD_MSG_VOLUME)
+ {
+ m_volume = message.volume;
+
+ m_reader->notify(message);
+
+ return true;
+ }
+ return m_reader->notify(message);
+}
+
+void AUD_VolumeReader::read(int & length, sample_t* & buffer)
+{
+ sample_t* buf;
+ AUD_Specs specs = m_reader->getSpecs();
+
+ m_reader->read(length, buf);
+ if(m_buffer->getSize() < length*AUD_SAMPLE_SIZE(specs))
+ m_buffer->resize(length*AUD_SAMPLE_SIZE(specs));
+
+ buffer = m_buffer->getBuffer();
+
+ m_adjust(buffer, buf, length * specs.channels, m_volume);
+}
diff --git a/intern/audaspace/FX/AUD_VolumeReader.h b/intern/audaspace/FX/AUD_VolumeReader.h
new file mode 100644
index 00000000000..f38ae4d265c
--- /dev/null
+++ b/intern/audaspace/FX/AUD_VolumeReader.h
@@ -0,0 +1,72 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_VOLUMEREADER
+#define AUD_VOLUMEREADER
+
+#include "AUD_EffectReader.h"
+#include "AUD_ConverterFunctions.h"
+class AUD_Buffer;
+
+/**
+ * This class reads another reader and changes it's volume.
+ */
+class AUD_VolumeReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The volume level.
+ */
+ float m_volume;
+
+ /**
+ * Volume adjustment function.
+ */
+ AUD_volume_adjust_f m_adjust;
+
+public:
+ /**
+ * Creates a new volume reader.
+ * \param reader The reader to read from.
+ * \param volume The size of the buffer.
+ * \exception AUD_Exception Thrown if the reader specified is NULL.
+ */
+ AUD_VolumeReader(AUD_IReader* reader, float volume);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_VolumeReader();
+
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_VOLUMEREADER
diff --git a/intern/SoundSystem/dummy/Makefile b/intern/audaspace/FX/Makefile
index 829135dde98..bda0e2bdab6 100644
--- a/intern/SoundSystem/dummy/Makefile
+++ b/intern/audaspace/FX/Makefile
@@ -28,15 +28,16 @@
#
#
-LIBNAME = DummySoundSystem
-DIR = $(OCGDIR)/intern/$(LIBNAME)
+LIBNAME = aud_fx
+DIR = $(OCGDIR)/intern/audaspace
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
-CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_MOTO)/include
+CPPFLAGS += -I../ffmpeg
CPPFLAGS += -I../intern
+CPPFLAGS += -I../SDL
+CPPFLAGS += -I../SRC
CPPFLAGS += -I..
CPPFLAGS += -I.
diff --git a/intern/audaspace/Makefile b/intern/audaspace/Makefile
new file mode 100644
index 00000000000..474f53f0e0f
--- /dev/null
+++ b/intern/audaspace/Makefile
@@ -0,0 +1,106 @@
+# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
+# vim: tabstop=8
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): GSR
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+#
+
+include nan_definitions.mk
+
+LIBNAME = audaspace
+SOURCEDIR = intern/audaspace
+DIR = $(OCGDIR)/$(SOURCEDIR)
+DIRS = intern
+DIRS += FX
+DIRS += SDL
+DIRS += SRC
+
+ifeq ($(WITH_FFMPEG),true)
+ DIRS += ffmpeg
+endif
+
+ifeq ($(WITH_OPENAL),true)
+ DIRS += OpenAL
+endif
+
+ifeq ($(WITH_JACK),true)
+ DIRS += jack
+endif
+
+ifeq ($(WITH_SNDFILE),true)
+ DIRS += sndfile
+endif
+
+include nan_subdirs.mk
+
+install: $(ALL_OR_DEBUG)
+ @[ -d $(NAN_AUDASPACE) ] || mkdir $(NAN_AUDASPACE)
+ @[ -d $(NAN_AUDASPACE)/include ] || mkdir $(NAN_AUDASPACE)/include
+ @[ -d $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
+ @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaudaspace.a $(DIR)/$(DEBUG_DIR)libaud_sdl.a $(DIR)/$(DEBUG_DIR)libaud_fx.a $(DIR)/$(DEBUG_DIR)libaud_src.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
+
+ifeq ($(WITH_FFMPEG),true)
+ @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_ffmpeg.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
+endif
+
+ifeq ($(WITH_OPENAL),true)
+ @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_openal.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
+endif
+
+ifeq ($(WITH_JACK),true)
+ @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_jack.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
+endif
+
+ifeq ($(WITH_SNDFILE),true)
+ @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_sndfile.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
+endif
+
+ifeq ($(OS),darwin)
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sdl.a
+
+ifeq ($(WITH_FFMPEG),true)
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_ffmpeg.a
+endif
+
+ifeq ($(WITH_OPENAL),true)
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_openal.a
+endif
+
+ifeq ($(WITH_JACK),true)
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_jack.a
+endif
+
+ifeq ($(WITH_SNDFILE),true)
+ ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sndfile.a
+endif
+
+endif
+ @../tools/cpifdiff.sh intern/*.h $(NAN_AUDASPACE)/include/
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
new file mode 100644
index 00000000000..f94b11a11b8
--- /dev/null
+++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
@@ -0,0 +1,1362 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_OpenALDevice.h"
+#include "AUD_IReader.h"
+#include "AUD_IMixer.h"
+#include "AUD_ConverterFactory.h"
+#include "AUD_SourceCaps.h"
+
+#include <cstring>
+#include <limits>
+
+#ifdef WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+#define AUD_OPENAL_CYCLE_BUFFERS 3
+
+/// Saves the data for playback.
+struct AUD_OpenALHandle : AUD_Handle
+{
+ /// Whether it's a buffered or a streamed source.
+ bool isBuffered;
+
+ /// The reader source.
+ AUD_IReader* reader;
+
+ /// Whether to keep the source if end of it is reached.
+ bool keep;
+
+ /// OpenAL sample format.
+ ALenum format;
+
+ /// OpenAL source.
+ ALuint source;
+
+ /// OpenAL buffers.
+ ALuint buffers[AUD_OPENAL_CYCLE_BUFFERS];
+
+ /// The first buffer to be read next.
+ int current;
+
+ /// Whether the stream doesn't return any more data.
+ bool data_end;
+};
+
+struct AUD_OpenALBufferedFactory
+{
+ /// The factory.
+ AUD_IFactory* factory;
+
+ /// The OpenAL buffer.
+ ALuint buffer;
+};
+
+typedef std::list<AUD_OpenALHandle*>::iterator AUD_HandleIterator;
+typedef std::list<AUD_OpenALBufferedFactory*>::iterator AUD_BFIterator;
+
+/******************************************************************************/
+/**************************** Threading Code **********************************/
+/******************************************************************************/
+
+void* AUD_openalRunThread(void* device)
+{
+ AUD_OpenALDevice* dev = (AUD_OpenALDevice*)device;
+ dev->updateStreams();
+ return NULL;
+}
+
+void AUD_OpenALDevice::start()
+{
+ lock();
+
+ if(!m_playing)
+ {
+ pthread_attr_t attr;
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+
+ pthread_create(&m_thread, &attr, AUD_openalRunThread, this);
+
+ pthread_attr_destroy(&attr);
+
+ m_playing = true;
+ }
+
+ unlock();
+}
+
+void AUD_OpenALDevice::updateStreams()
+{
+ AUD_OpenALHandle* sound;
+
+ int length;
+ sample_t* buffer;
+
+ ALint info;
+ AUD_Specs specs;
+
+ while(1)
+ {
+ lock();
+
+ alcSuspendContext(m_context);
+
+ // for all sounds
+ AUD_HandleIterator it = m_playingSounds->begin();
+ while(it != m_playingSounds->end())
+ {
+ sound = *it;
+ // increment the iterator to make sure it's valid,
+ // in case the sound gets deleted after stopping
+ ++it;
+
+ // is it a streamed sound?
+ if(!sound->isBuffered)
+ {
+ // check for buffer refilling
+ alGetSourcei(sound->source, AL_BUFFERS_PROCESSED, &info);
+
+ if(info)
+ {
+ specs = sound->reader->getSpecs();
+
+ // for all empty buffers
+ while(info--)
+ {
+ // if there's still data to play back
+ if(!sound->data_end)
+ {
+ // read data
+ length = m_buffersize;
+ sound->reader->read(length, buffer);
+
+ // read nothing?
+ if(length == 0)
+ {
+ sound->data_end = true;
+ break;
+ }
+
+ // unqueue buffer
+ alSourceUnqueueBuffers(sound->source, 1,
+ &sound->buffers[sound->current]);
+ ALenum err;
+ if((err = alGetError()) != AL_NO_ERROR)
+ {
+ sound->data_end = true;
+ break;
+ }
+
+ // fill with new data
+ alBufferData(sound->buffers[sound->current],
+ sound->format,
+ buffer,
+ length * AUD_SAMPLE_SIZE(specs),
+ specs.rate);
+
+ if(alGetError() != AL_NO_ERROR)
+ {
+ sound->data_end = true;
+ break;
+ }
+
+ // and queue again
+ alSourceQueueBuffers(sound->source, 1,
+ &sound->buffers[sound->current]);
+ if(alGetError() != AL_NO_ERROR)
+ {
+ sound->data_end = true;
+ break;
+ }
+
+ sound->current = (sound->current+1) %
+ AUD_OPENAL_CYCLE_BUFFERS;
+ }
+ else
+ break;
+ }
+ }
+ }
+
+ // check if the sound has been stopped
+ alGetSourcei(sound->source, AL_SOURCE_STATE, &info);
+
+ if(info != AL_PLAYING)
+ {
+ // if it really stopped
+ if(sound->data_end)
+ {
+ // pause or
+ if(sound->keep)
+ pause(sound);
+ // stop
+ else
+ stop(sound);
+ }
+ // continue playing
+ else
+ alSourcePlay(sound->source);
+ }
+ }
+
+ alcProcessContext(m_context);
+
+ // stop thread
+ if(m_playingSounds->empty())
+ {
+ unlock();
+ m_playing = false;
+ pthread_exit(NULL);
+ }
+
+ unlock();
+
+#ifdef WIN32
+ Sleep(20);
+#else
+ usleep(20000);
+#endif
+ }
+}
+
+/******************************************************************************/
+/**************************** IDevice Code ************************************/
+/******************************************************************************/
+
+bool AUD_OpenALDevice::isValid(AUD_Handle* handle)
+{
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ if(*i == handle)
+ return true;
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ if(*i == handle)
+ return true;
+ return false;
+}
+
+AUD_OpenALDevice::AUD_OpenALDevice(AUD_Specs specs, int buffersize)
+{
+ // cannot determine how many channels or which format OpenAL uses, but
+ // it at least is able to play 16 bit stereo audio
+ specs.channels = AUD_CHANNELS_STEREO;
+ specs.format = AUD_FORMAT_S16;
+
+ m_device = alcOpenDevice(NULL);
+
+ if(!m_device)
+ AUD_THROW(AUD_ERROR_OPENAL);
+
+ // at least try to set the frequency
+ ALCint attribs[] = { ALC_FREQUENCY, specs.rate, 0 };
+ ALCint* attributes = attribs;
+ if(specs.rate == AUD_RATE_INVALID)
+ attributes = NULL;
+
+ m_context = alcCreateContext(m_device, attributes);
+ alcMakeContextCurrent(m_context);
+
+ alcGetIntegerv(m_device, ALC_FREQUENCY, 1, (ALCint*)&specs.rate);
+
+ // check for specific formats and channel counts to be played back
+ if(alIsExtensionPresent("AL_EXT_FLOAT32") == AL_TRUE)
+ specs.format = AUD_FORMAT_FLOAT32;
+
+ m_useMC = alIsExtensionPresent("AL_EXT_MCFORMATS") == AL_TRUE;
+
+ alGetError();
+
+ m_converter = new AUD_ConverterFactory(specs); AUD_NEW("factory")
+
+ m_specs = specs;
+ m_buffersize = buffersize;
+ m_playing = false;
+
+ m_playingSounds = new std::list<AUD_OpenALHandle*>(); AUD_NEW("list")
+ m_pausedSounds = new std::list<AUD_OpenALHandle*>(); AUD_NEW("list")
+ m_bufferedFactories = new std::list<AUD_OpenALBufferedFactory*>();
+ AUD_NEW("list")
+
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+
+ pthread_mutex_init(&m_mutex, &attr);
+
+ pthread_mutexattr_destroy(&attr);
+}
+
+AUD_OpenALDevice::~AUD_OpenALDevice()
+{
+ AUD_OpenALHandle* sound;
+
+ lock();
+ alcSuspendContext(m_context);
+
+ // delete all playing sounds
+ while(!m_playingSounds->empty())
+ {
+ sound = *(m_playingSounds->begin());
+ alDeleteSources(1, &sound->source);
+ if(!sound->isBuffered)
+ {
+ delete sound->reader; AUD_DELETE("reader")
+ alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers);
+ }
+ delete sound; AUD_DELETE("handle")
+ m_playingSounds->erase(m_playingSounds->begin());
+ }
+
+ // delete all paused sounds
+ while(!m_pausedSounds->empty())
+ {
+ sound = *(m_pausedSounds->begin());
+ alDeleteSources(1, &sound->source);
+ if(!sound->isBuffered)
+ {
+ delete sound->reader; AUD_DELETE("reader")
+ alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers);
+ }
+ delete sound; AUD_DELETE("handle")
+ m_pausedSounds->erase(m_pausedSounds->begin());
+ }
+
+ // delete all buffered factories
+ while(!m_bufferedFactories->empty())
+ {
+ alDeleteBuffers(1, &(*(m_bufferedFactories->begin()))->buffer);
+ delete *m_bufferedFactories->begin(); AUD_DELETE("bufferedfactory");
+ m_bufferedFactories->erase(m_bufferedFactories->begin());
+ }
+
+ alcProcessContext(m_context);
+
+ // wait for the thread to stop
+ if(m_playing)
+ {
+ unlock();
+ pthread_join(m_thread, NULL);
+ }
+ else
+ unlock();
+
+ delete m_playingSounds; AUD_DELETE("list")
+ delete m_pausedSounds; AUD_DELETE("list")
+ delete m_bufferedFactories; AUD_DELETE("list")
+
+ // quit OpenAL
+ alcMakeContextCurrent(NULL);
+ alcDestroyContext(m_context);
+ alcCloseDevice(m_device);
+
+ delete m_converter; AUD_DELETE("factory")
+
+ pthread_mutex_destroy(&m_mutex);
+}
+
+AUD_Specs AUD_OpenALDevice::getSpecs()
+{
+ return m_specs;
+}
+
+bool AUD_OpenALDevice::getFormat(ALenum &format, AUD_Specs specs)
+{
+ bool valid = true;
+ format = 0;
+
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ switch(specs.channels)
+ {
+ case AUD_CHANNELS_MONO:
+ format = AL_FORMAT_MONO8;
+ break;
+ case AUD_CHANNELS_STEREO:
+ format = AL_FORMAT_STEREO8;
+ break;
+ case AUD_CHANNELS_SURROUND4:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_QUAD8");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND51:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_51CHN8");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND61:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_61CHN8");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND71:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_71CHN8");
+ break;
+ }
+ default:
+ valid = false;
+ }
+ break;
+ case AUD_FORMAT_S16:
+ switch(specs.channels)
+ {
+ case AUD_CHANNELS_MONO:
+ format = AL_FORMAT_MONO16;
+ break;
+ case AUD_CHANNELS_STEREO:
+ format = AL_FORMAT_STEREO16;
+ break;
+ case AUD_CHANNELS_SURROUND4:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_QUAD16");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND51:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_51CHN16");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND61:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_61CHN16");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND71:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_71CHN16");
+ break;
+ }
+ default:
+ valid = false;
+ }
+ break;
+ case AUD_FORMAT_FLOAT32:
+ switch(specs.channels)
+ {
+ case AUD_CHANNELS_MONO:
+ format = alGetEnumValue("AL_FORMAT_MONO_FLOAT32");
+ break;
+ case AUD_CHANNELS_STEREO:
+ format = alGetEnumValue("AL_FORMAT_STEREO_FLOAT32");
+ break;
+ case AUD_CHANNELS_SURROUND4:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_QUAD32");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND51:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_51CHN32");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND61:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_61CHN32");
+ break;
+ }
+ case AUD_CHANNELS_SURROUND71:
+ if(m_useMC)
+ {
+ format = alGetEnumValue("AL_FORMAT_71CHN32");
+ break;
+ }
+ default:
+ valid = false;
+ }
+ break;
+ default:
+ valid = false;
+ }
+
+ if(!format)
+ valid = false;
+
+ return valid;
+}
+
+AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep)
+{
+ // check if it is a buffered factory
+ for(AUD_BFIterator i = m_bufferedFactories->begin();
+ i != m_bufferedFactories->end(); i++)
+ {
+ if((*i)->factory == factory)
+ {
+ // create the handle
+ AUD_OpenALHandle* sound = new AUD_OpenALHandle; AUD_NEW("handle")
+ sound->keep = keep;
+ sound->current = -1;
+ sound->isBuffered = true;
+ sound->data_end = true;
+
+ alcSuspendContext(m_context);
+
+ // OpenAL playback code
+ try
+ {
+ alGenSources(1, &sound->source);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+
+ try
+ {
+ alSourcei(sound->source, AL_BUFFER, (*i)->buffer);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+ }
+ catch(AUD_Exception e)
+ {
+ alDeleteSources(1, &sound->source);
+ throw;
+ }
+ }
+ catch(AUD_Exception e)
+ {
+ delete sound; AUD_DELETE("handle")
+ alcProcessContext(m_context);
+ unlock();
+ throw;
+ }
+
+ // play sound
+ m_playingSounds->push_back(sound);
+
+ alSourcei(sound->source, AL_SOURCE_RELATIVE, 1);
+ start();
+
+ alcProcessContext(m_context);
+ unlock();
+
+ return sound;
+ }
+ }
+
+ AUD_IReader* reader = factory->createReader();
+
+ if(reader == NULL)
+ AUD_THROW(AUD_ERROR_READER);
+
+ AUD_Specs specs;
+
+ specs = reader->getSpecs();
+
+ // check format
+ bool valid = true;
+
+ if(specs.format == AUD_FORMAT_INVALID)
+ valid = false;
+ else if(specs.format == AUD_FORMAT_S24 ||
+ specs.format == AUD_FORMAT_S32 ||
+ specs.format == AUD_FORMAT_FLOAT32 ||
+ specs.format == AUD_FORMAT_FLOAT64)
+ {
+ m_converter->setReader(reader);
+ reader = m_converter->createReader();
+ specs = reader->getSpecs();
+ }
+
+ // create the handle
+ AUD_OpenALHandle* sound = new AUD_OpenALHandle; AUD_NEW("handle")
+ sound->keep = keep;
+ sound->reader = reader;
+ sound->current = 0;
+ sound->isBuffered = false;
+ sound->data_end = false;
+
+ valid &= getFormat(sound->format, specs);
+
+ if(!valid)
+ {
+ delete sound; AUD_DELETE("handle")
+ delete reader; AUD_DELETE("reader")
+ return NULL;
+ }
+
+ lock();
+ alcSuspendContext(m_context);
+
+ // OpenAL playback code
+ try
+ {
+ alGenBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+
+ try
+ {
+ sample_t* buf;
+ int length;
+
+ for(int i = 0; i < AUD_OPENAL_CYCLE_BUFFERS; i++)
+ {
+ length = m_buffersize;
+ reader->read(length, buf);
+ alBufferData(sound->buffers[i], sound->format, buf,
+ length * AUD_SAMPLE_SIZE(specs), specs.rate);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+ }
+
+ alGenSources(1, &sound->source);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+
+ try
+ {
+ alSourceQueueBuffers(sound->source, AUD_OPENAL_CYCLE_BUFFERS,
+ sound->buffers);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+ }
+ catch(AUD_Exception e)
+ {
+ alDeleteSources(1, &sound->source);
+ throw;
+ }
+ }
+ catch(AUD_Exception e)
+ {
+ alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers);
+ throw;
+ }
+ }
+ catch(AUD_Exception e)
+ {
+ delete sound; AUD_DELETE("handle")
+ delete reader; AUD_DELETE("reader")
+ alcProcessContext(m_context);
+ unlock();
+ throw;
+ }
+
+ // play sound
+ m_playingSounds->push_back(sound);
+ alSourcei(sound->source, AL_SOURCE_RELATIVE, 1);
+
+ start();
+
+ alcProcessContext(m_context);
+ unlock();
+
+ return sound;
+}
+
+bool AUD_OpenALDevice::pause(AUD_Handle* handle)
+{
+ // only songs that are played can be paused
+ lock();
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ m_pausedSounds->push_back(*i);
+ alSourcePause((*i)->source);
+ m_playingSounds->erase(i);
+ unlock();
+ return true;
+ }
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_OpenALDevice::resume(AUD_Handle* handle)
+{
+ lock();
+
+ // only songs that are paused can be resumed
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ m_playingSounds->push_back(*i);
+ start();
+ m_pausedSounds->erase(i);
+ unlock();
+ return true;
+ }
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_OpenALDevice::stop(AUD_Handle* handle)
+{
+ AUD_OpenALHandle* sound;
+
+ lock();
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ sound = *i;
+ alDeleteSources(1, &sound->source);
+ if(!sound->isBuffered)
+ {
+ delete sound->reader; AUD_DELETE("reader")
+ alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers);
+ }
+ delete *i; AUD_DELETE("handle")
+ m_playingSounds->erase(i);
+ unlock();
+ return true;
+ }
+ }
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ sound = *i;
+ alDeleteSources(1, &sound->source);
+ if(!sound->isBuffered)
+ {
+ delete sound->reader; AUD_DELETE("reader")
+ alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers);
+ }
+ delete *i; AUD_DELETE("handle")
+ m_pausedSounds->erase(i);
+ unlock();
+ return true;
+ }
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_OpenALDevice::setKeep(AUD_Handle* handle, bool keep)
+{
+ lock();
+ if(isValid(handle))
+ {
+ ((AUD_OpenALHandle*)handle)->keep = keep;
+ unlock();
+ return true;
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_OpenALDevice::sendMessage(AUD_Handle* handle, AUD_Message &message)
+{
+ lock();
+
+ bool result = false;
+
+ if(handle == 0)
+ {
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ if(!(*i)->isBuffered)
+ result |= (*i)->reader->notify(message);
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ if(!(*i)->isBuffered)
+ result |= (*i)->reader->notify(message);
+ }
+ else if(isValid(handle))
+ if(!((AUD_OpenALHandle*)handle)->isBuffered)
+ result = ((AUD_OpenALHandle*)handle)->reader->notify(message);
+ unlock();
+ return result;
+}
+
+bool AUD_OpenALDevice::seek(AUD_Handle* handle, float position)
+{
+ lock();
+
+ if(isValid(handle))
+ {
+ AUD_OpenALHandle* alhandle = (AUD_OpenALHandle*)handle;
+ if(alhandle->isBuffered)
+ alSourcef(alhandle->source, AL_SEC_OFFSET, position);
+ else
+ {
+ alhandle->reader->seek((int)(position *
+ alhandle->reader->getSpecs().rate));
+ alhandle->data_end = false;
+
+ ALint info;
+
+ alGetSourcei(alhandle->source, AL_SOURCE_STATE, &info);
+
+ if(info != AL_PLAYING)
+ {
+ if(info != AL_STOPPED)
+ alSourceStop(alhandle->source);
+
+ alSourceUnqueueBuffers(alhandle->source,
+ AUD_OPENAL_CYCLE_BUFFERS,
+ alhandle->buffers);
+ if(alGetError() == AL_NO_ERROR)
+ {
+ sample_t* buf;
+ int length;
+ AUD_Specs specs = alhandle->reader->getSpecs();
+
+ for(int i = 0; i < AUD_OPENAL_CYCLE_BUFFERS; i++)
+ {
+ length = m_buffersize;
+ alhandle->reader->read(length, buf);
+ alBufferData(alhandle->buffers[i], alhandle->format,
+ buf, length * AUD_SAMPLE_SIZE(specs),
+ specs.rate);
+
+ if(alGetError() != AL_NO_ERROR)
+ break;
+ }
+
+ alSourceQueueBuffers(alhandle->source,
+ AUD_OPENAL_CYCLE_BUFFERS,
+ alhandle->buffers);
+ }
+
+ alSourceRewind(alhandle->source);
+ }
+ }
+ unlock();
+ return true;
+ }
+
+ unlock();
+ return false;
+}
+
+float AUD_OpenALDevice::getPosition(AUD_Handle* handle)
+{
+ lock();
+
+ float position = 0.0;
+
+ if(isValid(handle))
+ {
+ AUD_OpenALHandle* h = (AUD_OpenALHandle*)handle;
+ if(h->isBuffered)
+ alGetSourcef(h->source, AL_SEC_OFFSET, &position);
+ else
+ position = h->reader->getPosition() /
+ (float)h->reader->getSpecs().rate;
+ }
+
+ unlock();
+ return position;
+}
+
+AUD_Status AUD_OpenALDevice::getStatus(AUD_Handle* handle)
+{
+ lock();
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ unlock();
+ return AUD_STATUS_PLAYING;
+ }
+ }
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ unlock();
+ return AUD_STATUS_PAUSED;
+ }
+ }
+ unlock();
+ return AUD_STATUS_INVALID;
+}
+
+void AUD_OpenALDevice::lock()
+{
+ pthread_mutex_lock(&m_mutex);
+}
+
+void AUD_OpenALDevice::unlock()
+{
+ pthread_mutex_unlock(&m_mutex);
+}
+
+/******************************************************************************/
+/**************************** Capabilities Code *******************************/
+/******************************************************************************/
+
+bool AUD_OpenALDevice::checkCapability(int capability)
+{
+ return capability == AUD_CAPS_3D_DEVICE ||
+ capability == AUD_CAPS_VOLUME ||
+ capability == AUD_CAPS_SOURCE_VOLUME ||
+ capability == AUD_CAPS_SOURCE_PITCH ||
+ capability == AUD_CAPS_BUFFERED_FACTORY;
+}
+
+bool AUD_OpenALDevice::setCapability(int capability, void *value)
+{
+ switch(capability)
+ {
+ case AUD_CAPS_VOLUME:
+ alListenerf(AL_GAIN, *((float*)value));
+ return true;
+ case AUD_CAPS_SOURCE_VOLUME:
+ {
+ AUD_SourceCaps* caps = (AUD_SourceCaps*) value;
+ lock();
+ if(isValid(caps->handle))
+ {
+ alSourcef(((AUD_OpenALHandle*)caps->handle)->source,
+ AL_GAIN, caps->value);
+ unlock();
+ return true;
+ }
+ unlock();
+ }
+ break;
+ case AUD_CAPS_SOURCE_PITCH:
+ {
+ AUD_SourceCaps* caps = (AUD_SourceCaps*) value;
+ lock();
+ if(isValid(caps->handle))
+ {
+ alSourcef(((AUD_OpenALHandle*)caps->handle)->source,
+ AL_PITCH, caps->value);
+ unlock();
+ return true;
+ }
+ unlock();
+ }
+ break;
+ case AUD_CAPS_BUFFERED_FACTORY:
+ {
+ AUD_IFactory* factory = (AUD_IFactory*) value;
+
+ // load the factory into an OpenAL buffer
+ if(factory)
+ {
+ lock();
+ for(AUD_BFIterator i = m_bufferedFactories->begin();
+ i != m_bufferedFactories->end(); i++)
+ {
+ if((*i)->factory == factory)
+ {
+ unlock();
+ return true;
+ }
+ }
+ unlock();
+
+ AUD_IReader* reader = factory->createReader();
+
+ if(reader == NULL)
+ return false;
+
+ AUD_Specs specs;
+
+ specs = reader->getSpecs();
+
+ // determine format
+ bool valid = reader->getType() == AUD_TYPE_BUFFER;
+
+ if(valid)
+ {
+ if(specs.format == AUD_FORMAT_INVALID)
+ valid = false;
+ else if(specs.format == AUD_FORMAT_S24 ||
+ specs.format == AUD_FORMAT_S32 ||
+ specs.format == AUD_FORMAT_FLOAT32 ||
+ specs.format == AUD_FORMAT_FLOAT64)
+ {
+ m_converter->setReader(reader);
+ reader = m_converter->createReader();
+ specs = reader->getSpecs();
+ }
+ }
+
+ ALenum format;
+
+ if(valid)
+ valid = getFormat(format, specs);
+
+ if(!valid)
+ {
+ delete reader; AUD_DELETE("reader")
+ return false;
+ }
+
+ // load into a buffer
+ lock();
+ alcSuspendContext(m_context);
+
+ AUD_OpenALBufferedFactory* bf = new AUD_OpenALBufferedFactory;
+ AUD_NEW("bufferedfactory");
+ bf->factory = factory;
+
+ try
+ {
+ alGenBuffers(1, &bf->buffer);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+
+ try
+ {
+ sample_t* buf;
+ int length = reader->getLength();
+
+ reader->read(length, buf);
+ alBufferData(bf->buffer, format, buf,
+ length * AUD_SAMPLE_SIZE(specs),
+ specs.rate);
+ if(alGetError() != AL_NO_ERROR)
+ AUD_THROW(AUD_ERROR_OPENAL);
+ }
+ catch(AUD_Exception e)
+ {
+ alDeleteBuffers(1, &bf->buffer);
+ throw;
+ }
+ }
+ catch(AUD_Exception e)
+ {
+ delete bf; AUD_DELETE("bufferedfactory")
+ delete reader; AUD_DELETE("reader")
+ alcProcessContext(m_context);
+ unlock();
+ return false;
+ }
+
+ m_bufferedFactories->push_back(bf);
+
+ alcProcessContext(m_context);
+ unlock();
+ }
+ else
+ {
+ // stop all playing and paused buffered sources
+ lock();
+ alcSuspendContext(m_context);
+
+ AUD_OpenALHandle* sound;
+ AUD_HandleIterator it = m_playingSounds->begin();
+ while(it != m_playingSounds->end())
+ {
+ sound = *it;
+ ++it;
+
+ if(sound->isBuffered)
+ stop(sound);
+ }
+ alcProcessContext(m_context);
+
+ while(!m_bufferedFactories->empty())
+ {
+ alDeleteBuffers(1,
+ &(*(m_bufferedFactories->begin()))->buffer);
+ delete *m_bufferedFactories->begin();
+ AUD_DELETE("bufferedfactory");
+ m_bufferedFactories->erase(m_bufferedFactories->begin());
+ }
+ unlock();
+ }
+
+ return true;
+ }
+ break;
+ }
+ return false;
+}
+
+bool AUD_OpenALDevice::getCapability(int capability, void *value)
+{
+ switch(capability)
+ {
+ case AUD_CAPS_VOLUME:
+ alGetListenerf(AL_GAIN, (float*)value);
+ return true;
+ case AUD_CAPS_SOURCE_VOLUME:
+ {
+ AUD_SourceCaps* caps = (AUD_SourceCaps*) value;
+ lock();
+ if(isValid(caps->handle))
+ {
+ alGetSourcef(((AUD_OpenALHandle*)caps->handle)->source,
+ AL_GAIN, &caps->value);
+ unlock();
+ return true;
+ }
+ unlock();
+ }
+ break;
+ case AUD_CAPS_SOURCE_PITCH:
+ {
+ AUD_SourceCaps* caps = (AUD_SourceCaps*) value;
+ lock();
+ if(isValid(caps->handle))
+ {
+ alGetSourcef(((AUD_OpenALHandle*)caps->handle)->source,
+ AL_PITCH, &caps->value);
+ unlock();
+ return true;
+ }
+ unlock();
+ }
+ break;
+ }
+ return false;
+}
+
+/******************************************************************************/
+/**************************** 3D Device Code **********************************/
+/******************************************************************************/
+
+AUD_Handle* AUD_OpenALDevice::play3D(AUD_IFactory* factory, bool keep)
+{
+ AUD_OpenALHandle* handle = (AUD_OpenALHandle*)play(factory, keep);
+ if(handle)
+ alSourcei(handle->source, AL_SOURCE_RELATIVE, 0);
+ return handle;
+}
+
+bool AUD_OpenALDevice::updateListener(AUD_3DData &data)
+{
+ alListenerfv(AL_POSITION, (ALfloat*)data.position);
+ alListenerfv(AL_VELOCITY, (ALfloat*)data.velocity);
+ alListenerfv(AL_ORIENTATION, (ALfloat*)&(data.orientation[3]));
+
+ return true;
+}
+
+bool AUD_OpenALDevice::setSetting(AUD_3DSetting setting, float value)
+{
+ switch(setting)
+ {
+ case AUD_3DS_DISTANCE_MODEL:
+ if(value == AUD_DISTANCE_MODEL_NONE)
+ alDistanceModel(AL_NONE);
+ else if(value == AUD_DISTANCE_MODEL_INVERSE)
+ alDistanceModel(AL_INVERSE_DISTANCE);
+ else if(value == AUD_DISTANCE_MODEL_INVERSE_CLAMPED)
+ alDistanceModel(AL_INVERSE_DISTANCE_CLAMPED);
+ else if(value == AUD_DISTANCE_MODEL_LINEAR)
+ alDistanceModel(AL_LINEAR_DISTANCE);
+ else if(value == AUD_DISTANCE_MODEL_LINEAR_CLAMPED)
+ alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
+ else if(value == AUD_DISTANCE_MODEL_EXPONENT)
+ alDistanceModel(AL_EXPONENT_DISTANCE);
+ else if(value == AUD_DISTANCE_MODEL_EXPONENT_CLAMPED)
+ alDistanceModel(AL_EXPONENT_DISTANCE_CLAMPED);
+ else
+ return false;
+ return true;
+ case AUD_3DS_DOPPLER_FACTOR:
+ alDopplerFactor(value);
+ return true;
+ case AUD_3DS_SPEED_OF_SOUND:
+ alSpeedOfSound(value);
+ return true;
+ default:
+ return false;
+ }
+}
+
+float AUD_OpenALDevice::getSetting(AUD_3DSetting setting)
+{
+ switch(setting)
+ {
+ case AUD_3DS_DISTANCE_MODEL:
+ switch(alGetInteger(AL_DISTANCE_MODEL))
+ {
+ case AL_NONE:
+ return AUD_DISTANCE_MODEL_NONE;
+ case AL_INVERSE_DISTANCE:
+ return AUD_DISTANCE_MODEL_INVERSE;
+ case AL_INVERSE_DISTANCE_CLAMPED:
+ return AUD_DISTANCE_MODEL_INVERSE_CLAMPED;
+ case AL_LINEAR_DISTANCE:
+ return AUD_DISTANCE_MODEL_LINEAR;
+ case AL_LINEAR_DISTANCE_CLAMPED:
+ return AUD_DISTANCE_MODEL_LINEAR_CLAMPED;
+ case AL_EXPONENT_DISTANCE:
+ return AUD_DISTANCE_MODEL_EXPONENT;
+ case AL_EXPONENT_DISTANCE_CLAMPED:
+ return AUD_DISTANCE_MODEL_EXPONENT_CLAMPED;
+ }
+ case AUD_3DS_DOPPLER_FACTOR:
+ return alGetFloat(AL_DOPPLER_FACTOR);
+ case AUD_3DS_SPEED_OF_SOUND:
+ return alGetFloat(AL_SPEED_OF_SOUND);
+ default:
+ return std::numeric_limits<float>::quiet_NaN();
+ }
+}
+
+bool AUD_OpenALDevice::updateSource(AUD_Handle* handle, AUD_3DData &data)
+{
+ lock();
+
+ if(isValid(handle))
+ {
+ int source = ((AUD_OpenALHandle*)handle)->source;
+ alSourcefv(source, AL_POSITION, (ALfloat*)data.position);
+ alSourcefv(source, AL_VELOCITY, (ALfloat*)data.velocity);
+ alSourcefv(source, AL_DIRECTION, (ALfloat*)&(data.orientation[3]));
+ unlock();
+ return true;
+ }
+
+ unlock();
+ return false;
+}
+
+bool AUD_OpenALDevice::setSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting,
+ float value)
+{
+ lock();
+
+ bool result = false;
+
+ if(isValid(handle))
+ {
+ int source = ((AUD_OpenALHandle*)handle)->source;
+
+ switch(setting)
+ {
+ case AUD_3DSS_CONE_INNER_ANGLE:
+ alSourcef(source, AL_CONE_INNER_ANGLE, value);
+ result = true;
+ break;
+ case AUD_3DSS_CONE_OUTER_ANGLE:
+ alSourcef(source, AL_CONE_OUTER_ANGLE, value);
+ result = true;
+ break;
+ case AUD_3DSS_CONE_OUTER_GAIN:
+ alSourcef(source, AL_CONE_OUTER_GAIN, value);
+ result = true;
+ break;
+ case AUD_3DSS_IS_RELATIVE:
+ alSourcei(source, AL_SOURCE_RELATIVE, value > 0.0);
+ result = true;
+ break;
+ case AUD_3DSS_MAX_DISTANCE:
+ alSourcef(source, AL_MAX_DISTANCE, value);
+ result = true;
+ break;
+ case AUD_3DSS_MAX_GAIN:
+ alSourcef(source, AL_MAX_GAIN, value);
+ result = true;
+ break;
+ case AUD_3DSS_MIN_GAIN:
+ alSourcef(source, AL_MIN_GAIN, value);
+ result = true;
+ break;
+ case AUD_3DSS_REFERENCE_DISTANCE:
+ alSourcef(source, AL_REFERENCE_DISTANCE, value);
+ result = true;
+ break;
+ case AUD_3DSS_ROLLOFF_FACTOR:
+ alSourcef(source, AL_ROLLOFF_FACTOR, value);
+ result = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ unlock();
+ return result;
+}
+
+float AUD_OpenALDevice::getSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting)
+{
+ float result = std::numeric_limits<float>::quiet_NaN();;
+
+ lock();
+
+ if(isValid(handle))
+ {
+ int source = ((AUD_OpenALHandle*)handle)->source;
+
+ switch(setting)
+ {
+ case AUD_3DSS_CONE_INNER_ANGLE:
+ alGetSourcef(source, AL_CONE_INNER_ANGLE, &result);
+ break;
+ case AUD_3DSS_CONE_OUTER_ANGLE:
+ alGetSourcef(source, AL_CONE_OUTER_ANGLE, &result);
+ break;
+ case AUD_3DSS_CONE_OUTER_GAIN:
+ alGetSourcef(source, AL_CONE_OUTER_GAIN, &result);
+ break;
+ case AUD_3DSS_IS_RELATIVE:
+ {
+ ALint i;
+ alGetSourcei(source, AL_SOURCE_RELATIVE, &i);
+ result = i ? 1.0 : 0.0;
+ break;
+ }
+ case AUD_3DSS_MAX_DISTANCE:
+ alGetSourcef(source, AL_MAX_DISTANCE, &result);
+ break;
+ case AUD_3DSS_MAX_GAIN:
+ alGetSourcef(source, AL_MAX_GAIN, &result);
+ break;
+ case AUD_3DSS_MIN_GAIN:
+ alGetSourcef(source, AL_MIN_GAIN, &result);
+ break;
+ case AUD_3DSS_REFERENCE_DISTANCE:
+ alGetSourcef(source, AL_REFERENCE_DISTANCE, &result);
+ break;
+ case AUD_3DSS_ROLLOFF_FACTOR:
+ alGetSourcef(source, AL_ROLLOFF_FACTOR, &result);
+ break;
+ default:
+ break;
+ }
+ }
+
+ unlock();
+ return result;
+}
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.h b/intern/audaspace/OpenAL/AUD_OpenALDevice.h
new file mode 100644
index 00000000000..074cd3d1924
--- /dev/null
+++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.h
@@ -0,0 +1,171 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_OPENALDEVICE
+#define AUD_OPENALDEVICE
+
+#include "AUD_IDevice.h"
+#include "AUD_I3DDevice.h"
+struct AUD_OpenALHandle;
+struct AUD_OpenALBufferedFactory;
+class AUD_ConverterFactory;
+
+#include <AL/al.h>
+#include <AL/alc.h>
+#include <list>
+#include <pthread.h>
+
+/**
+ * This device plays through OpenAL.
+ */
+class AUD_OpenALDevice : public AUD_IDevice, public AUD_I3DDevice
+{
+private:
+ /**
+ * The OpenAL device handle.
+ */
+ ALCdevice* m_device;
+
+ /**
+ * The OpenAL context.
+ */
+ ALCcontext* m_context;
+
+ /**
+ * The specification of the device.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * Whether the device has the AL_EXT_MCFORMATS extension.
+ */
+ bool m_useMC;
+
+ /**
+ * The converter factory for readers with wrong input format.
+ */
+ AUD_ConverterFactory* m_converter;
+
+ /**
+ * The list of sounds that are currently playing.
+ */
+ std::list<AUD_OpenALHandle*>* m_playingSounds;
+
+ /**
+ * The list of sounds that are currently paused.
+ */
+ std::list<AUD_OpenALHandle*>* m_pausedSounds;
+
+ /**
+ * The list of buffered factories.
+ */
+ std::list<AUD_OpenALBufferedFactory*>* m_bufferedFactories;
+
+ /**
+ * The mutex for locking.
+ */
+ pthread_mutex_t m_mutex;
+
+ /**
+ * The streaming thread.
+ */
+ pthread_t m_thread;
+
+ /**
+ * The condition for streaming thread wakeup.
+ */
+ bool m_playing;
+
+ /**
+ * Buffer size.
+ */
+ int m_buffersize;
+
+ /**
+ * Starts the streaming thread.
+ */
+ void start();
+
+ /**
+ * Checks if a handle is valid.
+ * \param handle The handle to check.
+ * \return Whether the handle is valid.
+ */
+ bool isValid(AUD_Handle* handle);
+
+ /**
+ * Gets the format according to the specs.
+ * \param format The variable to put the format into.
+ * \param specs The specs to read the format from.
+ * \return Whether the format is valid or not.
+ */
+ bool getFormat(ALenum &format, AUD_Specs specs);
+
+public:
+ /**
+ * Opens the OpenAL audio device for playback.
+ * \param specs The wanted audio specification.
+ * \param buffersize The size of the internal buffer.
+ * \note The specification really used for opening the device may differ.
+ * \note The buffersize will be multiplicated by three for this device.
+ * \exception AUD_Exception Thrown if the audio device cannot be opened.
+ */
+ AUD_OpenALDevice(AUD_Specs specs, int buffersize = AUD_DEFAULT_BUFFER_SIZE);
+
+ /**
+ * Streaming thread main function.
+ */
+ void updateStreams();
+
+ virtual ~AUD_OpenALDevice();
+
+ virtual AUD_Specs getSpecs();
+ virtual AUD_Handle* play(AUD_IFactory* factory, bool keep = false);
+ virtual bool pause(AUD_Handle* handle);
+ virtual bool resume(AUD_Handle* handle);
+ virtual bool stop(AUD_Handle* handle);
+ virtual bool setKeep(AUD_Handle* handle, bool keep);
+ virtual bool sendMessage(AUD_Handle* handle, AUD_Message &message);
+ virtual bool seek(AUD_Handle* handle, float position);
+ virtual float getPosition(AUD_Handle* handle);
+ virtual AUD_Status getStatus(AUD_Handle* handle);
+ virtual void lock();
+ virtual void unlock();
+ virtual bool checkCapability(int capability);
+ virtual bool setCapability(int capability, void *value);
+ virtual bool getCapability(int capability, void *value);
+
+ virtual AUD_Handle* play3D(AUD_IFactory* factory, bool keep = false);
+ virtual bool updateListener(AUD_3DData &data);
+ virtual bool setSetting(AUD_3DSetting setting, float value);
+ virtual float getSetting(AUD_3DSetting setting);
+ virtual bool updateSource(AUD_Handle* handle, AUD_3DData &data);
+ virtual bool setSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting, float value);
+ virtual float getSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting);
+};
+
+#endif //AUD_OPENALDEVICE
diff --git a/intern/audaspace/OpenAL/Makefile b/intern/audaspace/OpenAL/Makefile
new file mode 100644
index 00000000000..4cf9f66b06c
--- /dev/null
+++ b/intern/audaspace/OpenAL/Makefile
@@ -0,0 +1,39 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+#
+
+LIBNAME = aud_openal
+DIR = $(OCGDIR)/intern/audaspace
+
+include nan_compile.mk
+
+CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+
+CPPFLAGS += -I../intern
+CPPFLAGS += -I.
diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript
new file mode 100644
index 00000000000..0dfd0bb9e3a
--- /dev/null
+++ b/intern/audaspace/SConscript
@@ -0,0 +1,34 @@
+#!/usr/bin/python
+
+Import ('env')
+
+sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp') + env.Glob('SRC/*.cpp')
+incs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] + ' ' + env['BF_LIBSAMPLERATE_INC']
+defs = []
+
+if env['WITH_BF_FFMPEG']:
+ sources += env.Glob('ffmpeg/*.cpp')
+ incs += ' ffmpeg ' + env['BF_FFMPEG_INC']
+ defs.append('WITH_FFMPEG')
+
+if env['WITH_BF_SDL']:
+ sources += env.Glob('SDL/*.cpp')
+ incs += ' SDL ' + env['BF_SDL_INC']
+ defs.append('WITH_SDL')
+
+if env['WITH_BF_OPENAL']:
+ sources += env.Glob('OpenAL/*.cpp')
+ incs += ' OpenAL ' + env['BF_OPENAL_INC']
+ defs.append('WITH_OPENAL')
+
+if env['WITH_BF_JACK']:
+ sources += env.Glob('jack/*.cpp')
+ incs += ' jack ' + env['BF_JACK_INC']
+ defs.append('WITH_JACK')
+
+if env['WITH_BF_SNDFILE']:
+ sources += env.Glob('sndfile/*.cpp')
+ incs += ' sndfile ' + env['BF_SNDFILE_INC']
+ defs.append('WITH_SNDFILE')
+
+env.BlenderLib ('bf_audaspace', sources, Split(incs), defs, libtype=['intern'], priority = [25] )
diff --git a/intern/audaspace/SDL/AUD_SDLDevice.cpp b/intern/audaspace/SDL/AUD_SDLDevice.cpp
new file mode 100644
index 00000000000..dd443e7f5c7
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLDevice.cpp
@@ -0,0 +1,90 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SDLMixer.h"
+#include "AUD_SDLDevice.h"
+#include "AUD_IReader.h"
+
+void AUD_SDLDevice::SDL_mix(void *data, Uint8* buffer, int length)
+{
+ AUD_SDLDevice* device = (AUD_SDLDevice*)data;
+
+ device->mix((sample_t*)buffer, length/AUD_SAMPLE_SIZE(device->m_specs));
+}
+
+AUD_SDLDevice::AUD_SDLDevice(AUD_Specs specs, int buffersize)
+{
+ if(specs.channels == AUD_CHANNELS_INVALID)
+ specs.channels = AUD_CHANNELS_STEREO;
+ if(specs.format == AUD_FORMAT_INVALID)
+ specs.format = AUD_FORMAT_S16;
+ if(specs.rate == AUD_RATE_INVALID)
+ specs.rate = AUD_RATE_44100;
+
+ m_specs = specs;
+
+ SDL_AudioSpec format, obtained;
+
+ format.freq = m_specs.rate;
+ if(m_specs.format == AUD_FORMAT_U8)
+ format.format = AUDIO_U8;
+ else
+ format.format = AUDIO_S16SYS;
+ format.channels = m_specs.channels;
+ format.samples = buffersize;
+ format.callback = AUD_SDLDevice::SDL_mix;
+ format.userdata = this;
+
+ if(SDL_OpenAudio(&format, &obtained) != 0)
+ AUD_THROW(AUD_ERROR_SDL);
+
+ m_specs.rate = (AUD_SampleRate)obtained.freq;
+ m_specs.channels = (AUD_Channels)obtained.channels;
+ if(obtained.format == AUDIO_U8)
+ m_specs.format = AUD_FORMAT_U8;
+ else if(obtained.format == AUDIO_S16LSB || obtained.format == AUDIO_S16MSB)
+ m_specs.format = AUD_FORMAT_S16;
+ else
+ AUD_THROW(AUD_ERROR_SDL);
+
+ m_mixer = new AUD_SDLMixer(); AUD_NEW("mixer")
+ m_mixer->setSpecs(m_specs);
+
+ create();
+}
+
+AUD_SDLDevice::~AUD_SDLDevice()
+{
+ lock();
+ SDL_CloseAudio();
+ unlock();
+
+ destroy();
+}
+
+void AUD_SDLDevice::playing(bool playing)
+{
+ SDL_PauseAudio(playing ? 0 : 1);
+}
diff --git a/intern/audaspace/SDL/AUD_SDLDevice.h b/intern/audaspace/SDL/AUD_SDLDevice.h
new file mode 100644
index 00000000000..e2c6f7631b7
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLDevice.h
@@ -0,0 +1,66 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SDLDEVICE
+#define AUD_SDLDEVICE
+
+#include "AUD_SoftwareDevice.h"
+
+#include <SDL.h>
+
+/**
+ * This device plays back through SDL, the simple direct media layer.
+ */
+class AUD_SDLDevice : public AUD_SoftwareDevice
+{
+private:
+ /**
+ * Mixes the next bytes into the buffer.
+ * \param data The SDL device.
+ * \param buffer The target buffer.
+ * \param length The length in bytes to be filled.
+ */
+ static void SDL_mix(void *data, Uint8* buffer, int length);
+
+protected:
+ virtual void playing(bool playing);
+
+public:
+ /**
+ * Opens the SDL audio device for playback.
+ * \param specs The wanted audio specification.
+ * \param buffersize The size of the internal buffer.
+ * \note The specification really used for opening the device may differ.
+ * \exception AUD_Exception Thrown if the audio device cannot be opened.
+ */
+ AUD_SDLDevice(AUD_Specs specs, int buffersize = AUD_DEFAULT_BUFFER_SIZE);
+
+ /**
+ * Closes the SDL audio device.
+ */
+ virtual ~AUD_SDLDevice();
+};
+
+#endif //AUD_SDLDEVICE
diff --git a/intern/audaspace/SDL/AUD_SDLMixer.cpp b/intern/audaspace/SDL/AUD_SDLMixer.cpp
new file mode 100644
index 00000000000..cacc0c7063c
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLMixer.cpp
@@ -0,0 +1,83 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SDLMixer.h"
+#include "AUD_SDLMixerFactory.h"
+
+#include <SDL.h>
+
+AUD_SDLMixer::AUD_SDLMixer()
+{
+ m_factory = NULL;
+}
+
+AUD_SDLMixer::~AUD_SDLMixer()
+{
+ if(m_factory)
+ {
+ delete m_factory; AUD_DELETE("factory")
+ }
+}
+
+AUD_IReader* AUD_SDLMixer::prepare(AUD_IReader* reader)
+{
+ m_factory->setReader(reader);
+ return m_factory->createReader();
+}
+
+void AUD_SDLMixer::setSpecs(AUD_Specs specs)
+{
+ m_samplesize = AUD_SAMPLE_SIZE(specs);
+ if(m_factory)
+ {
+ delete m_factory; AUD_DELETE("factory")
+ }
+ m_factory = new AUD_SDLMixerFactory(specs); AUD_NEW("factory")
+}
+
+void AUD_SDLMixer::add(sample_t* buffer, AUD_Specs specs, int length,
+ float volume)
+{
+ AUD_SDLMixerBuffer buf;
+ buf.buffer = buffer;
+ buf.length = length;
+ buf.volume = volume;
+ m_buffers.push_back(buf);
+}
+
+void AUD_SDLMixer::superpose(sample_t* buffer, int length, float volume)
+{
+ AUD_SDLMixerBuffer buf;
+
+ while(!m_buffers.empty())
+ {
+ buf = m_buffers.front();
+ m_buffers.pop_front();
+ SDL_MixAudio((Uint8*)buffer,
+ (Uint8*)buf.buffer,
+ buf.length * m_samplesize,
+ (int)(SDL_MIX_MAXVOLUME * volume * buf.volume));
+ }
+}
diff --git a/intern/audaspace/SDL/AUD_SDLMixer.h b/intern/audaspace/SDL/AUD_SDLMixer.h
new file mode 100644
index 00000000000..2cc4e51f66d
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLMixer.h
@@ -0,0 +1,76 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SDLMIXER
+#define AUD_SDLMIXER
+
+#include "AUD_IMixer.h"
+class AUD_SDLMixerFactory;
+#include <list>
+
+struct AUD_SDLMixerBuffer
+{
+ sample_t* buffer;
+ int length;
+ float volume;
+};
+
+/**
+ * This class is able to mix audiosignals with the help of SDL.
+ */
+class AUD_SDLMixer : public AUD_IMixer
+{
+private:
+ /**
+ * The mixer factory that prepares all readers for superposition.
+ */
+ AUD_SDLMixerFactory* m_factory;
+
+ /**
+ * The list of buffers to superpose.
+ */
+ std::list<AUD_SDLMixerBuffer> m_buffers;
+
+ /**
+ * The size of an output sample.
+ */
+ int m_samplesize;
+
+public:
+ /**
+ * Creates the mixer.
+ */
+ AUD_SDLMixer();
+
+ virtual ~AUD_SDLMixer();
+
+ virtual AUD_IReader* prepare(AUD_IReader* reader);
+ virtual void setSpecs(AUD_Specs specs);
+ virtual void add(sample_t* buffer, AUD_Specs specs, int length,
+ float volume);
+ virtual void superpose(sample_t* buffer, int length, float volume);
+};
+
+#endif //AUD_SDLMIXER
diff --git a/intern/audaspace/SDL/AUD_SDLMixerFactory.cpp b/intern/audaspace/SDL/AUD_SDLMixerFactory.cpp
new file mode 100644
index 00000000000..e0b0c7d3603
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLMixerFactory.cpp
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SDLMixerFactory.h"
+#include "AUD_SDLMixerReader.h"
+
+#include <cstring>
+
+AUD_SDLMixerFactory::AUD_SDLMixerFactory(AUD_IReader* reader, AUD_Specs specs) :
+ AUD_MixerFactory(reader, specs) {}
+
+AUD_SDLMixerFactory::AUD_SDLMixerFactory(AUD_IFactory* factory, AUD_Specs specs) :
+ AUD_MixerFactory(factory, specs) {}
+
+AUD_SDLMixerFactory::AUD_SDLMixerFactory(AUD_Specs specs) :
+ AUD_MixerFactory(specs) {}
+
+AUD_IReader* AUD_SDLMixerFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ AUD_Specs specs = reader->getSpecs();
+ if(memcmp(&m_specs, &specs, sizeof(AUD_Specs)) != 0)
+ {
+ try
+ {
+ reader = new AUD_SDLMixerReader(reader, m_specs);
+ AUD_NEW("reader")
+ }
+ catch(AUD_Exception e)
+ {
+ // return 0 in case SDL cannot mix the source
+ if(e.error != AUD_ERROR_SDL)
+ throw;
+ else
+ reader = NULL;
+ }
+ }
+ }
+ return reader;
+}
diff --git a/intern/audaspace/SDL/AUD_SDLMixerFactory.h b/intern/audaspace/SDL/AUD_SDLMixerFactory.h
new file mode 100644
index 00000000000..44b36d06859
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLMixerFactory.h
@@ -0,0 +1,45 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SDLMIXERFACTORY
+#define AUD_SDLMIXERFACTORY
+
+#include "AUD_MixerFactory.h"
+
+/**
+ * This factory creates a resampling reader that uses SDL's resampling
+ * functionality which unfortunately is very very very limited.
+ */
+class AUD_SDLMixerFactory : public AUD_MixerFactory
+{
+public:
+ AUD_SDLMixerFactory(AUD_IReader* reader, AUD_Specs specs);
+ AUD_SDLMixerFactory(AUD_IFactory* factory, AUD_Specs specs);
+ AUD_SDLMixerFactory(AUD_Specs specs);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_SDLMIXERFACTORY
diff --git a/intern/audaspace/SDL/AUD_SDLMixerReader.cpp b/intern/audaspace/SDL/AUD_SDLMixerReader.cpp
new file mode 100644
index 00000000000..ec61f99f02d
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLMixerReader.cpp
@@ -0,0 +1,216 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SDLMixerReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+inline Uint16 AUD_TO_SDL(AUD_SampleFormat format)
+{
+ // SDL only supports 8 and 16 bit audio
+ switch(format)
+ {
+ case AUD_FORMAT_U8:
+ return AUDIO_U8;
+ case AUD_FORMAT_S16:
+ return AUDIO_S16SYS;
+ default:
+ AUD_THROW(AUD_ERROR_SDL);
+ }
+}
+
+// greatest common divisor
+inline int gcd(int a, int b)
+{
+ int c;
+
+ // make sure a is the bigger
+ if(b > a)
+ {
+ c = b;
+ b = a;
+ a = c;
+ }
+
+ // greetings from Euclides
+ while(b != 0)
+ {
+ c = a % b;
+ a = b;
+ b = c;
+ }
+ return a;
+}
+
+AUD_SDLMixerReader::AUD_SDLMixerReader(AUD_IReader* reader,
+ AUD_Specs specs)
+{
+ if(reader == NULL)
+ AUD_THROW(AUD_ERROR_READER);
+
+ m_reader = reader;
+ m_tspecs = specs;
+ m_sspecs = reader->getSpecs();
+
+ try
+ {
+ // SDL only supports 8 and 16 bit sample formats
+ if(SDL_BuildAudioCVT(&m_cvt,
+ AUD_TO_SDL(m_sspecs.format),
+ m_sspecs.channels,
+ m_sspecs.rate,
+ AUD_TO_SDL(specs.format),
+ specs.channels,
+ specs.rate) == -1)
+ AUD_THROW(AUD_ERROR_SDL);
+ }
+ catch(AUD_Exception e)
+ {
+ delete m_reader; AUD_DELETE("reader")
+ throw;
+ }
+
+ m_eor = false;
+ m_rsposition = 0;
+ m_rssize = 0;
+ m_ssize = m_sspecs.rate / gcd(specs.rate, m_sspecs.rate);
+ m_tsize = m_tspecs.rate * m_ssize / m_sspecs.rate;
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+ m_rsbuffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_SDLMixerReader::~AUD_SDLMixerReader()
+{
+ delete m_reader; AUD_DELETE("reader")
+ delete m_buffer; AUD_DELETE("buffer")
+ delete m_rsbuffer; AUD_DELETE("buffer")
+}
+
+bool AUD_SDLMixerReader::isSeekable()
+{
+ return m_reader->isSeekable();
+}
+
+void AUD_SDLMixerReader::seek(int position)
+{
+ m_reader->seek(position * m_ssize / m_tsize);
+ m_eor = false;
+}
+
+int AUD_SDLMixerReader::getLength()
+{
+ return m_reader->getLength() * m_tsize / m_ssize;
+}
+
+int AUD_SDLMixerReader::getPosition()
+{
+ return m_reader->getPosition() * m_tsize / m_ssize;
+}
+
+AUD_Specs AUD_SDLMixerReader::getSpecs()
+{
+ return m_tspecs;
+}
+
+AUD_ReaderType AUD_SDLMixerReader::getType()
+{
+ return m_reader->getType();
+}
+
+bool AUD_SDLMixerReader::notify(AUD_Message &message)
+{
+ return m_reader->notify(message);
+}
+
+void AUD_SDLMixerReader::read(int & length, sample_t* & buffer)
+{
+ // sample count for the target buffer without getting a shift
+ int tns = length + m_tsize - length % m_tsize;
+ // sample count for the source buffer without getting a shift
+ int sns = tns * m_ssize / m_tsize;
+ // target sample size
+ int tss = AUD_SAMPLE_SIZE(m_tspecs);
+ // source sample size
+ int sss = AUD_SAMPLE_SIZE(m_sspecs);
+
+ // input is output buffer
+ int buf_size = AUD_MAX(tns*tss, sns*sss);
+
+ // resize if necessary
+ if(m_rsbuffer->getSize() < buf_size)
+ m_rsbuffer->resize(buf_size, true);
+
+ if(m_buffer->getSize() < length*tss)
+ m_buffer->resize(length*tss);
+
+ buffer = m_buffer->getBuffer();
+ int size;
+ int index = 0;
+ sample_t* buf;
+
+ while(index < length)
+ {
+ if(m_rsposition == m_rssize)
+ {
+ // no more data
+ if(m_eor)
+ length = index;
+ // mix
+ else
+ {
+ // read from source
+ size = sns;
+ m_reader->read(size, buf);
+
+ // prepare
+ m_cvt.buf = m_rsbuffer->getBuffer();
+ m_cvt.len = size*sss;
+ memcpy(m_cvt.buf, buf, size*sss);
+
+ // convert
+ SDL_ConvertAudio(&m_cvt);
+
+ // end of reader
+ if(size < sns)
+ m_eor = true;
+
+ m_rsposition = 0;
+ m_rssize = size * m_tsize / m_ssize;
+ }
+ }
+
+ // size to copy
+ size = AUD_MIN(m_rssize-m_rsposition, length-index);
+
+ // copy
+ memcpy(m_buffer->getBuffer() + index * tss,
+ m_rsbuffer->getBuffer() + m_rsposition * tss,
+ size*tss);
+ m_rsposition += size;
+ index += size;
+ }
+}
diff --git a/intern/audaspace/SDL/AUD_SDLMixerReader.h b/intern/audaspace/SDL/AUD_SDLMixerReader.h
new file mode 100644
index 00000000000..56668d02171
--- /dev/null
+++ b/intern/audaspace/SDL/AUD_SDLMixerReader.h
@@ -0,0 +1,128 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SDLMIXERREADER
+#define AUD_SDLMIXERREADER
+
+#include "AUD_IReader.h"
+class AUD_Buffer;
+
+#include <SDL.h>
+
+/**
+ * This class mixes a sound source with help of the SDL library.
+ * Unfortunately SDL is only capable of 8 and 16 bit audio, mono and stereo, as
+ * well as resampling only 2^n sample rate relationships where n is a natural
+ * number.
+ * \warning Although SDL can only resample 2^n sample rate relationships, this
+ * class doesn't check for compliance, so in case of other factors,
+ * the behaviour is undefined.
+ */
+class AUD_SDLMixerReader : public AUD_IReader
+{
+private:
+ /**
+ * The reader that is being mixed.
+ */
+ AUD_IReader* m_reader;
+
+ /**
+ * The current reading position in the resampling buffer.
+ */
+ int m_rsposition;
+
+ /**
+ * The count of mixed samples in the resampling buffer.
+ */
+ int m_rssize;
+
+ /**
+ * The smallest count of source samples to get a fractionless resampling
+ * factor.
+ */
+ int m_ssize;
+
+ /**
+ * The smallest count of target samples to get a fractionless resampling
+ * factor.
+ */
+ int m_tsize;
+
+ /**
+ * The sound output buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The resampling buffer.
+ */
+ AUD_Buffer *m_rsbuffer;
+
+ /**
+ * The target specification.
+ */
+ AUD_Specs m_tspecs;
+
+ /**
+ * The sample specification of the source.
+ */
+ AUD_Specs m_sspecs;
+
+ /**
+ * Saves whether the end of the source has been reached.
+ */
+ bool m_eor;
+
+ /**
+ * The SDL_AudioCVT structure used for resampling.
+ */
+ SDL_AudioCVT m_cvt;
+
+public:
+ /**
+ * Creates a resampling reader.
+ * \param reader The reader to mix.
+ * \param specs The target specification.
+ * \exception AUD_Exception Thrown if the source specification cannot be
+ * mixed to the target specification or if the reader is
+ * NULL.
+ */
+ AUD_SDLMixerReader(AUD_IReader* reader, AUD_Specs specs);
+ /**
+ * Destroys the reader.
+ */
+ ~AUD_SDLMixerReader();
+
+ virtual bool isSeekable();
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_SDLMIXERREADER
diff --git a/intern/SoundSystem/sdl/Makefile b/intern/audaspace/SDL/Makefile
index 669d7110797..02a4068f3dc 100644
--- a/intern/SoundSystem/sdl/Makefile
+++ b/intern/audaspace/SDL/Makefile
@@ -28,16 +28,14 @@
#
#
-LIBNAME = SDLSoundSystem
-DIR = $(OCGDIR)/intern/$(LIBNAME)
+LIBNAME = aud_sdl
+DIR = $(OCGDIR)/intern/audaspace
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += $(NAN_SDLCFLAGS)
-CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.
diff --git a/intern/audaspace/SRC/AUD_SRCResampleFactory.cpp b/intern/audaspace/SRC/AUD_SRCResampleFactory.cpp
new file mode 100644
index 00000000000..bcace340b24
--- /dev/null
+++ b/intern/audaspace/SRC/AUD_SRCResampleFactory.cpp
@@ -0,0 +1,53 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SRCResampleFactory.h"
+#include "AUD_SRCResampleReader.h"
+
+AUD_SRCResampleFactory::AUD_SRCResampleFactory(AUD_IReader* reader,
+ AUD_Specs specs) :
+ AUD_ResampleFactory(reader, specs) {}
+
+AUD_SRCResampleFactory::AUD_SRCResampleFactory(AUD_IFactory* factory,
+ AUD_Specs specs) :
+ AUD_ResampleFactory(factory, specs) {}
+
+AUD_SRCResampleFactory::AUD_SRCResampleFactory(AUD_Specs specs) :
+ AUD_ResampleFactory(specs) {}
+
+AUD_IReader* AUD_SRCResampleFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ if(reader->getSpecs().rate != m_specs.rate)
+ {
+ reader = new AUD_SRCResampleReader(reader, m_specs);
+ AUD_NEW("reader")
+ }
+ }
+ return reader;
+}
diff --git a/intern/audaspace/SRC/AUD_SRCResampleFactory.h b/intern/audaspace/SRC/AUD_SRCResampleFactory.h
new file mode 100644
index 00000000000..c23c1d2c82e
--- /dev/null
+++ b/intern/audaspace/SRC/AUD_SRCResampleFactory.h
@@ -0,0 +1,46 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SRCRESAMPLEFACTORY
+#define AUD_SRCRESAMPLEFACTORY
+
+#include "AUD_ResampleFactory.h"
+
+/**
+ * This factory creates a resampling reader that uses libsamplerate for
+ * resampling.
+ * \note The format of the input must be float.
+ */
+class AUD_SRCResampleFactory : public AUD_ResampleFactory
+{
+public:
+ AUD_SRCResampleFactory(AUD_IReader* reader, AUD_Specs specs);
+ AUD_SRCResampleFactory(AUD_IFactory* factory, AUD_Specs specs);
+ AUD_SRCResampleFactory(AUD_Specs specs);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_SRCRESAMPLEFACTORY
diff --git a/intern/audaspace/SRC/AUD_SRCResampleReader.cpp b/intern/audaspace/SRC/AUD_SRCResampleReader.cpp
new file mode 100644
index 00000000000..f7564d3c010
--- /dev/null
+++ b/intern/audaspace/SRC/AUD_SRCResampleReader.cpp
@@ -0,0 +1,119 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SRCResampleReader.h"
+#include "AUD_Buffer.h"
+
+#include <math.h>
+#include <cstring>
+#include <stdio.h>
+
+static long src_callback(void *cb_data, float **data)
+{
+ return ((AUD_SRCResampleReader*)cb_data)->doCallback(data);
+}
+
+AUD_SRCResampleReader::AUD_SRCResampleReader(AUD_IReader* reader,
+ AUD_Specs specs) :
+ AUD_EffectReader(reader)
+{
+ m_sspecs = reader->getSpecs();
+
+ if(m_sspecs.format != AUD_FORMAT_FLOAT32)
+ {
+ delete m_reader; AUD_DELETE("reader")
+ AUD_THROW(AUD_ERROR_READER);
+ }
+
+ m_tspecs = specs;
+ m_tspecs.channels = m_sspecs.channels;
+ m_tspecs.format = m_sspecs.format;
+ m_factor = (double)m_tspecs.rate / (double)m_sspecs.rate;
+
+ int error;
+ m_src = src_callback_new(src_callback,
+ SRC_SINC_MEDIUM_QUALITY,
+ m_sspecs.channels,
+ &error,
+ this);
+
+ if(!m_src)
+ {
+ // XXX printf("%s\n", src_strerror(error));
+ delete m_reader; AUD_DELETE("reader")
+ AUD_THROW(AUD_ERROR_READER);
+ }
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_SRCResampleReader::~AUD_SRCResampleReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+
+ src_delete(m_src);
+}
+
+long AUD_SRCResampleReader::doCallback(float** data)
+{
+ int length = m_buffer->getSize() / 4 / m_tspecs.channels;
+ sample_t* buffer;
+
+ m_reader->read(length, buffer);
+
+ *data = (float*)buffer;
+ return length;
+}
+
+void AUD_SRCResampleReader::seek(int position)
+{
+ m_reader->seek(position / m_factor);
+ src_reset(m_src);
+}
+
+int AUD_SRCResampleReader::getLength()
+{
+ return m_reader->getLength() * m_factor;
+}
+
+int AUD_SRCResampleReader::getPosition()
+{
+ return m_reader->getPosition() * m_factor;
+}
+
+AUD_Specs AUD_SRCResampleReader::getSpecs()
+{
+ return m_tspecs;
+}
+
+void AUD_SRCResampleReader::read(int & length, sample_t* & buffer)
+{
+ if(m_buffer->getSize() < length * m_tspecs.channels * 4)
+ m_buffer->resize(length * m_tspecs.channels * 4);
+
+ buffer = m_buffer->getBuffer();
+
+ length = src_callback_read(m_src, m_factor, length, (float*)buffer);
+}
diff --git a/intern/audaspace/SRC/AUD_SRCResampleReader.h b/intern/audaspace/SRC/AUD_SRCResampleReader.h
new file mode 100644
index 00000000000..1bacdb3965c
--- /dev/null
+++ b/intern/audaspace/SRC/AUD_SRCResampleReader.h
@@ -0,0 +1,102 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SRCRESAMPLEREADER
+#define AUD_SRCRESAMPLEREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+#include <samplerate.h>
+
+/**
+ * This class mixes a sound source with help of the SDL library.
+ * Unfortunately SDL is only capable of 8 and 16 bit audio, mono and stereo, as
+ * well as resampling only 2^n sample rate relationships where n is a natural
+ * number.
+ * \warning Although SDL can only resample 2^n sample rate relationships, this
+ * class doesn't check for compliance, so in case of other factors,
+ * the behaviour is undefined.
+ */
+class AUD_SRCResampleReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The resampling factor.
+ */
+ double m_factor;
+
+ /**
+ * The sound output buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The target specification.
+ */
+ AUD_Specs m_tspecs;
+
+ /**
+ * The sample specification of the source.
+ */
+ AUD_Specs m_sspecs;
+
+ /**
+ * The src state structure.
+ */
+ SRC_STATE* m_src;
+
+public:
+ /**
+ * Creates a resampling reader.
+ * \param reader The reader to mix.
+ * \param specs The target specification.
+ * \exception AUD_Exception Thrown if the source specification cannot be
+ * mixed to the target specification or if the reader is
+ * NULL.
+ */
+ AUD_SRCResampleReader(AUD_IReader* reader, AUD_Specs specs);
+
+ /**
+ * Destroys the reader.
+ */
+ ~AUD_SRCResampleReader();
+
+ /**
+ * The callback function for SRC.
+ * \warning Do not call!
+ * \param data The pointer to the float data.
+ * \return The count of samples in the float data.
+ */
+ long doCallback(float** data);
+
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_SRCRESAMPLEREADER
diff --git a/intern/SoundSystem/openal/Makefile b/intern/audaspace/SRC/Makefile
index b28ab628d4c..5cf5f55b11f 100644
--- a/intern/SoundSystem/openal/Makefile
+++ b/intern/audaspace/SRC/Makefile
@@ -28,17 +28,17 @@
#
#
-LIBNAME = OpenALSoundSystem
-DIR = $(OCGDIR)/intern/$(LIBNAME)
+LIBNAME = aud_src
+DIR = $(OCGDIR)/intern/audaspace
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
-CPPFLAGS += -I$(NAN_OPENAL)/include
-CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_MOTO)/include
+CPPFLAGS += -I$(LCGDIR)/samplerate/include/
+CPPFLAGS += -I../ffmpeg
+CPPFLAGS += -I../FX
+CPPFLAGS += -I../SDL
CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.
-CPPFLAGS += -I../sdl
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp
new file mode 100644
index 00000000000..f67c819ff10
--- /dev/null
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_FFMPEGFactory.h"
+#include "AUD_FFMPEGReader.h"
+#include "AUD_Buffer.h"
+
+AUD_FFMPEGFactory::AUD_FFMPEGFactory(const char* filename)
+{
+ if(filename != NULL)
+ {
+ m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
+ strcpy(m_filename, filename);
+ }
+ else
+ m_filename = NULL;
+}
+
+AUD_FFMPEGFactory::AUD_FFMPEGFactory(unsigned char* buffer, int size)
+{
+ m_filename = NULL;
+ m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer(size));
+ memcpy(m_buffer.get()->getBuffer(), buffer, size);
+}
+
+AUD_FFMPEGFactory::~AUD_FFMPEGFactory()
+{
+ if(m_filename)
+ {
+ delete[] m_filename; AUD_DELETE("string")
+ }
+}
+
+AUD_IReader* AUD_FFMPEGFactory::createReader()
+{
+ AUD_IReader* reader;
+ if(m_filename)
+ reader = new AUD_FFMPEGReader(m_filename);
+ else
+ reader = new AUD_FFMPEGReader(m_buffer);
+ AUD_NEW("reader")
+ return reader;
+}
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h
new file mode 100644
index 00000000000..22560303a73
--- /dev/null
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h
@@ -0,0 +1,73 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_FFMPEGFACTORY
+#define AUD_FFMPEGFACTORY
+
+#include "AUD_IFactory.h"
+#include "AUD_Reference.h"
+class AUD_Buffer;
+
+/**
+ * This factory reads a sound file via ffmpeg.
+ * \warning Notice that the needed formats and codecs have to be registered
+ * for ffmpeg before this class can be used.
+ */
+class AUD_FFMPEGFactory : public AUD_IFactory
+{
+private:
+ /**
+ * The filename of the sound source file.
+ */
+ char* m_filename;
+
+ /**
+ * The buffer to read from.
+ */
+ AUD_Reference<AUD_Buffer> m_buffer;
+
+public:
+ /**
+ * Creates a new factory.
+ * \param filename The sound file path.
+ */
+ AUD_FFMPEGFactory(const char* filename);
+
+ /**
+ * Creates a new factory.
+ * \param buffer The buffer to read from.
+ * \param size The size of the buffer.
+ */
+ AUD_FFMPEGFactory(unsigned char* buffer, int size);
+
+ /**
+ * Destroys the factory.
+ */
+ ~AUD_FFMPEGFactory();
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_FFMPEGFACTORY
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
new file mode 100644
index 00000000000..d70a9c25bcb
--- /dev/null
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
@@ -0,0 +1,388 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+// needed for INT64_C
+#define __STDC_CONSTANT_MACROS
+
+#include "AUD_FFMPEGReader.h"
+#include "AUD_Buffer.h"
+
+extern "C" {
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+}
+
+// This function transforms a FFMPEG SampleFormat to our own sample format
+static inline AUD_SampleFormat FFMPEG_TO_AUD(SampleFormat fmt)
+{
+ switch(fmt)
+ {
+ case SAMPLE_FMT_U8:
+ return AUD_FORMAT_U8;
+ case SAMPLE_FMT_S16:
+ return AUD_FORMAT_S16;
+ case SAMPLE_FMT_S32:
+ return AUD_FORMAT_S32;
+ case SAMPLE_FMT_FLT:
+ return AUD_FORMAT_FLOAT32;
+ case SAMPLE_FMT_DBL:
+ return AUD_FORMAT_FLOAT64;
+ default:
+ return AUD_FORMAT_INVALID;
+ }
+}
+
+int AUD_FFMPEGReader::decode(AVPacket* packet, AUD_Buffer* buffer)
+{
+ // save packet parameters
+ uint8_t *audio_pkg_data = packet->data;
+ int audio_pkg_size = packet->size;
+
+ int buf_size = buffer->getSize();
+ int buf_pos = 0;
+
+ int read_length, data_size;
+
+ // as long as there is still data in the package
+ while(audio_pkg_size > 0)
+ {
+ // resize buffer if needed
+ if(buf_size - buf_pos < AVCODEC_MAX_AUDIO_FRAME_SIZE)
+ {
+ buffer->resize(buf_size + AVCODEC_MAX_AUDIO_FRAME_SIZE, true);
+ buf_size += AVCODEC_MAX_AUDIO_FRAME_SIZE;
+ }
+
+ // read samples from the packet
+ data_size = buf_size - buf_pos;
+ /*read_length = avcodec_decode_audio3(m_codecCtx,
+ (int16_t*)(buffer->getBuffer()+buf_pos),
+ &data_size,
+ packet);*/
+ read_length = avcodec_decode_audio2(m_codecCtx,
+ (int16_t*)(buffer->getBuffer()+buf_pos),
+ &data_size,
+ audio_pkg_data,
+ audio_pkg_size);
+
+ buf_pos += data_size;
+
+ // read error, next packet!
+ if(read_length < 0)
+ break;
+
+ // move packet parameters
+ audio_pkg_data += read_length;
+ audio_pkg_size -= read_length;
+ }
+
+ return buf_pos;
+}
+
+AUD_FFMPEGReader::AUD_FFMPEGReader(const char* filename)
+{
+ m_position = 0;
+ m_pkgbuf_left = 0;
+ m_byteiocontext = NULL;
+
+ // open file
+ if(av_open_input_file(&m_formatCtx, filename, NULL, 0, NULL)!=0)
+ AUD_THROW(AUD_ERROR_FILE);
+
+ try
+ {
+ if(av_find_stream_info(m_formatCtx)<0)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ // find audio stream and codec
+ m_stream = -1;
+
+ for(int i = 0; i < m_formatCtx->nb_streams; i++)
+ if((m_formatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
+ && (m_stream < 0))
+ {
+ m_stream=i;
+ break;
+ }
+ if(m_stream == -1)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ m_codecCtx = m_formatCtx->streams[m_stream]->codec;
+
+ // get a decoder and open it
+ AVCodec *aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
+ if(!aCodec)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ if(avcodec_open(m_codecCtx, aCodec)<0)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ // XXX this prints file information to stdout:
+ //dump_format(m_formatCtx, 0, filename, 0);
+
+ m_specs.channels = (AUD_Channels) m_codecCtx->channels;
+ m_specs.format = FFMPEG_TO_AUD(m_codecCtx->sample_fmt);
+ m_specs.rate = (AUD_SampleRate) m_codecCtx->sample_rate;
+ }
+ catch(AUD_Exception e)
+ {
+ av_close_input_file(m_formatCtx);
+ throw;
+ }
+
+ // last but not least if there hasn't been any error, create the buffers
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+ m_pkgbuf = new AUD_Buffer(AVCODEC_MAX_AUDIO_FRAME_SIZE<<1);
+ AUD_NEW("buffer")
+}
+
+AUD_FFMPEGReader::AUD_FFMPEGReader(AUD_Reference<AUD_Buffer> buffer)
+{
+ m_position = 0;
+ m_pkgbuf_left = 0;
+ m_byteiocontext = (ByteIOContext*)av_mallocz(sizeof(ByteIOContext));
+ AUD_NEW("byteiocontext")
+ m_membuffer = buffer;
+
+ if(init_put_byte(m_byteiocontext, buffer.get()->getBuffer(), buffer.get()->getSize(), 0,
+ NULL, NULL, NULL, NULL) != 0)
+ AUD_THROW(AUD_ERROR_FILE);
+
+ AVProbeData probe_data;
+ probe_data.filename = "";
+ probe_data.buf = buffer.get()->getBuffer();
+ probe_data.buf_size = buffer.get()->getSize();
+ AVInputFormat* fmt = av_probe_input_format(&probe_data, 1);
+
+ // open stream
+ if(av_open_input_stream(&m_formatCtx, m_byteiocontext, "", fmt, NULL)!=0)
+ AUD_THROW(AUD_ERROR_FILE);
+
+ try
+ {
+ if(av_find_stream_info(m_formatCtx)<0)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ // find audio stream and codec
+ m_stream = -1;
+
+ for(int i = 0; i < m_formatCtx->nb_streams; i++)
+ if((m_formatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
+ && (m_stream < 0))
+ {
+ m_stream=i;
+ break;
+ }
+ if(m_stream == -1)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ m_codecCtx = m_formatCtx->streams[m_stream]->codec;
+
+ // get a decoder and open it
+ AVCodec *aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
+ if(!aCodec)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ if(avcodec_open(m_codecCtx, aCodec)<0)
+ AUD_THROW(AUD_ERROR_FFMPEG);
+
+ // XXX this prints stream information to stdout:
+ //dump_format(m_formatCtx, 0, NULL, 0);
+
+ m_specs.channels = (AUD_Channels) m_codecCtx->channels;
+ m_specs.format = FFMPEG_TO_AUD(m_codecCtx->sample_fmt);
+ m_specs.rate = (AUD_SampleRate) m_codecCtx->sample_rate;
+ }
+ catch(AUD_Exception e)
+ {
+ av_close_input_stream(m_formatCtx);
+ av_free(m_byteiocontext); AUD_DELETE("byteiocontext")
+ throw;
+ }
+
+ // last but not least if there hasn't been any error, create the buffers
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+ m_pkgbuf = new AUD_Buffer(AVCODEC_MAX_AUDIO_FRAME_SIZE<<1);
+ AUD_NEW("buffer")
+}
+
+AUD_FFMPEGReader::~AUD_FFMPEGReader()
+{
+ avcodec_close(m_codecCtx);
+
+ if(m_byteiocontext)
+ {
+ av_close_input_stream(m_formatCtx);
+ av_free(m_byteiocontext); AUD_DELETE("byteiocontext")
+ }
+ else
+ av_close_input_file(m_formatCtx);
+
+ delete m_buffer; AUD_DELETE("buffer")
+ delete m_pkgbuf; AUD_DELETE("buffer")
+}
+
+bool AUD_FFMPEGReader::isSeekable()
+{
+ return true;
+}
+
+void AUD_FFMPEGReader::seek(int position)
+{
+ if(position >= 0)
+ {
+ // a value < 0 tells us that seeking failed
+ if(av_seek_frame(m_formatCtx,
+ -1,
+ (uint64_t)(((uint64_t)position *
+ (uint64_t)AV_TIME_BASE) /
+ (uint64_t)m_specs.rate),
+ AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_ANY) >= 0)
+ {
+ avcodec_flush_buffers(m_codecCtx);
+ m_position = position;
+
+ AVPacket packet;
+ bool search = true;
+
+ while(search && av_read_frame(m_formatCtx, &packet) >= 0)
+ {
+ // is it a frame from the audio stream?
+ if(packet.stream_index == m_stream)
+ {
+ // decode the package
+ m_pkgbuf_left = decode(&packet, m_pkgbuf);
+ search = false;
+
+ // check position
+ if(packet.pts != AV_NOPTS_VALUE)
+ {
+ // calculate real position, and read to frame!
+ m_position = packet.pts *
+ av_q2d(m_formatCtx->streams[m_stream]->time_base) *
+ m_specs.rate;
+
+ if(m_position < position)
+ {
+ sample_t* buf;
+ int length = position - m_position;
+ read(length, buf);
+ }
+ }
+ }
+ av_free_packet(&packet);
+ }
+ }
+ else
+ {
+ // Seeking failed, do nothing.
+ }
+ }
+}
+
+int AUD_FFMPEGReader::getLength()
+{
+ // return approximated remaning size
+ return (int)((m_formatCtx->duration * m_codecCtx->sample_rate)
+ / AV_TIME_BASE)-m_position;
+}
+
+int AUD_FFMPEGReader::getPosition()
+{
+ return m_position;
+}
+
+AUD_Specs AUD_FFMPEGReader::getSpecs()
+{
+ return m_specs;
+}
+
+AUD_ReaderType AUD_FFMPEGReader::getType()
+{
+ return AUD_TYPE_STREAM;
+}
+
+bool AUD_FFMPEGReader::notify(AUD_Message &message)
+{
+ return false;
+}
+
+void AUD_FFMPEGReader::read(int & length, sample_t* & buffer)
+{
+ // read packages and decode them
+ AVPacket packet;
+ int data_size = 0;
+ int pkgbuf_pos;
+ int left = length;
+ int sample_size = AUD_SAMPLE_SIZE(m_specs);
+
+ // resize output buffer if necessary
+ if(m_buffer->getSize() < length*sample_size)
+ m_buffer->resize(length*sample_size);
+
+ buffer = m_buffer->getBuffer();
+ pkgbuf_pos = m_pkgbuf_left;
+ m_pkgbuf_left = 0;
+
+ // there may still be data in the buffer from the last call
+ if(pkgbuf_pos > 0)
+ {
+ data_size = AUD_MIN(pkgbuf_pos, left * sample_size);
+ memcpy(buffer, m_pkgbuf->getBuffer(), data_size);
+ buffer += data_size;
+ left -= data_size/sample_size;
+ }
+
+ // for each frame read as long as there isn't enough data already
+ while((left > 0) && (av_read_frame(m_formatCtx, &packet) >= 0))
+ {
+ // is it a frame from the audio stream?
+ if(packet.stream_index == m_stream)
+ {
+ // decode the package
+ pkgbuf_pos = decode(&packet, m_pkgbuf);
+
+ // copy to output buffer
+ data_size = AUD_MIN(pkgbuf_pos, left * sample_size);
+ memcpy(buffer, m_pkgbuf->getBuffer(), data_size);
+ buffer += data_size;
+ left -= data_size/sample_size;
+ }
+ av_free_packet(&packet);
+ }
+ // read more data than necessary?
+ if(pkgbuf_pos > data_size)
+ {
+ m_pkgbuf_left = pkgbuf_pos-data_size;
+ memmove(m_pkgbuf->getBuffer(), m_pkgbuf->getBuffer()+data_size,
+ pkgbuf_pos-data_size);
+ }
+
+ buffer = m_buffer->getBuffer();
+
+ if(left > 0)
+ length -= left;
+ m_position += length;
+}
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h
new file mode 100644
index 00000000000..6e303934f36
--- /dev/null
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h
@@ -0,0 +1,139 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_FFMPEGREADER
+#define AUD_FFMPEGREADER
+
+#include "AUD_IReader.h"
+#include "AUD_Reference.h"
+class AUD_Buffer;
+
+struct AVCodecContext;
+extern "C" {
+#include <libavformat/avformat.h>
+}
+
+/**
+ * This class reads a sound file via ffmpeg.
+ * \warning Seeking may not be accurate! Moreover the position is updated after
+ * a buffer reading call. So calling getPosition right after seek
+ * normally results in a wrong value.
+ * \warning Playback of an ogg with some outdated ffmpeg versions results in a
+ * segfault on windows.
+ */
+class AUD_FFMPEGReader : public AUD_IReader
+{
+private:
+ /**
+ * The current position in samples.
+ */
+ int m_position;
+
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The specification of the audio data.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * The buffer for package reading.
+ */
+ AUD_Buffer *m_pkgbuf;
+
+ /**
+ * The count of samples still available from the last read package.
+ */
+ int m_pkgbuf_left;
+
+ /**
+ * The AVFormatContext structure for using ffmpeg.
+ */
+ AVFormatContext* m_formatCtx;
+
+ /**
+ * The AVCodecContext structure for using ffmpeg.
+ */
+ AVCodecContext* m_codecCtx;
+
+ /**
+ * The ByteIOContext to read the data from.
+ */
+ ByteIOContext* m_byteiocontext;
+
+ /**
+ * The stream ID in the file.
+ */
+ int m_stream;
+
+ /**
+ * The memory file to read from, only saved to keep the buffer alive.
+ */
+ AUD_Reference<AUD_Buffer> m_membuffer;
+
+ /**
+ * Decodes a packet into the given buffer.
+ * \param packet The AVPacket to decode.
+ * \param buffer The target buffer.
+ * \return The count of read bytes.
+ */
+ int decode(AVPacket* packet, AUD_Buffer* buffer);
+
+public:
+ /**
+ * Creates a new reader.
+ * \param filename The path to the file to be read.
+ * \exception AUD_Exception Thrown if the file specified does not exist or
+ * cannot be read with ffmpeg.
+ */
+ AUD_FFMPEGReader(const char* filename);
+
+ /**
+ * Creates a new reader.
+ * \param buffer The buffer to read from.
+ * \exception AUD_Exception Thrown if the buffer specified cannot be read
+ * with ffmpeg.
+ */
+ AUD_FFMPEGReader(AUD_Reference<AUD_Buffer> buffer);
+
+ /**
+ * Destroys the reader and closes the file.
+ */
+ virtual ~AUD_FFMPEGReader();
+
+ virtual bool isSeekable();
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_FFMPEGREADER
diff --git a/intern/SoundSystem/intern/Makefile b/intern/audaspace/ffmpeg/Makefile
index 7684b6b0bca..492ac83f532 100644
--- a/intern/SoundSystem/intern/Makefile
+++ b/intern/audaspace/ffmpeg/Makefile
@@ -28,17 +28,14 @@
#
#
-LIBNAME = SoundSystem
-DIR = $(OCGDIR)/intern/SoundSystem
+LIBNAME = aud_ffmpeg
+DIR = $(OCGDIR)/intern/audaspace
include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
-CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_MOTO)/include
-CPPFLAGS += -I../../../source/blender/include
-CPPFLAGS += -I../dummy
-CPPFLAGS += -I../openal
+CPPFLAGS += $(NAN_FFMPEGCFLAGS)
+CPPFLAGS += -I../intern
CPPFLAGS += -I..
CPPFLAGS += -I.
diff --git a/intern/audaspace/intern/AUD_Buffer.cpp b/intern/audaspace/intern/AUD_Buffer.cpp
new file mode 100644
index 00000000000..71deae0e87e
--- /dev/null
+++ b/intern/audaspace/intern/AUD_Buffer.cpp
@@ -0,0 +1,67 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_Buffer.h"
+#include "AUD_Space.h"
+
+#include <cstring>
+#include <stdlib.h>
+
+#define AUD_ALIGN(a) (a + 16 - ((long)a & 15))
+
+AUD_Buffer::AUD_Buffer(int size)
+{
+ m_size = size;
+ m_buffer = (sample_t*) malloc(size+16); AUD_NEW("buffer")
+}
+
+AUD_Buffer::~AUD_Buffer()
+{
+ free(m_buffer); AUD_DELETE("buffer")
+}
+
+sample_t* AUD_Buffer::getBuffer()
+{
+ return AUD_ALIGN(m_buffer);
+}
+
+int AUD_Buffer::getSize()
+{
+ return m_size;
+}
+
+void AUD_Buffer::resize(int size, bool keep)
+{
+ sample_t* buffer = (sample_t*) malloc(size+16); AUD_NEW("buffer")
+
+ // copy old data over if wanted
+ if(keep)
+ memcpy(AUD_ALIGN(buffer), AUD_ALIGN(m_buffer), AUD_MIN(size, m_size));
+
+ free(m_buffer); AUD_DELETE("buffer")
+
+ m_buffer = buffer;
+ m_size = size;
+}
diff --git a/intern/audaspace/intern/AUD_Buffer.h b/intern/audaspace/intern/AUD_Buffer.h
new file mode 100644
index 00000000000..64959b03799
--- /dev/null
+++ b/intern/audaspace/intern/AUD_Buffer.h
@@ -0,0 +1,75 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_BUFFER
+#define AUD_BUFFER
+
+#include "AUD_Space.h"
+
+/**
+ * This class is a simple buffer in RAM which is 16 Byte aligned and provides
+ * resize functionality.
+ */
+class AUD_Buffer
+{
+private:
+ /// The size of the buffer in bytes.
+ int m_size;
+
+ /// The pointer to the buffer memory.
+ sample_t* m_buffer;
+
+public:
+ /**
+ * Creates a new buffer.
+ * \param size The size of the buffer in bytes.
+ */
+ AUD_Buffer(int size = 0);
+
+ /**
+ * Destroys the buffer.
+ */
+ ~AUD_Buffer();
+
+ /**
+ * Returns the pointer to the buffer in memory.
+ */
+ sample_t* getBuffer();
+
+ /**
+ * Returns the size of the buffer in bytes.
+ */
+ int getSize();
+
+ /**
+ * Resizes the buffer.
+ * \param size The new size of the buffer, measured in bytes.
+ * \param keep Whether to keep the old data. If the new buffer is smaller,
+ * the data at the end will be lost.
+ */
+ void resize(int size, bool keep = false);
+};
+
+#endif //AUD_BUFFER
diff --git a/intern/audaspace/intern/AUD_BufferReader.cpp b/intern/audaspace/intern/AUD_BufferReader.cpp
new file mode 100644
index 00000000000..47bf5d3d171
--- /dev/null
+++ b/intern/audaspace/intern/AUD_BufferReader.cpp
@@ -0,0 +1,91 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_BufferReader.h"
+#include "AUD_Buffer.h"
+#include "AUD_Space.h"
+
+AUD_BufferReader::AUD_BufferReader(AUD_Reference<AUD_Buffer> buffer,
+ AUD_Specs specs)
+{
+ m_position = 0;
+ m_buffer = buffer;
+ m_specs = specs;
+}
+
+bool AUD_BufferReader::isSeekable()
+{
+ return true;
+}
+
+void AUD_BufferReader::seek(int position)
+{
+ if(position < 0)
+ m_position = 0;
+ else if(position > m_buffer.get()->getSize() / AUD_SAMPLE_SIZE(m_specs))
+ m_position = m_buffer.get()->getSize() / AUD_SAMPLE_SIZE(m_specs);
+ else
+ m_position = position;
+}
+
+int AUD_BufferReader::getLength()
+{
+ return m_buffer.get()->getSize()/AUD_SAMPLE_SIZE(m_specs);
+}
+
+int AUD_BufferReader::getPosition()
+{
+ return m_position;
+}
+
+AUD_Specs AUD_BufferReader::getSpecs()
+{
+ return m_specs;
+}
+
+AUD_ReaderType AUD_BufferReader::getType()
+{
+ return AUD_TYPE_BUFFER;
+}
+
+bool AUD_BufferReader::notify(AUD_Message &message)
+{
+ return false;
+}
+
+void AUD_BufferReader::read(int & length, sample_t* & buffer)
+{
+ int sample_size = AUD_SAMPLE_SIZE(m_specs);
+
+ buffer = m_buffer.get()->getBuffer()+m_position*sample_size;
+
+ // in case the end of the buffer is reach
+ if(m_buffer.get()->getSize() < (m_position+length)*sample_size)
+ length = m_buffer.get()->getSize()/sample_size-m_position;
+
+ if(length < 0)
+ length = 0;
+ m_position += length;
+}
diff --git a/intern/audaspace/intern/AUD_BufferReader.h b/intern/audaspace/intern/AUD_BufferReader.h
new file mode 100644
index 00000000000..f2d8ff6b57d
--- /dev/null
+++ b/intern/audaspace/intern/AUD_BufferReader.h
@@ -0,0 +1,74 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_BUFFERREADER
+#define AUD_BUFFERREADER
+
+#include "AUD_IReader.h"
+#include "AUD_Reference.h"
+class AUD_Buffer;
+
+/**
+ * This class represents a simple reader from a buffer that exists in memory.
+ * \warning Notice that the buffer used for creating the reader must exist as
+ * long as the reader exists.
+ */
+class AUD_BufferReader : public AUD_IReader
+{
+private:
+ /**
+ * The current position in the buffer.
+ */
+ int m_position;
+
+ /**
+ * The buffer that is read.
+ */
+ AUD_Reference<AUD_Buffer> m_buffer;
+
+ /**
+ * The specification of the sample data in the buffer.
+ */
+ AUD_Specs m_specs;
+
+public:
+ /**
+ * Creates a new buffer reader.
+ * \param buffer The buffer to read from.
+ * \param specs The specification of the sample data in the buffer.
+ */
+ AUD_BufferReader(AUD_Reference<AUD_Buffer> buffer, AUD_Specs specs);
+
+ virtual bool isSeekable();
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_BUFFERREADER
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp
new file mode 100644
index 00000000000..995d4c5f99e
--- /dev/null
+++ b/intern/audaspace/intern/AUD_C-API.cpp
@@ -0,0 +1,560 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_NULLDevice.h"
+#include "AUD_I3DDevice.h"
+#include "AUD_FileFactory.h"
+#include "AUD_StreamBufferFactory.h"
+#include "AUD_DelayFactory.h"
+#include "AUD_LimiterFactory.h"
+#include "AUD_PingPongFactory.h"
+#include "AUD_LoopFactory.h"
+#include "AUD_ReadDevice.h"
+#include "AUD_SourceCaps.h"
+#include "AUD_IReader.h"
+
+#ifdef WITH_SDL
+#include "AUD_SDLDevice.h"
+#include "AUD_FloatMixer.h"
+#endif
+
+#ifdef WITH_OPENAL
+#include "AUD_OpenALDevice.h"
+#endif
+
+#ifdef WITH_JACK
+#include "AUD_JackDevice.h"
+#endif
+
+#ifdef WITH_FFMPEG
+extern "C" {
+#include <libavformat/avformat.h>
+}
+#endif
+
+#include <assert.h>
+
+typedef AUD_IFactory AUD_Sound;
+typedef AUD_ReadDevice AUD_Device;
+
+#define AUD_CAPI_IMPLEMENTATION
+#include "AUD_C-API.h"
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+static AUD_IDevice* AUD_device = NULL;
+static int AUD_available_devices[3];
+static AUD_I3DDevice* AUD_3ddevice = NULL;
+
+int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize)
+{
+#ifdef WITH_FFMPEG
+ av_register_all();
+#endif
+ AUD_IDevice* dev = NULL;
+
+ if(AUD_device)
+ AUD_exit();
+
+ try
+ {
+ switch(device)
+ {
+ case AUD_NULL_DEVICE:
+ dev = new AUD_NULLDevice();
+ break;
+#ifdef WITH_SDL
+ case AUD_SDL_DEVICE:
+ {
+ dev = new AUD_SDLDevice(specs, buffersize);
+ AUD_FloatMixer* mixer = new AUD_FloatMixer();
+ ((AUD_SDLDevice*)dev)->setMixer(mixer);
+ break;
+ }
+#endif
+#ifdef WITH_OPENAL
+ case AUD_OPENAL_DEVICE:
+ dev = new AUD_OpenALDevice(specs, buffersize);
+ break;
+#endif
+#ifdef WITH_JACK
+ case AUD_JACK_DEVICE:
+ dev = new AUD_JackDevice(specs);
+ break;
+#endif
+ default:
+ return false;
+ }
+
+ AUD_device = dev;
+ if(AUD_device->checkCapability(AUD_CAPS_3D_DEVICE))
+ AUD_3ddevice = dynamic_cast<AUD_I3DDevice*>(AUD_device);
+
+ return true;
+ }
+ catch(AUD_Exception e)
+ {
+ return false;
+ }
+}
+
+int* AUD_enumDevices()
+{
+ int i = 0;
+#ifdef WITH_SDL
+ AUD_available_devices[i++] = AUD_SDL_DEVICE;
+#endif
+#ifdef WITH_OPENAL
+ AUD_available_devices[i++] = AUD_OPENAL_DEVICE;
+#endif
+#ifdef WITH_JACK
+ AUD_available_devices[i++] = AUD_JACK_DEVICE;
+#endif
+ AUD_available_devices[i++] = AUD_NULL_DEVICE;
+ return AUD_available_devices;
+}
+
+void AUD_exit()
+{
+ if(AUD_device)
+ {
+ delete AUD_device;
+ AUD_device = NULL;
+ AUD_3ddevice = NULL;
+ }
+}
+
+void AUD_lock()
+{
+ assert(AUD_device);
+ AUD_device->lock();
+}
+
+void AUD_unlock()
+{
+ assert(AUD_device);
+ AUD_device->unlock();
+}
+
+AUD_SoundInfo AUD_getInfo(AUD_Sound* sound)
+{
+ assert(sound);
+
+ AUD_IReader* reader = sound->createReader();
+
+ AUD_SoundInfo info;
+
+ if(reader)
+ {
+ info.specs = reader->getSpecs();
+ info.length = reader->getLength() / (float) info.specs.rate;
+ }
+ else
+ {
+ info.specs.channels = AUD_CHANNELS_INVALID;
+ info.specs.format = AUD_FORMAT_INVALID;
+ info.specs.rate = AUD_RATE_INVALID;
+ info.length = 0.0;
+ }
+
+ return info;
+}
+
+AUD_Sound* AUD_load(const char* filename)
+{
+ assert(filename);
+ return new AUD_FileFactory(filename);
+}
+
+AUD_Sound* AUD_loadBuffer(unsigned char* buffer, int size)
+{
+ assert(buffer);
+ return new AUD_FileFactory(buffer, size);
+}
+
+AUD_Sound* AUD_bufferSound(AUD_Sound* sound)
+{
+ assert(sound);
+
+ try
+ {
+ return new AUD_StreamBufferFactory(sound);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+AUD_Sound* AUD_delaySound(AUD_Sound* sound, float delay)
+{
+ assert(sound);
+
+ try
+ {
+ return new AUD_DelayFactory(sound, delay);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+extern AUD_Sound* AUD_limitSound(AUD_Sound* sound, float start, float end)
+{
+ assert(sound);
+
+ try
+ {
+ return new AUD_LimiterFactory(sound, start, end);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+AUD_Sound* AUD_pingpongSound(AUD_Sound* sound)
+{
+ assert(sound);
+
+ try
+ {
+ return new AUD_PingPongFactory(sound);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+AUD_Sound* AUD_loopSound(AUD_Sound* sound)
+{
+ assert(sound);
+
+ try
+ {
+ return new AUD_LoopFactory(sound);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+int AUD_stopLoop(AUD_Handle* handle)
+{
+ if(handle)
+ {
+ AUD_Message message;
+ message.type = AUD_MSG_LOOP;
+ message.loopcount = 0;
+
+ try
+ {
+ return AUD_device->sendMessage(handle, message);
+ }
+ catch(AUD_Exception e)
+ {
+ }
+ }
+ return false;
+}
+
+void AUD_unload(AUD_Sound* sound)
+{
+ assert(sound);
+ delete sound;
+}
+
+AUD_Handle* AUD_play(AUD_Sound* sound, int keep)
+{
+ assert(AUD_device);
+ assert(sound);
+ try
+ {
+ return AUD_device->play(sound, keep);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+int AUD_pause(AUD_Handle* handle)
+{
+ assert(AUD_device);
+ return AUD_device->pause(handle);
+}
+
+int AUD_resume(AUD_Handle* handle)
+{
+ assert(AUD_device);
+ return AUD_device->resume(handle);
+}
+
+int AUD_stop(AUD_Handle* handle)
+{
+ if(AUD_device)
+ return AUD_device->stop(handle);
+ return false;
+}
+
+int AUD_setKeep(AUD_Handle* handle, int keep)
+{
+ assert(AUD_device);
+ return AUD_device->setKeep(handle, keep);
+}
+
+int AUD_seek(AUD_Handle* handle, float seekTo)
+{
+ assert(AUD_device);
+ return AUD_device->seek(handle, seekTo);
+}
+
+float AUD_getPosition(AUD_Handle* handle)
+{
+ assert(AUD_device);
+ return AUD_device->getPosition(handle);
+}
+
+AUD_Status AUD_getStatus(AUD_Handle* handle)
+{
+ assert(AUD_device);
+ return AUD_device->getStatus(handle);
+}
+
+AUD_Handle* AUD_play3D(AUD_Sound* sound, int keep)
+{
+ assert(AUD_device);
+ assert(sound);
+
+ try
+ {
+ if(AUD_3ddevice)
+ return AUD_3ddevice->play3D(sound, keep);
+ else
+ return AUD_device->play(sound, keep);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+int AUD_updateListener(AUD_3DData* data)
+{
+ assert(AUD_device);
+ assert(data);
+
+ try
+ {
+ if(AUD_3ddevice)
+ return AUD_3ddevice->updateListener(*data);
+ }
+ catch(AUD_Exception e)
+ {
+ }
+ return false;
+}
+
+int AUD_set3DSetting(AUD_3DSetting setting, float value)
+{
+ assert(AUD_device);
+
+ try
+ {
+ if(AUD_3ddevice)
+ return AUD_3ddevice->setSetting(setting, value);
+ }
+ catch(AUD_Exception e)
+ {
+ }
+ return false;
+}
+
+float AUD_get3DSetting(AUD_3DSetting setting)
+{
+ assert(AUD_device);
+
+ try
+ {
+ if(AUD_3ddevice)
+ return AUD_3ddevice->getSetting(setting);
+ }
+ catch(AUD_Exception e)
+ {
+ }
+ return 0.0;
+}
+
+int AUD_update3DSource(AUD_Handle* handle, AUD_3DData* data)
+{
+ if(handle)
+ {
+ assert(AUD_device);
+ assert(data);
+
+ try
+ {
+ if(AUD_3ddevice)
+ return AUD_3ddevice->updateSource(handle, *data);
+ }
+ catch(AUD_Exception e)
+ {
+ }
+ }
+ return false;
+}
+
+int AUD_set3DSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting, float value)
+{
+ if(handle)
+ {
+ assert(AUD_device);
+
+ try
+ {
+ if(AUD_3ddevice)
+ return AUD_3ddevice->setSourceSetting(handle, setting, value);
+ }
+ catch(AUD_Exception e)
+ {
+ }
+ }
+ return false;
+}
+
+float AUD_get3DSourceSetting(AUD_Handle* handle, AUD_3DSourceSetting setting)
+{
+ if(handle)
+ {
+ assert(AUD_device);
+
+ try
+ {
+ if(AUD_3ddevice)
+ return AUD_3ddevice->getSourceSetting(handle, setting);
+ }
+ catch(AUD_Exception e)
+ {
+ }
+ }
+ return 0.0;
+}
+
+int AUD_setSoundVolume(AUD_Handle* handle, float volume)
+{
+ if(handle)
+ {
+ assert(AUD_device);
+ AUD_SourceCaps caps;
+ caps.handle = handle;
+ caps.value = volume;
+
+ try
+ {
+ return AUD_device->setCapability(AUD_CAPS_SOURCE_VOLUME, &caps);
+ }
+ catch(AUD_Exception e) {}
+ }
+ return false;
+}
+
+int AUD_setSoundPitch(AUD_Handle* handle, float pitch)
+{
+ if(handle)
+ {
+ assert(AUD_device);
+ AUD_SourceCaps caps;
+ caps.handle = handle;
+ caps.value = pitch;
+
+ try
+ {
+ return AUD_device->setCapability(AUD_CAPS_SOURCE_PITCH, &caps);
+ }
+ catch(AUD_Exception e) {}
+ }
+ return false;
+}
+
+AUD_Device* AUD_openReadDevice(AUD_Specs specs)
+{
+ try
+ {
+ return new AUD_ReadDevice(specs);
+ }
+ catch(AUD_Exception e)
+ {
+ return NULL;
+ }
+}
+
+int AUD_playDevice(AUD_Device* device, AUD_Sound* sound)
+{
+ assert(device);
+ assert(sound);
+
+ try
+ {
+ return device->play(sound) != NULL;
+ }
+ catch(AUD_Exception e)
+ {
+ return false;
+ }
+}
+
+int AUD_readDevice(AUD_Device* device, sample_t* buffer, int length)
+{
+ assert(device);
+ assert(buffer);
+
+ try
+ {
+ return device->read(buffer, length);
+ }
+ catch(AUD_Exception e)
+ {
+ return false;
+ }
+}
+
+void AUD_closeReadDevice(AUD_Device* device)
+{
+ assert(device);
+
+ try
+ {
+ delete device;
+ }
+ catch(AUD_Exception e)
+ {
+ }
+}
diff --git a/intern/audaspace/intern/AUD_C-API.h b/intern/audaspace/intern/AUD_C-API.h
new file mode 100644
index 00000000000..6ec5ec87ad5
--- /dev/null
+++ b/intern/audaspace/intern/AUD_C-API.h
@@ -0,0 +1,331 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_CAPI
+#define AUD_CAPI
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "AUD_Space.h"
+
+typedef enum
+{
+ AUD_NULL_DEVICE = 0,
+ AUD_SDL_DEVICE,
+ AUD_OPENAL_DEVICE,
+ AUD_JACK_DEVICE
+} AUD_DeviceType;
+
+typedef struct
+{
+ AUD_Specs specs;
+ float length;
+} AUD_SoundInfo;
+
+#ifndef AUD_CAPI_IMPLEMENTATION
+ typedef void AUD_Sound;
+ typedef void AUD_Handle;
+ typedef void AUD_Device;
+#endif
+
+/**
+ * Initializes an audio device.
+ * \param device The device type that should be used.
+ * \param specs The audio specification to be used.
+ * \param buffersize The buffersize for the device.
+ * \return Whether the device has been initialized.
+ */
+extern int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize);
+
+/**
+ * Returns a integer list with available sound devices. The last one is always
+ * AUD_NULL_DEVICE.
+ */
+extern int* AUD_enumDevices();
+
+/**
+ * Unitinitializes an audio device.
+ */
+extern void AUD_exit();
+
+/**
+ * Locks the playback device.
+ */
+extern void AUD_lock();
+
+/**
+ * Unlocks the device.
+ */
+extern void AUD_unlock();
+
+/**
+ * Returns information about a sound.
+ * \param sound The sound to get the info about.
+ * \return The AUD_SoundInfo structure with filled in data.
+ */
+extern AUD_SoundInfo AUD_getInfo(AUD_Sound* sound);
+
+/**
+ * Loads a sound file.
+ * \param filename The filename of the sound file.
+ * \return A handle of the sound file.
+ */
+extern AUD_Sound* AUD_load(const char* filename);
+
+/**
+ * Loads a sound file.
+ * \param buffer The buffer which contains the sound file.
+ * \param size The size of the buffer.
+ * \return A handle of the sound file.
+ */
+extern AUD_Sound* AUD_loadBuffer(unsigned char* buffer, int size);
+
+/**
+ * Buffers a sound.
+ * \param sound The sound to buffer.
+ * \return A handle of the sound buffer.
+ */
+extern AUD_Sound* AUD_bufferSound(AUD_Sound* sound);
+
+/**
+ * Delays a sound.
+ * \param sound The sound to dealy.
+ * \param delay The delay in seconds.
+ * \return A handle of the delayed sound.
+ */
+extern AUD_Sound* AUD_delaySound(AUD_Sound* sound, float delay);
+
+/**
+ * Limits a sound.
+ * \param sound The sound to limit.
+ * \param start The start time in seconds.
+ * \param end The stop time in seconds.
+ * \return A handle of the limited sound.
+ */
+extern AUD_Sound* AUD_limitSound(AUD_Sound* sound, float start, float end);
+
+/**
+ * Ping pongs a sound.
+ * \param sound The sound to ping pong.
+ * \return A handle of the ping pong sound.
+ */
+extern AUD_Sound* AUD_pingpongSound(AUD_Sound* sound);
+
+/**
+ * Loops a sound.
+ * \param sound The sound to loop.
+ * \return A handle of the looped sound.
+ */
+extern AUD_Sound* AUD_loopSound(AUD_Sound* sound);
+
+/**
+ * Stops a looping sound when the current playback finishes.
+ * \param handle The playback handle.
+ * \return Whether the handle is valid.
+ */
+extern int AUD_stopLoop(AUD_Handle* handle);
+
+/**
+ * Unloads a sound of any type.
+ * \param sound The handle of the sound.
+ */
+extern void AUD_unload(AUD_Sound* sound);
+
+/**
+ * Plays back a sound file.
+ * \param sound The handle of the sound file.
+ * \param keep When keep is true the sound source will not be deleted but set to
+ * paused when its end has been reached.
+ * \return A handle to the played back sound.
+ */
+extern AUD_Handle* AUD_play(AUD_Sound* sound, int keep);
+
+/**
+ * Pauses a played back sound.
+ * \param handle The handle to the sound.
+ * \return Whether the handle has been playing or not.
+ */
+extern int AUD_pause(AUD_Handle* handle);
+
+/**
+ * Resumes a paused sound.
+ * \param handle The handle to the sound.
+ * \return Whether the handle has been paused or not.
+ */
+extern int AUD_resume(AUD_Handle* handle);
+
+/**
+ * Stops a playing or paused sound.
+ * \param handle The handle to the sound.
+ * \return Whether the handle has been valid or not.
+ */
+extern int AUD_stop(AUD_Handle* handle);
+
+/**
+ * Sets the end behaviour of a playing or paused sound.
+ * \param handle The handle to the sound.
+ * \param keep When keep is true the sound source will not be deleted but set to
+ * paused when its end has been reached.
+ * \return Whether the handle has been valid or not.
+ */
+extern int AUD_setKeep(AUD_Handle* handle, int keep);
+
+/**
+ * Seeks a playing or paused sound.
+ * \param handle The handle to the sound.
+ * \param seekTo From where the sound file should be played back in seconds.
+ * \return Whether the handle has been valid or not.
+ */
+extern int AUD_seek(AUD_Handle* handle, float seekTo);
+
+/**
+ * Retrieves the playback position of a handle.
+ * \return The current playback position in seconds or 0.0 if the handle is
+ * invalid.
+ */
+extern float AUD_getPosition(AUD_Handle* handle);
+
+/**
+ * Returns the status of a playing, paused or stopped sound.
+ * \param handle The handle to the sound.
+ * \return The status of the sound behind the handle.
+ */
+extern AUD_Status AUD_getStatus(AUD_Handle* handle);
+
+/**
+ * Plays a 3D sound.
+ * \param sound The handle of the sound file.
+ * \param keep When keep is true the sound source will not be deleted but set to
+ * paused when its end has been reached.
+ * \return A handle to the played back sound.
+ * \note The factory must provide a mono (single channel) source and the device
+ * must support 3D audio, otherwise the sound is played back normally.
+ */
+extern AUD_Handle* AUD_play3D(AUD_Sound* sound, int keep);
+
+/**
+ * Updates the listener 3D data.
+ * \param data The 3D data.
+ * \return Whether the action succeeded.
+ */
+extern int AUD_updateListener(AUD_3DData* data);
+
+/**
+ * Sets a 3D device setting.
+ * \param setting The setting type.
+ * \param value The new setting value.
+ * \return Whether the action succeeded.
+ */
+extern int AUD_set3DSetting(AUD_3DSetting setting, float value);
+
+/**
+ * Retrieves a 3D device setting.
+ * \param setting The setting type.
+ * \return The setting value.
+ */
+extern float AUD_get3DSetting(AUD_3DSetting setting);
+
+/**
+ * Updates a listeners 3D data.
+ * \param handle The source handle.
+ * \param data The 3D data.
+ * \return Whether the action succeeded.
+ */
+extern int AUD_update3DSource(AUD_Handle* handle, AUD_3DData* data);
+
+/**
+ * Sets a 3D source setting.
+ * \param handle The source handle.
+ * \param setting The setting type.
+ * \param value The new setting value.
+ * \return Whether the action succeeded.
+ */
+extern int AUD_set3DSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting, float value);
+
+/**
+ * Retrieves a 3D source setting.
+ * \param handle The source handle.
+ * \param setting The setting type.
+ * \return The setting value.
+ */
+extern float AUD_get3DSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting);
+
+/**
+ * Sets the volume of a played back sound.
+ * \param handle The handle to the sound.
+ * \param volume The new volume, must be between 0.0 and 1.0.
+ * \return Whether the action succeeded.
+ */
+extern int AUD_setSoundVolume(AUD_Handle* handle, float volume);
+
+/**
+ * Sets the pitch of a played back sound.
+ * \param handle The handle to the sound.
+ * \param pitch The new pitch.
+ * \return Whether the action succeeded.
+ */
+extern int AUD_setSoundPitch(AUD_Handle* handle, float pitch);
+
+/**
+ * Opens a read device, with which audio data can be read.
+ * \param specs The specification of the audio data.
+ * \return A device handle.
+ */
+extern AUD_Device* AUD_openReadDevice(AUD_Specs specs);
+
+/**
+ * Plays back a sound file through a read device.
+ * \param device The read device.
+ * \param sound The handle of the sound file.
+ * \return Whether the sound could be played back.
+ */
+extern int AUD_playDevice(AUD_Device* device, AUD_Sound* sound);
+
+/**
+ * Reads the next samples into the supplied buffer.
+ * \param device The read device.
+ * \param buffer The target buffer.
+ * \param length The length in samples to be filled.
+ * \return True if the reading succeeded, false if there are no sounds
+ * played back currently, in that case the buffer is filled with
+ * silence.
+ */
+extern int AUD_readDevice(AUD_Device* device, sample_t* buffer, int length);
+
+/**
+ * Closes a read device.
+ * \param device The read device.
+ */
+extern void AUD_closeReadDevice(AUD_Device* device);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //AUD_CAPI
diff --git a/intern/audaspace/intern/AUD_ChannelMapperFactory.cpp b/intern/audaspace/intern/AUD_ChannelMapperFactory.cpp
new file mode 100644
index 00000000000..66205a58015
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ChannelMapperFactory.cpp
@@ -0,0 +1,125 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_ChannelMapperFactory.h"
+#include "AUD_ChannelMapperReader.h"
+
+#include <cstring>
+
+AUD_ChannelMapperFactory::AUD_ChannelMapperFactory(AUD_IReader* reader,
+ AUD_Specs specs) :
+ AUD_MixerFactory(reader, specs)
+{
+ memset(m_mapping, 0, sizeof(m_mapping));
+}
+
+AUD_ChannelMapperFactory::AUD_ChannelMapperFactory(AUD_IFactory* factory,
+ AUD_Specs specs) :
+ AUD_MixerFactory(factory, specs)
+{
+ memset(m_mapping, 0, sizeof(m_mapping));
+}
+
+AUD_ChannelMapperFactory::AUD_ChannelMapperFactory(AUD_Specs specs) :
+ AUD_MixerFactory(specs)
+{
+ memset(m_mapping, 0, sizeof(m_mapping));
+}
+
+AUD_ChannelMapperFactory::~AUD_ChannelMapperFactory()
+{
+ for(int i = 1; i < 10; i++)
+ deleteMapping(i);
+}
+
+float** AUD_ChannelMapperFactory::getMapping(int ic)
+{
+ ic--;
+ if(ic > 8 || ic < 0)
+ return 0;
+
+ if(m_mapping[ic])
+ {
+ int channels = -1;
+ while(m_mapping[ic][++channels] != 0);
+ if(channels != m_specs.channels)
+ deleteMapping(ic+1);
+ }
+
+ if(!m_mapping[ic])
+ {
+ int channels = m_specs.channels;
+
+ m_mapping[ic] = new float*[channels+1]; AUD_NEW("mapping")
+ m_mapping[ic][channels] = 0;
+
+ for(int i = 0; i < channels; i++)
+ {
+ m_mapping[ic][i] = new float[ic+1]; AUD_NEW("mapping")
+ for(int j = 0; j <= ic; j++)
+ m_mapping[ic][i][j] = ((i == j) || (channels == 1) ||
+ (ic == 0)) ? 1.0f : 0.0f;
+ }
+ }
+
+ return m_mapping[ic];
+}
+
+void AUD_ChannelMapperFactory::deleteMapping(int ic)
+{
+ ic--;
+ if(ic > 8 || ic < 0)
+ return;
+
+ if(m_mapping[ic])
+ {
+ for(int i = 0; 1; i++)
+ {
+ if(m_mapping[ic][i] != 0)
+ {
+ delete[] m_mapping[ic][i]; AUD_DELETE("mapping")
+ }
+ else
+ break;
+ }
+ delete[] m_mapping[ic]; AUD_DELETE("mapping")
+ m_mapping[ic] = 0;
+ }
+}
+
+AUD_IReader* AUD_ChannelMapperFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ int ic = reader->getSpecs().channels;
+
+ reader = new AUD_ChannelMapperReader(reader, getMapping(ic));
+ AUD_NEW("reader")
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/intern/AUD_ChannelMapperFactory.h b/intern/audaspace/intern/AUD_ChannelMapperFactory.h
new file mode 100644
index 00000000000..c2c39f4bdf6
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ChannelMapperFactory.h
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_CHANNELMAPPERFACTORY
+#define AUD_CHANNELMAPPERFACTORY
+
+#include "AUD_MixerFactory.h"
+
+/**
+ * This factory creates a reader that maps a sound source's channels to a
+ * specific output channel count.
+ */
+class AUD_ChannelMapperFactory : public AUD_MixerFactory
+{
+private:
+ /**
+ * The mapping specification.
+ */
+ float **m_mapping[9];
+
+public:
+ AUD_ChannelMapperFactory(AUD_IReader* reader, AUD_Specs specs);
+ AUD_ChannelMapperFactory(AUD_IFactory* factory, AUD_Specs specs);
+ AUD_ChannelMapperFactory(AUD_Specs specs);
+
+ virtual ~AUD_ChannelMapperFactory();
+
+ /**
+ * Returns the mapping array for editing.
+ * \param ic The count of input channels the array should have.
+ * \note The count of output channels is read of the desired output specs.
+ */
+ float** getMapping(int ic);
+
+ /**
+ * Deletes the current channel mapping.
+ */
+ void deleteMapping(int ic);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_CHANNELMAPPERFACTORY
diff --git a/intern/audaspace/intern/AUD_ChannelMapperReader.cpp b/intern/audaspace/intern/AUD_ChannelMapperReader.cpp
new file mode 100644
index 00000000000..61f97c08a8e
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ChannelMapperReader.cpp
@@ -0,0 +1,108 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_ChannelMapperReader.h"
+#include "AUD_Buffer.h"
+
+AUD_ChannelMapperReader::AUD_ChannelMapperReader(AUD_IReader* reader,
+ float **mapping) :
+ AUD_EffectReader(reader)
+{
+ m_specs = reader->getSpecs();
+
+ if(m_specs.format != AUD_FORMAT_FLOAT32)
+ {
+ delete m_reader; AUD_DELETE("reader")
+ AUD_THROW(AUD_ERROR_READER);
+ }
+
+ int channels = -1;
+ m_rch = m_specs.channels;
+ while(mapping[++channels] != 0);
+
+ m_mapping = new float*[channels]; AUD_NEW("mapping")
+ m_specs.channels = (AUD_Channels)channels;
+
+ float sum;
+ int i;
+
+ while(channels--)
+ {
+ m_mapping[channels] = new float[m_rch]; AUD_NEW("mapping")
+ sum = 0.0f;
+ for(i=0; i < m_rch; i++)
+ sum += mapping[channels][i];
+ for(i=0; i < m_rch; i++)
+ m_mapping[channels][i] = sum > 0.0 ? mapping[channels][i]/sum : 0.0;
+ }
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_ChannelMapperReader::~AUD_ChannelMapperReader()
+{
+ int channels = m_specs.channels;
+
+ while(channels--)
+ {
+ delete[] m_mapping[channels]; AUD_DELETE("mapping")
+ }
+
+ delete[] m_mapping; AUD_DELETE("mapping")
+
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+AUD_Specs AUD_ChannelMapperReader::getSpecs()
+{
+ return m_specs;
+}
+
+void AUD_ChannelMapperReader::read(int & length, sample_t* & buffer)
+{
+ m_reader->read(length, buffer);
+
+ int channels = m_specs.channels;
+
+ if(m_buffer->getSize() < length * 4 * channels)
+ m_buffer->resize(length * 4 * channels);
+
+ float* in = (float*)buffer;
+ float* out = (float*)m_buffer->getBuffer();
+ float sum;
+
+ for(int i = 0; i < length; i++)
+ {
+ for(int j = 0; j < channels; j++)
+ {
+ sum = 0;
+ for(int k = 0; k < m_rch; k++)
+ sum += m_mapping[j][k] * in[i * m_rch + k];
+ out[i * channels + j] = sum;
+ }
+ }
+
+ buffer = m_buffer->getBuffer();
+}
diff --git a/intern/audaspace/intern/AUD_ChannelMapperReader.h b/intern/audaspace/intern/AUD_ChannelMapperReader.h
new file mode 100644
index 00000000000..fe79ab6edd6
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ChannelMapperReader.h
@@ -0,0 +1,76 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_CHANNELMAPPERREADER
+#define AUD_CHANNELMAPPERREADER
+
+#include "AUD_EffectReader.h"
+class AUD_Buffer;
+
+/**
+ * This class maps a sound source's channels to a specific output channel count.
+ * \note The input sample format must be float.
+ */
+class AUD_ChannelMapperReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The sound output buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The output specification.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * The channel count of the reader.
+ */
+ int m_rch;
+
+ /**
+ * The mapping specification.
+ */
+ float **m_mapping;
+
+public:
+ /**
+ * Creates a channel mapper reader.
+ * \param reader The reader to map.
+ * \param mapping The mapping specification as two dimensional float array.
+ * \exception AUD_Exception Thrown if the reader is NULL.
+ */
+ AUD_ChannelMapperReader(AUD_IReader* reader, float **mapping);
+ /**
+ * Destroys the reader.
+ */
+ ~AUD_ChannelMapperReader();
+
+ virtual AUD_Specs getSpecs();
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_CHANNELMAPPERREADER
diff --git a/intern/audaspace/intern/AUD_ConverterFactory.cpp b/intern/audaspace/intern/AUD_ConverterFactory.cpp
new file mode 100644
index 00000000000..a1a86662072
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ConverterFactory.cpp
@@ -0,0 +1,54 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_ConverterFactory.h"
+#include "AUD_ConverterReader.h"
+
+AUD_ConverterFactory::AUD_ConverterFactory(AUD_IReader* reader,
+ AUD_Specs specs) :
+ AUD_MixerFactory(reader, specs) {}
+
+AUD_ConverterFactory::AUD_ConverterFactory(AUD_IFactory* factory,
+ AUD_Specs specs) :
+ AUD_MixerFactory(factory, specs) {}
+
+AUD_ConverterFactory::AUD_ConverterFactory(AUD_Specs specs) :
+ AUD_MixerFactory(specs) {}
+
+AUD_IReader* AUD_ConverterFactory::createReader()
+{
+ AUD_IReader* reader = getReader();
+
+ if(reader != 0)
+ {
+ if(reader->getSpecs().format != m_specs.format)
+ {
+ reader = new AUD_ConverterReader(reader, m_specs);
+ AUD_NEW("reader")
+ }
+ }
+
+ return reader;
+}
diff --git a/intern/audaspace/intern/AUD_ConverterFactory.h b/intern/audaspace/intern/AUD_ConverterFactory.h
new file mode 100644
index 00000000000..3778e8d8f03
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ConverterFactory.h
@@ -0,0 +1,45 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_CONVERTERFACTORY
+#define AUD_CONVERTERFACTORY
+
+#include "AUD_MixerFactory.h"
+
+/**
+ * This factory creates a converter reader that is able to convert from one
+ * audio format to another.
+ */
+class AUD_ConverterFactory : public AUD_MixerFactory
+{
+public:
+ AUD_ConverterFactory(AUD_IReader* reader, AUD_Specs specs);
+ AUD_ConverterFactory(AUD_IFactory* factory, AUD_Specs specs);
+ AUD_ConverterFactory(AUD_Specs specs);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_CONVERTERFACTORY
diff --git a/intern/audaspace/intern/AUD_ConverterFunctions.cpp b/intern/audaspace/intern/AUD_ConverterFunctions.cpp
new file mode 100644
index 00000000000..b6d5dffa1a2
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ConverterFunctions.cpp
@@ -0,0 +1,502 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_ConverterFunctions.h"
+#include "AUD_Buffer.h"
+
+#define AUD_U8_0 0x80
+#define AUD_S16_MAX 0x7FFF
+#define AUD_S16_MIN 0x8000
+#define AUD_S16_FLT 32768.0
+#define AUD_S32_MAX 0x7FFFFFFF
+#define AUD_S32_MIN 0x80000000
+#define AUD_S32_FLT 2147483648.0
+#define AUD_FLT_MAX 1.0
+#define AUD_FLT_MIN -1.0
+
+void AUD_convert_u8_s16(sample_t* target, sample_t* source, int length)
+{
+ int16_t* t = (int16_t*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = (((int16_t)source[i]) - AUD_U8_0) << 8;
+}
+
+void AUD_convert_u8_s24_be(sample_t* target, sample_t* source, int length)
+{
+ for(int i = 0; i < length; i++)
+ {
+ target[i*3] = source[i] - AUD_U8_0;
+ target[i*3+1] = 0;
+ target[i*3+2] = 0;
+ }
+}
+
+void AUD_convert_u8_s24_le(sample_t* target, sample_t* source, int length)
+{
+ for(int i = 0; i < length; i++)
+ {
+ target[i*3+2] = source[i] - AUD_U8_0;
+ target[i*3+1] = 0;
+ target[i*3] = 0;
+ }
+}
+
+void AUD_convert_u8_s32(sample_t* target, sample_t* source, int length)
+{
+ int32_t* t = (int32_t*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = (((int32_t)source[i]) - AUD_U8_0) << 24;
+}
+
+void AUD_convert_u8_float(sample_t* target, sample_t* source, int length)
+{
+ float* t = (float*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = (((int32_t)source[i]) - AUD_U8_0) / ((float)AUD_U8_0);
+}
+
+void AUD_convert_u8_double(sample_t* target, sample_t* source, int length)
+{
+ double* t = (double*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = (((int32_t)source[i]) - AUD_U8_0) / ((double)AUD_U8_0);
+}
+
+void AUD_convert_s16_u8(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ for(int i = 0; i < length; i++)
+ target[i] = (unsigned char)((s[i] >> 8) + AUD_U8_0);
+}
+
+void AUD_convert_s16_s24_be(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ for(int i = 0; i < length; i++)
+ {
+ target[i*3] = s[i] >> 8 & 0xFF;
+ target[i*3+1] = s[i] & 0xFF;
+ target[i*3+2] = 0;
+ }
+}
+
+void AUD_convert_s16_s24_le(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ for(int i = 0; i < length; i++)
+ {
+ target[i*3+2] = s[i] >> 8 & 0xFF;
+ target[i*3+1] = s[i] & 0xFF;
+ target[i*3] = 0;
+ }
+}
+
+void AUD_convert_s16_s32(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ int32_t* t = (int32_t*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = ((int32_t)s[i]) << 16;
+}
+
+void AUD_convert_s16_float(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ float* t = (float*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = s[i] / AUD_S16_FLT;
+}
+
+void AUD_convert_s16_double(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ double* t = (double*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = s[i] / AUD_S16_FLT;
+}
+
+void AUD_convert_s24_u8_be(sample_t* target, sample_t* source, int length)
+{
+ for(int i = 0; i < length; i++)
+ target[i] = source[i*3] ^ AUD_U8_0;
+}
+
+void AUD_convert_s24_u8_le(sample_t* target, sample_t* source, int length)
+{
+ for(int i = 0; i < length; i++)
+ target[i] = source[i*3+2] ^ AUD_U8_0;
+}
+
+void AUD_convert_s24_s16_be(sample_t* target, sample_t* source, int length)
+{
+ int16_t* t = (int16_t*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = source[i*3] << 8 | source[i*3+1];
+}
+
+void AUD_convert_s24_s16_le(sample_t* target, sample_t* source, int length)
+{
+ int16_t* t = (int16_t*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = source[i*3+2] << 8 | source[i*3+1];
+}
+
+void AUD_convert_s24_s24(sample_t* target, sample_t* source, int length)
+{
+ memcpy(target, source, length * 3);
+}
+
+void AUD_convert_s24_s32_be(sample_t* target, sample_t* source, int length)
+{
+ int32_t* t = (int32_t*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = source[i*3] << 24 | source[i*3+1] << 16 | source[i*3+2] << 8;
+}
+
+void AUD_convert_s24_s32_le(sample_t* target, sample_t* source, int length)
+{
+ int32_t* t = (int32_t*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = source[i*3+2] << 24 | source[i*3+1] << 16 | source[i*3] << 8;
+}
+
+void AUD_convert_s24_float_be(sample_t* target, sample_t* source, int length)
+{
+ float* t = (float*) target;
+ int32_t s;
+ for(int i = 0; i < length; i++)
+ {
+ s = source[i*3] << 24 | source[i*3+1] << 16 | source[i*3+2] << 8;
+ t[i] = s / AUD_S32_FLT;
+ }
+}
+
+void AUD_convert_s24_float_le(sample_t* target, sample_t* source, int length)
+{
+ float* t = (float*) target;
+ int32_t s;
+ for(int i = 0; i < length; i++)
+ {
+ s = source[i*3+2] << 24 | source[i*3+1] << 16 | source[i*3] << 8;
+ t[i] = s / AUD_S32_FLT;
+ }
+}
+
+void AUD_convert_s24_double_be(sample_t* target, sample_t* source, int length)
+{
+ double* t = (double*) target;
+ int32_t s;
+ for(int i = 0; i < length; i++)
+ {
+ s = source[i*3] << 24 | source[i*3+1] << 16 | source[i*3+2] << 8;
+ t[i] = s / AUD_S32_FLT;
+ }
+}
+
+void AUD_convert_s24_double_le(sample_t* target, sample_t* source, int length)
+{
+ double* t = (double*) target;
+ int32_t s;
+ for(int i = 0; i < length; i++)
+ {
+ s = source[i*3+2] << 24 | source[i*3+1] << 16 | source[i*3] << 8;
+ t[i] = s / AUD_S32_FLT;
+ }
+}
+
+void AUD_convert_s32_u8(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ for(int i = 0; i < length; i++)
+ target[i] = (unsigned char)((s[i] >> 24) + AUD_U8_0);
+}
+
+void AUD_convert_s32_s16(sample_t* target, sample_t* source, int length)
+{
+ int16_t* t = (int16_t*) target;
+ int32_t* s = (int32_t*) source;
+ for(int i = 0; i < length; i++)
+ t[i] = s[i] >> 16;
+}
+
+void AUD_convert_s32_s24_be(sample_t* target, sample_t* source, int length)
+{
+ int32_t* s = (int32_t*) source;
+ for(int i = 0; i < length; i++)
+ {
+ target[i*3] = s[i] >> 24 & 0xFF;
+ target[i*3+1] = s[i] >> 16 & 0xFF;
+ target[i*3+2] = s[i] >> 8 & 0xFF;
+ }
+}
+
+void AUD_convert_s32_s24_le(sample_t* target, sample_t* source, int length)
+{
+ int16_t* s = (int16_t*) source;
+ for(int i = 0; i < length; i++)
+ {
+ target[i*3+2] = s[i] >> 24 & 0xFF;
+ target[i*3+1] = s[i] >> 16 & 0xFF;
+ target[i*3] = s[i] >> 8 & 0xFF;
+ }
+}
+
+void AUD_convert_s32_float(sample_t* target, sample_t* source, int length)
+{
+ int32_t* s = (int32_t*) source;
+ float* t = (float*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = s[i] / AUD_S32_FLT;
+}
+
+void AUD_convert_s32_double(sample_t* target, sample_t* source, int length)
+{
+ int32_t* s = (int32_t*) source;
+ double* t = (double*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = s[i] / AUD_S32_FLT;
+}
+
+void AUD_convert_float_u8(sample_t* target, sample_t* source, int length)
+{
+ float* s = (float*) source;
+ float t;
+ for(int i = 0; i < length; i++)
+ {
+ t = s[i] + AUD_FLT_MAX;
+ if(t <= 0.0f)
+ target[i] = 0;
+ else if(t >= 2.0f)
+ target[i] = 255;
+ else
+ target[i] = (unsigned char)(t*127);
+ }
+}
+
+void AUD_convert_float_s16(sample_t* target, sample_t* source, int length)
+{
+ int16_t* t = (int16_t*) target;
+ float* s = (float*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t[i] = AUD_S16_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t[i] = AUD_S16_MAX;
+ else
+ t[i] = (int16_t)(s[i] * AUD_S16_MAX);
+ }
+}
+
+void AUD_convert_float_s24_be(sample_t* target, sample_t* source, int length)
+{
+ int32_t t;
+ float* s = (float*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t = AUD_S32_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t = AUD_S32_MAX;
+ else
+ t = (int32_t)(s[i]*AUD_S32_MAX);
+ target[i*3] = t >> 24 & 0xFF;
+ target[i*3+1] = t >> 16 & 0xFF;
+ target[i*3+2] = t >> 8 & 0xFF;
+ }
+}
+
+void AUD_convert_float_s24_le(sample_t* target, sample_t* source, int length)
+{
+ int32_t t;
+ float* s = (float*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t = AUD_S32_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t = AUD_S32_MAX;
+ else
+ t = (int32_t)(s[i]*AUD_S32_MAX);
+ target[i*3+2] = t >> 24 & 0xFF;
+ target[i*3+1] = t >> 16 & 0xFF;
+ target[i*3] = t >> 8 & 0xFF;
+ }
+}
+
+void AUD_convert_float_s32(sample_t* target, sample_t* source, int length)
+{
+ int32_t* t = (int32_t*) target;
+ float* s = (float*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t[i] = AUD_S32_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t[i] = AUD_S32_MAX;
+ else
+ t[i] = (int32_t)(s[i]*AUD_S32_MAX);
+ }
+}
+
+void AUD_convert_float_double(sample_t* target, sample_t* source, int length)
+{
+ float* s = (float*) source;
+ double* t = (double*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = s[i];
+}
+
+void AUD_convert_double_u8(sample_t* target, sample_t* source, int length)
+{
+ double* s = (double*) source;
+ double t;
+ for(int i = 0; i < length; i++)
+ {
+ t = s[i] + AUD_FLT_MAX;
+ if(t <= 0.0)
+ target[i] = 0;
+ else if(t >= 2.0)
+ target[i] = 255;
+ else
+ target[i] = (unsigned char)(t*127);
+ }
+}
+
+void AUD_convert_double_s16(sample_t* target, sample_t* source, int length)
+{
+ int16_t* t = (int16_t*) target;
+ double* s = (double*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t[i] = AUD_S16_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t[i] = AUD_S16_MAX;
+ else
+ t[i] = (int16_t)(s[i]*AUD_S16_MAX);
+ }
+}
+
+void AUD_convert_double_s24_be(sample_t* target, sample_t* source, int length)
+{
+ int32_t t;
+ double* s = (double*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t = AUD_S32_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t = AUD_S32_MAX;
+ else
+ t = (int32_t)(s[i]*AUD_S32_MAX);
+ target[i*3] = t >> 24 & 0xFF;
+ target[i*3+1] = t >> 16 & 0xFF;
+ target[i*3+2] = t >> 8 & 0xFF;
+ }
+}
+
+void AUD_convert_double_s24_le(sample_t* target, sample_t* source, int length)
+{
+ int32_t t;
+ double* s = (double*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t = AUD_S32_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t = AUD_S32_MAX;
+ else
+ t = (int32_t)(s[i]*AUD_S32_MAX);
+ target[i*3+2] = t >> 24 & 0xFF;
+ target[i*3+1] = t >> 16 & 0xFF;
+ target[i*3] = t >> 8 & 0xFF;
+ }
+}
+
+void AUD_convert_double_s32(sample_t* target, sample_t* source, int length)
+{
+ int32_t* t = (int32_t*) target;
+ double* s = (double*) source;
+ for(int i = 0; i < length; i++)
+ {
+ if(s[i] <= AUD_FLT_MIN)
+ t[i] = AUD_S32_MIN;
+ else if(s[i] >= AUD_FLT_MAX)
+ t[i] = AUD_S32_MAX;
+ else
+ t[i] = (int32_t)(s[i]*AUD_S32_MAX);
+ }
+}
+
+void AUD_convert_double_float(sample_t* target, sample_t* source, int length)
+{
+ double* s = (double*) source;
+ float* t = (float*) target;
+ for(int i = 0; i < length; i++)
+ t[i] = s[i];
+}
+
+void AUD_volume_adjust_u8(sample_t* target, sample_t* source,
+ int count, float volume)
+{
+ for(int i=0; i<count; i++)
+ target[i] = (unsigned char)((source[i]-0x0080) * volume + 0x80);
+}
+
+void AUD_volume_adjust_s24_le(sample_t* target, sample_t* source,
+ int count, float volume)
+{
+ count *= 3;
+ int value;
+
+ for(int i=0; i<count; i+=3)
+ {
+ value = source[i+2] << 16 | source[i+1] << 8 | source[i];
+ value |= (((value & 0x800000) >> 23) * 255) << 24;
+ value *= volume;
+ target[i+2] = value >> 16;
+ target[i+1] = value >> 8;
+ target[i] = value;
+ }
+}
+
+void AUD_volume_adjust_s24_be(sample_t* target, sample_t* source,
+ int count, float volume)
+{
+ count *= 3;
+ int value;
+
+ for(int i=0; i < count; i+=3)
+ {
+ value = source[i] << 16 | source[i+1] << 8 | source[i+2];
+ value |= (((value & 0x800000) >> 23) * 255) << 24;
+ value *= volume;
+ target[i] = value >> 16;
+ target[i+1] = value >> 8;
+ target[i+2] = value;
+ }
+}
+
diff --git a/intern/audaspace/intern/AUD_ConverterFunctions.h b/intern/audaspace/intern/AUD_ConverterFunctions.h
new file mode 100644
index 00000000000..c1dd0f4a3a2
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ConverterFunctions.h
@@ -0,0 +1,156 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_CONVERTERFUNCTIONS
+#define AUD_CONVERTERFUNCTIONS
+
+#include "AUD_Space.h"
+
+#include <cstring>
+#ifdef _MSC_VER
+#if (_MSC_VER < 1300)
+ typedef short int16_t;
+ typedef int int32_t;
+#else
+ typedef __int16 int16_t;
+ typedef __int32 int32_t;
+#endif
+#else
+#include <stdint.h>
+#endif
+
+typedef void (*AUD_convert_f)(sample_t* target, sample_t* source, int length);
+
+typedef void (*AUD_volume_adjust_f)(sample_t* target, sample_t* source,
+ int count, float volume);
+
+template <class T>
+void AUD_convert_copy(sample_t* target, sample_t* source, int length)
+{
+ memcpy(target, source, length*sizeof(T));
+}
+
+void AUD_convert_u8_s16(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_u8_s24_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_u8_s24_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_u8_s32(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_u8_float(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_u8_double(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s16_u8(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s16_s24_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s16_s24_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s16_s32(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s16_float(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s16_double(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_u8_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_u8_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_s16_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_s16_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_s24(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_s32_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_s32_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_float_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_float_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_double_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s24_double_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s32_u8(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s32_s16(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s32_s24_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s32_s24_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s32_float(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_s32_double(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_float_u8(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_float_s16(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_float_s24_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_float_s24_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_float_s32(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_float_double(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_double_u8(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_double_s16(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_double_s24_be(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_double_s24_le(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_double_s32(sample_t* target, sample_t* source, int length);
+
+void AUD_convert_double_float(sample_t* target, sample_t* source, int length);
+
+template <class T>
+void AUD_volume_adjust(sample_t* target, sample_t* source,
+ int count, float volume)
+{
+ T* t = (T*)target;
+ T* s = (T*)source;
+ for(int i=0; i < count; i++)
+ t[i] = (T)(s[i] * volume);
+}
+
+void AUD_volume_adjust_u8(sample_t* target, sample_t* source,
+ int count, float volume);
+
+void AUD_volume_adjust_s24_le(sample_t* target, sample_t* source,
+ int count, float volume);
+
+void AUD_volume_adjust_s24_be(sample_t* target, sample_t* source,
+ int count, float volume);
+
+#endif //AUD_CONVERTERFUNCTIONS
diff --git a/intern/audaspace/intern/AUD_ConverterReader.cpp b/intern/audaspace/intern/AUD_ConverterReader.cpp
new file mode 100644
index 00000000000..da25a2b7460
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ConverterReader.cpp
@@ -0,0 +1,260 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_ConverterReader.h"
+#include "AUD_Buffer.h"
+
+AUD_ConverterReader::AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs) :
+ AUD_EffectReader(reader)
+{
+ m_specs = reader->getSpecs();
+
+ int bigendian = 1;
+ bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
+
+ switch(m_specs.format)
+ {
+ case AUD_FORMAT_U8:
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_copy<unsigned char>;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_u8_s16;
+ break;
+ case AUD_FORMAT_S24:
+ if(bigendian)
+ m_convert = AUD_convert_u8_s24_be;
+ else
+ m_convert = AUD_convert_u8_s24_le;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_u8_s32;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_u8_float;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_u8_double;
+ break;
+ default:
+ break;
+ }
+ break;
+ case AUD_FORMAT_S16:
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_s16_u8;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_copy<int16_t>;
+ break;
+ case AUD_FORMAT_S24:
+ if(bigendian)
+ m_convert = AUD_convert_s16_s24_be;
+ else
+ m_convert = AUD_convert_s16_s24_le;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_s16_s32;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_s16_float;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_s16_double;
+ break;
+ default:
+ break;
+ }
+ break;
+ case AUD_FORMAT_S24:
+ if(bigendian)
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_u8_s24_be;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_s16_s24_be;
+ break;
+ case AUD_FORMAT_S24:
+ m_convert = AUD_convert_s24_s24;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_s32_s24_be;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_float_s24_be;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_double_s24_be;
+ break;
+ default:
+ break;
+ }
+ else
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_u8_s24_le;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_s16_s24_le;
+ break;
+ case AUD_FORMAT_S24:
+ m_convert = AUD_convert_s24_s24;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_s32_s24_le;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_float_s24_le;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_double_s24_le;
+ break;
+ default:
+ break;
+ }
+ break;
+ case AUD_FORMAT_S32:
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_s32_u8;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_s32_s16;
+ break;
+ case AUD_FORMAT_S24:
+ if(bigendian)
+ m_convert = AUD_convert_s32_s24_be;
+ else
+ m_convert = AUD_convert_s32_s24_le;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_copy<int32_t>;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_s32_float;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_s32_double;
+ break;
+ default:
+ break;
+ }
+ break;
+ case AUD_FORMAT_FLOAT32:
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_float_u8;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_float_s16;
+ break;
+ case AUD_FORMAT_S24:
+ if(bigendian)
+ m_convert = AUD_convert_float_s24_be;
+ else
+ m_convert = AUD_convert_float_s24_le;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_float_s32;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_copy<float>;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_float_double;
+ break;
+ default:
+ break;
+ }
+ break;
+ case AUD_FORMAT_FLOAT64:
+ switch(specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_double_u8;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_double_s16;
+ break;
+ case AUD_FORMAT_S24:
+ if(bigendian)
+ m_convert = AUD_convert_double_s24_be;
+ else
+ m_convert = AUD_convert_double_s24_le;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_double_s32;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_double_float;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_copy<double>;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ m_specs.format = specs.format;
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_ConverterReader::~AUD_ConverterReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+AUD_Specs AUD_ConverterReader::getSpecs()
+{
+ return m_specs;
+}
+
+void AUD_ConverterReader::read(int & length, sample_t* & buffer)
+{
+ m_reader->read(length, buffer);
+
+ int samplesize = AUD_SAMPLE_SIZE(m_specs);
+
+ if(m_buffer->getSize() < length*samplesize)
+ m_buffer->resize(length*samplesize);
+
+ m_convert(m_buffer->getBuffer(), buffer, length*m_specs.channels);
+
+ buffer = m_buffer->getBuffer();
+}
diff --git a/intern/audaspace/intern/AUD_ConverterReader.h b/intern/audaspace/intern/AUD_ConverterReader.h
new file mode 100644
index 00000000000..f855372b636
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ConverterReader.h
@@ -0,0 +1,71 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_CONVERTERREADER
+#define AUD_CONVERTERREADER
+
+#include "AUD_EffectReader.h"
+#include "AUD_ConverterFunctions.h"
+class AUD_Buffer;
+
+/**
+ * This class converts a sound source from one to another format.
+ */
+class AUD_ConverterReader : public AUD_EffectReader
+{
+private:
+ /**
+ * The sound output buffer.
+ */
+ AUD_Buffer *m_buffer;
+
+ /**
+ * The target specification.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * Converter function.
+ */
+ AUD_convert_f m_convert;
+
+public:
+ /**
+ * Creates a converter reader.
+ * \param reader The reader to convert.
+ * \param specs The target specification.
+ * \exception AUD_Exception Thrown if the reader is NULL.
+ */
+ AUD_ConverterReader(AUD_IReader* reader, AUD_Specs specs);
+ /**
+ * Destroys the reader.
+ */
+ ~AUD_ConverterReader();
+
+ virtual AUD_Specs getSpecs();
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_CONVERTERREADER
diff --git a/intern/audaspace/intern/AUD_FileFactory.cpp b/intern/audaspace/intern/AUD_FileFactory.cpp
new file mode 100644
index 00000000000..b63390803b1
--- /dev/null
+++ b/intern/audaspace/intern/AUD_FileFactory.cpp
@@ -0,0 +1,95 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_FileFactory.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+#ifdef WITH_FFMPEG
+#include "AUD_FFMPEGReader.h"
+#endif
+#ifdef WITH_SNDFILE
+#include "AUD_SndFileReader.h"
+#endif
+
+AUD_FileFactory::AUD_FileFactory(const char* filename)
+{
+ if(filename != NULL)
+ {
+ m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
+ strcpy(m_filename, filename);
+ }
+ else
+ m_filename = NULL;
+}
+
+AUD_FileFactory::AUD_FileFactory(unsigned char* buffer, int size)
+{
+ m_filename = NULL;
+ m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer(size));
+ memcpy(m_buffer.get()->getBuffer(), buffer, size);
+}
+
+AUD_FileFactory::~AUD_FileFactory()
+{
+ if(m_filename)
+ {
+ delete[] m_filename; AUD_DELETE("string")
+ }
+}
+
+AUD_IReader* AUD_FileFactory::createReader()
+{
+ AUD_IReader* reader = 0;
+
+#ifdef WITH_SNDFILE
+ try
+ {
+ if(m_filename)
+ reader = new AUD_SndFileReader(m_filename);
+ else
+ reader = new AUD_SndFileReader(m_buffer);
+ AUD_NEW("reader")
+ return reader;
+ }
+ catch(AUD_Exception e) {}
+#endif
+
+#ifdef WITH_FFMPEG
+ try
+ {
+ if(m_filename)
+ reader = new AUD_FFMPEGReader(m_filename);
+ else
+ reader = new AUD_FFMPEGReader(m_buffer);
+ AUD_NEW("reader")
+ return reader;
+ }
+ catch(AUD_Exception e) {}
+#endif
+
+ return reader;
+}
diff --git a/intern/audaspace/intern/AUD_FileFactory.h b/intern/audaspace/intern/AUD_FileFactory.h
new file mode 100644
index 00000000000..6ab8f280534
--- /dev/null
+++ b/intern/audaspace/intern/AUD_FileFactory.h
@@ -0,0 +1,71 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_FILEFACTORY
+#define AUD_FILEFACTORY
+
+#include "AUD_IFactory.h"
+#include "AUD_Reference.h"
+class AUD_Buffer;
+
+/**
+ * This factory tries to read a sound file via all available file readers.
+ */
+class AUD_FileFactory : public AUD_IFactory
+{
+private:
+ /**
+ * The filename of the sound source file.
+ */
+ char* m_filename;
+
+ /**
+ * The buffer to read from.
+ */
+ AUD_Reference<AUD_Buffer> m_buffer;
+
+public:
+ /**
+ * Creates a new factory.
+ * \param filename The sound file path.
+ */
+ AUD_FileFactory(const char* filename);
+
+ /**
+ * Creates a new factory.
+ * \param buffer The buffer to read from.
+ * \param size The size of the buffer.
+ */
+ AUD_FileFactory(unsigned char* buffer, int size);
+
+ /**
+ * Destroys the factory.
+ */
+ ~AUD_FileFactory();
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_FILEFACTORY
diff --git a/intern/audaspace/intern/AUD_FloatMixer.cpp b/intern/audaspace/intern/AUD_FloatMixer.cpp
new file mode 100644
index 00000000000..f7133b9c30e
--- /dev/null
+++ b/intern/audaspace/intern/AUD_FloatMixer.cpp
@@ -0,0 +1,172 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_FloatMixer.h"
+#include "AUD_ConverterFactory.h"
+#include "AUD_SRCResampleFactory.h"
+#include "AUD_ChannelMapperFactory.h"
+#include "AUD_IReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_FloatMixer::AUD_FloatMixer()
+{
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+
+ m_converter = NULL;
+ m_resampler = NULL;
+ m_mapper = NULL;
+}
+
+AUD_FloatMixer::~AUD_FloatMixer()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+
+ if(m_converter)
+ {
+ delete m_converter; AUD_DELETE("factory")
+ }
+ if(m_resampler)
+ {
+ delete m_resampler; AUD_DELETE("factory")
+ }
+ if(m_mapper)
+ {
+ delete m_mapper; AUD_DELETE("factory")
+ }
+}
+
+AUD_IReader* AUD_FloatMixer::prepare(AUD_IReader* reader)
+{
+ m_converter->setReader(reader);
+ reader = m_converter->createReader();
+
+ m_resampler->setReader(reader);
+ reader = m_resampler->createReader();
+
+ if(reader->getSpecs().channels != m_specs.channels)
+ {
+ m_mapper->setReader(reader);
+ reader = m_mapper->createReader();
+ }
+
+ return reader;
+}
+
+void AUD_FloatMixer::setSpecs(AUD_Specs specs)
+{
+ m_specs = specs;
+
+ if(m_converter)
+ {
+ delete m_converter; AUD_DELETE("factory")
+ }
+ if(m_resampler)
+ {
+ delete m_resampler; AUD_DELETE("factory")
+ }
+ if(m_mapper)
+ {
+ delete m_mapper; AUD_DELETE("factory")
+ }
+
+ specs.format = AUD_FORMAT_FLOAT32;
+
+ m_converter = new AUD_ConverterFactory(specs); AUD_NEW("factory")
+ m_resampler = new AUD_SRCResampleFactory(specs); AUD_NEW("factory")
+ m_mapper = new AUD_ChannelMapperFactory(specs); AUD_NEW("factory")
+
+ int bigendian = 1;
+ bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
+
+ switch(m_specs.format)
+ {
+ case AUD_FORMAT_U8:
+ m_convert = AUD_convert_float_u8;
+ break;
+ case AUD_FORMAT_S16:
+ m_convert = AUD_convert_float_s16;
+ break;
+ case AUD_FORMAT_S24:
+ if(bigendian)
+ m_convert = AUD_convert_float_s24_be;
+ else
+ m_convert = AUD_convert_float_s24_le;
+ break;
+ case AUD_FORMAT_S32:
+ m_convert = AUD_convert_float_s32;
+ break;
+ case AUD_FORMAT_FLOAT32:
+ m_convert = AUD_convert_copy<float>;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_convert = AUD_convert_float_double;
+ break;
+ default:
+ break;
+ }
+}
+
+void AUD_FloatMixer::add(sample_t* buffer, AUD_Specs specs, int length,
+ float volume)
+{
+ AUD_FloatMixerBuffer buf;
+ buf.buffer = buffer;
+ buf.length = length;
+ buf.volume = volume;
+ m_buffers.push_back(buf);
+}
+
+void AUD_FloatMixer::superpose(sample_t* buffer, int length, float volume)
+{
+ AUD_FloatMixerBuffer buf;
+
+ int channels = m_specs.channels;
+
+ if(m_buffer->getSize() < length * channels * 4)
+ m_buffer->resize(length * channels * 4);
+
+ float* out = (float*)m_buffer->getBuffer();
+ float* in;
+
+ memset(out, 0, length * channels * 4);
+
+ int end;
+
+ while(!m_buffers.empty())
+ {
+ buf = m_buffers.front();
+ m_buffers.pop_front();
+
+ end = buf.length*channels;
+ in = (float*) buf.buffer;
+
+ for(int i = 0; i < end; i++)
+ out[i] += in[i]*buf.volume * volume;
+ }
+
+ m_convert(buffer, (sample_t*) out, length * channels);
+}
diff --git a/intern/audaspace/intern/AUD_FloatMixer.h b/intern/audaspace/intern/AUD_FloatMixer.h
new file mode 100644
index 00000000000..728a0faf3cb
--- /dev/null
+++ b/intern/audaspace/intern/AUD_FloatMixer.h
@@ -0,0 +1,100 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_FLOATMIXER
+#define AUD_FLOATMIXER
+
+#include "AUD_IMixer.h"
+#include "AUD_ConverterFunctions.h"
+class AUD_ConverterFactory;
+class AUD_SRCResampleFactory;
+class AUD_ChannelMapperFactory;
+class AUD_Buffer;
+#include <list>
+
+struct AUD_FloatMixerBuffer
+{
+ sample_t* buffer;
+ int length;
+ float volume;
+};
+
+/**
+ * This class is able to mix two audiosignals with floats.
+ */
+class AUD_FloatMixer : public AUD_IMixer
+{
+private:
+ /**
+ * The converter factory that converts all readers for superposition.
+ */
+ AUD_ConverterFactory* m_converter;
+
+ /**
+ * The resampling factory that resamples all readers for superposition.
+ */
+ AUD_SRCResampleFactory* m_resampler;
+
+ /**
+ * The channel mapper factory that maps all readers for superposition.
+ */
+ AUD_ChannelMapperFactory* m_mapper;
+
+ /**
+ * The list of buffers to superpose.
+ */
+ std::list<AUD_FloatMixerBuffer> m_buffers;
+
+ /**
+ * The output specification.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * The temporary mixing buffer.
+ */
+ AUD_Buffer* m_buffer;
+
+ /**
+ * Converter function.
+ */
+ AUD_convert_f m_convert;
+
+public:
+ /**
+ * Creates the mixer.
+ */
+ AUD_FloatMixer();
+
+ virtual ~AUD_FloatMixer();
+
+ virtual AUD_IReader* prepare(AUD_IReader* reader);
+ virtual void setSpecs(AUD_Specs specs);
+ virtual void add(sample_t* buffer, AUD_Specs specs, int length,
+ float volume);
+ virtual void superpose(sample_t* buffer, int length, float volume);
+};
+
+#endif //AUD_FLOATMIXER
diff --git a/intern/audaspace/intern/AUD_I3DDevice.h b/intern/audaspace/intern/AUD_I3DDevice.h
new file mode 100644
index 00000000000..c36924160de
--- /dev/null
+++ b/intern/audaspace/intern/AUD_I3DDevice.h
@@ -0,0 +1,103 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_I3DDEVICE
+#define AUD_I3DDEVICE
+
+#include "AUD_Space.h"
+
+/**
+ * This class represents an output device for 3D sound.
+ * Whether a normal device supports this or not can be checked with the
+ * AUD_CAPS_3D_DEVICE capability.
+ */
+class AUD_I3DDevice
+{
+public:
+ /**
+ * Plays a 3D sound source.
+ * \param factory The factory to create the reader for the sound source.
+ * \param keep When keep is true the sound source will not be deleted but
+ * set to paused when its end has been reached.
+ * \return Returns a handle with which the playback can be controlled.
+ * This is NULL if the sound couldn't be played back.
+ * \exception AUD_Exception Thrown if there's an unexpected (from the
+ * device side) error during creation of the reader.
+ * \note The factory must provide a mono (single channel) source otherwise
+ * the sound is played back normally.
+ */
+ virtual AUD_Handle* play3D(AUD_IFactory* factory, bool keep = false)=0;
+
+ /**
+ * Updates a listeners 3D data.
+ * \param data The 3D data.
+ * \return Whether the action succeeded.
+ */
+ virtual bool updateListener(AUD_3DData &data)=0;
+
+ /**
+ * Sets a 3D device setting.
+ * \param setting The setting type.
+ * \param value The new setting value.
+ * \return Whether the action succeeded.
+ */
+ virtual bool setSetting(AUD_3DSetting setting, float value)=0;
+
+ /**
+ * Retrieves a 3D device setting.
+ * \param setting The setting type.
+ * \return The setting value.
+ */
+ virtual float getSetting(AUD_3DSetting setting)=0;
+
+ /**
+ * Updates a listeners 3D data.
+ * \param handle The source handle.
+ * \param data The 3D data.
+ * \return Whether the action succeeded.
+ */
+ virtual bool updateSource(AUD_Handle* handle, AUD_3DData &data)=0;
+
+ /**
+ * Sets a 3D source setting.
+ * \param handle The source handle.
+ * \param setting The setting type.
+ * \param value The new setting value.
+ * \return Whether the action succeeded.
+ */
+ virtual bool setSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting, float value)=0;
+
+ /**
+ * Retrieves a 3D source setting.
+ * \param handle The source handle.
+ * \param setting The setting type.
+ * \return The setting value.
+ */
+ virtual float getSourceSetting(AUD_Handle* handle,
+ AUD_3DSourceSetting setting)=0;
+};
+
+#endif //AUD_I3DDEVICE
diff --git a/intern/audaspace/intern/AUD_IDevice.h b/intern/audaspace/intern/AUD_IDevice.h
new file mode 100644
index 00000000000..af2cae206f3
--- /dev/null
+++ b/intern/audaspace/intern/AUD_IDevice.h
@@ -0,0 +1,191 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_IDEVICE
+#define AUD_IDEVICE
+
+#include "AUD_Space.h"
+class AUD_IFactory;
+
+/// Handle structure, for inherition.
+typedef struct
+{
+} AUD_Handle;
+
+/**
+ * This class represents an output device for sound sources.
+ * Output devices may be several backends such as plattform independand like
+ * SDL or OpenAL or plattform specific like DirectSound, but they may also be
+ * files, RAM buffers or other types of streams.
+ * \warning Thread safety must be insured so that no reader is beeing called
+ * twice at the same time.
+ */
+class AUD_IDevice
+{
+public:
+ /**
+ * Destroys the device.
+ */
+ virtual ~AUD_IDevice() {}
+
+ /**
+ * Returns the specification of the device.
+ */
+ virtual AUD_Specs getSpecs()=0;
+
+ /**
+ * Plays a sound source.
+ * \param factory The factory to create the reader for the sound source.
+ * \param keep When keep is true the sound source will not be deleted but
+ * set to paused when its end has been reached.
+ * \return Returns a handle with which the playback can be controlled.
+ * This is NULL if the sound couldn't be played back.
+ * \exception AUD_Exception Thrown if there's an unexpected (from the
+ * device side) error during creation of the reader.
+ */
+ virtual AUD_Handle* play(AUD_IFactory* factory, bool keep = false)=0;
+
+ /**
+ * Pauses a played back sound.
+ * \param handle The handle returned by the play function.
+ * \return
+ * - true if the sound has been paused.
+ * - false if the sound isn't playing back or the handle is invalid.
+ */
+ virtual bool pause(AUD_Handle* handle)=0;
+
+ /**
+ * Resumes a paused sound.
+ * \param handle The handle returned by the play function.
+ * \return
+ * - true if the sound has been resumed.
+ * - false if the sound isn't paused or the handle is invalid.
+ */
+ virtual bool resume(AUD_Handle* handle)=0;
+
+ /**
+ * Stops a played back or paused sound. The handle is definitely invalid
+ * afterwards.
+ * \param handle The handle returned by the play function.
+ * \return
+ * - true if the sound has been stopped.
+ * - false if the handle is invalid.
+ */
+ virtual bool stop(AUD_Handle* handle)=0;
+
+ /**
+ * Sets the behaviour of the device for a played back sound when the sound
+ * doesn't return any more samples.
+ * \param handle The handle returned by the play function.
+ * \param keep True when the source should be paused and not deleted.
+ * \return
+ * - true if the behaviour has been changed.
+ * - false if the handle is invalid.
+ */
+ virtual bool setKeep(AUD_Handle* handle, bool keep)=0;
+
+ /**
+ * Sends a message to a sound or all sounds that are currently played or
+ * paused.
+ * \param handle The sound that should receive the message or NULL if all
+ * sounds should receive it.
+ * \param message The message.
+ * \return True if the message has been read by at least one sound.
+ */
+ virtual bool sendMessage(AUD_Handle* handle, AUD_Message &message)=0;
+
+ /**
+ * Seeks in a played back sound.
+ * \param handle The handle returned by the play function.
+ * \param position The new position from where to play back, in seconds.
+ * \return
+ * - true if the handle is valid.
+ * - false if the handle is invalid.
+ * \warning Whether the seek works or not depends on the sound source.
+ */
+ virtual bool seek(AUD_Handle* handle, float position)=0;
+
+ /**
+ * Retrieves the current playback position of a sound.
+ * \param handle The handle returned by the play function.
+ * \return The playback position in seconds, or 0.0 if the handle is
+ * invalid.
+ */
+ virtual float getPosition(AUD_Handle* handle)=0;
+
+ /**
+ * Returns the status of a played back sound.
+ * \param handle The handle returned by the play function.
+ * \return
+ * - AUD_STATUS_INVALID if the sound has stopped or the handle is
+ *. invalid
+ * - AUD_STATUS_PLAYING if the sound is currently played back.
+ * - AUD_STATUS_PAUSED if the sound is currently paused.
+ * \see AUD_Status
+ */
+ virtual AUD_Status getStatus(AUD_Handle* handle)=0;
+
+ /**
+ * Locks the device.
+ * Used to make sure that between lock and unlock, no buffers are read, so
+ * that it is possible to start, resume, pause, stop or seek several
+ * playback handles simultaneously.
+ * \warning Make sure the locking time is as small as possible to avoid
+ * playback delays that result in unexpected noise and cracks.
+ */
+ virtual void lock()=0;
+
+ /**
+ * Unlocks the previously locked device.
+ */
+ virtual void unlock()=0;
+
+ /**
+ * Checks if a specific capability as available on a device.
+ * \param capability The capability.
+ * \return Whether it is available or not.
+ */
+ virtual bool checkCapability(int capability)=0;
+
+ /**
+ * Set a value of a capability. The data behind the pointer depends on the
+ * capability.
+ * \param capability The capability.
+ * \param value The value.
+ * \return Whether the action succeeded or not.
+ */
+ virtual bool setCapability(int capability, void *value)=0;
+
+ /**
+ * Retrieves a value of a capability. The data behind the pointer depends on
+ * the capability.
+ * \param capability The capability.
+ * \param value The value.
+ * \return Whether the action succeeded or not.
+ */
+ virtual bool getCapability(int capability, void *value)=0;
+};
+
+#endif //AUD_IDevice
diff --git a/intern/audaspace/intern/AUD_IFactory.h b/intern/audaspace/intern/AUD_IFactory.h
new file mode 100644
index 00000000000..f7f29c9e842
--- /dev/null
+++ b/intern/audaspace/intern/AUD_IFactory.h
@@ -0,0 +1,55 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_IFACTORY
+#define AUD_IFACTORY
+
+#include "AUD_Space.h"
+class AUD_IReader;
+
+/**
+ * This class represents a type of sound source and saves the necessary values
+ * for it. It is able to create a reader that is actually usable for playback
+ * of the respective sound source through the factory method createReader.
+ */
+class AUD_IFactory
+{
+public:
+ /**
+ * Destroys the factory.
+ */
+ virtual ~AUD_IFactory(){}
+
+ /**
+ * Creates a reader for playback of the sound source.
+ * \return A pointer to an AUD_IReader object or NULL if there has been an
+ * error.
+ * \exception AUD_Exception An exception may be thrown if there has been
+ * a more unexpected error during reader creation.
+ */
+ virtual AUD_IReader* createReader()=0;
+};
+
+#endif //AUD_IFACTORY
diff --git a/intern/audaspace/intern/AUD_IMixer.h b/intern/audaspace/intern/AUD_IMixer.h
new file mode 100644
index 00000000000..c65e4c69cf7
--- /dev/null
+++ b/intern/audaspace/intern/AUD_IMixer.h
@@ -0,0 +1,77 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_IMIXER
+#define AUD_IMIXER
+
+#include "AUD_Space.h"
+class AUD_IReader;
+
+/**
+ * This class is able to mix audiosignals of different format and channel count.
+ * \note This class doesn't do resampling!
+ */
+class AUD_IMixer
+{
+public:
+ /**
+ * Destroys the mixer.
+ */
+ virtual ~AUD_IMixer(){}
+
+ /**
+ * 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)=0;
+
+ /**
+ * Sets the target specification for superposing.
+ * \param specs The target specification.
+ */
+ virtual void setSpecs(AUD_Specs specs)=0;
+
+ /**
+ * Adds a buffer for superposition.
+ * \param buffer The buffer to superpose.
+ * \param specs The specification of the buffer.
+ * \param start The start sample of the buffer.
+ * \param length The length of the buffer in samples.
+ * \param volume The mixing volume. Must be a value between 0.0 and 1.0.
+ */
+ virtual void add(sample_t* buffer, AUD_Specs specs, int length,
+ float volume)=0;
+
+ /**
+ * Superposes all added buffers into an output buffer.
+ * \param buffer The target buffer for superposing.
+ * \param length The length of the buffer in samples.
+ * \param volume The mixing volume. Must be a value between 0.0 and 1.0.
+ */
+ virtual void superpose(sample_t* buffer, int length, float volume)=0;
+};
+
+#endif //AUD_IMIXER
diff --git a/intern/audaspace/intern/AUD_IReader.h b/intern/audaspace/intern/AUD_IReader.h
new file mode 100644
index 00000000000..4b563100659
--- /dev/null
+++ b/intern/audaspace/intern/AUD_IReader.h
@@ -0,0 +1,117 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_IREADER
+#define AUD_IREADER
+
+#include "AUD_Space.h"
+
+/**
+ * This class represents a sound source as stream or as buffer which can be read
+ * for example by another reader, a device or whatever.
+ */
+class AUD_IReader
+{
+public:
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_IReader(){}
+
+ /**
+ * Tells whether the source provides seeking functionality or not.
+ * \warning This doesn't mean that the seeking always has to succeed.
+ * \return Always returns true for readers of the buffer type.
+ * \see getType
+ */
+ virtual bool isSeekable()=0;
+
+ /**
+ * Seeks to a specific position in the source.
+ * This function must work for buffer type readers.
+ * \param position The position to seek for measured in samples. To get
+ * from a given time to the samples you simply have to multiply the
+ * time value in seconds with the sample rate of the reader.
+ * \warning This may work or not, depending on the actual reader.
+ * \see getType
+ */
+ virtual void seek(int position)=0;
+
+ /**
+ * Returns an aproximated length of the source in samples.
+ * For readers of the type buffer this has to return a correct value!
+ * \return The length as sample count. May be negative if unknown.
+ * \see getType
+ */
+ virtual int getLength()=0;
+
+ /**
+ * Returns the position of the source as a sample count value.
+ * \return The current position in the source. A negative value indicates
+ * that the position is unknown.
+ * \warning The value returned doesn't always have to be correct for readers
+ * of the stream type, especially after seeking, it must though for
+ * the buffer ones.
+ * \see getType
+ */
+ virtual int getPosition()=0;
+
+ /**
+ * Returns the specification of the reader.
+ * \return The AUD_Specs structure.
+ */
+ virtual AUD_Specs getSpecs()=0;
+
+ /**
+ * Returns the type of the reader. There are special conditions for the
+ * readers of the buffer type. Those have to return correct position and
+ * length values as well as they must be seekable.
+ * \return AUD_TYPE_BUFFER or AUD_TYPE_STREAM.
+ */
+ virtual AUD_ReaderType getType()=0;
+
+ /**
+ * Sends a message to this reader and if it has subreaders it broadcasts
+ * the message to them.
+ * \param message The message.
+ * \return Whether the message has been read by the reader or one of his
+ * subreaders.
+ */
+ virtual bool notify(AUD_Message &message)=0;
+
+ /**
+ * Request to read the next length samples out of the source.
+ * The buffer for reading has to stay valid until the next call of this
+ * method or until the reader is deleted.
+ * \param[in,out] length The count of samples that should be read. Shall
+ * contain the real count of samples after reading, in case
+ * there were only fewer samples available.
+ * A smaller value also indicates the end of the reader.
+ * \param[out] buffer The pointer to the buffer with the samples.
+ */
+ virtual void read(int & length, sample_t* & buffer)=0;
+};
+
+#endif //AUD_IREADER
diff --git a/intern/audaspace/intern/AUD_MixerFactory.cpp b/intern/audaspace/intern/AUD_MixerFactory.cpp
new file mode 100644
index 00000000000..db38d1004db
--- /dev/null
+++ b/intern/audaspace/intern/AUD_MixerFactory.cpp
@@ -0,0 +1,109 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_MixerFactory.h"
+#include "AUD_IReader.h"
+
+AUD_IReader* AUD_MixerFactory::getReader()
+{
+ AUD_IReader* reader;
+
+ // first check for an existing reader
+ if(m_reader != 0)
+ {
+ reader = m_reader;
+ m_reader = 0;
+ return reader;
+ }
+
+ // otherwise create a reader if there is a factory
+ if(m_factory != 0)
+ {
+ reader = m_factory->createReader();
+ return reader;
+ }
+
+ return 0;
+}
+
+AUD_MixerFactory::AUD_MixerFactory(AUD_IReader* reader,
+ AUD_Specs specs)
+{
+ m_specs = specs;
+ m_reader = reader;
+ m_factory = 0;
+}
+
+AUD_MixerFactory::AUD_MixerFactory(AUD_IFactory* factory,
+ AUD_Specs specs)
+{
+ m_specs = specs;
+ m_reader = 0;
+ m_factory = factory;
+}
+
+AUD_MixerFactory::AUD_MixerFactory(AUD_Specs specs)
+{
+ m_specs = specs;
+ m_reader = 0;
+ m_factory = 0;
+}
+
+AUD_MixerFactory::~AUD_MixerFactory()
+{
+ if(m_reader != 0)
+ {
+ delete m_reader; AUD_DELETE("reader")
+ }
+}
+
+AUD_Specs AUD_MixerFactory::getSpecs()
+{
+ return m_specs;
+}
+
+void AUD_MixerFactory::setSpecs(AUD_Specs specs)
+{
+ m_specs = specs;
+}
+
+void AUD_MixerFactory::setReader(AUD_IReader* reader)
+{
+ if(m_reader != 0)
+ {
+ delete m_reader; AUD_DELETE("reader")
+ }
+ m_reader = reader;
+}
+
+void AUD_MixerFactory::setFactory(AUD_IFactory* factory)
+{
+ m_factory = factory;
+}
+
+AUD_IFactory* AUD_MixerFactory::getFactory()
+{
+ return m_factory;
+}
diff --git a/intern/audaspace/intern/AUD_MixerFactory.h b/intern/audaspace/intern/AUD_MixerFactory.h
new file mode 100644
index 00000000000..c61dd283c67
--- /dev/null
+++ b/intern/audaspace/intern/AUD_MixerFactory.h
@@ -0,0 +1,117 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_MIXERFACTORY
+#define AUD_MIXERFACTORY
+
+#include "AUD_IFactory.h"
+
+/**
+ * This factory is a base class for all mixer factories.
+ */
+class AUD_MixerFactory : public AUD_IFactory
+{
+protected:
+ /**
+ * The reader that should be mixed later.
+ */
+ AUD_IReader* m_reader;
+
+ /**
+ * If there is no reader it is created out of this factory.
+ */
+ AUD_IFactory* m_factory;
+
+ /**
+ * The target specification for resampling.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * Returns the reader created out of the factory or taken from m_reader.
+ * This method can be used for the createReader function of the implementing
+ * classes.
+ * \return The reader to mix, or NULL if there is no reader or factory.
+ */
+ AUD_IReader* getReader();
+
+public:
+ /**
+ * Creates a new factory.
+ * \param reader The reader to mix.
+ * \param specs The target specification.
+ */
+ AUD_MixerFactory(AUD_IReader* reader, AUD_Specs specs);
+
+ /**
+ * Creates a new factory.
+ * \param factory The factory to create the readers to mix out of.
+ * \param specs The target specification.
+ */
+ AUD_MixerFactory(AUD_IFactory* factory, AUD_Specs specs);
+
+ /**
+ * Creates a new factory.
+ * \param specs The target specification.
+ */
+ AUD_MixerFactory(AUD_Specs specs);
+
+ /**
+ * Destroys the resampling factory.
+ */
+ virtual ~AUD_MixerFactory();
+
+ /**
+ * Returns the target specification for resampling.
+ */
+ AUD_Specs getSpecs();
+
+ /**
+ * Sets the target specification for resampling.
+ * \param specs The specification.
+ */
+ void setSpecs(AUD_Specs specs);
+
+ /**
+ * Sets the reader for resampling.
+ * If there has already been a reader, it will be deleted.
+ * \param reader The reader that should be used as source for resampling.
+ */
+ void setReader(AUD_IReader* reader);
+
+ /**
+ * Sets the factory for resampling.
+ * \param factory The factory that should be used as source for resampling.
+ */
+ void setFactory(AUD_IFactory* factory);
+
+ /**
+ * Returns the saved factory.
+ * \return The factory or NULL if there has no factory been saved.
+ */
+ AUD_IFactory* getFactory();
+};
+
+#endif //AUD_MIXERFACTORY
diff --git a/intern/audaspace/intern/AUD_NULLDevice.cpp b/intern/audaspace/intern/AUD_NULLDevice.cpp
new file mode 100644
index 00000000000..d237b71b67e
--- /dev/null
+++ b/intern/audaspace/intern/AUD_NULLDevice.cpp
@@ -0,0 +1,108 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_NULLDevice.h"
+#include "AUD_IReader.h"
+#include "AUD_IFactory.h"
+
+AUD_NULLDevice::AUD_NULLDevice()
+{
+ m_specs.channels = AUD_CHANNELS_INVALID;
+ m_specs.format = AUD_FORMAT_INVALID;
+ m_specs.rate = AUD_RATE_INVALID;
+}
+
+AUD_Specs AUD_NULLDevice::getSpecs()
+{
+ return m_specs;
+}
+
+AUD_Handle* AUD_NULLDevice::play(AUD_IFactory* factory, bool keep)
+{
+ return 0;
+}
+
+bool AUD_NULLDevice::pause(AUD_Handle* handle)
+{
+ return false;
+}
+
+bool AUD_NULLDevice::resume(AUD_Handle* handle)
+{
+ return false;
+}
+
+bool AUD_NULLDevice::stop(AUD_Handle* handle)
+{
+ return false;
+}
+
+bool AUD_NULLDevice::setKeep(AUD_Handle* handle, bool keep)
+{
+ return false;
+}
+
+bool AUD_NULLDevice::sendMessage(AUD_Handle* handle, AUD_Message &message)
+{
+ return false;
+}
+
+bool AUD_NULLDevice::seek(AUD_Handle* handle, float position)
+{
+ return false;
+}
+
+float AUD_NULLDevice::getPosition(AUD_Handle* handle)
+{
+ return 0.0f;
+}
+
+AUD_Status AUD_NULLDevice::getStatus(AUD_Handle* handle)
+{
+ return AUD_STATUS_INVALID;
+}
+
+void AUD_NULLDevice::lock()
+{
+}
+
+void AUD_NULLDevice::unlock()
+{
+}
+
+bool AUD_NULLDevice::checkCapability(int capability)
+{
+ return false;
+}
+
+bool AUD_NULLDevice::setCapability(int capability, void *value)
+{
+ return false;
+}
+
+bool AUD_NULLDevice::getCapability(int capability, void *value)
+{
+ return false;
+}
diff --git a/intern/audaspace/intern/AUD_NULLDevice.h b/intern/audaspace/intern/AUD_NULLDevice.h
new file mode 100644
index 00000000000..155f24f8837
--- /dev/null
+++ b/intern/audaspace/intern/AUD_NULLDevice.h
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_NULLDEVICE
+#define AUD_NULLDEVICE
+
+#include "AUD_IDevice.h"
+
+/**
+ * This device plays nothing.
+ */
+class AUD_NULLDevice : public AUD_IDevice
+{
+private:
+ /**
+ * The specs of the device.
+ */
+ AUD_Specs m_specs;
+
+public:
+ /**
+ * Creates a new NULL device.
+ */
+ AUD_NULLDevice();
+
+ virtual AUD_Specs getSpecs();
+ virtual AUD_Handle* play(AUD_IFactory* factory, bool keep = false);
+ virtual bool pause(AUD_Handle* handle);
+ virtual bool resume(AUD_Handle* handle);
+ virtual bool stop(AUD_Handle* handle);
+ virtual bool setKeep(AUD_Handle* handle, bool keep);
+ virtual bool sendMessage(AUD_Handle* handle, AUD_Message &message);
+ virtual bool seek(AUD_Handle* handle, float position);
+ virtual float getPosition(AUD_Handle* handle);
+ virtual AUD_Status getStatus(AUD_Handle* handle);
+ virtual void lock();
+ virtual void unlock();
+ virtual bool checkCapability(int capability);
+ virtual bool setCapability(int capability, void *value);
+ virtual bool getCapability(int capability, void *value);
+};
+
+#endif //AUD_NULLDEVICE
diff --git a/intern/audaspace/intern/AUD_ReadDevice.cpp b/intern/audaspace/intern/AUD_ReadDevice.cpp
new file mode 100644
index 00000000000..e2c1d2fac81
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ReadDevice.cpp
@@ -0,0 +1,64 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_FloatMixer.h"
+#include "AUD_ReadDevice.h"
+#include "AUD_IReader.h"
+
+#include <cstring>
+
+AUD_ReadDevice::AUD_ReadDevice(AUD_Specs specs)
+{
+ m_specs = specs;
+
+ m_mixer = new AUD_FloatMixer(); AUD_NEW("mixer")
+ m_mixer->setSpecs(m_specs);
+
+ m_playing = false;
+
+ create();
+}
+
+AUD_ReadDevice::~AUD_ReadDevice()
+{
+ destroy();
+}
+
+bool AUD_ReadDevice::read(sample_t* buffer, int length)
+{
+ if(m_playing)
+ mix(buffer, length);
+ else
+ if(m_specs.format == AUD_FORMAT_U8)
+ memset(buffer, 0x80, length * AUD_SAMPLE_SIZE(m_specs));
+ else
+ memset(buffer, 0, length * AUD_SAMPLE_SIZE(m_specs));
+ return m_playing;
+}
+
+void AUD_ReadDevice::playing(bool playing)
+{
+ m_playing = playing;
+}
diff --git a/intern/audaspace/intern/AUD_ReadDevice.h b/intern/audaspace/intern/AUD_ReadDevice.h
new file mode 100644
index 00000000000..d69b0c31ea5
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ReadDevice.h
@@ -0,0 +1,68 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_READDEVICE
+#define AUD_READDEVICE
+
+#include "AUD_SoftwareDevice.h"
+
+/**
+ * This device enables to let the user read raw data out of it.
+ */
+class AUD_ReadDevice : public AUD_SoftwareDevice
+{
+protected:
+ virtual void playing(bool playing);
+
+private:
+ /**
+ * Whether the device currently.
+ */
+ bool m_playing;
+
+public:
+ /**
+ * Creates a new read device.
+ * \param specs The wanted audio specification.
+ */
+ AUD_ReadDevice(AUD_Specs specs);
+
+ /**
+ * Closes the device.
+ */
+ virtual ~AUD_ReadDevice();
+
+ /**
+ * Reads the next bytes into the supplied buffer.
+ * \param buffer The target buffer.
+ * \param length The length in samples to be filled.
+ * \return True if the reading succeeded, false if there are no sounds
+ * played back currently, in that case the buffer is filled with
+ * silence.
+ */
+ bool read(sample_t* buffer, int length);
+};
+
+#endif //AUD_READDEVICE
diff --git a/intern/audaspace/intern/AUD_Reference.h b/intern/audaspace/intern/AUD_Reference.h
new file mode 100644
index 00000000000..9bb9d7440b3
--- /dev/null
+++ b/intern/audaspace/intern/AUD_Reference.h
@@ -0,0 +1,115 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_REFERENCE
+#define AUD_REFERENCE
+
+template <class T>
+/**
+ * This class provides reference counting functionality.
+ */
+class AUD_Reference
+{
+private:
+ /// The reference.
+ T* m_reference;
+ /// The reference counter.
+ int* m_refcount;
+public:
+ /**
+ * Creates a new reference counter.
+ * \param reference The reference.
+ */
+ AUD_Reference(T* reference = 0)
+ {
+ m_reference = reference;
+ m_refcount = new int; AUD_NEW("int")
+ *m_refcount = 1;
+ }
+
+ /**
+ * Copies a AUD_Reference object.
+ * \param ref The AUD_Reference object to copy.
+ */
+ AUD_Reference(const AUD_Reference& ref)
+ {
+ m_reference = ref.m_reference;
+ m_refcount = ref.m_refcount;
+ (*m_refcount)++;
+ }
+
+ /**
+ * Destroys a AUD_Reference object, if there's no furthere reference on the
+ * reference, it is destroyed as well.
+ */
+ ~AUD_Reference()
+ {
+ (*m_refcount)--;
+ if(*m_refcount == 0)
+ {
+ if(m_reference != 0)
+ {
+ delete m_reference; AUD_DELETE("buffer")
+ }
+ delete m_refcount; AUD_DELETE("int")
+ }
+ }
+
+ /**
+ * Copies a AUD_Reference object.
+ * \param ref The AUD_Reference object to copy.
+ */
+ AUD_Reference& operator=(const AUD_Reference& ref)
+ {
+ if(&ref == this)
+ return *this;
+
+ (*m_refcount)--;
+ if(*m_refcount == 0)
+ {
+ if(m_reference != 0)
+ {
+ delete m_reference; AUD_DELETE("buffer")
+ }
+ delete m_refcount; AUD_DELETE("int")
+ }
+
+ m_reference = ref.m_reference;
+ m_refcount = ref.m_refcount;
+ (*m_refcount)++;
+
+ return *this;
+ }
+
+ /**
+ * Returns the reference.
+ */
+ T* get()
+ {
+ return m_reference;
+ }
+};
+
+#endif // AUD_REFERENCE
diff --git a/intern/audaspace/intern/AUD_ResampleFactory.h b/intern/audaspace/intern/AUD_ResampleFactory.h
new file mode 100644
index 00000000000..5493e1005b7
--- /dev/null
+++ b/intern/audaspace/intern/AUD_ResampleFactory.h
@@ -0,0 +1,33 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_RESAMPLEFACTORY
+#define AUD_RESAMPLEFACTORY
+
+#include "AUD_MixerFactory.h"
+
+typedef AUD_MixerFactory AUD_ResampleFactory;
+
+#endif //AUD_RESAMPLEFACTORY
diff --git a/intern/audaspace/intern/AUD_SinusFactory.cpp b/intern/audaspace/intern/AUD_SinusFactory.cpp
new file mode 100644
index 00000000000..ae878b9df60
--- /dev/null
+++ b/intern/audaspace/intern/AUD_SinusFactory.cpp
@@ -0,0 +1,51 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SinusFactory.h"
+#include "AUD_SinusReader.h"
+#include "AUD_Space.h"
+
+AUD_SinusFactory::AUD_SinusFactory(double frequency, AUD_SampleRate sampleRate)
+{
+ m_frequency = frequency;
+ m_sampleRate = sampleRate;
+}
+
+AUD_IReader* AUD_SinusFactory::createReader()
+{
+ AUD_IReader* reader = new AUD_SinusReader(m_frequency, m_sampleRate);
+ AUD_NEW("reader")
+ return reader;
+}
+
+double AUD_SinusFactory::getFrequency()
+{
+ return m_frequency;
+}
+
+void AUD_SinusFactory::setFrequency(double frequency)
+{
+ m_frequency = frequency;
+}
diff --git a/intern/audaspace/intern/AUD_SinusFactory.h b/intern/audaspace/intern/AUD_SinusFactory.h
new file mode 100644
index 00000000000..ffb36e741b9
--- /dev/null
+++ b/intern/audaspace/intern/AUD_SinusFactory.h
@@ -0,0 +1,70 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SINUSFACTORY
+#define AUD_SINUSFACTORY
+
+#include "AUD_IFactory.h"
+
+/**
+ * This factory creates a reader that plays a sine tone.
+ */
+class AUD_SinusFactory : public AUD_IFactory
+{
+private:
+ /**
+ * The frequence of the sine wave.
+ */
+ double m_frequency;
+
+ /**
+ * The target sample rate for output.
+ */
+ AUD_SampleRate m_sampleRate;
+
+public:
+ /**
+ * Creates a new sine factory.
+ * \param frequency The desired frequency.
+ * \param sampleRate The target sample rate for playback.
+ */
+ AUD_SinusFactory(double frequency,
+ AUD_SampleRate sampleRate = AUD_RATE_44100);
+
+ /**
+ * Returns the frequency of the sine wave.
+ */
+ double getFrequency();
+
+ /**
+ * Sets the frequency.
+ * \param frequency The new frequency.
+ */
+ void setFrequency(double frequency);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_SINUSFACTORY
diff --git a/intern/audaspace/intern/AUD_SinusReader.cpp b/intern/audaspace/intern/AUD_SinusReader.cpp
new file mode 100644
index 00000000000..87e2f789d66
--- /dev/null
+++ b/intern/audaspace/intern/AUD_SinusReader.cpp
@@ -0,0 +1,104 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SinusReader.h"
+#include "AUD_Buffer.h"
+
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+AUD_SinusReader::AUD_SinusReader(double frequency, AUD_SampleRate sampleRate)
+{
+ m_frequency = frequency;
+ m_position = 0;
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+ m_sampleRate = sampleRate;
+}
+
+AUD_SinusReader::~AUD_SinusReader()
+{
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+bool AUD_SinusReader::isSeekable()
+{
+ return true;
+}
+
+void AUD_SinusReader::seek(int position)
+{
+ m_position = position;
+}
+
+int AUD_SinusReader::getLength()
+{
+ return -1;
+}
+
+int AUD_SinusReader::getPosition()
+{
+ return m_position;
+}
+
+AUD_Specs AUD_SinusReader::getSpecs()
+{
+ AUD_Specs specs;
+ specs.rate = m_sampleRate;
+ specs.format = AUD_FORMAT_S16;
+ specs.channels = AUD_CHANNELS_STEREO;
+ return specs;
+}
+
+AUD_ReaderType AUD_SinusReader::getType()
+{
+ return AUD_TYPE_STREAM;
+}
+
+bool AUD_SinusReader::notify(AUD_Message &message)
+{
+ return false;
+}
+
+void AUD_SinusReader::read(int & length, sample_t* & buffer)
+{
+ // resize if necessary
+ if(m_buffer->getSize() < length*4)
+ m_buffer->resize(length*4);
+
+ // fill with sine data
+ short* buf = (short*) m_buffer->getBuffer();
+ for(int i=0; i < length; i++)
+ {
+ buf[i*2] = sin((m_position + i) * 2.0 * M_PI * m_frequency /
+ (float)m_sampleRate) * 32700;
+ buf[i*2+1] = buf[i*2];
+ }
+
+ buffer = (sample_t*)buf;
+ m_position += length;
+}
diff --git a/intern/audaspace/intern/AUD_SinusReader.h b/intern/audaspace/intern/AUD_SinusReader.h
new file mode 100644
index 00000000000..cb060dd8a43
--- /dev/null
+++ b/intern/audaspace/intern/AUD_SinusReader.h
@@ -0,0 +1,86 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SINUSREADER
+#define AUD_SINUSREADER
+
+#include "AUD_IReader.h"
+class AUD_Buffer;
+
+/**
+ * This class is used for sine tone playback.
+ * The output format is in the 16 bit format and stereo, the sample rate can be
+ * specified.
+ * As the two channels both play the same the output could also be mono, but
+ * in most cases this will result in having to resample for output, so stereo
+ * sound is created directly.
+ */
+class AUD_SinusReader : public AUD_IReader
+{
+private:
+ /**
+ * The frequency of the sine wave.
+ */
+ double m_frequency;
+
+ /**
+ * The current position in samples.
+ */
+ int m_position;
+
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer* m_buffer;
+
+ /**
+ * The sample rate for the output.
+ */
+ AUD_SampleRate m_sampleRate;
+
+public:
+ /**
+ * Creates a new reader.
+ * \param frequency The frequency of the sine wave.
+ * \param sampleRate The output sample rate.
+ */
+ AUD_SinusReader(double frequency, AUD_SampleRate sampleRate);
+
+ /**
+ * Destroys the reader.
+ */
+ virtual ~AUD_SinusReader();
+
+ virtual bool isSeekable();
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_SINUSREADER
diff --git a/intern/audaspace/intern/AUD_SoftwareDevice.cpp b/intern/audaspace/intern/AUD_SoftwareDevice.cpp
new file mode 100644
index 00000000000..174ff8c8979
--- /dev/null
+++ b/intern/audaspace/intern/AUD_SoftwareDevice.cpp
@@ -0,0 +1,444 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SoftwareDevice.h"
+#include "AUD_IReader.h"
+#include "AUD_IMixer.h"
+#include "AUD_IFactory.h"
+#include "AUD_SourceCaps.h"
+
+#include <cstring>
+
+/// Saves the data for playback.
+struct AUD_SoftwareHandle : AUD_Handle
+{
+ /// The reader source.
+ AUD_IReader* reader;
+
+ /// Whether to keep the source if end of it is reached.
+ bool keep;
+
+ /// The volume of the source.
+ float volume;
+};
+
+typedef std::list<AUD_SoftwareHandle*>::iterator AUD_HandleIterator;
+
+void AUD_SoftwareDevice::create()
+{
+ m_playingSounds = new std::list<AUD_SoftwareHandle*>(); AUD_NEW("list")
+ m_pausedSounds = new std::list<AUD_SoftwareHandle*>(); AUD_NEW("list")
+ m_playback = false;
+ m_volume = 1.0;
+
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+
+ pthread_mutex_init(&m_mutex, &attr);
+
+ pthread_mutexattr_destroy(&attr);
+}
+
+void AUD_SoftwareDevice::destroy()
+{
+ if(m_playback)
+ playing(m_playback = false);
+
+ delete m_mixer; AUD_DELETE("mixer")
+
+ // delete all playing sounds
+ while(m_playingSounds->begin() != m_playingSounds->end())
+ {
+ delete (*(m_playingSounds->begin()))->reader; AUD_DELETE("reader")
+ delete *(m_playingSounds->begin()); AUD_DELETE("handle")
+ m_playingSounds->erase(m_playingSounds->begin());
+ }
+ delete m_playingSounds; AUD_DELETE("list")
+
+ // delete all paused sounds
+ while(m_pausedSounds->begin() != m_pausedSounds->end())
+ {
+ delete (*(m_pausedSounds->begin()))->reader; AUD_DELETE("reader")
+ delete *(m_pausedSounds->begin()); AUD_DELETE("handle")
+ m_pausedSounds->erase(m_pausedSounds->begin());
+ }
+ delete m_pausedSounds; AUD_DELETE("list")
+
+ pthread_mutex_destroy(&m_mutex);
+}
+
+void AUD_SoftwareDevice::mix(sample_t* buffer, int length)
+{
+ lock();
+
+ AUD_SoftwareHandle* sound;
+ int len;
+ sample_t* buf;
+ int sample_size = AUD_SAMPLE_SIZE(m_specs);
+ std::list<AUD_SoftwareHandle*> stopSounds;
+
+ // for all sounds
+ AUD_HandleIterator it = m_playingSounds->begin();
+ while(it != m_playingSounds->end())
+ {
+ sound = *it;
+ // increment the iterator to make sure it's valid,
+ // in case the sound gets deleted after stopping
+ ++it;
+
+ // get the buffer from the source
+ len = length;
+ sound->reader->read(len, buf);
+
+ m_mixer->add(buf, sound->reader->getSpecs(), len, sound->volume);
+
+ // in case the end of the sound is reached
+ if(len < length)
+ {
+ if(sound->keep)
+ pause(sound);
+ else
+ stopSounds.push_back(sound);
+ }
+ }
+
+ // fill with silence
+ if(m_specs.format == AUD_FORMAT_U8)
+ memset(buffer, 0x80, length * sample_size);
+ else
+ memset(buffer, 0, length * sample_size);
+
+ // superpose
+ m_mixer->superpose(buffer, length, m_volume);
+
+ while(!stopSounds.empty())
+ {
+ sound = stopSounds.front();
+ stopSounds.pop_front();
+ stop(sound);
+ }
+
+ unlock();
+}
+
+bool AUD_SoftwareDevice::isValid(AUD_Handle* handle)
+{
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ if(*i == handle)
+ return true;
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ if(*i == handle)
+ return true;
+ return false;
+}
+
+void AUD_SoftwareDevice::setMixer(AUD_IMixer* mixer)
+{
+ delete m_mixer; AUD_DELETE("mixer")
+ m_mixer = mixer;
+ mixer->setSpecs(m_specs);
+}
+
+AUD_Specs AUD_SoftwareDevice::getSpecs()
+{
+ return m_specs;
+}
+
+AUD_Handle* AUD_SoftwareDevice::play(AUD_IFactory* factory, bool keep)
+{
+ AUD_IReader* reader = factory->createReader();
+
+ if(reader == NULL)
+ AUD_THROW(AUD_ERROR_READER);
+
+ // prepare the reader
+ reader = m_mixer->prepare(reader);
+ if(reader == NULL)
+ return NULL;
+
+ AUD_Specs rs = reader->getSpecs();
+
+ // play sound
+ AUD_SoftwareHandle* sound = new AUD_SoftwareHandle; AUD_NEW("handle")
+ sound->keep = keep;
+ sound->reader = reader;
+ sound->volume = 1.0;
+
+ lock();
+ m_playingSounds->push_back(sound);
+
+ if(!m_playback)
+ playing(m_playback = true);
+ unlock();
+
+ return sound;
+}
+
+bool AUD_SoftwareDevice::pause(AUD_Handle* handle)
+{
+ // only songs that are played can be paused
+ lock();
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ m_pausedSounds->push_back(*i);
+ m_playingSounds->erase(i);
+ if(m_playingSounds->empty())
+ playing(m_playback = false);
+ unlock();
+ return true;
+ }
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_SoftwareDevice::resume(AUD_Handle* handle)
+{
+ // only songs that are paused can be resumed
+ lock();
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ m_playingSounds->push_back(*i);
+ m_pausedSounds->erase(i);
+ if(!m_playback)
+ playing(m_playback = true);
+ unlock();
+ return true;
+ }
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_SoftwareDevice::stop(AUD_Handle* handle)
+{
+ lock();
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ delete (*i)->reader; AUD_DELETE("reader")
+ delete *i; AUD_DELETE("handle")
+ m_playingSounds->erase(i);
+ if(m_playingSounds->empty())
+ playing(m_playback = false);
+ unlock();
+ return true;
+ }
+ }
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ delete (*i)->reader; AUD_DELETE("reader")
+ delete *i; AUD_DELETE("handle")
+ m_pausedSounds->erase(i);
+ unlock();
+ return true;
+ }
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_SoftwareDevice::setKeep(AUD_Handle* handle, bool keep)
+{
+ lock();
+ if(isValid(handle))
+ {
+ ((AUD_SoftwareHandle*)handle)->keep = keep;
+ unlock();
+ return true;
+ }
+ unlock();
+ return false;
+}
+
+bool AUD_SoftwareDevice::sendMessage(AUD_Handle* handle, AUD_Message &message)
+{
+ lock();
+
+ bool result = false;
+
+ if(handle == 0)
+ {
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ result |= (*i)->reader->notify(message);
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ result |= (*i)->reader->notify(message);
+ }
+ else if(isValid(handle))
+ result = ((AUD_SoftwareHandle*)handle)->reader->notify(message);
+ unlock();
+ return result;
+}
+
+bool AUD_SoftwareDevice::seek(AUD_Handle* handle, float position)
+{
+ lock();
+
+ if(isValid(handle))
+ {
+ AUD_IReader* reader = ((AUD_SoftwareHandle*)handle)->reader;
+ reader->seek((int)(position * reader->getSpecs().rate));
+ unlock();
+ return true;
+ }
+
+ unlock();
+ return false;
+}
+
+float AUD_SoftwareDevice::getPosition(AUD_Handle* handle)
+{
+ lock();
+
+ float position = 0.0f;
+
+ if(isValid(handle))
+ {
+ AUD_SoftwareHandle* h = (AUD_SoftwareHandle*)handle;
+ position = h->reader->getPosition() / (float)m_specs.rate;
+ }
+
+ unlock();
+ return position;
+}
+
+AUD_Status AUD_SoftwareDevice::getStatus(AUD_Handle* handle)
+{
+ lock();
+ for(AUD_HandleIterator i = m_playingSounds->begin();
+ i != m_playingSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ unlock();
+ return AUD_STATUS_PLAYING;
+ }
+ }
+ for(AUD_HandleIterator i = m_pausedSounds->begin();
+ i != m_pausedSounds->end(); i++)
+ {
+ if(*i == handle)
+ {
+ unlock();
+ return AUD_STATUS_PAUSED;
+ }
+ }
+ unlock();
+ return AUD_STATUS_INVALID;
+}
+
+void AUD_SoftwareDevice::lock()
+{
+ pthread_mutex_lock(&m_mutex);
+}
+
+void AUD_SoftwareDevice::unlock()
+{
+ pthread_mutex_unlock(&m_mutex);
+}
+
+bool AUD_SoftwareDevice::checkCapability(int capability)
+{
+ return capability == AUD_CAPS_SOFTWARE_DEVICE ||
+ capability == AUD_CAPS_VOLUME ||
+ capability == AUD_CAPS_SOURCE_VOLUME;
+}
+
+bool AUD_SoftwareDevice::setCapability(int capability, void *value)
+{
+ switch(capability)
+ {
+ case AUD_CAPS_VOLUME:
+ lock();
+ m_volume = *((float*)value);
+ if(m_volume > 1.0)
+ m_volume = 1.0;
+ else if(m_volume < 0.0)
+ m_volume = 0.0;
+ unlock();
+ return true;
+ case AUD_CAPS_SOURCE_VOLUME:
+ {
+ AUD_SourceCaps* caps = (AUD_SourceCaps*) value;
+ lock();
+ if(isValid(caps->handle))
+ {
+ AUD_SoftwareHandle* handle = (AUD_SoftwareHandle*)caps->handle;
+ handle->volume = caps->value;
+ if(handle->volume > 1.0)
+ handle->volume = 1.0;
+ else if(handle->volume < 0.0)
+ handle->volume = 0.0;
+ unlock();
+ return true;
+ }
+ unlock();
+ }
+ break;
+ }
+ return false;
+}
+
+bool AUD_SoftwareDevice::getCapability(int capability, void *value)
+{
+ switch(capability)
+ {
+ case AUD_CAPS_VOLUME:
+ lock();
+ *((float*)value) = m_volume;
+ unlock();
+ return true;
+ case AUD_CAPS_SOURCE_VOLUME:
+ {
+ AUD_SourceCaps* caps = (AUD_SourceCaps*) value;
+ lock();
+ if(isValid(caps->handle))
+ {
+ caps->value = ((AUD_SoftwareHandle*)caps->handle)->volume;
+ unlock();
+ return true;
+ }
+ unlock();
+ }
+ break;
+ }
+ return false;
+}
diff --git a/intern/audaspace/intern/AUD_SoftwareDevice.h b/intern/audaspace/intern/AUD_SoftwareDevice.h
new file mode 100644
index 00000000000..3768786fa9c
--- /dev/null
+++ b/intern/audaspace/intern/AUD_SoftwareDevice.h
@@ -0,0 +1,137 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SOFTWAREDEVICE
+#define AUD_SOFTWAREDEVICE
+
+#include "AUD_IDevice.h"
+struct AUD_SoftwareHandle;
+class AUD_IMixer;
+
+#include <list>
+#include <pthread.h>
+
+/**
+ * This device plays is a generic device with software mixing.
+ * Classes implementing this have to:
+ * - Implement the playing function.
+ * - Prepare the m_specs, m_mixer variables.
+ * - Call the create and destroy functions.
+ * - Call the mix function to retrieve their audio data.
+ */
+class AUD_SoftwareDevice : public AUD_IDevice
+{
+protected:
+ /**
+ * The specification of the device.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * The mixer. Will be deleted by the destroy function.
+ */
+ AUD_IMixer* m_mixer;
+
+ /**
+ * Initializes member variables.
+ */
+ void create();
+
+ /**
+ * Uninitializes member variables.
+ */
+ void destroy();
+
+ /**
+ * Mixes the next samples into the buffer.
+ * \param buffer The target buffer.
+ * \param length The length in samples to be filled.
+ */
+ void mix(sample_t* buffer, int length);
+
+ /**
+ * This function tells the device, to start or pause playback.
+ * \param playing True if device should playback.
+ */
+ virtual void playing(bool playing)=0;
+
+private:
+ /**
+ * The list of sounds that are currently playing.
+ */
+ std::list<AUD_SoftwareHandle*>* m_playingSounds;
+
+ /**
+ * The list of sounds that are currently paused.
+ */
+ std::list<AUD_SoftwareHandle*>* m_pausedSounds;
+
+ /**
+ * Whether there is currently playback.
+ */
+ bool m_playback;
+
+ /**
+ * The mutex for locking.
+ */
+ pthread_mutex_t m_mutex;
+
+ /**
+ * The overall volume of the device.
+ */
+ float m_volume;
+
+ /**
+ * Checks if a handle is valid.
+ * \param handle The handle to check.
+ * \return Whether the handle is valid.
+ */
+ bool isValid(AUD_Handle* handle);
+
+public:
+ /**
+ * Sets a new mixer.
+ * \param mixer The new mixer.
+ */
+ void setMixer(AUD_IMixer* mixer);
+
+ virtual AUD_Specs getSpecs();
+ virtual AUD_Handle* play(AUD_IFactory* factory, bool keep = false);
+ virtual bool pause(AUD_Handle* handle);
+ virtual bool resume(AUD_Handle* handle);
+ virtual bool stop(AUD_Handle* handle);
+ virtual bool setKeep(AUD_Handle* handle, bool keep);
+ virtual bool sendMessage(AUD_Handle* handle, AUD_Message &message);
+ virtual bool seek(AUD_Handle* handle, float position);
+ virtual float getPosition(AUD_Handle* handle);
+ virtual AUD_Status getStatus(AUD_Handle* handle);
+ virtual void lock();
+ virtual void unlock();
+ virtual bool checkCapability(int capability);
+ virtual bool setCapability(int capability, void *value);
+ virtual bool getCapability(int capability, void *value);
+};
+
+#endif //AUD_SOFTWAREDEVICE
diff --git a/intern/audaspace/intern/AUD_SourceCaps.h b/intern/audaspace/intern/AUD_SourceCaps.h
new file mode 100644
index 00000000000..b1edd2b9b4e
--- /dev/null
+++ b/intern/audaspace/intern/AUD_SourceCaps.h
@@ -0,0 +1,41 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SOURCECAPS
+#define AUD_SOURCECAPS
+
+#include "AUD_IDevice.h"
+
+/// The structure for source capabilities.
+typedef struct
+{
+ /// The source to apply the capability on.
+ AUD_Handle* handle;
+
+ /// The value for the capability.
+ float value;
+} AUD_SourceCaps;
+
+#endif //AUD_SOURCECAPS
diff --git a/intern/audaspace/intern/AUD_Space.h b/intern/audaspace/intern/AUD_Space.h
new file mode 100644
index 00000000000..123d9c272a0
--- /dev/null
+++ b/intern/audaspace/intern/AUD_Space.h
@@ -0,0 +1,295 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SPACE
+#define AUD_SPACE
+
+/// The size of a format in bytes.
+#define AUD_FORMAT_SIZE(format) (format & 0x0F)
+/// The size of a sample in the specified format in bytes.
+#define AUD_SAMPLE_SIZE(specs) (specs.channels * (specs.format & 0x0F))
+/// Throws a AUD_Exception with the provided error code.
+#define AUD_THROW(exception) { AUD_Exception e; e.error = exception; throw e; }
+
+/// Returns the smaller of the two values.
+#define AUD_MIN(a, b) (((a) < (b)) ? (a) : (b))
+/// Returns the bigger of the two values.
+#define AUD_MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+// 5 sec * 44100 samples/sec * 4 bytes/sample * 6 channels
+/// The size by which a buffer should be resized if the final extent is unknown.
+#define AUD_BUFFER_RESIZE_BYTES 5292000
+
+/// The default playback buffer size of a device.
+#define AUD_DEFAULT_BUFFER_SIZE 1024
+
+// Capability defines
+
+/// This capability checks whether a device is a 3D device. See AUD_I3DDevice.h.
+#define AUD_CAPS_3D_DEVICE 0x0001
+
+/**
+ * This capability checks whether a device is a software device. See
+ * AUD_SoftwareDevice.
+ */
+#define AUD_CAPS_SOFTWARE_DEVICE 0x0002
+
+/**
+ * This capability enables the user to set the overall volume of the device.
+ * You can set and get it with the pointer pointing to a float value between
+ * 0.0 (muted) and 1.0 (maximum volume).
+ */
+#define AUD_CAPS_VOLUME 0x0101
+
+/**
+ * This capability enables the user to set the volume of a source.
+ * You can set and get it with the pointer pointing to a AUD_SourceValue
+ * structure defined in AUD_SourceCaps.h.
+ */
+#define AUD_CAPS_SOURCE_VOLUME 0x1001
+
+/**
+ * This capability enables the user to set the pitch of a source.
+ * You can set and get it with the pointer pointing to a AUD_SourceValue
+ * structure defined in AUD_SourceCaps.h.
+ */
+#define AUD_CAPS_SOURCE_PITCH 0x1002
+
+/**
+ * This capability enables the user to buffer a factory into the device.
+ * Setting with the factory as pointer loads the factory into a device internal
+ * buffer. Play function calls with the buffered factory as argument result in
+ * the internal buffer being played back, so there's no reader created, what
+ * also results in not being able to send messages to that handle.
+ * A repeated call with the same factory doesn't do anything.
+ * A set call with a NULL pointer results in all buffered factories being
+ * deleted.
+ * \note This is only possible with factories that create readers of the buffer
+ * type.
+ */
+#define AUD_CAPS_BUFFERED_FACTORY 0x2001
+
+// Used for debugging memory leaks.
+//#define AUD_DEBUG_MEMORY
+
+#ifdef AUD_DEBUG_MEMORY
+int AUD_References(int count = 0, const char* text = "");
+#define AUD_NEW(text) AUD_References(1, text);
+#define AUD_DELETE(text) AUD_References(-1, text);
+#else
+#define AUD_NEW(text)
+#define AUD_DELETE(text)
+#endif
+
+/**
+ * The format of a sample.
+ * The last 4 bit save the byte count of the format.
+ */
+typedef enum
+{
+ AUD_FORMAT_INVALID = 0x00, /// Invalid sample format.
+ AUD_FORMAT_U8 = 0x01, /// 1 byte unsigned byte.
+ AUD_FORMAT_S16 = 0x12, /// 2 byte signed integer.
+ AUD_FORMAT_S24 = 0x13, /// 3 byte signed integer.
+ AUD_FORMAT_S32 = 0x14, /// 4 byte signed integer.
+ AUD_FORMAT_FLOAT32 = 0x24, /// 4 byte float.
+ AUD_FORMAT_FLOAT64 = 0x28 /// 8 byte float.
+} AUD_SampleFormat;
+
+/// The channel count.
+typedef enum
+{
+ AUD_CHANNELS_INVALID = 0, /// Invalid channel count.
+ AUD_CHANNELS_MONO = 1, /// Mono.
+ AUD_CHANNELS_STEREO = 2, /// Stereo.
+ AUD_CHANNELS_STEREO_LFE = 3, /// Stereo with LFE channel.
+ AUD_CHANNELS_SURROUND4 = 4, /// 4 channel surround sound.
+ AUD_CHANNELS_SURROUND5 = 5, /// 5 channel surround sound.
+ AUD_CHANNELS_SURROUND51 = 6, /// 5.1 surround sound.
+ AUD_CHANNELS_SURROUND61 = 7, /// 6.1 surround sound.
+ AUD_CHANNELS_SURROUND71 = 8, /// 7.1 surround sound.
+ AUD_CHANNELS_SURROUND72 = 9 /// 7.2 surround sound.
+} AUD_Channels;
+
+/**
+ * The sample rate tells how many samples are played back within one second.
+ * Some exotic formats may use other sample rates than provided here.
+ */
+typedef enum
+{
+ AUD_RATE_INVALID = 0, /// Invalid sample rate.
+ AUD_RATE_8000 = 8000, /// 8000 Hz.
+ AUD_RATE_16000 = 16000, /// 16000 Hz.
+ AUD_RATE_11025 = 11025, /// 11025 Hz.
+ AUD_RATE_22050 = 22050, /// 22050 Hz.
+ AUD_RATE_32000 = 32000, /// 32000 Hz.
+ AUD_RATE_44100 = 44100, /// 44100 Hz.
+ AUD_RATE_48000 = 48000, /// 48000 Hz.
+ AUD_RATE_88200 = 88200, /// 88200 Hz.
+ AUD_RATE_96000 = 96000, /// 96000 Hz.
+ AUD_RATE_192000 = 192000 /// 192000 Hz.
+} AUD_SampleRate;
+
+/**
+ * Type of a reader.
+ * @see AUD_IReader for details.
+ */
+typedef enum
+{
+ AUD_TYPE_INVALID = 0, /// Invalid reader type.
+ AUD_TYPE_BUFFER, /// Reader reads from a buffer.
+ AUD_TYPE_STREAM /// Reader reads from a stream.
+} AUD_ReaderType;
+
+/// Status of a playback handle.
+typedef enum
+{
+ AUD_STATUS_INVALID = 0, /// Invalid handle. Maybe due to stopping.
+ AUD_STATUS_PLAYING, /// Sound is playing.
+ AUD_STATUS_PAUSED /// Sound is being paused.
+} AUD_Status;
+
+/// Error codes for exceptions (C++ library) or for return values (C API).
+typedef enum
+{
+ AUD_NO_ERROR = 0,
+ AUD_ERROR_READER,
+ AUD_ERROR_FACTORY,
+ AUD_ERROR_FILE,
+ AUD_ERROR_FFMPEG,
+ AUD_ERROR_SDL,
+ AUD_ERROR_OPENAL,
+ AUD_ERROR_JACK
+} AUD_Error;
+
+/// Message codes.
+typedef enum
+{
+ AUD_MSG_INVALID = 0, /// Invalid message.
+ AUD_MSG_LOOP, /// Loop reader message.
+ AUD_MSG_VOLUME /// Volume reader message.
+} AUD_MessageType;
+
+/// Fading types.
+typedef enum
+{
+ AUD_FADE_IN,
+ AUD_FADE_OUT
+} AUD_FadeType;
+
+/// 3D device settings.
+typedef enum
+{
+ AUD_3DS_NONE, /// No setting.
+ AUD_3DS_SPEED_OF_SOUND, /// Speed of sound.
+ AUD_3DS_DOPPLER_FACTOR, /// Doppler factor.
+ AUD_3DS_DISTANCE_MODEL /// Distance model.
+} AUD_3DSetting;
+
+/// Possible distance models for the 3D device.
+#define AUD_DISTANCE_MODEL_NONE 0.0f
+#define AUD_DISTANCE_MODEL_INVERSE 1.0f
+#define AUD_DISTANCE_MODEL_INVERSE_CLAMPED 2.0f
+#define AUD_DISTANCE_MODEL_LINEAR 3.0f
+#define AUD_DISTANCE_MODEL_LINEAR_CLAMPED 4.0f
+#define AUD_DISTANCE_MODEL_EXPONENT 5.0f
+#define AUD_DISTANCE_MODEL_EXPONENT_CLAMPED 6.0f
+
+/// 3D source settings.
+typedef enum
+{
+ AUD_3DSS_NONE, /// No setting.
+ AUD_3DSS_IS_RELATIVE, /// > 0 tells that the sound source is
+ /// relative to the listener
+ AUD_3DSS_MIN_GAIN, /// Minimum gain.
+ AUD_3DSS_MAX_GAIN, /// Maximum gain.
+ AUD_3DSS_REFERENCE_DISTANCE, /// Reference distance.
+ AUD_3DSS_MAX_DISTANCE, /// Maximum distance.
+ AUD_3DSS_ROLLOFF_FACTOR, /// Rolloff factor.
+ AUD_3DSS_CONE_INNER_ANGLE, /// Cone inner angle.
+ AUD_3DSS_CONE_OUTER_ANGLE, /// Cone outer angle.
+ AUD_3DSS_CONE_OUTER_GAIN /// Cone outer gain.
+} AUD_3DSourceSetting;
+
+/// Sample pointer type.
+typedef unsigned char sample_t;
+
+/// Specification of a sound source or device.
+typedef struct
+{
+ /// Sample rate in Hz.
+ AUD_SampleRate rate;
+
+ /// Sample format.
+ AUD_SampleFormat format;
+
+ /// Channel count.
+ AUD_Channels channels;
+} AUD_Specs;
+
+/// Exception structure.
+typedef struct
+{
+ /**
+ * Error code.
+ * \see AUD_Error
+ */
+ AUD_Error error;
+
+ // void* userData; - for the case it is needed someday
+} AUD_Exception;
+
+/// Message structure.
+typedef struct
+{
+ /**
+ * The message type.
+ */
+ AUD_MessageType type;
+
+ union
+ {
+ // loop reader
+ int loopcount;
+
+ // volume reader
+ float volume;
+ };
+} AUD_Message;
+
+/// Handle structure, for inherition.
+typedef struct
+{
+ /// x, y and z coordinates of the object.
+ float position[3];
+
+ /// x, y and z coordinates telling the velocity and direction of the object.
+ float velocity[3];
+
+ /// 3x3 matrix telling the orientation of the object.
+ float orientation[9];
+} AUD_3DData;
+
+#endif //AUD_SPACE
diff --git a/intern/audaspace/intern/AUD_StreamBufferFactory.cpp b/intern/audaspace/intern/AUD_StreamBufferFactory.cpp
new file mode 100644
index 00000000000..11391fa4a08
--- /dev/null
+++ b/intern/audaspace/intern/AUD_StreamBufferFactory.cpp
@@ -0,0 +1,80 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_StreamBufferFactory.h"
+#include "AUD_BufferReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_StreamBufferFactory::AUD_StreamBufferFactory(AUD_IFactory* factory)
+{
+ AUD_IReader* reader = factory->createReader();
+
+ if(reader == NULL)
+ AUD_THROW(AUD_ERROR_READER);
+
+ m_specs = reader->getSpecs();
+ m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer()); AUD_NEW("buffer")
+
+ int sample_size = AUD_SAMPLE_SIZE(m_specs);
+ int length;
+ int index = 0;
+ sample_t* buffer;
+
+ // get an aproximated size if possible
+ int size = reader->getLength();
+
+ if(size <= 0)
+ size = AUD_BUFFER_RESIZE_BYTES / sample_size;
+ else
+ size += m_specs.rate;
+
+ // as long as we fill our buffer to the end
+ while(index == m_buffer.get()->getSize() / sample_size)
+ {
+ // increase
+ m_buffer.get()->resize(size*sample_size, true);
+
+ // read more
+ length = size-index;
+ reader->read(length, buffer);
+ memcpy(m_buffer.get()->getBuffer()+index*sample_size,
+ buffer,
+ length*sample_size);
+ size += AUD_BUFFER_RESIZE_BYTES / sample_size;
+ index += length;
+ }
+
+ m_buffer.get()->resize(index*sample_size, true);
+ delete reader; AUD_DELETE("reader")
+}
+
+AUD_IReader* AUD_StreamBufferFactory::createReader()
+{
+ AUD_IReader* reader = new AUD_BufferReader(m_buffer, m_specs);
+ AUD_NEW("reader")
+ return reader;
+}
diff --git a/intern/audaspace/intern/AUD_StreamBufferFactory.h b/intern/audaspace/intern/AUD_StreamBufferFactory.h
new file mode 100644
index 00000000000..eda06f6c10c
--- /dev/null
+++ b/intern/audaspace/intern/AUD_StreamBufferFactory.h
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_STREAMBUFFERFACTORY
+#define AUD_STREAMBUFFERFACTORY
+
+#include "AUD_IFactory.h"
+#include "AUD_Reference.h"
+class AUD_Buffer;
+
+/**
+ * This factory creates a buffer out of a reader. This way normally streamed
+ * sound sources can be loaded into memory for buffered playback.
+ */
+class AUD_StreamBufferFactory : public AUD_IFactory
+{
+private:
+ /**
+ * The buffer that holds the audio data.
+ */
+ AUD_Reference<AUD_Buffer> m_buffer;
+
+ /**
+ * The specification of the samples.
+ */
+ AUD_Specs m_specs;
+
+public:
+ /**
+ * Creates the factory and reads the reader created by the factory supplied
+ * to the buffer.
+ * \param factory The factory that creates the reader for buffering.
+ * \exception AUD_Exception Thrown if the reader cannot be created.
+ */
+ AUD_StreamBufferFactory(AUD_IFactory* factory);
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_STREAMBUFFERFACTORY
diff --git a/intern/audaspace/intern/Makefile b/intern/audaspace/intern/Makefile
new file mode 100644
index 00000000000..4bdca04c1cb
--- /dev/null
+++ b/intern/audaspace/intern/Makefile
@@ -0,0 +1,70 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+#
+
+LIBNAME = audaspace
+DIR = $(OCGDIR)/intern/audaspace
+
+include nan_compile.mk
+
+CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+
+ifeq ($(WITH_SDL),true)
+ CPPFLAGS += -DWITH_SDL
+ CPPFLAGS += $(NAN_SDLCFLAGS)
+endif
+
+ifeq ($(WITH_OPENAL),true)
+ CPPFLAGS += -DWITH_OPENAL
+ CPPFLAGS += -I../OpenAL
+endif
+
+ifeq ($(WITH_JACK),true)
+ CPPFLAGS += -DWITH_JACK
+ CPPFLAGS += $(NAN_JACKCFLAGS)
+ CPPFLAGS += -I../jack
+endif
+
+ifeq ($(WITH_FFMPEG),true)
+ CPPFLAGS += -DWITH_FFMPEG
+ CPPFLAGS += $(NAN_FFMPEGCFLAGS)
+endif
+
+ifeq ($(WITH_SNDFILE),true)
+ CPPFLAGS += -DWITH_SNDFILE
+ CPPFLAGS += -I../sndfile
+endif
+
+CPPFLAGS += -I$(LCGDIR)/samplerate/include/
+CPPFLAGS += -I../ffmpeg
+CPPFLAGS += -I../FX
+CPPFLAGS += -I../SDL
+CPPFLAGS += -I../SRC
+CPPFLAGS += -I..
+CPPFLAGS += -I.
diff --git a/intern/audaspace/jack/AUD_JackDevice.cpp b/intern/audaspace/jack/AUD_JackDevice.cpp
new file mode 100644
index 00000000000..445e68e1a9a
--- /dev/null
+++ b/intern/audaspace/jack/AUD_JackDevice.cpp
@@ -0,0 +1,149 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_FloatMixer.h"
+#include "AUD_JackDevice.h"
+#include "AUD_IReader.h"
+#include "AUD_Buffer.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+// AUD_XXX this is not realtime suitable!
+int AUD_JackDevice::jack_mix(jack_nframes_t length, void *data)
+{
+ AUD_JackDevice* device = (AUD_JackDevice*)data;
+ int samplesize = AUD_SAMPLE_SIZE(device->m_specs);
+ if(device->m_buffer->getSize() < samplesize * length)
+ device->m_buffer->resize(samplesize * length);
+ device->mix(device->m_buffer->getBuffer(), length);
+
+ float* in = (float*) device->m_buffer->getBuffer();
+ float* out;
+ int count = device->m_specs.channels;
+
+ for(int i = 0; i < count; i++)
+ {
+ out = (float*)jack_port_get_buffer(device->m_ports[i], length);
+ for(int j = 0; j < length; j++)
+ out[j] = in[j * count + i];
+ }
+
+ return 0;
+}
+
+void AUD_JackDevice::jack_shutdown(void *data)
+{
+ AUD_JackDevice* device = (AUD_JackDevice*)data;
+ device->m_valid = false;
+}
+
+AUD_JackDevice::AUD_JackDevice(AUD_Specs specs)
+{
+ if(specs.channels == AUD_CHANNELS_INVALID)
+ specs.channels = AUD_CHANNELS_STEREO;
+
+ // jack uses floats
+ m_specs = specs;
+ m_specs.format = AUD_FORMAT_FLOAT32;
+
+ jack_options_t options = JackNullOption;
+ jack_status_t status;
+
+ // open client
+ m_client = jack_client_open("Blender", options, &status);
+ if(m_client == NULL)
+ AUD_THROW(AUD_ERROR_JACK);
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer");
+
+ // set callbacks
+ jack_set_process_callback(m_client, AUD_JackDevice::jack_mix, this);
+ jack_on_shutdown(m_client, AUD_JackDevice::jack_shutdown, this);
+
+ // register our output channels which are called ports in jack
+ m_ports = new jack_port_t*[m_specs.channels]; AUD_NEW("jack_port")
+
+ try
+ {
+ char portname[64];
+ for(int i = 0; i < m_specs.channels; i++)
+ {
+ sprintf(portname, "out %d", i+1);
+ m_ports[i] = jack_port_register(m_client, portname,
+ JACK_DEFAULT_AUDIO_TYPE,
+ JackPortIsOutput, 0);
+ if(m_ports[i] == NULL)
+ AUD_THROW(AUD_ERROR_JACK);
+ }
+
+ m_specs.rate = (AUD_SampleRate)jack_get_sample_rate(m_client);
+
+ // activate the client
+ if(jack_activate(m_client))
+ AUD_THROW(AUD_ERROR_JACK);
+ }
+ catch(AUD_Exception e)
+ {
+ jack_client_close(m_client);
+ delete[] m_ports; AUD_DELETE("jack_port")
+ delete m_buffer; AUD_DELETE("buffer");
+ throw;
+ }
+
+ const char** ports = jack_get_ports(m_client, NULL, NULL,
+ JackPortIsPhysical | JackPortIsInput);
+ if(ports != NULL)
+ {
+ for(int i = 0; i < m_specs.channels && ports[i]; i++)
+ jack_connect(m_client, jack_port_name(m_ports[i]), ports[i]);
+
+ free(ports);
+ }
+
+ m_mixer = new AUD_FloatMixer(); AUD_NEW("mixer")
+ m_mixer->setSpecs(m_specs);
+
+ m_valid = true;
+
+ create();
+}
+
+AUD_JackDevice::~AUD_JackDevice()
+{
+ lock();
+ if(m_valid)
+ jack_client_close(m_client);
+ delete[] m_ports; AUD_DELETE("jack_port")
+ delete m_buffer; AUD_DELETE("buffer");
+ unlock();
+
+ destroy();
+}
+
+void AUD_JackDevice::playing(bool playing)
+{
+ // Do nothing.
+}
diff --git a/intern/audaspace/jack/AUD_JackDevice.h b/intern/audaspace/jack/AUD_JackDevice.h
new file mode 100644
index 00000000000..f0c887a2f43
--- /dev/null
+++ b/intern/audaspace/jack/AUD_JackDevice.h
@@ -0,0 +1,92 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_JACKDEVICE
+#define AUD_JACKDEVICE
+
+
+#include "AUD_SoftwareDevice.h"
+class AUD_Buffer;
+
+#include <jack.h>
+
+/**
+ * This device plays back through Jack.
+ */
+class AUD_JackDevice : public AUD_SoftwareDevice
+{
+private:
+ /**
+ * The output ports of jack.
+ */
+ jack_port_t** m_ports;
+
+ /**
+ * The jack client.
+ */
+ jack_client_t* m_client;
+
+ /**
+ * The output buffer.
+ */
+ AUD_Buffer* m_buffer;
+
+ /**
+ * Whether the device is valid.
+ */
+ bool m_valid;
+
+ /**
+ * Invalidates the jack device.
+ * \param data The jack device that gets invalidet by jack.
+ */
+ static void jack_shutdown(void *data);
+
+ /**
+ * Mixes the next bytes into the buffer.
+ * \param length The length in samples to be filled.
+ * \param data A pointer to the jack device.
+ * \return 0 what shows success.
+ */
+ static int jack_mix(jack_nframes_t length, void *data);
+
+protected:
+ virtual void playing(bool playing);
+
+public:
+ /**
+ * Creates a Jack client for audio output.
+ * \param specs The wanted audio specification, where only the channel count is important.
+ * \exception AUD_Exception Thrown if the audio device cannot be opened.
+ */
+ AUD_JackDevice(AUD_Specs specs);
+
+ /**
+ * Closes the Jack client.
+ */
+ virtual ~AUD_JackDevice();
+};
+
+#endif //AUD_JACKDEVICE
diff --git a/intern/audaspace/jack/Makefile b/intern/audaspace/jack/Makefile
new file mode 100644
index 00000000000..23cadf559c0
--- /dev/null
+++ b/intern/audaspace/jack/Makefile
@@ -0,0 +1,44 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): GSR
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+#
+
+LIBNAME = aud_jack
+DIR = $(OCGDIR)/intern/audaspace
+
+include nan_compile.mk
+
+CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+
+# If we are here, jack is enable.
+CPPFLAGS += -DWITH_JACK
+CPPFLAGS += $(NAN_JACKCFLAGS)
+
+CPPFLAGS += -I../intern
+CPPFLAGS += -I..
+CPPFLAGS += -I.
diff --git a/intern/audaspace/make/msvc_9_0/audaspace.vcproj b/intern/audaspace/make/msvc_9_0/audaspace.vcproj
new file mode 100644
index 00000000000..0d8ade43e07
--- /dev/null
+++ b/intern/audaspace/make/msvc_9_0/audaspace.vcproj
@@ -0,0 +1,767 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="INT_audaspace"
+ ProjectGUID="{87032FD2-9BA0-6B43-BE33-8902BA8F9172}"
+ RootNamespace="audaspace"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="..\..;..\..\ffmpeg;..\..\FX;..\..\intern;..\..\OpenAL;..\..\SDL;..\..\SRC;..\..\sndfile;..\..\..\..\..\lib\windows\pthreads\include;..\..\..\..\..\lib\windows\samplerate\include;..\..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\lib\windows\jack\include;..\..\..\..\..\lib\windows\sndfile\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB,WITH_FFMPEG,WITH_SDL,WITH_OPENAL"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\audaspace\audaspace.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\audaspace\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\audaspace\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\audaspace\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\libaudaspace.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..;..\..\ffmpeg;..\..\FX;..\..\intern;..\..\OpenAL;..\..\SDL;..\..\SRC;..\..\sndfile;..\..\..\..\..\lib\windows\pthreads\include;..\..\..\..\..\lib\windows\samplerate\include;..\..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\lib\windows\jack\include;..\..\..\..\..\lib\windows\sndfile\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_LIB,WITH_FFMPEG,WITH_SDL,WITH_OPENAL"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\audaspace\debug\audaspace.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\audaspace\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\audaspace\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\audaspace\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\debug\libaudaspace.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="3DPlugin Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="..\..;..\..\ffmpeg;..\..\FX;..\..\intern;..\..\OpenAL;..\..\SDL;..\..\SRC;..\..\sndfile;..\..\..\..\..\lib\windows\pthreads\include;..\..\..\..\..\lib\windows\samplerate\include;..\..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\lib\windows\jack\include;..\..\..\..\..\lib\windows\sndfile\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB,WITH_FFMPEG,WITH_SDL,WITH_OPENAL"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\audaspace.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libaudaspace.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="3DPlugin Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..;..\..\ffmpeg;..\..\FX;..\..\intern;..\..\OpenAL;..\..\SDL;..\..\SRC;..\..\sndfile;..\..\..\..\..\lib\windows\pthreads\include;..\..\..\..\..\lib\windows\samplerate\include;..\..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\..\lib\windows\sdl\include;..\..\..\..\..\lib\windows\openal\include;..\..\..\..\..\lib\windows\jack\include;..\..\..\..\..\lib\windows\sndfile\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_LIB,WITH_FFMPEG,WITH_SDL,WITH_OPENAL"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\debug\audaspace.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\audaspace\mtdll\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libaudaspace.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="intern"
+ >
+ <File
+ RelativePath="..\..\intern\AUD_Buffer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_Buffer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_BufferReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_BufferReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_C-API.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ChannelMapperFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ChannelMapperFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ChannelMapperReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ChannelMapperReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ConverterFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ConverterFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ConverterFunctions.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ConverterFunctions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ConverterReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ConverterReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_FileFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_FileFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_FloatMixer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_FloatMixer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_I3DDevice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_IDevice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_IFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_IMixer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_IReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_MixerFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_MixerFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_NULLDevice.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_NULLDevice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ReadDevice.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ReadDevice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_Reference.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_ResampleFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_SinusFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_SinusFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_SinusReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_SinusReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_SoftwareDevice.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_SoftwareDevice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_SourceCaps.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_Space.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_StreamBufferFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\AUD_StreamBufferFactory.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="ffmpeg"
+ >
+ <File
+ RelativePath="..\..\ffmpeg\AUD_FFMPEGFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ffmpeg\AUD_FFMPEGFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ffmpeg\AUD_FFMPEGReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ffmpeg\AUD_FFMPEGReader.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="FX"
+ >
+ <File
+ RelativePath="..\..\FX\AUD_DelayFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_DelayFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_DelayReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_DelayReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_DoubleReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_DoubleReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_EffectFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_EffectFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_EffectReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_EffectReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_FaderFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_FaderFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_FaderReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_FaderReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LimiterFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LimiterFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LimiterReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LimiterReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LoopFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LoopFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LoopReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_LoopReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_PingPongFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_PingPongFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_PitchFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_PitchFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_PitchReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_PitchReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_ReverseFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_ReverseFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_ReverseReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_ReverseReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_VolumeFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_VolumeFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_VolumeReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\FX\AUD_VolumeReader.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="OpenAL"
+ >
+ <File
+ RelativePath="..\..\OpenAL\AUD_OpenALDevice.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\OpenAL\AUD_OpenALDevice.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="SDL"
+ >
+ <File
+ RelativePath="..\..\SDL\AUD_SDLDevice.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDL\AUD_SDLDevice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDL\AUD_SDLMixer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDL\AUD_SDLMixer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDL\AUD_SDLMixerFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDL\AUD_SDLMixerFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDL\AUD_SDLMixerReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDL\AUD_SDLMixerReader.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="SRC"
+ >
+ <File
+ RelativePath="..\..\SRC\AUD_SRCResampleFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SRC\AUD_SRCResampleFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SRC\AUD_SRCResampleReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SRC\AUD_SRCResampleReader.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="jack"
+ >
+ <File
+ RelativePath="..\..\jack\AUD_JackDevice.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\jack\AUD_JackDevice.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="sndfile"
+ >
+ <File
+ RelativePath="..\..\sndfile\AUD_SndFileFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\sndfile\AUD_SndFileFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\sndfile\AUD_SndFileReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\sndfile\AUD_SndFileReader.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\AUD_C-API.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.cpp b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp
new file mode 100644
index 00000000000..bac6dc321f4
--- /dev/null
+++ b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp
@@ -0,0 +1,67 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SndFileFactory.h"
+#include "AUD_SndFileReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+AUD_SndFileFactory::AUD_SndFileFactory(const char* filename)
+{
+ if(filename != NULL)
+ {
+ m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
+ strcpy(m_filename, filename);
+ }
+ else
+ m_filename = NULL;
+}
+
+AUD_SndFileFactory::AUD_SndFileFactory(unsigned char* buffer, int size)
+{
+ m_filename = NULL;
+ m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer(size));
+ memcpy(m_buffer.get()->getBuffer(), buffer, size);
+}
+
+AUD_SndFileFactory::~AUD_SndFileFactory()
+{
+ if(m_filename)
+ {
+ delete[] m_filename; AUD_DELETE("string")
+ }
+}
+
+AUD_IReader* AUD_SndFileFactory::createReader()
+{
+ AUD_IReader* reader;
+ if(m_filename)
+ reader = new AUD_SndFileReader(m_filename);
+ else
+ reader = new AUD_SndFileReader(m_buffer);
+ AUD_NEW("reader")
+ return reader;
+}
diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.h b/intern/audaspace/sndfile/AUD_SndFileFactory.h
new file mode 100644
index 00000000000..98187ff1590
--- /dev/null
+++ b/intern/audaspace/sndfile/AUD_SndFileFactory.h
@@ -0,0 +1,71 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SNDFILEFACTORY
+#define AUD_SNDFILEFACTORY
+
+#include "AUD_IFactory.h"
+#include "AUD_Reference.h"
+class AUD_Buffer;
+
+/**
+ * This factory reads a sound file via libsndfile.
+ */
+class AUD_SndFileFactory : public AUD_IFactory
+{
+private:
+ /**
+ * The filename of the sound source file.
+ */
+ char* m_filename;
+
+ /**
+ * The buffer to read from.
+ */
+ AUD_Reference<AUD_Buffer> m_buffer;
+
+public:
+ /**
+ * Creates a new factory.
+ * \param filename The sound file path.
+ */
+ AUD_SndFileFactory(const char* filename);
+
+ /**
+ * Creates a new factory.
+ * \param buffer The buffer to read from.
+ * \param size The size of the buffer.
+ */
+ AUD_SndFileFactory(unsigned char* buffer, int size);
+
+ /**
+ * Destroys the factory.
+ */
+ ~AUD_SndFileFactory();
+
+ virtual AUD_IReader* createReader();
+};
+
+#endif //AUD_SNDFILEFACTORY
diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.cpp b/intern/audaspace/sndfile/AUD_SndFileReader.cpp
new file mode 100644
index 00000000000..485818552bb
--- /dev/null
+++ b/intern/audaspace/sndfile/AUD_SndFileReader.cpp
@@ -0,0 +1,233 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#include "AUD_SndFileReader.h"
+#include "AUD_Buffer.h"
+
+#include <cstring>
+
+// This function transforms a SampleFormat to our own sample format
+static inline AUD_SampleFormat SNDFILE_TO_AUD(int fmt)
+{
+ switch(fmt & SF_FORMAT_SUBMASK)
+ {
+ // only read s16, s32 and double as they are
+ case SF_FORMAT_PCM_16:
+ return AUD_FORMAT_S16;
+ case SF_FORMAT_PCM_32:
+ return AUD_FORMAT_S32;
+ case SF_FORMAT_DOUBLE:
+ return AUD_FORMAT_FLOAT64;
+ // read all other formats as floats
+ default:
+ return AUD_FORMAT_FLOAT32;
+ }
+}
+
+sf_count_t AUD_SndFileReader::vio_get_filelen(void *user_data)
+{
+ AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
+ return reader->m_membuffer.get()->getSize();
+}
+
+sf_count_t AUD_SndFileReader::vio_seek(sf_count_t offset, int whence, void *user_data)
+{
+ AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
+
+ switch(whence)
+ {
+ case SEEK_SET:
+ reader->m_memoffset = offset;
+ break;
+ case SEEK_CUR:
+ reader->m_memoffset = reader->m_memoffset + offset;
+ break;
+ case SEEK_END:
+ reader->m_memoffset = reader->m_membuffer.get()->getSize() + offset;
+ break;
+ }
+
+ return reader->m_memoffset;
+}
+
+sf_count_t AUD_SndFileReader::vio_read(void *ptr, sf_count_t count, void *user_data)
+{
+ AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
+
+ if(reader->m_memoffset + count > reader->m_membuffer.get()->getSize())
+ count = reader->m_membuffer.get()->getSize() - reader->m_memoffset;
+
+ memcpy(ptr, reader->m_membuffer.get()->getBuffer() + reader->m_memoffset, count);
+ reader->m_memoffset += count;
+
+ return count;
+}
+
+sf_count_t AUD_SndFileReader::vio_tell(void *user_data)
+{
+ AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
+
+ return reader->m_memoffset;
+}
+
+AUD_SndFileReader::AUD_SndFileReader(const char* filename)
+{
+ SF_INFO sfinfo;
+
+ sfinfo.format = 0;
+ m_sndfile = sf_open(filename, SFM_READ, &sfinfo);
+
+ if(!m_sndfile)
+ AUD_THROW(AUD_ERROR_FILE);
+
+ m_specs.channels = (AUD_Channels) sfinfo.channels;
+ m_specs.format = SNDFILE_TO_AUD(sfinfo.format);
+ m_specs.rate = (AUD_SampleRate) sfinfo.samplerate;
+ m_length = sfinfo.frames;
+ m_seekable = sfinfo.seekable;
+ m_position = 0;
+
+ switch(m_specs.format)
+ {
+ case AUD_FORMAT_S16:
+ m_read = (sf_read_f) sf_readf_short;
+ break;
+ case AUD_FORMAT_S32:
+ m_read = (sf_read_f) sf_readf_int;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_read = (sf_read_f) sf_readf_double;
+ break;
+ default:
+ m_read = (sf_read_f) sf_readf_float;
+ }
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_SndFileReader::AUD_SndFileReader(AUD_Reference<AUD_Buffer> buffer)
+{
+ m_membuffer = buffer;
+ m_memoffset = 0;
+
+ m_vio.get_filelen = vio_get_filelen;
+ m_vio.read = vio_read;
+ m_vio.seek = vio_seek;
+ m_vio.tell = vio_tell;
+ m_vio.write = NULL;
+
+ SF_INFO sfinfo;
+
+ sfinfo.format = 0;
+ m_sndfile = sf_open_virtual(&m_vio, SFM_READ, &sfinfo, this);
+
+ if(!m_sndfile)
+ AUD_THROW(AUD_ERROR_FILE);
+
+ m_specs.channels = (AUD_Channels) sfinfo.channels;
+ m_specs.format = SNDFILE_TO_AUD(sfinfo.format);
+ m_specs.rate = (AUD_SampleRate) sfinfo.samplerate;
+ m_length = sfinfo.frames;
+ m_seekable = sfinfo.seekable;
+ m_position = 0;
+
+ switch(m_specs.format)
+ {
+ case AUD_FORMAT_S16:
+ m_read = (sf_read_f) sf_readf_short;
+ break;
+ case AUD_FORMAT_S32:
+ m_read = (sf_read_f) sf_readf_int;
+ break;
+ case AUD_FORMAT_FLOAT64:
+ m_read = (sf_read_f) sf_readf_double;
+ break;
+ default:
+ m_read = (sf_read_f) sf_readf_float;
+ }
+
+ m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
+}
+
+AUD_SndFileReader::~AUD_SndFileReader()
+{
+ sf_close(m_sndfile);
+
+ delete m_buffer; AUD_DELETE("buffer")
+}
+
+bool AUD_SndFileReader::isSeekable()
+{
+ return m_seekable;
+}
+
+void AUD_SndFileReader::seek(int position)
+{
+ if(m_seekable)
+ {
+ position = sf_seek(m_sndfile, position, SEEK_SET);
+ m_position = position;
+ }
+}
+
+int AUD_SndFileReader::getLength()
+{
+ return m_length;
+}
+
+int AUD_SndFileReader::getPosition()
+{
+ return m_position;
+}
+
+AUD_Specs AUD_SndFileReader::getSpecs()
+{
+ return m_specs;
+}
+
+AUD_ReaderType AUD_SndFileReader::getType()
+{
+ return AUD_TYPE_STREAM;
+}
+
+bool AUD_SndFileReader::notify(AUD_Message &message)
+{
+ return false;
+}
+
+void AUD_SndFileReader::read(int & length, sample_t* & buffer)
+{
+ int sample_size = AUD_SAMPLE_SIZE(m_specs);
+
+ // resize output buffer if necessary
+ if(m_buffer->getSize() < length*sample_size)
+ m_buffer->resize(length*sample_size);
+
+ buffer = m_buffer->getBuffer();
+
+ length = m_read(m_sndfile, buffer, length);
+
+ m_position += length;
+}
diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.h b/intern/audaspace/sndfile/AUD_SndFileReader.h
new file mode 100644
index 00000000000..da890ef53ca
--- /dev/null
+++ b/intern/audaspace/sndfile/AUD_SndFileReader.h
@@ -0,0 +1,131 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN LGPL LICENSE BLOCK *****
+ *
+ * Copyright 2009 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 Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * ***** END LGPL LICENSE BLOCK *****
+ */
+
+#ifndef AUD_SNDFILEREADER
+#define AUD_SNDFILEREADER
+
+#include "AUD_IReader.h"
+#include "AUD_Reference.h"
+class AUD_Buffer;
+
+#include <sndfile.h>
+
+typedef sf_count_t (*sf_read_f)(SNDFILE *sndfile, void *ptr, sf_count_t frames);
+
+/**
+ * This class reads a sound file via libsndfile.
+ */
+class AUD_SndFileReader : public AUD_IReader
+{
+private:
+ /**
+ * The current position in samples.
+ */
+ int m_position;
+
+ /**
+ * The sample count in the file.
+ */
+ int m_length;
+
+ /**
+ * Whether the file is seekable.
+ */
+ bool m_seekable;
+
+ /**
+ * The specification of the audio data.
+ */
+ AUD_Specs m_specs;
+
+ /**
+ * The playback buffer.
+ */
+ AUD_Buffer* m_buffer;
+
+ /**
+ * The sndfile.
+ */
+ SNDFILE* m_sndfile;
+
+ /**
+ * The reading function.
+ */
+ sf_read_f m_read;
+
+ /**
+ * The virtual IO structure for memory file reading.
+ */
+ SF_VIRTUAL_IO m_vio;
+
+ /**
+ * The pointer to the memory file.
+ */
+ AUD_Reference<AUD_Buffer> m_membuffer;
+
+ /**
+ * The current reading pointer of the memory file.
+ */
+ int m_memoffset;
+
+ // Functions for libsndfile virtual IO functionality
+ static sf_count_t vio_get_filelen(void *user_data);
+ static sf_count_t vio_seek(sf_count_t offset, int whence, void *user_data);
+ static sf_count_t vio_read(void *ptr, sf_count_t count, void *user_data);
+ static sf_count_t vio_tell(void *user_data);
+
+public:
+ /**
+ * Creates a new reader.
+ * \param filename The path to the file to be read.
+ * \exception AUD_Exception Thrown if the file specified does not exist or
+ * cannot be read with libsndfile.
+ */
+ AUD_SndFileReader(const char* filename);
+
+ /**
+ * Creates a new reader.
+ * \param buffer The buffer to read from.
+ * \exception AUD_Exception Thrown if the buffer specified cannot be read
+ * with libsndfile.
+ */
+ AUD_SndFileReader(AUD_Reference<AUD_Buffer> buffer);
+
+ /**
+ * Destroys the reader and closes the file.
+ */
+ virtual ~AUD_SndFileReader();
+
+ virtual bool isSeekable();
+ virtual void seek(int position);
+ virtual int getLength();
+ virtual int getPosition();
+ virtual AUD_Specs getSpecs();
+ virtual AUD_ReaderType getType();
+ virtual bool notify(AUD_Message &message);
+ virtual void read(int & length, sample_t* & buffer);
+};
+
+#endif //AUD_SNDFILEREADER
diff --git a/intern/audaspace/sndfile/Makefile b/intern/audaspace/sndfile/Makefile
new file mode 100644
index 00000000000..1cf0b2683fb
--- /dev/null
+++ b/intern/audaspace/sndfile/Makefile
@@ -0,0 +1,40 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s):
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+#
+
+LIBNAME = aud_sndfile
+DIR = $(OCGDIR)/intern/audaspace
+
+include nan_compile.mk
+
+CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+
+CPPFLAGS += -I../intern
+CPPFLAGS += -I..
+CPPFLAGS += -I.
diff --git a/intern/elbeem/CMakeLists.txt b/intern/elbeem/CMakeLists.txt
index 03fd4a3fefc..8b8a3000efd 100644
--- a/intern/elbeem/CMakeLists.txt
+++ b/intern/elbeem/CMakeLists.txt
@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-SET(INC ${PNG_INC} ${ZLIB_INC} ${SDL_INC} extern)
+SET(INC ${PNG_INC} ${ZLIB_INC} extern)
FILE(GLOB SRC intern/*.cpp)
diff --git a/intern/elbeem/intern/paraloopend.h b/intern/elbeem/intern/paraloopend.h
index 6bb224b625a..a396e395126 100644
--- a/intern/elbeem/intern/paraloopend.h
+++ b/intern/elbeem/intern/paraloopend.h
@@ -22,9 +22,9 @@
{
if(doReduce) {
// synchronize global vars
- for(int j=0; j<calcListFull.size() ; j++) mListFull.push_back( calcListFull[j] );
- for(int j=0; j<calcListEmpty.size(); j++) mListEmpty.push_back( calcListEmpty[j] );
- for(int j=0; j<calcListParts.size(); j++) mpParticles->addFullParticle( calcListParts[j] );
+ for(size_t j=0; j<calcListFull.size() ; j++) mListFull.push_back( calcListFull[j] );
+ for(size_t j=0; j<calcListEmpty.size(); j++) mListEmpty.push_back( calcListEmpty[j] );
+ for(size_t j=0; j<calcListParts.size(); j++) mpParticles->addFullParticle( calcListParts[j] );
if(calcMaxVlen>mMaxVlen) {
mMxvx = calcMxvx;
mMxvy = calcMxvy;
diff --git a/intern/elbeem/intern/solver_init.cpp b/intern/elbeem/intern/solver_init.cpp
index ce54adb48ee..fee011a70ae 100644
--- a/intern/elbeem/intern/solver_init.cpp
+++ b/intern/elbeem/intern/solver_init.cpp
@@ -1464,7 +1464,7 @@ void LbmFsgrSolver::initMovingObstacles(bool staticInit) {
obj->applyTransformation(targetTime, &mMOIVertices,NULL /* no old normals needed */, 0, mMOIVertices.size(), false );
} else {
// only do transform update
- obj->getMovingPoints(mMOIVertices,pNormals);
+ obj->getMovingPoints(mMOIVertices,pNormals); // mMOIVertices = mCachedMovPoints
mMOIVerticesOld = mMOIVertices;
// WARNING - assumes mSimulationTime is global!?
obj->applyTransformation(targetTime, &mMOIVertices,pNormals, 0, mMOIVertices.size(), false );
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index b559d49958c..3d588ecfd00 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-SET(INC . ../string ${WINTAB_INC})
+SET(INC . ../string)
FILE(GLOB SRC intern/*.cpp)
@@ -37,6 +37,7 @@ IF(APPLE)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
ELSE(APPLE)
IF(WIN32)
+ SET(INC ${INC} ${WINTAB_INC})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp")
@@ -44,6 +45,7 @@ ELSE(APPLE)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
ELSE(WIN32)
+ SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp")
diff --git a/intern/ghost/intern/GHOST_EventManager.cpp b/intern/ghost/intern/GHOST_EventManager.cpp
index f9b13115f32..92cea8d8ff7 100644
--- a/intern/ghost/intern/GHOST_EventManager.cpp
+++ b/intern/ghost/intern/GHOST_EventManager.cpp
@@ -51,6 +51,15 @@ GHOST_EventManager::GHOST_EventManager()
GHOST_EventManager::~GHOST_EventManager()
{
disposeEvents();
+
+ TConsumerVector::iterator iter= m_consumers.begin();
+ while (iter != m_consumers.end())
+ {
+ GHOST_IEventConsumer* consumer = *iter;
+ delete consumer;
+ m_consumers.erase(iter);
+ iter = m_consumers.begin();
+ }
}
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index 87e5f375958..229744e2000 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -290,7 +290,8 @@ GHOST_TSuccess GHOST_System::init()
#ifdef GHOST_DEBUG
if (m_eventManager) {
- m_eventManager->addConsumer(&m_eventPrinter);
+ m_eventPrinter = new GHOST_EventPrinter();
+ //m_eventManager->addConsumer(m_eventPrinter);
}
#endif // GHOST_DEBUG
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index 9310e9b2591..066fe4b93d3 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -335,7 +335,7 @@ protected:
/** Prints all the events. */
#ifdef GHOST_DEBUG
- GHOST_EventPrinter m_eventPrinter;
+ GHOST_EventPrinter* m_eventPrinter;
#endif // GHOST_DEBUG
/** Settings of the display before the display went fullscreen. */
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index e5e88502f45..5dba76adb02 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -148,6 +148,13 @@ GHOST_SystemX11(
}
+GHOST_SystemX11::
+~GHOST_SystemX11()
+{
+ XCloseDisplay(m_display);
+}
+
+
GHOST_TSuccess
GHOST_SystemX11::
init(
@@ -155,11 +162,9 @@ init(
GHOST_TSuccess success = GHOST_System::init();
if (success) {
- m_keyboard_vector = new char[32];
-
m_displayManager = new GHOST_DisplayManagerX11(this);
- if (m_keyboard_vector && m_displayManager) {
+ if (m_displayManager) {
return GHOST_kSuccess;
}
}
@@ -715,9 +720,9 @@ getModifierKeys(
// analyse the masks retuned from XQueryPointer.
- memset(m_keyboard_vector,0,sizeof(m_keyboard_vector));
+ memset((void *)m_keyboard_vector,0,sizeof(m_keyboard_vector));
- XQueryKeymap(m_display,m_keyboard_vector);
+ XQueryKeymap(m_display,(char *)m_keyboard_vector);
// now translate key symobols into keycodes and
// test with vector.
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 711a188ffe9..782f08f6737 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -59,6 +59,12 @@ public:
GHOST_SystemX11(
);
+ /**
+ * Destructor.
+ */
+ virtual ~GHOST_SystemX11();
+
+
GHOST_TSuccess
init(
);
@@ -258,7 +264,7 @@ private :
GHOST_TUns64 m_start_time;
/// A vector of keyboard key masks
- char *m_keyboard_vector;
+ char m_keyboard_vector[32];
/**
* Return the ghost window associated with the
diff --git a/intern/ghost/intern/GHOST_WindowManager.cpp b/intern/ghost/intern/GHOST_WindowManager.cpp
index 2b0809929c5..af96653db13 100644
--- a/intern/ghost/intern/GHOST_WindowManager.cpp
+++ b/intern/ghost/intern/GHOST_WindowManager.cpp
@@ -54,6 +54,7 @@ GHOST_WindowManager::GHOST_WindowManager() :
GHOST_WindowManager::~GHOST_WindowManager()
{
+ /* m_windows is freed by GHOST_System::disposeWindow */
}
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 1525b4eb16d..88ae8afd0ce 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -42,6 +42,9 @@
#include <cstring>
#include <cstdio>
+#include <algorithm>
+#include <string>
+
// For obscure full screen mode stuuf
// lifted verbatim from blut.
@@ -187,6 +190,8 @@ GHOST_WindowX11(
printf("%s:%d: X11 glxChooseVisual() failed for OpenGL, verify working openGL system!\n", __FILE__, __LINE__);
return;
}
+
+ memset(&m_xtablet, 0, sizeof(m_xtablet));
// Create a bunch of attributes needed to create an X window.
@@ -426,7 +431,20 @@ void GHOST_WindowX11::initXInputDevices()
old_handler = XSetErrorHandler(ApplicationErrorHandler) ;
for(int i=0; i<device_count; ++i) {
- if(!strcasecmp(device_info[i].name, "stylus")) {
+ std::string type = "";
+
+ if(device_info[i].type) {
+ const char *orig = XGetAtomName(m_display, device_info[i].type);
+ // Make a copy so we can convert to lower case
+ if(orig) {
+ type = orig;
+ XFree((void*)orig);
+ std::transform(type.begin(), type.end(), type.begin(), ::tolower);
+ }
+ }
+
+
+ if(type.find("stylus") != std::string::npos) {
m_xtablet.StylusID= device_info[i].id;
m_xtablet.StylusDevice = XOpenDevice(m_display, m_xtablet.StylusID);
@@ -451,7 +469,7 @@ void GHOST_WindowX11::initXInputDevices()
m_xtablet.StylusID= 0;
}
}
- if(!strcasecmp(device_info[i].name, "eraser")) {
+ if(type.find("eraser") != std::string::npos) {
m_xtablet.EraserID= device_info[i].id;
m_xtablet.EraserDevice = XOpenDevice(m_display, m_xtablet.EraserID);
if (m_xtablet.EraserDevice == NULL) m_xtablet.EraserID= 0;
@@ -1323,13 +1341,12 @@ setWindowCustomCursorShape(
int fg_color,
int bg_color
){
+ Colormap colormap= DefaultColormap(m_display, DefaultScreen(m_display));
Pixmap bitmap_pix, mask_pix;
XColor fg, bg;
- if(XAllocNamedColor(m_display, DefaultColormap(m_display, DefaultScreen(m_display)),
- "White", &fg, &fg) == 0) return GHOST_kFailure;
- if(XAllocNamedColor(m_display, DefaultColormap(m_display, DefaultScreen(m_display)),
- "Black", &bg, &bg) == 0) return GHOST_kFailure;
+ if(XAllocNamedColor(m_display, colormap, "White", &fg, &fg) == 0) return GHOST_kFailure;
+ if(XAllocNamedColor(m_display, colormap, "Black", &bg, &bg) == 0) return GHOST_kFailure;
if (m_custom_cursor) {
XFreeCursor(m_display, m_custom_cursor);
@@ -1345,6 +1362,9 @@ setWindowCustomCursorShape(
XFreePixmap(m_display, bitmap_pix);
XFreePixmap(m_display, mask_pix);
+ XFreeColors(m_display, colormap, &fg.pixel, 1, 0L);
+ XFreeColors(m_display, colormap, &bg.pixel, 1, 0L);
+
return GHOST_kSuccess;
}
diff --git a/intern/guardedalloc/BLO_sys_types.h b/intern/guardedalloc/BLO_sys_types.h
index 5ed3117c890..e3c64f9746a 100644
--- a/intern/guardedalloc/BLO_sys_types.h
+++ b/intern/guardedalloc/BLO_sys_types.h
@@ -82,7 +82,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__NetBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h>
diff --git a/intern/guardedalloc/CMakeLists.txt b/intern/guardedalloc/CMakeLists.txt
index af64fb99d58..b29837fac7d 100644
--- a/intern/guardedalloc/CMakeLists.txt
+++ b/intern/guardedalloc/CMakeLists.txt
@@ -29,4 +29,9 @@ SET(INC .)
FILE(GLOB SRC intern/*.c)
BLENDERLIB(bf_guardedalloc "${SRC}" "${INC}")
-#, libtype=['intern', 'player'], priority = [10, 175] )
+
+# Override C++ alloc optional
+IF(WITH_CXX_GUARDEDALLOC)
+ FILE(GLOB SRC cpp/*.cpp)
+ BLENDERLIB(bf_guardedalloc_cpp "${SRC}" "${INC}")
+ENDIF(WITH_CXX_GUARDEDALLOC)
diff --git a/intern/guardedalloc/SConscript b/intern/guardedalloc/SConscript
index 0184ddd9785..8927bef2efc 100644
--- a/intern/guardedalloc/SConscript
+++ b/intern/guardedalloc/SConscript
@@ -5,4 +5,4 @@ Import('env')
sources = env.Glob('intern/*.c')
incs = '.'
-env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern', 'player'], priority = [5, 175] )
+env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern'], priority = [5] )
diff --git a/intern/guardedalloc/cpp/mallocn.cpp b/intern/guardedalloc/cpp/mallocn.cpp
new file mode 100644
index 00000000000..0ee22e734b9
--- /dev/null
+++ b/intern/guardedalloc/cpp/mallocn.cpp
@@ -0,0 +1,41 @@
+/**
+ * $Id$
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <new>
+#include "../MEM_guardedalloc.h"
+
+void* operator new (size_t size)
+{
+ return MEM_mallocN(size, "c++/anonymous");
+}
+
+/* not default but can be used when needing to set a string */
+void* operator new (size_t size, const char *str)
+{
+ return MEM_mallocN(size, str);
+}
+
+void operator delete (void *p)
+{
+ MEM_freeN(p);
+}
diff --git a/intern/memutil/SConscript b/intern/memutil/SConscript
index 4528de814f3..55c314d5211 100644
--- a/intern/memutil/SConscript
+++ b/intern/memutil/SConscript
@@ -5,4 +5,4 @@ sources = env.Glob('intern/*.cpp')
incs = '. ..'
-env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern', 'player'], priority = [0, 180] )
+env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern'], priority = [0] )
diff --git a/intern/opennl/superlu/BLO_sys_types.h b/intern/opennl/superlu/BLO_sys_types.h
index 411a8582f96..56a27ec17ce 100644
--- a/intern/opennl/superlu/BLO_sys_types.h
+++ b/intern/opennl/superlu/BLO_sys_types.h
@@ -83,7 +83,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__NetBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h>
diff --git a/intern/smoke/CMakeLists.txt b/intern/smoke/CMakeLists.txt
new file mode 100644
index 00000000000..0db6acb683f
--- /dev/null
+++ b/intern/smoke/CMakeLists.txt
@@ -0,0 +1,42 @@
+# $Id$
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Daniel Genrich
+#
+# ***** END GPL LICENSE BLOCK *****
+
+SET(INC ${PNG_INC} ${ZLIB_INC} intern ../../extern/bullet2/src ../memutil ../guardealloc)
+
+FILE(GLOB SRC intern/*.cpp)
+
+IF(WITH_OPENMP)
+ ADD_DEFINITIONS(-DPARALLEL=1)
+ENDIF(WITH_OPENMP)
+
+IF(WITH_FFTW3)
+ ADD_DEFINITIONS(-DFFTW3=1)
+ SET(INC ${INC} ${FFTW3_INC})
+ENDIF(WITH_FFTW3)
+
+
+BLENDERLIB(bf_smoke "${SRC}" "${INC}")
+#, libtype='blender', priority = 0 )
diff --git a/intern/SoundSystem/Makefile b/intern/smoke/Makefile
index 4d346f65138..e5144a9c3f8 100644
--- a/intern/SoundSystem/Makefile
+++ b/intern/smoke/Makefile
@@ -24,47 +24,31 @@
#
# The Original Code is: all of this file.
#
-# Contributor(s): GSR
+# Contributor(s): Hans Lambermont, GSR
#
# ***** END GPL LICENSE BLOCK *****
-#
+# smoke main makefile.
#
include nan_definitions.mk
-LIBNAME = SoundSystem
-SOURCEDIR = intern/SoundSystem
+unexport NAN_QUIET
+
+LIBNAME = smoke
+SOURCEDIR = intern/$(LIBNAME)
DIR = $(OCGDIR)/$(SOURCEDIR)
DIRS = intern
-DIRS += dummy
-
-ifneq ($(NAN_NO_OPENAL),true)
- ifeq ($(OS),windows)
- DIRS += openal sdl
- endif
- ifeq ($(OS),darwin)
- DIRS += openal
- endif
- ifeq ($(OS),$(findstring $(OS), "linux freebsd solaris"))
- DIRS += openal sdl
- endif
- ifeq ($(OS), irix)
- DIRS += sdl
- endif
-else
- export CPPFLAGS += -DNO_SOUND
-endif
+#not ready yet TESTDIRS = test
include nan_subdirs.mk
install: $(ALL_OR_DEBUG)
- @[ -d $(NAN_SOUNDSYSTEM) ] || mkdir $(NAN_SOUNDSYSTEM)
- @[ -d $(NAN_SOUNDSYSTEM)/include ] || mkdir $(NAN_SOUNDSYSTEM)/include
- @[ -d $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)
- @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libSoundSystem.a $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)
+ @[ -d $(NAN_SMOKE) ] || mkdir $(NAN_SMOKE)
+ @[ -d $(NAN_SMOKE)/include ] || mkdir $(NAN_SMOKE)/include
+ @[ -d $(NAN_SMOKE)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_SMOKE)/lib/$(DEBUG_DIR)
+ @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_SMOKE)/lib/$(DEBUG_DIR)
ifeq ($(OS),darwin)
- ranlib $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
+ ranlib $(NAN_SMOKE)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
endif
- @../tools/cpifdiff.sh *.h $(NAN_SOUNDSYSTEM)/include/
-
+ @../tools/cpifdiff.sh extern/*.h $(NAN_SMOKE)/include/
diff --git a/intern/smoke/SConscript b/intern/smoke/SConscript
new file mode 100644
index 00000000000..af5bf1aeb20
--- /dev/null
+++ b/intern/smoke/SConscript
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('intern/*.cpp')
+
+defs = ''
+
+if env['WITH_BF_OPENMP']:
+ defs += ' PARALLEL=1'
+
+incs = env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC']
+incs += ' intern ../../extern/bullet2/src ../memutil ../guardealloc '
+
+if env['WITH_BF_FFTW3']:
+ defs += ' FFTW3=1'
+ incs += env['BF_FFTW3_INC']
+
+env.BlenderLib ('bf_smoke', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] )
diff --git a/intern/smoke/extern/smoke_API.h b/intern/smoke/extern/smoke_API.h
new file mode 100644
index 00000000000..1a3edce2344
--- /dev/null
+++ b/intern/smoke/extern/smoke_API.h
@@ -0,0 +1,79 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 by Daniel Genrich
+ * All rights reserved.
+ *
+ * Contributor(s): Daniel Genrich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef SMOKE_API_H_
+#define SMOKE_API_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct FLUID_3D;
+
+// export
+void smoke_export(struct FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles);
+
+// low res
+struct FLUID_3D *smoke_init(int *res, float *p0, float dt);
+void smoke_free(struct FLUID_3D *fluid);
+
+void smoke_initBlenderRNA(struct FLUID_3D *fluid, float *alpha, float *beta);
+void smoke_step(struct FLUID_3D *fluid, size_t framenr);
+
+float *smoke_get_density(struct FLUID_3D *fluid);
+float *smoke_get_heat(struct FLUID_3D *fluid);
+float *smoke_get_velocity_x(struct FLUID_3D *fluid);
+float *smoke_get_velocity_y(struct FLUID_3D *fluid);
+float *smoke_get_velocity_z(struct FLUID_3D *fluid);
+
+unsigned char *smoke_get_obstacle(struct FLUID_3D *fluid);
+
+size_t smoke_get_index(int x, int max_x, int y, int max_y, int z);
+size_t smoke_get_index2d(int x, int max_x, int y);
+
+void smoke_dissolve(struct FLUID_3D *fluid, int speed, int log);
+
+// wavelet turbulence functions
+struct WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype);
+void smoke_turbulence_free(struct WTURBULENCE *wt);
+void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid);
+
+float *smoke_turbulence_get_density(struct WTURBULENCE *wt);
+void smoke_turbulence_get_res(struct WTURBULENCE *wt, unsigned int *res);
+void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type);
+void smoke_turbulence_initBlenderRNA(struct WTURBULENCE *wt, float *strength);
+
+void smoke_turbulence_dissolve(struct WTURBULENCE *wt, int speed, int log);
+
+// export
+void smoke_turbulence_export(struct WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SMOKE_API_H_ */
diff --git a/intern/smoke/intern/EIGENVALUE_HELPER.h b/intern/smoke/intern/EIGENVALUE_HELPER.h
new file mode 100644
index 00000000000..6ff61c5ca8e
--- /dev/null
+++ b/intern/smoke/intern/EIGENVALUE_HELPER.h
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+//////////////////////////////////////////////////////////////////////
+// Helper function, compute eigenvalues of 3x3 matrix
+//////////////////////////////////////////////////////////////////////
+
+#include "tnt/jama_eig.h"
+
+//////////////////////////////////////////////////////////////////////
+// eigenvalues of 3x3 non-symmetric matrix
+//////////////////////////////////////////////////////////////////////
+int inline computeEigenvalues3x3(
+ float dout[3],
+ float a[3][3])
+{
+ TNT::Array2D<float> A = TNT::Array2D<float>(3,3, &a[0][0]);
+ TNT::Array1D<float> eig = TNT::Array1D<float>(3);
+ TNT::Array1D<float> eigImag = TNT::Array1D<float>(3);
+ JAMA::Eigenvalue<float> jeig = JAMA::Eigenvalue<float>(A);
+ jeig.getRealEigenvalues(eig);
+
+ // complex ones
+ jeig.getImagEigenvalues(eigImag);
+ dout[0] = sqrt(eig[0]*eig[0] + eigImag[0]*eigImag[0]);
+ dout[1] = sqrt(eig[1]*eig[1] + eigImag[1]*eigImag[1]);
+ dout[2] = sqrt(eig[2]*eig[2] + eigImag[2]*eigImag[2]);
+ return 0;
+}
+
+#undef rfabs
+#undef ROT
diff --git a/intern/smoke/intern/FFT_NOISE.h b/intern/smoke/intern/FFT_NOISE.h
new file mode 100644
index 00000000000..2c278cdc4fc
--- /dev/null
+++ b/intern/smoke/intern/FFT_NOISE.h
@@ -0,0 +1,178 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+/////////////////////////////////////////////////////////////////////////
+//
+
+#ifndef FFT_NOISE_H_
+#define FFT_NOISE_H_
+
+#if FFTW3==1
+#include <iostream>
+#include <fftw3.h>
+#include <MERSENNETWISTER.h>
+
+#include "WAVELET_NOISE.h"
+
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
+/////////////////////////////////////////////////////////////////////////
+// shift spectrum to the format that FFTW expects
+/////////////////////////////////////////////////////////////////////////
+static void shift3D(float*& field, int xRes, int yRes, int zRes)
+{
+ int xHalf = xRes / 2;
+ int yHalf = yRes / 2;
+ int zHalf = zRes / 2;
+ // int slabSize = xRes * yRes;
+ for (int z = 0; z < zHalf; z++)
+ for (int y = 0; y < yHalf; y++)
+ for (int x = 0; x < xHalf; x++)
+ {
+ int index = x + y * xRes + z * xRes * yRes;
+ float temp;
+ int xSwap = xHalf;
+ int ySwap = yHalf * xRes;
+ int zSwap = zHalf * xRes * yRes;
+
+ // [0,0,0] to [1,1,1]
+ temp = field[index];
+ field[index] = field[index + xSwap + ySwap + zSwap];
+ field[index + xSwap + ySwap + zSwap] = temp;
+
+ // [1,0,0] to [0,1,1]
+ temp = field[index + xSwap];
+ field[index + xSwap] = field[index + ySwap + zSwap];
+ field[index + ySwap + zSwap] = temp;
+
+ // [0,1,0] to [1,0,1]
+ temp = field[index + ySwap];
+ field[index + ySwap] = field[index + xSwap + zSwap];
+ field[index + xSwap + zSwap] = temp;
+
+ // [0,0,1] to [1,1,0]
+ temp = field[index + zSwap];
+ field[index + zSwap] = field[index + xSwap + ySwap];
+ field[index + xSwap + ySwap] = temp;
+ }
+}
+
+static void generatTile_FFT(float* const noiseTileData, std::string filename)
+{
+ if (loadTile(noiseTileData, filename)) return;
+
+ int res = NOISE_TILE_SIZE;
+ int xRes = res;
+ int yRes = res;
+ int zRes = res;
+ int totalCells = xRes * yRes * zRes;
+
+ // create and shift the filter
+ float* filter = new float[totalCells];
+ for (int z = 0; z < zRes; z++)
+ for (int y = 0; y < yRes; y++)
+ for (int x = 0; x < xRes; x++)
+ {
+ int index = x + y * xRes + z * xRes * yRes;
+ float diff[] = {abs(x - xRes/2),
+ abs(y - yRes/2),
+ abs(z - zRes/2)};
+ float radius = sqrtf(diff[0] * diff[0] +
+ diff[1] * diff[1] +
+ diff[2] * diff[2]) / (xRes / 2);
+ radius *= M_PI;
+ float H = cos((M_PI / 2.0f) * log(4.0f * radius / M_PI) / log(2.0f));
+ H = H * H;
+ float filtered = H;
+
+ // clamp everything outside the wanted band
+ if (radius >= M_PI / 2.0f)
+ filtered = 0.0f;
+
+ // make sure to capture all low frequencies
+ if (radius <= M_PI / 4.0f)
+ filtered = 1.0f;
+
+ filter[index] = filtered;
+ }
+ shift3D(filter, xRes, yRes, zRes);
+
+ // create the noise
+ float* noise = new float[totalCells];
+ int index = 0;
+ MTRand twister;
+ for (int z = 0; z < zRes; z++)
+ for (int y = 0; y < yRes; y++)
+ for (int x = 0; x < xRes; x++, index++)
+ noise[index] = twister.randNorm();
+
+ // create padded field
+ fftw_complex* forward = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * totalCells);
+
+ // init padded field
+ index = 0;
+ for (int z = 0; z < zRes; z++)
+ for (int y = 0; y < yRes; y++)
+ for (int x = 0; x < xRes; x++, index++)
+ {
+ forward[index][0] = noise[index];
+ forward[index][1] = 0.0f;
+ }
+
+ // forward FFT
+ fftw_complex* backward = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * totalCells);
+ fftw_plan forwardPlan = fftw_plan_dft_3d(xRes, yRes, zRes, forward, backward, FFTW_FORWARD, FFTW_ESTIMATE);
+ fftw_execute(forwardPlan);
+ fftw_destroy_plan(forwardPlan);
+
+ // apply filter
+ index = 0;
+ for (int z = 0; z < zRes; z++)
+ for (int y = 0; y < yRes; y++)
+ for (int x = 0; x < xRes; x++, index++)
+ {
+ backward[index][0] *= filter[index];
+ backward[index][1] *= filter[index];
+ }
+
+ // backward FFT
+ fftw_plan backwardPlan = fftw_plan_dft_3d(xRes, yRes, zRes, backward, forward, FFTW_BACKWARD, FFTW_ESTIMATE);
+ fftw_execute(backwardPlan);
+ fftw_destroy_plan(backwardPlan);
+
+ // subtract out the low frequency components
+ index = 0;
+ for (int z = 0; z < zRes; z++)
+ for (int y = 0; y < yRes; y++)
+ for (int x = 0; x < xRes; x++, index++)
+ noise[index] -= forward[index][0] / totalCells;
+
+ // save out the noise tile
+ saveTile(noise, filename);
+
+ fftw_free(forward);
+ fftw_free(backward);
+ delete[] filter;
+ delete[] noise;
+}
+
+#endif
+
+#endif /* FFT_NOISE_H_ */
diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp
new file mode 100644
index 00000000000..89dd893198b
--- /dev/null
+++ b/intern/smoke/intern/FLUID_3D.cpp
@@ -0,0 +1,714 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// FLUID_3D.cpp: implementation of the FLUID_3D class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "FLUID_3D.h"
+#include "IMAGE.h"
+#include <INTERPOLATE.h>
+#include "SPHERE.h"
+#include <zlib.h>
+
+// boundary conditions of the fluid domain
+#define DOMAIN_BC_FRONT 1
+#define DOMAIN_BC_TOP 0
+#define DOMAIN_BC_LEFT 1
+#define DOMAIN_BC_BACK DOMAIN_BC_FRONT
+#define DOMAIN_BC_BOTTOM DOMAIN_BC_TOP
+#define DOMAIN_BC_RIGHT DOMAIN_BC_LEFT
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
+ _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f), _dt(dt)
+{
+ // set simulation consts
+ // _dt = dt; // 0.10
+
+ // start point of array
+ _p0[0] = p0[0];
+ _p0[1] = p0[1];
+ _p0[2] = p0[2];
+
+ _iterations = 100;
+ _tempAmb = 0;
+ _heatDiffusion = 1e-3;
+ _vorticityEps = 2.0;
+ _totalTime = 0.0f;
+ _totalSteps = 0;
+ _res = Vec3Int(_xRes,_yRes,_zRes);
+ _maxRes = MAX3(_xRes, _yRes, _zRes);
+
+ // initialize wavelet turbulence
+ /*
+ if(amplify)
+ _wTurbulence = new WTURBULENCE(_res[0],_res[1],_res[2], amplify, noisetype);
+ else
+ _wTurbulence = NULL;
+ */
+
+ // scale the constants according to the refinement of the grid
+ _dx = 1.0f / (float)_maxRes;
+ float scaling = 64.0f / _maxRes;
+ scaling = (scaling < 1.0f) ? 1.0f : scaling;
+ _vorticityEps /= scaling;
+
+ // allocate arrays
+ _totalCells = _xRes * _yRes * _zRes;
+ _slabSize = _xRes * _yRes;
+ _xVelocity = new float[_totalCells];
+ _yVelocity = new float[_totalCells];
+ _zVelocity = new float[_totalCells];
+ _xVelocityOld = new float[_totalCells];
+ _yVelocityOld = new float[_totalCells];
+ _zVelocityOld = new float[_totalCells];
+ _xForce = new float[_totalCells];
+ _yForce = new float[_totalCells];
+ _zForce = new float[_totalCells];
+ _density = new float[_totalCells];
+ _densityOld = new float[_totalCells];
+ _heat = new float[_totalCells];
+ _heatOld = new float[_totalCells];
+ _obstacles = new unsigned char[_totalCells]; // set 0 at end of step
+
+ // DG TODO: check if alloc went fine
+
+ for (int x = 0; x < _totalCells; x++)
+ {
+ _density[x] = 0.0f;
+ _densityOld[x] = 0.0f;
+ _heat[x] = 0.0f;
+ _heatOld[x] = 0.0f;
+ _xVelocity[x] = 0.0f;
+ _yVelocity[x] = 0.0f;
+ _zVelocity[x] = 0.0f;
+ _xVelocityOld[x] = 0.0f;
+ _yVelocityOld[x] = 0.0f;
+ _zVelocityOld[x] = 0.0f;
+ _xForce[x] = 0.0f;
+ _yForce[x] = 0.0f;
+ _zForce[x] = 0.0f;
+ _obstacles[x] = false;
+ }
+
+ // set side obstacles
+ size_t index;
+ for (int y = 0; y < _yRes; y++) // z
+ for (int x = 0; x < _xRes; x++)
+ {
+ // front slab
+ index = x + y * _xRes;
+ if(DOMAIN_BC_BOTTOM==1) _obstacles[index] = 1;
+
+ // back slab
+ index += _totalCells - _slabSize;
+ if(DOMAIN_BC_TOP==1) _obstacles[index] = 1;
+ }
+ for (int z = 0; z < _zRes; z++) // y
+ for (int x = 0; x < _xRes; x++)
+ {
+ // bottom slab
+ index = x + z * _slabSize;
+ if(DOMAIN_BC_FRONT==1) _obstacles[index] = 1;
+
+ // top slab
+ index += _slabSize - _xRes;
+ if(DOMAIN_BC_BACK==1) _obstacles[index] = 1;
+ }
+ for (int z = 0; z < _zRes; z++) // x
+ for (int y = 0; y < _yRes; y++)
+ {
+ // left slab
+ index = y * _xRes + z * _slabSize;
+ if(DOMAIN_BC_LEFT==1) _obstacles[index] = 1;
+
+ // right slab
+ index += _xRes - 1;
+ if(DOMAIN_BC_RIGHT==1) _obstacles[index] = 1;
+ }
+
+ /*
+ SPHERE *obsSphere = NULL;
+ obsSphere = new SPHERE(0.375,0.5,0.375, 0.1); // for 4 to 3 domain
+ addObstacle(obsSphere);
+ delete obsSphere;
+ */
+}
+
+FLUID_3D::~FLUID_3D()
+{
+ if (_xVelocity) delete[] _xVelocity;
+ if (_yVelocity) delete[] _yVelocity;
+ if (_zVelocity) delete[] _zVelocity;
+ if (_xVelocityOld) delete[] _xVelocityOld;
+ if (_yVelocityOld) delete[] _yVelocityOld;
+ if (_zVelocityOld) delete[] _zVelocityOld;
+ if (_xForce) delete[] _xForce;
+ if (_yForce) delete[] _yForce;
+ if (_zForce) delete[] _zForce;
+ if (_density) delete[] _density;
+ if (_densityOld) delete[] _densityOld;
+ if (_heat) delete[] _heat;
+ if (_heatOld) delete[] _heatOld;
+ if (_obstacles) delete[] _obstacles;
+ // if (_wTurbulence) delete _wTurbulence;
+
+ // printf("deleted fluid\n");
+}
+
+// init direct access functions from blender
+void FLUID_3D::initBlenderRNA(float *alpha, float *beta)
+{
+ _alpha = alpha;
+ _beta = beta;
+}
+
+//////////////////////////////////////////////////////////////////////
+// step simulation once
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::step()
+{
+ // wipe forces
+ for (int i = 0; i < _totalCells; i++)
+ {
+ _xForce[i] = _yForce[i] = _zForce[i] = 0.0f;
+ _obstacles[i] &= ~2;
+ }
+
+ wipeBoundaries();
+
+ // run the solvers
+ addVorticity();
+ addBuoyancy(_heat, _density);
+ addForce();
+ project();
+ diffuseHeat();
+
+ // advect everything
+ advectMacCormack();
+
+ // if(_wTurbulence) {
+ // _wTurbulence->stepTurbulenceFull(_dt/_dx,
+ // _xVelocity, _yVelocity, _zVelocity, _obstacles);
+ // _wTurbulence->stepTurbulenceReadable(_dt/_dx,
+ // _xVelocity, _yVelocity, _zVelocity, _obstacles);
+ // }
+/*
+ // no file output
+ float *src = _density;
+ string prefix = string("./original.preview/density_fullxy_");
+ writeImageSliceXY(src,_res, _res[2]/2, prefix, _totalSteps);
+*/
+ // artificial damping -- this is necessary because we use a
+ // collated grid, and at very coarse grid resolutions, banding
+ // artifacts can occur
+ artificialDamping(_xVelocity);
+ artificialDamping(_yVelocity);
+ artificialDamping(_zVelocity);
+/*
+// no file output
+ string pbrtPrefix = string("./pbrt/density_small_");
+ IMAGE::dumpPBRT(_totalSteps, pbrtPrefix, _density, _res[0],_res[1],_res[2]);
+ */
+ _totalTime += _dt;
+ _totalSteps++;
+
+ memset(_obstacles, 0, sizeof(unsigned char)*_xRes*_yRes*_zRes);
+}
+
+//////////////////////////////////////////////////////////////////////
+// helper function to dampen co-located grid artifacts of given arrays in intervals
+// (only needed for velocity, strength (w) depends on testcase...
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::artificialDamping(float* field) {
+ const float w = 0.9;
+ if(_totalSteps % 4 == 1) {
+ for (int z = 1; z < _res[2]-1; z++)
+ for (int y = 1; y < _res[1]-1; y++)
+ for (int x = 1+(y+z)%2; x < _res[0]-1; x+=2) {
+ const int index = x + y*_res[0] + z * _slabSize;
+ field[index] = (1-w)*field[index] + 1./6. * w*(
+ field[index+1] + field[index-1] +
+ field[index+_res[0]] + field[index-_res[0]] +
+ field[index+_slabSize] + field[index-_slabSize] );
+ }
+ }
+ if(_totalSteps % 4 == 3) {
+ for (int z = 1; z < _res[2]-1; z++)
+ for (int y = 1; y < _res[1]-1; y++)
+ for (int x = 1+(y+z+1)%2; x < _res[0]-1; x+=2) {
+ const int index = x + y*_res[0] + z * _slabSize;
+ field[index] = (1-w)*field[index] + 1./6. * w*(
+ field[index+1] + field[index-1] +
+ field[index+_res[0]] + field[index-_res[0]] +
+ field[index+_slabSize] + field[index-_slabSize] );
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// copy out the boundary in all directions
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::copyBorderAll(float* field)
+{
+ size_t index;
+ for (int y = 0; y < _yRes; y++)
+ for (int x = 0; x < _xRes; x++)
+ {
+ // front slab
+ index = x + y * _xRes;
+ field[index] = field[index + _slabSize];
+
+ // back slab
+ index += _totalCells - _slabSize;
+ field[index] = field[index - _slabSize];
+ }
+
+ for (int z = 0; z < _zRes; z++)
+ for (int x = 0; x < _xRes; x++)
+ {
+ // bottom slab
+ index = x + z * _slabSize;
+ field[index] = field[index + _xRes];
+
+ // top slab
+ index += _slabSize - _xRes;
+ field[index] = field[index - _xRes];
+ }
+
+ for (int z = 0; z < _zRes; z++)
+ for (int y = 0; y < _yRes; y++)
+ {
+ // left slab
+ index = y * _xRes + z * _slabSize;
+ field[index] = field[index + 1];
+
+ // right slab
+ index += _xRes - 1;
+ field[index] = field[index - 1];
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// wipe boundaries of velocity and density
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::wipeBoundaries()
+{
+ setZeroBorder(_xVelocity, _res);
+ setZeroBorder(_yVelocity, _res);
+ setZeroBorder(_zVelocity, _res);
+ setZeroBorder(_density, _res);
+}
+
+//////////////////////////////////////////////////////////////////////
+// add forces to velocity field
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::addForce()
+{
+ for (int i = 0; i < _totalCells; i++)
+ {
+ _xVelocity[i] += _dt * _xForce[i];
+ _yVelocity[i] += _dt * _yForce[i];
+ _zVelocity[i] += _dt * _zForce[i];
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// project into divergence free field
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::project()
+{
+ int x, y, z;
+ size_t index;
+
+ float *_pressure = new float[_totalCells];
+ float *_divergence = new float[_totalCells];
+
+ memset(_pressure, 0, sizeof(float)*_totalCells);
+ memset(_divergence, 0, sizeof(float)*_totalCells);
+
+ setObstacleBoundaries(_pressure);
+
+ // copy out the boundaries
+ if(DOMAIN_BC_LEFT == 0) setNeumannX(_xVelocity, _res);
+ else setZeroX(_xVelocity, _res);
+
+ if(DOMAIN_BC_TOP == 0) setNeumannZ(_zVelocity, _res);
+ else setZeroZ(_zVelocity, _res);
+
+ if(DOMAIN_BC_FRONT == 0) setNeumannY(_yVelocity, _res);
+ else setZeroY(_yVelocity, _res);
+
+ // calculate divergence
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ float xright = _xVelocity[index + 1];
+ float xleft = _xVelocity[index - 1];
+ float yup = _yVelocity[index + _xRes];
+ float ydown = _yVelocity[index - _xRes];
+ float ztop = _zVelocity[index + _slabSize];
+ float zbottom = _zVelocity[index - _slabSize];
+
+ if(_obstacles[index+1]) xright = - _xVelocity[index];
+ if(_obstacles[index-1]) xleft = - _xVelocity[index];
+ if(_obstacles[index+_xRes]) yup = - _yVelocity[index];
+ if(_obstacles[index-_xRes]) ydown = - _yVelocity[index];
+ if(_obstacles[index+_slabSize]) ztop = - _zVelocity[index];
+ if(_obstacles[index-_slabSize]) zbottom = - _zVelocity[index];
+
+ _divergence[index] = -_dx * 0.5f * (
+ xright - xleft +
+ yup - ydown +
+ ztop - zbottom );
+
+ // DG: commenting this helps CG to get a better start, 10-20% speed improvement
+ // _pressure[index] = 0.0f;
+ }
+ copyBorderAll(_pressure);
+
+ // solve Poisson equation
+ solvePressurePre(_pressure, _divergence, _obstacles);
+
+ setObstaclePressure(_pressure);
+
+ // project out solution
+ float invDx = 1.0f / _dx;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ if(!_obstacles[index])
+ {
+ _xVelocity[index] -= 0.5f * (_pressure[index + 1] - _pressure[index - 1]) * invDx;
+ _yVelocity[index] -= 0.5f * (_pressure[index + _xRes] - _pressure[index - _xRes]) * invDx;
+ _zVelocity[index] -= 0.5f * (_pressure[index + _slabSize] - _pressure[index - _slabSize]) * invDx;
+ }
+ }
+
+ if (_pressure) delete[] _pressure;
+ if (_divergence) delete[] _divergence;
+}
+
+//////////////////////////////////////////////////////////////////////
+// diffuse heat
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::diffuseHeat()
+{
+ SWAP_POINTERS(_heat, _heatOld);
+
+ copyBorderAll(_heatOld);
+ solveHeat(_heat, _heatOld, _obstacles);
+
+ // zero out inside obstacles
+ for (int x = 0; x < _totalCells; x++)
+ if (_obstacles[x])
+ _heat[x] = 0.0f;
+}
+
+//////////////////////////////////////////////////////////////////////
+// stamp an obstacle in the _obstacles field
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::addObstacle(OBSTACLE* obstacle)
+{
+ int index = 0;
+ for (int z = 0; z < _zRes; z++)
+ for (int y = 0; y < _yRes; y++)
+ for (int x = 0; x < _xRes; x++, index++)
+ if (obstacle->inside(x * _dx, y * _dx, z * _dx)) {
+ _obstacles[index] = true;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// calculate the obstacle directional types
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::setObstaclePressure(float *_pressure)
+{
+ // tag remaining obstacle blocks
+ for (int z = 1, index = _slabSize + _xRes + 1;
+ z < _zRes - 1; z++, index += 2 * _xRes)
+ for (int y = 1; y < _yRes - 1; y++, index += 2)
+ for (int x = 1; x < _xRes - 1; x++, index++)
+ {
+ // could do cascade of ifs, but they are a pain
+ if (_obstacles[index])
+ {
+ const int top = _obstacles[index + _slabSize];
+ const int bottom= _obstacles[index - _slabSize];
+ const int up = _obstacles[index + _xRes];
+ const int down = _obstacles[index - _xRes];
+ const int left = _obstacles[index - 1];
+ const int right = _obstacles[index + 1];
+
+ // unused
+ // const bool fullz = (top && bottom);
+ // const bool fully = (up && down);
+ //const bool fullx = (left && right);
+
+ _xVelocity[index] =
+ _yVelocity[index] =
+ _zVelocity[index] = 0.0f;
+ _pressure[index] = 0.0f;
+
+ // average pressure neighbors
+ float pcnt = 0.;
+ if (left && !right) {
+ _pressure[index] += _pressure[index + 1];
+ pcnt += 1.;
+ }
+ if (!left && right) {
+ _pressure[index] += _pressure[index - 1];
+ pcnt += 1.;
+ }
+ if (up && !down) {
+ _pressure[index] += _pressure[index - _xRes];
+ pcnt += 1.;
+ }
+ if (!up && down) {
+ _pressure[index] += _pressure[index + _xRes];
+ pcnt += 1.;
+ }
+ if (top && !bottom) {
+ _pressure[index] += _pressure[index - _slabSize];
+ pcnt += 1.;
+ // _zVelocity[index] += - _zVelocity[index - _slabSize];
+ // vp += 1.0;
+ }
+ if (!top && bottom) {
+ _pressure[index] += _pressure[index + _slabSize];
+ pcnt += 1.;
+ // _zVelocity[index] += - _zVelocity[index + _slabSize];
+ // vp += 1.0;
+ }
+
+ if(pcnt > 0.000001f)
+ _pressure[index] /= pcnt;
+
+ // test - dg
+ // if(vp > 0.000001f)
+ // _zVelocity[index] /= vp;
+
+ // TODO? set correct velocity bc's
+ // velocities are only set to zero right now
+ // this means it's not a full no-slip boundary condition
+ // but a "half-slip" - still looks ok right now
+ }
+ }
+}
+
+void FLUID_3D::setObstacleBoundaries(float *_pressure)
+{
+ // cull degenerate obstacles , move to addObstacle?
+ for (int z = 1, index = _slabSize + _xRes + 1;
+ z < _zRes - 1; z++, index += 2 * _xRes)
+ for (int y = 1; y < _yRes - 1; y++, index += 2)
+ for (int x = 1; x < _xRes - 1; x++, index++)
+ {
+ if (_obstacles[index] != EMPTY)
+ {
+ const int top = _obstacles[index + _slabSize];
+ const int bottom= _obstacles[index - _slabSize];
+ const int up = _obstacles[index + _xRes];
+ const int down = _obstacles[index - _xRes];
+ const int left = _obstacles[index - 1];
+ const int right = _obstacles[index + 1];
+
+ int counter = 0;
+ if (up) counter++;
+ if (down) counter++;
+ if (left) counter++;
+ if (right) counter++;
+ if (top) counter++;
+ if (bottom) counter++;
+
+ if (counter < 3)
+ _obstacles[index] = EMPTY;
+ }
+ if (_obstacles[index])
+ {
+ _xVelocity[index] =
+ _yVelocity[index] =
+ _zVelocity[index] = 0.0f;
+ _pressure[index] = 0.0f;
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// add buoyancy forces
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::addBuoyancy(float *heat, float *density)
+{
+ int index = 0;
+
+ for (int z = 0; z < _zRes; z++)
+ for (int y = 0; y < _yRes; y++)
+ for (int x = 0; x < _xRes; x++, index++)
+ {
+ _zForce[index] += *_alpha * density[index] + (*_beta * (heat[index] - _tempAmb)); // DG: was _yForce, changed for Blender
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// add vorticity to the force field
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::addVorticity()
+{
+ int x,y,z,index;
+ if(_vorticityEps<=0.) return;
+
+ float *_xVorticity, *_yVorticity, *_zVorticity, *_vorticity;
+
+ _xVorticity = new float[_totalCells];
+ _yVorticity = new float[_totalCells];
+ _zVorticity = new float[_totalCells];
+ _vorticity = new float[_totalCells];
+
+ memset(_xVorticity, 0, sizeof(float)*_totalCells);
+ memset(_yVorticity, 0, sizeof(float)*_totalCells);
+ memset(_zVorticity, 0, sizeof(float)*_totalCells);
+ memset(_vorticity, 0, sizeof(float)*_totalCells);
+
+ // calculate vorticity
+ float gridSize = 0.5f / _dx;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ int up = _obstacles[index + _xRes] ? index : index + _xRes;
+ int down = _obstacles[index - _xRes] ? index : index - _xRes;
+ float dy = (up == index || down == index) ? 1.0f / _dx : gridSize;
+ int out = _obstacles[index + _slabSize] ? index : index + _slabSize;
+ int in = _obstacles[index - _slabSize] ? index : index - _slabSize;
+ float dz = (out == index || in == index) ? 1.0f / _dx : gridSize;
+ int right = _obstacles[index + 1] ? index : index + 1;
+ int left = _obstacles[index - 1] ? index : index - 1;
+ float dx = (right == index || right == index) ? 1.0f / _dx : gridSize;
+
+ _xVorticity[index] = (_zVelocity[up] - _zVelocity[down]) * dy + (-_yVelocity[out] + _yVelocity[in]) * dz;
+ _yVorticity[index] = (_xVelocity[out] - _xVelocity[in]) * dz + (-_zVelocity[right] + _zVelocity[left]) * dx;
+ _zVorticity[index] = (_yVelocity[right] - _yVelocity[left]) * dx + (-_xVelocity[up] + _xVelocity[down])* dy;
+
+ _vorticity[index] = sqrtf(_xVorticity[index] * _xVorticity[index] +
+ _yVorticity[index] * _yVorticity[index] +
+ _zVorticity[index] * _zVorticity[index]);
+ }
+
+ // calculate normalized vorticity vectors
+ float eps = _vorticityEps;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ if (!_obstacles[index])
+ {
+ float N[3];
+
+ int up = _obstacles[index + _xRes] ? index : index + _xRes;
+ int down = _obstacles[index - _xRes] ? index : index - _xRes;
+ float dy = (up == index || down == index) ? 1.0f / _dx : gridSize;
+ int out = _obstacles[index + _slabSize] ? index : index + _slabSize;
+ int in = _obstacles[index - _slabSize] ? index : index - _slabSize;
+ float dz = (out == index || in == index) ? 1.0f / _dx : gridSize;
+ int right = _obstacles[index + 1] ? index : index + 1;
+ int left = _obstacles[index - 1] ? index : index - 1;
+ float dx = (right == index || right == index) ? 1.0f / _dx : gridSize;
+ N[0] = (_vorticity[right] - _vorticity[left]) * dx;
+ N[1] = (_vorticity[up] - _vorticity[down]) * dy;
+ N[2] = (_vorticity[out] - _vorticity[in]) * dz;
+
+ float magnitude = sqrtf(N[0] * N[0] + N[1] * N[1] + N[2] * N[2]);
+ if (magnitude > 0.0f)
+ {
+ magnitude = 1.0f / magnitude;
+ N[0] *= magnitude;
+ N[1] *= magnitude;
+ N[2] *= magnitude;
+
+ _xForce[index] += (N[1] * _zVorticity[index] - N[2] * _yVorticity[index]) * _dx * eps;
+ _yForce[index] -= (N[0] * _zVorticity[index] - N[2] * _xVorticity[index]) * _dx * eps;
+ _zForce[index] += (N[0] * _yVorticity[index] - N[1] * _xVorticity[index]) * _dx * eps;
+ }
+ }
+
+ if (_xVorticity) delete[] _xVorticity;
+ if (_yVorticity) delete[] _yVorticity;
+ if (_zVorticity) delete[] _zVorticity;
+ if (_vorticity) delete[] _vorticity;
+}
+
+//////////////////////////////////////////////////////////////////////
+// Advect using the MacCormack method from the Selle paper
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::advectMacCormack()
+{
+ Vec3Int res = Vec3Int(_xRes,_yRes,_zRes);
+
+ if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocity, res);
+ else setZeroX(_xVelocity, res);
+
+ if(DOMAIN_BC_TOP == 0) copyBorderZ(_zVelocity, res);
+ else setZeroZ(_zVelocity, res);
+
+ if(DOMAIN_BC_FRONT == 0) copyBorderY(_yVelocity, res);
+ else setZeroY(_yVelocity, res);
+
+ SWAP_POINTERS(_xVelocity, _xVelocityOld);
+ SWAP_POINTERS(_yVelocity, _yVelocityOld);
+ SWAP_POINTERS(_zVelocity, _zVelocityOld);
+ SWAP_POINTERS(_density, _densityOld);
+ SWAP_POINTERS(_heat, _heatOld);
+
+ const float dt0 = _dt / _dx;
+ // use force arrays as temp arrays
+ for (int x = 0; x < _totalCells; x++)
+ _xForce[x] = _yForce[x] = 0.0;
+
+ float* t1 = _xForce;
+ float* t2 = _yForce;
+
+ advectFieldMacCormack(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _densityOld, _density, t1,t2, res, _obstacles);
+ advectFieldMacCormack(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _heatOld, _heat, t1,t2, res, _obstacles);
+ advectFieldMacCormack(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _xVelocityOld, _xVelocity, t1,t2, res, _obstacles);
+ advectFieldMacCormack(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _yVelocityOld, _yVelocity, t1,t2, res, _obstacles);
+ advectFieldMacCormack(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _zVelocityOld, _zVelocity, t1,t2, res, _obstacles);
+
+ if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocity, res);
+ else setZeroX(_xVelocity, res);
+
+ if(DOMAIN_BC_TOP == 0) copyBorderZ(_zVelocity, res);
+ else setZeroZ(_zVelocity, res);
+
+ if(DOMAIN_BC_FRONT == 0) copyBorderY(_yVelocity, res);
+ else setZeroY(_yVelocity, res);
+
+ setZeroBorder(_density, res);
+ setZeroBorder(_heat, res);
+
+ for (int x = 0; x < _totalCells; x++)
+ t1[x] = t2[x] = 0.0;
+}
diff --git a/intern/smoke/intern/FLUID_3D.h b/intern/smoke/intern/FLUID_3D.h
new file mode 100644
index 00000000000..9d9e7318204
--- /dev/null
+++ b/intern/smoke/intern/FLUID_3D.h
@@ -0,0 +1,168 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// FLUID_3D.h: interface for the FLUID_3D class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef FLUID_3D_H
+#define FLUID_3D_H
+
+#include <cstdlib>
+#include <cmath>
+#include <iostream>
+#include "OBSTACLE.h"
+// #include "WTURBULENCE.h"
+#include "VEC3.h"
+
+using namespace std;
+using namespace BasicVector;
+class WTURBULENCE;
+
+class FLUID_3D
+{
+ public:
+ FLUID_3D(int *res, /* int amplify, */ float *p0, float dt);
+ FLUID_3D() {};
+ virtual ~FLUID_3D();
+
+ void initBlenderRNA(float *alpha, float *beta);
+
+ // create & allocate vector noise advection
+ void initVectorNoise(int amplify);
+
+ void addSmokeColumn();
+ static void addSmokeTestCase(float* field, Vec3Int res, float value);
+
+ void step();
+ void addObstacle(OBSTACLE* obstacle);
+
+ const float* xVelocity() { return _xVelocity; };
+ const float* yVelocity() { return _yVelocity; };
+ const float* zVelocity() { return _zVelocity; };
+
+ int xRes() const { return _xRes; };
+ int yRes() const { return _yRes; };
+ int zRes() const { return _zRes; };
+
+ public:
+ // dimensions
+ int _xRes, _yRes, _zRes, _maxRes;
+ Vec3Int _res;
+ size_t _totalCells;
+ int _slabSize;
+ float _dx;
+ float _p0[3];
+ float _p1[3];
+ float _totalTime;
+ int _totalSteps;
+ int _totalImgDumps;
+ int _totalVelDumps;
+
+ void artificialDamping(float* field);
+
+ // fields
+ float* _density;
+ float* _densityOld;
+ float* _heat;
+ float* _heatOld;
+ float* _xVelocity;
+ float* _yVelocity;
+ float* _zVelocity;
+ float* _xVelocityOld;
+ float* _yVelocityOld;
+ float* _zVelocityOld;
+ float* _xForce;
+ float* _yForce;
+ float* _zForce;
+ unsigned char* _obstacles;
+
+ // CG fields
+ int _iterations;
+
+ // simulation constants
+ float _dt;
+ float _vorticityEps;
+ float _heatDiffusion;
+ float *_alpha; // for the buoyancy density term <-- as pointer to get blender RNA in here
+ float *_beta; // was _buoyancy <-- as pointer to get blender RNA in here
+ float _tempAmb; /* ambient temperature */
+
+ // WTURBULENCE object, if active
+ // WTURBULENCE* _wTurbulence;
+
+ // boundary setting functions
+ void copyBorderAll(float* field);
+
+ // timestepping functions
+ void wipeBoundaries();
+ void addForce();
+ void addVorticity();
+ void addBuoyancy(float *heat, float *density);
+
+ // solver stuff
+ void project();
+ void diffuseHeat();
+ void solvePressure(float* field, float* b, unsigned char* skip);
+ void solvePressurePre(float* field, float* b, unsigned char* skip);
+ void solveHeat(float* field, float* b, unsigned char* skip);
+
+ // handle obstacle boundaries
+ void setObstacleBoundaries(float *_pressure);
+ void setObstaclePressure(float *_pressure);
+
+ public:
+ // advection, accessed e.g. by WTURBULENCE class
+ void advectMacCormack();
+
+ // boundary setting functions
+ static void copyBorderX(float* field, Vec3Int res);
+ static void copyBorderY(float* field, Vec3Int res);
+ static void copyBorderZ(float* field, Vec3Int res);
+ static void setNeumannX(float* field, Vec3Int res);
+ static void setNeumannY(float* field, Vec3Int res);
+ static void setNeumannZ(float* field, Vec3Int res);
+ static void setZeroX(float* field, Vec3Int res);
+ static void setZeroY(float* field, Vec3Int res);
+ static void setZeroZ(float* field, Vec3Int res);
+ static void setZeroBorder(float* field, Vec3Int res) {
+ setZeroX(field, res);
+ setZeroY(field, res);
+ setZeroZ(field, res);
+ };
+
+ // static advection functions, also used by WTURBULENCE
+ static void advectFieldSemiLagrange(const float dt, const float* velx, const float* vely, const float* velz,
+ float* oldField, float* newField, Vec3Int res);
+ static void advectFieldMacCormack(const float dt, const float* xVelocity, const float* yVelocity, const float* zVelocity,
+ float* oldField, float* newField, float* temp1, float* temp2, Vec3Int res, const unsigned char* obstacles);
+
+ // maccormack helper functions
+ static void clampExtrema(const float dt, const float* xVelocity, const float* yVelocity, const float* zVelocity,
+ float* oldField, float* newField, Vec3Int res);
+ static void clampOutsideRays(const float dt, const float* xVelocity, const float* yVelocity, const float* zVelocity,
+ float* oldField, float* newField, Vec3Int res, const unsigned char* obstacles, const float *oldAdvection);
+
+ // output helper functions
+ // static void writeImageSliceXY(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
+ // static void writeImageSliceYZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
+ // static void writeImageSliceXZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale=1.);
+ // static void writeProjectedIntern(const float *field, Vec3Int res, int dir1, int dir2, string prefix, int picCnt, float scale=1.);
+};
+
+#endif
diff --git a/intern/smoke/intern/FLUID_3D_SOLVERS.cpp b/intern/smoke/intern/FLUID_3D_SOLVERS.cpp
new file mode 100644
index 00000000000..7d078d86d61
--- /dev/null
+++ b/intern/smoke/intern/FLUID_3D_SOLVERS.cpp
@@ -0,0 +1,524 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// FLUID_3D.cpp: implementation of the FLUID_3D class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "FLUID_3D.h"
+#include <cstring>
+#define SOLVER_ACCURACY 1e-06
+
+void FLUID_3D::solvePressurePre(float* field, float* b, unsigned char* skip)
+{
+ int x, y, z;
+ size_t index;
+ float *_q, *_Precond, *_h, *_residual, *_direction;
+
+ // i = 0
+ int i = 0;
+
+ _residual = new float[_totalCells]; // set 0
+ _direction = new float[_totalCells]; // set 0
+ _q = new float[_totalCells]; // set 0
+ _h = new float[_totalCells]; // set 0
+ _Precond = new float[_totalCells]; // set 0
+
+ memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_h, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_Precond, 0, sizeof(float)*_xRes*_yRes*_zRes);
+
+ // r = b - Ax
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ // if the cell is a variable
+ float Acenter = 0.0f;
+ if (!skip[index])
+ {
+ // set the matrix to the Poisson stencil in order
+ if (!skip[index + 1]) Acenter += 1.;
+ if (!skip[index - 1]) Acenter += 1.;
+ if (!skip[index + _xRes]) Acenter += 1.;
+ if (!skip[index - _xRes]) Acenter += 1.;
+ if (!skip[index + _slabSize]) Acenter += 1.;
+ if (!skip[index - _slabSize]) Acenter += 1.;
+ }
+
+ _residual[index] = b[index] - (Acenter * field[index] +
+ field[index - 1] * (skip[index - 1] ? 0.0 : -1.0f)+
+ field[index + 1] * (skip[index + 1] ? 0.0 : -1.0f)+
+ field[index - _xRes] * (skip[index - _xRes] ? 0.0 : -1.0f)+
+ field[index + _xRes] * (skip[index + _xRes] ? 0.0 : -1.0f)+
+ field[index - _slabSize] * (skip[index - _slabSize] ? 0.0 : -1.0f)+
+ field[index + _slabSize] * (skip[index + _slabSize] ? 0.0 : -1.0f) );
+ _residual[index] = (skip[index]) ? 0.0f : _residual[index];
+
+ // P^-1
+ if(Acenter < 1.0)
+ _Precond[index] = 0.0;
+ else
+ _Precond[index] = 1.0 / Acenter;
+
+ // p = P^-1 * r
+ _direction[index] = _residual[index] * _Precond[index];
+ }
+
+ // deltaNew = transpose(r) * p
+ float deltaNew = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ deltaNew += _residual[index] * _direction[index];
+
+ // delta0 = deltaNew
+ // float delta0 = deltaNew;
+
+ // While deltaNew > (eps^2) * delta0
+ const float eps = SOLVER_ACCURACY;
+ //while ((i < _iterations) && (deltaNew > eps*delta0))
+ float maxR = 2.0f * eps;
+ // while (i < _iterations)
+ while ((i < _iterations) && (maxR > 0.001*eps))
+ {
+ // (s) q = Ad (p)
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ // if the cell is a variable
+ float Acenter = 0.0f;
+ if (!skip[index])
+ {
+ // set the matrix to the Poisson stencil in order
+ if (!skip[index + 1]) Acenter += 1.;
+ if (!skip[index - 1]) Acenter += 1.;
+ if (!skip[index + _xRes]) Acenter += 1.;
+ if (!skip[index - _xRes]) Acenter += 1.;
+ if (!skip[index + _slabSize]) Acenter += 1.;
+ if (!skip[index - _slabSize]) Acenter += 1.;
+ }
+
+ _q[index] = Acenter * _direction[index] +
+ _direction[index - 1] * (skip[index - 1] ? 0.0 : -1.0f) +
+ _direction[index + 1] * (skip[index + 1] ? 0.0 : -1.0f) +
+ _direction[index - _xRes] * (skip[index - _xRes] ? 0.0 : -1.0f) +
+ _direction[index + _xRes] * (skip[index + _xRes] ? 0.0 : -1.0f)+
+ _direction[index - _slabSize] * (skip[index - _slabSize] ? 0.0 : -1.0f) +
+ _direction[index + _slabSize] * (skip[index + _slabSize] ? 0.0 : -1.0f);
+ _q[index] = (skip[index]) ? 0.0f : _q[index];
+ }
+
+ // alpha = deltaNew / (transpose(d) * q)
+ float alpha = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ alpha += _direction[index] * _q[index];
+ if (fabs(alpha) > 0.0f)
+ alpha = deltaNew / alpha;
+
+ // x = x + alpha * d
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ field[index] += alpha * _direction[index];
+
+ // r = r - alpha * q
+ maxR = 0.0;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ _residual[index] -= alpha * _q[index];
+ // maxR = (_residual[index] > maxR) ? _residual[index] : maxR;
+ }
+
+ // if(maxR <= eps)
+ // break;
+
+ // h = P^-1 * r
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ _h[index] = _Precond[index] * _residual[index];
+ }
+
+ // deltaOld = deltaNew
+ float deltaOld = deltaNew;
+
+ // deltaNew = transpose(r) * h
+ deltaNew = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ deltaNew += _residual[index] * _h[index];
+ maxR = (_residual[index]* _h[index] > maxR) ? _residual[index]* _h[index] : maxR;
+ }
+
+ // beta = deltaNew / deltaOld
+ float beta = deltaNew / deltaOld;
+
+ // d = h + beta * d
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ _direction[index] = _h[index] + beta * _direction[index];
+
+ // i = i + 1
+ i++;
+ }
+ // cout << i << " iterations converged to " << sqrt(maxR) << endl;
+
+ if (_h) delete[] _h;
+ if (_Precond) delete[] _Precond;
+ if (_residual) delete[] _residual;
+ if (_direction) delete[] _direction;
+ if (_q) delete[] _q;
+}
+
+//////////////////////////////////////////////////////////////////////
+// solve the poisson equation with CG
+//////////////////////////////////////////////////////////////////////
+#if 0
+void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip)
+{
+ int x, y, z;
+ size_t index;
+
+ // i = 0
+ int i = 0;
+
+ memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes);
+
+ // r = b - Ax
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ // if the cell is a variable
+ float Acenter = 0.0f;
+ if (!skip[index])
+ {
+ // set the matrix to the Poisson stencil in order
+ if (!skip[index + 1]) Acenter += 1.;
+ if (!skip[index - 1]) Acenter += 1.;
+ if (!skip[index + _xRes]) Acenter += 1.;
+ if (!skip[index - _xRes]) Acenter += 1.;
+ if (!skip[index + _slabSize]) Acenter += 1.;
+ if (!skip[index - _slabSize]) Acenter += 1.;
+ }
+
+ _residual[index] = b[index] - (Acenter * field[index] +
+ field[index - 1] * (skip[index - 1] ? 0.0 : -1.0f)+
+ field[index + 1] * (skip[index + 1] ? 0.0 : -1.0f)+
+ field[index - _xRes] * (skip[index - _xRes] ? 0.0 : -1.0f)+
+ field[index + _xRes] * (skip[index + _xRes] ? 0.0 : -1.0f)+
+ field[index - _slabSize] * (skip[index - _slabSize] ? 0.0 : -1.0f)+
+ field[index + _slabSize] * (skip[index + _slabSize] ? 0.0 : -1.0f) );
+ _residual[index] = (skip[index]) ? 0.0f : _residual[index];
+ }
+
+
+ // d = r
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ _direction[index] = _residual[index];
+
+ // deltaNew = transpose(r) * r
+ float deltaNew = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ deltaNew += _residual[index] * _residual[index];
+
+ // delta0 = deltaNew
+ // float delta0 = deltaNew;
+
+ // While deltaNew > (eps^2) * delta0
+ const float eps = SOLVER_ACCURACY;
+ float maxR = 2.0f * eps;
+ while ((i < _iterations) && (maxR > eps))
+ {
+ // q = Ad
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ // if the cell is a variable
+ float Acenter = 0.0f;
+ if (!skip[index])
+ {
+ // set the matrix to the Poisson stencil in order
+ if (!skip[index + 1]) Acenter += 1.;
+ if (!skip[index - 1]) Acenter += 1.;
+ if (!skip[index + _xRes]) Acenter += 1.;
+ if (!skip[index - _xRes]) Acenter += 1.;
+ if (!skip[index + _slabSize]) Acenter += 1.;
+ if (!skip[index - _slabSize]) Acenter += 1.;
+ }
+
+ _q[index] = Acenter * _direction[index] +
+ _direction[index - 1] * (skip[index - 1] ? 0.0 : -1.0f) +
+ _direction[index + 1] * (skip[index + 1] ? 0.0 : -1.0f) +
+ _direction[index - _xRes] * (skip[index - _xRes] ? 0.0 : -1.0f) +
+ _direction[index + _xRes] * (skip[index + _xRes] ? 0.0 : -1.0f)+
+ _direction[index - _slabSize] * (skip[index - _slabSize] ? 0.0 : -1.0f) +
+ _direction[index + _slabSize] * (skip[index + _slabSize] ? 0.0 : -1.0f);
+ _q[index] = (skip[index]) ? 0.0f : _q[index];
+ }
+
+ // alpha = deltaNew / (transpose(d) * q)
+ float alpha = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ alpha += _direction[index] * _q[index];
+ if (fabs(alpha) > 0.0f)
+ alpha = deltaNew / alpha;
+
+ // x = x + alpha * d
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ field[index] += alpha * _direction[index];
+
+ // r = r - alpha * q
+ maxR = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ _residual[index] -= alpha * _q[index];
+ maxR = (_residual[index] > maxR) ? _residual[index] : maxR;
+ }
+
+ // deltaOld = deltaNew
+ float deltaOld = deltaNew;
+
+ // deltaNew = transpose(r) * r
+ deltaNew = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ deltaNew += _residual[index] * _residual[index];
+
+ // beta = deltaNew / deltaOld
+ float beta = deltaNew / deltaOld;
+
+ // d = r + beta * d
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ _direction[index] = _residual[index] + beta * _direction[index];
+
+ // i = i + 1
+ i++;
+ }
+ // cout << i << " iterations converged to " << maxR << endl;
+}
+#endif
+
+//////////////////////////////////////////////////////////////////////
+// solve the heat equation with CG
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::solveHeat(float* field, float* b, unsigned char* skip)
+{
+ int x, y, z;
+ size_t index;
+ const float heatConst = _dt * _heatDiffusion / (_dx * _dx);
+ float *_q, *_residual, *_direction;
+
+ // i = 0
+ int i = 0;
+
+ _residual = new float[_totalCells]; // set 0
+ _direction = new float[_totalCells]; // set 0
+ _q = new float[_totalCells]; // set 0
+
+ memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes);
+ memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes);
+
+ // r = b - Ax
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ // if the cell is a variable
+ float Acenter = 1.0f;
+ if (!skip[index])
+ {
+ // set the matrix to the Poisson stencil in order
+ if (!skip[index + 1]) Acenter += heatConst;
+ if (!skip[index - 1]) Acenter += heatConst;
+ if (!skip[index + _xRes]) Acenter += heatConst;
+ if (!skip[index - _xRes]) Acenter += heatConst;
+ if (!skip[index + _slabSize]) Acenter += heatConst;
+ if (!skip[index - _slabSize]) Acenter += heatConst;
+ }
+
+ _residual[index] = b[index] - (Acenter * field[index] +
+ field[index - 1] * (skip[index - 1] ? 0.0 : -heatConst) +
+ field[index + 1] * (skip[index + 1] ? 0.0 : -heatConst) +
+ field[index - _xRes] * (skip[index - _xRes] ? 0.0 : -heatConst) +
+ field[index + _xRes] * (skip[index + _xRes] ? 0.0 : -heatConst) +
+ field[index - _slabSize] * (skip[index - _slabSize] ? 0.0 : -heatConst) +
+ field[index + _slabSize] * (skip[index + _slabSize] ? 0.0 : -heatConst));
+ _residual[index] = (skip[index]) ? 0.0f : _residual[index];
+ }
+
+ // d = r
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ _direction[index] = _residual[index];
+
+ // deltaNew = transpose(r) * r
+ float deltaNew = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ deltaNew += _residual[index] * _residual[index];
+
+ // delta0 = deltaNew
+ // float delta0 = deltaNew;
+
+ // While deltaNew > (eps^2) * delta0
+ const float eps = SOLVER_ACCURACY;
+ float maxR = 2.0f * eps;
+ while ((i < _iterations) && (maxR > eps))
+ {
+ // q = Ad
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ // if the cell is a variable
+ float Acenter = 1.0f;
+ if (!skip[index])
+ {
+ // set the matrix to the Poisson stencil in order
+ if (!skip[index + 1]) Acenter += heatConst;
+ if (!skip[index - 1]) Acenter += heatConst;
+ if (!skip[index + _xRes]) Acenter += heatConst;
+ if (!skip[index - _xRes]) Acenter += heatConst;
+ if (!skip[index + _slabSize]) Acenter += heatConst;
+ if (!skip[index - _slabSize]) Acenter += heatConst;
+ }
+
+ _q[index] = (Acenter * _direction[index] +
+ _direction[index - 1] * (skip[index - 1] ? 0.0 : -heatConst) +
+ _direction[index + 1] * (skip[index + 1] ? 0.0 : -heatConst) +
+ _direction[index - _xRes] * (skip[index - _xRes] ? 0.0 : -heatConst) +
+ _direction[index + _xRes] * (skip[index + _xRes] ? 0.0 : -heatConst) +
+ _direction[index - _slabSize] * (skip[index - _slabSize] ? 0.0 : -heatConst) +
+ _direction[index + _slabSize] * (skip[index + _slabSize] ? 0.0 : -heatConst));
+
+ _q[index] = (skip[index]) ? 0.0f : _q[index];
+ }
+
+ // alpha = deltaNew / (transpose(d) * q)
+ float alpha = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ alpha += _direction[index] * _q[index];
+ if (fabs(alpha) > 0.0f)
+ alpha = deltaNew / alpha;
+
+ // x = x + alpha * d
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ field[index] += alpha * _direction[index];
+
+ // r = r - alpha * q
+ maxR = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ {
+ _residual[index] -= alpha * _q[index];
+ maxR = (_residual[index] > maxR) ? _residual[index] : maxR;
+ }
+
+ // deltaOld = deltaNew
+ float deltaOld = deltaNew;
+
+ // deltaNew = transpose(r) * r
+ deltaNew = 0.0f;
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ deltaNew += _residual[index] * _residual[index];
+
+ // beta = deltaNew / deltaOld
+ float beta = deltaNew / deltaOld;
+
+ // d = r + beta * d
+ index = _slabSize + _xRes + 1;
+ for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
+ for (y = 1; y < _yRes - 1; y++, index += 2)
+ for (x = 1; x < _xRes - 1; x++, index++)
+ _direction[index] = _residual[index] + beta * _direction[index];
+
+ // i = i + 1
+ i++;
+ }
+ // cout << i << " iterations converged to " << maxR << endl;
+
+ if (_residual) delete[] _residual;
+ if (_direction) delete[] _direction;
+ if (_q) delete[] _q;
+}
+
diff --git a/intern/smoke/intern/FLUID_3D_STATIC.cpp b/intern/smoke/intern/FLUID_3D_STATIC.cpp
new file mode 100644
index 00000000000..4474129beea
--- /dev/null
+++ b/intern/smoke/intern/FLUID_3D_STATIC.cpp
@@ -0,0 +1,660 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// FLUID_3D.cpp: implementation of the static functions of the FLUID_3D class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include <zlib.h>
+#include "FLUID_3D.h"
+#include "IMAGE.h"
+#include "WTURBULENCE.h"
+#include "INTERPOLATE.h"
+
+//////////////////////////////////////////////////////////////////////
+// add a test cube of density to the center
+//////////////////////////////////////////////////////////////////////
+/*
+void FLUID_3D::addSmokeColumn() {
+ addSmokeTestCase(_density, _res, 1.0);
+ // addSmokeTestCase(_zVelocity, _res, 1.0);
+ addSmokeTestCase(_heat, _res, 1.0);
+ if (_wTurbulence) {
+ addSmokeTestCase(_wTurbulence->getDensityBig(), _wTurbulence->getResBig(), 1.0);
+ }
+}
+*/
+
+//////////////////////////////////////////////////////////////////////
+// generic static version, so that it can be applied to the
+// WTURBULENCE grid as well
+//////////////////////////////////////////////////////////////////////
+/*
+void FLUID_3D::addSmokeTestCase(float* field, Vec3Int res, float value)
+{
+ const int slabSize = res[0]*res[1]; int maxRes = (int)MAX3V(res);
+ float dx = 1.0f / (float)maxRes;
+
+ float xTotal = dx * res[0];
+ float yTotal = dx * res[1];
+ float zTotal = dx * res[2];
+
+ float heighMin = 0.05;
+ float heighMax = 0.10;
+
+ for (int y = 0; y < res[1]; y++)
+ for (int z = (int)(heighMin*res[2]); z <= (int)(heighMax * res[1]); z++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ float xLength = x * dx - xTotal * 0.4f;
+ float yLength = y * dx - zTotal * 0.5f;
+ float radius = sqrtf(xLength * xLength + yLength * yLength);
+
+ if (radius < 0.075f * xTotal)
+ {
+ int index = x + y * res[0] + z * slabSize;
+ field[index] = value;
+ }
+ }
+}
+*/
+
+//////////////////////////////////////////////////////////////////////
+// set x direction to Neumann boundary conditions
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::setNeumannX(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ size_t index;
+ for (int z = 0; z < res[2]; z++)
+ for (int y = 0; y < res[1]; y++)
+ {
+ // left slab
+ index = y * res[0] + z * slabSize;
+ field[index] = field[index + 2];
+
+ // right slab
+ index += res[0] - 1;
+ field[index] = field[index - 2];
+ }
+ }
+
+//////////////////////////////////////////////////////////////////////
+// set y direction to Neumann boundary conditions
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::setNeumannY(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ size_t index;
+ for (int z = 0; z < res[2]; z++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // front slab
+ index = x + z * slabSize;
+ field[index] = field[index + 2 * res[0]];
+
+ // back slab
+ index += slabSize - res[0];
+ field[index] = field[index - 2 * res[0]];
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// set z direction to Neumann boundary conditions
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::setNeumannZ(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ const int totalCells = res[0] * res[1] * res[2];
+ size_t index;
+ for (int y = 0; y < res[1]; y++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // bottom slab
+ index = x + y * res[0];
+ field[index] = field[index + 2 * slabSize];
+
+ // top slab
+ index += totalCells - slabSize;
+ field[index] = field[index - 2 * slabSize];
+ }
+
+ // fix, force top slab to only allow outwards flux
+ for (int y = 0; y < res[1]; y++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // top slab
+ index = x + y * res[0];
+ index += totalCells - slabSize;
+ if(field[index]<0.) field[index] = 0.0f;
+ index -= slabSize;
+ if(field[index]<0.) field[index] = 0.0f;
+ }
+
+}
+
+//////////////////////////////////////////////////////////////////////
+// set x direction to zero
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::setZeroX(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ int index;
+ for (int z = 0; z < res[2]; z++)
+ for (int y = 0; y < res[1]; y++)
+ {
+ // left slab
+ index = y * res[0] + z * slabSize;
+ field[index] = 0.0f;
+
+ // right slab
+ index += res[0] - 1;
+ field[index] = 0.0f;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// set y direction to zero
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::setZeroY(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ int index;
+ for (int z = 0; z < res[2]; z++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // bottom slab
+ index = x + z * slabSize;
+ field[index] = 0.0f;
+
+ // top slab
+ index += slabSize - res[0];
+ field[index] = 0.0f;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// set z direction to zero
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::setZeroZ(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ const int totalCells = res[0] * res[1] * res[2];
+ int index;
+ for (int y = 0; y < res[1]; y++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // front slab
+ index = x + y * res[0];
+ field[index] = 0.0f;
+
+ // back slab
+ index += totalCells - slabSize;
+ field[index] = 0.0f;
+ }
+ }
+
+//////////////////////////////////////////////////////////////////////
+// copy grid boundary
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::copyBorderX(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ int index;
+ for (int z = 0; z < res[2]; z++)
+ for (int y = 0; y < res[1]; y++)
+ {
+ // left slab
+ index = y * res[0] + z * slabSize;
+ field[index] = field[index + 1];
+
+ // right slab
+ index += res[0] - 1;
+ field[index] = field[index - 1];
+ }
+}
+void FLUID_3D::copyBorderY(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ int index;
+ for (int z = 0; z < res[2]; z++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // bottom slab
+ index = x + z * slabSize;
+ field[index] = field[index + res[0]];
+ // top slab
+ index += slabSize - res[0];
+ field[index] = field[index - res[0]];
+ }
+}
+void FLUID_3D::copyBorderZ(float* field, Vec3Int res)
+{
+ const int slabSize = res[0] * res[1];
+ const int totalCells = res[0] * res[1] * res[2];
+ int index;
+ for (int y = 0; y < res[1]; y++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // front slab
+ index = x + y * res[0];
+ field[index] = field[index + slabSize];
+ // back slab
+ index += totalCells - slabSize;
+ field[index] = field[index - slabSize];
+ }
+}
+
+/////////////////////////////////////////////////////////////////////
+// advect field with the semi lagrangian method
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::advectFieldSemiLagrange(const float dt, const float* velx, const float* vely, const float* velz,
+ float* oldField, float* newField, Vec3Int res)
+{
+ const int xres = res[0];
+ const int yres = res[1];
+ const int zres = res[2];
+ const int slabSize = res[0] * res[1];
+
+ // scale dt up to grid resolution
+#if PARALLEL==1
+#pragma omp parallel for schedule(static)
+#endif
+ for (int z = 0; z < zres; z++)
+ for (int y = 0; y < yres; y++)
+ for (int x = 0; x < xres; x++)
+ {
+ const int index = x + y * xres + z * xres*yres;
+
+ // backtrace
+ float xTrace = x - dt * velx[index];
+ float yTrace = y - dt * vely[index];
+ float zTrace = z - dt * velz[index];
+
+ // clamp backtrace to grid boundaries
+ if (xTrace < 0.5) xTrace = 0.5;
+ if (xTrace > xres - 1.5) xTrace = xres - 1.5;
+ if (yTrace < 0.5) yTrace = 0.5;
+ if (yTrace > yres - 1.5) yTrace = yres - 1.5;
+ if (zTrace < 0.5) zTrace = 0.5;
+ if (zTrace > zres - 1.5) zTrace = zres - 1.5;
+
+ // locate neighbors to interpolate
+ const int x0 = (int)xTrace;
+ const int x1 = x0 + 1;
+ const int y0 = (int)yTrace;
+ const int y1 = y0 + 1;
+ const int z0 = (int)zTrace;
+ const int z1 = z0 + 1;
+
+ // get interpolation weights
+ const float s1 = xTrace - x0;
+ const float s0 = 1.0f - s1;
+ const float t1 = yTrace - y0;
+ const float t0 = 1.0f - t1;
+ const float u1 = zTrace - z0;
+ const float u0 = 1.0f - u1;
+
+ const int i000 = x0 + y0 * xres + z0 * slabSize;
+ const int i010 = x0 + y1 * xres + z0 * slabSize;
+ const int i100 = x1 + y0 * xres + z0 * slabSize;
+ const int i110 = x1 + y1 * xres + z0 * slabSize;
+ const int i001 = x0 + y0 * xres + z1 * slabSize;
+ const int i011 = x0 + y1 * xres + z1 * slabSize;
+ const int i101 = x1 + y0 * xres + z1 * slabSize;
+ const int i111 = x1 + y1 * xres + z1 * slabSize;
+
+ // interpolate
+ // (indices could be computed once)
+ newField[index] = u0 * (s0 * (t0 * oldField[i000] +
+ t1 * oldField[i010]) +
+ s1 * (t0 * oldField[i100] +
+ t1 * oldField[i110])) +
+ u1 * (s0 * (t0 * oldField[i001] +
+ t1 * oldField[i011]) +
+ s1 * (t0 * oldField[i101] +
+ t1 * oldField[i111]));
+ }
+}
+
+/////////////////////////////////////////////////////////////////////
+// advect field with the maccormack method
+//
+// comments are the pseudocode from selle's paper
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::advectFieldMacCormack(const float dt, const float* xVelocity, const float* yVelocity, const float* zVelocity,
+ float* oldField, float* newField, float* temp1, float* temp2, Vec3Int res, const unsigned char* obstacles)
+{
+ float* phiHatN = temp1;
+ float* phiHatN1 = temp2;
+ const int sx= res[0];
+ const int sy= res[1];
+ const int sz= res[2];
+
+ for (int x = 0; x < sx * sy * sz; x++)
+ phiHatN[x] = phiHatN1[x] = oldField[x];
+
+ float*& phiN = oldField;
+ float*& phiN1 = newField;
+
+ // phiHatN1 = A(phiN)
+ advectFieldSemiLagrange( dt, xVelocity, yVelocity, zVelocity, phiN, phiHatN1, res);
+
+ // phiHatN = A^R(phiHatN1)
+ advectFieldSemiLagrange( -1.0*dt, xVelocity, yVelocity, zVelocity, phiHatN1, phiHatN, res);
+
+ // phiN1 = phiHatN1 + (phiN - phiHatN) / 2
+ const int border = 0;
+ for (int z = border; z < sz-border; z++)
+ for (int y = border; y < sy-border; y++)
+ for (int x = border; x < sx-border; x++) {
+ int index = x + y * sx + z * sx*sy;
+ phiN1[index] = phiHatN1[index] + (phiN[index] - phiHatN[index]) * 0.50f;
+ //phiN1[index] = phiHatN1[index]; // debug, correction off
+ }
+ copyBorderX(phiN1, res);
+ copyBorderY(phiN1, res);
+ copyBorderZ(phiN1, res);
+
+ // clamp any newly created extrema
+ clampExtrema(dt, xVelocity, yVelocity, zVelocity, oldField, newField, res);
+
+ // if the error estimate was bad, revert to first order
+ clampOutsideRays(dt, xVelocity, yVelocity, zVelocity, oldField, newField, res, obstacles, phiHatN1);
+}
+
+
+//////////////////////////////////////////////////////////////////////
+// Clamp the extrema generated by the BFECC error correction
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::clampExtrema(const float dt, const float* velx, const float* vely, const float* velz,
+ float* oldField, float* newField, Vec3Int res)
+{
+ const int xres= res[0];
+ const int yres= res[1];
+ const int zres= res[2];
+ const int slabSize = res[0] * res[1];
+ for (int z = 1; z < zres-1; z++)
+ for (int y = 1; y < yres-1; y++)
+ for (int x = 1; x < xres-1; x++)
+ {
+ const int index = x + y * xres+ z * xres*yres;
+ // backtrace
+ float xTrace = x - dt * velx[index];
+ float yTrace = y - dt * vely[index];
+ float zTrace = z - dt * velz[index];
+
+ // clamp backtrace to grid boundaries
+ if (xTrace < 0.5) xTrace = 0.5;
+ if (xTrace > xres - 1.5) xTrace = xres - 1.5;
+ if (yTrace < 0.5) yTrace = 0.5;
+ if (yTrace > yres - 1.5) yTrace = yres - 1.5;
+ if (zTrace < 0.5) zTrace = 0.5;
+ if (zTrace > zres - 1.5) zTrace = zres - 1.5;
+
+ // locate neighbors to interpolate
+ const int x0 = (int)xTrace;
+ const int x1 = x0 + 1;
+ const int y0 = (int)yTrace;
+ const int y1 = y0 + 1;
+ const int z0 = (int)zTrace;
+ const int z1 = z0 + 1;
+
+ const int i000 = x0 + y0 * xres + z0 * slabSize;
+ const int i010 = x0 + y1 * xres + z0 * slabSize;
+ const int i100 = x1 + y0 * xres + z0 * slabSize;
+ const int i110 = x1 + y1 * xres + z0 * slabSize;
+ const int i001 = x0 + y0 * xres + z1 * slabSize;
+ const int i011 = x0 + y1 * xres + z1 * slabSize;
+ const int i101 = x1 + y0 * xres + z1 * slabSize;
+ const int i111 = x1 + y1 * xres + z1 * slabSize;
+
+ float minField = oldField[i000];
+ float maxField = oldField[i000];
+
+ minField = (oldField[i010] < minField) ? oldField[i010] : minField;
+ maxField = (oldField[i010] > maxField) ? oldField[i010] : maxField;
+
+ minField = (oldField[i100] < minField) ? oldField[i100] : minField;
+ maxField = (oldField[i100] > maxField) ? oldField[i100] : maxField;
+
+ minField = (oldField[i110] < minField) ? oldField[i110] : minField;
+ maxField = (oldField[i110] > maxField) ? oldField[i110] : maxField;
+
+ minField = (oldField[i001] < minField) ? oldField[i001] : minField;
+ maxField = (oldField[i001] > maxField) ? oldField[i001] : maxField;
+
+ minField = (oldField[i011] < minField) ? oldField[i011] : minField;
+ maxField = (oldField[i011] > maxField) ? oldField[i011] : maxField;
+
+ minField = (oldField[i101] < minField) ? oldField[i101] : minField;
+ maxField = (oldField[i101] > maxField) ? oldField[i101] : maxField;
+
+ minField = (oldField[i111] < minField) ? oldField[i111] : minField;
+ maxField = (oldField[i111] > maxField) ? oldField[i111] : maxField;
+
+ newField[index] = (newField[index] > maxField) ? maxField : newField[index];
+ newField[index] = (newField[index] < minField) ? minField : newField[index];
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// Reverts any backtraces that go into boundaries back to first
+// order -- in this case the error correction term was totally
+// incorrect
+//////////////////////////////////////////////////////////////////////
+void FLUID_3D::clampOutsideRays(const float dt, const float* velx, const float* vely, const float* velz,
+ float* oldField, float* newField, Vec3Int res, const unsigned char* obstacles, const float *oldAdvection)
+{
+ const int sx= res[0];
+ const int sy= res[1];
+ const int sz= res[2];
+ const int slabSize = res[0] * res[1];
+ for (int z = 1; z < sz-1; z++)
+ for (int y = 1; y < sy-1; y++)
+ for (int x = 1; x < sx-1; x++)
+ {
+ const int index = x + y * sx+ z * slabSize;
+ // backtrace
+ float xBackward = x + dt * velx[index];
+ float yBackward = y + dt * vely[index];
+ float zBackward = z + dt * velz[index];
+ float xTrace = x - dt * velx[index];
+ float yTrace = y - dt * vely[index];
+ float zTrace = z - dt * velz[index];
+
+ // see if it goes outside the boundaries
+ bool hasObstacle =
+ (zTrace < 1.0f) || (zTrace > sz - 2.0f) ||
+ (yTrace < 1.0f) || (yTrace > sy - 2.0f) ||
+ (xTrace < 1.0f) || (xTrace > sx - 2.0f) ||
+ (zBackward < 1.0f) || (zBackward > sz - 2.0f) ||
+ (yBackward < 1.0f) || (yBackward > sy - 2.0f) ||
+ (xBackward < 1.0f) || (xBackward > sx - 2.0f);
+ // reuse old advection instead of doing another one...
+ if(hasObstacle) { newField[index] = oldAdvection[index]; continue; }
+
+ // clamp to prevent an out of bounds access when looking into
+ // the _obstacles array
+ zTrace = (zTrace < 0.5f) ? 0.5f : zTrace;
+ zTrace = (zTrace > sz - 1.5f) ? sz - 1.5f : zTrace;
+ yTrace = (yTrace < 0.5f) ? 0.5f : yTrace;
+ yTrace = (yTrace > sy - 1.5f) ? sy - 1.5f : yTrace;
+ xTrace = (xTrace < 0.5f) ? 0.5f : xTrace;
+ xTrace = (xTrace > sx - 1.5f) ? sx - 1.5f : xTrace;
+
+ // locate neighbors to interpolate,
+ // do backward first since we will use the forward indices if a
+ // reversion is actually necessary
+ zBackward = (zBackward < 0.5f) ? 0.5f : zBackward;
+ zBackward = (zBackward > sz - 1.5f) ? sz - 1.5f : zBackward;
+ yBackward = (yBackward < 0.5f) ? 0.5f : yBackward;
+ yBackward = (yBackward > sy - 1.5f) ? sy - 1.5f : yBackward;
+ xBackward = (xBackward < 0.5f) ? 0.5f : xBackward;
+ xBackward = (xBackward > sx - 1.5f) ? sx - 1.5f : xBackward;
+
+ int x0 = (int)xBackward;
+ int x1 = x0 + 1;
+ int y0 = (int)yBackward;
+ int y1 = y0 + 1;
+ int z0 = (int)zBackward;
+ int z1 = z0 + 1;
+ if(obstacles && !hasObstacle) {
+ hasObstacle = hasObstacle ||
+ obstacles[x0 + y0 * sx + z0*slabSize] ||
+ obstacles[x0 + y1 * sx + z0*slabSize] ||
+ obstacles[x1 + y0 * sx + z0*slabSize] ||
+ obstacles[x1 + y1 * sx + z0*slabSize] ||
+ obstacles[x0 + y0 * sx + z1*slabSize] ||
+ obstacles[x0 + y1 * sx + z1*slabSize] ||
+ obstacles[x1 + y0 * sx + z1*slabSize] ||
+ obstacles[x1 + y1 * sx + z1*slabSize] ;
+ }
+ // reuse old advection instead of doing another one...
+ if(hasObstacle) { newField[index] = oldAdvection[index]; continue; }
+
+ x0 = (int)xTrace;
+ x1 = x0 + 1;
+ y0 = (int)yTrace;
+ y1 = y0 + 1;
+ z0 = (int)zTrace;
+ z1 = z0 + 1;
+ if(obstacles && !hasObstacle) {
+ hasObstacle = hasObstacle ||
+ obstacles[x0 + y0 * sx + z0*slabSize] ||
+ obstacles[x0 + y1 * sx + z0*slabSize] ||
+ obstacles[x1 + y0 * sx + z0*slabSize] ||
+ obstacles[x1 + y1 * sx + z0*slabSize] ||
+ obstacles[x0 + y0 * sx + z1*slabSize] ||
+ obstacles[x0 + y1 * sx + z1*slabSize] ||
+ obstacles[x1 + y0 * sx + z1*slabSize] ||
+ obstacles[x1 + y1 * sx + z1*slabSize] ;
+ } // obstacle array
+ // reuse old advection instead of doing another one...
+ if(hasObstacle) { newField[index] = oldAdvection[index]; continue; }
+
+ // see if either the forward or backward ray went into
+ // a boundary
+ if (hasObstacle) {
+ // get interpolation weights
+ float s1 = xTrace - x0;
+ float s0 = 1.0f - s1;
+ float t1 = yTrace - y0;
+ float t0 = 1.0f - t1;
+ float u1 = zTrace - z0;
+ float u0 = 1.0f - u1;
+
+ const int i000 = x0 + y0 * sx + z0 * slabSize;
+ const int i010 = x0 + y1 * sx + z0 * slabSize;
+ const int i100 = x1 + y0 * sx + z0 * slabSize;
+ const int i110 = x1 + y1 * sx + z0 * slabSize;
+ const int i001 = x0 + y0 * sx + z1 * slabSize;
+ const int i011 = x0 + y1 * sx + z1 * slabSize;
+ const int i101 = x1 + y0 * sx + z1 * slabSize;
+ const int i111 = x1 + y1 * sx + z1 * slabSize;
+
+ // interpolate, (indices could be computed once)
+ newField[index] = u0 * (s0 * (
+ t0 * oldField[i000] +
+ t1 * oldField[i010]) +
+ s1 * (t0 * oldField[i100] +
+ t1 * oldField[i110])) +
+ u1 * (s0 * (t0 * oldField[i001] +
+ t1 * oldField[i011]) +
+ s1 * (t0 * oldField[i101] +
+ t1 * oldField[i111]));
+ }
+ } // xyz
+}
+
+//////////////////////////////////////////////////////////////////////
+// image output
+//////////////////////////////////////////////////////////////////////
+/*
+void FLUID_3D::writeImageSliceXY(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale) {
+ writeProjectedIntern(field, res, 0,1, prefix, picCnt, scale);
+}
+void FLUID_3D::writeImageSliceYZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale) {
+ writeProjectedIntern(field, res, 1,2, prefix, picCnt, scale);
+}
+void FLUID_3D::writeImageSliceXZ(const float *field, Vec3Int res, int slice, string prefix, int picCnt, float scale) {
+ writeProjectedIntern(field, res, 0,2, prefix, picCnt, scale);
+}
+*/
+
+//////////////////////////////////////////////////////////////////////
+// Helper function for projecting densities along a dimension
+//////////////////////////////////////////////////////////////////////
+/*
+static int getOtherDir(int dir1, int dir2) {
+ switch(dir1) {
+ case 0:
+ switch(dir2) {
+ case 1: return 2;
+ case 2: return 1; }
+ break;
+ case 1:
+ switch(dir2) {
+ case 0: return 2;
+ case 2: return 0; }
+ break;
+ case 2:
+ switch(dir2) {
+ case 0: return 1;
+ case 1: return 0; }
+ break;
+ default:
+ return 0;
+ }
+ return 0;
+}
+*/
+
+//////////////////////////////////////////////////////////////////////
+// average densities along third spatial direction
+//////////////////////////////////////////////////////////////////////
+/*
+void FLUID_3D::writeProjectedIntern(const float *field, Vec3Int res,
+ int dir1, int dir2, string prefix, int picCnt, float scale) {
+ const int nitems = res[dir1]*res[dir2];
+ const int otherDir = getOtherDir(dir1,dir2);
+ float *buf = new float[nitems];
+ Vec3Int min = Vec3Int(0);
+ Vec3Int max = res;
+
+ min[otherDir] = 0;
+ max[otherDir] = res[otherDir];
+ float div = 1./(float)MIN3V(res); // normalize for shorter sides, old: res[otherDir];
+ div *= 4.; //slightly increase contrast
+ for(int i=0; i<nitems; i++) buf[i] = 0.;
+
+ Vec3Int cnt = 0;
+ for (cnt[2] = min[2]; cnt[2] < max[2]; cnt[2]++) {
+ for (cnt[1] = min[1]; cnt[1] < max[1]; cnt[1]++)
+ for (cnt[0] = min[0]; cnt[0] < max[0]; cnt[0]++)
+ {
+ const int index = cnt[0] + cnt[1] * res[0] + cnt[2] * res[0]*res[1];
+ const int bufindex = cnt[dir1] + cnt[dir2] * res[dir1];
+ buf[bufindex] += field[index] * scale *div;
+ }
+ }
+ // IMAGE::dumpNumberedPNG(picCnt, prefix, buf, res[dir1], res[dir2]);
+ delete[] buf;
+}
+*/
+
diff --git a/intern/smoke/intern/IMAGE.h b/intern/smoke/intern/IMAGE.h
new file mode 100644
index 00000000000..a57f164509e
--- /dev/null
+++ b/intern/smoke/intern/IMAGE.h
@@ -0,0 +1,277 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+//////////////////////////////////////////////////////////////////////
+//
+#ifndef IMAGE_H
+#define IMAGE_H
+
+#include <stdlib.h>
+#include <string>
+#include <fstream>
+#include <sstream>
+#include <zlib.h>
+
+//////////////////////////////////////////////////////////////////////
+// NT helper functions
+//////////////////////////////////////////////////////////////////////
+template < class T > inline T ABS( T a ) {
+ return (0 < a) ? a : -a ;
+}
+
+template < class T > inline void SWAP_POINTERS( T &a, T &b ) {
+ T temp = a;
+ a = b;
+ b = temp;
+}
+
+template < class T > inline void CLAMP( T &a, T b=0., T c=1.) {
+ if(a<b) { a=b; return; }
+ if(a>c) { a=c; return; }
+}
+
+template < class T > inline T MIN( T a, T b) {
+ return (a < b) ? a : b;
+}
+
+template < class T > inline T MAX( T a, T b) {
+ return (a > b) ? a : b;
+}
+
+template < class T > inline T MAX3( T a, T b, T c) {
+ T max = (a > b) ? a : b;
+ max = (max > c) ? max : c;
+ return max;
+}
+
+template < class T > inline float MAX3V( T vec) {
+ float max = (vec[0] > vec[1]) ? vec[0] : vec[1];
+ max = (max > vec[2]) ? max : vec[2];
+ return max;
+}
+
+template < class T > inline float MIN3V( T vec) {
+ float min = (vec[0] < vec[1]) ? vec[0] : vec[1];
+ min = (min < vec[2]) ? min : vec[2];
+ return min;
+}
+
+//////////////////////////////////////////////////////////////////////
+// PNG, POV-Ray, and PBRT output functions
+//////////////////////////////////////////////////////////////////////
+#include <png.h>
+
+namespace IMAGE {
+ /*
+ static int writePng(const char *fileName, unsigned char **rowsp, int w, int h)
+ {
+ // defaults
+ const int colortype = PNG_COLOR_TYPE_RGBA;
+ const int bitdepth = 8;
+ png_structp png_ptr = NULL;
+ png_infop info_ptr = NULL;
+ png_bytep *rows = rowsp;
+
+ FILE *fp = NULL;
+ std::string doing = "open for writing";
+ if (!(fp = fopen(fileName, "wb"))) goto fail;
+
+ if(!png_ptr) {
+ doing = "create png write struct";
+ if (!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL))) goto fail;
+ }
+ if(!info_ptr) {
+ doing = "create png info struct";
+ if (!(info_ptr = png_create_info_struct(png_ptr))) goto fail;
+ }
+
+ if (setjmp(png_jmpbuf(png_ptr))) goto fail;
+ doing = "init IO";
+ png_init_io(png_ptr, fp);
+ doing = "write header";
+ png_set_IHDR(png_ptr, info_ptr, w, h, bitdepth, colortype, PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+ doing = "write info";
+ png_write_info(png_ptr, info_ptr);
+ doing = "write image";
+ png_write_image(png_ptr, rows);
+ doing = "write end";
+ png_write_end(png_ptr, NULL);
+ doing = "write destroy structs";
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+
+ fclose( fp );
+ return 0;
+
+ fail:
+ std::cerr << "writePng: could not "<<doing<<" !\n";
+ if(fp) fclose( fp );
+ if(png_ptr || info_ptr) png_destroy_write_struct(&png_ptr, &info_ptr);
+ return -1;
+ }
+ */
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // write a numbered PNG file out, padded with zeros up to three zeros
+ /////////////////////////////////////////////////////////////////////////////////
+ /*
+ static void dumpNumberedPNG(int counter, std::string prefix, float* field, int xRes, int yRes)
+ {
+ char buffer[256];
+ sprintf(buffer,"%04i", counter);
+ std::string number = std::string(buffer);
+
+ unsigned char pngbuf[xRes*yRes*4];
+ unsigned char *rows[yRes];
+ float *pfield = field;
+ for (int j=0; j<yRes; j++) {
+ for (int i=0; i<xRes; i++) {
+ float val = *pfield;
+ if(val>1.) val=1.;
+ if(val<0.) val=0.;
+ pngbuf[(j*xRes+i)*4+0] = (unsigned char)(val*255.);
+ pngbuf[(j*xRes+i)*4+1] = (unsigned char)(val*255.);
+ pngbuf[(j*xRes+i)*4+2] = (unsigned char)(val*255.);
+ pfield++;
+ pngbuf[(j*xRes+i)*4+3] = 255;
+ }
+ rows[j] = &pngbuf[(yRes-j-1)*xRes*4];
+ }
+ std::string filenamePNG = prefix + number + std::string(".png");
+ writePng(filenamePNG.c_str(), rows, xRes, yRes, false);
+ printf("Writing %s\n", filenamePNG.c_str());
+
+ }
+*/
+ /////////////////////////////////////////////////////////////////////////////////
+ // export pbrt volumegrid geometry object
+ /////////////////////////////////////////////////////////////////////////////////
+ /*
+ static void dumpPBRT(int counter, std::string prefix, float* fieldOrg, int xRes, int yRes, int zRes)
+ {
+ char buffer[256];
+ sprintf(buffer,"%04i", counter);
+ std::string number = std::string(buffer);
+
+ std::string filenamePbrt = prefix + number + std::string(".pbrt.gz");
+ printf("Writing PBRT %s\n", filenamePbrt.c_str());
+
+ float *field = new float[xRes*yRes*zRes];
+ // normalize values
+ float maxDensVal = ABS(fieldOrg[0]);
+ float targetNorm = 0.5;
+ for (int i = 0; i < xRes * yRes * zRes; i++) {
+ if(ABS(fieldOrg[i])>maxDensVal) maxDensVal = ABS(fieldOrg[i]);
+ field[i] = 0.;
+ }
+ if(maxDensVal>0.) {
+ for (int i = 0; i < xRes * yRes * zRes; i++) {
+ field[i] = ABS(fieldOrg[i]) / maxDensVal * targetNorm;
+ }
+ }
+
+ std::fstream fout;
+ fout.open(filenamePbrt.c_str(), std::ios::out);
+
+ int maxRes = (xRes > yRes) ? xRes : yRes;
+ maxRes = (maxRes > zRes) ? maxRes : zRes;
+
+ const float xSize = 1.0 / (float)maxRes * (float)xRes;
+ const float ySize = 1.0 / (float)maxRes * (float)yRes;
+ const float zSize = 1.0 / (float)maxRes * (float)zRes;
+
+ gzFile file;
+ file = gzopen(filenamePbrt.c_str(), "wb1");
+ if (file == NULL) {
+ std::cerr << " Couldn't write file " << filenamePbrt << "!!!" << std::endl;
+ return;
+ }
+
+ // dimensions
+ gzprintf(file, "Volume \"volumegrid\" \n");
+ gzprintf(file, " \"integer nx\" %i\n", xRes);
+ gzprintf(file, " \"integer ny\" %i\n", yRes);
+ gzprintf(file, " \"integer nz\" %i\n", zRes);
+ gzprintf(file, " \"point p0\" [ 0.0 0.0 0.0 ] \"point p1\" [%f %f %f ] \n", xSize, ySize, zSize);
+ gzprintf(file, " \"float density\" [ \n");
+ for (int i = 0; i < xRes * yRes * zRes; i++)
+ gzprintf(file, "%f ", field[i]);
+ gzprintf(file, "] \n \n");
+
+ gzclose(file);
+ delete[] field;
+ }
+ */
+
+ /////////////////////////////////////////////////////////////////////////////////
+ // 3D df3 export
+ /////////////////////////////////////////////////////////////////////////////////
+/*
+ static void dumpDF3(int counter, std::string prefix, float* fieldOrg, int xRes, int yRes, int zRes)
+ {
+ char buffer[256];
+
+ // do deferred copying to final directory, better for network directories
+ sprintf(buffer,"%04i", counter);
+ std::string number = std::string(buffer);
+ std::string filenameDf3 = prefix + number + std::string(".df3.gz");
+ printf("Writing DF3 %s\n", filenameDf3.c_str());
+
+ gzFile file;
+ file = gzopen(filenameDf3.c_str(), "wb1");
+ if (file == NULL) {
+ std::cerr << " Couldn't write file " << filenameDf3 << "!!!" << std::endl;
+ return;
+ }
+
+ // dimensions
+ const int byteSize = 2;
+ const unsigned short int onx=xRes,ony=yRes,onz=zRes;
+ unsigned short int nx,ny,nz;
+ nx = onx >> 8;
+ ny = ony >> 8;
+ nz = onz >> 8;
+ nx += (onx << 8);
+ ny += (ony << 8);
+ nz += (onz << 8);
+ gzwrite(file, (void*)&nx, sizeof(short));
+ gzwrite(file, (void*)&ny, sizeof(short));
+ gzwrite(file, (void*)&nz, sizeof(short));
+ const int nitems = onx*ony*onz;
+ const float mul = (float)( (1<<(8*byteSize))-1);
+
+ unsigned short int *buf = new unsigned short int[nitems];
+ for (int k = 0; k < onz; k++)
+ for (int j = 0; j < ony; j++)
+ for (int i = 0; i < onx; i++) {
+ float val = fieldOrg[k*(onx*ony)+j*onx+i] ;
+ CLAMP(val);
+ buf[k*(onx*ony)+j*onx+i] = (short int)(val*mul);
+ }
+ gzwrite(file, (void*)buf, sizeof(unsigned short int)* nitems);
+
+ gzclose(file);
+ delete[] buf;
+ }
+ */
+
+};
+
+
+#endif
+
diff --git a/intern/smoke/intern/INTERPOLATE.h b/intern/smoke/intern/INTERPOLATE.h
new file mode 100644
index 00000000000..6800c3b84b0
--- /dev/null
+++ b/intern/smoke/intern/INTERPOLATE.h
@@ -0,0 +1,227 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+//////////////////////////////////////////////////////////////////////
+#ifndef INTERPOLATE_H
+#define INTERPOLATE_H
+
+#include <iostream>
+#include <VEC3.h>
+
+namespace INTERPOLATE {
+
+//////////////////////////////////////////////////////////////////////
+// linear interpolators
+//////////////////////////////////////////////////////////////////////
+static inline float lerp(float t, float a, float b) {
+ return ( a + t * (b - a) );
+}
+
+static inline float lerp(float* field, float x, float y, int res) {
+ // clamp backtrace to grid boundaries
+ if (x < 0.5f) x = 0.5f;
+ if (x > res - 1.5f) x = res - 1.5f;
+ if (y < 0.5f) y = 0.5f;
+ if (y > res - 1.5f) y = res - 1.5f;
+
+ const int x0 = (int)x;
+ const int y0 = (int)y;
+ x -= x0;
+ y -= y0;
+ float d00, d10, d01, d11;
+
+ // lerp the velocities
+ d00 = field[x0 + y0 * res];
+ d10 = field[(x0 + 1) + y0 * res];
+ d01 = field[x0 + (y0 + 1) * res];
+ d11 = field[(x0 + 1) + (y0 + 1) * res];
+ return lerp(y, lerp(x, d00, d10),
+ lerp(x, d01, d11));
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// 3d linear interpolation
+//////////////////////////////////////////////////////////////////////////////////////////
+static inline float lerp3d(float* field, float x, float y, float z, int xres, int yres, int zres) {
+ // clamp pos to grid boundaries
+ if (x < 0.5) x = 0.5;
+ if (x > xres - 1.5) x = xres - 1.5;
+ if (y < 0.5) y = 0.5;
+ if (y > yres - 1.5) y = yres - 1.5;
+ if (z < 0.5) z = 0.5;
+ if (z > zres - 1.5) z = zres - 1.5;
+
+ // locate neighbors to interpolate
+ const int x0 = (int)x;
+ const int x1 = x0 + 1;
+ const int y0 = (int)y;
+ const int y1 = y0 + 1;
+ const int z0 = (int)z;
+ const int z1 = z0 + 1;
+
+ // get interpolation weights
+ const float s1 = x - (float)x0;
+ const float s0 = 1.0f - s1;
+ const float t1 = y - (float)y0;
+ const float t0 = 1.0f - t1;
+ const float u1 = z - (float)z0;
+ const float u0 = 1.0f - u1;
+
+ const int slabSize = xres*yres;
+ const int i000 = x0 + y0 * xres + z0 * slabSize;
+ const int i010 = x0 + y1 * xres + z0 * slabSize;
+ const int i100 = x1 + y0 * xres + z0 * slabSize;
+ const int i110 = x1 + y1 * xres + z0 * slabSize;
+ const int i001 = x0 + y0 * xres + z1 * slabSize;
+ const int i011 = x0 + y1 * xres + z1 * slabSize;
+ const int i101 = x1 + y0 * xres + z1 * slabSize;
+ const int i111 = x1 + y1 * xres + z1 * slabSize;
+
+ // interpolate (indices could be computed once)
+ return ( u0 * (s0 * (t0 * field[i000] +
+ t1 * field[i010]) +
+ s1 * (t0 * field[i100] +
+ t1 * field[i110])) +
+ u1 * (s0 * (t0 * field[i001] +
+ t1 * field[i011]) +
+ s1 * (t0 * field[i101] +
+ t1 * field[i111])) );
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// convert field entries of type T to floats, then interpolate
+//////////////////////////////////////////////////////////////////////////////////////////
+template <class T>
+static inline float lerp3dToFloat(T* field1,
+ float x, float y, float z, int xres, int yres, int zres) {
+ // clamp pos to grid boundaries
+ if (x < 0.5) x = 0.5;
+ if (x > xres - 1.5) x = xres - 1.5;
+ if (y < 0.5) y = 0.5;
+ if (y > yres - 1.5) y = yres - 1.5;
+ if (z < 0.5) z = 0.5;
+ if (z > zres - 1.5) z = zres - 1.5;
+
+ // locate neighbors to interpolate
+ const int x0 = (int)x;
+ const int x1 = x0 + 1;
+ const int y0 = (int)y;
+ const int y1 = y0 + 1;
+ const int z0 = (int)z;
+ const int z1 = z0 + 1;
+
+ // get interpolation weights
+ const float s1 = x - (float)x0;
+ const float s0 = 1.0f - s1;
+ const float t1 = y - (float)y0;
+ const float t0 = 1.0f - t1;
+ const float u1 = z - (float)z0;
+ const float u0 = 1.0f - u1;
+
+ const int slabSize = xres*yres;
+ const int i000 = x0 + y0 * xres + z0 * slabSize;
+ const int i010 = x0 + y1 * xres + z0 * slabSize;
+ const int i100 = x1 + y0 * xres + z0 * slabSize;
+ const int i110 = x1 + y1 * xres + z0 * slabSize;
+ const int i001 = x0 + y0 * xres + z1 * slabSize;
+ const int i011 = x0 + y1 * xres + z1 * slabSize;
+ const int i101 = x1 + y0 * xres + z1 * slabSize;
+ const int i111 = x1 + y1 * xres + z1 * slabSize;
+
+ // interpolate (indices could be computed once)
+ return (float)(
+ ( u0 * (s0 * (t0 * (float)field1[i000] +
+ t1 * (float)field1[i010]) +
+ s1 * (t0 * (float)field1[i100] +
+ t1 * (float)field1[i110])) +
+ u1 * (s0 * (t0 * (float)field1[i001] +
+ t1 * (float)field1[i011]) +
+ s1 * (t0 * (float)field1[i101] +
+ t1 * (float)field1[i111])) ) );
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// interpolate a vector from 3 fields
+//////////////////////////////////////////////////////////////////////////////////////////
+static inline Vec3 lerp3dVec(float* field1, float* field2, float* field3,
+ float x, float y, float z, int xres, int yres, int zres) {
+ // clamp pos to grid boundaries
+ if (x < 0.5) x = 0.5;
+ if (x > xres - 1.5) x = xres - 1.5;
+ if (y < 0.5) y = 0.5;
+ if (y > yres - 1.5) y = yres - 1.5;
+ if (z < 0.5) z = 0.5;
+ if (z > zres - 1.5) z = zres - 1.5;
+
+ // locate neighbors to interpolate
+ const int x0 = (int)x;
+ const int x1 = x0 + 1;
+ const int y0 = (int)y;
+ const int y1 = y0 + 1;
+ const int z0 = (int)z;
+ const int z1 = z0 + 1;
+
+ // get interpolation weights
+ const float s1 = x - (float)x0;
+ const float s0 = 1.0f - s1;
+ const float t1 = y - (float)y0;
+ const float t0 = 1.0f - t1;
+ const float u1 = z - (float)z0;
+ const float u0 = 1.0f - u1;
+
+ const int slabSize = xres*yres;
+ const int i000 = x0 + y0 * xres + z0 * slabSize;
+ const int i010 = x0 + y1 * xres + z0 * slabSize;
+ const int i100 = x1 + y0 * xres + z0 * slabSize;
+ const int i110 = x1 + y1 * xres + z0 * slabSize;
+ const int i001 = x0 + y0 * xres + z1 * slabSize;
+ const int i011 = x0 + y1 * xres + z1 * slabSize;
+ const int i101 = x1 + y0 * xres + z1 * slabSize;
+ const int i111 = x1 + y1 * xres + z1 * slabSize;
+
+ // interpolate (indices could be computed once)
+ return Vec3(
+ ( u0 * (s0 * (t0 * field1[i000] +
+ t1 * field1[i010]) +
+ s1 * (t0 * field1[i100] +
+ t1 * field1[i110])) +
+ u1 * (s0 * (t0 * field1[i001] +
+ t1 * field1[i011]) +
+ s1 * (t0 * field1[i101] +
+ t1 * field1[i111])) ) ,
+ ( u0 * (s0 * (t0 * field2[i000] +
+ t1 * field2[i010]) +
+ s1 * (t0 * field2[i100] +
+ t1 * field2[i110])) +
+ u1 * (s0 * (t0 * field2[i001] +
+ t1 * field2[i011]) +
+ s1 * (t0 * field2[i101] +
+ t1 * field2[i111])) ) ,
+ ( u0 * (s0 * (t0 * field3[i000] +
+ t1 * field3[i010]) +
+ s1 * (t0 * field3[i100] +
+ t1 * field3[i110])) +
+ u1 * (s0 * (t0 * field3[i001] +
+ t1 * field3[i011]) +
+ s1 * (t0 * field3[i101] +
+ t1 * field3[i111])) )
+ );
+}
+
+};
+#endif
diff --git a/intern/smoke/intern/LICENSE.txt b/intern/smoke/intern/LICENSE.txt
new file mode 100644
index 00000000000..94a9ed024d3
--- /dev/null
+++ b/intern/smoke/intern/LICENSE.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/intern/smoke/intern/LU_HELPER.h b/intern/smoke/intern/LU_HELPER.h
new file mode 100644
index 00000000000..b3f3c5a1cb4
--- /dev/null
+++ b/intern/smoke/intern/LU_HELPER.h
@@ -0,0 +1,56 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef LU_HELPER_H
+#define LU_HELPER_H
+
+//////////////////////////////////////////////////////////////////////
+// Helper function, compute eigenvalues of 3x3 matrix
+//////////////////////////////////////////////////////////////////////
+
+#include "tnt/jama_lu.h"
+
+//////////////////////////////////////////////////////////////////////
+// LU decomposition of 3x3 non-symmetric matrix
+//////////////////////////////////////////////////////////////////////
+JAMA::LU<float> inline computeLU3x3(
+ float a[3][3])
+{
+ TNT::Array2D<float> A = TNT::Array2D<float>(3,3, &a[0][0]);
+ JAMA::LU<float> jLU= JAMA::LU<float>(A);
+ return jLU;
+}
+
+//////////////////////////////////////////////////////////////////////
+// LU decomposition of 3x3 non-symmetric matrix
+//////////////////////////////////////////////////////////////////////
+void inline solveLU3x3(
+ JAMA::LU<float>& A,
+ float x[3],
+ float b[3])
+{
+ TNT::Array1D<float> jamaB = TNT::Array1D<float>(3, &b[0]);
+ TNT::Array1D<float> jamaX = A.solve(jamaB);
+
+ x[0] = jamaX[0];
+ x[1] = jamaX[1];
+ x[2] = jamaX[2];
+}
+#endif
diff --git a/intern/smoke/intern/MERSENNETWISTER.h b/intern/smoke/intern/MERSENNETWISTER.h
new file mode 100644
index 00000000000..8ad00d8b9c2
--- /dev/null
+++ b/intern/smoke/intern/MERSENNETWISTER.h
@@ -0,0 +1,429 @@
+// MersenneTwister.h
+// Mersenne Twister random number generator -- a C++ class MTRand
+// Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus
+// Richard J. Wagner v1.0 15 May 2003 rjwagner@writeme.com
+
+// The Mersenne Twister is an algorithm for generating random numbers. It
+// was designed with consideration of the flaws in various other generators.
+// The period, 2^19937-1, and the order of equidistribution, 623 dimensions,
+// are far greater. The generator is also fast; it avoids multiplication and
+// division, and it benefits from caches and pipelines. For more information
+// see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html
+
+// Reference
+// M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
+// Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on
+// Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
+
+// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+// Copyright (C) 2000 - 2003, Richard J. Wagner
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// 3. The names of its contributors may not be used to endorse or promote
+// products derived from this software without specific prior written
+// permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The original code included the following notice:
+//
+// When you use this, send an email to: matumoto@math.keio.ac.jp
+// with an appropriate reference to your work.
+//
+// It would be nice to CC: rjwagner@writeme.com and Cokus@math.washington.edu
+// when you write.
+
+#ifndef MERSENNETWISTER_H
+#define MERSENNETWISTER_H
+
+// Not thread safe (unless auto-initialization is avoided and each thread has
+// its own MTRand object)
+
+#include <iostream>
+#include <limits.h>
+#include <stdio.h>
+#include <time.h>
+#include <math.h>
+
+class MTRand {
+// Data
+public:
+ typedef unsigned long uint32; // unsigned integer type, at least 32 bits
+
+ enum { N = 624 }; // length of state vector
+ enum { SAVE = N + 1 }; // length of array for save()
+
+protected:
+ enum { M = 397 }; // period parameter
+
+ uint32 state[N]; // internal state
+ uint32 *pNext; // next value to get from state
+ int left; // number of values left before reload needed
+
+
+//Methods
+public:
+ MTRand( const uint32& oneSeed ); // initialize with a simple uint32
+ MTRand( uint32 *const bigSeed, uint32 const seedLength = N ); // or an array
+ MTRand(); // auto-initialize with /dev/urandom or time() and clock()
+
+ // Do NOT use for CRYPTOGRAPHY without securely hashing several returned
+ // values together, otherwise the generator state can be learned after
+ // reading 624 consecutive values.
+
+ // Access to 32-bit random numbers
+ double rand(); // real number in [0,1]
+ double rand( const double& n ); // real number in [0,n]
+ double randExc(); // real number in [0,1)
+ double randExc( const double& n ); // real number in [0,n)
+ double randDblExc(); // real number in (0,1)
+ double randDblExc( const double& n ); // real number in (0,n)
+ uint32 randInt(); // integer in [0,2^32-1]
+ uint32 randInt( const uint32& n ); // integer in [0,n] for n < 2^32
+ double operator()() { return rand(); } // same as rand()
+
+ // Access to 53-bit random numbers (capacity of IEEE double precision)
+ double rand53(); // real number in [0,1)
+
+ // Access to nonuniform random number distributions
+ double randNorm( const double& mean = 0.0, const double& variance = 1.0 );
+
+ // Re-seeding functions with same behavior as initializers
+ void seed( const uint32 oneSeed );
+ void seed( uint32 *const bigSeed, const uint32 seedLength = N );
+ void seed();
+
+ // Saving and loading generator state
+ void save( uint32* saveArray ) const; // to array of size SAVE
+ void load( uint32 *const loadArray ); // from such array
+ friend std::ostream& operator<<( std::ostream& os, const MTRand& mtrand );
+ friend std::istream& operator>>( std::istream& is, MTRand& mtrand );
+
+protected:
+ void initialize( const uint32 oneSeed );
+ void reload();
+ uint32 hiBit( const uint32& u ) const { return u & 0x80000000UL; }
+ uint32 loBit( const uint32& u ) const { return u & 0x00000001UL; }
+ uint32 loBits( const uint32& u ) const { return u & 0x7fffffffUL; }
+ uint32 mixBits( const uint32& u, const uint32& v ) const
+ { return hiBit(u) | loBits(v); }
+ uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const
+ { return m ^ (mixBits(s0,s1)>>1) ^ (-loBit(s1) & 0x9908b0dfUL); }
+ static uint32 hash( time_t t, clock_t c );
+};
+
+
+inline MTRand::MTRand( const uint32& oneSeed )
+ { seed(oneSeed); }
+
+inline MTRand::MTRand( uint32 *const bigSeed, const uint32 seedLength )
+ { seed(bigSeed,seedLength); }
+
+inline MTRand::MTRand()
+ { seed(); }
+
+inline double MTRand::rand()
+ { return double(randInt()) * (1.0/4294967295.0); }
+
+inline double MTRand::rand( const double& n )
+ { return rand() * n; }
+
+inline double MTRand::randExc()
+ { return double(randInt()) * (1.0/4294967296.0); }
+
+inline double MTRand::randExc( const double& n )
+ { return randExc() * n; }
+
+inline double MTRand::randDblExc()
+ { return ( double(randInt()) + 0.5 ) * (1.0/4294967296.0); }
+
+inline double MTRand::randDblExc( const double& n )
+ { return randDblExc() * n; }
+
+inline double MTRand::rand53()
+{
+ uint32 a = randInt() >> 5, b = randInt() >> 6;
+ return ( a * 67108864.0 + b ) * (1.0/9007199254740992.0); // by Isaku Wada
+}
+
+inline double MTRand::randNorm( const double& mean, const double& variance )
+{
+ // Return a real number from a normal (Gaussian) distribution with given
+ // mean and variance by Box-Muller method
+ double r = sqrt( -2.0 * log( 1.0-randDblExc()) ) * variance;
+ double phi = 2.0 * 3.14159265358979323846264338328 * randExc();
+ return mean + r * cos(phi);
+}
+
+inline MTRand::uint32 MTRand::randInt()
+{
+ // Pull a 32-bit integer from the generator state
+ // Every other access function simply transforms the numbers extracted here
+
+ if( left == 0 ) reload();
+ --left;
+
+ register uint32 s1;
+ s1 = *pNext++;
+ s1 ^= (s1 >> 11);
+ s1 ^= (s1 << 7) & 0x9d2c5680UL;
+ s1 ^= (s1 << 15) & 0xefc60000UL;
+ return ( s1 ^ (s1 >> 18) );
+}
+
+inline MTRand::uint32 MTRand::randInt( const uint32& n )
+{
+ // Find which bits are used in n
+ // Optimized by Magnus Jonsson (magnus@smartelectronix.com)
+ uint32 used = n;
+ used |= used >> 1;
+ used |= used >> 2;
+ used |= used >> 4;
+ used |= used >> 8;
+ used |= used >> 16;
+
+ // Draw numbers until one is found in [0,n]
+ uint32 i;
+ do
+ i = randInt() & used; // toss unused bits to shorten search
+ while( i > n );
+ return i;
+}
+
+
+inline void MTRand::seed( const uint32 oneSeed )
+{
+ // Seed the generator with a simple uint32
+ initialize(oneSeed);
+ reload();
+}
+
+
+inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength )
+{
+ // Seed the generator with an array of uint32's
+ // There are 2^19937-1 possible initial states. This function allows
+ // all of those to be accessed by providing at least 19937 bits (with a
+ // default seed length of N = 624 uint32's). Any bits above the lower 32
+ // in each element are discarded.
+ // Just call seed() if you want to get array from /dev/urandom
+ initialize(19650218UL);
+ register int i = 1;
+ register uint32 j = 0;
+ register int k = ( N > seedLength ? N : seedLength );
+ for( ; k; --k )
+ {
+ state[i] =
+ state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1664525UL );
+ state[i] += ( bigSeed[j] & 0xffffffffUL ) + j;
+ state[i] &= 0xffffffffUL;
+ ++i; ++j;
+ if( i >= N ) { state[0] = state[N-1]; i = 1; }
+ if( j >= seedLength ) j = 0;
+ }
+ for( k = N - 1; k; --k )
+ {
+ state[i] =
+ state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL );
+ state[i] -= i;
+ state[i] &= 0xffffffffUL;
+ ++i;
+ if( i >= N ) { state[0] = state[N-1]; i = 1; }
+ }
+ state[0] = 0x80000000UL; // MSB is 1, assuring non-zero initial array
+ reload();
+}
+
+
+inline void MTRand::seed()
+{
+ // seed deterministically to produce reproducible runs
+ seed(123456);
+
+ /*
+ // Seed the generator with an array from /dev/urandom if available
+ // Otherwise use a hash of time() and clock() values
+
+ // First try getting an array from /dev/urandom
+ FILE* urandom = fopen( "/dev/urandom", "rb" );
+ if( urandom )
+ {
+ uint32 bigSeed[N];
+ register uint32 *s = bigSeed;
+ register int i = N;
+ register bool success = true;
+ while( success && i-- )
+ success = fread( s++, sizeof(uint32), 1, urandom );
+ fclose(urandom);
+ if( success ) { seed( bigSeed, N ); return; }
+ }
+
+ // Was not successful, so use time() and clock() instead
+ seed( hash( time(NULL), clock() ) );
+ */
+}
+
+
+inline void MTRand::initialize( const uint32 seed )
+{
+ // Initialize generator state with seed
+ // See Knuth TAOCP Vol 2, 3rd Ed, p.106 for multiplier.
+ // In previous versions, most significant bits (MSBs) of the seed affect
+ // only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto.
+ register uint32 *s = state;
+ register uint32 *r = state;
+ register int i = 1;
+ *s++ = seed & 0xffffffffUL;
+ for( ; i < N; ++i )
+ {
+ *s++ = ( 1812433253UL * ( *r ^ (*r >> 30) ) + i ) & 0xffffffffUL;
+ r++;
+ }
+}
+
+
+inline void MTRand::reload()
+{
+ // Generate N new values in state
+ // Made clearer and faster by Matthew Bellew (matthew.bellew@home.com)
+ register uint32 *p = state;
+ register int i;
+ for( i = N - M; i--; ++p )
+ *p = twist( p[M], p[0], p[1] );
+ for( i = M; --i; ++p )
+ *p = twist( p[M-N], p[0], p[1] );
+ *p = twist( p[M-N], p[0], state[0] );
+
+ left = N, pNext = state;
+}
+
+
+inline MTRand::uint32 MTRand::hash( time_t t, clock_t c )
+{
+ // Get a uint32 from t and c
+ // Better than uint32(x) in case x is floating point in [0,1]
+ // Based on code by Lawrence Kirby (fred@genesis.demon.co.uk)
+
+ static uint32 differ = 0; // guarantee time-based seeds will change
+
+ uint32 h1 = 0;
+ unsigned char *p = (unsigned char *) &t;
+ for( size_t i = 0; i < sizeof(t); ++i )
+ {
+ h1 *= UCHAR_MAX + 2U;
+ h1 += p[i];
+ }
+ uint32 h2 = 0;
+ p = (unsigned char *) &c;
+ for( size_t j = 0; j < sizeof(c); ++j )
+ {
+ h2 *= UCHAR_MAX + 2U;
+ h2 += p[j];
+ }
+ return ( h1 + differ++ ) ^ h2;
+}
+
+
+inline void MTRand::save( uint32* saveArray ) const
+{
+ register uint32 *sa = saveArray;
+ register const uint32 *s = state;
+ register int i = N;
+ for( ; i--; *sa++ = *s++ ) {}
+ *sa = left;
+}
+
+
+inline void MTRand::load( uint32 *const loadArray )
+{
+ register uint32 *s = state;
+ register uint32 *la = loadArray;
+ register int i = N;
+ for( ; i--; *s++ = *la++ ) {}
+ left = *la;
+ pNext = &state[N-left];
+}
+
+
+inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand )
+{
+ register const MTRand::uint32 *s = mtrand.state;
+ register int i = mtrand.N;
+ for( ; i--; os << *s++ << "\t" ) {}
+ return os << mtrand.left;
+}
+
+
+inline std::istream& operator>>( std::istream& is, MTRand& mtrand )
+{
+ register MTRand::uint32 *s = mtrand.state;
+ register int i = mtrand.N;
+ for( ; i--; is >> *s++ ) {}
+ is >> mtrand.left;
+ mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left];
+ return is;
+}
+
+#endif // MERSENNETWISTER_H
+
+// Change log:
+//
+// v0.1 - First release on 15 May 2000
+// - Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus
+// - Translated from C to C++
+// - Made completely ANSI compliant
+// - Designed convenient interface for initialization, seeding, and
+// obtaining numbers in default or user-defined ranges
+// - Added automatic seeding from /dev/urandom or time() and clock()
+// - Provided functions for saving and loading generator state
+//
+// v0.2 - Fixed bug which reloaded generator one step too late
+//
+// v0.3 - Switched to clearer, faster reload() code from Matthew Bellew
+//
+// v0.4 - Removed trailing newline in saved generator format to be consistent
+// with output format of built-in types
+//
+// v0.5 - Improved portability by replacing static const int's with enum's and
+// clarifying return values in seed(); suggested by Eric Heimburg
+// - Removed MAXINT constant; use 0xffffffffUL instead
+//
+// v0.6 - Eliminated seed overflow when uint32 is larger than 32 bits
+// - Changed integer [0,n] generator to give better uniformity
+//
+// v0.7 - Fixed operator precedence ambiguity in reload()
+// - Added access for real numbers in (0,1) and (0,n)
+//
+// v0.8 - Included time.h header to properly support time_t and clock_t
+//
+// v1.0 - Revised seeding to match 26 Jan 2002 update of Nishimura and Matsumoto
+// - Allowed for seeding with arrays of any length
+// - Added access for real numbers in [0,1) with 53-bit resolution
+// - Added access for real numbers from normal (Gaussian) distributions
+// - Increased overall speed by optimizing twist()
+// - Doubled speed of integer [0,n] generation
+// - Fixed out-of-range number generation on 64-bit machines
+// - Improved portability by substituting literal constants for long enum's
+// - Changed license from GNU LGPL to BSD
+
diff --git a/intern/smoke/intern/Makefile b/intern/smoke/intern/Makefile
new file mode 100644
index 00000000000..2cdd7d3853e
--- /dev/null
+++ b/intern/smoke/intern/Makefile
@@ -0,0 +1,52 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+# smoke intern Makefile
+#
+
+LIBNAME = smoke
+DIR = $(OCGDIR)/intern/$(LIBNAME)
+
+include nan_compile.mk
+
+unexport NAN_QUIET
+
+CCFLAGS += $(LEVEL_2_CPP_WARNINGS)
+
+ifeq ($(WITH_BF_OPENMP),true)
+ CPPFLAGS += -DPARALLEL
+endif
+
+CPPFLAGS += -I.
+CPPFLAGS += -I../extern
+CPPFLAGS += -I$(NAN_PNG)/include
+CPPFLAGS += -I$(NAN_PNG)/include/libpng
+
+# zlib
+ifeq ($(OS),$(findstring $(OS), "solaris windows"))
+ CPPFLAGS += -I$(NAN_ZLIB)/include
+endif
diff --git a/intern/smoke/intern/Makefile.FFT b/intern/smoke/intern/Makefile.FFT
new file mode 100644
index 00000000000..e45af1df29b
--- /dev/null
+++ b/intern/smoke/intern/Makefile.FFT
@@ -0,0 +1,22 @@
+# common stuff
+LDFLAGS_COMMON = -lfftw3 #-lglut -lglu32 -lopengl32 -lz -lpng
+CFLAGS_COMMON = -c -Wall -I./ #-I/cygdrive/c/lib/glvu/include -D_WIN32
+
+CC = g++
+CFLAGS = ${CFLAGS_COMMON} -O3 -Wno-unused
+LDFLAGS = ${LDFLAGS_COMMON}
+EXECUTABLE = noiseFFT
+
+SOURCES = noiseFFT.cpp
+OBJECTS = $(SOURCES:.cpp=.o)
+
+all: $(SOURCES) $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CC) $(OBJECTS) $(LDFLAGS) -o $@
+
+.cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
+
+clean:
+ rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
diff --git a/intern/smoke/intern/Makefile.cygwin b/intern/smoke/intern/Makefile.cygwin
new file mode 100644
index 00000000000..c93753a67fe
--- /dev/null
+++ b/intern/smoke/intern/Makefile.cygwin
@@ -0,0 +1,23 @@
+CC = g++
+LDFLAGS = -lz -lpng
+CFLAGS = -O3 -Wno-unused -c -Wall -I./ -D_WIN32
+EXECUTABLE = FLUID_3D
+
+SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
+OBJECTS = $(SOURCES:.cpp=.o)
+
+all: $(SOURCES) $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CC) $(OBJECTS) $(LDFLAGS) -o $@
+
+.cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
+
+SPHERE.o: SPHERE.h
+FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
+FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
+main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
+
+clean:
+ rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
diff --git a/intern/smoke/intern/Makefile.linux b/intern/smoke/intern/Makefile.linux
new file mode 100644
index 00000000000..8e71af465dd
--- /dev/null
+++ b/intern/smoke/intern/Makefile.linux
@@ -0,0 +1,23 @@
+CC = g++
+LDFLAGS = -lz -lpng -fopenmp -lgomp
+CFLAGS = -c -Wall -I./ -fopenmp -DPARALLEL=1 -O3 -Wno-unused
+EXECUTABLE = FLUID_3D
+
+SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
+OBJECTS = $(SOURCES:.cpp=.o)
+
+all: $(SOURCES) $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CC) $(OBJECTS) $(LDFLAGS) -o $@
+
+.cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
+
+SPHERE.o: SPHERE.h
+FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
+FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
+main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
+
+clean:
+ rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
diff --git a/intern/smoke/intern/Makefile.mac b/intern/smoke/intern/Makefile.mac
new file mode 100644
index 00000000000..227aaa10a16
--- /dev/null
+++ b/intern/smoke/intern/Makefile.mac
@@ -0,0 +1,35 @@
+CC = g++
+
+# uncomment the other two OPENMP_... lines, if your gcc supports OpenMP
+#OPENMP_FLAGS = -fopenmp -DPARALLEL=1 -I/opt/gcc-4.3/usr/local/include
+#OPENMPLD_FLAGS = -fopenmp -lgomp -I/opt/gcc-4.3/usr/local/lib
+OPENMP_FLAGS =
+OPENMPLD_FLAGS =
+
+# assumes MacPorts libpng installation
+PNG_INCLUDE = -I/opt/local/include
+PNG_LIBS = -I/opt/local/lib
+
+LDFLAGS = $(PNG_LIBS)-lz -lpng $(OPENMPLD_FLAGS)
+CFLAGS = -c -Wall -I./ $(PNG_INCLUDE) $(OPENMP_FLAGS) -O3 -Wno-unused
+EXECUTABLE = FLUID_3D
+
+SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
+OBJECTS = $(SOURCES:.cpp=.o)
+
+all: $(SOURCES) $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CC) $(OBJECTS) $(LDFLAGS) -o $@
+
+.cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
+
+SPHERE.o: SPHERE.h
+FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
+FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
+main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
+
+clean:
+ rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
+
diff --git a/intern/smoke/intern/OBSTACLE.h b/intern/smoke/intern/OBSTACLE.h
new file mode 100644
index 00000000000..54e824d275d
--- /dev/null
+++ b/intern/smoke/intern/OBSTACLE.h
@@ -0,0 +1,41 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// OBSTACLE.h: interface for the OBSTACLE class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef OBSTACLE_H
+#define OBSTACLE_H
+
+enum OBSTACLE_FLAGS {
+ EMPTY = 0,
+ MARCHED = 2,
+ RETIRED = 4
+};
+
+class OBSTACLE
+{
+public:
+ OBSTACLE() {};
+ virtual ~OBSTACLE() {};
+
+ virtual bool inside(float x, float y, float z) = 0;
+};
+
+#endif
diff --git a/intern/smoke/intern/SPHERE.cpp b/intern/smoke/intern/SPHERE.cpp
new file mode 100644
index 00000000000..4bb18fb81c0
--- /dev/null
+++ b/intern/smoke/intern/SPHERE.cpp
@@ -0,0 +1,50 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// SPHERE.cpp: implementation of the SPHERE class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "SPHERE.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+SPHERE::SPHERE(float x, float y, float z, float radius) :
+ _radius(radius)
+{
+ _center[0] = x;
+ _center[1] = y;
+ _center[2] = z;
+}
+
+SPHERE::~SPHERE()
+{
+
+}
+
+bool SPHERE::inside(float x, float y, float z)
+{
+ float translate[] = {x - _center[0], y - _center[1], z - _center[2]};
+ float magnitude = translate[0] * translate[0] +
+ translate[1] * translate[1] +
+ translate[2] * translate[2];
+
+ return (magnitude < _radius * _radius) ? true : false;
+}
diff --git a/intern/smoke/intern/SPHERE.h b/intern/smoke/intern/SPHERE.h
new file mode 100644
index 00000000000..13bd6e9493c
--- /dev/null
+++ b/intern/smoke/intern/SPHERE.h
@@ -0,0 +1,41 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// SPHERE.h: interface for the SPHERE class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef SPHERE_H
+#define SPHERE_H
+
+#include "OBSTACLE.h"
+
+class SPHERE : public OBSTACLE
+{
+public:
+ SPHERE(float x, float y, float z, float radius);
+ virtual ~SPHERE();
+
+ bool inside(float x, float y, float z);
+
+private:
+ float _center[3];
+ float _radius;
+};
+
+#endif
diff --git a/intern/smoke/intern/VEC3.h b/intern/smoke/intern/VEC3.h
new file mode 100644
index 00000000000..98c4555ac5f
--- /dev/null
+++ b/intern/smoke/intern/VEC3.h
@@ -0,0 +1,986 @@
+/******************************************************************************
+ * Copyright 2007 Nils Thuerey
+ * Basic vector class
+ *****************************************************************************/
+#ifndef BASICVECTOR_H
+#define BASICVECTOR_H
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <iostream>
+#include <sstream>
+
+// use which fp-precision? 1=float, 2=double
+#ifndef FLOATINGPOINT_PRECISION
+#if DDF_DEBUG==1
+#define FLOATINGPOINT_PRECISION 2
+#else // DDF_DEBUG==1
+#define FLOATINGPOINT_PRECISION 1
+#endif // DDF_DEBUG==1
+#endif
+
+// VECTOR_EPSILON is the minimal vector length
+// In order to be able to discriminate floating point values near zero, and
+// to be sure not to fail a comparison because of roundoff errors, use this
+// value as a threshold.
+
+#if FLOATINGPOINT_PRECISION==1
+typedef float Real;
+#define FP_REAL_MAX __FLT_MAX__
+#define VECTOR_EPSILON (1e-5f)
+#else
+typedef double Real;
+#define FP_REAL_MAX __DBL_MAX__
+#define VECTOR_EPSILON (1e-10)
+#endif
+
+
+// hardcoded limits for now...
+// for e.g. MSVC compiler...
+// some of these defines can be needed
+// for linux systems as well (e.g. FLT_MAX)
+#ifndef __FLT_MAX__
+# ifdef FLT_MAX // try to use it instead
+# define __FLT_MAX__ FLT_MAX
+# else // FLT_MAX
+# define __FLT_MAX__ 3.402823466e+38f
+# endif // FLT_MAX
+#endif // __FLT_MAX__
+#ifndef __DBL_MAX__
+# ifdef DBL_MAX // try to use it instead
+# define __DBL_MAX__ DBL_MAX
+# else // DBL_MAX
+# define __DBL_MAX__ 1.7976931348623158e+308
+# endif // DBL_MAX
+#endif // __DBL_MAX__
+
+#ifndef FLT_MAX
+#define FLT_MAX __FLT_MAX__
+#endif
+
+#ifndef DBL_MAX
+#define DBL_MAX __DBL_MAX__
+#endif
+
+#ifndef M_PI
+# define M_PI 3.1415926536
+# define M_E 2.7182818284
+#endif
+
+
+
+namespace BasicVector {
+
+
+// basic inlined vector class
+template<class Scalar>
+class Vector3Dim
+{
+public:
+ // Constructor
+ inline Vector3Dim();
+ // Copy-Constructor
+ inline Vector3Dim(const Vector3Dim<Scalar> &v );
+ inline Vector3Dim(const float *);
+ inline Vector3Dim(const double *);
+ // construct a vector from one Scalar
+ inline Vector3Dim(Scalar);
+ // construct a vector from three Scalars
+ inline Vector3Dim(Scalar, Scalar, Scalar);
+
+ // get address of array for OpenGL
+ Scalar *getAddress() { return value; }
+
+ // Assignment operator
+ inline const Vector3Dim<Scalar>& operator= (const Vector3Dim<Scalar>& v);
+ // Assignment operator
+ inline const Vector3Dim<Scalar>& operator= (Scalar s);
+ // Assign and add operator
+ inline const Vector3Dim<Scalar>& operator+= (const Vector3Dim<Scalar>& v);
+ // Assign and add operator
+ inline const Vector3Dim<Scalar>& operator+= (Scalar s);
+ // Assign and sub operator
+ inline const Vector3Dim<Scalar>& operator-= (const Vector3Dim<Scalar>& v);
+ // Assign and sub operator
+ inline const Vector3Dim<Scalar>& operator-= (Scalar s);
+ // Assign and mult operator
+ inline const Vector3Dim<Scalar>& operator*= (const Vector3Dim<Scalar>& v);
+ // Assign and mult operator
+ inline const Vector3Dim<Scalar>& operator*= (Scalar s);
+ // Assign and div operator
+ inline const Vector3Dim<Scalar>& operator/= (const Vector3Dim<Scalar>& v);
+ // Assign and div operator
+ inline const Vector3Dim<Scalar>& operator/= (Scalar s);
+
+
+ // unary operator
+ inline Vector3Dim<Scalar> operator- () const;
+
+ // binary operator add
+ inline Vector3Dim<Scalar> operator+ (const Vector3Dim<Scalar>&) const;
+ // binary operator add
+ inline Vector3Dim<Scalar> operator+ (Scalar) const;
+ // binary operator sub
+ inline Vector3Dim<Scalar> operator- (const Vector3Dim<Scalar>&) const;
+ // binary operator sub
+ inline Vector3Dim<Scalar> operator- (Scalar) const;
+ // binary operator mult
+ inline Vector3Dim<Scalar> operator* (const Vector3Dim<Scalar>&) const;
+ // binary operator mult
+ inline Vector3Dim<Scalar> operator* (Scalar) const;
+ // binary operator div
+ inline Vector3Dim<Scalar> operator/ (const Vector3Dim<Scalar>&) const;
+ // binary operator div
+ inline Vector3Dim<Scalar> operator/ (Scalar) const;
+
+ // Projection normal to a vector
+ inline Vector3Dim<Scalar> getOrthogonalntlVector3Dim() const;
+ // Project into a plane
+ inline const Vector3Dim<Scalar>& projectNormalTo(const Vector3Dim<Scalar> &v);
+
+ // minimize
+ inline const Vector3Dim<Scalar> &minimize(const Vector3Dim<Scalar> &);
+ // maximize
+ inline const Vector3Dim<Scalar> &maximize(const Vector3Dim<Scalar> &);
+
+ // access operator
+ inline Scalar& operator[](unsigned int i);
+ // access operator
+ inline const Scalar& operator[](unsigned int i) const;
+
+ //! actual values
+ union {
+ struct {
+ Scalar value[3];
+ };
+ struct {
+ Scalar x;
+ Scalar y;
+ Scalar z;
+ };
+ struct {
+ Scalar X;
+ Scalar Y;
+ Scalar Z;
+ };
+ };
+protected:
+
+};
+
+
+
+
+
+//------------------------------------------------------------------------------
+// VECTOR inline FUNCTIONS
+//------------------------------------------------------------------------------
+
+
+
+/*************************************************************************
+ Constructor.
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>::Vector3Dim( void )
+{
+ value[0] = value[1] = value[2] = 0;
+}
+
+
+
+/*************************************************************************
+ Copy-Constructor.
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>::Vector3Dim( const Vector3Dim<Scalar> &v )
+{
+ value[0] = v.value[0];
+ value[1] = v.value[1];
+ value[2] = v.value[2];
+}
+template<class Scalar>
+inline Vector3Dim<Scalar>::Vector3Dim( const float *fvalue)
+{
+ value[0] = (Scalar)fvalue[0];
+ value[1] = (Scalar)fvalue[1];
+ value[2] = (Scalar)fvalue[2];
+}
+template<class Scalar>
+inline Vector3Dim<Scalar>::Vector3Dim( const double *fvalue)
+{
+ value[0] = (Scalar)fvalue[0];
+ value[1] = (Scalar)fvalue[1];
+ value[2] = (Scalar)fvalue[2];
+}
+
+
+
+/*************************************************************************
+ Constructor for a vector from a single Scalar. All components of
+ the vector get the same value.
+ \param s The value to set
+ \return The new vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>::Vector3Dim(Scalar s )
+{
+ value[0]= s;
+ value[1]= s;
+ value[2]= s;
+}
+
+
+/*************************************************************************
+ Constructor for a vector from three Scalars.
+ \param s1 The value for the first vector component
+ \param s2 The value for the second vector component
+ \param s3 The value for the third vector component
+ \return The new vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>::Vector3Dim(Scalar s1, Scalar s2, Scalar s3)
+{
+ value[0]= s1;
+ value[1]= s2;
+ value[2]= s3;
+}
+
+
+
+/*************************************************************************
+ Copy a Vector3Dim componentwise.
+ \param v vector with values to be copied
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator=( const Vector3Dim<Scalar> &v )
+{
+ value[0] = v.value[0];
+ value[1] = v.value[1];
+ value[2] = v.value[2];
+ return *this;
+}
+
+
+/*************************************************************************
+ Copy a Scalar to each component.
+ \param s The value to copy
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator=(Scalar s)
+{
+ value[0] = s;
+ value[1] = s;
+ value[2] = s;
+ return *this;
+}
+
+
+/*************************************************************************
+ Add another Vector3Dim componentwise.
+ \param v vector with values to be added
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator+=( const Vector3Dim<Scalar> &v )
+{
+ value[0] += v.value[0];
+ value[1] += v.value[1];
+ value[2] += v.value[2];
+ return *this;
+}
+
+
+/*************************************************************************
+ Add a Scalar value to each component.
+ \param s Value to add
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator+=(Scalar s)
+{
+ value[0] += s;
+ value[1] += s;
+ value[2] += s;
+ return *this;
+}
+
+
+/*************************************************************************
+ Subtract another vector componentwise.
+ \param v vector of values to subtract
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator-=( const Vector3Dim<Scalar> &v )
+{
+ value[0] -= v.value[0];
+ value[1] -= v.value[1];
+ value[2] -= v.value[2];
+ return *this;
+}
+
+
+/*************************************************************************
+ Subtract a Scalar value from each component.
+ \param s Value to subtract
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator-=(Scalar s)
+{
+ value[0]-= s;
+ value[1]-= s;
+ value[2]-= s;
+ return *this;
+}
+
+
+/*************************************************************************
+ Multiply with another vector componentwise.
+ \param v vector of values to multiply with
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator*=( const Vector3Dim<Scalar> &v )
+{
+ value[0] *= v.value[0];
+ value[1] *= v.value[1];
+ value[2] *= v.value[2];
+ return *this;
+}
+
+
+/*************************************************************************
+ Multiply each component with a Scalar value.
+ \param s Value to multiply with
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator*=(Scalar s)
+{
+ value[0] *= s;
+ value[1] *= s;
+ value[2] *= s;
+ return *this;
+}
+
+
+/*************************************************************************
+ Divide by another Vector3Dim componentwise.
+ \param v vector of values to divide by
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator/=( const Vector3Dim<Scalar> &v )
+{
+ value[0] /= v.value[0];
+ value[1] /= v.value[1];
+ value[2] /= v.value[2];
+ return *this;
+}
+
+
+/*************************************************************************
+ Divide each component by a Scalar value.
+ \param s Value to divide by
+ \return Reference to self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::operator/=(Scalar s)
+{
+ value[0] /= s;
+ value[1] /= s;
+ value[2] /= s;
+ return *this;
+}
+
+
+//------------------------------------------------------------------------------
+// unary operators
+//------------------------------------------------------------------------------
+
+
+/*************************************************************************
+ Build componentwise the negative this vector.
+ \return The new (negative) vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator-() const
+{
+ return Vector3Dim<Scalar>(-value[0], -value[1], -value[2]);
+}
+
+
+
+//------------------------------------------------------------------------------
+// binary operators
+//------------------------------------------------------------------------------
+
+
+/*************************************************************************
+ Build a vector with another vector added componentwise.
+ \param v The second vector to add
+ \return The sum vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator+( const Vector3Dim<Scalar> &v ) const
+{
+ return Vector3Dim<Scalar>(value[0]+v.value[0],
+ value[1]+v.value[1],
+ value[2]+v.value[2]);
+}
+
+
+/*************************************************************************
+ Build a vector with a Scalar value added to each component.
+ \param s The Scalar value to add
+ \return The sum vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator+(Scalar s) const
+{
+ return Vector3Dim<Scalar>(value[0]+s,
+ value[1]+s,
+ value[2]+s);
+}
+
+
+/*************************************************************************
+ Build a vector with another vector subtracted componentwise.
+ \param v The second vector to subtract
+ \return The difference vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator-( const Vector3Dim<Scalar> &v ) const
+{
+ return Vector3Dim<Scalar>(value[0]-v.value[0],
+ value[1]-v.value[1],
+ value[2]-v.value[2]);
+}
+
+
+/*************************************************************************
+ Build a vector with a Scalar value subtracted componentwise.
+ \param s The Scalar value to subtract
+ \return The difference vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator-(Scalar s ) const
+{
+ return Vector3Dim<Scalar>(value[0]-s,
+ value[1]-s,
+ value[2]-s);
+}
+
+
+
+/*************************************************************************
+ Build a vector with another vector multiplied by componentwise.
+ \param v The second vector to muliply with
+ \return The product vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator*( const Vector3Dim<Scalar>& v) const
+{
+ return Vector3Dim<Scalar>(value[0]*v.value[0],
+ value[1]*v.value[1],
+ value[2]*v.value[2]);
+}
+
+
+/*************************************************************************
+ Build a Vector3Dim with a Scalar value multiplied to each component.
+ \param s The Scalar value to multiply with
+ \return The product vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator*(Scalar s) const
+{
+ return Vector3Dim<Scalar>(value[0]*s, value[1]*s, value[2]*s);
+}
+
+
+/*************************************************************************
+ Build a vector divided componentwise by another vector.
+ \param v The second vector to divide by
+ \return The ratio vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator/(const Vector3Dim<Scalar>& v) const
+{
+ return Vector3Dim<Scalar>(value[0]/v.value[0],
+ value[1]/v.value[1],
+ value[2]/v.value[2]);
+}
+
+
+
+/*************************************************************************
+ Build a vector divided componentwise by a Scalar value.
+ \param s The Scalar value to divide by
+ \return The ratio vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar>
+Vector3Dim<Scalar>::operator/(Scalar s) const
+{
+ return Vector3Dim<Scalar>(value[0]/s,
+ value[1]/s,
+ value[2]/s);
+}
+
+
+
+
+
+/*************************************************************************
+ Get a particular component of the vector.
+ \param i Number of Scalar to get
+ \return Reference to the component
+ */
+template<class Scalar>
+inline Scalar&
+Vector3Dim<Scalar>::operator[]( unsigned int i )
+{
+ return value[i];
+}
+
+
+/*************************************************************************
+ Get a particular component of a constant vector.
+ \param i Number of Scalar to get
+ \return Reference to the component
+ */
+template<class Scalar>
+inline const Scalar&
+Vector3Dim<Scalar>::operator[]( unsigned int i ) const
+{
+ return value[i];
+}
+
+
+
+//------------------------------------------------------------------------------
+// BLITZ compatibility functions
+//------------------------------------------------------------------------------
+
+
+
+/*************************************************************************
+ Compute the scalar product with another vector.
+ \param v The second vector to work with
+ \return The value of the scalar product
+ */
+template<class Scalar>
+inline Scalar dot(const Vector3Dim<Scalar> &t, const Vector3Dim<Scalar> &v )
+{
+ //return t.value[0]*v.value[0] + t.value[1]*v.value[1] + t.value[2]*v.value[2];
+ return ((t[0]*v[0]) + (t[1]*v[1]) + (t[2]*v[2]));
+}
+
+
+/*************************************************************************
+ Calculate the cross product of this and another vector
+ */
+template<class Scalar>
+inline Vector3Dim<Scalar> cross(const Vector3Dim<Scalar> &t, const Vector3Dim<Scalar> &v)
+{
+ Vector3Dim<Scalar> cp(
+ ((t[1]*v[2]) - (t[2]*v[1])),
+ ((t[2]*v[0]) - (t[0]*v[2])),
+ ((t[0]*v[1]) - (t[1]*v[0])) );
+ return cp;
+}
+
+
+
+
+/*************************************************************************
+ Compute a vector that is orthonormal to self. Nothing else can be assumed
+ for the direction of the new vector.
+ \return The orthonormal vector
+ */
+template<class Scalar>
+Vector3Dim<Scalar>
+Vector3Dim<Scalar>::getOrthogonalntlVector3Dim() const
+{
+ // Determine the component with max. absolute value
+ int max= (fabs(value[0]) > fabs(value[1])) ? 0 : 1;
+ max= (fabs(value[max]) > fabs(value[2])) ? max : 2;
+
+ /*************************************************************************
+ Choose another axis than the one with max. component and project
+ orthogonal to self
+ */
+ Vector3Dim<Scalar> vec(0.0);
+ vec[(max+1)%3]= 1;
+ vec.normalize();
+ vec.projectNormalTo(this->getNormalized());
+ return vec;
+}
+
+
+/*************************************************************************
+ Projects the vector into a plane normal to the given vector, which must
+ have unit length. Self is modified.
+ \param v The plane normal
+ \return The projected vector
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar>&
+Vector3Dim<Scalar>::projectNormalTo(const Vector3Dim<Scalar> &v)
+{
+ Scalar sprod = dot(*this,v);
+ value[0]= value[0] - v.value[0] * sprod;
+ value[1]= value[1] - v.value[1] * sprod;
+ value[2]= value[2] - v.value[2] * sprod;
+ return *this;
+}
+
+
+
+//------------------------------------------------------------------------------
+// Other helper functions
+//------------------------------------------------------------------------------
+
+
+
+/*************************************************************************
+ Minimize the vector, i.e. set each entry of the vector to the minimum
+ of both values.
+ \param pnt The second vector to compare with
+ \return Reference to the modified self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar> &
+Vector3Dim<Scalar>::minimize(const Vector3Dim<Scalar> &pnt)
+{
+ for (unsigned int i = 0; i < 3; i++)
+ value[i] = MIN(value[i],pnt[i]);
+ return *this;
+}
+
+
+
+/*************************************************************************
+ Maximize the vector, i.e. set each entry of the vector to the maximum
+ of both values.
+ \param pnt The second vector to compare with
+ \return Reference to the modified self
+ */
+template<class Scalar>
+inline const Vector3Dim<Scalar> &
+Vector3Dim<Scalar>::maximize(const Vector3Dim<Scalar> &pnt)
+{
+ for (unsigned int i = 0; i < 3; i++)
+ value[i] = MAX(value[i],pnt[i]);
+ return *this;
+}
+
+
+
+
+
+
+/************************************************************************/
+// HELPER FUNCTIONS, independent of implementation
+/************************************************************************/
+
+#define VECTOR_TYPE Vector3Dim<Scalar>
+
+
+/*************************************************************************
+ Compute the length (norm) of the vector.
+ \return The value of the norm
+ */
+template<class Scalar>
+inline Scalar norm( const VECTOR_TYPE &v)
+{
+ Scalar l = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
+ return (fabs(l-1.) < VECTOR_EPSILON*VECTOR_EPSILON) ? 1. : sqrt(l);
+}
+
+// for e.g. min max operator
+inline Real normHelper(const Vector3Dim<Real> &v) {
+ return norm(v);
+}
+inline Real normHelper(const Real &v) {
+ return (0. < v) ? v : -v ;
+}
+inline Real normHelper(const int &v) {
+ return (0 < v) ? (Real)(v) : (Real)(-v) ;
+}
+
+
+/*************************************************************************
+ Same as getNorm but doesnt sqrt
+ */
+template<class Scalar>
+inline Scalar normNoSqrt( const VECTOR_TYPE &v)
+{
+ return v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
+}
+
+
+/*************************************************************************
+ Compute a normalized vector based on this vector.
+ \return The new normalized vector
+ */
+template<class Scalar>
+inline VECTOR_TYPE getNormalized( const VECTOR_TYPE &v)
+{
+ Scalar l = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
+ if (fabs(l-1.) < VECTOR_EPSILON*VECTOR_EPSILON)
+ return v; /* normalized "enough"... */
+ else if (l > VECTOR_EPSILON*VECTOR_EPSILON)
+ {
+ Scalar fac = 1./sqrt(l);
+ return VECTOR_TYPE(v[0]*fac, v[1]*fac, v[2]*fac);
+ }
+ else
+ return VECTOR_TYPE((Scalar)0);
+}
+
+
+/*************************************************************************
+ Compute the norm of the vector and normalize it.
+ \return The value of the norm
+ */
+template<class Scalar>
+inline Scalar normalize( VECTOR_TYPE &v)
+{
+ Scalar norm;
+ Scalar l = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
+ if (fabs(l-1.) < VECTOR_EPSILON*VECTOR_EPSILON) {
+ norm = 1.;
+ } else if (l > VECTOR_EPSILON*VECTOR_EPSILON) {
+ norm = sqrt(l);
+ Scalar fac = 1./norm;
+ v[0] *= fac;
+ v[1] *= fac;
+ v[2] *= fac;
+ } else {
+ v[0]= v[1]= v[2]= 0;
+ norm = 0.;
+ }
+ return (Scalar)norm;
+}
+
+
+/*************************************************************************
+ Compute a vector, that is self (as an incoming
+ vector) reflected at a surface with a distinct normal vector. Note
+ that the normal is reversed, if the scalar product with it is positive.
+ \param n The surface normal
+ \return The new reflected vector
+ */
+template<class Scalar>
+inline VECTOR_TYPE reflectVector(const VECTOR_TYPE &t, const VECTOR_TYPE &n)
+{
+ VECTOR_TYPE nn= (dot(t, n) > 0.0) ? (n*-1.0) : n;
+ return ( t - nn * (2.0 * dot(nn, t)) );
+}
+
+
+
+/*************************************************************************
+ * My own refraction calculation
+ * Taken from Glassner's book, section 5.2 (Heckberts method)
+ */
+template<class Scalar>
+inline VECTOR_TYPE refractVector(const VECTOR_TYPE &t, const VECTOR_TYPE &normal, Scalar nt, Scalar nair, int &refRefl)
+{
+ Scalar eta = nair / nt;
+ Scalar n = -dot(t, normal);
+ Scalar tt = 1.0 + eta*eta* (n*n-1.0);
+ if(tt<0.0) {
+ // we have total reflection!
+ refRefl = 1;
+ } else {
+ // normal reflection
+ tt = eta*n - sqrt(tt);
+ return( t*eta + normal*tt );
+ }
+ return t;
+}
+
+
+/*************************************************************************
+ Test two ntlVector3Dims for equality based on the equality of their
+ values within a small threshold.
+ \param c The second vector to compare
+ \return TRUE if both are equal
+ \sa getEpsilon()
+ */
+template<class Scalar>
+inline bool equal(const VECTOR_TYPE &v, const VECTOR_TYPE &c)
+{
+ return (ABS(v[0]-c[0]) +
+ ABS(v[1]-c[1]) +
+ ABS(v[2]-c[2]) < VECTOR_EPSILON);
+}
+
+
+/*************************************************************************
+ * Assume this vector is an RGB color, and convert it to HSV
+ */
+template<class Scalar>
+inline void rgbToHsv( VECTOR_TYPE &V )
+{
+ Scalar h=0,s=0,v=0;
+ Scalar maxrgb, minrgb, delta;
+ // convert to hsv...
+ maxrgb = V[0];
+ int maxindex = 1;
+ if(V[2] > maxrgb){ maxrgb = V[2]; maxindex = 2; }
+ if(V[1] > maxrgb){ maxrgb = V[1]; maxindex = 3; }
+ minrgb = V[0];
+ if(V[2] < minrgb) minrgb = V[2];
+ if(V[1] < minrgb) minrgb = V[1];
+
+ v = maxrgb;
+ delta = maxrgb-minrgb;
+
+ if(maxrgb > 0) s = delta/maxrgb;
+ else s = 0;
+
+ h = 0;
+ if(s > 0) {
+ if(maxindex == 1) {
+ h = ((V[1]-V[2])/delta) + 0.0; }
+ if(maxindex == 2) {
+ h = ((V[2]-V[0])/delta) + 2.0; }
+ if(maxindex == 3) {
+ h = ((V[0]-V[1])/delta) + 4.0; }
+ h *= 60.0;
+ if(h < 0.0) h += 360.0;
+ }
+
+ V[0] = h;
+ V[1] = s;
+ V[2] = v;
+}
+
+/*************************************************************************
+ * Assume this vector is HSV and convert to RGB
+ */
+template<class Scalar>
+inline void hsvToRgb( VECTOR_TYPE &V )
+{
+ Scalar h = V[0], s = V[1], v = V[2];
+ Scalar r=0,g=0,b=0;
+ Scalar p,q,t, fracth;
+ int floorh;
+ // ...and back to rgb
+ if(s == 0) {
+ r = g = b = v; }
+ else {
+ h /= 60.0;
+ floorh = (int)h;
+ fracth = h - floorh;
+ p = v * (1.0 - s);
+ q = v * (1.0 - (s * fracth));
+ t = v * (1.0 - (s * (1.0 - fracth)));
+ switch (floorh) {
+ case 0: r = v; g = t; b = p; break;
+ case 1: r = q; g = v; b = p; break;
+ case 2: r = p; g = v; b = t; break;
+ case 3: r = p; g = q; b = v; break;
+ case 4: r = t; g = p; b = v; break;
+ case 5: r = v; g = p; b = q; break;
+ }
+ }
+
+ V[0] = r;
+ V[1] = g;
+ V[2] = b;
+}
+
+//------------------------------------------------------------------------------
+// STREAM FUNCTIONS
+//------------------------------------------------------------------------------
+
+
+
+//! global string for formatting vector output in utilities.cpp
+//extern const char *globVecFormatStr;
+#if 0
+static const char *globVecFormatStr = "[%6.4f,%6.4f,%6.4f]";
+#endif
+
+/*************************************************************************
+ Outputs the object in human readable form using the format
+ [x,y,z]
+ */
+template<class Scalar>
+std::ostream&
+operator<<( std::ostream& os, const BasicVector::Vector3Dim<Scalar>& i )
+{
+ char buf[256];
+#if 0
+#if _WIN32
+ sprintf(buf,globVecFormatStr, (double)i[0],(double)i[1],(double)i[2]);
+#else
+ snprintf(buf,256,globVecFormatStr, (double)i[0],(double)i[1],(double)i[2]);
+#endif
+ os << std::string(buf);
+#endif
+ return os;
+}
+
+
+/*************************************************************************
+ Reads the contents of the object from a stream using the same format
+ as the output operator.
+ */
+template<class Scalar>
+std::istream&
+operator>>( std::istream& is, BasicVector::Vector3Dim<Scalar>& i )
+{
+ char c;
+ char dummy[3];
+ is >> c >> i[0] >> dummy >> i[1] >> dummy >> i[2] >> c;
+ return is;
+}
+
+
+/**************************************************************************/
+// typedefs!
+/**************************************************************************/
+
+/* get minimal vector length value that can be discriminated. */
+inline Real getVecEpsilon() { return (Real)VECTOR_EPSILON; }
+
+// a 3D integer vector
+typedef Vector3Dim<int> Vec3Int;
+
+// a 3D vector
+typedef Vector3Dim<Real> Vec3;
+
+
+}; // namespace
+
+
+#endif /* BASICVECTOR_H */
diff --git a/intern/smoke/intern/WAVELET_NOISE.h b/intern/smoke/intern/WAVELET_NOISE.h
new file mode 100644
index 00000000000..4c2e7514af7
--- /dev/null
+++ b/intern/smoke/intern/WAVELET_NOISE.h
@@ -0,0 +1,458 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+//////////////////////////////////////////////////////////////////////////////////////////
+// Wavelet noise functions
+//
+// This code is based on the C code provided in the appendices of:
+//
+// @article{1073264,
+// author = {Robert L. Cook and Tony DeRose},
+// title = {Wavelet noise},
+// journal = {ACM Trans. Graph.},
+// volume = {24},
+// number = {3},
+// year = {2005},
+// issn = {0730-0301},
+// pages = {803--811},
+// doi = {http://doi.acm.org/10.1145/1073204.1073264},
+// publisher = {ACM},
+// address = {New York, NY, USA},
+// }
+//
+//////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef WAVELET_NOISE_H
+#define WAVELET_NOISE_H
+
+#include <MERSENNETWISTER.h>
+
+#define NOISE_TILE_SIZE 128
+static const int noiseTileSize = NOISE_TILE_SIZE;
+
+// warning - noiseTileSize has to be 128^3!
+#define modFast128(x) ((x) & 127)
+#define modFast64(x) ((x) & 63)
+#define DOWNCOEFFS 0.000334f,-0.001528f, 0.000410f, 0.003545f,-0.000938f,-0.008233f, 0.002172f, 0.019120f, \
+ -0.005040f,-0.044412f, 0.011655f, 0.103311f,-0.025936f,-0.243780f, 0.033979f, 0.655340f, \
+ 0.655340f, 0.033979f,-0.243780f,-0.025936f, 0.103311f, 0.011655f,-0.044412f,-0.005040f, \
+ 0.019120f, 0.002172f,-0.008233f,-0.000938f, 0.003546f, 0.000410f,-0.001528f, 0.000334f
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Wavelet downsampling -- periodic boundary conditions
+//////////////////////////////////////////////////////////////////////////////////////////
+static void downsampleX(float *from, float *to, int n){
+ // if these values are not local incorrect results are generated
+ float downCoeffs[32] = { DOWNCOEFFS };
+ const float *a = &downCoeffs[16];
+ for (int i = 0; i < n / 2; i++) {
+ to[i] = 0;
+ for (int k = 2 * i - 16; k <= 2 * i + 16; k++)
+ to[i] += a[k - 2 * i] * from[modFast128(k)];
+ }
+}
+static void downsampleY(float *from, float *to, int n){
+ // if these values are not local incorrect results are generated
+ float downCoeffs[32] = { DOWNCOEFFS };
+ const float *a = &downCoeffs[16];
+ for (int i = 0; i < n / 2; i++) {
+ to[i * n] = 0;
+ for (int k = 2 * i - 16; k <= 2 * i + 16; k++)
+ to[i * n] += a[k - 2 * i] * from[modFast128(k) * n];
+ }
+}
+static void downsampleZ(float *from, float *to, int n){
+ // if these values are not local incorrect results are generated
+ float downCoeffs[32] = { DOWNCOEFFS };
+ const float *a = &downCoeffs[16];
+ for (int i = 0; i < n / 2; i++) {
+ to[i * n * n] = 0;
+ for (int k = 2 * i - 16; k <= 2 * i + 16; k++)
+ to[i * n * n] += a[k - 2 * i] * from[modFast128(k) * n * n];
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Wavelet downsampling -- Neumann boundary conditions
+//////////////////////////////////////////////////////////////////////////////////////////
+static void downsampleNeumann(const float *from, float *to, int n, int stride)
+{
+ // if these values are not local incorrect results are generated
+ float downCoeffs[32] = { DOWNCOEFFS };
+ static const float *const aCoCenter= &downCoeffs[16];
+ for (int i = 0; i < n / 2; i++) {
+ to[i * stride] = 0;
+ for (int k = 2 * i - 16; k < 2 * i + 16; k++) {
+ // handle boundary
+ float fromval;
+ if (k < 0) {
+ fromval = from[0];
+ } else if(k > n - 1) {
+ fromval = from[(n - 1) * stride];
+ } else {
+ fromval = from[k * stride];
+ }
+ to[i * stride] += aCoCenter[k - 2 * i] * fromval;
+ }
+ }
+}
+static void downsampleXNeumann(float* to, const float* from, int sx,int sy, int sz) {
+ for (int iy = 0; iy < sy; iy++)
+ for (int iz = 0; iz < sz; iz++) {
+ const int i = iy * sx + iz*sx*sy;
+ downsampleNeumann(&from[i], &to[i], sx, 1);
+ }
+}
+static void downsampleYNeumann(float* to, const float* from, int sx,int sy, int sz) {
+ for (int ix = 0; ix < sx; ix++)
+ for (int iz = 0; iz < sz; iz++) {
+ const int i = ix + iz*sx*sy;
+ downsampleNeumann(&from[i], &to[i], sy, sx);
+ }
+}
+static void downsampleZNeumann(float* to, const float* from, int sx,int sy, int sz) {
+ for (int ix = 0; ix < sx; ix++)
+ for (int iy = 0; iy < sy; iy++) {
+ const int i = ix + iy*sx;
+ downsampleNeumann(&from[i], &to[i], sz, sx*sy);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Wavelet upsampling - periodic boundary conditions
+//////////////////////////////////////////////////////////////////////////////////////////
+static float _upCoeffs[4] = {0.25f, 0.75f, 0.75f, 0.25f};
+static void upsampleX(float *from, float *to, int n) {
+ const float *p = &_upCoeffs[2];
+
+ for (int i = 0; i < n; i++) {
+ to[i] = 0;
+ for (int k = i / 2; k <= i / 2 + 1; k++)
+ to[i] += p[i - 2 * k] * from[modFast64(k)];
+ }
+}
+static void upsampleY(float *from, float *to, int n) {
+ const float *p = &_upCoeffs[2];
+
+ for (int i = 0; i < n; i++) {
+ to[i * n] = 0;
+ for (int k = i / 2; k <= i / 2 + 1; k++)
+ to[i * n] += p[i - 2 * k] * from[modFast64(k) * n];
+ }
+}
+static void upsampleZ(float *from, float *to, int n) {
+ const float *p = &_upCoeffs[2];
+
+ for (int i = 0; i < n; i++) {
+ to[i * n * n] = 0;
+ for (int k = i / 2; k <= i / 2 + 1; k++)
+ to[i * n * n] += p[i - 2 * k] * from[modFast64(k) * n * n];
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Wavelet upsampling - Neumann boundary conditions
+//////////////////////////////////////////////////////////////////////////////////////////
+static void upsampleNeumann(const float *from, float *to, int n, int stride) {
+ static const float *const pCoCenter = &_upCoeffs[2];
+ for (int i = 0; i < n; i++) {
+ to[i * stride] = 0;
+ for (int k = i / 2; k <= i / 2 + 1; k++) {
+ float fromval;
+ if(k>n/2) {
+ fromval = from[(n/2) * stride];
+ } else {
+ fromval = from[k * stride];
+ }
+ to[i * stride] += pCoCenter[i - 2 * k] * fromval;
+ }
+ }
+}
+static void upsampleXNeumann(float* to, const float* from, int sx, int sy, int sz) {
+ for (int iy = 0; iy < sy; iy++)
+ for (int iz = 0; iz < sz; iz++) {
+ const int i = iy * sx + iz*sx*sy;
+ upsampleNeumann(&from[i], &to[i], sx, 1);
+ }
+}
+static void upsampleYNeumann(float* to, const float* from, int sx, int sy, int sz) {
+ for (int ix = 0; ix < sx; ix++)
+ for (int iz = 0; iz < sz; iz++) {
+ const int i = ix + iz*sx*sy;
+ upsampleNeumann(&from[i], &to[i], sy, sx);
+ }
+}
+static void upsampleZNeumann(float* to, const float* from, int sx, int sy, int sz) {
+ for (int ix = 0; ix < sx; ix++)
+ for (int iy = 0; iy < sy; iy++) {
+ const int i = ix + iy*sx;
+ upsampleNeumann(&from[i], &to[i], sz, sx*sy);
+ }
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// load in an existing noise tile
+//////////////////////////////////////////////////////////////////////////////////////////
+static bool loadTile(float* const noiseTileData, std::string filename)
+{
+ FILE* file;
+ file = fopen(filename.c_str(), "rb");
+
+ if (file == NULL) {
+ printf("loadTile: No noise tile '%s' found.\n", filename.c_str());
+ return false;
+ }
+
+ // dimensions
+ size_t gridSize = noiseTileSize * noiseTileSize * noiseTileSize;
+
+ // noiseTileData memory is managed by caller
+ size_t bread = fread((void*)noiseTileData, sizeof(float), gridSize, file);
+ fclose(file);
+ printf("Noise tile file '%s' loaded.\n", filename.c_str());
+
+ if (bread != gridSize) {
+ printf("loadTile: Noise tile '%s' is wrong size %d.\n", filename.c_str(), (int)bread);
+ return false;
+ }
+ return true;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// write out an existing noise tile
+//////////////////////////////////////////////////////////////////////////////////////////
+static void saveTile(float* const noiseTileData, std::string filename)
+{
+ FILE* file;
+ file = fopen(filename.c_str(), "wb");
+
+ if (file == NULL) {
+ printf("saveTile: Noise tile '%s' could not be saved.\n", filename.c_str());
+ return;
+ }
+
+ fwrite((void*)noiseTileData, sizeof(float), noiseTileSize * noiseTileSize * noiseTileSize, file);
+ fclose(file);
+
+ printf("saveTile: Noise tile file '%s' saved.\n", filename.c_str());
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// create a new noise tile if necessary
+//////////////////////////////////////////////////////////////////////////////////////////
+static void generateTile_WAVELET(float* const noiseTileData, std::string filename) {
+ // if a tile already exists, just use that
+ if (loadTile(noiseTileData, filename)) return;
+
+ const int n = noiseTileSize;
+ const int n3 = n*n*n;
+ std::cout <<"Generating new 3d noise tile size="<<n<<"^3 \n";
+ MTRand twister;
+
+ float *temp13 = new float[n3];
+ float *temp23 = new float[n3];
+ float *noise3 = new float[n3];
+
+ // initialize
+ for (int i = 0; i < n3; i++) {
+ temp13[i] = temp23[i] = noise3[i] = 0.;
+ }
+
+ // Step 1. Fill the tile with random numbers in the range -1 to 1.
+ for (int i = 0; i < n3; i++)
+ noise3[i] = twister.randNorm();
+
+ // Steps 2 and 3. Downsample and upsample the tile
+ for (int iy = 0; iy < n; iy++)
+ for (int iz = 0; iz < n; iz++) {
+ const int i = iy * n + iz*n*n;
+ downsampleX(&noise3[i], &temp13[i], n);
+ upsampleX (&temp13[i], &temp23[i], n);
+ }
+ for (int ix = 0; ix < n; ix++)
+ for (int iz = 0; iz < n; iz++) {
+ const int i = ix + iz*n*n;
+ downsampleY(&temp23[i], &temp13[i], n);
+ upsampleY (&temp13[i], &temp23[i], n);
+ }
+ for (int ix = 0; ix < n; ix++)
+ for (int iy = 0; iy < n; iy++) {
+ const int i = ix + iy*n;
+ downsampleZ(&temp23[i], &temp13[i], n);
+ upsampleZ (&temp13[i], &temp23[i], n);
+ }
+
+ // Step 4. Subtract out the coarse-scale contribution
+ for (int i = 0; i < n3; i++)
+ noise3[i] -= temp23[i];
+
+ // Avoid even/odd variance difference by adding odd-offset version of noise to itself.
+ int offset = n / 2;
+ if (offset % 2 == 0) offset++;
+
+ int icnt=0;
+ for (int ix = 0; ix < n; ix++)
+ for (int iy = 0; iy < n; iy++)
+ for (int iz = 0; iz < n; iz++) {
+ temp13[icnt] = noise3[modFast128(ix+offset) + modFast128(iy+offset)*n + modFast128(iz+offset)*n*n];
+ icnt++;
+ }
+
+ for (int i = 0; i < n3; i++)
+ noise3[i] += temp13[i];
+
+ for (int i = 0; i < n3; i++)
+ noiseTileData[i] = noise3[i];
+
+ saveTile(noise3, filename);
+ delete[] temp13;
+ delete[] temp23;
+ delete[] noise3;
+ std::cout <<"Generating new 3d noise done\n";
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// x derivative of noise
+//////////////////////////////////////////////////////////////////////////////////////////
+static inline float WNoiseDx(Vec3 p, float* data) {
+ int c[3], mid[3], n = noiseTileSize;
+ float w[3][3], t, result = 0;
+
+ mid[0] = (int)ceil(p[0] - 0.5);
+ t = mid[0] - (p[0] - 0.5);
+ w[0][0] = -t;
+ w[0][2] = (1.f - t);
+ w[0][1] = 2.0f * t - 1.0f;
+
+ mid[1] = (int)ceil(p[1] - 0.5);
+ t = mid[1] - (p[1] - 0.5);
+ w[1][0] = t * t / 2;
+ w[1][2] = (1 - t) * (1 - t) / 2;
+ w[1][1] = 1 - w[1][0] - w[1][2];
+
+ mid[2] = (int)ceil(p[2] - 0.5);
+ t = mid[2] - (p[2] - 0.5);
+ w[2][0] = t * t / 2;
+ w[2][2] = (1 - t) * (1 - t)/2;
+ w[2][1] = 1 - w[2][0] - w[2][2];
+
+ // to optimize, explicitly unroll this loop
+ for (int z = -1; z <=1; z++)
+ for (int y = -1; y <=1; y++)
+ for (int x = -1; x <=1; x++)
+ {
+ float weight = 1.0f;
+ c[0] = modFast128(mid[0] + x);
+ weight *= w[0][x+1];
+ c[1] = modFast128(mid[1] + y);
+ weight *= w[1][y+1];
+ c[2] = modFast128(mid[2] + z);
+ weight *= w[2][z+1];
+ result += weight * data[c[2]*n*n+c[1]*n+c[0]];
+ }
+ return result;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// y derivative of noise
+//////////////////////////////////////////////////////////////////////////////////////////
+static inline float WNoiseDy(Vec3 p, float* data) {
+ int c[3], mid[3], n=noiseTileSize;
+ float w[3][3], t, result =0;
+
+ mid[0] = (int)ceil(p[0] - 0.5);
+ t = mid[0]-(p[0] - 0.5);
+ w[0][0] = t * t / 2;
+ w[0][2] = (1 - t) * (1 - t) / 2;
+ w[0][1] = 1 - w[0][0] - w[0][2];
+
+ mid[1] = (int)ceil(p[1] - 0.5);
+ t = mid[1]-(p[1] - 0.5);
+ w[1][0] = -t;
+ w[1][2] = (1.f - t);
+ w[1][1] = 2.0f * t - 1.0f;
+
+ mid[2] = (int)ceil(p[2] - 0.5);
+ t = mid[2] - (p[2] - 0.5);
+ w[2][0] = t * t / 2;
+ w[2][2] = (1 - t) * (1 - t)/2;
+ w[2][1] = 1 - w[2][0] - w[2][2];
+
+ // to optimize, explicitly unroll this loop
+ for (int z = -1; z <=1; z++)
+ for (int y = -1; y <=1; y++)
+ for (int x = -1; x <=1; x++)
+ {
+ float weight = 1.0f;
+ c[0] = modFast128(mid[0] + x);
+ weight *= w[0][x+1];
+ c[1] = modFast128(mid[1] + y);
+ weight *= w[1][y+1];
+ c[2] = modFast128(mid[2] + z);
+ weight *= w[2][z+1];
+ result += weight * data[c[2]*n*n+c[1]*n+c[0]];
+ }
+
+ return result;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// z derivative of noise
+//////////////////////////////////////////////////////////////////////////////////////////
+static inline float WNoiseDz(Vec3 p, float* data) {
+ int c[3], mid[3], n=noiseTileSize;
+ float w[3][3], t, result =0;
+
+ mid[0] = (int)ceil(p[0] - 0.5);
+ t = mid[0]-(p[0] - 0.5);
+ w[0][0] = t * t / 2;
+ w[0][2] = (1 - t) * (1 - t) / 2;
+ w[0][1] = 1 - w[0][0] - w[0][2];
+
+ mid[1] = (int)ceil(p[1] - 0.5);
+ t = mid[1]-(p[1] - 0.5);
+ w[1][0] = t * t / 2;
+ w[1][2] = (1 - t) * (1 - t) / 2;
+ w[1][1] = 1 - w[1][0] - w[1][2];
+
+ mid[2] = (int)ceil(p[2] - 0.5);
+ t = mid[2] - (p[2] - 0.5);
+ w[2][0] = -t;
+ w[2][2] = (1.f - t);
+ w[2][1] = 2.0f * t - 1.0f;
+
+ // to optimize, explicitly unroll this loop
+ for (int z = -1; z <=1; z++)
+ for (int y = -1; y <=1; y++)
+ for (int x = -1; x <=1; x++)
+ {
+ float weight = 1.0f;
+ c[0] = modFast128(mid[0] + x);
+ weight *= w[0][x+1];
+ c[1] = modFast128(mid[1] + y);
+ weight *= w[1][y+1];
+ c[2] = modFast128(mid[2] + z);
+ weight *= w[2][z+1];
+ result += weight * data[c[2]*n*n+c[1]*n+c[0]];
+ }
+ return result;
+}
+
+#endif
+
diff --git a/intern/smoke/intern/WTURBULENCE.cpp b/intern/smoke/intern/WTURBULENCE.cpp
new file mode 100644
index 00000000000..dd092d4f0cc
--- /dev/null
+++ b/intern/smoke/intern/WTURBULENCE.cpp
@@ -0,0 +1,1013 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// WTURBULENCE handling
+///////////////////////////////////////////////////////////////////////////////////
+
+#include "WTURBULENCE.h"
+#include "INTERPOLATE.h"
+#include "IMAGE.h"
+#include <MERSENNETWISTER.h>
+#include "WAVELET_NOISE.h"
+#include "FFT_NOISE.h"
+#include "EIGENVALUE_HELPER.h"
+#include "LU_HELPER.h"
+#include "SPHERE.h"
+#include <zlib.h>
+
+// needed to access static advection functions
+#include "FLUID_3D.h"
+
+#if PARALLEL==1
+#include <omp.h>
+#endif // PARALLEL
+
+// 2^ {-5/6}
+static const float persistence = 0.56123f;
+
+//////////////////////////////////////////////////////////////////////
+// constructor
+//////////////////////////////////////////////////////////////////////
+WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int noisetype)
+{
+ // if noise magnitude is below this threshold, its contribution
+ // is negilgible, so stop evaluating new octaves
+ _cullingThreshold = 1e-3;
+
+ // factor by which to increase the simulation resolution
+ _amplify = amplify;
+
+ // manually adjust the overall amount of turbulence
+ // DG - RNA-fied _strength = 2.;
+
+ // add the corresponding octaves of noise
+ _octaves = (int)(log((float)_amplify) / log(2.0f) + 0.5); // XXX DEBUG/ TODO: int casting correct? - dg
+
+ // noise resolution
+ _xResBig = _amplify * xResSm;
+ _yResBig = _amplify * yResSm;
+ _zResBig = _amplify * zResSm;
+ _resBig = Vec3Int(_xResBig, _yResBig, _zResBig);
+ _invResBig = Vec3(1./(float)_resBig[0], 1./(float)_resBig[1], 1./(float)_resBig[2]);
+ _slabSizeBig = _xResBig*_yResBig;
+ _totalCellsBig = _slabSizeBig * _zResBig;
+
+ // original / small resolution
+ _xResSm = xResSm;
+ _yResSm = yResSm;
+ _zResSm = zResSm;
+ _resSm = Vec3Int(xResSm, yResSm, zResSm);
+ _invResSm = Vec3(1./(float)_resSm[0], 1./(float)_resSm[1], 1./(float)_resSm[2] );
+ _slabSizeSm = _xResSm*_yResSm;
+ _totalCellsSm = _slabSizeSm * _zResSm;
+
+ // allocate high resolution density field
+ _totalStepsBig = 0;
+ _densityBig = new float[_totalCellsBig];
+ _densityBigOld = new float[_totalCellsBig];
+
+ for(int i = 0; i < _totalCellsBig; i++) {
+ _densityBig[i] =
+ _densityBigOld[i] = 0.;
+ }
+
+ // allocate & init texture coordinates
+ _tcU = new float[_totalCellsSm];
+ _tcV = new float[_totalCellsSm];
+ _tcW = new float[_totalCellsSm];
+ _tcTemp = new float[_totalCellsSm];
+
+ // allocate & init energy terms
+ _energy = new float[_totalCellsSm];
+ _highFreqEnergy = new float[_totalCellsSm];
+
+ // map all
+ const float dx = 1./(float)(_resSm[0]);
+ const float dy = 1./(float)(_resSm[1]);
+ const float dz = 1./(float)(_resSm[2]);
+ int index = 0;
+ for (int z = 0; z < _zResSm; z++)
+ for (int y = 0; y < _yResSm; y++)
+ for (int x = 0; x < _xResSm; x++, index++)
+ {
+ _tcU[index] = x*dx;
+ _tcV[index] = y*dy;
+ _tcW[index] = z*dz;
+ _tcTemp[index] = 0.;
+ _energy[index] = 0.;
+ }
+
+ // allocate eigenvalue arrays
+ _eigMin = new float[_totalCellsSm];
+ _eigMax = new float[_totalCellsSm];
+ for(int i=0; i < _totalCellsSm; i++)
+ _eigMin[i] = _eigMax[i] = 0.;
+
+ // noise tiles
+ _noiseTile = new float[noiseTileSize * noiseTileSize * noiseTileSize];
+ /*
+ std::string noiseTileFilename = std::string("noise.wavelets");
+ generateTile_WAVELET(_noiseTile, noiseTileFilename);
+ */
+ setNoise(noisetype);
+ /*
+ std::string noiseTileFilename = std::string("noise.fft");
+ generatTile_FFT(_noiseTile, noiseTileFilename);
+ */
+}
+
+//////////////////////////////////////////////////////////////////////
+// destructor
+//////////////////////////////////////////////////////////////////////
+WTURBULENCE::~WTURBULENCE() {
+ delete[] _densityBig;
+ delete[] _densityBigOld;
+
+ delete[] _tcU;
+ delete[] _tcV;
+ delete[] _tcW;
+ delete[] _tcTemp;
+
+ delete[] _eigMin;
+ delete[] _eigMax;
+ delete[] _noiseTile;
+
+ delete[] _energy;
+ delete[] _highFreqEnergy;
+}
+
+//////////////////////////////////////////////////////////////////////
+// Change noise type
+//
+// type (1<<0) = wavelet / 2
+// type (1<<1) = FFT / 4
+// type (1<<2) = curl / 8
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::setNoise(int type)
+{
+ if(type == (1<<1)) // FFT
+ {
+ // needs fft
+ #if FFTW3==1
+ std::string noiseTileFilename = std::string("noise.fft");
+ generatTile_FFT(_noiseTile, noiseTileFilename);
+ #endif
+ }
+ else if(type == (1<<2)) // curl
+ {
+ // TODO: not supported yet
+ }
+ else // standard - wavelet
+ {
+ std::string noiseTileFilename = std::string("noise.wavelets");
+ generateTile_WAVELET(_noiseTile, noiseTileFilename);
+ }
+}
+
+// init direct access functions from blender
+void WTURBULENCE::initBlenderRNA(float *strength)
+{
+ _strength = strength;
+}
+
+//////////////////////////////////////////////////////////////////////
+// Get the smallest valid x derivative
+//
+// Takes the one-sided finite difference in both directions and
+// selects the smaller of the two
+//////////////////////////////////////////////////////////////////////
+static float minDx(int x, int y, int z, float* input, Vec3Int res)
+{
+ const int index = x + y * res[0] + z * res[0] * res[1];
+ const int maxx = res[0]-2;
+
+ // get grid values
+ float center = input[index];
+ float left = (x <= 1) ? FLT_MAX : input[index - 1];
+ float right = (x >= maxx) ? FLT_MAX : input[index + 1];
+
+ const float dx = res[0];
+
+ // get all the derivative estimates
+ float dLeft = (x <= 1) ? FLT_MAX : (center - left) * dx;
+ float dRight = (x >= maxx) ? FLT_MAX : (right - center) * dx;
+ float dCenter = (x <= 1 || x >= maxx) ? FLT_MAX : (right - left) * dx * 0.5f;
+
+ // if it's on a boundary, only one estimate is valid
+ if (x <= 1) return dRight;
+ if (x >= maxx) return dLeft;
+
+ // if it's not on a boundary, get the smallest one
+ float finalD;
+ finalD = (fabs(dCenter) < fabs(dRight)) ? dCenter : dRight;
+ finalD = (fabs(finalD) < fabs(dLeft)) ? finalD : dLeft;
+
+ return finalD;
+}
+
+//////////////////////////////////////////////////////////////////////
+// get the smallest valid y derivative
+//
+// Takes the one-sided finite difference in both directions and
+// selects the smaller of the two
+//////////////////////////////////////////////////////////////////////
+static float minDy(int x, int y, int z, float* input, Vec3Int res)
+{
+ const int index = x + y * res[0] + z * res[0] * res[1];
+ const int maxy = res[1]-2;
+
+ // get grid values
+ float center = input[index];
+ float down = (y <= 1) ? FLT_MAX : input[index - res[0]];
+ float up = (y >= maxy) ? FLT_MAX : input[index + res[0]];
+
+ const float dx = res[1]; // only for square domains
+
+ // get all the derivative estimates
+ float dDown = (y <= 1) ? FLT_MAX : (center - down) * dx;
+ float dUp = (y >= maxy) ? FLT_MAX : (up - center) * dx;
+ float dCenter = (y <= 1 || y >= maxy) ? FLT_MAX : (up - down) * dx * 0.5f;
+
+ // if it's on a boundary, only one estimate is valid
+ if (y <= 1) return dUp;
+ if (y >= maxy) return dDown;
+
+ // if it's not on a boundary, get the smallest one
+ float finalD = (fabs(dCenter) < fabs(dUp)) ? dCenter : dUp;
+ finalD = (fabs(finalD) < fabs(dDown)) ? finalD : dDown;
+
+ return finalD;
+}
+
+//////////////////////////////////////////////////////////////////////
+// get the smallest valid z derivative
+//
+// Takes the one-sided finite difference in both directions and
+// selects the smaller of the two
+//////////////////////////////////////////////////////////////////////
+static float minDz(int x, int y, int z, float* input, Vec3Int res)
+{
+ const int slab = res[0]*res[1];
+ const int index = x + y * res[0] + z * slab;
+ const int maxz = res[2]-2;
+
+ // get grid values
+ float center = input[index];
+ float front = (z <= 1) ? FLT_MAX : input[index - slab];
+ float back = (z >= maxz) ? FLT_MAX : input[index + slab];
+
+ const float dx = res[2]; // only for square domains
+
+ // get all the derivative estimates
+ float dfront = (z <= 1) ? FLT_MAX : (center - front) * dx;
+ float dback = (z >= maxz) ? FLT_MAX : (back - center) * dx;
+ float dCenter = (z <= 1 || z >= maxz) ? FLT_MAX : (back - front) * dx * 0.5f;
+
+ // if it's on a boundary, only one estimate is valid
+ if (z <= 1) return dback;
+ if (z >= maxz) return dfront;
+
+ // if it's not on a boundary, get the smallest one
+ float finalD = (fabs(dCenter) < fabs(dback)) ? dCenter : dback;
+ finalD = (fabs(finalD) < fabs(dfront)) ? finalD : dfront;
+
+ return finalD;
+}
+
+//////////////////////////////////////////////////////////////////////
+// handle texture coordinates (advection, reset, eigenvalues),
+// Beware -- uses big density maccormack as temporary arrays
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel, float *_tempBig1, float *_tempBig2) {
+ // advection
+ SWAP_POINTERS(_tcTemp, _tcU);
+ FLUID_3D::copyBorderX(_tcTemp, _resSm);
+ FLUID_3D::copyBorderY(_tcTemp, _resSm);
+ FLUID_3D::copyBorderZ(_tcTemp, _resSm);
+ FLUID_3D::advectFieldMacCormack(dtOrg, xvel, yvel, zvel,
+ _tcTemp, _tcU, _tempBig1, _tempBig2, _resSm, NULL);
+
+ SWAP_POINTERS(_tcTemp, _tcV);
+ FLUID_3D::copyBorderX(_tcTemp, _resSm);
+ FLUID_3D::copyBorderY(_tcTemp, _resSm);
+ FLUID_3D::copyBorderZ(_tcTemp, _resSm);
+ FLUID_3D::advectFieldMacCormack(dtOrg, xvel, yvel, zvel,
+ _tcTemp, _tcV, _tempBig1, _tempBig2, _resSm, NULL);
+
+ SWAP_POINTERS(_tcTemp, _tcW);
+ FLUID_3D::copyBorderX(_tcTemp, _resSm);
+ FLUID_3D::copyBorderY(_tcTemp, _resSm);
+ FLUID_3D::copyBorderZ(_tcTemp, _resSm);
+ FLUID_3D::advectFieldMacCormack(dtOrg, xvel, yvel, zvel,
+ _tcTemp, _tcW, _tempBig1, _tempBig2, _resSm, NULL);
+}
+
+//////////////////////////////////////////////////////////////////////
+// Compute the eigenvalues of the advected texture
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::computeEigenvalues() {
+ // stats
+ float maxeig = -1.;
+ float mineig = 10.;
+
+ // texture coordinate eigenvalues
+ for (int z = 1; z < _zResSm-1; z++) {
+ for (int y = 1; y < _yResSm-1; y++)
+ for (int x = 1; x < _xResSm-1; x++)
+ {
+ const int index = x+ y *_resSm[0] + z*_slabSizeSm;
+
+ // compute jacobian
+ float jacobian[3][3] = {
+ { minDx(x, y, z, _tcU, _resSm), minDx(x, y, z, _tcV, _resSm), minDx(x, y, z, _tcW, _resSm) } ,
+ { minDy(x, y, z, _tcU, _resSm), minDy(x, y, z, _tcV, _resSm), minDy(x, y, z, _tcW, _resSm) } ,
+ { minDz(x, y, z, _tcU, _resSm), minDz(x, y, z, _tcV, _resSm), minDz(x, y, z, _tcW, _resSm) }
+ };
+
+ // ONLY compute the eigenvalues after checking that the matrix
+ // is nonsingular
+ JAMA::LU<float> LU = computeLU3x3(jacobian);
+
+ if (LU.isNonsingular())
+ {
+ // get the analytic eigenvalues, quite slow right now...
+ Vec3 eigenvalues = Vec3(1.);
+ computeEigenvalues3x3( &eigenvalues[0], jacobian);
+ _eigMax[index] = MAX3V(eigenvalues);
+ _eigMin[index] = MIN3V(eigenvalues);
+ maxeig = MAX(_eigMax[index],maxeig);
+ mineig = MIN(_eigMin[index],mineig);
+ }
+ else
+ {
+ _eigMax[index] = 10.0f;
+ _eigMin[index] = 0.1;
+ }
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// advect & reset texture coordinates based on eigenvalues
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::resetTextureCoordinates()
+{
+ // allowed deformation of the textures
+ const float limit = 2.f;
+ const float limitInv = 1./limit;
+
+ // standard reset
+ int resets = 0;
+ const float dx = 1./(float)(_resSm[0]);
+ const float dy = 1./(float)(_resSm[1]);
+ const float dz = 1./(float)(_resSm[2]);
+
+ for (int z = 1; z < _zResSm-1; z++)
+ for (int y = 1; y < _yResSm-1; y++)
+ for (int x = 1; x < _xResSm-1; x++)
+ {
+ const int index = x+ y *_resSm[0] + z*_slabSizeSm;
+ if (_eigMax[index] > limit || _eigMin[index] < limitInv)
+ {
+ _tcU[index] = (float)x * dx;
+ _tcV[index] = (float)y * dy;
+ _tcW[index] = (float)z * dz;
+ resets++;
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// Compute the highest frequency component of the wavelet
+// decomposition
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::decomposeEnergy()
+{
+ // do the decomposition -- the goal here is to have
+ // the energy with the high frequency component stomped out
+ // stored in _tcTemp when it is done. _highFreqEnergy is only used
+ // as an additional temp array
+
+ // downsample input
+ downsampleXNeumann(_highFreqEnergy, _energy, _xResSm, _yResSm, _zResSm);
+ downsampleYNeumann(_tcTemp, _highFreqEnergy, _xResSm, _yResSm, _zResSm);
+ downsampleZNeumann(_highFreqEnergy, _tcTemp, _xResSm, _yResSm, _zResSm);
+
+ // upsample input
+ upsampleZNeumann(_tcTemp, _highFreqEnergy, _xResSm, _yResSm, _zResSm);
+ upsampleYNeumann(_highFreqEnergy, _tcTemp, _xResSm, _yResSm, _zResSm);
+ upsampleXNeumann(_tcTemp, _highFreqEnergy, _xResSm, _yResSm, _zResSm);
+
+ // subtract the down and upsampled field from the original field --
+ // what should be left over is solely the high frequency component
+ int index = 0;
+ for (int z = 0; z < _zResSm; z++)
+ for (int y = 0; y < _yResSm; y++) {
+ for (int x = 0; x < _xResSm; x++, index++) {
+ // brute force reset of boundaries
+ if(z >= _zResSm - 1 || x >= _xResSm - 1 || y >= _yResSm - 1 || z <= 0 || y <= 0 || x <= 0)
+ _highFreqEnergy[index] = 0.;
+ else
+ _highFreqEnergy[index] = _energy[index] - _tcTemp[index];
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////
+// compute velocity from energies and march into obstacles
+// for wavelet decomposition
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::computeEnergy(float* xvel, float* yvel, float* zvel, unsigned char *obstacles)
+{
+ // compute everywhere
+ for (int x = 0; x < _totalCellsSm; x++)
+ _energy[x] = 0.5f * (xvel[x] * xvel[x] + yvel[x] * yvel[x] + zvel[x] * zvel[x]);
+
+ FLUID_3D::copyBorderX(_energy, _resSm);
+ FLUID_3D::copyBorderY(_energy, _resSm);
+ FLUID_3D::copyBorderZ(_energy, _resSm);
+
+ // pseudo-march the values into the obstacles
+ // the wavelet upsampler only uses a 3x3 support neighborhood, so
+ // propagating the values in by 4 should be sufficient
+ int index;
+
+ // iterate
+ for (int iter = 0; iter < 4; iter++)
+ {
+ index = _slabSizeSm + _xResSm + 1;
+ for (int z = 1; z < _zResSm - 1; z++, index += 2 * _xResSm)
+ for (int y = 1; y < _yResSm - 1; y++, index += 2)
+ for (int x = 1; x < _xResSm - 1; x++, index++)
+ if (obstacles[index] && obstacles[index] != RETIRED)
+ {
+ float sum = 0.0f;
+ int valid = 0;
+
+ if (!obstacles[index + 1] || obstacles[index + 1] == RETIRED)
+ {
+ sum += _energy[index + 1];
+ valid++;
+ }
+ if (!obstacles[index - 1] || obstacles[index - 1] == RETIRED)
+ {
+ sum += _energy[index - 1];
+ valid++;
+ }
+ if (!obstacles[index + _xResSm] || obstacles[index + _xResSm] == RETIRED)
+ {
+ sum += _energy[index + _xResSm];
+ valid++;
+ }
+ if (!obstacles[index - _xResSm] || obstacles[index - _xResSm] == RETIRED)
+ {
+ sum += _energy[index - _xResSm];
+ valid++;
+ }
+ if (!obstacles[index + _slabSizeSm] || obstacles[index + _slabSizeSm] == RETIRED)
+ {
+ sum += _energy[index + _slabSizeSm];
+ valid++;
+ }
+ if (!obstacles[index - _slabSizeSm] || obstacles[index - _slabSizeSm] == RETIRED)
+ {
+ sum += _energy[index - _slabSizeSm];
+ valid++;
+ }
+ if (valid > 0)
+ {
+ _energy[index] = sum / valid;
+ obstacles[index] = MARCHED;
+ }
+ }
+ index = _slabSizeSm + _xResSm + 1;
+ for (int z = 1; z < _zResSm - 1; z++, index += 2 * _xResSm)
+ for (int y = 1; y < _yResSm - 1; y++, index += 2)
+ for (int x = 1; x < _xResSm - 1; x++, index++)
+ if (obstacles[index] == MARCHED)
+ obstacles[index] = RETIRED;
+ }
+ index = _slabSizeSm + _xResSm + 1;
+ for (int z = 1; z < _zResSm - 1; z++, index += 2 * _xResSm)
+ for (int y = 1; y < _yResSm - 1; y++, index += 2)
+ for (int x = 1; x < _xResSm - 1; x++, index++)
+ if (obstacles[index])
+ obstacles[index] = 1;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Evaluate derivatives
+//////////////////////////////////////////////////////////////////////////////////////////
+Vec3 WTURBULENCE::WVelocity(Vec3 orgPos)
+{
+ // arbitrarily offset evaluation points
+ const Vec3 p1 = orgPos + Vec3(NOISE_TILE_SIZE/2,0,0);
+ const Vec3 p2 = orgPos + Vec3(0,NOISE_TILE_SIZE/2,0);
+ const Vec3 p3 = orgPos + Vec3(0,0,NOISE_TILE_SIZE/2);
+
+ const float f1y = WNoiseDy(p1, _noiseTile);
+ const float f1z = WNoiseDz(p1, _noiseTile);
+
+ const float f2x = WNoiseDx(p2, _noiseTile);
+ const float f2z = WNoiseDz(p2, _noiseTile);
+
+ const float f3x = WNoiseDx(p3, _noiseTile);
+ const float f3y = WNoiseDy(p3, _noiseTile);
+
+ Vec3 ret = Vec3(
+ f3y - f2z,
+ f1z - f3x,
+ f2x - f1y );
+ return ret;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Evaluate derivatives with Jacobian
+//////////////////////////////////////////////////////////////////////////////////////////
+Vec3 WTURBULENCE::WVelocityWithJacobian(Vec3 orgPos, float* xUnwarped, float* yUnwarped, float* zUnwarped)
+{
+ // arbitrarily offset evaluation points
+ const Vec3 p1 = orgPos + Vec3(NOISE_TILE_SIZE/2,0,0);
+ const Vec3 p2 = orgPos + Vec3(0,NOISE_TILE_SIZE/2,0);
+ const Vec3 p3 = orgPos + Vec3(0,0,NOISE_TILE_SIZE/2);
+
+ Vec3 final;
+ final[0] = WNoiseDx(p1, _noiseTile);
+ final[1] = WNoiseDy(p1, _noiseTile);
+ final[2] = WNoiseDz(p1, _noiseTile);
+ // UNUSED const float f1x = xUnwarped[0] * final[0] + xUnwarped[1] * final[1] + xUnwarped[2] * final[2];
+ const float f1y = yUnwarped[0] * final[0] + yUnwarped[1] * final[1] + yUnwarped[2] * final[2];
+ const float f1z = zUnwarped[0] * final[0] + zUnwarped[1] * final[1] + zUnwarped[2] * final[2];
+
+ final[0] = WNoiseDx(p2, _noiseTile);
+ final[1] = WNoiseDy(p2, _noiseTile);
+ final[2] = WNoiseDz(p2, _noiseTile);
+ const float f2x = xUnwarped[0] * final[0] + xUnwarped[1] * final[1] + xUnwarped[2] * final[2];
+ // UNUSED const float f2y = yUnwarped[0] * final[0] + yUnwarped[1] * final[1] + yUnwarped[2] * final[2];
+ const float f2z = zUnwarped[0] * final[0] + zUnwarped[1] * final[1] + zUnwarped[2] * final[2];
+
+ final[0] = WNoiseDx(p3, _noiseTile);
+ final[1] = WNoiseDy(p3, _noiseTile);
+ final[2] = WNoiseDz(p3, _noiseTile);
+ const float f3x = xUnwarped[0] * final[0] + xUnwarped[1] * final[1] + xUnwarped[2] * final[2];
+ const float f3y = yUnwarped[0] * final[0] + yUnwarped[1] * final[1] + yUnwarped[2] * final[2];
+ // UNUSED const float f3z = zUnwarped[0] * final[0] + zUnwarped[1] * final[1] + zUnwarped[2] * final[2];
+
+ Vec3 ret = Vec3(
+ f3y - f2z,
+ f1z - f3x,
+ f2x - f1y );
+ return ret;
+}
+
+//////////////////////////////////////////////////////////////////////
+// perform an actual noise advection step
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles)
+{
+ // big velocity macCormack fields
+ float* _bigUx;
+ float* _bigUy;
+ float* _bigUz;
+
+ // temp arrays for BFECC and MacCormack - they have more convenient
+ // names in the actual implementations
+ float* _tempBig1;
+ float* _tempBig2;
+
+ // allocate high resolution velocity field. Note that this is only
+ // necessary because we use MacCormack advection. For semi-Lagrangian
+ // advection, these arrays are not necessary.
+ _tempBig1 = new float[_totalCellsBig];
+ _tempBig2 = new float[_totalCellsBig];
+
+ // enlarge timestep to match grid
+ const float dt = dtOrg * _amplify;
+ const float invAmp = 1.0f / _amplify;
+
+ _bigUx = new float[_totalCellsBig];
+ _bigUy = new float[_totalCellsBig];
+ _bigUz = new float[_totalCellsBig];
+
+ // prepare textures
+ advectTextureCoordinates(dtOrg, xvel,yvel,zvel, _tempBig1, _tempBig2);
+
+ // compute eigenvalues of the texture coordinates
+ computeEigenvalues();
+
+ // do wavelet decomposition of energy
+ computeEnergy(xvel, yvel, zvel, obstacles);
+ decomposeEnergy();
+
+ // zero out coefficients inside of the obstacle
+ for (int x = 0; x < _totalCellsSm; x++)
+ if (obstacles[x]) _energy[x] = 0.f;
+
+ float maxVelocity = 0.;
+ for (int z = 1; z < _zResBig - 1; z++)
+ for (int y = 1; y < _yResBig - 1; y++)
+ for (int x = 1; x < _xResBig - 1; x++)
+ {
+ // get unit position for both fine and coarse grid
+ const Vec3 pos = Vec3(x,y,z);
+ const Vec3 posSm = pos * invAmp;
+
+ // get grid index for both fine and coarse grid
+ const int index = x + y *_xResBig + z *_slabSizeBig;
+ const int indexSmall = (int)posSm[0] + (int)posSm[1] * _xResSm + (int)posSm[2] * _slabSizeSm;
+
+ // get a linearly interpolated velocity and texcoords
+ // from the coarse grid
+ Vec3 vel = INTERPOLATE::lerp3dVec( xvel,yvel,zvel,
+ posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
+ Vec3 uvw = INTERPOLATE::lerp3dVec( _tcU,_tcV,_tcW,
+ posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
+
+ // multiply the texture coordinate by _resSm so that turbulence
+ // synthesis begins at the first octave that the coarse grid
+ // cannot capture
+ Vec3 texCoord = Vec3(uvw[0] * _resSm[0],
+ uvw[1] * _resSm[1],
+ uvw[2] * _resSm[2]);
+
+ // retrieve wavelet energy at highest frequency
+ float energy = INTERPOLATE::lerp3d(
+ _highFreqEnergy, posSm[0],posSm[1],posSm[2], _xResSm, _yResSm, _zResSm);
+
+ // base amplitude for octave 0
+ float coefficient = sqrtf(2.0f * fabs(energy));
+ const float amplitude = *_strength * fabs(0.5 * coefficient) * persistence;
+
+ // add noise to velocity, but only if the turbulence is
+ // sufficiently undeformed, and the energy is large enough
+ // to make a difference
+ const bool addNoise = _eigMax[indexSmall] < 2. &&
+ _eigMin[indexSmall] > 0.5;
+ if (addNoise && amplitude > _cullingThreshold) {
+ // base amplitude for octave 0
+ float amplitudeScaled = amplitude;
+
+ for (int octave = 0; octave < _octaves; octave++)
+ {
+ // multiply the vector noise times the maximum allowed
+ // noise amplitude at this octave, and add it to the total
+ vel += WVelocity(texCoord) * amplitudeScaled;
+
+ // scale coefficient for next octave
+ amplitudeScaled *= persistence;
+ texCoord *= 2.0f;
+ }
+ }
+
+ // Store velocity + turbulence in big grid for maccormack step
+ //
+ // If you wanted to save memory, you would instead perform a
+ // semi-Lagrangian backtrace for the current grid cell here. Then
+ // you could just throw the velocity away.
+ _bigUx[index] = vel[0];
+ _bigUy[index] = vel[1];
+ _bigUz[index] = vel[2];
+
+ // compute the velocity magnitude for substepping later
+ const float velMag = _bigUx[index] * _bigUx[index] +
+ _bigUy[index] * _bigUy[index] +
+ _bigUz[index] * _bigUz[index];
+ if (velMag > maxVelocity) maxVelocity = velMag;
+
+ // zero out velocity inside obstacles
+ float obsCheck = INTERPOLATE::lerp3dToFloat(
+ obstacles, posSm[0], posSm[1], posSm[2], _xResSm, _yResSm, _zResSm);
+ if (obsCheck > 0.95)
+ _bigUx[index] = _bigUy[index] = _bigUz[index] = 0.;
+ }
+
+ // prepare density for an advection
+ SWAP_POINTERS(_densityBig, _densityBigOld);
+
+ // based on the maximum velocity present, see if we need to substep,
+ // but cap the maximum number of substeps to 5
+ const int maxSubSteps = 25;
+ const int maxVel = 5;
+ maxVelocity = sqrt(maxVelocity) * dt;
+ int totalSubsteps = (int)(maxVelocity / (float)maxVel);
+ totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
+ totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
+ const float dtSubdiv = dt / (float)totalSubsteps;
+
+ // set boundaries of big velocity grid
+ FLUID_3D::setZeroX(_bigUx, _resBig);
+ FLUID_3D::setZeroY(_bigUy, _resBig);
+ FLUID_3D::setZeroZ(_bigUz, _resBig);
+
+ // do the MacCormack advection, with substepping if necessary
+ for(int substep = 0; substep < totalSubsteps; substep++)
+ {
+ FLUID_3D::advectFieldMacCormack(dtSubdiv, _bigUx, _bigUy, _bigUz,
+ _densityBigOld, _densityBig, _tempBig1, _tempBig2, _resBig, NULL);
+
+ if (substep < totalSubsteps - 1)
+ SWAP_POINTERS(_densityBig, _densityBigOld);
+ } // substep
+
+ // wipe the density borders
+ FLUID_3D::setZeroBorder(_densityBig, _resBig);
+
+ // reset texture coordinates now in preparation for next timestep
+ // Shouldn't do this before generating the noise because then the
+ // eigenvalues stored do not reflect the underlying texture coordinates
+ resetTextureCoordinates();
+
+ // output files
+ /*
+ string prefix = string("./amplified.preview/density_bigxy_");
+ FLUID_3D::writeImageSliceXY(_densityBig, _resBig, _resBig[2]/2, prefix, _totalStepsBig, 1.0f);
+ //string df3Prefix = string("./df3/density_big_");
+ //IMAGE::dumpDF3(_totalStepsBig, df3Prefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
+ string pbrtPrefix = string("./pbrt/density_big_");
+ IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
+ */
+ _totalStepsBig++;
+
+ delete[] _bigUx;
+ delete[] _bigUy;
+ delete[] _bigUz;
+
+ delete[] _tempBig1;
+ delete[] _tempBig2;
+}
+
+//////////////////////////////////////////////////////////////////////
+// perform the full turbulence algorithm, including OpenMP
+// if available
+//////////////////////////////////////////////////////////////////////
+void WTURBULENCE::stepTurbulenceFull(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles)
+{
+ // big velocity macCormack fields
+ float* _bigUx;
+ float* _bigUy;
+ float* _bigUz;
+
+ // temp arrays for BFECC and MacCormack - they have more convenient
+ // names in the actual implementations
+ float* _tempBig1;
+ float* _tempBig2;
+
+ // allocate high resolution velocity field. Note that this is only
+ // necessary because we use MacCormack advection. For semi-Lagrangian
+ // advection, these arrays are not necessary.
+ _tempBig1 = new float[_totalCellsBig];
+ _tempBig2 = new float[_totalCellsBig];
+
+ // enlarge timestep to match grid
+ const float dt = dtOrg * _amplify;
+ const float invAmp = 1.0f / _amplify;
+
+ _bigUx = new float[_totalCellsBig];
+ _bigUy = new float[_totalCellsBig];
+ _bigUz = new float[_totalCellsBig];
+
+ // prepare textures
+ advectTextureCoordinates(dtOrg, xvel,yvel,zvel, _tempBig1, _tempBig2);
+
+ // do wavelet decomposition of energy
+ computeEnergy(xvel, yvel, zvel, obstacles);
+ decomposeEnergy();
+
+ // zero out coefficients inside of the obstacle
+ for (int x = 0; x < _totalCellsSm; x++)
+ if (obstacles[x]) _energy[x] = 0.f;
+
+ // parallel region setup
+ float maxVelMagThreads[8] = { -1., -1., -1., -1., -1., -1., -1., -1. };
+
+ #if PARALLEL==1
+ #pragma omp parallel
+ #endif
+ { float maxVelMag1 = 0.;
+ #if PARALLEL==1
+ const int id = omp_get_thread_num(); /*, num = omp_get_num_threads(); */
+ #endif
+
+ // vector noise main loop
+ #if PARALLEL==1
+ #pragma omp for schedule(static)
+ #endif
+ for (int zSmall = 0; zSmall < _zResSm; zSmall++)
+ for (int ySmall = 0; ySmall < _yResSm; ySmall++)
+ for (int xSmall = 0; xSmall < _xResSm; xSmall++)
+ {
+ const int indexSmall = xSmall + ySmall * _xResSm + zSmall * _slabSizeSm;
+
+ // compute jacobian
+ float jacobian[3][3] = {
+ { minDx(xSmall, ySmall, zSmall, _tcU, _resSm), minDx(xSmall, ySmall, zSmall, _tcV, _resSm), minDx(xSmall, ySmall, zSmall, _tcW, _resSm) } ,
+ { minDy(xSmall, ySmall, zSmall, _tcU, _resSm), minDy(xSmall, ySmall, zSmall, _tcV, _resSm), minDy(xSmall, ySmall, zSmall, _tcW, _resSm) } ,
+ { minDz(xSmall, ySmall, zSmall, _tcU, _resSm), minDz(xSmall, ySmall, zSmall, _tcV, _resSm), minDz(xSmall, ySmall, zSmall, _tcW, _resSm) }
+ };
+
+ // get LU factorization of texture jacobian and apply
+ // it to unit vectors
+ JAMA::LU<float> LU = computeLU3x3(jacobian);
+ float xUnwarped[] = {1.0f, 0.0f, 0.0f};
+ float yUnwarped[] = {0.0f, 1.0f, 0.0f};
+ float zUnwarped[] = {0.0f, 0.0f, 1.0f};
+ float xWarped[] = {1.0f, 0.0f, 0.0f};
+ float yWarped[] = {0.0f, 1.0f, 0.0f};
+ float zWarped[] = {0.0f, 0.0f, 1.0f};
+ bool nonSingular = LU.isNonsingular();
+
+ #if 0
+ // UNUSED
+ float eigMax = 10.0f;
+ float eigMin = 0.1f;
+ #endif
+
+ if (nonSingular)
+ {
+ solveLU3x3(LU, xUnwarped, xWarped);
+ solveLU3x3(LU, yUnwarped, yWarped);
+ solveLU3x3(LU, zUnwarped, zWarped);
+
+ // compute the eigenvalues while we have the Jacobian available
+ Vec3 eigenvalues = Vec3(1.);
+ computeEigenvalues3x3( &eigenvalues[0], jacobian);
+ _eigMax[indexSmall] = MAX3V(eigenvalues);
+ _eigMin[indexSmall] = MIN3V(eigenvalues);
+ }
+
+ // make sure to skip one on the beginning and end
+ int xStart = (xSmall == 0) ? 1 : 0;
+ int xEnd = (xSmall == _xResSm - 1) ? _amplify - 1 : _amplify;
+ int yStart = (ySmall == 0) ? 1 : 0;
+ int yEnd = (ySmall == _yResSm - 1) ? _amplify - 1 : _amplify;
+ int zStart = (zSmall == 0) ? 1 : 0;
+ int zEnd = (zSmall == _zResSm - 1) ? _amplify - 1 : _amplify;
+
+ for (int zBig = zStart; zBig < zEnd; zBig++)
+ for (int yBig = yStart; yBig < yEnd; yBig++)
+ for (int xBig = xStart; xBig < xEnd; xBig++)
+ {
+ const int x = xSmall * _amplify + xBig;
+ const int y = ySmall * _amplify + yBig;
+ const int z = zSmall * _amplify + zBig;
+
+ // get unit position for both fine and coarse grid
+ const Vec3 pos = Vec3(x,y,z);
+ const Vec3 posSm = pos * invAmp;
+
+ // get grid index for both fine and coarse grid
+ const int index = x + y *_xResBig + z *_slabSizeBig;
+
+ // get a linearly interpolated velocity and texcoords
+ // from the coarse grid
+ Vec3 vel = INTERPOLATE::lerp3dVec( xvel,yvel,zvel,
+ posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
+ Vec3 uvw = INTERPOLATE::lerp3dVec( _tcU,_tcV,_tcW,
+ posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
+
+ // multiply the texture coordinate by _resSm so that turbulence
+ // synthesis begins at the first octave that the coarse grid
+ // cannot capture
+ Vec3 texCoord = Vec3(uvw[0] * _resSm[0],
+ uvw[1] * _resSm[1],
+ uvw[2] * _resSm[2]);
+
+ // retrieve wavelet energy at highest frequency
+ float energy = INTERPOLATE::lerp3d(
+ _highFreqEnergy, posSm[0],posSm[1],posSm[2], _xResSm, _yResSm, _zResSm);
+
+ // base amplitude for octave 0
+ float coefficient = sqrtf(2.0f * fabs(energy));
+ const float amplitude = *_strength * fabs(0.5 * coefficient) * persistence;
+
+ // add noise to velocity, but only if the turbulence is
+ // sufficiently undeformed, and the energy is large enough
+ // to make a difference
+ const bool addNoise = _eigMax[indexSmall] < 2. &&
+ _eigMin[indexSmall] > 0.5;
+
+ if (addNoise && amplitude > _cullingThreshold) {
+ // base amplitude for octave 0
+ float amplitudeScaled = amplitude;
+
+ for (int octave = 0; octave < _octaves; octave++)
+ {
+ // multiply the vector noise times the maximum allowed
+ // noise amplitude at this octave, and add it to the total
+ vel += WVelocityWithJacobian(texCoord, &xUnwarped[0], &yUnwarped[0], &zUnwarped[0]) * amplitudeScaled;
+
+ // scale coefficient for next octave
+ amplitudeScaled *= persistence;
+ texCoord *= 2.0f;
+ }
+ }
+
+ // Store velocity + turbulence in big grid for maccormack step
+ //
+ // If you wanted to save memory, you would instead perform a
+ // semi-Lagrangian backtrace for the current grid cell here. Then
+ // you could just throw the velocity away.
+ _bigUx[index] = vel[0];
+ _bigUy[index] = vel[1];
+ _bigUz[index] = vel[2];
+
+ // compute the velocity magnitude for substepping later
+ const float velMag = _bigUx[index] * _bigUx[index] +
+ _bigUy[index] * _bigUy[index] +
+ _bigUz[index] * _bigUz[index];
+ if (velMag > maxVelMag1) maxVelMag1 = velMag;
+
+ // zero out velocity inside obstacles
+ float obsCheck = INTERPOLATE::lerp3dToFloat(
+ obstacles, posSm[0], posSm[1], posSm[2], _xResSm, _yResSm, _zResSm);
+
+ if (obsCheck > 0.95)
+ _bigUx[index] = _bigUy[index] = _bigUz[index] = 0.;
+ } // xyz
+
+ #if PARALLEL==1
+ maxVelMagThreads[id] = maxVelMag1;
+ #else
+ maxVelMagThreads[0] = maxVelMag1;
+ #endif
+ }
+ } // omp
+
+ // compute maximum over threads
+ float maxVelMag = maxVelMagThreads[0];
+ #if PARALLEL==1
+ for (int i = 1; i < 8; i++)
+ if (maxVelMag < maxVelMagThreads[i])
+ maxVelMag = maxVelMagThreads[i];
+ #endif
+
+ // prepare density for an advection
+ SWAP_POINTERS(_densityBig, _densityBigOld);
+
+ // based on the maximum velocity present, see if we need to substep,
+ // but cap the maximum number of substeps to 5
+ const int maxSubSteps = 25;
+ const int maxVel = 5;
+ maxVelMag = sqrt(maxVelMag) * dt;
+ int totalSubsteps = (int)(maxVelMag / (float)maxVel);
+ totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
+ // printf("totalSubsteps: %d\n", totalSubsteps);
+ totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
+ const float dtSubdiv = dt / (float)totalSubsteps;
+
+ // set boundaries of big velocity grid
+ FLUID_3D::setZeroX(_bigUx, _resBig);
+ FLUID_3D::setZeroY(_bigUy, _resBig);
+ FLUID_3D::setZeroZ(_bigUz, _resBig);
+
+ // do the MacCormack advection, with substepping if necessary
+ for(int substep = 0; substep < totalSubsteps; substep++)
+ {
+ FLUID_3D::advectFieldMacCormack(dtSubdiv, _bigUx, _bigUy, _bigUz,
+ _densityBigOld, _densityBig, _tempBig1, _tempBig2, _resBig, NULL);
+
+ if (substep < totalSubsteps - 1)
+ SWAP_POINTERS(_densityBig, _densityBigOld);
+ } // substep
+
+ // wipe the density borders
+ FLUID_3D::setZeroBorder(_densityBig, _resBig);
+
+ // reset texture coordinates now in preparation for next timestep
+ // Shouldn't do this before generating the noise because then the
+ // eigenvalues stored do not reflect the underlying texture coordinates
+ resetTextureCoordinates();
+
+ // output files
+ // string prefix = string("./amplified.preview/density_bigxy_");
+ // FLUID_3D::writeImageSliceXY(_densityBig, _resBig, _resBig[2]/2, prefix, _totalStepsBig, 1.0f);
+ //string df3prefix = string("./df3/density_big_");
+ //IMAGE::dumpDF3(_totalStepsBig, df3prefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
+ // string pbrtPrefix = string("./pbrt/density_big_");
+ // IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
+
+ _totalStepsBig++;
+
+ delete[] _bigUx;
+ delete[] _bigUy;
+ delete[] _bigUz;
+
+ delete[] _tempBig1;
+ delete[] _tempBig2;
+}
+
diff --git a/intern/smoke/intern/WTURBULENCE.h b/intern/smoke/intern/WTURBULENCE.h
new file mode 100644
index 00000000000..c21e002ad48
--- /dev/null
+++ b/intern/smoke/intern/WTURBULENCE.h
@@ -0,0 +1,141 @@
+//////////////////////////////////////////////////////////////////////
+// This file is part of Wavelet Turbulence.
+//
+// Wavelet Turbulence 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 3 of the License, or
+// (at your option) any later version.
+//
+// Wavelet Turbulence 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 Wavelet Turbulence. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright 2008 Theodore Kim and Nils Thuerey
+//
+// WTURBULENCE handling
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef WTURBULENCE_H
+#define WTURBULENCE_H
+
+#include "VEC3.h"
+using namespace BasicVector;
+class SIMPLE_PARSER;
+
+///////////////////////////////////////////////////////////////////////////////
+/// Main WTURBULENCE class, stores large density array etc.
+///////////////////////////////////////////////////////////////////////////////
+class WTURBULENCE
+{
+ public:
+ // both config files can be NULL, altCfg might override values from noiseCfg
+ WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int noisetype);
+
+ /// destructor
+ virtual ~WTURBULENCE();
+
+ void setNoise(int type);
+ void initBlenderRNA(float *strength);
+
+ // step more readable version -- no rotation correction
+ void stepTurbulenceReadable(float dt, float* xvel, float* yvel, float* zvel, unsigned char *obstacles);
+
+ // step more complete version -- include rotation correction
+ // and use OpenMP if available
+ void stepTurbulenceFull(float dt, float* xvel, float* yvel, float* zvel, unsigned char *obstacles);
+
+ // texcoord functions
+ void advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel, float *_tempBig1, float *_tempBig2);
+ void resetTextureCoordinates();
+
+ void computeEnergy(float* xvel, float* yvel, float* zvel, unsigned char *obstacles);
+
+ // evaluate wavelet noise function
+ Vec3 WVelocity(Vec3 p);
+ Vec3 WVelocityWithJacobian(Vec3 p, float* xUnwarped, float* yUnwarped, float* zUnwarped);
+
+ // access functions
+ inline float* getDensityBig() { return _densityBig; }
+ inline float* getArrayTcU() { return _tcU; }
+ inline float* getArrayTcV() { return _tcV; }
+ inline float* getArrayTcW() { return _tcW; }
+ inline float* getArrayEigMin() { return _eigMin; }
+ inline float* getArrayEigMax() { return _eigMax; }
+
+ inline Vec3Int getResSm() { return _resSm; } // small resolution
+ inline Vec3Int getResBig() { return _resBig; }
+ inline int getOctaves() { return _octaves; }
+
+ // is accessed on through rna gui
+ float *_strength;
+
+ // protected:
+ // enlargement factor from original velocity field / simulation
+ // _Big = _amplify * _Sm
+ int _amplify;
+ int _octaves;
+
+ // noise settings
+ float _cullingThreshold;
+ float _noiseStrength;
+ float _noiseSizeScale;
+ bool _uvwAdvection;
+ bool _uvwReset;
+ float _noiseTimeanimSpeed;
+ int _dumpInterval;
+ int _noiseControlType;
+ // debug, scale density for projections output images
+ float _outputScale;
+
+ // noise resolution
+ int _xResBig;
+ int _yResBig;
+ int _zResBig;
+ Vec3Int _resBig;
+ Vec3 _invResBig;
+ int _totalCellsBig;
+ int _slabSizeBig;
+ // original / small resolution
+ int _xResSm;
+ int _yResSm;
+ int _zResSm;
+ Vec3Int _resSm;
+ Vec3 _invResSm;
+ int _totalCellsSm;
+ int _slabSizeSm;
+
+ float* _densityBig;
+ float* _densityBigOld;
+
+ // texture coordinates for noise
+ float* _tcU;
+ float* _tcV;
+ float* _tcW;
+ float* _tcTemp;
+
+ float* _eigMin; // no save -dg
+ float* _eigMax; // no save -dg
+
+ // wavelet decomposition of velocity energies
+ float* _energy; // no save -dg
+
+ // noise data
+ float* _noiseTile;
+ //float* _noiseTileExt;
+
+ // step counter
+ int _totalStepsBig;
+
+ // highest frequency component of wavelet decomposition
+ float* _highFreqEnergy; // no save -dg
+
+ void computeEigenvalues();
+ void decomposeEnergy();
+};
+
+#endif // WTURBULENCE_H
+
diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp
new file mode 100644
index 00000000000..5a016b51bbe
--- /dev/null
+++ b/intern/smoke/intern/smoke_API.cpp
@@ -0,0 +1,262 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 by Daniel Genrich
+ * All rights reserved.
+ *
+ * Contributor(s): Daniel Genrich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "FLUID_3D.h"
+#include "WTURBULENCE.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+// y in smoke is z in blender
+extern "C" FLUID_3D *smoke_init(int *res, float *p0, float dt)
+{
+ // smoke lib uses y as top-bottom/vertical axis where blender uses z
+ FLUID_3D *fluid = new FLUID_3D(res, p0, dt);
+
+ // printf("xres: %d, yres: %d, zres: %d\n", res[0], res[1], res[2]);
+
+ return fluid;
+}
+
+extern "C" WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype)
+{
+ // initialize wavelet turbulence
+ if(amplify)
+ return new WTURBULENCE(res[0],res[1],res[2], amplify, noisetype);
+ else
+ return NULL;
+}
+
+extern "C" void smoke_free(FLUID_3D *fluid)
+{
+ delete fluid;
+ fluid = NULL;
+}
+
+extern "C" void smoke_turbulence_free(WTURBULENCE *wt)
+{
+ delete wt;
+ wt = NULL;
+}
+
+extern "C" size_t smoke_get_index(int x, int max_x, int y, int max_y, int z /*, int max_z */)
+{
+ // // const int index = x + y * smd->res[0] + z * smd->res[0]*smd->res[1];
+ return x + y * max_x + z * max_x*max_y;
+}
+
+extern "C" size_t smoke_get_index2d(int x, int max_x, int y /*, int max_y, int z, int max_z */)
+{
+ return x + y * max_x;
+}
+
+extern "C" void smoke_step(FLUID_3D *fluid, size_t framenr)
+{
+ fluid->step();
+}
+
+extern "C" void smoke_turbulence_step(WTURBULENCE *wt, FLUID_3D *fluid)
+{
+ if(wt)
+ wt->stepTurbulenceFull(fluid->_dt/fluid->_dx, fluid->_xVelocity, fluid->_yVelocity, fluid->_zVelocity, fluid->_obstacles);
+}
+
+extern "C" void smoke_initBlenderRNA(FLUID_3D *fluid, float *alpha, float *beta)
+{
+ fluid->initBlenderRNA(alpha, beta);
+}
+
+extern "C" void smoke_dissolve(FLUID_3D *fluid, int speed, int log)
+{
+ float *density = fluid->_density;
+ //float *densityOld = fluid->_densityOld;
+ float *heat = fluid->_heat;
+
+ if(log)
+ {
+ /* max density/speed = dydx */
+ float dydx = 1.0 / (float)speed;
+ size_t size= fluid->_xRes * fluid->_yRes * fluid->_zRes;
+
+ for(size_t i = 0; i < size; i++)
+ {
+ density[i] *= (1.0 - dydx);
+
+ if(density[i] < 0.0f)
+ density[i] = 0.0f;
+
+ heat[i] *= (1.0 - dydx);
+
+ if(heat[i] < 0.0f)
+ heat[i] = 0.0f;
+ }
+ }
+ else // linear falloff
+ {
+ /* max density/speed = dydx */
+ float dydx = 1.0 / (float)speed;
+ size_t size= fluid->_xRes * fluid->_yRes * fluid->_zRes;
+
+ for(size_t i = 0; i < size; i++)
+ {
+ density[i] -= dydx;
+
+ if(density[i] < 0.0f)
+ density[i] = 0.0f;
+
+ heat[i] -= dydx;
+
+ if(heat[i] < 0.0f)
+ heat[i] = 0.0f;
+
+ }
+ }
+}
+
+extern "C" void smoke_turbulence_dissolve(WTURBULENCE *wt, int speed, int log)
+{
+ float *density = wt->getDensityBig();
+ Vec3Int r = wt->getResBig();
+
+ if(log)
+ {
+ /* max density/speed = dydx */
+ float dydx = 1.0 / (float)speed;
+ size_t size= r[0] * r[1] * r[2];
+
+ for(size_t i = 0; i < size; i++)
+ {
+ density[i] *= (1.0 - dydx);
+
+ if(density[i] < 0.0f)
+ density[i] = 0.0f;
+ }
+ }
+ else // linear falloff
+ {
+ /* max density/speed = dydx */
+ float dydx = 1.0 / (float)speed;
+ size_t size= r[0] * r[1] * r[2];
+
+ for(size_t i = 0; i < size; i++)
+ {
+ density[i] -= dydx;
+
+ if(density[i] < 0.0f)
+ density[i] = 0.0f;
+ }
+ }
+}
+
+extern "C" void smoke_turbulence_initBlenderRNA(WTURBULENCE *wt, float *strength)
+{
+ wt->initBlenderRNA(strength);
+}
+
+template < class T > inline T ABS( T a ) {
+ return (0 < a) ? a : -a ;
+}
+
+extern "C" void smoke_export(FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles)
+{
+ *dens = fluid->_density;
+ *densold = fluid->_densityOld;
+ *heat = fluid->_heat;
+ *heatold = fluid->_heatOld;
+ *vx = fluid->_xVelocity;
+ *vy = fluid->_yVelocity;
+ *vz = fluid->_zVelocity;
+ *vxold = fluid->_xVelocityOld;
+ *vyold = fluid->_yVelocityOld;
+ *vzold = fluid->_zVelocityOld;
+ *obstacles = fluid->_obstacles;
+ dt = &(fluid->_dt);
+ dx = &(fluid->_dx);
+
+}
+
+extern "C" void smoke_turbulence_export(WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw)
+{
+ if(!wt)
+ return;
+
+ *dens = wt->_densityBig;
+ *densold = wt->_densityBigOld;
+ *tcu = wt->_tcU;
+ *tcv = wt->_tcV;
+ *tcw = wt->_tcW;
+}
+
+extern "C" float *smoke_get_density(FLUID_3D *fluid)
+{
+ return fluid->_density;
+}
+
+extern "C" float *smoke_get_heat(FLUID_3D *fluid)
+{
+ return fluid->_heat;
+}
+
+extern "C" float *smoke_get_velocity_x(FLUID_3D *fluid)
+{
+ return fluid->_xVelocity;
+}
+
+extern "C" float *smoke_get_velocity_y(FLUID_3D *fluid)
+{
+ return fluid->_yVelocity;
+}
+
+extern "C" float *smoke_get_velocity_z(FLUID_3D *fluid)
+{
+ return fluid->_zVelocity;
+}
+
+extern "C" float *smoke_turbulence_get_density(WTURBULENCE *wt)
+{
+ return wt ? wt->getDensityBig() : NULL;
+}
+
+extern "C" void smoke_turbulence_get_res(WTURBULENCE *wt, unsigned int *res)
+{
+ if(wt)
+ {
+ res[0] = wt->_resBig[0];
+ res[1] = wt->_resBig[1];
+ res[2] = wt->_resBig[2];
+ }
+}
+
+extern "C" unsigned char *smoke_get_obstacle(FLUID_3D *fluid)
+{
+ return fluid->_obstacles;
+}
+
+extern "C" void smoke_turbulence_set_noise(WTURBULENCE *wt, int type)
+{
+ wt->setNoise(type);
+}
diff --git a/intern/smoke/intern/tnt/jama_eig.h b/intern/smoke/intern/tnt/jama_eig.h
new file mode 100644
index 00000000000..0d833be56de
--- /dev/null
+++ b/intern/smoke/intern/tnt/jama_eig.h
@@ -0,0 +1,1050 @@
+#ifndef JAMA_EIG_H
+#define JAMA_EIG_H
+
+
+#include "tnt_array1d.h"
+#include "tnt_array2d.h"
+#include "tnt_math_utils.h"
+
+#include <algorithm>
+// for min(), max() below
+
+#include <cmath>
+// for fabs() below
+
+using namespace TNT;
+using namespace std;
+
+// NT debugging
+//static int gEigenDebug=0;
+//if(gEigenDebug) std::cerr<<"n="<<n<<" m="<<m<<" l="<<l<<"\n";
+// m has to be smaller l! in line 262
+// gcc can get confused with abs calls, replaced by fabs
+
+namespace JAMA
+{
+
+/**
+
+ Computes eigenvalues and eigenvectors of a real (non-complex)
+ matrix.
+<P>
+ If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is
+ diagonal and the eigenvector matrix V is orthogonal. That is,
+ the diagonal values of D are the eigenvalues, and
+ V*V' = I, where I is the identity matrix. The columns of V
+ represent the eigenvectors in the sense that A*V = V*D.
+
+<P>
+ If A is not symmetric, then the eigenvalue matrix D is block diagonal
+ with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues,
+ a + i*b, in 2-by-2 blocks, [a, b; -b, a]. That is, if the complex
+ eigenvalues look like
+<pre>
+
+ u + iv . . . . .
+ . u - iv . . . .
+ . . a + ib . . .
+ . . . a - ib . .
+ . . . . x .
+ . . . . . y
+</pre>
+ then D looks like
+<pre>
+
+ u v . . . .
+ -v u . . . .
+ . . a b . .
+ . . -b a . .
+ . . . . x .
+ . . . . . y
+</pre>
+ This keeps V a real matrix in both symmetric and non-symmetric
+ cases, and A*V = V*D.
+
+
+
+ <p>
+ The matrix V may be badly
+ conditioned, or even singular, so the validity of the equation
+ A = V*D*inverse(V) depends upon the condition number of V.
+
+ <p>
+ (Adapted from JAMA, a Java Matrix Library, developed by jointly
+ by the Mathworks and NIST; see http://math.nist.gov/javanumerics/jama).
+**/
+
+template <class Real>
+class Eigenvalue
+{
+
+
+ /** Row and column dimension (square matrix). */
+ int n;
+
+ int issymmetric; /* boolean*/
+
+ /** Arrays for internal storage of eigenvalues. */
+
+ TNT::Array1D<Real> d; /* real part */
+ TNT::Array1D<Real> e; /* img part */
+
+ /** Array for internal storage of eigenvectors. */
+ TNT::Array2D<Real> V;
+
+ /** Array for internal storage of nonsymmetric Hessenberg form.
+ @serial internal storage of nonsymmetric Hessenberg form.
+ */
+ TNT::Array2D<Real> H;
+
+
+ /** Working storage for nonsymmetric algorithm.
+ @serial working storage for nonsymmetric algorithm.
+ */
+ TNT::Array1D<Real> ort;
+
+
+ // Symmetric Householder reduction to tridiagonal form.
+
+ void tred2() {
+
+ // This is derived from the Algol procedures tred2 by
+ // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
+ // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
+ // Fortran subroutine in EISPACK.
+
+ for (int j = 0; j < n; j++) {
+ d[j] = V[n-1][j];
+ }
+
+ // Householder reduction to tridiagonal form.
+
+ for (int i = n-1; i > 0; i--) {
+
+ // Scale to avoid under/overflow.
+
+ Real scale = 0.0;
+ Real h = 0.0;
+ for (int k = 0; k < i; k++) {
+ scale = scale + fabs(d[k]);
+ }
+ if (scale == 0.0) {
+ e[i] = d[i-1];
+ for (int j = 0; j < i; j++) {
+ d[j] = V[i-1][j];
+ V[i][j] = 0.0;
+ V[j][i] = 0.0;
+ }
+ } else {
+
+ // Generate Householder vector.
+
+ for (int k = 0; k < i; k++) {
+ d[k] /= scale;
+ h += d[k] * d[k];
+ }
+ Real f = d[i-1];
+ Real g = sqrt(h);
+ if (f > 0) {
+ g = -g;
+ }
+ e[i] = scale * g;
+ h = h - f * g;
+ d[i-1] = f - g;
+ for (int j = 0; j < i; j++) {
+ e[j] = 0.0;
+ }
+
+ // Apply similarity transformation to remaining columns.
+
+ for (int j = 0; j < i; j++) {
+ f = d[j];
+ V[j][i] = f;
+ g = e[j] + V[j][j] * f;
+ for (int k = j+1; k <= i-1; k++) {
+ g += V[k][j] * d[k];
+ e[k] += V[k][j] * f;
+ }
+ e[j] = g;
+ }
+ f = 0.0;
+ for (int j = 0; j < i; j++) {
+ e[j] /= h;
+ f += e[j] * d[j];
+ }
+ Real hh = f / (h + h);
+ for (int j = 0; j < i; j++) {
+ e[j] -= hh * d[j];
+ }
+ for (int j = 0; j < i; j++) {
+ f = d[j];
+ g = e[j];
+ for (int k = j; k <= i-1; k++) {
+ V[k][j] -= (f * e[k] + g * d[k]);
+ }
+ d[j] = V[i-1][j];
+ V[i][j] = 0.0;
+ }
+ }
+ d[i] = h;
+ }
+
+ // Accumulate transformations.
+
+ for (int i = 0; i < n-1; i++) {
+ V[n-1][i] = V[i][i];
+ V[i][i] = 1.0;
+ Real h = d[i+1];
+ if (h != 0.0) {
+ for (int k = 0; k <= i; k++) {
+ d[k] = V[k][i+1] / h;
+ }
+ for (int j = 0; j <= i; j++) {
+ Real g = 0.0;
+ for (int k = 0; k <= i; k++) {
+ g += V[k][i+1] * V[k][j];
+ }
+ for (int k = 0; k <= i; k++) {
+ V[k][j] -= g * d[k];
+ }
+ }
+ }
+ for (int k = 0; k <= i; k++) {
+ V[k][i+1] = 0.0;
+ }
+ }
+ for (int j = 0; j < n; j++) {
+ d[j] = V[n-1][j];
+ V[n-1][j] = 0.0;
+ }
+ V[n-1][n-1] = 1.0;
+ e[0] = 0.0;
+ }
+
+ // Symmetric tridiagonal QL algorithm.
+
+ void tql2 () {
+
+ // This is derived from the Algol procedures tql2, by
+ // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
+ // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
+ // Fortran subroutine in EISPACK.
+
+ for (int i = 1; i < n; i++) {
+ e[i-1] = e[i];
+ }
+ e[n-1] = 0.0;
+
+ Real f = 0.0;
+ Real tst1 = 0.0;
+ Real eps = pow(2.0,-52.0);
+ for (int l = 0; l < n; l++) {
+
+ // Find small subdiagonal element
+
+ tst1 = max(tst1,fabs(d[l]) + fabs(e[l]));
+ int m = l;
+
+ // Original while-loop from Java code
+ while (m < n) {
+ if (fabs(e[m]) <= eps*tst1) {
+ break;
+ }
+ m++;
+ }
+
+
+ // If m == l, d[l] is an eigenvalue,
+ // otherwise, iterate.
+
+ if (m > l) {
+ int iter = 0;
+ do {
+ iter = iter + 1; // (Could check iteration count here.)
+
+ // Compute implicit shift
+
+ Real g = d[l];
+ Real p = (d[l+1] - g) / (2.0 * e[l]);
+ Real r = hypot(p,1.0);
+ if (p < 0) {
+ r = -r;
+ }
+ d[l] = e[l] / (p + r);
+ d[l+1] = e[l] * (p + r);
+ Real dl1 = d[l+1];
+ Real h = g - d[l];
+ for (int i = l+2; i < n; i++) {
+ d[i] -= h;
+ }
+ f = f + h;
+
+ // Implicit QL transformation.
+
+ p = d[m];
+ Real c = 1.0;
+ Real c2 = c;
+ Real c3 = c;
+ Real el1 = e[l+1];
+ Real s = 0.0;
+ Real s2 = 0.0;
+ for (int i = m-1; i >= l; i--) {
+ c3 = c2;
+ c2 = c;
+ s2 = s;
+ g = c * e[i];
+ h = c * p;
+ r = hypot(p,e[i]);
+ e[i+1] = s * r;
+ s = e[i] / r;
+ c = p / r;
+ p = c * d[i] - s * g;
+ d[i+1] = h + s * (c * g + s * d[i]);
+
+ // Accumulate transformation.
+
+ for (int k = 0; k < n; k++) {
+ h = V[k][i+1];
+ V[k][i+1] = s * V[k][i] + c * h;
+ V[k][i] = c * V[k][i] - s * h;
+ }
+ }
+ p = -s * s2 * c3 * el1 * e[l] / dl1;
+ e[l] = s * p;
+ d[l] = c * p;
+
+ // Check for convergence.
+
+ } while (fabs(e[l]) > eps*tst1);
+ }
+ d[l] = d[l] + f;
+ e[l] = 0.0;
+ }
+
+ // Sort eigenvalues and corresponding vectors.
+
+ for (int i = 0; i < n-1; i++) {
+ int k = i;
+ Real p = d[i];
+ for (int j = i+1; j < n; j++) {
+ if (d[j] < p) {
+ k = j;
+ p = d[j];
+ }
+ }
+ if (k != i) {
+ d[k] = d[i];
+ d[i] = p;
+ for (int j = 0; j < n; j++) {
+ p = V[j][i];
+ V[j][i] = V[j][k];
+ V[j][k] = p;
+ }
+ }
+ }
+ }
+
+ // Nonsymmetric reduction to Hessenberg form.
+
+ void orthes () {
+
+ // This is derived from the Algol procedures orthes and ortran,
+ // by Martin and Wilkinson, Handbook for Auto. Comp.,
+ // Vol.ii-Linear Algebra, and the corresponding
+ // Fortran subroutines in EISPACK.
+
+ int low = 0;
+ int high = n-1;
+
+ for (int m = low+1; m <= high-1; m++) {
+
+ // Scale column.
+
+ Real scale = 0.0;
+ for (int i = m; i <= high; i++) {
+ scale = scale + fabs(H[i][m-1]);
+ }
+ if (scale != 0.0) {
+
+ // Compute Householder transformation.
+
+ Real h = 0.0;
+ for (int i = high; i >= m; i--) {
+ ort[i] = H[i][m-1]/scale;
+ h += ort[i] * ort[i];
+ }
+ Real g = sqrt(h);
+ if (ort[m] > 0) {
+ g = -g;
+ }
+ h = h - ort[m] * g;
+ ort[m] = ort[m] - g;
+
+ // Apply Householder similarity transformation
+ // H = (I-u*u'/h)*H*(I-u*u')/h)
+
+ for (int j = m; j < n; j++) {
+ Real f = 0.0;
+ for (int i = high; i >= m; i--) {
+ f += ort[i]*H[i][j];
+ }
+ f = f/h;
+ for (int i = m; i <= high; i++) {
+ H[i][j] -= f*ort[i];
+ }
+ }
+
+ for (int i = 0; i <= high; i++) {
+ Real f = 0.0;
+ for (int j = high; j >= m; j--) {
+ f += ort[j]*H[i][j];
+ }
+ f = f/h;
+ for (int j = m; j <= high; j++) {
+ H[i][j] -= f*ort[j];
+ }
+ }
+ ort[m] = scale*ort[m];
+ H[m][m-1] = scale*g;
+ }
+ }
+
+ // Accumulate transformations (Algol's ortran).
+
+ for (int i = 0; i < n; i++) {
+ for (int j = 0; j < n; j++) {
+ V[i][j] = (i == j ? 1.0 : 0.0);
+ }
+ }
+
+ for (int m = high-1; m >= low+1; m--) {
+ if (H[m][m-1] != 0.0) {
+ for (int i = m+1; i <= high; i++) {
+ ort[i] = H[i][m-1];
+ }
+ for (int j = m; j <= high; j++) {
+ Real g = 0.0;
+ for (int i = m; i <= high; i++) {
+ g += ort[i] * V[i][j];
+ }
+ // Double division avoids possible underflow
+ g = (g / ort[m]) / H[m][m-1];
+ for (int i = m; i <= high; i++) {
+ V[i][j] += g * ort[i];
+ }
+ }
+ }
+ }
+ }
+
+
+ // Complex scalar division.
+
+ Real cdivr, cdivi;
+ void cdiv(Real xr, Real xi, Real yr, Real yi) {
+ Real r,d;
+ if (fabs(yr) > fabs(yi)) {
+ r = yi/yr;
+ d = yr + r*yi;
+ cdivr = (xr + r*xi)/d;
+ cdivi = (xi - r*xr)/d;
+ } else {
+ r = yr/yi;
+ d = yi + r*yr;
+ cdivr = (r*xr + xi)/d;
+ cdivi = (r*xi - xr)/d;
+ }
+ }
+
+
+ // Nonsymmetric reduction from Hessenberg to real Schur form.
+
+ void hqr2 () {
+
+ // This is derived from the Algol procedure hqr2,
+ // by Martin and Wilkinson, Handbook for Auto. Comp.,
+ // Vol.ii-Linear Algebra, and the corresponding
+ // Fortran subroutine in EISPACK.
+
+ // Initialize
+
+ int nn = this->n;
+ int n = nn-1;
+ int low = 0;
+ int high = nn-1;
+ Real eps = pow(2.0,-52.0);
+ Real exshift = 0.0;
+ Real p=0,q=0,r=0,s=0,z=0,t,w,x,y;
+
+ // Store roots isolated by balanc and compute matrix norm
+
+ Real norm = 0.0;
+ for (int i = 0; i < nn; i++) {
+ if ((i < low) || (i > high)) {
+ d[i] = H[i][i];
+ e[i] = 0.0;
+ }
+ for (int j = max(i-1,0); j < nn; j++) {
+ norm = norm + fabs(H[i][j]);
+ }
+ }
+
+ // Outer loop over eigenvalue index
+
+ int iter = 0;
+ int totIter = 0;
+ while (n >= low) {
+
+ // NT limit no. of iterations
+ totIter++;
+ if(totIter>100) {
+ //if(totIter>15) std::cout<<"!!!!iter ABORT !!!!!!! "<<totIter<<"\n";
+ // NT hack/fix, return large eigenvalues
+ for (int i = 0; i < nn; i++) {
+ d[i] = 10000.;
+ e[i] = 10000.;
+ }
+ return;
+ }
+
+ // Look for single small sub-diagonal element
+
+ int l = n;
+ while (l > low) {
+ s = fabs(H[l-1][l-1]) + fabs(H[l][l]);
+ if (s == 0.0) {
+ s = norm;
+ }
+ if (fabs(H[l][l-1]) < eps * s) {
+ break;
+ }
+ l--;
+ }
+
+ // Check for convergence
+ // One root found
+
+ if (l == n) {
+ H[n][n] = H[n][n] + exshift;
+ d[n] = H[n][n];
+ e[n] = 0.0;
+ n--;
+ iter = 0;
+
+ // Two roots found
+
+ } else if (l == n-1) {
+ w = H[n][n-1] * H[n-1][n];
+ p = (H[n-1][n-1] - H[n][n]) / 2.0;
+ q = p * p + w;
+ z = sqrt(fabs(q));
+ H[n][n] = H[n][n] + exshift;
+ H[n-1][n-1] = H[n-1][n-1] + exshift;
+ x = H[n][n];
+
+ // Real pair
+
+ if (q >= 0) {
+ if (p >= 0) {
+ z = p + z;
+ } else {
+ z = p - z;
+ }
+ d[n-1] = x + z;
+ d[n] = d[n-1];
+ if (z != 0.0) {
+ d[n] = x - w / z;
+ }
+ e[n-1] = 0.0;
+ e[n] = 0.0;
+ x = H[n][n-1];
+ s = fabs(x) + fabs(z);
+ p = x / s;
+ q = z / s;
+ r = sqrt(p * p+q * q);
+ p = p / r;
+ q = q / r;
+
+ // Row modification
+
+ for (int j = n-1; j < nn; j++) {
+ z = H[n-1][j];
+ H[n-1][j] = q * z + p * H[n][j];
+ H[n][j] = q * H[n][j] - p * z;
+ }
+
+ // Column modification
+
+ for (int i = 0; i <= n; i++) {
+ z = H[i][n-1];
+ H[i][n-1] = q * z + p * H[i][n];
+ H[i][n] = q * H[i][n] - p * z;
+ }
+
+ // Accumulate transformations
+
+ for (int i = low; i <= high; i++) {
+ z = V[i][n-1];
+ V[i][n-1] = q * z + p * V[i][n];
+ V[i][n] = q * V[i][n] - p * z;
+ }
+
+ // Complex pair
+
+ } else {
+ d[n-1] = x + p;
+ d[n] = x + p;
+ e[n-1] = z;
+ e[n] = -z;
+ }
+ n = n - 2;
+ iter = 0;
+
+ // No convergence yet
+
+ } else {
+
+ // Form shift
+
+ x = H[n][n];
+ y = 0.0;
+ w = 0.0;
+ if (l < n) {
+ y = H[n-1][n-1];
+ w = H[n][n-1] * H[n-1][n];
+ }
+
+ // Wilkinson's original ad hoc shift
+
+ if (iter == 10) {
+ exshift += x;
+ for (int i = low; i <= n; i++) {
+ H[i][i] -= x;
+ }
+ s = fabs(H[n][n-1]) + fabs(H[n-1][n-2]);
+ x = y = 0.75 * s;
+ w = -0.4375 * s * s;
+ }
+
+ // MATLAB's new ad hoc shift
+
+ if (iter == 30) {
+ s = (y - x) / 2.0;
+ s = s * s + w;
+ if (s > 0) {
+ s = sqrt(s);
+ if (y < x) {
+ s = -s;
+ }
+ s = x - w / ((y - x) / 2.0 + s);
+ for (int i = low; i <= n; i++) {
+ H[i][i] -= s;
+ }
+ exshift += s;
+ x = y = w = 0.964;
+ }
+ }
+
+ iter = iter + 1; // (Could check iteration count here.)
+
+ // Look for two consecutive small sub-diagonal elements
+
+ int m = n-2;
+ while (m >= l) {
+ z = H[m][m];
+ r = x - z;
+ s = y - z;
+ p = (r * s - w) / H[m+1][m] + H[m][m+1];
+ q = H[m+1][m+1] - z - r - s;
+ r = H[m+2][m+1];
+ s = fabs(p) + fabs(q) + fabs(r);
+ p = p / s;
+ q = q / s;
+ r = r / s;
+ if (m == l) {
+ break;
+ }
+ if (fabs(H[m][m-1]) * (fabs(q) + fabs(r)) <
+ eps * (fabs(p) * (fabs(H[m-1][m-1]) + fabs(z) +
+ fabs(H[m+1][m+1])))) {
+ break;
+ }
+ m--;
+ }
+
+ for (int i = m+2; i <= n; i++) {
+ H[i][i-2] = 0.0;
+ if (i > m+2) {
+ H[i][i-3] = 0.0;
+ }
+ }
+
+ // Double QR step involving rows l:n and columns m:n
+
+ for (int k = m; k <= n-1; k++) {
+ int notlast = (k != n-1);
+ if (k != m) {
+ p = H[k][k-1];
+ q = H[k+1][k-1];
+ r = (notlast ? H[k+2][k-1] : 0.0);
+ x = fabs(p) + fabs(q) + fabs(r);
+ if (x != 0.0) {
+ p = p / x;
+ q = q / x;
+ r = r / x;
+ }
+ }
+ if (x == 0.0) {
+ break;
+ }
+ s = sqrt(p * p + q * q + r * r);
+ if (p < 0) {
+ s = -s;
+ }
+ if (s != 0) {
+ if (k != m) {
+ H[k][k-1] = -s * x;
+ } else if (l != m) {
+ H[k][k-1] = -H[k][k-1];
+ }
+ p = p + s;
+ x = p / s;
+ y = q / s;
+ z = r / s;
+ q = q / p;
+ r = r / p;
+
+ // Row modification
+
+ for (int j = k; j < nn; j++) {
+ p = H[k][j] + q * H[k+1][j];
+ if (notlast) {
+ p = p + r * H[k+2][j];
+ H[k+2][j] = H[k+2][j] - p * z;
+ }
+ H[k][j] = H[k][j] - p * x;
+ H[k+1][j] = H[k+1][j] - p * y;
+ }
+
+ // Column modification
+
+ for (int i = 0; i <= min(n,k+3); i++) {
+ p = x * H[i][k] + y * H[i][k+1];
+ if (notlast) {
+ p = p + z * H[i][k+2];
+ H[i][k+2] = H[i][k+2] - p * r;
+ }
+ H[i][k] = H[i][k] - p;
+ H[i][k+1] = H[i][k+1] - p * q;
+ }
+
+ // Accumulate transformations
+
+ for (int i = low; i <= high; i++) {
+ p = x * V[i][k] + y * V[i][k+1];
+ if (notlast) {
+ p = p + z * V[i][k+2];
+ V[i][k+2] = V[i][k+2] - p * r;
+ }
+ V[i][k] = V[i][k] - p;
+ V[i][k+1] = V[i][k+1] - p * q;
+ }
+ } // (s != 0)
+ } // k loop
+ } // check convergence
+ } // while (n >= low)
+ //if(totIter>15) std::cout<<"!!!!iter "<<totIter<<"\n";
+
+ // Backsubstitute to find vectors of upper triangular form
+
+ if (norm == 0.0) {
+ return;
+ }
+
+ for (n = nn-1; n >= 0; n--) {
+ p = d[n];
+ q = e[n];
+
+ // Real vector
+
+ if (q == 0) {
+ int l = n;
+ H[n][n] = 1.0;
+ for (int i = n-1; i >= 0; i--) {
+ w = H[i][i] - p;
+ r = 0.0;
+ for (int j = l; j <= n; j++) {
+ r = r + H[i][j] * H[j][n];
+ }
+ if (e[i] < 0.0) {
+ z = w;
+ s = r;
+ } else {
+ l = i;
+ if (e[i] == 0.0) {
+ if (w != 0.0) {
+ H[i][n] = -r / w;
+ } else {
+ H[i][n] = -r / (eps * norm);
+ }
+
+ // Solve real equations
+
+ } else {
+ x = H[i][i+1];
+ y = H[i+1][i];
+ q = (d[i] - p) * (d[i] - p) + e[i] * e[i];
+ t = (x * s - z * r) / q;
+ H[i][n] = t;
+ if (fabs(x) > fabs(z)) {
+ H[i+1][n] = (-r - w * t) / x;
+ } else {
+ H[i+1][n] = (-s - y * t) / z;
+ }
+ }
+
+ // Overflow control
+
+ t = fabs(H[i][n]);
+ if ((eps * t) * t > 1) {
+ for (int j = i; j <= n; j++) {
+ H[j][n] = H[j][n] / t;
+ }
+ }
+ }
+ }
+
+ // Complex vector
+
+ } else if (q < 0) {
+ int l = n-1;
+
+ // Last vector component imaginary so matrix is triangular
+
+ if (fabs(H[n][n-1]) > fabs(H[n-1][n])) {
+ H[n-1][n-1] = q / H[n][n-1];
+ H[n-1][n] = -(H[n][n] - p) / H[n][n-1];
+ } else {
+ cdiv(0.0,-H[n-1][n],H[n-1][n-1]-p,q);
+ H[n-1][n-1] = cdivr;
+ H[n-1][n] = cdivi;
+ }
+ H[n][n-1] = 0.0;
+ H[n][n] = 1.0;
+ for (int i = n-2; i >= 0; i--) {
+ Real ra,sa,vr,vi;
+ ra = 0.0;
+ sa = 0.0;
+ for (int j = l; j <= n; j++) {
+ ra = ra + H[i][j] * H[j][n-1];
+ sa = sa + H[i][j] * H[j][n];
+ }
+ w = H[i][i] - p;
+
+ if (e[i] < 0.0) {
+ z = w;
+ r = ra;
+ s = sa;
+ } else {
+ l = i;
+ if (e[i] == 0) {
+ cdiv(-ra,-sa,w,q);
+ H[i][n-1] = cdivr;
+ H[i][n] = cdivi;
+ } else {
+
+ // Solve complex equations
+
+ x = H[i][i+1];
+ y = H[i+1][i];
+ vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;
+ vi = (d[i] - p) * 2.0 * q;
+ if ((vr == 0.0) && (vi == 0.0)) {
+ vr = eps * norm * (fabs(w) + fabs(q) +
+ fabs(x) + fabs(y) + fabs(z));
+ }
+ cdiv(x*r-z*ra+q*sa,x*s-z*sa-q*ra,vr,vi);
+ H[i][n-1] = cdivr;
+ H[i][n] = cdivi;
+ if (fabs(x) > (fabs(z) + fabs(q))) {
+ H[i+1][n-1] = (-ra - w * H[i][n-1] + q * H[i][n]) / x;
+ H[i+1][n] = (-sa - w * H[i][n] - q * H[i][n-1]) / x;
+ } else {
+ cdiv(-r-y*H[i][n-1],-s-y*H[i][n],z,q);
+ H[i+1][n-1] = cdivr;
+ H[i+1][n] = cdivi;
+ }
+ }
+
+ // Overflow control
+
+ t = max(fabs(H[i][n-1]),fabs(H[i][n]));
+ if ((eps * t) * t > 1) {
+ for (int j = i; j <= n; j++) {
+ H[j][n-1] = H[j][n-1] / t;
+ H[j][n] = H[j][n] / t;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Vectors of isolated roots
+
+ for (int i = 0; i < nn; i++) {
+ if (i < low || i > high) {
+ for (int j = i; j < nn; j++) {
+ V[i][j] = H[i][j];
+ }
+ }
+ }
+
+ // Back transformation to get eigenvectors of original matrix
+
+ for (int j = nn-1; j >= low; j--) {
+ for (int i = low; i <= high; i++) {
+ z = 0.0;
+ for (int k = low; k <= min(j,high); k++) {
+ z = z + V[i][k] * H[k][j];
+ }
+ V[i][j] = z;
+ }
+ }
+ }
+
+public:
+
+
+ /** Check for symmetry, then construct the eigenvalue decomposition
+ @param A Square real (non-complex) matrix
+ */
+
+ Eigenvalue(const TNT::Array2D<Real> &A) {
+ n = A.dim2();
+ V = Array2D<Real>(n,n);
+ d = Array1D<Real>(n);
+ e = Array1D<Real>(n);
+
+ issymmetric = 1;
+ for (int j = 0; (j < n) && issymmetric; j++) {
+ for (int i = 0; (i < n) && issymmetric; i++) {
+ issymmetric = (A[i][j] == A[j][i]);
+ }
+ }
+
+ if (issymmetric) {
+ for (int i = 0; i < n; i++) {
+ for (int j = 0; j < n; j++) {
+ V[i][j] = A[i][j];
+ }
+ }
+
+ // Tridiagonalize.
+ tred2();
+
+ // Diagonalize.
+ tql2();
+
+ } else {
+ H = TNT::Array2D<Real>(n,n);
+ ort = TNT::Array1D<Real>(n);
+
+ for (int j = 0; j < n; j++) {
+ for (int i = 0; i < n; i++) {
+ H[i][j] = A[i][j];
+ }
+ }
+
+ // Reduce to Hessenberg form.
+ orthes();
+
+ // Reduce Hessenberg to real Schur form.
+ hqr2();
+ }
+ }
+
+
+ /** Return the eigenvector matrix
+ @return V
+ */
+
+ void getV (TNT::Array2D<Real> &V_) {
+ V_ = V;
+ return;
+ }
+
+ /** Return the real parts of the eigenvalues
+ @return real(diag(D))
+ */
+
+ void getRealEigenvalues (TNT::Array1D<Real> &d_) {
+ d_ = d;
+ return ;
+ }
+
+ /** Return the imaginary parts of the eigenvalues
+ in parameter e_.
+
+ @pararm e_: new matrix with imaginary parts of the eigenvalues.
+ */
+ void getImagEigenvalues (TNT::Array1D<Real> &e_) {
+ e_ = e;
+ return;
+ }
+
+
+/**
+ Computes the block diagonal eigenvalue matrix.
+ If the original matrix A is not symmetric, then the eigenvalue
+ matrix D is block diagonal with the real eigenvalues in 1-by-1
+ blocks and any complex eigenvalues,
+ a + i*b, in 2-by-2 blocks, [a, b; -b, a]. That is, if the complex
+ eigenvalues look like
+<pre>
+
+ u + iv . . . . .
+ . u - iv . . . .
+ . . a + ib . . .
+ . . . a - ib . .
+ . . . . x .
+ . . . . . y
+</pre>
+ then D looks like
+<pre>
+
+ u v . . . .
+ -v u . . . .
+ . . a b . .
+ . . -b a . .
+ . . . . x .
+ . . . . . y
+</pre>
+ This keeps V a real matrix in both symmetric and non-symmetric
+ cases, and A*V = V*D.
+
+ @param D: upon return, the matrix is filled with the block diagonal
+ eigenvalue matrix.
+
+*/
+ void getD (TNT::Array2D<Real> &D) {
+ D = Array2D<Real>(n,n);
+ for (int i = 0; i < n; i++) {
+ for (int j = 0; j < n; j++) {
+ D[i][j] = 0.0;
+ }
+ D[i][i] = d[i];
+ if (e[i] > 0) {
+ D[i][i+1] = e[i];
+ } else if (e[i] < 0) {
+ D[i][i-1] = e[i];
+ }
+ }
+ }
+};
+
+} //namespace JAMA
+
+
+#endif
+// JAMA_EIG_H
diff --git a/intern/smoke/intern/tnt/jama_lu.h b/intern/smoke/intern/tnt/jama_lu.h
new file mode 100644
index 00000000000..a4f96b11502
--- /dev/null
+++ b/intern/smoke/intern/tnt/jama_lu.h
@@ -0,0 +1,319 @@
+#ifndef JAMA_LU_H
+#define JAMA_LU_H
+
+#include "tnt.h"
+#include <algorithm>
+//for min(), max() below
+
+using namespace TNT;
+using namespace std;
+
+namespace JAMA
+{
+
+ /** LU Decomposition.
+ <P>
+ For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n
+ unit lower triangular matrix L, an n-by-n upper triangular matrix U,
+ and a permutation vector piv of length m so that A(piv,:) = L*U.
+ If m < n, then L is m-by-m and U is m-by-n.
+ <P>
+ The LU decompostion with pivoting always exists, even if the matrix is
+ singular, so the constructor will never fail. The primary use of the
+ LU decomposition is in the solution of square systems of simultaneous
+ linear equations. This will fail if isNonsingular() returns false.
+ */
+template <class Real>
+class LU
+{
+
+
+
+ /* Array for internal storage of decomposition. */
+ Array2D<Real> LU_;
+ int m, n, pivsign;
+ Array1D<int> piv;
+
+
+ Array2D<Real> permute_copy(const Array2D<Real> &A,
+ const Array1D<int> &piv, int j0, int j1)
+ {
+ int piv_length = piv.dim();
+
+ Array2D<Real> X(piv_length, j1-j0+1);
+
+
+ for (int i = 0; i < piv_length; i++)
+ for (int j = j0; j <= j1; j++)
+ X[i][j-j0] = A[piv[i]][j];
+
+ return X;
+ }
+
+ Array1D<Real> permute_copy(const Array1D<Real> &A,
+ const Array1D<int> &piv)
+ {
+ int piv_length = piv.dim();
+ if (piv_length != A.dim())
+ return Array1D<Real>();
+
+ Array1D<Real> x(piv_length);
+
+
+ for (int i = 0; i < piv_length; i++)
+ x[i] = A[piv[i]];
+
+ return x;
+ }
+
+
+ public :
+
+ /** LU Decomposition
+ @param A Rectangular matrix
+ @return LU Decomposition object to access L, U and piv.
+ */
+
+ LU (const Array2D<Real> &A) : LU_(A.copy()), m(A.dim1()), n(A.dim2()),
+ piv(A.dim1())
+
+ {
+
+ // Use a "left-looking", dot-product, Crout/Doolittle algorithm.
+
+
+ for (int i = 0; i < m; i++) {
+ piv[i] = i;
+ }
+ pivsign = 1;
+ Real *LUrowi = 0;;
+ Array1D<Real> LUcolj(m);
+
+ // Outer loop.
+
+ for (int j = 0; j < n; j++) {
+
+ // Make a copy of the j-th column to localize references.
+
+ for (int i = 0; i < m; i++) {
+ LUcolj[i] = LU_[i][j];
+ }
+
+ // Apply previous transformations.
+
+ for (int i = 0; i < m; i++) {
+ LUrowi = LU_[i];
+
+ // Most of the time is spent in the following dot product.
+
+ int kmax = min(i,j);
+ double s = 0.0;
+ for (int k = 0; k < kmax; k++) {
+ s += LUrowi[k]*LUcolj[k];
+ }
+
+ LUrowi[j] = LUcolj[i] -= s;
+ }
+
+ // Find pivot and exchange if necessary.
+
+ int p = j;
+ for (int i = j+1; i < m; i++) {
+ if (abs(LUcolj[i]) > abs(LUcolj[p])) {
+ p = i;
+ }
+ }
+ if (p != j) {
+ int k=0;
+ for (k = 0; k < n; k++) {
+ double t = LU_[p][k];
+ LU_[p][k] = LU_[j][k];
+ LU_[j][k] = t;
+ }
+ k = piv[p];
+ piv[p] = piv[j];
+ piv[j] = k;
+ pivsign = -pivsign;
+ }
+
+ // Compute multipliers.
+
+ if ((j < m) && (LU_[j][j] != 0.0)) {
+ for (int i = j+1; i < m; i++) {
+ LU_[i][j] /= LU_[j][j];
+ }
+ }
+ }
+ }
+
+
+ /** Is the matrix nonsingular?
+ @return 1 (true) if upper triangular factor U (and hence A)
+ is nonsingular, 0 otherwise.
+ */
+
+ int isNonsingular () {
+ for (int j = 0; j < n; j++) {
+ if (LU_[j][j] == 0)
+ return 0;
+ }
+ return 1;
+ }
+
+ /** Return lower triangular factor
+ @return L
+ */
+
+ Array2D<Real> getL () {
+ Array2D<Real> L_(m,n);
+ for (int i = 0; i < m; i++) {
+ for (int j = 0; j < n; j++) {
+ if (i > j) {
+ L_[i][j] = LU_[i][j];
+ } else if (i == j) {
+ L_[i][j] = 1.0;
+ } else {
+ L_[i][j] = 0.0;
+ }
+ }
+ }
+ return L_;
+ }
+
+ /** Return upper triangular factor
+ @return U portion of LU factorization.
+ */
+
+ Array2D<Real> getU () {
+ Array2D<Real> U_(n,n);
+ for (int i = 0; i < n; i++) {
+ for (int j = 0; j < n; j++) {
+ if (i <= j) {
+ U_[i][j] = LU_[i][j];
+ } else {
+ U_[i][j] = 0.0;
+ }
+ }
+ }
+ return U_;
+ }
+
+ /** Return pivot permutation vector
+ @return piv
+ */
+
+ Array1D<int> getPivot () {
+ return piv;
+ }
+
+
+ /** Compute determinant using LU factors.
+ @return determinant of A, or 0 if A is not square.
+ */
+
+ Real det () {
+ if (m != n) {
+ return Real(0);
+ }
+ Real d = Real(pivsign);
+ for (int j = 0; j < n; j++) {
+ d *= LU_[j][j];
+ }
+ return d;
+ }
+
+ /** Solve A*X = B
+ @param B A Matrix with as many rows as A and any number of columns.
+ @return X so that L*U*X = B(piv,:), if B is nonconformant, returns
+ 0x0 (null) array.
+ */
+
+ Array2D<Real> solve (const Array2D<Real> &B)
+ {
+
+ /* Dimensions: A is mxn, X is nxk, B is mxk */
+
+ if (B.dim1() != m) {
+ return Array2D<Real>(0,0);
+ }
+ if (!isNonsingular()) {
+ return Array2D<Real>(0,0);
+ }
+
+ // Copy right hand side with pivoting
+ int nx = B.dim2();
+
+
+ Array2D<Real> X = permute_copy(B, piv, 0, nx-1);
+
+ // Solve L*Y = B(piv,:)
+ for (int k = 0; k < n; k++) {
+ for (int i = k+1; i < n; i++) {
+ for (int j = 0; j < nx; j++) {
+ X[i][j] -= X[k][j]*LU_[i][k];
+ }
+ }
+ }
+ // Solve U*X = Y;
+ for (int k = n-1; k >= 0; k--) {
+ for (int j = 0; j < nx; j++) {
+ X[k][j] /= LU_[k][k];
+ }
+ for (int i = 0; i < k; i++) {
+ for (int j = 0; j < nx; j++) {
+ X[i][j] -= X[k][j]*LU_[i][k];
+ }
+ }
+ }
+ return X;
+ }
+
+
+ /** Solve A*x = b, where x and b are vectors of length equal
+ to the number of rows in A.
+
+ @param b a vector (Array1D> of length equal to the first dimension
+ of A.
+ @return x a vector (Array1D> so that L*U*x = b(piv), if B is nonconformant,
+ returns 0x0 (null) array.
+ */
+
+ Array1D<Real> solve (const Array1D<Real> &b)
+ {
+
+ /* Dimensions: A is mxn, X is nxk, B is mxk */
+
+ if (b.dim1() != m) {
+ return Array1D<Real>();
+ }
+ if (!isNonsingular()) {
+ return Array1D<Real>();
+ }
+
+
+ Array1D<Real> x = permute_copy(b, piv);
+
+ // Solve L*Y = B(piv)
+ for (int k = 0; k < n; k++) {
+ for (int i = k+1; i < n; i++) {
+ x[i] -= x[k]*LU_[i][k];
+ }
+ }
+
+ // Solve U*X = Y;
+ for (int k = n-1; k >= 0; k--) {
+ x[k] /= LU_[k][k];
+ for (int i = 0; i < k; i++)
+ x[i] -= x[k]*LU_[i][k];
+ }
+
+
+ return x;
+ }
+
+}; /* class LU */
+
+} /* namespace JAMA */
+
+#endif
+/* JAMA_LU_H */
diff --git a/intern/smoke/intern/tnt/tnt.h b/intern/smoke/intern/tnt/tnt.h
new file mode 100644
index 00000000000..92463e08a06
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt.h
@@ -0,0 +1,64 @@
+/*
+*
+* Template Numerical Toolkit (TNT): Linear Algebra Module
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+#ifndef TNT_H
+#define TNT_H
+
+
+
+//---------------------------------------------------------------------
+// Define this macro if you want TNT to track some of the out-of-bounds
+// indexing. This can encur a small run-time overhead, but is recommended
+// while developing code. It can be turned off for production runs.
+//
+// #define TNT_BOUNDS_CHECK
+//---------------------------------------------------------------------
+//
+
+//#define TNT_BOUNDS_CHECK
+
+
+
+#include "tnt_version.h"
+#include "tnt_math_utils.h"
+#include "tnt_array1d.h"
+#include "tnt_array2d.h"
+#include "tnt_array3d.h"
+#include "tnt_array1d_utils.h"
+#include "tnt_array2d_utils.h"
+#include "tnt_array3d_utils.h"
+
+#include "tnt_fortran_array1d.h"
+#include "tnt_fortran_array2d.h"
+#include "tnt_fortran_array3d.h"
+#include "tnt_fortran_array1d_utils.h"
+#include "tnt_fortran_array2d_utils.h"
+#include "tnt_fortran_array3d_utils.h"
+
+#include "tnt_sparse_matrix_csr.h"
+
+#include "tnt_stopwatch.h"
+#include "tnt_subscript.h"
+#include "tnt_vec.h"
+#include "tnt_cmat.h"
+
+
+#endif
+// TNT_H
diff --git a/intern/smoke/intern/tnt/tnt_array1d.h b/intern/smoke/intern/tnt/tnt_array1d.h
new file mode 100644
index 00000000000..858df579863
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_array1d.h
@@ -0,0 +1,278 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_ARRAY1D_H
+#define TNT_ARRAY1D_H
+
+//#include <cstdlib>
+#include <iostream>
+
+#ifdef TNT_BOUNDS_CHECK
+#include <assert.h>
+#endif
+
+
+#include "tnt_i_refvec.h"
+
+namespace TNT
+{
+
+template <class T>
+class Array1D
+{
+
+ private:
+
+ /* ... */
+ i_refvec<T> v_;
+ int n_;
+ T* data_; /* this normally points to v_.begin(), but
+ * could also point to a portion (subvector)
+ * of v_.
+ */
+
+ void copy_(T* p, const T* q, int len) const;
+ void set_(T* begin, T* end, const T& val);
+
+
+ public:
+
+ typedef T value_type;
+
+
+ Array1D();
+ explicit Array1D(int n);
+ Array1D(int n, const T &a);
+ Array1D(int n, T *a);
+ inline Array1D(const Array1D &A);
+ inline operator T*();
+ inline operator const T*();
+ inline Array1D & operator=(const T &a);
+ inline Array1D & operator=(const Array1D &A);
+ inline Array1D & ref(const Array1D &A);
+ Array1D copy() const;
+ Array1D & inject(const Array1D & A);
+ inline T& operator[](int i);
+ inline const T& operator[](int i) const;
+ inline int dim1() const;
+ inline int dim() const;
+ ~Array1D();
+
+
+ /* ... extended interface ... */
+
+ inline int ref_count() const;
+ inline Array1D<T> subarray(int i0, int i1);
+
+};
+
+
+
+
+template <class T>
+Array1D<T>::Array1D() : v_(), n_(0), data_(0) {}
+
+template <class T>
+Array1D<T>::Array1D(const Array1D<T> &A) : v_(A.v_), n_(A.n_),
+ data_(A.data_)
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Array1D(const Array1D<T> &A) \n";
+#endif
+
+}
+
+
+template <class T>
+Array1D<T>::Array1D(int n) : v_(n), n_(n), data_(v_.begin())
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Array1D(int n) \n";
+#endif
+}
+
+template <class T>
+Array1D<T>::Array1D(int n, const T &val) : v_(n), n_(n), data_(v_.begin())
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Array1D(int n, const T& val) \n";
+#endif
+ set_(data_, data_+ n, val);
+
+}
+
+template <class T>
+Array1D<T>::Array1D(int n, T *a) : v_(a), n_(n) , data_(v_.begin())
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Array1D(int n, T* a) \n";
+#endif
+}
+
+template <class T>
+inline Array1D<T>::operator T*()
+{
+ return &(v_[0]);
+}
+
+
+template <class T>
+inline Array1D<T>::operator const T*()
+{
+ return &(v_[0]);
+}
+
+
+
+template <class T>
+inline T& Array1D<T>::operator[](int i)
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i>= 0);
+ assert(i < n_);
+#endif
+ return data_[i];
+}
+
+template <class T>
+inline const T& Array1D<T>::operator[](int i) const
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i>= 0);
+ assert(i < n_);
+#endif
+ return data_[i];
+}
+
+
+
+
+template <class T>
+Array1D<T> & Array1D<T>::operator=(const T &a)
+{
+ set_(data_, data_+n_, a);
+ return *this;
+}
+
+template <class T>
+Array1D<T> Array1D<T>::copy() const
+{
+ Array1D A( n_);
+ copy_(A.data_, data_, n_);
+
+ return A;
+}
+
+
+template <class T>
+Array1D<T> & Array1D<T>::inject(const Array1D &A)
+{
+ if (A.n_ == n_)
+ copy_(data_, A.data_, n_);
+
+ return *this;
+}
+
+
+
+
+
+template <class T>
+Array1D<T> & Array1D<T>::ref(const Array1D<T> &A)
+{
+ if (this != &A)
+ {
+ v_ = A.v_; /* operator= handles the reference counting. */
+ n_ = A.n_;
+ data_ = A.data_;
+
+ }
+ return *this;
+}
+
+template <class T>
+Array1D<T> & Array1D<T>::operator=(const Array1D<T> &A)
+{
+ return ref(A);
+}
+
+template <class T>
+inline int Array1D<T>::dim1() const { return n_; }
+
+template <class T>
+inline int Array1D<T>::dim() const { return n_; }
+
+template <class T>
+Array1D<T>::~Array1D() {}
+
+
+/* ............................ exented interface ......................*/
+
+template <class T>
+inline int Array1D<T>::ref_count() const
+{
+ return v_.ref_count();
+}
+
+template <class T>
+inline Array1D<T> Array1D<T>::subarray(int i0, int i1)
+{
+ if ((i0 > 0) && (i1 < n_) || (i0 <= i1))
+ {
+ Array1D<T> X(*this); /* create a new instance of this array. */
+ X.n_ = i1-i0+1;
+ X.data_ += i0;
+
+ return X;
+ }
+ else
+ {
+ return Array1D<T>();
+ }
+}
+
+
+/* private internal functions */
+
+
+template <class T>
+void Array1D<T>::set_(T* begin, T* end, const T& a)
+{
+ for (T* p=begin; p<end; p++)
+ *p = a;
+
+}
+
+template <class T>
+void Array1D<T>::copy_(T* p, const T* q, int len) const
+{
+ T *end = p + len;
+ while (p<end )
+ *p++ = *q++;
+
+}
+
+
+} /* namespace TNT */
+
+#endif
+/* TNT_ARRAY1D_H */
+
diff --git a/intern/smoke/intern/tnt/tnt_array1d_utils.h b/intern/smoke/intern/tnt/tnt_array1d_utils.h
new file mode 100644
index 00000000000..683e0e2d856
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_array1d_utils.h
@@ -0,0 +1,230 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+#ifndef TNT_ARRAY1D_UTILS_H
+#define TNT_ARRAY1D_UTILS_H
+
+#include <cstdlib>
+#include <cassert>
+
+namespace TNT
+{
+
+
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Array1D<T> &A)
+{
+ int N=A.dim1();
+
+#ifdef TNT_DEBUG
+ s << "addr: " << (void *) &A[0] << "\n";
+#endif
+ s << N << "\n";
+ for (int j=0; j<N; j++)
+ {
+ s << A[j] << "\n";
+ }
+ s << "\n";
+
+ return s;
+}
+
+template <class T>
+std::istream& operator>>(std::istream &s, Array1D<T> &A)
+{
+ int N;
+ s >> N;
+
+ Array1D<T> B(N);
+ for (int i=0; i<N; i++)
+ s >> B[i];
+ A = B;
+ return s;
+}
+
+
+
+template <class T>
+Array1D<T> operator+(const Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Array1D<T>();
+
+ else
+ {
+ Array1D<T> C(n);
+
+ for (int i=0; i<n; i++)
+ {
+ C[i] = A[i] + B[i];
+ }
+ return C;
+ }
+}
+
+
+
+template <class T>
+Array1D<T> operator-(const Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Array1D<T>();
+
+ else
+ {
+ Array1D<T> C(n);
+
+ for (int i=0; i<n; i++)
+ {
+ C[i] = A[i] - B[i];
+ }
+ return C;
+ }
+}
+
+
+template <class T>
+Array1D<T> operator*(const Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Array1D<T>();
+
+ else
+ {
+ Array1D<T> C(n);
+
+ for (int i=0; i<n; i++)
+ {
+ C[i] = A[i] * B[i];
+ }
+ return C;
+ }
+}
+
+
+template <class T>
+Array1D<T> operator/(const Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Array1D<T>();
+
+ else
+ {
+ Array1D<T> C(n);
+
+ for (int i=0; i<n; i++)
+ {
+ C[i] = A[i] / B[i];
+ }
+ return C;
+ }
+}
+
+
+
+
+
+
+
+
+
+template <class T>
+Array1D<T>& operator+=(Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=0; i<n; i++)
+ {
+ A[i] += B[i];
+ }
+ }
+ return A;
+}
+
+
+
+
+template <class T>
+Array1D<T>& operator-=(Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=0; i<n; i++)
+ {
+ A[i] -= B[i];
+ }
+ }
+ return A;
+}
+
+
+
+template <class T>
+Array1D<T>& operator*=(Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=0; i<n; i++)
+ {
+ A[i] *= B[i];
+ }
+ }
+ return A;
+}
+
+
+
+
+template <class T>
+Array1D<T>& operator/=(Array1D<T> &A, const Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=0; i<n; i++)
+ {
+ A[i] /= B[i];
+ }
+ }
+ return A;
+}
+
+
+
+
+
+
+} // namespace TNT
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_array2d.h b/intern/smoke/intern/tnt/tnt_array2d.h
new file mode 100644
index 00000000000..c791575ebfb
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_array2d.h
@@ -0,0 +1,315 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_ARRAY2D_H
+#define TNT_ARRAY2D_H
+
+#include <cstdlib>
+#include <iostream>
+#ifdef TNT_BOUNDS_CHECK
+#include <assert.h>
+#endif
+
+#include "tnt_array1d.h"
+
+namespace TNT
+{
+
+template <class T>
+class Array2D
+{
+
+
+ private:
+
+
+
+ Array1D<T> data_;
+ Array1D<T*> v_;
+ int m_;
+ int n_;
+
+ public:
+
+ typedef T value_type;
+ Array2D();
+ Array2D(int m, int n);
+ Array2D(int m, int n, T *a);
+ Array2D(int m, int n, const T &a);
+ inline Array2D(const Array2D &A);
+ inline operator T**();
+ inline operator const T**();
+ inline Array2D & operator=(const T &a);
+ inline Array2D & operator=(const Array2D &A);
+ inline Array2D & ref(const Array2D &A);
+ Array2D copy() const;
+ Array2D & inject(const Array2D & A);
+ inline T* operator[](int i);
+ inline const T* operator[](int i) const;
+ inline int dim1() const;
+ inline int dim2() const;
+ ~Array2D();
+
+ /* extended interface (not part of the standard) */
+
+
+ inline int ref_count();
+ inline int ref_count_data();
+ inline int ref_count_dim1();
+ Array2D subarray(int i0, int i1, int j0, int j1);
+
+};
+
+
+template <class T>
+Array2D<T>::Array2D() : data_(), v_(), m_(0), n_(0) {}
+
+template <class T>
+Array2D<T>::Array2D(const Array2D<T> &A) : data_(A.data_), v_(A.v_),
+ m_(A.m_), n_(A.n_) {}
+
+
+
+
+template <class T>
+Array2D<T>::Array2D(int m, int n) : data_(m*n), v_(m), m_(m), n_(n)
+{
+ if (m>0 && n>0)
+ {
+ T* p = &(data_[0]);
+ for (int i=0; i<m; i++)
+ {
+ v_[i] = p;
+ p += n;
+ }
+ }
+}
+
+
+
+template <class T>
+Array2D<T>::Array2D(int m, int n, const T &val) : data_(m*n), v_(m),
+ m_(m), n_(n)
+{
+ if (m>0 && n>0)
+ {
+ data_ = val;
+ T* p = &(data_[0]);
+ for (int i=0; i<m; i++)
+ {
+ v_[i] = p;
+ p += n;
+ }
+ }
+}
+
+template <class T>
+Array2D<T>::Array2D(int m, int n, T *a) : data_(m*n, a), v_(m), m_(m), n_(n)
+{
+ if (m>0 && n>0)
+ {
+ T* p = &(data_[0]);
+
+ for (int i=0; i<m; i++)
+ {
+ v_[i] = p;
+ p += n;
+ }
+ }
+}
+
+
+template <class T>
+inline T* Array2D<T>::operator[](int i)
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i >= 0);
+ assert(i < m_);
+#endif
+
+return v_[i];
+
+}
+
+
+template <class T>
+inline const T* Array2D<T>::operator[](int i) const
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i >= 0);
+ assert(i < m_);
+#endif
+
+return v_[i];
+
+}
+
+template <class T>
+Array2D<T> & Array2D<T>::operator=(const T &a)
+{
+ /* non-optimzied, but will work with subarrays in future verions */
+
+ for (int i=0; i<m_; i++)
+ for (int j=0; j<n_; j++)
+ v_[i][j] = a;
+ return *this;
+}
+
+
+
+
+template <class T>
+Array2D<T> Array2D<T>::copy() const
+{
+ Array2D A(m_, n_);
+
+ for (int i=0; i<m_; i++)
+ for (int j=0; j<n_; j++)
+ A[i][j] = v_[i][j];
+
+
+ return A;
+}
+
+
+template <class T>
+Array2D<T> & Array2D<T>::inject(const Array2D &A)
+{
+ if (A.m_ == m_ && A.n_ == n_)
+ {
+ for (int i=0; i<m_; i++)
+ for (int j=0; j<n_; j++)
+ v_[i][j] = A[i][j];
+ }
+ return *this;
+}
+
+
+
+
+template <class T>
+Array2D<T> & Array2D<T>::ref(const Array2D<T> &A)
+{
+ if (this != &A)
+ {
+ v_ = A.v_;
+ data_ = A.data_;
+ m_ = A.m_;
+ n_ = A.n_;
+
+ }
+ return *this;
+}
+
+
+
+template <class T>
+Array2D<T> & Array2D<T>::operator=(const Array2D<T> &A)
+{
+ return ref(A);
+}
+
+template <class T>
+inline int Array2D<T>::dim1() const { return m_; }
+
+template <class T>
+inline int Array2D<T>::dim2() const { return n_; }
+
+
+template <class T>
+Array2D<T>::~Array2D() {}
+
+
+
+
+template <class T>
+inline Array2D<T>::operator T**()
+{
+ return &(v_[0]);
+}
+template <class T>
+inline Array2D<T>::operator const T**()
+{
+ return &(v_[0]);
+}
+
+/* ............... extended interface ............... */
+/**
+ Create a new view to a subarray defined by the boundaries
+ [i0][i0] and [i1][j1]. The size of the subarray is
+ (i1-i0) by (j1-j0). If either of these lengths are zero
+ or negative, the subarray view is null.
+
+*/
+template <class T>
+Array2D<T> Array2D<T>::subarray(int i0, int i1, int j0, int j1)
+{
+ Array2D<T> A;
+ int m = i1-i0+1;
+ int n = j1-j0+1;
+
+ /* if either length is zero or negative, this is an invalide
+ subarray. return a null view.
+ */
+ if (m<1 || n<1)
+ return A;
+
+ A.data_ = data_;
+ A.m_ = m;
+ A.n_ = n;
+ A.v_ = Array1D<T*>(m);
+ T* p = &(data_[0]) + i0 * n_ + j0;
+ for (int i=0; i<m; i++)
+ {
+ A.v_[i] = p + i*n_;
+
+ }
+ return A;
+}
+
+template <class T>
+inline int Array2D<T>::ref_count()
+{
+ return ref_count_data();
+}
+
+
+
+template <class T>
+inline int Array2D<T>::ref_count_data()
+{
+ return data_.ref_count();
+}
+
+template <class T>
+inline int Array2D<T>::ref_count_dim1()
+{
+ return v_.ref_count();
+}
+
+
+
+
+} /* namespace TNT */
+
+#endif
+/* TNT_ARRAY2D_H */
+
diff --git a/intern/smoke/intern/tnt/tnt_array2d_utils.h b/intern/smoke/intern/tnt/tnt_array2d_utils.h
new file mode 100644
index 00000000000..7041ed37857
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_array2d_utils.h
@@ -0,0 +1,287 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+#ifndef TNT_ARRAY2D_UTILS_H
+#define TNT_ARRAY2D_UTILS_H
+
+#include <cstdlib>
+#include <cassert>
+
+namespace TNT
+{
+
+
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Array2D<T> &A)
+{
+ int M=A.dim1();
+ int N=A.dim2();
+
+ s << M << " " << N << "\n";
+
+ for (int i=0; i<M; i++)
+ {
+ for (int j=0; j<N; j++)
+ {
+ s << A[i][j] << " ";
+ }
+ s << "\n";
+ }
+
+
+ return s;
+}
+
+template <class T>
+std::istream& operator>>(std::istream &s, Array2D<T> &A)
+{
+
+ int M, N;
+
+ s >> M >> N;
+
+ Array2D<T> B(M,N);
+
+ for (int i=0; i<M; i++)
+ for (int j=0; j<N; j++)
+ {
+ s >> B[i][j];
+ }
+
+ A = B;
+ return s;
+}
+
+
+template <class T>
+Array2D<T> operator+(const Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Array2D<T>();
+
+ else
+ {
+ Array2D<T> C(m,n);
+
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ C[i][j] = A[i][j] + B[i][j];
+ }
+ return C;
+ }
+}
+
+template <class T>
+Array2D<T> operator-(const Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Array2D<T>();
+
+ else
+ {
+ Array2D<T> C(m,n);
+
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ C[i][j] = A[i][j] - B[i][j];
+ }
+ return C;
+ }
+}
+
+
+template <class T>
+Array2D<T> operator*(const Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Array2D<T>();
+
+ else
+ {
+ Array2D<T> C(m,n);
+
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ C[i][j] = A[i][j] * B[i][j];
+ }
+ return C;
+ }
+}
+
+
+
+
+template <class T>
+Array2D<T> operator/(const Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Array2D<T>();
+
+ else
+ {
+ Array2D<T> C(m,n);
+
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ C[i][j] = A[i][j] / B[i][j];
+ }
+ return C;
+ }
+}
+
+
+
+
+
+template <class T>
+Array2D<T>& operator+=(Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ A[i][j] += B[i][j];
+ }
+ }
+ return A;
+}
+
+
+
+template <class T>
+Array2D<T>& operator-=(Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ A[i][j] -= B[i][j];
+ }
+ }
+ return A;
+}
+
+
+
+template <class T>
+Array2D<T>& operator*=(Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ A[i][j] *= B[i][j];
+ }
+ }
+ return A;
+}
+
+
+
+
+
+template <class T>
+Array2D<T>& operator/=(Array2D<T> &A, const Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=0; i<m; i++)
+ {
+ for (int j=0; j<n; j++)
+ A[i][j] /= B[i][j];
+ }
+ }
+ return A;
+}
+
+/**
+ Matrix Multiply: compute C = A*B, where C[i][j]
+ is the dot-product of row i of A and column j of B.
+
+
+ @param A an (m x n) array
+ @param B an (n x k) array
+ @return the (m x k) array A*B, or a null array (0x0)
+ if the matrices are non-conformant (i.e. the number
+ of columns of A are different than the number of rows of B.)
+
+
+*/
+template <class T>
+Array2D<T> matmult(const Array2D<T> &A, const Array2D<T> &B)
+{
+ if (A.dim2() != B.dim1())
+ return Array2D<T>();
+
+ int M = A.dim1();
+ int N = A.dim2();
+ int K = B.dim2();
+
+ Array2D<T> C(M,K);
+
+ for (int i=0; i<M; i++)
+ for (int j=0; j<K; j++)
+ {
+ T sum = 0;
+
+ for (int k=0; k<N; k++)
+ sum += A[i][k] * B [k][j];
+
+ C[i][j] = sum;
+ }
+
+ return C;
+
+}
+
+} // namespace TNT
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_array3d.h b/intern/smoke/intern/tnt/tnt_array3d.h
new file mode 100644
index 00000000000..c210d2ed598
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_array3d.h
@@ -0,0 +1,296 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_ARRAY3D_H
+#define TNT_ARRAY3D_H
+
+#include <cstdlib>
+#include <iostream>
+#ifdef TNT_BOUNDS_CHECK
+#include <assert.h>
+#endif
+
+#include "tnt_array1d.h"
+#include "tnt_array2d.h"
+
+namespace TNT
+{
+
+template <class T>
+class Array3D
+{
+
+
+ private:
+ Array1D<T> data_;
+ Array2D<T*> v_;
+ int m_;
+ int n_;
+ int g_;
+
+
+ public:
+
+ typedef T value_type;
+
+ Array3D();
+ Array3D(int m, int n, int g);
+ Array3D(int m, int n, int g, T val);
+ Array3D(int m, int n, int g, T *a);
+
+ inline operator T***();
+ inline operator const T***();
+ inline Array3D(const Array3D &A);
+ inline Array3D & operator=(const T &a);
+ inline Array3D & operator=(const Array3D &A);
+ inline Array3D & ref(const Array3D &A);
+ Array3D copy() const;
+ Array3D & inject(const Array3D & A);
+
+ inline T** operator[](int i);
+ inline const T* const * operator[](int i) const;
+ inline int dim1() const;
+ inline int dim2() const;
+ inline int dim3() const;
+ ~Array3D();
+
+ /* extended interface */
+
+ inline int ref_count(){ return data_.ref_count(); }
+ Array3D subarray(int i0, int i1, int j0, int j1,
+ int k0, int k1);
+};
+
+template <class T>
+Array3D<T>::Array3D() : data_(), v_(), m_(0), n_(0) {}
+
+template <class T>
+Array3D<T>::Array3D(const Array3D<T> &A) : data_(A.data_),
+ v_(A.v_), m_(A.m_), n_(A.n_), g_(A.g_)
+{
+}
+
+
+
+template <class T>
+Array3D<T>::Array3D(int m, int n, int g) : data_(m*n*g), v_(m,n),
+ m_(m), n_(n), g_(g)
+{
+
+ if (m>0 && n>0 && g>0)
+ {
+ T* p = & (data_[0]);
+ int ng = n_*g_;
+
+ for (int i=0; i<m_; i++)
+ {
+ T* ping = p+ i*ng;
+ for (int j=0; j<n; j++)
+ v_[i][j] = ping + j*g_;
+ }
+ }
+}
+
+
+
+template <class T>
+Array3D<T>::Array3D(int m, int n, int g, T val) : data_(m*n*g, val),
+ v_(m,n), m_(m), n_(n), g_(g)
+{
+ if (m>0 && n>0 && g>0)
+ {
+
+ T* p = & (data_[0]);
+ int ng = n_*g_;
+
+ for (int i=0; i<m_; i++)
+ {
+ T* ping = p+ i*ng;
+ for (int j=0; j<n; j++)
+ v_[i][j] = ping + j*g_;
+ }
+ }
+}
+
+
+
+template <class T>
+Array3D<T>::Array3D(int m, int n, int g, T* a) :
+ data_(m*n*g, a), v_(m,n), m_(m), n_(n), g_(g)
+{
+
+ if (m>0 && n>0 && g>0)
+ {
+ T* p = & (data_[0]);
+ int ng = n_*g_;
+
+ for (int i=0; i<m_; i++)
+ {
+ T* ping = p+ i*ng;
+ for (int j=0; j<n; j++)
+ v_[i][j] = ping + j*g_;
+ }
+ }
+}
+
+
+
+template <class T>
+inline T** Array3D<T>::operator[](int i)
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i >= 0);
+ assert(i < m_);
+#endif
+
+return v_[i];
+
+}
+
+template <class T>
+inline const T* const * Array3D<T>::operator[](int i) const
+{ return v_[i]; }
+
+template <class T>
+Array3D<T> & Array3D<T>::operator=(const T &a)
+{
+ for (int i=0; i<m_; i++)
+ for (int j=0; j<n_; j++)
+ for (int k=0; k<g_; k++)
+ v_[i][j][k] = a;
+
+ return *this;
+}
+
+template <class T>
+Array3D<T> Array3D<T>::copy() const
+{
+ Array3D A(m_, n_, g_);
+ for (int i=0; i<m_; i++)
+ for (int j=0; j<n_; j++)
+ for (int k=0; k<g_; k++)
+ A.v_[i][j][k] = v_[i][j][k];
+
+ return A;
+}
+
+
+template <class T>
+Array3D<T> & Array3D<T>::inject(const Array3D &A)
+{
+ if (A.m_ == m_ && A.n_ == n_ && A.g_ == g_)
+
+ for (int i=0; i<m_; i++)
+ for (int j=0; j<n_; j++)
+ for (int k=0; k<g_; k++)
+ v_[i][j][k] = A.v_[i][j][k];
+
+ return *this;
+}
+
+
+
+template <class T>
+Array3D<T> & Array3D<T>::ref(const Array3D<T> &A)
+{
+ if (this != &A)
+ {
+ m_ = A.m_;
+ n_ = A.n_;
+ g_ = A.g_;
+ v_ = A.v_;
+ data_ = A.data_;
+ }
+ return *this;
+}
+
+template <class T>
+Array3D<T> & Array3D<T>::operator=(const Array3D<T> &A)
+{
+ return ref(A);
+}
+
+
+template <class T>
+inline int Array3D<T>::dim1() const { return m_; }
+
+template <class T>
+inline int Array3D<T>::dim2() const { return n_; }
+
+template <class T>
+inline int Array3D<T>::dim3() const { return g_; }
+
+
+
+template <class T>
+Array3D<T>::~Array3D() {}
+
+template <class T>
+inline Array3D<T>::operator T***()
+{
+ return v_;
+}
+
+
+template <class T>
+inline Array3D<T>::operator const T***()
+{
+ return v_;
+}
+
+/* extended interface */
+template <class T>
+Array3D<T> Array3D<T>::subarray(int i0, int i1, int j0,
+ int j1, int k0, int k1)
+{
+
+ /* check that ranges are valid. */
+ if (!( 0 <= i0 && i0 <= i1 && i1 < m_ &&
+ 0 <= j0 && j0 <= j1 && j1 < n_ &&
+ 0 <= k0 && k0 <= k1 && k1 < g_))
+ return Array3D<T>(); /* null array */
+
+
+ Array3D<T> A;
+ A.data_ = data_;
+ A.m_ = i1-i0+1;
+ A.n_ = j1-j0+1;
+ A.g_ = k1-k0+1;
+ A.v_ = Array2D<T*>(A.m_,A.n_);
+ T* p = &(data_[0]) + i0*n_*g_ + j0*g_ + k0;
+
+ for (int i=0; i<A.m_; i++)
+ {
+ T* ping = p + i*n_*g_;
+ for (int j=0; j<A.n_; j++)
+ A.v_[i][j] = ping + j*g_ ;
+ }
+
+ return A;
+}
+
+
+
+} /* namespace TNT */
+
+#endif
+/* TNT_ARRAY3D_H */
+
diff --git a/intern/smoke/intern/tnt/tnt_array3d_utils.h b/intern/smoke/intern/tnt/tnt_array3d_utils.h
new file mode 100644
index 00000000000..5acdc1d5dd2
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_array3d_utils.h
@@ -0,0 +1,236 @@
+
+
+#ifndef TNT_ARRAY3D_UTILS_H
+#define TNT_ARRAY3D_UTILS_H
+
+#include <cstdlib>
+#include <cassert>
+
+namespace TNT
+{
+
+
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Array3D<T> &A)
+{
+ int M=A.dim1();
+ int N=A.dim2();
+ int K=A.dim3();
+
+ s << M << " " << N << " " << K << "\n";
+
+ for (int i=0; i<M; i++)
+ {
+ for (int j=0; j<N; j++)
+ {
+ for (int k=0; k<K; k++)
+ s << A[i][j][k] << " ";
+ s << "\n";
+ }
+ s << "\n";
+ }
+
+
+ return s;
+}
+
+template <class T>
+std::istream& operator>>(std::istream &s, Array3D<T> &A)
+{
+
+ int M, N, K;
+
+ s >> M >> N >> K;
+
+ Array3D<T> B(M,N,K);
+
+ for (int i=0; i<M; i++)
+ for (int j=0; j<N; j++)
+ for (int k=0; k<K; k++)
+ s >> B[i][j][k];
+
+ A = B;
+ return s;
+}
+
+
+
+template <class T>
+Array3D<T> operator+(const Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Array3D<T>();
+
+ else
+ {
+ Array3D<T> C(m,n,p);
+
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ C[i][j][k] = A[i][j][k] + B[i][j][k];
+
+ return C;
+ }
+}
+
+
+template <class T>
+Array3D<T> operator-(const Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Array3D<T>();
+
+ else
+ {
+ Array3D<T> C(m,n,p);
+
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ C[i][j][k] = A[i][j][k] - B[i][j][k];
+
+ return C;
+ }
+}
+
+
+
+
+template <class T>
+Array3D<T> operator*(const Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Array3D<T>();
+
+ else
+ {
+ Array3D<T> C(m,n,p);
+
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ C[i][j][k] = A[i][j][k] * B[i][j][k];
+
+ return C;
+ }
+}
+
+
+template <class T>
+Array3D<T> operator/(const Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Array3D<T>();
+
+ else
+ {
+ Array3D<T> C(m,n,p);
+
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ C[i][j][k] = A[i][j][k] / B[i][j][k];
+
+ return C;
+ }
+}
+
+
+
+template <class T>
+Array3D<T>& operator+=(Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ A[i][j][k] += B[i][j][k];
+ }
+
+ return A;
+}
+
+template <class T>
+Array3D<T>& operator-=(Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ A[i][j][k] -= B[i][j][k];
+ }
+
+ return A;
+}
+
+template <class T>
+Array3D<T>& operator*=(Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ A[i][j][k] *= B[i][j][k];
+ }
+
+ return A;
+}
+
+
+template <class T>
+Array3D<T>& operator/=(Array3D<T> &A, const Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=0; i<m; i++)
+ for (int j=0; j<n; j++)
+ for (int k=0; k<p; k++)
+ A[i][j][k] /= B[i][j][k];
+ }
+
+ return A;
+}
+
+
+
+
+
+} // namespace TNT
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_cmat.h b/intern/smoke/intern/tnt/tnt_cmat.h
new file mode 100644
index 00000000000..5ff4c4898c3
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_cmat.h
@@ -0,0 +1,580 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+// C compatible matrix: row-oriented, 0-based [i][j] and 1-based (i,j) indexing
+//
+
+#ifndef TNT_CMAT_H
+#define TNT_CMAT_H
+
+#include "tnt_subscript.h"
+#include "tnt_vec.h"
+#include <cstdlib>
+#include <cassert>
+#include <iostream>
+#include <sstream>
+
+namespace TNT
+{
+
+
+template <class T>
+class Matrix
+{
+
+
+ public:
+
+ typedef Subscript size_type;
+ typedef T value_type;
+ typedef T element_type;
+ typedef T* pointer;
+ typedef T* iterator;
+ typedef T& reference;
+ typedef const T* const_iterator;
+ typedef const T& const_reference;
+
+ Subscript lbound() const { return 1;}
+
+ protected:
+ Subscript m_;
+ Subscript n_;
+ Subscript mn_; // total size
+ T* v_;
+ T** row_;
+ T* vm1_ ; // these point to the same data, but are 1-based
+ T** rowm1_;
+
+ // internal helper function to create the array
+ // of row pointers
+
+ void initialize(Subscript M, Subscript N)
+ {
+ mn_ = M*N;
+ m_ = M;
+ n_ = N;
+
+ v_ = new T[mn_];
+ row_ = new T*[M];
+ rowm1_ = new T*[M];
+
+ assert(v_ != NULL);
+ assert(row_ != NULL);
+ assert(rowm1_ != NULL);
+
+ T* p = v_;
+ vm1_ = v_ - 1;
+ for (Subscript i=0; i<M; i++)
+ {
+ row_[i] = p;
+ rowm1_[i] = p-1;
+ p += N ;
+
+ }
+
+ rowm1_ -- ; // compensate for 1-based offset
+ }
+
+ void copy(const T* v)
+ {
+ Subscript N = m_ * n_;
+ Subscript i;
+
+#ifdef TNT_UNROLL_LOOPS
+ Subscript Nmod4 = N & 3;
+ Subscript N4 = N - Nmod4;
+
+ for (i=0; i<N4; i+=4)
+ {
+ v_[i] = v[i];
+ v_[i+1] = v[i+1];
+ v_[i+2] = v[i+2];
+ v_[i+3] = v[i+3];
+ }
+
+ for (i=N4; i< N; i++)
+ v_[i] = v[i];
+#else
+
+ for (i=0; i< N; i++)
+ v_[i] = v[i];
+#endif
+ }
+
+ void set(const T& val)
+ {
+ Subscript N = m_ * n_;
+ Subscript i;
+
+#ifdef TNT_UNROLL_LOOPS
+ Subscript Nmod4 = N & 3;
+ Subscript N4 = N - Nmod4;
+
+ for (i=0; i<N4; i+=4)
+ {
+ v_[i] = val;
+ v_[i+1] = val;
+ v_[i+2] = val;
+ v_[i+3] = val;
+ }
+
+ for (i=N4; i< N; i++)
+ v_[i] = val;
+#else
+
+ for (i=0; i< N; i++)
+ v_[i] = val;
+
+#endif
+ }
+
+
+
+ void destroy()
+ {
+ /* do nothing, if no memory has been previously allocated */
+ if (v_ == NULL) return ;
+
+ /* if we are here, then matrix was previously allocated */
+ if (v_ != NULL) delete [] (v_);
+ if (row_ != NULL) delete [] (row_);
+
+ /* return rowm1_ back to original value */
+ rowm1_ ++;
+ if (rowm1_ != NULL ) delete [] (rowm1_);
+ }
+
+
+ public:
+
+ operator T**(){ return row_; }
+ operator T**() const { return row_; }
+
+
+ Subscript size() const { return mn_; }
+
+ // constructors
+
+ Matrix() : m_(0), n_(0), mn_(0), v_(0), row_(0), vm1_(0), rowm1_(0) {};
+
+ Matrix(const Matrix<T> &A)
+ {
+ initialize(A.m_, A.n_);
+ copy(A.v_);
+ }
+
+ Matrix(Subscript M, Subscript N, const T& value = T())
+ {
+ initialize(M,N);
+ set(value);
+ }
+
+ Matrix(Subscript M, Subscript N, const T* v)
+ {
+ initialize(M,N);
+ copy(v);
+ }
+
+ Matrix(Subscript M, Subscript N, const char *s)
+ {
+ initialize(M,N);
+ //std::istrstream ins(s);
+ std::istringstream ins(s);
+
+ Subscript i, j;
+
+ for (i=0; i<M; i++)
+ for (j=0; j<N; j++)
+ ins >> row_[i][j];
+ }
+
+ // destructor
+ //
+ ~Matrix()
+ {
+ destroy();
+ }
+
+
+ // reallocating
+ //
+ Matrix<T>& newsize(Subscript M, Subscript N)
+ {
+ if (num_rows() == M && num_cols() == N)
+ return *this;
+
+ destroy();
+ initialize(M,N);
+
+ return *this;
+ }
+
+
+
+
+ // assignments
+ //
+ Matrix<T>& operator=(const Matrix<T> &A)
+ {
+ if (v_ == A.v_)
+ return *this;
+
+ if (m_ == A.m_ && n_ == A.n_) // no need to re-alloc
+ copy(A.v_);
+
+ else
+ {
+ destroy();
+ initialize(A.m_, A.n_);
+ copy(A.v_);
+ }
+
+ return *this;
+ }
+
+ Matrix<T>& operator=(const T& scalar)
+ {
+ set(scalar);
+ return *this;
+ }
+
+
+ Subscript dim(Subscript d) const
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert( d >= 1);
+ assert( d <= 2);
+#endif
+ return (d==1) ? m_ : ((d==2) ? n_ : 0);
+ }
+
+ Subscript num_rows() const { return m_; }
+ Subscript num_cols() const { return n_; }
+
+
+
+
+ inline T* operator[](Subscript i)
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(0<=i);
+ assert(i < m_) ;
+#endif
+ return row_[i];
+ }
+
+ inline const T* operator[](Subscript i) const
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(0<=i);
+ assert(i < m_) ;
+#endif
+ return row_[i];
+ }
+
+ inline reference operator()(Subscript i)
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(1<=i);
+ assert(i <= mn_) ;
+#endif
+ return vm1_[i];
+ }
+
+ inline const_reference operator()(Subscript i) const
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(1<=i);
+ assert(i <= mn_) ;
+#endif
+ return vm1_[i];
+ }
+
+
+
+ inline reference operator()(Subscript i, Subscript j)
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(1<=i);
+ assert(i <= m_) ;
+ assert(1<=j);
+ assert(j <= n_);
+#endif
+ return rowm1_[i][j];
+ }
+
+
+
+ inline const_reference operator() (Subscript i, Subscript j) const
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(1<=i);
+ assert(i <= m_) ;
+ assert(1<=j);
+ assert(j <= n_);
+#endif
+ return rowm1_[i][j];
+ }
+
+
+
+
+};
+
+
+/* *************************** I/O ********************************/
+
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Matrix<T> &A)
+{
+ Subscript M=A.num_rows();
+ Subscript N=A.num_cols();
+
+ s << M << " " << N << "\n";
+
+ for (Subscript i=0; i<M; i++)
+ {
+ for (Subscript j=0; j<N; j++)
+ {
+ s << A[i][j] << " ";
+ }
+ s << "\n";
+ }
+
+
+ return s;
+}
+
+template <class T>
+std::istream& operator>>(std::istream &s, Matrix<T> &A)
+{
+
+ Subscript M, N;
+
+ s >> M >> N;
+
+ if ( !(M == A.num_rows() && N == A.num_cols() ))
+ {
+ A.newsize(M,N);
+ }
+
+
+ for (Subscript i=0; i<M; i++)
+ for (Subscript j=0; j<N; j++)
+ {
+ s >> A[i][j];
+ }
+
+
+ return s;
+}
+
+// *******************[ basic matrix algorithms ]***************************
+
+
+template <class T>
+Matrix<T> operator+(const Matrix<T> &A,
+ const Matrix<T> &B)
+{
+ Subscript M = A.num_rows();
+ Subscript N = A.num_cols();
+
+ assert(M==B.num_rows());
+ assert(N==B.num_cols());
+
+ Matrix<T> tmp(M,N);
+ Subscript i,j;
+
+ for (i=0; i<M; i++)
+ for (j=0; j<N; j++)
+ tmp[i][j] = A[i][j] + B[i][j];
+
+ return tmp;
+}
+
+template <class T>
+Matrix<T> operator-(const Matrix<T> &A,
+ const Matrix<T> &B)
+{
+ Subscript M = A.num_rows();
+ Subscript N = A.num_cols();
+
+ assert(M==B.num_rows());
+ assert(N==B.num_cols());
+
+ Matrix<T> tmp(M,N);
+ Subscript i,j;
+
+ for (i=0; i<M; i++)
+ for (j=0; j<N; j++)
+ tmp[i][j] = A[i][j] - B[i][j];
+
+ return tmp;
+}
+
+template <class T>
+Matrix<T> mult_element(const Matrix<T> &A,
+ const Matrix<T> &B)
+{
+ Subscript M = A.num_rows();
+ Subscript N = A.num_cols();
+
+ assert(M==B.num_rows());
+ assert(N==B.num_cols());
+
+ Matrix<T> tmp(M,N);
+ Subscript i,j;
+
+ for (i=0; i<M; i++)
+ for (j=0; j<N; j++)
+ tmp[i][j] = A[i][j] * B[i][j];
+
+ return tmp;
+}
+
+
+template <class T>
+Matrix<T> transpose(const Matrix<T> &A)
+{
+ Subscript M = A.num_rows();
+ Subscript N = A.num_cols();
+
+ Matrix<T> S(N,M);
+ Subscript i, j;
+
+ for (i=0; i<M; i++)
+ for (j=0; j<N; j++)
+ S[j][i] = A[i][j];
+
+ return S;
+}
+
+
+
+template <class T>
+inline Matrix<T> matmult(const Matrix<T> &A,
+ const Matrix<T> &B)
+{
+
+#ifdef TNT_BOUNDS_CHECK
+ assert(A.num_cols() == B.num_rows());
+#endif
+
+ Subscript M = A.num_rows();
+ Subscript N = A.num_cols();
+ Subscript K = B.num_cols();
+
+ Matrix<T> tmp(M,K);
+ T sum;
+
+ for (Subscript i=0; i<M; i++)
+ for (Subscript k=0; k<K; k++)
+ {
+ sum = 0;
+ for (Subscript j=0; j<N; j++)
+ sum = sum + A[i][j] * B[j][k];
+
+ tmp[i][k] = sum;
+ }
+
+ return tmp;
+}
+
+template <class T>
+inline Matrix<T> operator*(const Matrix<T> &A,
+ const Matrix<T> &B)
+{
+ return matmult(A,B);
+}
+
+template <class T>
+inline int matmult(Matrix<T>& C, const Matrix<T> &A,
+ const Matrix<T> &B)
+{
+
+ assert(A.num_cols() == B.num_rows());
+
+ Subscript M = A.num_rows();
+ Subscript N = A.num_cols();
+ Subscript K = B.num_cols();
+
+ C.newsize(M,K);
+
+ T sum;
+
+ const T* row_i;
+ const T* col_k;
+
+ for (Subscript i=0; i<M; i++)
+ for (Subscript k=0; k<K; k++)
+ {
+ row_i = &(A[i][0]);
+ col_k = &(B[0][k]);
+ sum = 0;
+ for (Subscript j=0; j<N; j++)
+ {
+ sum += *row_i * *col_k;
+ row_i++;
+ col_k += K;
+ }
+ C[i][k] = sum;
+ }
+
+ return 0;
+}
+
+
+template <class T>
+Vector<T> matmult(const Matrix<T> &A, const Vector<T> &x)
+{
+
+#ifdef TNT_BOUNDS_CHECK
+ assert(A.num_cols() == x.dim());
+#endif
+
+ Subscript M = A.num_rows();
+ Subscript N = A.num_cols();
+
+ Vector<T> tmp(M);
+ T sum;
+
+ for (Subscript i=0; i<M; i++)
+ {
+ sum = 0;
+ const T* rowi = A[i];
+ for (Subscript j=0; j<N; j++)
+ sum = sum + rowi[j] * x[j];
+
+ tmp[i] = sum;
+ }
+
+ return tmp;
+}
+
+template <class T>
+inline Vector<T> operator*(const Matrix<T> &A, const Vector<T> &x)
+{
+ return matmult(A,x);
+}
+
+} // namespace TNT
+
+#endif
+// CMAT_H
diff --git a/intern/smoke/intern/tnt/tnt_fortran_array1d.h b/intern/smoke/intern/tnt/tnt_fortran_array1d.h
new file mode 100644
index 00000000000..ad3bba0c0a7
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_fortran_array1d.h
@@ -0,0 +1,267 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_FORTRAN_ARRAY1D_H
+#define TNT_FORTRAN_ARRAY1D_H
+
+#include <cstdlib>
+#include <iostream>
+
+#ifdef TNT_BOUNDS_CHECK
+#include <assert.h>
+#endif
+
+
+#include "tnt_i_refvec.h"
+
+namespace TNT
+{
+
+template <class T>
+class Fortran_Array1D
+{
+
+ private:
+
+ i_refvec<T> v_;
+ int n_;
+ T* data_; /* this normally points to v_.begin(), but
+ * could also point to a portion (subvector)
+ * of v_.
+ */
+
+ void initialize_(int n);
+ void copy_(T* p, const T* q, int len) const;
+ void set_(T* begin, T* end, const T& val);
+
+
+ public:
+
+ typedef T value_type;
+
+
+ Fortran_Array1D();
+ explicit Fortran_Array1D(int n);
+ Fortran_Array1D(int n, const T &a);
+ Fortran_Array1D(int n, T *a);
+ inline Fortran_Array1D(const Fortran_Array1D &A);
+ inline Fortran_Array1D & operator=(const T &a);
+ inline Fortran_Array1D & operator=(const Fortran_Array1D &A);
+ inline Fortran_Array1D & ref(const Fortran_Array1D &A);
+ Fortran_Array1D copy() const;
+ Fortran_Array1D & inject(const Fortran_Array1D & A);
+ inline T& operator()(int i);
+ inline const T& operator()(int i) const;
+ inline int dim1() const;
+ inline int dim() const;
+ ~Fortran_Array1D();
+
+
+ /* ... extended interface ... */
+
+ inline int ref_count() const;
+ inline Fortran_Array1D<T> subarray(int i0, int i1);
+
+};
+
+
+
+
+template <class T>
+Fortran_Array1D<T>::Fortran_Array1D() : v_(), n_(0), data_(0) {}
+
+template <class T>
+Fortran_Array1D<T>::Fortran_Array1D(const Fortran_Array1D<T> &A) : v_(A.v_), n_(A.n_),
+ data_(A.data_)
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Fortran_Array1D(const Fortran_Array1D<T> &A) \n";
+#endif
+
+}
+
+
+template <class T>
+Fortran_Array1D<T>::Fortran_Array1D(int n) : v_(n), n_(n), data_(v_.begin())
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Fortran_Array1D(int n) \n";
+#endif
+}
+
+template <class T>
+Fortran_Array1D<T>::Fortran_Array1D(int n, const T &val) : v_(n), n_(n), data_(v_.begin())
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Fortran_Array1D(int n, const T& val) \n";
+#endif
+ set_(data_, data_+ n, val);
+
+}
+
+template <class T>
+Fortran_Array1D<T>::Fortran_Array1D(int n, T *a) : v_(a), n_(n) , data_(v_.begin())
+{
+#ifdef TNT_DEBUG
+ std::cout << "Created Fortran_Array1D(int n, T* a) \n";
+#endif
+}
+
+template <class T>
+inline T& Fortran_Array1D<T>::operator()(int i)
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i>= 1);
+ assert(i <= n_);
+#endif
+ return data_[i-1];
+}
+
+template <class T>
+inline const T& Fortran_Array1D<T>::operator()(int i) const
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i>= 1);
+ assert(i <= n_);
+#endif
+ return data_[i-1];
+}
+
+
+
+
+template <class T>
+Fortran_Array1D<T> & Fortran_Array1D<T>::operator=(const T &a)
+{
+ set_(data_, data_+n_, a);
+ return *this;
+}
+
+template <class T>
+Fortran_Array1D<T> Fortran_Array1D<T>::copy() const
+{
+ Fortran_Array1D A( n_);
+ copy_(A.data_, data_, n_);
+
+ return A;
+}
+
+
+template <class T>
+Fortran_Array1D<T> & Fortran_Array1D<T>::inject(const Fortran_Array1D &A)
+{
+ if (A.n_ == n_)
+ copy_(data_, A.data_, n_);
+
+ return *this;
+}
+
+
+
+
+
+template <class T>
+Fortran_Array1D<T> & Fortran_Array1D<T>::ref(const Fortran_Array1D<T> &A)
+{
+ if (this != &A)
+ {
+ v_ = A.v_; /* operator= handles the reference counting. */
+ n_ = A.n_;
+ data_ = A.data_;
+
+ }
+ return *this;
+}
+
+template <class T>
+Fortran_Array1D<T> & Fortran_Array1D<T>::operator=(const Fortran_Array1D<T> &A)
+{
+ return ref(A);
+}
+
+template <class T>
+inline int Fortran_Array1D<T>::dim1() const { return n_; }
+
+template <class T>
+inline int Fortran_Array1D<T>::dim() const { return n_; }
+
+template <class T>
+Fortran_Array1D<T>::~Fortran_Array1D() {}
+
+
+/* ............................ exented interface ......................*/
+
+template <class T>
+inline int Fortran_Array1D<T>::ref_count() const
+{
+ return v_.ref_count();
+}
+
+template <class T>
+inline Fortran_Array1D<T> Fortran_Array1D<T>::subarray(int i0, int i1)
+{
+#ifdef TNT_DEBUG
+ std::cout << "entered subarray. \n";
+#endif
+ if ((i0 > 0) && (i1 < n_) || (i0 <= i1))
+ {
+ Fortran_Array1D<T> X(*this); /* create a new instance of this array. */
+ X.n_ = i1-i0+1;
+ X.data_ += i0;
+
+ return X;
+ }
+ else
+ {
+#ifdef TNT_DEBUG
+ std::cout << "subarray: null return.\n";
+#endif
+ return Fortran_Array1D<T>();
+ }
+}
+
+
+/* private internal functions */
+
+
+template <class T>
+void Fortran_Array1D<T>::set_(T* begin, T* end, const T& a)
+{
+ for (T* p=begin; p<end; p++)
+ *p = a;
+
+}
+
+template <class T>
+void Fortran_Array1D<T>::copy_(T* p, const T* q, int len) const
+{
+ T *end = p + len;
+ while (p<end )
+ *p++ = *q++;
+
+}
+
+
+} /* namespace TNT */
+
+#endif
+/* TNT_FORTRAN_ARRAY1D_H */
+
diff --git a/intern/smoke/intern/tnt/tnt_fortran_array1d_utils.h b/intern/smoke/intern/tnt/tnt_fortran_array1d_utils.h
new file mode 100644
index 00000000000..b037b173f77
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_fortran_array1d_utils.h
@@ -0,0 +1,242 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+#ifndef TNT_FORTRAN_ARRAY1D_UTILS_H
+#define TNT_FORTRAN_ARRAY1D_UTILS_H
+
+#include <iostream>
+
+namespace TNT
+{
+
+
+/**
+ Write an array to a character outstream. Output format is one that can
+ be read back in via the in-stream operator: one integer
+ denoting the array dimension (n), followed by n elements,
+ one per line.
+
+*/
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Fortran_Array1D<T> &A)
+{
+ int N=A.dim1();
+
+ s << N << "\n";
+ for (int j=1; j<=N; j++)
+ {
+ s << A(j) << "\n";
+ }
+ s << "\n";
+
+ return s;
+}
+
+/**
+ Read an array from a character stream. Input format
+ is one integer, denoting the dimension (n), followed
+ by n whitespace-separated elments. Newlines are ignored
+
+ <p>
+ Note: the array being read into references new memory
+ storage. If the intent is to fill an existing conformant
+ array, use <code> cin >> B; A.inject(B) ); </code>
+ instead or read the elements in one-a-time by hand.
+
+ @param s the charater to read from (typically <code>std::in</code>)
+ @param A the array to read into.
+*/
+template <class T>
+std::istream& operator>>(std::istream &s, Fortran_Array1D<T> &A)
+{
+ int N;
+ s >> N;
+
+ Fortran_Array1D<T> B(N);
+ for (int i=1; i<=N; i++)
+ s >> B(i);
+ A = B;
+ return s;
+}
+
+
+template <class T>
+Fortran_Array1D<T> operator+(const Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Fortran_Array1D<T>();
+
+ else
+ {
+ Fortran_Array1D<T> C(n);
+
+ for (int i=1; i<=n; i++)
+ {
+ C(i) = A(i) + B(i);
+ }
+ return C;
+ }
+}
+
+
+
+template <class T>
+Fortran_Array1D<T> operator-(const Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Fortran_Array1D<T>();
+
+ else
+ {
+ Fortran_Array1D<T> C(n);
+
+ for (int i=1; i<=n; i++)
+ {
+ C(i) = A(i) - B(i);
+ }
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array1D<T> operator*(const Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Fortran_Array1D<T>();
+
+ else
+ {
+ Fortran_Array1D<T> C(n);
+
+ for (int i=1; i<=n; i++)
+ {
+ C(i) = A(i) * B(i);
+ }
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array1D<T> operator/(const Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() != n )
+ return Fortran_Array1D<T>();
+
+ else
+ {
+ Fortran_Array1D<T> C(n);
+
+ for (int i=1; i<=n; i++)
+ {
+ C(i) = A(i) / B(i);
+ }
+ return C;
+ }
+}
+
+
+
+
+
+
+
+
+
+template <class T>
+Fortran_Array1D<T>& operator+=(Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=1; i<=n; i++)
+ {
+ A(i) += B(i);
+ }
+ }
+ return A;
+}
+
+
+
+
+template <class T>
+Fortran_Array1D<T>& operator-=(Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=1; i<=n; i++)
+ {
+ A(i) -= B(i);
+ }
+ }
+ return A;
+}
+
+
+
+template <class T>
+Fortran_Array1D<T>& operator*=(Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=1; i<=n; i++)
+ {
+ A(i) *= B(i);
+ }
+ }
+ return A;
+}
+
+
+
+
+template <class T>
+Fortran_Array1D<T>& operator/=(Fortran_Array1D<T> &A, const Fortran_Array1D<T> &B)
+{
+ int n = A.dim1();
+
+ if (B.dim1() == n)
+ {
+ for (int i=1; i<=n; i++)
+ {
+ A(i) /= B(i);
+ }
+ }
+ return A;
+}
+
+
+} // namespace TNT
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_fortran_array2d.h b/intern/smoke/intern/tnt/tnt_fortran_array2d.h
new file mode 100644
index 00000000000..f3075366d37
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_fortran_array2d.h
@@ -0,0 +1,225 @@
+/*
+*
+* Template Numerical Toolkit (TNT): Two-dimensional Fortran numerical array
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_FORTRAN_ARRAY2D_H
+#define TNT_FORTRAN_ARRAY2D_H
+
+#include <cstdlib>
+#include <iostream>
+
+#ifdef TNT_BOUNDS_CHECK
+#include <assert.h>
+#endif
+
+#include "tnt_i_refvec.h"
+
+namespace TNT
+{
+
+template <class T>
+class Fortran_Array2D
+{
+
+
+ private:
+ i_refvec<T> v_;
+ int m_;
+ int n_;
+ T* data_;
+
+
+ void initialize_(int n);
+ void copy_(T* p, const T* q, int len);
+ void set_(T* begin, T* end, const T& val);
+
+ public:
+
+ typedef T value_type;
+
+ Fortran_Array2D();
+ Fortran_Array2D(int m, int n);
+ Fortran_Array2D(int m, int n, T *a);
+ Fortran_Array2D(int m, int n, const T &a);
+ inline Fortran_Array2D(const Fortran_Array2D &A);
+ inline Fortran_Array2D & operator=(const T &a);
+ inline Fortran_Array2D & operator=(const Fortran_Array2D &A);
+ inline Fortran_Array2D & ref(const Fortran_Array2D &A);
+ Fortran_Array2D copy() const;
+ Fortran_Array2D & inject(const Fortran_Array2D & A);
+ inline T& operator()(int i, int j);
+ inline const T& operator()(int i, int j) const ;
+ inline int dim1() const;
+ inline int dim2() const;
+ ~Fortran_Array2D();
+
+ /* extended interface */
+
+ inline int ref_count() const;
+
+};
+
+template <class T>
+Fortran_Array2D<T>::Fortran_Array2D() : v_(), m_(0), n_(0), data_(0) {}
+
+
+template <class T>
+Fortran_Array2D<T>::Fortran_Array2D(const Fortran_Array2D<T> &A) : v_(A.v_),
+ m_(A.m_), n_(A.n_), data_(A.data_) {}
+
+
+
+template <class T>
+Fortran_Array2D<T>::Fortran_Array2D(int m, int n) : v_(m*n), m_(m), n_(n),
+ data_(v_.begin()) {}
+
+template <class T>
+Fortran_Array2D<T>::Fortran_Array2D(int m, int n, const T &val) :
+ v_(m*n), m_(m), n_(n), data_(v_.begin())
+{
+ set_(data_, data_+m*n, val);
+}
+
+
+template <class T>
+Fortran_Array2D<T>::Fortran_Array2D(int m, int n, T *a) : v_(a),
+ m_(m), n_(n), data_(v_.begin()) {}
+
+
+
+
+template <class T>
+inline T& Fortran_Array2D<T>::operator()(int i, int j)
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i >= 1);
+ assert(i <= m_);
+ assert(j >= 1);
+ assert(j <= n_);
+#endif
+
+ return v_[ (j-1)*m_ + (i-1) ];
+
+}
+
+template <class T>
+inline const T& Fortran_Array2D<T>::operator()(int i, int j) const
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i >= 1);
+ assert(i <= m_);
+ assert(j >= 1);
+ assert(j <= n_);
+#endif
+
+ return v_[ (j-1)*m_ + (i-1) ];
+
+}
+
+
+template <class T>
+Fortran_Array2D<T> & Fortran_Array2D<T>::operator=(const T &a)
+{
+ set_(data_, data_+m_*n_, a);
+ return *this;
+}
+
+template <class T>
+Fortran_Array2D<T> Fortran_Array2D<T>::copy() const
+{
+
+ Fortran_Array2D B(m_,n_);
+
+ B.inject(*this);
+ return B;
+}
+
+
+template <class T>
+Fortran_Array2D<T> & Fortran_Array2D<T>::inject(const Fortran_Array2D &A)
+{
+ if (m_ == A.m_ && n_ == A.n_)
+ copy_(data_, A.data_, m_*n_);
+
+ return *this;
+}
+
+
+
+template <class T>
+Fortran_Array2D<T> & Fortran_Array2D<T>::ref(const Fortran_Array2D<T> &A)
+{
+ if (this != &A)
+ {
+ v_ = A.v_;
+ m_ = A.m_;
+ n_ = A.n_;
+ data_ = A.data_;
+ }
+ return *this;
+}
+
+template <class T>
+Fortran_Array2D<T> & Fortran_Array2D<T>::operator=(const Fortran_Array2D<T> &A)
+{
+ return ref(A);
+}
+
+template <class T>
+inline int Fortran_Array2D<T>::dim1() const { return m_; }
+
+template <class T>
+inline int Fortran_Array2D<T>::dim2() const { return n_; }
+
+
+template <class T>
+Fortran_Array2D<T>::~Fortran_Array2D()
+{
+}
+
+template <class T>
+inline int Fortran_Array2D<T>::ref_count() const { return v_.ref_count(); }
+
+
+
+
+template <class T>
+void Fortran_Array2D<T>::set_(T* begin, T* end, const T& a)
+{
+ for (T* p=begin; p<end; p++)
+ *p = a;
+
+}
+
+template <class T>
+void Fortran_Array2D<T>::copy_(T* p, const T* q, int len)
+{
+ T *end = p + len;
+ while (p<end )
+ *p++ = *q++;
+
+}
+
+
+} /* namespace TNT */
+
+#endif
+/* TNT_FORTRAN_ARRAY2D_H */
+
diff --git a/intern/smoke/intern/tnt/tnt_fortran_array2d_utils.h b/intern/smoke/intern/tnt/tnt_fortran_array2d_utils.h
new file mode 100644
index 00000000000..bb6867368cf
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_fortran_array2d_utils.h
@@ -0,0 +1,236 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+#ifndef TNT_FORTRAN_ARRAY2D_UTILS_H
+#define TNT_FORTRAN_ARRAY2D_UTILS_H
+
+#include <iostream>
+
+namespace TNT
+{
+
+
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Fortran_Array2D<T> &A)
+{
+ int M=A.dim1();
+ int N=A.dim2();
+
+ s << M << " " << N << "\n";
+
+ for (int i=1; i<=M; i++)
+ {
+ for (int j=1; j<=N; j++)
+ {
+ s << A(i,j) << " ";
+ }
+ s << "\n";
+ }
+
+
+ return s;
+}
+
+template <class T>
+std::istream& operator>>(std::istream &s, Fortran_Array2D<T> &A)
+{
+
+ int M, N;
+
+ s >> M >> N;
+
+ Fortran_Array2D<T> B(M,N);
+
+ for (int i=1; i<=M; i++)
+ for (int j=1; j<=N; j++)
+ {
+ s >> B(i,j);
+ }
+
+ A = B;
+ return s;
+}
+
+
+
+
+template <class T>
+Fortran_Array2D<T> operator+(const Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Fortran_Array2D<T>();
+
+ else
+ {
+ Fortran_Array2D<T> C(m,n);
+
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ C(i,j) = A(i,j) + B(i,j);
+ }
+ return C;
+ }
+}
+
+template <class T>
+Fortran_Array2D<T> operator-(const Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Fortran_Array2D<T>();
+
+ else
+ {
+ Fortran_Array2D<T> C(m,n);
+
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ C(i,j) = A(i,j) - B(i,j);
+ }
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array2D<T> operator*(const Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Fortran_Array2D<T>();
+
+ else
+ {
+ Fortran_Array2D<T> C(m,n);
+
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ C(i,j) = A(i,j) * B(i,j);
+ }
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array2D<T> operator/(const Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() != m || B.dim2() != n )
+ return Fortran_Array2D<T>();
+
+ else
+ {
+ Fortran_Array2D<T> C(m,n);
+
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ C(i,j) = A(i,j) / B(i,j);
+ }
+ return C;
+ }
+}
+
+
+
+template <class T>
+Fortran_Array2D<T>& operator+=(Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ A(i,j) += B(i,j);
+ }
+ }
+ return A;
+}
+
+template <class T>
+Fortran_Array2D<T>& operator-=(Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ A(i,j) -= B(i,j);
+ }
+ }
+ return A;
+}
+
+template <class T>
+Fortran_Array2D<T>& operator*=(Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ A(i,j) *= B(i,j);
+ }
+ }
+ return A;
+}
+
+template <class T>
+Fortran_Array2D<T>& operator/=(Fortran_Array2D<T> &A, const Fortran_Array2D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+
+ if (B.dim1() == m || B.dim2() == n )
+ {
+ for (int i=1; i<=m; i++)
+ {
+ for (int j=1; j<=n; j++)
+ A(i,j) /= B(i,j);
+ }
+ }
+ return A;
+}
+
+} // namespace TNT
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_fortran_array3d.h b/intern/smoke/intern/tnt/tnt_fortran_array3d.h
new file mode 100644
index 00000000000..e51affba4ea
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_fortran_array3d.h
@@ -0,0 +1,223 @@
+/*
+*
+* Template Numerical Toolkit (TNT): Three-dimensional Fortran numerical array
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_FORTRAN_ARRAY3D_H
+#define TNT_FORTRAN_ARRAY3D_H
+
+#include <cstdlib>
+#include <iostream>
+#ifdef TNT_BOUNDS_CHECK
+#include <assert.h>
+#endif
+#include "tnt_i_refvec.h"
+
+namespace TNT
+{
+
+template <class T>
+class Fortran_Array3D
+{
+
+
+ private:
+
+
+ i_refvec<T> v_;
+ int m_;
+ int n_;
+ int k_;
+ T* data_;
+
+ public:
+
+ typedef T value_type;
+
+ Fortran_Array3D();
+ Fortran_Array3D(int m, int n, int k);
+ Fortran_Array3D(int m, int n, int k, T *a);
+ Fortran_Array3D(int m, int n, int k, const T &a);
+ inline Fortran_Array3D(const Fortran_Array3D &A);
+ inline Fortran_Array3D & operator=(const T &a);
+ inline Fortran_Array3D & operator=(const Fortran_Array3D &A);
+ inline Fortran_Array3D & ref(const Fortran_Array3D &A);
+ Fortran_Array3D copy() const;
+ Fortran_Array3D & inject(const Fortran_Array3D & A);
+ inline T& operator()(int i, int j, int k);
+ inline const T& operator()(int i, int j, int k) const ;
+ inline int dim1() const;
+ inline int dim2() const;
+ inline int dim3() const;
+ inline int ref_count() const;
+ ~Fortran_Array3D();
+
+
+};
+
+template <class T>
+Fortran_Array3D<T>::Fortran_Array3D() : v_(), m_(0), n_(0), k_(0), data_(0) {}
+
+
+template <class T>
+Fortran_Array3D<T>::Fortran_Array3D(const Fortran_Array3D<T> &A) :
+ v_(A.v_), m_(A.m_), n_(A.n_), k_(A.k_), data_(A.data_) {}
+
+
+
+template <class T>
+Fortran_Array3D<T>::Fortran_Array3D(int m, int n, int k) :
+ v_(m*n*k), m_(m), n_(n), k_(k), data_(v_.begin()) {}
+
+
+
+template <class T>
+Fortran_Array3D<T>::Fortran_Array3D(int m, int n, int k, const T &val) :
+ v_(m*n*k), m_(m), n_(n), k_(k), data_(v_.begin())
+{
+ for (T* p = data_; p < data_ + m*n*k; p++)
+ *p = val;
+}
+
+template <class T>
+Fortran_Array3D<T>::Fortran_Array3D(int m, int n, int k, T *a) :
+ v_(a), m_(m), n_(n), k_(k), data_(v_.begin()) {}
+
+
+
+
+template <class T>
+inline T& Fortran_Array3D<T>::operator()(int i, int j, int k)
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i >= 1);
+ assert(i <= m_);
+ assert(j >= 1);
+ assert(j <= n_);
+ assert(k >= 1);
+ assert(k <= k_);
+#endif
+
+ return data_[(k-1)*m_*n_ + (j-1) * m_ + i-1];
+
+}
+
+template <class T>
+inline const T& Fortran_Array3D<T>::operator()(int i, int j, int k) const
+{
+#ifdef TNT_BOUNDS_CHECK
+ assert(i >= 1);
+ assert(i <= m_);
+ assert(j >= 1);
+ assert(j <= n_);
+ assert(k >= 1);
+ assert(k <= k_);
+#endif
+
+ return data_[(k-1)*m_*n_ + (j-1) * m_ + i-1];
+}
+
+
+template <class T>
+Fortran_Array3D<T> & Fortran_Array3D<T>::operator=(const T &a)
+{
+
+ T *end = data_ + m_*n_*k_;
+
+ for (T *p=data_; p != end; *p++ = a);
+
+ return *this;
+}
+
+template <class T>
+Fortran_Array3D<T> Fortran_Array3D<T>::copy() const
+{
+
+ Fortran_Array3D B(m_, n_, k_);
+ B.inject(*this);
+ return B;
+
+}
+
+
+template <class T>
+Fortran_Array3D<T> & Fortran_Array3D<T>::inject(const Fortran_Array3D &A)
+{
+
+ if (m_ == A.m_ && n_ == A.n_ && k_ == A.k_)
+ {
+ T *p = data_;
+ T *end = data_ + m_*n_*k_;
+ const T* q = A.data_;
+ for (; p < end; *p++ = *q++);
+ }
+ return *this;
+}
+
+
+
+
+template <class T>
+Fortran_Array3D<T> & Fortran_Array3D<T>::ref(const Fortran_Array3D<T> &A)
+{
+
+ if (this != &A)
+ {
+ v_ = A.v_;
+ m_ = A.m_;
+ n_ = A.n_;
+ k_ = A.k_;
+ data_ = A.data_;
+ }
+ return *this;
+}
+
+template <class T>
+Fortran_Array3D<T> & Fortran_Array3D<T>::operator=(const Fortran_Array3D<T> &A)
+{
+ return ref(A);
+}
+
+template <class T>
+inline int Fortran_Array3D<T>::dim1() const { return m_; }
+
+template <class T>
+inline int Fortran_Array3D<T>::dim2() const { return n_; }
+
+template <class T>
+inline int Fortran_Array3D<T>::dim3() const { return k_; }
+
+
+template <class T>
+inline int Fortran_Array3D<T>::ref_count() const
+{
+ return v_.ref_count();
+}
+
+template <class T>
+Fortran_Array3D<T>::~Fortran_Array3D()
+{
+}
+
+
+} /* namespace TNT */
+
+#endif
+/* TNT_FORTRAN_ARRAY3D_H */
+
diff --git a/intern/smoke/intern/tnt/tnt_fortran_array3d_utils.h b/intern/smoke/intern/tnt/tnt_fortran_array3d_utils.h
new file mode 100644
index 00000000000..a13a275dc0d
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_fortran_array3d_utils.h
@@ -0,0 +1,249 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+#ifndef TNT_FORTRAN_ARRAY3D_UTILS_H
+#define TNT_FORTRAN_ARRAY3D_UTILS_H
+
+#include <cstdlib>
+#include <cassert>
+
+namespace TNT
+{
+
+
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Fortran_Array3D<T> &A)
+{
+ int M=A.dim1();
+ int N=A.dim2();
+ int K=A.dim3();
+
+ s << M << " " << N << " " << K << "\n";
+
+ for (int i=1; i<=M; i++)
+ {
+ for (int j=1; j<=N; j++)
+ {
+ for (int k=1; k<=K; k++)
+ s << A(i,j,k) << " ";
+ s << "\n";
+ }
+ s << "\n";
+ }
+
+
+ return s;
+}
+
+template <class T>
+std::istream& operator>>(std::istream &s, Fortran_Array3D<T> &A)
+{
+
+ int M, N, K;
+
+ s >> M >> N >> K;
+
+ Fortran_Array3D<T> B(M,N,K);
+
+ for (int i=1; i<=M; i++)
+ for (int j=1; j<=N; j++)
+ for (int k=1; k<=K; k++)
+ s >> B(i,j,k);
+
+ A = B;
+ return s;
+}
+
+
+template <class T>
+Fortran_Array3D<T> operator+(const Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Fortran_Array3D<T>();
+
+ else
+ {
+ Fortran_Array3D<T> C(m,n,p);
+
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ C(i,j,k) = A(i,j,k)+ B(i,j,k);
+
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array3D<T> operator-(const Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Fortran_Array3D<T>();
+
+ else
+ {
+ Fortran_Array3D<T> C(m,n,p);
+
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ C(i,j,k) = A(i,j,k)- B(i,j,k);
+
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array3D<T> operator*(const Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Fortran_Array3D<T>();
+
+ else
+ {
+ Fortran_Array3D<T> C(m,n,p);
+
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ C(i,j,k) = A(i,j,k)* B(i,j,k);
+
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array3D<T> operator/(const Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() != m || B.dim2() != n || B.dim3() != p )
+ return Fortran_Array3D<T>();
+
+ else
+ {
+ Fortran_Array3D<T> C(m,n,p);
+
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ C(i,j,k) = A(i,j,k)/ B(i,j,k);
+
+ return C;
+ }
+}
+
+
+template <class T>
+Fortran_Array3D<T>& operator+=(Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ A(i,j,k) += B(i,j,k);
+ }
+
+ return A;
+}
+
+
+template <class T>
+Fortran_Array3D<T>& operator-=(Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ A(i,j,k) -= B(i,j,k);
+ }
+
+ return A;
+}
+
+
+template <class T>
+Fortran_Array3D<T>& operator*=(Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ A(i,j,k) *= B(i,j,k);
+ }
+
+ return A;
+}
+
+
+template <class T>
+Fortran_Array3D<T>& operator/=(Fortran_Array3D<T> &A, const Fortran_Array3D<T> &B)
+{
+ int m = A.dim1();
+ int n = A.dim2();
+ int p = A.dim3();
+
+ if (B.dim1() == m && B.dim2() == n && B.dim3() == p )
+ {
+ for (int i=1; i<=m; i++)
+ for (int j=1; j<=n; j++)
+ for (int k=1; k<=p; k++)
+ A(i,j,k) /= B(i,j,k);
+ }
+
+ return A;
+}
+
+
+} // namespace TNT
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_i_refvec.h b/intern/smoke/intern/tnt/tnt_i_refvec.h
new file mode 100644
index 00000000000..5a67eb57896
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_i_refvec.h
@@ -0,0 +1,243 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_I_REFVEC_H
+#define TNT_I_REFVEC_H
+
+#include <cstdlib>
+#include <iostream>
+
+#ifdef TNT_BOUNDS_CHECK
+#include <assert.h>
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+namespace TNT
+{
+/*
+ Internal representation of ref-counted array. The TNT
+ arrays all use this building block.
+
+ <p>
+ If an array block is created by TNT, then every time
+ an assignment is made, the left-hand-side reference
+ is decreased by one, and the right-hand-side refernce
+ count is increased by one. If the array block was
+ external to TNT, the refernce count is a NULL pointer
+ regardless of how many references are made, since the
+ memory is not freed by TNT.
+
+
+
+*/
+template <class T>
+class i_refvec
+{
+
+
+ private:
+ T* data_;
+ int *ref_count_;
+
+
+ public:
+
+ i_refvec();
+ explicit i_refvec(int n);
+ inline i_refvec(T* data);
+ inline i_refvec(const i_refvec &v);
+ inline T* begin();
+ inline const T* begin() const;
+ inline T& operator[](int i);
+ inline const T& operator[](int i) const;
+ inline i_refvec<T> & operator=(const i_refvec<T> &V);
+ void copy_(T* p, const T* q, const T* e);
+ void set_(T* p, const T* b, const T* e);
+ inline int ref_count() const;
+ inline int is_null() const;
+ inline void destroy();
+ ~i_refvec();
+
+};
+
+template <class T>
+void i_refvec<T>::copy_(T* p, const T* q, const T* e)
+{
+ for (T* t=p; q<e; t++, q++)
+ *t= *q;
+}
+
+template <class T>
+i_refvec<T>::i_refvec() : data_(NULL), ref_count_(NULL) {}
+
+/**
+ In case n is 0 or negative, it does NOT call new.
+*/
+template <class T>
+i_refvec<T>::i_refvec(int n) : data_(NULL), ref_count_(NULL)
+{
+ if (n >= 1)
+ {
+#ifdef TNT_DEBUG
+ std::cout << "new data storage.\n";
+#endif
+ data_ = new T[n];
+ ref_count_ = new int;
+ *ref_count_ = 1;
+ }
+}
+
+template <class T>
+inline i_refvec<T>::i_refvec(const i_refvec<T> &V): data_(V.data_),
+ ref_count_(V.ref_count_)
+{
+ if (V.ref_count_ != NULL)
+ (*(V.ref_count_))++;
+}
+
+
+template <class T>
+i_refvec<T>::i_refvec(T* data) : data_(data), ref_count_(NULL) {}
+
+template <class T>
+inline T* i_refvec<T>::begin()
+{
+ return data_;
+}
+
+template <class T>
+inline const T& i_refvec<T>::operator[](int i) const
+{
+ return data_[i];
+}
+
+template <class T>
+inline T& i_refvec<T>::operator[](int i)
+{
+ return data_[i];
+}
+
+
+template <class T>
+inline const T* i_refvec<T>::begin() const
+{
+ return data_;
+}
+
+
+
+template <class T>
+i_refvec<T> & i_refvec<T>::operator=(const i_refvec<T> &V)
+{
+ if (this == &V)
+ return *this;
+
+
+ if (ref_count_ != NULL)
+ {
+ (*ref_count_) --;
+ if ((*ref_count_) == 0)
+ destroy();
+ }
+
+ data_ = V.data_;
+ ref_count_ = V.ref_count_;
+
+ if (V.ref_count_ != NULL)
+ (*(V.ref_count_))++;
+
+ return *this;
+}
+
+template <class T>
+void i_refvec<T>::destroy()
+{
+ if (ref_count_ != NULL)
+ {
+#ifdef TNT_DEBUG
+ std::cout << "destorying data... \n";
+#endif
+ delete ref_count_;
+
+#ifdef TNT_DEBUG
+ std::cout << "deleted ref_count_ ...\n";
+#endif
+ if (data_ != NULL)
+ delete []data_;
+#ifdef TNT_DEBUG
+ std::cout << "deleted data_[] ...\n";
+#endif
+ data_ = NULL;
+ }
+}
+
+/*
+* return 1 is vector is empty, 0 otherwise
+*
+* if is_null() is false and ref_count() is 0, then
+*
+*/
+template<class T>
+int i_refvec<T>::is_null() const
+{
+ return (data_ == NULL ? 1 : 0);
+}
+
+/*
+* returns -1 if data is external,
+* returns 0 if a is NULL array,
+* otherwise returns the positive number of vectors sharing
+* this data space.
+*/
+template <class T>
+int i_refvec<T>::ref_count() const
+{
+ if (data_ == NULL)
+ return 0;
+ else
+ return (ref_count_ != NULL ? *ref_count_ : -1) ;
+}
+
+template <class T>
+i_refvec<T>::~i_refvec()
+{
+ if (ref_count_ != NULL)
+ {
+ (*ref_count_)--;
+
+ if (*ref_count_ == 0)
+ destroy();
+ }
+}
+
+
+} /* namespace TNT */
+
+
+
+
+
+#endif
+/* TNT_I_REFVEC_H */
+
diff --git a/intern/smoke/intern/tnt/tnt_math_utils.h b/intern/smoke/intern/tnt/tnt_math_utils.h
new file mode 100644
index 00000000000..6e14a1d9b90
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_math_utils.h
@@ -0,0 +1,34 @@
+#ifndef MATH_UTILS_H
+#define MATH_UTILS_H
+
+/* needed for fabs, sqrt() below */
+#include <cmath>
+
+
+
+namespace TNT
+{
+/**
+ @returns hypotenuse of real (non-complex) scalars a and b by
+ avoiding underflow/overflow
+ using (a * sqrt( 1 + (b/a) * (b/a))), rather than
+ sqrt(a*a + b*b).
+*/
+template <class Real>
+Real hypot(const Real &a, const Real &b)
+{
+
+ if (a== 0)
+ return fabs(b);
+ else
+ {
+ Real c = b/a;
+ return fabs(a) * sqrt(1 + c*c);
+ }
+}
+} /* TNT namespace */
+
+
+
+#endif
+/* MATH_UTILS_H */
diff --git a/intern/smoke/intern/tnt/tnt_sparse_matrix_csr.h b/intern/smoke/intern/tnt/tnt_sparse_matrix_csr.h
new file mode 100644
index 00000000000..0d4fde1c207
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_sparse_matrix_csr.h
@@ -0,0 +1,103 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+#ifndef TNT_SPARSE_MATRIX_CSR_H
+#define TNT_SPARSE_MATRIX_CSR_H
+
+#include "tnt_array1d.h"
+
+namespace TNT
+{
+
+
+/**
+ Read-only view of a sparse matrix in compressed-row storage
+ format. Neither array elements (nonzeros) nor sparsity
+ structure can be modified. If modifications are required,
+ create a new view.
+
+ <p>
+ Index values begin at 0.
+
+ <p>
+ <b>Storage requirements:</b> An (m x n) matrix with
+ nz nonzeros requires no more than ((T+I)*nz + M*I)
+ bytes, where T is the size of data elements and
+ I is the size of integers.
+
+
+*/
+template <class T>
+class Sparse_Matrix_CompRow {
+
+private:
+ Array1D<T> val_; // data values (nz_ elements)
+ Array1D<int> rowptr_; // row_ptr (dim_[0]+1 elements)
+ Array1D<int> colind_; // col_ind (nz_ elements)
+
+ int dim1_; // number of rows
+ int dim2_; // number of cols
+
+public:
+
+ Sparse_Matrix_CompRow(const Sparse_Matrix_CompRow &S);
+ Sparse_Matrix_CompRow(int M, int N, int nz, const T *val,
+ const int *r, const int *c);
+
+
+
+ inline const T& val(int i) const { return val_[i]; }
+ inline const int& row_ptr(int i) const { return rowptr_[i]; }
+ inline const int& col_ind(int i) const { return colind_[i];}
+
+ inline int dim1() const {return dim1_;}
+ inline int dim2() const {return dim2_;}
+ int NumNonzeros() const {return val_.dim1();}
+
+
+ Sparse_Matrix_CompRow& operator=(
+ const Sparse_Matrix_CompRow &R);
+
+
+
+};
+
+/**
+ Construct a read-only view of existing sparse matrix in
+ compressed-row storage format.
+
+ @param M the number of rows of sparse matrix
+ @param N the number of columns of sparse matrix
+ @param nz the number of nonzeros
+ @param val a contiguous list of nonzero values
+ @param r row-pointers: r[i] denotes the begining position of row i
+ (i.e. the ith row begins at val[row[i]]).
+ @param c column-indices: c[i] denotes the column location of val[i]
+*/
+template <class T>
+Sparse_Matrix_CompRow<T>::Sparse_Matrix_CompRow(int M, int N, int nz,
+ const T *val, const int *r, const int *c) : val_(nz,val),
+ rowptr_(M, r), colind_(nz, c), dim1_(M), dim2_(N) {}
+
+
+}
+// namespace TNT
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_stopwatch.h b/intern/smoke/intern/tnt/tnt_stopwatch.h
new file mode 100644
index 00000000000..8dc5d23ac1e
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_stopwatch.h
@@ -0,0 +1,95 @@
+/*
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef STOPWATCH_H
+#define STOPWATCH_H
+
+// for clock() and CLOCKS_PER_SEC
+#include <time.h>
+
+
+namespace TNT
+{
+
+inline static double seconds(void)
+{
+ const double secs_per_tick = 1.0 / CLOCKS_PER_SEC;
+ return ( (double) clock() ) * secs_per_tick;
+}
+
+class Stopwatch {
+ private:
+ int running_;
+ double start_time_;
+ double total_;
+
+ public:
+ inline Stopwatch();
+ inline void start();
+ inline double stop();
+ inline double read();
+ inline void resume();
+ inline int running();
+};
+
+inline Stopwatch::Stopwatch() : running_(0), start_time_(0.0), total_(0.0) {}
+
+void Stopwatch::start()
+{
+ running_ = 1;
+ total_ = 0.0;
+ start_time_ = seconds();
+}
+
+double Stopwatch::stop()
+{
+ if (running_)
+ {
+ total_ += (seconds() - start_time_);
+ running_ = 0;
+ }
+ return total_;
+}
+
+inline void Stopwatch::resume()
+{
+ if (!running_)
+ {
+ start_time_ = seconds();
+ running_ = 1;
+ }
+}
+
+
+inline double Stopwatch::read()
+{
+ if (running_)
+ {
+ stop();
+ resume();
+ }
+ return total_;
+}
+
+
+} /* TNT namespace */
+#endif
+
+
+
diff --git a/intern/smoke/intern/tnt/tnt_subscript.h b/intern/smoke/intern/tnt/tnt_subscript.h
new file mode 100644
index 00000000000..d8fe1200eeb
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_subscript.h
@@ -0,0 +1,54 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+#ifndef TNT_SUBSCRPT_H
+#define TNT_SUBSCRPT_H
+
+
+//---------------------------------------------------------------------
+// This definition describes the default TNT data type used for
+// indexing into TNT matrices and vectors. The data type should
+// be wide enough to index into large arrays. It defaults to an
+// "int", but can be overriden at compile time redefining TNT_SUBSCRIPT_TYPE,
+// e.g.
+//
+// c++ -DTNT_SUBSCRIPT_TYPE='unsigned int' ...
+//
+//---------------------------------------------------------------------
+//
+
+#ifndef TNT_SUBSCRIPT_TYPE
+#define TNT_SUBSCRIPT_TYPE int
+#endif
+
+namespace TNT
+{
+ typedef TNT_SUBSCRIPT_TYPE Subscript;
+} /* namespace TNT */
+
+
+// () indexing in TNT means 1-offset, i.e. x(1) and A(1,1) are the
+// first elements. This offset is left as a macro for future
+// purposes, but should not be changed in the current release.
+//
+//
+#define TNT_BASE_OFFSET (1)
+
+#endif
diff --git a/intern/smoke/intern/tnt/tnt_vec.h b/intern/smoke/intern/tnt/tnt_vec.h
new file mode 100644
index 00000000000..a0f614b5cbd
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_vec.h
@@ -0,0 +1,404 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+
+
+#ifndef TNT_VEC_H
+#define TNT_VEC_H
+
+#include "tnt_subscript.h"
+#include <cstdlib>
+#include <cassert>
+#include <iostream>
+#include <sstream>
+
+namespace TNT
+{
+
+/**
+ <b>[Deprecatred]</b> Value-based vector class from pre-1.0
+ TNT version. Kept here for backward compatiblity, but should
+ use the newer TNT::Array1D classes instead.
+
+*/
+
+template <class T>
+class Vector
+{
+
+
+ public:
+
+ typedef Subscript size_type;
+ typedef T value_type;
+ typedef T element_type;
+ typedef T* pointer;
+ typedef T* iterator;
+ typedef T& reference;
+ typedef const T* const_iterator;
+ typedef const T& const_reference;
+
+ Subscript lbound() const { return 1;}
+
+ protected:
+ T* v_;
+ T* vm1_; // pointer adjustment for optimzied 1-offset indexing
+ Subscript n_;
+
+ // internal helper function to create the array
+ // of row pointers
+
+ void initialize(Subscript N)
+ {
+ // adjust pointers so that they are 1-offset:
+ // v_[] is the internal contiguous array, it is still 0-offset
+ //
+ assert(v_ == NULL);
+ v_ = new T[N];
+ assert(v_ != NULL);
+ vm1_ = v_-1;
+ n_ = N;
+ }
+
+ void copy(const T* v)
+ {
+ Subscript N = n_;
+ Subscript i;
+
+#ifdef TNT_UNROLL_LOOPS
+ Subscript Nmod4 = N & 3;
+ Subscript N4 = N - Nmod4;
+
+ for (i=0; i<N4; i+=4)
+ {
+ v_[i] = v[i];
+ v_[i+1] = v[i+1];
+ v_[i+2] = v[i+2];
+ v_[i+3] = v[i+3];
+ }
+
+ for (i=N4; i< N; i++)
+ v_[i] = v[i];
+#else
+
+ for (i=0; i< N; i++)
+ v_[i] = v[i];
+#endif
+ }
+
+ void set(const T& val)
+ {
+ Subscript N = n_;
+ Subscript i;
+
+#ifdef TNT_UNROLL_LOOPS
+ Subscript Nmod4 = N & 3;
+ Subscript N4 = N - Nmod4;
+
+ for (i=0; i<N4; i+=4)
+ {
+ v_[i] = val;
+ v_[i+1] = val;
+ v_[i+2] = val;
+ v_[i+3] = val;
+ }
+
+ for (i=N4; i< N; i++)
+ v_[i] = val;
+#else
+
+ for (i=0; i< N; i++)
+ v_[i] = val;
+
+#endif
+ }
+
+
+
+ void destroy()
+ {
+ /* do nothing, if no memory has been previously allocated */
+ if (v_ == NULL) return ;
+
+ /* if we are here, then matrix was previously allocated */
+ delete [] (v_);
+
+ v_ = NULL;
+ vm1_ = NULL;
+ }
+
+
+ public:
+
+ // access
+
+ iterator begin() { return v_;}
+ iterator end() { return v_ + n_; }
+ iterator begin() const { return v_;}
+ iterator end() const { return v_ + n_; }
+
+ // destructor
+
+ ~Vector()
+ {
+ destroy();
+ }
+
+ // constructors
+
+ Vector() : v_(0), vm1_(0), n_(0) {};
+
+ Vector(const Vector<T> &A) : v_(0), vm1_(0), n_(0)
+ {
+ initialize(A.n_);
+ copy(A.v_);
+ }
+
+ Vector(Subscript N, const T& value = T()) : v_(0), vm1_(0), n_(0)
+ {
+ initialize(N);
+ set(value);
+ }
+
+ Vector(Subscript N, const T* v) : v_(0), vm1_(0), n_(0)
+ {
+ initialize(N);
+ copy(v);
+ }
+
+ Vector(Subscript N, char *s) : v_(0), vm1_(0), n_(0)
+ {
+ initialize(N);
+ std::istringstream ins(s);
+
+ Subscript i;
+
+ for (i=0; i<N; i++)
+ ins >> v_[i];
+ }
+
+
+ // methods
+ //
+ Vector<T>& newsize(Subscript N)
+ {
+ if (n_ == N) return *this;
+
+ destroy();
+ initialize(N);
+
+ return *this;
+ }
+
+
+ // assignments
+ //
+ Vector<T>& operator=(const Vector<T> &A)
+ {
+ if (v_ == A.v_)
+ return *this;
+
+ if (n_ == A.n_) // no need to re-alloc
+ copy(A.v_);
+
+ else
+ {
+ destroy();
+ initialize(A.n_);
+ copy(A.v_);
+ }
+
+ return *this;
+ }
+
+ Vector<T>& operator=(const T& scalar)
+ {
+ set(scalar);
+ return *this;
+ }
+
+ inline Subscript dim() const
+ {
+ return n_;
+ }
+
+ inline Subscript size() const
+ {
+ return n_;
+ }
+
+
+ inline reference operator()(Subscript i)
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(1<=i);
+ assert(i <= n_) ;
+#endif
+ return vm1_[i];
+ }
+
+ inline const_reference operator() (Subscript i) const
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(1<=i);
+ assert(i <= n_) ;
+#endif
+ return vm1_[i];
+ }
+
+ inline reference operator[](Subscript i)
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(0<=i);
+ assert(i < n_) ;
+#endif
+ return v_[i];
+ }
+
+ inline const_reference operator[](Subscript i) const
+ {
+#ifdef TNT_BOUNDS_CHECK
+ assert(0<=i);
+
+
+
+
+
+
+ assert(i < n_) ;
+#endif
+ return v_[i];
+ }
+
+
+
+};
+
+
+/* *************************** I/O ********************************/
+
+template <class T>
+std::ostream& operator<<(std::ostream &s, const Vector<T> &A)
+{
+ Subscript N=A.dim();
+
+ s << N << "\n";
+
+ for (Subscript i=0; i<N; i++)
+ s << A[i] << " " << "\n";
+ s << "\n";
+
+ return s;
+}
+
+template <class T>
+std::istream & operator>>(std::istream &s, Vector<T> &A)
+{
+
+ Subscript N;
+
+ s >> N;
+
+ if ( !(N == A.size() ))
+ {
+ A.newsize(N);
+ }
+
+
+ for (Subscript i=0; i<N; i++)
+ s >> A[i];
+
+
+ return s;
+}
+
+// *******************[ basic matrix algorithms ]***************************
+
+
+template <class T>
+Vector<T> operator+(const Vector<T> &A,
+ const Vector<T> &B)
+{
+ Subscript N = A.dim();
+
+ assert(N==B.dim());
+
+ Vector<T> tmp(N);
+ Subscript i;
+
+ for (i=0; i<N; i++)
+ tmp[i] = A[i] + B[i];
+
+ return tmp;
+}
+
+template <class T>
+Vector<T> operator-(const Vector<T> &A,
+ const Vector<T> &B)
+{
+ Subscript N = A.dim();
+
+ assert(N==B.dim());
+
+ Vector<T> tmp(N);
+ Subscript i;
+
+ for (i=0; i<N; i++)
+ tmp[i] = A[i] - B[i];
+
+ return tmp;
+}
+
+template <class T>
+Vector<T> operator*(const Vector<T> &A,
+ const Vector<T> &B)
+{
+ Subscript N = A.dim();
+
+ assert(N==B.dim());
+
+ Vector<T> tmp(N);
+ Subscript i;
+
+ for (i=0; i<N; i++)
+ tmp[i] = A[i] * B[i];
+
+ return tmp;
+}
+
+
+template <class T>
+T dot_prod(const Vector<T> &A, const Vector<T> &B)
+{
+ Subscript N = A.dim();
+ assert(N == B.dim());
+
+ Subscript i;
+ T sum = 0;
+
+ for (i=0; i<N; i++)
+ sum += A[i] * B[i];
+
+ return sum;
+}
+
+} /* namespace TNT */
+
+#endif
+// TNT_VEC_H
diff --git a/intern/smoke/intern/tnt/tnt_version.h b/intern/smoke/intern/tnt/tnt_version.h
new file mode 100644
index 00000000000..047e7d37042
--- /dev/null
+++ b/intern/smoke/intern/tnt/tnt_version.h
@@ -0,0 +1,39 @@
+/*
+*
+* Template Numerical Toolkit (TNT)
+*
+* Mathematical and Computational Sciences Division
+* National Institute of Technology,
+* Gaithersburg, MD USA
+*
+*
+* This software was developed at the National Institute of Standards and
+* Technology (NIST) by employees of the Federal Government in the course
+* of their official duties. Pursuant to title 17 Section 105 of the
+* United States Code, this software is not subject to copyright protection
+* and is in the public domain. NIST assumes no responsibility whatsoever for
+* its use by other parties, and makes no guarantees, expressed or implied,
+* about its quality, reliability, or any other characteristic.
+*
+*/
+
+#ifndef TNT_VERSION_H
+#define TNT_VERSION_H
+
+
+//---------------------------------------------------------------------
+// current version
+//---------------------------------------------------------------------
+
+
+#define TNT_MAJOR_VERSION '1'
+#define TNT_MINOR_VERSION '2'
+#define TNT_SUBMINOR_VERSION '6'
+#define TNT_VERSION_STRING "1.2.6"
+
+
+
+
+
+#endif
+// TNT_VERSION_H
diff --git a/intern/smoke/make/msvc_9_0/smoke.vcproj b/intern/smoke/make/msvc_9_0/smoke.vcproj
new file mode 100644
index 00000000000..aa3779031f0
--- /dev/null
+++ b/intern/smoke/make/msvc_9_0/smoke.vcproj
@@ -0,0 +1,511 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="INT_smoke"
+ ProjectGUID="{E8904FB3-F8F7-BC21-87A6-029A57B901F4}"
+ RootNamespace="smoke"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\smoke"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\smoke"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="..\..\intern;..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\smoke\smoke.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\smoke\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\smoke\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\smoke\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\libsmoke.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying IK files library to lib tree."
+ CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\smoke\include MKDIR ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;XCOPY /Y ..\..\extern\*.h ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\smoke\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\smoke\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\intern;..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\smoke\debug\smoke.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\smoke\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\smoke\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\smoke\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\debug\libsmoke.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying IK files library (debug target) to lib tree."
+ CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\smoke\include MKDIR ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;XCOPY /Y ..\..\extern\*.h ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="3DPlugin Release|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="..\..\intern;..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\smoke.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\libsmoke.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying IK files library to lib tree."
+ CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\smoke\include MKDIR ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;XCOPY /Y ..\..\extern\*.h ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="3DPlugin Debug|Win32"
+ OutputDirectory="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\debug"
+ IntermediateDirectory="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\intern;..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\debug\smoke.pch"
+ AssemblerListingLocation="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\debug\"
+ ObjectFile="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\debug\"
+ ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\intern\smoke\mtdll\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\..\build\msvc_9\libs\intern\mtdll\debug\libsmoke.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying IK files library (debug target) to lib tree."
+ CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\intern\smoke\include MKDIR ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;XCOPY /Y ..\..\extern\*.h ..\..\..\..\..\build\msvc_9\intern\smoke\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="intern"
+ >
+ <File
+ RelativePath="..\..\intern\EIGENVALUE_HELPER.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\FFT_NOISE.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\FLUID_3D.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\FLUID_3D.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\FLUID_3D_SOLVERS.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\FLUID_3D_STATIC.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\IMAGE.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\INTERPOLATE.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\LU_HELPER.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\MERSENNETWISTER.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\OBSTACLE.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\smoke_API.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\SPHERE.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\SPHERE.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\VEC3.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\WAVELET_NOISE.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\WTURBULENCE.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\WTURBULENCE.h"
+ >
+ </File>
+ <Filter
+ Name="TNT"
+ >
+ <File
+ RelativePath="..\..\intern\tnt\jama_eig.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\jama_lu.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_array1d.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_array1d_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_array2d.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_array2d_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_array3d.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_array3d_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_cmat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_fortran_array1d.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_fortran_array1d_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_fortran_array2d.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_fortran_array2d_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_fortran_array3d.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_fortran_array3d_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_i_refvec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_math_utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_sparse_matrix_csr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_stopwatch.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_subscript.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_vec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\intern\tnt\tnt_version.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="extern"
+ >
+ <File
+ RelativePath="..\..\extern\smoke_API.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h
index 941430fd976..a5e7a0721ec 100644
--- a/intern/string/STR_String.h
+++ b/intern/string/STR_String.h
@@ -50,6 +50,9 @@
using namespace std;
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
class STR_String;
@@ -191,6 +194,13 @@ protected:
char *pData; // -> STR_String data
int Len; // Data length
int Max; // Space in data buffer
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
inline STR_String operator+(rcSTR_String lhs, rcSTR_String rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); }
diff --git a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
index 42576c2733b..7f1eff21e6f 100644
--- a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
+++ b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -120,7 +120,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="true"
RuntimeLibrary="0"
@@ -197,7 +197,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -274,7 +274,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="true"
RuntimeLibrary="0"
@@ -335,6 +335,10 @@
Name="internal"
>
<File
+ RelativePath="..\..\..\source\blender\python\intern\bpy_array.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\python\intern\bpy_interface.c"
>
</File>
@@ -412,10 +416,6 @@
Name="internal"
>
<File
- RelativePath="..\..\..\source\blender\python\intern\bpy_compat.h"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\python\intern\bpy_idprop.h"
>
</File>
diff --git a/projectfiles_vc9/blender/blender.sln b/projectfiles_vc9/blender/blender.sln
index d1db956118c..1bd132ea223 100644
--- a/projectfiles_vc9/blender/blender.sln
+++ b/projectfiles_vc9/blender/blender.sln
@@ -6,14 +6,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{6E24BF09-9653-4166-A871-F65CC9E98A9B} = {6E24BF09-9653-4166-A871-F65CC9E98A9B}
{A90C4918-4B21-4277-93BD-AF65F30951D9} = {A90C4918-4B21-4277-93BD-AF65F30951D9}
{FB88301F-F725-401B-ACD7-D2ABBF333B71} = {FB88301F-F725-401B-ACD7-D2ABBF333B71}
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6} = {98330220-47A6-42E0-9DE4-AD0FF5D204D6}
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE} = {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
{D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}
{884D8731-654C-4C7F-9A75-8F37A305BE1E} = {884D8731-654C-4C7F-9A75-8F37A305BE1E}
+ {79D0B232-208C-F208-DA71-79B4AC088602} = {79D0B232-208C-F208-DA71-79B4AC088602}
{E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018}
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C} = {FAF46346-65CC-4DB2-85C4-B99826F79D0C}
{51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E}
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
{31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}
@@ -26,6 +25,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
{106AE171-0083-41D6-A949-20DB0E8DC251} = {106AE171-0083-41D6-A949-20DB0E8DC251}
{670EC17A-0548-4BBF-A27B-636C7C188139} = {670EC17A-0548-4BBF-A27B-636C7C188139}
+ {8BFA4082-773B-D100-BC24-659083BA023F} = {8BFA4082-773B-D100-BC24-659083BA023F}
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
@@ -37,12 +37,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7} = {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}
{542A9FA1-B7FF-441C-AE15-054DB31D3488} = {542A9FA1-B7FF-441C-AE15-054DB31D3488}
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} = {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}
- {213356A9-3A1F-41DA-9819-1297BCD17DEE} = {213356A9-3A1F-41DA-9819-1297BCD17DEE}
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA} = {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4} = {E8904FB3-F8F7-BC21-87A6-029A57B901F4}
{E90C7BC2-CF30-4A60-A8F2-0050D592E358} = {E90C7BC2-CF30-4A60-A8F2-0050D592E358}
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = {8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172} = {87032FD2-9BA0-6B43-BE33-8902BA8F9172}
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9} = {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}
{E86B7BDE-C33C-4E55-9433-E74C141D7538} = {E86B7BDE-C33C-4E55-9433-E74C141D7538}
@@ -56,6 +57,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BKE_blenkernel", "blenkernel\BKE_blenkernel.vcproj", "{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}"
ProjectSection(ProjectDependencies) = postProject
+ {02110D03-59DB-4571-8787-72B3C03B2F2D} = {02110D03-59DB-4571-8787-72B3C03B2F2D}
{9C71A793-C177-4CAB-8EC5-923D500B39F8} = {9C71A793-C177-4CAB-8EC5-923D500B39F8}
EndProjectSection
EndProject
@@ -84,6 +86,7 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNA_makesdna", "makesdna\DNA_makesdna.vcproj", "{E013786A-9575-4F34-81B2-33290357EE87}"
ProjectSection(ProjectDependencies) = postProject
{31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9} = {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXP_expressions", "..\gameengine\expression\EXP_expressions.vcproj", "{EADC3C5A-6C51-4F03-8038-1553E7D7F740}"
@@ -124,13 +127,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{02110D03-59DB-4571-8787-72B3C03B2F2D} = {02110D03-59DB-4571-8787-72B3C03B2F2D}
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F} = {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}
{6E24BF09-9653-4166-A871-F65CC9E98A9B} = {6E24BF09-9653-4166-A871-F65CC9E98A9B}
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6} = {98330220-47A6-42E0-9DE4-AD0FF5D204D6}
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE} = {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
{D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}
{E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018}
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C} = {FAF46346-65CC-4DB2-85C4-B99826F79D0C}
{51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E}
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
{31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}
@@ -154,12 +155,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{542A9FA1-B7FF-441C-AE15-054DB31D3488} = {542A9FA1-B7FF-441C-AE15-054DB31D3488}
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0} = {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} = {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}
- {213356A9-3A1F-41DA-9819-1297BCD17DEE} = {213356A9-3A1F-41DA-9819-1297BCD17DEE}
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA} = {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}
{E90C7BC2-CF30-4A60-A8F2-0050D592E358} = {E90C7BC2-CF30-4A60-A8F2-0050D592E358}
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = {8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172} = {87032FD2-9BA0-6B43-BE33-8902BA8F9172}
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}
{E86B7BDE-C33C-4E55-9433-E74C141D7538} = {E86B7BDE-C33C-4E55-9433-E74C141D7538}
{32CC75E2-EE85-45E6-8E3D-513F58464F43} = {32CC75E2-EE85-45E6-8E3D-513F58464F43}
@@ -222,7 +223,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_glew", "..\..\extern\gl
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_build_install_all", "..\..\extern\make\msvc_9_0\build_install_all.vcproj", "{9C71A793-C177-4CAB-8EC5-923D500B39F8}"
ProjectSection(ProjectDependencies) = postProject
+ {79D0B232-208C-F208-DA71-79B4AC088602} = {79D0B232-208C-F208-DA71-79B4AC088602}
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
+ {8BFA4082-773B-D100-BC24-659083BA023F} = {8BFA4082-773B-D100-BC24-659083BA023F}
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_boolop", "..\..\intern\boolop\make\msvc_9_0\boolop.vcproj", "{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}"
@@ -241,11 +245,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_container", "..\..\inte
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_decimation", "..\..\intern\decimation\make\msvc_9_0\decimation.vcproj", "{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_DummySoundSystem", "..\..\intern\SoundSystem\make\msvc_9_0\dummy\DummySoundSystem.vcproj", "{FAF46346-65CC-4DB2-85C4-B99826F79D0C}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_elbeem", "..\..\intern\elbeem\make\msvc_9_0\elbeem.vcproj", "{A90C4918-4B21-4277-93BD-AF65F30951D9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_ghost", "..\..\intern\ghost\make\msvc_9_0\ghost.vcproj", "{76D90B92-ECC7-409C-9F98-A8814B90F3C0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598} = {B789C2F3-279E-4A85-8F0A-7F7AC068E598}
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_guardedalloc", "..\..\intern\guardedalloc\make\msvc_9_0\guardedalloc.vcproj", "{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}"
EndProject
@@ -255,34 +260,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_memutil", "..\..\intern
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_MoTo", "..\..\intern\moto\make\msvc_9_0\moto.vcproj", "{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_OpenALSoundSystem", "..\..\intern\SoundSystem\make\msvc_9_0\openal\OpenALSoundSystem.vcproj", "{213356A9-3A1F-41DA-9819-1297BCD17DEE}"
- ProjectSection(ProjectDependencies) = postProject
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6} = {98330220-47A6-42E0-9DE4-AD0FF5D204D6}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_opennl", "..\..\intern\opennl\make\msvc_9_0\opennl.vcproj", "{8B8D4FC3-3234-4E54-8376-5AB83D00D164}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_SoundSystem", "..\..\intern\SoundSystem\make\msvc_9_0\SoundSystem.vcproj", "{98330220-47A6-42E0-9DE4-AD0FF5D204D6}"
- ProjectSection(ProjectDependencies) = postProject
- {4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
- {B789C2F3-279E-4A85-8F0A-7F7AC068E598} = {B789C2F3-279E-4A85-8F0A-7F7AC068E598}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_string", "..\..\intern\string\make\msvc_9_0\string.vcproj", "{B789C2F3-279E-4A85-8F0A-7F7AC068E598}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_build_install_all", "..\..\intern\make\msvc_9_0\INT_build_install_all.vcproj", "{02110D03-59DB-4571-8787-72B3C03B2F2D}"
ProjectSection(ProjectDependencies) = postProject
{A90C4918-4B21-4277-93BD-AF65F30951D9} = {A90C4918-4B21-4277-93BD-AF65F30951D9}
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6} = {98330220-47A6-42E0-9DE4-AD0FF5D204D6}
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C} = {FAF46346-65CC-4DB2-85C4-B99826F79D0C}
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E} = {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}
{76D90B92-ECC7-409C-9F98-A8814B90F3C0} = {76D90B92-ECC7-409C-9F98-A8814B90F3C0}
{542A9FA1-B7FF-441C-AE15-054DB31D3488} = {542A9FA1-B7FF-441C-AE15-054DB31D3488}
- {213356A9-3A1F-41DA-9819-1297BCD17DEE} = {213356A9-3A1F-41DA-9819-1297BCD17DEE}
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4} = {E8904FB3-F8F7-BC21-87A6-029A57B901F4}
{51A348C1-8684-4D67-B980-97B1FC74159B} = {51A348C1-8684-4D67-B980-97B1FC74159B}
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = {8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172} = {87032FD2-9BA0-6B43-BE33-8902BA8F9172}
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9} = {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}
{E86B7BDE-C33C-4E55-9433-E74C141D7538} = {E86B7BDE-C33C-4E55-9433-E74C141D7538}
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9} = {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}
@@ -313,10 +306,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNA_dna", "makesdna\DNA_dna
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BLF_blenfont", "blenfont\BLF_blenfont.vcproj", "{D1A9312F-4557-4982-A0F4-4D08508235F4}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_smoke", "..\..\intern\smoke\make\msvc_9_0\smoke.vcproj", "{E8904FB3-F8F7-BC21-87A6-029A57B901F4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_audaspace", "..\..\intern\audaspace\make\msvc_9_0\audaspace.vcproj", "{87032FD2-9BA0-6B43-BE33-8902BA8F9172}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzma", "..\..\extern\lzma\make\msvc_9_0\lzma.vcproj", "{79D0B232-208C-F208-DA71-79B4AC088602}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzo", "..\..\extern\lzo\make\msvc_9_0\lzo.vcproj", "{8BFA4082-773B-D100-BC24-659083BA023F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3D Plugin Debug|Win32 = 3D Plugin Debug|Win32
3D Plugin Release|Win32 = 3D Plugin Release|Win32
+ 3DPlugin Debug|Win32 = 3DPlugin Debug|Win32
+ 3DPlugin Release|Win32 = 3DPlugin Release|Win32
Blender Debug|Win32 = Blender Debug|Win32
Blender Release|Win32 = Blender Release|Win32
BlenderPlayer Debug|Win32 = BlenderPlayer Debug|Win32
@@ -329,6 +332,10 @@ Global
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3DPlugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3DPlugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3DPlugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3DPlugin Release|Win32.Build.0 = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -343,6 +350,10 @@ Global
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -359,6 +370,10 @@ Global
{31628053-825D-4C06-8A21-D13883489718}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{31628053-825D-4C06-8A21-D13883489718}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{31628053-825D-4C06-8A21-D13883489718}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{31628053-825D-4C06-8A21-D13883489718}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{31628053-825D-4C06-8A21-D13883489718}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{31628053-825D-4C06-8A21-D13883489718}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -375,6 +390,10 @@ Global
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -391,6 +410,10 @@ Global
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -407,6 +430,10 @@ Global
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -423,6 +450,10 @@ Global
{415BFD6E-64CF-422B-AF88-C07F040A7292}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -439,6 +470,10 @@ Global
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3D Plugin Debug|Win32.Build.0 = BlenderPlayer Release|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3D Plugin Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3D Plugin Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3DPlugin Debug|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3DPlugin Debug|Win32.Build.0 = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3DPlugin Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3DPlugin Release|Win32.Build.0 = BlenderPlayer Release|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -455,6 +490,10 @@ Global
{106AE171-0083-41D6-A949-20DB0E8DC251}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3DPlugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3DPlugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3DPlugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3DPlugin Release|Win32.Build.0 = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -469,6 +508,10 @@ Global
{E013786A-9575-4F34-81B2-33290357EE87}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -485,6 +528,10 @@ Global
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -501,6 +548,10 @@ Global
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Blender Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Blender Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.BlenderPlayer Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
@@ -513,6 +564,10 @@ Global
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Blender Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Blender Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
@@ -527,6 +582,10 @@ Global
{3D310C60-6771-48E4-BCCA-D2718CDED898}.3D Plugin Debug|Win32.Build.0 = BlenderPlayer Release|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.3D Plugin Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.3D Plugin Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3DPlugin Debug|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3DPlugin Debug|Win32.Build.0 = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3DPlugin Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3DPlugin Release|Win32.Build.0 = BlenderPlayer Release|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.Blender Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.Blender Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
@@ -541,6 +600,10 @@ Global
{8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -555,6 +618,10 @@ Global
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -571,6 +638,10 @@ Global
{E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -587,6 +658,10 @@ Global
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -603,6 +678,10 @@ Global
{6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -619,6 +698,10 @@ Global
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -635,6 +718,10 @@ Global
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -651,6 +738,10 @@ Global
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.Blender Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.Blender Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
@@ -663,6 +754,10 @@ Global
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -679,6 +774,10 @@ Global
{AB590CED-F71F-4A17-A89B-18583ECD633D}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -695,6 +794,10 @@ Global
{51FB3D48-2467-4BFA-A321-D848252B437E}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -711,6 +814,10 @@ Global
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -727,6 +834,10 @@ Global
{09222F5E-1625-4FF3-A89A-384D16875EE5}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -743,6 +854,10 @@ Global
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -759,6 +874,10 @@ Global
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -775,6 +894,10 @@ Global
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -791,6 +914,10 @@ Global
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -807,6 +934,10 @@ Global
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -823,6 +954,10 @@ Global
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -839,6 +974,10 @@ Global
{670EC17A-0548-4BBF-A27B-636C7C188139}.3D Plugin Debug|Win32.Build.0 = Debug|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.3D Plugin Release|Win32.ActiveCfg = Release|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.3D Plugin Release|Win32.Build.0 = Release|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3DPlugin Debug|Win32.ActiveCfg = Debug|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3DPlugin Debug|Win32.Build.0 = Debug|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3DPlugin Release|Win32.ActiveCfg = Release|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3DPlugin Release|Win32.Build.0 = Release|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.Blender Debug|Win32.ActiveCfg = Debug|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.Blender Debug|Win32.Build.0 = Debug|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.Blender Release|Win32.ActiveCfg = Release|Win32
@@ -855,6 +994,10 @@ Global
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -871,6 +1014,10 @@ Global
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -887,6 +1034,10 @@ Global
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3DPlugin Release|Win32.Build.0 = 3D Plugin Debug|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
@@ -899,6 +1050,10 @@ Global
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -913,6 +1068,10 @@ Global
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -927,6 +1086,10 @@ Global
{51A348C1-8684-4D67-B980-97B1FC74159B}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -943,6 +1106,10 @@ Global
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -955,26 +1122,14 @@ Global
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Release|Win32.Build.0 = 3DPlugin Release|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
- {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Release|Win32.Build.0 = 3DPlugin Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -989,6 +1144,10 @@ Global
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1005,6 +1164,10 @@ Global
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1021,6 +1184,10 @@ Global
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1037,6 +1204,10 @@ Global
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1053,6 +1224,10 @@ Global
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1065,26 +1240,14 @@ Global
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Release|Win32.Build.0 = 3DPlugin Release|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
- {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Release|Win32.Build.0 = 3DPlugin Release|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1097,26 +1260,14 @@ Global
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Release|Win32.Build.0 = 3DPlugin Release|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
- {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Release|Win32.Build.0 = 3DPlugin Release|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1133,6 +1284,10 @@ Global
{02110D03-59DB-4571-8787-72B3C03B2F2D}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
@@ -1145,6 +1300,10 @@ Global
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1161,6 +1320,10 @@ Global
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3DPlugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3DPlugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3DPlugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3DPlugin Release|Win32.Build.0 = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1177,6 +1340,10 @@ Global
{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1193,6 +1360,10 @@ Global
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1209,6 +1380,10 @@ Global
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1225,6 +1400,10 @@ Global
{D1A9312F-4557-4982-A0F4-4D08508235F4}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
+ {D1A9312F-4557-4982-A0F4-4D08508235F4}.3DPlugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {D1A9312F-4557-4982-A0F4-4D08508235F4}.3DPlugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {D1A9312F-4557-4982-A0F4-4D08508235F4}.3DPlugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {D1A9312F-4557-4982-A0F4-4D08508235F4}.3DPlugin Release|Win32.Build.0 = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1237,6 +1416,86 @@ Global
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Debug|Win32.Build.0 = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Release|Win32.ActiveCfg = Blender Release|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Release|Win32.Build.0 = Blender Release|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3DPlugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3DPlugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3DPlugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.3DPlugin Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.Release|Win32.Build.0 = 3D Plugin Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/projectfiles_vc9/blender/blender.vcproj b/projectfiles_vc9/blender/blender.vcproj
index 37824155bb7..56913cb8160 100644
--- a/projectfiles_vc9/blender/blender.vcproj
+++ b/projectfiles_vc9/blender/blender.vcproj
@@ -73,12 +73,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib openal_static.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python26.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
+ AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib"
ShowProgress="0"
OutputFile="..\..\..\install\msvc_9\blender.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\python\lib\lib26_vs2008;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\build\msvc_9\libs\intern;..\..\..\build\msvc_9\libs\extern;..\..\..\lib\windows\ffmpeg\lib"
+ AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\build\msvc_9\libs\intern;..\..\..\build\msvc_9\libs\extern;..\..\..\lib\windows\ffmpeg\lib;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames="msvcprt.lib;glut32.lib;libc.lib;libcd.lib;libcpd.lib;libcp.lib;libcmtd.lib;odbc32.lib;odbccp32.lib"
GenerateDebugInformation="true"
@@ -107,7 +107,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\bin\blender.lib ..\..\..\build\msvc_9\libs&#x0D;&#x0A;MOVE /Y ..\..\bin\blender.exp ..\..\..\build\msvc_9\libs&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\python\lib\lib26_vs2008\python26.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\gettext\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\sdl\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\tiff\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\pthreads\lib\pthreadVSE2.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;ECHO Copying language folder&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9\.blender MKDIR ..\..\..\install\msvc_9\.blender&#x0D;&#x0A;XCOPY /Y ..\..\bin\.blender ..\..\..\install\msvc_9\.blender /E&#x0D;&#x0A;ECHO Copying python scripts&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9\.blender\scripts MKDIR ..\..\..\install\msvc_9\.blender\scripts&#x0D;&#x0A;XCOPY /Y ..\..\release\scripts ..\..\..\install\msvc_9\.blender\scripts /E&#x0D;&#x0A;ECHO Copying python ui scripts&#x0D;&#x0A;IF NOT EXIST ..\..\bin\.blender\ui MKDIR ..\..\..\install\msvc_9\.blender\ui&#x0D;&#x0A;XCOPY /Y ..\..\release\ui ..\..\..\install\msvc_9\.blender\ui /E&#x0D;&#x0A;ECHO Copying manuals/text&#x0D;&#x0A;XCOPY/Y ..\..\release\text ..\..\..\install\msvc_9 /E&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\bin\blender.lib ..\..\..\build\msvc_9\libs&#x0D;&#x0A;MOVE /Y ..\..\bin\blender.exp ..\..\..\build\msvc_9\libs&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\python\lib\python31.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\release\python31.zip ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\release\zlib.pyd ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\openal\lib\wrap_oal.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\openal\lib\OpenAL32.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\gettext\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\sdl\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\tiff\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\pthreads\lib\pthreadVSE2.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\sndfile\lib\*.dll ..\..\..\install\msvc_9&#x0D;&#x0A;ECHO Copying language folder&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9\.blender MKDIR ..\..\..\install\msvc_9\.blender&#x0D;&#x0A;XCOPY /Y ..\..\bin\.blender ..\..\..\install\msvc_9\.blender /E&#x0D;&#x0A;ECHO Copying python scripts&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9\.blender\scripts MKDIR ..\..\..\install\msvc_9\.blender\scripts&#x0D;&#x0A;XCOPY /Y ..\..\release\scripts ..\..\..\install\msvc_9\.blender\scripts /E&#x0D;&#x0A;ECHO Copying python ui scripts&#x0D;&#x0A;IF NOT EXIST ..\..\bin\.blender\ui MKDIR ..\..\..\install\msvc_9\.blender\ui&#x0D;&#x0A;XCOPY /Y ..\..\release\ui ..\..\..\install\msvc_9\.blender\ui /E&#x0D;&#x0A;ECHO Copying manuals/text&#x0D;&#x0A;XCOPY/Y ..\..\release\text ..\..\..\install\msvc_9 /E&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@@ -168,12 +168,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"
- AdditionalDependencies="SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib openal_static.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python26_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib"
+ AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib"
ShowProgress="0"
OutputFile="..\..\..\install\msvc_9d\blender.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
- AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\python\lib\lib26_vs2008;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\lib\windows\ffmpeg\lib;..\..\..\build\msvc_9\libs\intern\debug;..\..\..\build\msvc_9\libs\extern\debug"
+ AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\lib\windows\ffmpeg\lib;..\..\..\build\msvc_9\libs\intern\debug;..\..\..\build\msvc_9\libs\extern\debug;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib"
IgnoreDefaultLibraryNames="libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, odbc32.lib, odbccp32.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="..\..\..\build\msvc_9\libs\debug\blender.pdb"
@@ -201,7 +201,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\bin\debug\blender.lib ..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\bin\debug\blender.exp ..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\bin\debug\blender.ilk ..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\gettext\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\sdl\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\python\lib\lib26_vs2008\python26_d.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\CRTL\lib\msvcrtd.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\tiff\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\pthreads\lib\pthreadVSE2.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;ECHO Copying language folder&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9d\.blender MKDIR ..\..\..\install\msvc_9d\.blender&#x0D;&#x0A;XCOPY /Y ..\..\bin\.blender ..\..\..\install\msvc_9d\.blender /E&#x0D;&#x0A;ECHO Copying python scripts&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9d\.blender\scripts MKDIR ..\..\..\install\msvc_9d\.blender\scripts&#x0D;&#x0A;XCOPY /Y ..\..\release\scripts ..\..\..\install\msvc_9d\.blender\scripts /E&#x0D;&#x0A;ECHO Copying python ui scripts&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9d\.blender\ui MKDIR ..\..\..\install\msvc_9d\.blender\ui&#x0D;&#x0A;XCOPY /Y ..\..\release\ui ..\..\..\install\msvc_9d\.blender\ui /E&#x0D;&#x0A;ECHO Copying manuals/text&#x0D;&#x0A;XCOPY/Y ..\..\release\text ..\..\..\install\msvc_9d /E&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\bin\debug\blender.lib ..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\bin\debug\blender.exp ..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\bin\debug\blender.ilk ..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\gettext\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\sdl\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\python\lib\python31_d.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\release\python31.zip ..\..\..\install\msvc_9d\python31_d.zip&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\release\zlib.pyd ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\openal\lib\wrap_oal.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\openal\lib\OpenAL32.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\CRTL\lib\msvcrtd.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\tiff\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\pthreads\lib\pthreadVSE2.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;XCOPY /Y ..\..\..\lib\windows\sndfile\lib\*.dll ..\..\..\install\msvc_9d&#x0D;&#x0A;ECHO Copying language folder&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9d\.blender MKDIR ..\..\..\install\msvc_9d\.blender&#x0D;&#x0A;XCOPY /Y ..\..\bin\.blender ..\..\..\install\msvc_9d\.blender /E&#x0D;&#x0A;ECHO Copying python scripts&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9d\.blender\scripts MKDIR ..\..\..\install\msvc_9d\.blender\scripts&#x0D;&#x0A;XCOPY /Y ..\..\release\scripts ..\..\..\install\msvc_9d\.blender\scripts /E&#x0D;&#x0A;ECHO Copying python ui scripts&#x0D;&#x0A;IF NOT EXIST ..\..\..\install\msvc_9d\.blender\ui MKDIR ..\..\..\install\msvc_9d\.blender\ui&#x0D;&#x0A;XCOPY /Y ..\..\release\ui ..\..\..\install\msvc_9d\.blender\ui /E&#x0D;&#x0A;ECHO Copying manuals/text&#x0D;&#x0A;XCOPY/Y ..\..\release\text ..\..\..\install\msvc_9d /E&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
diff --git a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
index 18d0254afc4..87f10346726 100644
--- a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
+++ b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_OPENEXR;WITH_DDS;WITH_BULLET;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
@@ -268,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@@ -343,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
@@ -698,6 +698,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\paint.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\intern\particle.c"
>
</File>
@@ -750,6 +754,14 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\sketch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\smoke.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\intern\softbody.c"
>
</File>
@@ -774,6 +786,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\unit.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\intern\world.c"
>
</File>
@@ -1007,6 +1023,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\BKE_paint.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\BKE_particle.h"
>
</File>
@@ -1051,6 +1071,14 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\BKE_sketch.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\blenkernel\BKE_smoke.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\BKE_softbody.h"
>
</File>
@@ -1075,6 +1103,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\BKE_unit.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\BKE_utildefines.h"
>
</File>
diff --git a/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj b/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
index d31a7fb4500..75bd6686d01 100644
--- a/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
+++ b/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
@@ -575,10 +575,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\blender\blenlib\intern\psfont.c"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\blenlib\intern\rand.c"
>
</File>
@@ -615,6 +611,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenlib\intern\voxel.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenlib\intern\winstuff.c"
>
</File>
@@ -728,6 +728,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\blenlib\BLI_voxel.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenlib\BLI_winstuff.h"
>
</File>
diff --git a/projectfiles_vc9/blender/editors/ED_editors.vcproj b/projectfiles_vc9/blender/editors/ED_editors.vcproj
index 08432b56d62..9f2fc769e49 100644
--- a/projectfiles_vc9/blender/editors/ED_editors.vcproj
+++ b/projectfiles_vc9/blender/editors/ED_editors.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_FREETYPE2;WITH_INTERNATIONAL;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_BF_INTERNATIONAL;WITH_FREETYPE2;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -218,6 +218,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\editors\include\ED_info.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\editors\include\ED_interface.h"
>
</File>
@@ -238,6 +242,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\editors\include\ED_mball.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\editors\include\ED_mesh.h"
>
</File>
@@ -286,6 +294,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\editors\include\ED_sound.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\editors\include\ED_space_api.h"
>
</File>
@@ -455,6 +467,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\editors\space_view3d\drawvolume.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\editors\space_view3d\space_view3d.c"
>
</File>
@@ -507,10 +523,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\blender\editors\space_time\time_header.c"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\editors\space_time\time_intern.h"
>
</File>
@@ -803,6 +815,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\editors\space_info\info_stats.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\editors\space_info\space_info.c"
>
</File>
@@ -991,7 +1007,11 @@
Name="animation"
>
<File
- RelativePath="..\..\..\source\blender\editors\animation\anim_channels.c"
+ RelativePath="..\..\..\source\blender\editors\animation\anim_channels_defines.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\animation\anim_channels_edit.c"
>
</File>
<File
@@ -1267,6 +1287,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_stroke.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_utils.c"
>
</File>
@@ -1282,10 +1306,6 @@
RelativePath="..\..\..\source\blender\editors\sculpt_paint\sculpt_intern.h"
>
</File>
- <File
- RelativePath="..\..\..\source\blender\editors\sculpt_paint\sculpt_stroke.c"
- >
- </File>
</Filter>
<Filter
Name="uvedit"
@@ -1327,6 +1347,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\editors\gpencil\gpencil_buttons.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\editors\gpencil\gpencil_edit.c"
>
</File>
@@ -1334,6 +1358,14 @@
RelativePath="..\..\..\source\blender\editors\gpencil\gpencil_intern.h"
>
</File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\gpencil\gpencil_ops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\gpencil\gpencil_paint.c"
+ >
+ </File>
</Filter>
<Filter
Name="curve"
@@ -1443,6 +1475,50 @@
>
</File>
</Filter>
+ <Filter
+ Name="metaball"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\metaball\editmball.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\metaball\mball_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\metaball\mball_ops.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_userpref"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_userpref\space_userpref.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_userpref\userpref_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_userpref\userpref_ops.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="sound"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\sound\sound_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\sound\sound_ops.c"
+ >
+ </File>
+ </Filter>
</Files>
<Globals>
</Globals>
diff --git a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
index 69bce6b621b..0e25b26831b 100644
--- a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
+++ b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR;WITH_DDS;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -192,7 +192,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,WITH_QUICKTIME"
StringPooling="true"
RuntimeLibrary="2"
@@ -267,7 +267,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds;..\..\..\..\lib\windows\ffmpeg\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR;WITH_DDS;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
@@ -342,7 +342,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds;..\..\..\..\lib\windows\ffmpeg\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_DDS;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -417,7 +417,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds;..\..\..\..\lib\windows\ffmpeg\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\jpeg\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\png\include;..\..\..\..\lib\windows\tiff\include;..\..\..\..\lib\windows\openexr\include;..\..\..\..\lib\windows\openexr\include\Iex;..\..\..\..\lib\windows\openexr\include\Imath;..\..\..\..\lib\windows\openexr\include\IlmImf;..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf\intern;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\imbuf\intern\openexr;..\..\..\source\blender\imbuf\intern\dds"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_DDS;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/blender/loader/BLO_loader.vcproj b/projectfiles_vc9/blender/loader/BLO_loader.vcproj
index 0906904e293..a8cec5ecf76 100644
--- a/projectfiles_vc9/blender/loader/BLO_loader.vcproj
+++ b/projectfiles_vc9/blender/loader/BLO_loader.vcproj
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging;..\..\..\..\build\msvc_9\extern\verse\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging;..\..\..\..\build\msvc_9\extern\verse\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@@ -343,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging;..\..\..\..\build\msvc_9\extern\verse\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\zlib\include;..\..\..\source\blender\inflate;..\..\..\source\blender\deflate;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\streamglue;..\..\..\source\blender\readblenfile;..\..\..\source\blender\writeblenfile;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\writestreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel\gen_messaging;..\..\..\..\build\msvc_9\extern\verse\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj b/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj
index f46c8844f78..77fbe72dede 100644
--- a/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj
+++ b/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj
@@ -778,6 +778,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesdna\DNA_smoke_types.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesdna\DNA_sound_types.h"
>
</File>
diff --git a/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj b/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
index 3db292155f1..9ed358efc0b 100644
--- a/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
+++ b/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
@@ -45,7 +45,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -140,7 +140,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
StringPooling="true"
RuntimeLibrary="0"
@@ -234,7 +234,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
StringPooling="true"
RuntimeLibrary="2"
@@ -328,7 +328,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -425,7 +425,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -522,7 +522,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
StringPooling="true"
RuntimeLibrary="0"
@@ -611,6 +611,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_animation_api.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesrna\intern\rna_armature.c"
>
</File>
@@ -663,6 +667,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_gpencil.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesrna\intern\rna_group.c"
>
</File>
@@ -763,6 +771,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_scene_api.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesrna\intern\rna_screen.c"
>
</File>
@@ -779,6 +791,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_smoke.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesrna\intern\rna_sound.c"
>
</File>
diff --git a/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj b/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
index 0699468bfcf..84359390f41 100644
--- a/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
+++ b/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
@@ -231,6 +231,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_gpencil_gen.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesrna\intern\rna_group_gen.c"
>
</File>
@@ -335,6 +339,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_smoke_gen.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesrna\intern\rna_sound_gen.c"
>
</File>
diff --git a/projectfiles_vc9/blender/nodes/nodes.vcproj b/projectfiles_vc9/blender/nodes/nodes.vcproj
index d188725918b..68bf0feac73 100644
--- a/projectfiles_vc9/blender/nodes/nodes.vcproj
+++ b/projectfiles_vc9/blender/nodes/nodes.vcproj
@@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -112,7 +112,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
@@ -182,7 +182,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_OPENEXR"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -252,7 +252,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\makesrna"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_OPENEXR"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/blender/render/BRE_render.vcproj b/projectfiles_vc9/blender/render/BRE_render.vcproj
index d7851674857..4e354c6dde3 100644
--- a/projectfiles_vc9/blender/render/BRE_render.vcproj
+++ b/projectfiles_vc9/blender/render/BRE_render.vcproj
@@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\yafray;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel;..\..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\yafray;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel;..\..\..\source\kernel\gen_messaging"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR"
StringPooling="true"
RuntimeLibrary="0"
@@ -117,7 +117,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\yafray;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel;..\..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\yafray;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\render\extern\include;..\..\..\source\kernel;..\..\..\source\kernel\gen_messaging"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_QUICKTIME;WITH_OPENEXR;_USE_MATH_DEFINES"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -209,6 +209,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\render\intern\source\pointdensity.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\render\intern\source\rayshade.c"
>
</File>
@@ -253,6 +257,18 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\render\intern\source\volume_precache.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\volumetric.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\source\voxeldata.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\render\intern\source\zbuf.c"
>
</File>
@@ -298,6 +314,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\render\intern\include\pointdensity.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\render\extern\include\RE_pipeline.h"
>
</File>
@@ -310,6 +330,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\render\intern\include\render_types.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\render\intern\include\rendercore.h"
>
</File>
@@ -354,6 +378,18 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\render\intern\include\volume_precache.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\include\volumetric.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\render\intern\include\voxeldata.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\render\intern\include\zbuf.h"
>
</File>
diff --git a/projectfiles_vc9/gameengine/blenderhook/KX_blenderhook.vcproj b/projectfiles_vc9/gameengine/blenderhook/KX_blenderhook.vcproj
index 2a14458399c..ea387c4e976 100644
--- a/projectfiles_vc9/gameengine/blenderhook/KX_blenderhook.vcproj
+++ b/projectfiles_vc9/gameengine/blenderhook/KX_blenderhook.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenfont"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="WIN32;_LIB;_DEBUG;WITH_GLEXT;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -119,7 +119,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenfont"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenfont"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT;WITH_FFMPEG"
StringPooling="true"
BasicRuntimeChecks="0"
diff --git a/projectfiles_vc9/gameengine/converter/KX_converter.vcproj b/projectfiles_vc9/gameengine/converter/KX_converter.vcproj
index 7202be552f4..d179fe03dc7 100644
--- a/projectfiles_vc9/gameengine/converter/KX_converter.vcproj
+++ b/projectfiles_vc9/gameengine/converter/KX_converter.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="KX_converter"
ProjectGUID="{F90BD995-FFA4-4B18-81E8-FA4322C939E8}"
+ RootNamespace="KX_converter"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="true"
RuntimeLibrary="0"
@@ -193,7 +194,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -268,7 +269,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="true"
RuntimeLibrary="2"
@@ -344,7 +345,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -419,7 +420,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/gameengine/expression/EXP_expressions.vcproj b/projectfiles_vc9/gameengine/expression/EXP_expressions.vcproj
index 2e8351cd58f..9aeb9584b35 100644
--- a/projectfiles_vc9/gameengine/expression/EXP_expressions.vcproj
+++ b/projectfiles_vc9/gameengine/expression/EXP_expressions.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
PreprocessorDefinitions="WIN32,_LIB,EXP_PYTHON_EMBEDDING,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="2"
@@ -268,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"
@@ -343,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\SceneGraph;..\..\..\source\blender\blenloader"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/gameengine/gamelogic/SCA_GameLogic.vcproj b/projectfiles_vc9/gameengine/gamelogic/SCA_GameLogic.vcproj
index 90706035649..61e589213c0 100644
--- a/projectfiles_vc9/gameengine/gamelogic/SCA_GameLogic.vcproj
+++ b/projectfiles_vc9/gameengine/gamelogic/SCA_GameLogic.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"
@@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="2"
@@ -268,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,EXP_PYTHON_EMBEDDING,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -343,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna;..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/gameengine/gameplayer/axctl/GP_axctl.vcproj b/projectfiles_vc9/gameengine/gameplayer/axctl/GP_axctl.vcproj
index de5ddadf4b6..ed2dad65374 100644
--- a/projectfiles_vc9/gameengine/gameplayer/axctl/GP_axctl.vcproj
+++ b/projectfiles_vc9/gameengine/gameplayer/axctl/GP_axctl.vcproj
@@ -53,7 +53,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\include;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\GamePlayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\include;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\GamePlayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
PreprocessorDefinitions="_DEBUG, _MT, _DLL,WIN32"
IgnoreStandardIncludePath="false"
BasicRuntimeChecks="3"
@@ -162,7 +162,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\include;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\GamePlayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\include;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\GamePlayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
StringPooling="true"
RuntimeLibrary="2"
diff --git a/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj b/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj
index fdf144a449a..87d9683a25e 100644
--- a/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj
+++ b/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="GP_common"
ProjectGUID="{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}"
+ RootNamespace="GP_common"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -191,7 +192,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -265,7 +266,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\Converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\GamePlayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\soundsystem\snd_dummy;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\Physics\Sumo;..\..\..\..\source\gameengine\Physics\common;..\..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj b/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
index 886be9b42a3..e29a65264e9 100644
--- a/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
+++ b/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
PreprocessorDefinitions="WIN32,_CONSOLE,dSINGLE, _DEBUG;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -72,12 +72,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"
- AdditionalDependencies="ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib Half_d.lib Iex_d.lib IlmImf_d.lib IlmThread_d.lib Imath_d.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
+ AdditionalDependencies="ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib OpenAL32.lib wrap_oal.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib Half_d.lib Iex_d.lib IlmImf_d.lib IlmThread_d.lib Imath_d.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
ShowProgress="0"
OutputFile="..\..\..\..\bin\debug\blenderplayer.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
- AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib\lib25_vs2008;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
+ AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
IgnoreDefaultLibraryNames="libc.lib;libcmt.lib;msvcrt.lib;libcd.lib;msvcrtd.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="..\..\..\..\..\build\msvc_9\libs\debug\blenderplayer.pdb"
@@ -105,7 +105,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\debug\blenderplayer.lib ..\..\..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\debug\blenderplayer.exp ..\..\..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\debug\blenderplayer.ilk ..\..\..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\python\lib\lib25_vs2003\python25_d.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\sdl\lib\SDL.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\png\lib\libpng.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\zlib\lib\zlib.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\CRTL\lib\msvcrtd.dll ..\..\..\..\bin\debug&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\debug\blenderplayer.lib ..\..\..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\debug\blenderplayer.exp ..\..\..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\debug\blenderplayer.ilk ..\..\..\..\..\build\msvc_9\libs\debug&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\python\lib\python31_d.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\sdl\lib\SDL.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\png\lib\libpng.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\zlib\lib\zlib.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\..\bin\debug&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\CRTL\lib\msvcrtd.dll ..\..\..\..\bin\debug&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@@ -137,7 +137,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\openal\include;..\..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\blender\include;..\..\..\..\source\blender\imbuf;..\..\..\..\source\blender\blenlib;..\..\..\..\source\blender\blenkernel;..\..\..\..\source\blender\makesdna;..\..\..\..\source\blender\blenloader;..\..\..\..\source\blender\readblenfile;..\..\..\..\source\blender\render\extern\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\kernel\gen_messaging;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Physics;..\..\..\..\source\gameengine\network;..\..\..\..\source\gameengine\rasterizer;..\..\..\..\source\gameengine\converter;..\..\..\..\source\gameengine\gamelogic;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\scenegraph;..\..\..\..\source\gameengine\Physics\Ode;..\..\..\..\source\gameengine\soundsystem;..\..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\..\source\gameengine\gameplayer\common;..\..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\..\source\gameengine\gameplayer\common\windows;..\..\..\..\source\sumo\include;..\..\..\..\source\sumo\fuzzics\include;..\..\..\..\source\blender\gpu;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
@@ -166,11 +166,11 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="odelib.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
+ AdditionalDependencies="odelib.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib OpenAL32.lib wrap_oal.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python31.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib"
OutputFile="..\..\..\..\bin\blenderplayer.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib\lib25_vs2008;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
+ AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
IgnoreDefaultLibraryNames="libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="..\..\..\..\..\build\msvc_9\libs\blenderplayer.pdb"
@@ -198,7 +198,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\blenderplayer.lib ..\..\..\..\..\build\msvc_9\libs&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\blenderplayer.exp ..\..\..\..\..\build\msvc_9\libs&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\python\lib\lib25_vs2003\python25.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\sdl\lib\SDL.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\png\lib\libpng.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\zlib\lib\zlib.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\..\bin&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
+ CommandLine="ECHO Moving libraries and export definitions...&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\blenderplayer.lib ..\..\..\..\..\build\msvc_9\libs&#x0D;&#x0A;MOVE /Y ..\..\..\..\bin\blenderplayer.exp ..\..\..\..\..\build\msvc_9\libs&#x0D;&#x0A;ECHO Copying required 3rd party dlls...&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\python\lib\python31.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\sdl\lib\SDL.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\png\lib\libpng.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\zlib\lib\zlib.dll ..\..\..\..\bin&#x0D;&#x0A;XCOPY /Y ..\..\..\..\..\lib\windows\ffmpeg\lib\*.dll ..\..\..\..\bin&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
diff --git a/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj b/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj
index d57e8d7f6a7..f709e0b7d29 100644
--- a/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj
+++ b/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="KX_ketsji"
ProjectGUID="{E645CC32-4823-463E-82F0-46ADDE664018}"
+ RootNamespace="KX_ketsji"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID"
StringPooling="true"
RuntimeLibrary="2"
@@ -118,7 +119,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -193,7 +194,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -269,7 +270,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"
@@ -345,7 +346,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -421,7 +422,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\solid\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\python\generic;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"
@@ -629,10 +630,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\gameengine\Ketsji\KX_CDActuator.cpp"
- >
- </File>
- <File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_ConstraintActuator.cpp"
>
</File>
@@ -942,10 +939,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\gameengine\Ketsji\KX_CDActuator.h"
- >
- </File>
- <File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_ConstraintActuator.h"
>
</File>
diff --git a/projectfiles_vc9/gameengine/ketsji/network/KX_network.vcproj b/projectfiles_vc9/gameengine/ketsji/network/KX_network.vcproj
index c6edae137b7..36c8218b803 100644
--- a/projectfiles_vc9/gameengine/ketsji/network/KX_network.vcproj
+++ b/projectfiles_vc9/gameengine/ketsji/network/KX_network.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@@ -268,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -343,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\ketsji;..\..\..\..\source\gameengine\Network;..\..\..\..\source\gameengine\expressions;..\..\..\..\source\gameengine\GameLogic;..\..\..\..\source\gameengine\Scenegraph"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj b/projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
index a954b011994..d4e29e0774a 100644
--- a/projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
+++ b/projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
@@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -110,7 +110,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@@ -176,7 +176,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@@ -243,7 +243,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -312,7 +312,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -380,7 +380,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\..\..\build\msvc_9\intern\SoundSystem\include;..\..\..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\gameengine\Ketsji;..\..\..\..\..\source\gameengine\Expressions;..\..\..\..\..\source\gameengine\GameLogic;..\..\..\..\..\source\gameengine\SceneGraph;..\..\..\..\..\source\kernel\gen_system;..\..\..\..\..\source\blender\makesdna;..\..\..\..\..\source\blender\blenkernel;..\..\..\..\..\source\blender\blenlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
diff --git a/projectfiles_vc9/gameengine/rasterizer/RAS_rasterizer.vcproj b/projectfiles_vc9/gameengine/rasterizer/RAS_rasterizer.vcproj
index 52293b49519..43c8d4100bf 100644
--- a/projectfiles_vc9/gameengine/rasterizer/RAS_rasterizer.vcproj
+++ b/projectfiles_vc9/gameengine/rasterizer/RAS_rasterizer.vcproj
@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender\makesdna"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -118,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender\makesdna"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@@ -193,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender\makesdna"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"
@@ -268,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender\makesdna"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -343,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender\makesdna"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -418,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\source\blender\makesdna"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\moto\include;..\..\..\..\build\msvc_9\intern\string\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\SceneGraph;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj b/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj
index 14a62f6a31e..94e09303a1b 100644
--- a/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj
+++ b/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj
@@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;WITH_FFMPEG;__STDC_CONSTANT_MACROS"
StringPooling="false"
BasicRuntimeChecks="3"
@@ -113,7 +113,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;WITH_FFMPEG;__STDC_CONSTANT_MACROS"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/release/Makefile b/release/Makefile
index 2d688211b9c..94bb902646d 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -35,16 +35,6 @@ BLENDNAME=blender-$(VERSION)-$(CONFIG_GUESS)-py$(NAN_PYTHON_VERSION)$(TYPE)
export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
export CONFDIR=$(DISTDIR)/.blender
-ifeq ($(OS),beos)
- TAR="zip"
- TARFLAGS="-ry9"
- EXT0=""
- EXT1=".zip"
- COMPRESS=""
- EXT2=""
- NOPLUGINS?=true
-endif
-
ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
TAR="tar"
TARFLAGS="cf"
@@ -166,6 +156,12 @@ endif
@echo "----> Copy python UI files"
@[ ! -d ui ] || cp -r ui $(CONFDIR)/ui
+
+ ifeq ($(OS),darwin)
+ @echo "----> Copy python modules"
+ @mkdir $(CONFDIR)/python/
+ @unzip -q $(LCGDIR)/release/python.zip -d $(CONFDIR)/python/
+ endif
ifeq ($(OS),darwin)
@echo "----> Move .blender to .app/Contents/MacOS/"
diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons
index e011fec50cd..98c321cd954 100644
--- a/release/datafiles/blenderbuttons
+++ b/release/datafiles/blenderbuttons
Binary files differ
diff --git a/release/datafiles/datatoc.c b/release/datafiles/datatoc.c
deleted file mode 100644
index 46b935c7fd6..00000000000
--- a/release/datafiles/datatoc.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-int main(int argc, char**argv) {
- FILE *fpin, *fpout;
- char cname[256];
- char sizest[256];
- size_t size;
- int i;
-
- if (argc<1) {
- printf ("Usage: datatoc <data_file>\n");
- exit(1);
- }
-
- fpin= fopen(argv[1], "rb");
- if (!fpin) {
- printf ("Unable to open input <%s>\n", argv[1]);
- exit(1);
- }
-
- fseek (fpin, 0L, SEEK_END);
- size= ftell(fpin);
- fseek (fpin, 0L, SEEK_SET);
-
- if (argv[1][0]=='.') argv[1]++;
-
- sprintf(cname, "%s.c", argv[1]);
- printf ("Making C file <%s>\n", cname);
-
- for (i=0; i < (int)strlen(argv[1]); i++)
- if (argv[1][i]=='.') argv[1][i]='_';
-
- sprintf(sizest, "%d", (int)size);
- printf ("Input filesize is %ld, Output size should be %ld\n", size, ((int)size)*4 + strlen("/* DataToC output of file <> */\n\n") + strlen("char datatoc_[]= {\"") + strlen ("\"};\n") + (strlen(argv[1])*3) + strlen(sizest) + strlen("int datatoc__size= ;\n") +(((int)(size/256)+1)*5));
-
- fpout= fopen(cname, "w");
- if (!fpout) {
- printf ("Unable to open output <%s>\n", cname);
- exit(1);
- }
-
- fprintf (fpout, "/* DataToC output of file <%s> */\n\n",argv[1]);
- fprintf (fpout, "int datatoc_%s_size= %s;\n", argv[1], sizest);
- /*
- fprintf (fpout, "char datatoc_%s[]= {\"", argv[1]);
-
- while (size--) {
- if(size%256==0)
- fprintf(fpout, "\" \\\n\"");
-
- fprintf (fpout, "\\x%02x", getc(fpin));
- }
-
- fprintf (fpout, "\"};\n");
- */
-
- fprintf (fpout, "char datatoc_%s[]= {\n", argv[1]);
- while (size--) {
- if(size%32==31)
- fprintf(fpout, "\n");
-
- /* fprintf (fpout, "\\x%02x", getc(fpin)); */
- fprintf (fpout, "%3d,", getc(fpin));
- }
- /* null terminate for the case it is a string */
- fprintf (fpout, "\n 0};\n\n");
-
- fclose(fpin);
- fclose(fpout);
- return 0;
-}
diff --git a/release/datafiles/datatoc.py b/release/datafiles/datatoc.py
new file mode 100755
index 00000000000..362d4ddc126
--- /dev/null
+++ b/release/datafiles/datatoc.py
@@ -0,0 +1,75 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2009 Blender Foundation.
+# All rights reserved.
+#
+# Contributor(s): Jörg Müller
+#
+# ***** END GPL LICENCE BLOCK *****
+
+import sys, os
+
+if len(sys.argv) < 2:
+ sys.stdout.write("Usage: datatoc <data_file>\n")
+ sys.exit(1)
+
+filename = sys.argv[1]
+
+try:
+ fpin = open(filename, "rb");
+except:
+ sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
+ sys.exit(1)
+
+fpin.seek(0, os.SEEK_END)
+size = fpin.tell()
+fpin.seek(0)
+
+if filename[0] == ".":
+ filename = filename[1:]
+
+cname = filename + ".c"
+sys.stdout.write("Making C file <%s>\n" % cname)
+
+filename = filename.replace(".", "_")
+sys.stdout.write(str(size))
+sys.stdout.write("\n")
+try:
+ fpout = open(cname, "w")
+except:
+ sys.stdout.write("Unable to open output %s\n" % cname)
+ sys.exit(1)
+
+fpout.write("/* DataToC output of file <%s> */\n\n" % filename)
+fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
+
+fpout.write("char datatoc_%s[]= {\n" % filename)
+
+while size > 0:
+ size -= 1
+ if size % 32 == 31:
+ fpout.write("\n")
+
+ fpout.write("%3d," % ord(fpin.read(1)))
+
+fpout.write("\n 0};\n\n")
+
+fpin.close()
+fpout.close()
diff --git a/release/datafiles/splash.jpg b/release/datafiles/splash.jpg
index 1c34cf36f75..e35a26a2c23 100644
--- a/release/datafiles/splash.jpg
+++ b/release/datafiles/splash.jpg
Binary files differ
diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py
index 186118246b8..c3165d22540 100644
--- a/release/io/engine_render_pov.py
+++ b/release/io/engine_render_pov.py
@@ -19,20 +19,113 @@ def write_pov(filename, scene=None, info_callback = None):
# Only for testing
if not scene:
scene = bpy.data.scenes[0]
-
+
render = scene.render_data
- materialTable = {}
+ world = scene.world
+
+ # --- taken from fbx exporter
+ ## This was used to make V, but faster not to do all that
+ ##valid = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_,.()[]{}'
+ ##v = range(255)
+ ##for c in valid: v.remove(ord(c))
+ v = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,42,43,46,47,58,59,60,61,62,63,64,92,94,96,124,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254]
+ invalid = ''.join([chr(i) for i in v])
+ def cleanName(name):
+ for ch in invalid: name = name.replace(ch, '_')
+ return name
+ del v
- def saneName(name):
- name = name.lower()
- for ch in ' /\\+=-[]{}().,<>\'":;~!@#$%^&*|?':
- name = name.replace(ch, '_')
+ # --- done with clean name.
+
+ def uniqueName(name, nameSeq):
+
+ if name not in nameSeq:
+ return name
+
+ name_orig = name
+ i = 1
+ while name in nameSeq:
+ name = '%s_%.3d' % (name_orig, i)
+ i+=1
+
return name
+
def writeMatrix(matrix):
file.write('\tmatrix <%.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f, %.6f>\n' %\
(matrix[0][0], matrix[0][1], matrix[0][2], matrix[1][0], matrix[1][1], matrix[1][2], matrix[2][0], matrix[2][1], matrix[2][2], matrix[3][0], matrix[3][1], matrix[3][2]) )
+ def writeObjectMaterial(material):
+ if material and material.transparency_method=='RAYTRACE':
+ file.write('\tinterior { ior %.6f }\n' % material.raytrace_transparency.ior)
+
+ # Other interior args
+ # fade_distance 2
+ # fade_power [Value]
+ # fade_color
+
+ # dispersion
+ # dispersion_samples
+
+ materialNames = {}
+ DEF_MAT_NAME = 'Default'
+ def writeMaterial(material):
+ # Assumes only called once on each material
+
+ if material:
+ name_orig = material.name
+ else:
+ name_orig = DEF_MAT_NAME
+
+ name = materialNames[name_orig] = uniqueName(cleanName(name_orig), materialNames)
+
+ file.write('#declare %s = finish {\n' % name)
+
+ if material:
+ file.write('\tdiffuse %.3g\n' % material.diffuse_intensity)
+ file.write('\tspecular %.3g\n' % material.specular_intensity)
+
+ file.write('\tambient %.3g\n' % material.ambient)
+ #file.write('\tambient rgb <%.3g, %.3g, %.3g>\n' % tuple([c*material.ambient for c in world.ambient_color])) # povray blends the global value
+
+ # map hardness between 0.0 and 1.0
+ roughness = ((1.0 - ((material.specular_hardness-1.0)/510.0)))
+ # scale from 0.0 to 0.1
+ roughness *= 0.1
+ # add a small value because 0.0 is invalid
+ roughness += (1/511.0)
+
+ file.write('\troughness %.3g\n' % roughness)
+
+ # 'phong 70.0 '
+
+ if material.raytrace_mirror.enabled:
+ raytrace_mirror= material.raytrace_mirror
+ if raytrace_mirror.reflect_factor:
+ file.write('\treflection {\n')
+ file.write('\t\trgb <%.3g, %.3g, %.3g>' % tuple(material.mirror_color))
+ file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_factor, raytrace_mirror.reflect_factor))
+
+ else:
+ file.write('\tdiffuse 0.8\n')
+ file.write('\tspecular 0.2\n')
+
+
+
+ # This is written into the object
+ '''
+ if material and material.transparency_method=='RAYTRACE':
+ 'interior { ior %.3g} ' % material.raytrace_transparency.ior
+ '''
+
+ #file.write('\t\t\tcrand 1.0\n') # Sand granyness
+ #file.write('\t\t\tmetallic %.6f\n' % material.spec)
+ #file.write('\t\t\tphong %.6f\n' % material.spec)
+ #file.write('\t\t\tphong_size %.6f\n' % material.spec)
+ #file.write('\t\t\tbrilliance %.6f ' % (material.specular_hardness/256.0) # Like hardness
+
+ file.write('}\n')
+
def exportCamera():
camera = scene.camera
matrix = camera.matrix
@@ -64,7 +157,7 @@ def write_pov(filename, scene=None, info_callback = None):
file.write('light_source {\n')
file.write('\t< 0,0,0 >\n')
- file.write('\tcolor red %.6f green %.6f blue %.6f\n' % color)
+ file.write('\tcolor rgb<%.3g, %.3g, %.3g>\n' % color)
if lamp.type == 'POINT': # Point Lamp
pass
@@ -79,6 +172,10 @@ def write_pov(filename, scene=None, info_callback = None):
file.write('\ttightness 0\n') # 0:10f
file.write('\tpoint_at <0, 0, -1>\n')
+ elif lamp.type == 'SUN':
+ file.write('\tparallel\n')
+ file.write('\tpoint_at <0, 0, -1>\n') # *must* be after 'parallel'
+
elif lamp.type == 'AREA':
size_x = lamp.size
@@ -109,47 +206,69 @@ def write_pov(filename, scene=None, info_callback = None):
file.write('}\n')
- def exportMeshs(sel):
- def bMat2PovString(material):
- povstring = 'finish {'
- if world != None:
- povstring += 'ambient <%.6f, %.6f, %.6f> ' % tuple([c*material.ambient for c in world.ambient_color])
+ def exportMeta(metas):
+
+ # TODO - blenders 'motherball' naming is not supported.
+
+ for ob in metas:
+ meta = ob.data
- povstring += 'diffuse %.6f ' % material.diffuse_reflection
- povstring += 'specular %.6f ' % material.specular_reflection
+ file.write('blob {\n')
+ file.write('\t\tthreshold %.4g\n' % meta.threshold)
+ try:
+ material= meta.materials[0] # lame! - blender cant do enything else.
+ except:
+ material= None
- if material.raytrace_mirror.enabled:
- #povstring += 'interior { ior %.6f } ' % material.IOR
- raytrace_mirror= material.raytrace_mirror
- if raytrace_mirror.reflect:
- povstring += 'reflection {'
- povstring += '<%.6f, %.6f, %.6f>' % tuple(material.mirror_color) # Should ask for ray mirror flag
- povstring += 'fresnel 1 falloff %.6f exponent %.6f metallic %.6f} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_fac, raytrace_mirror.reflect)
+ for elem in meta.elements:
+
+ if elem.type not in ('BALL', 'ELLIPSOID'):
+ continue # Not supported
+ loc = elem.location
+ stiffness= elem.stiffness
+ if elem.negative:
+ stiffness = -stiffness
+
+ if elem.type == 'BALL':
- if material.raytrace_transparency.enabled:
- #povstring += 'interior { ior %.6f } ' % material.IOR
- pass
+ file.write('\tsphere { <%.6g, %.6g, %.6g>, %.4g, %.4g ' % (loc.x, loc.y, loc.z, elem.radius, stiffness))
+
+ # After this wecould do something simple like...
+ # "pigment {Blue} }"
+ # except we'll write the color
+
+ elif elem.type == 'ELLIPSOID':
+ # location is modified by scale
+ file.write('\tsphere { <%.6g, %.6g, %.6g>, %.4g, %.4g ' % (loc.x/elem.size_x, loc.y/elem.size_y, loc.z/elem.size_z, elem.radius, stiffness))
+ file.write( 'scale <%.6g, %.6g, %.6g> ' % (elem.size_x, elem.size_y, elem.size_z))
+
+ if material:
+ diffuse_color = material.diffuse_color
+
+ if material.transparency and material.transparency_method=='RAYTRACE': trans = 1-material.raytrace_transparency.filter
+ else: trans = 0.0
+
+ file.write(
+ 'pigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>} finish {%s} }\n' % \
+ (diffuse_color[0], diffuse_color[1], diffuse_color[2], 1-material.alpha, trans, materialNames[material.name])
+ )
+
+ else:
+ file.write('pigment {rgb<1 1 1>} finish {%s} }\n' % DEF_MAT_NAME) # Write the finish last.
- #file.write('\t\troughness %.6f\n' % (material.hard*0.5))
- #file.write('\t\t\tcrand 0.0\n') # Sand granyness
- #file.write('\t\t\tmetallic %.6f\n' % material.spec)
- #file.write('\t\t\tphong %.6f\n' % material.spec)
- #file.write('\t\t\tphong_size %.6f\n' % material.spec)
- povstring += 'brilliance %.6f ' % (material.specular_hardness/256.0) # Like hardness
- povstring += '}'
- #file.write('\t}\n')
- return povstring
+ writeObjectMaterial(material)
+
+ writeMatrix(ob.matrix)
+ file.write('}\n')
- world = scene.world
-
- # Convert all materials to strings we can access directly per vertex.
- for material in bpy.data.materials:
- materialTable[material.name] = bMat2PovString(material)
+
+
+ def exportMeshs(sel):
ob_num = 0
@@ -181,14 +300,7 @@ def write_pov(filename, scene=None, info_callback = None):
try: vcol_layer = me.active_vertex_color.data
except:vcol_layer = None
-
- def regular_face(f):
- fv = f.verts
- if fv[3]== 0:
- return fv[0], fv[1], fv[2]
- return fv[0], fv[1], fv[2], fv[3]
-
- faces_verts = [regular_face(f) for f in me.faces]
+ faces_verts = [f.verts for f in me.faces]
faces_normals = [tuple(f.normal) for f in me.faces]
verts_normals = [tuple(v.normal) for v in me.verts]
@@ -304,13 +416,19 @@ def write_pov(filename, scene=None, info_callback = None):
if me_materials:
material = me_materials[col[3]]
- materialString = materialTable[material.name]
+ material_finish = materialNames[material.name]
+
+ if material.transparency and material.transparency_method=='RAYTRACE': trans = 1-material.raytrace_transparency.filter
+ else: trans = 0.0
+
else:
- materialString = '' # Dont write anything
+ material_finish = DEF_MAT_NAME # not working properly,
+ trans = 0.0
- float_col = col[0], col[1], col[2], 1-material.alpha, materialString
#print material.apl
- file.write(',\n\t\ttexture { pigment {rgbf<%.6f, %.6f, %.6f, %.6f>}%s}' % float_col)
+ file.write( ',\n\t\ttexture { pigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>} finish {%s}}' %
+ (col[0], col[1], col[2], 1-material.alpha, trans, material_finish) )
+
index[0] = idx
idx+=1
@@ -404,21 +522,70 @@ def write_pov(filename, scene=None, info_callback = None):
if me.materials:
material = me.materials[0] # dodgy
- if material and material.raytrace_transparency.enabled:
- file.write('\tinterior { ior %.6f }\n' % material.raytrace_transparency.ior)
+ writeObjectMaterial(material)
writeMatrix(matrix)
file.write('}\n')
bpy.data.remove_mesh(me)
+ def exportWorld(world):
+ if not world:
+ return
+
+ mist = world.mist
+
+ if mist.enabled:
+ file.write('fog {\n')
+ file.write('\tdistance %.6f\n' % mist.depth)
+ file.write('\tcolor rgbt<%.3g, %.3g, %.3g, %.3g>\n' % (tuple(world.horizon_color) + (1-mist.intensity,)))
+ #file.write('\tfog_offset %.6f\n' % mist.start)
+ #file.write('\tfog_alt 5\n')
+ #file.write('\tturbulence 0.2\n')
+ #file.write('\tturb_depth 0.3\n')
+ file.write('\tfog_type 1\n')
+ file.write('}\n')
+
+ def exportGlobalSettings(scene):
+
+ file.write('global_settings {\n')
+
+ if scene.pov_radio_enable:
+ file.write('\tradiosity {\n')
+ file.write("\t\tadc_bailout %.4g\n" % scene.pov_radio_adc_bailout)
+ file.write("\t\talways_sample %d\n" % scene.pov_radio_always_sample)
+ file.write("\t\tbrightness %.4g\n" % scene.pov_radio_brightness)
+ file.write("\t\tcount %d\n" % scene.pov_radio_count)
+ file.write("\t\terror_bound %.4g\n" % scene.pov_radio_error_bound)
+ file.write("\t\tgray_threshold %.4g\n" % scene.pov_radio_gray_threshold)
+ file.write("\t\tlow_error_factor %.4g\n" % scene.pov_radio_low_error_factor)
+ file.write("\t\tmedia %d\n" % scene.pov_radio_media)
+ file.write("\t\tminimum_reuse %.4g\n" % scene.pov_radio_minimum_reuse)
+ file.write("\t\tnearest_count %d\n" % scene.pov_radio_nearest_count)
+ file.write("\t\tnormal %d\n" % scene.pov_radio_normal)
+ file.write("\t\trecursion_limit %d\n" % scene.pov_radio_recursion_limit)
+ file.write('\t}\n')
+
+ if world:
+ file.write("\tambient_light rgb<%.3g, %.3g, %.3g>\n" % tuple(world.ambient_color))
+
+ file.write('}\n')
+
+
+ # Convert all materials to strings we can access directly per vertex.
+ writeMaterial(None) # default material
+
+ for material in bpy.data.materials:
+ writeMaterial(material)
exportCamera()
#exportMaterials()
sel = scene.objects
- lamps = [l for l in sel if l.type == 'LAMP']
- exportLamps(lamps)
+ exportLamps([l for l in sel if l.type == 'LAMP'])
+ exportMeta([l for l in sel if l.type == 'META'])
exportMeshs(sel)
+ exportWorld(scene.world)
+ exportGlobalSettings(scene)
file.close()
@@ -461,16 +628,100 @@ def write_pov_ini(filename_ini, filename_pov, filename_image):
file.close()
+# Radiosity panel, use in the scene for now.
+FloatProperty= bpy.types.Scene.FloatProperty
+IntProperty= bpy.types.Scene.IntProperty
+BoolProperty= bpy.types.Scene.BoolProperty
+
+# Not a real pov option, just to know if we should write
+BoolProperty( attr="pov_radio_enable",
+ name="Enable Radiosity",
+ description="Enable povrays radiosity calculation.",
+ default= False)
+BoolProperty( attr="pov_radio_display_advanced",
+ name="Advanced Options",
+ description="Show advanced options.",
+ default= False)
+
+# Real pov options
+FloatProperty( attr="pov_radio_adc_bailout",
+ name="ADC Bailout",
+ description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.",
+ min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01)
+
+BoolProperty( attr="pov_radio_always_sample",
+ name="Always Sample",
+ description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..",
+ default= True)
+
+FloatProperty( attr="pov_radio_brightness",
+ name="Brightness",
+ description="Ammount objects are brightened before being returned upwards to the rest of the system.",
+ min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0)
+
+IntProperty( attr="pov_radio_count",
+ name="Ray Count",
+ description="number of rays that are sent out whenever a new radiosity value has to be calculated.",
+ min=1, max=1600, default= 35)
+
+FloatProperty( attr="pov_radio_error_bound",
+ name="Error Bound",
+ description="one of the two main speed/quality tuning values, lower values are more accurate.",
+ min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8)
+
+FloatProperty( attr="pov_radio_gray_threshold",
+ name="Gray Threshold",
+ description="one of the two main speed/quality tuning values, lower values are more accurate.",
+ min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0)
+
+FloatProperty( attr="pov_radio_low_error_factor",
+ name="Low Error Factor",
+ description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.",
+ min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5)
+
+# max_sample - not available yet
+BoolProperty( attr="pov_radio_media",
+ name="Media",
+ description="Radiosity estimation can be affected by media.",
+ default= False)
+
+FloatProperty( attr="pov_radio_minimum_reuse",
+ name="Minimum Reuse",
+ description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).",
+ min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015)
+
+IntProperty( attr="pov_radio_nearest_count",
+ name="Nearest Count",
+ description="Number of old ambient values blended together to create a new interpolated value.",
+ min=1, max=20, default= 5)
+
+BoolProperty( attr="pov_radio_normal",
+ name="Normals",
+ description="Radiosity estimation can be affected by normals.",
+ default= False)
-class PovrayRenderEngine(bpy.types.RenderEngine):
+IntProperty( attr="pov_radio_recursion_limit",
+ name="Recursion Limit",
+ description="how many recursion levels are used to calculate the diffuse inter-reflection.",
+ min=1, max=20, default= 3)
+
+
+class PovrayRender(bpy.types.RenderEngine):
+ __idname__ = 'POVRAY_RENDER'
__label__ = "Povray"
DELAY = 0.02
+
def _export(self, scene):
import tempfile
self.temp_file_in = tempfile.mktemp(suffix='.pov')
self.temp_file_out = tempfile.mktemp(suffix='.tga')
self.temp_file_ini = tempfile.mktemp(suffix='.ini')
+ '''
+ self.temp_file_in = '/test.pov'
+ self.temp_file_out = '/test.tga'
+ self.temp_file_ini = '/test.ini'
+ '''
def info_callback(txt):
self.update_stats("", "POVRAY: " + txt)
@@ -485,8 +736,6 @@ class PovrayRenderEngine(bpy.types.RenderEngine):
write_pov_ini(self.temp_file_ini, self.temp_file_in, self.temp_file_out)
print ("***-STARTING-***")
- # This works too but means we have to wait until its done
- # os.system('povray %s' % self.temp_file_ini)
pov_binary = "povray"
@@ -496,7 +745,11 @@ class PovrayRenderEngine(bpy.types.RenderEngine):
else:
pov_binary = "pvengine"
- self.process = subprocess.Popen([pov_binary, self.temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
+ if 1:
+ self.process = subprocess.Popen([pov_binary, self.temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
+ else:
+ # This works too but means we have to wait until its done
+ os.system('%s %s' % (pov_binary, self.temp_file_ini))
print ("***-DONE-***")
@@ -545,7 +798,7 @@ class PovrayRenderEngine(bpy.types.RenderEngine):
result = self.begin_result(0, 0, x, y)
lay = result.layers[0]
# possible the image wont load early on.
- try: lay.rect_from_file(self.temp_file_out, 0, 0)
+ try: lay.load_from_file(self.temp_file_out)
except: pass
self.end_result(result)
@@ -579,5 +832,94 @@ class PovrayRenderEngine(bpy.types.RenderEngine):
self._cleanup()
+bpy.types.register(PovrayRender)
+
+# Use some of the existing buttons.
+import buttons_scene
+buttons_scene.SCENE_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
+buttons_scene.SCENE_PT_dimensions.COMPAT_ENGINES.add('POVRAY_RENDER')
+buttons_scene.SCENE_PT_antialiasing.COMPAT_ENGINES.add('POVRAY_RENDER')
+buttons_scene.SCENE_PT_output.COMPAT_ENGINES.add('POVRAY_RENDER')
+del buttons_scene
+
+# Use only a subset of the world panels
+import buttons_world
+buttons_world.WORLD_PT_preview.COMPAT_ENGINES.add('POVRAY_RENDER')
+buttons_world.WORLD_PT_context_world.COMPAT_ENGINES.add('POVRAY_RENDER')
+buttons_world.WORLD_PT_world.COMPAT_ENGINES.add('POVRAY_RENDER')
+buttons_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')
+del buttons_world
+
+# Example of wrapping every class 'as is'
+import buttons_material
+for member in dir(buttons_material):
+ subclass = getattr(buttons_material, member)
+ try: subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
+ except: pass
+del buttons_material
+
+class RenderButtonsPanel(bpy.types.Panel):
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
+ __context__ = "scene"
+ # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
+ def poll(self, context):
+ rd = context.scene.render_data
+ return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
+
+class SCENE_PT_povray_radiosity(RenderButtonsPanel):
+ __label__ = "Radiosity"
+ COMPAT_ENGINES = set(['POVRAY_RENDER'])
+
+ def draw_header(self, context):
+ layout = self.layout
+ scene = context.scene
+ layout.itemR(scene, "pov_radio_enable", text="")
+
+ def draw(self, context):
+ layout = self.layout
+ scene = context.scene
+ rd = scene.render_data
+
+ layout.active = scene.pov_radio_enable
+
+ split = layout.split()
+
+ col = split.column()
+
+ col.itemR(scene, "pov_radio_count", text="Rays")
+ col.itemR(scene, "pov_radio_recursion_limit", text="Recursions")
+ col = split.column()
+ col.itemR(scene, "pov_radio_error_bound", text="Error")
+
+ layout.itemR(scene, "pov_radio_display_advanced")
+
+ if scene.pov_radio_display_advanced:
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(scene, "pov_radio_adc_bailout", slider=True)
+ col.itemR(scene, "pov_radio_gray_threshold", slider=True)
+ col.itemR(scene, "pov_radio_low_error_factor", slider=True)
+
+
+
+ col = split.column()
+ col.itemR(scene, "pov_radio_brightness")
+ col.itemR(scene, "pov_radio_minimum_reuse", text="Min Reuse")
+ col.itemR(scene, "pov_radio_nearest_count")
+
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Estimation Influence:")
+ col.itemR(scene, "pov_radio_media")
+ col.itemR(scene, "pov_radio_normal")
+
+ col = split.column()
+ col.itemR(scene, "pov_radio_always_sample")
+
-bpy.types.register(PovrayRenderEngine)
+bpy.types.register(SCENE_PT_povray_radiosity)
diff --git a/release/io/export_ply.py b/release/io/export_ply.py
index 3668693db16..c293119d3c8 100644
--- a/release/io/export_ply.py
+++ b/release/io/export_ply.py
@@ -64,7 +64,7 @@ def write(filename, scene, ob, \
raise Exception("Error, Select 1 active object")
return
- file = open(filename, 'wb')
+ file = open(filename, 'w')
#EXPORT_EDGES = Draw.Create(0)
@@ -88,9 +88,9 @@ def write(filename, scene, ob, \
# mesh.transform(ob.matrixWorld) # XXX
- faceUV = len(mesh.uv_layers) > 0
+ faceUV = len(mesh.uv_textures) > 0
vertexUV = len(mesh.sticky) > 0
- vertexColors = len(mesh.vcol_layers) > 0
+ vertexColors = len(mesh.vertex_colors) > 0
if (not faceUV) and (not vertexUV): EXPORT_UV = False
if not vertexColors: EXPORT_COLORS = False
@@ -100,7 +100,7 @@ def write(filename, scene, ob, \
if faceUV:
active_uv_layer = None
- for lay in mesh.uv_layers:
+ for lay in mesh.uv_textures:
if lay.active:
active_uv_layer= lay.data
break
@@ -110,7 +110,7 @@ def write(filename, scene, ob, \
if vertexColors:
active_col_layer = None
- for lay in mesh.vcol_layers:
+ for lay in mesh.vertex_colors:
if lay.active:
active_col_layer= lay.data
if not active_col_layer:
@@ -123,8 +123,8 @@ def write(filename, scene, ob, \
mesh_verts = mesh.verts # save a lookup
ply_verts = [] # list of dictionaries
# vdict = {} # (index, normal, uv) -> new index
- vdict = [{} for i in xrange(len(mesh_verts))]
- ply_faces = [[] for f in xrange(len(mesh.faces))]
+ vdict = [{} for i in range(len(mesh_verts))]
+ ply_faces = [[] for f in range(len(mesh.faces))]
vert_count = 0
for i, f in enumerate(mesh.faces):
@@ -141,8 +141,7 @@ def write(filename, scene, ob, \
col = active_col_layer[i]
col = col.color1, col.color2, col.color3, col.color4
- f_verts= list(f.verts)
- if not f_verts[3]: f_verts.pop() # XXX face length should be 3/4, not always 4
+ f_verts= f.verts
pf= ply_faces[i]
for j, vidx in enumerate(f_verts):
diff --git a/release/io/netrender/__init__.py b/release/io/netrender/__init__.py
new file mode 100644
index 00000000000..e0de2726a55
--- /dev/null
+++ b/release/io/netrender/__init__.py
@@ -0,0 +1,9 @@
+# This directory is a Python package.
+
+import model
+import operators
+import client
+import slave
+import master
+import utils
+import ui
diff --git a/release/io/netrender/client.py b/release/io/netrender/client.py
new file mode 100644
index 00000000000..59cb19c2075
--- /dev/null
+++ b/release/io/netrender/client.py
@@ -0,0 +1,88 @@
+import bpy
+import sys, os
+import http, http.client, http.server, urllib
+import subprocess, shutil, time, hashlib
+
+import netrender.slave as slave
+import netrender.master as master
+from netrender.utils import *
+
+class NetworkRenderEngine(bpy.types.RenderEngine):
+ __idname__ = 'NET_RENDER'
+ __label__ = "Network Render"
+ def render(self, scene):
+ if scene.network_render.mode == "RENDER_CLIENT":
+ self.render_client(scene)
+ elif scene.network_render.mode == "RENDER_SLAVE":
+ self.render_slave(scene)
+ elif scene.network_render.mode == "RENDER_MASTER":
+ self.render_master(scene)
+ else:
+ print("UNKNOWN OPERATION MODE")
+
+ def render_master(self, scene):
+ server_address = (scene.network_render.server_address, scene.network_render.server_port)
+ httpd = master.RenderMasterServer(server_address, master.RenderHandler, scene.network_render.path)
+ httpd.timeout = 1
+ httpd.stats = self.update_stats
+ while not self.test_break():
+ httpd.handle_request()
+
+ def render_slave(self, scene):
+ slave.render_slave(self, scene)
+
+ def render_client(self, scene):
+ netsettings = scene.network_render
+ self.update_stats("", "Network render client initiation")
+
+ conn = clientConnection(scene)
+
+ if conn:
+ # Sending file
+
+ self.update_stats("", "Network render exporting")
+
+ job_id = netsettings.job_id
+
+ # reading back result
+
+ self.update_stats("", "Network render waiting for results")
+
+ clientRequestResult(conn, scene, job_id)
+ response = conn.getresponse()
+
+ if response.status == http.client.NO_CONTENT:
+ netsettings.job_id = clientSendJob(conn, scene)
+ clientRequestResult(conn, scene, job_id)
+
+ while response.status == http.client.ACCEPTED and not self.test_break():
+ print("waiting")
+ time.sleep(1)
+ clientRequestResult(conn, scene, job_id)
+ response = conn.getresponse()
+
+ if response.status != http.client.OK:
+ conn.close()
+ return
+
+ r = scene.render_data
+ x= int(r.resolution_x*r.resolution_percentage*0.01)
+ y= int(r.resolution_y*r.resolution_percentage*0.01)
+
+ f = open(netsettings.path + "output.exr", "wb")
+ buf = response.read(1024)
+
+ while buf:
+ f.write(buf)
+ buf = response.read(1024)
+
+ f.close()
+
+ result = self.begin_result(0, 0, x, y)
+ result.load_from_file(netsettings.path + "output.exr", 0, 0)
+ self.end_result(result)
+
+ conn.close()
+
+bpy.types.register(NetworkRenderEngine)
+
diff --git a/release/io/netrender/master.py b/release/io/netrender/master.py
new file mode 100644
index 00000000000..6f360a4e7a9
--- /dev/null
+++ b/release/io/netrender/master.py
@@ -0,0 +1,601 @@
+import sys, os
+import http, http.client, http.server, urllib
+import subprocess, shutil, time, hashlib
+
+from netrender.utils import *
+import netrender.model
+
+JOB_WAITING = 0 # before all data has been entered
+JOB_PAUSED = 1 # paused by user
+JOB_QUEUED = 2 # ready to be dispatched
+
+class MRenderFile:
+ def __init__(self, filepath):
+ self.filepath = filepath
+ self.found = False
+
+ def test(self):
+ self.found = os.path.exists(self.filepath)
+ return self.found
+
+
+class MRenderSlave(netrender.model.RenderSlave):
+ def __init__(self, name, address, stats):
+ super().__init__()
+ self.id = hashlib.md5(bytes(repr(name) + repr(address), encoding='utf8')).hexdigest()
+ self.name = name
+ self.address = address
+ self.stats = stats
+ self.last_seen = time.time()
+
+ self.job = None
+ self.frame = None
+
+ netrender.model.RenderSlave._slave_map[self.id] = self
+
+ def seen(self):
+ self.last_seen = time.time()
+
+# sorting key for jobs
+def groupKey(job):
+ return (job.status, job.framesLeft() > 0, job.priority, job.credits)
+
+class MRenderJob(netrender.model.RenderJob):
+ def __init__(self, job_id, name, files, chunks = 1, priority = 1, credits = 100.0, blacklist = []):
+ super().__init__()
+ self.id = job_id
+ self.name = name
+ self.files = files
+ self.frames = []
+ self.chunks = chunks
+ self.priority = priority
+ self.credits = credits
+ self.blacklist = blacklist
+ self.last_dispatched = time.time()
+
+ # special server properties
+ self.save_path = ""
+ self.files_map = {path: MRenderFile(path) for path in files}
+ self.status = JOB_WAITING
+
+ def save(self):
+ if self.save_path:
+ f = open(self.save_path + "job.txt", "w")
+ f.write(repr(self.serialize()))
+ f.close()
+
+ def testStart(self):
+ for f in self.files_map.values():
+ if not f.test():
+ return False
+
+ self.start()
+ return True
+
+ def start(self):
+ self.status = JOB_QUEUED
+
+ def update(self):
+ self.credits -= 5 # cost of one frame
+ self.credits += (time.time() - self.last_dispatched) / 60
+ self.last_dispatched = time.time()
+
+ def addFrame(self, frame_number):
+ frame = MRenderFrame(frame_number)
+ self.frames.append(frame)
+ return frame
+
+ def framesLeft(self):
+ total = 0
+ for j in self.frames:
+ if j.status == QUEUED:
+ total += 1
+
+ return total
+
+ def reset(self, all):
+ for f in self.frames:
+ f.reset(all)
+
+ def getFrames(self):
+ frames = []
+ for f in self.frames:
+ if f.status == QUEUED:
+ self.update()
+ frames.append(f)
+ if len(frames) >= self.chunks:
+ break
+
+ return frames
+
+class MRenderFrame(netrender.model.RenderFrame):
+ def __init__(self, frame):
+ super().__init__()
+ self.number = frame
+ self.slave = None
+ self.time = 0
+ self.status = QUEUED
+
+ def reset(self, all):
+ if all or self.status == ERROR:
+ self.slave = None
+ self.time = 0
+ self.status = QUEUED
+
+
+# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+class RenderHandler(http.server.BaseHTTPRequestHandler):
+ def send_head(self, code = http.client.OK, headers = {}):
+ self.send_response(code)
+ self.send_header("Content-type", "application/octet-stream")
+
+ for key, value in headers.items():
+ self.send_header(key, value)
+
+ self.end_headers()
+
+ def do_HEAD(self):
+ print(self.path)
+
+ if self.path == "status":
+ job_id = self.headers.get('job-id', "")
+ job_frame = int(self.headers.get('job-frame', -1))
+
+ if job_id:
+ print("status:", job_id, "\n")
+
+ job = self.server.getJobByID(job_id)
+ if job:
+ if job_frame != -1:
+ frame = job[frame]
+
+ if not frame:
+ # no such frame
+ self.send_heat(http.client.NOT_FOUND)
+ return
+ else:
+ # no such job id
+ self.send_head(http.client.NOT_FOUND)
+ return
+
+ self.send_head()
+
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+ def do_GET(self):
+ print(self.path)
+
+ if self.path == "version":
+ self.send_head()
+ self.server.stats("", "New client connection")
+ self.wfile.write(VERSION)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "render":
+ job_id = self.headers['job-id']
+ job_frame = int(self.headers['job-frame'])
+ print("render:", job_id, job_frame)
+
+ job = self.server.getJobByID(job_id)
+
+ if job:
+ frame = job[job_frame]
+
+ if frame:
+ if frame.status in (QUEUED, DISPATCHED):
+ self.send_head(http.client.ACCEPTED)
+ elif frame.status == DONE:
+ self.server.stats("", "Sending result back to client")
+ f = open(job.save_path + "%04d" % job_frame + ".exr", 'rb')
+
+ self.send_head()
+
+ shutil.copyfileobj(f, self.wfile)
+
+ f.close()
+ elif frame.status == ERROR:
+ self.send_head(http.client.PARTIAL_CONTENT)
+ else:
+ # no such frame
+ self.send_head(http.client.NO_CONTENT)
+ else:
+ # no such job id
+ self.send_head(http.client.NO_CONTENT)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "log":
+ job_id = self.headers['job-id']
+ job_frame = int(self.headers['job-frame'])
+ print("log:", job_id, job_frame)
+
+ job = self.server.getJobByID(job_id)
+
+ if job:
+ frame = job[job_frame]
+
+ if frame:
+ if frame.status in (QUEUED, DISPATCHED):
+ self.send_head(http.client.PROCESSING)
+ else:
+ self.server.stats("", "Sending log back to client")
+ f = open(job.save_path + "%04d" % job_frame + ".log", 'rb')
+
+ self.send_head()
+
+ shutil.copyfileobj(f, self.wfile)
+
+ f.close()
+ else:
+ # no such frame
+ self.send_head(http.client.NO_CONTENT)
+ else:
+ # no such job id
+ self.send_head(http.client.NO_CONTENT)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "status":
+ job_id = self.headers.get('job-id', "")
+ job_frame = int(self.headers.get('job-frame', -1))
+
+ if job_id:
+ print("status:", job_id, "\n")
+
+ job = self.server.getJobByID(job_id)
+ if job:
+ if job_frame != -1:
+ frame = job[frame]
+
+ if frame:
+ message = frame.serialize()
+ else:
+ # no such frame
+ self.send_heat(http.client.NO_CONTENT)
+ return
+ else:
+ message = job.serialize()
+ else:
+ # no such job id
+ self.send_head(http.client.NO_CONTENT)
+ return
+ else: # status of all jobs
+ message = []
+
+ for job in self.server:
+ message.append(job.serialize())
+
+ self.send_head()
+ self.wfile.write(bytes(repr(message), encoding='utf8'))
+
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "job":
+ self.server.update()
+
+ slave_id = self.headers['slave-id']
+
+ print("slave-id", slave_id)
+
+ slave = self.server.updateSlave(slave_id)
+
+ if slave: # only if slave id is valid
+ job, frames = self.server.getNewJob(slave_id)
+
+ if job and frames:
+ for f in frames:
+ print("dispatch", f.number)
+ f.status = DISPATCHED
+ f.slave = slave
+
+ self.send_head(headers={"job-id": job.id})
+
+ message = job.serialize(frames)
+
+ self.wfile.write(bytes(repr(message), encoding='utf8'))
+
+ self.server.stats("", "Sending job frame to render node")
+ else:
+ # no job available, return error code
+ self.send_head(http.client.ACCEPTED)
+ else: # invalid slave id
+ self.send_head(http.client.NO_CONTENT)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "file":
+ slave_id = self.headers['slave-id']
+
+ slave = self.server.updateSlave(slave_id)
+
+ if slave: # only if slave id is valid
+ job_id = self.headers['job-id']
+ job_file = self.headers['job-file']
+ print("job:", job_id, "\n")
+ print("file:", job_file, "\n")
+
+ job = self.server.getJobByID(job_id)
+
+ if job:
+ render_file = job.files_map.get(job_file, None)
+
+ if render_file:
+ self.server.stats("", "Sending file to render node")
+ f = open(render_file.path, 'rb')
+
+ shutil.copyfileobj(f, self.wfile)
+
+ f.close()
+ else:
+ # no such file
+ self.send_head(http.client.NO_CONTENT)
+ else:
+ # no such job id
+ self.send_head(http.client.NO_CONTENT)
+ else: # invalid slave id
+ self.send_head(http.client.NO_CONTENT)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "slave":
+ message = []
+
+ for slave in self.server.slaves:
+ message.append(slave.serialize())
+
+ self.send_head()
+
+ self.wfile.write(bytes(repr(message), encoding='utf8'))
+
+
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ def do_POST(self):
+ print(self.path)
+
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ if self.path == "job":
+ print("posting job info")
+ self.server.stats("", "Receiving job")
+
+ length = int(self.headers['content-length'])
+
+ job_info = netrender.model.RenderJob.materialize(eval(str(self.rfile.read(length), encoding='utf8')))
+
+ job_id = self.server.nextJobID()
+
+ print(job_info.files)
+
+ job = MRenderJob(job_id, job_info.name, job_info.files, chunks = job_info.chunks, priority = job_info.priority, blacklist = job_info.blacklist)
+
+ for frame in job_info.frames:
+ frame = job.addFrame(frame.number)
+
+ self.server.addJob(job)
+
+ headers={"job-id": job_id}
+
+ if job.testStart():
+ self.send_head(headers=headers)
+ else:
+ self.send_head(http.client.ACCEPTED, headers=headers)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "cancel":
+ job_id = self.headers.get('job-id', "")
+ if job_id:
+ print("cancel:", job_id, "\n")
+ self.server.removeJob(job_id)
+ else: # cancel all jobs
+ self.server.clear()
+
+ self.send_head()
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "reset":
+ job_id = self.headers.get('job-id', "")
+ job_frame = int(self.headers.get('job-frame', "-1"))
+ all = bool(self.headers.get('reset-all', "False"))
+
+ job = self.server.getJobByID(job_id)
+
+ if job:
+ if job_frame != -1:
+ job[job_frame].reset(all)
+ else:
+ job.reset(all)
+
+ self.send_head()
+ else: # job not found
+ self.send_head(http.client.NO_CONTENT)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "slave":
+ length = int(self.headers['content-length'])
+ job_frame_string = self.headers['job-frame']
+
+ slave_info = netrender.model.RenderSlave.materialize(eval(str(self.rfile.read(length), encoding='utf8')))
+
+ slave_id = self.server.addSlave(slave_info.name, self.client_address, slave_info.stats)
+
+ self.send_head(headers = {"slave-id": slave_id})
+
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ def do_PUT(self):
+ print(self.path)
+
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ if self.path == "file":
+ print("writing blend file")
+ self.server.stats("", "Receiving job")
+
+ length = int(self.headers['content-length'])
+ job_id = self.headers['job-id']
+ job_file = self.headers['job-file']
+
+ job = self.server.getJobByID(job_id)
+
+ if job:
+
+ render_file = job.files_map.get(job_file, None)
+
+ if render_file:
+ main_file = job.files[0]
+
+ main_path, main_name = os.path.split(main_file)
+
+ if job_file != main_file:
+ file_path = prefixPath(job.save_path, job_file, main_path)
+ else:
+ file_path = job.save_path + main_name
+
+ buf = self.rfile.read(length)
+
+ f = open(file_path, "wb")
+ f.write(buf)
+ f.close()
+ del buf
+
+ render_file.path = file_path # set the new path
+
+ if job.testStart():
+ self.send_head(headers=headers)
+ else:
+ self.send_head(http.client.ACCEPTED, headers=headers)
+ else: # invalid file
+ self.send_head(http.client.NO_CONTENT)
+ else: # job not found
+ self.send_head(http.client.NO_CONTENT)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "render":
+ print("writing result file")
+ self.server.stats("", "Receiving render result")
+
+ job_id = self.headers['job-id']
+
+ job = self.server.getJobByID(job_id)
+
+ if job:
+ job_frame = int(self.headers['job-frame'])
+ job_result = int(self.headers['job-result'])
+ job_time = float(self.headers['job-time'])
+
+ if job_result == DONE:
+ length = int(self.headers['content-length'])
+ buf = self.rfile.read(length)
+ f = open(job.save_path + "%04d" % job_frame + ".exr", 'wb')
+ f.write(buf)
+ f.close()
+
+ del buf
+
+ job = self.server.getJobByID(job_id)
+ frame = job[job_frame]
+ frame.status = job_result
+ frame.time = job_time
+
+ self.server.updateSlave(self.headers['slave-id'])
+
+ self.send_head()
+ else: # job not found
+ self.send_head(http.client.NO_CONTENT)
+ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ elif self.path == "log":
+ print("writing log file")
+ self.server.stats("", "Receiving log file")
+
+ job_id = self.headers['job-id']
+
+ job = self.server.getJobByID(job_id)
+
+ if job:
+ length = int(self.headers['content-length'])
+ job_frame = int(self.headers['job-frame'])
+
+ buf = self.rfile.read(length)
+ f = open(job.save_path + "%04d" % job_frame + ".log", 'wb')
+ f.write(buf)
+ f.close()
+
+ del buf
+
+ self.server.updateSlave(self.headers['slave-id'])
+
+ self.send_head()
+ else: # job not found
+ self.send_head(http.client.NO_CONTENT)
+
+class RenderMasterServer(http.server.HTTPServer):
+ def __init__(self, address, handler_class, path):
+ super().__init__(address, handler_class)
+ self.jobs = []
+ self.jobs_map = {}
+ self.slaves = []
+ self.slaves_map = {}
+ self.job_id = 0
+ self.path = path + "master_" + str(os.getpid()) + os.sep
+
+ if not os.path.exists(self.path):
+ os.mkdir(self.path)
+
+ def nextJobID(self):
+ self.job_id += 1
+ return str(self.job_id)
+
+ def addSlave(self, name, address, stats):
+ slave = MRenderSlave(name, address, stats)
+ self.slaves.append(slave)
+ self.slaves_map[slave.id] = slave
+
+ return slave.id
+
+ def getSlave(self, slave_id):
+ return self.slaves_map.get(slave_id, None)
+
+ def updateSlave(self, slave_id):
+ slave = self.getSlave(slave_id)
+ if slave:
+ slave.seen()
+
+ return slave
+
+ def clear(self):
+ self.jobs_map = {}
+ self.jobs = []
+
+ def update(self):
+ self.jobs.sort(key = groupKey)
+
+ def removeJob(self, id):
+ job = self.jobs_map.pop(id)
+
+ if job:
+ self.jobs.remove(job)
+
+ def addJob(self, job):
+ self.jobs.append(job)
+ self.jobs_map[job.id] = job
+
+ # create job directory
+ job.save_path = self.path + "job_" + job.id + os.sep
+ if not os.path.exists(job.save_path):
+ os.mkdir(job.save_path)
+
+ job.save()
+
+ def getJobByID(self, id):
+ return self.jobs_map.get(id, None)
+
+ def __iter__(self):
+ for job in self.jobs:
+ yield job
+
+ def getNewJob(self, slave_id):
+ if self.jobs:
+ for job in reversed(self.jobs):
+ if job.status == JOB_QUEUED and job.framesLeft() > 0 and slave_id not in job.blacklist:
+ return job, job.getFrames()
+
+ return None, None
diff --git a/release/io/netrender/model.py b/release/io/netrender/model.py
new file mode 100644
index 00000000000..8b919b1fa36
--- /dev/null
+++ b/release/io/netrender/model.py
@@ -0,0 +1,157 @@
+import sys, os
+import http, http.client, http.server, urllib
+import subprocess, shutil, time, hashlib
+
+from netrender.utils import *
+
+class RenderSlave:
+ _slave_map = {}
+
+ def __init__(self):
+ self.id = ""
+ self.name = ""
+ self.address = (0,0)
+ self.stats = ""
+ self.total_done = 0
+ self.total_error = 0
+ self.last_seen = 0.0
+
+ def serialize(self):
+ return {
+ "id": self.id,
+ "name": self.name,
+ "address": self.address,
+ "stats": self.stats,
+ "total_done": self.total_done,
+ "total_error": self.total_error,
+ "last_seen": self.last_seen
+ }
+
+ @staticmethod
+ def materialize(data):
+ if not data:
+ return None
+
+ slave_id = data["id"]
+
+ if slave_id in RenderSlave._slave_map:
+ return RenderSlave._slave_map[slave_id]
+ else:
+ slave = RenderSlave()
+ slave.id = slave_id
+ slave.name = data["name"]
+ slave.address = data["address"]
+ slave.stats = data["stats"]
+ slave.total_done = data["total_done"]
+ slave.total_error = data["total_error"]
+ slave.last_seen = data["last_seen"]
+
+ RenderSlave._slave_map[slave_id] = slave
+
+ return slave
+
+class RenderJob:
+ def __init__(self):
+ self.id = ""
+ self.name = ""
+ self.files = []
+ self.frames = []
+ self.chunks = 0
+ self.priority = 0
+ self.credits = 0
+ self.blacklist = []
+ self.last_dispatched = 0.0
+
+ def addFrame(self, frame_number):
+ frame = RenderFrame(frame_number)
+ self.frames.append(frame)
+ return frame
+
+ def __len__(self):
+ return len(self.frames)
+
+ def framesStatus(self):
+ results = {
+ QUEUED: 0,
+ DISPATCHED: 0,
+ DONE: 0,
+ ERROR: 0
+ }
+
+ for frame in self.frames:
+ results[frame.status] += 1
+
+ return results
+
+ def __contains__(self, frame_number):
+ for f in self.frames:
+ if f.number == frame_number:
+ return True
+ else:
+ return False
+
+ def __getitem__(self, frame_number):
+ for f in self.frames:
+ if f.number == frame_number:
+ return f
+ else:
+ return None
+
+ def serialize(self, frames = None):
+ return {
+ "id": self.id,
+ "name": self.name,
+ "files": self.files,
+ "frames": [f.serialize() for f in self.frames if not frames or f in frames],
+ "chunks": self.chunks,
+ "priority": self.priority,
+ "credits": self.credits,
+ "blacklist": self.blacklist,
+ "last_dispatched": self.last_dispatched
+ }
+
+ @staticmethod
+ def materialize(data):
+ if not data:
+ return None
+
+ job = RenderJob()
+ job.id = data["id"]
+ job.name = data["name"]
+ job.files = data["files"]
+ job.frames = [RenderFrame.materialize(f) for f in data["frames"]]
+ job.chunks = data["chunks"]
+ job.priority = data["priority"]
+ job.credits = data["credits"]
+ job.blacklist = data["blacklist"]
+ job.last_dispatched = data["last_dispatched"]
+
+ return job
+
+class RenderFrame:
+ def __init__(self, number = 0):
+ self.number = number
+ self.time = 0
+ self.status = QUEUED
+ self.slave = None
+
+ def serialize(self):
+ return {
+ "number": self.number,
+ "time": self.time,
+ "status": self.status,
+ "slave": None if not self.slave else self.slave.serialize()
+ }
+
+ @staticmethod
+ def materialize(data):
+ if not data:
+ return None
+
+ frame = RenderFrame()
+ frame.number = data["number"]
+ frame.time = data["time"]
+ frame.status = data["status"]
+ frame.slave = RenderSlave.materialize(data["slave"])
+
+ return frame
diff --git a/release/io/netrender/operators.py b/release/io/netrender/operators.py
new file mode 100644
index 00000000000..a1208aa1b46
--- /dev/null
+++ b/release/io/netrender/operators.py
@@ -0,0 +1,238 @@
+import bpy
+import sys, os
+import http, http.client, http.server, urllib
+
+from netrender.utils import *
+import netrender.model
+
+class RENDER_OT_netclientsend(bpy.types.Operator):
+ '''
+ Operator documentation text, will be used for the operator tooltip and python docs.
+ '''
+ __idname__ = "render.netclientsend"
+ __label__ = "Net Render Client Send"
+
+ # List of operator properties, the attributes will be assigned
+ # to the class instance from the operator settings before calling.
+
+ __props__ = []
+
+ def poll(self, context):
+ return True
+
+ def execute(self, context):
+ scene = context.scene
+
+ conn = clientConnection(scene)
+
+ if conn:
+ # Sending file
+ scene.network_render.job_id = clientSendJob(conn, scene, True)
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ return self.execute(context)
+
+class RENDER_OT_netclientstatus(bpy.types.Operator):
+ '''Operator documentation text, will be used for the operator tooltip and python docs.'''
+ __idname__ = "render.netclientstatus"
+ __label__ = "Net Render Client Status"
+
+ # List of operator properties, the attributes will be assigned
+ # to the class instance from the operator settings before calling.
+
+ __props__ = []
+
+ def poll(self, context):
+ return True
+
+ def execute(self, context):
+ netsettings = context.scene.network_render
+ conn = clientConnection(context.scene)
+
+ if conn:
+ conn.request("GET", "status")
+
+ response = conn.getresponse()
+ print( response.status, response.reason )
+
+ jobs = (netrender.model.RenderJob.materialize(j) for j in eval(str(response.read(), encoding='utf8')))
+
+ while(len(netsettings.jobs) > 0):
+ netsettings.jobs.remove(0)
+
+ for j in jobs:
+ netsettings.jobs.add()
+ job = netsettings.jobs[-1]
+
+ job_results = j.framesStatus()
+
+ job.id = j.id
+ job.name = j.name
+ job.length = len(j)
+ job.done = job_results[DONE]
+ job.error = job_results[ERROR]
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ return self.execute(context)
+
+class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
+ '''Operator documentation text, will be used for the operator tooltip and python docs.'''
+ __idname__ = "render.netclientblacklistslave"
+ __label__ = "Net Render Client Blacklist Slave"
+
+ # List of operator properties, the attributes will be assigned
+ # to the class instance from the operator settings before calling.
+
+ __props__ = []
+
+ def poll(self, context):
+ return True
+
+ def execute(self, context):
+ netsettings = context.scene.network_render
+
+ if netsettings.active_slave_index >= 0:
+
+ slave = netrender.slaves[netsettings.active_slave_index]
+
+ netsettings.slaves_blacklist.add()
+
+ netsettings.slaves_blacklist[-1].id = slave.id
+ netsettings.slaves_blacklist[-1].name = slave.name
+ netsettings.slaves_blacklist[-1].address = slave.address
+ netsettings.slaves_blacklist[-1].last_seen = slave.last_seen
+ netsettings.slaves_blacklist[-1].stats = slave.stats
+
+ netsettings.slaves.remove(netsettings.active_slave_index)
+ netsettings.active_slave_index = -1
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ return self.execute(context)
+
+class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
+ '''Operator documentation text, will be used for the operator tooltip and python docs.'''
+ __idname__ = "render.netclientwhitelistslave"
+ __label__ = "Net Render Client Whitelist Slave"
+
+ # List of operator properties, the attributes will be assigned
+ # to the class instance from the operator settings before calling.
+
+ __props__ = []
+
+ def poll(self, context):
+ return True
+
+ def execute(self, context):
+ netsettings = context.scene.network_render
+
+ if netsettings.active_blacklisted_slave_index >= 0:
+
+ slave = netsettings.slaves_blacklist[netsettings.active_blacklisted_slave_index]
+
+ netsettings.slaves.add()
+
+ netsettings.slaves[-1].id = slave.id
+ netsettings.slaves[-1].name = slave.name
+ netsettings.slaves[-1].address = slave.address
+ netsettings.slaves[-1].last_seen = slave.last_seen
+ netsettings.slaves[-1].stats = slave.stats
+
+ netsettings.slaves_blacklist.remove(netsettings.active_blacklisted_slave_index)
+ netsettings.active_blacklisted_slave_index = -1
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ return self.execute(context)
+
+
+class RENDER_OT_netclientslaves(bpy.types.Operator):
+ '''Operator documentation text, will be used for the operator tooltip and python docs.'''
+ __idname__ = "render.netclientslaves"
+ __label__ = "Net Render Client Slaves"
+
+ # List of operator properties, the attributes will be assigned
+ # to the class instance from the operator settings before calling.
+
+ __props__ = []
+
+ def poll(self, context):
+ return True
+
+ def execute(self, context):
+ netsettings = context.scene.network_render
+ conn = clientConnection(context.scene)
+
+ if conn:
+ conn.request("GET", "slave")
+
+ response = conn.getresponse()
+ print( response.status, response.reason )
+
+ slaves = (netrender.model.RenderSlave.materialize(s) for s in eval(str(response.read(), encoding='utf8')))
+
+ while(len(netsettings.slaves) > 0):
+ netsettings.slaves.remove(0)
+
+ for s in slaves:
+ for slave in netsettings.slaves_blacklist:
+ if slave.id == s.id:
+ break
+
+ netsettings.slaves.add()
+ slave = netsettings.slaves[-1]
+
+ slave.id = s.id
+ slave.name = s.name
+ slave.stats = s.stats
+ slave.address = s.address[0]
+ slave.last_seen = time.ctime(s.last_seen)
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ return self.execute(context)
+
+class RENDER_OT_netclientcancel(bpy.types.Operator):
+ '''Operator documentation text, will be used for the operator tooltip and python docs.'''
+ __idname__ = "render.netclientcancel"
+ __label__ = "Net Render Client Cancel"
+
+ # List of operator properties, the attributes will be assigned
+ # to the class instance from the operator settings before calling.
+
+ __props__ = []
+
+ def poll(self, context):
+ netsettings = context.scene.network_render
+ return netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0
+
+ def execute(self, context):
+ netsettings = context.scene.network_render
+ conn = clientConnection(context.scene)
+
+ if conn:
+ job = netsettings.jobs[netsettings.active_job_index]
+
+ conn.request("POST", "cancel", headers={"job-id":job.id})
+
+ response = conn.getresponse()
+ print( response.status, response.reason )
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ return self.execute(context)
+
+bpy.ops.add(RENDER_OT_netclientsend)
+bpy.ops.add(RENDER_OT_netclientstatus)
+bpy.ops.add(RENDER_OT_netclientslaves)
+bpy.ops.add(RENDER_OT_netclientblacklistslave)
+bpy.ops.add(RENDER_OT_netclientwhitelistslave)
+bpy.ops.add(RENDER_OT_netclientcancel) \ No newline at end of file
diff --git a/release/io/netrender/slave.py b/release/io/netrender/slave.py
new file mode 100644
index 00000000000..3d7153a0c54
--- /dev/null
+++ b/release/io/netrender/slave.py
@@ -0,0 +1,162 @@
+import sys, os
+import http, http.client, http.server, urllib
+import subprocess, time
+
+from netrender.utils import *
+import netrender.model
+
+CANCEL_POLL_SPEED = 2
+MAX_TIMEOUT = 10
+INCREMENT_TIMEOUT = 1
+
+def slave_Info():
+ sysname, nodename, release, version, machine = os.uname()
+ slave = netrender.model.RenderSlave()
+ slave.name = nodename
+ slave.stats = sysname + " " + release + " " + machine
+ return slave
+
+def testCancel(conn, job_id):
+ conn.request("HEAD", "status", headers={"job-id":job_id})
+ response = conn.getresponse()
+
+ # cancelled if job isn't found anymore
+ if response.status == http.client.NO_CONTENT:
+ return True
+ else:
+ return False
+
+def testFile(conn, JOB_PREFIX, file_path, main_path = None):
+ job_full_path = prefixPath(JOB_PREFIX, file_path, main_path)
+
+ if not os.path.exists(job_full_path):
+ conn.request("GET", "file", headers={"job-id": job.id, "slave-id":slave_id, "job-file":file_path})
+ response = conn.getresponse()
+
+ if response.status != http.client.OK:
+ return None # file for job not returned by server, need to return an error code to server
+
+ f = open(job_full_path, "wb")
+ buf = response.read(1024)
+
+ while buf:
+ f.write(buf)
+ buf = response.read(1024)
+
+ f.close()
+
+ return job_full_path
+
+
+def render_slave(engine, scene):
+ netsettings = scene.network_render
+ timeout = 1
+
+ engine.update_stats("", "Network render node initiation")
+
+ conn = clientConnection(scene)
+
+ if conn:
+ conn.request("POST", "slave", repr(slave_Info().serialize()))
+ response = conn.getresponse()
+
+ slave_id = response.getheader("slave-id")
+
+ NODE_PREFIX = netsettings.path + "slave_" + slave_id + os.sep
+ if not os.path.exists(NODE_PREFIX):
+ os.mkdir(NODE_PREFIX)
+
+ while not engine.test_break():
+
+ conn.request("GET", "job", headers={"slave-id":slave_id})
+ response = conn.getresponse()
+
+ if response.status == http.client.OK:
+ timeout = 1 # reset timeout on new job
+
+ job = netrender.model.RenderJob.materialize(eval(str(response.read(), encoding='utf8')))
+
+ JOB_PREFIX = NODE_PREFIX + "job_" + job.id + os.sep
+ if not os.path.exists(JOB_PREFIX):
+ os.mkdir(JOB_PREFIX)
+
+ job_path = job.files[0]
+ main_path, main_file = os.path.split(job_path)
+
+ job_full_path = testFile(conn, JOB_PREFIX, job_path)
+ print("Fullpath", job_full_path)
+ print("File:", main_file, "and %i other files" % (len(job.files) - 1,))
+ engine.update_stats("", "Render File", main_file, "for job", job.id)
+
+ for file_path in job.files[1:]:
+ testFile(conn, JOB_PREFIX, file_path, main_path)
+
+ frame_args = []
+
+ for frame in job.frames:
+ print("frame", frame.number)
+ frame_args += ["-f", str(frame.number)]
+
+ start_t = time.time()
+
+ process = subprocess.Popen([sys.argv[0], "-b", job_full_path, "-o", JOB_PREFIX + "######", "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+ cancelled = False
+ stdout = bytes()
+ run_t = time.time()
+ while process.poll() == None and not cancelled:
+ stdout += process.stdout.read(32)
+ current_t = time.time()
+ cancelled = engine.test_break()
+ if current_t - run_t > CANCEL_POLL_SPEED:
+ if testCancel(conn, job.id):
+ cancelled = True
+ else:
+ run_t = current_t
+
+ if cancelled:
+ continue # to next frame
+
+ total_t = time.time() - start_t
+
+ avg_t = total_t / len(job.frames)
+
+ status = process.returncode
+
+ print("status", status)
+
+ headers = {"job-id":job.id, "slave-id":slave_id, "job-time":str(avg_t)}
+
+ if status == 0: # non zero status is error
+ headers["job-result"] = str(DONE)
+ for frame in job.frames:
+ headers["job-frame"] = str(frame.number)
+ # send result back to server
+ f = open(JOB_PREFIX + "%06d" % frame.number + ".exr", 'rb')
+ conn.request("PUT", "render", f, headers=headers)
+ f.close()
+ response = conn.getresponse()
+ else:
+ headers["job-result"] = str(ERROR)
+ for frame in job.frames:
+ headers["job-frame"] = str(frame.number)
+ # send error result back to server
+ conn.request("PUT", "render", headers=headers)
+ response = conn.getresponse()
+
+ for frame in job.frames:
+ headers["job-frame"] = str(frame.number)
+ # send log in any case
+ conn.request("PUT", "log", stdout, headers=headers)
+ response = conn.getresponse()
+ else:
+ if timeout < MAX_TIMEOUT:
+ timeout += INCREMENT_TIMEOUT
+
+ for i in range(timeout):
+ time.sleep(1)
+ if engine.test_break():
+ conn.close()
+ return
+
+ conn.close()
diff --git a/release/io/netrender/ui.py b/release/io/netrender/ui.py
new file mode 100644
index 00000000000..f8179fedbda
--- /dev/null
+++ b/release/io/netrender/ui.py
@@ -0,0 +1,317 @@
+import bpy
+import sys, os
+import http, http.client, http.server, urllib
+import subprocess, shutil, time, hashlib
+
+import netrender.slave as slave
+import netrender.master as master
+
+VERSION = b"0.3"
+
+PATH_PREFIX = "/tmp/"
+
+QUEUED = 0
+DISPATCHED = 1
+DONE = 2
+ERROR = 3
+
+class RenderButtonsPanel(bpy.types.Panel):
+ __space_type__ = "PROPERTIES"
+ __region_type__ = "WINDOW"
+ __context__ = "scene"
+ # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
+ def poll(self, context):
+ rd = context.scene.render_data
+ return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
+
+# Setting panel, use in the scene for now.
+class SCENE_PT_network_settings(RenderButtonsPanel):
+ __label__ = "Network Settings"
+ COMPAT_ENGINES = set(['NET_RENDER'])
+
+ def draw_header(self, context):
+ layout = self.layout
+ scene = context.scene
+
+ def draw(self, context):
+ layout = self.layout
+ scene = context.scene
+ rd = scene.render_data
+
+ layout.active = True
+
+ split = layout.split()
+
+ col = split.column()
+
+ col.itemR(scene.network_render, "mode")
+ col.itemR(scene.network_render, "server_address")
+ col.itemR(scene.network_render, "server_port")
+ col.itemR(scene.network_render, "path")
+
+ if scene.network_render.mode == "RENDER_CLIENT":
+ col.itemR(scene.network_render, "chunks")
+ col.itemR(scene.network_render, "priority")
+ col.itemR(scene.network_render, "job_name")
+ col.itemO("render.netclientsend", text="send job to server")
+bpy.types.register(SCENE_PT_network_settings)
+
+class SCENE_PT_network_slaves(RenderButtonsPanel):
+ __label__ = "Slaves Status"
+ COMPAT_ENGINES = set(['NET_RENDER'])
+
+ def poll(self, context):
+ scene = context.scene
+ return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT"
+
+ def draw(self, context):
+ layout = self.layout
+
+ scene = context.scene
+ netrender = scene.network_render
+
+ row = layout.row()
+ row.template_list(netrender, "slaves", netrender, "active_slave_index", rows=2)
+
+ col = row.column()
+
+ subcol = col.column(align=True)
+ subcol.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
+ subcol.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
+
+ if netrender.active_slave_index >= 0 and len(netrender.slaves) > 0:
+ layout.itemS()
+
+ slave = netrender.slaves[netrender.active_slave_index]
+
+ layout.itemL(text="Name: " + slave.name)
+ layout.itemL(text="Address: " + slave.address)
+ layout.itemL(text="Seen: " + slave.last_seen)
+ layout.itemL(text="Stats: " + slave.stats)
+
+bpy.types.register(SCENE_PT_network_slaves)
+
+class SCENE_PT_network_slaves_blacklist(RenderButtonsPanel):
+ __label__ = "Slaves Blacklist"
+ COMPAT_ENGINES = set(['NET_RENDER'])
+
+ def poll(self, context):
+ scene = context.scene
+ return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT"
+
+ def draw(self, context):
+ layout = self.layout
+
+ scene = context.scene
+ netrender = scene.network_render
+
+ row = layout.row()
+ row.template_list(netrender, "slaves_blacklist", netrender, "active_blacklisted_slave_index", rows=2)
+
+ col = row.column()
+
+ subcol = col.column(align=True)
+ subcol.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
+
+
+ if netrender.active_blacklisted_slave_index >= 0 and len(netrender.slaves_blacklist) > 0:
+ layout.itemS()
+
+ slave = netrender.slaves_blacklist[netrender.active_blacklisted_slave_index]
+
+ layout.itemL(text="Name: " + slave.name)
+ layout.itemL(text="Address: " + slave.address)
+ layout.itemL(text="Seen: " + slave.last_seen)
+ layout.itemL(text="Stats: " + slave.stats)
+
+bpy.types.register(SCENE_PT_network_slaves_blacklist)
+
+class SCENE_PT_network_jobs(RenderButtonsPanel):
+ __label__ = "Jobs"
+ COMPAT_ENGINES = set(['NET_RENDER'])
+
+ def poll(self, context):
+ scene = context.scene
+ return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT"
+
+ def draw(self, context):
+ layout = self.layout
+
+ scene = context.scene
+ netrender = scene.network_render
+
+ row = layout.row()
+ row.template_list(netrender, "jobs", netrender, "active_job_index", rows=2)
+
+ col = row.column()
+
+ subcol = col.column(align=True)
+ subcol.itemO("render.netclientstatus", icon="ICON_FILE_REFRESH", text="")
+ subcol.itemO("render.netclientcancel", icon="ICON_ZOOMOUT", text="")
+
+
+ if netrender.active_job_index >= 0 and len(netrender.jobs) > 0:
+ layout.itemS()
+
+ job = netrender.jobs[netrender.active_job_index]
+
+ layout.itemL(text="Name: %s" % job.name)
+ layout.itemL(text="Length: %04i" % job.length)
+ layout.itemL(text="Done: %04i" % job.done)
+ layout.itemL(text="Error: %04i" % job.error)
+
+bpy.types.register(SCENE_PT_network_jobs)
+
+class NetRenderSettings(bpy.types.IDPropertyGroup):
+ pass
+
+class NetRenderSlave(bpy.types.IDPropertyGroup):
+ pass
+
+class NetRenderJob(bpy.types.IDPropertyGroup):
+ pass
+
+bpy.types.register(NetRenderSettings)
+bpy.types.register(NetRenderSlave)
+bpy.types.register(NetRenderJob)
+
+bpy.types.Scene.PointerProperty(attr="network_render", type=NetRenderSettings, name="Network Render", description="Network Render Settings")
+
+NetRenderSettings.StringProperty( attr="server_address",
+ name="Server address",
+ description="IP or name of the master render server",
+ maxlen = 128,
+ default = "127.0.0.1")
+
+NetRenderSettings.IntProperty( attr="server_port",
+ name="Server port",
+ description="port of the master render server",
+ default = 8000,
+ min=1,
+ max=65535)
+
+NetRenderSettings.StringProperty( attr="path",
+ name="Path",
+ description="Path for temporary files",
+ maxlen = 128,
+ default = "/tmp/")
+
+NetRenderSettings.StringProperty( attr="job_name",
+ name="Job name",
+ description="Name of the job",
+ maxlen = 128,
+ default = "[default]")
+
+NetRenderSettings.IntProperty( attr="chunks",
+ name="Chunks",
+ description="Number of frame to dispatch to each slave in one chunk",
+ default = 5,
+ min=1,
+ max=65535)
+
+NetRenderSettings.IntProperty( attr="priority",
+ name="Priority",
+ description="Priority of the job",
+ default = 1,
+ min=1,
+ max=10)
+
+NetRenderSettings.StringProperty( attr="job_id",
+ name="Network job id",
+ description="id of the last sent render job",
+ maxlen = 64,
+ default = "")
+
+NetRenderSettings.IntProperty( attr="active_slave_index",
+ name="Index of the active slave",
+ description="",
+ default = -1,
+ min= -1,
+ max=65535)
+
+NetRenderSettings.IntProperty( attr="active_blacklisted_slave_index",
+ name="Index of the active slave",
+ description="",
+ default = -1,
+ min= -1,
+ max=65535)
+
+NetRenderSettings.IntProperty( attr="active_job_index",
+ name="Index of the active job",
+ description="",
+ default = -1,
+ min= -1,
+ max=65535)
+
+NetRenderSettings.EnumProperty(attr="mode",
+ items=(
+ ("RENDER_CLIENT", "Client", "Act as render client"),
+ ("RENDER_MASTER", "Master", "Act as render master"),
+ ("RENDER_SLAVE", "Slave", "Act as render slave"),
+ ),
+ name="network mode",
+ description="mode of operation of this instance",
+ default="RENDER_CLIENT")
+
+NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="")
+NetRenderSettings.CollectionProperty(attr="slaves_blacklist", type=NetRenderSlave, name="Slaves Blacklist", description="")
+NetRenderSettings.CollectionProperty(attr="jobs", type=NetRenderJob, name="Job List", description="")
+
+NetRenderSlave.StringProperty( attr="name",
+ name="Name of the slave",
+ description="",
+ maxlen = 64,
+ default = "")
+
+NetRenderSlave.StringProperty( attr="address",
+ name="Address of the slave",
+ description="",
+ maxlen = 64,
+ default = "")
+
+NetRenderSlave.StringProperty( attr="last_seen",
+ name="Last time slave was seen by server",
+ description="",
+ maxlen = 64,
+ default = "")
+
+NetRenderSlave.StringProperty( attr="stats",
+ name="Hardware stats of the slave",
+ description="",
+ maxlen = 128,
+ default = "")
+
+NetRenderJob.StringProperty( attr="id",
+ name="ID of the job",
+ description="",
+ maxlen = 64,
+ default = "")
+
+
+NetRenderJob.StringProperty( attr="name",
+ name="Name of the job",
+ description="",
+ maxlen = 128,
+ default = "")
+
+NetRenderJob.IntProperty( attr="length",
+ name="Number of frames",
+ description="",
+ default = 0,
+ min= 0,
+ max=65535)
+
+NetRenderJob.IntProperty( attr="done",
+ name="Number of frames rendered",
+ description="",
+ default = 0,
+ min= 0,
+ max=65535)
+
+NetRenderJob.IntProperty( attr="error",
+ name="Number of frames in error",
+ description="",
+ default = 0,
+ min= 0,
+ max=65535)
diff --git a/release/io/netrender/utils.py b/release/io/netrender/utils.py
new file mode 100644
index 00000000000..62571011bc1
--- /dev/null
+++ b/release/io/netrender/utils.py
@@ -0,0 +1,134 @@
+import bpy
+import sys, os
+import re
+import http, http.client, http.server, urllib
+import subprocess, shutil, time, hashlib
+
+import netrender.model
+
+VERSION = b"0.3"
+
+QUEUED = 0
+DISPATCHED = 1
+DONE = 2
+ERROR = 3
+
+def clientConnection(scene):
+ netrender = scene.network_render
+
+ conn = http.client.HTTPConnection(netrender.server_address, netrender.server_port)
+
+ if clientVerifyVersion(conn):
+ return conn
+ else:
+ conn.close()
+ return None
+
+def clientVerifyVersion(conn):
+ conn.request("GET", "version")
+ response = conn.getresponse()
+
+ if response.status != http.client.OK:
+ conn.close()
+ return False
+
+ server_version = response.read()
+
+ if server_version != VERSION:
+ print("Incorrect server version!")
+ print("expected", VERSION, "received", server_version)
+ return False
+
+ return True
+
+def clientSendJob(conn, scene, anim = False, chunks = 5):
+ netsettings = scene.network_render
+ job = netrender.model.RenderJob()
+
+ if anim:
+ for f in range(scene.start_frame, scene.end_frame + 1):
+ job.addFrame(f)
+ else:
+ job.addFrame(scene.current_frame)
+
+ filename = bpy.data.filename
+ job.files.append(filename)
+
+ job_name = netsettings.job_name
+ path, name = os.path.split(filename)
+ if job_name == "[default]":
+ job_name = name
+
+ for lib in bpy.data.libraries:
+ lib_path = lib.filename
+
+ if lib_path.startswith("//"):
+ lib_path = path + os.sep + lib_path[2:]
+
+ job.files.append(lib_path)
+
+ root, ext = os.path.splitext(name)
+ cache_path = path + os.sep + "blendcache_" + root + os.sep # need an API call for that
+
+ print("cache:", cache_path)
+
+ if os.path.exists(cache_path):
+ pattern = re.compile("[a-zA-Z0-9]+_([0-9]+)_[0-9]+\.bphys")
+ for cache_name in sorted(os.listdir(cache_path)):
+ match = pattern.match(cache_name)
+
+ if match:
+ print("Frame:", int(match.groups()[0]), cache_name)
+
+ job.files.append(cache_path + cache_name)
+
+ #print(job.files)
+
+ job.name = job_name
+
+ for slave in scene.network_render.slaves_blacklist:
+ job.blacklist.append(slave.id)
+
+ job.chunks = netsettings.chunks
+ job.priority = netsettings.priority
+
+ # try to send path first
+ conn.request("POST", "job", repr(job.serialize()))
+ response = conn.getresponse()
+
+ job_id = response.getheader("job-id")
+
+ # if not ACCEPTED (but not processed), send files
+ if response.status == http.client.ACCEPTED:
+ for filepath in job.files:
+ f = open(filepath, "rb")
+ conn.request("PUT", "file", f, headers={"job-id": job_id, "job-file": filepath})
+ f.close()
+ response = conn.getresponse()
+
+ # server will reply with NOT_FOUD until all files are found
+
+ return job_id
+
+def clientRequestResult(conn, scene, job_id):
+ conn.request("GET", "render", headers={"job-id": job_id, "job-frame":str(scene.current_frame)})
+
+
+def prefixPath(prefix_directory, file_path, prefix_path):
+ if os.path.isabs(file_path):
+ # if an absolute path, make sure path exists, if it doesn't, use relative local path
+ full_path = file_path
+ if not os.path.exists(full_path):
+ p, n = os.path.split(full_path)
+
+ if main_path and p.startswith(main_path):
+ directory = prefix_directory + p[len(main_path):]
+ full_path = directory + n
+ if not os.path.exists(directory):
+ os.mkdir(directory)
+ else:
+ full_path = prefix_directory + n
+ else:
+ full_path = prefix_directory + file_path
+
+ return full_path \ No newline at end of file
diff --git a/release/scripts/export_map.py b/release/scripts/export_map.py
index ab32f6d5ff5..2262ae3b89b 100644
--- a/release/scripts/export_map.py
+++ b/release/scripts/export_map.py
@@ -197,7 +197,7 @@ def is_tricyl_facegroup(faces):
is the face group a tri cylinder
Returens a bool, true if the faces make an extruded tri solid
'''
- return False
+
# cube must have 5 faces
if len(faces) != 5:
print '1'
@@ -249,6 +249,10 @@ def write_node_map(file, ob):
file.write('{\n')
for name_value in props:
file.write('"%s" "%s"\n' % name_value)
+ if PREF_GRID_SNAP.val:
+ file.write('"origin" "%d %d %d"\n' % tuple([round(axis*PREF_SCALE.val) for axis in ob.getLocation('worldspace')]) )
+ else:
+ file.write('"origin" "%.6f %.6f %.6f"\n' % tuple([axis*PREF_SCALE.val for axis in ob.getLocation('worldspace')]) )
file.write('}\n')
return True
@@ -447,4 +451,4 @@ def main():
Window.FileSelector(export_map, 'EXPORT MAP', '*.map')
if __name__ == '__main__': main()
-# export_map('/foo.map') \ No newline at end of file
+# export_map('/foo.map')
diff --git a/release/scripts/help_getting_started.py b/release/scripts/help_getting_started.py
deleted file mode 100644
index 77dda2cf88f..00000000000
--- a/release/scripts/help_getting_started.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!BPY
-"""
-Name: 'Getting Started'
-Blender: 248
-Group: 'Help'
-Tooltip: 'Help for new users'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org's
-"Getting Started" page.
-"""
-
-# $Id$
-#
-# --------------------------------------------------------------------------
-# Getting Started Help Menu Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://www.blender.org/education-help/tutorials/getting-started/')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
-
-
diff --git a/release/scripts/help_manual.py b/release/scripts/help_manual.py
deleted file mode 100644
index 27900040eb4..00000000000
--- a/release/scripts/help_manual.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!BPY
-"""
-Name: 'Manual'
-Blender: 248
-Group: 'Help'
-Tooltip: 'The Blender Wiki manual'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org's
-"Manual" page.
-"""
-
-# --------------------------------------------------------------------------
-# Manual Help Menu Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://wiki.blender.org/index.php/Manual')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
-
-
diff --git a/release/scripts/help_release_notes.py b/release/scripts/help_release_notes.py
deleted file mode 100644
index 870f2391487..00000000000
--- a/release/scripts/help_release_notes.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!BPY
-"""
-Name: 'Release Logs'
-Blender: 248
-Group: 'Help'
-Tooltip: 'Information about the changes in this version of Blender'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org's
-"Release Logs" page.
-"""
-
-# --------------------------------------------------------------------------
-# Release Notes Help Menu Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://www.blender.org/development/release-logs/')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
-
diff --git a/release/scripts/help_tutorials.py b/release/scripts/help_tutorials.py
deleted file mode 100644
index e0cef1abdbf..00000000000
--- a/release/scripts/help_tutorials.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!BPY
-
-"""
-Name: 'Tutorials'
-Blender: 248
-Group: 'Help'
-Tooltip: 'Tutorials for learning to use Blender'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org's
-"Tutorials" page.
-"""
-
-# --------------------------------------------------------------------------
-# Tutorials Help Menu Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://www.blender.org/education-help/tutorials/')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_blender.py b/release/scripts/help_web_blender.py
deleted file mode 100644
index 2a0f90844ae..00000000000
--- a/release/scripts/help_web_blender.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!BPY
-
-"""
-Name: 'Blender Website'
-Blender: 248
-Group: 'HelpWebsites'
-Tooltip: 'The official Blender website'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at Blender's main site,
-www.blender.org.
-"""
-
-
-# --------------------------------------------------------------------------
-# Blender Website Help Menu -> Websites Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://www.blender.org/')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_devcomm.py b/release/scripts/help_web_devcomm.py
deleted file mode 100644
index 46fa2487a89..00000000000
--- a/release/scripts/help_web_devcomm.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!BPY
-
-"""
-Name: 'Developer Community'
-Blender: 248
-Group: 'HelpWebsites'
-Tooltip: 'Get involved with Blender development'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org's
-"Get Involved" page.
-"""
-
-# --------------------------------------------------------------------------
-# Blender Website Help Menu -> Websites Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://www.blender.org/community/get-involved/')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_eshop.py b/release/scripts/help_web_eshop.py
deleted file mode 100644
index e40795b3a0d..00000000000
--- a/release/scripts/help_web_eshop.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!BPY
-
-"""
-Name: 'Blender E-Shop'
-Blender: 248
-Group: 'HelpWebsites'
-Tooltip: 'Buy official Blender resources and merchandise online'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org's
-"E-Shop" section.
-"""
-
-# --------------------------------------------------------------------------
-# Blender Website Help Menu -> Websites Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://www.blender3d.org/e-shop')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/help_web_usercomm.py b/release/scripts/help_web_usercomm.py
deleted file mode 100644
index dda5e42f34e..00000000000
--- a/release/scripts/help_web_usercomm.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!BPY
-
-"""
-Name: 'User Community'
-Blender: 248
-Group: 'HelpWebsites'
-Tooltip: 'Get involved with other Blender users'
-"""
-
-__author__ = "Matt Ebb"
-__url__ = ("blender", "blenderartists.org")
-__version__ = "1.0.1"
-__bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org's
-"User Community" page.
-"""
-
-# --------------------------------------------------------------------------
-# Blender Website Help Menu -> Websites Item
-# --------------------------------------------------------------------------
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# ***** END GPL LICENCE BLOCK *****
-# --------------------------------------------------------------------------
-
-import Blender
-try: import webbrowser
-except: webbrowser = None
-
-if webbrowser:
- webbrowser.open('http://www.blender.org/community/user-community/')
-else:
- Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
diff --git a/release/scripts/import_edl.py b/release/scripts/import_edl.py
new file mode 100644
index 00000000000..8c5d041b34c
--- /dev/null
+++ b/release/scripts/import_edl.py
@@ -0,0 +1,961 @@
+#!BPY
+
+"""
+Name: 'Video Sequence (.edl)...'
+Blender: 248
+Group: 'Import'
+Tooltip: 'Load a CMX formatted EDL into the sequencer'
+"""
+
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# Copyright (C) 2009: Campbell Barton, ideasman42@gmail.com
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# --------------------------------------------------------------------------
+
+class TimeCode(object):
+ '''
+ Simple timecode class
+ also supports conversion from other time strings used by EDL
+ '''
+ def __init__(self, data, fps):
+ self.fps= fps
+ if type(data)==str:
+ self.fromString(data)
+ frame = self.asFrame()
+ self.fromFrame(frame)
+ else:
+ self.fromFrame(data)
+
+ def fromString(self, text):
+ # hh:mm:ss:ff
+ # No dropframe support yet
+
+ if text.lower().endswith('mps'): # 5.2mps
+ return self.fromFrame( int( float(text[:-3]) * self.fps ) )
+ elif text.lower().endswith('s'): # 5.2s
+ return self.fromFrame( int( float(text[:-1]) * self.fps ) )
+ elif text.isdigit(): # 1234
+ return self.fromFrame( int(text) )
+ elif ':' in text: # hh:mm:ss:ff
+ text= text.replace(';', ':').replace(',', ':').replace('.', ':')
+ text= text.split(':')
+
+ self.hours= int(text[0])
+ self.minutes= int(text[1])
+ self.seconds= int(text[2])
+ self.frame= int(text[3])
+ return self
+ else:
+ print 'ERROR: could not convert this into timecode "%s"' % test
+ return self
+
+
+ def fromFrame(self, frame):
+
+ if frame < 0:
+ frame = -frame;
+ neg=True
+ else:
+ neg=False
+
+ fpm = 60 * self.fps
+ fph = 60 * fpm
+
+ if frame < fph:
+ self.hours= 0
+ else:
+ self.hours= int(frame/fph)
+ frame = frame % fph
+
+ if frame < fpm:
+ self.minutes= 0
+ else:
+ self.minutes= int(frame/fpm)
+ frame = frame % fpm
+
+ if frame < self.fps:
+ self.seconds= 0
+ else:
+ self.seconds= int(frame/self.fps)
+ frame = frame % self.fps
+
+ self.frame= frame
+
+ if neg:
+ self.frame = -self.frame
+ self.seconds = -self.seconds
+ self.minutes = -self.minutes
+ self.hours = -self.hours
+
+ return self
+
+ def asFrame(self):
+ abs_frame= self.frame
+ abs_frame += self.seconds * self.fps
+ abs_frame += self.minutes * 60 * self.fps
+ abs_frame += self.hours * 60 * 60 * self.fps
+
+ return abs_frame
+
+ def asString(self):
+ self.fromFrame(int(self))
+ return '%.2d:%.2d:%.2d:%.2d' % (self.hours, self.minutes, self.seconds, self.frame)
+
+ def __repr__(self):
+ return self.asString()
+
+ # Numeric stuff, may as well have this
+ def __neg__(self): return TimeCode(-int(self), self.fps)
+ def __int__(self): return self.asFrame()
+ def __sub__(self, other): return TimeCode(int(self)-int(other), self.fps)
+ def __add__(self, other): return TimeCode(int(self)+int(other), self.fps)
+ def __mul__(self, other): return TimeCode(int(self)*int(other), self.fps)
+ def __div__(self, other): return TimeCode(int(self)/int(other), self.fps)
+ def __abs__(self): return TimeCode(abs(int(self)), self.fps)
+ def __iadd__(self, other): return self.fromFrame(int(self)+int(other))
+ def __imul__(self, other): return self.fromFrame(int(self)*int(other))
+ def __idiv__(self, other): return self.fromFrame(int(self)/int(other))
+# end timecode
+
+
+'''Comments
+Comments can appear at the beginning of the EDL file (header) or between the edit lines in the EDL. The first block of comments in the file is defined to be the header comments and they are associated with the EDL as a whole. Subsequent comments in the EDL file are associated with the first edit line that appears after them.
+Edit Entries
+<filename|tag> <EditMode> <TransitionType>[num] [duration] [srcIn] [srcOut] [recIn] [recOut]
+
+ * <filename|tag>: Filename or tag value. Filename can be for an MPEG file, Image file, or Image file template. Image file templates use the same pattern matching as for command line glob, and can be used to specify images to encode into MPEG. i.e. /usr/data/images/image*.jpg
+ * <EditMode>: 'V' | 'A' | 'VA' | 'B' | 'v' | 'a' | 'va' | 'b' which equals Video, Audio, Video_Audio edits (note B or b can be used in place of VA or va).
+ * <TransitonType>: 'C' | 'D' | 'E' | 'FI' | 'FO' | 'W' | 'c' | 'd' | 'e' | 'fi' | 'fo' | 'w'. which equals Cut, Dissolve, Effect, FadeIn, FadeOut, Wipe.
+ * [num]: if TransitionType = Wipe, then a wipe number must be given. At the moment only wipe 'W0' and 'W1' are supported.
+ * [duration]: if the TransitionType is not equal to Cut, then an effect duration must be given. Duration is in frames.
+ * [srcIn]: Src in. If no srcIn is given, then it defaults to the first frame of the video or the first frame in the image pattern. If srcIn isn't specified, then srcOut, recIn, recOut can't be specified.
+ * [srcOut]: Src out. If no srcOut is given, then it defaults to the last frame of the video - or last image in the image pattern. if srcOut isn't given, then recIn and recOut can't be specified.
+ * [recIn]: Rec in. If no recIn is given, then it is calculated based on its position in the EDL and the length of its input.
+ [recOut]: Rec out. If no recOut is given, then it is calculated based on its position in the EDL and the length of its input. first frame of the video.
+
+For srcIn, srcOut, recIn, recOut, the values can be specified as either timecode, frame number, seconds, or mps seconds. i.e.
+[tcode | fnum | sec | mps], where:
+
+ * tcode : SMPTE timecode in hh:mm:ss:ff
+ * fnum : frame number (the first decodable frame in the video is taken to be frame 0).
+ * sec : seconds with 's' suffix (e.g. 5.2s)
+ * mps : seconds with 'mps' suffix (e.g. 5.2mps). This corresponds to the 'seconds' value displayed by Windows MediaPlayer.
+
+More notes,
+Key
+
+'''
+
+enum= 0
+TRANSITION_UNKNOWN= enum
+TRANSITION_CUT= enum; enum+=1
+TRANSITION_DISSOLVE= enum; enum+=1
+TRANSITION_EFFECT= enum; enum+=1
+TRANSITION_FADEIN= enum; enum+=1
+TRANSITION_FADEOUT= enum; enum+=1
+TRANSITION_WIPE= enum; enum+=1
+TRANSITION_KEY= enum; enum+=1
+
+TRANSITION_DICT={ \
+ 'c':TRANSITION_CUT,
+ 'd':TRANSITION_DISSOLVE,
+ 'e':TRANSITION_EFFECT,
+ 'fi':TRANSITION_FADEIN,
+ 'fo':TRANSITION_FADEOUT,
+ 'w':TRANSITION_WIPE,
+ 'k':TRANSITION_KEY,
+ }
+
+enum= 0
+EDIT_UNKNOWN= 1<<enum; enum+=1
+EDIT_VIDEO= 1<<enum; enum+=1
+EDIT_AUDIO= 1<<enum; enum+=1
+EDIT_AUDIO_STEREO= 1<<enum; enum+=1
+EDIT_VIDEO_AUDIO= 1<<enum; enum+=1
+
+EDIT_DICT= { \
+ 'v':EDIT_VIDEO,
+ 'a':EDIT_AUDIO,
+ 'aa':EDIT_AUDIO_STEREO,
+ 'va':EDIT_VIDEO_AUDIO,
+ 'b':EDIT_VIDEO_AUDIO
+ }
+
+
+enum= 0
+WIPE_UNKNOWN= enum
+WIPE_0= enum; enum+=1
+WIPE_1= enum; enum+=1
+
+enum= 0
+KEY_UNKNOWN= enum
+KEY_BG= enum; enum+=1 # K B
+KEY_IN= enum; enum+=1 # This is assumed if no second type is set
+KEY_OUT= enum; enum+=1 # K O
+
+
+'''
+Most sytems:
+Non-dropframe: 1:00:00:00 - colon in last position
+Dropframe: 1:00:00;00 - semicolon in last position
+PAL/SECAM: 1:00:00:00 - colon in last position
+
+SONY:
+Non-dropframe: 1:00:00.00 - period in last position
+Dropframe: 1:00:00,00 - comma in last position
+PAL/SECAM: 1:00:00.00 - period in last position
+'''
+
+'''
+t = abs(timecode('-124:-12:-43:-22', 25))
+t /= 2
+print t
+'''
+
+def editFlagsToText(flag):
+ items = []
+ for item, val in EDIT_DICT.items():
+ if val & flag:
+ items.append(item)
+ return '/'.join(items)
+
+
+class EditDecision(object):
+ def __init__(self, text= None, fps= 25):
+ # print text
+ self.number = -1
+ self.reel = '' # Uniqie name for this 'file' but not filename, when BL signifies black
+ self.transition_duration= 0
+ self.edit_type= EDIT_UNKNOWN
+ self.transition_type= TRANSITION_UNKNOWN
+ self.wipe_type = WIPE_UNKNOWN
+ self.key_type = KEY_UNKNOWN
+ self.key_fade = -1 # true/false
+ self.srcIn = None # Where on the original field recording the event begins
+ self.srcOut = None # Where on the original field recording the event ends
+ self.recIn = None # Beginning of the original event in the edited program
+ self.recOut = None # End of the original event in the edited program
+ self.m2 = None # fps set by the m2 command
+ self.filename = ''
+
+ self.custom_data= [] # use for storing any data you want (blender strip for eg)
+
+ if text != None:
+ self.read(text, fps)
+
+ def __repr__(self):
+ txt= 'num: %d, ' % self.number
+ txt += 'reel: %s, ' % self.reel
+ txt += 'edit_type: '
+ txt += editFlagsToText(self.edit_type) + ', '
+
+ txt += 'trans_type: '
+ for item, val in TRANSITION_DICT.items():
+ if val == self.transition_type:
+ txt += item + ', '
+ break
+
+
+ txt += 'm2: '
+ if self.m2:
+ txt += '%g' % float(self.m2.fps)
+ txt += '\n\t'
+ txt += self.m2.data
+ else:
+ txt += 'nil'
+
+ txt += ', '
+ txt += 'recIn: ' + str(self.recIn) + ', '
+ txt += 'recOut: ' + str(self.recOut) + ', '
+ txt += 'srcIn: ' + str(self.srcIn) + ', '
+ txt += 'srcOut: ' + str(self.srcOut) + ', '
+
+ return txt
+
+
+ def read(self, line, fps):
+ line= line.split()
+ index= 0
+ self.number= int(line[index]); index+=1
+ self.reel= line[index].lower(); index+=1
+
+ # AA/V can be an edit type
+ self.edit_type= 0
+ for edit_type in line[index].lower().split('/'):
+ self.edit_type |= EDIT_DICT[edit_type];
+ index+=1
+
+ tx_name = ''.join([c for c in line[index].lower() if not c.isdigit()])
+ self.transition_type= TRANSITION_DICT[tx_name]; # advance the index later
+
+ if self.transition_type== TRANSITION_WIPE:
+ tx_num = ''.join([c for c in line[index].lower() if c.isdigit()])
+ if tx_num: tx_num = int(tx_num)
+ else: tx_num = 0
+
+ self.wipe_type= tx_num
+
+ elif self.transition_type== TRANSITION_KEY: # UNTESTED
+
+ val= line[index+1].lower()
+
+ if val == 'b':
+ self.key_type= KEY_BG
+ index+=1
+ elif val == 'o':
+ self.key_type= KEY_OUT
+ index+=1
+ else:
+ self.key_type= KEY_IN # if no args given
+
+ # there may be an (F) after, eg 'K B (F)'
+ # in the docs this should only be after K B but who knows, it may be after K O also?
+ val= line[index+1].lower()
+ if val == '(f)':
+ index+=1
+ self.key_fade = True
+ else:
+ self.key_fade = False
+
+ index+=1
+
+ if self.transition_type in (TRANSITION_DISSOLVE, TRANSITION_EFFECT, TRANSITION_FADEIN, TRANSITION_FADEOUT, TRANSITION_WIPE):
+ self.transition_duration= TimeCode(line[index], fps); index+=1
+
+ if index < len(line):
+ self.srcIn= TimeCode(line[index], fps); index+=1
+ if index < len(line):
+ self.srcOut= TimeCode(line[index], fps); index+=1
+
+ if index < len(line):
+ self.recIn= TimeCode(line[index], fps); index+=1
+ if index < len(line):
+ self.recOut= TimeCode(line[index], fps); index+=1
+
+ def renumber(self):
+ self.edits.sort( key=lambda e: int(e.recIn) )
+ for i, edit in enumerate(self.edits):
+ edit.number= i
+
+ def clean(self):
+ '''
+ Clean up double ups
+ '''
+ self.renumber()
+
+ # TODO
+ def asName(self):
+ cut_type = 'nil'
+ for k,v in TRANSITION_DICT.iteritems():
+ if v==self.transition_type:
+ cut_type = k
+ break
+
+ return '%d_%s_%s' % (self.number, self.reel, cut_type)
+
+class M2(object):
+ def __init__(self):
+ self.reel = None
+ self.fps = None
+ self.time = None
+ self.data = None
+
+ self.index = -1
+ self.tot = -1
+
+ def read(self, line, fps):
+
+ # M2 TAPEC 050.5 00:08:11:08
+ words = line.split()
+
+ self.reel= words[1].lower()
+ self.fps= float(words[2])
+ self.time= TimeCode(words[3], fps)
+
+ self.data = line
+
+class EditList(object):
+ def __init__(self):
+ self.edits= []
+ self.title= ''
+
+ def parse(self, filename, fps):
+ try:
+ file= open(filename, 'rU')
+ except:
+ return False
+
+ self.edits= []
+ edits_m2 = [] # edits with m2's
+
+ has_m2 = False
+
+ for line in file:
+ line= ' '.join(line.split())
+
+ if not line or line.startswith('*') or line.startswith('#'):
+ continue
+ elif line.startswith('TITLE:'):
+ self.title= ' '.join(line.split()[1:])
+ elif line.split()[0].lower() == 'm2':
+ has_m2 = True
+ m2 = M2()
+ m2.read(line, fps)
+ edits_m2.append( m2 )
+ elif not line.split()[0].isdigit():
+ print 'Ignoring:', line
+ else:
+ self.edits.append( EditDecision(line, fps) )
+ edits_m2.append( self.edits[-1] )
+
+ if has_m2:
+ # Group indexes
+ i = 0
+ for item in edits_m2:
+ if isinstance(item, M2):
+ item.index = i
+ i += 1
+ else:
+ # not an m2
+ i = 0
+
+ # Set total group indexes
+ for item in reversed(edits_m2):
+ if isinstance(item, M2):
+ if tot_m2 == -1:
+ tot_m2 = item.index + 1
+
+ item.tot = tot_m2
+ else:
+ # not an m2
+ tot_m2 = -1
+
+
+ for i, item in enumerate(edits_m2):
+ if isinstance(item, M2):
+ # make a list of all items that match the m2's reel name
+ edits_m2_tmp = [item_tmp for item_tmp in edits_m2 if (isinstance(item, M2) or item_tmp.reel == item.reel)]
+
+ # get the new index
+ i_tmp = edits_m2_tmp.index(item)
+
+ # Seek back to get the edit.
+ edit = edits_m2[i_tmp-item.tot]
+
+ # Note, docs say time should also match with edit start time
+ # but from final cut pro, this seems not to be the case
+ if not isinstance(edit, EditDecision):
+ print "ERROR!", 'M2 incorrect'
+ else:
+ edit.m2 = item
+
+
+ return True
+
+ def testOverlap(self, edit_test):
+ recIn= int(edit_test.recIn)
+ recOut= int(edit_test.recOut)
+
+ for edit in self.edits:
+ if edit is edit_test:
+ break
+
+ recIn_other= int(edit.recIn)
+ recOut_other= int(edit.recOut)
+
+ if recIn_other < recIn < recOut_other:
+ return True
+ if recIn_other < recOut < recOut_other:
+ return True
+
+ if recIn < recIn_other < recOut:
+ return True
+ if recIn < recOut_other < recOut:
+ return True
+
+ return False
+
+ def getReels(self):
+ reels = {}
+ for edit in self.edits:
+ reels.setdefault(edit.reel, []).append(edit)
+
+ return reels
+
+
+
+# from DNA
+SEQ_IMAGE= 0
+SEQ_META= 1
+SEQ_SCENE= 2
+SEQ_MOVIE= 3
+SEQ_RAM_SOUND= 4
+SEQ_HD_SOUND= 5
+SEQ_MOVIE_AND_HD_SOUND= 6
+
+SEQ_EFFECT= 8
+SEQ_CROSS= 8
+SEQ_ADD= 9
+SEQ_SUB= 10
+SEQ_ALPHAOVER= 11
+SEQ_ALPHAUNDER= 12
+SEQ_GAMCROSS= 13
+SEQ_MUL= 14
+SEQ_OVERDROP= 15
+SEQ_PLUGIN= 24
+SEQ_WIPE= 25
+SEQ_GLOW= 26
+SEQ_TRANSFORM= 27
+SEQ_COLOR= 28
+SEQ_SPEED= 29
+
+# Blender spesific stuff starts here
+import bpy
+import Blender
+
+def scale_meta_speed(seq, mov, scale):
+ # Add an effect
+ speed= seq.new((SEQ_SPEED, mov,), 199, mov.channel+1)
+ speed.speedEffectFrameBlending = True
+ meta= seq.new([mov, speed], 199, mov.channel)
+
+ if scale >= 1.0:
+ mov.endStill = int(mov.length * (scale - 1.0))
+ else:
+ speed.speedEffectGlobalSpeed = 1.0/scale
+ meta.endOffset = mov.length - int(mov.length*scale)
+
+ speed.update()
+ meta.update()
+ return meta
+
+def apply_dissolve_ipo(mov, blendin):
+ len_disp = float(mov.endDisp - mov.startDisp)
+
+ if len_disp <= 0.0:
+ print 'Error, strip is zero length'
+ return
+
+ mov.ipo= ipo= bpy.data.ipos.new("fade", "Sequence")
+ icu= ipo.addCurve('Fac')
+
+ icu.interpolation= Blender.IpoCurve.InterpTypes.LINEAR
+ icu.append((0, 0))
+ icu.append(((int(blendin)/len_disp) * 100, 1))
+
+ if mov.type not in (SEQ_HD_SOUND, SEQ_RAM_SOUND):
+ mov.blendMode = Blender.Scene.Sequence.BlendModes.ALPHAOVER
+
+
+def replace_ext(path, ext):
+ return path[:path.rfind('.')+1] + ext
+
+def load_edl(filename, reel_files, reel_offsets):
+ '''
+ reel_files - key:reel <--> reel:filename
+ '''
+
+ # For test file
+ # frame_offset = -769
+
+
+ sce= bpy.data.scenes.active
+ fps= sce.render.fps
+
+ elist= EditList()
+ if not elist.parse(filename, fps):
+ return 'Unable to parse "%s"' % filename
+ # elist.clean()
+
+
+ seq= sce.sequence
+
+ track= 0
+
+ edits = elist.edits[:]
+ # edits.sort(key = lambda edit: int(edit.recIn))
+
+ prev_edit = None
+ for edit in edits:
+ print edit
+ frame_offset = reel_offsets[edit.reel]
+
+
+ src_start= int(edit.srcIn) + frame_offset
+ src_end= int(edit.srcOut) + frame_offset
+ src_length= src_end-src_start
+
+ rec_start= int(edit.recIn) + 1
+ rec_end= int(edit.recOut) + 1
+ rec_length= rec_end-rec_start
+
+ # print src_length, rec_length, src_start
+
+ if edit.m2 != None: scale = fps/float(edit.m2.fps)
+ else: scale = 1.0
+
+ unedited_start= rec_start - src_start
+ offset_start = src_start - int(src_start*scale) # works for scaling up AND down
+
+ if edit.transition_type == TRANSITION_CUT and (not elist.testOverlap(edit)):
+ track = 1
+
+ strip= None
+ final_strips = []
+ if edit.reel.lower()=='bw':
+ strip= seq.new((0,0,0), rec_start, track+1)
+ strip.length= rec_length # for color its simple
+ final_strips.append(strip)
+ else:
+
+ path_full = reel_files[edit.reel]
+ path_fileonly= path_full.split('/')[-1].split('\\')[-1] # os.path.basename(full)
+ path_dironly= path_full[:-len(path_fileonly)] # os.path.dirname(full)
+
+ if edit.edit_type & EDIT_VIDEO: #and edit.transition_type == TRANSITION_CUT:
+
+ try:
+ strip= seq.new((path_fileonly, path_dironly, path_full, 'movie'), unedited_start + offset_start, track+1)
+ except:
+ return 'Invalid input for movie'
+
+ # Apply scaled rec in bounds
+ if scale != 1.0:
+ meta = scale_meta_speed(seq, strip, scale)
+ final_strip = meta
+ else:
+ final_strip = strip
+
+
+ final_strip.update()
+ final_strip.startOffset= rec_start - final_strip.startDisp
+ final_strip.endOffset= rec_end- final_strip.endDisp
+ final_strip.update()
+ final_strip.endOffset += (final_strip.endDisp - rec_end)
+ final_strip.update()
+
+
+ if edit.transition_duration:
+ if not prev_edit:
+ print "Error no previous strip"
+ else:
+ new_end = rec_start + int(edit.transition_duration)
+ for other in prev_edit.custom_data:
+ if other.type != SEQ_HD_SOUND and other.type != SEQ_RAM_SOUND:
+ other.endOffset += (other.endDisp - new_end)
+ other.update()
+
+ # Apply disolve
+ if edit.transition_type == TRANSITION_DISSOLVE:
+ apply_dissolve_ipo(final_strip, edit.transition_duration)
+
+ if edit.transition_type == TRANSITION_WIPE:
+ other_track = track + 2
+ for other in prev_edit.custom_data:
+ if other.type != SEQ_HD_SOUND and other.type != SEQ_RAM_SOUND:
+
+ strip_wipe= seq.new((SEQ_WIPE, other, final_strip), 1, other_track)
+
+ if edit.wipe_type == WIPE_0:
+ strip_wipe.wipeEffectAngle = 90
+ else:
+ strip_wipe.wipeEffectAngle = -90
+
+ other_track += 1
+
+
+
+ # strip.endOffset= strip.length - int(edit.srcOut)
+ #end_offset= (unedited_start+strip.length) - end
+ # print start, end, end_offset
+ #strip.endOffset = end_offset
+
+ # break
+ # print strip
+
+ final_strips.append(final_strip)
+
+
+ if edit.edit_type & (EDIT_AUDIO | EDIT_AUDIO_STEREO | EDIT_VIDEO_AUDIO):
+
+ if scale == 1.0: # TODO - scaled audio
+
+ try:
+ strip= seq.new((path_fileonly, path_dironly, path_full, 'audio_hd'), unedited_start + offset_start, track+6)
+ except:
+
+ # See if there is a wave file there
+ path_full_wav = replace_ext(path_full, 'wav')
+ path_fileonly_wav = replace_ext(path_fileonly, 'wav')
+
+ #try:
+ strip= seq.new((path_fileonly_wav, path_dironly, path_full_wav, 'audio_hd'), unedited_start + offset_start, track+6)
+ #except:
+ # return 'Invalid input for audio'
+
+ final_strip = strip
+
+ # Copied from above
+ final_strip.update()
+ final_strip.startOffset= rec_start - final_strip.startDisp
+ final_strip.endOffset= rec_end- final_strip.endDisp
+ final_strip.update()
+ final_strip.endOffset += (final_strip.endDisp - rec_end)
+ final_strip.update()
+
+ if edit.transition_type == TRANSITION_DISSOLVE:
+ apply_dissolve_ipo(final_strip, edit.transition_duration)
+
+ final_strips.append(final_strip)
+
+ # strip= seq.new((0.6, 0.6, 0.6), start, track+1)
+
+ if final_strips:
+ for strip in final_strips:
+ # strip.length= length
+ final_strip.name = edit.asName()
+ edit.custom_data[:]= final_strips
+ # track = not track
+ prev_edit = edit
+ track += 1
+
+ #break
+
+
+ def recursive_update(s):
+ s.update(1)
+ for s_kid in s:
+ recursive_update(s_kid)
+
+
+ for s in seq:
+ recursive_update(s)
+
+ return ''
+
+
+
+#load_edl('/fe/edl/EP30CMXtrk1.edl') # /tmp/test.edl
+#load_edl('/fe/edl/EP30CMXtrk2.edl') # /tmp/test.edl
+#load_edl('/fe/edl/EP30CMXtrk3.edl') # /tmp/test.edl
+#load_edl('/root/vid/rush/blender_edl.edl', ['/root/vid/rush/rushes3.avi',]) # /tmp/test.edl
+
+
+
+
+# ---------------------- Blender UI part
+from Blender import Draw, Window
+import BPyWindow
+
+if 0:
+ DEFAULT_FILE_EDL = '/root/vid/rush/blender_edl.edl'
+ DEFAULT_FILE_MEDIA = '/root/vid/rush/rushes3_wav.avi'
+ DEFAULT_FRAME_OFFSET = -769
+else:
+ DEFAULT_FILE_EDL = ''
+ DEFAULT_FILE_MEDIA = ''
+ DEFAULT_FRAME_OFFSET = 0
+
+B_EVENT_IMPORT = 1
+B_EVENT_RELOAD = 2
+B_EVENT_FILESEL_EDL = 3
+B_EVENT_NOP = 4
+
+B_EVENT_FILESEL = 100 # or greater
+
+class ReelItemUI(object):
+ __slots__ = 'filename_but', 'offset_but', 'ui_text'
+ def __init__(self):
+ self.filename_but = Draw.Create(DEFAULT_FILE_MEDIA)
+ self.offset_but = Draw.Create(DEFAULT_FRAME_OFFSET)
+ self.ui_text = ''
+
+
+
+REEL_UI = {} # reel:ui_string
+
+
+#REEL_FILENAMES = {} # reel:filename
+#REEL_OFFSETS = {} # reel:filename
+
+PREF = {}
+
+PREF['filename'] = Draw.Create(DEFAULT_FILE_EDL)
+PREF['reel_act'] = ''
+
+def edl_reload():
+ Window.WaitCursor(1)
+ filename = PREF['filename'].val
+ sce= bpy.data.scenes.active
+ fps= sce.render.fps
+
+ elist= EditList()
+
+ if filename:
+ if not elist.parse(filename, fps):
+ Draw.PupMenu('Error%t|Could not open the file "' + filename + '"')
+ reels = elist.getReels()
+ else:
+ reels = {}
+
+ REEL_UI.clear()
+ for reel_key, edits in reels.iteritems():
+
+ if reel_key == 'bw':
+ continue
+
+ flag = 0
+ for edit in edits:
+ flag |= edit.edit_type
+
+ reel_item = REEL_UI[reel_key] = ReelItemUI()
+
+ reel_item.ui_text = '%s (%s): ' % (reel_key, editFlagsToText(flag))
+
+ Window.WaitCursor(0)
+
+def edl_set_path(filename):
+ PREF['filename'].val = filename
+ edl_reload()
+ Draw.Redraw()
+
+def edl_set_path_reel(filename):
+ REEL_UI[PREF['reel_act']].filename_but.val = filename
+ Draw.Redraw()
+
+def edl_reel_keys():
+ reel_keys = REEL_UI.keys()
+
+ if 'bw' in reel_keys:
+ reel_keys.remove('bw')
+
+ reel_keys.sort()
+ return reel_keys
+
+def edl_draw():
+
+ MARGIN = 4
+ rect = BPyWindow.spaceRect()
+ but_width = int((rect[2]-MARGIN*2)/4.0) # 72
+ # Clamp
+ if but_width>100: but_width = 100
+ but_height = 17
+
+ x=MARGIN
+ y=rect[3]-but_height-MARGIN
+ xtmp = x
+
+
+
+ # ---------- ---------- ---------- ----------
+ Blender.Draw.BeginAlign()
+ PREF['filename'] = Draw.String('edl path: ', B_EVENT_RELOAD, xtmp, y, (but_width*3)-20, but_height, PREF['filename'].val, 256, 'EDL Path'); xtmp += (but_width*3)-20;
+ Draw.PushButton('..', B_EVENT_FILESEL_EDL, xtmp, y, 20, but_height, 'Select an EDL file'); xtmp += 20;
+ Blender.Draw.EndAlign()
+
+ Draw.PushButton('Reload', B_EVENT_RELOAD, xtmp + MARGIN, y, but_width - MARGIN, but_height, 'Read the ID Property settings from the active curve object'); xtmp += but_width;
+ y-=but_height + MARGIN
+ xtmp = x
+ # ---------- ---------- ---------- ----------
+
+ reel_keys = edl_reel_keys()
+
+
+
+ if reel_keys: text = 'Reel file list...'
+ elif PREF['filename'].val == '': text = 'No EDL loaded.'
+ else: text = 'No reels found!'
+
+ Draw.Label(text, xtmp + MARGIN, y, but_width*4, but_height); xtmp += but_width*4;
+
+ y-=but_height + MARGIN
+ xtmp = x
+
+ # ---------- ---------- ---------- ----------
+
+
+ for i, reel_key in enumerate(reel_keys):
+ reel_item = REEL_UI[reel_key]
+
+ Blender.Draw.BeginAlign()
+ REEL_UI[reel_key].filename_but = Draw.String(reel_item.ui_text, B_EVENT_NOP, xtmp, y, (but_width*3)-20, but_height, REEL_UI[reel_key].filename_but.val, 256, 'Select the reel path'); xtmp += (but_width*3)-20;
+ Draw.PushButton('..', B_EVENT_FILESEL + i, xtmp, y, 20, but_height, 'Media path to use for this reel'); xtmp += 20;
+ Blender.Draw.EndAlign()
+
+ reel_item.offset_but= Draw.Number('ofs:', B_EVENT_NOP, xtmp + MARGIN, y, but_width - MARGIN, but_height, reel_item.offset_but.val, -100000, 100000, 'Start offset in frames when applying timecode'); xtmp += but_width - MARGIN;
+
+ y-=but_height + MARGIN
+ xtmp = x
+
+ # ---------- ---------- ---------- ----------
+
+ Draw.PushButton('Import CMX-EDL Sequencer Strips', B_EVENT_IMPORT, xtmp + MARGIN, MARGIN, but_width*4 - MARGIN, but_height, 'Load the EDL file into the sequencer'); xtmp += but_width*4;
+ y-=but_height + MARGIN
+ xtmp = x
+
+
+def edl_event(evt, val):
+ pass
+
+def edl_bevent(evt):
+
+ if evt == B_EVENT_NOP:
+ pass
+ elif evt == B_EVENT_IMPORT:
+ '''
+ Load the file into blender with UI settings
+ '''
+ filename = PREF['filename'].val
+
+ reel_files = {}
+ reel_offsets = {}
+
+ for reel_key, reel_item in REEL_UI.iteritems():
+ reel_files[reel_key] = reel_item.filename_but.val
+ reel_offsets[reel_key] = reel_item.offset_but.val
+
+ error = load_edl(filename, reel_files, reel_offsets)
+ if error != '':
+ Draw.PupMenu('Error%t|' + error)
+ else:
+ Window.RedrawAll()
+
+ elif evt == B_EVENT_RELOAD:
+ edl_reload()
+ Draw.Redraw()
+
+ elif evt == B_EVENT_FILESEL_EDL:
+ filename = PREF['filename'].val
+ if not filename: filename = Blender.sys.join(Blender.sys.expandpath('//'), '*.edl')
+
+ Window.FileSelector(edl_set_path, 'Select EDL', filename)
+
+ elif evt >= B_EVENT_FILESEL:
+ reel_keys = edl_reel_keys()
+ reel_key = reel_keys[evt - B_EVENT_FILESEL]
+
+ filename = REEL_UI[reel_key].filename_but.val
+ if not filename: filename = Blender.sys.expandpath('//')
+
+ PREF['reel_act'] = reel_key # so file set path knows which one to set
+ Window.FileSelector(edl_set_path_reel, 'Reel Media', filename)
+
+
+
+if __name__ == '__main__':
+ Draw.Register(edl_draw, edl_event, edl_bevent)
+ edl_reload()
+
diff --git a/release/scripts/md2_export.py b/release/scripts/md2_export.py
index cf5752597da..f0fe6b9af40 100644
--- a/release/scripts/md2_export.py
+++ b/release/scripts/md2_export.py
@@ -923,7 +923,8 @@ def fill_md2(md2, object):
maxdot = dot;
maxdotindex = j;
- md2.frames[frame_counter].vertices[vert_counter].lightnormalindex=maxdotindex+2
+ # See patch [#19206], gives good info on this line below.
+ md2.frames[frame_counter].vertices[vert_counter].lightnormalindex=maxdotindex
del maxdot, maxdotindex
del new_x, new_y, new_z
diff --git a/release/scripts/textplugin_convert_ge.py b/release/scripts/textplugin_convert_ge.py
index 21e065bcfd7..fb17367d622 100644
--- a/release/scripts/textplugin_convert_ge.py
+++ b/release/scripts/textplugin_convert_ge.py
@@ -537,7 +537,7 @@ attributeRenameDict = {
'getFrameMessageCount': (replaceSimpleGetter, 'frameMessageCount'), # KX_NetworkMessageSensor
'getFrameProperty': (replaceSimpleGetter, 'framePropName'), # BL_ShapeActionActuator, BL_ActionActuator
'getFrequency': (replaceSimpleGetter, 'frequency'), # SCA_ISensor
- 'getGain': (replaceSimpleGetter, 'volume'), # KX_SoundActuator, KX_CDActuator
+ 'getGain': (replaceSimpleGetter, 'volume'), # KX_SoundActuator
'getHat': (replaceSimpleGetter, 'hat'), # SCA_JoystickSensor
'getHeight': (replaceSimpleGetter, 'height'), # KX_CameraActuator
'getHitNormal': (replaceSimpleGetter, 'hitNormal'), # KX_MouseFocusSensor, KX_RaySensor
@@ -620,7 +620,7 @@ attributeRenameDict = {
'setFrame': (replaceSimpleSetter, 'frame'), # BL_ShapeActionActuator, BL_ActionActuator
'setFrameProperty': (replaceSimpleSetter, 'framePropName'), # BL_ShapeActionActuator, BL_ActionActuator
'setFrequency': (replaceSimpleSetter, 'frequency'), # SCA_ISensor
- 'setGain': (replaceSimpleSetter, 'volume'), # KX_SoundActuator, KX_CDActuator
+ 'setGain': (replaceSimpleSetter, 'volume'), # KX_SoundActuator
'setHeight': (replaceSimpleSetter, 'height'), # KX_CameraActuator
'setHold1': (replaceSimpleSetter, 'hold1'), # SCA_KeyboardSensor
'setHold2': (replaceSimpleSetter, 'hold2'), # SCA_KeyboardSensor
diff --git a/release/ui/bpy_ops.py b/release/ui/bpy_ops.py
index aa9bfb460f0..dff8125fca1 100644
--- a/release/ui/bpy_ops.py
+++ b/release/ui/bpy_ops.py
@@ -5,6 +5,18 @@ from bpy.__ops__ import dir as op_dir
from bpy.__ops__ import call as op_call
from bpy.__ops__ import get_rna as op_get_rna
+# Keep in sync with WM_types.h
+context_dict = {
+ 'INVOKE_DEFAULT':0,
+ 'INVOKE_REGION_WIN':1,
+ 'INVOKE_AREA':2,
+ 'INVOKE_SCREEN':3,
+ 'EXEC_DEFAULT':4,
+ 'EXEC_REGION_WIN':5,
+ 'EXEC_AREA':6,
+ 'EXEC_SCREEN':7,
+}
+
class bpy_ops(object):
'''
Fake module like class.
@@ -94,10 +106,22 @@ class bpy_ops_submodule_op(object):
# submod.foo -> SUBMOD_OT_foo
return self.module.upper() + '_OT_' + self.func
- def __call__(self, **kw):
+ def __call__(self, *args, **kw):
# Get the operator from blender
- return op_call(self.idname(), kw)
+ if len(args) > 1:
+ raise ValueError("only one argument for the execution context is supported ")
+
+ if args:
+ try:
+ context = context_dict[args[0]]
+ except:
+ raise ValueError("Expected a single context argument in: " + str(list(context_dict.keys())))
+
+ return op_call(self.idname(), kw, context)
+
+ else:
+ return op_call(self.idname(), kw)
def get_rna(self):
'''
diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py
index 6f467ee30da..ff0cc531c67 100644
--- a/release/ui/buttons_data_armature.py
+++ b/release/ui/buttons_data_armature.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
@@ -41,21 +41,22 @@ class DATA_PT_skeleton(DataButtonsPanel):
split = layout.split()
col = split.column()
+ col.itemL(text="Layers:")
+ col.template_layers(arm, "layer")
+ col.itemL(text="Protected Layers:")
+ col.template_layers(arm, "layer_protection")
+ col.itemL(text="Edit Options:")
+ col.itemR(arm, "x_axis_mirror")
+ col.itemR(arm, "auto_ik")
+
+ col = split.column()
col.itemR(arm, "rest_position")
col.itemL(text="Deform:")
- col.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
+ col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
col.itemR(arm, "deform_quaternion", text="Quaternion")
col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
- #col.itemR(arm, "x_axis_mirror")
- #col.itemR(arm, "auto_ik")
-
- col = split.column()
- col.itemL(text="Layers:")
- col.template_layers(arm, "layer")
- col.itemL(text="Protected Layers:")
- col.template_layers(arm, "layer_protection")
-
+
class DATA_PT_display(DataButtonsPanel):
__label__ = "Display"
@@ -83,15 +84,15 @@ class DATA_PT_bone_groups(DataButtonsPanel):
layout = self.layout
ob = context.object
- pose= ob.pose
+ pose = ob.pose
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index")
col = row.column(align=True)
col.active = (ob.proxy == None)
- col.itemO("pose.group_add", icon="ICON_ZOOMIN", text="")
- col.itemO("pose.group_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
+ col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
group = pose.active_bone_group
if group:
@@ -154,7 +155,7 @@ class DATA_PT_ghost(DataButtonsPanel):
split = layout.split()
col = split.column()
- col.itemR(arm, "ghost_type", text="Scope")
+ col.itemR(arm, "ghost_type", text="")
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py
index e05b64e5e11..276ca066af5 100644
--- a/release/ui/buttons_data_bone.py
+++ b/release/ui/buttons_data_bone.py
@@ -2,8 +2,8 @@
import bpy
class BoneButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "bone"
def poll(self, context):
@@ -20,7 +20,7 @@ class BONE_PT_context_bone(BoneButtonsPanel):
bone = context.edit_bone
row = layout.row()
- row.itemL(text="", icon="ICON_BONE_DATA")
+ row.itemL(text="", icon='ICON_BONE_DATA')
row.itemR(bone, "name", text="")
class BONE_PT_transform(BoneButtonsPanel):
@@ -74,10 +74,15 @@ class BONE_PT_bone(BoneButtonsPanel):
def draw(self, context):
layout = self.layout
+ ob = context.object
bone = context.bone
arm = context.armature
+
if not bone:
bone = context.edit_bone
+ pchan = None
+ else:
+ pchan = ob.pose.pose_channels[context.bone.name]
split = layout.split()
@@ -87,14 +92,14 @@ class BONE_PT_bone(BoneButtonsPanel):
col.itemR(bone, "parent", text="")
else:
col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
-
+
row = col.row()
row.active = bone.parent != None
row.itemR(bone, "connected")
-
+
col.itemL(text="Layers:")
col.template_layers(bone, "layer")
-
+
col = split.column()
col.itemL(text="Inherit:")
col.itemR(bone, "hinge", text="Rotation")
@@ -102,6 +107,17 @@ class BONE_PT_bone(BoneButtonsPanel):
col.itemL(text="Display:")
col.itemR(bone, "draw_wire", text="Wireframe")
col.itemR(bone, "hidden", text="Hide")
+
+ if ob and pchan:
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Bone Group:")
+ col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
+
+ col = split.column()
+ col.itemL(text="Custom Shape:")
+ col.itemR(pchan, "custom_shape", text="")
class BONE_PT_inverse_kinematics(BoneButtonsPanel):
__label__ = "Inverse Kinematics"
@@ -178,18 +194,18 @@ class BONE_PT_deform(BoneButtonsPanel):
__default_closed__ = True
def draw_header(self, context):
- layout = self.layout
-
bone = context.bone
+
if not bone:
bone = context.edit_bone
- layout.itemR(bone, "deform", text="")
+ self.layout.itemR(bone, "deform", text="")
def draw(self, context):
layout = self.layout
bone = context.bone
+
if not bone:
bone = context.edit_bone
diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py
index 811858e3627..aa107d8dbdd 100644
--- a/release/ui/buttons_data_camera.py
+++ b/release/ui/buttons_data_camera.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
@@ -49,7 +49,7 @@ class DATA_PT_camera(DataButtonsPanel):
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
- layout.itemR(cam, "panorama");
+ layout.itemR(cam, "panorama")
split = layout.split()
diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py
index d0e1756986d..ced3c6597e0 100644
--- a/release/ui/buttons_data_curve.py
+++ b/release/ui/buttons_data_curve.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
@@ -38,33 +38,34 @@ class DATA_PT_shape_curve(DataButtonsPanel):
curve = context.curve
space = context.space_data
- if curve:
- layout.itemR(curve, "curve_2d")
+ layout.itemR(curve, "curve_2d")
- split = layout.split()
+ split = layout.split()
- col = split.column()
- colsub = col.column()
- colsub.active = curve.curve_2d
- colsub.itemL(text="Caps:")
- colsub.itemR(curve, "front")
- colsub.itemR(curve, "back")
+ col = split.column()
+ sub = col.column()
+ sub.active = curve.curve_2d
+ sub.itemL(text="Caps:")
+ sub.itemR(curve, "front")
+ sub.itemR(curve, "back")
- col.itemL(text="Textures:")
-# col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
+ col.itemL(text="Textures:")
+# col.itemR(curve, "uv_orco")
+ col.itemR(curve, "auto_texspace")
- sub = split.column()
- sub.itemL(text="Resolution:")
- sub.itemR(curve, "resolution_u", text="Preview U")
- sub.itemR(curve, "resolution_v", text="Preview V")
- sub.itemR(curve, "render_resolution_u", text="Render U")
- sub.itemR(curve, "render_resolution_v", text="Render V")
-
-# sub.itemL(text="Display:")
-# sub.itemL(text="HANDLES")
-# sub.itemL(text="NORMALS")
-# sub.itemR(curve, "vertex_normal_flip")
+ col = split.column()
+ col.itemL(text="Resolution:")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_u", text="Preview U")
+ sub.itemR(curve, "render_resolution_u", text="Render U")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_v", text="Preview V")
+ sub.itemR(curve, "render_resolution_v", text="Render V")
+
+# col.itemL(text="Display:")
+# col.itemL(text="HANDLES")
+# col.itemL(text="NORMALS")
+# col.itemR(curve, "vertex_normal_flip")
class DATA_PT_geometry_curve(DataButtonsPanel):
__label__ = "Geometry "
@@ -76,27 +77,25 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
split = layout.split()
- sub = split.column()
- sub.itemL(text="Modification:")
- sub.itemR(curve, "width")
- sub.itemR(curve, "extrude")
- sub.itemR(curve, "taper_object", icon="ICON_OUTLINER_OB_CURVE")
+ col = split.column()
+ col.itemL(text="Modification:")
+ col.itemR(curve, "width")
+ col.itemR(curve, "extrude")
+ col.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE')
- sub = split.column()
- sub.itemL(text="Bevel:")
- sub.itemR(curve, "bevel_depth", text="Depth")
- sub.itemR(curve, "bevel_resolution", text="Resolution")
- sub.itemR(curve, "bevel_object", icon="ICON_OUTLINER_OB_CURVE")
+ col = split.column()
+ col.itemL(text="Bevel:")
+ col.itemR(curve, "bevel_depth", text="Depth")
+ col.itemR(curve, "bevel_resolution", text="Resolution")
+ col.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE')
class DATA_PT_pathanim(DataButtonsPanel):
__label__ = "Path Animation"
def draw_header(self, context):
- layout = self.layout
-
curve = context.curve
- layout.itemR(curve, "path", text="")
+ self.layout.itemR(curve, "path", text="")
def draw(self, context):
layout = self.layout
diff --git a/release/ui/buttons_data_empty.py b/release/ui/buttons_data_empty.py
index 827fe02e411..98c9b88e9f5 100644
--- a/release/ui/buttons_data_empty.py
+++ b/release/ui/buttons_data_empty.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py
index 5be25278e93..808a205b1b8 100644
--- a/release/ui/buttons_data_lamp.py
+++ b/release/ui/buttons_data_lamp.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
@@ -13,9 +13,7 @@ class DATA_PT_preview(DataButtonsPanel):
__label__ = "Preview"
def draw(self, context):
- layout = self.layout
-
- layout.template_preview(context.lamp)
+ self.layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel):
__show_header__ = False
@@ -52,54 +50,29 @@ class DATA_PT_lamp(DataButtonsPanel):
sub = col.column()
sub.itemR(lamp, "color", text="")
sub.itemR(lamp, "energy")
-
-
-
-
- #split = layout.split()
-
+
if lamp.type in ('POINT', 'SPOT'):
- #col = split.column()
- #col.itemL(text="Falloff:")
- sub = col.column()
- sub.itemR(lamp, "falloff_type", text="Falloff")
+ sub.itemL(text="Falloff:")
+ sub.itemR(lamp, "falloff_type", text="")
sub.itemR(lamp, "distance")
-
-
+
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
- #col = split.column()
col.itemL(text="Attenuation Factors:")
sub = col.column(align=True)
sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
- #else:
- #
- # split.column()
col.itemR(lamp, "sphere")
if lamp.type == 'AREA':
- #col = split.column()
col.itemR(lamp, "distance")
col.itemR(lamp, "gamma")
-
- #col = split.column()
-
-
- col.itemR(lamp, "shape")
- sub = col.column(align=True)
- if (lamp.shape == 'SQUARE'):
- sub.itemR(lamp, "size")
- elif (lamp.shape == 'RECTANGLE'):
- sub.itemR(lamp, "size", text="Size X")
- sub.itemR(lamp, "size_y", text="Size Y")
-
+
col = split.column()
col.itemR(lamp, "negative")
col.itemR(lamp, "layer", text="This Layer Only")
col.itemR(lamp, "specular")
col.itemR(lamp, "diffuse")
-
class DATA_PT_sunsky(DataButtonsPanel):
__label__ = "Sun/Sky"
@@ -198,13 +171,13 @@ class DATA_PT_shadow(DataButtonsPanel):
if lamp.type in ('POINT', 'SUN', 'SPOT'):
split = layout.split()
- col = split.column(align=True)
+ col = split.column()
col.itemR(lamp, "shadow_soft_size", text="Soft Size")
- col = split.column(align=True)
col.itemR(lamp, "shadow_ray_samples", text="Samples")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+ col = split.column()
elif lamp.type == 'AREA':
split = layout.split()
@@ -212,18 +185,18 @@ class DATA_PT_shadow(DataButtonsPanel):
col = split.column()
sub = split.column(align=True)
if lamp.shape == 'SQUARE':
- sub.itemR(lamp, "shadow_ray_samples_x", text="Samples")
+ col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
- sub.itemR(lamp, "shadow_ray_samples_x", text="Samples X")
- sub.itemR(lamp, "shadow_ray_samples_y", text="Samples Y")
+ col.itemR(lamp, "shadow_ray_samples_x", text="Samples X")
+ col.itemR(lamp, "shadow_ray_samples_y", text="Samples Y")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
- sub.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+ col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
- col.itemR(lamp, "umbra")
- col.itemR(lamp, "dither")
- col.itemR(lamp, "jitter")
+ sub.itemR(lamp, "umbra")
+ sub.itemR(lamp, "dither")
+ sub.itemR(lamp, "jitter")
if lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
@@ -262,8 +235,34 @@ class DATA_PT_shadow(DataButtonsPanel):
sub.active = not lamp.auto_clip_end
sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
+class DATA_PT_area(DataButtonsPanel):
+ __label__ = "Area Shape"
+
+ def poll(self, context):
+ lamp = context.lamp
+ return (lamp and lamp.type == 'AREA')
+
+ def draw(self, context):
+ layout = self.layout
+
+ lamp = context.lamp
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(lamp, "shape", text="")
+
+ sub = col.column(align=True)
+ if (lamp.shape == 'SQUARE'):
+ sub.itemR(lamp, "size")
+ elif (lamp.shape == 'RECTANGLE'):
+ sub.itemR(lamp, "size", text="Size X")
+ sub.itemR(lamp, "size_y", text="Size Y")
+
+ col = split.column()
+
class DATA_PT_spot(DataButtonsPanel):
- __label__ = "Spot"
+ __label__ = "Spot Shape"
def poll(self, context):
lamp = context.lamp
@@ -297,23 +296,18 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
def poll(self, context):
lamp = context.lamp
- if lamp and lamp.type in ('POINT', 'SPOT'):
- if lamp.falloff_type == 'CUSTOM_CURVE':
- return True
-
- return False
+ return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
def draw(self, context):
- layout = self.layout
-
lamp = context.lamp
- layout.template_curve_mapping(lamp.falloff_curve)
+ self.layout.template_curve_mapping(lamp.falloff_curve)
bpy.types.register(DATA_PT_context_lamp)
bpy.types.register(DATA_PT_preview)
bpy.types.register(DATA_PT_lamp)
bpy.types.register(DATA_PT_falloff_curve)
+bpy.types.register(DATA_PT_area)
bpy.types.register(DATA_PT_spot)
bpy.types.register(DATA_PT_shadow)
-bpy.types.register(DATA_PT_sunsky) \ No newline at end of file
+bpy.types.register(DATA_PT_sunsky)
diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py
index 3766b9ff1a5..895c1a65bea 100644
--- a/release/ui/buttons_data_lattice.py
+++ b/release/ui/buttons_data_lattice.py
@@ -2,12 +2,12 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
- return (context.lattice != None)
+ return (context.lattice)
class DATA_PT_context_lattice(DataButtonsPanel):
__show_header__ = False
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py
index 87c4a596b4d..33b3960b381 100644
--- a/release/ui/buttons_data_mesh.py
+++ b/release/ui/buttons_data_mesh.py
@@ -2,12 +2,12 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
- return (context.mesh != None)
+ return (context.mesh)
class DATA_PT_context_mesh(DataButtonsPanel):
__show_header__ = False
@@ -44,9 +44,9 @@ class DATA_PT_normals(DataButtonsPanel):
sub.active = mesh.autosmooth
sub.itemR(mesh, "autosmooth_angle", text="Angle")
- sub = split.column()
- sub.itemR(mesh, "vertex_normal_flip")
- sub.itemR(mesh, "double_sided")
+ col = split.column()
+ col.itemR(mesh, "vertex_normal_flip")
+ col.itemR(mesh, "double_sided")
class DATA_PT_vertex_groups(DataButtonsPanel):
__label__ = "Vertex Groups"
@@ -63,25 +63,28 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index")
col = row.column(align=True)
- col.itemO("object.vertex_group_add", icon="ICON_ZOOMIN", text="")
- col.itemO("object.vertex_group_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
+ col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
- col.itemO("object.vertex_group_copy", icon="ICON_BLANK1", text="")
+ col.itemO("object.vertex_group_copy", icon='ICON_BLANK1', text="")
if ob.data.users > 1:
- col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="")
+ col.itemO("object.vertex_group_copy_to_linked", icon='ICON_BLANK1', text="")
group = ob.active_vertex_group
if group:
row = layout.row()
row.itemR(group, "name")
- if context.edit_object:
- row = layout.row(align=True)
-
- row.itemO("object.vertex_group_assign", text="Assign")
- row.itemO("object.vertex_group_remove_from", text="Remove")
- row.itemO("object.vertex_group_select", text="Select")
- row.itemO("object.vertex_group_deselect", text="Deselect")
+ if ob.mode == 'EDIT':
+ row = layout.row()
+
+ sub = row.row(align=True)
+ sub.itemO("object.vertex_group_assign", text="Assign")
+ sub.itemO("object.vertex_group_remove_from", text="Remove")
+
+ sub = row.row(align=True)
+ sub.itemO("object.vertex_group_select", text="Select")
+ sub.itemO("object.vertex_group_deselect", text="Deselect")
layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
@@ -99,20 +102,20 @@ class DATA_PT_shape_keys(DataButtonsPanel):
kb = ob.active_shape_key
row = layout.row()
- row.template_list(key, "keys", ob, "active_shape_key_index")
+ row.template_list(key, "keys", ob, "active_shape_key_index", rows=2)
col = row.column()
subcol = col.column(align=True)
- subcol.itemO("object.shape_key_add", icon="ICON_ZOOMIN", text="")
- subcol.itemO("object.shape_key_remove", icon="ICON_ZOOMOUT", text="")
+ subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
+ subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
if kb:
col.itemS()
subcol = col.column(align=True)
- subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="")
- subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="")
+ subcol.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
+ subcol.itemR(kb, "mute", icon='ICON_MUTE_IPO_ON', text="")
if key.relative:
row = layout.row()
@@ -123,15 +126,23 @@ class DATA_PT_shape_keys(DataButtonsPanel):
row.itemR(kb, "name")
if ob.active_shape_key_index != 0:
- if not ob.shape_key_lock:
- row = layout.row(align=True)
- row.itemR(kb, "value", text="")
- row.itemR(kb, "slider_min", text="Min")
- row.itemR(kb, "slider_max", text="Max")
-
+
row = layout.row()
- row.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
- row.item_pointerR(kb, "relative_key", key, "keys", text="")
+ row.enabled = ob.shape_key_lock == False
+ row.itemR(kb, "value", slider=True)
+
+ split = layout.split()
+ sub = split.column(align=True)
+ sub.enabled = ob.shape_key_lock == False
+ sub.itemL(text="Range:")
+ sub.itemR(kb, "slider_min", text="Min")
+ sub.itemR(kb, "slider_max", text="Max")
+
+ sub = split.column()
+ sub.itemL(text="Blend:")
+ sub.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
+ sub.item_pointerR(kb, "relative_key", key, "keys", text="")
+
else:
row = layout.row()
row.itemR(key, "relative")
@@ -139,7 +150,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
layout.itemR(kb, "name")
- if context.edit_object:
+ if ob.mode == 'EDIT':
layout.enabled = False
class DATA_PT_uv_texture(DataButtonsPanel):
@@ -156,8 +167,8 @@ class DATA_PT_uv_texture(DataButtonsPanel):
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
col = row.column(align=True)
- col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="")
- col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
+ col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_uv_texture
if lay:
@@ -177,8 +188,8 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
col = row.column(align=True)
- col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="")
- col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
+ col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_vertex_color
if lay:
diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py
index 009a13df0b7..88c0066c67f 100644
--- a/release/ui/buttons_data_metaball.py
+++ b/release/ui/buttons_data_metaball.py
@@ -1,8 +1,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
@@ -54,30 +54,59 @@ class DATA_PT_metaball_element(DataButtonsPanel):
__label__ = "Active Element"
def poll(self, context):
- return (context.meta_ball and context.meta_ball.last_selected_element)
+ return (context.meta_ball and context.meta_ball.active_element)
def draw(self, context):
layout = self.layout
- metaelem = context.meta_ball.last_selected_element
+ metaelem = context.meta_ball.active_element
split = layout.split(percentage=0.3)
split.itemL(text="Type:")
split.itemR(metaelem, "type", text="")
split = layout.split()
-
- col = split.column()
- col.itemL(text="Size:")
- col.itemR(metaelem, "size", text="")
-
+
col = split.column()
col.itemL(text="Settings:")
col.itemR(metaelem, "stiffness", text="Stiffness")
col.itemR(metaelem, "negative", text="Negative")
col.itemR(metaelem, "hide", text="Hide")
-
+ if metaelem.type == 'BALL':
+
+ col = split.column(align=True)
+
+ elif metaelem.type == 'CUBE':
+
+ col = split.column(align=True)
+ col.itemL(text="Size:")
+ col.itemR(metaelem, "size_x", text="X")
+ col.itemR(metaelem, "size_y", text="Y")
+ col.itemR(metaelem, "size_z", text="Z")
+
+ elif metaelem.type == 'TUBE':
+
+ col = split.column(align=True)
+ col.itemL(text="Size:")
+ col.itemR(metaelem, "size_x", text="X")
+
+ elif metaelem.type == 'PLANE':
+
+ col = split.column(align=True)
+ col.itemL(text="Size:")
+ col.itemR(metaelem, "size_x", text="X")
+ col.itemR(metaelem, "size_y", text="Y")
+
+ elif metaelem.type == 'ELLIPSOID':
+
+ col = split.column(align=True)
+ col.itemL(text="Size:")
+ col.itemR(metaelem, "size_x", text="X")
+ col.itemR(metaelem, "size_y", text="Y")
+ col.itemR(metaelem, "size_z", text="Z")
+
+
bpy.types.register(DATA_PT_context_metaball)
bpy.types.register(DATA_PT_metaball)
-bpy.types.register(DATA_PT_metaball_element) \ No newline at end of file
+bpy.types.register(DATA_PT_metaball_element)
diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py
index 909677d61f0..2835f55f71a 100644
--- a/release/ui/buttons_data_modifier.py
+++ b/release/ui/buttons_data_modifier.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "modifier"
class DATA_PT_modifiers(DataButtonsPanel):
@@ -16,87 +16,44 @@ class DATA_PT_modifiers(DataButtonsPanel):
row = layout.row()
row.item_menu_enumO("object.modifier_add", "type")
- row.itemL();
+ row.itemL()
for md in ob.modifiers:
box = layout.template_modifier(md)
-
if box:
- if md.type == 'ARMATURE':
- self.armature(box, ob, md)
- elif md.type == 'ARRAY':
- self.array(box, ob, md)
- elif md.type == 'BEVEL':
- self.bevel(box, ob, md)
- elif md.type == 'BOOLEAN':
- self.boolean(box, ob, md)
- elif md.type == 'BUILD':
- self.build(box, ob, md)
- elif md.type == 'CAST':
- self.cast(box, ob, md)
- elif md.type == 'CLOTH':
- self.cloth(box, ob, md)
- elif md.type == 'COLLISION':
- self.collision(box, ob, md)
- elif md.type == 'CURVE':
- self.curve(box, ob, md)
- elif md.type == 'DECIMATE':
- self.decimate(box, ob, md)
- elif md.type == 'DISPLACE':
- self.displace(box, ob, md)
- elif md.type == 'EDGE_SPLIT':
- self.edgesplit(box, ob, md)
- elif md.type == 'EXPLODE':
- self.explode(box, ob, md)
- elif md.type == 'FLUID_SIMULATION':
- self.fluid(box, ob, md)
- elif md.type == 'HOOK':
- self.hook(box, ob, md)
- elif md.type == 'LATTICE':
- self.lattice(box, ob, md)
- elif md.type == 'MASK':
- self.mask(box, ob, md)
- elif md.type == 'MESH_DEFORM':
- self.mesh_deform(box, ob, md)
- elif md.type == 'MIRROR':
- self.mirror(box, ob, md)
- elif md.type == 'MULTIRES':
- self.multires(box, ob, md)
- elif md.type == 'PARTICLE_INSTANCE':
- self.particleinstance(box, ob, md)
- elif md.type == 'PARTICLE_SYSTEM':
- self.particlesystem(box, ob, md)
- elif md.type == 'SHRINKWRAP':
- self.shrinkwrap(box, ob, md)
- elif md.type == 'SIMPLE_DEFORM':
- self.simpledeform(box, ob, md)
- elif md.type == 'SMOOTH':
- self.smooth(box, ob, md)
- elif md.type == 'SOFTBODY':
- self.softbody(box, ob, md)
- elif md.type == 'SUBSURF':
- self.subsurf(box, ob, md)
- elif md.type == 'SURFACE':
- self.surface(box, ob, md)
- elif md.type == 'UV_PROJECT':
- self.uvproject(box, ob, md)
- elif md.type == 'WAVE':
- self.wave(box, ob, md)
-
- def armature(self, layout, ob, md):
+ # match enum type to our functions, avoids a lookup table.
+ getattr(self, md.type)(box, ob, md)
+
+ # the mt.type enum is (ab)used for a lookup on function names
+ # ...to avoid lengthy if statements
+ # so each type must have a function here.
+
+ def ARMATURE(self, layout, ob, md):
layout.itemR(md, "object")
- row = layout.row()
- row.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- row.itemR(md, "invert")
+ split = layout.split(percentage=0.5)
+ split.itemL(text="Vertex Group:")
+ sub = split.split(percentage=0.7)
+ sub.item_pointerR(md, "vertex_group", ob, "vertex_groups", text="")
+ subsub = sub.row()
+ subsub.active = md.vertex_group
+ subsub.itemR(md, "invert")
- flow = layout.column_flow()
- flow.itemR(md, "use_vertex_groups", text="Vertex Groups")
- flow.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
- flow.itemR(md, "quaternion")
- flow.itemR(md, "multi_modifier")
+ layout.itemS()
- def array(self, layout, ob, md):
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Bind To:")
+ col.itemR(md, "use_vertex_groups", text="Vertex Groups")
+ col.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
+
+ col = split.column()
+ col.itemL(text="Deformation:")
+ col.itemR(md, "quaternion")
+ col.itemR(md, "multi_modifier")
+
+ def ARRAY(self, layout, ob, md):
layout.itemR(md, "fit_type")
if md.fit_type == 'FIXED_COUNT':
layout.itemR(md, "count")
@@ -142,7 +99,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.itemR(md, "start_cap")
col.itemR(md, "end_cap")
- def bevel(self, layout, ob, md):
+ def BEVEL(self, layout, ob, md):
row = layout.row()
row.itemR(md, "width")
row.itemR(md, "only_vertices")
@@ -154,11 +111,11 @@ class DATA_PT_modifiers(DataButtonsPanel):
elif md.limit_method == 'WEIGHT':
layout.row().itemR(md, "edge_weight_method", expand=True)
- def boolean(self, layout, ob, md):
+ def BOOLEAN(self, layout, ob, md):
layout.itemR(md, "operation")
layout.itemR(md, "object")
- def build(self, layout, ob, md):
+ def BUILD(self, layout, ob, md):
split = layout.split()
col = split.column()
@@ -171,7 +128,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
sub.active = md.randomize
sub.itemR(md, "seed")
- def cast(self, layout, ob, md):
+ def CAST(self, layout, ob, md):
layout.itemR(md, "cast_type")
layout.itemR(md, "object")
if md.object:
@@ -189,22 +146,22 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- def cloth(self, layout, ob, md):
+ def CLOTH(self, layout, ob, md):
layout.itemL(text="See Cloth panel.")
- def collision(self, layout, ob, md):
+ def COLLISION(self, layout, ob, md):
layout.itemL(text="See Collision panel.")
- def curve(self, layout, ob, md):
+ def CURVE(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "deform_axis")
- def decimate(self, layout, ob, md):
+ def DECIMATE(self, layout, ob, md):
layout.itemR(md, "ratio")
layout.itemR(md, "face_count")
- def displace(self, layout, ob, md):
+ def DISPLACE(self, layout, ob, md):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "texture")
layout.itemR(md, "midlevel")
@@ -214,9 +171,9 @@ class DATA_PT_modifiers(DataButtonsPanel):
if md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinate_object", text="Object")
elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
+ layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
- def edgesplit(self, layout, ob, md):
+ def EDGE_SPLIT(self, layout, ob, md):
split = layout.split()
col = split.column()
@@ -228,30 +185,49 @@ class DATA_PT_modifiers(DataButtonsPanel):
col = split.column()
col.itemR(md, "use_sharp", text="Sharp Edges")
- def explode(self, layout, ob, md):
+ def EXPLODE(self, layout, ob, md):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "protect")
- layout.itemR(md, "split_edges")
- layout.itemR(md, "unborn")
- layout.itemR(md, "alive")
- layout.itemR(md, "dead")
- # Missing: "Refresh" and "Clear Vertex Group" Operator
+
+ flow = layout.column_flow(2)
+ flow.itemR(md, "split_edges")
+ flow.itemR(md, "unborn")
+ flow.itemR(md, "alive")
+ flow.itemR(md, "dead")
+
+ layout.itemO("object.explode_refresh", text="Refresh");
- def fluid(self, layout, ob, md):
+ def FLUID_SIMULATION(self, layout, ob, md):
layout.itemL(text="See Fluid panel.")
- def hook(self, layout, ob, md):
- layout.itemR(md, "falloff")
- layout.itemR(md, "force", slider=True)
- layout.itemR(md, "object")
+ def HOOK(self, layout, ob, md):
+ col = layout.column()
+ col.itemR(md, "object")
+ if md.object and md.object.type == 'ARMATURE':
+ layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
+
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- # Missing: "Reset" and "Recenter" Operator
+
+ split = layout.split()
+ split.itemR(md, "falloff")
+ split.itemR(md, "force", slider=True)
+
+ layout.itemS()
+
+ row = layout.row()
+ row.itemO("object.hook_reset", text="Reset")
+ row.itemO("object.hook_recenter", text="Recenter")
+
+ if ob.mode == 'EDIT':
+ row = layout.row()
+ row.itemO("object.hook_select", text="Select")
+ row.itemO("object.hook_assign", text="Assign")
- def lattice(self, layout, ob, md):
+ def LATTICE(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- def mask(self, layout, ob, md):
+ def MASK(self, layout, ob, md):
layout.itemR(md, "mode")
if md.mode == 'ARMATURE':
layout.itemR(md, "armature")
@@ -259,19 +235,19 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "inverse")
- def mesh_deform(self, layout, ob, md):
+ def MESH_DEFORM(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "invert")
layout.itemS()
- layout.itemO("object.modifier_mdef_bind", text="Bind")
+ layout.itemO("object.meshdeform_bind", text="Bind")
row = layout.row()
row.itemR(md, "precision")
row.itemR(md, "dynamic")
- def mirror(self, layout, ob, md):
+ def MIRROR(self, layout, ob, md):
layout.itemR(md, "merge_limit")
split = layout.split()
@@ -291,12 +267,16 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.itemR(md, "mirror_object")
- def multires(self, layout, ob, md):
+ def MULTIRES(self, layout, ob, md):
layout.itemR(md, "subdivision_type")
- layout.itemO("object.multires_subdivide", text="Subdivide")
+
+ row = layout.row()
+ row.itemO("object.multires_subdivide", text="Subdivide")
+ row.itemO("object.multires_higher_levels_delete", text="Delete Higher")
+
layout.itemR(md, "level")
- def particleinstance(self, layout, ob, md):
+ def PARTICLE_INSTANCE(self, layout, ob, md):
layout.itemR(md, "object")
layout.itemR(md, "particle_system_number")
@@ -319,10 +299,10 @@ class DATA_PT_modifiers(DataButtonsPanel):
row.itemR(md, "position", slider=True)
row.itemR(md, "random_position", text = "Random", slider=True)
- def particlesystem(self, layout, ob, md):
+ def PARTICLE_SYSTEM(self, layout, ob, md):
layout.itemL(text="See Particle panel.")
- def shrinkwrap(self, layout, ob, md):
+ def SHRINKWRAP(self, layout, ob, md):
layout.itemR(md, "target")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "offset")
@@ -345,7 +325,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
elif md.mode == 'NEAREST_SURFACEPOINT':
layout.itemR(md, "keep_above_surface")
- def simpledeform(self, layout, ob, md):
+ def SIMPLE_DEFORM(self, layout, ob, md):
layout.itemR(md, "mode")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "origin")
@@ -355,8 +335,11 @@ class DATA_PT_modifiers(DataButtonsPanel):
if md.mode in ('TAPER', 'STRETCH'):
layout.itemR(md, "lock_x_axis")
layout.itemR(md, "lock_y_axis")
+
+ def SMOKE(self, layout, ob, md):
+ layout.itemL(text="See Smoke panel.")
- def smooth(self, layout, ob, md):
+ def SMOOTH(self, layout, ob, md):
split = layout.split()
col = split.column()
@@ -370,11 +353,11 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- def softbody(self, layout, ob, md):
+ def SOFT_BODY(self, layout, ob, md):
layout.itemL(text="See Soft Body panel.")
- def subsurf(self, layout, ob, md):
- layout.itemR(md, "subdivision_type")
+ def SUBSURF(self, layout, ob, md):
+ layout.row().itemR(md, "subdivision_type", expand=True)
flow = layout.column_flow()
flow.itemR(md, "levels", text="Preview")
@@ -382,20 +365,33 @@ class DATA_PT_modifiers(DataButtonsPanel):
flow.itemR(md, "optimal_draw", text="Optimal Display")
flow.itemR(md, "subsurf_uv")
- def surface(self, layout, ob, md):
+ def SURFACE(self, layout, ob, md):
layout.itemL(text="See Fields panel.")
- def uvproject(self, layout, ob, md):
+ def UV_PROJECT(self, layout, ob, md):
if ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
- #layout.itemR(md, "projectors")
+ layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
layout.itemR(md, "image")
- layout.itemR(md, "horizontal_aspect_ratio")
- layout.itemR(md, "vertical_aspect_ratio")
layout.itemR(md, "override_image")
- #"Projectors" don't work.
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Aspect Ratio:")
+
+ sub = col.column(align=True)
+ sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
+ sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
+
+ col = split.column()
+ col.itemL(text="Projectors:")
+
+ sub = col.column(align=True)
+ sub.itemR(md, "num_projectors", text="Number")
+ for proj in md.projectors:
+ sub.itemR(proj, "object", text="")
- def wave(self, layout, ob, md):
+ def WAVE(self, layout, ob, md):
split = layout.split()
col = split.column()
@@ -406,29 +402,41 @@ class DATA_PT_modifiers(DataButtonsPanel):
col = split.column()
col.itemR(md, "normals")
- sub = col.row(align=True)
+ sub = col.column()
sub.active = md.normals
- sub.itemR(md, "x_normal", text="X", toggle=True)
- sub.itemR(md, "y_normal", text="Y", toggle=True)
- sub.itemR(md, "z_normal", text="Z", toggle=True)
+ sub.itemR(md, "x_normal", text="X")
+ sub.itemR(md, "y_normal", text="Y")
+ sub.itemR(md, "z_normal", text="Z")
- flow = layout.column_flow()
- flow.itemR(md, "time_offset")
- flow.itemR(md, "lifetime")
- flow.itemR(md, "damping_time")
- flow.itemR(md, "falloff_radius")
- flow.itemR(md, "start_position_x")
- flow.itemR(md, "start_position_y")
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Time:")
+ sub = col.column(align=True)
+ sub.itemR(md, "time_offset", text="Offset")
+ sub.itemR(md, "lifetime", text="Life")
+ col.itemR(md, "damping_time", text="Damping")
+
+ col = split.column()
+ col.itemL(text="Position:")
+ sub = col.column(align=True)
+ sub.itemR(md, "start_position_x", text="X")
+ sub.itemR(md, "start_position_y", text="Y")
+ col.itemR(md, "falloff_radius", text="Falloff")
+
+ layout.itemS()
layout.itemR(md, "start_position_object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "texture")
layout.itemR(md, "texture_coordinates")
if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
+ layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
elif md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinates_object")
+ layout.itemS()
+
flow = layout.column_flow()
flow.itemR(md, "speed", slider=True)
flow.itemR(md, "height", slider=True)
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py
index 757e61307df..aabf218122f 100644
--- a/release/ui/buttons_data_text.py
+++ b/release/ui/buttons_data_text.py
@@ -2,8 +2,8 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
@@ -38,29 +38,29 @@ class DATA_PT_shape_text(DataButtonsPanel):
curve = context.curve
space = context.space_data
- if curve:
- layout.itemR(curve, "curve_2d")
+
+ layout.itemR(curve, "curve_2d")
- split = layout.split()
+ split = layout.split()
- col = split.column()
- col.itemL(text="Caps:")
- col.itemR(curve, "front")
- col.itemR(curve, "back")
- col.itemL(text="Textures:")
- col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
+ col = split.column()
+ col.itemL(text="Caps:")
+ col.itemR(curve, "front")
+ col.itemR(curve, "back")
+ col.itemL(text="Textures:")
+ col.itemR(curve, "uv_orco")
+ col.itemR(curve, "auto_texspace")
- col = split.column()
- col.itemL(text="Resolution:")
- sub = col.column(align=True)
- sub.itemR(curve, "resolution_u", text="Preview U")
- sub.itemR(curve, "render_resolution_u", text="Render U")
- sub = col.column(align=True)
- sub.itemR(curve, "resolution_v", text="Preview V")
- sub.itemR(curve, "render_resolution_v", text="Render V")
- col.itemL(text="Display:")
- col.itemR(curve, "fast")
+ col = split.column()
+ col.itemL(text="Resolution:")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_u", text="Preview U")
+ sub.itemR(curve, "render_resolution_u", text="Render U")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_v", text="Preview V")
+ sub.itemR(curve, "render_resolution_v", text="Render V")
+ col.itemL(text="Display:")
+ col.itemR(curve, "fast")
class DATA_PT_geometry_text(DataButtonsPanel):
__label__ = "Geometry"
@@ -134,8 +134,8 @@ class DATA_PT_paragraph(DataButtonsPanel):
col = split.column(align=True)
col.itemL(text="Offset:")
- col.itemR(text, "x_offset", text="X")
- col.itemR(text, "y_offset", text="Y")
+ col.itemR(text, "offset_x", text="X")
+ col.itemR(text, "offset_y", text="Y")
#col.itemR(text, "wrap")
"""
diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py
index 3f60bceb284..73ba566e23f 100644
--- a/release/ui/buttons_game.py
+++ b/release/ui/buttons_game.py
@@ -2,8 +2,8 @@
import bpy
class PhysicsButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
@@ -16,98 +16,155 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
def draw(self, context):
layout = self.layout
- ob = context.active_object
+ ob = context.active_object
game = ob.game
+ soft = ob.game.soft_body
layout.itemR(game, "physics_type")
layout.itemS()
- split = layout.split()
- col = split.column()
-
- col.itemR(game, "actor")
-
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
- col = split.column()
- col.itemR(game, "do_fh", text="Use Material Physics")
- col.itemR(game, "rotation_fh", text="Rotate From Normal")
- col.itemR(game, "no_sleeping")
-
- layout.itemS()
- split = layout.split()
- col = split.column()
- col.itemL(text="Attributes:")
- colsub = col.column(align=True)
- colsub.itemR(game, "mass")
- colsub.itemR(game, "radius")
- colsub.itemR(game, "form_factor")
- col.itemS()
- col.itemL(text="Damping:")
- colsub = col.column(align=True)
- colsub.itemR(game, "damping", text="Translation", slider=True)
- colsub.itemR(game, "rotation_damping", text="Rotation", slider=True)
-
- col = split.column()
-
- col.itemL(text="Velocity:")
- colsub = col.column(align=True)
- colsub.itemR(game, "minimum_velocity", text="Minimum")
- colsub.itemR(game, "maximum_velocity", text="Maximum")
- col.itemS()
- col.itemR(game, "anisotropic_friction")
-
- colsub = col.column()
- colsub.active = game.anisotropic_friction
- colsub.itemR(game, "friction_coefficients", text="", slider=True)
+ #if game.physics_type == 'DYNAMIC':
+ if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(game, "actor")
+ col.itemR(game, "ghost")
+ col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+
+ col = split.column()
+ col.itemR(game, "material_physics")
+ col.itemR(game, "rotate_from_normal")
+ col.itemR(game, "no_sleeping")
+
+ layout.itemS()
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Attributes:")
+ col.itemR(game, "mass")
+ col.itemR(game, "radius")
+ col.itemR(game, "form_factor")
+
+ col = split.column()
+ sub = col.column()
+ sub.active = (game.physics_type == 'RIGID_BODY')
+ sub.itemR(game, "anisotropic_friction")
+ subsub = sub.column()
+ subsub.active = game.anisotropic_friction
+ subsub.itemR(game, "friction_coefficients", text="", slider=True)
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Velocity:")
+ sub = col.column(align=True)
+ sub.itemR(game, "minimum_velocity", text="Minimum")
+ sub.itemR(game, "maximum_velocity", text="Maximum")
+
+ col = split.column()
+ col.itemL(text="Damping:")
+ sub = col.column(align=True)
+ sub.itemR(game, "damping", text="Translation", slider=True)
+ sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
+
+ layout.itemS()
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Lock Translation:")
+ col.itemR(game, "lock_x_axis", text="X")
+ col.itemR(game, "lock_y_axis", text="Y")
+ col.itemR(game, "lock_z_axis", text="Z")
+
+ col = split.column()
+ col.itemL(text="Lock Rotation:")
+ col.itemR(game, "lock_x_rot_axis", text="X")
+ col.itemR(game, "lock_y_rot_axis", text="Y")
+ col.itemR(game, "lock_z_rot_axis", text="Z")
- layout.itemS()
- split = layout.split()
- sub = split.column()
- sub.itemL(text="Lock Translation:")
- sub.itemR(game, "lock_x_axis", text="X")
- sub.itemR(game, "lock_y_axis", text="Y")
- sub.itemR(game, "lock_z_axis", text="Z")
- sub = split.column()
- sub.itemL(text="Lock Rotation:")
- sub.itemR(game, "lock_x_rot_axis", text="X")
- sub.itemR(game, "lock_y_rot_axis", text="Y")
- sub.itemR(game, "lock_z_rot_axis", text="Z")
+ elif game.physics_type == 'SOFT_BODY':
+
+ col = layout.column()
+ col.itemR(game, "actor")
+ col.itemR(game, "ghost")
+ col.itemR(ob, "restrict_render", text="Invisible")
+
+ layout.itemS()
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Attributes:")
+ col.itemR(game, "mass")
+ col.itemR(soft, "welding")
+ col.itemR(soft, "position_iterations")
+ col.itemR(soft, "linstiff", slider=True)
+ col.itemR(soft, "dynamic_friction", slider=True)
+ col.itemR(soft, "margin", slider=True)
+ col.itemR(soft, "bending_const", text="Bending Constraints")
+ col = split.column()
+ col.itemR(soft, "shape_match")
+ sub = col.column()
+ sub.active = soft.shape_match
+ sub.itemR(soft, "threshold", slider=True)
+
+ col.itemS()
+
+ col.itemL(text="Cluster Collision:")
+ col.itemR(soft, "cluster_rigid_to_softbody")
+ col.itemR(soft, "cluster_soft_to_softbody")
+ sub = col.column()
+ sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
+ sub.itemR(soft, "cluster_iterations", text="Iterations")
+
+ elif game.physics_type == 'STATIC':
+
+ col = layout.column()
+ col.itemR(game, "actor")
+ col.itemR(game, "ghost")
+ col.itemR(ob, "restrict_render", text="Invisible")
+
+ elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
+
+ layout.itemR(ob, "restrict_render", text="Invisible")
+
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
__label__ = "Collision Bounds"
+ def poll(self, context):
+ game = context.object.game
+ rd = context.scene.render_data
+ return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
+
def draw_header(self, context):
- layout = self.layout
- ob = context.active_object
- game = ob.game
+ game = context.active_object.game
- layout.itemR(game, "use_collision_bounds", text="")
+ self.layout.itemR(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
- ob = context.scene.objects[0]
- game = ob.game
+ game = context.active_object.game
+
layout.active = game.use_collision_bounds
-
-
-
layout.itemR(game, "collision_bounds", text="Bounds")
- split = layout.split()
- sub = split.column()
- sub.itemR(game, "collision_compound", text="Compound")
- sub = split.column()
- sub.itemR(game, "collision_margin", text="Margin", slider=True)
+ row = layout.row()
+ row.itemR(game, "collision_compound", text="Compound")
+ row.itemR(game, "collision_margin", text="Margin", slider=True)
bpy.types.register(PHYSICS_PT_game_physics)
bpy.types.register(PHYSICS_PT_game_collision_bounds)
class SceneButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "scene"
def poll(self, context):
@@ -119,83 +176,144 @@ class SCENE_PT_game(SceneButtonsPanel):
def draw(self, context):
layout = self.layout
- rd = context.scene.render_data
row = layout.row()
row.itemO("view3d.game_start", text="Start")
row.itemL()
class SCENE_PT_game_player(SceneButtonsPanel):
- __label__ = "Player"
+ __label__ = "Standalone Player"
def draw(self, context):
layout = self.layout
+
gs = context.scene.game_data
- row = layout.row()
- row.itemR(gs, "fullscreen")
+
+ layout.itemR(gs, "fullscreen")
split = layout.split()
+
col = split.column()
col.itemL(text="Resolution:")
- colsub = col.column(align=True)
- colsub.itemR(gs, "resolution_x", slider=False, text="X")
- colsub.itemR(gs, "resolution_y", slider=False, text="Y")
+ sub = col.column(align=True)
+ sub.itemR(gs, "resolution_x", slider=False, text="X")
+ sub.itemR(gs, "resolution_y", slider=False, text="Y")
col = split.column()
col.itemL(text="Quality:")
- colsub = col.column(align=True)
- colsub.itemR(gs, "depth", text="Bit Depth", slider=False)
- colsub.itemR(gs, "frequency", text="FPS", slider=False)
+ sub = col.column(align=True)
+ sub.itemR(gs, "depth", text="Bit Depth", slider=False)
+ sub.itemR(gs, "frequency", text="FPS", slider=False)
# framing:
col = layout.column()
col.itemL(text="Framing:")
col.row().itemR(gs, "framing_type", expand=True)
-
- colsub = col.column()
- colsub.itemR(gs, "framing_color", text="")
+ if gs.framing_type == 'LETTERBOX':
+ col.itemR(gs, "framing_color", text="")
class SCENE_PT_game_stereo(SceneButtonsPanel):
__label__ = "Stereo"
def draw(self, context):
layout = self.layout
+
gs = context.scene.game_data
+ stereo_mode = gs.stereo
# stereo options:
- col= layout.column()
- row = col.row()
- row.itemR(gs, "stereo", expand=True)
+ layout.itemR(gs, "stereo", expand=True)
- stereo_mode = gs.stereo
-
# stereo:
if stereo_mode == 'STEREO':
- row = layout.row()
- row.itemR(gs, "stereo_mode")
+ layout.itemR(gs, "stereo_mode")
+ layout.itemL(text="To do: Focal Length")
+ layout.itemL(text="To do: Eye Separation")
# dome:
- if stereo_mode == 'DOME':
- row = layout.row()
- row.itemR(gs, "dome_mode", text="Dome Type")
+ elif stereo_mode == 'DOME':
+ layout.itemR(gs, "dome_mode", text="Dome Type")
+
+ dome_type = gs.dome_mode
split=layout.split()
- col=split.column()
- col.itemR(gs, "dome_angle", slider=True)
- col.itemR(gs, "dome_tesselation", text="Tesselation")
- col=split.column()
- col.itemR(gs, "dome_tilt")
- col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
- col=layout.column()
- col.itemR(gs, "dome_text")
+
+ if dome_type == 'FISHEYE' or \
+ dome_type == 'TRUNCATED_REAR' or \
+ dome_type == 'TRUNCATED_FRONT':
+
+ col=split.column()
+ col.itemR(gs, "dome_angle", slider=True)
+ col.itemR(gs, "dome_tilt")
+
+ col=split.column()
+ col.itemR(gs, "dome_tesselation", text="Tesselation")
+ col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+ elif dome_type == 'PANORAM_SPH':
+ col=split.column()
+ col.itemR(gs, "dome_tesselation", text="Tesselation")
+ col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+ else: # cube map
+ col=split.column()
+ col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+ layout.itemR(gs, "dome_text")
+
+class SCENE_PT_game_shading(SceneButtonsPanel):
+ __label__ = "Shading"
+
+ def draw(self, context):
+ layout = self.layout
+
+ gs = context.scene.game_data
+ layout.itemR(gs, "material_mode", expand=True)
+
+ if gs.material_mode == 'GLSL':
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(gs, "glsl_lights", text="Lights")
+ col.itemR(gs, "glsl_shaders", text="Shaders")
+ col.itemR(gs, "glsl_shadows", text="Shadows")
+
+ col = split.column()
+ col.itemR(gs, "glsl_ramps", text="Ramps")
+ col.itemR(gs, "glsl_nodes", text="Nodes")
+ col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
+
+class SCENE_PT_game_performance(SceneButtonsPanel):
+ __label__ = "Performance"
+
+ def draw(self, context):
+ layout = self.layout
+
+ gs = context.scene.game_data
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Show:")
+ col.itemR(gs, "show_debug_properties", text="Debug Properties")
+ col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
+ col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
+ col.itemR(gs, "deprecation_warnings")
+
+ col = split.column()
+ col.itemL(text="Render:")
+ col.itemR(gs, "all_frames")
+ col.itemR(gs, "display_lists")
bpy.types.register(SCENE_PT_game)
bpy.types.register(SCENE_PT_game_player)
bpy.types.register(SCENE_PT_game_stereo)
+bpy.types.register(SCENE_PT_game_shading)
+bpy.types.register(SCENE_PT_game_performance)
class WorldButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "world"
def poll(self, context):
@@ -207,7 +325,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
def poll(self, context):
rd = context.scene.render_data
- return (context.scene != None) and (rd.use_game_engine)
+ return (context.scene) and (rd.use_game_engine)
def draw(self, context):
layout = self.layout
@@ -228,6 +346,7 @@ class WORLD_PT_game_world(WorldButtonsPanel):
def draw(self, context):
layout = self.layout
+
world = context.world
row = layout.row()
@@ -241,64 +360,44 @@ class WORLD_PT_game_world(WorldButtonsPanel):
row.itemR(world.mist, "start")
row.itemR(world.mist, "depth")
-
-"""
-class WORLD_PT_game(WorldButtonsPanel):
- __space_type__ = "LOGIC_EDITOR"
- __region_type__ = "UI"
- __label__ = "Game Settings"
-
- def draw(self, context):
- layout = self.layout
- world = context.world
-
- flow = layout.column_flow()
- flow.itemR(world, "physics_engine")
- flow.itemR(world, "physics_gravity")
-
- flow.itemR(world, "game_fps")
- flow.itemR(world, "game_logic_step_max")
- flow.itemR(world, "game_physics_substep")
- flow.itemR(world, "game_physics_step_max")
-
- flow.itemR(world, "game_use_occlusion_culling", text="Enable Occlusion Culling")
- flow.itemR(world, "game_occlusion_culling_resolution")
-"""
-
class WORLD_PT_game_physics(WorldButtonsPanel):
__label__ = "Physics"
def draw(self, context):
layout = self.layout
+
gs = context.scene.game_data
- flow = layout.column_flow()
- flow.itemR(gs, "physics_engine")
- if gs.physics_engine != "NONE":
- flow.itemR(gs, "physics_gravity", text="Gravity")
+
+ layout.itemR(gs, "physics_engine")
+ if gs.physics_engine != 'NONE':
+ layout.itemR(gs, "physics_gravity", text="Gravity")
split = layout.split()
+
col = split.column()
col.itemL(text="Physics Steps:")
- colsub = col.column(align=True)
- colsub.itemR(gs, "physics_step_max", text="Max")
- colsub.itemR(gs, "physics_step_sub", text="Substeps")
+ sub = col.column(align=True)
+ sub.itemR(gs, "physics_step_max", text="Max")
+ sub.itemR(gs, "physics_step_sub", text="Substeps")
col.itemR(gs, "fps", text="FPS")
col = split.column()
col.itemL(text="Logic Steps:")
col.itemR(gs, "logic_step_max", text="Max")
- col.itemS()
- col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
- colsub = col.column()
- colsub.active = gs.use_occlusion_culling
- colsub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
+ col = layout.column()
+ col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
+ sub = col.column()
+ sub.active = gs.use_occlusion_culling
+ sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
else:
split = layout.split()
+
col = split.column()
col.itemL(text="Physics Steps:")
col.itemR(gs, "fps", text="FPS")
+
col = split.column()
col.itemL(text="Logic Steps:")
col.itemR(gs, "logic_step_max", text="Max")
@@ -306,4 +405,3 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
bpy.types.register(WORLD_PT_game_context_world)
bpy.types.register(WORLD_PT_game_world)
bpy.types.register(WORLD_PT_game_physics)
-
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index 66eca1a14b8..dc11731d7a9 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -2,29 +2,33 @@
import bpy
class MaterialButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "material"
+ # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
- return (context.material != None)
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_preview(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_preview"
__label__ = "Preview"
+ COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def draw(self, context):
- layout = self.layout
- mat = context.material
-
- layout.template_preview(mat)
+ self.layout.template_preview(context.material)
class MATERIAL_PT_context_material(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_context_material"
__show_header__ = False
+ COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
- return (context.object)
+ # An exception, dont call the parent poll func because
+ # this manages materials for all engine types
+
+ engine = context.scene.render_data.engine
+ return (context.object) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -40,12 +44,11 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
col = row.column(align=True)
- col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
- col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
+ col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
- if context.edit_object:
+ if ob.mode == 'EDIT':
row = layout.row(align=True)
-
row.itemO("object.material_slot_assign", text="Assign")
row.itemO("object.material_slot_select", text="Select")
row.itemO("object.material_slot_deselect", text="Deselect")
@@ -56,359 +59,458 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
split.template_ID(ob, "active_material", new="material.new")
row = split.row()
if slot:
- row.itemR(slot, "link", expand=True)
+ row.itemR(slot, "link", text="")
else:
row.itemL()
elif mat:
split.template_ID(space, "pin_id")
split.itemS()
+
+ layout.itemR(mat, "type", expand=True)
-class MATERIAL_PT_material(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_material"
+class MATERIAL_PT_shading(MaterialButtonsPanel):
__label__ = "Shading"
+ COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+ def poll(self, context):
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
- ob = context.object
- slot = context.material_slot
- space = context.space_data
-
- if mat:
- layout.itemR(mat, "type", expand=True)
- if mat.type in ('SURFACE', 'WIRE', 'VOLUME'):
- split = layout.split()
+ if mat.type in ('SURFACE', 'WIRE'):
+ split = layout.split()
- sub = split.column()
- sub.itemR(mat, "alpha", slider=True)
- sub.itemR(mat, "ambient", slider=True)
- sub.itemR(mat, "emit")
- sub.itemR(mat, "translucency", slider=True)
+ col = split.column()
+ sub = col.column()
+ sub.active = not mat.shadeless
+ sub.itemR(mat, "emit")
+ sub.itemR(mat, "ambient")
+ sub = col.column()
+ sub.itemR(mat, "translucency")
- sub = split.column()
- sub.itemR(mat, "z_transparency")
- sub.itemR(mat, "shadeless")
- sub.itemR(mat, "tangent_shading")
- sub.itemR(mat, "cubic", slider=True)
+ col = split.column()
+ col.itemR(mat, "shadeless")
+ sub = col.column()
+ sub.active = not mat.shadeless
+ sub.itemR(mat, "tangent_shading")
+ sub.itemR(mat, "cubic")
- elif mat.type == 'HALO':
- layout.itemR(mat, "alpha", slider=True)
+ elif mat.type == 'HALO':
+ layout.itemR(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_strand"
__label__ = "Strand"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def poll(self, context):
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
- tan = context.material.strand
+
mat = context.material
+ tan = mat.strand
split = layout.split()
- sub = split.column()
- sub.itemL(text="Size:")
- sub.itemR(tan, "start_size", text="Root")
- sub.itemR(tan, "end_size", text="Tip")
- sub.itemR(tan, "min_size", text="Minimum")
- sub.itemR(tan, "blender_units")
- colsub = sub.column()
- colsub.active = mat.shadeless== False
- colsub.itemR(tan, "tangent_shading")
-
- sub = split.column()
- sub.itemR(tan, "shape")
- sub.itemR(tan, "width_fade")
- sub.itemR(tan, "uv_layer")
- colsub = sub.column()
- colsub.active = mat.shadeless== False
- colsub.itemR(tan, "surface_diffuse")
- colsubsub = colsub.column()
- colsubsub.active = tan.surface_diffuse
- colsubsub.itemR(tan, "blend_distance", text="Distance")
+ col = split.column(align=True)
+ col.itemL(text="Size:")
+ col.itemR(tan, "root_size", text="Root")
+ col.itemR(tan, "tip_size", text="Tip")
+ col.itemR(tan, "min_size", text="Minimum")
+ col.itemR(tan, "blender_units")
+ sub = col.column()
+ sub.active = (not mat.shadeless)
+ sub.itemR(tan, "tangent_shading")
+ col.itemR(tan, "shape")
+
+ col = split.column()
+ col.itemL(text="Shading:")
+ col.itemR(tan, "width_fade")
+ col.itemR(tan, "uv_layer")
+ col.itemS()
+ sub = col.column()
+ sub.active = (not mat.shadeless)
+ sub.itemR(tan, "surface_diffuse")
+ sub = col.column()
+ sub.active = tan.surface_diffuse
+ sub.itemR(tan, "blend_distance", text="Distance")
+
+class MATERIAL_PT_physics(MaterialButtonsPanel):
+ __label__ = "Physics"
+ COMPAT_ENGINES = set(['BLENDER_GAME'])
+
+ def draw(self, context):
+ layout = self.layout
+
+ phys = context.material.physics
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(phys, "distance")
+ col.itemR(phys, "friction")
+ col.itemR(phys, "align_to_normal")
+
+ col = split.column()
+ col.itemR(phys, "force", slider=True)
+ col.itemR(phys, "elasticity", slider=True)
+ col.itemR(phys, "damp", slider=True)
class MATERIAL_PT_options(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_options"
__label__ = "Options"
+ COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+ def poll(self, context):
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
+
mat = context.material
split = layout.split()
- sub = split.column()
- sub.itemR(mat, "traceable")
- sub.itemR(mat, "full_oversampling")
- sub.itemR(mat, "sky")
- sub.itemR(mat, "exclude_mist")
- sub.itemR(mat, "invert_z")
-
- col = sub.column(align=True)
- col.itemL(text="Light Group:")
- col.itemR(mat, "light_group", text="")
- row = col.row()
+ col = split.column()
+ col.itemR(mat, "traceable")
+ col.itemR(mat, "full_oversampling")
+ col.itemR(mat, "sky")
+ col.itemR(mat, "exclude_mist")
+ col.itemR(mat, "invert_z")
+ sub = col.column(align=True)
+ sub.itemL(text="Light Group:")
+ sub.itemR(mat, "light_group", text="")
+ row = sub.row()
row.active = mat.light_group
row.itemR(mat, "light_group_exclusive", text="Exclusive")
- sub = split.column()
- sub.itemR(mat, "face_texture")
- colsub = sub.column()
- colsub.active = mat.face_texture
- colsub.itemR(mat, "face_texture_alpha")
- sub.itemR(mat, "vertex_color_paint")
- sub.itemR(mat, "vertex_color_light")
- sub.itemR(mat, "object_color")
-
-class MATERIAL_PT_shadows(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_shadows"
- __label__ = "Shadows"
+ col = split.column()
+ col.itemR(mat, "face_texture")
+ sub = col.column()
+ sub.active = mat.face_texture
+ sub.itemR(mat, "face_texture_alpha")
+ col.itemS()
+ col.itemR(mat, "vertex_color_paint")
+ col.itemR(mat, "vertex_color_light")
+ col.itemR(mat, "object_color")
+
+class MATERIAL_PT_shadow(MaterialButtonsPanel):
+ __label__ = "Shadow"
+ __default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
+
+ def poll(self, context):
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
+
mat = context.material
split = layout.split()
- sub = split.column()
- sub.itemR(mat, "shadows", text="Receive")
- sub.itemR(mat, "transparent_shadows", text="Receive Transparent")
- sub.itemR(mat, "only_shadow", text="Shadows Only")
- sub.itemR(mat, "cast_shadows_only", text="Cast Only")
- sub.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True)
- sub = split.column()
- sub.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
- colsub = sub.column()
- colsub.active = not mat.ray_shadow_bias
- colsub.itemR(mat, "shadow_ray_bias", text="Ray Shadow Bias")
- sub.itemR(mat, "cast_buffer_shadows")
+ col = split.column()
+ col.itemR(mat, "shadows", text="Receive")
+ col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
+ col.itemR(mat, "only_shadow", text="Shadows Only")
+ col.itemR(mat, "cast_shadows_only", text="Cast Only")
+ col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
+
+ col = split.column()
+ col.itemR(mat, "cast_buffer_shadows")
+ sub = col.column()
+ sub.active = mat.cast_buffer_shadows
sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
-
+ col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
+ sub = col.column()
+ sub.active = (not mat.ray_shadow_bias)
+ sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_diffuse"
__label__ = "Diffuse"
+ COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = context.material
- return (mat and mat.type != 'HALO')
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
+
mat = context.material
split = layout.split()
- sub = split.column()
- sub.itemR(mat, "diffuse_color", text="")
- row = sub.row()
- row.active = mat.shadeless== False
- row.itemR(mat, "diffuse_reflection", text="Intensity", slider=True)
+ col = split.column()
+ col.itemR(mat, "diffuse_color", text="")
+ sub = col.column()
+ sub.active = (not mat.shadeless)
+ sub.itemR(mat, "diffuse_intensity", text="Intensity")
- sub = split.column()
- sub.active = mat.shadeless== False
- sub.itemR(mat, "diffuse_shader", text="")
- sub.itemR(mat, "use_diffuse_ramp", text="Ramp")
+ col = split.column()
+ col.active = (not mat.shadeless)
+ col.itemR(mat, "diffuse_shader", text="")
+ col.itemR(mat, "use_diffuse_ramp", text="Ramp")
- split = layout.split()
- split.active = mat.shadeless== False
- sub = split.column()
+ col = layout.column()
+ col.active = (not mat.shadeless)
if mat.diffuse_shader == 'OREN_NAYAR':
- sub.itemR(mat, "roughness")
- if mat.diffuse_shader == 'MINNAERT':
- sub.itemR(mat, "darkness")
- if mat.diffuse_shader == 'TOON':
- sub.itemR(mat, "diffuse_toon_size", text="Size")
- sub = split.column()
- sub.itemR(mat, "diffuse_toon_smooth", text="Smooth")
- if mat.diffuse_shader == 'FRESNEL':
- sub.itemR(mat, "diffuse_fresnel", text="Fresnel")
- sub = split.column()
- sub.itemR(mat, "diffuse_fresnel_factor", text="Factor")
-
+ col.itemR(mat, "roughness")
+ elif mat.diffuse_shader == 'MINNAERT':
+ col.itemR(mat, "darkness")
+ elif mat.diffuse_shader == 'TOON':
+ row = col.row()
+ row.itemR(mat, "diffuse_toon_size", text="Size")
+ row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
+ elif mat.diffuse_shader == 'FRESNEL':
+ row = col.row()
+ row.itemR(mat, "diffuse_fresnel", text="Fresnel")
+ row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
+
if mat.use_diffuse_ramp:
+ layout.itemS()
layout.template_color_ramp(mat.diffuse_ramp, expand=True)
-
+ layout.itemS()
+ row = layout.row()
+ split = row.split(percentage=0.3)
+ split.itemL(text="Input:")
+ split.itemR(mat, "diffuse_ramp_input", text="")
+ split = row.split(percentage=0.3)
+ split.itemL(text="Blend:")
+ split.itemR(mat, "diffuse_ramp_blend", text="")
+
class MATERIAL_PT_specular(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_specular"
__label__ = "Specular"
+ COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = context.material
- return (mat and mat.type != 'HALO')
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
+
mat = context.material
- layout.active = mat.shadeless== False
+ layout.active = (not mat.shadeless)
split = layout.split()
- sub = split.column()
- sub.itemR(mat, "specular_color", text="")
- sub.itemR(mat, "specular_reflection", text="Intensity", slider=True)
+ col = split.column()
+ col.itemR(mat, "specular_color", text="")
+ col.itemR(mat, "specular_intensity", text="Intensity")
- sub = split.column()
- sub.itemR(mat, "specular_shader", text="")
- sub.itemR(mat, "use_specular_ramp", text="Ramp")
-
- split = layout.split()
-
- sub = split.column()
+ col = split.column()
+ col.itemR(mat, "specular_shader", text="")
+ col.itemR(mat, "use_specular_ramp", text="Ramp")
+
+ col = layout.column()
if mat.specular_shader in ('COOKTORR', 'PHONG'):
- sub.itemR(mat, "specular_hardness", text="Hardness")
- if mat.specular_shader == 'BLINN':
- sub.itemR(mat, "specular_hardness", text="Hardness")
- sub = split.column()
- sub.itemR(mat, "specular_ior", text="IOR")
- if mat.specular_shader == 'WARDISO':
- sub.itemR(mat, "specular_slope", text="Slope")
- if mat.specular_shader == 'TOON':
- sub.itemR(mat, "specular_toon_size", text="Size")
- sub = split.column()
- sub.itemR(mat, "specular_toon_smooth", text="Smooth")
+ col.itemR(mat, "specular_hardness", text="Hardness")
+ elif mat.specular_shader == 'BLINN':
+ row = col.row()
+ row.itemR(mat, "specular_hardness", text="Hardness")
+ row.itemR(mat, "specular_ior", text="IOR")
+ elif mat.specular_shader == 'WARDISO':
+ col.itemR(mat, "specular_slope", text="Slope")
+ elif mat.specular_shader == 'TOON':
+ row = col.row()
+ row.itemR(mat, "specular_toon_size", text="Size")
+ row.itemR(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
+ layout.itemS()
layout.template_color_ramp(mat.specular_ramp, expand=True)
+ layout.itemS()
+ row = layout.row()
+ split = row.split(percentage=0.3)
+ split.itemL(text="Input:")
+ split.itemR(mat, "specular_ramp_input", text="")
+ split = row.split(percentage=0.3)
+ split.itemL(text="Blend:")
+ split.itemR(mat, "specular_ramp_blend", text="")
class MATERIAL_PT_sss(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_sss"
__label__ = "Subsurface Scattering"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
- return (mat and (mat.type == 'SURFACE' or mat.type == 'WIRE'))
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
- layout = self.layout
sss = context.material.subsurface_scattering
-
- layout.itemR(sss, "enabled", text="")
+ mat = context.material
+
+ self.layout.active = (not mat.shadeless)
+ self.layout.itemR(sss, "enabled", text="")
def draw(self, context):
layout = self.layout
- sss = context.material.subsurface_scattering
+
mat = context.material
+ sss = context.material.subsurface_scattering
+
layout.active = sss.enabled
split = layout.split()
- split.active = mat.shadeless== False
+ split.active = (not mat.shadeless)
- sub = split.column()
- sub.itemR(sss, "color", text="")
+ col = split.column()
+ col.itemR(sss, "ior")
+ col.itemR(sss, "scale")
+ col.itemR(sss, "color", text="")
+ col.itemR(sss, "radius", text="RGB Radius")
+
+ col = split.column()
+ sub = col.column(align=True)
sub.itemL(text="Blend:")
- sub.itemR(sss, "color_factor", slider=True)
- sub.itemR(sss, "texture_factor", slider=True)
+ sub.itemR(sss, "color_factor", text="Color")
+ sub.itemR(sss, "texture_factor", text="Texture")
sub.itemL(text="Scattering Weight:")
sub.itemR(sss, "front")
sub.itemR(sss, "back")
-
- sub = split.column()
- sub.itemR(sss, "ior")
- sub.itemR(sss, "scale")
- sub.itemR(sss, "radius", text="RGB Radius")
- sub.itemR(sss, "error_tolerance")
+ col.itemS()
+ col.itemR(sss, "error_tolerance", text="Error")
-class MATERIAL_PT_raymir(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_raymir"
- __label__ = "Ray Mirror"
+class MATERIAL_PT_mirror(MaterialButtonsPanel):
+ __label__ = "Mirror"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
- return (mat and (mat.type == 'SURFACE' or mat.type == 'WIRE'))
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
- def draw_header(self, context):
- layout = self.layout
+ def draw_header(self, context):
raym = context.material.raytrace_mirror
- layout.itemR(raym, "enabled", text="")
+ self.layout.itemR(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
- raym = context.material.raytrace_mirror
+
mat = context.material
+ raym = context.material.raytrace_mirror
layout.active = raym.enabled
split = layout.split()
- sub = split.column()
- sub.itemR(raym, "reflect", text="Reflectivity", slider=True)
- sub.itemR(mat, "mirror_color", text="")
- sub.itemR(raym, "fresnel")
- sub.itemR(raym, "fresnel_fac", text="Fac", slider=True)
-
- sub = split.column()
- sub.itemR(raym, "gloss", slider=True)
- colsub = sub.column()
- colsub.active = raym.gloss < 1
- colsub.itemR(raym, "gloss_threshold", slider=True, text="Threshold")
- colsub.itemR(raym, "gloss_samples", text="Samples")
- colsub.itemR(raym, "gloss_anisotropic", slider=True, text="Anisotropic")
+ col = split.column()
+ col.itemR(raym, "reflect_factor")
+ col.itemR(mat, "mirror_color", text="")
+
+ col = split.column()
+ col.itemR(raym, "fresnel")
+ sub = col.column()
+ sub.active = raym.fresnel > 0
+ sub.itemR(raym, "fresnel_factor", text="Blend")
- row = layout.row()
- row.itemR(raym, "distance", text="Max Dist")
- row.itemR(raym, "depth")
+ split = layout.split()
- layout.itemR(raym, "fade_to")
+ col = split.column()
+ col.itemS()
+ col.itemR(raym, "distance", text="Max Dist")
+ col.itemR(raym, "depth")
+ col.itemS()
+ sub = col.split(percentage=0.4)
+ sub.itemL(text="Fade To:")
+ sub.itemR(raym, "fade_to", text="")
-class MATERIAL_PT_raytransp(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_raytransp"
- __label__= "Ray Transparency"
+ col = split.column()
+ col.itemL(text="Gloss:")
+ col.itemR(raym, "gloss_factor", text="Amount")
+ sub = col.column()
+ sub.active = raym.gloss_factor < 1.0
+ sub.itemR(raym, "gloss_threshold", text="Threshold")
+ sub.itemR(raym, "gloss_samples", text="Samples")
+ sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
+
+class MATERIAL_PT_transp(MaterialButtonsPanel):
+ __label__= "Transparency"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
- return (mat and (mat.type == 'SURFACE' or mat.type == 'WIRE'))
-
- def draw_header(self, context):
- layout = self.layout
- rayt = context.material.raytrace_transparency
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
- layout.itemR(rayt, "enabled", text="")
+ def draw_header(self, context):
+ mat = context.material
+ self.layout.itemR(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
- rayt = context.material.raytrace_transparency
+
mat = context.material
+ rayt = context.material.raytrace_transparency
- layout.active = rayt.enabled
+ row = layout.row()
+ row.active = mat.transparency and (not mat.shadeless)
+ row.itemR(mat, "transparency_method", expand=True)
split = layout.split()
- split.active = mat.shadeless== False
-
- sub = split.column()
- sub.itemR(rayt, "ior")
- sub.itemR(rayt, "fresnel")
- sub.itemR(rayt, "fresnel_fac", text="Fac", slider=True)
-
- sub = split.column()
- sub.itemR(rayt, "gloss", slider=True)
- colsub = sub.column()
- colsub.active = rayt.gloss < 1
- colsub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold")
- colsub.itemR(rayt, "gloss_samples", text="Samples")
-
- flow = layout.column_flow()
- flow.active = mat.shadeless== False
- flow.itemR(rayt, "filter", slider=True)
- flow.itemR(rayt, "limit")
- flow.itemR(rayt, "falloff")
- flow.itemR(rayt, "specular_opacity", slider=True, text="Spec Opacity")
- flow.itemR(rayt, "depth")
+ col = split.column()
+ col.itemR(mat, "alpha")
+ row = col.row()
+ row.active = mat.transparency and (not mat.shadeless)
+ row.itemR(mat, "specular_alpha", text="Specular")
+
+ col = split.column()
+ col.active = (not mat.shadeless)
+ col.itemR(rayt, "fresnel")
+ sub = col.column()
+ sub.active = rayt.fresnel > 0
+ sub.itemR(rayt, "fresnel_factor", text="Blend")
+
+ if mat.transparency_method == 'RAYTRACE':
+ layout.itemS()
+ split = layout.split()
+ split.active = mat.transparency
+
+ col = split.column()
+ col.itemR(rayt, "ior")
+ col.itemR(rayt, "filter")
+ col.itemR(rayt, "falloff")
+ col.itemR(rayt, "limit")
+ col.itemR(rayt, "depth")
+
+ col = split.column()
+ col.itemL(text="Gloss:")
+ col.itemR(rayt, "gloss_factor", text="Amount")
+ sub = col.column()
+ sub.active = rayt.gloss_factor < 1.0
+ sub.itemR(rayt, "gloss_threshold", text="Threshold")
+ sub.itemR(rayt, "gloss_samples", text="Samples")
+
class MATERIAL_PT_halo(MaterialButtonsPanel):
- __idname__= "MATERIAL_PT_halo"
__label__= "Halo"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
- return (mat and mat.type == 'HALO')
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -422,50 +524,190 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
col.itemR(mat, "diffuse_color", text="")
col.itemR(halo, "size")
col.itemR(halo, "hardness")
- col.itemR(halo, "add", slider=True)
-
+ col.itemR(halo, "add")
col.itemL(text="Options:")
- col.itemR(halo, "use_texture", text="Texture")
- col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
+ col.itemR(halo, "texture")
+ col.itemR(halo, "vertex_normal")
col.itemR(halo, "xalpha")
col.itemR(halo, "shaded")
col.itemR(halo, "soft")
col = split.column()
- col = col.column()
col.itemR(halo, "ring")
- colsub = col.column()
- colsub.active = halo.ring
- colsub.itemR(halo, "rings")
- colsub.itemR(mat, "mirror_color", text="")
+ sub = col.column()
+ sub.active = halo.ring
+ sub.itemR(halo, "rings")
+ sub.itemR(mat, "mirror_color", text="")
+ col.itemS()
col.itemR(halo, "lines")
- colsub = col.column()
- colsub.active = halo.lines
- colsub.itemR(halo, "line_number", text="Lines")
- colsub.itemR(mat, "specular_color", text="")
+ sub = col.column()
+ sub.active = halo.lines
+ sub.itemR(halo, "line_number", text="Lines")
+ sub.itemR(mat, "specular_color", text="")
+ col.itemS()
col.itemR(halo, "star")
- colsub = col.column()
- colsub.active = halo.star
- colsub.itemR(halo, "star_tips")
- col.itemR(halo, "flare_mode")
- colsub = col.column()
- colsub.active = halo.flare_mode
- colsub.itemR(halo, "flare_size", text="Size")
- colsub.itemR(halo, "flare_subsize", text="Subsize")
- colsub.itemR(halo, "flare_boost", text="Boost")
- colsub.itemR(halo, "flare_seed", text="Seed")
- colsub.itemR(halo, "flares_sub", text="Sub")
-
+ sub = col.column()
+ sub.active = halo.star
+ sub.itemR(halo, "star_tips")
+
+class MATERIAL_PT_flare(MaterialButtonsPanel):
+ __label__= "Flare"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def poll(self, context):
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
+
+ def draw_header(self, context):
+ layout = self.layout
+
+ mat = context.material
+ halo = mat.halo
+ layout.itemR(halo, "flare_mode", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.material
+ halo = mat.halo
+ layout.active = halo.flare_mode
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(halo, "flare_size", text="Size")
+ col.itemR(halo, "flare_boost", text="Boost")
+ col.itemR(halo, "flare_seed", text="Seed")
+ col = split.column()
+ col.itemR(halo, "flares_sub", text="Subflares")
+ col.itemR(halo, "flare_subsize", text="Subsize")
+
bpy.types.register(MATERIAL_PT_context_material)
bpy.types.register(MATERIAL_PT_preview)
-bpy.types.register(MATERIAL_PT_material)
bpy.types.register(MATERIAL_PT_diffuse)
bpy.types.register(MATERIAL_PT_specular)
-bpy.types.register(MATERIAL_PT_raymir)
-bpy.types.register(MATERIAL_PT_raytransp)
+bpy.types.register(MATERIAL_PT_shading)
+bpy.types.register(MATERIAL_PT_transp)
+bpy.types.register(MATERIAL_PT_mirror)
bpy.types.register(MATERIAL_PT_sss)
bpy.types.register(MATERIAL_PT_halo)
+bpy.types.register(MATERIAL_PT_flare)
+bpy.types.register(MATERIAL_PT_physics)
bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options)
-bpy.types.register(MATERIAL_PT_shadows)
+bpy.types.register(MATERIAL_PT_shadow)
+
+# Volumetrics
+class VolumeButtonsPanel(bpy.types.Panel):
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
+ __context__ = "material"
+
+ def poll(self, context):
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
+
+class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
+ __label__ = "Shading"
+ __default_closed__ = False
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.material
+ vol = context.material.volume
+
+ row = layout.row()
+ row.itemR(vol, "density")
+ row.itemR(vol, "scattering")
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(vol, "absorption")
+ col.itemR(vol, "absorption_color", text="")
+
+ col = split.column()
+ col.itemR(vol, "emission")
+ col.itemR(vol, "emission_color", text="")
+
+class MATERIAL_PT_volume_scattering(VolumeButtonsPanel):
+ __label__ = "Scattering"
+ __default_closed__ = False
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def draw(self, context):
+ layout = self.layout
+
+ vol = context.material.volume
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(vol, "scattering_mode", text="")
+ if vol.scattering_mode == 'SINGLE_SCATTERING':
+ col.itemR(vol, "light_cache")
+ sub = col.column()
+ sub.active = vol.light_cache
+ sub.itemR(vol, "cache_resolution")
+ elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
+ col.itemR(vol, "cache_resolution")
+
+ col = col.column(align=True)
+ col.itemR(vol, "ms_diffusion")
+ col.itemR(vol, "ms_spread")
+ col.itemR(vol, "ms_intensity")
+
+ col = split.column()
+ # col.itemL(text="Anisotropic Scattering:")
+ col.itemR(vol, "phase_function", text="")
+ if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
+ col.itemR(vol, "asymmetry")
+
+class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
+ __label__= "Transparency"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.material
+ rayt = context.material.raytrace_transparency
+
+ row= layout.row()
+ row.itemR(mat, "transparency_method", expand=True)
+ row.active = mat.transparency and (not mat.shadeless)
+
+class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
+ __label__ = "Integration"
+ __default_closed__ = False
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.material
+ vol = context.material.volume
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Step Calculation:")
+ col.itemR(vol, "step_calculation", text="")
+ col = col.column(align=True)
+ col.itemR(vol, "step_size")
+ col.itemR(vol, "shading_step_size")
+
+ col = split.column()
+ col.itemL()
+ col.itemR(vol, "depth_cutoff")
+ col.itemR(vol, "density_scale")
+
+bpy.types.register(MATERIAL_PT_volume_shading)
+bpy.types.register(MATERIAL_PT_volume_scattering)
+bpy.types.register(MATERIAL_PT_volume_transp)
+bpy.types.register(MATERIAL_PT_volume_integration)
diff --git a/release/ui/buttons_object.py b/release/ui/buttons_object.py
index b2c8105f2bb..af2c7cfb58a 100644
--- a/release/ui/buttons_object.py
+++ b/release/ui/buttons_object.py
@@ -2,8 +2,8 @@
import bpy
class ObjectButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "object"
class OBJECT_PT_context_object(ObjectButtonsPanel):
@@ -11,10 +11,11 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
row = layout.row()
- row.itemL(text="", icon="ICON_OBJECT_DATA")
+ row.itemL(text="", icon='ICON_OBJECT_DATA')
row.itemR(ob, "name", text="")
class OBJECT_PT_transform(ObjectButtonsPanel):
@@ -22,6 +23,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
row = layout.row()
@@ -34,9 +36,11 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
split = layout.split()
+
col = split.column()
col.itemR(ob, "layers")
col.itemS()
@@ -47,7 +51,9 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
col.itemR(ob, "parent", text="")
sub = col.column()
- sub.itemR(ob, "parent_type", text="Type")
+ split = sub.split(percentage=0.3)
+ split.itemL(text="Type:")
+ split.itemR(ob, "parent_type", text="")
parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")
@@ -58,6 +64,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
split = layout.split()
@@ -72,7 +79,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
row = col.box().row()
row.itemR(group, "name", text="")
- row.itemO("object.group_remove", text="", icon="VICON_X")
+ row.itemO("object.group_remove", text="", icon='VICON_X')
split = col.box().split()
split.column().itemR(group, "layer", text="Dupli")
@@ -83,6 +90,7 @@ class OBJECT_PT_display(ObjectButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
row = layout.row()
@@ -102,6 +110,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
layout.itemR(ob, "dupli_type", expand=True)
@@ -109,13 +118,13 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
if ob.dupli_type == 'FRAMES':
split = layout.split()
- sub = split.column(align=True)
- sub.itemR(ob, "dupli_frames_start", text="Start")
- sub.itemR(ob, "dupli_frames_end", text="End")
+ col = split.column(align=True)
+ col.itemR(ob, "dupli_frames_start", text="Start")
+ col.itemR(ob, "dupli_frames_end", text="End")
- sub = split.column(align=True)
- sub.itemR(ob, "dupli_frames_on", text="On")
- sub.itemR(ob, "dupli_frames_off", text="Off")
+ col = split.column(align=True)
+ col.itemR(ob, "dupli_frames_on", text="On")
+ col.itemR(ob, "dupli_frames_off", text="Off")
layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
@@ -135,30 +144,31 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
split = layout.split()
- sub = split.column()
- sub.itemL(text="Time Offset:")
- sub.itemR(ob, "time_offset_edit", text="Edit")
- row = sub.row()
+ col = split.column()
+ col.itemL(text="Time Offset:")
+ col.itemR(ob, "time_offset_edit", text="Edit")
+ row = col.row()
row.itemR(ob, "time_offset_particle", text="Particle")
row.active = len(ob.particle_systems) != 0
- row = sub.row()
+ row = col.row()
row.itemR(ob, "time_offset_parent", text="Parent")
row.active = ob.parent != None
- row = sub.row()
+ row = col.row()
row.itemR(ob, "slow_parent")
row.active = ob.parent != None
- sub.itemR(ob, "time_offset", text="Offset")
-
- sub = split.column()
- sub.itemL(text="Track:")
- sub.itemR(ob, "track", text="")
- sub.itemR(ob, "track_axis", text="Axis")
- sub.itemR(ob, "up_axis", text="Up Axis")
- row = sub.row()
+ col.itemR(ob, "time_offset", text="Offset")
+
+ col = split.column()
+ col.itemL(text="Track:")
+ col.itemR(ob, "track", text="")
+ col.itemR(ob, "track_axis", text="Axis")
+ col.itemR(ob, "up_axis", text="Up Axis")
+ row = col.row()
row.itemR(ob, "track_override_parent", text="Override Parent")
row.active = ob.parent != None
diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py
index b239a96a16a..cdc18e3545c 100644
--- a/release/ui/buttons_object_constraint.py
+++ b/release/ui/buttons_object_constraint.py
@@ -2,59 +2,22 @@
import bpy
class ConstraintButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "constraint"
def draw_constraint(self, con):
layout = self.layout
+
box = layout.template_constraint(con)
if box:
- if con.type == "CHILD_OF":
- self.child_of(box, con)
- elif con.type == "TRACK_TO":
- self.track_to(box, con)
- elif con.type == "IK":
- self.ik(box, con)
- elif con.type == "FOLLOW_PATH":
- self.follow_path(box, con)
- elif con.type == "LIMIT_ROTATION":
- self.limit_rotation(box, con)
- elif con.type == "LIMIT_LOCATION":
- self.limit_location(box, con)
- elif con.type == "LIMIT_SCALE":
- self.limit_scale(box, con)
- elif con.type == "COPY_ROTATION":
- self.copy_rotation(box, con)
- elif con.type == "COPY_LOCATION":
- self.copy_location(box, con)
- elif con.type == "COPY_SCALE":
- self.copy_scale(box, con)
- #elif con.type == "SCRIPT":
- # self.script(box, con)
- elif con.type == "ACTION":
- self.action(box, con)
- elif con.type == "LOCKED_TRACK":
- self.locked_track(box, con)
- elif con.type == "LIMIT_DISTANCE":
- self.limit_distance(box, con)
- elif con.type == "STRETCH_TO":
- self.stretch_to(box, con)
- elif con.type == "FLOOR":
- self.floor(box, con)
- elif con.type == "RIGID_BODY_JOINT":
- self.rigid_body(box, con)
- elif con.type == "CLAMP_TO":
- self.clamp_to(box, con)
- elif con.type == "TRANSFORM":
- self.transform(box, con)
- elif con.type == "SHRINKWRAP":
- self.shrinkwrap(box, con)
-
+ # match enum type to our functions, avoids a lookup table.
+ getattr(self, con.type)(box, con)
+
# show/key buttons here are most likely obsolete now, with
# keyframing functionality being part of every button
- if con.type not in ("RIGID_BODY_JOINT", "NULL"):
+ if con.type not in ('RIGID_BODY_JOINT', 'NULL'):
box.itemR(con, "influence")
def space_template(self, layout, con, target=True, owner=True):
@@ -67,7 +30,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemR(con, "target_space", text="")
if target and owner:
- row.itemL(icon="ICON_ARROW_LEFTRIGHT")
+ row.itemL(icon='ICON_ARROW_LEFTRIGHT')
if owner:
row.itemR(con, "owner_space", text="")
@@ -76,44 +39,44 @@ class ConstraintButtonsPanel(bpy.types.Panel):
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
if con.target and subtargets:
- if con.target.type == "ARMATURE":
+ if con.target.type == 'ARMATURE':
layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
if con.type == 'COPY_LOCATION':
row = layout.row()
row.itemL(text="Head/Tail:")
row.itemR(con, "head_tail", text="")
- elif con.target.type in ("MESH", "LATTICE"):
+ elif con.target.type in ('MESH', 'LATTICE'):
layout.item_pointerR(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
- def child_of(self, layout, con):
+ def CHILD_OF(self, layout, con):
self.target_template(layout, con)
split = layout.split()
- sub = split.column()
- sub.itemL(text="Location:")
- sub.itemR(con, "locationx", text="X")
- sub.itemR(con, "locationy", text="Y")
- sub.itemR(con, "locationz", text="Z")
+ col = split.column()
+ col.itemL(text="Location:")
+ col.itemR(con, "locationx", text="X")
+ col.itemR(con, "locationy", text="Y")
+ col.itemR(con, "locationz", text="Z")
- sub = split.column()
- sub.itemL(text="Rotation:")
- sub.itemR(con, "rotationx", text="X")
- sub.itemR(con, "rotationy", text="Y")
- sub.itemR(con, "rotationz", text="Z")
+ col = split.column()
+ col.itemL(text="Rotation:")
+ col.itemR(con, "rotationx", text="X")
+ col.itemR(con, "rotationy", text="Y")
+ col.itemR(con, "rotationz", text="Z")
- sub = split.column()
- sub.itemL(text="Scale:")
- sub.itemR(con, "sizex", text="X")
- sub.itemR(con, "sizey", text="Y")
- sub.itemR(con, "sizez", text="Z")
+ col = split.column()
+ col.itemL(text="Scale:")
+ col.itemR(con, "sizex", text="X")
+ col.itemR(con, "sizey", text="Y")
+ col.itemR(con, "sizez", text="Z")
row = layout.row()
row.itemO("constraint.childof_set_inverse")
row.itemO("constraint.childof_clear_inverse")
- def track_to(self, layout, con):
+ def TRACK_TO(self, layout, con):
self.target_template(layout, con)
row = layout.row()
@@ -127,27 +90,35 @@ class ConstraintButtonsPanel(bpy.types.Panel):
self.space_template(layout, con)
- def ik(self, layout, con):
+ def IK(self, layout, con):
self.target_template(layout, con)
layout.itemR(con, "pole_target")
- if con.pole_target and con.pole_target.type == "ARMATURE":
+
+ if con.pole_target and con.pole_target.type == 'ARMATURE':
layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
- col = layout.column_flow()
+ split = layout.split()
+
+ col = split.column()
col.itemR(con, "iterations")
- col.itemR(con, "pole_angle")
- col.itemR(con, "weight")
- col.itemR(con, "orient_weight")
col.itemR(con, "chain_length")
+ sub = col.column()
+ sub.active = con.pole_target
+ sub.itemR(con, "pole_angle")
+ col.itemL(text="Weight:")
+ col.itemR(con, "weight", text="Position", slider=True)
+ sub = col.column()
+ sub.active = con.rotation
+ sub.itemR(con, "orient_weight", text="Rotation", slider=True)
- col = layout.column_flow()
+ col = split.column()
col.itemR(con, "tail")
col.itemR(con, "rotation")
col.itemR(con, "targetless")
col.itemR(con, "stretch")
- def follow_path(self, layout, con):
+ def FOLLOW_PATH(self, layout, con):
self.target_template(layout, con)
row = layout.row()
@@ -162,30 +133,30 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemR(con, "up", text="Up")
row.itemL()
- def limit_rotation(self, layout, con):
+ def LIMIT_ROTATION(self, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_limit_x")
- colsub = col.column()
- colsub.active = con.use_limit_x
- colsub.itemR(con, "minimum_x", text="Min")
- colsub.itemR(con, "maximum_x", text="Max")
+ sub = col.column()
+ sub.active = con.use_limit_x
+ sub.itemR(con, "minimum_x", text="Min")
+ sub.itemR(con, "maximum_x", text="Max")
col = split.column()
col.itemR(con, "use_limit_y")
- colsub = col.column()
- colsub.active = con.use_limit_y
- colsub.itemR(con, "minimum_y", text="Min")
- colsub.itemR(con, "maximum_y", text="Max")
+ sub = col.column()
+ sub.active = con.use_limit_y
+ sub.itemR(con, "minimum_y", text="Min")
+ sub.itemR(con, "maximum_y", text="Max")
col = split.column()
col.itemR(con, "use_limit_z")
- colsub = col.column()
- colsub.active = con.use_limit_z
- colsub.itemR(con, "minimum_z", text="Min")
- colsub.itemR(con, "maximum_z", text="Max")
+ sub = col.column()
+ sub.active = con.use_limit_z
+ sub.itemR(con, "minimum_z", text="Min")
+ sub.itemR(con, "maximum_z", text="Max")
row = layout.row()
row.itemR(con, "limit_transform")
@@ -195,38 +166,38 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
- def limit_location(self, layout, con):
+ def LIMIT_LOCATION(self, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_minimum_x")
- colsub = col.column()
- colsub.active = con.use_minimum_x
- colsub.itemR(con, "minimum_x", text="")
+ sub = col.column()
+ sub.active = con.use_minimum_x
+ sub.itemR(con, "minimum_x", text="")
col.itemR(con, "use_maximum_x")
- colsub = col.column()
- colsub.active = con.use_maximum_x
- colsub.itemR(con, "maximum_x", text="")
+ sub = col.column()
+ sub.active = con.use_maximum_x
+ sub.itemR(con, "maximum_x", text="")
col = split.column()
col.itemR(con, "use_minimum_y")
- colsub = col.column()
- colsub.active = con.use_minimum_y
- colsub.itemR(con, "minimum_y", text="")
+ sub = col.column()
+ sub.active = con.use_minimum_y
+ sub.itemR(con, "minimum_y", text="")
col.itemR(con, "use_maximum_y")
- colsub = col.column()
- colsub.active = con.use_maximum_y
- colsub.itemR(con, "maximum_y", text="")
+ sub = col.column()
+ sub.active = con.use_maximum_y
+ sub.itemR(con, "maximum_y", text="")
col = split.column()
col.itemR(con, "use_minimum_z")
- colsub = col.column()
- colsub.active = con.use_minimum_z
- colsub.itemR(con, "minimum_z", text="")
+ sub = col.column()
+ sub.active = con.use_minimum_z
+ sub.itemR(con, "minimum_z", text="")
col.itemR(con, "use_maximum_z")
- colsub = col.column()
- colsub.active = con.use_maximum_z
- colsub.itemR(con, "maximum_z", text="")
+ sub = col.column()
+ sub.active = con.use_maximum_z
+ sub.itemR(con, "maximum_z", text="")
row = layout.row()
row.itemR(con, "limit_transform")
@@ -236,38 +207,38 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
- def limit_scale(self, layout, con):
+ def LIMIT_SCALE(self, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_minimum_x")
- colsub = col.column()
- colsub.active = con.use_minimum_x
- colsub.itemR(con, "minimum_x", text="")
+ sub = col.column()
+ sub.active = con.use_minimum_x
+ sub.itemR(con, "minimum_x", text="")
col.itemR(con, "use_maximum_x")
- colsub = col.column()
- colsub.active = con.use_maximum_x
- colsub.itemR(con, "maximum_x", text="")
+ sub = col.column()
+ sub.active = con.use_maximum_x
+ sub.itemR(con, "maximum_x", text="")
col = split.column()
col.itemR(con, "use_minimum_y")
- colsub = col.column()
- colsub.active = con.use_minimum_y
- colsub.itemR(con, "minimum_y", text="")
+ sub = col.column()
+ sub.active = con.use_minimum_y
+ sub.itemR(con, "minimum_y", text="")
col.itemR(con, "use_maximum_y")
- colsub = col.column()
- colsub.active = con.use_maximum_y
- colsub.itemR(con, "maximum_y", text="")
+ sub = col.column()
+ sub.active = con.use_maximum_y
+ sub.itemR(con, "maximum_y", text="")
col = split.column()
col.itemR(con, "use_minimum_z")
- colsub = col.column()
- colsub.active = con.use_minimum_z
- colsub.itemR(con, "minimum_z", text="")
+ sub = col.column()
+ sub.active = con.use_minimum_z
+ sub.itemR(con, "minimum_z", text="")
col.itemR(con, "use_maximum_z")
- colsub = col.column()
- colsub.active = con.use_maximum_z
- colsub.itemR(con, "maximum_z", text="")
+ sub = col.column()
+ sub.active = con.use_maximum_z
+ sub.itemR(con, "maximum_z", text="")
row = layout.row()
row.itemR(con, "limit_transform")
@@ -277,61 +248,61 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
- def copy_rotation(self, layout, con):
+ def COPY_ROTATION(self, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "rotate_like_x", text="X")
- colsub = col.column()
- colsub.active = con.rotate_like_x
- colsub.itemR(con, "invert_x", text="Invert")
+ sub = col.column()
+ sub.active = con.rotate_like_x
+ sub.itemR(con, "invert_x", text="Invert")
col = split.column()
col.itemR(con, "rotate_like_y", text="Y")
- colsub = col.column()
- colsub.active = con.rotate_like_y
- colsub.itemR(con, "invert_y", text="Invert")
+ sub = col.column()
+ sub.active = con.rotate_like_y
+ sub.itemR(con, "invert_y", text="Invert")
col = split.column()
col.itemR(con, "rotate_like_z", text="Z")
- colsub = col.column()
- colsub.active = con.rotate_like_z
- colsub.itemR(con, "invert_z", text="Invert")
+ sub = col.column()
+ sub.active = con.rotate_like_z
+ sub.itemR(con, "invert_z", text="Invert")
layout.itemR(con, "offset")
self.space_template(layout, con)
- def copy_location(self, layout, con):
+ def COPY_LOCATION(self, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "locate_like_x", text="X")
- colsub = col.column()
- colsub.active = con.locate_like_x
- colsub.itemR(con, "invert_x", text="Invert")
+ sub = col.column()
+ sub.active = con.locate_like_x
+ sub.itemR(con, "invert_x", text="Invert")
col = split.column()
col.itemR(con, "locate_like_y", text="Y")
- colsub = col.column()
- colsub.active = con.locate_like_y
- colsub.itemR(con, "invert_y", text="Invert")
+ sub = col.column()
+ sub.active = con.locate_like_y
+ sub.itemR(con, "invert_y", text="Invert")
col = split.column()
col.itemR(con, "locate_like_z", text="Z")
- colsub = col.column()
- colsub.active = con.locate_like_z
- colsub.itemR(con, "invert_z", text="Invert")
+ sub = col.column()
+ sub.active = con.locate_like_z
+ sub.itemR(con, "invert_z", text="Invert")
layout.itemR(con, "offset")
self.space_template(layout, con)
- def copy_scale(self, layout, con):
+ def COPY_SCALE(self, layout, con):
self.target_template(layout, con)
row = layout.row(align=True)
@@ -343,9 +314,9 @@ class ConstraintButtonsPanel(bpy.types.Panel):
self.space_template(layout, con)
- #def script(self, layout, con):
+ #def SCRIPT(self, layout, con):
- def action(self, layout, con):
+ def ACTION(self, layout, con):
self.target_template(layout, con)
layout.itemR(con, "action")
@@ -365,7 +336,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
- def locked_track(self, layout, con):
+ def LOCKED_TRACK(self, layout, con):
self.target_template(layout, con)
row = layout.row()
@@ -376,7 +347,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Lock:")
row.itemR(con, "locked", expand=True)
- def limit_distance(self, layout, con):
+ def LIMIT_DISTANCE(self, layout, con):
self.target_template(layout, con)
col = layout.column(align=True);
@@ -387,12 +358,12 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Clamp Region:")
row.itemR(con, "limit_mode", text="")
- def stretch_to(self, layout, con):
+ def STRETCH_TO(self, layout, con):
self.target_template(layout, con)
- col = layout.column(align=True)
- col.itemR(con, "original_length", text="Rest Length")
- col.itemO("constraint.stretchto_reset")
+ row = layout.row()
+ row.itemR(con, "original_length", text="Rest Length")
+ row.itemO("constraint.stretchto_reset", text="Reset")
col = layout.column()
col.itemR(con, "bulge", text="Volume Variation")
@@ -403,7 +374,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Plane:")
row.itemR(con, "keep_axis", expand=True)
- def floor(self, layout, con):
+ def FLOOR(self, layout, con):
self.target_template(layout, con)
row = layout.row()
@@ -416,7 +387,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.itemL(text="Min/Max:")
row.itemR(con, "floor_location", expand=True)
- def rigid_body(self, layout, con):
+ def RIGID_BODY_JOINT(self, layout, con):
self.target_template(layout, con)
layout.itemR(con, "pivot_type")
@@ -424,23 +395,25 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row = layout.row()
row.itemR(con, "disable_linked_collision", text="No Collision")
- row.itemR(con, "draw_pivot")
+ row.itemR(con, "draw_pivot", text="Display Pivot")
split = layout.split()
- col = split.column()
- col.itemR(con, "pivot_x")
- col.itemR(con, "pivot_y")
- col.itemR(con, "pivot_z")
+ col = split.column(align=True)
+ col.itemL(text="Pivot:")
+ col.itemR(con, "pivot_x", text="X")
+ col.itemR(con, "pivot_y", text="Y")
+ col.itemR(con, "pivot_z", text="Z")
- col = split.column()
- col.itemR(con, "axis_x")
- col.itemR(con, "axis_y")
- col.itemR(con, "axis_z")
+ col = split.column(align=True)
+ col.itemL(text="Axis:")
+ col.itemR(con, "axis_x", text="X")
+ col.itemR(con, "axis_y", text="Y")
+ col.itemR(con, "axis_z", text="Z")
#Missing: Limit arrays (not wrapped in RNA yet)
- def clamp_to(self, layout, con):
+ def CLAMP_TO(self, layout, con):
self.target_template(layout, con)
row = layout.row()
@@ -450,7 +423,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row = layout.row()
row.itemR(con, "cyclic")
- def transform(self, layout, con):
+ def TRANSFORM(self, layout, con):
self.target_template(layout, con)
layout.itemR(con, "extrapolate_motion", text="Extrapolate")
@@ -499,13 +472,13 @@ class ConstraintButtonsPanel(bpy.types.Panel):
self.space_template(layout, con)
- def shrinkwrap (self, layout, con):
+ def SHRINKWRAP (self, layout, con):
self.target_template(layout, con)
layout.itemR(con, "distance")
layout.itemR(con, "shrinkwrap_type")
- if con.shrinkwrap_type == "PROJECT":
+ if con.shrinkwrap_type == 'PROJECT':
row = layout.row(align=True)
row.itemR(con, "axis_x")
row.itemR(con, "axis_y")
@@ -516,11 +489,11 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel):
__context__ = "constraint"
def poll(self, context):
- return (context.object != None)
+ return (context.object)
def draw(self, context):
- ob = context.object
layout = self.layout
+ ob = context.object
row = layout.row()
row.item_menu_enumO("object.constraint_add", "type")
@@ -535,12 +508,13 @@ class BONE_PT_constraints(ConstraintButtonsPanel):
def poll(self, context):
ob = context.object
- return (ob and ob.type == "ARMATURE" and context.bone)
+ return (ob and ob.type == 'ARMATURE' and context.bone)
def draw(self, context):
+ layout = self.layout
+
ob = context.object
pchan = ob.pose.pose_channels[context.bone.name]
- layout = self.layout
row = layout.row()
row.item_menu_enumO("pose.constraint_add", "type")
diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py
index f35d15bbb80..0b18b7c2072 100644
--- a/release/ui/buttons_particle.py
+++ b/release/ui/buttons_particle.py
@@ -2,17 +2,83 @@
import bpy
def particle_panel_enabled(psys):
- return psys.point_cache.baked==False and psys.editable==False
+ return psys.point_cache.baked==False and psys.edited==False
def particle_panel_poll(context):
psys = context.particle_system
if psys==None: return False
if psys.settings==None: return False
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
+
+def point_cache_ui(self, cache, enabled, particles, smoke):
+ layout = self.layout
+ layout.set_context_pointer("PointCache", cache)
+
+ row = layout.row()
+ row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 )
+ col = row.column(align=True)
+ col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
+ col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
+
+ row = layout.row()
+ row.itemL(text="File Name:")
+ if particles:
+ row.itemR(cache, "external")
+
+ if cache.external:
+ split = layout.split(percentage=0.80)
+ split.itemR(cache, "name", text="")
+ split.itemR(cache, "index", text="")
+
+ layout.itemL(text="File Path:")
+ layout.itemR(cache, "filepath", text="")
+
+ layout.itemL(text=cache.info)
+ else:
+ layout.itemR(cache, "name", text="")
+
+ if not particles:
+ row = layout.row()
+ row.enabled = enabled
+ row.itemR(cache, "start_frame")
+ row.itemR(cache, "end_frame")
+
+ row = layout.row()
+
+ if cache.baked == True:
+ row.itemO("ptcache.free_bake", text="Free Bake")
+ else:
+ row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
+
+ sub = row.row()
+ sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
+ sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
+
+ row = layout.row()
+ row.enabled = enabled
+ row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
+ row.itemR(cache, "step");
+
+ if not smoke:
+ row = layout.row()
+ sub = row.row()
+ sub.enabled = enabled
+ sub.itemR(cache, "quick_cache")
+ row.itemR(cache, "disk_cache")
+
+ layout.itemL(text=cache.info)
+
+ layout.itemS()
+
+ row = layout.row()
+ row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
+ row.itemO("ptcache.free_bake_all", text="Free All Bakes")
+ layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
+
class ParticleButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "particle"
def poll(self, context):
@@ -32,13 +98,22 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
if ob:
row = layout.row()
- row.template_list(ob, "particle_systems", ob, "active_particle_system_index")
+ row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
col = row.column(align=True)
- col.itemO("object.particle_system_add", icon="ICON_ZOOMIN", text="")
- col.itemO("object.particle_system_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("object.particle_system_add", icon='ICON_ZOOMIN', text="")
+ col.itemO("object.particle_system_remove", icon='ICON_ZOOMOUT', text="")
- if psys:
+ if psys and not psys.settings:
+ split = layout.split(percentage=0.32)
+ col = split.column()
+ col.itemL(text="Name:")
+ col.itemL(text="Settings:")
+
+ col = split.column()
+ col.itemR(psys, "name", text="")
+ col.template_ID(psys, "settings", new="particle.new")
+ elif psys:
part = psys.settings
split = layout.split(percentage=0.32)
@@ -69,10 +144,10 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
split = layout.split(percentage=0.65)
if part.type=='HAIR':
- if psys.editable==True:
- split.itemO("particle.editable_set", text="Free Edit")
+ if psys.edited==True:
+ split.itemO("particle.edited_clear", text="Free Edit")
else:
- split.itemO("particle.editable_set", text="Make Editable")
+ split.itemL(text="")
row = split.row()
row.enabled = particle_panel_enabled(psys)
row.itemR(part, "hair_step")
@@ -96,7 +171,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel):
psys = context.particle_system
part = psys.settings
- layout.enabled = particle_panel_enabled(psys)
+ layout.enabled = particle_panel_enabled(psys) and not psys.multiple_caches
row = layout.row()
row.itemR(part, "amount")
@@ -149,68 +224,8 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
layout = self.layout
psys = context.particle_system
- part = psys.settings
- cache = psys.point_cache
-
- row = layout.row()
- row.itemL(text="File Name:")
- row.itemR(cache, "external")
-
- if cache.external:
- split = layout.split(percentage=0.80)
- split.itemR(cache, "name", text="")
- split.itemR(cache, "index", text="")
-
- layout.itemL(text="File Path:")
- layout.itemR(cache, "filepath", text="")
-
- layout.itemL(text=cache.info)
-
- split = layout.split()
-
- col = split.column(align=True)
- col.itemR(part, "start")
- col.itemR(part, "end")
-
- col = split.column(align=True)
- col.itemR(part, "lifetime")
- col.itemR(part, "random_lifetime", slider=True)
- else:
- layout.itemR(cache, "name", text="")
-
- row = layout.row()
-
- if cache.baked == True:
- row.itemO("ptcache.free_bake_particle_system", text="Free Bake")
- else:
- row.item_booleanO("ptcache.cache_particle_system", "bake", True, text="Bake")
-
- subrow = row.row()
- subrow.enabled = (cache.frames_skipped or cache.outdated) and particle_panel_enabled(psys)
- subrow.itemO("ptcache.cache_particle_system", text="Calculate to Current Frame")
-
- row = layout.row()
- row.enabled = particle_panel_enabled(psys)
- row.itemO("ptcache.bake_from_particles_cache", text="Current Cache to Bake")
- row.itemR(cache, "step");
-
- row = layout.row()
- row.enabled = particle_panel_enabled(psys)
- row.itemR(cache, "quick_cache")
- row.itemR(cache, "disk_cache")
-
- layout.itemL(text=cache.info)
-
- layout.itemS()
-
- row = layout.row()
- row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
- row.itemO("ptcache.free_bake_all", text="Free All Bakes")
- layout.itemO("ptcache.bake_all", text="Update All Dynamics to current frame")
- # for particles these are figured out automatically
- #row.itemR(cache, "start_frame")
- #row.itemR(cache, "end_frame")
+ point_cache_ui(self, psys.point_cache, particle_panel_enabled(psys), 1, 0)
class PARTICLE_PT_initial(ParticleButtonsPanel):
__label__ = "Velocity"
@@ -392,12 +407,12 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
col = row.column()
subrow = col.row()
subcol = subrow.column(align=True)
- subcol.itemO("particle.new_target", icon="ICON_ZOOMIN", text="")
- subcol.itemO("particle.remove_target", icon="ICON_ZOOMOUT", text="")
+ subcol.itemO("particle.new_target", icon='ICON_ZOOMIN', text="")
+ subcol.itemO("particle.remove_target", icon='ICON_ZOOMOUT', text="")
subrow = col.row()
subcol = subrow.column(align=True)
- subcol.itemO("particle.target_move_up", icon="VICON_MOVE_UP", text="")
- subcol.itemO("particle.target_move_down", icon="VICON_MOVE_DOWN", text="")
+ subcol.itemO("particle.target_move_up", icon='VICON_MOVE_UP', text="")
+ subcol.itemO("particle.target_move_down", icon='VICON_MOVE_DOWN', text="")
key = psys.active_particle_target
if key:
@@ -442,11 +457,11 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
#row.template_list(boids, "states", boids, "active_boid_state_index", compact="True")
#col = row.row()
#subrow = col.row(align=True)
- #subrow.itemO("boid.boidstate_add", icon="ICON_ZOOMIN", text="")
- #subrow.itemO("boid.boidstate_del", icon="ICON_ZOOMOUT", text="")
+ #subrow.itemO("boid.boidstate_add", icon='ICON_ZOOMIN', text="")
+ #subrow.itemO("boid.boidstate_del", icon='ICON_ZOOMOUT', text="")
#subrow = row.row(align=True)
- #subrow.itemO("boid.boidstate_move_up", icon="VICON_MOVE_UP", text="")
- #subrow.itemO("boid.boidstate_move_down", icon="VICON_MOVE_DOWN", text="")
+ #subrow.itemO("boid.boidstate_move_up", icon='VICON_MOVE_UP', text="")
+ #subrow.itemO("boid.boidstate_move_down", icon='VICON_MOVE_DOWN', text="")
state = boids.active_boid_state
@@ -465,12 +480,12 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
col = row.column()
subrow = col.row()
subcol = subrow.column(align=True)
- subcol.item_menu_enumO("boid.boidrule_add", "type", icon="ICON_ZOOMIN", text="")
- subcol.itemO("boid.boidrule_del", icon="ICON_ZOOMOUT", text="")
+ subcol.item_menu_enumO("boid.boidrule_add", "type", icon='ICON_ZOOMIN', text="")
+ subcol.itemO("boid.boidrule_del", icon='ICON_ZOOMOUT', text="")
subrow = col.row()
subcol = subrow.column(align=True)
- subcol.itemO("boid.boidrule_move_up", icon="VICON_MOVE_UP", text="")
- subcol.itemO("boid.boidrule_move_down", icon="VICON_MOVE_DOWN", text="")
+ subcol.itemO("boid.boidrule_move_up", icon='VICON_MOVE_UP', text="")
+ subcol.itemO("boid.boidrule_move_down", icon='VICON_MOVE_DOWN', text="")
rule = state.active_boid_rule
@@ -478,8 +493,8 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
row = layout.row()
row.itemR(rule, "name", text="")
#somebody make nice icons for boids here please! -jahka
- row.itemR(rule, "in_air", icon="VICON_MOVE_UP", text="")
- row.itemR(rule, "on_land", icon="VICON_MOVE_DOWN", text="")
+ row.itemR(rule, "in_air", icon='VICON_MOVE_UP', text="")
+ row.itemR(rule, "on_land", icon='VICON_MOVE_DOWN', text="")
row = layout.row()
@@ -703,9 +718,8 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
col = row.column()
col.itemR(part, "material_color", text="Use material color")
- if (path):
- box = col.box()
- box.itemR(part, "draw_step")
+ if (path):
+ col.itemR(part, "draw_step")
else:
subcol = col.column()
subcol.active = part.material_color==False
diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py
index 372dc32d063..5cdca3c2c74 100644
--- a/release/ui/buttons_physics_cloth.py
+++ b/release/ui/buttons_physics_cloth.py
@@ -1,9 +1,14 @@
import bpy
+from buttons_particle import point_cache_ui
+
+def cloth_panel_enabled(md):
+ return md.point_cache.baked==False
+
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
@@ -16,11 +21,12 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
def draw(self, context):
layout = self.layout
+
md = context.cloth
ob = context.object
split = layout.split()
- split.operator_context = "EXEC_DEFAULT"
+ split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
@@ -32,36 +38,40 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
row.itemR(md, "realtime", text="")
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", "CLOTH", text="Add")
+ split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add")
split.itemL()
if md:
cloth = md.settings
+
+ layout.active = cloth_panel_enabled(md)
split = layout.split()
col = split.column()
- col.itemR(cloth, "quality", slider=True)
+ col.itemL(text="Quality:")
+ col.itemR(cloth, "quality", text="Steps",slider=True)
col.itemL(text="Gravity:")
col.itemR(cloth, "gravity", text="")
col.itemR(cloth, "pin_cloth", text="Pin")
- colsub = col.column(align=True)
- colsub.active = cloth.pin_cloth
- colsub.itemR(cloth, "pin_stiffness", text="Stiffness")
- colsub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
+ sub = col.column(align=True)
+ sub.active = cloth.pin_cloth
+ sub.itemR(cloth, "pin_stiffness", text="Stiffness")
+ sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.itemL(text="Presets...")
+ col.itemL(text="TODO!")
col.itemL(text="Material:")
- colsub = col.column(align=True)
- colsub.itemR(cloth, "mass")
- colsub.itemR(cloth, "structural_stiffness", text="Structural")
- colsub.itemR(cloth, "bending_stiffness", text="Bending")
+ sub = col.column(align=True)
+ sub.itemR(cloth, "mass")
+ sub.itemR(cloth, "structural_stiffness", text="Structural")
+ sub.itemR(cloth, "bending_stiffness", text="Bending")
col.itemL(text="Damping:")
- colsub = col.column(align=True)
- colsub.itemR(cloth, "spring_damping", text="Spring")
- colsub.itemR(cloth, "air_damping", text="Air")
+ sub = col.column(align=True)
+ sub.itemR(cloth, "spring_damping", text="Spring")
+ sub.itemR(cloth, "air_damping", text="Air")
# Disabled for now
"""
@@ -79,81 +89,46 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
__default_closed__ = True
def poll(self, context):
- return (context.cloth != None)
+ return (context.cloth)
def draw(self, context):
- layout = self.layout
-
- cache = context.cloth.point_cache
-
- row = layout.row()
- row.itemR(cache, "name")
-
- row = layout.row()
- row.itemR(cache, "start_frame")
- row.itemR(cache, "end_frame")
-
- row = layout.row()
-
- if cache.baked == True:
- row.itemO("ptcache.free_bake_cloth", text="Free Bake")
- else:
- row.item_booleanO("ptcache.cache_cloth", "bake", True, text="Bake")
-
- subrow = row.row()
- subrow.enabled = cache.frames_skipped or cache.outdated
- subrow.itemO("ptcache.cache_cloth", text="Calculate to Current Frame")
-
- row = layout.row()
- #row.enabled = particle_panel_enabled(psys)
- row.itemO("ptcache.bake_from_cloth_cache", text="Current Cache to Bake")
- row.itemR(cache, "step");
-
- row = layout.row()
- #row.enabled = particle_panel_enabled(psys)
- row.itemR(cache, "quick_cache")
- row.itemR(cache, "disk_cache")
-
- layout.itemL(text=cache.info)
-
- layout.itemS()
-
- row = layout.row()
- row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
- row.itemO("ptcache.free_bake_all", text="Free All Bakes")
- layout.itemO("ptcache.bake_all", text="Update All Dynamics to current frame")
+ md = context.cloth
+ point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0)
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
__label__ = "Cloth Collision"
__default_closed__ = True
def poll(self, context):
- return (context.cloth != None)
+ return (context.cloth)
def draw_header(self, context):
- layout = self.layout
cloth = context.cloth.collision_settings
-
- layout.itemR(cloth, "enable_collision", text="")
+
+ self.layout.active = cloth_panel_enabled(context.cloth)
+ self.layout.itemR(cloth, "enable_collision", text="")
def draw(self, context):
layout = self.layout
+
cloth = context.cloth.collision_settings
- split = layout.split()
+ md = context.cloth
+
+ layout.active = cloth.enable_collision and cloth_panel_enabled(md)
- layout.active = cloth.enable_collision
+ split = layout.split()
- col = split.column(align=True)
+ col = split.column()
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
col.itemR(cloth, "min_distance", slider=True, text="Distance")
col.itemR(cloth, "friction")
- col = split.column(align=True)
+ col = split.column()
col.itemR(cloth, "enable_self_collision", text="Self Collision")
- col = col.column(align=True)
- col.active = cloth.enable_self_collision
- col.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
- col.itemR(cloth, "self_min_distance", slider=True, text="Distance")
+ sub = col.column()
+ sub.active = cloth.enable_self_collision
+ sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
+ sub.itemR(cloth, "self_min_distance", slider=True, text="Distance")
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
__label__ = "Cloth Stiffness Scaling"
@@ -163,31 +138,33 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
return (context.cloth != None)
def draw_header(self, context):
- layout = self.layout
cloth = context.cloth.settings
- layout.itemR(cloth, "stiffness_scaling", text="")
+ self.layout.active = cloth_panel_enabled(context.cloth)
+ self.layout.itemR(cloth, "stiffness_scaling", text="")
def draw(self, context):
layout = self.layout
+
+ md = context.cloth
ob = context.object
cloth = context.cloth.settings
- layout.active = cloth.stiffness_scaling
+ layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemL(text="Structural Stiffness:")
- colsub = col.column(align=True)
- colsub.itemR(cloth, "structural_stiffness_max", text="Max")
- colsub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
+ sub = col.column(align=True)
+ sub.itemR(cloth, "structural_stiffness_max", text="Max")
+ sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.itemL(text="Bending Stiffness:")
- colsub = col.column(align=True)
- colsub.itemR(cloth, "bending_stiffness_max", text="Max")
- colsub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
+ sub = col.column(align=True)
+ sub.itemR(cloth, "bending_stiffness_max", text="Max")
+ sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
bpy.types.register(PHYSICS_PT_cloth)
bpy.types.register(PHYSICS_PT_cloth_cache)
diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py
index 180133f599e..58033d2c431 100644
--- a/release/ui/buttons_physics_field.py
+++ b/release/ui/buttons_physics_field.py
@@ -2,13 +2,13 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
rd = context.scene.render_data
- return (context.object != None) and (not rd.use_game_engine)
+ return (context.object) and (not rd.use_game_engine)
class PHYSICS_PT_field(PhysicButtonsPanel):
__label__ = "Force Fields"
@@ -16,152 +16,145 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
def draw(self, context):
layout = self.layout
+
ob = context.object
field = ob.field
#layout.active = field.enabled
- split = layout.split(percentage=0.3)
+ split = layout.split(percentage=0.2)
split.itemL(text="Type:")
- split.itemR(field, "type", text=""
- )
-
+ split.itemR(field, "type",text="")
+
split = layout.split()
- sub = split.column()
-
- if field.type == "GUIDE":
- sub = col.column()
- sub.itemR(field, "guide_path_add")
+ if field.type == 'GUIDE':
+ layout.itemR(field, "guide_path_add")
- if field.type == "WIND":
- sub.itemR(field, "strength")
- sub = split.column()
- sub.itemR(field, "noise")
- sub.itemR(field, "seed")
-
-
- if field.type == "VORTEX":
- sub.itemR(field, "strength")
- sub = split.column()
- sub.itemL(text="")
+ elif field.type == 'WIND':
+ split.itemR(field, "strength")
+
+ col = split.column()
+ col.itemR(field, "noise")
+ col.itemR(field, "seed")
- if field.type in ("SPHERICAL", "CHARGE", "LENNARDJ"):
- sub.itemR(field, "strength")
- sub = split.column()
- sub.itemR(field, "planar")
- sub.itemR(field, "surface")
-
- if field.type == "BOID":
- sub.itemR(field, "strength")
- sub = split.column()
- sub.itemR(field, "surface")
-
- if field.type == "MAGNET":
- sub.itemR(field, "strength")
- sub = split.column()
- sub.itemR(field, "planar")
-
- if field.type == "HARMONIC":
- sub.itemR(field, "strength")
- sub.itemR(field, "harmonic_damping", text="Damping")
- sub = split.column()
- sub.itemR(field, "surface")
- sub.itemR(field, "planar")
-
- if field.type == "TEXTURE":
- sub.itemR(field, "strength")
- sub.itemR(field, "texture", text="")
- sub.itemR(field, "texture_mode")
- sub.itemR(field, "texture_nabla")
- sub = split.column()
- sub.itemR(field, "use_coordinates")
- sub.itemR(field, "root_coordinates")
- sub.itemR(field, "force_2d")
-
- if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "WIND", "VORTEX", "TEXTURE", "MAGNET", "BOID"):
-
+ elif field.type == 'VORTEX':
+ split.itemR(field, "strength")
+ split.itemL()
- layout.itemS()
- layout.itemL(text="Falloff:")
- layout.itemR(field, "falloff_type", expand=True)
+ elif field.type in ('SPHERICAL', 'CHARGE', 'LENNARDJ'):
+ split.itemR(field, "strength")
- row = layout.row()
- row.itemR(field, "falloff_power", text="Power")
- row.itemR(field, "positive_z", text="Positive Z")
+ col = split.column()
+ col.itemR(field, "planar")
+ col.itemR(field, "surface")
- layout.itemS()
- split = layout.split()
- sub = split.column()
+ elif field.type == 'BOID':
+ split.itemR(field, "strength")
+ split.itemR(field, "surface")
+
+ elif field.type == 'MAGNET':
+ split.itemR(field, "strength")
+ split.itemR(field, "planar")
+
+ elif field.type == 'HARMONIC':
+ col = split.column()
+ col.itemR(field, "strength")
+ col.itemR(field, "harmonic_damping", text="Damping")
+
+ col = split.column()
+ col.itemR(field, "planar")
+ col.itemR(field, "surface")
+
+ elif field.type == 'TEXTURE':
+ col = split.column()
+ col.itemR(field, "strength")
+ col.itemR(field, "texture", text="")
+ col.itemR(field, "texture_mode", text="")
+ col.itemR(field, "texture_nabla")
- sub.itemR(field, "use_min_distance", text="Minimum")
- colsub1 = sub.column()
- colsub1.active = field.use_min_distance
- colsub1.itemR(field, "minimum_distance", text="Distance")
+ col = split.column()
+ col.itemR(field, "use_coordinates")
+ col.itemR(field, "root_coordinates")
+ col.itemR(field, "force_2d")
- sub = split.column()
+ if field.type in ('HARMONIC', 'SPHERICAL', 'CHARGE', 'WIND', 'VORTEX', 'TEXTURE', 'MAGNET', 'BOID'):
- sub.itemR(field, "use_max_distance", text="Maximum")
- colsub2 = sub.column()
- colsub2.active = field.use_max_distance
- colsub2.itemR(field, "maximum_distance", text="Distance")
+ layout.itemL(text="Falloff:")
+ layout.itemR(field, "falloff_type", expand=True)
+
+ split = layout.split(percentage=0.35)
+
+ col = split.column()
+ col.itemR(field, "positive_z", text="Positive Z")
+ col.itemR(field, "use_min_distance", text="Use Minimum")
+ col.itemR(field, "use_max_distance", text="Use Maximum")
+
+ col = split.column()
+ col.itemR(field, "falloff_power", text="Power")
- if field.falloff_type == "CONE":
- layout.itemS()
- layout.itemL(text="Angular:")
+ sub = col.column()
+ sub.active = field.use_min_distance
+ sub.itemR(field, "minimum_distance", text="Distance")
+
+ sub = col.column()
+ sub.active = field.use_max_distance
+ sub.itemR(field, "maximum_distance", text="Distance")
+
+ if field.falloff_type == 'CONE':
+
+ layout.itemS()
- row = layout.row()
- row.itemR(field, "radial_falloff", text="Power")
- row.itemL(text="")
+ split = layout.split(percentage=0.35)
- split = layout.split()
- sub = split.column()
+ col = split.column()
+ col.itemL(text="Angular:")
+ col.itemR(field, "use_radial_min", text="Use Minimum")
+ col.itemR(field, "use_radial_max", text="Use Maximum")
- sub.itemR(field, "use_radial_min", text="Minimum")
- colsub1 = sub.column()
- colsub1.active = field.use_radial_min
- colsub1.itemR(field, "radial_minimum", text="Angle")
+ col = split.column()
+ col.itemR(field, "radial_falloff", text="Power")
- sub = split.column()
+ sub = col.column()
+ sub.active = field.use_radial_min
+ sub.itemR(field, "radial_minimum", text="Angle")
- sub.itemR(field, "use_radial_max", text="Maximum")
- colsub2 = sub.column()
- colsub2.active = field.use_radial_max
- colsub2.itemR(field, "radial_maximum", text="Angle")
+ sub = col.column()
+ sub.active = field.use_radial_max
+ sub.itemR(field, "radial_maximum", text="Angle")
- if field.falloff_type == "TUBE":
+ elif field.falloff_type == 'TUBE':
- layout.itemS()
- layout.itemL(text="Radial:")
- row = layout.row()
- row.itemR(field, "radial_falloff", text="Power")
- row.itemL(text="")
+ layout.itemS()
- split = layout.split()
- sub = split.column()
+ split = layout.split(percentage=0.35)
+
+ col = split.column()
+ col.itemL(text="Radial:")
+ col.itemR(field, "use_radial_min", text="Use Minimum")
+ col.itemR(field, "use_radial_max", text="Use Maximum")
- sub.itemR(field, "use_radial_min", text="Minimum")
- colsub1 = sub.column()
- colsub1.active = field.use_radial_min
- colsub1.itemR(field, "radial_minimum", text="Distance")
+ col = split.column()
+ col.itemR(field, "radial_falloff", text="Power")
- sub = split.column()
+ sub = col.column()
+ sub.active = field.use_radial_min
+ sub.itemR(field, "radial_minimum", text="Distance")
- sub.itemR(field, "use_radial_max", text="Maximum")
- colsub2 = sub.column()
- colsub2.active = field.use_radial_max
- colsub2.itemR(field, "radial_maximum", text="Distance")
+ sub = col.column()
+ sub.active = field.use_radial_max
+ sub.itemR(field, "radial_maximum", text="Distance")
- #if ob.type in "CURVE":
- #if field.type == "GUIDE":
+ #if ob.type in 'CURVE':
+ #if field.type == 'GUIDE':
#colsub = col.column(align=True)
- #if field.type != "NONE":
+ #if field.type != 'NONE':
#layout.itemR(field, "strength")
- #if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"):
- #if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"):
+ #if field.type in ('HARMONIC', 'SPHERICAL', 'CHARGE', "LENNARDj"):
+ #if ob.type in ('MESH', 'SURFACE', 'FONT', 'CURVE'):
#layout.itemR(field, "surface")
class PHYSICS_PT_collision(PhysicButtonsPanel):
@@ -172,45 +165,66 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
-
- def draw_header(self, context):
- settings = context.object.collision
- self.layout.itemR(settings, "enabled", text="")
-
+
def draw(self, context):
layout = self.layout
+
md = context.collision
- settings = context.object.collision
- layout.active = settings.enabled
-
split = layout.split()
+ split.operator_context = 'EXEC_DEFAULT'
+
+ if md:
+ # remove modifier + settings
+ split.set_context_pointer("modifier", md)
+ split.itemO("object.modifier_remove", text="Remove")
+ col = split.column()
+
+ #row = split.row(align=True)
+ #row.itemR(md, "render", text="")
+ #row.itemR(md, "realtime", text="")
+
+ coll = md.settings
+
+ else:
+ # add modifier
+ split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
+ split.itemL()
+
+ coll = None
+
+ if coll:
+ settings = context.object.collision
+
+ layout.active = settings.enabled
+
+ split = layout.split()
- col = split.column()
- col.itemL(text="Particle:")
- col.itemR(settings, "permeability", slider=True)
- col.itemL(text="Particle Damping:")
- colsub = col.column(align=True)
- colsub.itemR(settings, "damping_factor", text="Factor", slider=True)
- colsub.itemR(settings, "random_damping", text="Random", slider=True)
+ col = split.column()
+ col.itemL(text="Particle:")
+ col.itemR(settings, "permeability", slider=True)
+ col.itemL(text="Particle Damping:")
+ sub = col.column(align=True)
+ sub.itemR(settings, "damping_factor", text="Factor", slider=True)
+ sub.itemR(settings, "random_damping", text="Random", slider=True)
- col.itemL(text="Soft Body and Cloth:")
- colsub = col.column(align=True)
- colsub.itemR(settings, "outer_thickness", text="Outer", slider=True)
- colsub.itemR(settings, "inner_thickness", text="Inner", slider=True)
+ col.itemL(text="Soft Body and Cloth:")
+ sub = col.column(align=True)
+ sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
+ sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
- col.itemL(text="Force Fields:")
- layout.itemR(md, "absorption", text="Absorption")
+ layout.itemL(text="Force Fields:")
+ layout.itemR(md, "absorption", text="Absorption")
- col = split.column()
- col.itemL(text="")
- col.itemR(settings, "kill_particles")
- col.itemL(text="Particle Friction:")
- colsub = col.column(align=True)
- colsub.itemR(settings, "friction_factor", text="Factor", slider=True)
- colsub.itemR(settings, "random_friction", text="Random", slider=True)
- col.itemL(text="Soft Body Damping:")
- col.itemR(settings, "damping", text="Factor", slider=True)
+ col = split.column()
+ col.itemL(text="")
+ col.itemR(settings, "kill_particles")
+ col.itemL(text="Particle Friction:")
+ sub = col.column(align=True)
+ sub.itemR(settings, "friction_factor", text="Factor", slider=True)
+ sub.itemR(settings, "random_friction", text="Random", slider=True)
+ col.itemL(text="Soft Body Damping:")
+ col.itemR(settings, "damping", text="Factor", slider=True)
bpy.types.register(PHYSICS_PT_field)
bpy.types.register(PHYSICS_PT_collision)
diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py
index 1f56c423c13..6f7a97ff793 100644
--- a/release/ui/buttons_physics_fluid.py
+++ b/release/ui/buttons_physics_fluid.py
@@ -2,8 +2,8 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
@@ -16,11 +16,12 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
def draw(self, context):
layout = self.layout
+
md = context.fluid
ob = context.object
split = layout.split()
- split.operator_context = "EXEC_DEFAULT"
+ split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
@@ -35,73 +36,72 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", "FLUID_SIMULATION", text="Add")
+ split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add")
split.itemL()
fluid = None
if fluid:
-
- col = layout.column(align=True)
- col.itemR(fluid, "type")
+ layout.itemR(fluid, "type")
if fluid.type == 'DOMAIN':
- layout.itemO("fluid.bake", text="BAKE")
+ layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
- colsub = col.column()
- colsub.itemR(fluid, "resolution", text="Final")
- colsub.itemL(text="Render Display:")
- colsub.itemR(fluid, "render_display_mode", text="")
+ col.itemR(fluid, "resolution", text="Final")
+ col.itemL(text="Render Display:")
+ col.itemR(fluid, "render_display_mode", text="")
col.itemL(text="Time:")
- colsub = col.column(align=True)
- colsub.itemR(fluid, "start_time", text="Start")
- colsub.itemR(fluid, "end_time", text="End")
+ sub = col.column(align=True)
+ sub.itemR(fluid, "start_time", text="Start")
+ sub.itemR(fluid, "end_time", text="End")
col = split.column()
- colsub = col.column()
- colsub.itemL(text="Required Memory: " + fluid.memory_estimate)
- colsub.itemR(fluid, "preview_resolution", text="Preview")
- colsub.itemL(text="Viewport Display:")
- colsub.itemR(fluid, "viewport_display_mode", text="")
- colsub = col.column()
- colsub.itemL(text="")
- colsub.itemR(fluid, "reverse_frames")
- colsub.itemR(fluid, "generate_speed_vectors")
+ col.itemL(text="Required Memory: " + fluid.memory_estimate)
+ col.itemR(fluid, "preview_resolution", text="Preview")
+ col.itemL(text="Viewport Display:")
+ col.itemR(fluid, "viewport_display_mode", text="")
+ col.itemL()
+ col.itemR(fluid, "generate_speed_vectors")
+ col.itemR(fluid, "reverse_frames")
- layout.itemL(text="Path:")
layout.itemR(fluid, "path", text="")
- if fluid.type == 'FLUID':
+ elif fluid.type == 'FLUID':
split = layout.split()
+
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
+
col = split.column()
col.itemL(text="Initial Velocity:")
col.itemR(fluid, "initial_velocity", text="")
- if fluid.type == 'OBSTACLE':
+ elif fluid.type == 'OBSTACLE':
split = layout.split()
+
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
+
col = split.column()
col.itemL(text="Slip Type:")
- colsub=col.column(align=True)
- colsub.itemR(fluid, "slip_type", text="")
+ col.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- colsub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
+ col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
- col.itemR(fluid, "impact_factor")
+ col.itemL(text="Impact:")
+ col.itemR(fluid, "impact_factor", text="Factor")
- if fluid.type == 'INFLOW':
+ elif fluid.type == 'INFLOW':
split = layout.split()
+
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
@@ -112,33 +112,35 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col.itemL(text="Inflow Velocity:")
col.itemR(fluid, "inflow_velocity", text="")
- if fluid.type == 'OUTFLOW':
+ elif fluid.type == 'OUTFLOW':
split = layout.split()
+
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
- col = split.column()
- if fluid.type == 'PARTICLE':
- split = layout.split()
+ split.column()
+
+ elif fluid.type == 'PARTICLE':
+ split = layout.split(percentage=0.5)
col = split.column()
col.itemL(text="Influence:")
- colsub = col.column(align=True)
- colsub.itemR(fluid, "particle_influence", text="Size")
- colsub.itemR(fluid, "alpha_influence", text="Alpha")
- col.itemL(text="Path:")
-
- layout.itemR(fluid, "path", text="")
+ col.itemR(fluid, "particle_influence", text="Size")
+ col.itemR(fluid, "alpha_influence", text="Alpha")
col = split.column()
col.itemL(text="Type:")
col.itemR(fluid, "drops")
col.itemR(fluid, "floats")
+ col = split.column()
+ col.itemL()
col.itemR(fluid, "tracer")
- if fluid.type == 'CONTROL':
+ layout.itemR(fluid, "path", text="")
+
+ elif fluid.type == 'CONTROL':
split = layout.split()
col = split.column()
@@ -148,23 +150,23 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
col = split.column()
col.itemL(text="Time:")
- col=col.column(align=True)
- col.itemR(fluid, "start_time", text="Start")
- col.itemR(fluid, "end_time", text="End")
+ sub = col.column(align=True)
+ sub.itemR(fluid, "start_time", text="Start")
+ sub.itemR(fluid, "end_time", text="End")
split = layout.split()
col = split.column()
col.itemL(text="Attraction Force:")
- col=col.column(align=True)
- col.itemR(fluid, "attraction_strength", text="Strength")
- col.itemR(fluid, "attraction_radius", text="Radius")
+ sub = col.column(align=True)
+ sub.itemR(fluid, "attraction_strength", text="Strength")
+ sub.itemR(fluid, "attraction_radius", text="Radius")
col = split.column()
col.itemL(text="Velocity Force:")
- col=col.column(align=True)
- col.itemR(fluid, "velocity_strength", text="Strength")
- col.itemR(fluid, "velocity_radius", text="Radius")
+ sub = col.column(align=True)
+ sub.itemR(fluid, "velocity_strength", text="Strength")
+ sub.itemR(fluid, "velocity_radius", text="Radius")
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
__label__ = "Domain World"
@@ -173,14 +175,11 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
def poll(self, context):
md = context.fluid
if md:
- settings = md.settings
- if settings:
- return (settings.type == 'DOMAIN')
-
- return False
+ return (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
+
fluid = context.fluid.settings
split = layout.split()
@@ -188,26 +187,25 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
col = split.column()
col.itemL(text="Gravity:")
col.itemR(fluid, "gravity", text="")
-
col.itemL(text="Real World Size:")
col.itemR(fluid, "real_world_size", text="Metres")
col = split.column()
col.itemL(text="Viscosity Presets:")
- colsub=col.column(align=True)
- colsub.itemR(fluid, "viscosity_preset", text="")
+ sub = col.column(align=True)
+ sub.itemR(fluid, "viscosity_preset", text="")
if fluid.viscosity_preset == 'MANUAL':
- colsub.itemR(fluid, "viscosity_base", text="Base")
- colsub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
+ sub.itemR(fluid, "viscosity_base", text="Base")
+ sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
else:
- colsub.itemL(text="")
- colsub.itemL(text="")
+ sub.itemL()
+ sub.itemL()
col.itemL(text="Optimization:")
- col=col.column(align=True)
- col.itemR(fluid, "grid_levels", slider=True)
- col.itemR(fluid, "compressibility", slider=True)
+ sub = col.column(align=True)
+ sub.itemR(fluid, "grid_levels", slider=True)
+ sub.itemR(fluid, "compressibility", slider=True)
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
__label__ = "Domain Boundary"
@@ -216,28 +214,27 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
def poll(self, context):
md = context.fluid
if md:
- settings = md.settings
- if settings:
- return (settings.type == 'DOMAIN')
-
- return False
+ return (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
+
fluid = context.fluid.settings
split = layout.split()
+
col = split.column()
col.itemL(text="Slip Type:")
- col=col.column(align=True)
- col.itemR(fluid, "slip_type", text="")
+ sub = col.column(align=True)
+ sub.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- col.itemR(fluid, "partial_slip_amount", slider=True, text="Amount")
+ sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
+
col = split.column()
col.itemL(text="Surface:")
- col=col.column(align=True)
- col.itemR(fluid, "surface_smoothing", text="Smoothing")
- col.itemR(fluid, "surface_subdivisions", text="Subdivisions")
+ sub = col.column(align=True)
+ sub.itemR(fluid, "surface_smoothing", text="Smoothing")
+ sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")
class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
__label__ = "Domain Particles"
@@ -246,17 +243,14 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
def poll(self, context):
md = context.fluid
if md:
- settings = md.settings
- if settings:
- return (settings.type == 'DOMAIN')
-
- return False
-
+ return (md.settings.type == 'DOMAIN')
+
def draw(self, context):
layout = self.layout
+
fluid = context.fluid.settings
- col=layout.column(align=True)
+ col = layout.column(align=True)
col.itemR(fluid, "tracer_particles")
col.itemR(fluid, "generate_particles")
diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py
new file mode 100644
index 00000000000..c87f71bff42
--- /dev/null
+++ b/release/ui/buttons_physics_smoke.py
@@ -0,0 +1,226 @@
+
+import bpy
+
+from buttons_particle import point_cache_ui
+
+def smoke_panel_enabled_low(smd):
+ if smd.smoke_type == 'TYPE_DOMAIN':
+ return smd.domain.point_cache.baked==False
+ return True
+
+class PhysicButtonsPanel(bpy.types.Panel):
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
+ __context__ = "physics"
+
+ def poll(self, context):
+ ob = context.object
+ rd = context.scene.render_data
+ return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
+
+class PHYSICS_PT_smoke(PhysicButtonsPanel):
+ __label__ = "Smoke"
+
+ def draw(self, context):
+ layout = self.layout
+
+ md = context.smoke
+ ob = context.object
+
+ split = layout.split()
+ split.operator_context = 'EXEC_DEFAULT'
+
+ if md:
+ # remove modifier + settings
+ split.set_context_pointer("modifier", md)
+ split.itemO("object.modifier_remove", text="Remove")
+
+ row = split.row(align=True)
+ row.itemR(md, "render", text="")
+ row.itemR(md, "realtime", text="")
+
+ else:
+ # add modifier
+ split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
+ split.itemL()
+
+ if md:
+
+ # layout.enabled = smoke_panel_enabled(md)
+ layout.itemR(md, "smoke_type", expand=True)
+
+ if md.smoke_type == 'TYPE_DOMAIN':
+
+ domain = md.domain_settings
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Resolution:")
+ col.itemR(domain, "maxres", text="Divisions")
+
+ col = split.column()
+ col.itemL(text="Behavior:")
+ col.itemR(domain, "alpha")
+ col.itemR(domain, "beta")
+ col.itemR(domain, "dissolve_smoke", text="Dissolve")
+ sub = col.column()
+ sub.active = domain.dissolve_smoke
+ sub.itemR(domain, "dissolve_speed", text="Speed")
+ sub.itemR(domain, "dissolve_smoke_log", text="Slow")
+
+ elif md.smoke_type == 'TYPE_FLOW':
+
+ flow = md.flow_settings
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(flow, "outflow")
+ col.itemL(text="Particle System:")
+ col.item_pointerR(flow, "psys", ob, "particle_systems", text="")
+
+ if md.flow_settings.outflow:
+ col = split.column()
+ else:
+ col = split.column()
+ col.itemL(text="Behavior:")
+ col.itemR(flow, "temperature")
+ col.itemR(flow, "density")
+
+ #elif md.smoke_type == 'TYPE_COLL':
+ # layout.itemS()
+
+class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
+ __label__ = "Smoke Groups"
+ __default_closed__ = True
+
+ def poll(self, context):
+ md = context.smoke
+ return md and (md.smoke_type == 'TYPE_DOMAIN')
+
+ def draw(self, context):
+ layout = self.layout
+
+ group = context.smoke.domain_settings
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Flow Group:")
+ col.itemR(group, "fluid_group", text="")
+
+ #col.itemL(text="Effector Group:")
+ #col.itemR(group, "eff_group", text="")
+
+ col = split.column()
+ col.itemL(text="Collision Group:")
+ col.itemR(group, "coll_group", text="")
+
+class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
+ __label__ = "Smoke Cache"
+ __default_closed__ = True
+
+ def poll(self, context):
+ md = context.smoke
+ return md and (md.smoke_type == 'TYPE_DOMAIN')
+
+ def draw(self, context):
+ layout = self.layout
+
+ md = context.smoke.domain_settings
+ cache = md.point_cache
+
+ point_cache_ui(self, cache, cache.baked==False, 0, 1)
+
+class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
+ __label__ = "Smoke High Resolution"
+ __default_closed__ = True
+
+ def poll(self, context):
+ md = context.smoke
+ return md and (md.smoke_type == 'TYPE_DOMAIN')
+
+ def draw_header(self, context):
+ high = context.smoke.domain_settings
+
+ self.layout.itemR(high, "highres", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ md = context.smoke.domain_settings
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Resolution:")
+ col.itemR(md, "amplify", text="Divisions")
+
+ col = split.column()
+ col.itemL(text="Noise Method:")
+ col.row().itemR(md, "noise_type", text="")
+ col.itemR(md, "strength")
+ col.itemR(md, "show_highres")
+
+class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
+ __label__ = "Smoke Cache"
+ __default_closed__ = True
+
+ def poll(self, context):
+ return (context.smoke)
+
+ def draw(self, context):
+ layout = self.layout
+
+ md = context.smoke
+
+ cache = md.point_cache
+
+ layout.set_context_pointer("PointCache", cache)
+
+ row = layout.row()
+ row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
+ col = row.column(align=True)
+ col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
+ col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
+
+ row = layout.row()
+ row.itemR(cache, "name")
+
+ row = layout.row()
+ row.itemR(cache, "start_frame")
+ row.itemR(cache, "end_frame")
+
+ row = layout.row()
+
+ if cache.baked == True:
+ row.itemO("ptcache.free_bake", text="Free Bake")
+ else:
+ row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
+
+ subrow = row.row()
+ subrow.enabled = cache.frames_skipped or cache.outdated
+ subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
+
+ row = layout.row()
+ #row.enabled = smoke_panel_enabled(psys)
+ row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
+
+ row = layout.row()
+ #row.enabled = smoke_panel_enabled(psys)
+
+ layout.itemL(text=cache.info)
+
+ layout.itemS()
+
+ row = layout.row()
+ row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
+ row.itemO("ptcache.free_bake_all", text="Free All Bakes")
+ layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
+
+bpy.types.register(PHYSICS_PT_smoke)
+bpy.types.register(PHYSICS_PT_smoke_cache)
+bpy.types.register(PHYSICS_PT_smoke_groups)
+#bpy.types.register(PHYSICS_PT_smoke_highres)
+#bpy.types.register(PHYSICS_PT_smoke_cache_highres)
diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py
index c73bef18e73..703977a056f 100644
--- a/release/ui/buttons_physics_softbody.py
+++ b/release/ui/buttons_physics_softbody.py
@@ -1,9 +1,14 @@
import bpy
+from buttons_particle import point_cache_ui
+
+def softbody_panel_enabled(md):
+ return md.point_cache.baked==False
+
class PhysicButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
@@ -16,6 +21,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
def draw(self, context):
layout = self.layout
+
md = context.soft_body
ob = context.object
@@ -32,7 +38,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
row.itemR(md, "realtime", text="")
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", "SOFTBODY", text="Add")
+ split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
split.itemL("")
if md:
@@ -40,6 +46,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
# General
split = layout.split()
+ split.enabled = softbody_panel_enabled(md)
col = split.column()
col.itemL(text="Object:")
@@ -51,164 +58,173 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
col.itemR(softbody, "gravity")
col.itemR(softbody, "speed")
+class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
+ __label__ = "Soft Body Cache"
+ __default_closed__ = True
+
+ def poll(self, context):
+ return (context.soft_body)
+
+ def draw(self, context):
+ md = context.soft_body
+ point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0)
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
__label__ = "Soft Body Goal"
+ __default_closed__ = True
def poll(self, context):
- return (context.soft_body != None)
+ return (context.soft_body)
def draw_header(self, context):
- layout = self.layout
softbody = context.soft_body.settings
- layout.itemR(softbody, "use_goal", text="")
+ self.layout.active = softbody_panel_enabled(context.soft_body)
+ self.layout.itemR(softbody, "use_goal", text="")
def draw(self, context):
layout = self.layout
+
md = context.soft_body
+ softbody = md.settings
ob = context.object
+
+ layout.active = softbody.use_goal and softbody_panel_enabled(md)
split = layout.split()
-
- if md:
- softbody = md.settings
- layout.active = softbody.use_goal
- # Goal
- split = layout.split()
+ # Goal
+ split = layout.split()
- col = split.column()
- col.itemL(text="Goal Strengths:")
- col.itemR(softbody, "goal_default", text="Default")
- subcol = col.column(align=True)
- subcol.itemR(softbody, "goal_min", text="Minimum")
- subcol.itemR(softbody, "goal_max", text="Maximum")
+ col = split.column()
+ col.itemL(text="Goal Strengths:")
+ col.itemR(softbody, "goal_default", text="Default")
+ sub = col.column(align=True)
+ sub.itemR(softbody, "goal_min", text="Minimum")
+ sub.itemR(softbody, "goal_max", text="Maximum")
- col = split.column()
- col.itemL(text="Goal Settings:")
- col.itemR(softbody, "goal_spring", text="Stiffness")
- col.itemR(softbody, "goal_friction", text="Damping")
- layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
+ col = split.column()
+ col.itemL(text="Goal Settings:")
+ col.itemR(softbody, "goal_spring", text="Stiffness")
+ col.itemR(softbody, "goal_friction", text="Damping")
+
+ layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
__label__ = "Soft Body Edges"
+ __default_closed__ = True
def poll(self, context):
- return (context.soft_body != None)
+ return (context.soft_body)
def draw_header(self, context):
- layout = self.layout
softbody = context.soft_body.settings
- layout.itemR(softbody, "use_edges", text="")
+ self.layout.active = softbody_panel_enabled(context.soft_body)
+ self.layout.itemR(softbody, "use_edges", text="")
def draw(self, context):
layout = self.layout
+
md = context.soft_body
+ softbody = md.settings
ob = context.object
- split = layout.split()
-
- if md:
- softbody = md.settings
-
- layout.active = softbody.use_edges
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Springs:")
- col.itemR(softbody, "pull")
- col.itemR(softbody, "push")
- col.itemR(softbody, "damp")
- col.itemR(softbody, "plastic")
- col.itemR(softbody, "bending")
- col.itemR(softbody, "spring_length", text="Length")
+ layout.active = softbody.use_edges and softbody_panel_enabled(md)
- col = split.column()
- col.itemR(softbody, "stiff_quads")
- subcol = col.column()
- subcol.active = softbody.stiff_quads
- subcol.itemR(softbody, "shear")
+ split = layout.split()
- col.itemR(softbody, "new_aero", text="Aero")
- subcol = col.column()
- subcol.enabled = softbody.new_aero
- subcol.itemR(softbody, "aero", text="Factor")
-
- col.itemL(text="Collision:")
- col.itemR(softbody, "edge_collision", text="Edge")
- col.itemR(softbody, "face_collision", text="Face")
+ col = split.column()
+ col.itemL(text="Springs:")
+ col.itemR(softbody, "pull")
+ col.itemR(softbody, "push")
+ col.itemR(softbody, "damp")
+ col.itemR(softbody, "plastic")
+ col.itemR(softbody, "bending")
+ col.itemR(softbody, "spring_length", text="Length")
+
+ col = split.column()
+ col.itemR(softbody, "stiff_quads")
+ sub = col.column()
+ sub.active = softbody.stiff_quads
+ sub.itemR(softbody, "shear")
+
+ col.itemR(softbody, "new_aero", text="Aero")
+ sub = col.column()
+ sub.enabled = softbody.new_aero
+ sub.itemR(softbody, "aero", text="Factor")
+
+ col.itemL(text="Collision:")
+ col.itemR(softbody, "edge_collision", text="Edge")
+ col.itemR(softbody, "face_collision", text="Face")
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
__label__ = "Soft Body Collision"
+ __default_closed__ = True
def poll(self, context):
- return (context.soft_body != None)
+ return (context.soft_body)
def draw_header(self, context):
- layout = self.layout
softbody = context.soft_body.settings
- layout.itemR(softbody, "self_collision", text="")
+ self.layout.active = softbody_panel_enabled(context.soft_body)
+ self.layout.itemR(softbody, "self_collision", text="")
def draw(self, context):
layout = self.layout
+
md = context.soft_body
+ softbody = md.settings
ob = context.object
- split = layout.split()
+ layout.active = softbody.self_collision and softbody_panel_enabled(md)
- if md:
- softbody = md.settings
-
- layout.active = softbody.self_collision
- layout.itemL(text="Collision Type:")
- layout.itemR(softbody, "collision_type", expand=True)
+ layout.itemL(text="Collision Type:")
+ layout.itemR(softbody, "collision_type", expand=True)
- col = layout.column(align=True)
- col.itemL(text="Ball:")
- col.itemR(softbody, "ball_size", text="Size")
- col.itemR(softbody, "ball_stiff", text="Stiffness")
- col.itemR(softbody, "ball_damp", text="Dampening")
+ col = layout.column(align=True)
+ col.itemL(text="Ball:")
+ col.itemR(softbody, "ball_size", text="Size")
+ col.itemR(softbody, "ball_stiff", text="Stiffness")
+ col.itemR(softbody, "ball_damp", text="Dampening")
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
__label__ = "Soft Body Solver"
+ __default_closed__ = True
def poll(self, context):
- return (context.soft_body != None)
+ return (context.soft_body)
def draw(self, context):
layout = self.layout
+
md = context.soft_body
+ softbody = md.settings
ob = context.object
- split = layout.split()
-
- if md:
- softbody = md.settings
+ layout.active = softbody_panel_enabled(md)
- # Solver
- split = layout.split()
+ # Solver
+ split = layout.split()
- col = split.column(align=True)
- col.itemL(text="Step Size:")
- col.itemR(softbody, "minstep")
- col.itemR(softbody, "maxstep")
- col.itemR(softbody, "auto_step", text="Auto-Step")
+ col = split.column(align=True)
+ col.itemL(text="Step Size:")
+ col.itemR(softbody, "minstep")
+ col.itemR(softbody, "maxstep")
+ col.itemR(softbody, "auto_step", text="Auto-Step")
- col = split.column()
- col.itemR(softbody, "error_limit")
-
- col.itemL(text="Helpers:")
- col.itemR(softbody, "choke")
- col.itemR(softbody, "fuzzy")
+ col = split.column()
+ col.itemR(softbody, "error_limit")
+ col.itemL(text="Helpers:")
+ col.itemR(softbody, "choke")
+ col.itemR(softbody, "fuzzy")
- layout.itemL(text="Diagnostics:")
- layout.itemR(softbody, "diagnose")
+ layout.itemL(text="Diagnostics:")
+ layout.itemR(softbody, "diagnose")
bpy.types.register(PHYSICS_PT_softbody)
+bpy.types.register(PHYSICS_PT_softbody_cache)
bpy.types.register(PHYSICS_PT_softbody_goal)
bpy.types.register(PHYSICS_PT_softbody_edge)
bpy.types.register(PHYSICS_PT_softbody_collision)
diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py
index 8b6bcb98e06..3c321f11f6e 100644
--- a/release/ui/buttons_scene.py
+++ b/release/ui/buttons_scene.py
@@ -2,33 +2,38 @@
import bpy
class RenderButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "scene"
-
+ # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
def poll(self, context):
rd = context.scene.render_data
- return (not rd.use_game_engine)
+ return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
class SCENE_PT_render(RenderButtonsPanel):
__label__ = "Render"
-
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
row = layout.row()
- row.itemO("screen.render", text="Image", icon='ICON_IMAGE_COL')
- row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_SEQUENCE')
+ row.itemO("screen.render", text="Image", icon='ICON_RENDER_RESULT')
+ row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
layout.itemR(rd, "display_mode", text="Display")
class SCENE_PT_layers(RenderButtonsPanel):
__label__ = "Layers"
__default_closed__ = True
-
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
def draw(self, context):
layout = self.layout
+
scene = context.scene
rd = scene.render_data
@@ -36,12 +41,13 @@ class SCENE_PT_layers(RenderButtonsPanel):
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
col = row.column(align=True)
- col.itemO("scene.render_layer_add", icon="ICON_ZOOMIN", text="")
- col.itemO("scene.render_layer_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
+ col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
rl = rd.layers[rd.active_layer_index]
split = layout.split()
+
col = split.column()
col.itemR(scene, "visible_layers", text="Scene")
col = split.column()
@@ -52,6 +58,7 @@ class SCENE_PT_layers(RenderButtonsPanel):
layout.itemS()
layout.itemL(text="Include:")
+
split = layout.split()
col = split.column()
@@ -79,6 +86,7 @@ class SCENE_PT_layers(RenderButtonsPanel):
layout.itemS()
split = layout.split()
+
col = split.column()
col.itemL(text="Passes:")
col.itemR(rl, "pass_combined")
@@ -95,25 +103,27 @@ class SCENE_PT_layers(RenderButtonsPanel):
col.itemR(rl, "pass_diffuse")
row = col.row()
row.itemR(rl, "pass_specular")
- row.itemR(rl, "pass_specular_exclude", text="", icon="ICON_X")
+ row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_shadow")
- row.itemR(rl, "pass_shadow_exclude", text="", icon="ICON_X")
+ row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_ao")
- row.itemR(rl, "pass_ao_exclude", text="", icon="ICON_X")
+ row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_reflection")
- row.itemR(rl, "pass_reflection_exclude", text="", icon="ICON_X")
+ row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_refraction")
- row.itemR(rl, "pass_refraction_exclude", text="", icon="ICON_X")
+ row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
class SCENE_PT_shading(RenderButtonsPanel):
__label__ = "Shading"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
split = layout.split()
@@ -132,9 +142,11 @@ class SCENE_PT_shading(RenderButtonsPanel):
class SCENE_PT_performance(RenderButtonsPanel):
__label__ = "Performance"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
split = layout.split()
@@ -142,41 +154,34 @@ class SCENE_PT_performance(RenderButtonsPanel):
col = split.column(align=True)
col.itemL(text="Threads:")
col.row().itemR(rd, "threads_mode", expand=True)
- colsub = col.column()
- colsub.enabled = rd.threads_mode == 'THREADS_FIXED'
- colsub.itemR(rd, "threads")
-
- col = split.column()
-
- sub = col.column(align=True)
- sub.itemL(text="Tiles:")
- sub.itemR(rd, "parts_x", text="X")
- sub.itemR(rd, "parts_y", text="Y")
-
- split = layout.split()
+ sub = col.column()
+ sub.enabled = rd.threads_mode == 'THREADS_FIXED'
+ sub.itemR(rd, "threads")
+ col.itemL(text="Tiles:")
+ col.itemR(rd, "parts_x", text="X")
+ col.itemR(rd, "parts_y", text="Y")
col = split.column()
col.itemL(text="Memory:")
- row = col.row()
- row.itemR(rd, "save_buffers")
- row.enabled = not rd.full_sample
-
- col = split.column()
- col.itemL()
- col.itemR(rd, "free_image_textures")
- col.active = rd.use_compositing
-
- row = layout.row()
- row.active = rd.render_raytracing
- row.itemR(rd, "octree_resolution", text="Ray Tracing Octree")
-
+ sub = col.column()
+ sub.itemR(rd, "save_buffers")
+ sub.enabled = not rd.full_sample
+ sub = col.column()
+ sub.active = rd.use_compositing
+ sub.itemR(rd, "free_image_textures")
+ sub = col.column()
+ sub.active = rd.render_raytracing
+ sub.itemL(text="Ray Tracing Octree:")
+ sub.itemR(rd, "octree_resolution", text="")
class SCENE_PT_post_processing(RenderButtonsPanel):
__label__ = "Post Processing"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
split = layout.split()
@@ -184,26 +189,35 @@ class SCENE_PT_post_processing(RenderButtonsPanel):
col = split.column()
col.itemR(rd, "use_compositing")
col.itemR(rd, "use_sequencer")
-
+
col = split.column()
- row = col.row()
- row.itemR(rd, "fields", text="Fields")
- rowsub = row.row()
- rowsub.active = rd.fields
- rowsub.itemR(rd, "fields_still", text="Still")
- rowsub = col.row()
- rowsub.active = rd.fields
- rowsub.itemR(rd, "field_order", expand=True)
-
+ col.itemR(rd, "dither_intensity", text="Dither", slider=True)
+
+ layout.itemS()
+
split = layout.split()
- split.itemL()
- split.itemR(rd, "dither_intensity", text="Dither", slider=True)
+
+ col = split.column()
+ col.itemR(rd, "fields", text="Fields")
+ sub = col.column()
+ sub.active = rd.fields
+ sub.row().itemR(rd, "field_order", expand=True)
+ sub.itemR(rd, "fields_still", text="Still")
+
+ col = split.column()
+ col.itemR(rd, "edge")
+ sub = col.column()
+ sub.active = rd.edge
+ sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
+ sub.itemR(rd, "edge_color", text="")
class SCENE_PT_output(RenderButtonsPanel):
__label__ = "Output"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
layout.itemR(rd, "output_path", text="")
@@ -215,8 +229,8 @@ class SCENE_PT_output(RenderButtonsPanel):
col = split.column()
col.itemR(rd, "file_extensions")
- col.itemR(rd, "placeholders")
- col.itemR(rd, "no_overwrite")
+ col.itemR(rd, "use_overwrite")
+ col.itemR(rd, "use_placeholder")
if rd.file_format in ('AVIJPEG', 'JPEG'):
split = layout.split()
@@ -224,6 +238,7 @@ class SCENE_PT_output(RenderButtonsPanel):
elif rd.file_format == 'OPENEXR':
split = layout.split()
+
col = split.column()
col.itemR(rd, "exr_codec")
@@ -263,6 +278,7 @@ class SCENE_PT_output(RenderButtonsPanel):
class SCENE_PT_encoding(RenderButtonsPanel):
__label__ = "Encoding"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
rd = context.scene.render_data
@@ -270,9 +286,11 @@ class SCENE_PT_encoding(RenderButtonsPanel):
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
split = layout.split()
+
split.itemR(rd, "ffmpeg_format")
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
split.itemR(rd, "ffmpeg_codec")
@@ -309,15 +327,16 @@ class SCENE_PT_encoding(RenderButtonsPanel):
class SCENE_PT_antialiasing(RenderButtonsPanel):
__label__ = "Anti-Aliasing"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
rd = context.scene.render_data
- layout.itemR(rd, "antialiasing", text="")
+ self.layout.itemR(rd, "antialiasing", text="")
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
layout.active = rd.antialiasing
@@ -334,6 +353,7 @@ class SCENE_PT_antialiasing(RenderButtonsPanel):
class SCENE_PT_dimensions(RenderButtonsPanel):
__label__ = "Dimensions"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
@@ -355,9 +375,9 @@ class SCENE_PT_dimensions(RenderButtonsPanel):
sub.itemR(rd, "pixel_aspect_y", text="Y")
row = col.row()
- row.itemR(rd, "border", text="Border")
+ row.itemR(rd, "use_border", text="Border")
rowsub = row.row()
- rowsub.active = rd.border
+ rowsub.active = rd.use_border
rowsub.itemR(rd, "crop_to_border", text="Crop")
col = split.column(align=True)
@@ -373,15 +393,16 @@ class SCENE_PT_dimensions(RenderButtonsPanel):
class SCENE_PT_stamp(RenderButtonsPanel):
__label__ = "Stamp"
__default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
rd = context.scene.render_data
- layout = self.layout
- layout.itemR(rd, "render_stamp", text="")
+ self.layout.itemR(rd, "render_stamp", text="")
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
layout.active = rd.render_stamp
@@ -398,17 +419,36 @@ class SCENE_PT_stamp(RenderButtonsPanel):
col.itemR(rd, "stamp_marker", text="Marker")
col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
- sub = split.column()
- sub.active = rd.render_stamp
- sub.itemR(rd, "stamp_foreground", slider=True)
- sub.itemR(rd, "stamp_background", slider=True)
- sub.itemR(rd, "stamp_font_size", text="Font Size")
+ col = split.column()
+ col.active = rd.render_stamp
+ col.itemR(rd, "stamp_foreground", slider=True)
+ col.itemR(rd, "stamp_background", slider=True)
+ col.itemR(rd, "stamp_font_size", text="Font Size")
row = layout.split(percentage=0.2)
row.itemR(rd, "stamp_note", text="Note")
- rowsub = row.row()
- rowsub.active = rd.stamp_note
- rowsub.itemR(rd, "stamp_note_text", text="")
+ sub = row.row()
+ sub.active = rd.stamp_note
+ sub.itemR(rd, "stamp_note_text", text="")
+
+class SCENE_PT_unit(RenderButtonsPanel):
+ __label__ = "Units"
+ __default_closed__ = True
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def draw(self, context):
+ layout = self.layout
+
+ unit = context.scene.unit_settings
+
+ col = layout.column()
+ col.row().itemR(unit, "system", expand=True)
+
+ row = layout.row()
+ row.active = (unit.system != 'NONE')
+ row.itemR(unit, "scale_length", text="Scale")
+ row.itemR(unit, "use_separate")
+
bpy.types.register(SCENE_PT_render)
bpy.types.register(SCENE_PT_layers)
@@ -420,4 +460,4 @@ bpy.types.register(SCENE_PT_encoding)
bpy.types.register(SCENE_PT_performance)
bpy.types.register(SCENE_PT_post_processing)
bpy.types.register(SCENE_PT_stamp)
-
+bpy.types.register(SCENE_PT_unit)
diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py
index d638d1356f9..90ce40b4832 100644
--- a/release/ui/buttons_texture.py
+++ b/release/ui/buttons_texture.py
@@ -2,38 +2,39 @@
import bpy
class TextureButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "texture"
def poll(self, context):
- return (context.texture != None and context.texture.type != 'NONE')
+ tex = context.texture
+ return (tex and (tex.type != 'NONE' or tex.use_nodes))
class TEXTURE_PT_preview(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_preview"
__label__ = "Preview"
def draw(self, context):
layout = self.layout
+
tex = context.texture
+ slot = context.texture_slot
ma = context.material
la = context.lamp
wo = context.world
br = context.brush
if ma:
- layout.template_preview(tex, parent=ma)
+ layout.template_preview(tex, parent=ma, slot=slot)
elif la:
- layout.template_preview(tex, parent=la)
+ layout.template_preview(tex, parent=la, slot=slot)
elif wo:
- layout.template_preview(tex, parent=wo)
+ layout.template_preview(tex, parent=wo, slot=slot)
elif br:
- layout.template_preview(tex, parent=br)
+ layout.template_preview(tex, parent=br, slot=slot)
else:
- layout.template_preview(tex)
-
+ layout.template_preview(tex, slot=slot)
+
class TEXTURE_PT_context_texture(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_context_texture"
__show_header__ = False
def poll(self, context):
@@ -43,27 +44,18 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
layout = self.layout
tex = context.texture
- ma = context.material
- la = context.lamp
- wo = context.world
- br = context.brush
+
+ id = context.material
+ if not id: id = context.lamp
+ if not id: id = context.world
+ if not id: id = context.brush
+
space = context.space_data
- if ma:
- id = ma
- elif la:
- id = la
- elif wo:
- id = wo
- elif br:
- id = br
- else:
- id = None
-
if id:
row = layout.row()
- row.template_list(id, "textures", id, "active_texture_index", type="ICONS")
-
+ row.template_list(id, "textures", id, "active_texture_index", rows=2)
+
split = layout.split(percentage=0.65)
if id:
@@ -71,30 +63,65 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
elif tex:
split.template_ID(space, "pin_id")
- if not space.pin_id and \
- (context.sculpt_object or context.vertex_paint_object or \
- context.weight_paint_object or context.texture_paint_object):
+ if (not space.pin_id) and (
+ context.sculpt_object or
+ context.vertex_paint_object or
+ context.weight_paint_object or
+ context.texture_paint_object
+ ):
split.itemR(space, "brush_texture", text="Brush", toggle=True)
-
- layout.itemS()
if tex:
+ layout.itemR(tex, "use_nodes")
+
split = layout.split(percentage=0.2)
+
+ if tex.use_nodes:
+ slot = context.texture_slot
+ split.itemL(text="Output:")
+ split.itemR(slot, "output_node", text="")
+
+ else:
+ split.itemL(text="Type:")
+ split.itemR(tex, "type", text="")
+
+class TEXTURE_PT_colors(TextureButtonsPanel):
+ __label__ = "Colors"
+ __default_closed__ = True
+
+ def draw(self, context):
+ layout = self.layout
- col = split.column()
- col.itemL(text="Type:")
- col = split.column()
- col.itemR(tex, "type", text="")
+ tex = context.texture
+
+ layout.itemR(tex, "use_color_ramp", text="Ramp")
+ if tex.use_color_ramp:
+ layout.template_color_ramp(tex.color_ramp, expand=True)
+
+ split = layout.split()
+
+ split.itemR(tex, "rgb_factor", text="Multiply RGB")
-class TEXTURE_PT_mapping(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_mapping"
+ col = split.column()
+ col.itemL(text="Adjust:")
+ col.itemR(tex, "brightness")
+ col.itemR(tex, "contrast")
+
+# Texture Slot Panels #
+
+class TextureSlotPanel(TextureButtonsPanel):
+ def poll(self, context):
+ return (
+ context.texture_slot and
+ TextureButtonsPanel.poll(self, context)
+ )
+
+class TEXTURE_PT_mapping(TextureSlotPanel):
__label__ = "Mapping"
- def poll(self, context):
- return (context.texture_slot and context.texture and context.texture.type != 'NONE')
-
def draw(self, context):
layout = self.layout
+
ma = context.material
la = context.lamp
wo = context.world
@@ -128,10 +155,8 @@ class TEXTURE_PT_mapping(TextureButtonsPanel):
if ma:
split = layout.split(percentage=0.3)
- col = split.column()
- col.itemL(text="Projection:")
- col = split.column()
- col.itemR(tex, "mapping", text="")
+ split.itemL(text="Projection:")
+ split.itemR(tex, "mapping", text="")
split = layout.split()
@@ -149,17 +174,24 @@ class TEXTURE_PT_mapping(TextureButtonsPanel):
row.itemR(tex, "y_mapping", text="")
row.itemR(tex, "z_mapping", text="")
- row = layout.row()
- row.column().itemR(tex, "offset")
- row.column().itemR(tex, "size")
+ if br:
+ layout.itemR(tex, "brush_map_mode", expand=True)
+
+ row = layout.row()
+ row.active = tex.brush_map_mode in ('FIXED', 'TILED')
+ row.itemR(tex, "angle")
+
+ row = layout.row()
+ row.active = tex.brush_map_mode in ('TILED', '3D')
+ row.column().itemR(tex, "size")
+ else:
+ row = layout.row()
+ row.column().itemR(tex, "offset")
+ row.column().itemR(tex, "size")
-class TEXTURE_PT_influence(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_influence"
+class TEXTURE_PT_influence(TextureSlotPanel):
__label__ = "Influence"
- def poll(self, context):
- return (context.texture_slot and context.texture and context.texture.type != 'NONE' and (not context.brush))
-
def draw(self, context):
layout = self.layout
@@ -178,42 +210,58 @@ class TEXTURE_PT_influence(TextureButtonsPanel):
sub.itemR(tex, factor, text=name, slider=True)
if ma:
- split = layout.split()
-
- col = split.column()
-
- col.itemL(text="Diffuse:")
- factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
- factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
- factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
- factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
+ if ma.type in ['SURFACE', 'HALO', 'WIRE']:
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Diffuse:")
+ factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
+ factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
+ factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
+ factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
+
+ col.itemL(text="Specular:")
+ factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
+ factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
+ factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
+
+ col = split.column()
+ col.itemL(text="Shading:")
+ factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
+ factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
+ factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
+ factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
+
+ col.itemL(text="Geometry:")
+ factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
+ factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
+ factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
+
+ #sub = col.column()
+ #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
+ #sub.itemR(tex, "default_value", text="Amount", slider=True)
+ elif ma.type == 'VOLUME':
+ split = layout.split()
+
+ col = split.column()
+ factor_but(col, tex.map_density, "map_density", "density_factor", "Density")
+ factor_but(col, tex.map_emission, "map_emission", "emission_factor", "Emission")
+ factor_but(col, tex.map_absorption, "map_absorption", "absorption_factor", "Absorption")
+ factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
+
+ col = split.column()
+ col.itemL(text=" ")
+ factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color")
+ factor_but(col, tex.map_colorabsorption, "map_colorabsorption", "colorabsorption_factor", "Absorption Color")
+
- col.itemL(text="Specular:")
- factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
- factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
- factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
-
- col = split.column()
- col.itemL(text="Shading:")
- factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
- factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
- factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
- factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
-
- col.itemL(text="Geometry:")
- factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
- factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
- factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
-
- #colsub = col.column()
- #colsub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
- #colsub.itemR(tex, "default_value", text="Amount", slider=True)
elif la:
row = layout.row()
factor_but(row, tex.map_color, "map_color", "color_factor", "Color")
factor_but(row, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
elif wo:
split = layout.split()
+
col = split.column()
factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend")
factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon")
@@ -223,15 +271,15 @@ class TEXTURE_PT_influence(TextureButtonsPanel):
factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
layout.itemS()
+
split = layout.split()
col = split.column()
-
col.itemR(tex, "blend_type", text="Blend")
col.itemR(tex, "rgb_to_intensity")
- colsub = col.column()
- colsub.active = tex.rgb_to_intensity
- colsub.itemR(tex, "color", text="")
+ sub = col.column()
+ sub.active = tex.rgb_to_intensity
+ sub.itemR(tex, "color", text="")
col = split.column()
col.itemR(tex, "negate", text="Negative")
@@ -239,38 +287,20 @@ class TEXTURE_PT_influence(TextureButtonsPanel):
if ma or wo:
col.itemR(tex, "default_value", text="DVar", slider=True)
-class TEXTURE_PT_colors(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_colors"
- __label__ = "Colors"
- __default_closed__ = True
+# Texture Type Panels #
- def draw(self, context):
- layout = self.layout
+class TextureTypePanel(TextureButtonsPanel):
+ def poll(self, context):
tex = context.texture
+ return (tex and tex.type == self.tex_type and not tex.use_nodes)
- layout.itemR(tex, "use_color_ramp", text="Ramp")
- if tex.use_color_ramp:
- layout.template_color_ramp(tex.color_ramp, expand=True)
-
- split = layout.split()
- col = split.column()
- col.itemR(tex, "rgb_factor", text="Multiply RGB")
-
- col = split.column()
- col.itemL(text="Adjust:")
- col.itemR(tex, "brightness")
- col.itemR(tex, "contrast")
-
-class TEXTURE_PT_clouds(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_clouds"
+class TEXTURE_PT_clouds(TextureTypePanel):
__label__ = "Clouds"
-
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'CLOUDS')
+ tex_type = 'CLOUDS'
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemR(tex, "stype", expand=True)
@@ -278,21 +308,18 @@ class TEXTURE_PT_clouds(TextureButtonsPanel):
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
- col = layout.column_flow()
- col.itemR(tex, "noise_size", text="Size")
- col.itemR(tex, "noise_depth", text="Depth")
- col.itemR(tex, "nabla", text="Nabla")
+ flow = layout.column_flow()
+ flow.itemR(tex, "noise_size", text="Size")
+ flow.itemR(tex, "noise_depth", text="Depth")
+ flow.itemR(tex, "nabla", text="Nabla")
-class TEXTURE_PT_wood(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_wood"
+class TEXTURE_PT_wood(TextureTypePanel):
__label__ = "Wood"
-
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'WOOD')
+ tex_type = 'WOOD'
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemR(tex, "noisebasis2", expand=True)
@@ -304,22 +331,19 @@ class TEXTURE_PT_wood(TextureButtonsPanel):
col.row().itemR(tex, "noise_type", text="Type", expand=True)
col.itemR(tex, "noise_basis", text="Basis")
- col = layout.column_flow()
- col.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
- col.itemR(tex, "noise_size", text="Size")
- col.itemR(tex, "turbulence")
- col.itemR(tex, "nabla")
+ flow = layout.column_flow()
+ flow.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
+ flow.itemR(tex, "noise_size", text="Size")
+ flow.itemR(tex, "turbulence")
+ flow.itemR(tex, "nabla")
-class TEXTURE_PT_marble(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_marble"
+class TEXTURE_PT_marble(TextureTypePanel):
__label__ = "Marble"
+ tex_type = 'MARBLE'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'MARBLE')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemR(tex, "stype", expand=True)
@@ -328,53 +352,44 @@ class TEXTURE_PT_marble(TextureButtonsPanel):
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
- col = layout.column_flow()
- col.itemR(tex, "noise_size", text="Size")
- col.itemR(tex, "noise_depth", text="Depth")
- col.itemR(tex, "turbulence")
- col.itemR(tex, "nabla")
+ flow = layout.column_flow()
+ flow.itemR(tex, "noise_size", text="Size")
+ flow.itemR(tex, "noise_depth", text="Depth")
+ flow.itemR(tex, "turbulence")
+ flow.itemR(tex, "nabla")
-class TEXTURE_PT_magic(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_magic"
+class TEXTURE_PT_magic(TextureTypePanel):
__label__ = "Magic"
+ tex_type = 'MAGIC'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'MAGIC')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
row = layout.row()
row.itemR(tex, "noise_depth", text="Depth")
row.itemR(tex, "turbulence")
-class TEXTURE_PT_blend(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_blend"
+class TEXTURE_PT_blend(TextureTypePanel):
__label__ = "Blend"
+ tex_type = 'BLEND'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'BLEND')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemR(tex, "progression")
layout.itemR(tex, "flip_axis")
-class TEXTURE_PT_stucci(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_stucci"
+class TEXTURE_PT_stucci(TextureTypePanel):
__label__ = "Stucci"
+ tex_type = 'STUCCI'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'STUCCI')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemR(tex, "stype", expand=True)
@@ -386,81 +401,73 @@ class TEXTURE_PT_stucci(TextureButtonsPanel):
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "turbulence")
-class TEXTURE_PT_image(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_image"
+class TEXTURE_PT_image(TextureTypePanel):
__label__ = "Image"
+ tex_type = 'IMAGE'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'IMAGE')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.template_texture_image(tex)
-class TEXTURE_PT_image_sampling(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_image_sampling"
+class TEXTURE_PT_image_sampling(TextureTypePanel):
__label__ = "Image Sampling"
__default_closed__ = True
+ tex_type = 'IMAGE'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'IMAGE')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
slot = context.texture_slot
split = layout.split()
"""
- sub = split.column()
- sub.itemR(tex, "flip_axis")
- sub.itemR(tex, "normal_map")
+ col = split.column()
+ col.itemR(tex, "flip_axis")
+ col.itemR(tex, "normal_map")
if slot:
- row = sub.row()
+ row = col.row()
row.active = tex.normal_map
row.itemR(slot, "normal_map_space", text="")
"""
- sub = split.column()
-
- sub.itemL(text="Alpha:")
- sub.itemR(tex, "use_alpha", text="Use")
- sub.itemR(tex, "calculate_alpha", text="Calculate")
- sub.itemR(tex, "invert_alpha", text="Invert")
+ col = split.column()
+ col.itemL(text="Alpha:")
+ col.itemR(tex, "use_alpha", text="Use")
+ col.itemR(tex, "calculate_alpha", text="Calculate")
+ col.itemR(tex, "invert_alpha", text="Invert")
- sub.itemL(text="Flip:")
- sub.itemR(tex, "flip_axis", text="X/Y Axis")
+ col.itemL(text="Flip:")
+ col.itemR(tex, "flip_axis", text="X/Y Axis")
- sub = split.column()
- sub.itemL(text="Filter:")
- sub.itemR(tex, "filter", text="")
- sub.itemR(tex, "mipmap")
- row = sub.row()
- row.itemR(tex, "mipmap_gauss", text="Gauss")
+ col = split.column()
+ col.itemL(text="Filter:")
+ col.itemR(tex, "filter", text="")
+ col.itemR(tex, "mipmap")
+
+ row = col.row()
row.active = tex.mipmap
- sub.itemR(tex, "interpolation")
+ row.itemR(tex, "mipmap_gauss", text="Gauss")
+
+ col.itemR(tex, "interpolation")
if tex.mipmap and tex.filter != 'DEFAULT':
if tex.filter == 'FELINE':
- sub.itemR(tex, "filter_probes", text="Probes")
+ col.itemR(tex, "filter_probes", text="Probes")
else:
- sub.itemR(tex, "filter_eccentricity", text="Eccentricity")
+ col.itemR(tex, "filter_eccentricity", text="Eccentricity")
-class TEXTURE_PT_image_mapping(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_image_mapping"
+class TEXTURE_PT_image_mapping(TextureTypePanel):
__label__ = "Image Mapping"
__default_closed__ = True
+ tex_type = 'IMAGE'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'IMAGE')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemR(tex, "extension")
@@ -468,90 +475,84 @@ class TEXTURE_PT_image_mapping(TextureButtonsPanel):
split = layout.split()
if tex.extension == 'REPEAT':
- sub = split.column(align=True)
- sub.itemL(text="Repeat:")
- sub.itemR(tex, "repeat_x", text="X")
- sub.itemR(tex, "repeat_y", text="Y")
- sub = split.column(align=True)
- sub.itemL(text="Mirror:")
- sub.itemR(tex, "mirror_x", text="X")
- sub.itemR(tex, "mirror_y", text="Y")
+ col = split.column(align=True)
+ col.itemL(text="Repeat:")
+ col.itemR(tex, "repeat_x", text="X")
+ col.itemR(tex, "repeat_y", text="Y")
+
+ col = split.column(align=True)
+ col.itemL(text="Mirror:")
+ col.itemR(tex, "mirror_x", text="X")
+ col.itemR(tex, "mirror_y", text="Y")
elif tex.extension == 'CHECKER':
- sub = split.column(align=True)
- row = sub.row()
+ col = split.column(align=True)
+ row = col.row()
row.itemR(tex, "checker_even", text="Even")
row.itemR(tex, "checker_odd", text="Odd")
- sub = split.column()
- sub.itemR(tex, "checker_distance", text="Distance")
+
+ split.itemR(tex, "checker_distance", text="Distance")
layout.itemS()
split = layout.split()
- sub = split.column(align=True)
- #sub.itemR(tex, "crop_rectangle")
- sub.itemL(text="Crop Minimum:")
- sub.itemR(tex, "crop_min_x", text="X")
- sub.itemR(tex, "crop_min_y", text="Y")
- sub = split.column(align=True)
- sub.itemL(text="Crop Maximum:")
- sub.itemR(tex, "crop_max_x", text="X")
- sub.itemR(tex, "crop_max_y", text="Y")
+ col = split.column(align=True)
+ #col.itemR(tex, "crop_rectangle")
+ col.itemL(text="Crop Minimum:")
+ col.itemR(tex, "crop_min_x", text="X")
+ col.itemR(tex, "crop_min_y", text="Y")
+
+ col = split.column(align=True)
+ col.itemL(text="Crop Maximum:")
+ col.itemR(tex, "crop_max_x", text="X")
+ col.itemR(tex, "crop_max_y", text="Y")
-class TEXTURE_PT_plugin(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_plugin"
+class TEXTURE_PT_plugin(TextureTypePanel):
__label__ = "Plugin"
+ tex_type = 'PLUGIN'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'PLUGIN')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemL(text="Nothing yet")
-class TEXTURE_PT_envmap(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_envmap"
+class TEXTURE_PT_envmap(TextureTypePanel):
__label__ = "Environment Map"
+ tex_type = 'ENVIRONMENT_MAP'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'ENVIRONMENT_MAP')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemL(text="Nothing yet")
-class TEXTURE_PT_musgrave(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_musgrave"
+class TEXTURE_PT_musgrave(TextureTypePanel):
__label__ = "Musgrave"
+ tex_type = 'MUSGRAVE'
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'MUSGRAVE')
-
def draw(self, context):
layout = self.layout
+
tex = context.texture
layout.itemR(tex, "musgrave_type")
split = layout.split()
- sub = split.column()
- sub.itemR(tex, "highest_dimension", text="Dimension")
- sub.itemR(tex, "lacunarity")
- sub.itemR(tex, "octaves")
- sub = split.column()
+ col = split.column()
+ col.itemR(tex, "highest_dimension", text="Dimension")
+ col.itemR(tex, "lacunarity")
+ col.itemR(tex, "octaves")
+
+ col = split.column()
if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
- sub.itemR(tex, "offset")
+ col.itemR(tex, "offset")
if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
- sub.itemR(tex, "gain")
- sub.itemR(tex, "noise_intensity", text="Intensity")
+ col.itemR(tex, "gain")
+ col.itemR(tex, "noise_intensity", text="Intensity")
layout.itemL(text="Noise:")
@@ -561,30 +562,33 @@ class TEXTURE_PT_musgrave(TextureButtonsPanel):
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
-class TEXTURE_PT_voronoi(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_voronoi"
+class TEXTURE_PT_voronoi(TextureTypePanel):
__label__ = "Voronoi"
-
- def poll(self, context):
- tex = context.texture
- return (tex and tex.type == 'VORONOI')
+ tex_type = 'VORONOI'
def draw(self, context):
layout = self.layout
+
tex = context.texture
-
- layout.itemR(tex, "distance_metric")
- layout.itemR(tex, "coloring")
split = layout.split()
- sub = split.column()
-
- sub.itemR(tex, "noise_intensity", text="Intensity")
- if tex.distance_metric == 'MINKOVSKY':
- sub.itemR(tex, "minkovsky_exponent", text="Exponent")
- sub = split.column()
- sub.itemR(tex, "feature_weights", slider=True)
+ col = split.column()
+ col.itemL(text="Distance Metric:")
+ col.itemR(tex, "distance_metric", text="")
+ sub = col.column()
+ sub.active = tex.distance_metric == 'MINKOVSKY'
+ sub.itemR(tex, "minkovsky_exponent", text="Exponent")
+ col.itemL(text="Coloring:")
+ col.itemR(tex, "coloring", text="")
+ col.itemR(tex, "noise_intensity", text="Intensity")
+
+ col = split.column(align=True)
+ col.itemL(text="Feature Weights:")
+ col.itemR(tex, "weight_1", text="1", slider=True)
+ col.itemR(tex, "weight_2", text="2", slider=True)
+ col.itemR(tex, "weight_3", text="3", slider=True)
+ col.itemR(tex, "weight_4", text="4", slider=True)
layout.itemL(text="Noise:")
@@ -592,33 +596,146 @@ class TEXTURE_PT_voronoi(TextureButtonsPanel):
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
-class TEXTURE_PT_distortednoise(TextureButtonsPanel):
- __idname__= "TEXTURE_PT_distortednoise"
+class TEXTURE_PT_distortednoise(TextureTypePanel):
__label__ = "Distorted Noise"
+ tex_type = 'DISTORTED_NOISE'
+
+ def draw(self, context):
+ layout = self.layout
+
+ tex = context.texture
+
+ layout.itemR(tex, "noise_distortion")
+ layout.itemR(tex, "noise_basis", text="Basis")
+
+ flow = layout.column_flow()
+ flow.itemR(tex, "distortion", text="Distortion")
+ flow.itemR(tex, "noise_size", text="Size")
+ flow.itemR(tex, "nabla")
+
+class TEXTURE_PT_voxeldata(TextureButtonsPanel):
+ __idname__= "TEXTURE_PT_voxeldata"
+ __label__ = "Voxel Data"
def poll(self, context):
tex = context.texture
- return (tex and tex.type == 'DISTORTED_NOISE')
+ return (tex and tex.type == 'VOXEL_DATA')
def draw(self, context):
layout = self.layout
+
tex = context.texture
+ vd = tex.voxeldata
- layout.itemR(tex, "noise_distortion")
- layout.itemR(tex, "noise_basis", text="Basis")
+ layout.itemR(vd, "file_format")
+ if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']:
+ layout.itemR(vd, "source_path")
+ if vd.file_format == 'RAW_8BIT':
+ layout.itemR(vd, "resolution")
+ elif vd.file_format == 'SMOKE':
+ layout.itemR(vd, "domain_object")
+
+ layout.itemR(vd, "still")
+ row = layout.row()
+ row.active = vd.still
+ row.itemR(vd, "still_frame_number")
+ layout.itemR(vd, "interpolation")
+ layout.itemR(vd, "intensity")
+
+class TEXTURE_PT_pointdensity(TextureButtonsPanel):
+ __idname__= "TEXTURE_PT_pointdensity"
+ __label__ = "Point Density"
+
+ def poll(self, context):
+ tex = context.texture
+ return (tex and tex.type == 'POINT_DENSITY')
+
+ def draw(self, context):
+ layout = self.layout
+
+ tex = context.texture
+ pd = tex.pointdensity
+
+ layout.itemR(pd, "point_source", expand=True)
+
split = layout.split()
- sub = split.column()
- sub.itemR(tex, "distortion_amount", text="Distortion")
- sub.itemR(tex, "noise_size", text="Size")
+ col = split.column()
+ if pd.point_source == 'PARTICLE_SYSTEM':
+ col.itemL(text="Object:")
+ col.itemR(pd, "object", text="")
+
+ sub = col.column()
+ sub.enabled = pd.object
+ if pd.object:
+ sub.itemL(text="System:")
+ sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="")
+ sub.itemL(text="Cache:")
+ sub.itemR(pd, "particle_cache", text="")
+ else:
+ col.itemL(text="Object:")
+ col.itemR(pd, "object", text="")
+ col.itemL(text="Cache:")
+ col.itemR(pd, "vertices_cache", text="")
+
+ col.itemS()
+
+ col.itemL(text="Color Source:")
+ col.itemR(pd, "color_source", text="")
+ if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'):
+ col.itemR(pd, "speed_scale")
+ if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
+ layout.template_color_ramp(pd.color_ramp, expand=True)
+
+ col = split.column()
+ col.itemL()
+ col.itemR(pd, "radius")
+ col.itemL(text="Falloff:")
+ col.itemR(pd, "falloff", text="")
+ if pd.falloff == 'SOFT':
+ col.itemR(pd, "falloff_softness")
+
+class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
+ __label__ = "Turbulence"
+
+ def poll(self, context):
+ tex = context.texture
+ return (tex and tex.type == 'POINT_DENSITY')
+
+ def draw_header(self, context):
+ layout = self.layout
+
+ tex = context.texture
+ pd = tex.pointdensity
+
+ layout.itemR(pd, "turbulence", text="")
- sub = split.column()
- sub.itemR(tex, "nabla")
+ def draw(self, context):
+ layout = self.layout
+
+ tex = context.texture
+ pd = tex.pointdensity
+ layout.active = pd.turbulence
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="Influence:")
+ col.itemR(pd, "turbulence_influence", text="")
+ col.itemL(text="Noise Basis:")
+ col.itemR(pd, "noise_basis", text="")
+
+ col = split.column()
+ col.itemL()
+ col.itemR(pd, "turbulence_size")
+ col.itemR(pd, "turbulence_depth")
+ col.itemR(pd, "turbulence_strength")
bpy.types.register(TEXTURE_PT_context_texture)
bpy.types.register(TEXTURE_PT_preview)
-bpy.types.register(TEXTURE_PT_clouds)
+
+bpy.types.register(TEXTURE_PT_clouds) # Texture Type Panels
bpy.types.register(TEXTURE_PT_wood)
bpy.types.register(TEXTURE_PT_marble)
bpy.types.register(TEXTURE_PT_magic)
@@ -632,7 +749,10 @@ bpy.types.register(TEXTURE_PT_envmap)
bpy.types.register(TEXTURE_PT_musgrave)
bpy.types.register(TEXTURE_PT_voronoi)
bpy.types.register(TEXTURE_PT_distortednoise)
+bpy.types.register(TEXTURE_PT_voxeldata)
+bpy.types.register(TEXTURE_PT_pointdensity)
+bpy.types.register(TEXTURE_PT_pointdensity_turbulence)
+
bpy.types.register(TEXTURE_PT_colors)
bpy.types.register(TEXTURE_PT_mapping)
bpy.types.register(TEXTURE_PT_influence)
-
diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py
index 67cf5cc2e89..b02673d126f 100644
--- a/release/ui/buttons_world.py
+++ b/release/ui/buttons_world.py
@@ -2,29 +2,29 @@
import bpy
class WorldButtonsPanel(bpy.types.Panel):
- __space_type__ = "BUTTONS_WINDOW"
- __region_type__ = "WINDOW"
+ __space_type__ = 'PROPERTIES'
+ __region_type__ = 'WINDOW'
__context__ = "world"
-
+ # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
def poll(self, context):
rd = context.scene.render_data
- return (context.world != None) and (not rd.use_game_engine)
+ return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
class WORLD_PT_preview(WorldButtonsPanel):
__label__ = "Preview"
-
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
def draw(self, context):
- layout = self.layout
- world = context.world
-
- layout.template_preview(world)
+ self.layout.template_preview(context.world)
class WORLD_PT_context_world(WorldButtonsPanel):
__show_header__ = False
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
rd = context.scene.render_data
- return (context.scene != None) and (not rd.use_game_engine)
+ return (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@@ -42,60 +42,61 @@ class WORLD_PT_context_world(WorldButtonsPanel):
class WORLD_PT_world(WorldButtonsPanel):
__label__ = "World"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
world = context.world
- if world:
-
- row = layout.row()
- row.itemR(world, "blend_sky")
- row.itemR(world, "paper_sky")
- row.itemR(world, "real_sky")
+ row = layout.row()
+ row.itemR(world, "paper_sky")
+ row.itemR(world, "blend_sky")
+ row.itemR(world, "real_sky")
- row = layout.row()
- row.column().itemR(world, "horizon_color")
- col = row.column()
- col.itemR(world, "zenith_color")
- col.active = world.blend_sky
- row.column().itemR(world, "ambient_color")
+ row = layout.row()
+ row.column().itemR(world, "horizon_color")
+ col = row.column()
+ col.itemR(world, "zenith_color")
+ col.active = world.blend_sky
+ row.column().itemR(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
__label__ = "Mist"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.mist, "enabled", text="")
+ self.layout.itemR(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
+
world = context.world
layout.active = world.mist.enabled
flow = layout.column_flow()
+ flow.itemR(world.mist, "intensity", slider=True)
flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height")
- flow.itemR(world.mist, "intensity")
layout.itemR(world.mist, "falloff")
class WORLD_PT_stars(WorldButtonsPanel):
__label__ = "Stars"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.stars, "enabled", text="")
+ self.layout.itemR(world.stars, "enabled", text="")
def draw(self, context):
layout = self.layout
+
world = context.world
layout.active = world.stars.enabled
@@ -108,15 +109,16 @@ class WORLD_PT_stars(WorldButtonsPanel):
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
__label__ = "Ambient Occlusion"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.ambient_occlusion, "enabled", text="")
+ self.layout.itemR(world.ambient_occlusion, "enabled", text="")
def draw(self, context):
layout = self.layout
+
ao = context.world.ambient_occlusion
layout.active = ao.enabled
@@ -139,12 +141,12 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
col.itemL(text="Sampling:")
col.itemR(ao, "sample_method", text="")
- sub = col.column(align=True)
+ sub = col.column()
sub.itemR(ao, "samples")
if ao.sample_method == 'ADAPTIVE_QMC':
sub.itemR(ao, "threshold")
- sub.itemR(ao, "adapt_to_speed")
+ sub.itemR(ao, "adapt_to_speed", slider=True)
elif ao.sample_method == 'CONSTANT_JITTERED':
sub.itemR(ao, "bias")
@@ -156,12 +158,21 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
col.itemR(ao, "pixel_cache")
col.itemR(ao, "correction")
- col = layout.column(align=True)
+ col = layout.column()
col.itemL(text="Influence:")
- row = col.row()
- row.itemR(ao, "blend_mode", text="")
- row.itemR(ao, "color", text="")
- row.itemR(ao, "energy", text="")
+
+ col.row().itemR(ao, "blend_mode", expand=True)
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(ao, "energy")
+
+ col = split.column()
+ colsub = col.split(percentage=0.3)
+ colsub.itemL(text="Color:")
+ colsub.itemR(ao, "color", text="")
+
bpy.types.register(WORLD_PT_context_world)
bpy.types.register(WORLD_PT_preview)
@@ -169,4 +180,3 @@ bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion)
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)
-
diff --git a/release/ui/space_buttons.py b/release/ui/space_buttons.py
index b444913809d..aa89c06ea08 100644
--- a/release/ui/space_buttons.py
+++ b/release/ui/space_buttons.py
@@ -2,7 +2,7 @@
import bpy
class Buttons_HT_header(bpy.types.Header):
- __space_type__ = "BUTTONS_WINDOW"
+ __space_type__ = 'PROPERTIES'
def draw(self, context):
layout = self.layout
@@ -10,18 +10,19 @@ class Buttons_HT_header(bpy.types.Header):
so = context.space_data
scene = context.scene
- layout.template_header()
+ row= layout.row(align=True)
+ row.template_header()
if context.area.show_menus:
- row = layout.row(align=True)
- row.itemM("Buttons_MT_view", text="View")
+ sub = row.row(align=True)
+ sub.itemM("Buttons_MT_view", text="View")
row = layout.row()
row.itemR(so, "buttons_context", expand=True, text="")
row.itemR(scene, "current_frame")
class Buttons_MT_view(bpy.types.Menu):
- __space_type__ = "BUTTONS_WINDOW"
+ __space_type__ = 'PROPERTIES'
__label__ = "View"
def draw(self, context):
diff --git a/release/ui/space_console.py b/release/ui/space_console.py
index a5662fa3db3..dbf202f924c 100644
--- a/release/ui/space_console.py
+++ b/release/ui/space_console.py
@@ -5,24 +5,29 @@ import bpy_ops # XXX - should not need to do this
del bpy_ops
class CONSOLE_HT_header(bpy.types.Header):
- __space_type__ = "CONSOLE"
+ __space_type__ = 'CONSOLE'
def draw(self, context):
sc = context.space_data
# text = sc.text
layout = self.layout
- layout.template_header()
+ row= layout.row(align=True)
+ row.template_header()
- row = layout.row()
- row.itemR(sc, "console_type", expand=True)
+ if context.area.show_menus:
+ sub = row.row(align=True)
+
+ if sc.console_type == 'REPORT':
+ sub.itemM("CONSOLE_MT_report")
+ else:
+ sub.itemM("CONSOLE_MT_console")
+
+ layout.itemS()
+ layout.itemR(sc, "console_type", expand=True)
if sc.console_type == 'REPORT':
-
- if context.area.show_menus:
- row = layout.row()
- row.itemM("CONSOLE_MT_report")
-
+ row = layout.row(align=True)
row.itemR(sc, "show_report_debug", text="Debug")
row.itemR(sc, "show_report_info", text="Info")
row.itemR(sc, "show_report_operator", text="Operators")
@@ -32,15 +37,9 @@ class CONSOLE_HT_header(bpy.types.Header):
row = layout.row()
row.enabled = sc.show_report_operator
row.itemO("console.report_replay")
-
- else:
- if context.area.show_menus:
- row = layout.row()
- row.itemM("CONSOLE_MT_console")
-
class CONSOLE_MT_console(bpy.types.Menu):
- __space_type__ = "CONSOLE"
+ __space_type__ = 'CONSOLE'
__label__ = "Console"
def draw(self, context):
@@ -50,9 +49,10 @@ class CONSOLE_MT_console(bpy.types.Menu):
layout.column()
layout.itemO("console.clear")
layout.itemO("console.copy")
+ layout.itemO("console.paste")
class CONSOLE_MT_report(bpy.types.Menu):
- __space_type__ = "CONSOLE"
+ __space_type__ = 'CONSOLE'
__label__ = "Report"
def draw(self, context):
@@ -98,19 +98,9 @@ def get_console(console_id):
console = code.InteractiveConsole(namespace)
- if sys.version.startswith('3'):
- import io
- stdout = io.StringIO()
- stderr = io.StringIO()
- elif sys.version.startswith('2.6'):
- import io
- stdout = io.BytesIO() # Py2x support
- stderr = io.BytesIO()
- else:
- import cStringIO
- stdout = cStringIO.StringIO()
- stderr = cStringIO.StringIO()
-
+ import io
+ stdout = io.StringIO()
+ stderr = io.StringIO()
consoles[console_id]= namespace, console, stdout, stderr
@@ -120,7 +110,7 @@ class CONSOLE_OT_exec(bpy.types.Operator):
'''
Operator documentatuon text, will be used for the operator tooltip and python docs.
'''
- __idname__ = "console.exec"
+ __idname__ = "console.execute"
__label__ = "Console Execute"
__register__ = False
diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py
index 0fecbdbfbba..f1ea5555787 100644
--- a/release/ui/space_filebrowser.py
+++ b/release/ui/space_filebrowser.py
@@ -1,16 +1,16 @@
import bpy
-
class FILEBROWSER_HT_header(bpy.types.Header):
- __space_type__ = "FILE_BROWSER"
+ __space_type__ = 'FILE_BROWSER'
def draw(self, context):
- st = context.space_data
layout = self.layout
+ st = context.space_data
params = st.params
- layout.template_header()
+
+ layout.template_header(menus=False)
row = layout.row(align=True)
row.itemO("file.parent", text="", icon='ICON_FILE_PARENT')
@@ -39,5 +39,4 @@ class FILEBROWSER_HT_header(bpy.types.Header):
row.active = params.do_filter
-
bpy.types.register(FILEBROWSER_HT_header)
diff --git a/release/ui/space_image.py b/release/ui/space_image.py
index eeac19c04e0..3f82727da47 100644
--- a/release/ui/space_image.py
+++ b/release/ui/space_image.py
@@ -2,18 +2,19 @@
import bpy
class IMAGE_MT_view(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "View"
def draw(self, context):
layout = self.layout
+
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
show_uvedit = sima.show_uvedit
- layout.itemO("image.properties", icon="ICON_MENU_PANEL")
+ layout.itemO("image.properties", icon='ICON_MENU_PANEL')
layout.itemS()
@@ -43,7 +44,7 @@ class IMAGE_MT_view(bpy.types.Menu):
layout.itemO("screen.screen_full_area")
class IMAGE_MT_select(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "Select"
def draw(self, context):
@@ -64,11 +65,12 @@ class IMAGE_MT_select(bpy.types.Menu):
layout.itemO("uv.select_linked")
class IMAGE_MT_image(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "Image"
def draw(self, context):
layout = self.layout
+
sima = context.space_data
ima = sima.image
@@ -85,7 +87,7 @@ class IMAGE_MT_image(bpy.types.Menu):
layout.itemO("image.save")
layout.itemO("image.save_as")
- if ima.source == "SEQUENCE":
+ if ima.source == 'SEQUENCE':
layout.itemO("image.save_sequence")
if not show_render:
@@ -99,7 +101,7 @@ class IMAGE_MT_image(bpy.types.Menu):
# only for dirty && specific image types, perhaps
# this could be done in operator poll too
if ima.dirty:
- if ima.source in ("FILE", "GENERATED") and ima.type != "MULTILAYER":
+ if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG")
layout.itemS()
@@ -107,7 +109,7 @@ class IMAGE_MT_image(bpy.types.Menu):
layout.itemR(sima, "image_painting")
class IMAGE_MT_uvs_showhide(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "Show/Hide Faces"
def draw(self, context):
@@ -118,28 +120,28 @@ class IMAGE_MT_uvs_showhide(bpy.types.Menu):
layout.item_booleanO("uv.hide", "unselected", True)
class IMAGE_MT_uvs_transform(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "Transform"
def draw(self, context):
layout = self.layout
- layout.item_enumO("tfm.transform", "mode", "TRANSLATION")
- layout.item_enumO("tfm.transform", "mode", "ROTATION")
- layout.item_enumO("tfm.transform", "mode", "RESIZE")
+ layout.item_enumO("tfm.transform", "mode", 'TRANSLATION')
+ layout.item_enumO("tfm.transform", "mode", 'ROTATION')
+ layout.item_enumO("tfm.transform", "mode", 'RESIZE')
class IMAGE_MT_uvs_mirror(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "Mirror"
def draw(self, context):
layout = self.layout
- layout.item_enumO("uv.mirror", "axis", "MIRROR_X") # "X Axis", M,
- layout.item_enumO("uv.mirror", "axis", "MIRROR_Y") # "Y Axis", M,
+ layout.item_enumO("uv.mirror", "axis", 'MIRROR_X') # "X Axis", M,
+ layout.item_enumO("uv.mirror", "axis", 'MIRROR_Y') # "Y Axis", M,
class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "Weld/Align"
def draw(self, context):
@@ -148,13 +150,13 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
layout.itemO("uv.weld") # W, 1
layout.items_enumO("uv.align", "axis") # W, 2/3/4
-
class IMAGE_MT_uvs(bpy.types.Menu):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
__label__ = "UVs"
def draw(self, context):
layout = self.layout
+
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
@@ -192,36 +194,38 @@ class IMAGE_MT_uvs(bpy.types.Menu):
layout.itemM("IMAGE_MT_uvs_showhide")
class IMAGE_HT_header(bpy.types.Header):
- __space_type__ = "IMAGE_EDITOR"
+ __space_type__ = 'IMAGE_EDITOR'
def draw(self, context):
+ layout = self.layout
+
sima = context.space_data
ima = sima.image
iuser = sima.image_user
- layout = self.layout
settings = context.tool_settings
show_render = sima.show_render
show_paint = sima.show_paint
show_uvedit = sima.show_uvedit
- layout.template_header()
+ row = layout.row(align=True)
+ row.template_header()
# menus
if context.area.show_menus:
- row = layout.row()
- row.itemM("IMAGE_MT_view")
+ sub = row.row(align=True)
+ sub.itemM("IMAGE_MT_view")
if show_uvedit:
- row.itemM("IMAGE_MT_select")
+ sub.itemM("IMAGE_MT_select")
if ima and ima.dirty:
- row.itemM("IMAGE_MT_image", text="Image*")
+ sub.itemM("IMAGE_MT_image", text="Image*")
else:
- row.itemM("IMAGE_MT_image", text="Image")
+ sub.itemM("IMAGE_MT_image", text="Image")
if show_uvedit:
- row.itemM("IMAGE_MT_uvs")
+ sub.itemM("IMAGE_MT_uvs")
layout.template_ID(sima, "image", new="image.new")
@@ -246,7 +250,7 @@ class IMAGE_HT_header(bpy.types.Header):
"""
mesh = context.edit_object.data
- row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_layers")
+ row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
"""
if ima:
@@ -261,17 +265,17 @@ class IMAGE_HT_header(bpy.types.Header):
row.itemR(sima, "draw_channels", text="", expand=True)
row = layout.row(align=True)
- if ima.type == "COMPOSITE":
- row.itemO("image.record_composite", icon="ICON_REC")
- if ima.type == "COMPOSITE" and ima.source in ("MOVIE", "SEQUENCE"):
- row.itemO("image.play_composite", icon="ICON_PLAY")
+ if ima.type == 'COMPOSITE':
+ row.itemO("image.record_composite", icon='ICON_REC')
+ if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
+ row.itemO("image.play_composite", icon='ICON_PLAY')
if show_uvedit or sima.image_painting:
layout.itemR(sima, "update_automatically", text="")
class IMAGE_PT_game_properties(bpy.types.Panel):
- __space_type__ = "IMAGE_EDITOR"
- __region_type__ = "UI"
+ __space_type__ = 'IMAGE_EDITOR'
+ __region_type__ = 'UI'
__label__ = "Game Properties"
def poll(self, context):
@@ -280,52 +284,48 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
def draw(self, context):
- sima = context.space_data
layout = self.layout
-
+
+ sima = context.space_data
ima = sima.image
- if ima:
- split = layout.split()
-
- col = split.column()
-
- subcol = col.column(align=True)
- subcol.itemR(ima, "clamp_x")
- subcol.itemR(ima, "clamp_y")
+ split = layout.split()
- col.itemR(ima, "mapping", expand=True)
- col.itemR(ima, "tiles")
+ col = split.column()
+ col.itemR(ima, "clamp_x")
+ col.itemR(ima, "clamp_y")
+ col.itemR(ima, "mapping", expand=True)
+ col.itemR(ima, "tiles")
- col = split.column()
+ col = split.column()
- subcol = col.column(align=True)
- subcol.itemR(ima, "animated")
+ sub = col.column(align=True)
+ sub.itemR(ima, "animated")
- subcol = subcol.column()
- subcol.itemR(ima, "animation_start", text="Start")
- subcol.itemR(ima, "animation_end", text="End")
- subcol.itemR(ima, "animation_speed", text="Speed")
- subcol.active = ima.animated
+ subsub = sub.column()
+ subsub.active = ima.animated
+ subsub.itemR(ima, "animation_start", text="Start")
+ subsub.itemR(ima, "animation_end", text="End")
+ subsub.itemR(ima, "animation_speed", text="Speed")
- subrow = col.row(align=True)
- subrow.itemR(ima, "tiles_x", text="X")
- subrow.itemR(ima, "tiles_y", text="Y")
- subrow.active = ima.tiles or ima.animated
+ sub = col.row(align=True)
+ sub.active = ima.tiles or ima.animated
+ sub.itemR(ima, "tiles_x", text="X")
+ sub.itemR(ima, "tiles_y", text="Y")
class IMAGE_PT_view_properties(bpy.types.Panel):
- __space_type__ = "IMAGE_EDITOR"
- __region_type__ = "UI"
- __label__ = "View Properties"
+ __space_type__ = 'IMAGE_EDITOR'
+ __region_type__ = 'UI'
+ __label__ = "Display"
def poll(self, context):
sima = context.space_data
return (sima and (sima.image or sima.show_uvedit))
def draw(self, context):
- sima = context.space_data
layout = self.layout
-
+
+ sima = context.space_data
ima = sima.image
show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor
@@ -334,26 +334,33 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
col = split.column()
if ima:
- col.itemR(ima, "display_aspect")
+ col.itemR(ima, "display_aspect", text="Aspect Ratio")
col = split.column()
+ col.itemL(text="Coordinates:")
col.itemR(sima, "draw_repeated", text="Repeat")
if show_uvedit:
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
elif show_uvedit:
+ col.itemL(text="Coordinates:")
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
if show_uvedit:
col = layout.column()
row = col.row()
row.itemR(uvedit, "edge_draw_type", expand=True)
- row = col.row()
- row.itemR(uvedit, "draw_smooth_edges", text="Smooth")
- row.itemR(uvedit, "draw_modified_edges", text="Modified")
+
+ split = layout.split()
- row = col.row()
- row.itemR(uvedit, "draw_stretch", text="Stretch")
- row.itemR(uvedit, "draw_stretch_type", text="")
+ col = split.column()
+ col.itemR(uvedit, "draw_stretch", text="Stretch")
+ sub = col.column()
+ sub.active = uvedit.draw_stretch
+ sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
+
+ col = split.column()
+ col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
+ col.itemR(uvedit, "draw_modified_edges", text="Modified")
#col.itemR(uvedit, "draw_edges")
#col.itemR(uvedit, "draw_faces")
@@ -368,4 +375,3 @@ bpy.types.register(IMAGE_MT_uvs)
bpy.types.register(IMAGE_HT_header)
bpy.types.register(IMAGE_PT_game_properties)
bpy.types.register(IMAGE_PT_view_properties)
-
diff --git a/release/ui/space_info.py b/release/ui/space_info.py
index c6f7bf4decd..5f9f73e18b7 100644
--- a/release/ui/space_info.py
+++ b/release/ui/space_info.py
@@ -2,27 +2,30 @@
import bpy
class INFO_HT_header(bpy.types.Header):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
def draw(self, context):
- st = context.space_data
- rd = context.scene.render_data
layout = self.layout
- layout.template_header()
+ st = context.space_data
+ scene = context.scene
+ rd = scene.render_data
+
+ row = layout.row(align=True)
+ row.template_header()
if context.area.show_menus:
- row = layout.row()
- row.itemM("INFO_MT_file")
- row.itemM("INFO_MT_add")
+ sub = row.row(align=True)
+ sub.itemM("INFO_MT_file")
+ sub.itemM("INFO_MT_add")
if rd.use_game_engine:
- row.itemM("INFO_MT_game")
+ sub.itemM("INFO_MT_game")
else:
- row.itemM("INFO_MT_render")
- row.itemM("INFO_MT_help")
+ sub.itemM("INFO_MT_render")
+ sub.itemM("INFO_MT_help")
- layout.template_ID(context.window, "screen") #, new="screen.new", open="scene.unlink")
- layout.template_ID(context.screen, "scene") #, new="screen.new", unlink="scene.unlink")
+ layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
+ layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
if rd.multiple_engines:
layout.itemR(rd, "engine", text="")
@@ -31,9 +34,11 @@ class INFO_HT_header(bpy.types.Header):
layout.template_operator_search()
layout.template_running_jobs()
+
+ layout.itemL(text=scene.statistics())
class INFO_MT_file(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "File"
def draw(self, context):
@@ -69,16 +74,18 @@ class INFO_MT_file(bpy.types.Menu):
layout.itemO("wm.exit_blender", text="Quit")
class INFO_MT_file_import(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "Import"
def draw(self, context):
layout = self.layout
+
+ layout.itemL(text="Nothing yet")
layout.itemO("WM_OT_collada_import", text="COLLADA")
class INFO_MT_file_export(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "Export"
def draw(self, context):
@@ -88,7 +95,7 @@ class INFO_MT_file_export(bpy.types.Menu):
layout.itemO("WM_OT_collada_export", text="COLLADA")
class INFO_MT_file_external_data(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "External Data"
def draw(self, context):
@@ -105,7 +112,7 @@ class INFO_MT_file_external_data(bpy.types.Menu):
layout.itemO("file.find_missing_files")
class INFO_MT_add(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "Add"
def draw(self, context):
@@ -113,38 +120,48 @@ class INFO_MT_add(bpy.types.Menu):
layout.operator_context = "EXEC_SCREEN"
- layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon="ICON_OUTLINER_OB_MESH")
- layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon="ICON_OUTLINER_OB_CURVE")
- layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon="ICON_OUTLINER_OB_SURFACE")
- layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", "META", icon="ICON_OUTLINER_OB_META")
- layout.itemO("OBJECT_OT_text_add", text="Text", icon="ICON_OUTLINER_OB_FONT")
+ layout.item_menu_enumO( "object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
+ layout.item_menu_enumO( "object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
+ layout.item_menu_enumO( "object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
+ layout.item_menu_enumO( "object.metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META')
+ layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
layout.itemS()
- layout.itemO("OBJECT_OT_armature_add", text="Armature", icon="ICON_OUTLINER_OB_ARMATURE")
- layout.item_enumO("OBJECT_OT_object_add", "type", "LATTICE", icon="ICON_OUTLINER_OB_LATTICE")
- layout.item_enumO("OBJECT_OT_object_add", "type", "EMPTY", icon="ICON_OUTLINER_OB_EMPTY")
+ layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
+ layout.item_enumO("object.object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
+ layout.item_enumO("object.object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
layout.itemS()
- layout.item_enumO("OBJECT_OT_object_add", "type", "CAMERA", icon="ICON_OUTLINER_OB_CAMERA")
- layout.item_enumO("OBJECT_OT_object_add", "type", "LAMP", icon="ICON_OUTLINER_OB_LAMP")
+ layout.item_enumO("object.object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
+ layout.item_enumO("object.object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP')
class INFO_MT_game(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "Game"
def draw(self, context):
layout = self.layout
+ gs = context.scene.game_data
+
layout.itemO("view3d.game_start")
+ layout.itemS()
+
+ layout.itemR(gs, "show_debug_properties")
+ layout.itemR(gs, "show_framerate_profile")
+ layout.itemR(gs, "show_physics_visualization")
+ layout.itemR(gs, "deprecation_warnings")
+
class INFO_MT_render(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "Render"
def draw(self, context):
layout = self.layout
+
rd = context.scene.render_data
layout.itemO("screen.render", text="Render Image")
@@ -155,7 +172,7 @@ class INFO_MT_render(bpy.types.Menu):
layout.itemO("screen.render_view_show")
class INFO_MT_help(bpy.types.Menu):
- __space_type__ = "USER_PREFERENCES"
+ __space_type__ = 'INFO'
__label__ = "Help"
def draw(self, context):
@@ -171,382 +188,6 @@ class INFO_MT_help(bpy.types.Menu):
layout.itemO("help.developer_community")
layout.itemO("help.user_community")
-class INFO_PT_tabs(bpy.types.Panel):
- __space_type__ = "USER_PREFERENCES"
- __show_header__ = False
-
- def draw(self, context):
- layout = self.layout
- userpref = context.user_preferences
-
- layout.itemR(userpref, "active_section", expand=True)
-
-class INFO_PT_view(bpy.types.Panel):
- __space_type__ = "USER_PREFERENCES"
- __label__ = "View"
- __show_header__ = False
-
- def poll(self, context):
- userpref = context.user_preferences
- return (userpref.active_section == 'VIEW_CONTROLS')
-
- def draw(self, context):
- layout = self.layout
- userpref = context.user_preferences
- view = userpref.view
-
- split = layout.split()
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- colsplitcol.itemL(text="Display:")
- colsplitcol.itemR(view, "tooltips")
- colsplitcol.itemR(view, "display_object_info", text="Object Info")
- colsplitcol.itemR(view, "use_large_cursors")
- colsplitcol.itemR(view, "show_view_name", text="View Name")
- colsplitcol.itemR(view, "show_playback_fps", text="Playback FPS")
- colsplitcol.itemR(view, "global_scene")
- colsplitcol.itemR(view, "pin_floating_panels")
- colsplitcol.itemR(view, "object_center_size")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- colsplitcol.itemR(view, "show_mini_axis")
- colsub = colsplitcol.column()
- colsub.enabled = view.show_mini_axis
- colsub.itemR(view, "mini_axis_size")
- colsub.itemR(view, "mini_axis_brightness")
-
-
-
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- colsplitcol.itemL(text="View Manipulation:")
- colsplitcol.itemR(view, "auto_depth")
- colsplitcol.itemR(view, "global_pivot")
- colsplitcol.itemR(view, "zoom_to_mouse")
- colsplitcol.itemR(view, "rotate_around_selection")
- colsplitcol.itemL(text="Zoom Style:")
- row = colsplitcol.row()
- row.itemR(view, "viewport_zoom_style", expand=True)
- colsplitcol.itemL(text="Orbit Style:")
- row = colsplitcol.row()
- row.itemR(view, "view_rotation", expand=True)
- colsplitcol.itemR(view, "perspective_orthographic_switch")
- colsplitcol.itemR(view, "smooth_view")
- colsplitcol.itemR(view, "rotation_angle")
- colsplitcol.itemL(text="NDOF Device:")
- colsplitcol.itemR(view, "ndof_pan_speed", text="Pan Speed")
- colsplitcol.itemR(view, "ndof_rotate_speed", text="Orbit Speed")
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- colsplitcol.itemL(text="Mouse Buttons:")
- colsplitcol.itemR(view, "left_mouse_button_select")
- colsplitcol.itemR(view, "right_mouse_button_select")
- colsplitcol.itemR(view, "emulate_3_button_mouse")
- colsplitcol.itemR(view, "use_middle_mouse_paste")
- colsplitcol.itemR(view, "middle_mouse_rotate")
- colsplitcol.itemR(view, "middle_mouse_pan")
- colsplitcol.itemR(view, "wheel_invert_zoom")
- colsplitcol.itemR(view, "wheel_scroll_lines")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- colsplitcol.itemL(text="Menus:")
- colsplitcol.itemR(view, "open_mouse_over")
- colsplitcol.itemL(text="Menu Open Delay:")
- colsplitcol.itemR(view, "open_toplevel_delay", text="Top Level")
- colsplitcol.itemR(view, "open_sublevel_delay", text="Sub Level")
-
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- #manipulator
- colsplitcol.itemR(view, "use_manipulator")
- colsub = colsplitcol.column()
- colsub.enabled = view.use_manipulator
- colsub.itemR(view, "manipulator_size", text="Size")
- colsub.itemR(view, "manipulator_handle_size", text="Handle Size")
- colsub.itemR(view, "manipulator_hotspot", text="Hotspot")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- colsplitcol.itemL(text="Toolbox:")
- colsplitcol.itemR(view, "use_column_layout")
- colsplitcol.itemL(text="Open Toolbox Delay:")
- colsplitcol.itemR(view, "open_left_mouse_delay", text="Hold LMB")
- colsplitcol.itemR(view, "open_right_mouse_delay", text="Hold RMB")
-
-
-class INFO_PT_edit(bpy.types.Panel):
- __space_type__ = "USER_PREFERENCES"
- __label__ = "Edit"
- __show_header__ = False
-
- def poll(self, context):
- userpref = context.user_preferences
- return (userpref.active_section == 'EDIT_METHODS')
-
- def draw(self, context):
- layout = self.layout
- userpref = context.user_preferences
- edit = userpref.edit
- view = userpref.view
-
- split = layout.split()
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
-
- colsplitcol.itemL(text="Materials:")
- colsplitcol.itemR(edit, "material_linked_object", text="Linked to Object")
- colsplitcol.itemR(edit, "material_linked_obdata", text="Linked to ObData")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- colsplitcol.itemL(text="New Objects:")
- colsplitcol.itemR(edit, "enter_edit_mode")
- colsplitcol.itemR(edit, "align_to_view")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- colsplitcol.itemL(text="Transform:")
- colsplitcol.itemR(edit, "drag_immediately")
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- colsplitcol.itemL(text="Snap:")
- colsplitcol.itemR(edit, "snap_translate", text="Translate")
- colsplitcol.itemR(edit, "snap_rotate", text="Rotate")
- colsplitcol.itemR(edit, "snap_scale", text="Scale")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- colsplitcol.itemL(text="Grease Pencil:")
- colsplitcol.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
- colsplitcol.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
- colsplitcol.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
- colsplitcol.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
- colsplitcol.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
-
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
-
- colsplitcol.itemL(text="Keyframing:")
- colsplitcol.itemR(edit, "use_visual_keying")
- colsplitcol.itemR(edit, "new_interpolation_type")
- colsplitcol.itemR(edit, "auto_keying_enable", text="Auto Keyframing")
- colsub = colsplitcol.column()
- colsub.enabled = edit.auto_keying_enable
- row = colsub.row()
- row.itemR(edit, "auto_keying_mode", expand=True)
- colsub.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available")
- colsub.itemR(edit, "auto_keyframe_insert_needed", text="Only Insert Needed")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- colsplitcol.itemL(text="Undo:")
- colsplitcol.itemR(edit, "global_undo")
- colsplitcol.itemR(edit, "undo_steps", text="Steps")
- colsplitcol.itemR(edit, "undo_memory_limit", text="Memory Limit")
- colsplitcol.itemS()
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- colsplitcol.itemL(text="Duplicate:")
- colsplitcol.itemR(edit, "duplicate_mesh", text="Mesh")
- colsplitcol.itemR(edit, "duplicate_surface", text="Surface")
- colsplitcol.itemR(edit, "duplicate_curve", text="Curve")
- colsplitcol.itemR(edit, "duplicate_text", text="Text")
- colsplitcol.itemR(edit, "duplicate_metaball", text="Metaball")
- colsplitcol.itemR(edit, "duplicate_armature", text="Armature")
- colsplitcol.itemR(edit, "duplicate_lamp", text="Lamp")
- colsplitcol.itemR(edit, "duplicate_material", text="Material")
- colsplitcol.itemR(edit, "duplicate_texture", text="Texture")
- colsplitcol.itemR(edit, "duplicate_ipo", text="F-Curve")
- colsplitcol.itemR(edit, "duplicate_action", text="Action")
-
-class INFO_PT_system(bpy.types.Panel):
- __space_type__ = "USER_PREFERENCES"
- __label__ = "System"
- __show_header__ = False
-
- def poll(self, context):
- userpref = context.user_preferences
- return (userpref.active_section == 'SYSTEM_OPENGL')
-
- def draw(self, context):
- layout = self.layout
- userpref = context.user_preferences
- system = userpref.system
- lan = userpref.language
-
- split = layout.split()
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- colsplitcol.itemR(system, "emulate_numpad")
- colsplitcol.itemS()
- colsplitcol.itemS()
- #Weight Colors
- colsplitcol.itemL(text="Weight Colors:")
- colsplitcol.itemR(system, "use_weight_color_range", text="Use Custom Range")
-
- colsub = colsplitcol.column()
- colsub.active = system.use_weight_color_range
- colsub.template_color_ramp(system.weight_color_range, expand=True)
- colsplitcol.itemS()
- colsplitcol.itemS()
-
- #sequencer
- colsplitcol.itemL(text="Sequencer:")
- colsplitcol.itemR(system, "prefetch_frames")
- colsplitcol.itemR(system, "memory_cache_limit")
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- #System
- colsplitcol.itemL(text="System:")
- colsplitcol.itemR(lan, "dpi")
- colsplitcol.itemR(system, "enable_all_codecs")
- colsplitcol.itemR(system, "auto_run_python_scripts")
- colsplitcol.itemR(system, "frame_server_port")
- colsplitcol.itemR(system, "game_sound")
- colsplitcol.itemR(system, "filter_file_extensions")
- colsplitcol.itemR(system, "hide_dot_files_datablocks")
- colsplitcol.itemR(system, "audio_mixing_buffer")
- colsplitcol.itemR(lan, "scrollback", text="Console Scrollback")
-
- col = split.column()
- colsplit = col.split(percentage=0.85)
- colsplitcol = colsplit.column()
- #OpenGL
- colsplitcol.itemL(text="OpenGL:")
- colsplitcol.itemR(system, "clip_alpha", slider=True)
- colsplitcol.itemR(system, "use_mipmaps")
- colsplitcol.itemL(text="Window Draw Method:")
- row = colsplitcol.row()
- row.itemR(system, "window_draw_method", expand=True)
- colsplitcol.itemL(text="Textures:")
- colsplitcol.itemR(system, "gl_texture_limit", text="Limit Size")
- colsplitcol.itemR(system, "texture_time_out", text="Time Out")
- colsplitcol.itemR(system, "texture_collection_rate", text="Collection Rate")
-
-class INFO_PT_filepaths(bpy.types.Panel):
- __space_type__ = "USER_PREFERENCES"
- __label__ = "File Paths"
- __show_header__ = False
-
- def poll(self, context):
- userpref = context.user_preferences
- return (userpref.active_section == 'FILE_PATHS')
-
- def draw(self, context):
- layout = self.layout
- userpref = context.user_preferences
- paths = userpref.filepaths
-
- split = layout.split()
- col = split.column()
- col.itemL(text="File Paths:")
- splitcol = col.split(percentage=0.3)
-
- splitcol.itemL(text="Fonts:")
- splitcol.itemR(paths, "fonts_directory", text="")
- splitcol = col.split(percentage=0.3)
- splitcol.itemL(text="Textures:")
- splitcol.itemR(paths, "textures_directory", text="")
- splitcol = col.split(percentage=0.3)
- splitcol.itemL(text="Texture Plugins:")
- splitcol.itemR(paths, "texture_plugin_directory", text="")
- splitcol = col.split(percentage=0.3)
- splitcol.itemL(text="Sequence Plugins:")
- splitcol.itemR(paths, "sequence_plugin_directory", text="")
- splitcol = col.split(percentage=0.3)
- splitcol.itemL(text="Render Output:")
- splitcol.itemR(paths, "render_output_directory", text="")
- splitcol = col.split(percentage=0.3)
- splitcol.itemL(text="Scripts:")
- splitcol.itemR(paths, "python_scripts_directory", text="")
- splitcol = col.split(percentage=0.3)
- splitcol.itemL(text="Sounds:")
- splitcol.itemR(paths, "sounds_directory", text="")
- splitcol = col.split(percentage=0.3)
- splitcol.itemL(text="Temp:")
- splitcol.itemR(paths, "temporary_directory", text="")
-
- col = split.column()
- colsplit = col.split(percentage=0.2)
- colsplitcol = colsplit.column()
- colsplitcol = colsplit.column()
- colsplitcol.itemL(text="Save & Load:")
- colsplitcol.itemR(paths, "use_relative_paths")
- colsplitcol.itemR(paths, "compress_file")
- colsplitcol.itemL(text="Auto Save:")
- colsplitcol.itemR(paths, "save_version")
- colsplitcol.itemR(paths, "recent_files")
- colsplitcol.itemR(paths, "save_preview_images")
- colsplitcol.itemR(paths, "auto_save_temporary_files")
- colsub = colsplitcol.column()
- colsub.enabled = paths.auto_save_temporary_files
- colsub.itemR(paths, "auto_save_time")
-
-class INFO_PT_language(bpy.types.Panel):
- __space_type__ = "USER_PREFERENCES"
- __label__ = "Language"
- __show_header__ = False
-
- def poll(self, context):
- userpref = context.user_preferences
- return (userpref.active_section == 'LANGUAGE_COLORS')
-
- def draw(self, context):
- layout = self.layout
- userpref = context.user_preferences
- lan = userpref.language
-
- split = layout.split()
- col = split.column()
-
- col.itemR(lan, "language")
- col.itemR(lan, "translate_tooltips")
- col.itemR(lan, "translate_buttons")
- col.itemR(lan, "translate_toolbox")
- col.itemR(lan, "use_textured_fonts")
-
-class INFO_PT_bottombar(bpy.types.Panel):
- __space_type__ = "USER_PREFERENCES"
- __label__ = " "
- __show_header__ = False
-
- def draw(self, context):
- layout = self.layout
- userpref = context.user_preferences
-
- split = layout.split(percentage=0.8)
- split.itemL(text="")
- layout.operator_context = "EXEC_AREA"
- split.itemO("wm.save_homefile", text="Save As Default")
-
bpy.types.register(INFO_HT_header)
bpy.types.register(INFO_MT_file)
bpy.types.register(INFO_MT_file_import)
@@ -556,13 +197,6 @@ bpy.types.register(INFO_MT_add)
bpy.types.register(INFO_MT_game)
bpy.types.register(INFO_MT_render)
bpy.types.register(INFO_MT_help)
-bpy.types.register(INFO_PT_tabs)
-bpy.types.register(INFO_PT_view)
-bpy.types.register(INFO_PT_edit)
-bpy.types.register(INFO_PT_system)
-bpy.types.register(INFO_PT_filepaths)
-bpy.types.register(INFO_PT_language)
-bpy.types.register(INFO_PT_bottombar)
# Help operators
diff --git a/release/ui/space_logic.py b/release/ui/space_logic.py
index 728e5e6307b..5748d15a53a 100644
--- a/release/ui/space_logic.py
+++ b/release/ui/space_logic.py
@@ -1,8 +1,8 @@
import bpy
class LOGIC_PT_properties(bpy.types.Panel):
- __space_type__ = "LOGIC_EDITOR"
- __region_type__ = "UI"
+ __space_type__ = 'LOGIC_EDITOR'
+ __region_type__ = 'UI'
__label__ = "Properties"
def poll(self, context):
@@ -11,15 +11,19 @@ class LOGIC_PT_properties(bpy.types.Panel):
def draw(self, context):
layout = self.layout
+
ob = context.active_object
game = ob.game
- for prop in game.properties:
- flow = layout.row()
- flow.itemR(prop, "name", text="")
- flow.itemR(prop, "type", text="")
- flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly
- flow.itemR(prop, "debug")
-
+ layout.itemO("object.game_property_new", text="Add Game Property")
+
+ for i, prop in enumerate(game.properties):
+
+ row = layout.row(align=True)
+ row.itemR(prop, "name", text="")
+ row.itemR(prop, "type", text="")
+ row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
+ row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
+ row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
+
bpy.types.register(LOGIC_PT_properties)
-
diff --git a/release/ui/space_node.py b/release/ui/space_node.py
new file mode 100644
index 00000000000..6ac1ac84f35
--- /dev/null
+++ b/release/ui/space_node.py
@@ -0,0 +1,120 @@
+
+import bpy
+
+class NODE_HT_header(bpy.types.Header):
+ __space_type__ = 'NODE_EDITOR'
+
+ def draw(self, context):
+ layout = self.layout
+
+ snode = context.space_data
+
+ row = layout.row(align=True)
+ row.template_header()
+
+ if context.area.show_menus:
+ sub = row.row(align=True)
+ sub.itemM("NODE_MT_view")
+ sub.itemM("NODE_MT_select")
+ sub.itemM("NODE_MT_add")
+ sub.itemM("NODE_MT_node")
+
+ row = layout.row()
+ row.itemR(snode, "tree_type", text="", expand=True)
+
+ if snode.tree_type == 'MATERIAL':
+ ob = snode.id_from
+ id = snode.id
+ if ob:
+ layout.template_ID(ob, "active_material", new="material.new")
+ if id:
+ layout.itemR(id, "use_nodes")
+
+ elif snode.tree_type == 'TEXTURE':
+ row.itemR(snode, "texture_type", text="", expand=True)
+
+ id = snode.id
+ id_from = snode.id_from
+ if id_from:
+ layout.template_ID(id_from, "active_texture", new="texture.new")
+ if id:
+ layout.itemR(id, "use_nodes")
+
+ elif snode.tree_type == 'COMPOSITING':
+ id = snode.id
+
+ layout.itemR(id, "use_nodes")
+ layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused")
+ layout.itemR(snode, "backdrop")
+
+class NODE_MT_view(bpy.types.Menu):
+ __space_type__ = 'NODE_EDITOR'
+ __label__ = "View"
+
+ def draw(self, context):
+ layout = self.layout
+
+ # layout.itemO("grease_pencil..")
+ # layout.itemS()
+
+ layout.itemO("view2d.zoom_in")
+ layout.itemO("view2d.zoom_out")
+
+ layout.itemS()
+
+ layout.itemO("node.view_all")
+ layout.itemO("screen.screen_full_area")
+
+class NODE_MT_select(bpy.types.Menu):
+ __space_type__ = 'NODE_EDITOR'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("node.select_border")
+
+ # XXX
+ # layout.itemS()
+ # layout.itemO("node.select_all")
+ # layout.itemO("node.select_linked_from")
+ # layout.itemO("node.select_linked_to")
+
+class NODE_MT_node(bpy.types.Menu):
+ __space_type__ = 'NODE_EDITOR'
+ __label__ = "Node"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("tfm.translate")
+ layout.itemO("tfm.resize")
+ layout.itemO("tfm.rotate")
+
+ layout.itemS()
+
+ layout.itemO("node.duplicate")
+ layout.itemO("node.delete")
+
+ # XXX
+ # layout.itemS()
+ # layout.itemO("node.make_link")
+ # layout.itemS()
+ # layout.itemO("node.edit_group")
+ # layout.itemO("node.ungroup")
+ # layout.itemO("node.group")
+ # layout.itemO("node.make_link")
+
+ layout.itemS()
+
+ layout.itemO("node.visibility_toggle")
+
+ # XXX
+ # layout.itemO("node.rename")
+ # layout.itemS()
+ # layout.itemO("node.show_cyclic_dependencies")
+
+bpy.types.register(NODE_HT_header)
+bpy.types.register(NODE_MT_view)
+bpy.types.register(NODE_MT_select)
+bpy.types.register(NODE_MT_node)
diff --git a/release/ui/space_outliner.py b/release/ui/space_outliner.py
index 5815acc7e12..522b620e29d 100644
--- a/release/ui/space_outliner.py
+++ b/release/ui/space_outliner.py
@@ -2,18 +2,19 @@
import bpy
class OUTLINER_HT_header(bpy.types.Header):
- __space_type__ = "OUTLINER"
+ __space_type__ = 'OUTLINER'
def draw(self, context):
so = context.space_data
sce = context.scene
layout = self.layout
- layout.template_header()
+ row = layout.row(align=True)
+ row.template_header()
if context.area.show_menus:
- row = layout.row(align=True)
- row.itemM("OUTLINER_MT_view")
+ sub = row.row(align=True)
+ sub.itemM("OUTLINER_MT_view")
row = layout.row()
row.itemR(so, "display_mode", text="")
@@ -35,7 +36,7 @@ class OUTLINER_HT_header(bpy.types.Header):
class OUTLINER_MT_view(bpy.types.Menu):
- __space_type__ = "OUTLINER"
+ __space_type__ = 'OUTLINER'
__label__ = "View"
def draw(self, context):
diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py
index 4f60f5ccd61..bef48f5ebdb 100644
--- a/release/ui/space_sequencer.py
+++ b/release/ui/space_sequencer.py
@@ -7,39 +7,43 @@ def act_strip(context):
# Header
class SEQUENCER_HT_header(bpy.types.Header):
- __space_type__ = "SEQUENCE_EDITOR"
+ __space_type__ = 'SEQUENCE_EDITOR'
def draw(self, context):
+ layout = self.layout
st = context.space_data
- layout = self.layout
- layout.template_header()
+ row = layout.row(align=True)
+ row.template_header()
if context.area.show_menus:
- row = layout.row()
- row.itemM("SEQUENCER_MT_view")
+ sub = row.row(align=True)
+ sub.itemM("SEQUENCER_MT_view")
- row.itemR(st, "display_mode")
-
- layout.itemS()
+ row.itemS()
if st.display_mode == 'SEQUENCER':
- row.itemM("SEQUENCER_MT_select")
- row.itemM("SEQUENCER_MT_marker")
- row.itemM("SEQUENCER_MT_add")
- row.itemM("SEQUENCER_MT_strip")
- layout.itemS()
- row.itemO("sequencer.reload")
- else:
- row.itemR(st, "display_channel") # text="Chan"
+ sub.itemM("SEQUENCER_MT_select")
+ sub.itemM("SEQUENCER_MT_marker")
+ sub.itemM("SEQUENCER_MT_add")
+ sub.itemM("SEQUENCER_MT_strip")
+
+ layout.itemR(st, "display_mode", text="")
+
+ if st.display_mode == 'SEQUENCER':
+ layout.itemS()
+ layout.itemO("sequencer.reload")
+ else:
+ layout.itemR(st, "display_channel", text="Channel")
class SEQUENCER_MT_view(bpy.types.Menu):
- __space_type__ = "SEQUENCE_EDITOR"
- __label__ = "View (TODO)"
+ __space_type__ = 'SEQUENCE_EDITOR'
+ __label__ = "View"
def draw(self, context):
layout = self.layout
+
st = context.space_data
layout.column()
@@ -76,6 +80,7 @@ class SEQUENCER_MT_view(bpy.types.Menu):
layout.itemO("sequencer.view_all")
layout.itemO("sequencer.view_selected")
layout.itemS()
+ layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
"""
@@ -101,11 +106,12 @@ class SEQUENCER_MT_view(bpy.types.Menu):
"""
class SEQUENCER_MT_select(bpy.types.Menu):
- __space_type__ = "SEQUENCE_EDITOR"
+ __space_type__ = 'SEQUENCE_EDITOR'
__label__ = "Select"
def draw(self, context):
layout = self.layout
+
st = context.space_data
layout.column()
@@ -121,71 +127,72 @@ class SEQUENCER_MT_select(bpy.types.Menu):
layout.itemO("sequencer.select_inverse")
class SEQUENCER_MT_marker(bpy.types.Menu):
- __space_type__ = "SEQUENCE_EDITOR"
+ __space_type__ = 'SEQUENCE_EDITOR'
__label__ = "Marker (TODO)"
def draw(self, context):
layout = self.layout
+
st = context.space_data
layout.column()
- layout.itemO("sequencer.sound_strip_add", text="Add Marker|Ctrl Alt M")
- layout.itemO("sequencer.sound_strip_add", text="Duplicate Marker|Ctrl Shift D")
- layout.itemO("sequencer.sound_strip_add", text="Delete Marker|Shift X")
+ layout.itemO("marker.add", text="Add Marker")
+ layout.itemO("marker.duplicate", text="Duplicate Marker")
+ layout.itemO("marker.move", text="Grab/Move Marker")
+ layout.itemO("marker.delete", text="Delete Marker")
layout.itemS()
- layout.itemO("sequencer.sound_strip_add", text="(Re)Name Marker|Ctrl M")
- layout.itemO("sequencer.sound_strip_add", text="Grab/Move Marker|Ctrl G")
- layout.itemS()
- layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
+ layout.itemL(text="ToDo: Name Marker")
+
+ #layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
class SEQUENCER_MT_add(bpy.types.Menu):
- __space_type__ = "SEQUENCE_EDITOR"
+ __space_type__ = 'SEQUENCE_EDITOR'
__label__ = "Add"
def draw(self, context):
layout = self.layout
+
st = context.space_data
layout.column()
layout.itemO("sequencer.scene_strip_add", text="Scene")
layout.itemO("sequencer.movie_strip_add", text="Movie")
- layout.item_booleanO("sequencer.movie_strip_add", "sound", True, text="Movie & Sound") # FFMPEG ONLY
layout.itemO("sequencer.image_strip_add", text="Image")
- layout.itemO("sequencer.sound_strip_add", text="Sound (Ram)")
- layout.item_booleanO("sequencer.sound_strip_add", "hd", True, text="Sound (Streaming)") # FFMPEG ONLY
+ layout.itemO("sequencer.sound_strip_add", text="Sound")
layout.itemM("SEQUENCER_MT_add_effect")
-
class SEQUENCER_MT_add_effect(bpy.types.Menu):
- __space_type__ = "SEQUENCE_EDITOR"
+ __space_type__ = 'SEQUENCE_EDITOR'
__label__ = "Effect Strip..."
def draw(self, context):
layout = self.layout
+
st = context.space_data
- self.layout.column()
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'SUBTRACT')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_OVER')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_UNDER')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'GAMMA_CROSS')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'MULTIPLY')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'OVER_DROP')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'PLUGIN')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'WIPE')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'GLOW')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'TRANSFORM')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'COLOR')
- self.layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED')
+ layout.column()
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'SUBTRACT')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_OVER')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_UNDER')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'GAMMA_CROSS')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'MULTIPLY')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'OVER_DROP')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'PLUGIN')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'WIPE')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'GLOW')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'TRANSFORM')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'COLOR')
+ layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED')
class SEQUENCER_MT_strip(bpy.types.Menu):
- __space_type__ = "SEQUENCE_EDITOR"
+ __space_type__ = 'SEQUENCE_EDITOR'
__label__ = "Strip"
def draw(self, context):
layout = self.layout
+
st = context.space_data
layout.operator_context = 'INVOKE_REGION_WIN'
@@ -247,15 +254,15 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
# Panels
class SequencerButtonsPanel(bpy.types.Panel):
- __space_type__ = "SEQUENCE_EDITOR"
- __region_type__ = "UI"
+ __space_type__ = 'SEQUENCE_EDITOR'
+ __region_type__ = 'UI'
def poll(self, context):
return context.space_data.display_mode == 'SEQUENCER' and act_strip(context) != None
class SequencerButtonsPanel_Output(bpy.types.Panel):
- __space_type__ = "SEQUENCE_EDITOR"
- __region_type__ = "UI"
+ __space_type__ = 'SEQUENCE_EDITOR'
+ __region_type__ = 'UI'
def poll(self, context):
return context.space_data.display_mode != 'SEQUENCER'
@@ -268,35 +275,48 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel):
strip = act_strip(context)
- layout.itemR(strip, "name")
+ split = layout.split(percentage=0.3)
+ split.itemL(text="Name:")
+ split.itemR(strip, "name", text="")
- layout.itemR(strip, "type")
+ split = layout.split(percentage=0.3)
+ split.itemL(text="Type:")
+ split.itemR(strip, "type", text="")
- layout.itemR(strip, "blend_mode")
+ split = layout.split(percentage=0.3)
+ split.itemL(text="Blend:")
+ split.itemR(strip, "blend_mode", text="")
- layout.itemR(strip, "blend_opacity", text="Opacity", slider=True)
+ row = layout.row()
+ if strip.mute == True:
+ row.itemR(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_ON', text="")
+ elif strip.mute == False:
+ row.itemR(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_OFF', text="")
- split = layout.split()
+ sub = row.row()
+ sub.active = (not strip.mute)
- col = split.column()
- col.itemR(strip, "mute")
- col.itemR(strip, "lock")
- col.itemR(strip, "frame_locked")
+ sub.itemR(strip, "blend_opacity", text="Opacity", slider=True)
- col = split.column()
+ row = layout.row()
+ row.itemR(strip, "lock")
+ row.itemR(strip, "frame_locked", text="Frame Lock")
+
+ col = layout.column()
+ col.enabled = not strip.lock
col.itemR(strip, "channel")
col.itemR(strip, "start_frame")
col.itemR(strip, "length")
- split = layout.split()
-
- col = split.column()
- col.itemR(strip, "start_offset")
- col.itemR(strip, "start_still")
+ col = layout.column(align=True)
+ col.itemL(text="Offset:")
+ col.itemR(strip, "start_offset", text="Start")
+ col.itemR(strip, "end_offset", text="End")
- col = split.column()
- col.itemR(strip, "end_offset")
- col.itemR(strip, "end_still")
+ col = layout.column(align=True)
+ col.itemL(text="Still:")
+ col.itemR(strip, "start_still", text="Start")
+ col.itemR(strip, "end_still", text="End")
class SEQUENCER_PT_effect(SequencerButtonsPanel):
__label__ = "Effect Strip"
@@ -320,23 +340,21 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
layout.itemR(strip, "color")
elif strip.type == 'WIPE':
- row = layout.row()
- row.itemL(text="Transition Type:")
- row.itemL(text="Direction:")
- row = layout.row()
- row.itemR(strip, "transition_type", text="")
- row.itemR(strip, "direction", text="")
+ col = layout.column()
+ col.itemR(strip, "transition_type")
+ col.itemL(text="Direction:")
+ col.row().itemR(strip, "direction", expand=True)
- row = layout.row()
- row.itemR(strip, "blur_width")
+ col = layout.column()
+ col.itemR(strip, "blur_width", slider=True)
if strip.transition_type in ('SINGLE', 'DOUBLE'):
- row.itemR(strip, "angle")
+ col.itemR(strip, "angle")
elif strip.type == 'GLOW':
flow = layout.column_flow()
- flow.itemR(strip, "threshold")
- flow.itemR(strip, "clamp")
+ flow.itemR(strip, "threshold", slider=True)
+ flow.itemR(strip, "clamp", slider=True)
flow.itemR(strip, "boost_factor")
flow.itemR(strip, "blur_distance")
@@ -353,42 +371,39 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
flow.itemR(strip, "frame_blending")
elif strip.type == 'TRANSFORM':
- row = layout.row()
- row.itemL(text="Interpolation:")
- row.itemL(text="Translation Unit:")
- row = layout.row()
- row.itemR(strip, "interpolation", text="")
- row.itemR(strip, "translation_unit", text="")
+ col = layout.column()
+ col.itemR(strip, "interpolation")
+ col.itemR(strip, "translation_unit")
- split = layout.split()
+ col = layout.column(align=True)
+ col.itemL(text="Position X:")
+ col.itemR(strip, "translate_start_x", text="Start")
+ col.itemR(strip, "translate_end_x", text="End")
- col = split.column()
- sub = col.column(align=True)
- sub.itemL(text="Position X:")
- sub.itemR(strip, "translate_start_x", text="Start")
- sub.itemR(strip, "translate_end_x", text="End")
+ col = layout.column(align=True)
+ col.itemL(text="Position Y:")
+ col.itemR(strip, "translate_start_y", text="Start")
+ col.itemR(strip, "translate_end_y", text="End")
- sub = col.column(align=True)
- sub.itemL(text="Scale X:")
- sub.itemR(strip, "scale_start_x", text="Start")
- sub.itemR(strip, "scale_end_x", text="End")
+ layout.itemS()
- sub = col.column(align=True)
- sub.itemL(text="Rotation:")
- sub.itemR(strip, "rotation_start", text="Start")
- sub.itemR(strip, "rotation_end", text="End")
+ col = layout.column(align=True)
+ col.itemL(text="Scale X:")
+ col.itemR(strip, "scale_start_x", text="Start")
+ col.itemR(strip, "scale_end_x", text="End")
- col = split.column()
- sub = col.column(align=True)
- sub.itemL(text="Position Y:")
- sub.itemR(strip, "translate_start_y", text="Start")
- sub.itemR(strip, "translate_end_y", text="End")
+ col = layout.column(align=True)
+ col.itemL(text="Scale Y:")
+ col.itemR(strip, "scale_start_y", text="Start")
+ col.itemR(strip, "scale_end_y", text="End")
- sub = col.column(align=True)
- sub.itemL(text="Scale Y:")
- sub.itemR(strip, "scale_start_y", text="Start")
- sub.itemR(strip, "scale_end_y", text="End")
+ layout.itemS()
+
+ col = layout.column(align=True)
+ col.itemL(text="Rotation:")
+ col.itemR(strip, "rotation_start", text="Start")
+ col.itemR(strip, "rotation_end", text="End")
class SEQUENCER_PT_input(SequencerButtonsPanel):
__label__ = "Strip Input"
@@ -408,42 +423,75 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
strip = act_strip(context)
- split = layout.split(percentage=0.3)
- sub = split.column()
- sub.itemL(text="Directory:")
- sub = split.column()
- sub.itemR(strip, "directory", text="")
+ split = layout.split(percentage=0.2)
+ col = split.column()
+ col.itemL(text="Path:")
+ col = split.column()
+ col.itemR(strip, "directory", text="")
# Current element for the filename
- split = layout.split(percentage=0.3)
- sub = split.column()
- sub.itemL(text="File Name:")
- sub = split.column()
+
elem = strip.getStripElem(context.scene.current_frame)
if elem:
- sub.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
-
- layout.itemR(strip, "use_translation")
- if strip.transform:
- flow = layout.column_flow()
- flow.active = strip.use_translation
- flow.itemR(strip.transform, "offset_x")
- flow.itemR(strip.transform, "offset_y")
-
-
- layout.itemR(strip, "use_crop")
- if strip.crop:
- flow = layout.column_flow()
- flow.active = strip.use_crop
- flow.itemR(strip.crop, "top")
- flow.itemR(strip.crop, "left")
- flow.itemR(strip.crop, "bottom")
- flow.itemR(strip.crop, "right")
+ split = layout.split(percentage=0.2)
+ col = split.column()
+ col.itemL(text="File:")
+ col = split.column()
+ col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
+
+ if strip.type != 'SOUND':
+ layout.itemR(strip, "use_translation", text="Image Offset:")
+ if strip.transform:
+ col = layout.column(align=True)
+ col.active = strip.use_translation
+ col.itemR(strip.transform, "offset_x", text="X")
+ col.itemR(strip.transform, "offset_y", text="Y")
+
+ layout.itemR(strip, "use_crop", text="Image Crop:")
+ if strip.crop:
+ col = layout.column(align=True)
+ col.active = strip.use_crop
+ col.itemR(strip.crop, "top")
+ col.itemR(strip.crop, "left")
+ col.itemR(strip.crop, "bottom")
+ col.itemR(strip.crop, "right")
- layout.itemR(strip, "animation_start_offset")
- layout.itemR(strip, "animation_end_offset")
+ col = layout.column(align=True)
+ col.itemL(text="Trim Duration:")
+ col.itemR(strip, "animation_start_offset", text="Start")
+ col.itemR(strip, "animation_end_offset", text="End")
+
+class SEQUENCER_PT_sound(SequencerButtonsPanel):
+ __label__ = "Sound"
+
+ def poll(self, context):
+ if context.space_data.display_mode != 'SEQUENCER':
+ return False
+
+ strip = act_strip(context)
+ if not strip:
+ return False
+
+ return strip.type in ('SOUND', )
+
+ def draw(self, context):
+ layout = self.layout
+
+ strip = act_strip(context)
+
+ layout.template_ID(strip, "sound", new="sound.open")
+ layout.itemS()
+ layout.itemR(strip.sound, "filename", text="")
+
+ row = layout.row()
+ if strip.sound.packed_file:
+ row.itemO("sound.unpack", icon='ICON_PACKAGE', text="Unpack")
+ else:
+ row.itemO("sound.pack", icon='ICON_UGLYPACKAGE', text="Pack")
+
+ row.itemR(strip.sound, "caching")
class SEQUENCER_PT_filter(SequencerButtonsPanel):
__label__ = "Filter"
@@ -462,17 +510,19 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel):
layout = self.layout
strip = act_strip(context)
+
+ col = layout.column()
+ col.itemL(text="Video:")
+ col.itemR(strip, "strobe")
+ col.itemR(strip, "de_interlace")
- split = layout.split()
-
- col = split.column()
+ col = layout.column()
+ col.itemL(text="Colors:")
+ col.itemR(strip, "multiply_colors", text="Multiply")
col.itemR(strip, "premultiply")
col.itemR(strip, "convert_float")
- col.itemR(strip, "de_interlace")
- col.itemR(strip, "multiply_colors")
- col.itemR(strip, "strobe")
-
- col = split.column()
+
+ col = layout.column()
col.itemL(text="Flip:")
col.itemR(strip, "flip_x", text="X")
col.itemR(strip, "flip_y", text="Y")
@@ -484,14 +534,13 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel):
row.active = strip.use_color_balance
col = row.column()
col.itemR(strip.color_balance, "lift")
- col.itemR(strip.color_balance, "inverse_lift")
+ col.itemR(strip.color_balance, "inverse_lift", text="Inverse")
col = row.column()
col.itemR(strip.color_balance, "gamma")
- col.itemR(strip.color_balance, "inverse_gamma")
+ col.itemR(strip.color_balance, "inverse_gamma", text="Inverse")
col = row.column()
col.itemR(strip.color_balance, "gain")
- col.itemR(strip.color_balance, "inverse_gain")
-
+ col.itemR(strip.color_balance, "inverse_gain", text="Inverse")
class SEQUENCER_PT_proxy(SequencerButtonsPanel):
__label__ = "Proxy"
@@ -507,36 +556,34 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel):
return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
def draw_header(self, context):
- strip = act_strip(context)
-
layout = self.layout
+ strip = act_strip(context)
+
layout.itemR(strip, "use_proxy", text="")
def draw(self, context):
- strip = act_strip(context)
-
layout = self.layout
+ strip = act_strip(context)
+
flow = layout.column_flow()
flow.itemR(strip, "proxy_custom_directory")
if strip.proxy: # TODO - need to add this somehow
flow.itemR(strip.proxy, "directory")
flow.itemR(strip.proxy, "file")
-
class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
__label__ = "View Settings"
def draw(self, context):
- st = context.space_data
-
layout = self.layout
+
+ st = context.space_data
- flow = layout.column_flow()
- flow.itemR(st, "draw_overexposed") # text="Zebra"
- flow.itemR(st, "draw_safe_margin")
-
+ col = layout.column()
+ col.itemR(st, "draw_overexposed") # text="Zebra"
+ col.itemR(st, "draw_safe_margin")
bpy.types.register(SEQUENCER_HT_header) # header/menu classes
bpy.types.register(SEQUENCER_MT_view)
@@ -549,6 +596,7 @@ bpy.types.register(SEQUENCER_MT_strip)
bpy.types.register(SEQUENCER_PT_edit) # sequencer panels
bpy.types.register(SEQUENCER_PT_effect)
bpy.types.register(SEQUENCER_PT_input)
+bpy.types.register(SEQUENCER_PT_sound)
bpy.types.register(SEQUENCER_PT_filter)
bpy.types.register(SEQUENCER_PT_proxy)
diff --git a/release/ui/space_text.py b/release/ui/space_text.py
index 1b4fcea24b6..117033c50a1 100644
--- a/release/ui/space_text.py
+++ b/release/ui/space_text.py
@@ -2,41 +2,43 @@
import bpy
class TEXT_HT_header(bpy.types.Header):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
def draw(self, context):
+ layout = self.layout
+
st = context.space_data
text = st.text
- layout = self.layout
- layout.template_header()
+ row = layout.row(align=True)
+ row.template_header()
if context.area.show_menus:
- row = layout.row()
- row.itemM("TEXT_MT_text")
+ sub = row.row(align=True)
+ sub.itemM("TEXT_MT_text")
if text:
- row.itemM("TEXT_MT_edit")
- row.itemM("TEXT_MT_format")
+ sub.itemM("TEXT_MT_edit")
+ sub.itemM("TEXT_MT_format")
if text and text.modified:
row = layout.row()
# row.color(redalert)
row.itemO("text.resolve_conflict", text="", icon='ICON_HELP')
+ layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
+
row = layout.row(align=True)
row.itemR(st, "line_numbers", text="")
row.itemR(st, "word_wrap", text="")
row.itemR(st, "syntax_highlight", text="")
- layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
-
if text:
row = layout.row()
if text.filename != "":
if text.dirty:
- row.itemL(text="File: *" + text.filename + " (unsaved)")
+ row.itemL(text="File: *%s (unsaved)" % text.filename)
else:
- row.itemL(text="File: " + text.filename)
+ row.itemL(text="File: %s" % text.filename )
else:
if text.library:
row.itemL(text="Text: External")
@@ -44,13 +46,14 @@ class TEXT_HT_header(bpy.types.Header):
row.itemL(text="Text: Internal")
class TEXT_PT_properties(bpy.types.Panel):
- __space_type__ = "TEXT_EDITOR"
- __region_type__ = "UI"
+ __space_type__ = 'TEXT_EDITOR'
+ __region_type__ = 'UI'
__label__ = "Properties"
def draw(self, context):
- st = context.space_data
layout = self.layout
+
+ st = context.space_data
flow = layout.column_flow()
flow.itemR(st, "line_numbers")
@@ -63,13 +66,14 @@ class TEXT_PT_properties(bpy.types.Panel):
flow.itemR(st, "tab_width")
class TEXT_PT_find(bpy.types.Panel):
- __space_type__ = "TEXT_EDITOR"
- __region_type__ = "UI"
+ __space_type__ = 'TEXT_EDITOR'
+ __region_type__ = 'UI'
__label__ = "Find"
def draw(self, context):
- st = context.space_data
layout = self.layout
+
+ st = context.space_data
# find
col = layout.column(align=True)
@@ -94,11 +98,12 @@ class TEXT_PT_find(bpy.types.Panel):
row.itemR(st, "find_all", text="All")
class TEXT_MT_text(bpy.types.Menu):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
__label__ = "Text"
def draw(self, context):
layout = self.layout
+
st = context.space_data
text = st.text
@@ -123,6 +128,10 @@ class TEXT_MT_text(bpy.types.Menu):
# XXX if(BPY_is_pyconstraint(text))
# XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints");
#endif
+
+ layout.itemS()
+
+ layout.itemO("text.properties", icon='ICON_MENU_PANEL')
#ifndef DISABLE_PYTHON
# XXX layout.column()
@@ -131,17 +140,17 @@ class TEXT_MT_text(bpy.types.Menu):
#endif
class TEXT_MT_edit_view(bpy.types.Menu):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
__label__ = "View"
def draw(self, context):
layout = self.layout
- layout.item_enumO("text.move", "type", "FILE_TOP", text="Top of File")
- layout.item_enumO("text.move", "type", "FILE_BOTTOM", text="Bottom of File")
+ layout.item_enumO("text.move", "type", 'FILE_TOP', text="Top of File")
+ layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File")
class TEXT_MT_edit_select(bpy.types.Menu):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
__label__ = "Select"
def draw(self, context):
@@ -151,7 +160,7 @@ class TEXT_MT_edit_select(bpy.types.Menu):
layout.itemO("text.select_line")
class TEXT_MT_edit_markers(bpy.types.Menu):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
__label__ = "Markers"
def draw(self, context):
@@ -162,7 +171,7 @@ class TEXT_MT_edit_markers(bpy.types.Menu):
layout.itemO("text.previous_marker")
class TEXT_MT_format(bpy.types.Menu):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
__label__ = "Format"
def draw(self, context):
@@ -181,7 +190,7 @@ class TEXT_MT_format(bpy.types.Menu):
layout.item_menu_enumO("text.convert_whitespace", "type")
class TEXT_MT_edit_to3d(bpy.types.Menu):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
__label__ = "Text To 3D Object"
def draw(self, context):
@@ -191,12 +200,11 @@ class TEXT_MT_edit_to3d(bpy.types.Menu):
layout.item_booleanO("text.to_3d_object", "split_lines", True, text="One Object Per Line");
class TEXT_MT_edit(bpy.types.Menu):
- __space_type__ = "TEXT_EDITOR"
+ __space_type__ = 'TEXT_EDITOR'
__label__ = "Edit"
def poll(self, context):
- st = context.space_data
- return st.text != None
+ return (context.space_data.text)
def draw(self, context):
layout = self.layout
@@ -219,7 +227,7 @@ class TEXT_MT_edit(bpy.types.Menu):
layout.itemS()
layout.itemO("text.jump")
- layout.itemO("text.properties")
+ layout.itemO("text.properties", text="Find...")
layout.itemS()
@@ -235,4 +243,3 @@ bpy.types.register(TEXT_MT_edit_view)
bpy.types.register(TEXT_MT_edit_select)
bpy.types.register(TEXT_MT_edit_markers)
bpy.types.register(TEXT_MT_edit_to3d)
-
diff --git a/release/ui/space_time.py b/release/ui/space_time.py
new file mode 100644
index 00000000000..bb82eea3272
--- /dev/null
+++ b/release/ui/space_time.py
@@ -0,0 +1,151 @@
+
+import bpy
+
+class TIME_HT_header(bpy.types.Header):
+ __space_type__ = 'TIMELINE'
+
+ def draw(self, context):
+ layout = self.layout
+
+ st = context.space_data
+ scene = context.scene
+ rd = context.scene.render_data
+ tools = context.tool_settings
+ screen = context.screen
+
+ row = layout.row(align=True)
+ row.template_header()
+
+ if context.area.show_menus:
+ sub = row.row(align=True)
+ sub.itemM("TIME_MT_view")
+ sub.itemM("TIME_MT_frame")
+ sub.itemM("TIME_MT_playback")
+
+ layout.itemR(scene, "use_preview_range", text="PR")
+
+ row = layout.row(align=True)
+ if not scene.use_preview_range:
+ row.itemR(scene, "start_frame", text="Start")
+ row.itemR(scene, "end_frame", text="End")
+ else:
+ row.itemR(scene, "preview_range_start_frame", text="Start")
+ row.itemR(scene, "preview_range_end_frame", text="End")
+
+ layout.itemR(scene, "current_frame", text="")
+
+ layout.itemS()
+
+ row = layout.row(align=True)
+ row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
+ row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
+ if not screen.animation_playing:
+ row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
+ row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
+ else:
+ sub = row.row()
+ sub.scale_x = 2.0
+ sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
+ row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
+ row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
+
+ row = layout.row(align=True)
+ row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
+ if screen.animation_playing and tools.enable_auto_key:
+ subsub = row.row()
+ subsub.itemR(tools, "record_with_nla", toggle=True)
+
+ layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
+
+ layout.itemS()
+
+ row = layout.row(align=True)
+ row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
+ row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
+ row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
+
+class TIME_MT_view(bpy.types.Menu):
+ __space_type__ = 'TIMELINE'
+ __label__ = "View"
+
+ def draw(self, context):
+ layout = self.layout
+
+ st = context.space_data
+
+ layout.itemO("anim.time_toggle")
+
+ layout.itemS()
+
+ layout.itemR(st, "only_selected")
+
+class TIME_MT_frame(bpy.types.Menu):
+ __space_type__ = 'TIMELINE'
+ __label__ = "Frame"
+
+ def draw(self, context):
+ layout = self.layout
+ tools = context.tool_settings
+
+ layout.itemO("marker.add", text="Add Marker")
+ layout.itemO("marker.duplicate", text="Duplicate Marker")
+ layout.itemO("marker.move", text="Grab/Move Marker")
+ layout.itemO("marker.delete", text="Delete Marker")
+ layout.itemL(text="ToDo: Name Marker")
+
+ layout.itemS()
+
+ layout.itemO("time.start_frame_set")
+ layout.itemO("time.end_frame_set")
+
+ layout.itemS()
+
+ sub = layout.row()
+ sub.active = tools.enable_auto_key
+ sub.itemM("TIME_MT_autokey")
+
+class TIME_MT_playback(bpy.types.Menu):
+ __space_type__ = 'TIMELINE'
+ __label__ = "Playback"
+
+ def draw(self, context):
+ layout = self.layout
+
+ st = context.space_data
+ rd = context.scene.render_data
+
+ layout.itemR(st, "play_top_left")
+ layout.itemR(st, "play_all_3d")
+ layout.itemR(st, "play_anim")
+ layout.itemR(st, "play_buttons")
+ layout.itemR(st, "play_image")
+ layout.itemR(st, "play_sequencer")
+
+ layout.itemS()
+
+ layout.itemR(st, "continue_physics")
+
+ layout.itemS()
+
+ layout.itemR(rd, "sync_audio", icon='ICON_SPEAKER')
+
+
+
+class TIME_MT_autokey(bpy.types.Menu):
+ __space_type__ = 'TIMELINE'
+ __label__ = "Auto-Keyframing Mode"
+
+ def draw(self, context):
+ layout = self.layout
+ tools = context.tool_settings
+
+ layout.active = tools.enable_auto_key
+
+ layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
+ layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS')
+
+bpy.types.register(TIME_HT_header)
+bpy.types.register(TIME_MT_view)
+bpy.types.register(TIME_MT_frame)
+bpy.types.register(TIME_MT_autokey)
+bpy.types.register(TIME_MT_playback)
diff --git a/release/ui/space_userpref.py b/release/ui/space_userpref.py
new file mode 100644
index 00000000000..1e7a9b581d4
--- /dev/null
+++ b/release/ui/space_userpref.py
@@ -0,0 +1,418 @@
+
+import bpy
+
+class USERPREF_HT_header(bpy.types.Header):
+ __space_type__ = 'USER_PREFERENCES'
+
+ def draw(self, context):
+ layout = self.layout
+ layout.template_header(menus=False)
+
+ userpref = context.user_preferences
+
+ layout.operator_context = "EXEC_AREA"
+ layout.itemO("wm.save_homefile", text="Save As Default")
+
+class USERPREF_MT_view(bpy.types.Menu):
+ __space_type__ = 'USER_PREFERENCES'
+ __label__ = "View"
+
+ def draw(self, context):
+ layout = self.layout
+
+class USERPREF_PT_tabs(bpy.types.Panel):
+ __space_type__ = 'USER_PREFERENCES'
+ __show_header__ = False
+
+ def draw(self, context):
+ layout = self.layout
+
+ userpref = context.user_preferences
+
+ layout.itemR(userpref, "active_section", expand=True)
+
+class USERPREF_PT_view(bpy.types.Panel):
+ __space_type__ = 'USER_PREFERENCES'
+ __label__ = "View"
+ __show_header__ = False
+
+ def poll(self, context):
+ userpref = context.user_preferences
+ return (userpref.active_section == 'VIEW_CONTROLS')
+
+ def draw(self, context):
+ layout = self.layout
+
+ userpref = context.user_preferences
+ view = userpref.view
+
+ split = layout.split()
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemL(text="Display:")
+ sub1.itemR(view, "tooltips")
+ sub1.itemR(view, "display_object_info", text="Object Info")
+ sub1.itemR(view, "use_large_cursors")
+ sub1.itemR(view, "show_view_name", text="View Name")
+ sub1.itemR(view, "show_playback_fps", text="Playback FPS")
+ sub1.itemR(view, "global_scene")
+ sub1.itemR(view, "pin_floating_panels")
+ sub1.itemR(view, "object_center_size")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemR(view, "show_mini_axis", text="Display Mini Axis")
+ sub2 = sub1.column()
+ sub2.enabled = view.show_mini_axis
+ sub2.itemR(view, "mini_axis_size", text="Size")
+ sub2.itemR(view, "mini_axis_brightness", text="Brightness")
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemL(text="View Manipulation:")
+ sub1.itemR(view, "auto_depth")
+ sub1.itemR(view, "global_pivot")
+ sub1.itemR(view, "zoom_to_mouse")
+ sub1.itemR(view, "rotate_around_selection")
+ sub1.itemS()
+ sub1.itemL(text="Zoom Style:")
+ sub1.row().itemR(view, "viewport_zoom_style", expand=True)
+ sub1.itemL(text="Orbit Style:")
+ sub1.row().itemR(view, "view_rotation", expand=True)
+ sub1.itemR(view, "perspective_orthographic_switch")
+ sub1.itemR(view, "smooth_view")
+ sub1.itemR(view, "rotation_angle")
+ sub1.itemS()
+ sub1.itemL(text="NDOF Device:")
+ sub1.itemR(view, "ndof_pan_speed", text="Pan Speed")
+ sub1.itemR(view, "ndof_rotate_speed", text="Orbit Speed")
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemL(text="Mouse Buttons:")
+ sub1.itemR(view, "left_mouse_button_select")
+ sub1.itemR(view, "right_mouse_button_select")
+ sub1.itemR(view, "emulate_3_button_mouse")
+ sub1.itemR(view, "use_middle_mouse_paste")
+ sub1.itemR(view, "middle_mouse_rotate")
+ sub1.itemR(view, "middle_mouse_pan")
+ sub1.itemR(view, "wheel_invert_zoom")
+ sub1.itemR(view, "wheel_scroll_lines")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemL(text="Menus:")
+ sub1.itemR(view, "open_mouse_over")
+ sub1.itemL(text="Menu Open Delay:")
+ sub1.itemR(view, "open_toplevel_delay", text="Top Level")
+ sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ #manipulator
+ sub1.itemR(view, "use_manipulator")
+ sub2 = sub1.column()
+ sub2.enabled = view.use_manipulator
+ sub2.itemR(view, "manipulator_size", text="Size")
+ sub2.itemR(view, "manipulator_handle_size", text="Handle Size")
+ sub2.itemR(view, "manipulator_hotspot", text="Hotspot")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemL(text="Toolbox:")
+ sub1.itemR(view, "use_column_layout")
+ sub1.itemL(text="Open Toolbox Delay:")
+ sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
+ sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
+
+class USERPREF_PT_edit(bpy.types.Panel):
+ __space_type__ = 'USER_PREFERENCES'
+ __label__ = "Edit"
+ __show_header__ = False
+
+ def poll(self, context):
+ userpref = context.user_preferences
+ return (userpref.active_section == 'EDIT_METHODS')
+
+ def draw(self, context):
+ layout = self.layout
+
+ userpref = context.user_preferences
+ edit = userpref.edit
+ view = userpref.view
+
+ split = layout.split()
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemL(text="Materials:")
+ sub1.itemR(edit, "material_linked_object", text="Linked to Object")
+ sub1.itemR(edit, "material_linked_obdata", text="Linked to ObData")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemL(text="New Objects:")
+ sub1.itemR(edit, "enter_edit_mode")
+ sub1.itemR(edit, "align_to_view")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemL(text="Transform:")
+ sub1.itemR(edit, "drag_immediately")
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemL(text="Snap:")
+ sub1.itemR(edit, "snap_translate", text="Translate")
+ sub1.itemR(edit, "snap_rotate", text="Rotate")
+ sub1.itemR(edit, "snap_scale", text="Scale")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemL(text="Grease Pencil:")
+ sub1.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
+ sub1.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
+ sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
+ # sub1.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
+ sub1.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemL(text="Keyframing:")
+ sub1.itemR(edit, "use_visual_keying")
+ sub1.itemR(edit, "new_interpolation_type")
+ sub1.itemS()
+ sub1.itemR(edit, "auto_keying_enable", text="Auto Keyframing")
+ sub2 = sub1.column()
+ sub2.enabled = edit.auto_keying_enable
+ sub2.row().itemR(edit, "auto_keying_mode", expand=True)
+ sub2.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available")
+ sub2.itemR(edit, "auto_keyframe_insert_needed", text="Only Insert Needed")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemL(text="Undo:")
+ sub1.itemR(edit, "global_undo")
+ sub1.itemR(edit, "undo_steps", text="Steps")
+ sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemS()
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemL(text="Duplicate:")
+ sub1.itemR(edit, "duplicate_mesh", text="Mesh")
+ sub1.itemR(edit, "duplicate_surface", text="Surface")
+ sub1.itemR(edit, "duplicate_curve", text="Curve")
+ sub1.itemR(edit, "duplicate_text", text="Text")
+ sub1.itemR(edit, "duplicate_metaball", text="Metaball")
+ sub1.itemR(edit, "duplicate_armature", text="Armature")
+ sub1.itemR(edit, "duplicate_lamp", text="Lamp")
+ sub1.itemR(edit, "duplicate_material", text="Material")
+ sub1.itemR(edit, "duplicate_texture", text="Texture")
+ sub1.itemR(edit, "duplicate_ipo", text="F-Curve")
+ sub1.itemR(edit, "duplicate_action", text="Action")
+ sub1.itemR(edit, "duplicate_particle", text="Particle")
+
+class USERPREF_PT_system(bpy.types.Panel):
+ __space_type__ = 'USER_PREFERENCES'
+ __label__ = "System"
+ __show_header__ = False
+
+ def poll(self, context):
+ userpref = context.user_preferences
+ return (userpref.active_section == 'SYSTEM_OPENGL')
+
+ def draw(self, context):
+ layout = self.layout
+
+ userpref = context.user_preferences
+ system = userpref.system
+ lan = userpref.language
+
+ split = layout.split()
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ sub1.itemR(system, "emulate_numpad")
+ sub1.itemS()
+ sub1.itemS()
+
+ #Weight Colors
+ sub1.itemL(text="Weight Colors:")
+ sub1.itemR(system, "use_weight_color_range", text="Use Custom Range")
+
+ sub2 = sub1.column()
+ sub2.active = system.use_weight_color_range
+ sub2.template_color_ramp(system.weight_color_range, expand=True)
+ sub1.itemS()
+ sub1.itemS()
+
+ #sequencer
+ sub1.itemL(text="Sequencer:")
+ sub1.itemR(system, "prefetch_frames")
+ sub1.itemR(system, "memory_cache_limit")
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub .column()
+ #System
+ sub1.itemL(text="System:")
+ sub1.itemR(lan, "dpi")
+ sub1.itemR(system, "auto_run_python_scripts")
+ sub1.itemR(system, "frame_server_port")
+ sub1.itemR(system, "filter_file_extensions")
+ sub1.itemR(system, "hide_dot_files_datablocks")
+ sub1.itemR(lan, "scrollback", text="Console Scrollback")
+ sub1.itemS()
+ sub1.itemS()
+ sub1.itemL(text="Sound:")
+ sub1.itemR(system, "audio_device")
+ sub2 = sub1.column()
+ sub2.active = system.audio_device != 'AUDIO_DEVICE_NULL'
+ sub2.itemR(system, "enable_all_codecs")
+ sub2.itemR(system, "game_sound")
+ sub2.itemR(system, "audio_channels")
+ sub2.itemR(system, "audio_mixing_buffer")
+ sub2.itemR(system, "audio_sample_rate")
+ sub2.itemR(system, "audio_sample_format")
+
+ col = split.column()
+ sub = col.split(percentage=0.85)
+
+ sub1 = sub.column()
+ #OpenGL
+ sub1.itemL(text="OpenGL:")
+ sub1.itemR(system, "clip_alpha", slider=True)
+ sub1.itemR(system, "use_mipmaps")
+ sub1.itemL(text="Window Draw Method:")
+ sub1.row().itemR(system, "window_draw_method", expand=True)
+ sub1.itemL(text="Textures:")
+ sub1.itemR(system, "gl_texture_limit", text="Limit Size")
+ sub1.itemR(system, "texture_time_out", text="Time Out")
+ sub1.itemR(system, "texture_collection_rate", text="Collection Rate")
+
+class USERPREF_PT_filepaths(bpy.types.Panel):
+ __space_type__ = 'USER_PREFERENCES'
+ __label__ = "File Paths"
+ __show_header__ = False
+
+ def poll(self, context):
+ userpref = context.user_preferences
+ return (userpref.active_section == 'FILE_PATHS')
+
+ def draw(self, context):
+ layout = self.layout
+
+ userpref = context.user_preferences
+ paths = userpref.filepaths
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemL(text="File Paths:")
+ sub = col.split(percentage=0.3)
+
+ sub.itemL(text="Fonts:")
+ sub.itemR(paths, "fonts_directory", text="")
+ sub = col.split(percentage=0.3)
+ sub.itemL(text="Textures:")
+ sub.itemR(paths, "textures_directory", text="")
+ sub = col.split(percentage=0.3)
+ sub.itemL(text="Texture Plugins:")
+ sub.itemR(paths, "texture_plugin_directory", text="")
+ sub = col.split(percentage=0.3)
+ sub.itemL(text="Sequence Plugins:")
+ sub.itemR(paths, "sequence_plugin_directory", text="")
+ sub = col.split(percentage=0.3)
+ sub.itemL(text="Render Output:")
+ sub.itemR(paths, "render_output_directory", text="")
+ sub = col.split(percentage=0.3)
+ sub.itemL(text="Scripts:")
+ sub.itemR(paths, "python_scripts_directory", text="")
+ sub = col.split(percentage=0.3)
+ sub.itemL(text="Sounds:")
+ sub.itemR(paths, "sounds_directory", text="")
+ sub = col.split(percentage=0.3)
+ sub.itemL(text="Temp:")
+ sub.itemR(paths, "temporary_directory", text="")
+
+ col = split.column()
+ sub = col.split(percentage=0.2)
+ sub1 = sub.column()
+ sub2 = sub.column()
+ sub2.itemL(text="Save & Load:")
+ sub2.itemR(paths, "use_relative_paths")
+ sub2.itemR(paths, "compress_file")
+ sub2.itemR(paths, "load_ui")
+ sub2.itemS()
+ sub2.itemS()
+ sub2.itemL(text="Auto Save:")
+ sub2.itemR(paths, "save_version")
+ sub2.itemR(paths, "recent_files")
+ sub2.itemR(paths, "save_preview_images")
+ sub2.itemR(paths, "auto_save_temporary_files")
+ sub3 = sub2.column()
+ sub3.enabled = paths.auto_save_temporary_files
+ sub3.itemR(paths, "auto_save_time", text="Timer (mins)")
+
+class USERPREF_PT_language(bpy.types.Panel):
+ __space_type__ = 'USER_PREFERENCES'
+ __label__ = "Language"
+ __show_header__ = False
+
+ def poll(self, context):
+ userpref = context.user_preferences
+ return (userpref.active_section == 'LANGUAGE_COLORS')
+
+ def draw(self, context):
+ layout = self.layout
+
+ userpref = context.user_preferences
+ lan = userpref.language
+
+ split = layout.split()
+ col = split.column()
+
+ col.itemR(lan, "language")
+ col.itemL(text="Translate:")
+ col.itemR(lan, "translate_tooltips", text="Tooltips")
+ col.itemR(lan, "translate_buttons", text="Labels")
+ col.itemR(lan, "translate_toolbox", text="Toolbox")
+ col.itemS()
+ col.itemS()
+ col.itemR(lan, "use_textured_fonts")
+
+ col = split.column()
+
+
+bpy.types.register(USERPREF_HT_header)
+bpy.types.register(USERPREF_MT_view)
+bpy.types.register(USERPREF_PT_tabs)
+bpy.types.register(USERPREF_PT_view)
+bpy.types.register(USERPREF_PT_edit)
+bpy.types.register(USERPREF_PT_system)
+bpy.types.register(USERPREF_PT_filepaths)
+bpy.types.register(USERPREF_PT_language)
+
diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py
index fc550982afa..ae1edc0295b 100644
--- a/release/ui/space_view3d.py
+++ b/release/ui/space_view3d.py
@@ -1,35 +1,129 @@
import bpy
-# ********** Header ****************
+# ********** Header **********
class VIEW3D_HT_header(bpy.types.Header):
- __space_type__ = "VIEW_3D"
+ __space_type__ = 'VIEW_3D'
def draw(self, context):
layout = self.layout
+
+ view = context.space_data
+ mode_string = context.mode
+ edit_object = context.edit_object
+ object = context.active_object
+
+ row = layout.row(align=True)
+ row.template_header()
- layout.template_header()
-
- # menus
+ # Menus
if context.area.show_menus:
- row = layout.row()
- row.itemM("VIEW3D_MT_view")
+ sub = row.row(align=True)
+
+ sub.itemM("VIEW3D_MT_view")
+
+ # Select Menu
+ if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'):
+ sub.itemM("VIEW3D_MT_select_%s" % mode_string)
+
+ if edit_object:
+ sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type)
+ elif object:
+ ob_mode_string = object.mode
+
+ if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']:
+ sub.itemM("VIEW3D_MT_%s" % mode_string)
layout.template_header_3D()
-# ********** Menu ****************
+# ********** Menu **********
+
+# ********** Utilities **********
+
+class VIEW3D_MT_showhide(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Show/Hide"
+ _operator_name = ""
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("%s.reveal" % self._operator_name, text="Show Hidden")
+ layout.itemO("%s.hide" % self._operator_name, text="Hide Selected")
+ layout.item_booleanO("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected")
+
+class VIEW3D_MT_snap(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Snap"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.snap_selected_to_grid", text="Selection to Grid")
+ layout.itemO("view3d.snap_selected_to_cursor", text="Selection to Cursor")
+ layout.itemO("view3d.snap_selected_to_center", text="Selection to Center")
+
+ layout.itemS()
+
+ layout.itemO("view3d.snap_cursor_to_selected", text="Cursor to Selected")
+ layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid")
+ layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active")
+
+# ********** View menus **********
+
+class VIEW3D_MT_view(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "View"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.properties", icon='ICON_MENU_PANEL')
+ layout.itemO("view3d.toolbar", icon='ICON_MENU_PANEL')
+
+ layout.itemS()
+
+ layout.item_enumO("view3d.viewnumpad", "type", 'CAMERA')
+ layout.item_enumO("view3d.viewnumpad", "type", 'TOP')
+ layout.item_enumO("view3d.viewnumpad", "type", 'FRONT')
+ layout.item_enumO("view3d.viewnumpad", "type", 'RIGHT')
+
+ layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
+
+ layout.itemS()
+
+ layout.itemO("view3d.view_persportho")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_view_navigation")
+ layout.itemM("VIEW3D_MT_view_align")
+
+ layout.itemS()
+
+ layout.operator_context = "INVOKE_REGION_WIN"
+
+ layout.itemO("view3d.clip_border", text="Clipping Border...")
+ layout.itemO("view3d.zoom_border", text="Zoom Border...")
+
+ layout.itemS()
+
+ layout.itemO("view3d.view_center")
+ layout.itemO("view3d.view_all")
+
+ layout.itemS()
+
+ layout.itemO("screen.region_foursplit", text="Toggle Quad View")
+ layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
class VIEW3D_MT_view_navigation(bpy.types.Menu):
- __space_type__ = "VIEW_3D"
+ __space_type__ = 'VIEW_3D'
__label__ = "Navigation"
def draw(self, context):
layout = self.layout
- # layout.itemO("view3d.view_fly_mode")
- # layout.itemS()
-
layout.items_enumO("view3d.view_orbit", "type")
layout.itemS()
@@ -41,65 +135,991 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu):
layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In")
layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out")
-class VIEW3D_MT_view(bpy.types.Menu):
- __space_type__ = "VIEW_3D"
- __label__ = "View"
+class VIEW3D_MT_view_align(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Align View"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.view_center")
+
+class VIEW3D_MT_view_cameras(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Cameras"
+
+ def draw(self, context):
+ layout = self.layout
+
+# ********** Select menus, suffix from context.mode **********
+
+class VIEW3D_MT_select_OBJECT(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.properties", icon="ICON_MENU_PANEL")
- layout.itemO("view3d.toolbar", icon="ICON_MENU_PANEL")
+ layout.itemO("view3d.select_border")
+
+ layout.itemS()
+
+ layout.itemO("object.select_all_toggle", text="Select/Deselect All")
+ layout.itemO("object.select_inverse", text="Inverse")
+ layout.itemO("object.select_random", text="Random")
+ layout.itemO("object.select_mirror", text="Mirror")
+ layout.itemO("object.select_by_layer", text="Select All by Layer")
+ layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type...")
+ layout.itemO("object.select_grouped", text="Select Grouped...")
+
+class VIEW3D_MT_select_POSE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border", text="Border Select...")
+
+ layout.itemS()
+
+ layout.itemO("pose.select_all_toggle", text="Select/Deselect All")
+ layout.itemO("pose.select_inverse", text="Inverse")
+ layout.itemO("pose.select_constraint_target", text="Constraint Target")
layout.itemS()
- layout.item_enumO("view3d.viewnumpad", "type", "CAMERA")
- layout.item_enumO("view3d.viewnumpad", "type", "TOP")
- layout.item_enumO("view3d.viewnumpad", "type", "FRONT")
- layout.item_enumO("view3d.viewnumpad", "type", "RIGHT")
+ layout.item_enumO("pose.select_hierarchy", "direction", 'PARENT')
+ layout.item_enumO("pose.select_hierarchy", "direction", 'CHILD')
- # layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
+ layout.itemS()
+ props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Parent")
+ props.extend = True
+ props.direction = 'PARENT'
+
+ props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Child")
+ props.extend = True
+ props.direction = 'CHILD'
+
+class VIEW3D_MT_select_PARTICLE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border")
+
layout.itemS()
+
+ layout.itemO("particle.select_all_toggle", text="Select/Deselect All")
+ layout.itemO("particle.select_linked")
+
+ layout.itemS()
+
+ layout.itemO("particle.select_more")
+ layout.itemO("particle.select_less")
- layout.itemO("view3d.view_persportho")
+class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border", text="Border Select...")
+
+ layout.itemS()
+
+ layout.itemO("mesh.select_all_toggle", text="Select/Deselect All")
+ layout.itemO("mesh.select_inverse", text="Inverse")
+
+ layout.itemS()
+
+ layout.itemO("mesh.select_random", text="Random...")
+ layout.itemO("mesh.edges_select_sharp", text="Sharp Edges")
+ layout.itemO("mesh.faces_select_linked_flat", text="Linked Flat Faces")
+
+ layout.itemS()
+
+ layout.item_enumO("mesh.select_by_number_vertices", "type", 'TRIANGLES', text="Triangles")
+ layout.item_enumO("mesh.select_by_number_vertices", "type", 'QUADS', text="Quads")
+ layout.item_enumO("mesh.select_by_number_vertices", "type", 'OTHER', text="Loose Verts/Edges")
+ layout.itemO("mesh.select_similar", text="Similar...")
+
+ layout.itemS()
+
+ layout.itemO("mesh.select_less", text="Less")
+ layout.itemO("mesh.select_more", text="More")
+
+ layout.itemS()
+
+ layout.itemO("mesh.select_linked", text="Linked")
+ layout.itemO("mesh.select_vertex_path", text="Vertex Path")
+ layout.itemO("mesh.loop_multi_select", text="Edge Loop")
+ layout.item_booleanO("mesh.loop_multi_select", "ring", True, text="Edge Ring")
+
+ layout.itemS()
+
+ layout.itemO("mesh.loop_to_region")
+ layout.itemO("mesh.region_to_loop")
+
+class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border", text="Border Select...")
+ layout.itemO("view3d.select_circle", text="Circle Select...")
+
+ layout.itemS()
+ layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
+ layout.itemO("curve.select_inverse")
+ layout.itemO("curve.select_random")
+ layout.itemO("curve.select_every_nth")
+
layout.itemS()
- # layout.itemO("view3d.view_show_all_layers")
+ layout.itemO("curve.de_select_first")
+ layout.itemO("curve.de_select_last")
+ layout.itemO("curve.select_next")
+ layout.itemO("curve.select_previous")
+
+ layout.itemS()
- # layout.itemS()
+ layout.itemO("curve.select_more")
+ layout.itemO("curve.select_less")
+
+class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border", text="Border Select...")
+ layout.itemO("view3d.select_circle", text="Circle Select...")
+
+ layout.itemS()
- # layout.itemO("view3d.view_local_view")
- # layout.itemO("view3d.view_global_view")
+ layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
+ layout.itemO("curve.select_inverse")
+ layout.itemO("curve.select_random")
+ layout.itemO("curve.select_every_nth")
+
+ layout.itemS()
- # layout.itemS()
+ layout.itemO("curve.select_row")
+
+ layout.itemS()
- layout.itemM("VIEW3D_MT_view_navigation")
- # layout.itemM("VIEW3D_MT_view_align", text="Align View")
+ layout.itemO("curve.select_more")
+ layout.itemO("curve.select_less")
+
+class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border")
layout.itemS()
+
+ layout.itemO("mball.select_deselect_all_metaelems")
+ layout.itemO("mball.select_inverse_metaelems")
+
+ layout.itemS()
+
+ layout.itemO("mball.select_random_metaelems")
- layout.operator_context = "INVOKE_REGION_WIN"
+class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
- layout.itemO("view3d.clip_border")
- layout.itemO("view3d.zoom_border")
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border")
+
+ layout.itemS()
+ layout.itemO("lattice.select_all_toggle", text="Select/Deselect All")
+
+class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("view3d.select_border", text="Border Select...")
+
layout.itemS()
- layout.itemO("view3d.view_center")
- layout.itemO("view3d.view_all")
+ layout.itemO("armature.select_all_toggle", text="Select/Deselect All")
+ layout.itemO("armature.select_inverse", text="Inverse")
+
+ layout.itemS()
+
+ layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT', text="Parent")
+ layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD', text="Child")
layout.itemS()
- layout.itemO("screen.region_foursplit", text="Toggle Quad View")
- layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
+ props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Parent")
+ props.extend = True
+ props.direction = 'PARENT'
+
+ props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Child")
+ props.extend = True
+ props.direction = 'CHILD'
+
+class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.view3d_select_faceselmenu()
+
+# ********** Object menu **********
+
+class VIEW3D_MT_OBJECT(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __context__ = "objectmode"
+ __label__ = "Object"
-# ********** Panel ****************
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemM("VIEW3D_MT_OBJECT_clear")
+ layout.itemM("VIEW3D_MT_snap")
+
+ layout.itemS()
+
+ layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
+ layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
+
+ layout.itemS()
+
+ layout.itemO("object.duplicate")
+ layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
+ layout.itemO("object.delete", text="Delete...")
+ layout.itemO("object.proxy_make", text="Make Proxy...")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_OBJECT_parent")
+ layout.itemM("VIEW3D_MT_OBJECT_track")
+ layout.itemM("VIEW3D_MT_OBJECT_group")
+ layout.itemM("VIEW3D_MT_OBJECT_constraints")
+
+ layout.itemS()
+
+ layout.itemO("object.join")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_OBJECT_showhide")
+
+class VIEW3D_MT_OBJECT_clear(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Clear"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("object.location_clear", text="Location")
+ layout.itemO("object.rotation_clear", text="Rotation")
+ layout.itemO("object.scale_clear", text="Scale")
+ layout.itemO("object.origin_clear", text="Origin")
+
+class VIEW3D_MT_OBJECT_parent(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Parent"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("object.parent_set", text="Set")
+ layout.itemO("object.parent_clear", text="Clear")
+
+class VIEW3D_MT_OBJECT_track(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Track"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("object.track_set", text="Set")
+ layout.itemO("object.track_clear", text="Clear")
+
+class VIEW3D_MT_OBJECT_group(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Group"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("group.group_create")
+ layout.itemO("group.objects_remove")
+
+ layout.itemS()
+
+ layout.itemO("group.objects_add_active")
+ layout.itemO("group.objects_remove_active")
+
+class VIEW3D_MT_OBJECT_constraints(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Constraints"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("object.constraint_add_with_targets")
+ layout.itemO("object.constraints_clear")
+
+class VIEW3D_MT_OBJECT_showhide(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Show/Hide"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("object.restrictview_clear", text="Show Hidden")
+ layout.itemO("object.restrictview_set", text="Hide Selected")
+ layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected")
+
+# ********** Vertex paint menu **********
+
+class VIEW3D_MT_PAINT_VERTEX(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Paint"
+
+ def draw(self, context):
+ layout = self.layout
+
+ sculpt = context.tool_settings.sculpt
+
+ layout.itemO("paint.vertex_color_set")
+ props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True)
+ props.selected = True
+
+# ********** Sculpt menu **********
+
+class VIEW3D_MT_SCULPT(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Sculpt"
+
+ def draw(self, context):
+ layout = self.layout
+
+ sculpt = context.tool_settings.sculpt
+ brush = context.tool_settings.sculpt.brush
+
+ layout.itemR(sculpt, "symmetry_x")
+ layout.itemR(sculpt, "symmetry_y")
+ layout.itemR(sculpt, "symmetry_z")
+ layout.itemS()
+ layout.itemR(sculpt, "lock_x")
+ layout.itemR(sculpt, "lock_y")
+ layout.itemR(sculpt, "lock_z")
+ layout.itemS()
+ layout.item_menu_enumO("brush.curve_preset", property="shape")
+ layout.itemS()
+
+ if brush.sculpt_tool != 'GRAB':
+ layout.itemR(brush, "airbrush")
+
+ if brush.sculpt_tool != 'LAYER':
+ layout.itemR(brush, "anchored")
+
+ if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
+ layout.itemR(brush, "flip_direction")
+
+ if brush.sculpt_tool == 'LAYER':
+ layout.itemR(brush, "persistent")
+ layout.itemO("sculpt.set_persistent_base")
+
+# ********** Particle menu **********
+
+class VIEW3D_MT_PARTICLE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Particle"
+
+ def draw(self, context):
+ layout = self.layout
+
+ particle_edit = context.tool_settings.particle_edit
+
+ layout.itemO("particle.mirror")
+
+ layout.itemS()
+
+ layout.itemO("particle.remove_doubles")
+ layout.itemO("particle.delete")
+
+ if particle_edit.selection_mode == 'POINT':
+ layout.itemO("particle.subdivide")
+
+ layout.itemO("particle.rekey")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_PARTICLE_showhide")
+
+class VIEW3D_MT_PARTICLE_showhide(VIEW3D_MT_showhide):
+ _operator_name = "particle"
+
+# ********** Pose Menu **********
+
+class VIEW3D_MT_POSE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Pose"
+
+ def draw(self, context):
+ layout = self.layout
+
+ arm = context.active_object.data
+
+ if arm.drawtype in ('BBONE', 'ENVELOPE'):
+ layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
+
+ layout.itemM("VIEW3D_MT_POSE_transform")
+
+ layout.itemS()
+
+ layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
+ layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
+
+ layout.itemS()
+
+ layout.itemO("pose.apply")
+
+ layout.itemS()
+
+ layout.itemO("pose.copy")
+ layout.itemO("pose.paste")
+ layout.item_booleanO("pose.paste", "flipped", True, text="Paste X-Flipped Pose")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_POSE_pose")
+ layout.itemM("VIEW3D_MT_POSE_motion")
+ layout.itemM("VIEW3D_MT_POSE_group")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_POSE_ik")
+ layout.itemM("VIEW3D_MT_POSE_constraints")
+
+ layout.itemS()
+
+ layout.operator_context = "EXEC_AREA"
+ layout.item_enumO("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right")
+ layout.item_enumO("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back")
+ layout.item_enumO("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom")
+
+ layout.itemO("pose.flip_names")
+
+ layout.itemS()
+
+ layout.operator_context = "INVOKE_AREA"
+ layout.itemO("pose.armature_layers", text="Change Armature Layers...")
+ layout.itemO("pose.bone_layers", text="Change Bone Layers...")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_POSE_showhide")
+ layout.item_menu_enumO("pose.flags_set", 'mode', text="Bone Settings")
+
+class VIEW3D_MT_POSE_transform(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Clear Transform"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemL(text="User Transform")
+
+ layout.itemO("pose.loc_clear", text="Location")
+ layout.itemO("pose.rot_clear", text="Rotation")
+ layout.itemO("pose.scale_clear", text="Scale")
+
+ layout.itemL(text="Origin")
+
+class VIEW3D_MT_POSE_pose(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Pose Library"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("poselib.browse_interactive", text="Browse Poses...")
+
+ layout.itemS()
+
+ layout.itemO("poselib.pose_add", text="Add Pose...")
+ layout.itemO("poselib.pose_rename", text="Rename Pose...")
+ layout.itemO("poselib.pose_remove", text="Remove Pose...")
+
+class VIEW3D_MT_POSE_motion(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Motion Paths"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("pose.paths_calculate", text="Calculate")
+ layout.itemO("pose.paths_clear", text="Clear")
+
+class VIEW3D_MT_POSE_group(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Bone Groups"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.itemO("pose.group_add")
+ layout.itemO("pose.group_remove")
+
+ layout.itemS()
+
+ layout.itemO("pose.group_assign")
+ layout.itemO("pose.group_unassign")
+
+
+class VIEW3D_MT_POSE_ik(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Inverse Kinematics"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("pose.ik_add")
+ layout.itemO("pose.ik_clear")
+
+class VIEW3D_MT_POSE_constraints(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Constraints"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("pose.constraint_add_with_targets", text="Add (With Targets)...")
+ layout.itemO("pose.constraints_clear")
+
+class VIEW3D_MT_POSE_showhide(VIEW3D_MT_showhide):
+ _operator_name = "pose"
+
+# ********** Edit Menus, suffix from ob.type **********
+
+# Edit MESH
+class VIEW3D_MT_edit_MESH(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Mesh"
+
+ def draw(self, context):
+ layout = self.layout
+
+ settings = context.tool_settings
+
+ layout.itemO("ed.undo")
+ layout.itemO("ed.redo")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_snap")
+
+ layout.itemS()
+
+ layout.itemO("uv.mapping_menu", text="UV Unwrap...")
+
+ layout.itemS()
+
+ layout.itemO("mesh.extrude")
+ layout.itemO("mesh.duplicate")
+ layout.itemO("mesh.delete", text="Delete...")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_edit_MESH_vertices")
+ layout.itemM("VIEW3D_MT_edit_MESH_edges")
+ layout.itemM("VIEW3D_MT_edit_MESH_faces")
+ layout.itemM("VIEW3D_MT_edit_MESH_normals")
+
+ layout.itemS()
+
+ layout.itemR(settings, "automerge_editing")
+ layout.itemR(settings, "proportional_editing")
+ layout.item_menu_enumR(settings, "proportional_editing_falloff")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_edit_MESH_showhide")
+
+class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Vertices"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("mesh.merge")
+ layout.itemO("mesh.rip")
+ layout.itemO("mesh.split")
+ layout.itemO("mesh.separate")
+
+ layout.itemS()
+
+ layout.itemO("mesh.vertices_smooth")
+ layout.itemO("mesh.remove_doubles")
+
+class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Edges"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("mesh.edge_face_add")
+ layout.itemO("mesh.subdivide")
+
+ layout.itemS()
+
+ layout.itemO("mesh.mark_seam")
+ layout.item_booleanO("mesh.mark_seam", "clear", True, text="Clear Seam")
+
+ layout.itemS()
+
+ layout.itemO("mesh.mark_sharp")
+ layout.item_booleanO("mesh.mark_sharp", "clear", True, text="Clear Sharp")
+
+ layout.itemS()
+
+ layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW")
+ layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW")
+
+class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Faces"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("mesh.edge_face_add")
+ layout.itemO("mesh.fill")
+ layout.itemO("mesh.beauty_fill")
+
+ layout.itemS()
+
+ layout.itemO("mesh.quads_convert_to_tris")
+ layout.itemO("mesh.tris_convert_to_quads")
+ layout.itemO("mesh.edge_flip")
+
+ layout.itemS()
+
+ layout.itemO("mesh.faces_shade_smooth")
+ layout.itemO("mesh.faces_shade_flat")
+
+class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Normals"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("mesh.normals_make_consistent", text="Recalculate Outside")
+ layout.item_booleanO("mesh.normals_make_consistent", "inside", True, text="Recalculate Inside")
+
+ layout.itemS()
+
+ layout.itemO("mesh.flip_normals")
+
+class VIEW3D_MT_edit_MESH_showhide(VIEW3D_MT_showhide):
+ _operator_name = "mesh"
+
+# Edit CURVE
+
+# draw_CURVE is used by VIEW3D_MT_edit_CURVE and VIEW3D_MT_edit_SURFACE
+def draw_CURVE(self, context):
+ layout = self.layout
+
+ settings = context.tool_settings
+
+ layout.itemM("VIEW3D_MT_snap")
+
+ layout.itemS()
+
+ layout.itemO("curve.extrude")
+ layout.itemO("curve.duplicate")
+ layout.itemO("curve.separate")
+ layout.itemO("curve.make_segment")
+ layout.itemO("curve.cyclic_toggle")
+ layout.itemO("curve.delete", text="Delete...")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_edit_CURVE_ctrlpoints")
+ layout.itemM("VIEW3D_MT_edit_CURVE_segments")
+
+ layout.itemS()
+
+ layout.itemR(settings, "proportional_editing")
+ layout.item_menu_enumR(settings, "proportional_editing_falloff")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_edit_CURVE_showhide")
+
+class VIEW3D_MT_edit_CURVE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Curve"
+
+ draw = draw_CURVE
+
+class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Control Points"
+
+ def draw(self, context):
+ layout = self.layout
+
+ edit_object = context.edit_object
+
+ if edit_object.type == 'CURVE':
+ layout.item_enumO("tfm.transform", "mode", 'TILT')
+ layout.itemO("curve.tilt_clear")
+ layout.itemO("curve.separate")
+
+ layout.itemS()
+
+ layout.item_menu_enumO("curve.handle_type_set", "type")
+
+class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Segments"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("curve.subdivide")
+ layout.itemO("curve.switch_direction")
+
+class VIEW3D_MT_edit_CURVE_showhide(VIEW3D_MT_showhide):
+ _operator_name = "curve"
+
+# Edit SURFACE
+class VIEW3D_MT_edit_SURFACE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Surface"
+
+ draw = draw_CURVE
+
+# Edit TEXT
+class VIEW3D_MT_edit_TEXT(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Text"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("font.file_paste")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_edit_TEXT_chars")
+
+class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Special Characters"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xA9'.decode(), text="Copyright|Alt C")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xAE'.decode(), text="Registered Trademark|Alt R")
+
+ layout.itemS()
+
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xB0'.decode(), text="Degree Sign|Alt G")
+ layout.item_stringO("font.text_insert", "text", b'\xC3\x97'.decode(), text="Multiplication Sign|Alt x")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\x8A'.decode(), text="Circle|Alt .")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xB9'.decode(), text="Superscript 1|Alt 1")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xB2'.decode(), text="Superscript 2|Alt 2")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xB3'.decode(), text="Superscript 3|Alt 3")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xBB'.decode(), text="Double >>|Alt >")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xAB'.decode(), text="Double <<|Alt <")
+ layout.item_stringO("font.text_insert", "text", b'\xE2\x80\xB0'.decode(), text="Promillage|Alt %")
+
+ layout.itemS()
+
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xA4'.decode(), text="Dutch Florin|Alt F")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xA3'.decode(), text="British Pound|Alt L")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xA5'.decode(), text="Japanese Yen|Alt Y")
+
+ layout.itemS()
+
+ layout.item_stringO("font.text_insert", "text", b'\xC3\x9F'.decode(), text="German S|Alt S")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xBF'.decode(), text="Spanish Question Mark|Alt ?")
+ layout.item_stringO("font.text_insert", "text", b'\xC2\xA1'.decode(), text="Spanish Exclamation Mark|Alt !")
+
+# Edit META
+class VIEW3D_MT_edit_META(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Metaball"
+
+ def draw(self, context):
+ layout = self.layout
+
+ settings = context.tool_settings
+
+ layout.itemO("ed.undo")
+ layout.itemO("ed.redo")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_snap")
+
+ layout.itemS()
+
+ layout.itemO("mball.delete_metaelems", text="Delete...")
+ layout.itemO("mball.duplicate_metaelems")
+
+ layout.itemS()
+
+ layout.itemR(settings, "proportional_editing")
+ layout.item_menu_enumR(settings, "proportional_editing_falloff")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_edit_META_showhide")
+
+class VIEW3D_MT_edit_META_showhide(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Show/Hide"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("mball.reveal_metaelems", text="Show Hidden")
+ layout.itemO("mball.hide_metaelems", text="Hide Selected")
+ layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected")
+
+# Edit LATTICE
+class VIEW3D_MT_edit_LATTICE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Lattice"
+
+ def draw(self, context):
+ layout = self.layout
+
+ settings = context.tool_settings
+
+ layout.itemM("VIEW3D_MT_snap")
+
+ layout.itemS()
+
+ layout.itemO("lattice.make_regular")
+
+ layout.itemS()
+
+ layout.itemR(settings, "proportional_editing")
+ layout.item_menu_enumR(settings, "proportional_editing_falloff")
+
+# Edit ARMATURE
+class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Armature"
+
+ def draw(self, context):
+ layout = self.layout
+
+ edit_object = context.edit_object
+ arm = edit_object.data
+
+ layout.itemM("VIEW3D_MT_snap")
+ layout.itemM("VIEW3D_MT_edit_ARMATURE_roll")
+
+ if arm.drawtype == 'ENVELOPE':
+ layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
+ else:
+ layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale B-Bone Width")
+
+ layout.itemS()
+
+ layout.itemO("armature.extrude")
+
+ if arm.x_axis_mirror:
+ layout.item_booleanO("armature.extrude", "forked", True, text="Extrude Forked")
+
+ layout.itemO("armature.duplicate")
+ layout.itemO("armature.merge")
+ layout.itemO("armature.fill")
+ layout.itemO("armature.delete")
+ layout.itemO("armature.separate")
+
+ layout.itemS()
+
+ layout.itemO("armature.subdivide_multi", text="Subdivide")
+
+ layout.itemS()
+
+ layout.operator_context = "EXEC_AREA"
+ layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right")
+ layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back")
+ layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom")
+ layout.itemO("armature.flip_names")
+
+ layout.itemS()
+
+ layout.operator_context = "INVOKE_DEFAULT"
+ layout.itemO("armature.armature_layers")
+ layout.itemO("armature.bone_layers")
+
+ layout.itemS()
+
+ layout.itemM("VIEW3D_MT_edit_ARMATURE_parent")
+
+ layout.itemS()
+
+ layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings")
+
+class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Parent"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("armature.parent_set", text="Make")
+ layout.itemO("armature.parent_clear", text="Clear")
+
+class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu):
+ __space_type__ = 'VIEW_3D'
+ __label__ = "Bone Roll"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.item_enumO("armature.calculate_roll", "type", 'GLOBALUP', text="Clear Roll (Z-Axis Up)")
+ layout.item_enumO("armature.calculate_roll", "type", 'CURSOR', text="Roll to Cursor")
+
+ layout.itemS()
+
+ layout.item_enumO("tfm.transform", "mode", 'BONE_ROLL', text="Set Roll")
+
+# ********** Panel **********
class VIEW3D_PT_3dview_properties(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "UI"
+ __space_type__ = 'VIEW_3D'
+ __region_type__ = 'UI'
__label__ = "View"
def poll(self, context):
@@ -130,8 +1150,8 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel):
layout.column().itemR(scene, "cursor_location", text="3D Cursor:")
class VIEW3D_PT_3dview_display(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "UI"
+ __space_type__ = 'VIEW_3D'
+ __region_type__ = 'UI'
__label__ = "Display"
def poll(self, context):
@@ -160,10 +1180,44 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel):
col.itemR(view, "lock_rotation")
col.itemR(view, "box_preview")
col.itemR(view, "box_clip")
+
+class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
+ __space_type__ = 'VIEW_3D'
+ __region_type__ = 'UI'
+ __label__ = "Mesh Display"
+
+ def poll(self, context):
+ editmesh = context.mode == 'EDIT_MESH'
+ return (editmesh)
+
+ def draw(self, context):
+ layout = self.layout
+
+ mesh = context.active_object.data
+
+ col = layout.column()
+ col.itemL(text="Overlays:")
+ col.itemR(mesh, "draw_edges", text="Edges")
+ col.itemR(mesh, "draw_faces", text="Faces")
+ col.itemR(mesh, "draw_creases", text="Creases")
+ col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights")
+ col.itemR(mesh, "draw_seams", text="Seams")
+ col.itemR(mesh, "draw_sharp", text="Sharp")
+
+ col.itemS()
+ col.itemL(text="Normals:")
+ col.itemR(mesh, "draw_normals", text="Face")
+ col.itemR(mesh, "draw_vertex_normals", text="Vertex")
+
+ col.itemS()
+ col.itemL(text="Numerics:")
+ col.itemR(mesh, "draw_edge_lenght")
+ col.itemR(mesh, "draw_edge_angle")
+ col.itemR(mesh, "draw_face_area")
class VIEW3D_PT_background_image(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "UI"
+ __space_type__ = 'VIEW_3D'
+ __region_type__ = 'UI'
__label__ = "Background Image"
__default_closed__ = True
@@ -195,12 +1249,80 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
col.itemL(text="Offset:")
col = layout.column(align=True)
- col.itemR(bg, "x_offset", text="X")
- col.itemR(bg, "y_offset", text="Y")
+ col.itemR(bg, "offset_x", text="X")
+ col.itemR(bg, "offset_y", text="Y")
+
+bpy.types.register(VIEW3D_HT_header) # Header
+bpy.types.register(VIEW3D_MT_view) #View Menus
bpy.types.register(VIEW3D_MT_view_navigation)
-bpy.types.register(VIEW3D_MT_view)
-bpy.types.register(VIEW3D_HT_header)
-bpy.types.register(VIEW3D_PT_3dview_properties)
+bpy.types.register(VIEW3D_MT_view_align)
+bpy.types.register(VIEW3D_MT_view_cameras)
+
+bpy.types.register(VIEW3D_MT_select_OBJECT) # Select Menus
+bpy.types.register(VIEW3D_MT_select_POSE)
+bpy.types.register(VIEW3D_MT_select_PARTICLE)
+bpy.types.register(VIEW3D_MT_select_EDIT_MESH)
+bpy.types.register(VIEW3D_MT_select_EDIT_CURVE)
+bpy.types.register(VIEW3D_MT_select_EDIT_SURFACE)
+bpy.types.register(VIEW3D_MT_select_EDIT_METABALL)
+bpy.types.register(VIEW3D_MT_select_EDIT_LATTICE)
+bpy.types.register(VIEW3D_MT_select_EDIT_ARMATURE)
+bpy.types.register(VIEW3D_MT_select_FACE) # XXX todo
+
+bpy.types.register(VIEW3D_MT_OBJECT) # Object Menu
+bpy.types.register(VIEW3D_MT_OBJECT_clear)
+bpy.types.register(VIEW3D_MT_OBJECT_parent)
+bpy.types.register(VIEW3D_MT_OBJECT_track)
+bpy.types.register(VIEW3D_MT_OBJECT_group)
+bpy.types.register(VIEW3D_MT_OBJECT_constraints)
+bpy.types.register(VIEW3D_MT_OBJECT_showhide)
+
+bpy.types.register(VIEW3D_MT_SCULPT) # Sculpt Menu
+
+bpy.types.register(VIEW3D_MT_PAINT_VERTEX)
+
+bpy.types.register(VIEW3D_MT_PARTICLE) # Particle Menu
+bpy.types.register(VIEW3D_MT_PARTICLE_showhide)
+
+bpy.types.register(VIEW3D_MT_POSE) # POSE Menu
+bpy.types.register(VIEW3D_MT_POSE_transform)
+bpy.types.register(VIEW3D_MT_POSE_pose)
+bpy.types.register(VIEW3D_MT_POSE_motion)
+bpy.types.register(VIEW3D_MT_POSE_group)
+bpy.types.register(VIEW3D_MT_POSE_ik)
+bpy.types.register(VIEW3D_MT_POSE_constraints)
+bpy.types.register(VIEW3D_MT_POSE_showhide)
+
+bpy.types.register(VIEW3D_MT_snap) # Edit Menus
+
+bpy.types.register(VIEW3D_MT_edit_MESH)
+bpy.types.register(VIEW3D_MT_edit_MESH_vertices)
+bpy.types.register(VIEW3D_MT_edit_MESH_edges)
+bpy.types.register(VIEW3D_MT_edit_MESH_faces)
+bpy.types.register(VIEW3D_MT_edit_MESH_normals)
+bpy.types.register(VIEW3D_MT_edit_MESH_showhide)
+
+bpy.types.register(VIEW3D_MT_edit_CURVE)
+bpy.types.register(VIEW3D_MT_edit_CURVE_ctrlpoints)
+bpy.types.register(VIEW3D_MT_edit_CURVE_segments)
+bpy.types.register(VIEW3D_MT_edit_CURVE_showhide)
+
+bpy.types.register(VIEW3D_MT_edit_SURFACE)
+
+bpy.types.register(VIEW3D_MT_edit_TEXT)
+bpy.types.register(VIEW3D_MT_edit_TEXT_chars)
+
+bpy.types.register(VIEW3D_MT_edit_META)
+bpy.types.register(VIEW3D_MT_edit_META_showhide)
+
+bpy.types.register(VIEW3D_MT_edit_LATTICE)
+
+bpy.types.register(VIEW3D_MT_edit_ARMATURE)
+bpy.types.register(VIEW3D_MT_edit_ARMATURE_parent)
+bpy.types.register(VIEW3D_MT_edit_ARMATURE_roll)
+
+bpy.types.register(VIEW3D_PT_3dview_properties) # Panels
bpy.types.register(VIEW3D_PT_3dview_display)
+bpy.types.register(VIEW3D_PT_3dview_meshdisplay)
bpy.types.register(VIEW3D_PT_background_image)
diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py
index 7fd8d75209f..0b7ccb15d6c 100644
--- a/release/ui/space_view3d_toolbar.py
+++ b/release/ui/space_view3d_toolbar.py
@@ -1,14 +1,14 @@
import bpy
-# ********** default tools for objectmode ****************
-
class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "objectmode"
+ __space_type__ = 'VIEW_3D'
+ __region_type__ = 'TOOLS'
+
+# ********** default tools for objectmode ****************
class VIEW3D_PT_tools_objectmode(View3DPanel):
+ __context__ = "objectmode"
__label__ = "Object Tools"
def draw(self, context):
@@ -43,12 +43,8 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
# ********** default tools for editmode_mesh ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "editmode_mesh"
-
-class VIEW3D_PT_tools_editmode_mesh(View3DPanel):
+class VIEW3D_PT_tools_meshedit(View3DPanel):
+ __context__ = "mesh_edit"
__label__ = "Mesh Tools"
def draw(self, context):
@@ -90,12 +86,8 @@ class VIEW3D_PT_tools_editmode_mesh(View3DPanel):
# ********** default tools for editmode_curve ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "editmode_curve"
-
-class VIEW3D_PT_tools_editmode_curve(View3DPanel):
+class VIEW3D_PT_tools_curveedit(View3DPanel):
+ __context__ = "curve_edit"
__label__ = "Curve Tools"
def draw(self, context):
@@ -124,12 +116,8 @@ class VIEW3D_PT_tools_editmode_curve(View3DPanel):
# ********** default tools for editmode_surface ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "editmode_surface"
-
-class VIEW3D_PT_tools_editmode_surface(View3DPanel):
+class VIEW3D_PT_tools_surfaceedit(View3DPanel):
+ __context__ = "surface_edit"
__label__ = "Surface Tools"
def draw(self, context):
@@ -158,12 +146,8 @@ class VIEW3D_PT_tools_editmode_surface(View3DPanel):
# ********** default tools for editmode_text ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "editmode_text"
-
-class VIEW3D_PT_tools_editmode_text(View3DPanel):
+class VIEW3D_PT_tools_textedit(View3DPanel):
+ __context__ = "text_edit"
__label__ = "Text Tools"
def draw(self, context):
@@ -179,12 +163,8 @@ class VIEW3D_PT_tools_editmode_text(View3DPanel):
# ********** default tools for editmode_armature ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "editmode_armature"
-
-class VIEW3D_PT_tools_editmode_armature(View3DPanel):
+class VIEW3D_PT_tools_armatureedit(View3DPanel):
+ __context__ = "armature_edit"
__label__ = "Armature Tools"
def draw(self, context):
@@ -209,12 +189,8 @@ class VIEW3D_PT_tools_editmode_armature(View3DPanel):
# ********** default tools for editmode_mball ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "editmode_mball"
-
-class VIEW3D_PT_tools_editmode_mball(View3DPanel):
+class VIEW3D_PT_tools_mballedit(View3DPanel):
+ __context__ = "mball_edit"
__label__ = "Meta Tools"
def draw(self, context):
@@ -229,12 +205,8 @@ class VIEW3D_PT_tools_editmode_mball(View3DPanel):
# ********** default tools for editmode_lattice ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "editmode_lattice"
-
-class VIEW3D_PT_tools_editmode_lattice(View3DPanel):
+class VIEW3D_PT_tools_latticeedit(View3DPanel):
+ __context__ = "lattice_edit"
__label__ = "Lattice Tools"
def draw(self, context):
@@ -249,12 +221,8 @@ class VIEW3D_PT_tools_editmode_lattice(View3DPanel):
# ********** default tools for posemode ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "posemode"
-
class VIEW3D_PT_tools_posemode(View3DPanel):
+ __context__ = "posemode"
__label__ = "Pose Tools"
def draw(self, context):
@@ -294,8 +262,8 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
# ********** default tools for paint modes ****************
class PaintPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
+ __space_type__ = 'VIEW_3D'
+ __region_type__ = 'TOOLS'
def paint_settings(self, context):
ts = context.tool_settings
@@ -325,67 +293,174 @@ class VIEW3D_PT_tools_brush(PaintPanel):
settings = self.paint_settings(context)
brush = settings.brush
+ if not context.particle_edit_object:
+ col = layout.split().column()
+ row = col.row()
+ row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
+
+ col.template_ID(settings, "brush", new="brush.add")
+
+ # Particle Mode #
+
+ # XXX This needs a check if psys is editable.
if context.particle_edit_object:
+ # XXX Select Particle System
layout.column().itemR(settings, "tool", expand=True)
- else:
- layout.split().row().template_ID(settings, "brush")
-
- if brush and not context.particle_edit_object:
- if context.sculpt_object:
- layout.column().itemR(brush, "sculpt_tool", expand=True)
-
- elif context.texture_paint_object:
- col = layout.column(align=True)
- col.item_enumR(settings, "tool", "DRAW")
- col.item_enumR(settings, "tool", "SOFTEN")
- if settings.use_projection:
- col.item_enumR(settings, "tool", "CLONE")
- else:
- col.item_enumR(settings, "tool", "SMEAR")
+ if settings.tool != 'NONE':
+ col = layout.column()
+ col.itemR(brush, "size", slider=True)
+ col.itemR(brush, "strength", slider=True)
+
+ if settings.tool == 'ADD':
+
+ col = layout.column()
+ col.itemR(settings, "add_interpolate")
+ sub = col.column(align=True)
+ sub.active = settings.add_interpolate
+ sub.itemR(brush, "steps", slider=True)
+ sub.itemR(settings, "add_keys", slider=True)
+ elif settings.tool == 'LENGTH':
+ layout.itemR(brush, "length_mode", expand=True)
+ elif settings.tool == 'PUFF':
+ layout.itemR(brush, "puff_mode", expand=True)
+
+ # Sculpt Mode #
+
+ elif context.sculpt_object and settings.brush:
col = layout.column()
+ col.itemS()
+
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
- if context.weight_paint_object:
- col.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
+
+ if brush.sculpt_tool != 'GRAB':
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ col = layout.column()
+
+ if brush.sculpt_tool != 'LAYER':
+ col.itemR(brush, "anchored")
+
+ if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
+ col.itemR(brush, "flip_direction")
+
+ if brush.sculpt_tool == 'LAYER':
+ col.itemR(brush, "persistent")
+ col.itemO("sculpt.set_persistent_base")
+
+ col.itemR(brush, "rake")
+
+ col.itemR(brush, "sculpt_tool")
- col.itemR(brush, "strength", slider=True)
+ # Texture Paint Mode #
+
+ elif context.texture_paint_object:
+ col = layout.column(align=True)
+ col.item_enumR(settings, "tool", 'DRAW')
+ col.item_enumR(settings, "tool", 'SOFTEN')
+ if settings.use_projection:
+ col.item_enumR(settings, "tool", 'CLONE')
+ else:
+ col.item_enumR(settings, "tool", 'SMEAR')
+
+ col = layout.column()
+ col.itemR(brush, "color", text="")
+
row = col.row(align=True)
- row.itemR(brush, "falloff", slider=True)
- row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
- if context.vertex_paint_object:
- col.itemR(brush, "color", text="")
- if context.texture_paint_object:
- row = col.row(align=True)
- row.itemR(brush, "clone_opacity", slider=True, text="Opacity")
- row.itemR(brush, "opacity_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+ row.itemR(brush, "size", slider=True)
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+ col.itemR(brush, "blend")
+
+ # Weight Paint Mode #
+
+ elif context.weight_paint_object:
+ layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
+
+ col = layout.column()
row = col.row(align=True)
- row.itemR(brush, "space", text="")
- rowsub = row.row(align=True)
- rowsub.active = brush.space
- rowsub.itemR(brush, "spacing", text="Spacing", slider=True)
- rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+ row.itemR(brush, "size", slider=True)
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ # Vertex Paint Mode #
+
+ elif context.vertex_paint_object:
+ col = layout.column()
+ col.itemR(brush, "color", text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "size", slider=True)
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+class VIEW3D_PT_tools_brush_stroke(PaintPanel):
+ __label__ = "Stroke"
+ __default_closed__ = True
+
+ def poll(self, context):
+ settings = self.paint_settings(context)
+ return (settings and settings.brush and (context.sculpt_object or
+ context.vertex_paint_object or
+ context.weight_paint_object or
+ context.texture_paint_object))
+
+ def draw(self, context):
+ layout = self.layout
+
+ settings = self.paint_settings(context)
+ brush = settings.brush
+ texture_paint = context.texture_paint_object
+ if not texture_paint:
+ layout.itemR(brush, "smooth_stroke")
col = layout.column()
col.itemR(brush, "airbrush")
col.itemR(brush, "anchored")
col.itemR(brush, "rake")
+ layout.itemR(brush, "space")
+ row = layout.row(align=True)
+ row.active = brush.space
+ row.itemR(brush, "spacing", text="Distance", slider=True)
+ if texture_paint:
+ row.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ layout.itemR(brush, "airbrush")
+ col = layout.column()
+ col.active = brush.airbrush
+ col.itemR(brush, "rate", slider=True)
+
class VIEW3D_PT_tools_brush_curve(PaintPanel):
__label__ = "Curve"
+ __default_closed__ = True
def poll(self, context):
settings = self.paint_settings(context)
return (settings and settings.brush and settings.brush.curve)
def draw(self, context):
+ layout = self.layout
+
settings = self.paint_settings(context)
brush = settings.brush
- layout = self.layout
layout.template_curve_mapping(brush.curve)
+ layout.item_menu_enumO("brush.curve_preset", property="shape")
class VIEW3D_PT_sculpt_options(PaintPanel):
__label__ = "Options"
@@ -395,6 +470,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
def draw(self, context):
layout = self.layout
+
sculpt = context.tool_settings.sculpt
col = layout.column()
@@ -417,16 +493,13 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
# ********** default tools for weightpaint ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "weight_paint"
-
-class VIEW3D_PT_weight_paint_options(View3DPanel):
+class VIEW3D_PT_tools_weightpaint(View3DPanel):
+ __context__ = "weightpaint"
__label__ = "Options"
def draw(self, context):
layout = self.layout
+
wpaint = context.tool_settings.weight_paint
col = layout.column()
@@ -443,19 +516,18 @@ class VIEW3D_PT_weight_paint_options(View3DPanel):
# col.itemL(text="Multiply:")
# col.itemR(wpaint, "mul", text="")
+# Also missing now:
+# Soft, Vgroup, X-Mirror and "Clear" Operator.
# ********** default tools for vertexpaint ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
-
-class VIEW3D_PT_vertex_paint_options(View3DPanel):
- __context__ = "vertex_paint"
+class VIEW3D_PT_tools_vertexpaint(View3DPanel):
+ __context__ = "vertexpaint"
__label__ = "Options"
def draw(self, context):
layout = self.layout
+
vpaint = context.tool_settings.vertex_paint
col = layout.column()
@@ -474,64 +546,131 @@ class VIEW3D_PT_vertex_paint_options(View3DPanel):
# ********** default tools for texturepaint ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "texture_paint"
-
-class VIEW3D_PT_tools_texture_paint(View3DPanel):
+class VIEW3D_PT_tools_texturepaint(View3DPanel):
+ __context__ = "texturepaint"
__label__ = "Options"
def draw(self, context):
layout = self.layout
+
ipaint = context.tool_settings.image_paint
+ settings = context.tool_settings.image_paint
+ use_projection= ipaint.use_projection
col = layout.column()
col.itemR(ipaint, "use_projection")
- col.itemR(ipaint, "use_occlude")
- col.itemR(ipaint, "use_backface_cull")
+ sub = col.column()
+ sub.active = use_projection
+ sub.itemR(ipaint, "use_occlude")
+ sub.itemR(ipaint, "use_backface_cull")
+
+ split = layout.split()
+
+ col = split.column()
+ col.active = (use_projection)
col.itemR(ipaint, "use_normal_falloff")
- col.itemR(ipaint, "invert_stencil")
- col.itemR(ipaint, "use_clone_layer")
+
+ col = split.column()
+ col.active = (ipaint.use_normal_falloff and use_projection)
+ col.itemR(ipaint, "normal_angle", text="")
+
+
+ split = layout.split(percentage=0.7)
+
+ col = split.column(align=False)
+ col.active = (use_projection)
col.itemR(ipaint, "use_stencil_layer")
- col.itemR(ipaint, "seam_bleed")
- col.itemR(ipaint, "normal_angle")
+ col = split.column(align=False)
+ col.active = (use_projection and ipaint.use_stencil_layer)
+ col.itemR(ipaint, "invert_stencil", text="Inv")
+
+
+ col = layout.column()
+ sub = col.column()
+ sub.active = (settings.tool == 'CLONE')
+ sub.itemR(ipaint, "use_clone_layer")
+
+ sub = col.column()
+ sub.itemR(ipaint, "seam_bleed")
# ********** default tools for particle mode ****************
-class View3DPanel(bpy.types.Panel):
- __space_type__ = "VIEW_3D"
- __region_type__ = "TOOLS"
- __context__ = "particle_mode"
-
-class VIEW3D_PT_tools_particle_edit(View3DPanel):
+class VIEW3D_PT_tools_particlemode(View3DPanel):
+ __context__ = "particlemode"
__label__ = "Options"
def draw(self, context):
layout = self.layout
+
pe = context.tool_settings.particle_edit
+ ob = pe.object
+ row = layout.row()
+ row.itemL(text="Edit:")
+ row.itemR(pe, "type", text="")
+
+ if pe.type == 'PARTICLES':
+ if ob.particle_systems:
+ if len(ob.particle_systems) > 1:
+ layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS')
+
+ ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache
+ else:
+ for md in ob.modifiers:
+ if md.type==pe.type:
+ ptcache = md.point_cache
+
+ if ptcache and len(ptcache.point_cache_list) > 1:
+ layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS')
+
+
+ if not pe.editable:
+ layout.itemL(text="Point cache must be baked")
+ layout.itemL(text="to enable editing!")
+
col = layout.column(align=True)
-
- col.itemR(pe, "emitter_deflect", text="Deflect")
+ if pe.hair:
+ col.active = pe.editable
+ col.itemR(pe, "emitter_deflect", text="Deflect emitter")
+ sub = col.row()
+ sub.active = pe.emitter_deflect
+ sub.itemR(pe, "emitter_distance", text="Distance")
+
+ col = layout.column(align=True)
+ col.active = pe.editable
+ col.itemL(text="Keep:")
+ col.itemR(pe, "keep_lengths", text="Lenghts")
+ col.itemR(pe, "keep_root", text="Root")
+ if not pe.hair:
+ col.itemL(text="Correct:")
+ col.itemR(pe, "auto_velocity", text="Velocity")
+
+ col = layout.column(align=True)
+ col.active = pe.editable
+ col.itemL(text="Draw:")
+ col.itemR(pe, "draw_step", text="Path Steps")
+ if pe.type == 'PARTICLES':
+ col.itemR(pe, "draw_particles", text="Particles")
+ col.itemR(pe, "fade_time")
sub = col.row()
- sub.itemR(pe, "emitter_distance", text="Distance")
- sub.active = pe.emitter_deflect
+ sub.active = pe.fade_time
+ sub.itemR(pe, "fade_frames", slider=True)
bpy.types.register(VIEW3D_PT_tools_objectmode)
-bpy.types.register(VIEW3D_PT_tools_editmode_mesh)
-bpy.types.register(VIEW3D_PT_tools_editmode_curve)
-bpy.types.register(VIEW3D_PT_tools_editmode_surface)
-bpy.types.register(VIEW3D_PT_tools_editmode_text)
-bpy.types.register(VIEW3D_PT_tools_editmode_armature)
-bpy.types.register(VIEW3D_PT_tools_editmode_mball)
-bpy.types.register(VIEW3D_PT_tools_editmode_lattice)
+bpy.types.register(VIEW3D_PT_tools_meshedit)
+bpy.types.register(VIEW3D_PT_tools_curveedit)
+bpy.types.register(VIEW3D_PT_tools_surfaceedit)
+bpy.types.register(VIEW3D_PT_tools_textedit)
+bpy.types.register(VIEW3D_PT_tools_armatureedit)
+bpy.types.register(VIEW3D_PT_tools_mballedit)
+bpy.types.register(VIEW3D_PT_tools_latticeedit)
bpy.types.register(VIEW3D_PT_tools_posemode)
bpy.types.register(VIEW3D_PT_tools_brush)
+bpy.types.register(VIEW3D_PT_tools_brush_stroke)
bpy.types.register(VIEW3D_PT_tools_brush_curve)
bpy.types.register(VIEW3D_PT_sculpt_options)
-bpy.types.register(VIEW3D_PT_vertex_paint_options)
-bpy.types.register(VIEW3D_PT_weight_paint_options)
-bpy.types.register(VIEW3D_PT_tools_texture_paint)
-bpy.types.register(VIEW3D_PT_tools_particle_edit)
+bpy.types.register(VIEW3D_PT_tools_vertexpaint)
+bpy.types.register(VIEW3D_PT_tools_weightpaint)
+bpy.types.register(VIEW3D_PT_tools_texturepaint)
+bpy.types.register(VIEW3D_PT_tools_particlemode)
diff --git a/source/Makefile b/source/Makefile
index 351db333aba..d9acd4bf059 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -75,11 +75,11 @@ endif
# PLUGAPPLIB libs that form the application to be plugged in
# Note: the order is important here
+
GRPLIB = $(OCGDIR)/creator/$(DEBUG_DIR)libcreator.a
GRPLIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a
GRPLIB += $(NAN_BSP)/lib/$(DEBUG_DIR)libbsp.a
GRPLIB += $(NAN_BOOLOP)/lib/$(DEBUG_DIR)libboolop.a
-GRPLIB += $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
GRPLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
GRPLIB += $(OCGDIR)/blender/render/$(DEBUG_DIR)librender.a
@@ -106,6 +106,30 @@ COMLIB += $(NAN_JPEG)/lib/libjpeg.a
COMLIB += $(OCGDIR)/blender/gpu/$(DEBUG_DIR)libgpu.a
COMLIB += $(NAN_GLEW)/lib/$(DEBUG_DIR)libglew.a
COMLIB += $(OCGDIR)/blender/blenfont/$(DEBUG_DIR)libblenfont.a
+COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a
+COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a
+COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a
+COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sdl.a
+COMLIB += $(NAN_SAMPLERATE)/lib/$(DEBUG_DIR)libsamplerate.a
+COMLIB += $(NAN_LZO)/lib/$(DEBUG_DIR)libminilzo.a
+COMLIB += $(NAN_LZMA)/lib/$(DEBUG_DIR)liblzma.a
+COMLIB += $(NAN_SMOKE)/lib/$(DEBUG_DIR)/libsmoke.a
+
+ifeq ($(WITH_FFMPEG),true)
+ COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_ffmpeg.a
+endif
+
+ifeq ($(WITH_OPENAL),true)
+ COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_openal.a
+endif
+
+ifeq ($(WITH_JACK),true)
+ COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_jack.a
+endif
+
+ifeq ($(WITH_SNDFILE),true)
+ COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sndfile.a
+endif
ifneq ($(NAN_NO_KETSJI),true)
COMLIB += $(OCGDIR)/gameengine/bloutines/$(DEBUG_DIR)libbloutines.a
@@ -114,8 +138,6 @@ ifneq ($(NAN_NO_KETSJI),true)
COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a
COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
- COMLIB += $(OCGDIR)/gameengine/blphys/fuzzics/$(DEBUG_DIR)libfuzzics.a
- COMLIB += $(NAN_QHULL)/lib/libqhull.a
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
@@ -242,6 +264,9 @@ PULIB += $(OCGDIR)/blender/ed_image/$(DEBUG_DIR)libed_image.a
PULIB += $(OCGDIR)/blender/ed_uvedit/$(DEBUG_DIR)libed_uvedit.a
PULIB += $(OCGDIR)/blender/ed_screen/$(DEBUG_DIR)libed_screen.a
PULIB += $(OCGDIR)/blender/ed_console/$(DEBUG_DIR)libed_console.a
+PULIB += $(OCGDIR)/blender/ed_userpref/$(DEBUG_DIR)libed_userpref.a
+PULIB += $(OCGDIR)/blender/ed_gpencil/$(DEBUG_DIR)libed_gpencil.a
+PULIB += $(OCGDIR)/blender/ed_opsound/$(DEBUG_DIR)libed_opsound.a
PULIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a
PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a
@@ -249,6 +274,7 @@ PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a
PULIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
PULIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
PULIB += $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
+PULIB += $(NAN_SMOKE)/lib/$(DEBUG_DIR)/libsmoke.a
ifeq ($(NAN_NO_KETSJI),true)
PULIB += $(NAN_MOTO)/lib/$(DEBUG_DIR)libmoto.a
@@ -349,74 +375,38 @@ ifeq ($(OS),solaris)
SPLIB += $(NAN_ZLIB)/lib/libz.a
endif
-# OpenAL libs are already compiled as shared code!
-
-# Some vars to keep the rest of this section mostly readable
-# in an 80 char term
-SOUNDSYSTEM = $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libSoundSystem.a
-DUMMYSOUND = $(OCGDIR)/intern/DummySoundSystem/$(DEBUG_DIR)libDummySoundSystem.a
-OPENALSOUND = $(OCGDIR)/intern/OpenALSoundSystem/$(DEBUG_DIR)libOpenALSoundSystem.a
-SDLSOUND = $(OCGDIR)/intern/SDLSoundSystem/$(DEBUG_DIR)libSDLSoundSystem.a
-
-# Some kooky logic going on here ...
-ifeq ($(NAN_NO_OPENAL), true)
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(SOUNDSYSTEM)
-else
+ifeq ($(WITH_OPENAL),true)
ifeq ($(OS),$(findstring $(OS), "freebsd linux windows"))
ifeq ($(CPU),$(findstring $(CPU), "i386 powerpc x86_64 parisc64"))
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(OPENALSOUND)
- NAN_SND_LIBS += $(SDLSOUND)
NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a
- NAN_SND_LIBS += $(SOUNDSYSTEM)
else
ifeq ($(OS),windows)
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(OPENALSOUND)
- NAN_SND_LIBS += $(SDLSOUND)
NAN_SND_LIBS += $(NAN_OPENAL)/lib/openal_static.lib
- NAN_SND_LIBS += $(SOUNDSYSTEM)
- else
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(SOUNDSYSTEM)
endif
endif
else
ifeq ($(OS),darwin)
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(OPENALSOUND)
NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a
- NAN_SND_LIBS += $(SOUNDSYSTEM)
else
ifeq ($(OS), solaris)
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(OPENALSOUND)
- NAN_SND_LIBS += $(SDLSOUND)
NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a
- NAN_SND_LIBS += $(SOUNDSYSTEM)
- else
- ifeq ($(OS), irix)
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(SDLSOUND)
- NAN_SND_LIBS += $(SOUNDSYSTEM)
- else
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(SOUNDSYSTEM)
- endif
endif
endif
endif
endif
+ifeq ($(WITH_JACK),true)
+ ifeq ($(OS),$(findstring $(OS), "linux"))
+ NAN_SND_LIBS += $(NAN_JACKLIBS)
+ endif
+endif
+
+ifeq ($(WITH_SNDFILE),true)
+ ifeq ($(OS),$(findstring $(OS), "linux"))
+ NAN_SND_LIBS += $(NAN_SNDFILELIBS)
+ endif
+endif
+
ifeq ($(OS),windows)
# Might need to change this to $(NAN_MOZILLA_LIB)/nspr4.lib
diff --git a/source/SConscript b/source/SConscript
index d3a9373b4d8..e4e89671653 100644
--- a/source/SConscript
+++ b/source/SConscript
@@ -6,6 +6,9 @@ SConscript(['blender/SConscript',
'creator/SConscript'])
if env['WITH_BF_GAMEENGINE']:
SConscript (['gameengine/SConscript'])
-
+
+if env['WITH_BF_PLAYER']:
+ SConscript (['blenderplayer/bad_level_call_stubs/SConscript'])
+
if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw'):
SConscript (['icons/SConscript'])
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index b77f4a8fcd1..760b7059bc7 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -70,6 +70,11 @@ void BLF_boundbox(char *str, struct rctf *box);
float BLF_width(char *str);
float BLF_height(char *str);
+/*
+ * The following function return the width and height of the string, but
+ * just in one call, so avoid extra freetype2 stuff.
+ */
+void BLF_width_and_height(char *str, float *width, float *height);
/*
* For fixed width fonts only, returns the width of a
@@ -117,6 +122,28 @@ void BLF_shadow(int level, float r, float g, float b, float a);
void BLF_shadow_offset(int x, int y);
/*
+ * Set the buffer, size and number of channels to draw, one thing to take care is call
+ * this function with NULL pointer when we finish, for example:
+ * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
+ *
+ * ... set color, position and draw ...
+ *
+ * BLF_buffer(NULL, NULL, 0, 0, 0);
+ */
+void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch);
+
+/*
+ * Set the color to be used for text.
+ */
+void BLF_buffer_col(float r, float g, float b, float a);
+
+/*
+ * Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_
+ * it's not necessary set both buffer, NULL is valid here.
+ */
+void BLF_draw_buffer(char *str);
+
+/*
* Search the path directory to the locale files, this try all
* the case for Linux, Win and Mac.
*/
@@ -146,8 +173,4 @@ void BLF_dir_free(char **dirs, int count);
#define BLF_SHADOW (1<<2)
#define BLF_KERNING_DEFAULT (1<<3)
-/* font->mode. */
-#define BLF_MODE_TEXTURE 0
-#define BLF_MODE_BITMAP 1
-
#endif /* BLF_API_H */
diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt
index aef655ca0d1..bc03e69eb88 100644
--- a/source/blender/blenfont/CMakeLists.txt
+++ b/source/blender/blenfont/CMakeLists.txt
@@ -27,11 +27,13 @@ FILE(GLOB SRC intern/*.c)
SET(INC
../../../intern/guardedalloc ../blenlib ../makesdna ../editors/include
../blenkernel ../../../extern/glew/include .
- ${FTGL_INC}
- ${FREETYPE_INC}
- ${GETTEXT_INC}
+ ${FREETYPE_INCLUDE_DIRS}
)
+IF(WITH_INTERNATIONAL)
+ SET(INC ${INC} ${GETTEXT_INC})
+ENDIF(WITH_INTERNATIONAL)
+
IF(WIN32)
ADD_DEFINITIONS(-D_WIN32 -DUSE_GETTEXT_DLL)
ENDIF(WIN32)
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index af57f822c40..8cb237a19ac 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -333,7 +333,6 @@ void BLF_default_rotation(float angle)
}
}
-
void BLF_draw(char *str)
{
FontBLF *font;
@@ -342,40 +341,24 @@ void BLF_draw(char *str)
* The pixmap alignment hack is handle
* in BLF_position (old ui_rasterpos_safe).
*/
-
font= global_font[global_font_cur];
if (font) {
- if (font->mode == BLF_MODE_BITMAP) {
- glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- glPushAttrib(GL_ENABLE_BIT);
- glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glDisable(GL_BLEND);
- glRasterPos3f(font->pos[0], font->pos[1], font->pos[2]);
-
- blf_font_draw(font, str);
-
- glPopAttrib();
- glPopClientAttrib();
- }
- else {
- glEnable(GL_BLEND);
- glEnable(GL_TEXTURE_2D);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+ glEnable(GL_TEXTURE_2D);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glPushMatrix();
- glTranslatef(font->pos[0], font->pos[1], font->pos[2]);
- glScalef(font->aspect, font->aspect, 1.0);
+ glPushMatrix();
+ glTranslatef(font->pos[0], font->pos[1], font->pos[2]);
+ glScalef(font->aspect, font->aspect, 1.0);
- if (font->flags & BLF_ROTATION)
- glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
+ if (font->flags & BLF_ROTATION)
+ glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
- blf_font_draw(font, str);
+ blf_font_draw(font, str);
- glPopMatrix();
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- }
+ glPopMatrix();
+ glDisable(GL_BLEND);
+ glDisable(GL_TEXTURE_2D);
}
}
@@ -388,6 +371,15 @@ void BLF_boundbox(char *str, rctf *box)
blf_font_boundbox(font, str, box);
}
+void BLF_width_and_height(char *str, float *width, float *height)
+{
+ FontBLF *font;
+
+ font= global_font[global_font_cur];
+ if (font)
+ blf_font_width_and_height(font, str, width, height);
+}
+
float BLF_width(char *str)
{
FontBLF *font;
@@ -506,15 +498,6 @@ void BLF_clipping(float xmin, float ymin, float xmax, float ymax)
}
}
-void BLF_mode(int mode)
-{
- FontBLF *font;
-
- font= global_font[global_font_cur];
- if (font)
- font->mode= mode;
-}
-
void BLF_shadow(int level, float r, float g, float b, float a)
{
FontBLF *font;
@@ -539,3 +522,39 @@ void BLF_shadow_offset(int x, int y)
font->shadow_y= y;
}
}
+
+void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch)
+{
+ FontBLF *font;
+
+ font= global_font[global_font_cur];
+ if (font) {
+ font->b_fbuf= fbuf;
+ font->b_cbuf= cbuf;
+ font->bw= w;
+ font->bh= h;
+ font->bch= nch;
+ }
+}
+
+void BLF_buffer_col(float r, float g, float b, float a)
+{
+ FontBLF *font;
+
+ font= global_font[global_font_cur];
+ if (font) {
+ font->b_col[0]= r;
+ font->b_col[1]= g;
+ font->b_col[2]= b;
+ font->b_col[3]= a;
+ }
+}
+
+void BLF_draw_buffer(char *str)
+{
+ FontBLF *font;
+
+ font= global_font[global_font_cur];
+ if (font)
+ blf_font_buffer(font, str);
+}
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index 92dfe8457b0..b4d902ff428 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -153,7 +153,8 @@ char *blf_dir_search(char *file)
int blf_dir_split(const char *str, char *file, int *size)
{
- char *s, i, len;
+ int i, len;
+ char *s;
/* Window, Linux or Mac, this is always / */
s= strrchr(str, '/');
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 6fc35a96e1e..2cd72809579 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -100,7 +100,7 @@ void blf_font_draw(FontBLF *font, char *str)
unsigned int c;
GlyphBLF *g, *g_prev;
FT_Vector delta;
- FT_UInt glyph_index, g_prev_index;
+ FT_UInt glyph_index;
int pen_x, pen_y;
int i, has_kerning, st;
@@ -112,41 +112,30 @@ void blf_font_draw(FontBLF *font, char *str)
pen_y= 0;
has_kerning= FT_HAS_KERNING(font->face);
g_prev= NULL;
- g_prev_index= 0;
while (str[i]) {
c= blf_utf8_next((unsigned char *)str, &i);
if (c == 0)
break;
- glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_search(font->glyph_cache, c);
- if (!g)
+ if (!g) {
+ glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_add(font, glyph_index, c);
+ }
/* if we don't found a glyph, skip it. */
if (!g)
continue;
- /*
- * This happen if we change the mode of the
- * font, we don't drop the glyph cache, so it's
- * possible that some glyph don't have the
- * bitmap or texture information.
- */
- if (font->mode == BLF_MODE_BITMAP && (!g->bitmap_data))
- g= blf_glyph_add(font, glyph_index, c);
- else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data))
- g= blf_glyph_add(font, glyph_index, c);
-
if (has_kerning && g_prev) {
delta.x= 0;
delta.y= 0;
if (font->flags & BLF_KERNING_DEFAULT)
- st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta);
+ st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
else
- st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
+ st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
if (st == 0)
pen_x += delta.x >> 6;
@@ -157,7 +146,158 @@ void blf_font_draw(FontBLF *font, char *str)
pen_x += g->advance;
g_prev= g;
- g_prev_index= glyph_index;
+ }
+}
+
+void blf_font_buffer(FontBLF *font, char *str)
+{
+ unsigned char *data, *cbuf;
+ unsigned int c;
+ GlyphBLF *g, *g_prev;
+ FT_Vector delta;
+ FT_UInt glyph_index;
+ float a, *fbuf;
+ int pen_x, pen_y, y, x, yb, diff;
+ int i, has_kerning, st, chx, chy;
+
+ if (!font->glyph_cache)
+ return;
+
+ i= 0;
+ pen_x= (int)font->pos[0];
+ pen_y= (int)font->pos[1];
+ has_kerning= FT_HAS_KERNING(font->face);
+ g_prev= NULL;
+
+ while (str[i]) {
+ c= blf_utf8_next((unsigned char *)str, &i);
+ if (c == 0)
+ break;
+
+ g= blf_glyph_search(font->glyph_cache, c);
+ if (!g) {
+ glyph_index= FT_Get_Char_Index(font->face, c);
+ g= blf_glyph_add(font, glyph_index, c);
+ }
+
+ /* if we don't found a glyph, skip it. */
+ if (!g)
+ continue;
+
+ if (has_kerning && g_prev) {
+ delta.x= 0;
+ delta.y= 0;
+
+ if (font->flags & BLF_KERNING_DEFAULT)
+ st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
+ else
+ st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
+
+ if (st == 0)
+ pen_x += delta.x >> 6;
+ }
+
+ chx= pen_x + ((int)g->pos_x);
+ diff= g->height - ((int)g->pos_y);
+ if (diff > 0) {
+ if (g->pitch < 0)
+ pen_y += diff;
+ else
+ pen_y -= diff;
+ }
+ else if (diff < 0) {
+ if (g->pitch < 0)
+ pen_y -= diff;
+ else
+ pen_y += diff;
+ }
+
+ if (g->pitch < 0)
+ chy= pen_y - ((int)g->pos_y);
+ else
+ chy= pen_y + ((int)g->pos_y);
+
+ if (font->b_fbuf) {
+ if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) {
+ if (g->pitch < 0)
+ yb= 0;
+ else
+ yb= g->height-1;
+
+ for (y= 0; y < g->height; y++) {
+ for (x= 0; x < g->width; x++) {
+ fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
+ data= g->bitmap + x + (yb * g->pitch);
+ a= data[0]/255.0f;
+
+ if (a == 1.0) {
+ fbuf[0]= font->b_col[0];
+ fbuf[1]= font->b_col[1];
+ fbuf[2]= font->b_col[2];
+ }
+ 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));
+ }
+ }
+
+ if (g->pitch < 0)
+ yb++;
+ else
+ yb--;
+ }
+ }
+ }
+
+ if (font->b_cbuf) {
+ if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) {
+ if (g->pitch < 0)
+ yb= 0;
+ else
+ yb= g->height-1;
+
+ for (y= 0; y < g->height; y++) {
+ for (x= 0; x < g->width; x++) {
+ cbuf= font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
+ data= g->bitmap + x + (yb * g->pitch);
+ a= data[0];
+
+ if (a == 256) {
+ cbuf[0]= font->b_col[0];
+ cbuf[1]= font->b_col[1];
+ cbuf[2]= font->b_col[2];
+ }
+ else {
+ cbuf[0]= (font->b_col[0]*a) + (cbuf[0] * (256-a));
+ cbuf[1]= (font->b_col[1]*a) + (cbuf[1] * (256-a));
+ cbuf[2]= (font->b_col[2]*a) + (cbuf[2] * (256-a));
+ }
+ }
+
+ if (g->pitch < 0)
+ yb++;
+ else
+ yb--;
+ }
+ }
+ }
+
+ if (diff > 0) {
+ if (g->pitch < 0)
+ pen_x -= diff;
+ else
+ pen_y += diff;
+ }
+ else if (diff < 0) {
+ if (g->pitch < 0)
+ pen_x += diff;
+ else
+ pen_y -= diff;
+ }
+
+ pen_x += g->advance;
+ g_prev= g;
}
}
@@ -166,7 +306,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
unsigned int c;
GlyphBLF *g, *g_prev;
FT_Vector delta;
- FT_UInt glyph_index, g_prev_index;
+ FT_UInt glyph_index;
rctf gbox;
int pen_x, pen_y;
int i, has_kerning, st;
@@ -184,41 +324,30 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
pen_y= 0;
has_kerning= FT_HAS_KERNING(font->face);
g_prev= NULL;
- g_prev_index= 0;
while (str[i]) {
c= blf_utf8_next((unsigned char *)str, &i);
if (c == 0)
break;
- glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_search(font->glyph_cache, c);
- if (!g)
+ if (!g) {
+ glyph_index= FT_Get_Char_Index(font->face, c);
g= blf_glyph_add(font, glyph_index, c);
+ }
/* if we don't found a glyph, skip it. */
if (!g)
continue;
- /*
- * This happen if we change the mode of the
- * font, we don't drop the glyph cache, so it's
- * possible that some glyph don't have the
- * bitmap or texture information.
- */
- if (font->mode == BLF_MODE_BITMAP && (!g->bitmap_data))
- g= blf_glyph_add(font, glyph_index, c);
- else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data))
- g= blf_glyph_add(font, glyph_index, c);
-
if (has_kerning && g_prev) {
delta.x= 0;
delta.y= 0;
if (font->flags & BLF_KERNING_DEFAULT)
- st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta);
+ st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
else
- st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
+ st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
if (st == 0)
pen_x += delta.x >> 6;
@@ -241,7 +370,6 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
pen_x += g->advance;
g_prev= g;
- g_prev_index= glyph_index;
}
if (box->xmin > box->xmax) {
@@ -252,6 +380,17 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
}
}
+void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height)
+{
+ rctf box;
+
+ if (font->glyph_cache) {
+ blf_font_boundbox(font, str, &box);
+ *width= ((box.xmax - box.xmin) * font->aspect);
+ *height= ((box.ymax - box.ymin) * font->aspect);
+ }
+}
+
float blf_font_width(FontBLF *font, char *str)
{
rctf box;
@@ -316,7 +455,6 @@ void blf_font_free(FontBLF *font)
void blf_font_fill(FontBLF *font)
{
- font->mode= BLF_MODE_TEXTURE;
font->aspect= 1.0f;
font->pos[0]= 0.0f;
font->pos[1]= 0.0f;
@@ -333,7 +471,16 @@ void blf_font_fill(FontBLF *font)
font->cache.last= NULL;
font->glyph_cache= NULL;
font->blur= 0;
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&font->max_tex_size);
+ font->max_tex_size= -1;
+ font->b_fbuf= NULL;
+ font->b_cbuf= NULL;
+ font->bw= 0;
+ font->bh= 0;
+ font->bch= 0;
+ font->b_col[0]= 0;
+ font->b_col[1]= 0;
+ font->b_col[2]= 0;
+ font->b_col[3]= 0;
}
FontBLF *blf_font_new(char *name, char *filename)
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 805da02ba36..f3db3ddc9a5 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -189,29 +189,18 @@ GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c)
return(NULL);
}
-GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c)
+GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
{
FT_GlyphSlot slot;
- GlyphCacheBLF *gc;
GlyphBLF *g;
- GlyphTextureBLF *gt;
FT_Error err;
FT_Bitmap bitmap;
FT_BBox bbox;
unsigned int key;
- int do_new;
g= blf_glyph_search(font->glyph_cache, c);
-
- /* The glyph can be add on Bitmap mode, so we have the
- * glyph, but not the texture data.
- */
- if (g && g->tex_data)
+ if (g)
return(g);
- else if (g)
- do_new= 0;
- else
- do_new= 1;
err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
if (err)
@@ -224,56 +213,33 @@ GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c)
if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)
return(NULL);
- if (do_new) {
- g= (GlyphBLF *)MEM_mallocN(sizeof(GlyphBLF), "blf_glyph_add");
- g->next= NULL;
- g->prev= NULL;
- g->tex_data= NULL;
- g->bitmap_data= NULL;
- g->c= c;
- }
-
- gt= (GlyphTextureBLF *)MEM_mallocN(sizeof(GlyphTextureBLF), "blf_glyph_texture_add");
- gc= font->glyph_cache;
-
- if (gc->cur_tex == -1) {
- blf_glyph_cache_texture(font, gc);
- gc->x_offs= gc->pad;
- gc->y_offs= gc->pad;
- }
-
- if (gc->x_offs > (gc->p2_width - gc->max_glyph_width)) {
- gc->x_offs= gc->pad;
- gc->y_offs += gc->max_glyph_height;
-
- if (gc->y_offs > (gc->p2_height - gc->max_glyph_height)) {
- gc->y_offs= gc->pad;
- blf_glyph_cache_texture(font, gc);
- }
- }
-
+ g= (GlyphBLF *)MEM_mallocN(sizeof(GlyphBLF), "blf_glyph_add");
+ g->next= NULL;
+ g->prev= NULL;
+ g->c= c;
+ g->idx= index;
+ g->tex= 0;
+ g->build_tex= 0;
+ g->bitmap= NULL;
+ g->xoff= -1;
+ g->yoff= -1;
+ g->uv[0][0]= 0.0f;
+ g->uv[0][1]= 0.0f;
+ g->uv[1][0]= 0.0f;
+ g->uv[1][1]= 0.0f;
bitmap= slot->bitmap;
- gt->tex= gc->textures[gc->cur_tex];
-
- gt->xoff= gc->x_offs;
- gt->yoff= gc->y_offs;
- gt->width= bitmap.width;
- gt->height= bitmap.rows;
+ g->width= bitmap.width;
+ g->height= bitmap.rows;
- if (gt->width && gt->height) {
- glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- glBindTexture(GL_TEXTURE_2D, gt->tex);
- glTexSubImage2D(GL_TEXTURE_2D, 0, gt->xoff, gt->yoff, gt->width, gt->height, GL_ALPHA, GL_UNSIGNED_BYTE, bitmap.buffer);
- glPopClientAttrib();
+ if (g->width && g->height) {
+ g->bitmap= (unsigned char *)MEM_mallocN(g->width * g->height, "glyph bitmap");
+ memcpy((void *)g->bitmap, (void *)bitmap.buffer, g->width * g->height);
}
g->advance= ((float)slot->advance.x) / 64.0f;
- gt->pos_x= slot->bitmap_left;
- gt->pos_y= slot->bitmap_top;
+ g->pos_x= slot->bitmap_left;
+ g->pos_y= slot->bitmap_top;
+ g->pitch= slot->bitmap.pitch;
FT_Outline_Get_CBox(&(slot->outline), &bbox);
g->box.xmin= ((float)bbox.xMin) / 64.0f;
@@ -281,143 +247,18 @@ GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c)
g->box.ymin= ((float)bbox.yMin) / 64.0f;
g->box.ymax= ((float)bbox.yMax) / 64.0f;
- gt->uv[0][0]= ((float)gt->xoff) / ((float)gc->p2_width);
- gt->uv[0][1]= ((float)gt->yoff) / ((float)gc->p2_height);
- gt->uv[1][0]= ((float)(gt->xoff + gt->width)) / ((float)gc->p2_width);
- gt->uv[1][1]= ((float)(gt->yoff + gt->height)) / ((float)gc->p2_height);
-
- /* update the x offset for the next glyph. */
- gc->x_offs += (int)(g->box.xmax - g->box.xmin + gc->pad);
-
- if (do_new) {
- key= blf_hash(g->c);
- BLI_addhead(&(gc->bucket[key]), g);
- gc->rem_glyphs--;
- }
-
- /* and attach the texture information. */
- g->tex_data= gt;
-
+ key= blf_hash(g->c);
+ BLI_addhead(&(font->glyph_cache->bucket[key]), g);
return(g);
}
-GlyphBLF *blf_glyph_bitmap_add(FontBLF *font, FT_UInt index, unsigned int c)
-{
- FT_GlyphSlot slot;
- GlyphCacheBLF *gc;
- GlyphBLF *g;
- GlyphBitmapBLF *gt;
- FT_Error err;
- FT_Bitmap bitmap;
- FT_BBox bbox;
- unsigned char *dest, *src;
- unsigned int key, y;
- unsigned int src_width, src_height, src_pitch;
- int do_new;
-
- g= blf_glyph_search(font->glyph_cache, c);
-
- /*
- * The glyph can be add on Texture mode, so we have the
- * glyph, but not the bitmap data.
- */
- if (g && g->bitmap_data)
- return(g);
- else if (g)
- do_new= 0;
- else
- do_new= 1;
-
- err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
- if (err)
- return(NULL);
-
- /* get the glyph. */
- slot= font->face->glyph;
-
- err= FT_Render_Glyph(slot, FT_RENDER_MODE_MONO);
- if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)
- return(NULL);
-
- if (do_new) {
- g= (GlyphBLF *)MEM_mallocN(sizeof(GlyphBLF), "blf_glyph_add");
- g->next= NULL;
- g->prev= NULL;
- g->tex_data= NULL;
- g->bitmap_data= NULL;
- g->c= c;
- }
-
- gt= (GlyphBitmapBLF *)MEM_mallocN(sizeof(GlyphBitmapBLF), "blf_glyph_bitmap_add");
- gc= font->glyph_cache;
-
- bitmap= slot->bitmap;
-
- src_width= bitmap.width;
- src_height= bitmap.rows;
- src_pitch= bitmap.pitch;
-
- gt->width= src_width;
- gt->height= src_height;
- gt->pitch= src_pitch;
- gt->image= NULL;
-
- if (gt->width && gt->height) {
- gt->image= (unsigned char *)malloc(gt->pitch * gt->height);
-
- dest= gt->image + ((gt->height - 1) * gt->pitch);
- src= bitmap.buffer;
-
- for (y= 0; y < src_height; ++y) {
- memcpy((void *)dest, (void *)src, src_pitch);
- dest -= gt->pitch;
- src += src_pitch;
- }
- }
-
- g->advance= ((float)slot->advance.x) / 64.0f;
- gt->pos_x= slot->bitmap_left;
- gt->pos_y= ((int)src_height) - slot->bitmap_top;
-
- FT_Outline_Get_CBox(&(slot->outline), &bbox);
- g->box.xmin= ((float)bbox.xMin) / 64.0f;
- g->box.xmax= ((float)bbox.xMax) / 64.0f;
- g->box.ymin= ((float)bbox.yMin) / 64.0f;
- g->box.ymax= ((float)bbox.yMax) / 64.0f;
-
- if (do_new) {
- key= blf_hash(g->c);
- BLI_addhead(&(gc->bucket[key]), g);
- gc->rem_glyphs--;
- }
-
- /* and attach the bitmap information. */
- g->bitmap_data= gt;
-
- return(g);
-}
-
-GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
-{
- if (font->mode == BLF_MODE_BITMAP)
- return(blf_glyph_bitmap_add(font, index, c));
- return(blf_glyph_texture_add(font, index, c));
-}
-
void blf_glyph_free(GlyphBLF *g)
{
- if (g->tex_data)
- MEM_freeN(g->tex_data);
-
- if (g->bitmap_data) {
- if (g->bitmap_data->image)
- free((void *)g->bitmap_data->image);
- MEM_freeN(g->bitmap_data);
- }
-
/* don't need free the texture, the GlyphCache already
* have a list of all the texture and free it.
*/
+ if (g->bitmap)
+ MEM_freeN(g->bitmap);
MEM_freeN(g);
}
@@ -482,16 +323,65 @@ static void blf_texture3_draw(float uv[2][2], float x1, float y1, float x2, floa
glColor4fv(color);
}
-int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y)
+int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
{
- GlyphTextureBLF *gt;
+ GlyphCacheBLF *gc;
GLint cur_tex;
float dx, dx1;
float y1, y2;
float xo, yo;
float color[4];
- gt= g->tex_data;
+ if ((!g->width) || (!g->height))
+ return(1);
+
+ if (g->build_tex == 0) {
+ gc= font->glyph_cache;
+
+ if (font->max_tex_size == -1)
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&font->max_tex_size);
+
+ if (gc->cur_tex == -1) {
+ blf_glyph_cache_texture(font, gc);
+ gc->x_offs= gc->pad;
+ gc->y_offs= gc->pad;
+ }
+
+ if (gc->x_offs > (gc->p2_width - gc->max_glyph_width)) {
+ gc->x_offs= gc->pad;
+ gc->y_offs += gc->max_glyph_height;
+
+ if (gc->y_offs > (gc->p2_height - gc->max_glyph_height)) {
+ gc->y_offs= gc->pad;
+ blf_glyph_cache_texture(font, gc);
+ }
+ }
+
+ g->tex= gc->textures[gc->cur_tex];
+ g->xoff= gc->x_offs;
+ g->yoff= gc->y_offs;
+
+ glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ glBindTexture(GL_TEXTURE_2D, g->tex);
+ glTexSubImage2D(GL_TEXTURE_2D, 0, g->xoff, g->yoff, g->width, g->height, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap);
+ glPopClientAttrib();
+
+ g->uv[0][0]= ((float)g->xoff) / ((float)gc->p2_width);
+ g->uv[0][1]= ((float)g->yoff) / ((float)gc->p2_height);
+ g->uv[1][0]= ((float)(g->xoff + g->width)) / ((float)gc->p2_width);
+ g->uv[1][1]= ((float)(g->yoff + g->height)) / ((float)gc->p2_height);
+
+ /* update the x offset for the next glyph. */
+ gc->x_offs += (int)(g->box.xmax - g->box.xmin + gc->pad);
+
+ gc->rem_glyphs--;
+ g->build_tex= 1;
+ }
+
xo= 0.0f;
yo= 0.0f;
@@ -502,10 +392,10 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y)
y += font->shadow_y;
}
- dx= floor(x + gt->pos_x);
- dx1= dx + gt->width;
- y1= y + gt->pos_y;
- y2= y + gt->pos_y - gt->height;
+ dx= floor(x + g->pos_x);
+ dx1= dx + g->width;
+ y1= y + g->pos_y;
+ y2= y + g->pos_y - g->height;
if (font->flags & BLF_CLIPPING) {
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1]))
@@ -519,70 +409,36 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y)
}
glGetIntegerv(GL_TEXTURE_2D_BINDING_EXT, &cur_tex);
- if (cur_tex != gt->tex)
- glBindTexture(GL_TEXTURE_2D, gt->tex);
+ if (cur_tex != g->tex)
+ glBindTexture(GL_TEXTURE_2D, g->tex);
if (font->flags & BLF_SHADOW) {
glGetFloatv(GL_CURRENT_COLOR, color);
glColor4fv(font->shadow_col);
if (font->shadow == 3)
- blf_texture3_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture3_draw(g->uv, dx, y1, dx1, y2);
else if (font->shadow == 5)
- blf_texture5_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture5_draw(g->uv, dx, y1, dx1, y2);
else
- blf_texture_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture_draw(g->uv, dx, y1, dx1, y2);
glColor4fv(color);
x= xo;
y= yo;
- dx= floor(x + gt->pos_x);
- dx1= dx + gt->width;
- y1= y + gt->pos_y;
- y2= y + gt->pos_y - gt->height;
+ dx= floor(x + g->pos_x);
+ dx1= dx + g->width;
+ y1= y + g->pos_y;
+ y2= y + g->pos_y - g->height;
}
if (font->blur==3)
- blf_texture3_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture3_draw(g->uv, dx, y1, dx1, y2);
else if (font->blur==5)
- blf_texture5_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture5_draw(g->uv, dx, y1, dx1, y2);
else
- blf_texture_draw(gt->uv, dx, y1, dx1, y2);
-
- return(1);
-}
-
-int blf_glyph_bitmap_render(FontBLF *font, GlyphBLF *g, float x, float y)
-{
- GlyphBitmapBLF *gt;
- GLubyte null_bitmap= 0;
-
- gt= g->bitmap_data;
- if (!gt->image)
- return(1);
-
- if (font->flags & BLF_CLIPPING) {
- if (!BLI_in_rctf(&font->clip_rec, x + font->pos[0], y + font->pos[1]))
- return(0);
- if (!BLI_in_rctf(&font->clip_rec, x + font->pos[0], y + gt->height + font->pos[1]))
- return(0);
- if (!BLI_in_rctf(&font->clip_rec, x + gt->width + font->pos[0], y + gt->height + font->pos[1]))
- return(0);
- if (!BLI_in_rctf(&font->clip_rec, x + gt->width + font->pos[0], y + font->pos[1]))
- return(0);
- }
+ blf_texture_draw(g->uv, dx, y1, dx1, y2);
- glBitmap(0, 0, 0.0, 0.0, x + gt->pos_x, y, (const GLubyte *)&null_bitmap);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, gt->pitch * 8);
- glBitmap(gt->width, gt->height, 0.0, gt->pos_y, 0.0, 0.0, (const GLubyte *)gt->image);
- glBitmap(0, 0, 0.0, 0.0, -x - gt->pos_x, -y, (const GLubyte *)&null_bitmap);
return(1);
}
-
-int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
-{
- if (font->mode == BLF_MODE_BITMAP)
- return(blf_glyph_bitmap_render(font, g, x, y));
- return(blf_glyph_texture_render(font, g, x, y));
-}
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index 30d5c8ede65..2a69b8652ea 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -45,7 +45,9 @@ void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_s
void blf_font_size(FontBLF *font, int size, int dpi);
void blf_font_draw(FontBLF *font, char *str);
+void blf_font_buffer(FontBLF *font, char *str);
void blf_font_boundbox(FontBLF *font, char *str, rctf *box);
+void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height);
float blf_font_width(FontBLF *font, char *str);
float blf_font_height(FontBLF *font, char *str);
float blf_font_fixed_width(FontBLF *font);
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h
index 64d95986867..fb4a2e6a9e5 100644
--- a/source/blender/blenfont/intern/blf_internal_types.h
+++ b/source/blender/blenfont/intern/blf_internal_types.h
@@ -78,7 +78,22 @@ typedef struct GlyphCacheBLF {
float descender;
} GlyphCacheBLF;
-typedef struct GlyphTextureBLF {
+typedef struct GlyphBLF {
+ struct GlyphBLF *next;
+ struct GlyphBLF *prev;
+
+ /* and the character, as UTF8 */
+ unsigned int c;
+
+ /* freetype2 index, to speed-up the search. */
+ FT_UInt idx;
+
+ /* glyph box. */
+ rctf box;
+
+ /* advance size. */
+ float advance;
+
/* texture id where this glyph is store. */
GLuint tex;
@@ -86,9 +101,15 @@ typedef struct GlyphTextureBLF {
int xoff;
int yoff;
+ /* Bitmap data, from freetype. Take care that this
+ * can be NULL.
+ */
+ unsigned char *bitmap;
+
/* glyph width and height. */
int width;
int height;
+ int pitch;
/* uv coords. */
float uv[2][2];
@@ -99,38 +120,9 @@ typedef struct GlyphTextureBLF {
*/
float pos_x;
float pos_y;
-} GlyphTextureBLF;
-
-typedef struct GlyphBitmapBLF {
- /* image data. */
- unsigned char *image;
- int width;
- int height;
- int pitch;
-
- float pos_x;
- float pos_y;
-} GlyphBitmapBLF;
-
-typedef struct GlyphBLF {
- struct GlyphBLF *next;
- struct GlyphBLF *prev;
-
- /* and the character, as UTF8 */
- unsigned int c;
-
- /* glyph box. */
- rctf box;
-
- /* advance size. */
- float advance;
-
- /* texture information. */
- GlyphTextureBLF *tex_data;
-
- /* bitmap information. */
- GlyphBitmapBLF *bitmap_data;
+ /* with value of zero mean that we need build the texture. */
+ short build_tex;
} GlyphBLF;
typedef struct FontBLF {
@@ -140,9 +132,6 @@ typedef struct FontBLF {
/* filename or NULL. */
char *filename;
- /* draw mode, texture or bitmap. */
- int mode;
-
/* aspect ratio or scale. */
float aspect;
@@ -191,6 +180,22 @@ typedef struct FontBLF {
/* freetype2 face. */
FT_Face face;
+
+ /* for draw to buffer, always set this to NULL after finish! */
+ float *b_fbuf;
+
+ /* the same but unsigned char */
+ unsigned char *b_cbuf;
+
+ /* buffer size. */
+ unsigned int bw;
+ unsigned int bh;
+
+ /* number of channels. */
+ int bch;
+
+ /* and the color, the alphas is get from the glyph! */
+ float b_col[4];
} FontBLF;
typedef struct DirBLF {
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index d35acb5447a..4724ee19aaa 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -66,7 +66,7 @@ void free_action(struct bAction *act);
void make_local_action(struct bAction *act);
/* Some kind of bounding box operation on the action */
-void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden);
+void calc_action_range(const struct bAction *act, float *start, float *end, short incl_modifiers);
/* Does action have any motion data at all? */
short action_has_motion(const struct bAction *act);
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index 2447d1823af..cabbaa7aa0f 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -66,6 +66,9 @@ void BKE_keyingset_add_destination(struct KeyingSet *ks, struct ID *id, const ch
struct KS_Path *BKE_keyingset_find_destination(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode);
+/* Copy all KeyingSets in the given list */
+void BKE_keyingsets_copy(struct ListBase *newlist, struct ListBase *list);
+
/* Free data for KeyingSet but not set itself */
void BKE_keyingset_free(struct KeyingSet *ks);
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 19b9c315939..42ee11587a7 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -43,7 +43,7 @@ struct bContext;
struct ReportList;
#define BLENDER_VERSION 250
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 2
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index 9eb0b15aed4..4d24a2433b3 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -38,16 +38,15 @@ struct Scene;
struct wmOperator;
/* datablock functions */
-struct Brush *add_brush(char *name);
+struct Brush *add_brush(const char *name);
struct Brush *copy_brush(struct Brush *brush);
void make_local_brush(struct Brush *brush);
void free_brush(struct Brush *brush);
/* brush library operations used by different paint panels */
-struct Brush **current_brush_source(struct Scene *sce);
-int brush_set_nr(struct Brush **current_brush, int nr);
+int brush_set_nr(struct Brush **current_brush, int nr, const char *name);
int brush_delete(struct Brush **current_brush);
-void brush_check_exists(struct Brush **brush);
+void brush_check_exists(struct Brush **brush, const char *name);
void brush_toggled_fake_user(struct Brush *brush);
int brush_texture_set_nr(struct Brush *brush, int nr);
int brush_texture_delete(struct Brush *brush);
@@ -65,7 +64,6 @@ float brush_curve_strength(struct Brush *br, float p, const float len);
/* sampling */
float brush_sample_falloff(struct Brush *brush, float dist);
-float brush_sample_falloff_noalpha(struct Brush *brush, float dist);
void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
struct ImBuf **imbuf);
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index 4270c677338..bc4585106e6 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -65,8 +65,7 @@ struct CollisionTree;
#elif defined (__sun) || defined (__sun__)
# define DO_INLINE
#else
-# define DO_INLINE inline
-# define LINUX
+# define DO_INLINE static inline
#endif
#define CLOTH_MAX_THREAD 2
@@ -245,10 +244,6 @@ void cloth_update_normals ( ClothVertex *verts, int nVerts, MFace *face, int tot
void bvhtree_update_from_cloth ( ClothModifierData *clmd, int moving );
void bvhselftree_update_from_cloth ( ClothModifierData *clmd, int moving );
-// needed for editmesh.c
-void cloth_write_cache( Object *ob, ClothModifierData *clmd, int framenr );
-int cloth_read_cache( Scene *scene, Object *ob, ClothModifierData *clmd, float framenr, int *old_framenr );
-
// needed for button_object.c
void cloth_clear_cache ( Object *ob, ClothModifierData *clmd, float framenr );
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 6e69906b71d..a0061173438 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -49,6 +49,7 @@ typedef struct bConstraintOb {
float startmat[4][4]; /* original matrix (before constraint solving) */
short type; /* type of owner */
+ short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_arithb.h) */
} bConstraintOb;
/* ---------------------------------------------------------------------------- */
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index e47ad969b91..09e13c2930e 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -86,6 +86,25 @@ typedef struct bContextStore {
int used;
} bContextStore;
+/* for the conrtext's rna mode enum
+ * keep aligned with data_mode_strings in context.c */
+enum {
+ CTX_MODE_EDIT_MESH = 0,
+ CTX_MODE_EDIT_CURVE,
+ CTX_MODE_EDIT_SURFACE,
+ CTX_MODE_EDIT_TEXT,
+ CTX_MODE_EDIT_ARMATURE,
+ CTX_MODE_EDIT_METABALL,
+ CTX_MODE_EDIT_LATTICE,
+ CTX_MODE_POSE,
+ CTX_MODE_SCULPT,
+ CTX_MODE_PAINT_WEIGHT,
+ CTX_MODE_PAINT_VERTEX,
+ CTX_MODE_PAINT_TEXTURE,
+ CTX_MODE_PARTICLE,
+ CTX_MODE_OBJECT
+};
+
/* Context */
bContext *CTX_create(void);
@@ -133,6 +152,7 @@ struct SpaceLogic *CTX_wm_space_logic(const bContext *C);
struct SpaceIpo *CTX_wm_space_graph(const bContext *C);
struct SpaceAction *CTX_wm_space_action(const bContext *C);
struct SpaceInfo *CTX_wm_space_info(const bContext *C);
+struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C);
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm);
void CTX_wm_window_set(bContext *C, struct wmWindow *win);
@@ -191,6 +211,9 @@ struct Main *CTX_data_main(const bContext *C);
struct Scene *CTX_data_scene(const bContext *C);
struct ToolSettings *CTX_data_tool_settings(const bContext *C);
+char *CTX_data_mode_string(const bContext *C);
+int CTX_data_mode_enum(const bContext *C);
+
void CTX_data_main_set(bContext *C, struct Main *bmain);
void CTX_data_scene_set(bContext *C, struct Scene *bmain);
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 4b7ddf43647..6323258ff43 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -44,7 +44,6 @@ extern "C" {
/* forwards */
struct Main;
struct Object;
-struct bSoundListener;
struct BME_Glob;
typedef struct Global {
@@ -93,9 +92,6 @@ typedef struct Global {
/* save the allowed windowstate of blender when using -W or -w */
int windowstate;
- /* Janco's playing ground */
- struct bSoundListener* listener;
-
/* ndof device found ? */
int ndofdevice;
@@ -116,52 +112,40 @@ typedef struct Global {
#define G_FACESELECT (1 << 8)
-#define G_VERTEXPAINT (1 << 10)
-
#define G_DEBUG (1 << 12)
#define G_DOSCRIPTLINKS (1 << 13)
-#define G_WEIGHTPAINT (1 << 15)
-#define G_TEXTUREPAINT (1 << 16)
/* #define G_NOFROZEN (1 << 17) also removed */
#define G_GREASEPENCIL (1 << 17)
-#define G_SCULPTMODE (1 << 29)
-#define G_PARTICLEEDIT (1 << 30)
-
/* #define G_AUTOMATKEYS (1 << 30) also removed */
#define G_HIDDENHANDLES (1 << 31) /* used for curves only */
-/* macro for testing face select mode
- * Texture paint could be removed since selected faces are not used
- * however hiding faces is useful */
-#define FACESEL_PAINT_TEST ((G.f&G_FACESELECT) && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT)))
-
/* G.fileflags */
#define G_AUTOPACK (1 << 0)
#define G_FILE_COMPRESS (1 << 1)
#define G_FILE_AUTOPLAY (1 << 2)
-#define G_FILE_ENABLE_ALL_FRAMES (1 << 3)
-#define G_FILE_SHOW_DEBUG_PROPS (1 << 4)
-#define G_FILE_SHOW_FRAMERATE (1 << 5)
-#define G_FILE_SHOW_PROFILE (1 << 6)
+#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */
+#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */
+#define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */
+#define G_FILE_SHOW_PROFILE (1 << 6) /* deprecated */
#define G_FILE_LOCK (1 << 7)
#define G_FILE_SIGN (1 << 8)
#define G_FIle_PUBLISH (1 << 9)
#define G_FILE_NO_UI (1 << 10)
-#define G_FILE_GAME_TO_IPO (1 << 11)
-#define G_FILE_GAME_MAT (1 << 12)
-#define G_FILE_DISPLAY_LISTS (1 << 13)
-#define G_FILE_SHOW_PHYSICS (1 << 14)
-#define G_FILE_GAME_MAT_GLSL (1 << 15)
-#define G_FILE_GLSL_NO_LIGHTS (1 << 16)
-#define G_FILE_GLSL_NO_SHADERS (1 << 17)
-#define G_FILE_GLSL_NO_SHADOWS (1 << 18)
-#define G_FILE_GLSL_NO_RAMPS (1 << 19)
-#define G_FILE_GLSL_NO_NODES (1 << 20)
-#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21)
-#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22)
+#define G_FILE_GAME_TO_IPO (1 << 11) /* deprecated */
+#define G_FILE_GAME_MAT (1 << 12) /* deprecated */
+#define G_FILE_DISPLAY_LISTS (1 << 13) /* deprecated */
+#define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */
+#define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */
+#define G_FILE_GLSL_NO_LIGHTS (1 << 16) /* deprecated */
+#define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */
+#define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */
+#define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */
+#define G_FILE_GLSL_NO_NODES (1 << 20) /* deprecated */
+#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) /* deprecated */
+#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) /* deprecated */
/* G.windowstate */
#define G_WINDOWSTATE_USERDEF 0
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index ce182267b93..4e7db115168 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -58,6 +58,7 @@ int set_listbasepointers(struct Main *main, struct ListBase **lb);
void free_libblock(struct ListBase *lb, void *idv);
void free_libblock_us(struct ListBase *lb, void *idv);
void free_main(struct Main *mainvar);
+void tag_main(struct Main *mainvar, int tag);
void splitIDname(char *name, char *left, int *nr);
void rename_id(struct ID *id, char *name);
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h
index ba78aa0682d..ff9ac693ba8 100644
--- a/source/blender/blenkernel/BKE_mball.h
+++ b/source/blender/blenkernel/BKE_mball.h
@@ -164,6 +164,7 @@ struct MetaBall *copy_mball(struct MetaBall *mb);
void make_local_mball(struct MetaBall *mb);
void tex_space_mball(struct Object *ob);
float *make_orco_mball(struct Object *ob);
+void copy_mball_properties(struct Scene *scene, struct Object *active_object);
struct Object *find_basis_mball(struct Scene *scene, struct Object *ob);
int is_basis_mball(struct Object *ob);
void metaball_polygonize(struct Scene *scene, struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 144ed3bc624..27c75126026 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -33,6 +33,7 @@
#include "DNA_modifier_types.h" /* needed for all enum typdefs */
#include "BKE_customdata.h"
+struct ID;
struct EditMesh;
struct DerivedMesh;
struct DagForest;
@@ -89,7 +90,10 @@ typedef enum {
eModifierTypeFlag_UsesPointCache = (1<<6),
/* For physics modifiers, max one per type */
- eModifierTypeFlag_Single = (1<<7)
+ eModifierTypeFlag_Single = (1<<7),
+
+ /* Some modifier can't be added manually by user */
+ eModifierTypeFlag_NoUserAdd = (1<<8)
} ModifierTypeFlag;
typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin);
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index 6558212519f..a331479cad1 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -35,10 +35,12 @@ struct Object;
typedef struct MultiresSubsurf {
struct MultiresModifierData *mmd;
- struct Mesh *me;
+ struct Object *ob;
+ int local_mmd;
} MultiresSubsurf;
/* MultiresDM */
+struct Object *MultiresDM_get_object(struct DerivedMesh *dm);
struct Mesh *MultiresDM_get_mesh(struct DerivedMesh *dm);
struct DerivedMesh *MultiresDM_new(struct MultiresSubsurf *, struct DerivedMesh*, int, int, int);
void *MultiresDM_get_vertnorm(struct DerivedMesh *);
@@ -58,8 +60,8 @@ void multires_mark_as_modified(struct Object *ob);
void multires_force_update(struct Object *ob);
-struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*,
- struct Mesh *, int, int);
+struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, int local_mmd, struct DerivedMesh*,
+ struct Object *, int, int);
struct MultiresModifierData *find_multires_modifier(struct Object *ob);
int multiresModifier_switch_level(struct Object *, const int);
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 241a8fd7b59..989043c1d67 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -80,6 +80,7 @@ short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip);
/* ............ */
struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt);
+void BKE_nlastrip_set_active(struct AnimData *adt, struct NlaStrip *strip);
short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max);
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 87ee8f9cab3..40afa1dba36 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -47,6 +47,7 @@ struct rctf;
struct ListBase;
struct RenderData;
struct Scene;
+struct Main;
struct Tex;
struct GPUMaterial;
struct GPUNode;
@@ -420,10 +421,9 @@ extern struct ListBase node_all_textures;
/* API */
int ntreeTexTagAnimated(struct bNodeTree *ntree);
-void ntreeTexUpdatePreviews( struct bNodeTree* nodetree );
-void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, char do_preview, short thread, struct Tex *tex, short which_output, int cfra);
+void ntreeTexSetPreviewFlag(int);
+void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra);
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
-void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node);
char* ntreeTexOutputMenu(struct bNodeTree *ntree);
@@ -432,4 +432,8 @@ char* ntreeTexOutputMenu(struct bNodeTree *ntree);
void init_nodesystem(void);
void free_nodesystem(void);
+/**/
+
+void clear_scene_in_nodes(struct Main *bmain, struct Scene *sce);
+
#endif
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index a57529ccf75..1cb6efeb838 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -115,6 +115,11 @@ void object_handle_update(struct Scene *scene, struct Object *ob);
float give_timeoffset(struct Object *ob);
int give_obdata_texspace(struct Object *ob, int **texflag, float **loc, float **size, float **rot);
+
+int object_insert_ptcache(struct Object *ob);
+// void object_delete_ptcache(struct Object *ob, int index);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h
index efd930d375a..b6513bede99 100644
--- a/source/blender/blenkernel/BKE_packedFile.h
+++ b/source/blender/blenkernel/BKE_packedFile.h
@@ -34,7 +34,6 @@
#define RET_OK 0
#define RET_ERROR 1
-struct bSample;
struct bSound;
struct Image;
struct Main;
@@ -51,7 +50,7 @@ void packAll(struct Main *bmain, struct ReportList *reports);
/* unpack */
char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how);
int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how);
-int unpackSample(struct ReportList *reports, struct bSample *sample, int how);
+int unpackSound(struct ReportList *reports, struct bSound *sound, int how);
int unpackImage(struct ReportList *reports, struct Image *ima, int how);
void unpackAll(struct Main *bmain, struct ReportList *reports, int how);
diff --git a/source/blender/blenkernel/BKE_sculpt.h b/source/blender/blenkernel/BKE_paint.h
index 08db1ac632e..7dc9e4499c6 100644
--- a/source/blender/blenkernel/BKE_sculpt.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -17,7 +15,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2007 by Nicholas Bishop
+ * The Original Code is Copyright (C) 2009 by Nicholas Bishop
* All rights reserved.
*
* The Original Code is: all of this file.
@@ -25,17 +23,42 @@
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
- */
+ */
-#ifndef BKE_SCULPT_H
-#define BKE_SCULPT_H
+#ifndef BKE_PAINT_H
+#define BKE_PAINT_H
+struct Brush;
struct MFace;
struct MultireModifierData;
struct MVert;
-struct Sculpt;
+struct Object;
+struct Paint;
+struct Scene;
struct StrokeCache;
+extern const char PAINT_CURSOR_SCULPT[3];
+extern const char PAINT_CURSOR_VERTEX_PAINT[3];
+extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
+extern const char PAINT_CURSOR_TEXTURE_PAINT[3];
+
+void paint_init(struct Paint *p, const char col[3]);
+void free_paint(struct Paint *p);
+void copy_paint(struct Paint *orig, struct Paint *new);
+
+struct Paint *paint_get_active(struct Scene *sce);
+struct Brush *paint_brush(struct Paint *paint);
+void paint_brush_set(struct Paint *paint, struct Brush *br);
+void paint_brush_slot_add(struct Paint *p);
+void paint_brush_slot_remove(struct Paint *p);
+
+/* testing face select mode
+ * Texture paint could be removed since selected faces are not used
+ * however hiding faces is useful */
+int paint_facesel_test(struct Object *ob);
+
+/* Session data (mode-specific) */
+
typedef struct SculptSession {
struct ProjVert *projverts;
@@ -59,13 +82,14 @@ typedef struct SculptSession {
/* Used to cache the render of the active texture */
unsigned int texcache_side, *texcache, texcache_actual;
- void *cursor; /* wm handle */
+ /* Layer brush persistence between strokes */
+ float (*mesh_co_orig)[3]; /* Copy of the mesh vertices' locations */
+ float *layer_disps; /* Displacements for each vertex */
struct SculptStroke *stroke;
-
struct StrokeCache *cache;
} SculptSession;
-void sculptsession_free(struct Sculpt *sculpt);
+void free_sculptsession(SculptSession **);
#endif
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index cf02efc34ac..e24114cd219 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -109,46 +109,10 @@ typedef struct ParticleCacheKey{
float vel[3];
float rot[4];
float col[3];
+ float time;
int steps;
} ParticleCacheKey;
-typedef struct ParticleEditKey{
- float *co;
- float *vel;
- float *rot;
- float *time;
-
- float world_co[3];
- float length;
- short flag;
-} ParticleEditKey;
-
-typedef struct ParticleUndo {
- struct ParticleUndo *next, *prev;
- struct ParticleEditKey **keys;
- struct KDTree *emitter_field;
- struct ParticleData *particles;
- float *emitter_cosnos;
- int totpart, totkeys;
- char name[64];
-} ParticleUndo;
-
-typedef struct ParticleEdit {
- ListBase undo;
- struct ParticleUndo *curundo;
-
- ParticleEditKey **keys;
- int totkeys;
-
- int *mirror_cache;
-
- struct KDTree *emitter_field;
- float *emitter_cosnos;
-
- char sel_col[3];
- char nosel_col[3];
-} ParticleEdit;
-
typedef struct ParticleThreadContext {
/* shared */
struct Scene *scene;
@@ -240,7 +204,7 @@ int psys_check_enabled(struct Object *ob, struct ParticleSystem *psys);
void psys_free_boid_rules(struct ListBase *list);
void psys_free_settings(struct ParticleSettings *part);
void free_child_path_cache(struct ParticleSystem *psys);
-void psys_free_path_cache(struct ParticleSystem *psys);
+void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit);
void free_hair(struct ParticleSystem *psys, int softbody);
void free_keyed_keys(struct ParticleSystem *psys);
void psys_free(struct Object * ob, struct ParticleSystem * psys);
@@ -271,9 +235,9 @@ void psys_reset(struct ParticleSystem *psys, int mode);
void psys_find_parents(struct Object *ob, struct ParticleSystemModifierData *psmd, struct ParticleSystem *psys);
-void psys_cache_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra, int editupdate);
+void psys_cache_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra);
+void psys_cache_edit_paths(struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra);
void psys_cache_child_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra, int editupdate);
-void psys_update_world_cos(struct Object *ob, struct ParticleSystem *psys);
int do_guide(struct Scene *scene, struct ParticleKey *state, int pa_num, float time, struct ListBase *lb);
float psys_get_size(struct Object *ob, struct Material *ma, struct ParticleSystemModifierData *psmd, struct IpoCurve *icu_size, struct ParticleSystem *psys, struct ParticleSettings *part, struct ParticleData *pa, float *vg_size);
float psys_get_timestep(struct ParticleSettings *part);
@@ -359,12 +323,6 @@ void reset_particle(struct Scene *scene, struct ParticleData *pa, struct Particl
#define PSYS_EC_PARTICLE 4
#define PSYS_EC_REACTOR 8
-/* ParticleEditKey->flag */
-#define PEK_SELECT 1
-#define PEK_TO_SELECT 2
-#define PEK_TAG 4
-#define PEK_HIDE 8
-
/* index_dmcache */
#define DMCACHE_NOTFOUND -1
#define DMCACHE_ISCHILD -2
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 8062f807055..9ba34091064 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -30,6 +30,8 @@
#define BKE_POINTCACHE_H
#include "DNA_ID.h"
+#include "DNA_object_force.h"
+#include "DNA_boid_types.h"
#include "MEM_guardedalloc.h"
@@ -55,9 +57,11 @@
#define PTCACHE_FILE_WRITE 1
/* PTCacheID types */
-#define PTCACHE_TYPE_SOFTBODY 0
-#define PTCACHE_TYPE_PARTICLES 1
-#define PTCACHE_TYPE_CLOTH 2
+#define PTCACHE_TYPE_SOFTBODY 0
+#define PTCACHE_TYPE_PARTICLES 1
+#define PTCACHE_TYPE_CLOTH 2
+#define PTCACHE_TYPE_SMOKE_DOMAIN 3
+#define PTCACHE_TYPE_SMOKE_HIGHRES 4
/* PTCache read return code */
#define PTCACHE_READ_EXACT 1
@@ -69,47 +73,74 @@ struct Object;
struct Scene;
struct SoftBody;
struct ParticleSystem;
+struct ParticleKey;
struct ClothModifierData;
+struct SmokeModifierData;
struct PointCache;
struct ListBase;
+/* temp structure for read/write */
+typedef struct PTCacheData {
+ int index;
+ float loc[3];
+ float vel[3];
+ float rot[4];
+ float ave[3];
+ float size;
+ float times[3];
+ struct BoidData boids;
+} PTCacheData;
+
typedef struct PTCacheFile {
FILE *fp;
+
+ int totpoint, type;
+ unsigned int data_types;
+
+ struct PTCacheData data;
+ void *cur[BPHYS_TOT_DATA];
} PTCacheFile;
+#define PTCACHE_VEL_PER_SEC 1
+
typedef struct PTCacheID {
struct PTCacheID *next, *prev;
+ struct Scene *scene;
struct Object *ob;
- void *data;
+ void *calldata;
int type;
int stack_index;
+ int flag;
+
+ /* flags defined in DNA_object_force.h */
+ unsigned int data_types, info_types;
+
+ /* copies point data to cache data */
+ int (*write_elem)(int index, void *calldata, void **data);
+ /* copies point data to cache data */
+ int (*write_stream)(PTCacheFile *pf, void *calldata);
+ /* copies cache cata to point data */
+ void (*read_elem)(int index, void *calldata, void **data, float frs_sec, float cfra, float *old_data);
+ /* copies cache cata to point data */
+ void (*read_stream)(PTCacheFile *pf, void *calldata);
+ /* interpolated between previously read point data and cache data */
+ void (*interpolate_elem)(int index, void *calldata, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data);
+
+ /* total number of simulated points */
+ int (*totpoint)(void *calldata);
+ /* number of points written for current cache frame (currently not used) */
+ int (*totwrite)(void *calldata);
+
+ int (*write_header)(PTCacheFile *pf);
+ int (*read_header)(PTCacheFile *pf);
struct PointCache *cache;
+ /* used for setting the current cache from ptcaches list */
+ struct PointCache **cache_ptr;
+ struct ListBase *ptcaches;
} PTCacheID;
-typedef struct PTCacheWriter {
- struct PTCacheID *pid;
- int cfra;
- int totelem;
-
- void (*set_elem)(int index, void *calldata, float *data);
- void *calldata;
-} PTCacheWriter;
-
-typedef struct PTCacheReader {
- struct Scene *scene;
- struct PTCacheID *pid;
- float cfra;
- int totelem;
-
- void (*set_elem)(int elem_index, void *calldata, float *data);
- void (*interpolate_elem)(int index, void *calldata, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2);
- void *calldata;
-
- int *old_frame;
-} PTCacheReader;
-
typedef struct PTCacheBaker {
struct Scene *scene;
int bake;
@@ -123,49 +154,148 @@ typedef struct PTCacheBaker {
void *progresscontext;
} PTCacheBaker;
-/* Creating ID's */
+/* PTCacheEditKey->flag */
+#define PEK_SELECT 1
+#define PEK_TAG 2
+#define PEK_HIDE 4
+#define PEK_USE_WCO 8
+
+typedef struct PTCacheEditKey{
+ float *co;
+ float *vel;
+ float *rot;
+ float *time;
+
+ float world_co[3];
+ float ftime;
+ float length;
+ short flag;
+} PTCacheEditKey;
+
+/* PTCacheEditPoint->flag */
+#define PEP_TAG 1
+#define PEP_EDIT_RECALC 2
+#define PEP_TRANSFORM 4
+#define PEP_HIDE 8
+
+typedef struct PTCacheEditPoint {
+ struct PTCacheEditKey *keys;
+ int totkey;
+ short flag;
+} PTCacheEditPoint;
+
+typedef struct PTCacheUndo {
+ struct PTCacheUndo *next, *prev;
+ struct PTCacheEditPoint *points;
+
+ /* particles stuff */
+ struct ParticleData *particles;
+ struct KDTree *emitter_field;
+ float *emitter_cosnos;
+
+ /* cache stuff */
+ struct ListBase mem_cache;
+
+ int totpoint;
+ char name[64];
+} PTCacheUndo;
+
+typedef struct PTCacheEdit {
+ ListBase undo;
+ struct PTCacheUndo *curundo;
+ PTCacheEditPoint *points;
+
+ struct PTCacheID pid;
+
+ /* particles stuff */
+ struct ParticleSystem *psys;
+ struct ParticleData *particles;
+ struct KDTree *emitter_field;
+ float *emitter_cosnos;
+ int *mirror_cache;
+
+ struct ParticleCacheKey **pathcache; /* path cache (runtime) */
+ ListBase pathcachebufs;
+
+ int totpoint, totframes, totcached, edited;
+
+ char sel_col[3];
+ char nosel_col[3];
+} PTCacheEdit;
+
+/* Particle functions */
+void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **data, float time);
+
+/**************** Creating ID's ****************************/
void BKE_ptcache_id_from_softbody(PTCacheID *pid, struct Object *ob, struct SoftBody *sb);
void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys);
void BKE_ptcache_id_from_cloth(PTCacheID *pid, struct Object *ob, struct ClothModifierData *clmd);
+void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd);
void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob);
-/* Global funcs */
+/***************** Global funcs ****************************/
void BKE_ptcache_remove(void);
-/* ID specific functions */
+/************ ID specific functions ************************/
void BKE_ptcache_id_clear(PTCacheID *id, int mode, int cfra);
int BKE_ptcache_id_exist(PTCacheID *id, int cfra);
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode);
void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale);
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode);
-/* File reading/writing */
-PTCacheFile *BKE_ptcache_file_open(PTCacheID *id, int mode, int cfra);
-void BKE_ptcache_file_close(PTCacheFile *pf);
-int BKE_ptcache_file_read_floats(PTCacheFile *pf, float *f, int tot);
-int BKE_ptcache_file_write_floats(PTCacheFile *pf, float *f, int tot);
-
void BKE_ptcache_update_info(PTCacheID *pid);
-/* General cache reading/writing */
-int BKE_ptcache_read_cache(PTCacheReader *reader);
-int BKE_ptcache_write_cache(PTCacheWriter *writer);
+/*********** General cache reading/writing ******************/
+
+/* Size of cache data type. */
+int BKE_ptcache_data_size(int data_type);
+
+/* Memory cache read/write helpers. */
+void BKE_ptcache_mem_init_pointers(struct PTCacheMem *pm);
+void BKE_ptcache_mem_incr_pointers(struct PTCacheMem *pm);
+
+/* Copy a specific data type from cache data to point data. */
+void BKE_ptcache_data_get(void **data, int type, int index, void *to);
+
+/* Copy a specific data type from point data to cache data. */
+void BKE_ptcache_data_set(void **data, int type, void *from);
-/* Continue physics */
+/* Main cache reading call. */
+int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec);
+
+/* Main cache writing call. */
+int BKE_ptcache_write_cache(PTCacheID *pid, int cfra);
+
+/****************** Continue physics ***************/
void BKE_ptcache_set_continue_physics(struct Scene *scene, int enable);
int BKE_ptcache_get_continue_physics(void);
-/* Point Cache */
-struct PointCache *BKE_ptcache_add(void);
+/******************* Allocate & free ***************/
+struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
+void BKE_ptcache_free_mem(struct ListBase *mem_cache);
void BKE_ptcache_free(struct PointCache *cache);
-struct PointCache *BKE_ptcache_copy(struct PointCache *cache);
+void BKE_ptcache_free_list(struct ListBase *ptcaches);
+struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old);
-/* Baking */
+/********************** Baking *********************/
+
+/* Bakes cache with cache_step sized jumps in time, not accurate but very fast. */
void BKE_ptcache_quick_cache_all(struct Scene *scene);
+
+/* Bake cache or simulate to current frame with settings defined in the baker. */
void BKE_ptcache_make_cache(struct PTCacheBaker* baker);
+
+/* Convert disk cache to memory cache. */
+void BKE_ptcache_disk_to_mem(struct PTCacheID *pid);
+
+/* Convert memory cache to disk cache. */
+void BKE_ptcache_mem_to_disk(struct PTCacheID *pid);
+
+/* Convert disk cache to memory cache and vice versa. Clears the cache that was converted. */
void BKE_ptcache_toggle_disk_cache(struct PTCacheID *pid);
+/* Loads simulation from external (disk) cache files. */
void BKE_ptcache_load_external(struct PTCacheID *pid);
#endif
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 9bb246f88cc..12a13a2b50c 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -40,6 +40,12 @@ struct AviCodecData;
struct QuicktimeCodecData;
struct RenderData;
struct Text;
+struct Main;
+
+#define SCE_COPY_EMPTY 0
+#define SCE_COPY_LINK_OB 1
+#define SCE_COPY_LINK_DATA 2
+#define SCE_COPY_FULL 3
/* note; doesn't work when scene is empty */
#define SETLOOPER(s, b) sce= s, b= (Base*)sce->base.first; b; b= (Base*)(b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL)
@@ -48,13 +54,16 @@ struct Text;
void free_avicodecdata(struct AviCodecData *acd);
void free_qtcodecdata(struct QuicktimeCodecData *acd);
-void free_scene(struct Scene *me);
+void free_scene(struct Scene *sce);
struct Scene *add_scene(char *name);
struct Base *object_in_scene(struct Object *ob, struct Scene *sce);
void set_scene_bg(struct Scene *sce);
void set_scene_name(char *name);
+struct Scene *copy_scene(struct Main *bmain, struct Scene *sce, int type);
+void unlink_scene(struct Main *bmain, struct Scene *sce, struct Scene *newsce);
+
int next_object(struct Scene *scene, int val, struct Base **base, struct Object **ob);
struct Object *scene_find_camera(struct Scene *sc);
diff --git a/source/blender/blenkernel/BKE_sequence.h b/source/blender/blenkernel/BKE_sequence.h
index 65a3b0216fe..f72617c8312 100644
--- a/source/blender/blenkernel/BKE_sequence.h
+++ b/source/blender/blenkernel/BKE_sequence.h
@@ -37,6 +37,7 @@ struct Strip;
struct StripElem;
struct ImBuf;
struct Scene;
+struct bContext;
#define MAXSEQ 32
@@ -44,7 +45,6 @@ struct Scene;
#define BUILD_SEQAR_COUNT_CURRENT 1
#define BUILD_SEQAR_COUNT_CHILDREN 2
-
/* sequence iterator */
typedef struct SeqIterator {
@@ -137,9 +137,9 @@ struct SeqEffectHandle {
/* sequence.c */
// extern
-void seq_free_sequence(struct Editing *ed, struct Sequence *seq);
+void seq_free_sequence(struct Scene *scene, struct Sequence *seq);
void seq_free_strip(struct Strip *strip);
-void seq_free_editing(struct Editing *ed);
+void seq_free_editing(struct Scene *scene);
struct Editing *seq_give_editing(struct Scene *scene, int alloc);
char *give_seqname(struct Sequence *seq);
struct ImBuf *give_ibuf_seq(struct Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size);
@@ -181,5 +181,10 @@ int check_single_seq(struct Sequence *seq);
void fix_single_seq(struct Sequence *seq);
int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test);
int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test);
-void free_imbuf_seq(struct ListBase * seqbasep);
+void free_imbuf_seq(struct ListBase * seqbasep, int check_mem_usage);
+
+void seq_update_sound(struct Sequence *seq);
+
+void clear_scene_in_allseqs(struct Scene *sce);
+
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h
index eb0e3c4ef00..5b413ae4e44 100644
--- a/source/blender/blenkernel/BKE_shrinkwrap.h
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -115,9 +115,9 @@ typedef struct ShrinkwrapCalcData
int vgroup; //Vertex group num
struct DerivedMesh *target; //mesh we are shrinking to
- SpaceTransform local2target; //transform to move bettwem local and target space
+ SpaceTransform local2target; //transform to move between local and target space
- float keepDist; //Distance to kept from target (units are in local space)
+ float keepDist; //Distance to keep above target surface (units are in local space)
} ShrinkwrapCalcData;
diff --git a/intern/SoundSystem/SND_Object.h b/source/blender/blenkernel/BKE_smoke.h
index f23827974e3..fddcf0fea83 100644
--- a/intern/SoundSystem/SND_Object.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@ -1,7 +1,5 @@
-/*
- * SND_Object.h
- *
- * Abstract sound object
+/**
+ * BKE_smoke.h
*
* $Id$
*
@@ -21,34 +19,26 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Daniel Genrich
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __SND_OBJECT_H
-#define __SND_OBJECT_H
+#ifndef BKE_SMOKE_H_
+#define BKE_SMOKE_H_
-#include "GEN_List.h"
-#include "MT_Matrix3x3.h"
-#include "SoundDefines.h"
+typedef int (*bresenham_callback) (float *input, int res[3], int *pixel, float *tRay);
-/**
- * SND_Object is an interface class for soundobjects, listeners and other
- * kinds of sound related thingies.
- */
+void smokeModifier_do(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc);
-class SND_Object : public GEN_Link
-{
-public:
- SND_Object() {};
- virtual ~SND_Object() {};
-};
+void smokeModifier_free (struct SmokeModifierData *smd);
+void smokeModifier_reset(struct SmokeModifierData *smd);
+void smokeModifier_createType(struct SmokeModifierData *smd);
-#endif //__SND_OBJECT_H
+#endif /* BKE_SMOKE_H_ */
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h
index 971ac7a5f01..d8053281ceb 100644
--- a/source/blender/blenkernel/BKE_softbody.h
+++ b/source/blender/blenkernel/BKE_softbody.h
@@ -68,8 +68,5 @@ extern void sbObjectToSoftbody(struct Object *ob);
/* pass NULL to unlink again */
extern void sbSetInterruptCallBack(int (*f)(void));
-/* writing to cache for bake editing */
-extern void sbWriteCache(struct Object *ob, int framenr);
-
#endif
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index f3bed467c3a..e9f6eb21e36 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -1,7 +1,7 @@
/**
* sound.h (mar-2001 nzc)
- *
- * $Id$
+ *
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -33,20 +33,47 @@
struct PackedFile;
struct bSound;
-struct bSample;
+struct bContext;
struct ListBase;
+struct Main;
-/* bad bad global... */
-extern struct ListBase *samples;
+void sound_init();
-void sound_free_all_samples(void);
+void sound_exit();
-/* void *sound_get_listener(void); implemented in src!also declared there now */
+struct bSound* sound_new_file(struct Main *main, char* filename);
-void sound_set_packedfile(struct bSample* sample, struct PackedFile* pf);
-struct PackedFile* sound_find_packedfile(struct bSound* sound);
-void sound_free_sample(struct bSample* sample);
-void sound_free_sound(struct bSound* sound);
+// XXX unused currently
+#if 0
+struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source);
+struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end);
#endif
+void sound_delete(struct bContext *C, struct bSound* sound);
+
+void sound_cache(struct bSound* sound, int ignore);
+
+void sound_delete_cache(struct bSound* sound);
+
+void sound_load(struct Main *main, struct bSound* sound);
+
+void sound_free(struct bSound* sound);
+
+void sound_unlink(struct bContext *C, struct bSound* sound);
+
+struct SoundHandle* sound_new_handle(struct Scene *scene, struct bSound* sound, int startframe, int endframe, int frameskip);
+
+void sound_delete_handle(struct Scene *scene, struct SoundHandle *handle);
+
+void sound_update_playing(struct bContext *C);
+
+void sound_scrub(struct bContext *C);
+
+#ifdef AUD_CAPI
+AUD_Device* sound_mixdown(struct Scene *scene, AUD_Specs specs, int start, int end);
+#endif
+
+void sound_stop_all(struct bContext *C);
+
+#endif
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index a1600ce5473..a9862ba586b 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -40,6 +40,8 @@ struct ColorBand;
struct HaloRen;
struct TexMapping;
struct EnvMap;
+struct PointDensity;
+struct VoxelData;
/* in ColorBand struct */
#define MAXCOLORBAND 32
@@ -75,6 +77,16 @@ void BKE_free_envmap(struct EnvMap *env);
struct EnvMap *BKE_add_envmap(void);
struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
+void BKE_free_pointdensitydata(struct PointDensity *pd);
+void BKE_free_pointdensity(struct PointDensity *pd);
+struct PointDensity *BKE_add_pointdensity(void);
+struct PointDensity *BKE_copy_pointdensity(struct PointDensity *pd);
+
+void BKE_free_voxeldatadata(struct VoxelData *vd);
+void BKE_free_voxeldata(struct VoxelData *vd);
+struct VoxelData *BKE_add_voxeldata(void);
+struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd);
+
int BKE_texture_dependsOnTime(const struct Tex *texture);
#endif
diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h
new file mode 100644
index 00000000000..5d5f8cddf47
--- /dev/null
+++ b/source/blender/blenkernel/BKE_unit.h
@@ -0,0 +1,68 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BKE_UNIT_H
+#define BKE_UNIT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* in all cases the value is assumed to be scaled by the user preference */
+
+/* humanly readable representation of a value in units (used for button drawing) */
+void bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad);
+
+/* replace units with values, used before python button evaluation */
+int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pref, int system, int type);
+
+/* the size of the unit used for this value (used for calculating the ckickstep) */
+double bUnit_ClosestScalar(double value, int system, int type);
+
+/* base scale for these units */
+double bUnit_BaseScalar(int system, int type);
+
+/* loop over scales, coudl add names later */
+//double bUnit_Iter(void **unit, char **name, int system, int type);
+
+void bUnit_GetSystem(void **usys_pt, int *len, int system, int type);
+char* bUnit_GetName(void *usys_pt, int index);
+char* bUnit_GetNameDisplay(void *usys_pt, int index);
+double bUnit_GetScaler(void *usys_pt, int index);
+
+/* aligned with PropertyUnit */
+#define B_UNIT_NONE 0
+#define B_UNIT_LENGTH 1
+#define B_UNIT_AREA 2
+#define B_UNIT_VOLUME 3
+#define B_UNIT_MASS 4
+#define B_UNIT_ROTATION 5
+#define B_UNIT_TIME 6
+#define B_UNIT_VELOCITY 7
+#define B_UNIT_ACCELERATION 8
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BKE_UNIT_H */
diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h
index f6c305b202d..76e0da98f69 100644
--- a/source/blender/blenkernel/BKE_utildefines.h
+++ b/source/blender/blenkernel/BKE_utildefines.h
@@ -62,11 +62,6 @@
#define SHIFT3(type, a, b, c) { type tmp; tmp = a; a = c; c = b; b = tmp; }
#define SHIFT4(type, a, b, c, d) { type tmp; tmp = a; a = d; d = c; c = b; b = tmp; }
-/* string compare */
-#define STREQ(str, a) ( strcmp((str), (a))==0 )
-#define STREQ2(str, a, b) ( STREQ(str, a) || STREQ(str, b) )
-#define STREQ3(str, a, b, c) ( STREQ2(str, a, b) || STREQ(str, c) )
-
/* min/max */
#define MIN2(x,y) ( (x)<(y) ? (x) : (y) )
#define MIN3(x,y,z) MIN2( MIN2((x),(y)) , (z) )
@@ -92,8 +87,6 @@
if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0]; \
if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1]; }
-#define MINSIZE(val, size) ( ((val)>=0.0) ? (((val)<(size)) ? (size): (val)) : ( ((val)>(-size)) ? (-size) : (val)))
-
/* some math and copy defines */
#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h
index cae1f25d0d8..4ef63b069c2 100644
--- a/source/blender/blenkernel/BKE_writeavi.h
+++ b/source/blender/blenkernel/BKE_writeavi.h
@@ -37,13 +37,14 @@ extern "C" {
/* generic blender movie support, could move to own module */
struct RenderData;
-void start_avi(struct RenderData *rd, int rectx, int recty);
+struct Scene;
+void start_avi(struct Scene *scene, struct RenderData *rd, int rectx, int recty);
void end_avi(void);
void append_avi(struct RenderData *rd, int frame, int *pixels, int rectx, int recty);
void makeavistring (struct RenderData *rd, char *string);
typedef struct bMovieHandle {
- void (*start_movie)(struct RenderData *rd, int rectx, int recty);
+ void (*start_movie)(struct Scene *scene, struct RenderData *rd, int rectx, int recty);
void (*append_movie)(struct RenderData *rd, int frame, int *pixels, int rectx, int recty);
void (*end_movie)(void);
int (*get_next_frame)(struct RenderData *rd); /* optional */
diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h
index be136bd9d6d..07e0e01ef7e 100644
--- a/source/blender/blenkernel/BKE_writeffmpeg.h
+++ b/source/blender/blenkernel/BKE_writeffmpeg.h
@@ -57,8 +57,9 @@ extern "C" {
struct IDProperty;
struct RenderData;
+struct Scene;
-extern void start_ffmpeg(struct RenderData *rd, int rectx, int recty);
+extern void start_ffmpeg(struct Scene *scene, struct RenderData *rd, int rectx, int recty);
extern void end_ffmpeg(void);
extern void append_ffmpeg(struct RenderData *rd, int frame, int *pixels, int rectx, int recty);
diff --git a/source/blender/blenkernel/BKE_writeframeserver.h b/source/blender/blenkernel/BKE_writeframeserver.h
index e870cbb865d..6a38abe977f 100644
--- a/source/blender/blenkernel/BKE_writeframeserver.h
+++ b/source/blender/blenkernel/BKE_writeframeserver.h
@@ -33,8 +33,9 @@ extern "C" {
#endif
struct RenderData;
+struct Scene;
-extern void start_frameserver(struct RenderData *rd, int rectx, int recty);
+extern void start_frameserver(struct Scene *scene, struct RenderData *rd, int rectx, int recty);
extern void end_frameserver(void);
extern void append_frameserver(struct RenderData *rd, int frame, int *pixels, int rectx, int recty);
extern int frameserver_loop(struct RenderData *rd);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 92cc206667c..17079205423 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -27,16 +27,23 @@
FILE(GLOB SRC intern/*.c)
SET(INC
- . ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna
+ . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna
../render/extern/include ../../../intern/decimation/extern
../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern
- ../../../intern/iksolver/extern ../blenloader ../quicktime
- ../../../extern/bullet2/src
- ../nodes ../../../extern/glew/include ../gpu ../makesrna
- ../../../intern/bsp/extern
+ ../../../intern/iksolver/extern ../blenloader
+ ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern
+ ../../../intern/bsp/extern ../blenfont
+ ../../../intern/audaspace/intern
+ ../../../extern/lzo/minilzo
+ ../../../extern/lzma
${ZLIB_INC}
)
+IF(WITH_BULLET)
+ SET(INC ${INC} ../../../extern/bullet2/src)
+ ADD_DEFINITIONS(-DUSE_BULLET)
+ENDIF(WITH_BULLET)
+
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
@@ -50,16 +57,10 @@ IF(WITH_DDS)
ENDIF(WITH_DDS)
IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
+ SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
-IF(WITH_SDL)
- SET(INC ${INC} ${SDL_INC})
-ELSE(WITH_SDL)
- ADD_DEFINITIONS(-DDISABLE_SDL)
-ENDIF(WITH_SDL)
-
IF(WITH_FFMPEG)
SET(INC ${INC} ${FFMPEG_INC})
ADD_DEFINITIONS(-DWITH_FFMPEG)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index dbc990d0613..0c7922de6ff 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -3,13 +3,17 @@ Import ('env')
sources = env.Glob('intern/*.c')
-incs = '. #/intern/guardedalloc ../editors/include ../blenlib ../makesdna'
+incs = '. #/intern/guardedalloc #/intern/memutil ../editors/include ../blenlib ../blenfont ../makesdna'
incs += ' ../render/extern/include #/intern/decimation/extern ../makesrna'
incs += ' ../imbuf ../avi #/intern/elbeem/extern ../nodes'
incs += ' #/intern/iksolver/extern ../blenloader'
incs += ' #/extern/bullet2/src'
incs += ' #/intern/opennl/extern #/intern/bsp/extern'
incs += ' ../gpu #/extern/glew/include'
+incs += ' #/intern/smoke/extern'
+incs += ' #/extern/lzo/minilzo'
+incs += ' #/extern/lzma'
+incs += ' #/intern/audaspace/intern'
incs += ' ' + env['BF_OPENGL_INC']
incs += ' ' + env['BF_ZLIB_INC']
@@ -50,7 +54,7 @@ if env['WITH_BF_QUICKTIME']:
incs += ' ' + env['BF_QUICKTIME_INC']
if env['WITH_BF_BULLET']:
- defs.append('WITH_BULLET')
+ defs.append('USE_BULLET')
if env['BF_NO_ELBEEM']:
defs.append('DISABLE_ELBEEM')
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 090f256ab9f..43b9a63a2c1 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -72,6 +72,7 @@
#include "BKE_modifier.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_subsurf.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
@@ -2076,7 +2077,7 @@ static void clear_mesh_caches(Object *ob)
static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
{
Object *obact = scene->basact?scene->basact->object:NULL;
- int editing = (FACESEL_PAINT_TEST)|(G.f & G_PARTICLEEDIT);
+ int editing = paint_facesel_test(ob);
int needMapping = editing && (ob==obact);
float min[3], max[3];
diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile
index a6a5066b574..6c2edc9e25f 100644
--- a/source/blender/blenkernel/intern/Makefile
+++ b/source/blender/blenkernel/intern/Makefile
@@ -41,6 +41,8 @@ CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I../../../../intern/memutil
+CPPFLAGS += -I$(NAN_AUDASPACE)/include
# Reference to the types in makesdna and imbuf
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../makesrna
@@ -49,6 +51,7 @@ CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../python
+CPPFLAGS += -I../../blenfont
# also avi is used
CPPFLAGS += -I../../avi
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
@@ -68,6 +71,7 @@ CPPFLAGS += -I$(NAN_DECIMATION)/include
CPPFLAGS += -I$(NAN_ELBEEM)/include
CPPFLAGS += -I$(NAN_OPENNL)/include
CPPFLAGS += -I$(NAN_BSP)/include
+CPPFLAGS += -I$(NAN_SMOKE)/include
# path to zlib
CPPFLAGS += -I$(NAN_ZLIB)/include
@@ -86,6 +90,10 @@ CPPFLAGS += -I$(NAN_BULLET2)/include
CPPFLAGS += -I$(NAN_FREETYPE)/include
CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
+# lzo and lzma, for pointcache
+CPPFLAGS += -I$(NAN_LZO)/minilzo
+CPPFLAGS += -I$(NAN_LZMA)
+
ifeq ($(WITH_FFMPEG),true)
CPPFLAGS += -DWITH_FFMPEG
CPPFLAGS += $(NAN_FFMPEGCFLAGS)
@@ -107,3 +115,4 @@ ifeq ($(WITH_QUICKTIME), true)
CPPFLAGS += -I../../quicktime
CPPFLAGS += -DWITH_QUICKTIME
endif
+
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index f4d4eb1cc9c..47de044ea25 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -410,8 +410,9 @@ bActionGroup *action_groups_find_named (bAction *act, const char name[])
bPoseChannel *get_pose_channel(const bPose *pose, const char *name)
{
bPoseChannel *chan;
-
- if (pose==NULL) return NULL;
+
+ if (ELEM(NULL, pose, name) || (name[0] == 0))
+ return NULL;
for (chan=pose->chanbase.first; chan; chan=chan->next) {
if (chan->name[0] == name[0]) {
@@ -837,14 +838,15 @@ short action_has_motion(const bAction *act)
}
/* Calculate the extents of given action */
-void calc_action_range(const bAction *act, float *start, float *end, int incl_hidden)
+void calc_action_range(const bAction *act, float *start, float *end, short incl_modifiers)
{
FCurve *fcu;
float min=999999999.0f, max=-999999999.0f;
- short foundvert=0;
+ short foundvert=0, foundmod=0;
if (act) {
for (fcu= act->curves.first; fcu; fcu= fcu->next) {
+ /* if curve has keyframes, consider them first */
if (fcu->totvert) {
float nmin, nmax;
@@ -857,10 +859,53 @@ void calc_action_range(const bAction *act, float *start, float *end, int incl_hi
foundvert= 1;
}
+
+ /* if incl_modifiers is enabled, need to consider modifiers too
+ * - only really care about the last modifier
+ */
+ if ((incl_modifiers) && (fcu->modifiers.last)) {
+ FModifier *fcm= fcu->modifiers.last;
+
+ /* only use the maximum sensible limits of the modifiers if they are more extreme */
+ switch (fcm->type) {
+ case FMODIFIER_TYPE_LIMITS: /* Limits F-Modifier */
+ {
+ FMod_Limits *fmd= (FMod_Limits *)fcm->data;
+
+ if (fmd->flag & FCM_LIMIT_XMIN) {
+ min= MIN2(min, fmd->rect.xmin);
+ }
+ if (fmd->flag & FCM_LIMIT_XMAX) {
+ max= MAX2(max, fmd->rect.xmax);
+ }
+ }
+ break;
+
+ case FMODIFIER_TYPE_CYCLES: /* Cycles F-Modifier */
+ {
+ FMod_Cycles *fmd= (FMod_Cycles *)fcm->data;
+
+ if (fmd->before_mode != FCM_EXTRAPOLATE_NONE)
+ min= MINAFRAMEF;
+ if (fmd->after_mode != FCM_EXTRAPOLATE_NONE)
+ max= MAXFRAMEF;
+ }
+ break;
+
+ // TODO: function modifier may need some special limits
+
+ default: /* all other standard modifiers are on the infinite range... */
+ min= MINAFRAMEF;
+ max= MAXFRAMEF;
+ break;
+ }
+
+ foundmod= 1;
+ }
}
}
- if (foundvert) {
+ if (foundvert || foundmod) {
if(min==max) max+= 1.0f;
*start= min;
*end= max;
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index e4882d8f555..b7cc98063ed 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -71,7 +71,7 @@ static short id_has_animdata (ID *id)
switch (GS(id->name)) {
/* has AnimData */
case ID_OB:
- case ID_CU:
+ case ID_MB: case ID_CU:
case ID_KE:
case ID_PA:
case ID_MA: case ID_TE: case ID_NT:
@@ -120,8 +120,15 @@ AnimData *BKE_id_add_animdata (ID *id)
IdAdtTemplate *iat= (IdAdtTemplate *)id;
/* check if there's already AnimData, in which case, don't add */
- if (iat->adt == NULL)
- iat->adt= MEM_callocN(sizeof(AnimData), "AnimData");
+ if (iat->adt == NULL) {
+ AnimData *adt;
+
+ /* add animdata */
+ adt= iat->adt= MEM_callocN(sizeof(AnimData), "AnimData");
+
+ /* set default settings */
+ adt->act_influence= 1.0f;
+ }
return iat->adt;
}
@@ -200,12 +207,6 @@ AnimData *BKE_copy_animdata (AnimData *adt)
/* *********************************** */
/* KeyingSet API */
-/* NOTES:
- * It is very likely that there will be two copies of the api - one for internal use,
- * and one 'operator' based wrapper of the internal API, which should allow for access
- * from Python/scripts so that riggers can automate the creation of KeyingSets for their rigs.
- */
-
/* Finding Tools --------------------------- */
/* Find the first path that matches the given criteria */
@@ -238,7 +239,7 @@ KS_Path *BKE_keyingset_find_destination (KeyingSet *ks, ID *id, const char group
if ((ksp->rna_path==0) || strcmp(rna_path, ksp->rna_path))
eq_path= 0;
- /* index */
+ /* index - need to compare whole-array setting too... */
if (ksp->array_index != array_index)
eq_index= 0;
@@ -269,7 +270,7 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho
if (name)
BLI_snprintf(ks->name, 64, name);
else
- strcpy(ks->name, "Keying Set");
+ strcpy(ks->name, "KeyingSet");
ks->flag= flag;
ks->keyingflag= keyingflag;
@@ -278,7 +279,7 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho
BLI_addtail(list, ks);
/* make sure KeyingSet has a unique name (this helps with identification) */
- BLI_uniquename(list, ks, "Keying Set", ' ', offsetof(KeyingSet, name), 64);
+ BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, name), 64);
/* return new KeyingSet for further editing */
return ks;
@@ -292,18 +293,25 @@ void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name
KS_Path *ksp;
/* sanity checks */
- if ELEM(NULL, ks, rna_path)
+ if ELEM(NULL, ks, rna_path) {
+ printf("ERROR: no Keying Set and/or RNA Path to add destination with \n");
return;
+ }
/* ID is optional for relative KeyingSets, but is necessary for absolute KeyingSets */
if (id == NULL) {
- if (ks->flag & KEYINGSET_ABSOLUTE)
+ if (ks->flag & KEYINGSET_ABSOLUTE) {
+ printf("ERROR: No ID provided for absolute destination. \n");
return;
+ }
}
/* don't add if there is already a matching KS_Path in the KeyingSet */
- if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode))
+ if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode)) {
+ if (G.f & G_DEBUG)
+ printf("ERROR: destination already exists in Keying Set \n");
return;
+ }
/* allocate a new KeyingSet Path */
ksp= MEM_callocN(sizeof(KS_Path), "KeyingSet Path");
@@ -335,6 +343,21 @@ void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name
BLI_addtail(&ks->paths, ksp);
}
+/* Copy all KeyingSets in the given list */
+void BKE_keyingsets_copy(ListBase *newlist, ListBase *list)
+{
+ KeyingSet *ksn;
+ KS_Path *kspn;
+
+ BLI_duplicatelist(newlist, list);
+
+ for(ksn=newlist->first; ksn; ksn=ksn->next) {
+ BLI_duplicatelist(&ksn->paths, &ksn->paths);
+
+ for(kspn=ksn->paths.first; kspn; kspn=kspn->next)
+ kspn->rna_path= MEM_dupallocN(kspn->rna_path);
+ }
+}
/* Freeing Tools --------------------------- */
@@ -418,19 +441,19 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
switch (RNA_property_type(prop))
{
case PROP_BOOLEAN:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(&new_ptr, prop))
RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value);
else
RNA_property_boolean_set(&new_ptr, prop, (int)value);
break;
case PROP_INT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(&new_ptr, prop))
RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value);
else
RNA_property_int_set(&new_ptr, prop, (int)value);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(&new_ptr, prop))
RNA_property_float_set_index(&new_ptr, prop, array_index, value);
else
RNA_property_float_set(&new_ptr, prop, value);
@@ -1155,19 +1178,19 @@ void nladata_flush_channels (ListBase *channels)
switch (RNA_property_type(prop))
{
case PROP_BOOLEAN:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(ptr, prop))
RNA_property_boolean_set_index(ptr, prop, array_index, (int)value);
else
RNA_property_boolean_set(ptr, prop, (int)value);
break;
case PROP_INT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(ptr, prop))
RNA_property_int_set_index(ptr, prop, array_index, (int)value);
else
RNA_property_int_set(ptr, prop, (int)value);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(ptr, prop))
RNA_property_float_set_index(ptr, prop, array_index, value);
else
RNA_property_float_set(ptr, prop, value);
@@ -1190,8 +1213,12 @@ void nladata_flush_channels (ListBase *channels)
*/
static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime)
{
+ ListBase dummy_trackslist = {NULL, NULL};
+ NlaStrip dummy_strip;
+
NlaTrack *nlt;
short track_index=0;
+ short has_strips = 0;
ListBase estrips= {NULL, NULL};
ListBase echannels= {NULL, NULL};
@@ -1213,11 +1240,50 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime)
if (nlt->flag & NLATRACK_MUTED)
continue;
+ /* if this track has strips (but maybe they won't be suitable), set has_strips
+ * - used for mainly for still allowing normal action evaluation...
+ */
+ if (nlt->strips.first)
+ has_strips= 1;
+
/* otherwise, get strip to evaluate for this channel */
nes= nlastrips_ctime_get_strip(&estrips, &nlt->strips, track_index, ctime);
if (nes) nes->track= nlt;
}
+ /* add 'active' Action (may be tweaking track) as last strip to evaluate in NLA stack
+ * - only do this if we're not exclusively evaluating the 'solo' NLA-track
+ */
+ if ((adt->action) && !(adt->flag & ADT_NLA_SOLO_TRACK)) {
+ /* if there are strips, evaluate action as per NLA rules */
+ if (has_strips) {
+ /* make dummy NLA strip, and add that to the stack */
+ memset(&dummy_strip, 0, sizeof(NlaStrip));
+ dummy_trackslist.first= dummy_trackslist.last= &dummy_strip;
+
+ dummy_strip.act= adt->action;
+ dummy_strip.remap= adt->remap;
+
+ /* action range is calculated taking F-Modifiers into account (which making new strips doesn't do due to the troublesome nature of that) */
+ calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1);
+ dummy_strip.start = dummy_strip.actstart;
+ dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend);
+
+ dummy_strip.blendmode= adt->act_blendmode;
+ dummy_strip.extendmode= adt->act_extendmode;
+ dummy_strip.influence= adt->act_influence;
+
+ /* add this to our list of evaluation strips */
+ nlastrips_ctime_get_strip(&estrips, &dummy_trackslist, -1, ctime);
+ }
+ else {
+ /* special case - evaluate as if there isn't any NLA data */
+ // TODO: this is really just a stop-gap measure...
+ animsys_evaluate_action(ptr, adt->action, adt->remap, ctime);
+ return;
+ }
+ }
+
/* only continue if there are strips to evaluate */
if (estrips.first == NULL)
return;
@@ -1316,14 +1382,10 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re
/* evaluate NLA data */
if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF))
{
- /* evaluate NLA-stack */
- animsys_evaluate_nla(&id_ptr, adt, ctime);
-
- /* evaluate 'active' Action (may be tweaking track) on top of results of NLA-evaluation
- * - only do this if we're not exclusively evaluating the 'solo' NLA-track
+ /* evaluate NLA-stack
+ * - active action is evaluated as part of the NLA stack as the last item
*/
- if ((adt->action) && !(adt->flag & ADT_NLA_SOLO_TRACK))
- animsys_evaluate_action(&id_ptr, adt->action, adt->remap, ctime);
+ animsys_evaluate_nla(&id_ptr, adt, ctime);
}
/* evaluate Active Action only */
else if (adt->action)
@@ -1362,19 +1424,36 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re
* 'local' (i.e. belonging in the nearest ID-block that setting is related to, not a
* standard 'root') block are overridden by a larger 'user'
*/
-// TODO: we currently go over entire 'main' database...
+// FIXME?: we currently go over entire 'main' database...
void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
{
ID *id;
if (G.f & G_DEBUG)
printf("Evaluate all animation - %f \n", ctime);
-
- /* macro for less typing */
-#define EVAL_ANIM_IDS(first, flag) \
+
+ /* macro for less typing
+ * - only evaluate animation data for id if it has users (and not just fake ones)
+ * - whether animdata exists is checked for by the evaluation function, though taking
+ * this outside of the function may make things slightly faster?
+ */
+#define EVAL_ANIM_IDS(first, aflag) \
for (id= first; id; id= id->next) { \
AnimData *adt= BKE_animdata_from_id(id); \
- BKE_animsys_evaluate_animdata(id, adt, ctime, flag); \
+ if ( (id->us > 1) || (id->us && !(id->flag & LIB_FAKEUSER)) ) \
+ BKE_animsys_evaluate_animdata(id, adt, ctime, aflag); \
+ }
+
+ /* optimisation:
+ * when there are no actions, don't go over database and loop over heaps of datablocks,
+ * which should ultimately be empty, since it is not possible for now to have any animation
+ * without some actions, and drivers wouldn't get affected by any state changes
+ */
+ if (main->action.first == NULL) {
+ if (G.f & G_DEBUG)
+ printf("\tNo Actions, so no animation needs to be evaluated...\n");
+
+ return;
}
/* nodes */
@@ -1396,6 +1475,9 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
// TODO: we probably need the same hack as for curves (ctime-hack)
EVAL_ANIM_IDS(main->key.first, ADT_RECALC_ANIM);
+ /* metaballs */
+ EVAL_ANIM_IDS(main->mball.first, ADT_RECALC_ANIM);
+
/* curves */
/* we need to perform a special hack here to ensure that the ctime
* value of the curve gets set in case there's no animation for that
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index eb8a894e800..631bc2cb88c 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1988,9 +1988,9 @@ void chan_calc_mat(bPoseChannel *chan)
SizeToMat3(chan->size, smat);
/* rotations may either be quats or eulers (no rotation modes for now...) */
- if (chan->rotmode) {
+ if (chan->rotmode > 0) {
/* euler rotations (will cause gimble lock... no rotation order to solve that yet) */
- EulToMat3(chan->eul, rmat);
+ EulOToMat3(chan->eul, chan->rotmode, rmat);
}
else {
/* quats are normalised before use to eliminate scaling issues */
@@ -2213,7 +2213,7 @@ static void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, fl
Mat4MulSerie(pchan->pose_mat, tmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
}
else if(bone->flag & BONE_NO_SCALE) {
- float orthmat[4][4], vec[3];
+ float orthmat[4][4];
/* get the official transform, but we only use the vector from it (optimize...) */
Mat4MulSerie(pchan->pose_mat, parchan->pose_mat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 2728aa30e6e..f261b020717 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -176,8 +176,6 @@ void pushpop_test()
void free_blender(void)
{
/* samples are in a global list..., also sets G.main->sound->sample NULL */
- sound_free_all_samples();
-
free_main(G.main);
G.main= NULL;
@@ -228,7 +226,7 @@ static void clear_global(void)
G.main= NULL;
- G.f &= ~(G_WEIGHTPAINT + G_VERTEXPAINT + G_FACESELECT + G_PARTICLEEDIT);
+ G.f &= ~(G_FACESELECT);
}
/* make sure path names are correct for OS */
@@ -330,9 +328,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
MEM_freeN(bfd->user);
}
- /* samples is a global list... */
- sound_free_all_samples();
-
/* case G_FILE_NO_UI or no screens in file */
if(mode) {
/* leave entire context further unaltered? */
@@ -631,8 +626,7 @@ void BKE_write_undo(bContext *C, char *name)
}
}
-/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation
- * Note, ALWAYS call sound_initialize_sounds after BKE_undo_step() */
+/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */
void BKE_undo_step(bContext *C, int step)
{
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index d8926fc5753..5c62e434cb6 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -76,7 +76,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
Object *priority_ob = NULL;
float vec[3] = {0.0f, 0.0f, 0.0f}, loc[3] = {0.0f, 0.0f, 0.0f};
float mul = (rule->type == eBoidRuleType_Avoid ? 1.0 : -1.0);
- float priority = 0.0f, len;
+ float priority = 0.0f, len = 0.0f;
int ret = 0;
/* first find out goal/predator with highest priority */
@@ -614,7 +614,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
KDTreeNearest *ptn = NULL;
ParticleTarget *pt;
ParticleData *epars;
- ParticleData *enemy_pa;
+ ParticleData *enemy_pa = NULL;
/* friends & enemies */
float closest_enemy[3] = {0.0f,0.0f,0.0f};
float closest_dist = fbr->distance + 1.0f;
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 30a35cbe91c..bce4e1120be 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -35,6 +35,7 @@
#include "DNA_brush_types.h"
#include "DNA_color_types.h"
#include "DNA_image_types.h"
+#include "DNA_object_types.h"
#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
#include "DNA_windowmanager_types.h"
@@ -50,6 +51,7 @@
#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_main.h"
+#include "BKE_paint.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
@@ -61,7 +63,7 @@
/* Datablock add/copy/free/make_local */
-Brush *add_brush(char *name)
+Brush *add_brush(const char *name)
{
Brush *brush;
@@ -73,6 +75,8 @@ Brush *add_brush(char *name)
brush->alpha= 0.2f;
brush->size= 25;
brush->spacing= 10.0f;
+ brush->smooth_stroke_radius= 75;
+ brush->smooth_stroke_factor= 0.9;
brush->rate= 0.1f;
brush->innerradius= 0.5f;
brush->clone.alpha= 0.5;
@@ -152,7 +156,7 @@ void make_local_brush(Brush *brush)
}
for(scene= G.main->scene.first; scene; scene=scene->id.next)
- if(scene->toolsettings->imapaint.brush==brush) {
+ if(paint_brush(&scene->toolsettings->imapaint.paint)==brush) {
if(scene->id.lib) lib= 1;
else local= 1;
}
@@ -174,9 +178,9 @@ void make_local_brush(Brush *brush)
brushn->id.flag |= LIB_FAKEUSER;
for(scene= G.main->scene.first; scene; scene=scene->id.next)
- if(scene->toolsettings->imapaint.brush==brush)
+ if(paint_brush(&scene->toolsettings->imapaint.paint)==brush)
if(scene->id.lib==0) {
- scene->toolsettings->imapaint.brush= brushn;
+ paint_brush_set(&scene->toolsettings->imapaint.paint, brushn);
brushn->id.us++;
brush->id.us--;
}
@@ -185,20 +189,7 @@ void make_local_brush(Brush *brush)
/* Library Operations */
-Brush **current_brush_source(Scene *sce)
-{
- if(G.f & G_SCULPTMODE)
- return &sce->toolsettings->sculpt->brush;
- else if(G.f & G_VERTEXPAINT)
- return &sce->toolsettings->vpaint->brush;
- else if(G.f & G_WEIGHTPAINT)
- return &sce->toolsettings->wpaint->brush;
- else if(G.f & G_TEXTUREPAINT)
- return &sce->toolsettings->imapaint.brush;
- return NULL;
-}
-
-int brush_set_nr(Brush **current_brush, int nr)
+int brush_set_nr(Brush **current_brush, int nr, const char *name)
{
ID *idtest, *id;
@@ -207,7 +198,7 @@ int brush_set_nr(Brush **current_brush, int nr)
if(idtest==0) { /* new brush */
if(id) idtest= (ID *)copy_brush((Brush *)id);
- else idtest= (ID *)add_brush("Brush");
+ else idtest= (ID *)add_brush(name);
idtest->us--;
}
if(idtest!=id) {
@@ -300,6 +291,13 @@ void brush_curve_preset(Brush *b, BrushCurvePreset preset)
curvemapping_changed(b->curve, 0);
}
+static MTex *brush_active_texture(Brush *brush)
+{
+ if(brush && brush->texact >= 0)
+ return brush->mtex[brush->texact];
+ return NULL;
+}
+
int brush_texture_set_nr(Brush *brush, int nr)
{
ID *idtest, *id=NULL;
@@ -374,10 +372,10 @@ int brush_clone_image_delete(Brush *brush)
return 0;
}
-void brush_check_exists(Brush **brush)
+void brush_check_exists(Brush **brush, const char *name)
{
if(*brush==NULL)
- brush_set_nr(brush, 1);
+ brush_set_nr(brush, 1, name);
}
/* Brush Sampling */
@@ -411,23 +409,6 @@ float brush_sample_falloff(Brush *brush, float dist)
return 0.0f;
}
-float brush_sample_falloff_noalpha(Brush *brush, float dist)
-{
- float outer, inner;
-
- outer = brush->size >> 1;
- inner = outer*brush->innerradius;
-
- if (dist <= inner) {
- return 1.0f;
- }
- else if ((dist < outer) && (inner < outer)) {
- return 1.0f - sqrt((dist - inner)/(outer - inner));
- }
- else
- return 0.0f;
-}
-
void brush_sample_tex(Brush *brush, float *xy, float *rgba)
{
MTex *mtex= brush->mtex[brush->texact];
@@ -1077,8 +1058,11 @@ void brush_radial_control_invoke(wmOperator *op, Brush *br, float size_weight)
original_value = br->size * size_weight;
else if(mode == WM_RADIALCONTROL_STRENGTH)
original_value = br->alpha;
- else if(mode == WM_RADIALCONTROL_ANGLE)
- original_value = br->rot;
+ else if(mode == WM_RADIALCONTROL_ANGLE) {
+ MTex *mtex = brush_active_texture(br);
+ if(mtex)
+ original_value = mtex->rot;
+ }
RNA_float_set(op->ptr, "initial_value", original_value);
op->customdata = brush_gen_radial_control_imbuf(br);
@@ -1094,8 +1078,11 @@ int brush_radial_control_exec(wmOperator *op, Brush *br, float size_weight)
br->size = new_value * size_weight;
else if(mode == WM_RADIALCONTROL_STRENGTH)
br->alpha = new_value;
- else if(mode == WM_RADIALCONTROL_ANGLE)
- br->rot = new_value * conv;
+ else if(mode == WM_RADIALCONTROL_ANGLE) {
+ MTex *mtex = brush_active_texture(br);
+ if(mtex)
+ mtex->rot = new_value * conv;
+ }
return OPERATOR_FINISHED;
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 706eece108c..b20da0962a7 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1288,6 +1288,7 @@ typedef struct MultiresDM {
CDDerivedMesh cddm;
MultiresModifierData *mmd;
+ int local_mmd;
int lvl, totlvl;
float (*orco)[3];
@@ -1297,7 +1298,7 @@ typedef struct MultiresDM {
IndexNode *vert_face_map_mem, *vert_edge_map_mem;
int *face_offsets;
- Mesh *me;
+ Object *ob;
int modified;
void (*update)(DerivedMesh*);
@@ -1309,14 +1310,19 @@ static void MultiresDM_release(DerivedMesh *dm)
int mvert_layer;
/* Before freeing, need to update the displacement map */
- if(dm->needsFree && mrdm->modified)
- mrdm->update(dm);
+ if(dm->needsFree && mrdm->modified) {
+ /* Check that mmd still exists */
+ if(!mrdm->local_mmd && BLI_findindex(&mrdm->ob->modifiers, mrdm->mmd) < 0)
+ mrdm->mmd = NULL;
+ if(mrdm->mmd)
+ mrdm->update(dm);
+ }
/* If the MVert data is being used as the sculpt undo store, don't free it */
mvert_layer = CustomData_get_layer_index(&dm->vertData, CD_MVERT);
if(mvert_layer != -1) {
CustomDataLayer *cd = &dm->vertData.layers[mvert_layer];
- if(cd->data == mrdm->mmd->undo_verts)
+ if(mrdm->mmd && cd->data == mrdm->mmd->undo_verts)
cd->flag |= CD_FLAG_NOFREE;
}
@@ -1348,7 +1354,8 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts
dm = &mrdm->cddm.dm;
mrdm->mmd = ms->mmd;
- mrdm->me = ms->me;
+ mrdm->ob = ms->ob;
+ mrdm->local_mmd = ms->local_mmd;
if(dm) {
MDisps *disps;
@@ -1391,7 +1398,12 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts
Mesh *MultiresDM_get_mesh(DerivedMesh *dm)
{
- return ((MultiresDM*)dm)->me;
+ return get_mesh(((MultiresDM*)dm)->ob);
+}
+
+Object *MultiresDM_get_object(DerivedMesh *dm)
+{
+ return ((MultiresDM*)dm)->ob;
}
void *MultiresDM_get_orco(DerivedMesh *dm)
@@ -1428,10 +1440,11 @@ void MultiresDM_set_update(DerivedMesh *dm, void (*update)(DerivedMesh*))
ListBase *MultiresDM_get_vert_face_map(DerivedMesh *dm)
{
MultiresDM *mrdm = (MultiresDM*)dm;
+ Mesh *me = mrdm->ob->data;
if(!mrdm->vert_face_map)
- create_vert_face_map(&mrdm->vert_face_map, &mrdm->vert_face_map_mem, mrdm->me->mface,
- mrdm->me->totvert, mrdm->me->totface);
+ create_vert_face_map(&mrdm->vert_face_map, &mrdm->vert_face_map_mem, me->mface,
+ me->totvert, me->totface);
return mrdm->vert_face_map;
}
@@ -1439,10 +1452,11 @@ ListBase *MultiresDM_get_vert_face_map(DerivedMesh *dm)
ListBase *MultiresDM_get_vert_edge_map(DerivedMesh *dm)
{
MultiresDM *mrdm = (MultiresDM*)dm;
+ Mesh *me = mrdm->ob->data;
if(!mrdm->vert_edge_map)
- create_vert_edge_map(&mrdm->vert_edge_map, &mrdm->vert_edge_map_mem, mrdm->me->medge,
- mrdm->me->totvert, mrdm->me->totedge);
+ create_vert_edge_map(&mrdm->vert_edge_map, &mrdm->vert_edge_map_mem, me->medge,
+ me->totvert, me->totedge);
return mrdm->vert_edge_map;
}
@@ -1450,6 +1464,7 @@ ListBase *MultiresDM_get_vert_edge_map(DerivedMesh *dm)
int *MultiresDM_get_face_offsets(DerivedMesh *dm)
{
MultiresDM *mrdm = (MultiresDM*)dm;
+ Mesh *me = mrdm->ob->data;
int i, accum = 0;
if(!mrdm->face_offsets) {
@@ -1457,11 +1472,11 @@ int *MultiresDM_get_face_offsets(DerivedMesh *dm)
int area = len * len;
int t = 1 + len * 3 + area * 3, q = t + len + area;
- mrdm->face_offsets = MEM_callocN(sizeof(int) * mrdm->me->totface, "mrdm face offsets");
- for(i = 0; i < mrdm->me->totface; ++i) {
+ mrdm->face_offsets = MEM_callocN(sizeof(int) * me->totface, "mrdm face offsets");
+ for(i = 0; i < me->totface; ++i) {
mrdm->face_offsets[i] = accum;
- accum += (mrdm->me->mface[i].v4 ? q : t);
+ accum += (me->mface[i].v4 ? q : t);
}
}
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 089dafeb8c7..eafd9eb01fe 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -340,92 +340,6 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
}
}
-int modifiers_indexInObject(Object *ob, ModifierData *md_seek);
-static void cloth_write_state(int index, void *cloth_v, float *data)
-{
- Cloth *cloth= cloth_v;
- ClothVertex *vert = cloth->verts + index;
-
- memcpy(data, vert->x, 3 * sizeof(float));
- memcpy(data + 3, vert->xconst, 3 * sizeof(float));
- memcpy(data + 6, vert->v, 3 * sizeof(float));
-}
-static void cloth_read_state(int index, void *cloth_v, float *data)
-{
- Cloth *cloth= cloth_v;
- ClothVertex *vert = cloth->verts + index;
-
- memcpy(vert->x, data, 3 * sizeof(float));
- memcpy(vert->xconst, data + 3, 3 * sizeof(float));
- memcpy(vert->v, data + 6, 3 * sizeof(float));
-}
-static void cloth_cache_interpolate(int index, void *cloth_v, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2)
-{
- Cloth *cloth= cloth_v;
- ClothVertex *vert = cloth->verts + index;
- ParticleKey keys[4];
- float dfra;
-
- if(cfra1 == cfra2) {
- cloth_read_state(index, cloth, data1);
- return;
- }
-
- memcpy(keys[1].co, data1, 3 * sizeof(float));
- memcpy(keys[1].vel, data1 + 6, 3 * sizeof(float));
-
- memcpy(keys[2].co, data2, 3 * sizeof(float));
- memcpy(keys[2].vel, data2 + 6, 3 * sizeof(float));
-
- dfra = cfra2 - cfra1;
-
- VecMulf(keys[1].vel, dfra);
- VecMulf(keys[2].vel, dfra);
-
- psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, keys, 1);
-
- VecMulf(keys->vel, 1.0f / dfra);
-
- memcpy(vert->x, keys->co, 3 * sizeof(float));
- memcpy(vert->v, keys->vel, 3 * sizeof(float));
-
- /* not sure what to do with this - jahka */
- memcpy(vert->xconst, data1 + 3, 3 * sizeof(float));
-}
-void cloth_write_cache(Object *ob, ClothModifierData *clmd, int cfra)
-{
- PTCacheWriter writer;
- PTCacheID pid;
-
- BKE_ptcache_id_from_cloth(&pid, ob, clmd);
-
- writer.calldata = clmd->clothObject;
- writer.cfra = cfra;
- writer.set_elem = cloth_write_state;
- writer.pid = &pid;
- writer.totelem = clmd->clothObject->numverts;
-
- BKE_ptcache_write_cache(&writer);
-}
-
-int cloth_read_cache(Scene *scene, Object *ob, ClothModifierData *clmd, float cfra, int *old_framenr)
-{
- PTCacheReader reader;
- PTCacheID pid;
-
- BKE_ptcache_id_from_cloth(&pid, ob, clmd);
-
- reader.calldata = clmd->clothObject;
- reader.cfra = cfra;
- reader.interpolate_elem = cloth_cache_interpolate;
- reader.old_frame = old_framenr;
- reader.pid = &pid;
- reader.scene = scene;
- reader.set_elem = cloth_read_state;
- reader.totelem = clmd->clothObject->numverts;
-
- return BKE_ptcache_read_cache(&reader);
-}
void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr)
{
PTCacheID pid;
@@ -433,7 +347,7 @@ void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr)
BKE_ptcache_id_from_cloth(&pid, ob, clmd);
// don't do anything as long as we're in editmode!
- if(pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
+ if(pid.cache->edit && ob->mode & OB_MODE_PARTICLE_EDIT)
return;
BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_AFTER, framenr);
@@ -512,7 +426,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
PTCacheID pid;
float timescale;
int framedelta, framenr, startframe, endframe;
- int cache_result, old_framenr;
+ int cache_result;
clmd->scene= scene; /* nice to pass on later :) */
framenr= (int)scene->r.cfra;
@@ -583,7 +497,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
return result;
/* try to read from cache */
- cache_result = cloth_read_cache(scene, ob, clmd, framenr, &old_framenr);
+ cache_result = BKE_ptcache_read_cache(&pid, (float)framenr, scene->r.frs_sec);
if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
cache->flag |= PTCACHE_SIMULATION_VALID;
@@ -600,7 +514,6 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
implicit_set_positions(clmd);
cache->flag |= PTCACHE_SIMULATION_VALID;
- cache->simframe= old_framenr;
}
else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {
/* if baked and nothing in cache, do nothing */
@@ -624,7 +537,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
else {
/* if on second frame, write cache for first frame */
if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
- cloth_write_cache(ob, clmd, startframe);
+ BKE_ptcache_write_cache(&pid, startframe);
clmd->sim_parms->timescale *= framenr - cache->simframe;
@@ -638,7 +551,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
cache->last_exact= 0;
}
else
- cloth_write_cache(ob, clmd, framenr);
+ BKE_ptcache_write_cache(&pid, framenr);
cloth_to_object (ob, clmd, result);
}
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index c122145c98f..37e9c93a108 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -591,7 +591,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
ClothModifierData *clmd = ( ClothModifierData * ) md1;
CollisionModifierData *collmd = ( CollisionModifierData * ) md2;
MFace *face1=NULL, *face2 = NULL;
-#ifdef WITH_BULLET
+#ifdef USE_BULLET
ClothVertex *verts1 = clmd->clothObject->verts;
#endif
double distance = 0;
@@ -669,7 +669,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
break;
}
-#ifdef WITH_BULLET
+#ifdef USE_BULLET
// calc distance + normal
distance = plNearestPoints (
verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa,collpair->pb,collpair->vector );
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 2280ec71f7a..26f9245abc7 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -68,33 +68,33 @@
void gamma_correct_rec709(float *c, float gamma)
{
/* Rec. 709 gamma correction. */
- float cc = 0.018f;
+ const float cc = 0.018f;
if (*c < cc)
- *c *= ((1.099f * (float)pow(cc, gamma)) - 0.099f) / cc;
+ *c *= ((1.099f * (float)powf(cc, gamma)) - 0.099f) * (1.0f/cc);
else
- *c = (1.099f * (float)pow(*c, gamma)) - 0.099f;
+ *c = (1.099f * (float)powf(*c, gamma)) - 0.099f;
}
void gamma_correct(float *c, float gamma)
{
- *c = pow((*c), gamma);
+ *c = powf((*c), gamma);
}
float srgb_to_linearrgb(float c)
{
if (c < 0.04045f)
- return (c < 0.f)?0.f:c / 12.92;
+ return (c < 0.0f)? 0.0f: c*(1.0f/12.92f);
else
- return pow((c + 0.055)/1.055, 2.4);
+ return powf((c + 0.055f)*(1.0f/1.055f), 2.4f);
}
float linearrgb_to_srgb(float c)
{
- if (c < 0.0031308)
- return (c < 0.f)?0.f:c * 12.92;
+ if (c < 0.0031308f)
+ return (c < 0.0f)? 0.0f: c * 12.92f;
else
- return 1.055 * pow(c, 1.0/2.4) - 0.055;
+ return 1.055f * powf(c, 1.0f/2.4f) - 0.055f;
}
/* utility function convert an RGB triplet from sRGB to linear RGB color space */
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 88e73a00ba7..e6e65ebd614 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -121,6 +121,7 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata,
if (ob) {
cob->ob = ob;
cob->type = datatype;
+ cob->rotOrder = EULER_ORDER_DEFAULT; // TODO: when objects have rotation order too, use that
Mat4CpyMat4(cob->matrix, ob->obmat);
}
else
@@ -137,6 +138,15 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata,
cob->pchan = (bPoseChannel *)subdata;
cob->type = datatype;
+ if (cob->pchan->rotmode > 0) {
+ /* should be some type of Euler order */
+ cob->rotOrder= cob->pchan->rotmode;
+ }
+ else {
+ /* Quats, so eulers should just use default order */
+ cob->rotOrder= EULER_ORDER_DEFAULT;
+ }
+
/* matrix in world-space */
Mat4MulMat4(cob->matrix, cob->pchan->pose_mat, ob->obmat);
}
@@ -664,6 +674,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
+// TODO: cope with getting rotation order...
#define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list) \
{ \
ct= MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget"); \
@@ -687,6 +698,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
+// TODO: cope with getting rotation order...
#define SINGLETARGETNS_GET_TARS(con, datatar, ct, list) \
{ \
ct= MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget"); \
@@ -795,11 +807,11 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
/* extract components of both matrices */
VECCOPY(loc, ct->matrix[3]);
- Mat4ToEul(ct->matrix, eul);
+ Mat4ToEulO(ct->matrix, eul, ct->rotOrder);
Mat4ToSize(ct->matrix, size);
VECCOPY(loco, invmat[3]);
- Mat4ToEul(invmat, eulo);
+ Mat4ToEulO(invmat, eulo, cob->rotOrder);
Mat4ToSize(invmat, sizo);
/* disable channels not enabled */
@@ -814,8 +826,8 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
if (!(data->flag & CHILDOF_SIZEZ)) size[2]= sizo[2]= 1.0f;
/* make new target mat and offset mat */
- LocEulSizeToMat4(ct->matrix, loc, eul, size);
- LocEulSizeToMat4(invmat, loco, eulo, sizo);
+ LocEulOSizeToMat4(ct->matrix, loc, eul, size, ct->rotOrder);
+ LocEulOSizeToMat4(invmat, loco, eulo, sizo, cob->rotOrder);
/* multiply target (parent matrix) by offset (parent inverse) to get
* the effect of the parent that will be exherted on the owner
@@ -1304,7 +1316,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
VECCOPY(loc, cob->matrix[3]);
Mat4ToSize(cob->matrix, size);
- Mat4ToEul(cob->matrix, eul);
+ Mat4ToEulO(cob->matrix, eul, cob->rotOrder);
/* eulers: radians to degrees! */
eul[0] = (float)(eul[0] / M_PI * 180);
@@ -1339,7 +1351,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
eul[1] = (float)(eul[1] / 180 * M_PI);
eul[2] = (float)(eul[2] / 180 * M_PI);
- LocEulSizeToMat4(cob->matrix, loc, eul, size);
+ LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
}
static bConstraintTypeInfo CTI_ROTLIMIT = {
@@ -1546,14 +1558,15 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
VECCOPY(loc, cob->matrix[3]);
Mat4ToSize(cob->matrix, size);
- Mat4ToEul(ct->matrix, eul);
- Mat4ToEul(cob->matrix, obeul);
+ //Mat4ToEulO(ct->matrix, eul, ct->rotOrder);
+ Mat4ToEul(ct->matrix, eul); // the version we should be using causes errors...
+ Mat4ToEulO(cob->matrix, obeul, cob->rotOrder);
if ((data->flag & ROTLIKE_X)==0)
eul[0] = obeul[0];
else {
if (data->flag & ROTLIKE_OFFSET)
- euler_rot(eul, obeul[0], 'x');
+ eulerO_rot(eul, obeul[0], 'x', cob->rotOrder);
if (data->flag & ROTLIKE_X_INVERT)
eul[0] *= -1;
@@ -1563,7 +1576,7 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
eul[1] = obeul[1];
else {
if (data->flag & ROTLIKE_OFFSET)
- euler_rot(eul, obeul[1], 'y');
+ eulerO_rot(eul, obeul[1], 'y', cob->rotOrder);
if (data->flag & ROTLIKE_Y_INVERT)
eul[1] *= -1;
@@ -1573,14 +1586,14 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
eul[2] = obeul[2];
else {
if (data->flag & ROTLIKE_OFFSET)
- euler_rot(eul, obeul[2], 'z');
+ eulerO_rot(eul, obeul[2], 'z', cob->rotOrder);
if (data->flag & ROTLIKE_Z_INVERT)
eul[2] *= -1;
}
compatible_eul(eul, obeul);
- LocEulSizeToMat4(cob->matrix, loc, eul, size);
+ LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
}
}
@@ -3036,7 +3049,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
Mat4ToSize(ct->matrix, dvec);
break;
case 1: /* rotation (convert to degrees first) */
- Mat4ToEul(ct->matrix, dvec);
+ Mat4ToEulO(ct->matrix, dvec, cob->rotOrder);
for (i=0; i<3; i++)
dvec[i] = (float)(dvec[i] / M_PI * 180);
break;
@@ -3047,7 +3060,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
/* extract components of owner's matrix */
VECCOPY(loc, cob->matrix[3]);
- Mat4ToEul(cob->matrix, eul);
+ Mat4ToEulO(cob->matrix, eul, cob->rotOrder);
Mat4ToSize(cob->matrix, size);
/* determine where in range current transforms lie */
@@ -3102,7 +3115,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
}
/* apply to matrix */
- LocEulSizeToMat4(cob->matrix, loc, eul, size);
+ LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
}
}
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 78c29a96bff..bbfe077c15e 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -34,6 +34,7 @@
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "DNA_windowmanager_types.h"
+#include "DNA_object_types.h"
#include "RNA_access.h"
@@ -43,6 +44,7 @@
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_screen.h"
+#include "BKE_global.h"
#include <string.h>
@@ -217,7 +219,10 @@ struct ARegion *CTX_wm_menu(const bContext *C)
struct ReportList *CTX_wm_reports(const bContext *C)
{
- return &(C->wm.manager->reports);
+ if (C->wm.manager)
+ return &(C->wm.manager->reports);
+
+ return NULL;
}
View3D *CTX_wm_view3d(const bContext *C)
@@ -333,6 +338,13 @@ struct SpaceInfo *CTX_wm_space_info(const bContext *C)
return NULL;
}
+struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C)
+{
+ if(C->wm.area && C->wm.area->spacetype==SPACE_USERPREF)
+ return C->wm.area->spacedata.first;
+ return NULL;
+}
+
void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
{
C->wm.manager= wm;
@@ -656,6 +668,69 @@ Scene *CTX_data_scene(const bContext *C)
return C->data.scene;
}
+int CTX_data_mode_enum(const bContext *C)
+{
+ Object *obedit= CTX_data_edit_object(C);
+
+ if(obedit) {
+ switch(obedit->type) {
+ case OB_MESH:
+ return CTX_MODE_EDIT_MESH;
+ case OB_CURVE:
+ return CTX_MODE_EDIT_CURVE;
+ case OB_SURF:
+ return CTX_MODE_EDIT_SURFACE;
+ case OB_FONT:
+ return CTX_MODE_EDIT_TEXT;
+ case OB_ARMATURE:
+ return CTX_MODE_EDIT_ARMATURE;
+ case OB_MBALL:
+ return CTX_MODE_EDIT_METABALL;
+ case OB_LATTICE:
+ return CTX_MODE_EDIT_LATTICE;
+ }
+ }
+ else {
+ Object *ob = CTX_data_active_object(C);
+
+ if(ob) {
+ if(ob->mode & OB_MODE_POSE) return CTX_MODE_POSE;
+ else if(ob->mode & OB_MODE_SCULPT) return CTX_MODE_SCULPT;
+ else if(ob->mode & OB_MODE_WEIGHT_PAINT) return CTX_MODE_PAINT_WEIGHT;
+ else if(ob->mode & OB_MODE_VERTEX_PAINT) return CTX_MODE_PAINT_VERTEX;
+ else if(ob->mode & OB_MODE_TEXTURE_PAINT) return CTX_MODE_PAINT_TEXTURE;
+ else if(ob->mode & OB_MODE_PARTICLE_EDIT) return CTX_MODE_PARTICLE;
+ }
+ }
+
+ return CTX_MODE_OBJECT;
+}
+
+
+/* would prefer if we can use the enum version below over this one - Campbell */
+/* must be aligned with above enum */
+static char *data_mode_strings[] = {
+ "mesh_edit",
+ "curve_edit",
+ "surface_edit",
+ "text_edit",
+ "armature_edit",
+ "mball_edit",
+ "lattice_edit",
+ "posemode",
+ "sculpt_mode",
+ "weightpaint",
+ "vertexpaint",
+ "texturepaint",
+ "particlemode",
+ "objectmode",
+ 0
+};
+char *CTX_data_mode_string(const bContext *C)
+{
+ return data_mode_strings[CTX_data_mode_enum(C)];
+}
+
void CTX_data_scene_set(bContext *C, Scene *scene)
{
C->data.scene= scene;
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index cdf4b90cee1..069129c15da 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -315,6 +315,9 @@ static void init_fastshade_shadeinput(Render *re)
static Render *fastshade_get_render(Scene *scene)
{
+ // XXX 2.5: this crashes combined with previewrender
+ // due to global R so disabled for now
+#if 0
/* XXX ugly global still, but we can't do preview while rendering */
if(G.rendering==0) {
@@ -326,6 +329,7 @@ static Render *fastshade_get_render(Scene *scene)
}
return re;
}
+#endif
return NULL;
}
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c
index bc9a0ee99c1..8827897a509 100644
--- a/source/blender/blenkernel/intern/exotic.c
+++ b/source/blender/blenkernel/intern/exotic.c
@@ -334,7 +334,7 @@ static void read_stl_mesh_ascii(Scene *scene, char *str)
*/
numtenthousand = 1;
vertdata = malloc(numtenthousand*3*30000*sizeof(float)); // uses realloc!
- if (!vertdata); STLALLOCERROR;
+ if (!vertdata) { STLALLOCERROR; }
linenum = 1;
/* Get rid of the first line */
@@ -357,7 +357,7 @@ static void read_stl_mesh_ascii(Scene *scene, char *str)
++numtenthousand;
vertdata = realloc(vertdata,
numtenthousand*3*30000*sizeof(float));
- if (!vertdata); STLALLOCERROR;
+ if (!vertdata) { STLALLOCERROR; }
}
/* Don't read normal, but check line for proper syntax anyway
@@ -1687,7 +1687,7 @@ static void displist_to_objects(Scene *scene, ListBase *lbase)
if(totvert==0) {
- if(ivsurf==0) ; //XXX error("Found no data");
+ if(ivsurf==0) {}; //XXX error("Found no data");
if(lbase->first) BLI_freelistN(lbase);
return;
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index ebd94b94f8c..31f6e2c6067 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -698,19 +698,19 @@ float driver_get_target_value (ChannelDriver *driver, DriverTarget *dtar)
if (RNA_path_resolve(&id_ptr, path, &ptr, &prop)) {
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(&ptr, prop))
value= (float)RNA_property_boolean_get_index(&ptr, prop, index);
else
value= (float)RNA_property_boolean_get(&ptr, prop);
break;
case PROP_INT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(&ptr, prop))
value= (float)RNA_property_int_get_index(&ptr, prop, index);
else
value= (float)RNA_property_int_get(&ptr, prop);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(&ptr, prop))
value= RNA_property_float_get_index(&ptr, prop, index);
else
value= RNA_property_float_get(&ptr, prop);
@@ -722,6 +722,8 @@ float driver_get_target_value (ChannelDriver *driver, DriverTarget *dtar)
break;
}
}
+ else if (G.f & G_DEBUG)
+ printf("Driver Evaluation Error: cannot resolve target for %s -> %s \n", id->name, path);
return value;
}
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index dd8f44c71d5..43c4137e73e 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -214,6 +214,11 @@ bGPdata *gpencil_data_addnew (char name[])
/* initial settings */
gpd->flag = (GP_DATA_DISPINFO|GP_DATA_EXPAND);
+ /* for now, stick to view is also enabled by default
+ * since this is more useful...
+ */
+ gpd->flag |= GP_DATA_VIEWALIGN;
+
return gpd;
}
@@ -308,7 +313,7 @@ bGPdata *gpencil_data_duplicate (bGPdata *src)
void gpencil_frame_delete_laststroke (bGPDlayer *gpl, bGPDframe *gpf)
{
bGPDstroke *gps= (gpf) ? gpf->strokes.last : NULL;
- int cfra = 1; // XXX FIXME!!!
+ int cfra = (gpf) ? gpf->framenum : 0; /* assume that the current frame was not locked */
/* error checking */
if (ELEM(NULL, gpf, gps))
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 54366aadd92..3cff82f522a 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -167,7 +167,7 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
for (i=newlen; i<prop->len; i++) {
IDP_FreeProperty(GETPROP(prop, i));
}
- memcpy(newarr, prop->data.pointer, newlen*prop->len*sizeof(IDProperty));
+ memcpy(newarr, prop->data.pointer, newlen*sizeof(IDProperty));
}
if(prop->data.pointer)
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index b66213ffbc2..f99e330939d 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -73,6 +73,8 @@
//XXX #include "BIF_editseq.h"
+#include "BLF_api.h"
+
#include "PIL_time.h"
#include "RE_pipeline.h"
@@ -978,7 +980,6 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
if (do_prefix) strcpy(stamp_data->file, "File <untitled>");
else strcpy(stamp_data->file, "<untitled>");
}
- stamp_data->note[0] = '\0';
} else {
stamp_data->file[0] = '\0';
}
@@ -1046,8 +1047,8 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
if (scene->r.stamp & R_STAMP_FRAME) {
char format[32];
- if (do_prefix) sprintf(format, "Frame %%0%di\n", 1 + (int) log10(scene->r.efra));
- else sprintf(format, "%%0%di\n", 1 + (int) log10(scene->r.efra));
+ if (do_prefix) sprintf(format, "Frame %%0%di", 1 + (int) log10(scene->r.efra));
+ else sprintf(format, "%%0%di", 1 + (int) log10(scene->r.efra));
sprintf (stamp_data->frame, format, scene->r.cfra);
} else {
stamp_data->frame[0] = '\0';
@@ -1083,131 +1084,172 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
}
}
+// XXX - Bad level call.
+extern int datatoc_bmonofont_ttf_size;
+extern char datatoc_bmonofont_ttf[];
+
+// XXX - copied from text_font_begin
+static void stamp_font_begin(int size)
+{
+ static int mono= -1;
+
+ if (mono == -1)
+ mono= BLF_load_mem("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
+
+ BLF_set(mono);
+ BLF_aspect(1.0);
+ BLF_size(size, 72);
+}
+
void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, int height, int channels)
{
-#if 0
-// XXX
-// This go back when BLF_draw_buffer is implemented - Diego
struct StampData stamp_data;
-
- int x=1,y=1;
- int font_height;
- int text_width;
- int text_pad;
- struct BMF_Font *font;
+ float w, h, pad;
+ int x, y;
if (!rect && !rectf)
return;
stampdata(scene, &stamp_data, 1);
-
- switch (scene->r.stamp_font_id) {
- case 1: /* tiny */
- font = BMF_GetFont(BMF_kHelveticaBold8);
- break;
- case 2: /* small */
- font = BMF_GetFont(BMF_kHelveticaBold10);
- break;
- case 3: /* medium */
- font = BMF_GetFont(BMF_kScreen12);
- break;
- case 0: /* large - default */
- font = BMF_GetFont(BMF_kScreen15);
- break;
- case 4: /* huge */
- font = BMF_GetFont(BMF_kHelveticaBold14);
- break;
- default:
- font = NULL;
- break;
- }
-
- font_height = BMF_GetFontHeight(font);
- /* All texts get halfspace+1 pixel on each side and 1 pix
- above and below as padding against their backing rectangles */
- text_pad = BMF_GetStringWidth(font, " ");
-
- x = 1; /* Inits for everyone, text position, so 1 for padding, not 0 */
- y = height - font_height - 1; /* Also inits for everyone, notice padding pixel */
-
+ stamp_font_begin(12);
+
+ BLF_buffer(rectf, rect, width, height, channels);
+ BLF_buffer_col(scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0);
+ pad= BLF_width("--");
+
+ x= 0;
+ y= height;
+
if (stamp_data.file[0]) {
/* Top left corner */
- text_width = BMF_GetStringWidth(font, stamp_data.file);
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.file, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
- y -= font_height+2; /* Top and bottom 1 pix padding each */
+ BLF_width_and_height(stamp_data.file, &w, &h);
+ y -= h;
+
+ /* also a little of space to the background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+3);
+
+ /* and draw the text. */
+ BLF_position(x, y, 0.0);
+ BLF_draw_buffer(stamp_data.file);
+
+ /* the extra pixel for background. */
+ y -= 4;
}
/* Top left corner, below File */
if (stamp_data.note[0]) {
- text_width = BMF_GetStringWidth(font, stamp_data.note);
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.note, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
- y -= font_height+2; /* Top and bottom 1 pix padding each */
+ BLF_width_and_height(stamp_data.note, &w, &h);
+ y -= h;
+
+ /* and space for background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-2, w+3, y+h+2);
+
+ BLF_position(x, y+1, 0.0);
+ BLF_draw_buffer(stamp_data.note);
+
+ /* the extra pixel for background. */
+ y -= 4;
}
/* Top left corner, below File (or Note) */
if (stamp_data.date[0]) {
- text_width = BMF_GetStringWidth(font, stamp_data.date);
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.date, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
+ BLF_width_and_height(stamp_data.date, &w, &h);
+ y -= h;
+
+ /* and space for background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+
+ BLF_position(x, y, 0.0);
+ BLF_draw_buffer(stamp_data.date);
}
+ x= 0;
+ y= 0;
+
/* Bottom left corner, leaving space for timing */
if (stamp_data.marker[0]) {
- x = 1;
- y = font_height+2+1; /* 2 for padding in TIME|FRAME fields below and 1 for padding in this one */
- text_width = BMF_GetStringWidth(font, stamp_data.marker);
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.marker, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
+ BLF_width_and_height(stamp_data.marker, &w, &h);
+
+ /* extra space for background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+3);
+
+ /* and pad the text. */
+ BLF_position(x, y+3, 0.0);
+ BLF_draw_buffer(stamp_data.marker);
+
+ /* space width. */
+ x += w + pad;
}
/* Left bottom corner */
if (stamp_data.time[0]) {
- x = 1;
- y = 1;
- text_width = BMF_GetStringWidth(font, stamp_data.time);
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.time, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
- x += text_width+text_pad+2; /* Both sides have 1 pix additional padding each */
+ BLF_width_and_height(stamp_data.time, &w, &h);
+
+ /* extra space for background */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+
+ /* and pad the text. */
+ BLF_position(x, y+3, 0.0);
+ BLF_draw_buffer(stamp_data.time);
+
+ /* space width. */
+ x += w + pad;
}
if (stamp_data.frame[0]) {
- text_width = BMF_GetStringWidth(font, stamp_data.frame);
- /* Left bottom corner (after SMPTE if exists) */
- if (!stamp_data.time[0]) x = 1;
- y = 1;
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.frame, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
+ BLF_width_and_height(stamp_data.frame, &w, &h);
+
+ /* extra space for background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+
+ /* and pad the text. */
+ BLF_position(x, y+3, 0.0);
+
+ BLF_draw_buffer(stamp_data.frame);
+
+ /* space width. */
+ x += w + pad;
}
if (stamp_data.camera[0]) {
- text_width = BMF_GetStringWidth(font, stamp_data.camera);
- /* Center of bottom edge */
- x = (width/2) - (BMF_GetStringWidth(font, stamp_data.camera)/2);
- y = 1;
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.camera, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
+ BLF_width_and_height(stamp_data.camera, &w, &h);
+
+ /* extra space for background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ BLF_position(x, y+3, 0.0);
+ BLF_draw_buffer(stamp_data.camera);
}
if (stamp_data.scene[0]) {
- text_width = BMF_GetStringWidth(font, stamp_data.scene);
- /* Bottom right corner */
- x = width - (text_width+1+text_pad);
- y = 1;
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.scene, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
+ BLF_width_and_height(stamp_data.scene, &w, &h);
+
+ /* Bottom right corner, with an extra space because blenfont is too strict! */
+ x= width - w - 2;
+
+ /* extra space for background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+3);
+
+ /* and pad the text. */
+ BLF_position(x, y+3, 0.0);
+ BLF_draw_buffer(stamp_data.scene);
}
if (stamp_data.strip[0]) {
- text_width = BMF_GetStringWidth(font, stamp_data.strip);
- /* Top right corner */
- x = width - (text_width+1+text_pad);
- y = height - font_height - 1;
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
- BMF_DrawStringBuf(font, stamp_data.strip, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels);
- }
-#endif // 0 XXX
+ BLF_width_and_height(stamp_data.scene, &w, &h);
+
+ /* Top right corner, with an extra space because blenfont is too strict! */
+ x= width - w - pad;
+ y= height - h;
+
+ /* extra space for background. */
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+3);
+
+ BLF_position(x, y, 0.0);
+ BLF_draw_buffer(stamp_data.strip);
+ }
+
+ /* cleanup the buffer. */
+ BLF_buffer(NULL, NULL, 0, 0, 0);
}
void BKE_stamp_info(Scene *scene, struct ImBuf *ibuf)
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index cf7e486613b..2f0e0931588 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -160,7 +160,7 @@ static AdrBit2Path ma_mode_bits[]= {
// {MA_SHADOW, "shadow", 0},
// {MA_SHLESS, "shadeless", 0},
// ...
- {MA_RAYTRANSP, "raytrace_transparency.enabled", 0},
+ {MA_RAYTRANSP, "transparency", 0},
{MA_RAYMIRROR, "raytrace_mirror.enabled", 0},
// {MA_HALO, "type", MA_TYPE_HALO}
};
@@ -296,8 +296,8 @@ static char *pchan_adrcodes_to_paths (int adrcode, int *array_index)
case AC_EUL_Z:
*array_index= 2; return "euler_rotation";
- case -1: // XXX special case for rotation drivers... until eulers are added...
- *array_index= 0; return "rotation";
+ case -1: /* special case for euler-rotations used by old drivers */
+ *array_index= 0; return "euler_rotation";
case AC_LOC_X:
*array_index= 0; return "location";
@@ -1023,12 +1023,11 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
dtar->rna_path= get_rna_access(ID_PO, AC_SIZE_Z, idriver->name, NULL, &dtar->array_index);
break;
- case OB_ROT_X: /* rotation - we need to be careful with this... XXX (another reason why we need eulers) */
+ case OB_ROT_X: /* rotation - we need to be careful with this... */
case OB_ROT_Y:
case OB_ROT_Z:
{
- // XXX this is not yet a 1:1 map, since we'd need euler rotations to make this work nicely (unless we make some hacks)
- // XXX -1 here is a special hack...
+ /* -1 here, not rotation code, since old system didn't have eulers */
dtar->rna_path= get_rna_access(ID_PO, -1, idriver->name, NULL, NULL);
dtar->array_index= idriver->adrcode - OB_ROT_X;
}
@@ -1276,6 +1275,26 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
dst->vec[1][1] *= fac;
dst->vec[2][1] *= fac;
}
+
+ /* correct times for rotation drivers
+ * - need to go from degrees to radians...
+ * - there's only really 1 target to worry about
+ */
+ if (fcu->driver && fcu->driver->targets.first) {
+ DriverTarget *dtar= fcu->driver->targets.first;
+
+ /* since drivers could only be for objects, we should just check for 'rotation' being
+ * in the name of the path given
+ * - WARNING: this will break if we encounter a bone or object explictly named in that way...
+ */
+ if ((dtar && dtar->rna_path) && strstr(dtar->rna_path, "rotation")) {
+ const float fac= (float)M_PI / 180.0f;
+
+ dst->vec[0][0] *= fac;
+ dst->vec[1][0] *= fac;
+ dst->vec[2][0] *= fac;
+ }
+ }
}
/* free this data now */
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 595ba37e09c..a2fa97cabc9 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -1382,18 +1382,11 @@ int do_ob_key(Scene *scene, Object *ob)
return 1;
}
else {
-#if 0 // XXX old animation system
- // NOTE: this stuff was NEVER reliable at all...
- if(ob->ipoflag & OB_ACTION_KEY)
- do_all_object_actions(scene, ob);
- else {
- calc_ipo(key->ipo, bsystem_time(scene, ob, scene->r.cfra, 0.0));
- execute_ipo((ID *)key, key->ipo);
- }
-#endif // XXX old animation system
/* do shapekey local drivers */
float ctime= (float)scene->r.cfra; // XXX this needs to be checked
- if (G.f & G_DEBUG) printf("ob %s - do shapekey (%s) drivers \n", ob->id.name+2, key->id.name+2);
+
+ if (G.f & G_DEBUG)
+ printf("ob %s - do shapekey (%s) drivers \n", ob->id.name+2, key->id.name+2);
BKE_animsys_evaluate_animdata(&key->id, key->adt, ctime, ADT_RECALC_DRIVERS);
if(ob->type==OB_MESH) return do_mesh_key(scene, ob, ob->data);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 90ab4e05d44..3c8bf9200f8 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -567,7 +567,7 @@ void free_libblock(ListBase *lb, void *idv)
//XXX free_script((Script *)id);
break;
case ID_SO:
- sound_free_sound((bSound *)id);
+ sound_free((bSound*)id);
break;
case ID_GR:
free_group((Group *)id);
@@ -1030,6 +1030,20 @@ static void lib_indirect_test_id(ID *id)
}
}
+void tag_main(struct Main *mainvar, int tag)
+{
+ ListBase *lbarray[MAX_LIBARRAY];
+ ID *id;
+ int a;
+
+ a= set_listbasepointers(mainvar, lbarray);
+ while(a--) {
+ for(id= lbarray[a]->first; id; id= id->next) {
+ if(tag) id->flag |= LIB_DOIT;
+ else id->flag &= ~LIB_DOIT;
+ }
+ }
+}
/* if lib!=NULL, only all from lib local */
void all_local(Library *lib, int untagged_only)
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 08a19cada7d..53de570b55e 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -170,7 +170,22 @@ void init_material(Material *ma)
ma->sss_front= 1.0f;
ma->sss_back= 1.0f;
- ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR;
+ ma->vol.density = 1.0f;
+ ma->vol.emission = 0.0f;
+ ma->vol.absorption = 1.0f;
+ ma->vol.scattering = 1.0f;
+ ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f;
+ ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f;
+ ma->vol.density_scale = 1.0f;
+ ma->vol.depth_cutoff = 0.01f;
+ ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED;
+ ma->vol.stepsize = 0.2f;
+ ma->vol.shade_stepsize = 0.2f;
+ ma->vol.shade_type = MA_VOL_SHADE_SINGLE;
+ ma->vol.shadeflag |= MA_VOL_PRECACHESHADING;
+ ma->vol.precache_resolution = 50;
+
+ ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR|MA_ZTRANSP;
ma->preview = NULL;
}
@@ -678,9 +693,6 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb)
if(needtang) ma->mode |= MA_NORMAP_TANG;
else ma->mode &= ~MA_NORMAP_TANG;
- if(r_mode & R_RADIO)
- if(ma->mode & MA_RADIO) needuv= 1;
-
if(ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE)) {
needuv= 1;
if(r_mode & R_OSA) ma->texco |= TEXCO_OSA; /* for texfaces */
@@ -689,7 +701,7 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb)
/* since the raytracer doesnt recalc O structs for each ray, we have to preset them all */
if(r_mode & R_RAYTRACE) {
- if(ma->mode & (MA_RAYMIRROR|MA_RAYTRANSP|MA_SHADOW_TRA)) {
+ if((ma->mode & (MA_RAYMIRROR|MA_SHADOW_TRA)) || ((ma->mode && MA_TRANSP) && (ma->mode & MA_RAYTRANSP))) {
ma->texco |= NEED_UV|TEXCO_ORCO|TEXCO_REFL|TEXCO_NORM;
if(r_mode & R_OSA) ma->texco |= TEXCO_OSA;
}
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 74d56e81a87..3ca7dac4bc9 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -55,6 +55,7 @@
#include "BKE_main.h"
/* #include "BKE_object.h" */
+#include "BKE_animsys.h"
#include "BKE_scene.h"
#include "BKE_blender.h"
#include "BKE_library.h"
@@ -68,10 +69,10 @@
/* Global variables */
-float thresh= 0.6f;
-int totelem=0;
-MetaElem **mainb;
-octal_tree *metaball_tree = NULL;
+static float thresh= 0.6f;
+static int totelem=0;
+static MetaElem **mainb;
+static octal_tree *metaball_tree = NULL;
/* Functions */
void unlink_mball(MetaBall *mb)
@@ -90,6 +91,7 @@ void free_mball(MetaBall *mb)
{
unlink_mball(mb);
+ if(mb->adt) BKE_free_animdata((ID *)mb);
if(mb->mat) MEM_freeN(mb->mat);
if(mb->bb) MEM_freeN(mb->bb);
BLI_freelistN(&mb->elems);
@@ -278,6 +280,47 @@ int is_basis_mball(Object *ob)
return 1;
}
+/* \brief copy some properties from object to other metaball object with same base name
+ *
+ * When some properties (wiresize, threshold, update flags) of metaball are changed, then this properties
+ * are copied to all metaballs in same "group" (metaballs with same base name: MBall,
+ * MBall.001, MBall.002, etc). The most important is to copy properties to the base metaball,
+ * because this metaball influence polygonisation of metaballs. */
+void copy_mball_properties(Scene *scene, Object *active_object)
+{
+ Base *base;
+ Object *ob;
+ MetaBall *active_mball = (MetaBall*)active_object->data;
+ int basisnr, obnr;
+ char basisname[32], obname[32];
+
+ splitIDname(active_object->id.name+2, basisname, &basisnr);
+
+ /* XXX recursion check, see scene.c, just too simple code this next_object() */
+ if(F_ERROR==next_object(scene, 0, 0, 0))
+ return;
+
+ while(next_object(scene, 1, &base, &ob)) {
+ if (ob->type==OB_MBALL) {
+ if(ob!=active_object){
+ splitIDname(ob->id.name+2, obname, &obnr);
+
+ /* Object ob has to be in same "group" ... it means, that it has to have
+ * same base of its name */
+ if(strcmp(obname, basisname)==0){
+ MetaBall *mb= ob->data;
+
+ /* Copy properties from selected/edited metaball */
+ mb->wiresize= active_mball->wiresize;
+ mb->rendersize= active_mball->rendersize;
+ mb->thresh= active_mball->thresh;
+ mb->flag= active_mball->flag;
+ }
+ }
+ }
+ }
+}
+
/** \brief This function finds basic MetaBall.
*
* Basic MetaBall doesn't include any number at the end of
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index c129e8ed99b..7a0eb882083 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -58,6 +58,7 @@
#include "DNA_cloth_types.h"
#include "DNA_curve_types.h"
#include "DNA_effect_types.h"
+#include "DNA_group_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -67,6 +68,7 @@
#include "DNA_object_force.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
+#include "DNA_smoke_types.h"
#include "DNA_texture_types.h"
#include "BLI_editVert.h"
@@ -76,6 +78,7 @@
#include "BKE_main.h"
#include "BKE_anim.h"
+#include "BKE_action.h"
#include "BKE_bmesh.h"
// XXX #include "BKE_booleanops.h"
#include "BKE_cloth.h"
@@ -96,6 +99,7 @@
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
+#include "BKE_smoke.h"
#include "BKE_softbody.h"
#include "BKE_subsurf.h"
#include "BKE_texture.h"
@@ -5595,6 +5599,7 @@ static void hookModifier_copyData(ModifierData *md, ModifierData *target)
thmd->indexar = MEM_dupallocN(hmd->indexar);
memcpy(thmd->parentinv, hmd->parentinv, sizeof(hmd->parentinv));
strncpy(thmd->name, hmd->name, 32);
+ strncpy(thmd->subtarget, hmd->subtarget, 32);
}
CustomDataMask hookModifier_requiredDataMask(Object *ob, ModifierData *md)
@@ -5639,9 +5644,11 @@ static void hookModifier_updateDepgraph(ModifierData *md, DagForest *forest, Sce
if (hmd->object) {
DagNode *curNode = dag_get_node(forest, hmd->object);
-
- dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA,
- "Hook Modifier");
+
+ if (hmd->subtarget[0])
+ dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, "Hook Modifier");
+ else
+ dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA, "Hook Modifier");
}
}
@@ -5650,12 +5657,22 @@ static void hookModifier_deformVerts(
float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
{
HookModifierData *hmd = (HookModifierData*) md;
- float vec[3], mat[4][4];
+ bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget);
+ float vec[3], mat[4][4], dmat[4][4];
int i;
DerivedMesh *dm = derivedData;
-
+
+ /* get world-space matrix of target, corrected for the space the verts are in */
+ if (hmd->subtarget[0] && pchan) {
+ /* bone target if there's a matching pose-channel */
+ Mat4MulMat4(dmat, pchan->pose_mat, hmd->object->obmat);
+ }
+ else {
+ /* just object target */
+ Mat4CpyMat4(dmat, hmd->object->obmat);
+ }
Mat4Invert(ob->imat, ob->obmat);
- Mat4MulSerie(mat, ob->imat, hmd->object->obmat, hmd->parentinv,
+ Mat4MulSerie(mat, ob->imat, dmat, hmd->parentinv,
NULL, NULL, NULL, NULL, NULL);
/* vertex indices? */
@@ -5712,7 +5729,8 @@ static void hookModifier_deformVerts(
}
}
}
- } else { /* vertex group hook */
+ }
+ else if(hmd->name[0]) { /* vertex group hook */
bDeformGroup *curdef;
Mesh *me = ob->data;
int index = 0;
@@ -5787,6 +5805,79 @@ static int softbodyModifier_dependsOnTime(ModifierData *md)
return 1;
}
+/* Smoke */
+
+static void smokeModifier_initData(ModifierData *md)
+{
+ SmokeModifierData *smd = (SmokeModifierData*) md;
+
+ smd->domain = NULL;
+ smd->flow = NULL;
+ smd->coll = NULL;
+ smd->type = 0;
+ smd->time = -1;
+}
+
+static void smokeModifier_freeData(ModifierData *md)
+{
+ SmokeModifierData *smd = (SmokeModifierData*) md;
+
+ smokeModifier_free (smd);
+}
+
+static void smokeModifier_deformVerts(
+ ModifierData *md, Object *ob, DerivedMesh *derivedData,
+ float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+{
+ SmokeModifierData *smd = (SmokeModifierData*) md;
+ DerivedMesh *dm = NULL;
+
+ if(derivedData) dm = derivedData;
+ else if(ob->type == OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
+ else return;
+
+ CDDM_apply_vert_coords(dm, vertexCos);
+ CDDM_calc_normals(dm);
+
+ smokeModifier_do(smd, md->scene, ob, dm, useRenderParams, isFinalCalc);
+
+ if(dm != derivedData) dm->release(dm);
+}
+
+static int smokeModifier_dependsOnTime(ModifierData *md)
+{
+ return 1;
+}
+
+static void smokeModifier_updateDepgraph(
+ ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
+ DagNode *obNode)
+{
+ /*SmokeModifierData *smd = (SmokeModifierData *) md;
+ if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
+ {
+ if(smd->domain->fluid_group)
+ {
+ GroupObject *go = NULL;
+
+ for(go = smd->domain->fluid_group->gobject.first; go; go = go->next)
+ {
+ if(go->ob)
+ {
+ SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(go->ob, eModifierType_Smoke);
+
+ // check for initialized smoke object
+ if(smd2 && (smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+ {
+ DagNode *curNode = dag_get_node(forest, go->ob);
+ dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
+ }
+ }
+ }
+ }
+ }
+ */
+}
/* Cloth */
@@ -5796,7 +5887,7 @@ static void clothModifier_initData(ModifierData *md)
clmd->sim_parms = MEM_callocN(sizeof(ClothSimSettings), "cloth sim parms");
clmd->coll_parms = MEM_callocN(sizeof(ClothCollSettings), "cloth coll parms");
- clmd->point_cache = BKE_ptcache_add();
+ clmd->point_cache = BKE_ptcache_add(&clmd->ptcaches);
/* check for alloc failing */
if(!clmd->sim_parms || !clmd->coll_parms || !clmd->point_cache)
@@ -5875,12 +5966,13 @@ static void clothModifier_copyData(ModifierData *md, ModifierData *target)
MEM_freeN(tclmd->sim_parms);
if(tclmd->coll_parms)
MEM_freeN(tclmd->coll_parms);
- if(tclmd->point_cache)
- BKE_ptcache_free(tclmd->point_cache);
+
+ BKE_ptcache_free_list(&tclmd->ptcaches);
+ tclmd->point_cache = NULL;
tclmd->sim_parms = MEM_dupallocN(clmd->sim_parms);
tclmd->coll_parms = MEM_dupallocN(clmd->coll_parms);
- tclmd->point_cache = BKE_ptcache_copy(clmd->point_cache);
+ tclmd->point_cache = BKE_ptcache_copy_list(&tclmd->ptcaches, &clmd->ptcaches);
tclmd->clothObject = NULL;
}
@@ -5904,8 +5996,9 @@ static void clothModifier_freeData(ModifierData *md)
MEM_freeN(clmd->sim_parms);
if(clmd->coll_parms)
MEM_freeN(clmd->coll_parms);
- if(clmd->point_cache)
- BKE_ptcache_free(clmd->point_cache);
+
+ BKE_ptcache_free_list(&clmd->ptcaches);
+ clmd->point_cache = NULL;
}
}
@@ -7980,14 +8073,13 @@ static DerivedMesh *multiresModifier_applyModifier(ModifierData *md, Object *ob,
int useRenderParams, int isFinalCalc)
{
MultiresModifierData *mmd = (MultiresModifierData*)md;
- Mesh *me = get_mesh(ob);
DerivedMesh *final;
/* TODO: for now just skip a level1 mesh */
if(mmd->lvl == 1)
return dm;
- final = multires_dm_create_from_derived(mmd, dm, me, useRenderParams, isFinalCalc);
+ final = multires_dm_create_from_derived(mmd, 0, dm, ob, useRenderParams, isFinalCalc);
if(mmd->undo_signal && mmd->undo_verts && mmd->undo_verts_tot == final->getNumVerts(final)) {
int i;
MVert *dst = CDDM_get_verts(final);
@@ -8477,6 +8569,17 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
| eModifierTypeFlag_Single;
mti->deformVerts = softbodyModifier_deformVerts;
mti->dependsOnTime = softbodyModifier_dependsOnTime;
+
+ mti = INIT_TYPE(Smoke);
+ mti->type = eModifierTypeType_OnlyDeform;
+ mti->initData = smokeModifier_initData;
+ mti->freeData = smokeModifier_freeData;
+ mti->flags = eModifierTypeFlag_AcceptsMesh
+ | eModifierTypeFlag_UsesPointCache
+ | eModifierTypeFlag_Single;
+ mti->deformVerts = smokeModifier_deformVerts;
+ mti->dependsOnTime = smokeModifier_dependsOnTime;
+ mti->updateDepgraph = smokeModifier_updateDepgraph;
mti = INIT_TYPE(Cloth);
mti->type = eModifierTypeType_Nonconstructive;
@@ -8504,7 +8607,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
mti = INIT_TYPE(Surface);
mti->type = eModifierTypeType_OnlyDeform;
mti->initData = surfaceModifier_initData;
- mti->flags = eModifierTypeFlag_AcceptsMesh;
+ mti->flags = eModifierTypeFlag_AcceptsMesh|eModifierTypeFlag_NoUserAdd;
mti->dependsOnTime = surfaceModifier_dependsOnTime;
mti->freeData = surfaceModifier_freeData;
mti->deformVerts = surfaceModifier_deformVerts;
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 22a471f6521..9ba5769843f 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -204,10 +204,11 @@ static void VecAddUf(float a[3], float b[3])
a[2] += b[2];
}
-static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, int lvl, int totlvl,
+static void multires_subdisp(DerivedMesh *orig, Object *ob, DerivedMesh *final, int lvl, int totlvl,
int totsubvert, int totsubedge, int totsubface, int addverts)
{
DerivedMesh *mrdm;
+ Mesh *me = ob->data;
MultiresModifierData mmd_sub;
MVert *mvs = CDDM_get_verts(final);
MVert *mvd, *mvd_f1, *mvs_f1, *mvd_f3, *mvd_f4;
@@ -220,8 +221,9 @@ static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, in
int skip = multires_side_tot[totlvl - lvl] - 1;
int i, j, k;
+ memset(&mmd_sub, 0, sizeof(MultiresModifierData));
mmd_sub.lvl = mmd_sub.totlvl = totlvl;
- mrdm = multires_dm_create_from_derived(&mmd_sub, orig, me, 0, 0);
+ mrdm = multires_dm_create_from_derived(&mmd_sub, 1, orig, ob, 0, 0);
mvd = CDDM_get_verts(mrdm);
/* Need to map from ccg to mrdm */
@@ -394,7 +396,7 @@ static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, in
}
}
- final->needsFree = 1;
+ final->needsFree = 1;
final->release(final);
mrdm->needsFree = 1;
MultiresDM_mark_as_modified(mrdm);
@@ -465,8 +467,10 @@ void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int dista
MultiresModifierData mmd_sub;
orig = CDDM_from_mesh(me, NULL);
+ memset(&mmd_sub, 0, sizeof(MultiresModifierData));
mmd_sub.lvl = mmd_sub.totlvl = mmd->lvl;
- mrdm = multires_dm_create_from_derived(&mmd_sub, orig, me, 0, 0);
+ mmd_sub.simple = simple;
+ mrdm = multires_dm_create_from_derived(&mmd_sub, 1, orig, ob, 0, 0);
totsubvert = mrdm->getNumVerts(mrdm);
totsubedge = mrdm->getNumEdges(mrdm);
totsubface = mrdm->getNumFaces(mrdm);
@@ -495,7 +499,7 @@ void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int dista
orig = CDDM_from_mesh(me, NULL);
- multires_subdisp(orig, me, final, mmd->lvl, mmd->totlvl, totsubvert, totsubedge, totsubface, 0);
+ multires_subdisp(orig, ob, final, mmd->lvl, mmd->totlvl, totsubvert, totsubedge, totsubface, 0);
orig->needsFree = 1;
orig->release(orig);
@@ -1164,9 +1168,11 @@ static void multiresModifier_disp_run(DerivedMesh *dm, MVert *subco, int invert)
static void multiresModifier_update(DerivedMesh *dm)
{
+ Object *ob;
Mesh *me;
MDisps *mdisps;
+ ob = MultiresDM_get_object(dm);
me = MultiresDM_get_mesh(dm);
mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS);
@@ -1187,7 +1193,7 @@ static void multiresModifier_update(DerivedMesh *dm)
(includes older displacements but not new sculpts) */
mmd.totlvl = totlvl;
mmd.lvl = lvl;
- subco_dm = multires_dm_create_from_derived(&mmd, orig, me, 0, 0);
+ subco_dm = multires_dm_create_from_derived(&mmd, 1, orig, ob, 0, 0);
cur_lvl_orig_verts = CDDM_get_verts(subco_dm);
/* Subtract the original vertex cos from the new vertex cos */
@@ -1197,7 +1203,7 @@ static void multiresModifier_update(DerivedMesh *dm)
final = multires_subdisp_pre(dm, totlvl - lvl, 0);
- multires_subdisp(orig, me, final, lvl, totlvl, dm->getNumVerts(dm), dm->getNumEdges(dm),
+ multires_subdisp(orig, ob, final, lvl, totlvl, dm->getNumVerts(dm), dm->getNumEdges(dm),
dm->getNumFaces(dm), 1);
subco_dm->release(subco_dm);
@@ -1224,7 +1230,7 @@ void multires_force_update(Object *ob)
}
}
-struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, DerivedMesh *dm, Mesh *me,
+struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int local_mmd, DerivedMesh *dm, Object *ob,
int useRenderParams, int isFinalCalc)
{
SubsurfModifierData smd;
@@ -1233,7 +1239,8 @@ struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, D
int i;
ms.mmd = mmd;
- ms.me = me;
+ ms.ob = ob;
+ ms.local_mmd = local_mmd;
memset(&smd, 0, sizeof(SubsurfModifierData));
smd.levels = smd.renderLevels = mmd->lvl - 1;
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 1871ec006f4..480c79fbc1a 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -291,7 +291,7 @@ NlaStrip *add_nlastrip (bAction *act)
/* determine initial range
* - strip length cannot be 0... ever...
*/
- calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
+ calc_action_range(strip->act, &strip->actstart, &strip->actend, 0);
strip->start = strip->actstart;
strip->end = (IS_EQ(strip->actstart, strip->actend)) ? (strip->actstart + 1.0f): (strip->actend);
@@ -993,6 +993,28 @@ NlaStrip *BKE_nlastrip_find_active (NlaTrack *nlt)
return NULL;
}
+/* Make the given NLA-Strip the active one within the given block */
+void BKE_nlastrip_set_active (AnimData *adt, NlaStrip *strip)
+{
+ NlaTrack *nlt;
+ NlaStrip *nls;
+
+ /* sanity checks */
+ if (adt == NULL)
+ return;
+
+ /* loop over tracks, deactivating*/
+ for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
+ for (nls= nlt->strips.first; nls; nls= nls->next) {
+ if (nls != strip)
+ nls->flag &= ~NLASTRIP_FLAG_ACTIVE;
+ else
+ nls->flag |= NLASTRIP_FLAG_ACTIVE;
+ }
+ }
+}
+
+
/* Does the given NLA-strip fall within the given bounds (times)? */
short BKE_nlastrip_within_bounds (NlaStrip *strip, float min, float max)
{
@@ -1403,6 +1425,9 @@ void BKE_nla_action_pushdown (AnimData *adt)
// FIXME: this needs to be more automated, since user can rearrange strips
strip->extendmode= NLASTRIP_EXTEND_HOLD_FORWARD;
}
+
+ /* make strip the active one... */
+ BKE_nlastrip_set_active(adt, strip);
}
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 0f42ba0d2e2..bd6919dc115 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -950,9 +950,6 @@ bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup, ID *id)
if(ntype->initfunc!=NULL)
ntype->initfunc(node);
- if(type==TEX_NODE_OUTPUT)
- ntreeTexAssignIndex(ntree, node);
-
nodeAddSockets(node, ntype);
return node;
@@ -1021,9 +1018,6 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node, int internal)
nnode->new_node= NULL;
nnode->preview= NULL;
- if(node->type==TEX_NODE_OUTPUT)
- ntreeTexAssignIndex(ntree, node);
-
return nnode;
}
@@ -3112,3 +3106,29 @@ void free_nodesystem(void)
BLI_freelistN(&node_all_shaders);
BLI_freelistN(&node_all_textures);
}
+
+/* called from unlink_scene, when deleting a scene goes over all scenes
+ * other than the input, checks if they have render layer nodes referencing
+ * the to-be-deleted scene, and resets them to NULL. */
+
+/* XXX needs to get current scene then! */
+void clear_scene_in_nodes(Main *bmain, Scene *sce)
+{
+ Scene *sce1;
+ bNode *node;
+
+ for(sce1= bmain->scene.first; sce1; sce1=sce1->id.next) {
+ if(sce1!=sce) {
+ if(sce1->nodetree) {
+ for(node= sce1->nodetree->nodes.first; node; node= node->next) {
+ if(node->type==CMP_NODE_R_LAYERS) {
+ Scene *nodesce= (Scene *)node->id;
+
+ if (nodesce==sce) node->id = NULL;
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index e463d007a2d..1cb0abfe21c 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -91,6 +91,7 @@
#include "BKE_constraint.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
+#include "BKE_fcurve.h"
#include "BKE_group.h"
#include "BKE_icons.h"
#include "BKE_key.h"
@@ -100,6 +101,7 @@
#include "BKE_mball.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_property.h"
@@ -221,6 +223,34 @@ void object_free_display(Object *ob)
freedisplist(&ob->disp);
}
+void free_sculptsession(SculptSession **ssp)
+{
+ if(ssp && *ssp) {
+ SculptSession *ss = *ssp;
+ if(ss->projverts)
+ MEM_freeN(ss->projverts);
+
+ if(ss->fmap)
+ MEM_freeN(ss->fmap);
+
+ if(ss->fmap_mem)
+ MEM_freeN(ss->fmap_mem);
+
+ if(ss->texcache)
+ MEM_freeN(ss->texcache);
+
+ if(ss->layer_disps)
+ MEM_freeN(ss->layer_disps);
+
+ if(ss->mesh_co_orig)
+ MEM_freeN(ss->mesh_co_orig);
+
+ MEM_freeN(ss);
+
+ *ssp = NULL;
+ }
+}
+
/* do not free object itself */
void free_object(Object *ob)
{
@@ -254,6 +284,7 @@ void free_object(Object *ob)
if(ob->adt) BKE_free_animdata((ID *)ob);
if(ob->poselib) ob->poselib->id.us--;
if(ob->dup_group) ob->dup_group->id.us--;
+ if(ob->gpd) ob->gpd->id.us--;
if(ob->defbase.first)
BLI_freelistN(&ob->defbase);
if(ob->pose)
@@ -275,6 +306,10 @@ void free_object(Object *ob)
if(ob->soft) sbFree(ob->soft);
if(ob->bsoft) bsbFree(ob->bsoft);
if(ob->gpulamp.first) GPU_lamp_free(ob);
+
+ free_sculptsession(&ob->sculpt);
+
+ if(ob->pc_ids.first) BLI_freelistN(&ob->pc_ids);
}
static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Object **obpoin)
@@ -984,6 +1019,8 @@ Object *add_only_object(int type, char *name)
ob->fluidsimFlag = 0;
ob->fluidsimSettings = NULL;
+ ob->pc_ids.first = ob->pc_ids.last = NULL;
+
return ob;
}
@@ -1025,7 +1062,7 @@ SoftBody *copy_softbody(SoftBody *sb)
sbn->scratch= NULL;
- sbn->pointcache= BKE_ptcache_copy(sb->pointcache);
+ sbn->pointcache= BKE_ptcache_copy_list(&sbn->ptcaches, &sb->ptcaches);
return sbn;
}
@@ -1084,7 +1121,7 @@ ParticleSystem *copy_particlesystem(ParticleSystem *psys)
psysn->reactevents.first = psysn->reactevents.last = NULL;
psysn->renderdata = NULL;
- psysn->pointcache= BKE_ptcache_copy(psys->pointcache);
+ psysn->pointcache= BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches);
id_us_plus((ID *)psysn->part);
@@ -1210,6 +1247,9 @@ Object *copy_object(Object *ob)
copy_defgroups(&obn->defbase, &ob->defbase);
copy_constraints(&obn->constraints, &ob->constraints);
+ obn->mode = 0;
+ obn->sculpt = NULL;
+
/* increase user numbers */
id_us_plus((ID *)obn->data);
id_us_plus((ID *)obn->dup_group);
@@ -1233,7 +1273,8 @@ Object *copy_object(Object *ob)
obn->derivedFinal = NULL;
obn->gpulamp.first = obn->gpulamp.last = NULL;
-
+ obn->pc_ids.first = obn->pc_ids.last = NULL;
+
return obn;
}
@@ -1402,11 +1443,32 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
ob->parent= target->parent; /* libdata */
Mat4CpyMat4(ob->parentinv, target->parentinv);
-#if 0 // XXX old animation system
- ob->ipo= target->ipo; /* libdata */
-#endif // XXX old animation system
- /* skip constraints, constraintchannels, nla? */
+ /* copy animdata stuff - drivers only for now... */
+ if ((target->adt) && (target->adt->drivers.first)) {
+ FCurve *fcu;
+
+ /* add new animdata block */
+ ob->adt= BKE_id_add_animdata(&ob->id);
+
+ /* make a copy of all the drivers (for now), then correct any links that need fixing */
+ copy_fcurves(&ob->adt->drivers, &target->adt->drivers);
+
+ for (fcu= ob->adt->drivers.first; fcu; fcu= fcu->next) {
+ ChannelDriver *driver= fcu->driver;
+ DriverTarget *dtar;
+
+ for (dtar= driver->targets.first; dtar; dtar= dtar->next) {
+ if ((Object *)dtar->id == target)
+ dtar->id= (ID *)ob;
+ else
+ id_lib_extern((ID *)dtar->id);
+ }
+ }
+ }
+
+ /* skip constraints? */
+ // FIXME: this is considered by many as a bug
/* set object type and link to data */
ob->type= target->type;
@@ -1442,6 +1504,9 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
armature_set_id_extern(ob);
}
+
+ /* copy drawtype info */
+ ob->dt= target->dt;
}
@@ -2476,3 +2541,61 @@ int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3
return result;
}
+
+static int pc_cmp(void *a, void *b)
+{
+ LinkData *ad = a, *bd = b;
+ if((int)ad->data > (int)bd->data)
+ return 1;
+ else return 0;
+}
+
+int object_insert_ptcache(Object *ob)
+{
+ LinkData *link = NULL;
+ int i = 0;
+
+ BLI_sortlist(&ob->pc_ids, pc_cmp);
+
+ for(link=ob->pc_ids.first, i = 0; link; link=link->next, i++)
+ {
+ int index =(int)link->data;
+
+ if(i < index)
+ break;
+ }
+
+ link = MEM_callocN(sizeof(LinkData), "PCLink");
+ link->data = (void *)i;
+ BLI_addtail(&ob->pc_ids, link);
+
+ return i;
+}
+
+#if 0
+static int pc_findindex(ListBase *listbase, int index)
+{
+ LinkData *link= NULL;
+ int number= 0;
+
+ if (listbase == NULL) return -1;
+
+ link= listbase->first;
+ while (link) {
+ if ((int)link->data == index)
+ return number;
+
+ number++;
+ link= link->next;
+ }
+
+ return -1;
+}
+
+void object_delete_ptcache(Object *ob, int index)
+{
+ int list_index = pc_findindex(&ob->pc_ids, index);
+ LinkData *link = BLI_findlink(&ob->pc_ids, list_index);
+ BLI_freelinkN(&ob->pc_ids, link);
+}
+#endif
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 02b0f6a45a0..3e47c1006e5 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -123,7 +123,7 @@ int countPackedFiles(Main *bmain)
{
Image *ima;
VFont *vf;
- bSample *sample;
+ bSound *sound;
int count = 0;
// let's check if there are packed files...
@@ -135,10 +135,9 @@ int countPackedFiles(Main *bmain)
if(vf->packedfile)
count++;
- if(samples)
- for(sample=samples->first; sample; sample=sample->id.next)
- if(sample->packedfile)
- count++;
+ for(sound=bmain->sound.first; sound; sound=sound->id.next)
+ if(sound->packedfile)
+ count++;
return count;
}
@@ -208,8 +207,8 @@ void packAll(Main *bmain, ReportList *reports)
{
Image *ima;
VFont *vf;
- bSample *sample;
-
+ bSound *sound;
+
for(ima=bmain->image.first; ima; ima=ima->id.next)
if(ima->packedfile == NULL)
ima->packedfile = newPackedFile(reports, ima->name);
@@ -218,10 +217,9 @@ void packAll(Main *bmain, ReportList *reports)
if(vf->packedfile == NULL)
vf->packedfile = newPackedFile(reports, vf->name);
- if(samples)
- for(sample=samples->first; sample; sample=sample->id.next)
- if(sample->packedfile == NULL)
- sound_set_packedfile(sample, newPackedFile(reports, sample->name));
+ for(sound=bmain->sound.first; sound; sound=sound->id.next)
+ if(sound->packedfile == NULL)
+ sound->packedfile = newPackedFile(reports, sound->name);
}
@@ -360,6 +358,8 @@ int checkPackedFile(char *filename, PackedFile *pf)
}
}
}
+
+ close(file);
}
}
@@ -454,28 +454,26 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how)
return (ret_value);
}
-int unpackSample(ReportList *reports, bSample *sample, int how)
+int unpackSound(ReportList *reports, bSound *sound, int how)
{
char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX];
char *newname;
int ret_value = RET_ERROR;
- PackedFile *pf;
-
- if (sample != NULL) {
- strcpy(localname, sample->name);
+
+ if (sound != NULL) {
+ strcpy(localname, sound->name);
BLI_splitdirstring(localname, fi);
- sprintf(localname, "//samples/%s", fi);
-
- newname = unpackFile(reports, sample->name, localname, sample->packedfile, how);
+ sprintf(localname, "//sounds/%s", fi);
+
+ newname = unpackFile(reports, sound->name, localname, sound->packedfile, how);
if (newname != NULL) {
- strcpy(sample->name, newname);
+ strcpy(sound->name, newname);
MEM_freeN(newname);
- pf = sample->packedfile;
- // because samples and sounds can point to the
- // same packedfile we have to check them all
- sound_set_packedfile(sample, NULL);
- freePackedFile(pf);
+ freePackedFile(sound->packedfile);
+ sound->packedfile = 0;
+
+ sound_load(NULL, sound);
ret_value = RET_OK;
}
@@ -513,7 +511,7 @@ void unpackAll(Main *bmain, ReportList *reports, int how)
{
Image *ima;
VFont *vf;
- bSample *sample;
+ bSound *sound;
for(ima=bmain->image.first; ima; ima=ima->id.next)
if(ima->packedfile)
@@ -523,9 +521,8 @@ void unpackAll(Main *bmain, ReportList *reports, int how)
if(vf->packedfile)
unpackVFont(reports, vf, how);
- if(samples)
- for(sample=samples->first; sample; sample=sample->id.next)
- if(sample->packedfile)
- unpackSample(reports, sample, how);
+ for(sound=bmain->sound.first; sound; sound=sound->id.next)
+ if(sound->packedfile)
+ unpackSound(reports, sound, how);
}
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
new file mode 100644
index 00000000000..7c5b2b82b4b
--- /dev/null
+++ b/source/blender/blenkernel/intern/paint.c
@@ -0,0 +1,189 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_brush_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_brush.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_paint.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+const char PAINT_CURSOR_SCULPT[3] = {255, 100, 100};
+const char PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255};
+const char PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255};
+const char PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255};
+
+Paint *paint_get_active(Scene *sce)
+{
+ if(sce && sce->basact && sce->basact->object) {
+ ToolSettings *ts = sce->toolsettings;
+
+ switch(sce->basact->object->mode) {
+ case OB_MODE_SCULPT:
+ return &ts->sculpt->paint;
+ case OB_MODE_VERTEX_PAINT:
+ return &ts->vpaint->paint;
+ case OB_MODE_WEIGHT_PAINT:
+ return &ts->wpaint->paint;
+ case OB_MODE_TEXTURE_PAINT:
+ return &ts->imapaint.paint;
+ }
+ }
+
+ return NULL;
+}
+
+Brush *paint_brush(Paint *p)
+{
+ return p && p->brushes ? p->brushes[p->active_brush_index] : NULL;
+}
+
+void paint_brush_set(Paint *p, Brush *br)
+{
+ if(p && !br) {
+ /* Setting to NULL removes the current slot */
+ paint_brush_slot_remove(p);
+ }
+ else if(p) {
+ int found = 0;
+
+ if(p->brushes) {
+ int i;
+
+ /* See if there's already a slot with the brush */
+ for(i = 0; i < p->brush_count; ++i) {
+ if(p->brushes[i] == br) {
+ p->active_brush_index = i;
+ found = 1;
+ break;
+ }
+ }
+
+ }
+
+ if(!found) {
+ paint_brush_slot_add(p);
+ id_us_plus(&br->id);
+ }
+
+ /* Make sure the current slot is the new brush */
+ p->brushes[p->active_brush_index] = br;
+ }
+}
+
+static void paint_brush_slots_alloc(Paint *p, const int count)
+{
+ p->brush_count = count;
+ if(count == 0)
+ p->brushes = NULL;
+ else
+ p->brushes = MEM_callocN(sizeof(Brush*) * count, "Brush slots");
+}
+
+void paint_brush_slot_add(Paint *p)
+{
+ if(p) {
+ Brush **orig = p->brushes;
+ int orig_count = p->brushes ? p->brush_count : 0;
+
+ /* Increase size of brush slot array */
+ paint_brush_slots_alloc(p, orig_count + 1);
+ if(orig) {
+ memcpy(p->brushes, orig, sizeof(Brush*) * orig_count);
+ MEM_freeN(orig);
+ }
+
+ p->active_brush_index = orig_count;
+ }
+}
+
+void paint_brush_slot_remove(Paint *p)
+{
+ if(p && p->brushes) {
+ Brush **orig = p->brushes;
+ int src, dst;
+
+ /* Decrease size of brush slot array */
+ paint_brush_slots_alloc(p, p->brush_count - 1);
+ if(p->brushes) {
+ for(src = 0, dst = 0; dst < p->brush_count; ++src) {
+ if(src != p->active_brush_index) {
+ p->brushes[dst] = orig[src];
+ ++dst;
+ }
+ }
+ }
+ MEM_freeN(orig);
+
+ if(p->active_brush_index >= p->brush_count)
+ p->active_brush_index = p->brush_count - 1;
+ if(p->active_brush_index < 0)
+ p->active_brush_index = 0;
+ }
+}
+
+int paint_facesel_test(Object *ob)
+{
+ return (G.f&G_FACESELECT) && (ob && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)));
+
+}
+
+void paint_init(Paint *p, const char col[3])
+{
+ Brush *brush;
+
+ /* If there's no brush, create one */
+ brush = paint_brush(p);
+ brush_check_exists(&brush, "Brush");
+ paint_brush_set(p, brush);
+
+ memcpy(p->paint_cursor_col, col, 3);
+ p->paint_cursor_col[3] = 128;
+}
+
+void free_paint(Paint *paint)
+{
+ if(paint->brushes)
+ MEM_freeN(paint->brushes);
+}
+
+void copy_paint(Paint *orig, Paint *new)
+{
+ if(orig->brushes) {
+ int i;
+ new->brushes = MEM_dupallocN(orig->brushes);
+ for(i = 0; i < orig->brush_count; ++i)
+ id_us_plus((ID *)new->brushes[i]);
+ }
+}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index e4f8a484061..18e3512967a 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -321,7 +321,7 @@ int psys_ob_has_hair(Object *ob)
}
int psys_in_edit_mode(Scene *scene, ParticleSystem *psys)
{
- return ((G.f & G_PARTICLEEDIT) && psys==psys_get_current((scene->basact)->object) && psys->edit);
+ return (scene->basact && (scene->basact->object->mode & OB_MODE_PARTICLE_EDIT) && psys==psys_get_current((scene->basact)->object) && (psys->edit || psys->pointcache->edit));
}
int psys_check_enabled(Object *ob, ParticleSystem *psys)
{
@@ -406,13 +406,20 @@ void free_child_path_cache(ParticleSystem *psys)
psys->childcache = NULL;
psys->totchildcache = 0;
}
-void psys_free_path_cache(ParticleSystem *psys)
+void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit)
{
- psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs);
- psys->pathcache= NULL;
- psys->totcached= 0;
+ if(edit) {
+ psys_free_path_cache_buffers(edit->pathcache, &edit->pathcachebufs);
+ edit->pathcache= NULL;
+ edit->totcached= 0;
+ }
+ else {
+ psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs);
+ psys->pathcache= NULL;
+ psys->totcached= 0;
- free_child_path_cache(psys);
+ free_child_path_cache(psys);
+ }
}
void psys_free_children(ParticleSystem *psys)
{
@@ -431,17 +438,14 @@ void psys_free(Object *ob, ParticleSystem * psys)
int nr = 0;
ParticleSystem * tpsys;
- if(ob->particlesystem.first == NULL && G.f & G_PARTICLEEDIT)
- G.f &= ~G_PARTICLEEDIT;
-
- psys_free_path_cache(psys);
+ psys_free_path_cache(psys, NULL);
free_hair(psys, 1);
free_keyed_keys(psys);
if(psys->edit && psys->free_edit)
- psys->free_edit(psys);
+ psys->free_edit(psys->edit);
if(psys->particles){
if(psys->particles->boid)
@@ -484,8 +488,8 @@ void psys_free(Object *ob, ParticleSystem * psys)
if(psys->reactevents.first)
BLI_freelistN(&psys->reactevents);
- if(psys->pointcache)
- BKE_ptcache_free(psys->pointcache);
+ BKE_ptcache_free_list(&psys->ptcaches);
+ psys->pointcache = NULL;
if(psys->targets.first)
BLI_freelistN(&psys->targets);
@@ -648,7 +652,7 @@ void psys_render_restore(Object *ob, ParticleSystem *psys)
psmd->dm->release(psmd->dm);
}
- psys_free_path_cache(psys);
+ psys_free_path_cache(psys, NULL);
if(psys->child){
MEM_freeN(psys->child);
@@ -956,17 +960,25 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic
typedef struct ParticleInterpolationData {
- ParticleKey *kkey[2];
HairKey *hkey[2];
- BodyPoint *bp[2];
+
+ int keyed;
+ ParticleKey *kkey[2];
+
SoftBody *soft;
- int keyed, cached;
+ BodyPoint *bp[2];
+
+ PointCache *cache;
+
+ PTCacheEditPoint *epoint;
+ PTCacheEditKey *ekey[2];
+
float birthtime, dietime;
+ int bspline;
} ParticleInterpolationData;
/* Assumes pointcache->mem_cache exists, so for disk cached particles call psys_make_temp_pointcache() before use */
-static void get_pointcache_keys_for_time(Object *ob, ParticleSystem *psys, int index, float t, ParticleKey *key1, ParticleKey *key2)
+static void get_pointcache_keys_for_time(Object *ob, PointCache *cache, int index, float t, ParticleKey *key1, ParticleKey *key2)
{
- PointCache *cache = psys->pointcache;
static PTCacheMem *pm = NULL; /* not thread safe */
if(index < 0) { /* initialize */
@@ -980,35 +992,40 @@ static void get_pointcache_keys_for_time(Object *ob, ParticleSystem *psys, int i
while(pm && pm->next && (float)pm->frame < t)
pm = pm->next;
- copy_particle_key(key2, ((ParticleKey *)pm->data) + index, 1);
- copy_particle_key(key1, ((ParticleKey *)(pm->prev)->data) + index, 1);
+ BKE_ptcache_make_particle_key(key2, pm->index_array ? pm->index_array[index] : index, pm->data, (float)pm->frame);
+ BKE_ptcache_make_particle_key(key1, pm->prev->index_array ? pm->prev->index_array[index] : index, pm->prev->data, (float)pm->prev->frame);
}
else if(cache->mem_cache.first) {
PTCacheMem *pm2 = cache->mem_cache.first;
- copy_particle_key(key2, ((ParticleKey *)pm2->data) + index, 1);
- copy_particle_key(key1, ((ParticleKey *)pm2->data) + index, 1);
+ BKE_ptcache_make_particle_key(key2, pm2->index_array ? pm2->index_array[index] : index, pm2->data, (float)pm2->frame);
+ copy_particle_key(key1, key2, 1);
}
}
}
static void init_particle_interpolation(Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind)
{
- if(pind->keyed) {
- pind->kkey[0] = pa->keys;
+ if(pind->epoint) {
+ PTCacheEditPoint *point = pind->epoint;
- if(pa->totkey > 1)
- pind->kkey[1] = pa->keys + 1;
- else
- pind->kkey[1] = NULL;
+ pind->ekey[0] = point->keys;
+ pind->ekey[1] = point->totkey > 1 ? point->keys + 1 : NULL;
+
+ pind->birthtime = *(point->keys->time);
+ pind->dietime = *((point->keys + point->totkey - 1)->time);
+ }
+ else if(pind->keyed) {
+ pind->kkey[0] = pa->keys;
+ pind->kkey[1] = pa->totkey > 1 ? pa->keys + 1 : NULL;
pind->birthtime = pa->keys->time;
pind->dietime = (pa->keys + pa->totkey - 1)->time;
}
- else if(pind->cached) {
- get_pointcache_keys_for_time(ob, psys, -1, 0.0f, NULL, NULL);
+ else if(pind->cache) {
+ get_pointcache_keys_for_time(ob, pind->cache, -1, 0.0f, NULL, NULL);
- pind->birthtime = pa->time;
- pind->dietime = pa->dietime;
+ pind->birthtime = pa ? pa->time : pind->cache->startframe;
+ pind->dietime = pa ? pa->dietime : pind->cache->endframe;
}
else {
pind->hkey[0] = pa->hair;
@@ -1023,6 +1040,14 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
pind->bp[1] = pind->soft->bpoint + pa->bpi + 1;
}
}
+static void edit_to_particle(ParticleKey *key, PTCacheEditKey *ekey)
+{
+ VECCOPY(key->co, ekey->co);
+ if(ekey->vel) {
+ VECCOPY(key->vel, ekey->vel);
+ }
+ key->time = *(ekey->time);
+}
static void hair_to_particle(ParticleKey *key, HairKey *hkey)
{
VECCOPY(key->co, hkey->co);
@@ -1036,11 +1061,24 @@ static void bp_to_particle(ParticleKey *key, BodyPoint *bp, HairKey *hkey)
static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData *pa, float t, float frs_sec, ParticleInterpolationData *pind, ParticleKey *result)
{
+ PTCacheEditPoint *point = pind->epoint;
ParticleKey keys[4];
+ int point_vel = (point && point->keys->vel);
float real_t, dfra, keytime;
/* interpret timing and find keys */
- if(pind->keyed) {
+ if(point) {
+ if(result->time < 0.0f)
+ real_t = -result->time;
+ else
+ real_t = *(pind->ekey[0]->time) + t * (*(pind->ekey[0][point->totkey-1].time) - *(pind->ekey[0]->time));
+
+ while(*(pind->ekey[1]->time) < real_t)
+ pind->ekey[1]++;
+
+ pind->ekey[0] = pind->ekey[1] - 1;
+ }
+ else if(pind->keyed) {
/* we have only one key, so let's use that */
if(pind->kkey[1]==NULL) {
copy_particle_key(result, pind->kkey[0], 1);
@@ -1077,7 +1115,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
pind->kkey[0] = pind->kkey[1] - 1;
}
- else if(pind->cached) {
+ else if(pind->cache) {
if(result->time < 0.0f) /* flag for time in frames */
real_t = -result->time;
else
@@ -1098,7 +1136,11 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
}
/* set actual interpolation keys */
- if(pind->soft) {
+ if(point) {
+ edit_to_particle(keys + 1, pind->ekey[0]);
+ edit_to_particle(keys + 2, pind->ekey[1]);
+ }
+ else if(pind->soft) {
pind->bp[0] = pind->bp[1] - 1;
bp_to_particle(keys + 1, pind->bp[0], pind->hkey[0]);
bp_to_particle(keys + 2, pind->bp[1], pind->hkey[1]);
@@ -1107,8 +1149,8 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
memcpy(keys + 1, pind->kkey[0], sizeof(ParticleKey));
memcpy(keys + 2, pind->kkey[1], sizeof(ParticleKey));
}
- else if(pind->cached) {
- get_pointcache_keys_for_time(NULL, psys, p, real_t, keys+1, keys+2);
+ else if(pind->cache) {
+ get_pointcache_keys_for_time(NULL, pind->cache, p, real_t, keys+1, keys+2);
}
else {
hair_to_particle(keys + 1, pind->hkey[0]);
@@ -1116,8 +1158,14 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
}
/* set secondary interpolation keys for hair */
- if(!pind->keyed && !pind->cached) {
- if(pind->soft) {
+ if(!pind->keyed && !pind->cache && !point_vel) {
+ if(point) {
+ if(pind->ekey[0] != point->keys)
+ edit_to_particle(keys, pind->ekey[0] - 1);
+ else
+ edit_to_particle(keys, pind->ekey[0]);
+ }
+ else if(pind->soft) {
if(pind->hkey[0] != pa->hair)
bp_to_particle(keys, pind->bp[0] - 1, pind->hkey[0] - 1);
else
@@ -1130,7 +1178,13 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
hair_to_particle(keys, pind->hkey[0]);
}
- if(pind->soft) {
+ if(point) {
+ if(pind->ekey[1] != point->keys + point->totkey - 1)
+ edit_to_particle(keys + 3, pind->ekey[1] + 1);
+ else
+ edit_to_particle(keys + 3, pind->ekey[1]);
+ }
+ else if(pind->soft) {
if(pind->hkey[1] != pa->hair + pa->totkey - 1)
bp_to_particle(keys + 3, pind->bp[1] + 1, pind->hkey[1] + 1);
else
@@ -1148,19 +1202,19 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
keytime = (real_t - keys[1].time) / dfra;
/* convert velocity to timestep size */
- if(pind->keyed || pind->cached){
+ if(pind->keyed || pind->cache || point_vel){
VecMulf(keys[1].vel, dfra / frs_sec);
VecMulf(keys[2].vel, dfra / frs_sec);
QuatInterpol(result->rot,keys[1].rot,keys[2].rot,keytime);
}
/* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/
- psys_interpolate_particle((pind->keyed || pind->cached) ? -1 /* signal for cubic interpolation */
- : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL)
+ psys_interpolate_particle((pind->keyed || pind->cache || point_vel) ? -1 /* signal for cubic interpolation */
+ : (pind->bspline ? KEY_BSPLINE : KEY_CARDINAL)
,keys, keytime, result, 1);
/* the velocity needs to be converted back from cubic interpolation */
- if(pind->keyed || pind->cached)
+ if(pind->keyed || pind->cache || point_vel)
VecMulf(result->vel, frs_sec / dfra);
}
/************************************************/
@@ -1613,7 +1667,7 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys)
}
}
}
- return 0;
+ return NULL;
}
/************************************************/
/* Particles on a shape */
@@ -2132,7 +2186,7 @@ int psys_threads_init_path(ParticleThread *threads, Scene *scene, float cfra, in
/*---start figuring out what is actually wanted---*/
if(psys_in_edit_mode(scene, psys))
- if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_SHOW_CHILD)==0)
+ if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0)
totchild=0;
if(totchild && part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES){
@@ -2248,7 +2302,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa,
needupdate= 0;
w= 0;
while(w<4 && cpa->pa[w]>=0) {
- if(psys->particles[cpa->pa[w]].flag & PARS_EDIT_RECALC) {
+ if(psys->edit->points[cpa->pa[w]].flag & PEP_EDIT_RECALC) {
needupdate= 1;
break;
}
@@ -2291,7 +2345,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa,
}
else{
if(ctx->editupdate && !(part->flag & PART_BRANCHING)) {
- if(!(psys->particles[cpa->parent].flag & PARS_EDIT_RECALC))
+ if(!(psys->edit->points[cpa->parent].flag & PEP_EDIT_RECALC))
return;
memset(keys, 0, sizeof(*keys)*(ctx->steps+1));
@@ -2560,24 +2614,20 @@ void psys_cache_child_paths(Scene *scene, Object *ob, ParticleSystem *psys, floa
/* -Usefull for making use of opengl vertex arrays for super fast strand drawing. */
/* -Makes child strands possible and creates them too into the cache. */
/* -Cached path data is also used to determine cut position for the editmode tool. */
-void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra, int editupdate)
+void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra)
{
- ParticleCacheKey *ca, **cache=psys->pathcache;
+ ParticleCacheKey *ca, **cache= psys->pathcache;
ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
- ParticleEditSettings *pset = &scene->toolsettings->particle;
ParticleSettings *part = psys->part;
+ ParticleEditSettings *pset = &scene->toolsettings->particle;
- ParticleData *pa;
+ ParticleData *pa = psys->particles;
ParticleKey result;
- ParticleEdit *edit = 0;
- ParticleEditKey *ekey = 0;
-
- SoftBody *soft = 0;
+ SoftBody *soft = NULL;
BodyPoint *bp[2] = {NULL, NULL};
Material *ma;
-
ParticleInterpolationData pind;
float birthtime = 0.0, dietime = 0.0;
@@ -2586,132 +2636,98 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra
float prev_tangent[3], hairmat[4][4];
float rotmat[3][3];
int k,i;
- int steps = (int)pow(2.0, (double)psys->part->draw_step);
+ int steps = (int)pow(2.0, (double)(psys->renderdata ? part->ren_step : part->draw_step));
int totpart = psys->totpart;
- float sel_col[3];
- float nosel_col[3];
float length, vec[3];
float *vg_effector= NULL, effector=0.0f;
float *vg_length= NULL, pa_length=1.0f;
int keyed, baked;
/* we don't have anything valid to create paths from so let's quit here */
- if((psys->flag & PSYS_HAIR_DONE)==0 && (psys->flag & PSYS_KEYED)==0 && (psys->pointcache->flag & PTCACHE_BAKED)==0)
+ if(!(psys->flag & PSYS_HAIR_DONE) && !(psys->flag & PSYS_KEYED) && !(psys->pointcache->flag & PTCACHE_BAKED))
return;
+ if(psys_in_edit_mode(scene, psys))
+ if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0)
+ return;
+
BLI_srandom(psys->seed);
keyed = psys->flag & PSYS_KEYED;
baked = psys->pointcache->flag & PTCACHE_BAKED;
- if(psys->renderdata) {
- steps = (int)pow(2.0, (double)psys->part->ren_step);
- }
- else if(psys_in_edit_mode(scene, psys)) {
- edit=psys->edit;
-
- //timed = edit->draw_timed;
-
- if(pset->brushtype == PE_BRUSH_WEIGHT) {
- sel_col[0] = sel_col[1] = sel_col[2] = 1.0f;
- nosel_col[0] = nosel_col[1] = nosel_col[2] = 0.0f;
- }
- else{
- sel_col[0] = (float)edit->sel_col[0] / 255.0f;
- sel_col[1] = (float)edit->sel_col[1] / 255.0f;
- sel_col[2] = (float)edit->sel_col[2] / 255.0f;
- nosel_col[0] = (float)edit->nosel_col[0] / 255.0f;
- nosel_col[1] = (float)edit->nosel_col[1] / 255.0f;
- nosel_col[2] = (float)edit->nosel_col[2] / 255.0f;
- }
- }
-
- if(editupdate && psys->pathcache && totpart == psys->totcached) {
- cache = psys->pathcache;
- }
- else {
- /* clear out old and create new empty path cache */
- psys_free_path_cache(psys);
- cache= psys_alloc_path_cache_buffers(&psys->pathcachebufs, totpart, steps+1);
- psys->pathcache= cache;
- }
+ /* clear out old and create new empty path cache */
+ psys_free_path_cache(psys, NULL);
+ cache= psys->pathcache= psys_alloc_path_cache_buffers(&psys->pathcachebufs, totpart, steps+1);
- if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE) {
+ if(psys->soft && psys->softflag & OB_SB_ENABLE) {
soft = psys->soft;
if(!soft->bpoint)
soft= NULL;
}
-
+
psys->lattice = psys_get_lattice(scene, ob, psys);
ma= give_current_material(ob, psys->part->omat);
if(ma && (psys->part->draw & PART_DRAW_MAT_COL))
VECCOPY(col, &ma->r)
-
+
if(psys->part->from!=PART_FROM_PARTICLE) {
if(!(psys->part->flag & PART_CHILD_EFFECT))
vg_effector = psys_cache_vgroup(psmd->dm, psys, PSYS_VG_EFFECTOR);
- if(!edit && !psys->totchild)
+ if(!psys->totchild)
vg_length = psys_cache_vgroup(psmd->dm, psys, PSYS_VG_LENGTH);
}
/*---first main loop: create all actual particles' paths---*/
- for(i=0,pa=psys->particles; i<totpart; i++, pa++){
- if(psys && edit==NULL && (pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST)) {
+ for(i=0; i<totpart; i++, pa++){
+ if(pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) {
if(soft)
bp[0] += pa->totkey; /* TODO use of initialized value? */
continue;
}
- if(editupdate && !(pa->flag & PARS_EDIT_RECALC)) continue;
- else memset(cache[i], 0, sizeof(*cache[i])*(steps+1));
-
- if(!edit && !psys->totchild) {
+ if(!psys->totchild) {
pa_length = 1.0f - part->randlength * 0.5 * (1.0f + pa->r_ave[0]);
if(vg_length)
pa_length *= psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_length);
}
- cache[i]->steps = steps;
+ pind.keyed = keyed;
+ pind.cache = baked ? psys->pointcache : NULL;
+ pind.soft = soft;
+ pind.epoint = NULL;
+ pind.bspline = (psys->part->flag & PART_HAIR_BSPLINE);
- if(edit)
- ekey = edit->keys[i];
+ memset(cache[i], 0, sizeof(*cache[i])*(steps+1));
+
+ cache[i]->steps = steps;
/*--get the first data points--*/
- pind.keyed = keyed;
- pind.cached = baked;
- pind.soft = soft;
init_particle_interpolation(ob, psys, pa, &pind);
-
/* hairmat is needed for for non-hair particle too so we get proper rotations */
psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
VECCOPY(rotmat[0], hairmat[2]);
VECCOPY(rotmat[1], hairmat[1]);
VECCOPY(rotmat[2], hairmat[0]);
- if(!edit) {
- if(part->draw & PART_ABS_PATH_TIME) {
- birthtime = MAX2(pind.birthtime, part->path_start);
- dietime = MIN2(pind.dietime, part->path_end);
- }
- else {
- float tb = pind.birthtime;
- birthtime = tb + part->path_start * (pind.dietime - tb);
- dietime = tb + part->path_end * (pind.dietime - tb);
- }
-
- if(birthtime >= dietime) {
- cache[i]->steps = -1;
- continue;
- }
+ if(part->draw & PART_ABS_PATH_TIME) {
+ birthtime = MAX2(pind.birthtime, part->path_start);
+ dietime = MIN2(pind.dietime, part->path_end);
+ }
+ else {
+ float tb = pind.birthtime;
+ birthtime = tb + part->path_start * (pind.dietime - tb);
+ dietime = tb + part->path_end * (pind.dietime - tb);
+ }
- dietime = birthtime + pa_length * (dietime - birthtime);
+ if(birthtime >= dietime) {
+ cache[i]->steps = -1;
+ continue;
}
- else
- /* XXX brecht: don't know if this code from 2.4 is correct
- * still, but makes hair appear again in particle mode */
- dietime= pind.hkey[0][pa->totkey-1].time;
+
+ dietime = birthtime + pa_length * (dietime - birthtime);
/*--interpolate actual path from data points--*/
for(k=0, ca=cache[i]; k<=steps; k++, ca++){
@@ -2729,40 +2745,8 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra
}
VECCOPY(ca->co, result.co);
-
- /* selection coloring in edit mode */
- if(edit){
- if(pset->brushtype==PE_BRUSH_WEIGHT){
- if(k==steps)
- VecLerpf(ca->col, nosel_col, sel_col, pind.hkey[0]->weight);
- else
- VecLerpf(ca->col, nosel_col, sel_col,
- (1.0f - keytime) * pind.hkey[0]->weight + keytime * pind.hkey[1]->weight);
- }
- else{
- if((ekey + (pind.hkey[0] - pa->hair))->flag & PEK_SELECT){
- if((ekey + (pind.hkey[1] - pa->hair))->flag & PEK_SELECT){
- VECCOPY(ca->col, sel_col);
- }
- else{
- VecLerpf(ca->col, sel_col, nosel_col, keytime);
- }
- }
- else{
- if((ekey + (pind.hkey[1] - pa->hair))->flag & PEK_SELECT){
- VecLerpf(ca->col, nosel_col, sel_col, keytime);
- }
- else{
- VECCOPY(ca->col, nosel_col);
- }
- }
- }
- }
- else{
- VECCOPY(ca->col, col);
- }
+ VECCOPY(ca->col, col);
}
-
/*--modify paths and calculate rotation & velocity--*/
@@ -2775,16 +2759,16 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra
for(k=0, ca=cache[i]; k<=steps; k++, ca++) {
/* apply effectors */
- if(!(psys->part->flag & PART_CHILD_EFFECT) && edit==0 && k)
+ if(!(psys->part->flag & PART_CHILD_EFFECT) && k)
do_path_effectors(scene, ob, psys, i, ca, k, steps, cache[i]->co, effector, dfra, cfra, &length, vec);
/* apply guide curves to path data */
- if(edit==0 && psys->effectors.first && (psys->part->flag & PART_CHILD_EFFECT)==0)
+ if(psys->effectors.first && (psys->part->flag & PART_CHILD_EFFECT)==0)
/* ca is safe to cast, since only co and vel are used */
do_guide(scene, (ParticleKey*)ca, i, (float)k/(float)steps, &psys->effectors);
/* apply lattice */
- if(psys->lattice && edit==0)
+ if(psys->lattice)
calc_latt_deform(psys->lattice, ca->co, 1.0f);
/* figure out rotation */
@@ -2813,8 +2797,8 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra
cosangle= Inpf(tangent, prev_tangent);
/* note we do the comparison on cosangle instead of
- * angle, since floating point accuracy makes it give
- * different results across platforms */
+ * angle, since floating point accuracy makes it give
+ * different results across platforms */
if(cosangle > 0.999999f) {
QUATCOPY((ca - 1)->rot, (ca - 2)->rot);
}
@@ -2859,6 +2843,124 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra
if(vg_length)
MEM_freeN(vg_length);
}
+void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cfra)
+{
+ ParticleCacheKey *ca, **cache= edit->pathcache;
+ ParticleEditSettings *pset = &scene->toolsettings->particle;
+
+ PTCacheEditPoint *point = edit->points;
+ PTCacheEditKey *ekey = NULL;
+
+ ParticleSystem *psys = edit->psys;
+ ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
+ ParticleSettings *part = psys ? psys->part : NULL;
+ ParticleData *pa = psys ? psys->particles : NULL;
+
+ ParticleInterpolationData pind;
+ ParticleKey result;
+
+ float birthtime = 0.0, dietime = 0.0;
+ float t, time = 0.0, keytime = 0.0, dfra = 1.0, frs_sec;
+ float hairmat[4][4];
+ int k,i;
+ int steps = (int)pow(2.0, (double)pset->draw_step);
+ int totpart = edit->totpoint;
+ float sel_col[3];
+ float nosel_col[3];
+
+ steps = MAX2(steps, 4);
+
+ if(!cache || edit->totpoint != edit->totcached) {
+ /* clear out old and create new empty path cache */
+ psys_free_path_cache(NULL, edit);
+ cache= edit->pathcache= psys_alloc_path_cache_buffers(&edit->pathcachebufs, totpart, steps+1);
+ }
+
+ frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f;
+
+ sel_col[0] = (float)edit->sel_col[0] / 255.0f;
+ sel_col[1] = (float)edit->sel_col[1] / 255.0f;
+ sel_col[2] = (float)edit->sel_col[2] / 255.0f;
+ nosel_col[0] = (float)edit->nosel_col[0] / 255.0f;
+ nosel_col[1] = (float)edit->nosel_col[1] / 255.0f;
+ nosel_col[2] = (float)edit->nosel_col[2] / 255.0f;
+
+ /*---first main loop: create all actual particles' paths---*/
+ for(i=0; i<totpart; i++, pa+=pa?1:0, point++){
+ if(edit->totcached && !(point->flag & PEP_EDIT_RECALC))
+ continue;
+
+ ekey = point->keys;
+
+ pind.keyed = 0;
+ pind.cache = NULL;
+ pind.soft = NULL;
+ pind.epoint = point;
+ pind.bspline = psys ? (psys->part->flag & PART_HAIR_BSPLINE) : 0;
+
+ memset(cache[i], 0, sizeof(*cache[i])*(steps+1));
+
+ cache[i]->steps = steps;
+
+ /*--get the first data points--*/
+ init_particle_interpolation(ob, psys, pa, &pind);
+
+ if(psys)
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
+
+ birthtime = pind.birthtime;
+ dietime = pind.dietime;
+
+ if(birthtime >= dietime) {
+ cache[i]->steps = -1;
+ continue;
+ }
+
+ /*--interpolate actual path from data points--*/
+ for(k=0, ca=cache[i]; k<=steps; k++, ca++){
+ time = (float)k / (float)steps;
+
+ t = birthtime + time * (dietime - birthtime);
+
+ result.time = -t;
+
+ do_particle_interpolation(psys, i, pa, t, frs_sec, &pind, &result);
+
+ /* non-hair points are allready in global space */
+ if(psys)
+ Mat4MulVecfl(hairmat, result.co);
+
+ VECCOPY(ca->co, result.co);
+
+ ca->vel[0] = ca->vel[1] = 0.0f;
+ ca->vel[1] = 1.0f;
+
+ /* selection coloring in edit mode */
+ if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT){
+ if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){
+ VECCOPY(ca->col, sel_col);
+ }
+ else{
+ keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
+ VecLerpf(ca->col, sel_col, nosel_col, keytime);
+ }
+ }
+ else{
+ if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){
+ keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
+ VecLerpf(ca->col, nosel_col, sel_col, keytime);
+ }
+ else{
+ VECCOPY(ca->col, nosel_col);
+ }
+ }
+
+ ca->time = t;
+ }
+ }
+
+ edit->totcached = totpart;
+}
/************************************************/
/* Particle Key handling */
/************************************************/
@@ -3038,7 +3140,7 @@ void object_add_particle_system(Scene *scene, Object *ob)
psys->flag &= ~PSYS_CURRENT;
psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- psys->pointcache = BKE_ptcache_add();
+ psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
BLI_addtail(&ob->particlesystem, psys);
psys->part = psys_new_settings("ParticleSettings", NULL);
@@ -3666,8 +3768,9 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i
}
pind.keyed = keyed;
- pind.cached = cached;
+ pind.cache = cached ? psys->pointcache : NULL;
pind.soft = NULL;
+ pind.epoint = NULL;
init_particle_interpolation(ob, psys, pa, &pind);
do_particle_interpolation(psys, p, pa, t, frs_sec, &pind, state);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index b5d58e9db8c..0f72c1c5866 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -127,7 +127,7 @@ void psys_reset(ParticleSystem *psys, int mode)
int i;
if(ELEM(mode, PSYS_RESET_ALL, PSYS_RESET_DEPSGRAPH)) {
- if(mode == PSYS_RESET_ALL || !(part->type == PART_HAIR && (psys->flag & PSYS_EDITED))) {
+ if(mode == PSYS_RESET_ALL || !(part->type == PART_HAIR && (psys->edit && psys->edit->edited))) {
if(psys->particles) {
if(psys->particles->keys)
MEM_freeN(psys->particles->keys);
@@ -145,6 +145,12 @@ void psys_reset(ParticleSystem *psys, int mode)
if(psys->reactevents.first)
BLI_freelistN(&psys->reactevents);
+
+ if(psys->edit && psys->free_edit) {
+ psys->free_edit(psys->edit);
+ psys->edit = NULL;
+ psys->free_edit = NULL;
+ }
}
}
else if(mode == PSYS_RESET_CACHE_MISS) {
@@ -165,7 +171,7 @@ void psys_reset(ParticleSystem *psys, int mode)
psys->totchild= 0;
/* reset path cache */
- psys_free_path_cache(psys);
+ psys_free_path_cache(psys, NULL);
/* reset point cache */
psys->pointcache->flag &= ~PTCACHE_SIMULATION_VALID;
@@ -2260,56 +2266,21 @@ void psys_get_reactor_target(Object *ob, ParticleSystem *psys, Object **target_o
void psys_make_temp_pointcache(Object *ob, ParticleSystem *psys)
{
PointCache *cache = psys->pointcache;
- PTCacheFile *pf = NULL;
- PTCacheMem *pm = NULL;
PTCacheID pid;
- int cfra, sfra = cache->startframe, efra = cache->endframe;
- int totelem = psys->totpart;
- int float_count = sizeof(ParticleKey) / sizeof(float);
- int tot = totelem * float_count;
if((cache->flag & PTCACHE_DISK_CACHE)==0 || cache->mem_cache.first)
return;
BKE_ptcache_id_from_particles(&pid, ob, psys);
- for(cfra=sfra; cfra <= efra; cfra++) {
- pf = BKE_ptcache_file_open(&pid, PTCACHE_FILE_READ, cfra);
-
- if(pf) {
- pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache temp mem");
- pm->data = MEM_callocN(sizeof(float)*tot, "Pointcache temp mem data");
-
- if(fread(pm->data, sizeof(float), tot, pf->fp)!= tot) {
- printf("Error reading from disk cache\n");
-
- MEM_freeN(pm->data);
- MEM_freeN(pm);
- BKE_ptcache_file_close(pf);
- return;
- }
-
- pm->frame = cfra;
- pm->totpoint = totelem;
-
- BLI_addtail(&cache->mem_cache, pm);
-
- BKE_ptcache_file_close(pf);
- }
- }
+ BKE_ptcache_disk_to_mem(&pid);
}
void psys_clear_temp_pointcache(ParticleSystem *psys)
{
- PTCacheMem *pm = psys->pointcache->mem_cache.first;
-
if((psys->pointcache->flag & PTCACHE_DISK_CACHE)==0)
return;
- for(; pm; pm=pm->next) {
- MEM_freeN(pm->data);
- }
-
- BLI_freelistN(&psys->pointcache->mem_cache);
+ BKE_ptcache_free_mem(&psys->pointcache->mem_cache);
}
void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
{
@@ -2318,88 +2289,6 @@ void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra
*sfra = MAX2(1, (int)part->sta);
*efra = MIN2((int)(part->end + part->lifetime + 1.0), scene->r.efra);
}
-static void particle_write_state(int index, void *psys_ptr, float *data)
-{
- ParticleSystem *psys= psys_ptr;
-
- memcpy(data, (float *)(&(psys->particles+index)->state), sizeof(ParticleKey));
-}
-static void particle_read_state(int index, void *psys_ptr, float *data)
-{
- ParticleSystem *psys= psys_ptr;
- ParticleData *pa = psys->particles + index;
- ParticleKey *key = (ParticleKey *)data;
-
- if(key->time > pa->state.time)
- copy_particle_key(&pa->prev_state, &pa->state, 1);
-
- copy_particle_key(&pa->state, key, 1);
-}
-static void particle_cache_interpolate(int index, void *psys_ptr, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2)
-{
- ParticleSystem *psys= psys_ptr;
- ParticleData *pa = psys->particles + index;
- ParticleKey keys[4];
- float dfra;
-
- cfra = MIN2(cfra, pa->dietime);
- cfra1 = MIN2(cfra1, pa->dietime);
- cfra2 = MIN2(cfra2, pa->dietime);
-
- keys[1] = *((ParticleKey*)data1);
- keys[2] = *((ParticleKey*)data2);
-
- if(cfra1 == cfra2) {
- copy_particle_key(&pa->state, &keys[1], 1);
- return;
- }
-
- dfra = cfra2 - cfra1;
-
- VecMulf(keys[1].vel, dfra / frs_sec);
- VecMulf(keys[2].vel, dfra / frs_sec);
-
- psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, &pa->state, 1);
- QuatInterpol(pa->state.rot, keys[1].rot,keys[2].rot, (cfra - cfra1) / dfra);
-
- VecMulf(pa->state.vel, frs_sec / dfra);
-
- pa->state.time = cfra;
-}
-static void write_particles_to_cache(Object *ob, ParticleSystem *psys, int cfra)
-{
- PTCacheWriter writer;
- PTCacheID pid;
-
- BKE_ptcache_id_from_particles(&pid, ob, psys);
-
- writer.calldata = psys;
- writer.cfra = cfra;
- writer.set_elem = particle_write_state;
- writer.pid = &pid;
- writer.totelem = psys->totpart;
-
- BKE_ptcache_write_cache(&writer);
-}
-
-static int get_particles_from_cache(Scene *scene, Object *ob, ParticleSystem *psys, float cfra, int *old_frame)
-{
- PTCacheReader reader;
- PTCacheID pid;
-
- BKE_ptcache_id_from_particles(&pid, ob, psys);
-
- reader.calldata = psys;
- reader.cfra = cfra;
- reader.interpolate_elem = particle_cache_interpolate;
- reader.old_frame = old_frame;
- reader.pid = &pid;
- reader.scene = scene;
- reader.set_elem = particle_read_state;
- reader.totelem = psys->totpart;
-
- return BKE_ptcache_read_cache(&reader);
-}
/************************************************/
/* Effectors */
@@ -3355,7 +3244,7 @@ static void deflect_particle(Scene *scene, Object *pob, ParticleSystemModifierDa
ParticleCollision col;
BVHTreeRayHit hit;
float ray_dir[3], zerovec[3]={0.0,0.0,0.0};
- float radius = ((part->flag & PART_SIZE_DEFL)?pa->size:0.0f), boid_z;
+ float radius = ((part->flag & PART_SIZE_DEFL)?pa->size:0.0f), boid_z = 0.0f;
int deflections=0, max_deflections=10;
VECCOPY(col.co1, pa->prev_state.co);
@@ -3843,7 +3732,7 @@ static void psys_update_path_cache(Scene *scene, Object *ob, ParticleSystemModif
if((psys->part->childtype && psys->totchild != get_psys_tot_child(scene, psys)) || psys->recalc&PSYS_RECALC_RESET)
alloc=1;
- if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (G.f & G_WEIGHTPAINT)))
+ if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (ob && ob->mode & OB_MODE_WEIGHT_PAINT)))
distr=1;
if(distr){
@@ -3864,41 +3753,17 @@ static void psys_update_path_cache(Scene *scene, Object *ob, ParticleSystemModif
if((part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED) && ( psys_in_edit_mode(scene, psys) || (part->type==PART_HAIR
|| (part->ren_as == PART_DRAW_PATH && (part->draw_as == PART_DRAW_REND || psys->renderdata))))){
- psys_cache_paths(scene, ob, psys, cfra, 0);
+ psys_cache_paths(scene, ob, psys, cfra);
/* for render, child particle paths are computed on the fly */
if(part->childtype) {
- if(((psys->totchild!=0)) || (psys_in_edit_mode(scene, psys) && (pset->flag&PE_SHOW_CHILD)))
+ if(((psys->totchild!=0)) || (psys_in_edit_mode(scene, psys) && (pset->flag&PE_DRAW_PART)))
if(!(psys->part->type == PART_HAIR) || (psys->flag & PSYS_HAIR_DONE))
psys_cache_child_paths(scene, ob, psys, cfra, 0);
}
}
else if(psys->pathcache)
- psys_free_path_cache(psys);
-}
-
-/* calculate and store key locations in world coordinates */
-void psys_update_world_cos(Object *ob, ParticleSystem *psys)
-{
- ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
- ParticleData *pa;
- ParticleEditKey *key;
- int i, k, totpart;
- float hairmat[4][4];
-
- if(psys==0 || psys->edit==0)
- return;
-
- totpart= psys->totpart;
-
- for(i=0, pa=psys->particles; i<totpart; i++, pa++) {
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
-
- for(k=0, key=psys->edit->keys[i]; k<pa->totkey; k++, key++) {
- VECCOPY(key->world_co,key->co);
- Mat4MulVecfl(hairmat, key->world_co);
- }
- }
+ psys_free_path_cache(psys, NULL);
}
static void hair_step(Scene *scene, Object *ob, ParticleSystemModifierData *psmd, ParticleSystem *psys, float cfra)
@@ -3925,9 +3790,6 @@ static void hair_step(Scene *scene, Object *ob, ParticleSystemModifierData *psmd
psys_init_effectors(scene, ob, part->eff_group, psys);
if(psys->effectors.first)
precalc_effectors(scene, ob,psys,psmd,cfra);
-
- if(psys_in_edit_mode(scene, psys))
- psys_update_world_cos(ob, psys);
psys_update_path_cache(scene, ob,psmd,psys,cfra);
}
@@ -4237,7 +4099,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle
int totpart, oldtotpart, totchild, oldtotchild, p;
float disp, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, *vg_size= 0;
int init= 0, distr= 0, alloc= 0, usecache= 0, only_children_changed= 0;
- int framenr, framedelta, startframe, endframe, old_framenr;
+ int framenr, framedelta, startframe, endframe;
part= psys->part;
cache= psys->pointcache;
@@ -4327,8 +4189,10 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle
if(alloc) {
realloc_particles(ob, psys, totpart);
- if(usecache && !only_children_changed)
+ if(usecache && !only_children_changed) {
BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
+ BKE_ptcache_id_from_particles(&pid, ob, psys);
+ }
}
if(!only_children_changed)
@@ -4358,7 +4222,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle
/* try to read from the cache */
if(usecache) {
- int result = get_particles_from_cache(scene, ob, psys, (float)framenr, &old_framenr);
+ int result = BKE_ptcache_read_cache(&pid, cfra, scene->r.frs_sec);
if(result == PTCACHE_READ_EXACT || result == PTCACHE_READ_INTERPOLATED) {
cached_step(scene, ob, psmd, psys, cfra);
@@ -4369,14 +4233,12 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle
cache->flag |= PTCACHE_SIMULATION_VALID;
if(result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED)
- write_particles_to_cache(ob, psys, cfra);
+ BKE_ptcache_write_cache(&pid, (int)cfra);
return;
}
else if(result==PTCACHE_READ_OLD) {
- /* set old cfra */
- psys->cfra = (float)old_framenr;
-
+ psys->cfra = (float)cache->simframe;
for(p=0, pa=psys->particles; p<totpart; p++, pa++) {
/* update alive status */
if(pa->time > psys->cfra)
@@ -4402,7 +4264,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle
/* if on second frame, write cache for first frame */
if(usecache && psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
- write_particles_to_cache(ob, psys, startframe);
+ BKE_ptcache_write_cache(&pid, startframe);
if(part->phystype==PART_PHYS_KEYED)
psys_count_keyed_targets(ob,psys);
@@ -4448,7 +4310,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle
/* only write cache starting from second frame */
if(usecache && framenr != startframe)
- write_particles_to_cache(ob, psys, framenr);
+ BKE_ptcache_write_cache(&pid, (int)cfra);
/* for keyed particles the path is allways known so it can be drawn */
if(part->phystype==PART_PHYS_KEYED) {
@@ -4456,7 +4318,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle
psys_update_path_cache(scene, ob, psmd, psys,(int)cfra);
}
else if(psys->pathcache)
- psys_free_path_cache(psys);
+ psys_free_path_cache(psys, NULL);
/* cleanup */
if(vg_vel) MEM_freeN(vg_vel);
@@ -4502,7 +4364,7 @@ static void psys_to_softbody(Scene *scene, Object *ob, ParticleSystem *psys)
static int hair_needs_recalc(ParticleSystem *psys)
{
- if((psys->flag & PSYS_EDITED)==0 &&
+ if((!psys->edit || !psys->edit->edited) &&
((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET)) {
return 1;
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 4bb571aa8ca..c0223d1690c 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -39,6 +39,7 @@
#include "DNA_object_force.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
+#include "DNA_smoke_types.h"
#include "BLI_blenlib.h"
@@ -52,11 +53,19 @@
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_scene.h"
+#include "BKE_smoke.h"
#include "BKE_softbody.h"
#include "BKE_utildefines.h"
#include "BLI_blenlib.h"
+/* both in intern */
+#include "smoke_API.h"
+#include "minilzo.h"
+
+#include "LzmaLib.h"
+
+
/* needed for directory lookup */
#ifndef WIN32
#include <dirent.h>
@@ -77,46 +86,679 @@
#endif
#endif
-/* Creating ID's */
+static void ptcache_data_to(void **data, int type, int index, void *to);
+static void ptcache_data_from(void **data, int type, void *from);
+
+/* Common functions */
+static int ptcache_read_basic_header(PTCacheFile *pf)
+{
+ int error=0;
+
+ /* Custom functions should read these basic elements too! */
+ if(!error && !fread(&pf->totpoint, sizeof(int), 1, pf->fp))
+ error = 1;
+
+ if(!error && !fread(&pf->data_types, sizeof(int), 1, pf->fp))
+ error = 1;
+
+ return !error;
+}
+static int ptcache_write_basic_header(PTCacheFile *pf)
+{
+ /* Custom functions should write these basic elements too! */
+ if(!fwrite(&pf->totpoint, sizeof(int), 1, pf->fp))
+ return 0;
+
+ if(!fwrite(&pf->data_types, sizeof(int), 1, pf->fp))
+ return 0;
+
+ return 1;
+}
+/* Softbody functions */
+static int ptcache_write_softbody(int index, void *soft_v, void **data)
+{
+ SoftBody *soft= soft_v;
+ BodyPoint *bp = soft->bpoint + index;
+
+ ptcache_data_from(data, BPHYS_DATA_LOCATION, bp->pos);
+ ptcache_data_from(data, BPHYS_DATA_VELOCITY, bp->vec);
+
+ return 1;
+}
+static void ptcache_read_softbody(int index, void *soft_v, void **data, float frs_sec, float cfra, float *old_data)
+{
+ SoftBody *soft= soft_v;
+ BodyPoint *bp = soft->bpoint + index;
+
+ if(old_data) {
+ memcpy(bp->pos, data, 3 * sizeof(float));
+ memcpy(bp->vec, data + 3, 3 * sizeof(float));
+ }
+ else {
+ ptcache_data_to(data, BPHYS_DATA_LOCATION, 0, bp->pos);
+ ptcache_data_to(data, BPHYS_DATA_VELOCITY, 0, bp->vec);
+ }
+}
+static void ptcache_interpolate_softbody(int index, void *soft_v, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data)
+{
+ SoftBody *soft= soft_v;
+ BodyPoint *bp = soft->bpoint + index;
+ ParticleKey keys[4];
+ float dfra;
+
+ if(cfra1 == cfra2)
+ return;
+
+ VECCOPY(keys[1].co, bp->pos);
+ VECCOPY(keys[1].vel, bp->vec);
+
+ if(old_data) {
+ memcpy(keys[2].co, old_data, 3 * sizeof(float));
+ memcpy(keys[2].vel, old_data + 3, 3 * sizeof(float));
+ }
+ else
+ BKE_ptcache_make_particle_key(keys+2, 0, data, cfra2);
+
+ dfra = cfra2 - cfra1;
+
+ VecMulf(keys[1].vel, dfra);
+ VecMulf(keys[2].vel, dfra);
+
+ psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, keys, 1);
+
+ VecMulf(keys->vel, 1.0f / dfra);
+
+ VECCOPY(bp->pos, keys->co);
+ VECCOPY(bp->vec, keys->vel);
+}
+static int ptcache_totpoint_softbody(void *soft_v)
+{
+ SoftBody *soft= soft_v;
+ return soft->totpoint;
+}
+/* Particle functions */
+static int ptcache_write_particle(int index, void *psys_v, void **data)
+{
+ ParticleSystem *psys= psys_v;
+ ParticleData *pa = psys->particles + index;
+ float times[3] = {pa->time, pa->dietime, pa->lifetime};
+
+ if(data[BPHYS_DATA_INDEX]) {
+ int step = psys->pointcache->step;
+ /* No need to store unborn or died particles */
+ if(pa->time - step > pa->state.time || pa->dietime + step < pa->state.time)
+ return 0;
+ }
+
+ ptcache_data_from(data, BPHYS_DATA_INDEX, &index);
+ ptcache_data_from(data, BPHYS_DATA_LOCATION, pa->state.co);
+ ptcache_data_from(data, BPHYS_DATA_VELOCITY, pa->state.vel);
+ ptcache_data_from(data, BPHYS_DATA_ROTATION, pa->state.rot);
+ ptcache_data_from(data, BPHYS_DATA_AVELOCITY, pa->state.ave);
+ ptcache_data_from(data, BPHYS_DATA_SIZE, &pa->size);
+ ptcache_data_from(data, BPHYS_DATA_TIMES, times);
+
+ if(pa->boid)
+ ptcache_data_from(data, BPHYS_DATA_TIMES, &pa->boid);
+
+ return 1;
+}
+void BKE_ptcache_make_particle_key(ParticleKey *key, int index, void **data, float time)
+{
+ ptcache_data_to(data, BPHYS_DATA_LOCATION, index, key->co);
+ ptcache_data_to(data, BPHYS_DATA_VELOCITY, index, key->vel);
+ ptcache_data_to(data, BPHYS_DATA_ROTATION, index, key->rot);
+ ptcache_data_to(data, BPHYS_DATA_AVELOCITY, index, key->ave);
+ key->time = time;
+}
+static void ptcache_read_particle(int index, void *psys_v, void **data, float frs_sec, float cfra, float *old_data)
+{
+ ParticleSystem *psys= psys_v;
+ ParticleData *pa = psys->particles + index;
+
+ if(cfra > pa->state.time)
+ memcpy(&pa->prev_state, &pa->state, sizeof(ParticleKey));
+
+ if(old_data){
+ /* old format cache */
+ memcpy(&pa->state, old_data, sizeof(ParticleKey));
+ return;
+ }
+
+ BKE_ptcache_make_particle_key(&pa->state, 0, data, cfra);
+
+ if(data[BPHYS_DATA_SIZE])
+ ptcache_data_to(data, BPHYS_DATA_SIZE, 0, &pa->size);
+
+ if(data[BPHYS_DATA_TIMES]) {
+ float times[3];
+ ptcache_data_to(data, BPHYS_DATA_TIMES, 0, &times);
+ pa->time = times[0];
+ pa->dietime = times[1];
+ pa->lifetime = times[2];
+ }
+
+ if(pa->boid)
+ ptcache_data_to(data, BPHYS_DATA_BOIDS, 0, &pa->boid);
+
+ /* determine velocity from previous location */
+ if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
+ if(cfra > pa->prev_state.time) {
+ VecSubf(pa->state.vel, pa->state.co, pa->prev_state.co);
+ VecMulf(pa->state.vel, (cfra - pa->prev_state.time) / frs_sec);
+ }
+ else {
+ VecSubf(pa->state.vel, pa->prev_state.co, pa->state.co);
+ VecMulf(pa->state.vel, (pa->prev_state.time - cfra) / frs_sec);
+ }
+ }
+
+ /* determine rotation from velocity */
+ if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
+ vectoquat(pa->state.vel, OB_POSX, OB_POSZ, pa->state.rot);
+ }
+}
+static void ptcache_interpolate_particle(int index, void *psys_v, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data)
+{
+ ParticleSystem *psys= psys_v;
+ ParticleData *pa = psys->particles + index;
+ ParticleKey keys[4];
+ float dfra;
+
+ cfra = MIN2(cfra, pa->dietime);
+ cfra1 = MIN2(cfra1, pa->dietime);
+ cfra2 = MIN2(cfra2, pa->dietime);
+
+ if(cfra1 == cfra2)
+ return;
+
+ memcpy(keys+1, &pa->state, sizeof(ParticleKey));
+ if(old_data)
+ memcpy(keys+2, old_data, sizeof(ParticleKey));
+ else
+ BKE_ptcache_make_particle_key(keys+2, 0, data, cfra2);
+
+ dfra = cfra2 - cfra1;
+
+ VecMulf(keys[1].vel, dfra / frs_sec);
+ VecMulf(keys[2].vel, dfra / frs_sec);
+
+ psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, &pa->state, 1);
+ QuatInterpol(pa->state.rot, keys[1].rot,keys[2].rot, (cfra - cfra1) / dfra);
+ VecMulf(pa->state.vel, frs_sec / dfra);
+
+ pa->state.time = cfra;
+}
+
+static int ptcache_totpoint_particle(void *psys_v)
+{
+ ParticleSystem *psys = psys_v;
+ return psys->totpart;
+}
+static int ptcache_totwrite_particle(void *psys_v)
+{
+ ParticleSystem *psys = psys_v;
+ int totwrite = 0;
+
+ /* TODO for later */
+ //if((psys->part->flag & (PART_UNBORN|PART_DIED))==0) {
+ // ParticleData *pa= psys->particles;
+ // int p, step = psys->pointcache->step;
+
+ // for(p=0; p<psys->totpart; p++,pa++)
+ // totwrite += (pa->time - step > pa->state.time || pa->dietime + step > pa->state.time);
+ //}
+ //else
+ totwrite= psys->totpart;
+
+ return totwrite;
+}
+
+/* Cloth functions */
+static int ptcache_write_cloth(int index, void *cloth_v, void **data)
+{
+ ClothModifierData *clmd= cloth_v;
+ Cloth *cloth= clmd->clothObject;
+ ClothVertex *vert = cloth->verts + index;
+
+ ptcache_data_from(data, BPHYS_DATA_LOCATION, vert->x);
+ ptcache_data_from(data, BPHYS_DATA_VELOCITY, vert->v);
+ ptcache_data_from(data, BPHYS_DATA_XCONST, vert->xconst);
+
+ return 1;
+}
+static void ptcache_read_cloth(int index, void *cloth_v, void **data, float frs_sec, float cfra, float *old_data)
+{
+ ClothModifierData *clmd= cloth_v;
+ Cloth *cloth= clmd->clothObject;
+ ClothVertex *vert = cloth->verts + index;
+
+ if(old_data) {
+ memcpy(vert->x, data, 3 * sizeof(float));
+ memcpy(vert->xconst, data + 3, 3 * sizeof(float));
+ memcpy(vert->v, data + 6, 3 * sizeof(float));
+ }
+ else {
+ ptcache_data_to(data, BPHYS_DATA_LOCATION, 0, vert->x);
+ ptcache_data_to(data, BPHYS_DATA_VELOCITY, 0, vert->v);
+ ptcache_data_to(data, BPHYS_DATA_XCONST, 0, vert->xconst);
+ }
+}
+static void ptcache_interpolate_cloth(int index, void *cloth_v, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data)
+{
+ ClothModifierData *clmd= cloth_v;
+ Cloth *cloth= clmd->clothObject;
+ ClothVertex *vert = cloth->verts + index;
+ ParticleKey keys[4];
+ float dfra;
+
+ if(cfra1 == cfra2)
+ return;
+
+ VECCOPY(keys[1].co, vert->x);
+ VECCOPY(keys[1].vel, vert->v);
+
+ if(old_data) {
+ memcpy(keys[2].co, old_data, 3 * sizeof(float));
+ memcpy(keys[2].vel, old_data + 6, 3 * sizeof(float));
+ }
+ else
+ BKE_ptcache_make_particle_key(keys+2, 0, data, cfra2);
+
+ dfra = cfra2 - cfra1;
+
+ VecMulf(keys[1].vel, dfra);
+ VecMulf(keys[2].vel, dfra);
+
+ psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, keys, 1);
+
+ VecMulf(keys->vel, 1.0f / dfra);
+
+ VECCOPY(vert->x, keys->co);
+ VECCOPY(vert->v, keys->vel);
+
+ /* should vert->xconst be interpolated somehow too? - jahka */
+}
+
+static int ptcache_totpoint_cloth(void *cloth_v)
+{
+ ClothModifierData *clmd= cloth_v;
+ return clmd->clothObject->numverts;
+}
+
+/* Creating ID's */
void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb)
{
ParticleSystemModifierData *psmd;
- ModifierData *md;
- int a;
memset(pid, 0, sizeof(PTCacheID));
pid->ob= ob;
- pid->data= sb;
+ pid->calldata= sb;
pid->type= PTCACHE_TYPE_SOFTBODY;
pid->cache= sb->pointcache;
+ pid->cache_ptr= &sb->pointcache;
+ pid->ptcaches= &sb->ptcaches;
+ pid->totpoint= pid->totwrite= ptcache_totpoint_softbody;
+
+ pid->write_elem= ptcache_write_softbody;
+ pid->write_stream = NULL;
+ pid->read_stream = NULL;
+ pid->read_elem= ptcache_read_softbody;
+ pid->interpolate_elem= ptcache_interpolate_softbody;
+
+ pid->write_header= ptcache_write_basic_header;
+ pid->read_header= ptcache_read_basic_header;
+
+ pid->data_types= (1<<BPHYS_DATA_LOCATION) | (1<<BPHYS_DATA_VELOCITY);
+ pid->info_types= 0;
if(sb->particles) {
psmd= psys_get_modifier(ob, sb->particles);
- pid->stack_index= modifiers_indexInObject(ob, (ModifierData*)psmd);
- }
- else {
- for(a=0, md=ob->modifiers.first; md; md=md->next, a++) {
- if(md->type == eModifierType_Softbody) {
- pid->stack_index = a;
- break;
- }
- }
+ // pid->stack_index= modifiers_indexInObject(ob, (ModifierData*)psmd); XXX TODO - get other index DG
}
+ else
+ pid->stack_index = pid->cache->index;
}
void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *psys)
{
- ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
-
memset(pid, 0, sizeof(PTCacheID));
pid->ob= ob;
- pid->data= psys;
+ pid->calldata= psys;
pid->type= PTCACHE_TYPE_PARTICLES;
- pid->stack_index= modifiers_indexInObject(ob, (ModifierData *)psmd);
+ pid->stack_index= psys->pointcache->index;
pid->cache= psys->pointcache;
+ pid->cache_ptr= &psys->pointcache;
+ pid->ptcaches= &psys->ptcaches;
+
+ pid->flag |= PTCACHE_VEL_PER_SEC;
+
+ pid->write_elem= ptcache_write_particle;
+ pid->write_stream = NULL;
+ pid->read_stream = NULL;
+ pid->read_elem= ptcache_read_particle;
+ pid->interpolate_elem= ptcache_interpolate_particle;
+
+ pid->totpoint= ptcache_totpoint_particle;
+ pid->totwrite= ptcache_totwrite_particle;
+
+ pid->write_header= ptcache_write_basic_header;
+ pid->read_header= ptcache_read_basic_header;
+
+ pid->data_types= (1<<BPHYS_DATA_LOCATION) | (1<<BPHYS_DATA_VELOCITY);
+
+ /* TODO for later */
+ //if((psys->part->flag & (PART_UNBORN|PART_DIED))==0)
+ // pid->data_types|= (1<<BPHYS_DATA_INDEX);
+
+ if(psys->part->phystype == PART_PHYS_BOIDS)
+ pid->data_types|= (1<<BPHYS_DATA_AVELOCITY) | (1<<BPHYS_DATA_ROTATION) | (1<<BPHYS_DATA_BOIDS);
+
+ if(psys->part->rotmode || psys->part->avemode)
+ pid->data_types|= (1<<BPHYS_DATA_AVELOCITY) | (1<<BPHYS_DATA_ROTATION);
+
+ if(psys->part->flag & PART_ROT_DYN)
+ pid->data_types|= (1<<BPHYS_DATA_ROTATION);
+
+ pid->info_types= (1<<BPHYS_DATA_TIMES);
+}
+
+/* Smoke functions */
+static int ptcache_totpoint_smoke(void *smoke_v)
+{
+ SmokeModifierData *smd= (SmokeModifierData *)smoke_v;
+ SmokeDomainSettings *sds = smd->domain;
+
+ if(sds->fluid) {
+ return sds->res[0]*sds->res[1]*sds->res[2];
+ }
+ else
+ return 0;
+}
+
+// forward decleration
+static int ptcache_file_write(PTCacheFile *pf, void *f, size_t tot, int size);
+
+static int ptcache_compress_write(PTCacheFile *pf, unsigned char *in, unsigned int in_len, unsigned char *out, int mode)
+{
+ int r = 0;
+ unsigned char compressed;
+ LZO_HEAP_ALLOC(wrkmem, LZO1X_MEM_COMPRESS);
+ unsigned int out_len = LZO_OUT_LEN(in_len);
+ unsigned char *props = MEM_callocN(16*sizeof(char), "tmp");
+ size_t sizeOfIt = 5;
+
+ if(mode == 1) {
+ r = lzo1x_1_compress(in, (lzo_uint)in_len, out, (lzo_uint *)&out_len, wrkmem);
+ if (!(r == LZO_E_OK) || (out_len >= in_len))
+ compressed = 0;
+ else
+ compressed = 1;
+ }
+ else if(mode == 2) {
+
+ r = LzmaCompress(out, (size_t *)&out_len, in, in_len,//assume sizeof(char)==1....
+ props, &sizeOfIt, 5, 1 << 24, 3, 0, 2, 32, 2);
+
+ if(!(r == SZ_OK) || (out_len >= in_len))
+ compressed = 0;
+ else
+ compressed = 2;
+ }
+
+ ptcache_file_write(pf, &compressed, 1, sizeof(unsigned char));
+ if(compressed) {
+ ptcache_file_write(pf, &out_len, 1, sizeof(unsigned int));
+ ptcache_file_write(pf, out, out_len, sizeof(unsigned char));
+ }
+ else
+ ptcache_file_write(pf, in, in_len, sizeof(unsigned char));
+
+ if(compressed == 2)
+ {
+ ptcache_file_write(pf, &sizeOfIt, 1, sizeof(unsigned int));
+ ptcache_file_write(pf, props, sizeOfIt, sizeof(unsigned char));
+ }
+
+ MEM_freeN(props);
+
+ return r;
+}
+
+static int ptcache_write_smoke(PTCacheFile *pf, void *smoke_v)
+{
+ SmokeModifierData *smd= (SmokeModifierData *)smoke_v;
+ SmokeDomainSettings *sds = smd->domain;
+
+ if(sds->fluid) {
+ size_t res = sds->res[0]*sds->res[1]*sds->res[2];
+ float dt, dx, *dens, *densold, *heat, *heatold, *vx, *vy, *vz, *vxold, *vyold, *vzold;
+ unsigned char *obstacles;
+ unsigned int in_len = sizeof(float)*(unsigned int)res;
+ unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len)*4, "pointcache_lzo_buffer");
+ int mode = res >= 1000000 ? 2 : 1;
+
+ smoke_export(sds->fluid, &dt, &dx, &dens, &densold, &heat, &heatold, &vx, &vy, &vz, &vxold, &vyold, &vzold, &obstacles);
+
+ ptcache_compress_write(pf, (unsigned char *)sds->view3d, in_len*4, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)dens, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)densold, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)heat, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)heatold, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)vx, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)vy, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)vz, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)vxold, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)vyold, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)vzold, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)obstacles, (unsigned int)res, out, mode);
+ ptcache_file_write(pf, &dt, 1, sizeof(float));
+ ptcache_file_write(pf, &dx, 1, sizeof(float));
+
+ MEM_freeN(out);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+static int ptcache_write_smoke_turbulence(PTCacheFile *pf, void *smoke_v)
+{
+ SmokeModifierData *smd= (SmokeModifierData *)smoke_v;
+ SmokeDomainSettings *sds = smd->domain;
+
+ if(sds->wt) {
+ unsigned int res_big[3];
+ size_t res = sds->res[0]*sds->res[1]*sds->res[2];
+ float *dens, *densold, *tcu, *tcv, *tcw;
+ unsigned int in_len = sizeof(float)*(unsigned int)res;
+ unsigned int in_len_big = sizeof(float) * (unsigned int)res_big;
+ unsigned char *out;
+ int mode;
+
+ smoke_turbulence_get_res(sds->wt, res_big);
+ mode = res_big[0]*res_big[1]*res_big[2] >= 1000000 ? 2 : 1;
+
+ smoke_turbulence_export(sds->wt, &dens, &densold, &tcu, &tcv, &tcw);
+
+ out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len_big), "pointcache_lzo_buffer");
+
+ ptcache_compress_write(pf, (unsigned char *)dens, in_len_big, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)densold, in_len_big, out, mode);
+
+ MEM_freeN(out);
+ out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len), "pointcache_lzo_buffer");
+ ptcache_compress_write(pf, (unsigned char *)tcu, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)tcv, in_len, out, mode);
+ ptcache_compress_write(pf, (unsigned char *)tcw, in_len, out, mode);
+ MEM_freeN(out);
+
+ return 1;
+ }
+ return 0;
+}
+*/
+
+// forward decleration
+static int ptcache_file_read(PTCacheFile *pf, void *f, size_t tot, int size);
+
+static int ptcache_compress_read(PTCacheFile *pf, unsigned char *result, unsigned int len)
+{
+ int r = 0;
+ unsigned char compressed = 0;
+ unsigned int in_len;
+ unsigned int out_len = len;
+ unsigned char *in;
+ unsigned char *props = MEM_callocN(16*sizeof(char), "tmp");
+ size_t sizeOfIt = 5;
+
+ ptcache_file_read(pf, &compressed, 1, sizeof(unsigned char));
+ if(compressed) {
+ ptcache_file_read(pf, &in_len, 1, sizeof(unsigned int));
+ in = (unsigned char *)MEM_callocN(sizeof(unsigned char)*in_len, "pointcache_compressed_buffer");
+ ptcache_file_read(pf, in, in_len, sizeof(unsigned char));
+
+ if(compressed == 1)
+ r = lzo1x_decompress(in, (lzo_uint)in_len, result, (lzo_uint *)&out_len, NULL);
+ else if(compressed == 2)
+ {
+ size_t leni = in_len, leno = out_len;
+ ptcache_file_read(pf, &sizeOfIt, 1, sizeof(unsigned int));
+ ptcache_file_read(pf, props, sizeOfIt, sizeof(unsigned char));
+ r = LzmaUncompress(result, &leno, in, &leni, props, sizeOfIt);
+ }
+
+ MEM_freeN(in);
+ }
+ else {
+ ptcache_file_read(pf, result, len, sizeof(unsigned char));
+ }
+
+ MEM_freeN(props);
+
+ return r;
+}
+
+static void ptcache_read_smoke(PTCacheFile *pf, void *smoke_v)
+{
+ SmokeModifierData *smd= (SmokeModifierData *)smoke_v;
+ SmokeDomainSettings *sds = smd->domain;
+
+ if(sds->fluid) {
+ size_t res = sds->res[0]*sds->res[1]*sds->res[2];
+ float dt, dx, *dens, *densold, *heat, *heatold, *vx, *vy, *vz, *vxold, *vyold, *vzold;
+ unsigned char *obstacles;
+ unsigned int out_len = (unsigned int)res * sizeof(float);
+
+ smoke_export(sds->fluid, &dt, &dx, &dens, &densold, &heat, &heatold, &vx, &vy, &vz, &vxold, &vyold, &vzold, &obstacles);
+
+ ptcache_compress_read(pf, (unsigned char *)sds->view3d, out_len*4);
+ ptcache_compress_read(pf, (unsigned char*)dens, out_len);
+ ptcache_compress_read(pf, (unsigned char*)densold, out_len);
+ ptcache_compress_read(pf, (unsigned char*)heat, out_len);
+ ptcache_compress_read(pf, (unsigned char*)heatold, out_len);
+ ptcache_compress_read(pf, (unsigned char*)vx, out_len);
+ ptcache_compress_read(pf, (unsigned char*)vy, out_len);
+ ptcache_compress_read(pf, (unsigned char*)vz, out_len);
+ ptcache_compress_read(pf, (unsigned char*)vxold, out_len);
+ ptcache_compress_read(pf, (unsigned char*)vyold, out_len);
+ ptcache_compress_read(pf, (unsigned char*)vzold, out_len);
+ ptcache_compress_read(pf, (unsigned char*)obstacles, (unsigned int)res);
+ ptcache_file_read(pf, &dt, 1, sizeof(float));
+ ptcache_file_read(pf, &dx, 1, sizeof(float));
+ }
+}
+
+/*
+static void ptcache_read_smoke_turbulence(PTCacheFile *pf, void *smoke_v)
+{
+ SmokeModifierData *smd= (SmokeModifierData *)smoke_v;
+ SmokeDomainSettings *sds = smd->domain;
+
+ if(sds->fluid) {
+ unsigned int res[3];
+ float *dens, *densold, *tcu, *tcv, *tcw;
+ unsigned int out_len = sizeof(float)*(unsigned int)res;
+
+ smoke_turbulence_get_res(sds->wt, res);
+
+ smoke_turbulence_export(sds->wt, &dens, &densold, &tcu, &tcv, &tcw);
+
+ ptcache_compress_read(pf, (unsigned char*)dens, out_len);
+
+ }
+}
+*/
+
+void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd)
+{
+ SmokeDomainSettings *sds = smd->domain;
+
+ memset(pid, 0, sizeof(PTCacheID));
+
+ pid->ob= ob;
+ pid->calldata= smd;
+
+ pid->type= PTCACHE_TYPE_SMOKE_DOMAIN;
+ pid->stack_index= sds->point_cache[0]->index;
+
+ pid->cache= sds->point_cache[0];
+ pid->cache_ptr= &(sds->point_cache[0]);
+ pid->ptcaches= &(sds->ptcaches[0]);
+
+ pid->totpoint= pid->totwrite= ptcache_totpoint_smoke;
+
+ pid->write_elem= NULL;
+ pid->read_elem= NULL;
+
+ pid->read_stream = ptcache_read_smoke;
+ pid->write_stream = ptcache_write_smoke;
+
+ pid->interpolate_elem= NULL;
+
+ pid->write_header= ptcache_write_basic_header;
+ pid->read_header= ptcache_read_basic_header;
+
+ pid->data_types= (1<<BPHYS_DATA_LOCATION); // bogus values tot make pointcache happy
+ pid->info_types= 0;
+}
+
+void BKE_ptcache_id_from_smoke_turbulence(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd)
+{
+ SmokeDomainSettings *sds = smd->domain;
+
+ memset(pid, 0, sizeof(PTCacheID));
+
+ pid->ob= ob;
+ pid->calldata= smd;
+
+ pid->type= PTCACHE_TYPE_SMOKE_HIGHRES;
+ pid->stack_index= sds->point_cache[1]->index;
+
+ pid->cache= sds->point_cache[1];
+ pid->cache_ptr= &sds->point_cache[1];
+ pid->ptcaches= &sds->ptcaches[1];
+
+ pid->totpoint= pid->totwrite= ptcache_totpoint_smoke;
+
+ pid->write_elem= NULL;
+ pid->read_elem= NULL;
+
+ pid->read_stream = ptcache_read_smoke;
+ pid->write_stream = ptcache_write_smoke;
+
+ pid->interpolate_elem= NULL;
+
+ pid->write_header= ptcache_write_basic_header;
+ pid->read_header= ptcache_read_basic_header;
+
+ pid->data_types= (1<<BPHYS_DATA_LOCATION); // bogus values tot make pointcache happy
+ pid->info_types= 0;
}
void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *clmd)
@@ -124,10 +766,25 @@ void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *cl
memset(pid, 0, sizeof(PTCacheID));
pid->ob= ob;
- pid->data= clmd;
+ pid->calldata= clmd;
pid->type= PTCACHE_TYPE_CLOTH;
- pid->stack_index= modifiers_indexInObject(ob, (ModifierData *)clmd);
+ pid->stack_index= clmd->point_cache->index;
pid->cache= clmd->point_cache;
+ pid->cache_ptr= &clmd->point_cache;
+ pid->ptcaches= &clmd->ptcaches;
+ pid->totpoint= pid->totwrite= ptcache_totpoint_cloth;
+
+ pid->write_elem= ptcache_write_cloth;
+ pid->write_stream = NULL;
+ pid->read_stream = NULL;
+ pid->read_elem= ptcache_read_cloth;
+ pid->interpolate_elem= ptcache_interpolate_cloth;
+
+ pid->write_header= ptcache_write_basic_header;
+ pid->read_header= ptcache_read_basic_header;
+
+ pid->data_types= (1<<BPHYS_DATA_LOCATION) | (1<<BPHYS_DATA_VELOCITY) | (1<<BPHYS_DATA_XCONST);
+ pid->info_types= 0;
}
void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob)
@@ -145,14 +802,16 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob)
}
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
- BKE_ptcache_id_from_particles(pid, ob, psys);
- BLI_addtail(lb, pid);
-
- if(psys->soft) {
+ if(psys->part) {
pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
- BKE_ptcache_id_from_softbody(pid, ob, psys->soft);
+ BKE_ptcache_id_from_particles(pid, ob, psys);
BLI_addtail(lb, pid);
+
+ if(psys->soft) {
+ pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
+ BKE_ptcache_id_from_softbody(pid, ob, psys->soft);
+ BLI_addtail(lb, pid);
+ }
}
}
@@ -162,9 +821,21 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob)
BKE_ptcache_id_from_cloth(pid, ob, (ClothModifierData*)md);
BLI_addtail(lb, pid);
}
+ if(md->type == eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData *)md;
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ {
+ pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID");
+ BKE_ptcache_id_from_smoke(pid, ob, (SmokeModifierData*)md);
+ BLI_addtail(lb, pid);
+ }
+ }
}
}
+
+/* File handling */
+
/* Takes an Object ID and returns a unique name
- id: object id
- cfra: frame for the cache, can be negative
@@ -177,7 +848,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob)
static int ptcache_path(PTCacheID *pid, char *filename)
{
Library *lib;
- int i;
+ size_t i;
lib= (pid)? pid->ob->id.lib: NULL;
@@ -235,13 +906,17 @@ static int BKE_ptcache_id_filename(PTCacheID *pid, char *filename, int cfra, sho
}
}
else {
- int temp = strlen(pid->cache->name);
+ int temp = (int)strlen(pid->cache->name);
strcpy(newname, pid->cache->name);
newname+=temp;
len += temp;
}
if (do_ext) {
+
+ if(pid->cache->index < 0)
+ pid->cache->index = pid->stack_index = object_insert_ptcache(pid->ob);
+
if(pid->cache->flag & PTCACHE_EXTERNAL) {
if(pid->cache->index >= 0)
snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02d"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
@@ -258,7 +933,7 @@ static int BKE_ptcache_id_filename(PTCacheID *pid, char *filename, int cfra, sho
}
/* youll need to close yourself after! */
-PTCacheFile *BKE_ptcache_file_open(PTCacheID *pid, int mode, int cfra)
+static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
{
PTCacheFile *pf;
FILE *fp = NULL;
@@ -291,134 +966,224 @@ PTCacheFile *BKE_ptcache_file_open(PTCacheID *pid, int mode, int cfra)
return pf;
}
-void BKE_ptcache_file_close(PTCacheFile *pf)
+static void ptcache_file_close(PTCacheFile *pf)
{
fclose(pf->fp);
MEM_freeN(pf);
}
-int BKE_ptcache_file_read_floats(PTCacheFile *pf, float *f, int tot)
+static int ptcache_file_read(PTCacheFile *pf, void *f, size_t tot, int size)
{
- return (fread(f, sizeof(float), tot, pf->fp) == tot);
+ return (fread(f, size, tot, pf->fp) == tot);
}
-
-int BKE_ptcache_file_write_floats(PTCacheFile *pf, float *f, int tot)
+static int ptcache_file_write(PTCacheFile *pf, void *f, size_t tot, int size)
{
- return (fwrite(f, sizeof(float), tot, pf->fp) == tot);
+ return (fwrite(f, size, tot, pf->fp) == tot);
}
-
-static int ptcache_pid_elemsize(PTCacheID *pid)
+static int ptcache_file_read_data(PTCacheFile *pf)
{
- if(pid->type==PTCACHE_TYPE_SOFTBODY)
- return 0; // TODO
- else if(pid->type==PTCACHE_TYPE_PARTICLES)
- return sizeof(ParticleKey);
- else if(pid->type==PTCACHE_TYPE_CLOTH)
- return 9 * sizeof(float);
+ int i;
- return 0;
-}
-static int ptcache_pid_totelem(PTCacheID *pid)
-{
- if(pid->type==PTCACHE_TYPE_SOFTBODY)
- return 0; // TODO
- else if(pid->type==PTCACHE_TYPE_PARTICLES) {
- ParticleSystem *psys = pid->data;
- return psys->totpart;
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(pf->data_types & (1<<i) && !ptcache_file_read(pf, pf->cur[i], 1, BKE_ptcache_data_size(i)))
+ return 0;
}
- else if(pid->type==PTCACHE_TYPE_CLOTH) {
- ClothModifierData *clmd = pid->data;
- return clmd->clothObject->numverts;
+
+ return 1;
+}
+static int ptcache_file_write_data(PTCacheFile *pf)
+{
+ int i;
+
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(pf->data_types & (1<<i) && !ptcache_file_write(pf, pf->cur[i], 1, BKE_ptcache_data_size(i)))
+ return 0;
}
+
+ return 1;
+}
+static int ptcache_file_read_header_begin(PTCacheFile *pf)
+{
+ int error=0;
+ char bphysics[8];
+
+ pf->data_types = 0;
+
+ if(fread(bphysics, sizeof(char), 8, pf->fp) != 8)
+ error = 1;
+
+ if(!error && strncmp(bphysics, "BPHYSICS", 8))
+ error = 1;
- return 0;
+ if(!error && !fread(&pf->type, sizeof(int), 1, pf->fp))
+ error = 1;
+
+ /* if there was an error set file as it was */
+ if(error)
+ fseek(pf->fp, 0, SEEK_SET);
+
+ return !error;
}
-void BKE_ptcache_update_info(PTCacheID *pid)
+
+static int ptcache_file_write_header_begin(PTCacheFile *pf)
{
- PointCache *cache = pid->cache;
- int totframes = 0;
- char mem_info[64];
+ char *bphysics = "BPHYSICS";
+
+ if(fwrite(bphysics, sizeof(char), 8, pf->fp) != 8)
+ return 0;
- if(cache->flag & PTCACHE_EXTERNAL) {
- int cfra = cache->startframe;
+ if(!fwrite(&pf->type, sizeof(int), 1, pf->fp))
+ return 0;
+
+ return 1;
+}
- for(; cfra<=cache->endframe; cfra++) {
- if(BKE_ptcache_id_exist(pid, cfra))
- totframes++;
- }
- if(totframes)
- sprintf(cache->info, "%i points read for %i frames", cache->totpoint, totframes);
+/* Data pointer handling */
+int BKE_ptcache_data_size(int data_type)
+{
+ switch(data_type) {
+ case BPHYS_DATA_INDEX:
+ return sizeof(int);
+ case BPHYS_DATA_LOCATION:
+ case BPHYS_DATA_VELOCITY:
+ case BPHYS_DATA_AVELOCITY: /* also BPHYS_DATA_XCONST */
+ case BPHYS_DATA_TIMES:
+ return 3 * sizeof(float);
+ case BPHYS_DATA_ROTATION:
+ return 4 * sizeof(float);
+ case BPHYS_DATA_SIZE:
+ return sizeof(float);
+ case BPHYS_DATA_BOIDS:
+ return sizeof(BoidData);
+ default:
+ return 0;
+ }
+}
+static void ptcache_data_to(void **data, int type, int index, void *to)
+{
+ if(data[type]) {
+ if(index)
+ memcpy(to, (char*)data[type] + index * BKE_ptcache_data_size(type), BKE_ptcache_data_size(type));
else
- sprintf(cache->info, "No valid data to read!");
- return;
+ memcpy(to, data[type], BKE_ptcache_data_size(type));
}
+}
- if(cache->flag & PTCACHE_DISK_CACHE) {
- int cfra = cache->startframe;
+static void ptcache_data_from(void **data, int type, void *from)
+{
+ if(data[type])
+ memcpy(data[type], from, BKE_ptcache_data_size(type));
+}
- for(; cfra<=cache->endframe; cfra++) {
- if(BKE_ptcache_id_exist(pid, cfra))
- totframes++;
- }
+static void ptcache_file_init_pointers(PTCacheFile *pf)
+{
+ int data_types = pf->data_types;
+
+ pf->cur[BPHYS_DATA_INDEX] = data_types & (1<<BPHYS_DATA_INDEX) ? &pf->data.index : NULL;
+ pf->cur[BPHYS_DATA_LOCATION] = data_types & (1<<BPHYS_DATA_LOCATION) ? &pf->data.loc : NULL;
+ pf->cur[BPHYS_DATA_VELOCITY] = data_types & (1<<BPHYS_DATA_VELOCITY) ? &pf->data.vel : NULL;
+ pf->cur[BPHYS_DATA_ROTATION] = data_types & (1<<BPHYS_DATA_ROTATION) ? &pf->data.rot : NULL;
+ pf->cur[BPHYS_DATA_AVELOCITY] = data_types & (1<<BPHYS_DATA_AVELOCITY) ? &pf->data.ave : NULL;
+ pf->cur[BPHYS_DATA_SIZE] = data_types & (1<<BPHYS_DATA_SIZE) ? &pf->data.size : NULL;
+ pf->cur[BPHYS_DATA_TIMES] = data_types & (1<<BPHYS_DATA_TIMES) ? &pf->data.times : NULL;
+ pf->cur[BPHYS_DATA_BOIDS] = data_types & (1<<BPHYS_DATA_BOIDS) ? &pf->data.boids : NULL;
+}
- sprintf(mem_info, "%i frames on disk", totframes);
- }
- else {
- PTCacheMem *pm = cache->mem_cache.first;
- float framesize = 0.0f, bytes = 0.0f;
- int mb;
+void BKE_ptcache_mem_init_pointers(PTCacheMem *pm)
+{
+ int data_types = pm->data_types;
+ int i;
- if(pm)
- framesize = (float)ptcache_pid_elemsize(pid) * (float)pm->totpoint;
-
- for(; pm; pm=pm->next)
- totframes++;
+ for(i=0; i<BPHYS_TOT_DATA; i++)
+ pm->cur[i] = data_types & (1<<i) ? pm->data[i] : NULL;
+}
- bytes = totframes * framesize;
+void BKE_ptcache_mem_incr_pointers(PTCacheMem *pm)
+{
+ int i;
- mb = (bytes > 1024.0f * 1024.0f);
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(pm->cur[i])
+ pm->cur[i] = (char*)pm->cur[i] + BKE_ptcache_data_size(i);
+ }
+}
+static void ptcache_alloc_data(PTCacheMem *pm)
+{
+ int data_types = pm->data_types;
+ int totpoint = pm->totpoint;
+ int i;
- sprintf(mem_info, "%i frames in memory (%.1f %s)",
- totframes,
- bytes / (mb ? 1024.0f * 1024.0f : 1024.0f),
- mb ? "Mb" : "kb");
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(data_types & (1<<i))
+ pm->data[i] = MEM_callocN(totpoint * BKE_ptcache_data_size(i), "PTCache Data");
}
+}
+static void ptcache_free_data(void *data[])
+{
+ int i;
- if(cache->flag & PTCACHE_OUTDATED) {
- sprintf(cache->info, "%s, cache is outdated!", mem_info);
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(data[i])
+ MEM_freeN(data[i]);
}
- else if(cache->flag & PTCACHE_FRAMES_SKIPPED) {
- sprintf(cache->info, "%s, not exact since frame %i.", mem_info, cache->last_exact);
+}
+static void ptcache_copy_data(void *from[], void *to[])
+{
+ int i;
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(from[i])
+ memcpy(to[i], from[i], BKE_ptcache_data_size(i));
}
- else
- sprintf(cache->info, "%s.", mem_info);
}
+
+
+
+static int ptcache_pid_old_elemsize(PTCacheID *pid)
+{
+ if(pid->type==PTCACHE_TYPE_SOFTBODY)
+ return 6 * sizeof(float);
+ else if(pid->type==PTCACHE_TYPE_PARTICLES)
+ return sizeof(ParticleKey);
+ else if(pid->type==PTCACHE_TYPE_CLOTH)
+ return 9 * sizeof(float);
+
+ return 0;
+}
+
/* reads cache from disk or memory */
/* possible to get old or interpolated result */
-int BKE_ptcache_read_cache(PTCacheReader *reader)
+int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec)
{
- PTCacheID *pid = reader->pid;
PTCacheFile *pf=NULL, *pf2=NULL;
PTCacheMem *pm=NULL, *pm2=NULL;
- int totelem = reader->totelem;
- float cfra = reader->cfra;
+ float old_data1[14], old_data2[14];
int cfrai = (int)cfra;
- int elemsize = ptcache_pid_elemsize(pid);
- int i, incr = elemsize / sizeof(float);
- float frs_sec = reader->scene->r.frs_sec;
- int cfra1=0, cfra2;
- int ret = 0;
+ int old_elemsize = ptcache_pid_old_elemsize(pid);
+ int i;
+
+ int cfra1 = 0, cfra2 = 0;
+ int totpoint = 0, totpoint2 = 0;
+ int *index = &i, *index2 = &i;
+ int use_old = 0, old_frame = 0;
+
+ int ret = 0, error = 0;
- if(totelem == 0)
+ /* nothing to read to */
+ if(pid->totpoint(pid->calldata) == 0)
return 0;
+ if(pid->cache->flag & PTCACHE_READ_INFO) {
+ pid->cache->flag &= ~PTCACHE_READ_INFO;
+ BKE_ptcache_read_cache(pid, 0, frs_sec);
+ }
+
/* first check if we have the actual frame cached */
if(cfra == (float)cfrai) {
if(pid->cache->flag & PTCACHE_DISK_CACHE) {
- pf= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai);
+ pf= ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai);
}
else {
pm = pid->cache->mem_cache.first;
@@ -430,240 +1195,297 @@ int BKE_ptcache_read_cache(PTCacheReader *reader)
}
}
- /* if found, use exact frame */
- if(pf || pm) {
- float *data;
-
- if(pm)
- data = pm->data;
- else
- data = MEM_callocN(elemsize, "pointcache read data");
+ /* no exact cache frame found so try to find cached frames around cfra */
+ if(!pm && !pf) {
+ if(pid->cache->flag & PTCACHE_DISK_CACHE) {
+ pf=NULL;
+ while(cfrai > pid->cache->startframe && !pf) {
+ cfrai--;
+ pf= ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai);
+ cfra1 = cfrai;
+ }
- for(i=0; i<totelem; i++) {
- if(pf) {
- if(!BKE_ptcache_file_read_floats(pf, data, incr)) {
- BKE_ptcache_file_close(pf);
- MEM_freeN(data);
- return 0;
- }
+ old_frame = cfrai;
- reader->set_elem(i, reader->calldata, data);
+ cfrai = (int)cfra;
+ while(cfrai < pid->cache->endframe && !pf2) {
+ cfrai++;
+ pf2= ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai);
+ cfra2 = cfrai;
}
- else {
- reader->set_elem(i, reader->calldata, data);
- data += incr;
+
+ if(pf && !pf2) {
+ pf2 = pf;
+ pf = NULL;
}
}
+ else if(pid->cache->mem_cache.first){
+ pm = pid->cache->mem_cache.first;
- if(pf) {
- BKE_ptcache_file_close(pf);
- pf = NULL;
- MEM_freeN(data);
- }
+ while(pm->next && pm->next->frame < cfra)
+ pm= pm->next;
- ret = PTCACHE_READ_EXACT;
- }
+ if(pm) {
+ old_frame = pm->frame;
+ cfra1 = pm->frame;
+ }
- if(ret)
- ;
- /* no exact cache frame found so try to find cached frames around cfra */
- else if(pid->cache->flag & PTCACHE_DISK_CACHE) {
- pf=NULL;
- while(cfrai > pid->cache->startframe && !pf) {
- cfrai--;
- pf= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai);
- cfra1 = cfrai;
- }
+ pm2 = pid->cache->mem_cache.last;
+
+ if(pm2 && pm2->frame < cfra)
+ pm2 = NULL;
+ else {
+ while(pm2->prev && pm2->prev->frame > cfra)
+ pm2= pm2->prev;
- if(reader->old_frame)
- *(reader->old_frame) = cfrai;
+ if(pm2)
+ cfra2 = pm2->frame;
+ }
- cfrai = (int)cfra;
- while(cfrai < pid->cache->endframe && !pf2) {
- cfrai++;
- pf2= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai);
- cfra2 = cfrai;
+ if(pm && !pm2) {
+ pm2 = pm;
+ pm = NULL;
+ }
}
}
- else if(pid->cache->mem_cache.first){
- pm = pid->cache->mem_cache.first;
- while(pm->next && pm->next->frame < cfra)
- pm= pm->next;
+ if(!pm && !pm2 && !pf && !pf2)
+ return 0;
- if(pm) {
- if(reader->old_frame)
- *(reader->old_frame) = pm->frame;
- cfra1 = pm->frame;
+ if(pm) {
+ BKE_ptcache_mem_init_pointers(pm);
+ totpoint = pm->totpoint;
+ index = pm->data_types & (1<<BPHYS_DATA_INDEX) ? pm->cur[BPHYS_DATA_INDEX] : &i;
+ }
+ if(pm2) {
+ BKE_ptcache_mem_init_pointers(pm2);
+ totpoint2 = pm2->totpoint;
+ index2 = pm2->data_types & (1<<BPHYS_DATA_INDEX) ? pm2->cur[BPHYS_DATA_INDEX] : &i;
+ }
+ if(pf) {
+ if(ptcache_file_read_header_begin(pf)) {
+ if(pf->type != pid->type) {
+ /* todo report error */
+ ptcache_file_close(pf);
+ pf = NULL;
+ }
+ else if(pid->read_header(pf)) {
+ ptcache_file_init_pointers(pf);
+ totpoint = pf->totpoint;
+ index = pf->data_types & BPHYS_DATA_INDEX ? &pf->data.index : &i;
+ }
}
-
- pm2 = pid->cache->mem_cache.last;
-
- if(pm2 && pm2->frame < cfra)
- pm2 = NULL;
else {
- while(pm2->prev && pm2->prev->frame > cfra)
- pm2= pm2->prev;
-
- if(pm2)
- cfra2 = pm2->frame;
+ /* fall back to old cache file format */
+ use_old = 1;
+ totpoint = pid->totpoint(pid->calldata);
}
}
-
- if(ret)
- ;
- else if((pf && pf2) || (pm && pm2)) {
- /* interpolate from nearest frames if cache isn't outdated */
- float *data1, *data2;
-
- if(pm) {
- data1 = pm->data;
- data2 = pm2->data;
+ if(pf2) {
+ if(ptcache_file_read_header_begin(pf2)) {
+ if(pf2->type != pid->type) {
+ /* todo report error */
+ ptcache_file_close(pf2);
+ pf2 = NULL;
+ }
+ else if(pid->read_header(pf2)) {
+ ptcache_file_init_pointers(pf2);
+ totpoint2 = pf2->totpoint;
+ index2 = pf->data_types & BPHYS_DATA_INDEX ? &pf2->data.index : &i;
+ }
}
else {
- data1 = MEM_callocN(elemsize, "pointcache read data1");
- data2 = MEM_callocN(elemsize, "pointcache read data2");
+ /* fall back to old cache file format */
+ use_old = 1;
+ totpoint2 = pid->totpoint(pid->calldata);
}
+ }
- for(i=0; i<totelem; i++) {
- if(pf && pf2) {
- if(!BKE_ptcache_file_read_floats(pf, data1, incr)) {
- BKE_ptcache_file_close(pf);
- BKE_ptcache_file_close(pf2);
- MEM_freeN(data1);
- MEM_freeN(data2);
- return 0;
- }
- if(!BKE_ptcache_file_read_floats(pf2, data2, incr)) {
- BKE_ptcache_file_close(pf);
- BKE_ptcache_file_close(pf2);
- MEM_freeN(data1);
- MEM_freeN(data2);
- return 0;
- }
- reader->interpolate_elem(i, reader->calldata, frs_sec, cfra, (float)cfra1, (float)cfra2, data1, data2);
+ /* don't read old cache if allready simulated past cached frame */
+ if(!pm && !pf && cfra1 && cfra1 <= pid->cache->simframe)
+ error = 1;
+ if(cfra1 && cfra1==cfra2)
+ error = 1;
+
+ if(!error)
+ {
+ if(pf && pid->read_stream) {
+ if(totpoint != pid->totpoint(pid->calldata))
+ error = 1;
+ else
+ {
+ // we have stream writing here
+ pid->read_stream(pf, pid->calldata);
+ }
+ }
+ }
+
+ totpoint = MIN2(totpoint, pid->totpoint(pid->calldata));
+
+ if(!error)
+ {
+ for(i=0; i<totpoint; i++) {
+ /* read old cache file format */
+ if(use_old) {
+ if(pid->read_elem && ptcache_file_read(pf, (void*)old_data1, 1, old_elemsize))
+ pid->read_elem(i, pid->calldata, NULL, frs_sec, cfra, old_data1);
+ else if(pid->read_elem)
+ { error = 1; break; }
}
else {
- reader->interpolate_elem(i, reader->calldata, frs_sec, cfra, (float)cfra1, (float)cfra2, data1, data2);
- data1 += incr;
- data2 += incr;
+ if(pid->read_elem && (pm || ptcache_file_read_data(pf)))
+ pid->read_elem(*index, pid->calldata, pm ? pm->cur : pf->cur, frs_sec, cfra1 ? (float)cfra1 : (float)cfrai, NULL);
+ else if(pid->read_elem)
+ { error = 1; break; }
}
- }
- if(pf) {
- BKE_ptcache_file_close(pf);
- pf = NULL;
- BKE_ptcache_file_close(pf2);
- pf2 = NULL;
- MEM_freeN(data1);
- MEM_freeN(data2);
+ if(pm) {
+ BKE_ptcache_mem_incr_pointers(pm);
+ index = pm->data_types & (1<<BPHYS_DATA_INDEX) ? pm->cur[BPHYS_DATA_INDEX] : &i;
+ }
}
-
- ret = PTCACHE_READ_INTERPOLATED;
}
- else if(pf || pm) {
- /* use last valid cache frame */
- float *data;
-
- /* don't read cache if allready simulated past cached frame */
- if(cfra1 && cfra1 <= pid->cache->simframe) {
- if(pf)
- BKE_ptcache_file_close(pf);
- if(pf2)
- BKE_ptcache_file_close(pf2);
- return 0;
+ if(!error)
+ {
+ if(pf2 && pid->read_stream) {
+ if(totpoint2 != pid->totpoint(pid->calldata))
+ error = 1;
+ else
+ {
+ // we have stream writing here
+ pid->read_stream(pf2, pid->calldata);
+ }
}
+ }
- if(pm)
- data = pm->data;
- else
- data = MEM_callocN(elemsize, "pointcache read data");
-
- for(i=0; i<totelem; i++) {
- if(pf) {
- if(!BKE_ptcache_file_read_floats(pf, data, incr)) {
- BKE_ptcache_file_close(pf);
- if(pf2)
- BKE_ptcache_file_close(pf2);
- return 0;
+ totpoint2 = MIN2(totpoint2, pid->totpoint(pid->calldata));
+
+ if(!error)
+ {
+ for(i=0; i<totpoint2; i++) {
+ /* read old cache file format */
+ if(use_old) {
+ if(pid->read_elem && ptcache_file_read(pf2, (void*)old_data2, 1, old_elemsize)) {
+ if(!pf && pf2)
+ pid->read_elem(i, pid->calldata, NULL, frs_sec, (float)cfra2, old_data2);
+ else if(pid->interpolate_elem)
+ pid->interpolate_elem(i, pid->calldata, NULL, frs_sec, cfra, (float)cfra1, (float)cfra2, old_data2);
+ else
+ { error = 1; break; }
}
- reader->set_elem(i, reader->calldata, data);
+ else if(pid->read_elem)
+ { error = 1; break; }
}
else {
- reader->set_elem(i, reader->calldata, data);
- data += incr;
+ if(pid->read_elem && (pm2 || ptcache_file_read_data(pf2))) {
+ if((!pf && pf2) || (!pm && pm2))
+ pid->read_elem(*index2, pid->calldata, pm2 ? pm2->cur : pf2->cur, frs_sec, (float)cfra2, NULL);
+ else if(pid->interpolate_elem)
+ pid->interpolate_elem(*index2, pid->calldata, pm2 ? pm2->cur : pf2->cur, frs_sec, cfra, (float)cfra1, (float)cfra2, NULL);
+ else
+ { error = 1; break; }
+ }
+ else if(pid->read_elem)
+ { error = 1; break; }
}
- }
- if(pf) {
- BKE_ptcache_file_close(pf);
- pf = NULL;
- MEM_freeN(data);
- }
- if(pf2) {
- BKE_ptcache_file_close(pf2);
- pf = NULL;
+ if(pm2) {
+ BKE_ptcache_mem_incr_pointers(pm2);
+ index2 = pm2->data_types & (1<<BPHYS_DATA_INDEX) ? pm2->cur[BPHYS_DATA_INDEX] : &i;
+ }
}
+ }
+ if(pm || pf)
+ ret = (pm2 || pf2) ? PTCACHE_READ_INTERPOLATED : PTCACHE_READ_EXACT;
+ else if(pm2 || pf2) {
ret = PTCACHE_READ_OLD;
+ pid->cache->simframe = old_frame;
}
- if(pf)
- BKE_ptcache_file_close(pf);
- if(pf2)
- BKE_ptcache_file_close(pf2);
+ if(pf) {
+ ptcache_file_close(pf);
+ pf = NULL;
+ }
+
+ if(pf2) {
+ ptcache_file_close(pf2);
+ pf = NULL;
+ }
if((pid->cache->flag & PTCACHE_QUICK_CACHE)==0) {
+ cfrai = (int)cfra;
/* clear invalid cache frames so that better stuff can be simulated */
if(pid->cache->flag & PTCACHE_OUTDATED) {
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, cfra);
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, cfrai);
}
else if(pid->cache->flag & PTCACHE_FRAMES_SKIPPED) {
if(cfra <= pid->cache->last_exact)
pid->cache->flag &= ~PTCACHE_FRAMES_SKIPPED;
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, MAX2(cfra,pid->cache->last_exact));
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, MAX2(cfrai,pid->cache->last_exact));
}
}
- return ret;
+ return (error ? 0 : ret);
}
+/* TODO for later */
+//static void ptcache_make_index_array(PTCacheMem *pm, int totpoint)
+//{
+// int i, *index;
+//
+// if(pm->index_array) {
+// MEM_freeN(pm->index_array);
+// pm->index_array = NULL;
+// }
+//
+// if(!pm->data[BPHYS_DATA_INDEX])
+// return;
+//
+// pm->index_array = MEM_callocN(totpoint * sizeof(int), "PTCacheMem index_array");
+// index = pm->data[BPHYS_DATA_INDEX];
+//
+// for(i=0; i<pm->totpoint; i++, index++)
+// pm->index_array[*index] = i;
+//}
/* writes cache to disk or memory */
-int BKE_ptcache_write_cache(PTCacheWriter *writer)
+int BKE_ptcache_write_cache(PTCacheID *pid, int cfra)
{
- PointCache *cache = writer->pid->cache;
+ PointCache *cache = pid->cache;
PTCacheFile *pf= NULL;
- int elemsize = ptcache_pid_elemsize(writer->pid);
- int i, incr = elemsize / sizeof(float);
+ int i;
+ int totpoint = pid->totpoint(pid->calldata);
int add = 0, overwrite = 0;
- float temp[14];
- if(writer->totelem == 0 || writer->cfra <= 0)
+ if(totpoint == 0 || cfra < 0
+ || (cfra ? pid->data_types == 0 : pid->info_types == 0))
return 0;
if(cache->flag & PTCACHE_DISK_CACHE) {
- int cfra = cache->endframe;
+ int efra = cache->endframe;
+ if(cfra==0)
+ add = 1;
/* allways start from scratch on the first frame */
- if(writer->cfra == cache->startframe) {
- BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_ALL, writer->cfra);
+ else if(cfra == cache->startframe) {
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, cfra);
cache->flag &= ~PTCACHE_REDO_NEEDED;
add = 1;
}
else {
- int ocfra;
+ int ofra;
/* find last cached frame */
- while(cfra > cache->startframe && !BKE_ptcache_id_exist(writer->pid, cfra))
- cfra--;
+ while(efra > cache->startframe && !BKE_ptcache_id_exist(pid, efra))
+ efra--;
/* find second last cached frame */
- ocfra = cfra-1;
- while(ocfra > cache->startframe && !BKE_ptcache_id_exist(writer->pid, ocfra))
- ocfra--;
+ ofra = efra-1;
+ while(ofra > cache->startframe && !BKE_ptcache_id_exist(pid, ofra))
+ ofra--;
- if(cfra >= cache->startframe && writer->cfra > cfra) {
- if(ocfra >= cache->startframe && cfra - ocfra < cache->step)
+ if(efra >= cache->startframe && cfra > efra) {
+ if(ofra >= cache->startframe && efra - ofra < cache->step)
overwrite = 1;
else
add = 1;
@@ -672,74 +1494,92 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer)
if(add || overwrite) {
if(overwrite)
- BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_FRAME, cfra);
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_FRAME, efra);
- pf = BKE_ptcache_file_open(writer->pid, PTCACHE_FILE_WRITE, writer->cfra);
+ pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, cfra);
if(!pf)
return 0;
- for(i=0; i<writer->totelem; i++) {
- writer->set_elem(i, writer->calldata, temp);
- BKE_ptcache_file_write_floats(pf, temp, incr);
+ pf->type = pid->type;
+ pf->totpoint = cfra ? totpoint : pid->totwrite(pid->calldata);
+ pf->data_types = cfra ? pid->data_types : pid->info_types;
+
+ if(!ptcache_file_write_header_begin(pf) || !pid->write_header(pf)) {
+ ptcache_file_close(pf);
+ return 0;
+ }
+
+ ptcache_file_init_pointers(pf);
+
+ if(pf && pid->write_stream) {
+ // we have stream writing here
+ pid->write_stream(pf, pid->calldata);
}
+ else
+ for(i=0; i<totpoint; i++) {
+ if(pid->write_elem && pid->write_elem(i, pid->calldata, pf->cur))
+ if(!ptcache_file_write_data(pf)) {
+ ptcache_file_close(pf);
+ return 0;
+ }
+ }
}
}
else {
PTCacheMem *pm;
PTCacheMem *pm2;
- float *pmdata;
pm2 = cache->mem_cache.first;
+ /* don't write info file in memory */
+ if(cfra==0)
+ return 1;
/* allways start from scratch on the first frame */
- if(writer->cfra == cache->startframe) {
- BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_ALL, writer->cfra);
+ if(cfra == cache->startframe) {
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, cfra);
cache->flag &= ~PTCACHE_REDO_NEEDED;
add = 1;
}
- else {
+ else if (cache->mem_cache.last) {
pm2 = cache->mem_cache.last;
- if(pm2 && writer->cfra > pm2->frame) {
+ if(pm2 && cfra > pm2->frame) {
if(pm2->prev && pm2->frame - pm2->prev->frame < cache->step)
overwrite = 1;
else
add = 1;
}
}
+ else
+ add = 1;
- if(overwrite) {
- pm = cache->mem_cache.last;
- pmdata = pm->data;
-
- for(i=0; i<writer->totelem; i++, pmdata+=incr) {
- writer->set_elem(i, writer->calldata, temp);
- memcpy(pmdata, temp, elemsize);
- }
+ if(add || overwrite) {
+ if(overwrite)
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_FRAME, pm2->frame);
- pm->frame = writer->cfra;
- }
- else if(add) {
pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem");
- pm->data = MEM_callocN(elemsize * writer->totelem, "Pointcache mem data");
- pmdata = pm->data;
- for(i=0; i<writer->totelem; i++, pmdata+=incr) {
- writer->set_elem(i, writer->calldata, temp);
- memcpy(pmdata, temp, elemsize);
- }
+ pm->totpoint = pid->totwrite(pid->calldata);
+ pm->data_types = cfra ? pid->data_types : pid->info_types;
- pm->frame = writer->cfra;
- pm->totpoint = writer->totelem;
+ ptcache_alloc_data(pm);
+ BKE_ptcache_mem_init_pointers(pm);
+ for(i=0; i<totpoint; i++) {
+ if(pid->write_elem && pid->write_elem(i, pid->calldata, pm->cur))
+ BKE_ptcache_mem_incr_pointers(pm);
+ }
+ //ptcache_make_index_array(pm, pid->totpoint(pid->calldata));
+
+ pm->frame = cfra;
BLI_addtail(&cache->mem_cache, pm);
}
}
if(add || overwrite) {
- if(writer->cfra - cache->last_exact == 1
- || writer->cfra == cache->startframe) {
- cache->last_exact = writer->cfra;
+ if(cfra - cache->last_exact == 1
+ || cfra == cache->startframe) {
+ cache->last_exact = cfra;
cache->flag &= ~PTCACHE_FRAMES_SKIPPED;
}
else
@@ -747,9 +1587,9 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer)
}
if(pf)
- BKE_ptcache_file_close(pf);
+ ptcache_file_close(pf);
- BKE_ptcache_update_info(writer->pid);
+ BKE_ptcache_update_info(pid);
return 1;
}
@@ -757,7 +1597,7 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer)
* mode - PTCACHE_CLEAR_ALL,
*/
-
+/* Clears & resets */
void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
{
int len; /* store the length of the string */
@@ -804,7 +1644,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
BLI_delete(path_full, 0, 0);
} else {
/* read the number of the file */
- int frame, len2 = strlen(de->d_name);
+ int frame, len2 = (int)strlen(de->d_name);
char num[7];
if (len2 > 15) { /* could crash if trying to copy a string out of this range*/
@@ -828,10 +1668,12 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
PTCacheMem *pm= pid->cache->mem_cache.first;
PTCacheMem *link= NULL;
+ pm= pid->cache->mem_cache.first;
+
if(mode == PTCACHE_CLEAR_ALL) {
pid->cache->last_exact = 0;
for(; pm; pm=pm->next)
- MEM_freeN(pm->data);
+ ptcache_free_data(pm->data);
BLI_freelistN(&pid->cache->mem_cache);
} else {
while(pm) {
@@ -839,7 +1681,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
(mode==PTCACHE_CLEAR_AFTER && pm->frame > cfra) ) {
link = pm;
pm = pm->next;
- MEM_freeN(link->data);
+ ptcache_free_data(link->data);
BLI_freelinkN(&pid->cache->mem_cache, link);
}
else
@@ -861,7 +1703,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
for(; pm; pm=pm->next) {
if(pm->frame == cfra) {
- MEM_freeN(pm->data);
+ ptcache_free_data(pm->data);
BLI_freelinkN(&pid->cache->mem_cache, pm);
break;
}
@@ -983,11 +1825,13 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
cache->last_exact= 0;
if(pid->type == PTCACHE_TYPE_CLOTH)
- cloth_free_modifier(pid->ob, pid->data);
+ cloth_free_modifier(pid->ob, pid->calldata);
else if(pid->type == PTCACHE_TYPE_SOFTBODY)
- sbFreeSimulation(pid->data);
+ sbFreeSimulation(pid->calldata);
else if(pid->type == PTCACHE_TYPE_PARTICLES)
- psys_reset(pid->data, PSYS_RESET_DEPSGRAPH);
+ psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH);
+ else if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+ smokeModifier_reset(pid->calldata);
}
if(clear)
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
@@ -1025,7 +1869,7 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
else if(psys->recalc & PSYS_RECALC_REDO || psys->recalc & PSYS_RECALC_CHILD)
skip = 1;
- if(skip == 0) {
+ if(skip == 0 && psys->part) {
BKE_ptcache_id_from_particles(&pid, ob, psys);
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
}
@@ -1036,6 +1880,14 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
BKE_ptcache_id_from_cloth(&pid, ob, (ClothModifierData*)md);
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
}
+ if(md->type == eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData *)md;
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ {
+ BKE_ptcache_id_from_smoke(&pid, ob, (SmokeModifierData*)md);
+ reset |= BKE_ptcache_id_reset(scene, &pid, mode);
+ }
+ }
}
return reset;
@@ -1105,9 +1957,9 @@ int BKE_ptcache_get_continue_physics()
return CONTINUE_PHYSICS;
}
-/* Point Cache */
+/* Point Cache handling */
-PointCache *BKE_ptcache_add()
+PointCache *BKE_ptcache_add(ListBase *ptcaches)
{
PointCache *cache;
@@ -1115,24 +1967,46 @@ PointCache *BKE_ptcache_add()
cache->startframe= 1;
cache->endframe= 250;
cache->step= 10;
+ cache->index = -1;
+
+ BLI_addtail(ptcaches, cache);
return cache;
}
-void BKE_ptcache_free(PointCache *cache)
+void BKE_ptcache_free_mem(ListBase *mem_cache)
{
- PTCacheMem *pm = cache->mem_cache.first;
+ PTCacheMem *pm = mem_cache->first;
+
if(pm) {
- for(; pm; pm=pm->next)
- MEM_freeN(pm->data);
+ for(; pm; pm=pm->next) {
+ ptcache_free_data(pm->data);
+ if(pm->index_array)
+ MEM_freeN(pm->index_array);
+ }
- BLI_freelistN(&cache->mem_cache);
+ BLI_freelistN(mem_cache);
}
-
+}
+void BKE_ptcache_free(PointCache *cache)
+{
+ BKE_ptcache_free_mem(&cache->mem_cache);
+ if(cache->edit && cache->free_edit)
+ cache->free_edit(cache->edit);
MEM_freeN(cache);
}
+void BKE_ptcache_free_list(ListBase *ptcaches)
+{
+ PointCache *cache = ptcaches->first;
-PointCache *BKE_ptcache_copy(PointCache *cache)
+ while(cache) {
+ BLI_remlink(ptcaches, cache);
+ BKE_ptcache_free(cache);
+ cache = ptcaches->first;
+ }
+}
+
+static PointCache *ptcache_copy(PointCache *cache)
{
PointCache *ncache;
@@ -1147,7 +2021,18 @@ PointCache *BKE_ptcache_copy(PointCache *cache)
return ncache;
}
+/* returns first point cache */
+PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old)
+{
+ PointCache *cache = ptcaches_old->first;
+ ptcaches_new->first = ptcaches_new->last = NULL;
+
+ for(; cache; cache=cache->next)
+ BLI_addtail(ptcaches_new, ptcache_copy(cache));
+
+ return ptcaches_new->first;
+}
/* Baking */
@@ -1208,7 +2093,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
Base *base;
ListBase pidlist;
PTCacheID *pid = baker->pid;
- PointCache *cache;
+ PointCache *cache = NULL;
float frameleno = scene->r.framelen;
int cfrao = CFRA;
int startframe = MAXFRAME;
@@ -1225,7 +2110,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
cache = pid->cache;
if((cache->flag & PTCACHE_BAKED)==0) {
if(pid->type==PTCACHE_TYPE_PARTICLES)
- psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe);
+ psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe);
if(bake || cache->flag & PTCACHE_REDO_NEEDED)
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
@@ -1251,12 +2136,12 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
cache = pid->cache;
if((cache->flag & PTCACHE_BAKED)==0) {
if(pid->type==PTCACHE_TYPE_PARTICLES) {
- ParticleSystem *psys = (ParticleSystem*)pid->data;
+ ParticleSystem *psys = (ParticleSystem*)pid->calldata;
/* skip hair & keyed particles */
if(psys->part->type == PART_HAIR || psys->part->phystype == PART_PHYS_KEYED)
continue;
- psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe);
+ psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe);
}
if((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0)
@@ -1283,10 +2168,10 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
scene->r.framelen = 1.0;
for(; CFRA <= endframe; CFRA+=step) {
- float prog;
+ int prog;
if(bake)
- prog = (int)(100.0 * (float)(CFRA - startframe)/(float)(endframe-startframe));
+ prog = (int)(100.0f * (float)(CFRA - startframe)/(float)(endframe-startframe));
else
prog = CFRA;
@@ -1305,15 +2190,19 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
if(pid) {
cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED);
cache->flag |= PTCACHE_SIMULATION_VALID;
- if(bake)
+ if(bake) {
cache->flag |= PTCACHE_BAKED;
+ /* write info file */
+ if(cache->flag & PTCACHE_DISK_CACHE)
+ BKE_ptcache_write_cache(pid, 0);
+ }
}
else for(base=scene->base.first; base; base= base->next) {
BKE_ptcache_ids_from_object(&pidlist, base->object);
for(pid=pidlist.first; pid; pid=pid->next) {
/* skip hair particles */
- if(pid->type==PTCACHE_TYPE_PARTICLES && ((ParticleSystem*)pid->data)->part->type == PART_HAIR)
+ if(pid->type==PTCACHE_TYPE_PARTICLES && ((ParticleSystem*)pid->calldata)->part->type == PART_HAIR)
continue;
cache = pid->cache;
@@ -1325,8 +2214,11 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
cache->flag |= PTCACHE_SIMULATION_VALID;
- if(bake)
+ if(bake) {
cache->flag |= PTCACHE_BAKED;
+ if(cache->flag & PTCACHE_DISK_CACHE)
+ BKE_ptcache_write_cache(pid, 0);
+ }
}
BLI_freelistN(&pidlist);
}
@@ -1339,97 +2231,141 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
/* TODO: call redraw all windows somehow */
}
-
-void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) {
+/* Helpers */
+void BKE_ptcache_disk_to_mem(PTCacheID *pid)
+{
PointCache *cache = pid->cache;
PTCacheFile *pf;
PTCacheMem *pm;
- int totelem=0;
- int float_count=0;
- int tot;
- int last_exact = cache->last_exact;
- if (!G.relbase_valid){
- cache->flag &= ~PTCACHE_DISK_CACHE;
- printf("File must be saved before using disk cache!\n");
- return;
- }
+ int cfra, sfra = cache->startframe, efra = cache->endframe;
+ int i;
- totelem = ptcache_pid_totelem(pid);
- float_count = ptcache_pid_elemsize(pid) / sizeof(float);
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
- if(totelem==0 || float_count==0)
- return;
+ for(cfra=sfra; cfra <= efra; cfra++) {
+ pf = ptcache_file_open(pid, PTCACHE_FILE_READ, cfra);
- tot = totelem*float_count;
+ if(pf) {
+ if(!ptcache_file_read_header_begin(pf)) {
+ printf("Can't yet convert old cache format\n");
+ cache->flag |= PTCACHE_DISK_CACHE;
+ ptcache_file_close(pf);
+ return;
+ }
- /* MEM -> DISK */
- if(cache->flag & PTCACHE_DISK_CACHE) {
- pm = cache->mem_cache.first;
+ if(pf->type != pid->type || !pid->read_header(pf)) {
+ cache->flag |= PTCACHE_DISK_CACHE;
+ ptcache_file_close(pf);
+ return;
+ }
+
+ pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem");
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
+ pm->totpoint = pf->totpoint;
+ pm->data_types = pf->data_types;
+ pm->frame = cfra;
- for(; pm; pm=pm->next) {
- pf = BKE_ptcache_file_open(pid, PTCACHE_FILE_WRITE, pm->frame);
+ ptcache_alloc_data(pm);
+ BKE_ptcache_mem_init_pointers(pm);
+ ptcache_file_init_pointers(pf);
- if(pf) {
- if(fwrite(pm->data, sizeof(float), tot, pf->fp) != tot) {
- printf("Error writing to disk cache\n");
+ for(i=0; i<pm->totpoint; i++) {
+ if(!ptcache_file_read_data(pf)) {
+ printf("Error reading from disk cache\n");
- cache->flag &= ~PTCACHE_DISK_CACHE;
+ cache->flag |= PTCACHE_DISK_CACHE;
+
+ ptcache_free_data(pm->data);
+ MEM_freeN(pm);
+ ptcache_file_close(pf);
- BKE_ptcache_file_close(pf);
return;
}
- BKE_ptcache_file_close(pf);
+ ptcache_copy_data(pf->cur, pm->cur);
+ BKE_ptcache_mem_incr_pointers(pm);
}
- else
- printf("Error creating disk cache file\n");
- }
- cache->flag &= ~PTCACHE_DISK_CACHE;
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
- cache->flag |= PTCACHE_DISK_CACHE;
+ //ptcache_make_index_array(pm, pid->totpoint(pid->calldata));
+
+ BLI_addtail(&pid->cache->mem_cache, pm);
+
+ ptcache_file_close(pf);
+ }
}
- /* DISK -> MEM */
- else {
- int cfra;
- int sfra = cache->startframe;
- int efra = cache->endframe;
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
+}
+void BKE_ptcache_mem_to_disk(PTCacheID *pid)
+{
+ PointCache *cache = pid->cache;
+ PTCacheFile *pf;
+ PTCacheMem *pm;
+ int i;
- for(cfra=sfra; cfra <= efra; cfra++) {
- pf = BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfra);
+ pm = cache->mem_cache.first;
- if(pf) {
- pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem");
- pm->data = MEM_callocN(sizeof(float)*tot, "Pointcache mem data");
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
- if(fread(pm->data, sizeof(float), tot, pf->fp)!= tot) {
- printf("Error reading from disk cache\n");
+ for(; pm; pm=pm->next) {
+ pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, pm->frame);
- cache->flag |= PTCACHE_DISK_CACHE;
+ if(pf) {
+ pf->data_types = pm->data_types;
+ pf->totpoint = pm->totpoint;
+ pf->type = pid->type;
- MEM_freeN(pm->data);
- MEM_freeN(pm);
- BKE_ptcache_file_close(pf);
- return;
- }
+ BKE_ptcache_mem_init_pointers(pm);
+ ptcache_file_init_pointers(pf);
- pm->frame = cfra;
- pm->totpoint = totelem;
+ if(!ptcache_file_write_header_begin(pf) || !pid->write_header(pf)) {
+ printf("Error writing to disk cache\n");
+ cache->flag &= ~PTCACHE_DISK_CACHE;
+
+ ptcache_file_close(pf);
+ return;
+ }
- BLI_addtail(&pid->cache->mem_cache, pm);
+ for(i=0; i<pm->totpoint; i++) {
+ ptcache_copy_data(pm->cur, pf->cur);
+ if(!ptcache_file_write_data(pf)) {
+ printf("Error writing to disk cache\n");
+ cache->flag &= ~PTCACHE_DISK_CACHE;
- BKE_ptcache_file_close(pf);
+ ptcache_file_close(pf);
+ return;
+ }
+ BKE_ptcache_mem_incr_pointers(pm);
}
+
+ ptcache_file_close(pf);
+
+ /* write info file */
+ if(cache->flag & PTCACHE_BAKED)
+ BKE_ptcache_write_cache(pid, 0);
}
+ else
+ printf("Error creating disk cache file\n");
+ }
+}
+void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
+{
+ PointCache *cache = pid->cache;
+ int last_exact = cache->last_exact;
- cache->flag |= PTCACHE_DISK_CACHE;
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
+ if (!G.relbase_valid){
cache->flag &= ~PTCACHE_DISK_CACHE;
+ printf("File must be saved before using disk cache!\n");
+ return;
}
+
+ if(cache->flag & PTCACHE_DISK_CACHE)
+ BKE_ptcache_mem_to_disk(pid);
+ else
+ BKE_ptcache_disk_to_mem(pid);
+
+ cache->flag ^= PTCACHE_DISK_CACHE;
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
+ cache->flag ^= PTCACHE_DISK_CACHE;
cache->last_exact = last_exact;
@@ -1438,15 +2374,16 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) {
void BKE_ptcache_load_external(PTCacheID *pid)
{
+ /*todo*/
PointCache *cache = pid->cache;
int len; /* store the length of the string */
+ int info = 0;
/* mode is same as fopen's modes */
DIR *dir;
struct dirent *de;
char path[MAX_PTCACHE_PATH];
char filename[MAX_PTCACHE_FILE];
- char path_full[MAX_PTCACHE_FILE];
char ext[MAX_PTCACHE_PATH];
if(!cache)
@@ -1473,15 +2410,19 @@ void BKE_ptcache_load_external(PTCacheID *pid)
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */
/* read the number of the file */
- int frame, len2 = strlen(de->d_name);
+ int frame, len2 = (int)strlen(de->d_name);
char num[7];
if (len2 > 15) { /* could crash if trying to copy a string out of this range*/
BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num));
frame = atoi(num);
- cache->startframe = MIN2(cache->startframe, frame);
- cache->endframe = MAX2(cache->endframe, frame);
+ if(frame) {
+ cache->startframe = MIN2(cache->startframe, frame);
+ cache->endframe = MAX2(cache->endframe, frame);
+ }
+ else
+ info = 1;
}
}
}
@@ -1490,18 +2431,36 @@ void BKE_ptcache_load_external(PTCacheID *pid)
if(cache->startframe != MAXFRAME) {
PTCacheFile *pf;
- int elemsize = ptcache_pid_elemsize(pid);
- int incr = elemsize / sizeof(float);
- float *data = NULL;
- pf= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cache->startframe);
- if(pf) {
- data = MEM_callocN(elemsize, "pointcache read data");
- while(BKE_ptcache_file_read_floats(pf, data, incr))
- cache->totpoint++;
-
- BKE_ptcache_file_close(pf);
- MEM_freeN(data);
+ /* read totpoint from info file (frame 0) */
+ if(info) {
+ pf= ptcache_file_open(pid, PTCACHE_FILE_READ, 0);
+
+ if(pf) {
+ if(ptcache_file_read_header_begin(pf)) {
+ if(pf->type == pid->type && pid->read_header(pf)) {
+ cache->totpoint = pf->totpoint;
+ cache->flag |= PTCACHE_READ_INFO;
+ }
+ else {
+ cache->totpoint = 0;
+ }
+ }
+ ptcache_file_close(pf);
+ }
+ }
+ /* or from any old format cache file */
+ else {
+ float old_data[14];
+ int elemsize = ptcache_pid_old_elemsize(pid);
+ pf= ptcache_file_open(pid, PTCACHE_FILE_READ, cache->startframe);
+
+ if(pf) {
+ while(ptcache_file_read(pf, old_data, 1, elemsize))
+ cache->totpoint++;
+
+ ptcache_file_close(pf);
+ }
}
}
@@ -1509,3 +2468,65 @@ void BKE_ptcache_load_external(PTCacheID *pid)
BKE_ptcache_update_info(pid);
}
+
+void BKE_ptcache_update_info(PTCacheID *pid)
+{
+ PointCache *cache = pid->cache;
+ int totframes = 0;
+ char mem_info[64];
+
+ if(cache->flag & PTCACHE_EXTERNAL) {
+ int cfra = cache->startframe;
+
+ for(; cfra<=cache->endframe; cfra++) {
+ if(BKE_ptcache_id_exist(pid, cfra))
+ totframes++;
+ }
+
+ if(totframes && cache->totpoint)
+ sprintf(cache->info, "%i points found!", cache->totpoint);
+ else
+ sprintf(cache->info, "No valid data to read!");
+ return;
+ }
+
+ if(cache->flag & PTCACHE_DISK_CACHE) {
+ int cfra = cache->startframe;
+
+ for(; cfra<=cache->endframe; cfra++) {
+ if(BKE_ptcache_id_exist(pid, cfra))
+ totframes++;
+ }
+
+ sprintf(mem_info, "%i frames on disk", totframes);
+ }
+ else {
+ PTCacheMem *pm = cache->mem_cache.first;
+ float framesize = 0.0f, bytes = 0.0f;
+ int mb;
+
+ if(pm)
+ framesize = (float)ptcache_pid_old_elemsize(pid) * (float)pm->totpoint;
+
+ for(; pm; pm=pm->next)
+ totframes++;
+
+ bytes = totframes * framesize;
+
+ mb = (bytes > 1024.0f * 1024.0f);
+
+ sprintf(mem_info, "%i frames in memory (%.1f %s)",
+ totframes,
+ bytes / (mb ? 1024.0f * 1024.0f : 1024.0f),
+ mb ? "Mb" : "kb");
+ }
+
+ if(cache->flag & PTCACHE_OUTDATED) {
+ sprintf(cache->info, "%s, cache is outdated!", mem_info);
+ }
+ else if(cache->flag & PTCACHE_FRAMES_SKIPPED) {
+ sprintf(cache->info, "%s, not exact since frame %i.", mem_info, cache->last_exact);
+ }
+ else
+ sprintf(cache->info, "%s.", mem_info);
+}
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index 74d2347ec39..e4d73208c64 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -35,6 +35,8 @@
#include <stdio.h>
#include <string.h>
+#include <float.h>
+
#include "MEM_guardedalloc.h"
#include "DNA_text_types.h"
@@ -410,22 +412,25 @@ void init_actuator(bActuator *act)
{
/* also use when actuator changes type */
bObjectActuator *oa;
+ bSoundActuator *sa;
if(act->data) MEM_freeN(act->data);
act->data= 0;
switch(act->type) {
-#ifdef __NLA
case ACT_ACTION:
case ACT_SHAPEACTION:
act->data= MEM_callocN(sizeof(bActionActuator), "actionact");
break;
-#endif
case ACT_SOUND:
- act->data= MEM_callocN(sizeof(bSoundActuator), "soundact");
- break;
- case ACT_CD:
- act->data= MEM_callocN(sizeof(bCDActuator), "cdact");
+ sa = act->data= MEM_callocN(sizeof(bSoundActuator), "soundact");
+ sa->volume = 1.0f;
+ sa->sound3D.rolloff_factor = 1.0f;
+ sa->sound3D.reference_distance = 1.0f;
+ sa->sound3D.max_gain = 1.0f;
+ sa->sound3D.cone_inner_angle = 360.0f;
+ sa->sound3D.cone_outer_angle = 360.0f;
+ sa->sound3D.max_distance = FLT_MAX;
break;
case ACT_OBJECT:
act->data= MEM_callocN(sizeof(bObjectActuator), "objectact");
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index d629654c426..10f6a8cf47c 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -54,6 +54,7 @@
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
#include "DNA_userdef_types.h"
@@ -75,8 +76,8 @@
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_scene.h"
-#include "BKE_sculpt.h"
#include "BKE_sequence.h"
#include "BKE_world.h"
#include "BKE_utildefines.h"
@@ -125,7 +126,113 @@ void free_qtcodecdata(QuicktimeCodecData *qcd)
}
}
-/* copy_scene moved to src/header_info.c... should be back */
+Scene *copy_scene(Main *bmain, Scene *sce, int type)
+{
+ Scene *scen;
+ ToolSettings *ts;
+ Base *base, *obase;
+
+ if(type == SCE_COPY_EMPTY) {
+ ListBase lb;
+ scen= add_scene(sce->id.name+2);
+
+ lb= scen->r.layers;
+ scen->r= sce->r;
+ scen->r.layers= lb;
+ }
+ else {
+ scen= copy_libblock(sce);
+ BLI_duplicatelist(&(scen->base), &(sce->base));
+
+ clear_id_newpoins();
+
+ id_us_plus((ID *)scen->world);
+ id_us_plus((ID *)scen->set);
+ id_us_plus((ID *)scen->ima);
+ id_us_plus((ID *)scen->gm.dome.warptext);
+
+ scen->ed= NULL;
+ scen->theDag= NULL;
+ scen->obedit= NULL;
+ scen->toolsettings= MEM_dupallocN(sce->toolsettings);
+ scen->stats= NULL;
+
+ ts= scen->toolsettings;
+ if(ts) {
+ if(ts->vpaint) {
+ ts->vpaint= MEM_dupallocN(ts->vpaint);
+ ts->vpaint->paintcursor= NULL;
+ ts->vpaint->vpaint_prev= NULL;
+ ts->vpaint->wpaint_prev= NULL;
+ copy_paint(&ts->vpaint->paint, &ts->vpaint->paint);
+ }
+ if(ts->wpaint) {
+ ts->wpaint= MEM_dupallocN(ts->wpaint);
+ ts->wpaint->paintcursor= NULL;
+ ts->wpaint->vpaint_prev= NULL;
+ ts->wpaint->wpaint_prev= NULL;
+ copy_paint(&ts->wpaint->paint, &ts->wpaint->paint);
+ }
+ if(ts->sculpt) {
+ ts->sculpt= MEM_dupallocN(ts->sculpt);
+ copy_paint(&ts->sculpt->paint, &ts->sculpt->paint);
+ }
+
+ copy_paint(&ts->imapaint.paint, &ts->imapaint.paint);
+ ts->imapaint.paintcursor= NULL;
+
+ ts->particle.paintcursor= NULL;
+ }
+
+ BLI_duplicatelist(&(scen->markers), &(sce->markers));
+ BLI_duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces));
+ BLI_duplicatelist(&(scen->r.layers), &(sce->r.layers));
+ BKE_keyingsets_copy(&(scen->keyingsets), &(sce->keyingsets));
+
+ scen->nodetree= ntreeCopyTree(sce->nodetree, 0);
+
+ obase= sce->base.first;
+ base= scen->base.first;
+ while(base) {
+ id_us_plus(&base->object->id);
+ if(obase==sce->basact) scen->basact= base;
+
+ obase= obase->next;
+ base= base->next;
+ }
+ }
+
+ /* make a private copy of the avicodecdata */
+ if(sce->r.avicodecdata) {
+ scen->r.avicodecdata = MEM_dupallocN(sce->r.avicodecdata);
+ scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat);
+ scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms);
+ }
+
+ /* make a private copy of the qtcodecdata */
+ if(sce->r.qtcodecdata) {
+ scen->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata);
+ scen->r.qtcodecdata->cdParms = MEM_dupallocN(scen->r.qtcodecdata->cdParms);
+ }
+
+ /* NOTE: part of SCE_COPY_LINK_DATA and SCE_COPY_FULL operations
+ * are done outside of blenkernel with ED_objects_single_users! */
+
+ /* camera */
+ if(type == SCE_COPY_LINK_DATA || type == SCE_COPY_FULL) {
+ ID_NEW(scen->camera);
+ }
+
+ /* world */
+ if(type == SCE_COPY_FULL) {
+ if(scen->world) {
+ id_us_plus((ID *)scen->world);
+ scen->world= copy_world(scen->world);
+ }
+ }
+
+ return scen;
+}
/* do not free scene itself */
void free_scene(Scene *sce)
@@ -138,9 +245,14 @@ void free_scene(Scene *sce)
base= base->next;
}
/* do not free objects! */
+
+ if(sce->gpd) {
+ sce->gpd->id.us--;
+ sce->gpd= NULL;
+ }
BLI_freelistN(&sce->base);
- seq_free_editing(sce->ed);
+ seq_free_editing(sce);
BKE_free_animdata((ID *)sce);
BKE_keyingsets_free(&sce->keyingsets);
@@ -166,15 +278,20 @@ void free_scene(Scene *sce)
BLI_freelistN(&sce->r.layers);
if(sce->toolsettings) {
- if(sce->toolsettings->vpaint)
+ if(sce->toolsettings->vpaint) {
+ free_paint(&sce->toolsettings->vpaint->paint);
MEM_freeN(sce->toolsettings->vpaint);
- if(sce->toolsettings->wpaint)
+ }
+ if(sce->toolsettings->wpaint) {
+ free_paint(&sce->toolsettings->wpaint->paint);
MEM_freeN(sce->toolsettings->wpaint);
+ }
if(sce->toolsettings->sculpt) {
- sculptsession_free(sce->toolsettings->sculpt);
+ free_paint(&sce->toolsettings->sculpt->paint);
MEM_freeN(sce->toolsettings->sculpt);
}
-
+ free_paint(&sce->toolsettings->imapaint.paint);
+
MEM_freeN(sce->toolsettings);
sce->toolsettings = NULL;
}
@@ -188,6 +305,9 @@ void free_scene(Scene *sce)
ntreeFreeTree(sce->nodetree);
MEM_freeN(sce->nodetree);
}
+
+ if(sce->stats)
+ MEM_freeN(sce->stats);
}
Scene *add_scene(char *name)
@@ -280,12 +400,17 @@ Scene *add_scene(char *name)
sce->toolsettings->proportional_size = 1.0f;
+
+ sce->unit.scale_length = 1.0f;
+
pset= &sce->toolsettings->particle;
- pset->flag= PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER;
+ pset->flag= PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER|PE_AUTO_VELOCITY;
pset->emitterdist= 0.25f;
pset->totrekey= 5;
pset->totaddkey= 5;
pset->brushtype= PE_BRUSH_NONE;
+ pset->draw_step= 2;
+ pset->fade_frames= 2;
for(a=0; a<PE_TOT_BRUSH; a++) {
pset->brush[a].strength= 50;
pset->brush[a].size= 50;
@@ -294,7 +419,7 @@ Scene *add_scene(char *name)
pset->brush[PE_BRUSH_CUT].strength= 100;
sce->jumpframe = 10;
- sce->audio.mixrate = 44100;
+ sce->r.audio.mixrate = 44100;
strcpy(sce->r.backbuf, "//backbuf");
strcpy(sce->r.pic, U.renderdir);
@@ -328,6 +453,9 @@ Scene *add_scene(char *name)
sce->gm.physubstep = 1;
sce->gm.maxphystep = 5;
+ sce->gm.flag = GAME_DISPLAY_LISTS;
+ sce->gm.matmode = GAME_MAT_MULTITEX;
+
return sce;
}
@@ -387,7 +515,7 @@ void set_scene_bg(Scene *scene)
base->flag |= flag;
/* not too nice... for recovering objects with lost data */
- if(ob->pose==NULL) base->flag &= ~OB_POSEMODE;
+ //if(ob->pose==NULL) base->flag &= ~OB_POSEMODE;
ob->flag= base->flag;
ob->ctime= -1234567.0; /* force ipo to be calculated later */
@@ -410,6 +538,30 @@ void set_scene_name(char *name)
//XXX error("Can't find scene: %s", name);
}
+void unlink_scene(Main *bmain, Scene *sce, Scene *newsce)
+{
+ Scene *sce1;
+ bScreen *sc;
+
+ /* check all sets */
+ for(sce1= bmain->scene.first; sce1; sce1= sce1->id.next)
+ if(sce1->set == sce)
+ sce1->set= NULL;
+
+ /* check all sequences */
+ clear_scene_in_allseqs(sce);
+
+ /* check render layer nodes in other scenes */
+ clear_scene_in_nodes(bmain, sce);
+
+ /* al screens */
+ for(sc= bmain->screen.first; sc; sc= sc->id.next)
+ if(sc->scene == sce)
+ sc->scene= newsce;
+
+ free_libblock(&bmain->scene, sce);
+}
+
/* used by metaballs
* doesnt return the original duplicated object, only dupli's
*/
@@ -674,26 +826,6 @@ void scene_add_render_layer(Scene *sce)
srl->passflag= SCE_PASS_COMBINED|SCE_PASS_Z;
}
-void sculptsession_free(Sculpt *sculpt)
-{
- SculptSession *ss= sculpt->session;
- if(ss) {
- if(ss->projverts)
- MEM_freeN(ss->projverts);
-
- if(ss->fmap)
- MEM_freeN(ss->fmap);
-
- if(ss->fmap_mem)
- MEM_freeN(ss->fmap_mem);
-
- if(ss->texcache)
- MEM_freeN(ss->texcache);
- MEM_freeN(ss);
- sculpt->session= NULL;
- }
-}
-
/* render simplification */
int get_render_subsurf_level(RenderData *r, int lvl)
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 2ee95ed928e..078258092f7 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -2792,6 +2792,10 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force)
if (!(force || seq->len != v->length || !v->frameMap)) {
return;
}
+ if (!seq->seq1) { /* make coverity happy and check for (CID 598)
+ input strip ... */
+ return;
+ }
if (!v->frameMap || v->length != seq->len) {
if (v->frameMap) MEM_freeN(v->frameMap);
@@ -2807,7 +2811,7 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force)
/* if there is no IPO, try to make retiming easy by stretching the
strip */
// XXX old animation system - seq
- if (/*!seq->ipo &&*/ seq->seq1 && seq->seq1->enddisp != seq->seq1->start
+ if (/*!seq->ipo &&*/ seq->seq1->enddisp != seq->seq1->start
&& seq->seq1->len != 0) {
fallback_fac = (float) seq->seq1->len /
(float) (seq->seq1->enddisp - seq->seq1->start);
diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c
index 3eeecd94a85..c6b714c3125 100644
--- a/source/blender/blenkernel/intern/sequence.c
+++ b/source/blender/blenkernel/intern/sequence.c
@@ -32,6 +32,7 @@
#include <math.h>
#include "MEM_guardedalloc.h"
+#include "MEM_CacheLimiterC-Api.h"
#include "DNA_listBase.h"
#include "DNA_sequence_types.h"
@@ -51,6 +52,10 @@
#include "BLI_threads.h"
#include <pthread.h>
+#include "BKE_context.h"
+#include "BKE_sound.h"
+#include "AUD_C-API.h"
+
#ifdef WIN32
#define snprintf _snprintf
#endif
@@ -58,7 +63,7 @@
/* **** XXX ******** */
static int seqrectx= 0; /* bad bad global! */
static int seqrecty= 0;
-static void waitcursor() {}
+static void waitcursor(int val) {}
static int blender_test_break() {return 0;}
/* **** XXX ******** */
@@ -122,7 +127,7 @@ void new_tstripdata(Sequence *seq)
/* free */
-static void free_proxy_seq(Sequence *seq)
+void free_proxy_seq(Sequence *seq)
{
if (seq->strip && seq->strip->proxy && seq->strip->proxy->anim) {
IMB_free_anim(seq->strip->proxy->anim);
@@ -177,12 +182,16 @@ void seq_free_strip(Strip *strip)
MEM_freeN(strip);
}
-void seq_free_sequence(Editing *ed, Sequence *seq)
+void seq_free_sequence(Scene *scene, Sequence *seq)
{
+ Editing *ed = scene->ed;
+
if(seq->strip) seq_free_strip(seq->strip);
if(seq->anim) IMB_free_anim(seq->anim);
- //XXX if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio);
+
+ if(seq->sound_handle)
+ sound_delete_handle(scene, seq->sound_handle);
if (seq->type & SEQ_EFFECT) {
struct SeqEffectHandle sh = get_sequence_effect(seq);
@@ -207,8 +216,9 @@ Editing *seq_give_editing(Scene *scene, int alloc)
return scene->ed;
}
-void seq_free_editing(Editing *ed)
+void seq_free_editing(Scene *scene)
{
+ Editing *ed = scene->ed;
MetaStack *ms;
Sequence *seq;
@@ -216,7 +226,7 @@ void seq_free_editing(Editing *ed)
return;
SEQ_BEGIN(ed, seq) {
- seq_free_sequence(ed, seq);
+ seq_free_sequence(scene, seq);
}
SEQ_END
@@ -443,6 +453,8 @@ void calc_sequence_disp(Sequence *seq)
else if(seq->enddisp-seq->startdisp > 250) {
seq->handsize= (float)((seq->enddisp-seq->startdisp)/25);
}
+
+ seq_update_sound(seq);
}
void calc_sequence(Sequence *seq)
@@ -514,8 +526,8 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq)
char str[FILE_MAXDIR+FILE_MAXFILE];
if (!(seq->type == SEQ_MOVIE || seq->type == SEQ_IMAGE ||
- seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND ||
- seq->type == SEQ_SCENE || seq->type == SEQ_META)) {
+ seq->type == SEQ_SOUND ||
+ seq->type == SEQ_SCENE || seq->type == SEQ_META)) {
return;
}
@@ -557,23 +569,8 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq)
seq->len = 0;
}
seq->strip->len = seq->len;
- } else if (seq->type == SEQ_HD_SOUND) {
-// XXX if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio);
-// seq->hdaudio = sound_open_hdaudio(str);
-
- if (!seq->hdaudio) {
- return;
- }
-
-// XXX seq->len = sound_hdaudio_get_duration(seq->hdaudio, FPS) - seq->anim_startofs - seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- } else if (seq->type == SEQ_RAM_SOUND) {
- seq->len = (int) ( ((float)(seq->sound->streamlen-1)/
- ((float)scene->audio.mixrate*4.0 ))
- * FPS);
+ } else if (seq->type == SEQ_SOUND) {
+ seq->len = AUD_getInfo(seq->sound->handle).length * FPS;
seq->len -= seq->anim_startofs;
seq->len -= seq->anim_endofs;
if (seq->len < 0) {
@@ -692,8 +689,7 @@ char *give_seqname_by_type(int type)
case SEQ_IMAGE: return "Image";
case SEQ_SCENE: return "Scene";
case SEQ_MOVIE: return "Movie";
- case SEQ_RAM_SOUND: return "Audio (RAM)";
- case SEQ_HD_SOUND: return "Audio (HD)";
+ case SEQ_SOUND: return "Audio";
case SEQ_CROSS: return "Cross";
case SEQ_GAMCROSS: return "Gamma Cross";
case SEQ_ADD: return "Add";
@@ -1070,10 +1066,9 @@ int evaluate_seq_frame(Scene *scene, int cfra)
static int video_seq_is_rendered(Sequence * seq)
{
- return (seq
- && !(seq->flag & SEQ_MUTE)
- && seq->type != SEQ_RAM_SOUND
- && seq->type != SEQ_HD_SOUND);
+ return (seq
+ && !(seq->flag & SEQ_MUTE)
+ && seq->type != SEQ_SOUND);
}
static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Sequence ** seq_arr_out)
@@ -3039,11 +3034,36 @@ void free_imbuf_seq_except(Scene *scene, int cfra)
SEQ_END
}
-void free_imbuf_seq(ListBase * seqbase)
+void free_imbuf_seq(ListBase * seqbase, int check_mem_usage)
{
Sequence *seq;
TStripElem *se;
int a;
+
+ if (check_mem_usage) {
+ /* Let the cache limitor take care of this (schlaile) */
+ /* While render let's keep all memory available for render
+ (ton)
+ At least if free memory is tight...
+ This can make a big difference in encoding speed
+ (it is around 4 times(!) faster, if we do not waste time
+ on freeing _all_ buffers every time on long timelines...)
+ (schlaile)
+ */
+
+ uintptr_t mem_in_use;
+ uintptr_t mmap_in_use;
+ uintptr_t max;
+
+ mem_in_use= MEM_get_memory_in_use();
+ mmap_in_use= MEM_get_mapped_memory_in_use();
+ max = MEM_CacheLimiter_get_maximum();
+
+ if (max == 0 || mem_in_use + mmap_in_use <= max) {
+ return;
+ }
+ }
+
for(seq= seqbase->first; seq; seq= seq->next) {
if(seq->strip) {
@@ -3076,7 +3096,11 @@ void free_imbuf_seq(ListBase * seqbase)
}
}
if(seq->type==SEQ_META) {
- free_imbuf_seq(&seq->seqbase);
+ free_imbuf_seq(&seq->seqbase, FALSE);
+ }
+ if(seq->type==SEQ_SCENE) {
+ /* FIXME: recurs downwards,
+ but do recurs protection somehow! */
}
}
@@ -3174,88 +3198,6 @@ void free_imbuf_seq_with_ipo(Scene *scene, struct Ipo *ipo)
SEQ_END
}
-#if 0
-/* bad levell call... */
-void do_render_seq(RenderResult *rr, int cfra)
-{
- static int recurs_depth = 0
- ImBuf *ibuf;
-
- recurs_depth++;
-
- ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, 100.0);
-
- recurs_depth--;
-
- if(ibuf) {
- if(ibuf->rect_float) {
- if (!rr->rectf)
- rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf");
-
- memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty);
-
- /* TSK! Since sequence render doesn't free the *rr render result, the old rect32
- can hang around when sequence render has rendered a 32 bits one before */
- if(rr->rect32) {
- MEM_freeN(rr->rect32);
- rr->rect32= NULL;
- }
- }
- else if(ibuf->rect) {
- if (!rr->rect32)
- rr->rect32= MEM_mallocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
-
- memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty);
-
- /* if (ibuf->zbuf) { */
- /* if (R.rectz) freeN(R.rectz); */
- /* R.rectz = BLI_dupallocN(ibuf->zbuf); */
- /* } */
- }
-
- /* Let the cache limitor take care of this (schlaile) */
- /* While render let's keep all memory available for render
- (ton)
- At least if free memory is tight...
- This can make a big difference in encoding speed
- (it is around 4 times(!) faster, if we do not waste time
- on freeing _all_ buffers every time on long timelines...)
- (schlaile)
- */
- if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */
- uintptr_t mem_in_use;
- uintptr_t mmap_in_use;
- uintptr_t max;
-
- mem_in_use= MEM_get_memory_in_use();
- mmap_in_use= MEM_get_mapped_memory_in_use();
- max = MEM_CacheLimiter_get_maximum();
-
- if (max != 0 && mem_in_use + mmap_in_use > max) {
- fprintf(stderr, "Memory in use > maximum memory\n");
- fprintf(stderr, "Cleaning up, please wait...\n"
- "If this happens very often,\n"
- "consider "
- "raising the memcache limit in the "
- "user preferences.\n");
- free_imbuf_seq();
- }
- free_proxy_seq(seq);
- }
- }
- else {
- /* render result is delivered empty in most cases, nevertheless we handle all cases */
- if (rr->rectf)
- memset(rr->rectf, 0, 4*sizeof(float)*rr->rectx*rr->recty);
- else if (rr->rect32)
- memset(rr->rect32, 0, 4*rr->rectx*rr->recty);
- else
- rr->rect32= MEM_callocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
- }
-}
-
-#endif
-
/* seq funcs's for transforming internally
notice the difference between start/end and left/right.
@@ -3361,7 +3303,7 @@ void seq_tx_handle_xlimits(Sequence *seq, int leftflag, int rightflag)
}
/* sounds cannot be extended past their endpoints */
- if (seq->type == SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND) {
+ if (seq->type == SEQ_SOUND) {
seq->startstill= 0;
seq->endstill= 0;
}
@@ -3458,3 +3400,15 @@ int shuffle_seq(ListBase * seqbasep, Sequence *test)
return 1;
}
}
+
+void seq_update_sound(struct Sequence *seq)
+{
+ if(seq->type == SEQ_SOUND)
+ {
+ seq->sound_handle->startframe = seq->startdisp;
+ seq->sound_handle->endframe = seq->enddisp;
+ seq->sound_handle->frameskip = seq->startofs + seq->anim_startofs;
+ seq->sound_handle->mute = seq->flag & SEQ_MUTE ? 1 : 0;
+ seq->sound_handle->changed = -1;
+ }
+}
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 27357d92aae..efb7db04029 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -574,7 +574,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Scene *scene, Object
}
}
- //Just to make sure we are not letting any memory behind
+ //Just to make sure we are not leaving any memory behind
assert(ssmd.emCache == NULL);
assert(ssmd.mCache == NULL);
}
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
new file mode 100644
index 00000000000..223d48012df
--- /dev/null
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -0,0 +1,1472 @@
+/**
+ * smoke.c
+ *
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Daniel Genrich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/* Part of the code copied from elbeem fluid library, copyright by Nils Thuerey */
+
+#include <GL/glew.h>
+
+#include "MEM_guardedalloc.h"
+
+#include <float.h>
+#include <math.h>
+#include "stdio.h"
+
+#include "BLI_linklist.h"
+#include "BLI_rand.h"
+#include "BLI_jitter.h"
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_edgehash.h"
+#include "BLI_kdtree.h"
+#include "BLI_kdopbvh.h"
+
+#include "BKE_bvhutils.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_customdata.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_modifier.h"
+#include "BKE_particle.h"
+#include "BKE_pointcache.h"
+#include "BKE_smoke.h"
+#include "BKE_utildefines.h"
+
+#include "DNA_customdata_types.h"
+#include "DNA_group_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_smoke_types.h"
+
+#include "smoke_API.h"
+
+#include "BKE_smoke.h"
+
+#ifdef _WIN32
+#include <time.h>
+#include <stdio.h>
+#include <conio.h>
+#include <windows.h>
+
+static LARGE_INTEGER liFrequency;
+static LARGE_INTEGER liStartTime;
+static LARGE_INTEGER liCurrentTime;
+
+static void tstart ( void )
+{
+ QueryPerformanceFrequency ( &liFrequency );
+ QueryPerformanceCounter ( &liStartTime );
+}
+static void tend ( void )
+{
+ QueryPerformanceCounter ( &liCurrentTime );
+}
+//static double tval()
+//{
+// return ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart)* (double)1000.0/(double)liFrequency.QuadPart ));
+//}
+#else
+#include <sys/time.h>
+static struct timeval _tstart, _tend;
+static struct timezone tz;
+static void tstart ( void )
+{
+ gettimeofday ( &_tstart, &tz );
+}
+static void tend ( void )
+{
+ gettimeofday ( &_tend,&tz );
+}
+static double tval()
+{
+ double t1, t2;
+ t1 = ( double ) _tstart.tv_sec*1000 + ( double ) _tstart.tv_usec/ ( 1000 );
+ t2 = ( double ) _tend.tv_sec*1000 + ( double ) _tend.tv_usec/ ( 1000 );
+ return t2-t1;
+}
+#endif
+
+struct Object;
+struct Scene;
+struct DerivedMesh;
+struct SmokeModifierData;
+
+// forward declerations
+static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct);
+void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len);
+void smoke_prepare_View(SmokeModifierData *smd, float framenr, float *light, int have_light);
+
+#define TRI_UVOFFSET (1./4.)
+
+int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm)
+{
+ if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid)
+ {
+ size_t i;
+ float min[3] = {FLT_MAX, FLT_MAX, FLT_MAX}, max[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX};
+ float size[3];
+ MVert *verts = dm->getVertArray(dm);
+ float scale = 0.0;
+ int res;
+
+ res = smd->domain->maxres;
+
+ // get BB of domain
+ for(i = 0; i < dm->getNumVerts(dm); i++)
+ {
+ float tmp[3];
+
+ VECCOPY(tmp, verts[i].co);
+ Mat4MulVecfl(ob->obmat, tmp);
+
+ // min BB
+ min[0] = MIN2(min[0], tmp[0]);
+ min[1] = MIN2(min[1], tmp[1]);
+ min[2] = MIN2(min[2], tmp[2]);
+
+ // max BB
+ max[0] = MAX2(max[0], tmp[0]);
+ max[1] = MAX2(max[1], tmp[1]);
+ max[2] = MAX2(max[2], tmp[2]);
+ }
+
+ VECCOPY(smd->domain->p0, min);
+ VECCOPY(smd->domain->p1, max);
+
+ // calc other res with max_res provided
+ VECSUB(size, max, min);
+
+ if((size[0] < FLT_EPSILON) || (size[1] < FLT_EPSILON) || (size[2] < FLT_EPSILON))
+ return 0;
+
+ if(size[0] > size[1])
+ {
+ if(size[0] > size[1])
+ {
+ scale = res / size[0];
+ smd->domain->dx = size[0] / res;
+ smd->domain->res[0] = res;
+ smd->domain->res[1] = (int)(size[1] * scale + 0.5);
+ smd->domain->res[2] = (int)(size[2] * scale + 0.5);
+ }
+ else
+ {
+ scale = res / size[1];
+ smd->domain->dx = size[1] / res;
+ smd->domain->res[1] = res;
+ smd->domain->res[0] = (int)(size[0] * scale + 0.5);
+ smd->domain->res[2] = (int)(size[2] * scale + 0.5);
+ }
+ }
+ else
+ {
+ if(size[1] > size[2])
+ {
+ scale = res / size[1];
+ smd->domain->dx = size[1] / res;
+ smd->domain->res[1] = res;
+ smd->domain->res[0] = (int)(size[0] * scale + 0.5);
+ smd->domain->res[2] = (int)(size[2] * scale + 0.5);
+ }
+ else
+ {
+ scale = res / size[2];
+ smd->domain->dx = size[2] / res;
+ smd->domain->res[2] = res;
+ smd->domain->res[0] = (int)(size[0] * scale + 0.5);
+ smd->domain->res[1] = (int)(size[1] * scale + 0.5);
+ }
+ }
+
+ // TODO: put in failsafe if res<=0 - dg
+
+ // printf("res[0]: %d, res[1]: %d, res[2]: %d\n", smd->domain->res[0], smd->domain->res[1], smd->domain->res[2]);
+ // dt max is 0.1
+ smd->domain->fluid = smoke_init(smd->domain->res, smd->domain->p0, 0.1);
+ smd->time = scene->r.cfra;
+ smd->domain->firstframe = smd->time;
+
+ if(!smd->domain->wt && (smd->domain->flags & MOD_SMOKE_HIGHRES))
+ {
+ smd->domain->wt = smoke_turbulence_init(smd->domain->res, smd->domain->amplify + 1, smd->domain->noise);
+ smoke_turbulence_initBlenderRNA(smd->domain->wt, &smd->domain->strength);
+ }
+
+ if(!smd->domain->view3d)
+ {
+ // TVox is for transparency
+ smd->domain->view3d = MEM_callocN(sizeof(float)*smd->domain->res[0]*smd->domain->res[1]*smd->domain->res[2]*4, "Smoke_tVox");
+ }
+
+ smoke_initBlenderRNA(smd->domain->fluid, &(smd->domain->alpha), &(smd->domain->beta));
+
+ return 1;
+ }
+ else if((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow)
+ {
+ // handle flow object here
+ // XXX TODO
+
+ smd->time = scene->r.cfra;
+
+ // update particle lifetime to be one frame
+ // smd->flow->psys->part->lifetime = scene->r.efra + 1;
+/*
+ if(!smd->flow->bvh)
+ {
+ // smd->flow->bvh = MEM_callocN(sizeof(BVHTreeFromMesh), "smoke_bvhfromfaces");
+ // bvhtree_from_mesh_faces(smd->flow->bvh, dm, 0.0, 2, 6);
+
+ // copy obmat
+ // Mat4CpyMat4(smd->flow->mat, ob->obmat);
+ // Mat4CpyMat4(smd->flow->mat_old, ob->obmat);
+ }
+*/
+
+ return 1;
+ }
+ else if((smd->type & MOD_SMOKE_TYPE_COLL))
+ {
+ smd->time = scene->r.cfra;
+
+ // todo: delete this when loading colls work -dg
+ if(!smd->coll)
+ smokeModifier_createType(smd);
+
+ if(!smd->coll->points)
+ {
+ // init collision points
+ SmokeCollSettings *scs = smd->coll;
+ MVert *mvert = dm->getVertArray(dm);
+ MFace *mface = dm->getFaceArray(dm);
+ size_t i = 0;
+ int divs = 0;
+ int *tridivs = NULL;
+ float cell_len = 1.0 / 50.0; // for res = 50
+ size_t newdivs = 0;
+ //size_t max_points = 0;
+ size_t quads = 0, facecounter = 0;
+
+ // copy obmat
+ Mat4CpyMat4(scs->mat, ob->obmat);
+ Mat4CpyMat4(scs->mat_old, ob->obmat);
+
+ // count quads
+ for(i = 0; i < dm->getNumFaces(dm); i++)
+ {
+ if(mface[i].v4)
+ quads++;
+ }
+
+ calcTriangleDivs(ob, mvert, dm->getNumVerts(dm), mface, dm->getNumFaces(dm), dm->getNumFaces(dm) + quads, &tridivs, cell_len);
+
+ // count triangle divisions
+ for(i = 0; i < dm->getNumFaces(dm) + quads; i++)
+ {
+ divs += (tridivs[3 * i] + 1) * (tridivs[3 * i + 1] + 1) * (tridivs[3 * i + 2] + 1);
+ }
+
+ // printf("divs: %d\n", divs);
+
+ scs->points = MEM_callocN(sizeof(float) * (dm->getNumVerts(dm) + divs) * 3, "SmokeCollPoints");
+
+ for(i = 0; i < dm->getNumVerts(dm); i++)
+ {
+ float tmpvec[3];
+ VECCOPY(tmpvec, mvert[i].co);
+ Mat4MulVecfl (ob->obmat, tmpvec);
+ VECCOPY(&scs->points[i * 3], tmpvec);
+ }
+
+ for(i = 0, facecounter = 0; i < dm->getNumFaces(dm); i++)
+ {
+ int again = 0;
+ do
+ {
+ size_t j, k;
+ int divs1 = tridivs[3 * facecounter + 0];
+ int divs2 = tridivs[3 * facecounter + 1];
+ //int divs3 = tridivs[3 * facecounter + 2];
+ float side1[3], side2[3], trinormorg[3], trinorm[3];
+
+ if(again == 1 && mface[i].v4)
+ {
+ VECSUB(side1, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
+ VECSUB(side2, mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co);
+ }
+ else
+ {
+ VECSUB(side1, mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co);
+ VECSUB(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
+ }
+
+ Crossf(trinormorg, side1, side2);
+ Normalize(trinormorg);
+ VECCOPY(trinorm, trinormorg);
+ VecMulf(trinorm, 0.25 * cell_len);
+
+ for(j = 0; j <= divs1; j++)
+ {
+ for(k = 0; k <= divs2; k++)
+ {
+ float p1[3], p2[3], p3[3], p[3]={0,0,0};
+ const float uf = (float)(j + TRI_UVOFFSET) / (float)(divs1 + 0.0);
+ const float vf = (float)(k + TRI_UVOFFSET) / (float)(divs2 + 0.0);
+ float tmpvec[3];
+
+ if(uf+vf > 1.0)
+ {
+ // printf("bigger - divs1: %d, divs2: %d\n", divs1, divs2);
+ continue;
+ }
+
+ VECCOPY(p1, mvert[ mface[i].v1 ].co);
+ if(again == 1 && mface[i].v4)
+ {
+ VECCOPY(p2, mvert[ mface[i].v3 ].co);
+ VECCOPY(p3, mvert[ mface[i].v4 ].co);
+ }
+ else
+ {
+ VECCOPY(p2, mvert[ mface[i].v2 ].co);
+ VECCOPY(p3, mvert[ mface[i].v3 ].co);
+ }
+
+ VecMulf(p1, (1.0-uf-vf));
+ VecMulf(p2, uf);
+ VecMulf(p3, vf);
+
+ VECADD(p, p1, p2);
+ VECADD(p, p, p3);
+
+ if(newdivs > divs)
+ printf("mem problem\n");
+
+ // mMovPoints.push_back(p + trinorm);
+ VECCOPY(tmpvec, p);
+ VECADD(tmpvec, tmpvec, trinorm);
+ Mat4MulVecfl (ob->obmat, tmpvec);
+ VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
+ newdivs++;
+
+ if(newdivs > divs)
+ printf("mem problem\n");
+
+ // mMovPoints.push_back(p - trinorm);
+ VECCOPY(tmpvec, p);
+ VECSUB(tmpvec, tmpvec, trinorm);
+ Mat4MulVecfl (ob->obmat, tmpvec);
+ VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
+ newdivs++;
+ }
+ }
+
+ if(again == 0 && mface[i].v4)
+ again++;
+ else
+ again = 0;
+
+ facecounter++;
+
+ } while(again!=0);
+ }
+
+ scs->numpoints = dm->getNumVerts(dm) + newdivs;
+
+ MEM_freeN(tridivs);
+ }
+
+ if(!smd->coll->bvhtree)
+ {
+ smd->coll->bvhtree = NULL; // bvhtree_build_from_smoke ( ob->obmat, dm->getFaceArray(dm), dm->getNumFaces(dm), dm->getVertArray(dm), dm->getNumVerts(dm), 0.0 );
+ }
+ return 1;
+ }
+
+ return 1;
+}
+
+/*! init triangle divisions */
+void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *faces, int numfaces, int numtris, int **tridivs, float cell_len)
+{
+ // mTriangleDivs1.resize( faces.size() );
+ // mTriangleDivs2.resize( faces.size() );
+ // mTriangleDivs3.resize( faces.size() );
+
+ size_t i = 0, facecounter = 0;
+ float maxscale[3] = {1,1,1}; // = channelFindMaxVf(mcScale);
+ float maxpart = ABS(maxscale[0]);
+ float scaleFac = 0;
+ float fsTri = 0;
+ if(ABS(maxscale[1])>maxpart) maxpart = ABS(maxscale[1]);
+ if(ABS(maxscale[2])>maxpart) maxpart = ABS(maxscale[2]);
+ scaleFac = 1.0 / maxpart;
+ // featureSize = mLevel[mMaxRefine].nodeSize
+ fsTri = cell_len * 0.5 * scaleFac;
+
+ if(*tridivs)
+ MEM_freeN(*tridivs);
+
+ *tridivs = MEM_callocN(sizeof(int) * numtris * 3, "Smoke_Tridivs");
+
+ for(i = 0, facecounter = 0; i < numfaces; i++)
+ {
+ float p0[3], p1[3], p2[3];
+ float side1[3];
+ float side2[3];
+ float side3[3];
+ int divs1=0, divs2=0, divs3=0;
+
+ VECCOPY(p0, verts[faces[i].v1].co);
+ Mat4MulVecfl (ob->obmat, p0);
+ VECCOPY(p1, verts[faces[i].v2].co);
+ Mat4MulVecfl (ob->obmat, p1);
+ VECCOPY(p2, verts[faces[i].v3].co);
+ Mat4MulVecfl (ob->obmat, p2);
+
+ VECSUB(side1, p1, p0);
+ VECSUB(side2, p2, p0);
+ VECSUB(side3, p1, p2);
+
+ if(INPR(side1, side1) > fsTri*fsTri)
+ {
+ float tmp = Normalize(side1);
+ divs1 = (int)ceil(tmp/fsTri);
+ }
+ if(INPR(side2, side2) > fsTri*fsTri)
+ {
+ float tmp = Normalize(side2);
+ divs2 = (int)ceil(tmp/fsTri);
+
+ /*
+ // debug
+ if(i==0)
+ printf("b tmp: %f, fsTri: %f, divs2: %d\n", tmp, fsTri, divs2);
+ */
+ }
+
+ (*tridivs)[3 * facecounter + 0] = divs1;
+ (*tridivs)[3 * facecounter + 1] = divs2;
+ (*tridivs)[3 * facecounter + 2] = divs3;
+
+ // TODO quad case
+ if(faces[i].v4)
+ {
+ divs1=0, divs2=0, divs3=0;
+
+ facecounter++;
+
+ VECCOPY(p0, verts[faces[i].v3].co);
+ Mat4MulVecfl (ob->obmat, p0);
+ VECCOPY(p1, verts[faces[i].v4].co);
+ Mat4MulVecfl (ob->obmat, p1);
+ VECCOPY(p2, verts[faces[i].v1].co);
+ Mat4MulVecfl (ob->obmat, p2);
+
+ VECSUB(side1, p1, p0);
+ VECSUB(side2, p2, p0);
+ VECSUB(side3, p1, p2);
+
+ if(INPR(side1, side1) > fsTri*fsTri)
+ {
+ float tmp = Normalize(side1);
+ divs1 = (int)ceil(tmp/fsTri);
+ }
+ if(INPR(side2, side2) > fsTri*fsTri)
+ {
+ float tmp = Normalize(side2);
+ divs2 = (int)ceil(tmp/fsTri);
+ }
+
+ (*tridivs)[3 * facecounter + 0] = divs1;
+ (*tridivs)[3 * facecounter + 1] = divs2;
+ (*tridivs)[3 * facecounter + 2] = divs3;
+ }
+ facecounter++;
+ }
+}
+
+void smokeModifier_freeDomain(SmokeModifierData *smd)
+{
+ if(smd->domain)
+ {
+ // free visualisation buffers
+ if(smd->domain->view3d)
+ MEM_freeN(smd->domain->view3d);
+
+ if(smd->domain->fluid)
+ smoke_free(smd->domain->fluid);
+
+ if(smd->domain->wt)
+ smoke_turbulence_free(smd->domain->wt);
+
+ BKE_ptcache_free_list(&(smd->domain->ptcaches[0]));
+ smd->domain->point_cache[0] = NULL;
+ BKE_ptcache_free_list(&(smd->domain->ptcaches[1]));
+ smd->domain->point_cache[1] = NULL;
+
+ MEM_freeN(smd->domain);
+ smd->domain = NULL;
+ }
+}
+
+void smokeModifier_freeFlow(SmokeModifierData *smd)
+{
+ if(smd->flow)
+ {
+/*
+ if(smd->flow->bvh)
+ {
+ free_bvhtree_from_mesh(smd->flow->bvh);
+ MEM_freeN(smd->flow->bvh);
+ }
+ smd->flow->bvh = NULL;
+*/
+ MEM_freeN(smd->flow);
+ smd->flow = NULL;
+ }
+}
+
+void smokeModifier_freeCollision(SmokeModifierData *smd)
+{
+ if(smd->coll)
+ {
+ if(smd->coll->points)
+ {
+ MEM_freeN(smd->coll->points);
+ smd->coll->points = NULL;
+ }
+
+ if(smd->coll->bvhtree)
+ {
+ BLI_bvhtree_free(smd->coll->bvhtree);
+ smd->coll->bvhtree = NULL;
+ }
+
+ if(smd->coll->dm)
+ smd->coll->dm->release(smd->coll->dm);
+ smd->coll->dm = NULL;
+
+ MEM_freeN(smd->coll);
+ smd->coll = NULL;
+ }
+}
+
+void smokeModifier_reset(struct SmokeModifierData *smd)
+{
+ if(smd)
+ {
+ if(smd->domain)
+ {
+ if(smd->domain->view3d)
+ MEM_freeN(smd->domain->view3d);
+ smd->domain->view3d = NULL;
+
+ smd->domain->tex = NULL;
+
+ if(smd->domain->fluid)
+ {
+ smoke_free(smd->domain->fluid);
+ smd->domain->fluid = NULL;
+ }
+
+ if(smd->domain->wt)
+ {
+ smoke_turbulence_free(smd->domain->wt);
+ smd->domain->wt = NULL;
+ }
+
+ smd->domain->point_cache[0]->flag &= ~PTCACHE_SIMULATION_VALID;
+ smd->domain->point_cache[0]->flag |= PTCACHE_OUTDATED;
+ smd->domain->point_cache[0]->simframe= 0;
+ smd->domain->point_cache[0]->last_exact= 0;
+
+ smd->domain->point_cache[1]->flag &= ~PTCACHE_SIMULATION_VALID;
+ smd->domain->point_cache[1]->flag |= PTCACHE_OUTDATED;
+ smd->domain->point_cache[1]->simframe= 0;
+ smd->domain->point_cache[1]->last_exact= 0;
+
+ // printf("reset_domain\n");
+ }
+ else if(smd->flow)
+ {
+ /*
+ if(smd->flow->bvh)
+ {
+ free_bvhtree_from_mesh(smd->flow->bvh);
+ MEM_freeN(smd->flow->bvh);
+ }
+ smd->flow->bvh = NULL;
+ */
+ }
+ else if(smd->coll)
+ {
+ if(smd->coll->points)
+ {
+ MEM_freeN(smd->coll->points);
+ smd->coll->points = NULL;
+ }
+
+ if(smd->coll->bvhtree)
+ {
+ BLI_bvhtree_free(smd->coll->bvhtree);
+ smd->coll->bvhtree = NULL;
+ }
+
+ if(smd->coll->dm)
+ smd->coll->dm->release(smd->coll->dm);
+ smd->coll->dm = NULL;
+
+ }
+ }
+}
+
+void smokeModifier_free (SmokeModifierData *smd)
+{
+ if(smd)
+ {
+ smokeModifier_freeDomain(smd);
+ smokeModifier_freeFlow(smd);
+ smokeModifier_freeCollision(smd);
+ }
+}
+
+void smokeModifier_createType(struct SmokeModifierData *smd)
+{
+ if(smd)
+ {
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ {
+ if(smd->domain)
+ smokeModifier_freeDomain(smd);
+
+ smd->domain = MEM_callocN(sizeof(SmokeDomainSettings), "SmokeDomain");
+
+ smd->domain->smd = smd;
+
+ smd->domain->point_cache[0] = BKE_ptcache_add(&(smd->domain->ptcaches[0]));
+ smd->domain->point_cache[0]->flag |= PTCACHE_DISK_CACHE;
+ smd->domain->point_cache[0]->step = 1;
+
+ smd->domain->point_cache[1] = BKE_ptcache_add(&(smd->domain->ptcaches[1]));
+ smd->domain->point_cache[1]->flag |= PTCACHE_DISK_CACHE;
+ smd->domain->point_cache[1]->step = 1;
+
+ /* set some standard values */
+ smd->domain->fluid = NULL;
+ smd->domain->eff_group = NULL;
+ smd->domain->fluid_group = NULL;
+ smd->domain->coll_group = NULL;
+ smd->domain->maxres = 32;
+ smd->domain->alpha = -0.001;
+ smd->domain->beta = 0.1;
+ smd->domain->flags = MOD_SMOKE_DISSOLVE_LOG;
+ smd->domain->diss_speed = 5;
+ smd->domain->strength = 2.0f;
+ smd->domain->amplify = 1;
+ smd->domain->noise = MOD_SMOKE_NOISEWAVE;
+ smd->domain->wt = NULL;
+
+ // init 3dview buffer
+ smd->domain->view3d = NULL;
+ smd->domain->tex = NULL;
+ }
+ else if(smd->type & MOD_SMOKE_TYPE_FLOW)
+ {
+ if(smd->flow)
+ smokeModifier_freeFlow(smd);
+
+ smd->flow = MEM_callocN(sizeof(SmokeFlowSettings), "SmokeFlow");
+
+ smd->flow->smd = smd;
+
+ /* set some standard values */
+ smd->flow->density = 1.0;
+ smd->flow->temp = 1.0;
+
+ smd->flow->psys = NULL;
+
+ }
+ else if(smd->type & MOD_SMOKE_TYPE_COLL)
+ {
+ if(smd->coll)
+ smokeModifier_freeCollision(smd);
+
+ smd->coll = MEM_callocN(sizeof(SmokeCollSettings), "SmokeColl");
+
+ smd->coll->smd = smd;
+ smd->coll->points = NULL;
+ smd->coll->numpoints = 0;
+ smd->coll->bvhtree = NULL;
+ smd->coll->dm = NULL;
+ }
+ }
+}
+
+// forward declaration
+void smoke_simulate_domain(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm);
+
+void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc)
+{
+ if((smd->type & MOD_SMOKE_TYPE_FLOW))
+ {
+ if(scene->r.cfra >= smd->time)
+ smokeModifier_init(smd, ob, scene, dm);
+
+ if(scene->r.cfra > smd->time)
+ {
+ // XXX TODO
+ smd->time = scene->r.cfra;
+
+ // rigid movement support
+ /*
+ Mat4CpyMat4(smd->flow->mat_old, smd->flow->mat);
+ Mat4CpyMat4(smd->flow->mat, ob->obmat);
+ */
+ }
+ else if(scene->r.cfra < smd->time)
+ {
+ smd->time = scene->r.cfra;
+ smokeModifier_reset(smd);
+ }
+ }
+ else if(smd->type & MOD_SMOKE_TYPE_COLL)
+ {
+ if(scene->r.cfra >= smd->time)
+ smokeModifier_init(smd, ob, scene, dm);
+
+ if(scene->r.cfra > smd->time)
+ {
+ // XXX TODO
+ smd->time = scene->r.cfra;
+
+ if(smd->coll->dm)
+ smd->coll->dm->release(smd->coll->dm);
+
+ smd->coll->dm = CDDM_copy(dm);
+
+ // rigid movement support
+ Mat4CpyMat4(smd->coll->mat_old, smd->coll->mat);
+ Mat4CpyMat4(smd->coll->mat, ob->obmat);
+ }
+ else if(scene->r.cfra < smd->time)
+ {
+ smd->time = scene->r.cfra;
+ smokeModifier_reset(smd);
+ }
+ }
+ else if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ {
+ PointCache *cache;
+ PTCacheID pid;
+ float timescale;
+ int cache_result = 0;
+ int startframe, endframe, framenr;
+ SmokeDomainSettings *sds = smd->domain;
+ float light[3] = {0.0,0.0,0.0};
+ int have_lamp = 0;
+
+ // printf("smd->type & MOD_SMOKE_TYPE_DOMAIN\n");
+
+ framenr = scene->r.cfra;
+
+ cache = sds->point_cache[0];
+
+ BKE_ptcache_id_from_smoke(&pid, ob, smd);
+ BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, &timescale);
+
+ /* handle continuous simulation with the play button */
+ if(BKE_ptcache_get_continue_physics())
+ {
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
+ cache->simframe= 0;
+ cache->last_exact= 0;
+
+ if(!smokeModifier_init(smd, ob, scene, dm))
+ return;
+
+ if(!smd->domain->fluid)
+ return;
+
+ smoke_simulate_domain(smd, scene, ob, dm);
+
+ {
+ Base *base_tmp = NULL;
+
+ for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next)
+ {
+ if(base_tmp->object->type == OB_LAMP)
+ {
+ Lamp *la = (Lamp *)base_tmp->object->data;
+
+ if(la->type == LA_LOCAL)
+ {
+ VECCOPY(light, base_tmp->object->obmat[3]);
+ have_lamp = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ smoke_prepare_View(smd, (float)framenr, light, have_lamp);
+
+ return;
+ }
+
+ if(framenr < startframe)
+ {
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
+ cache->simframe= 0;
+ cache->last_exact= 0;
+
+ // we got back in time, reset smoke in this case (TODO: use cache later)
+ // smd->time = scene->r.cfra;
+ // smokeModifier_reset(smd);
+
+ return;
+ }
+ else if(framenr > endframe)
+ {
+ framenr = endframe;
+ }
+
+ if(!(cache->flag & PTCACHE_SIMULATION_VALID))
+ {
+ // printf("reseting\n");
+ BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
+ }
+
+ if(!smokeModifier_init(smd, ob, scene, dm))
+ return;
+
+ if(!smd->domain->fluid)
+ return;
+
+ /* try to read from cache */
+ cache_result = BKE_ptcache_read_cache(&pid, (float)framenr, scene->r.frs_sec);
+ // printf("cache_result: %d\n", cache_result);
+
+ if(cache_result == PTCACHE_READ_EXACT)
+ {
+ SmokeDomainSettings *sds = smd->domain;
+
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+ cache->simframe= framenr;
+ sds->v3dnum = framenr;
+
+ // printf("PTCACHE_READ_EXACT\n");
+ return;
+ }
+ else if(cache_result==PTCACHE_READ_OLD)
+ {
+ BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE);
+
+ // printf("PTCACHE_READ_OLD\n");
+
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+ }
+ else if(ob->id.lib || (cache->flag & PTCACHE_BAKED))
+ {
+ /* if baked and nothing in cache, do nothing */
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
+ cache->simframe= 0;
+ cache->last_exact= 0;
+
+ // printf("PTCACHE_BAKED\n");
+ return;
+ }
+ else if((cache_result==0) && (startframe!=framenr) && !(cache->flag & PTCACHE_SIMULATION_VALID))
+ {
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
+ cache->simframe= 0;
+ cache->last_exact= 0;
+
+ return;
+ }
+
+ /* do simulation */
+
+ // low res
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+ cache->simframe= framenr;
+
+ smoke_simulate_domain(smd, scene, ob, dm);
+
+ if(sds->wt)
+ smoke_turbulence_step(sds->wt, sds->fluid);
+
+ {
+ Base *base_tmp = NULL;
+
+ for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next)
+ {
+ if(base_tmp->object->type == OB_LAMP)
+ {
+ Lamp *la = (Lamp *)base_tmp->object->data;
+
+ if(la->type == LA_LOCAL)
+ {
+ VECCOPY(light, base_tmp->object->obmat[3]);
+ have_lamp = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ smoke_prepare_View(smd, (float)framenr, light, have_lamp);
+
+ BKE_ptcache_write_cache(&pid, framenr);
+
+ // printf("Writing cache_low, %d\n", framenr);
+
+
+ tend();
+ // printf ( "Frame: %d, Time: %f\n", (int)smd->time, ( float ) tval() );
+ }
+}
+
+void smoke_simulate_domain(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm)
+{
+ GroupObject *go = NULL;
+ Base *base = NULL;
+ SmokeDomainSettings *sds = smd->domain;
+
+ tstart();
+
+ if(sds->flags & MOD_SMOKE_DISSOLVE)
+ smoke_dissolve(sds->fluid, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG);
+
+ // do flows and fluids
+ if(1)
+ {
+ Object *otherobj = NULL;
+ ModifierData *md = NULL;
+
+ if(sds->fluid_group) // we use groups since we have 2 domains
+ go = sds->fluid_group->gobject.first;
+ else
+ base = scene->base.first;
+
+ while(base || go)
+ {
+ otherobj = NULL;
+
+ if(sds->fluid_group)
+ {
+ if(go->ob)
+ otherobj = go->ob;
+ }
+ else
+ otherobj = base->object;
+
+ if(!otherobj)
+ {
+ if(sds->fluid_group)
+ go = go->next;
+ else
+ base= base->next;
+
+ continue;
+ }
+
+ md = modifiers_findByType(otherobj, eModifierType_Smoke);
+
+ // check for active smoke modifier
+ if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
+ {
+ SmokeModifierData *smd2 = (SmokeModifierData *)md;
+
+ // check for initialized smoke object
+ if((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+ {
+ // we got nice flow object
+ SmokeFlowSettings *sfs = smd2->flow;
+
+ if(sfs->psys && sfs->psys->part && sfs->psys->part->type==PART_EMITTER) // is particle system selected
+ {
+ ParticleSystem *psys = sfs->psys;
+ ParticleSettings *part=psys->part;
+ ParticleData *pa = NULL;
+ int p = 0;
+ float *density = smoke_get_density(sds->fluid);
+ // float *bigdensity = smoke_turbulence_get_density(sds->wt);
+ float *heat = smoke_get_heat(sds->fluid);
+ float *velocity_x = smoke_get_velocity_x(sds->fluid);
+ float *velocity_y = smoke_get_velocity_y(sds->fluid);
+ float *velocity_z = smoke_get_velocity_z(sds->fluid);
+ unsigned char *obstacle = smoke_get_obstacle(sds->fluid);
+
+ // debug printf("found flow psys\n");
+
+ // mostly copied from particle code
+ for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++)
+ {
+ int cell[3];
+ size_t i = 0;
+ size_t index = 0;
+ int badcell = 0;
+
+ if(pa->alive == PARS_KILLED) continue;
+ else if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0) continue;
+ else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue;
+ else if(pa->flag & (PARS_UNEXIST+PARS_NO_DISP)) continue;
+
+ // VECCOPY(pos, pa->state.co);
+ // Mat4MulVecfl (ob->imat, pos);
+
+ // 1. get corresponding cell
+ get_cell(sds->p0, sds->res, sds->dx, pa->state.co, cell, 0);
+
+ // check if cell is valid (in the domain boundary)
+ for(i = 0; i < 3; i++)
+ {
+ if((cell[i] > sds->res[i] - 1) || (cell[i] < 0))
+ {
+ badcell = 1;
+ break;
+ }
+ }
+
+ if(badcell)
+ continue;
+
+ // 2. set cell values (heat, density and velocity)
+ index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]);
+
+ if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) && !(obstacle[index] & 2)) // this is inflow
+ {
+ // heat[index] += sfs->temp * 0.1;
+ // density[index] += sfs->density * 0.1;
+
+ heat[index] = sfs->temp;
+ density[index] = sfs->density;
+
+ /*
+ velocity_x[index] = pa->state.vel[0];
+ velocity_y[index] = pa->state.vel[1];
+ velocity_z[index] = pa->state.vel[2];
+ */
+ obstacle[index] |= 2;
+ }
+ else if(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) // outflow
+ {
+ heat[index] = 0.f;
+ density[index] = 0.f;
+ velocity_x[index] = 0.f;
+ velocity_y[index] = 0.f;
+ velocity_z[index] = 0.f;
+ }
+ }
+ }
+ else
+ {
+ /*
+ for()
+ {
+ // no psys
+ BVHTreeNearest nearest;
+
+ nearest.index = -1;
+ nearest.dist = FLT_MAX;
+
+ BLI_bvhtree_find_nearest(sfs->bvh->tree, pco, &nearest, sfs->bvh->nearest_callback, sfs->bvh);
+ }*/
+ }
+ }
+ }
+
+ if(sds->fluid_group)
+ go = go->next;
+ else
+ base= base->next;
+ }
+ }
+
+ // do effectors
+ /*
+ if(sds->eff_group)
+ {
+ for(go = sds->eff_group->gobject.first; go; go = go->next)
+ {
+ if(go->ob)
+ {
+ if(ob->pd)
+ {
+
+ }
+ }
+ }
+ }
+ */
+
+ // do collisions
+ if(1)
+ {
+ Object *otherobj = NULL;
+ ModifierData *md = NULL;
+
+ if(sds->coll_group) // we use groups since we have 2 domains
+ go = sds->coll_group->gobject.first;
+ else
+ base = scene->base.first;
+
+ while(base || go)
+ {
+ otherobj = NULL;
+
+ if(sds->coll_group)
+ {
+ if(go->ob)
+ otherobj = go->ob;
+ }
+ else
+ otherobj = base->object;
+
+ if(!otherobj)
+ {
+ if(sds->coll_group)
+ go = go->next;
+ else
+ base= base->next;
+
+ continue;
+ }
+
+ md = modifiers_findByType(otherobj, eModifierType_Smoke);
+
+ // check for active smoke modifier
+ if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render))
+ {
+ SmokeModifierData *smd2 = (SmokeModifierData *)md;
+
+ if((smd2->type & MOD_SMOKE_TYPE_COLL) && smd2->coll)
+ {
+ // we got nice collision object
+ SmokeCollSettings *scs = smd2->coll;
+ size_t i, j;
+ unsigned char *obstacles = smoke_get_obstacle(smd->domain->fluid);
+
+ for(i = 0; i < scs->numpoints; i++)
+ {
+ int badcell = 0;
+ size_t index = 0;
+ int cell[3];
+
+ // 1. get corresponding cell
+ get_cell(sds->p0, sds->res, sds->dx, &scs->points[3 * i], cell, 0);
+
+ // check if cell is valid (in the domain boundary)
+ for(j = 0; j < 3; j++)
+ if((cell[j] > sds->res[j] - 1) || (cell[j] < 0))
+ {
+ badcell = 1;
+ break;
+ }
+
+ if(badcell)
+ continue;
+
+ // 2. set cell values (heat, density and velocity)
+ index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]);
+
+ // printf("cell[0]: %d, cell[1]: %d, cell[2]: %d\n", cell[0], cell[1], cell[2]);
+ // printf("res[0]: %d, res[1]: %d, res[2]: %d, index: %d\n\n", sds->res[0], sds->res[1], sds->res[2], index);
+
+ obstacles[index] = 1;
+
+ // for moving gobstacles
+ /*
+ const LbmFloat maxVelVal = 0.1666;
+ const LbmFloat maxusqr = maxVelVal*maxVelVal*3. *1.5;
+
+ LbmVec objvel = vec2L((mMOIVertices[n]-mMOIVerticesOld[n]) /dvec); {
+ const LbmFloat usqr = (objvel[0]*objvel[0]+objvel[1]*objvel[1]+objvel[2]*objvel[2])*1.5;
+ USQRMAXCHECK(usqr, objvel[0],objvel[1],objvel[2], mMaxVlen, mMxvx,mMxvy,mMxvz);
+ if(usqr>maxusqr) {
+ // cutoff at maxVelVal
+ for(int jj=0; jj<3; jj++) {
+ if(objvel[jj]>0.) objvel[jj] = maxVelVal;
+ if(objvel[jj]<0.) objvel[jj] = -maxVelVal;
+ }
+ } }
+
+ const LbmFloat dp=dot(objvel, vec2L((*pNormals)[n]) );
+ const LbmVec oldov=objvel; // debug
+ objvel = vec2L((*pNormals)[n]) *dp;
+ */
+ }
+ }
+ }
+
+ if(sds->coll_group)
+ go = go->next;
+ else
+ base= base->next;
+ }
+ }
+
+ // set new time
+ smd->time = scene->r.cfra;
+
+ // simulate the actual smoke (c++ code in intern/smoke)
+ smoke_step(sds->fluid, smd->time);
+}
+
+static int calc_voxel_transp(float *input, int res[3], int *pixel, float *tRay)
+{
+ const size_t index = smoke_get_index(pixel[0], res[0], pixel[1], res[1], pixel[2]);
+
+ // T_ray *= T_vox
+ *tRay *= input[index*4];
+
+ return *tRay;
+}
+
+// forward decleration
+void smoke_calc_transparency(float *result, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb);
+
+// update necessary information for 3dview
+void smoke_prepare_View(SmokeModifierData *smd, float framenr, float *light, int have_light)
+{
+ float *density = NULL;
+ int x, y, z;
+ size_t cells, i;
+ SmokeDomainSettings *sds = smd->domain;
+
+ // update 3dview
+ density = smoke_get_density(smd->domain->fluid);
+ for(x = 0; x < smd->domain->res[0]; x++)
+ for(y = 0; y < smd->domain->res[1]; y++)
+ for(z = 0; z < smd->domain->res[2]; z++)
+ {
+ size_t index;
+
+ index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z);
+ // Transparency computation
+ // formula taken from "Visual Simulation of Smoke" / Fedkiw et al. pg. 4
+ // T_vox = exp(-C_ext * h)
+ // C_ext/sigma_t = density * C_ext
+ smd->domain->view3d[index * 4] = smd->domain->view3d[index * 4 + 1] =
+ smd->domain->view3d[index * 4 + 2] = exp(-density[index] * 7.0 * smd->domain->dx);
+ smd->domain->view3d[index * 4 + 3] = 1.0 - smd->domain->view3d[index * 4];
+
+ }
+
+ if(have_light)
+ {
+ smoke_calc_transparency(sds->view3d, sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp);
+
+ cells = smd->domain->res[0]*smd->domain->res[1]*smd->domain->res[2];
+ for(i = 0; i < cells; i++)
+ {
+ smd->domain->view3d[i * 4] = smd->domain->view3d[i * 4 + 1] =
+ smd->domain->view3d[i * 4 + 2] = smd->domain->view3d[i * 4 + 1] * smd->domain->view3d[i * 4 + 0];
+ }
+ }
+ smd->domain->v3dnum = framenr;
+}
+
+long long smoke_get_mem_req(int xres, int yres, int zres, int amplify)
+{
+ int totalCells = xres * yres * zres;
+ int amplifiedCells = totalCells * amplify * amplify * amplify;
+
+ // print out memory requirements
+ long long int coarseSize = sizeof(float) * totalCells * 22 +
+ sizeof(unsigned char) * totalCells;
+
+ long long int fineSize = sizeof(float) * amplifiedCells * 7 + // big grids
+ sizeof(float) * totalCells * 8 + // small grids
+ sizeof(float) * 128 * 128 * 128; // noise tile
+
+ long long int totalMB = (coarseSize + fineSize) / (1024 * 1024);
+
+ return totalMB;
+}
+
+static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, float *tRay, bresenham_callback cb, float *input, int res[3])
+{
+ int dx, dy, dz, i, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2;
+ int pixel[3];
+
+ pixel[0] = x1;
+ pixel[1] = y1;
+ pixel[2] = z1;
+
+ dx = x2 - x1;
+ dy = y2 - y1;
+ dz = z2 - z1;
+
+ x_inc = (dx < 0) ? -1 : 1;
+ l = abs(dx);
+ y_inc = (dy < 0) ? -1 : 1;
+ m = abs(dy);
+ z_inc = (dz < 0) ? -1 : 1;
+ n = abs(dz);
+ dx2 = l << 1;
+ dy2 = m << 1;
+ dz2 = n << 1;
+
+ if ((l >= m) && (l >= n)) {
+ err_1 = dy2 - l;
+ err_2 = dz2 - l;
+ for (i = 0; i < l; i++) {
+ if(cb(input, res, pixel, tRay) < 0.0)
+ return;
+ if (err_1 > 0) {
+ pixel[1] += y_inc;
+ err_1 -= dx2;
+ }
+ if (err_2 > 0) {
+ pixel[2] += z_inc;
+ err_2 -= dx2;
+ }
+ err_1 += dy2;
+ err_2 += dz2;
+ pixel[0] += x_inc;
+ }
+ } else if ((m >= l) && (m >= n)) {
+ err_1 = dx2 - m;
+ err_2 = dz2 - m;
+ for (i = 0; i < m; i++) {
+ if(cb(input, res, pixel, tRay) < 0.0f)
+ return;
+ if (err_1 > 0) {
+ pixel[0] += x_inc;
+ err_1 -= dy2;
+ }
+ if (err_2 > 0) {
+ pixel[2] += z_inc;
+ err_2 -= dy2;
+ }
+ err_1 += dx2;
+ err_2 += dz2;
+ pixel[1] += y_inc;
+ }
+ } else {
+ err_1 = dy2 - n;
+ err_2 = dx2 - n;
+ for (i = 0; i < n; i++) {
+ if(cb(input, res, pixel, tRay) < 0.0f)
+ return;
+ if (err_1 > 0) {
+ pixel[1] += y_inc;
+ err_1 -= dz2;
+ }
+ if (err_2 > 0) {
+ pixel[0] += x_inc;
+ err_2 -= dz2;
+ }
+ err_1 += dy2;
+ err_2 += dx2;
+ pixel[2] += z_inc;
+ }
+ }
+ cb(input, res, pixel, tRay);
+}
+
+static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct)
+{
+ float tmp[3];
+
+ VECSUB(tmp, pos, p0);
+ VecMulf(tmp, 1.0 / dx);
+
+ if(correct)
+ {
+ cell[0] = MIN2(res[0] - 1, MAX2(0, (int)floor(tmp[0])));
+ cell[1] = MIN2(res[1] - 1, MAX2(0, (int)floor(tmp[1])));
+ cell[2] = MIN2(res[2] - 1, MAX2(0, (int)floor(tmp[2])));
+ }
+ else
+ {
+ cell[0] = (int)floor(tmp[0]);
+ cell[1] = (int)floor(tmp[1]);
+ cell[2] = (int)floor(tmp[2]);
+ }
+}
+
+void smoke_calc_transparency(float *result, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb)
+{
+ int x, y, z;
+ float bv[6];
+
+ // x
+ bv[0] = p0[0];
+ bv[1] = p1[0];
+ // y
+ bv[2] = p0[1];
+ bv[3] = p1[1];
+ // z
+ bv[4] = p0[2];
+ bv[5] = p1[2];
+
+// #pragma omp parallel for schedule(static) private(y, z)
+ for(x = 0; x < res[0]; x++)
+ for(y = 0; y < res[1]; y++)
+ for(z = 0; z < res[2]; z++)
+ {
+ float voxelCenter[3];
+ size_t index;
+ float pos[3];
+ int cell[3];
+ float tRay = 1.0;
+
+ index = smoke_get_index(x, res[0], y, res[1], z);
+
+ voxelCenter[0] = p0[0] + dx * x + dx * 0.5;
+ voxelCenter[1] = p0[1] + dx * y + dx * 0.5;
+ voxelCenter[2] = p0[2] + dx * z + dx * 0.5;
+
+ // get starting position (in voxel coords)
+ if(BLI_bvhtree_bb_raycast(bv, light, voxelCenter, pos) > FLT_EPSILON)
+ {
+ // we're ouside
+ get_cell(p0, res, dx, pos, cell, 1);
+ }
+ else
+ {
+ // we're inside
+ get_cell(p0, res, dx, light, cell, 1);
+ }
+
+ bresenham_linie_3D(cell[0], cell[1], cell[2], x, y, z, &tRay, cb, result, res);
+
+ // convention -> from a RGBA float array, use G value for tRay
+ result[index*4 + 1] = tRay;
+ }
+}
+
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index fe63585ae1c..40a28251495 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -866,7 +866,8 @@ static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring
bp->frozen = 1.0f;
bp->colball = 0.0f;
bp->flag = 0;
-
+ bp->springweight = 1.0f;
+ bp->mass = sb->nodemass;
}
}
}
@@ -3687,66 +3688,6 @@ static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts,
}
}
-void sbWriteCache(Object *ob, int framenr)
-{
- SoftBody *sb= ob->soft;
- BodyPoint *bp;
- PTCacheID pid;
- PTCacheFile *pf;
- int a;
-
- if(sb->totpoint == 0)
- return;
-
- BKE_ptcache_id_from_softbody(&pid, ob, sb);
- pf= BKE_ptcache_file_open(&pid, PTCACHE_FILE_WRITE, framenr);
- if(!pf)
- return;
-
- for(a=0, bp=sb->bpoint; a<sb->totpoint; a++, bp++)
- BKE_ptcache_file_write_floats(pf, bp->pos, 3);
-
- for(a=0, bp=sb->bpoint; a<sb->totpoint; a++, bp++)
- BKE_ptcache_file_write_floats(pf, bp->vec, 3);
-
- BKE_ptcache_file_close(pf);
-}
-
-static int softbody_read_cache(Object *ob, float framenr)
-{
- SoftBody *sb= ob->soft;
- BodyPoint *bp;
- PTCacheID pid;
- PTCacheFile *pf;
- int a;
-
- if(sb->totpoint == 0)
- return 0;
-
- BKE_ptcache_id_from_softbody(&pid, ob, sb);
- pf= BKE_ptcache_file_open(&pid, PTCACHE_FILE_READ, framenr);
- if(!pf)
- return 0;
-
- for(a=0, bp=sb->bpoint; a<sb->totpoint; a++, bp++) {
- if(!BKE_ptcache_file_read_floats(pf, bp->pos, 3)) {
- BKE_ptcache_file_close(pf);
- return 0;
- }
- }
-
- for(a=0, bp=sb->bpoint; a<sb->totpoint; a++, bp++) {
- if(!BKE_ptcache_file_read_floats(pf, bp->vec, 3)) {
- BKE_ptcache_file_close(pf);
- return 0;
- }
- }
-
- BKE_ptcache_file_close(pf);
-
- return 1;
-}
-
/* +++ ************ maintaining scratch *************** */
static void sb_new_scratch(SoftBody *sb)
{
@@ -3806,7 +3747,7 @@ SoftBody *sbNew(Scene *scene)
sb->shearstiff = 1.0f;
sb->solverflags |= SBSO_OLDERR;
- sb->pointcache = BKE_ptcache_add();
+ sb->pointcache = BKE_ptcache_add(&sb->ptcaches);
return sb;
}
@@ -3815,7 +3756,8 @@ SoftBody *sbNew(Scene *scene)
void sbFree(SoftBody *sb)
{
free_softbody_intern(sb);
- BKE_ptcache_free(sb->pointcache);
+ BKE_ptcache_free_list(&sb->ptcaches);
+ sb->pointcache = NULL;
MEM_freeN(sb);
}
@@ -4114,6 +4056,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
PTCacheID pid;
float dtime, timescale;
int framedelta, framenr, startframe, endframe;
+ int cache_result;
cache= sb->pointcache;
@@ -4128,7 +4071,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
if(sb->bpoint && numVerts != sb->totpoint) {
cache->flag &= ~PTCACHE_SIMULATION_VALID;
cache->simframe= 0;
-
+ cache->last_exact= 0;
return;
}
@@ -4136,6 +4079,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
if(framenr < startframe) {
cache->flag &= ~PTCACHE_SIMULATION_VALID;
cache->simframe= 0;
+ cache->last_exact= 0;
return;
}
@@ -4198,26 +4142,35 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
}
/* try to read from cache */
- if(softbody_read_cache(ob, framenr)) {
- if(sb->particles==0)
- softbody_to_object(ob, vertexCos, numVerts, sb->local);
+ cache_result = BKE_ptcache_read_cache(&pid, framenr, scene->r.frs_sec);
+ if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
cache->flag |= PTCACHE_SIMULATION_VALID;
cache->simframe= framenr;
+ if(sb->particles==0)
+ softbody_to_object(ob, vertexCos, numVerts, sb->local);
+
return;
}
+ else if(cache_result==PTCACHE_READ_OLD) {
+ BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE);
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+ }
else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {
/* if baked and nothing in cache, do nothing */
- if(cache->flag & PTCACHE_SIMULATION_VALID) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- }
-
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
+ cache->simframe= 0;
+ cache->last_exact= 0;
return;
}
if(framenr == startframe) {
+ if(cache->flag & PTCACHE_REDO_NEEDED) {
+ softbody_update_positions(ob, sb, vertexCos, numVerts);
+ softbody_reset(ob, sb, vertexCos, numVerts);
+ cache->flag &= ~PTCACHE_REDO_NEEDED;
+ }
/* first frame, no simulation to do, just set the positions */
softbody_update_positions(ob, sb, vertexCos, numVerts);
@@ -4227,10 +4180,10 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
/* don't write cache on first frame, but on second frame write
* cache for frame 1 and 2 */
}
- else if(framedelta == 1) {
+ else {
/* if on second frame, write cache for first frame */
- if(framenr == startframe+1)
- sbWriteCache(ob, startframe);
+ if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
+ BKE_ptcache_write_cache(&pid, startframe);
softbody_update_positions(ob, sb, vertexCos, numVerts);
@@ -4246,14 +4199,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
if(sb->particles==0)
softbody_to_object(ob, vertexCos, numVerts, 0);
- sbWriteCache(ob, framenr);
- }
- else {
- /* time step backwards or too large forward - do nothing */
- if(cache->flag & PTCACHE_SIMULATION_VALID) {
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->simframe= 0;
- }
+ BKE_ptcache_write_cache(&pid, framenr);
}
}
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 2c5b49246fb..06ef8a23142 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -1,6 +1,6 @@
/**
* sound.c (mar-2001 nzc)
- *
+ *
* $Id$
*/
@@ -14,125 +14,468 @@
#include "DNA_scene_types.h"
#include "DNA_sound_types.h"
#include "DNA_packedFile_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_userdef_types.h"
+
+#include "AUD_C-API.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_sound.h"
+#include "BKE_context.h"
+#include "BKE_library.h"
#include "BKE_packedFile.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-ListBase _samples = {0,0}, *samples = &_samples;
+void sound_init()
+{
+ AUD_Specs specs;
+ int device, buffersize;
+
+ device = U.audiodevice;
+ buffersize = U.mixbufsize;
+ specs.channels = U.audiochannels;
+ specs.format = U.audioformat;
+ specs.rate = U.audiorate;
+
+ if(buffersize < 128)
+ buffersize = AUD_DEFAULT_BUFFER_SIZE;
+
+ if(specs.rate < AUD_RATE_8000)
+ specs.rate = AUD_RATE_44100;
+
+ if(specs.format <= AUD_FORMAT_INVALID)
+ specs.format = AUD_FORMAT_S16;
+
+ if(specs.channels <= AUD_CHANNELS_INVALID)
+ specs.channels = AUD_CHANNELS_STEREO;
+
+ if(!AUD_init(device, specs, buffersize))
+ AUD_init(AUD_NULL_DEVICE, specs, buffersize);
+}
-void sound_free_sound(bSound *sound)
+void sound_exit()
{
- /* when sounds have been loaded, but not played, the packedfile was not copied
- to sample block and not freed otherwise */
- if(sound->sample==NULL) {
- if (sound->newpackedfile) {
- freePackedFile(sound->newpackedfile);
- sound->newpackedfile = NULL;
- }
+ AUD_exit();
+}
+
+struct bSound* sound_new_file(struct Main *main, char* filename)
+{
+ bSound* sound = NULL;
+
+ char str[FILE_MAX];
+ int len;
+
+ strcpy(str, filename);
+ BLI_convertstringcode(str, main->name);
+
+ len = strlen(filename);
+ while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
+ len--;
+
+ sound = alloc_libblock(&main->sound, ID_SO, filename+len);
+ strcpy(sound->name, filename);
+// XXX unused currently sound->type = SOUND_TYPE_FILE;
+
+ sound_load(main, sound);
+
+ if(!sound->handle)
+ {
+ free_libblock(&main->sound, sound);
+ sound = NULL;
+ }
+
+ return sound;
+}
+
+// XXX unused currently
+#if 0
+struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
+{
+ bSound* sound = NULL;
+
+ char name[25];
+ strcpy(name, "buf_");
+ strcpy(name + 4, source->id.name);
+
+ sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
+
+ sound->child_sound = source;
+ sound->type = SOUND_TYPE_BUFFER;
+
+ sound_load(CTX_data_main(C), sound);
+
+ if(!sound->handle)
+ {
+ free_libblock(&CTX_data_main(C)->sound, sound);
+ sound = NULL;
}
- if (sound->stream) free(sound->stream);
+
+ return sound;
}
-void sound_free_sample(bSample *sample)
+struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end)
{
- if (sample) {
- if (sample->data != &sample->fakedata[0] && sample->data != NULL) {
- MEM_freeN(sample->data);
- sample->data = &sample->fakedata[0];
+ bSound* sound = NULL;
+
+ char name[25];
+ strcpy(name, "lim_");
+ strcpy(name + 4, source->id.name);
+
+ sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
+
+ sound->child_sound = source;
+ sound->start = start;
+ sound->end = end;
+ sound->type = SOUND_TYPE_LIMITER;
+
+ sound_load(CTX_data_main(C), sound);
+
+ if(!sound->handle)
+ {
+ free_libblock(&CTX_data_main(C)->sound, sound);
+ sound = NULL;
+ }
+
+ return sound;
+}
+#endif
+
+void sound_delete(struct bContext *C, struct bSound* sound)
+{
+ if(sound)
+ {
+ sound_free(sound);
+
+ sound_unlink(C, sound);
+
+ free_libblock(&CTX_data_main(C)->sound, sound);
+ }
+}
+
+void sound_cache(struct bSound* sound, int ignore)
+{
+ if(sound->cache && !ignore)
+ AUD_unload(sound->cache);
+
+ sound->cache = AUD_bufferSound(sound->handle);
+ sound->changed++;
+}
+
+void sound_delete_cache(struct bSound* sound)
+{
+ if(sound->cache)
+ {
+ AUD_unload(sound->cache);
+ sound->cache = NULL;
+ }
+}
+
+void sound_load(struct Main *main, struct bSound* sound)
+{
+ if(sound)
+ {
+ if(sound->handle)
+ {
+ AUD_unload(sound->handle);
+ sound->handle = NULL;
+ }
+
+// XXX unused currently
+#if 0
+ switch(sound->type)
+ {
+ case SOUND_TYPE_FILE:
+#endif
+ {
+ char fullpath[FILE_MAX];
+ char *path;
+
+ /* load sound */
+ PackedFile* pf = sound->packedfile;
+
+ /* dont modify soundact->sound->name, only change a copy */
+ BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
+
+ if(sound->id.lib)
+ path = sound->id.lib->filename;
+ else
+ path = main ? main->name : G.sce;
+
+ BLI_convertstringcode(fullpath, path);
+
+ /* but we need a packed file then */
+ if (pf)
+ sound->handle = AUD_loadBuffer((unsigned char*) pf->data, pf->size);
+ /* or else load it from disk */
+ else
+ sound->handle = AUD_load(fullpath);
+ } // XXX
+// XXX unused currently
+#if 0
+ break;
}
-
- if (sample->packedfile) {
- freePackedFile(sample->packedfile); //FIXME: crashes sometimes
- sample->packedfile = NULL;
+ case SOUND_TYPE_BUFFER:
+ if(sound->child_sound && sound->child_sound->handle)
+ sound->handle = AUD_bufferSound(sound->child_sound->handle);
+ break;
+ case SOUND_TYPE_LIMITER:
+ if(sound->child_sound && sound->child_sound->handle)
+ sound->handle = AUD_limitSound(sound->child_sound, sound->start, sound->end);
+ break;
}
-
- if (sample->alindex != SAMPLE_INVALID) {
-// AUD_free_sample(sample->snd_sample);
- sample->alindex = SAMPLE_INVALID;
+#endif
+ sound->changed++;
+ }
+}
+
+void sound_free(struct bSound* sound)
+{
+ if (sound->packedfile)
+ {
+ freePackedFile(sound->packedfile);
+ sound->packedfile = NULL;
+ }
+
+ if(sound->handle)
+ {
+ AUD_unload(sound->handle);
+ sound->handle = NULL;
+ }
+}
+
+void sound_unlink(struct bContext *C, struct bSound* sound)
+{
+ bSound *snd;
+ Scene *scene;
+ SoundHandle *handle;
+
+// XXX unused currently
+#if 0
+ for(snd = CTX_data_main(C)->sound.first; snd; snd = snd->id.next)
+ {
+ if(snd->child_sound == sound)
+ {
+ snd->child_sound = NULL;
+ if(snd->handle)
+ {
+ AUD_unload(sound->handle);
+ snd->handle = NULL;
+ }
+
+ sound_unlink(C, snd);
}
+ }
+#endif
- sample->type = SAMPLE_INVALID;
+ for(scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next)
+ {
+ for(handle = scene->sound_handles.first; handle; handle = handle->next)
+ {
+ if(handle->source == sound)
+ {
+ handle->source = NULL;
+ if(handle->handle)
+ AUD_stop(handle->handle);
+ }
+ }
}
}
-/* this is called after file reading or undos */
-void sound_free_all_samples(void)
+struct SoundHandle* sound_new_handle(struct Scene *scene, struct bSound* sound, int startframe, int endframe, int frameskip)
+{
+ ListBase* handles = &scene->sound_handles;
+
+ SoundHandle* handle = MEM_callocN(sizeof(SoundHandle), "sound_handle");
+ handle->source = sound;
+ handle->startframe = startframe;
+ handle->endframe = endframe;
+ handle->frameskip = frameskip;
+ handle->state = AUD_STATUS_INVALID;
+ handle->volume = 1.0f;
+
+ BLI_addtail(handles, handle);
+
+ return handle;
+}
+
+void sound_delete_handle(struct Scene *scene, struct SoundHandle *handle)
{
- bSample *sample;
- bSound *sound;
-
- /* ensure no sample pointers exist, and check packedfile */
- for(sound= G.main->sound.first; sound; sound= sound->id.next) {
- if(sound->sample && sound->sample->packedfile==sound->newpackedfile)
- sound->newpackedfile= NULL;
- sound->sample= NULL;
+ if(handle == NULL)
+ return;
+
+ if(handle->handle)
+ AUD_stop(handle->handle);
+
+ BLI_freelinkN(&scene->sound_handles, handle);
+}
+
+void sound_stop_all(struct bContext *C)
+{
+ SoundHandle *handle;
+
+ for(handle = CTX_data_scene(C)->sound_handles.first; handle; handle = handle->next)
+ {
+ if(handle->state == AUD_STATUS_PLAYING)
+ {
+ AUD_pause(handle->handle);
+ handle->state = AUD_STATUS_PAUSED;
+ }
}
-
- /* now free samples */
- for(sample= samples->first; sample; sample= sample->id.next)
- sound_free_sample(sample);
- BLI_freelistN(samples);
-
-}
-
-void sound_set_packedfile(bSample *sample, PackedFile *pf)
-{
- bSound *sound;
-
- if (sample) {
- sample->packedfile = pf;
- sound = G.main->sound.first;
- while (sound) {
- if (sound->sample == sample) {
- sound->newpackedfile = pf;
- if (pf == NULL) {
- strcpy(sound->name, sample->name);
+}
+
+void sound_update_playing(struct bContext *C)
+{
+ SoundHandle *handle;
+ Scene* scene = CTX_data_scene(C);
+ int cfra = CFRA;
+ float fps = FPS;
+ int action;
+
+ AUD_lock();
+
+ for(handle = scene->sound_handles.first; handle; handle = handle->next)
+ {
+ if(cfra < handle->startframe || cfra >= handle->endframe || handle->mute)
+ {
+ if(handle->state == AUD_STATUS_PLAYING)
+ {
+ AUD_pause(handle->handle);
+ handle->state = AUD_STATUS_PAUSED;
+ }
+ }
+ else
+ {
+ action = 0;
+
+ if(handle->changed != handle->source->changed)
+ {
+ handle->changed = handle->source->changed;
+ action = 3;
+ if(handle->state != AUD_STATUS_INVALID)
+ {
+ AUD_stop(handle->handle);
+ handle->state = AUD_STATUS_INVALID;
+ }
+ }
+ else
+ {
+ if(handle->state != AUD_STATUS_PLAYING)
+ action = 3;
+ else
+ {
+ handle->state = AUD_getStatus(handle->handle);
+ if(handle->state != AUD_STATUS_PLAYING)
+ action = 3;
+ else
+ {
+ float diff = AUD_getPosition(handle->handle) * fps - cfra + handle->startframe;
+ if(diff < 0.0)
+ diff = -diff;
+ if(diff > FPS/2.0)
+ {
+ action = 2;
+ }
+ }
+ }
+ }
+
+ if(action & 1)
+ {
+ if(handle->state == AUD_STATUS_INVALID)
+ {
+ if(handle->source && handle->source->handle)
+ {
+ AUD_Sound* limiter = AUD_limitSound(handle->source->cache ? handle->source->cache : handle->source->handle, handle->frameskip / fps, (handle->frameskip + handle->endframe - handle->startframe)/fps);
+ handle->handle = AUD_play(limiter, 1);
+ AUD_unload(limiter);
+ if(handle->handle)
+ handle->state = AUD_STATUS_PLAYING;
+ if(cfra == handle->startframe)
+ action &= ~2;
+ }
}
+ else
+ if(AUD_resume(handle->handle))
+ handle->state = AUD_STATUS_PLAYING;
+ else
+ handle->state = AUD_STATUS_INVALID;
}
- sound = sound->id.next;
+
+ if(action & 2)
+ AUD_seek(handle->handle, (cfra - handle->startframe) / fps);
}
}
+
+ AUD_unlock();
}
-PackedFile* sound_find_packedfile(bSound *sound)
-{
- bSound *search;
- PackedFile *pf = NULL;
- char soundname[FILE_MAXDIR + FILE_MAXFILE], searchname[FILE_MAXDIR + FILE_MAXFILE];
-
- // convert sound->name to abolute filename
- strcpy(soundname, sound->name);
- BLI_convertstringcode(soundname, G.sce);
-
- search = G.main->sound.first;
- while (search) {
- if (search->sample && search->sample->packedfile) {
- strcpy(searchname, search->sample->name);
- BLI_convertstringcode(searchname, G.sce);
-
- if (BLI_streq(searchname, soundname)) {
- pf = search->sample->packedfile;
- break;
+void sound_scrub(struct bContext *C)
+{
+ SoundHandle *handle;
+ Scene* scene = CTX_data_scene(C);
+ int cfra = CFRA;
+ float fps = FPS;
+
+ if(scene->r.audio.flag & AUDIO_SCRUB && !CTX_wm_screen(C)->animtimer)
+ {
+ AUD_lock();
+
+ for(handle = scene->sound_handles.first; handle; handle = handle->next)
+ {
+ if(cfra >= handle->startframe && cfra < handle->endframe && !handle->mute)
+ {
+ if(handle->source && handle->source->handle)
+ {
+ int frameskip = handle->frameskip + cfra - handle->startframe;
+ AUD_Sound* limiter = AUD_limitSound(handle->source->cache ? handle->source->cache : handle->source->handle, frameskip / fps, (frameskip + 1)/fps);
+ AUD_play(limiter, 0);
+ AUD_unload(limiter);
+ }
}
- }
-
- if (search->newpackedfile) {
- strcpy(searchname, search->name);
- BLI_convertstringcode(searchname, G.sce);
- if (BLI_streq(searchname, soundname)) {
- pf = search->newpackedfile;
- break;
+ }
+
+ AUD_unlock();
+ }
+}
+
+AUD_Device* sound_mixdown(struct Scene *scene, AUD_Specs specs, int start, int end)
+{
+ AUD_Device* mixdown = AUD_openReadDevice(specs);
+ SoundHandle *handle;
+ float fps = FPS;
+ AUD_Sound *limiter, *delayer;
+ int frameskip, s, e;
+
+ end++;
+
+ for(handle = scene->sound_handles.first; handle; handle = handle->next)
+ {
+ if(start < handle->endframe && end > handle->startframe && !handle->mute && handle->source && handle->source->handle)
+ {
+ frameskip = handle->frameskip;
+ s = handle->startframe - start;
+ e = handle->frameskip + AUD_MIN(handle->endframe, end) - handle->startframe;
+
+ if(s < 0)
+ {
+ frameskip -= s;
+ s = 0;
}
+
+ limiter = AUD_limitSound(handle->source->handle, frameskip / fps, e / fps);
+ delayer = AUD_delaySound(limiter, s / fps);
+
+ AUD_playDevice(mixdown, delayer);
+
+ AUD_unload(delayer);
+ AUD_unload(limiter);
}
- search = search->id.next;
}
-
- return (pf);
+
+ return mixdown;
}
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index eeffbfe5ef6..61f62b2222d 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -43,6 +43,7 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BLI_rand.h"
+#include "BLI_kdopbvh.h"
#include "DNA_texture_types.h"
#include "DNA_key_types.h"
@@ -417,6 +418,8 @@ void free_texture(Tex *tex)
free_plugin_tex(tex->plugin);
if(tex->coba) MEM_freeN(tex->coba);
if(tex->env) BKE_free_envmap(tex->env);
+ if(tex->pd) BKE_free_pointdensity(tex->pd);
+ if(tex->vd) BKE_free_voxeldata(tex->vd);
BKE_previewimg_free(&tex->preview);
BKE_icon_delete((struct ID*)tex);
tex->id.icon_id = 0;
@@ -486,6 +489,16 @@ void default_tex(Tex *tex)
tex->env->depth=0;
}
+ if (tex->pd) {
+ tex->pd->radius = 0.3f;
+ tex->pd->falloff_type = TEX_PD_FALLOFF_STD;
+ }
+
+ if (tex->vd) {
+ tex->vd->resol[0] = tex->vd->resol[1] = tex->vd->resol[2] = 0;
+ tex->vd->interp_type=TEX_VD_LINEAR;
+ tex->vd->file_format=TEX_VD_SMOKE;
+ }
pit = tex->plugin;
if (pit) {
varstr= pit->varstr;
@@ -737,9 +750,9 @@ void make_local_texture(Tex *tex)
void autotexname(Tex *tex)
{
- char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend",
+ char texstr[20][15]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend",
"Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave",
- "Voronoi", "DistNoise", "", "", "", "", "", ""};
+ "Voronoi", "DistNoise", "Point Density", "Voxel Data", "", "", "", ""};
Image *ima;
char di[FILE_MAXDIR], fi[FILE_MAXFILE];
@@ -888,6 +901,106 @@ void BKE_free_envmap(EnvMap *env)
}
/* ------------------------------------------------------------------------- */
+
+PointDensity *BKE_add_pointdensity(void)
+{
+ PointDensity *pd;
+
+ pd= MEM_callocN(sizeof(PointDensity), "pointdensity");
+ pd->flag = 0;
+ pd->radius = 0.3f;
+ pd->falloff_type = TEX_PD_FALLOFF_STD;
+ pd->falloff_softness = 2.0;
+ pd->source = TEX_PD_PSYS;
+ pd->point_tree = NULL;
+ pd->point_data = NULL;
+ pd->noise_size = 0.5f;
+ pd->noise_depth = 1;
+ pd->noise_fac = 1.0f;
+ pd->noise_influence = TEX_PD_NOISE_STATIC;
+ pd->coba = add_colorband(1);
+ pd->speed_scale = 1.0f;
+ pd->totpoints = 0;
+ pd->coba = add_colorband(1);
+ pd->object = NULL;
+ pd->psys = NULL;
+ return pd;
+}
+
+PointDensity *BKE_copy_pointdensity(PointDensity *pd)
+{
+ PointDensity *pdn;
+
+ pdn= MEM_dupallocN(pd);
+ pdn->point_tree = NULL;
+ pdn->point_data = NULL;
+ if(pdn->coba) pdn->coba= MEM_dupallocN(pdn->coba);
+
+ return pdn;
+}
+
+void BKE_free_pointdensitydata(PointDensity *pd)
+{
+ if (pd->point_tree) {
+ BLI_bvhtree_free(pd->point_tree);
+ pd->point_tree = NULL;
+ }
+ if (pd->point_data) {
+ MEM_freeN(pd->point_data);
+ pd->point_data = NULL;
+ }
+ if(pd->coba) MEM_freeN(pd->coba);
+}
+
+void BKE_free_pointdensity(PointDensity *pd)
+{
+ BKE_free_pointdensitydata(pd);
+ MEM_freeN(pd);
+}
+
+
+void BKE_free_voxeldatadata(struct VoxelData *vd)
+{
+ if (vd->dataset) {
+ MEM_freeN(vd->dataset);
+ vd->dataset = NULL;
+ }
+
+}
+
+void BKE_free_voxeldata(struct VoxelData *vd)
+{
+ BKE_free_voxeldatadata(vd);
+ MEM_freeN(vd);
+}
+
+struct VoxelData *BKE_add_voxeldata(void)
+{
+ VoxelData *vd;
+
+ vd= MEM_callocN(sizeof(struct VoxelData), "voxeldata");
+ vd->dataset = NULL;
+ vd->resol[0] = vd->resol[1] = vd->resol[2] = 1;
+ vd->interp_type= TEX_VD_LINEAR;
+ vd->file_format= TEX_VD_SMOKE;
+ vd->int_multiplier = 1.0;
+ vd->object = NULL;
+
+ return vd;
+ }
+
+struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd)
+{
+ VoxelData *vdn;
+
+ vdn= MEM_dupallocN(vd);
+ vdn->dataset = NULL;
+
+ return vdn;
+}
+
+
+/* ------------------------------------------------------------------------- */
int BKE_texture_dependsOnTime(const struct Tex *texture)
{
if(texture->plugin) {
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
new file mode 100644
index 00000000000..f8e3b3c5ad2
--- /dev/null
+++ b/source/blender/blenkernel/intern/unit.c
@@ -0,0 +1,585 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <math.h>
+
+#if defined(WIN32) && (!(defined snprintf))
+#define snprintf _snprintf
+#endif
+
+#define TEMP_STR_SIZE 256
+
+#define SEP_CHR '#'
+#define SEP_STR "#"
+
+#define EUL 0.000001
+
+
+/* define a single unit */
+typedef struct bUnitDef {
+ char *name;
+ char *name_plural; /* abused a bit for the display name */
+ char *name_short; /* this is used for display*/
+ char *name_alt; /* can be NULL */
+
+ char *name_display; /* can be NULL */
+
+ double scalar;
+ double bias; /* not used yet, needed for converting temperature */
+ int flag;
+} bUnitDef;
+
+#define B_UNIT_DEF_NONE 0
+#define B_UNIT_DEF_SUPPRESS 1 /* Use for units that are not used enough to be translated into for common use */
+
+/* define a single unit */
+typedef struct bUnitCollection {
+ struct bUnitDef *units;
+ int base_unit; /* use for 0.0, or none given */
+ int flag; /* options for this system */
+ int length; /* to quickly find the last item */
+} bUnitCollection;
+
+/* Dummy */
+static struct bUnitDef buDummyDef[] = {
+ {"", NULL, "", NULL, NULL, 1.0, 0.0},
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+};
+static struct bUnitCollection buDummyCollecton = {buDummyDef, 0, 0, sizeof(buDummyDef)};
+
+
+/* Lengths */
+static struct bUnitDef buMetricLenDef[] = {
+ {"kilometer", "kilometers", "km", NULL, "Kilometers", 1000.0, 0.0, B_UNIT_DEF_NONE},
+ {"hectometer", "hectometers", "hm", NULL, "10 Meters", 100.0, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"dekameter", "dekameters", "dkm",NULL, "10 Meters", 10.0, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"meter", "meters", "m", NULL, "Meters", 1.0, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"decimetre", "decimetres", "dm", NULL, "10 Centimeters", 0.1, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"centimeter", "centimeters", "cm", NULL, "Centimeters", 0.01, 0.0, B_UNIT_DEF_NONE},
+ {"millimeter", "millimeters", "mm", NULL, "Millimeters", 0.001, 0.0, B_UNIT_DEF_NONE},
+ {"micrometer", "micrometers", "um", "µm", "Micrometers", 0.000001, 0.0, B_UNIT_DEF_NONE}, // micron too?
+
+ /* These get displayed because of float precision problems in the transform header,
+ * could work around, but for now probably people wont use these */
+ /*
+ {"nanometer", "Nanometers", "nm", NULL, 0.000000001, 0.0, B_UNIT_DEF_NONE},
+ {"picometer", "Picometers", "pm", NULL, 0.000000000001, 0.0,B_UNIT_DEF_NONE},
+ */
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+};
+static struct bUnitCollection buMetricLenCollecton = {buMetricLenDef, 3, 0, sizeof(buMetricLenDef)/sizeof(bUnitDef)};
+
+static struct bUnitDef buImperialLenDef[] = {
+ {"mile", "miles", "mi", "m", "Miles", 1609.344, 0.0, B_UNIT_DEF_NONE},
+ {"furlong", "furlongs", "fur", NULL, "Furlongs",201.168, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"chain", "chains", "ch", NULL, "Chains", 0.9144*22.0, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"yard", "yards", "yd", NULL, "Yards", 0.9144, 0.0, B_UNIT_DEF_NONE},
+ {"foot", "feet", "'", "ft", "Feet", 0.3048, 0.0, B_UNIT_DEF_NONE},
+ {"inch", "inches", "\"", "in", "Inches", 0.0254, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"thou", "thous", "mil", NULL, "Thous", 0.0000254, 0.0, B_UNIT_DEF_NONE},
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+};
+static struct bUnitCollection buImperialLenCollecton = {buImperialLenDef, 4, 0, sizeof(buImperialLenDef)/sizeof(bUnitDef)};
+
+
+/* Time */
+static struct bUnitDef buNaturalTimeDef[] = {
+ /* weeks? - probably not needed for blender */
+ {"day", "days", "d", NULL, "Days", 90000.0, 0.0, B_UNIT_DEF_NONE},
+ {"hour", "hours", "hr", "h", "Hours", 3600.0, 0.0, B_UNIT_DEF_NONE},
+ {"minute", "minutes", "min", "m", "Minutes", 60.0, 0.0, B_UNIT_DEF_NONE},
+ {"second", "seconds", "sec", "s", "Seconds", 1.0, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"millisecond", "milliseconds", "ms", NULL, "Milliseconds", 0.001, 0.0 , B_UNIT_DEF_NONE},
+ {"microsecond", "microseconds", "us", NULL, "Microseconds", 0.000001, 0.0, B_UNIT_DEF_NONE},
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+};
+static struct bUnitCollection buNaturalTimeCollecton = {buNaturalTimeDef, 3, 0, sizeof(buNaturalTimeDef)/sizeof(bUnitDef)};
+
+#define UNIT_SYSTEM_MAX 3
+static struct bUnitCollection *bUnitSystems[][8] = {
+ {0,0,0,0,0,0,0,0},
+ {0,&buMetricLenCollecton, 0,0,0,0, &buNaturalTimeCollecton,0}, /* metric */
+ {0,&buImperialLenCollecton, 0,0,0,0, &buNaturalTimeCollecton,0}, /* imperial */
+ {0,0,0,0,0,0,0,0}
+};
+
+/* internal, has some option not exposed */
+static bUnitCollection *unit_get_system(int system, int type)
+{
+ return bUnitSystems[system][type]; /* select system to use, metric/imperial/other? */
+}
+
+static bUnitDef *unit_default(bUnitCollection *usys)
+{
+ return &usys->units[usys->base_unit];
+}
+
+static bUnitDef *unit_best_fit(double value, bUnitCollection *usys, bUnitDef *unit_start, int suppress)
+{
+ bUnitDef *unit;
+ double value_abs= value>0.0?value:-value;
+
+ for(unit= unit_start ? unit_start:usys->units; unit->name; unit++) {
+
+ if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
+ continue;
+
+ if (value_abs >= unit->scalar*(1.0-EUL)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+ return unit;
+ }
+
+ return unit_default(usys);
+}
+
+
+
+/* convert into 2 units and 2 values for "2ft, 3inch" syntax */
+static void unit_dual_convert(double value, bUnitCollection *usys,
+ bUnitDef **unit_a, bUnitDef **unit_b, double *value_a, double *value_b)
+{
+ bUnitDef *unit= unit_best_fit(value, usys, NULL, 1);
+
+ *value_a= floor(value/unit->scalar) * unit->scalar;
+ *value_b= value - (*value_a);
+
+ *unit_a= unit;
+ *unit_b= unit_best_fit(*value_b, usys, *unit_a, 1);
+}
+
+static int unit_as_string(char *str, int len_max, double value, int prec, bUnitCollection *usys,
+ /* non exposed options */
+ bUnitDef *unit, char pad)
+{
+ double value_conv;
+ int len, i;
+
+ if(unit) {
+ /* use unit without finding the best one */
+ }
+ else if(value == 0.0) {
+ /* use the default units since there is no way to convert */
+ unit= unit_default(usys);
+ }
+ else {
+ unit= unit_best_fit(value, usys, NULL, 1);
+ }
+
+ value_conv= value/unit->scalar;
+
+ /* Convert to a string */
+ {
+ char conv_str[6] = {'%', '.', '0'+prec, 'l', 'f', '\0'}; /* "%.2lf" when prec is 2, must be under 10 */
+ len= snprintf(str, len_max, conv_str, (float)value_conv);
+
+ if(len >= len_max)
+ len= len_max;
+ }
+
+ /* Add unit prefix and strip zeros */
+
+ /* replace trailing zero's with spaces
+ * so the number is less complicated but allignment in a button wont
+ * jump about while dragging */
+ i= len-1;
+
+ while(i>0 && str[i]=='0') { /* 4.300 -> 4.3 */
+ str[i--]= pad;
+ }
+
+ if(i>0 && str[i]=='.') { /* 10. -> 10 */
+ str[i--]= pad;
+ }
+
+ /* Now add the suffix */
+ if(i<len_max) {
+ int j=0;
+ i++;
+ while(unit->name_short[j] && (i < len_max)) {
+ str[i++]= unit->name_short[j++];
+ }
+
+ if(pad) {
+ /* this loop only runs if so many zeros were removed that
+ * the unit name only used padded chars,
+ * In that case add padding for the name. */
+
+ while(i<=len+j && (i < len_max)) {
+ str[i++]= pad;
+ }
+ }
+ }
+
+ /* terminate no matter whats done with padding above */
+ if(i >= len_max)
+ i= len_max-1;
+
+ str[i] = '\0';
+ return i;
+}
+
+
+/* Used for drawing number buttons, try keep fast */
+void bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad)
+{
+ bUnitCollection *usys = unit_get_system(system, type);
+
+ if(usys==NULL || usys->units[0].name==NULL)
+ usys= &buDummyCollecton;
+
+ if(split) {
+ int i;
+ bUnitDef *unit_a, *unit_b;
+ double value_a, value_b;
+
+ unit_dual_convert(value, usys, &unit_a, &unit_b, &value_a, &value_b);
+
+ /* check the 2 is a smaller unit */
+ if(unit_b > unit_a) {
+ i= unit_as_string(str, len_max, value_a, prec, usys, unit_a, '\0');
+
+ /* is there enough space for at least 1 char of the next unit? */
+ if(i+2 < len_max) {
+ str[i++]= ' ';
+
+ /* use low precision since this is a smaller unit */
+ unit_as_string(str+i, len_max-i, value_b, prec?1:0, usys, unit_b, '\0');
+ }
+ return;
+ }
+ }
+
+ unit_as_string(str, len_max, value, prec, usys, NULL, pad?' ':'\0');
+}
+
+
+static char *unit_find_str(char *str, char *substr)
+{
+ char *str_found;
+
+ if(substr && substr[0] != '\0') {
+ str_found= strstr(str, substr);
+ if(str_found) {
+ /* previous char cannot be a letter */
+ if (str_found == str || isalpha(*(str_found-1))==0) {
+ /* next char cannot be alphanum */
+ int len_name = strlen(substr);
+
+ if (!isalpha(*(str_found+len_name))) {
+ return str_found;
+ }
+ }
+ }
+
+ }
+ return NULL;
+
+}
+
+/* Note that numbers are added within brackets
+ * ") " - is used to detect numbers we added so we can detect if commas need to be added
+ *
+ * "1m1cm+2mm" - Original value
+ * "1*1#1*0.01#+2*0.001#" - Replace numbers
+ * "1*1,1*0.01 +2*0.001 " - Add comma's if ( - + * / % ^ < > ) not found in between
+ *
+ */
+
+/* not too strict, (- = * /) are most common */
+static int ch_is_op(char op)
+{
+ switch(op) {
+ case '+':
+ case '-':
+ case '*':
+ case '/':
+ case '|':
+ case '&':
+ case '~':
+ case '<':
+ case '>':
+ case '^':
+ case '!':
+ case '=':
+ case '%':
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, char *replace_str)
+{
+ char *str_found;
+
+ if((len_max>0) && (str_found= unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly */
+ int len, len_num, len_name, len_move, found_ofs;
+
+ found_ofs = (int)(str_found-str);
+
+ len= strlen(str);
+
+ 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 */
+
+ if(len_num > len_max)
+ len_num= len_max;
+
+ if(found_ofs+len_num+len_move > len_max) {
+ /* can't move the whole string, move just as much as will fit */
+ len_move -= (found_ofs+len_num+len_move) - len_max;
+ }
+
+ if(len_move>0) {
+ /* resize the last part of the string */
+ memmove(str_found+len_num, str_found+len_name, len_move); /* may grow or shrink the string */
+ }
+
+ if(found_ofs+len_num > len_max) {
+ /* not even the number will fit into the string, only copy part of it */
+ len_num -= (found_ofs+len_num) - len_max;
+ }
+
+ if(len_num > 0) {
+ /* its possible none of the number could be copied in */
+ memcpy(str_found, str_tmp, len_num); /* without the string terminator */
+ }
+
+ /* since the null terminator wont be moved if the stringlen_max
+ * was not long enough to fit everything in it */
+ str[len_max-1]= '\0';
+ return found_ofs + len_num;
+ }
+ return 0;
+}
+
+static int unit_replace(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit)
+{
+ int ofs= 0;
+ ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name_short);
+ ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name_plural);
+ ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name_alt);
+ ofs += unit_scale_str(str+ofs, len_max-ofs, str_tmp, scale_pref, unit, unit->name);
+ return ofs;
+}
+
+static int unit_find(char *str, bUnitDef *unit)
+{
+ if (unit_find_str(str, unit->name_short)) return 1;
+ if (unit_find_str(str, unit->name_plural)) return 1;
+ if (unit_find_str(str, unit->name_alt)) return 1;
+ if (unit_find_str(str, unit->name)) return 1;
+
+ return 0;
+}
+
+/* make a copy of the string that replaces the units with numbers
+ * this is used before parsing
+ * This is only used when evaluating user input and can afford to be a bit slower
+ *
+ * This is to be used before python evaluation so..
+ * 10.1km -> 10.1*1000.0
+ * ...will be resolved by python.
+ *
+ * values will be split by a comma's
+ * 5'2" -> 5'0.0254, 2*0.3048
+ *
+ * str_prev is optional, when valid it is used to get a base unit when none is set.
+ *
+ * return true of a change was made.
+ */
+int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pref, int system, int type)
+{
+ bUnitCollection *usys = unit_get_system(system, type);
+
+ bUnitDef *unit;
+ char str_tmp[TEMP_STR_SIZE];
+ int change= 0;
+
+ if(usys==NULL || usys->units[0].name==NULL) {
+ return 0;
+ }
+
+
+ { /* make lowercase */
+ int i;
+ char *ch= str;
+
+ for(i=0; (i>=len_max || *ch=='\0'); i++, ch++)
+ if((*ch>='A') && (*ch<='Z'))
+ *ch += ('a'-'A');
+ }
+
+
+ for(unit= usys->units; unit->name; unit++) {
+
+ if(unit->flag & B_UNIT_DEF_SUPPRESS)
+ continue;
+
+ /* incase there are multiple instances */
+ while(unit_replace(str, len_max, str_tmp, scale_pref, unit))
+ change= 1;
+ }
+ unit= NULL;
+
+ {
+ /* try other unit systems now, so we can evaluate imperial when metric is set for eg. */
+ bUnitCollection *usys_iter;
+ int system_iter;
+
+ for(system_iter= 1; system_iter<UNIT_SYSTEM_MAX; system_iter++) {
+ if (system_iter != system) {
+ usys_iter= unit_get_system(system_iter, type);
+ for(unit= usys_iter->units; unit->name; unit++) {
+
+ if((unit->flag & B_UNIT_DEF_SUPPRESS) == 0) {
+ int ofs = 0;
+ /* incase there are multiple instances */
+ while((ofs=unit_replace(str+ofs, len_max-ofs, str_tmp, scale_pref, unit)))
+ change= 1;
+ }
+ }
+ }
+ }
+ }
+ unit= NULL;
+
+ if(change==0) {
+ /* no units given so infer a unit from the previous string or default */
+ if(str_prev) {
+ /* see which units the original value had */
+ for(unit= usys->units; unit->name; unit++) {
+
+ if(unit->flag & B_UNIT_DEF_SUPPRESS)
+ continue;
+
+ if (unit_find(str_prev, unit))
+ break;
+ }
+ }
+
+ if(unit==NULL)
+ unit= unit_default(usys);
+
+ /* add the unit prefic 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)) {
+ 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
+ * check for this because otherwise bUnit_ReplaceString could call its self forever */
+ return 0;
+ }
+
+ }
+
+ /* replace # with commas when there is no operator between it and the next number
+ *
+ * "1*1# 3*100# * 3" -> "1 *1, 3 *100 * 3"
+ *
+ * */
+ {
+ char *str_found= str;
+ char *ch= str;
+
+ while((str_found= strchr(str_found, SEP_CHR))) {
+
+ int op_found= 0;
+ /* any operators after this?*/
+ for(ch= str_found+1; *ch!='\0'; ch++) {
+
+ if(*ch==' ' || *ch=='\t') {
+ /* do nothing */
+ }
+ else if (ch_is_op(*ch) || *ch==',') { /* found an op, no need to insert a ,*/
+ op_found= 1;
+ break;
+ }
+ else { /* found a non-op character */
+ op_found= 0;
+ break;
+ }
+ }
+
+ *str_found++ = op_found ? ' ':',';
+ }
+ }
+
+ // printf("replace %s\n", str);
+ return change;
+}
+
+
+double bUnit_ClosestScalar(double value, int system, int type)
+{
+ bUnitCollection *usys = unit_get_system(system, type);
+ bUnitDef *unit;
+
+ if(usys==NULL)
+ return -1;
+
+ unit= unit_best_fit(value, usys, NULL, 1);
+ if(unit==NULL)
+ return -1;
+
+ return unit->scalar;
+}
+
+double bUnit_BaseScalar(int system, int type)
+{
+ bUnitCollection *usys = unit_get_system(system, type);
+ return unit_default(usys)->scalar;
+}
+
+/* external access */
+void bUnit_GetSystem(void **usys_pt, int *len, int system, int type)
+{
+ bUnitCollection *usys = unit_get_system(system, type);
+ *usys_pt= usys;
+
+ if(usys==NULL) {
+ *len= 0;
+ return;
+ }
+
+ *len= usys->length;
+}
+
+char *bUnit_GetName(void *usys_pt, int index)
+{
+ return ((bUnitCollection *)usys_pt)->units[index].name;
+}
+char *bUnit_GetNameDisplay(void *usys_pt, int index)
+{
+ return ((bUnitCollection *)usys_pt)->units[index].name_display;
+}
+
+double bUnit_GetScaler(void *usys_pt, int index)
+{
+ return ((bUnitCollection *)usys_pt)->units[index].scalar;
+}
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index cfbe3f629d6..7c58a4f9499 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -127,7 +127,7 @@ void makeavistring (RenderData *rd, char *string)
}
}
-void start_avi(RenderData *rd, int rectx, int recty)
+void start_avi(struct Scene *scene, RenderData *rd, int rectx, int recty)
{
int x, y;
char name[256];
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 5e3c8024524..e7164dc4794 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -65,6 +65,10 @@
#include "DNA_scene_types.h"
+#include "AUD_C-API.h"
+#include "BKE_sound.h"
+#include "BKE_main.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -96,6 +100,8 @@ static int audio_input_frame_size = 0;
static uint8_t* audio_output_buffer = 0;
static int audio_outbuf_size = 0;
+static AUD_Device* audio_mixdown_device = 0;
+
#define FFMPEG_AUTOSPLIT_SIZE 2000000000
/* Delete a picture buffer */
@@ -127,9 +133,8 @@ static int write_audio_frame(void)
c = get_codec_from_stream(audio_stream);
- //XXX audiostream_fill(audio_input_buffer,
- // audio_input_frame_size
- // * sizeof(short) * c->channels);
+ if(audio_mixdown_device)
+ AUD_readDevice(audio_mixdown_device, audio_input_buffer, audio_input_frame_size);
av_init_packet(&pkt);
@@ -827,11 +832,21 @@ static void makeffmpegstring(RenderData* rd, char* string) {
}
-void start_ffmpeg(RenderData *rd, int rectx, int recty)
+void start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty)
{
ffmpeg_autosplit_count = 0;
start_ffmpeg_impl(rd, rectx, recty);
+
+ if(ffmpeg_multiplex_audio && audio_stream)
+ {
+ AVCodecContext* c = get_codec_from_stream(audio_stream);
+ AUD_Specs specs;
+ specs.channels = c->channels;
+ specs.format = AUD_FORMAT_S16;
+ specs.rate = rd->audio.mixrate;
+ audio_mixdown_device = sound_mixdown(scene, specs, rd->sfra, rd->efra);
+ }
}
void end_ffmpeg(void);
@@ -884,6 +899,12 @@ void end_ffmpeg(void)
if (audio_stream && video_stream) {
write_audio_frames();
}
+
+ if(audio_mixdown_device)
+ {
+ AUD_closeReadDevice(audio_mixdown_device);
+ audio_mixdown_device = 0;
+ }
if (outfile) {
av_write_trailer(outfile);
diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c
index 2d3a2e6b883..0780cd0dc48 100644
--- a/source/blender/blenkernel/intern/writeframeserver.c
+++ b/source/blender/blenkernel/intern/writeframeserver.c
@@ -101,7 +101,7 @@ static int closesocket(int fd)
}
#endif
-void start_frameserver(RenderData *rd, int rectx, int recty)
+void start_frameserver(struct Scene *scene, RenderData *rd, int rectx, int recty)
{
struct sockaddr_in addr;
int arg = 1;
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
index 1502c4870be..2ab60c6a8d0 100644
--- a/source/blender/blenlib/BLI_arithb.h
+++ b/source/blender/blenlib/BLI_arithb.h
@@ -174,7 +174,39 @@ void CalcNormShort(short *v1, short *v2, short *v3, float *n);
float power_of_2(float val);
/**
- * @section Euler conversion routines
+ * @section Euler conversion routines (With Custom Order)
+ */
+
+/* Defines for rotation orders
+ * WARNING: must match the ePchan_RotMode in DNA_action_types.h
+ * order matters - types are saved to file!
+ */
+typedef enum eEulerRotationOrders {
+ EULER_ORDER_DEFAULT = 1, /* Blender 'default' (classic) is basically XYZ */
+ EULER_ORDER_XYZ = 1, /* Blender 'default' (classic) - must be as 1 to sync with PoseChannel rotmode */
+ EULER_ORDER_XZY,
+ EULER_ORDER_YXZ,
+ EULER_ORDER_YZX,
+ EULER_ORDER_ZXY,
+ EULER_ORDER_ZYX,
+ /* NOTE: there are about 6 more entries when including duplicated entries too */
+} eEulerRotationOrders;
+
+void EulOToQuat(float eul[3], short order, float quat[4]);
+void QuatToEulO(float quat[4], float eul[3], short order);
+
+void EulOToMat3(float eul[3], short order, float Mat[3][3]);
+void EulOToMat4(float eul[3], short order, float Mat[4][4]);
+
+void Mat3ToEulO(float Mat[3][3], float eul[3], short order);
+void Mat4ToEulO(float Mat[4][4], float eul[3], short order);
+
+void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order);
+
+void eulerO_rot(float beul[3], float ang, char axis, short order);
+
+/**
+ * @section Euler conversion routines (Blender XYZ)
*/
void EulToMat3(float *eul, float mat[][3]);
@@ -185,11 +217,14 @@ void Mat4ToEul(float tmat[][4],float *eul);
void EulToQuat(float *eul, float *quat);
-void compatible_eul(float *eul, float *oldrot);
-
void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot);
+
+void compatible_eul(float *eul, float *oldrot);
+void euler_rot(float *beul, float ang, char axis);
+
+
/**
* @section Quaternion arithmetic routines
*/
@@ -216,6 +251,8 @@ void printquat(char *str, float q[4]);
void QuatInterpol(float *result, float *quat1, float *quat2, float t);
void QuatAdd(float *result, float *quat1, float *quat2, float t);
+void QuatToMat3(float *q, float m[][3]);
+void QuatToMat4(float *q, float m[][4]);
/**
* @section matrix multiplication and copying routines
@@ -325,6 +362,7 @@ void printvec4f(char *str, float v[4]);
void VecAddf(float *v, float *v1, float *v2);
void VecSubf(float *v, float *v1, float *v2);
+void VecMulVecf(float *v, float *v1, float *v2);
void VecLerpf(float *target, float *a, float *b, float t);
void VecMidf(float *v, float *v1, float *v2);
@@ -348,8 +386,6 @@ float NormalizedVecAngle2(float *v1, float *v2);
float VecAngle3_2D(float *v1, float *v2, float *v3);
float NormalizedVecAngle2_2D(float *v1, float *v2);
-
-void euler_rot(float *beul, float ang, char axis);
void NormalShortToFloat(float *out, short *in);
void NormalFloatToShort(short *out, float *in);
@@ -421,9 +457,6 @@ void VecStar(float mat[][3],float *vec);
short EenheidsMat(float mat[][3]);
-void QuatToMat3(float *q, float m[][3]);
-void QuatToMat4(float *q, float m[][4]);
-
void Mat3ToQuat_is_ok(float wmat[][3], float *q);
void i_ortho(float left, float right, float bottom, float top, float nearClip, float farClip, float matrix[][4]);
@@ -434,8 +467,6 @@ void i_rotate(float angle, char axis, float mat[][4]);
-
-
void MinMax3(float *min, float *max, float *vec);
void SizeToMat3(float *size, float mat[][3]);
void SizeToMat4(float *size, float mat[][4]);
@@ -455,8 +486,9 @@ void Mat4ToSize(float mat[][4], float *size);
void triatoquat(float *v1, float *v2, float *v3, float *quat);
-void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3]);
-void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3]);
+void LocEulSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3]);
+void LocEulOSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3], short rotOrder);
+void LocQuatSizeToMat4(float mat[4][4], float loc[3], float quat[4], float size[3]);
void tubemap(float x, float y, float z, float *u, float *v);
void spheremap(float x, float y, float z, float *u, float *v);
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h
index e3591a84e98..fe6bc576fbd 100644
--- a/source/blender/blenlib/BLI_kdopbvh.h
+++ b/source/blender/blenlib/BLI_kdopbvh.h
@@ -71,6 +71,8 @@ typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const f
/* callback must update hit in case it finds a nearest successful hit */
typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit);
+/* callback to range search query */
+typedef void (*BVHTree_RangeQuery) (void *userdata, int index, float squared_dist);
BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis);
void BLI_bvhtree_free(BVHTree *tree);
@@ -93,5 +95,11 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea
int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
+float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, float *pos);
+
+/* range query */
+int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata);
+
+
#endif // BLI_KDOPBVH_H
diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h
index bd89959801a..070d8d12c08 100644
--- a/source/blender/blenlib/BLI_vfontdata.h
+++ b/source/blender/blenlib/BLI_vfontdata.h
@@ -67,19 +67,6 @@ struct TmpFont
struct VFont *vfont;
};
-
-/**
- * Construct a new VFontData structure from
- * PostScript font data in a PackedFile.
- *
- * @param pf The font data.
- * @retval A new VFontData structure, or NULL
- * if unable to load.
- */
- VFontData*
-BLI_vfontdata_from_psfont(
- struct PackedFile *pf);
-
/**
* Construct a new VFontData structure from
* Freetype font data in a PackedFile.
diff --git a/intern/SoundSystem/sdl/SND_SDLCDDevice.h b/source/blender/blenlib/BLI_voxel.h
index 96600d53630..934bc820259 100644
--- a/intern/SoundSystem/sdl/SND_SDLCDDevice.h
+++ b/source/blender/blenlib/BLI_voxel.h
@@ -1,5 +1,4 @@
/**
- * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -22,37 +21,21 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary).
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef SND_SDLCDDEVICE
-#define SND_SDLCDDEVICE
-struct SDL_CD;
+#ifndef BLI_VOXEL_H
+#define BLI_VOXEL_H
-class SND_SDLCDDevice
-{
-public:
- SND_SDLCDDevice();
- ~SND_SDLCDDevice();
-
- void NextFrame();
+/* find the index number of a voxel, given x/y/z integer coords and resolution vector */
+#define V_I(x, y, z, res) ( (z)*(res)[1]*(res)[0] + (y)*(res)[0] + (x) )
- void PlayCD(int track);
- void PauseCD(bool pause);
- void StopCD();
- void SetCDPlaymode(int playmode);
- void SetCDGain(MT_Scalar gain);
+/* all input coordinates must be in bounding box 0.0 - 1.0 */
+float voxel_sample_nearest(float *data, int *res, float *co);
+float voxel_sample_trilinear(float *data, int *res, float *co);
+float voxel_sample_triquadratic(float *data, int *res, float *co);
+float voxel_sample_tricubic(float *data, int *res, float *co, int bspline);
-private:
- void init();
- /* CD Audio */
- SDL_CD* m_cdrom;
- bool m_cdplaying;
- int m_cdtrack;
- unsigned char m_cdplaymode;
- unsigned char m_frame;
-};
-
-#endif
+#endif /* BLI_VOXEL_H */
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h
index 3e1b73e51be..fad45f1b6c3 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -65,20 +65,22 @@
extern "C" {
#endif
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661923
-#endif
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-#ifndef M_SQRT1_2
-#define M_SQRT1_2 0.70710678118654752440
-#endif
-#ifndef M_1_PI
-#define M_1_PI 0.318309886183790671538
+# ifndef _WIN64
+ #ifndef M_PI
+ #define M_PI 3.14159265358979323846
+ #endif
+ #ifndef M_PI_2
+ #define M_PI_2 1.57079632679489661923
+ #endif
+ #ifndef M_SQRT2
+ #define M_SQRT2 1.41421356237309504880
+ #endif
+ #ifndef M_SQRT1_2
+ #define M_SQRT1_2 0.70710678118654752440
+ #endif
+ #ifndef M_1_PI
+ #define M_1_PI 0.318309886183790671538
+ #endif
#endif
#define MAXPATHLEN MAX_PATH
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 334c8e6906b..a0bf2367b98 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -28,8 +28,7 @@ FILE(GLOB SRC intern/*.c)
SET(INC
. ../makesdna ../blenkernel ../../../intern/guardedalloc ../include
- ${FREETYPE_INC}
- ${SDL_INC}
+ ${FREETYPE_INCLUDE_DIRS}
${ZLIB_INC}
)
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index 0f8194362c9..61d9cce1a58 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -1173,7 +1173,7 @@ static float squared_dist(const float *a, const float *b)
}
//Determines the nearest point of the given node BV. Returns the squared distance to that point.
-static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest)
+static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest)
{
int i;
const float *bv = node->bv;
@@ -1181,12 +1181,12 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near
//nearest on AABB hull
for(i=0; i != 3; i++, bv += 2)
{
- if(bv[0] > data->proj[i])
+ if(bv[0] > proj[i])
nearest[i] = bv[0];
- else if(bv[1] < data->proj[i])
+ else if(bv[1] < proj[i])
nearest[i] = bv[1];
else
- nearest[i] = data->proj[i];
+ nearest[i] = proj[i];
}
/*
@@ -1208,7 +1208,7 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near
}
}
*/
- return squared_dist(data->co, nearest);
+ return squared_dist(proj, nearest);
}
@@ -1231,7 +1231,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
else
{
data->nearest.index = node->index;
- data->nearest.dist = calc_nearest_point(data, node, data->nearest.co);
+ data->nearest.dist = calc_nearest_point(data->proj, node, data->nearest.co);
}
}
else
@@ -1240,12 +1240,12 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
int i;
float nearest[3];
- if(data->proj[ (int)node->main_axis ] <= node->children[0]->bv[(int)node->main_axis*2+1])
+ if(data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1])
{
for(i=0; i != node->totnode; i++)
{
- if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
+ if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
dfs_find_nearest_dfs(data, node->children[i]);
}
}
@@ -1253,7 +1253,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
{
for(i=node->totnode-1; i >= 0 ; i--)
{
- if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
+ if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
dfs_find_nearest_dfs(data, node->children[i]);
}
}
@@ -1263,7 +1263,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node)
{
float nearest[3], sdist;
- sdist = calc_nearest_point(data, node, nearest);
+ sdist = calc_nearest_point(data->proj, node, nearest);
if(sdist >= data->nearest.dist) return;
dfs_find_nearest_dfs(data, node);
}
@@ -1301,7 +1301,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
}
current.node = node;
- current.dist = calc_nearest_point(data, node, nearest);
+ current.dist = calc_nearest_point(data->proj, node, nearest);
while(current.dist < data->nearest.dist)
{
@@ -1329,7 +1329,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
}
heap[heap_size].node = current.node->children[i];
- heap[heap_size].dist = calc_nearest_point(data, current.node->children[i], nearest);
+ heap[heap_size].dist = calc_nearest_point(data->proj, current.node->children[i], nearest);
if(heap[heap_size].dist >= data->nearest.dist) continue;
heap_size++;
@@ -1355,6 +1355,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
}
#endif
+
int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
{
int i;
@@ -1405,10 +1406,9 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea
*/
//Determines the distance that the ray must travel to hit the bounding volume of the given node
-static float ray_nearest_hit(BVHRayCastData *data, BVHNode *node)
+static float ray_nearest_hit(BVHRayCastData *data, float *bv)
{
int i;
- const float *bv = node->bv;
float low = 0, upper = data->hit.dist;
@@ -1449,7 +1449,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
//ray-bv is really fast.. and simple tests revealed its worth to test it
//before calling the ray-primitive functions
- float dist = ray_nearest_hit(data, node);
+ float dist = ray_nearest_hit(data, node->bv);
if(dist >= data->hit.dist) return;
if(node->totnode == 0)
@@ -1527,3 +1527,121 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
return data.hit.index;
}
+float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, float *pos)
+{
+ BVHRayCastData data;
+ float dist = 0.0;
+
+ data.hit.dist = FLT_MAX;
+
+ // get light direction
+ data.ray.direction[0] = light_end[0] - light_start[0];
+ data.ray.direction[1] = light_end[1] - light_start[1];
+ data.ray.direction[2] = light_end[2] - light_start[2];
+
+ data.ray.radius = 0.0;
+
+ data.ray.origin[0] = light_start[0];
+ data.ray.origin[1] = light_start[1];
+ data.ray.origin[2] = light_start[2];
+
+ Normalize(data.ray.direction);
+ VECCOPY(data.ray_dot_axis, data.ray.direction);
+
+ dist = ray_nearest_hit(&data, bv);
+
+ if(dist > 0.0)
+ {
+ VECADDFAC(pos, light_start, data.ray.direction, dist);
+ }
+ return dist;
+
+}
+
+/*
+ * Range Query - as request by broken :P
+ *
+ * Allocs and fills an array with the indexs of node that are on the given spherical range (center, radius)
+ * Returns the size of the array.
+ */
+typedef struct RangeQueryData
+{
+ BVHTree *tree;
+ const float *center;
+ float radius; //squared radius
+
+ int hits;
+
+ BVHTree_RangeQuery callback;
+ void *userdata;
+
+
+} RangeQueryData;
+
+
+static void dfs_range_query(RangeQueryData *data, BVHNode *node)
+{
+ if(node->totnode == 0)
+ {
+
+ //Calculate the node min-coords (if the node was a point then this is the point coordinates)
+ float co[3];
+ co[0] = node->bv[0];
+ co[1] = node->bv[2];
+ co[2] = node->bv[4];
+
+ }
+ else
+ {
+ int i;
+ for(i=0; i != node->totnode; i++)
+ {
+ float nearest[3];
+ float dist = calc_nearest_point(data->center, node->children[i], nearest);
+ if(dist < data->radius)
+ {
+ //Its a leaf.. call the callback
+ if(node->children[i]->totnode == 0)
+ {
+ data->hits++;
+ data->callback( data->userdata, node->children[i]->index, dist );
+ }
+ else
+ dfs_range_query( data, node->children[i] );
+ }
+ }
+ }
+}
+
+int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata)
+{
+ BVHNode * root = tree->nodes[tree->totleaf];
+
+ RangeQueryData data;
+ data.tree = tree;
+ data.center = co;
+ data.radius = radius*radius;
+ data.hits = 0;
+
+ data.callback = callback;
+ data.userdata = userdata;
+
+ if(root != NULL)
+ {
+ float nearest[3];
+ float dist = calc_nearest_point(data.center, root, nearest);
+ if(dist < data.radius)
+ {
+ //Its a leaf.. call the callback
+ if(root->totnode == 0)
+ {
+ data.hits++;
+ data.callback( data.userdata, root->index, dist );
+ }
+ else
+ dfs_range_query( &data, root );
+ }
+ }
+
+ return data.hits;
+}
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c
index 79a46da4c66..1f3a861ba6a 100644
--- a/source/blender/blenlib/intern/BLI_kdtree.c
+++ b/source/blender/blenlib/intern/BLI_kdtree.c
@@ -374,7 +374,7 @@ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KD
KDTreeNode **stack, *defaultstack[100];
KDTreeNearest *foundstack=NULL;
float range2 = range*range, dist2;
- int i, totstack, cur=0, found=0, totfoundstack=0;
+ int totstack, cur=0, found=0, totfoundstack=0;
if(!tree || !tree->root)
return 0;
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index a26e333e095..9d67ac50108 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -1408,22 +1408,6 @@ void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3])
AxisAngleToQuat(q, axis, angle);
}
-void AxisAngleToQuat(float *q, float *axis, float angle)
-{
- float nor[3];
- float si;
-
- VecCopyf(nor, axis);
- Normalize(nor);
-
- angle /= 2;
- si = (float)sin(angle);
- q[0] = (float)cos(angle);
- q[1] = nor[0] * si;
- q[2] = nor[1] * si;
- q[3] = nor[2] * si;
-}
-
void vectoquat(float *vec, short axis, short upflag, float *q)
{
float q2[4], nor[3], *fp, mat[3][3], angle, si, co, x2, y2, z2, len1;
@@ -1610,7 +1594,7 @@ void VecUpMat3(float *vec, float mat[][3], short axis)
}
/* A & M Watt, Advanced animation and rendering techniques, 1992 ACM press */
-void QuatInterpolW(float *, float *, float *, float );
+void QuatInterpolW(float *, float *, float *, float ); // XXX why this?
void QuatInterpolW(float *result, float *quat1, float *quat2, float t)
{
@@ -2176,6 +2160,13 @@ void VecSubf(float *v, float *v1, float *v2)
v[2]= v1[2]- v2[2];
}
+void VecMulVecf(float *v, float *v1, float *v2)
+{
+ v[0] = v1[0] * v2[0];
+ v[1] = v1[1] * v2[1];
+ v[2] = v1[2] * v2[2];
+}
+
void VecLerpf(float *target, float *a, float *b, float t)
{
float s = 1.0f-t;
@@ -2800,6 +2791,236 @@ void MeanValueWeights(float v[][3], int n, float *co, float *w)
/* ************ EULER *************** */
+/* Euler Rotation Order Code:
+ * was adapted from
+ ANSI C code from the article
+ "Euler Angle Conversion"
+ by Ken Shoemake, shoemake@graphics.cis.upenn.edu
+ in "Graphics Gems IV", Academic Press, 1994
+ * for use in Blender
+ */
+
+/* Type for rotation order info - see wiki for derivation details */
+typedef struct RotOrderInfo {
+ short i; /* first axis index */
+ short j; /* second axis index */
+ short k; /* third axis index */
+ short parity; /* parity of axis permuation (even=0, odd=1) - 'n' in original code */
+} RotOrderInfo;
+
+/* Array of info for Rotation Order calculations
+ * WARNING: must be kept in same order as eEulerRotationOrders
+ */
+static RotOrderInfo rotOrders[]= {
+ /* i, j, k, n */
+ {0, 1, 2, 0}, // XYZ
+ {0, 2, 1, 1}, // XZY
+ {1, 0, 2, 1}, // YXZ
+ {1, 2, 0, 0}, // YZX
+ {2, 0, 1, 0}, // ZXY
+ {2, 1, 0, 1} // ZYZ
+};
+
+/* Get relevant pointer to rotation order set from the array
+ * NOTE: since we start at 1 for the values, but arrays index from 0,
+ * there is -1 factor involved in this process...
+ */
+#define GET_ROTATIONORDER_INFO(order) (((order)>=1) ? &rotOrders[(order)-1] : &rotOrders[0])
+
+/* Construct quaternion from Euler angles (in radians). */
+void EulOToQuat(float e[3], short order, float q[4])
+{
+ RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
+ short i=R->i, j=R->j, k=R->k;
+ double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
+ double a[3];
+
+ if (R->parity) e[1] = -e[1];
+
+ ti = e[0]/2; tj = e[1]/2; th = e[2]/2;
+
+ ci = cos(ti); cj = cos(tj); ch = cos(th);
+ si = sin(ti); sj = sin(tj); sh = sin(th);
+
+ cc = ci*ch; cs = ci*sh;
+ sc = si*ch; ss = si*sh;
+
+ a[i] = cj*sc - sj*cs;
+ a[j] = cj*ss + sj*cc;
+ a[k] = cj*cs - sj*sc;
+
+ q[0] = cj*cc + sj*ss;
+ q[1] = a[0];
+ q[2] = a[1];
+ q[3] = a[2];
+
+ if (R->parity) q[j] = -q[j];
+}
+
+/* Convert quaternion to Euler angles (in radians). */
+void QuatToEulO(float q[4], float e[3], short order)
+{
+ float M[3][3];
+
+ QuatToMat3(q, M);
+ Mat3ToEulO(M, e, order);
+}
+
+/* Construct 3x3 matrix from Euler angles (in radians). */
+void EulOToMat3(float e[3], short order, float M[3][3])
+{
+ RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
+ short i=R->i, j=R->j, k=R->k;
+ double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
+
+ if (R->parity) {
+ e[0] = -e[0];
+ e[1] = -e[1];
+ e[2] = -e[2];
+ }
+
+ ti = e[0]; tj = e[1]; th = e[2];
+
+ ci = cos(ti); cj = cos(tj); ch = cos(th);
+ si = sin(ti); sj = sin(tj); sh = sin(th);
+
+ cc = ci*ch; cs = ci*sh;
+ sc = si*ch; ss = si*sh;
+
+ M[i][i] = cj*ch; M[j][i] = sj*sc-cs; M[k][i] = sj*cc+ss;
+ M[i][j] = cj*sh; M[j][j] = sj*ss+cc; M[k][j] = sj*cs-sc;
+ M[i][k] = -sj; M[j][k] = cj*si; M[k][k] = cj*ci;
+}
+
+/* Construct 4x4 matrix from Euler angles (in radians). */
+void EulOToMat4(float e[3], short order, float M[4][4])
+{
+ float m[3][3];
+
+ /* for now, we'll just do this the slow way (i.e. copying matrices) */
+ Mat3Ortho(m);
+ EulOToMat3(e, order, m);
+ Mat4CpyMat3(M, m);
+}
+
+/* Convert 3x3 matrix to Euler angles (in radians). */
+void Mat3ToEulO(float M[3][3], float e[3], short order)
+{
+ RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
+ short i=R->i, j=R->j, k=R->k;
+ double cy = sqrt(M[i][i]*M[i][i] + M[j][i]*M[j][i]);
+
+ if (cy > 16*FLT_EPSILON) {
+ e[0] = atan2(M[j][k], M[k][k]);
+ e[1] = atan2(-M[i][k], cy);
+ e[2] = atan2(M[i][j], M[i][i]);
+ }
+ else {
+ e[0] = atan2(-M[k][j], M[j][j]);
+ e[1] = atan2(-M[i][k], cy);
+ e[2] = 0;
+ }
+
+ if (R->parity) {
+ e[0] = -e[0];
+ e[1] = -e[1];
+ e[2] = -e[2];
+ }
+}
+
+/* Convert 4x4 matrix to Euler angles (in radians). */
+void Mat4ToEulO(float M[4][4], float e[3], short order)
+{
+ float m[3][3];
+
+ /* for now, we'll just do this the slow way (i.e. copying matrices) */
+ Mat3CpyMat4(m, M);
+ Mat3Ortho(m);
+ Mat3ToEulO(m, e, order);
+}
+
+/* returns two euler calculation methods, so we can pick the best */
+static void mat3_to_eulo2(float M[3][3], float *e1, float *e2, short order)
+{
+ RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
+ short i=R->i, j=R->j, k=R->k;
+ double cy = sqrt(M[i][i]*M[i][i] + M[j][i]*M[j][i]);
+
+ if (cy > 16*FLT_EPSILON) {
+ e1[0] = atan2(M[j][k], M[k][k]);
+ e1[1] = atan2(-M[i][k], cy);
+ e1[2] = atan2(M[i][j], M[i][i]);
+
+ e2[0] = atan2(-M[j][k], -M[k][k]);
+ e2[1] = atan2(-M[i][k], -cy);
+ e2[2] = atan2(-M[i][j], -M[i][i]);
+ }
+ else {
+ e1[0] = atan2(-M[k][j], M[j][j]);
+ e1[1] = atan2(-M[i][k], cy);
+ e1[2] = 0;
+
+ VecCopyf(e2, e1);
+ }
+
+ if (R->parity) {
+ e1[0] = -e1[0];
+ e1[1] = -e1[1];
+ e1[2] = -e1[2];
+
+ e2[0] = -e2[0];
+ e2[1] = -e2[1];
+ e2[2] = -e2[2];
+ }
+}
+
+/* uses 2 methods to retrieve eulers, and picks the closest */
+// FIXME: this does not work well with the other rotation modes...
+void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order)
+{
+ float eul1[3], eul2[3];
+ float d1, d2;
+
+ mat3_to_eulo2(mat, eul1, eul2, order);
+
+ compatible_eul(eul1, oldrot);
+ compatible_eul(eul2, oldrot);
+
+ d1= (float)fabs(eul1[0]-oldrot[0]) + (float)fabs(eul1[1]-oldrot[1]) + (float)fabs(eul1[2]-oldrot[2]);
+ d2= (float)fabs(eul2[0]-oldrot[0]) + (float)fabs(eul2[1]-oldrot[1]) + (float)fabs(eul2[2]-oldrot[2]);
+
+ /* return best, which is just the one with lowest difference */
+ if (d1 > d2)
+ VecCopyf(eul, eul2);
+ else
+ VecCopyf(eul, eul1);
+}
+
+/* rotate the given euler by the given angle on the specified axis */
+// NOTE: is this safe to do with different axis orders?
+void eulerO_rot(float beul[3], float ang, char axis, short order)
+{
+ float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
+
+ eul[0]= eul[1]= eul[2]= 0.0f;
+ if (axis=='x')
+ eul[0]= ang;
+ else if (axis=='y')
+ eul[1]= ang;
+ else
+ eul[2]= ang;
+
+ EulOToMat3(eul, order, mat1);
+ EulOToMat3(beul, order, mat2);
+
+ Mat3MulMat3(totmat, mat2, mat1);
+
+ Mat3ToEulO(totmat, beul, order);
+}
+
+/* ************ EULER (old XYZ) *************** */
+
+/* XYZ order */
void EulToMat3( float *eul, float mat[][3])
{
double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
@@ -2827,6 +3048,7 @@ void EulToMat3( float *eul, float mat[][3])
}
+/* XYZ order */
void EulToMat4( float *eul,float mat[][4])
{
double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
@@ -2858,6 +3080,7 @@ void EulToMat4( float *eul,float mat[][4])
}
/* returns two euler calculation methods, so we can pick the best */
+/* XYZ order */
static void mat3_to_eul2(float tmat[][3], float *eul1, float *eul2)
{
float cy, quat[4], mat[3][3];
@@ -2888,6 +3111,7 @@ static void mat3_to_eul2(float tmat[][3], float *eul1, float *eul2)
}
}
+/* XYZ order */
void Mat3ToEul(float tmat[][3], float *eul)
{
float eul1[3], eul2[3];
@@ -2903,6 +3127,7 @@ void Mat3ToEul(float tmat[][3], float *eul)
}
}
+/* XYZ order */
void Mat4ToEul(float tmat[][4], float *eul)
{
float tempMat[3][3];
@@ -2912,6 +3137,7 @@ void Mat4ToEul(float tmat[][4], float *eul)
Mat3ToEul(tempMat, eul);
}
+/* XYZ order */
void QuatToEul(float *quat, float *eul)
{
float mat[3][3];
@@ -2920,7 +3146,7 @@ void QuatToEul(float *quat, float *eul)
Mat3ToEul(mat, eul);
}
-
+/* XYZ order */
void EulToQuat(float *eul, float *quat)
{
float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
@@ -2936,6 +3162,155 @@ void EulToQuat(float *eul, float *quat)
quat[3] = cj*cs - sj*sc;
}
+/* XYZ order */
+void euler_rot(float *beul, float ang, char axis)
+{
+ float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
+
+ eul[0]= eul[1]= eul[2]= 0.0f;
+ if(axis=='x') eul[0]= ang;
+ else if(axis=='y') eul[1]= ang;
+ else eul[2]= ang;
+
+ EulToMat3(eul, mat1);
+ EulToMat3(beul, mat2);
+
+ Mat3MulMat3(totmat, mat2, mat1);
+
+ Mat3ToEul(totmat, beul);
+
+}
+
+/* exported to transform.c */
+/* order independent! */
+void compatible_eul(float *eul, float *oldrot)
+{
+ float dx, dy, dz;
+
+ /* correct differences of about 360 degrees first */
+ dx= eul[0] - oldrot[0];
+ dy= eul[1] - oldrot[1];
+ dz= eul[2] - oldrot[2];
+
+ while(fabs(dx) > 5.1) {
+ if(dx > 0.0f) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
+ dx= eul[0] - oldrot[0];
+ }
+ while(fabs(dy) > 5.1) {
+ if(dy > 0.0f) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
+ dy= eul[1] - oldrot[1];
+ }
+ while(fabs(dz) > 5.1) {
+ if(dz > 0.0f) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
+ dz= eul[2] - oldrot[2];
+ }
+
+ /* is 1 of the axis rotations larger than 180 degrees and the other small? NO ELSE IF!! */
+ if( fabs(dx) > 3.2 && fabs(dy)<1.6 && fabs(dz)<1.6 ) {
+ if(dx > 0.0) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
+ }
+ if( fabs(dy) > 3.2 && fabs(dz)<1.6 && fabs(dx)<1.6 ) {
+ if(dy > 0.0) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
+ }
+ if( fabs(dz) > 3.2 && fabs(dx)<1.6 && fabs(dy)<1.6 ) {
+ if(dz > 0.0) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
+ }
+
+ /* the method below was there from ancient days... but why! probably because the code sucks :)
+ */
+#if 0
+ /* calc again */
+ dx= eul[0] - oldrot[0];
+ dy= eul[1] - oldrot[1];
+ dz= eul[2] - oldrot[2];
+
+ /* special case, tested for x-z */
+
+ if( (fabs(dx) > 3.1 && fabs(dz) > 1.5 ) || ( fabs(dx) > 1.5 && fabs(dz) > 3.1 ) ) {
+ if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
+ if(eul[1] > 0.0) eul[1]= M_PI - eul[1]; else eul[1]= -M_PI - eul[1];
+ if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
+
+ }
+ else if( (fabs(dx) > 3.1 && fabs(dy) > 1.5 ) || ( fabs(dx) > 1.5 && fabs(dy) > 3.1 ) ) {
+ if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
+ if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
+ if(eul[2] > 0.0) eul[2]= M_PI - eul[2]; else eul[2]= -M_PI - eul[2];
+ }
+ else if( (fabs(dy) > 3.1 && fabs(dz) > 1.5 ) || ( fabs(dy) > 1.5 && fabs(dz) > 3.1 ) ) {
+ if(eul[0] > 0.0) eul[0]= M_PI - eul[0]; else eul[0]= -M_PI - eul[0];
+ if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
+ if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
+ }
+#endif
+}
+
+/* uses 2 methods to retrieve eulers, and picks the closest */
+/* XYZ order */
+void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot)
+{
+ float eul1[3], eul2[3];
+ float d1, d2;
+
+ mat3_to_eul2(mat, eul1, eul2);
+
+ compatible_eul(eul1, oldrot);
+ compatible_eul(eul2, oldrot);
+
+ d1= (float)fabs(eul1[0]-oldrot[0]) + (float)fabs(eul1[1]-oldrot[1]) + (float)fabs(eul1[2]-oldrot[2]);
+ d2= (float)fabs(eul2[0]-oldrot[0]) + (float)fabs(eul2[1]-oldrot[1]) + (float)fabs(eul2[2]-oldrot[2]);
+
+ /* return best, which is just the one with lowest difference */
+ if( d1 > d2) {
+ VecCopyf(eul, eul2);
+ }
+ else {
+ VecCopyf(eul, eul1);
+ }
+
+}
+
+/* ************ AXIS ANGLE *************** */
+
+/* Axis angle to Quaternions */
+void AxisAngleToQuat(float *q, float *axis, float angle)
+{
+ float nor[3];
+ float si;
+
+ VecCopyf(nor, axis);
+ Normalize(nor);
+
+ angle /= 2;
+ si = (float)sin(angle);
+ q[0] = (float)cos(angle);
+ q[1] = nor[0] * si;
+ q[2] = nor[1] * si;
+ q[3] = nor[2] * si;
+}
+
+/* Quaternions to Axis Angle */
+void QuatToAxisAngle(float q[4], float axis[3], float *angle)
+{
+ float ha, si;
+
+ /* calculate angle/2, and sin(angle/2) */
+ ha= (float)acos(q[0]);
+ si= (float)sin(ha);
+
+ /* from half-angle to angle */
+ *angle= ha * 2;
+
+ /* prevent division by zero for axis conversion */
+ if (fabs(si) < 0.0005)
+ si= 1.0f;
+
+ axis[0]= q[1] / si;
+ axis[1]= q[2] / si;
+ axis[2]= q[3] / si;
+}
+
+/* axis angle to 3x3 matrix */
void VecRotToMat3(float *vec, float phi, float mat[][3])
{
/* rotation of phi radials around vec */
@@ -2962,6 +3337,7 @@ void VecRotToMat3(float *vec, float phi, float mat[][3])
}
+/* axis angle to 4x4 matrix */
void VecRotToMat4(float *vec, float phi, float mat[][4])
{
float tmat[3][3];
@@ -2971,6 +3347,7 @@ void VecRotToMat4(float *vec, float phi, float mat[][4])
Mat4CpyMat3(mat, tmat);
}
+/* axis angle to quaternion */
void VecRotToQuat(float *vec, float phi, float *quat)
{
/* rotation of phi radials around vec */
@@ -3067,111 +3444,6 @@ float NormalizedVecAngle2_2D(float *v1, float *v2)
return 2.0f*(float)saasin(Vec2Lenf(v2, v1)/2.0f);
}
-void euler_rot(float *beul, float ang, char axis)
-{
- float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
-
- eul[0]= eul[1]= eul[2]= 0.0f;
- if(axis=='x') eul[0]= ang;
- else if(axis=='y') eul[1]= ang;
- else eul[2]= ang;
-
- EulToMat3(eul, mat1);
- EulToMat3(beul, mat2);
-
- Mat3MulMat3(totmat, mat2, mat1);
-
- Mat3ToEul(totmat, beul);
-
-}
-
-/* exported to transform.c */
-void compatible_eul(float *eul, float *oldrot)
-{
- float dx, dy, dz;
-
- /* correct differences of about 360 degrees first */
- dx= eul[0] - oldrot[0];
- dy= eul[1] - oldrot[1];
- dz= eul[2] - oldrot[2];
-
- while(fabs(dx) > 5.1) {
- if(dx > 0.0f) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
- dx= eul[0] - oldrot[0];
- }
- while(fabs(dy) > 5.1) {
- if(dy > 0.0f) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
- dy= eul[1] - oldrot[1];
- }
- while(fabs(dz) > 5.1) {
- if(dz > 0.0f) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
- dz= eul[2] - oldrot[2];
- }
-
- /* is 1 of the axis rotations larger than 180 degrees and the other small? NO ELSE IF!! */
- if( fabs(dx) > 3.2 && fabs(dy)<1.6 && fabs(dz)<1.6 ) {
- if(dx > 0.0) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
- }
- if( fabs(dy) > 3.2 && fabs(dz)<1.6 && fabs(dx)<1.6 ) {
- if(dy > 0.0) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
- }
- if( fabs(dz) > 3.2 && fabs(dx)<1.6 && fabs(dy)<1.6 ) {
- if(dz > 0.0) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
- }
-
- /* the method below was there from ancient days... but why! probably because the code sucks :)
- */
-#if 0
- /* calc again */
- dx= eul[0] - oldrot[0];
- dy= eul[1] - oldrot[1];
- dz= eul[2] - oldrot[2];
-
- /* special case, tested for x-z */
-
- if( (fabs(dx) > 3.1 && fabs(dz) > 1.5 ) || ( fabs(dx) > 1.5 && fabs(dz) > 3.1 ) ) {
- if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
- if(eul[1] > 0.0) eul[1]= M_PI - eul[1]; else eul[1]= -M_PI - eul[1];
- if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
-
- }
- else if( (fabs(dx) > 3.1 && fabs(dy) > 1.5 ) || ( fabs(dx) > 1.5 && fabs(dy) > 3.1 ) ) {
- if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
- if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
- if(eul[2] > 0.0) eul[2]= M_PI - eul[2]; else eul[2]= -M_PI - eul[2];
- }
- else if( (fabs(dy) > 3.1 && fabs(dz) > 1.5 ) || ( fabs(dy) > 1.5 && fabs(dz) > 3.1 ) ) {
- if(eul[0] > 0.0) eul[0]= M_PI - eul[0]; else eul[0]= -M_PI - eul[0];
- if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
- if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
- }
-#endif
-}
-
-/* uses 2 methods to retrieve eulers, and picks the closest */
-void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot)
-{
- float eul1[3], eul2[3];
- float d1, d2;
-
- mat3_to_eul2(mat, eul1, eul2);
-
- compatible_eul(eul1, oldrot);
- compatible_eul(eul2, oldrot);
-
- d1= (float)fabs(eul1[0]-oldrot[0]) + (float)fabs(eul1[1]-oldrot[1]) + (float)fabs(eul1[2]-oldrot[2]);
- d2= (float)fabs(eul2[0]-oldrot[0]) + (float)fabs(eul2[1]-oldrot[1]) + (float)fabs(eul2[2]-oldrot[2]);
-
- /* return best, which is just the one with lowest difference */
- if( d1 > d2) {
- VecCopyf(eul, eul2);
- }
- else {
- VecCopyf(eul, eul1);
- }
-
-}
-
/* ******************************************** */
void SizeToMat3( float *size, float mat[][3])
@@ -4694,7 +4966,8 @@ float PdistVL3Dfl(float *v1, float *v2, float *v3)
/* make a 4x4 matrix out of 3 transform components */
/* matrices are made in the order: scale * rot * loc */
-void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3])
+// TODO: need to have a version that allows for rotation order...
+void LocEulSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3])
{
float rmat[3][3], smat[3][3], tmat[3][3];
@@ -4717,7 +4990,31 @@ void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3])
/* make a 4x4 matrix out of 3 transform components */
/* matrices are made in the order: scale * rot * loc */
-void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3])
+void LocEulOSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3], short rotOrder)
+{
+ float rmat[3][3], smat[3][3], tmat[3][3];
+
+ /* initialise new matrix */
+ Mat4One(mat);
+
+ /* make rotation + scaling part */
+ EulOToMat3(eul, rotOrder, rmat);
+ SizeToMat3(size, smat);
+ Mat3MulMat3(tmat, rmat, smat);
+
+ /* copy rot/scale part to output matrix*/
+ Mat4CpyMat3(mat, tmat);
+
+ /* copy location to matrix */
+ mat[3][0] = loc[0];
+ mat[3][1] = loc[1];
+ mat[3][2] = loc[2];
+}
+
+
+/* make a 4x4 matrix out of 3 transform components */
+/* matrices are made in the order: scale * rot * loc */
+void LocQuatSizeToMat4(float mat[4][4], float loc[3], float quat[4], float size[3])
{
float rmat[3][3], smat[3][3], tmat[3][3];
@@ -4738,6 +5035,8 @@ void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3
mat[3][2] = loc[2];
}
+/********************************************************/
+
/* Tangents */
/* For normal map tangents we need to detect uv boundaries, and only average
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index db7bae8a91d..7d5e1eec53e 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack2d.c
@@ -16,28 +16,22 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Campbell barton
+ * Contributor(s): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
-#include <stdlib.h>
+#include <stdlib.h> /* for qsort */
-#include "BKE_utildefines.h"
#include "MEM_guardedalloc.h"
#include "BLI_boxpack2d.h"
-/* BoxPacker ported from Python by Campbell Barton
+/* BoxPacker for backing 2D rectangles into a square
*
* The defined Below are for internal use only */
/* free vert flags */
-#define eul 0.0000001
+#define eul 0.0000001f
#define BLF 1
#define TRF 2
#define TLF 4
@@ -79,6 +73,9 @@
BOXRIGHT(b1)-eul<=BOXLEFT(b2) ||\
BOXTOP(b1)-eul<=BOXBOTTOM(b2) ))
+#define MIN2(x,y) ( (x)<(y) ? (x) : (y) )
+#define MAX2(x,y) ( (x)>(y) ? (x) : (y) )
+
/* #define BOXDEBUG(b)\
* printf("\tBox Debug i %i, w:%.3f h:%.3f x:%.3f y:%.3f\n",\
* b->index, b->w, b->h, b->x, b->y) */
@@ -141,11 +138,11 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
int box_index, verts_pack_len, i, j, k, isect;
int quad_flags[4]= {BLF,TRF,TLF,BRF}; /* use for looping */
boxPack *box, *box_test; /*current box and another for intersection tests*/
- int *vertex_pack_indicies; /*an array of indicies used for sorting verts*/
+ int *vertex_pack_indicies; /*an array of indices used for sorting verts*/
if (!len) {
- *tot_width = 0.0;
- *tot_height = 0.0;
+ *tot_width = 0.0f;
+ *tot_height = 0.0f;
return;
}
@@ -153,8 +150,8 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
qsort(boxarray, len, sizeof(boxPack), box_areasort);
/* add verts to the boxes, these are only used internally */
- vert = vertarray = MEM_mallocN( len*4*sizeof(boxVert), "boxPack verts");
- vertex_pack_indicies = MEM_mallocN( len*3*sizeof(int), "boxPack indicies");
+ vert = vertarray = MEM_mallocN( len*4*sizeof(boxVert), "boxPack Verts");
+ vertex_pack_indicies = MEM_mallocN( len*3*sizeof(int), "boxPack Indices");
for (box=boxarray, box_index=0, i=0; box_index < len; box_index++, box++) {
@@ -194,11 +191,11 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
/* Pack the First box!
- * then enter the main boxpacking loop */
+ * then enter the main box-packing loop */
box = boxarray; /* get the first box */
/* First time, no boxes packed */
- box->v[BL]->free = 0; /* Cant use any if these */
+ box->v[BL]->free = 0; /* Can't use any if these */
box->v[BR]->free &= ~(BLF|BRF);
box->v[TL]->free &= ~(BLF|TLF);
@@ -206,9 +203,9 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
*tot_height = box->h;
/* This sets all the vertex locations */
- SET_BOXLEFT(box, 0.0);
- SET_BOXBOTTOM(box, 0.0);
- box->x = box->y = 0.0;
+ SET_BOXLEFT(box, 0.0f);
+ SET_BOXBOTTOM(box, 0.0f);
+ box->x = box->y = 0.0f;
for (i=0; i<3; i++)
vertex_pack_indicies[i] = box->v[i+1]->index;
@@ -219,7 +216,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
/* Main boxpacking loop */
for (box_index=1; box_index < len; box_index++, box++) {
- /* Sort the verts, these constants are used in sorting */
+ /* These static floatds are used for sorting */
box_width = box->w;
box_height = box->h;
@@ -234,7 +231,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
/* printf("\ttesting vert %i %i %i %f %f\n", i,
* vert->free, verts_pack_len, vert->x, vert->y); */
- /* This vert has a free quaderent
+ /* This vert has a free quadrant
* Test if we can place the box here
* vert->free & quad_flags[j] - Checks
* */
@@ -266,7 +263,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
isect = 0;
if (/* Constrain boxes to positive X/Y values */
- BOXLEFT(box)<0.0 || BOXBOTTOM(box) < 0.0 ||
+ BOXLEFT(box)<0.0f || BOXBOTTOM(box) < 0.0f ||
/* check for last intersected */
( vert->isect_cache[j] &&
BOXINTERSECT(box, vert->isect_cache[j]) )
@@ -274,13 +271,13 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
/* Here we check that the last intersected
* box will intersect with this one using
* isect_cache that can store a pointer to a
- * box for each quaderent
+ * box for each quadrant
* big speedup */
isect = 1;
} else {
- /* do a full saech for colliding box
- * this is realy slow, some spacialy divided
- * datastructure would be better */
+ /* do a full search for colliding box
+ * this is really slow, some spacialy divided
+ * data-structure would be better */
for (box_test=boxarray; box_test != box; box_test++) {
if BOXINTERSECT(box, box_test) {
/* Store the last intersecting here as cache
@@ -321,7 +318,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
}
/* Mask free flags for verts that are
- * on the bottom or side so we dont get
+ * on the bottom or side so we don't get
* boxes outside the given rectangle ares
*
* We can do an else/if here because only the first
@@ -392,7 +389,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
verts_pack_len++;
}
}
- /* The Box verts are only used interially
+ /* The Box verts are only used internally
* Update the box x and y since thats what external
* functions will see */
box->x = BOXLEFT(box);
@@ -403,8 +400,8 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
}
}
- /* free all the verts, not realy needed because they shouldebt be
- * touched anymore but accessing the pointers woud crash blender */
+ /* free all the verts, not really needed because they shouldn't be
+ * touched anymore but accessing the pointers would crash blender */
for (box_index=0; box_index < len; box_index++) {
box = boxarray+box_index;
box->v[0] = box->v[1] = box->v[2] = box->v[3] = NULL;
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 85a95fa6e66..6c89afe7173 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -51,7 +51,7 @@
/* for sequence */
//XXX #include "BSE_sequence.h"
//XXX define below from BSE_sequence.h - otherwise potentially odd behaviour
-#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE)
+#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_IMAGE)
/* path/file handeling stuff */
#ifndef WIN32
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index 1064c8ac1bf..3194593374f 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -347,11 +347,11 @@ void BLI_duplicatelist(ListBase *list1, ListBase *list2) /* copy from 2 to 1 */
{
struct Link *link1, *link2;
+ /* in this order, to ensure it works if list1 == list2 */
+ link2= list2->first;
list1->first= list1->last= 0;
- link2= list2->first;
while(link2) {
-
link1= MEM_dupallocN(link2);
BLI_addtail(list1, link1);
diff --git a/source/blender/blenlib/intern/psfont.c b/source/blender/blenlib/intern/psfont.c
deleted file mode 100644
index 269e674a62f..00000000000
--- a/source/blender/blenlib/intern/psfont.c
+++ /dev/null
@@ -1,2126 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * fromtype1 - Convert an Adobe type 1 font into .of or .sf format.
- * Paul Haeberli - 1990
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_vfontdata.h"
-#include "BLI_blenlib.h"
-
-#include "DNA_packedFile_types.h"
-#include "DNA_curve_types.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
- /* ObjFnt types */
-
-typedef struct chardesc {
- short movex, movey; /* advance */
- short llx, lly; /* bounding box */
- short urx, ury;
- short *data; /* char data */
- intptr_t datalen;
-} chardesc;
-
-typedef struct objfnt {
- struct objfnt *freeaddr; /* if freeaddr != 0, objfnt is one chunck */
- short type;
- short charmin, charmax;
- short my_nchars;
- short scale;
- chardesc *my_chars;
-} objfnt;
-
-#define OFMAGIC 0x93339333
-
-#define TM_TYPE 1
-#define PO_TYPE 2
-#define SP_TYPE 3
-
-/* ops for tmesh characters */
-
-#define TM_BGNTMESH (1)
-#define TM_SWAPTMESH (2)
-#define TM_ENDBGNTMESH (3)
-#define TM_RETENDTMESH (4)
-#define TM_RET (5)
-
-/* ops for poly characters */
-
-#define PO_BGNLOOP (1)
-#define PO_ENDBGNLOOP (2)
-#define PO_RETENDLOOP (3)
-#define PO_RET (4)
-
-/* ops for spline characters */
-
-#define SP_MOVETO (1)
-#define SP_LINETO (2)
-#define SP_CURVETO (3)
-#define SP_CLOSEPATH (4)
-#define SP_RETCLOSEPATH (5)
-#define SP_RET (6)
-
-
-#define MIN_ASCII ' '
-#define MAX_ASCII '~'
-#define NASCII (256 - 32)
-
-#define NOBBOX (30000)
-
-typedef struct pschar {
- char *name;
- int code;
- int prog;
-} pschar;
-
- /***/
-
-#define SKIP 4
-#define LINELEN 2048
-#define NOTHEX (100)
-#define MC1 52845
-#define MC2 22719
-#define MAXSUBRS 4000
-#define MAXCHARS 4000
-#define MAXTRIES 30
-
-/* some local thingies */
-static void rcurveto( int dx1, int dy1, int dx2, int dy2, int dx3, int dy3);
-static void makeobjfont(int savesplines);
-static void drawchar(int c);
-static void runprog(void);
-static int chartoindex(objfnt *fnt, int c);
-static short STDtoISO(short c);
-static char * newfgets(char * s, int n, PackedFile * pf);
-static int readfontmatrix(PackedFile * pf, float mat[2][2]);
-static char mdecrypt(char cipher);
-static void decryptall(void);
-static int decodetype1(PackedFile * pf, char *outname);
-static void fakefopen(void);
-static char *fakefread(int n);
-static void setcharlist(void);
-static void initpcstack(void);
-static char *poppc(void);
-static void initstack(void);
-static void push(int val);
-static int pop(void);
-static void initretstack(void);
-static void retpush(int val);
-static int retpop(void);
-static void subr1(void);
-static void subr2(void);
-static void subr0(void);
-static void append_poly_offset(short ofsx, short ofsy, short * data);
-static void append_spline_offset(short ofsx, short ofsy, short * data);
-static void setwidth(int w, int x);
-static void poly_beginchar(void);
-static void poly_endchar(void);
-static void poly_close(void);
-static void poly_pnt(float x, float y);
-static void spline_beginchar(void);
-static void spline_endchar(void);
-static void spline_close(void);
-static void spline_line(float x0, float y0, float x1, float y1);
-static void spline_curveto(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
-static void savestart(int x, int y);
-static void sbpoint( int x, int y);
-static void rmoveto( int x, int y);
-static void drawline(float x0, float y0, float x1, float y1, float dx0, float dy0, float dx1, float dy1);
-static void rlineto( int x, int y);
-static void closepath(void);
-static void bezadapt( float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float beztol);
-static void drawbez( float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
-static int docommand(int cmd);
-
-/* some local vars */
-static int startx, starty;
-static int curx, cury;
-static int nextx, nexty;
-static int delx, dely;
-static int started;
-
-
-/* postscript commands */
-#define HSTEM (1)
-#define VSTEM (3)
-#define VMOVETO (4)
-#define RLINETO (5)
-#define HLINETO (6)
-#define VLINETO (7)
-#define RRCURVETO (8)
-#define CLOSEPATH (9)
-#define CALLSUBR (10)
-#define RETURN (11)
-#define HSBW (13)
-#define ENDCHAR (14)
-#define RMOVETO (21)
-#define HMOVETO (22)
-#define VHCURVETO (30)
-#define HVCURVETO (31)
-#define DOTSECTION (256+0)
-#define VSTEM3 (256+1)
-#define HSTEM3 (256+2)
-#define SEAC (256+6)
-#define SBW (256+7)
-#define DIV (256+12)
-#define CALLOTHERSUBR (256+16)
-#define POP (256+17)
-#define SETCURRENTPOINT (256+33)
-#define WHAT0 (0)
-
-static char oneline[LINELEN];
-static objfnt *fnt;
-
-static unsigned short int mr;
-
-static char *bindat;
-static int datbytes;
-static int firsted;
-static short chardata[20000];
-static int nshorts;
-
-static int thecharwidth, thesidebearing;
-static int npnts, nloops;
-static int nvertpos;
-
-static int fakepos;
-static int fakemax;
-
-static float beztol = 100.0;
-
-/* extern: from libfm */
-
-static char *my_subrs[MAXSUBRS];
-static unsigned int my_sublen[MAXSUBRS];
-static char *my_chars[MAXCHARS];
-static unsigned int my_charlen[MAXCHARS];
-static char *my_charname[MAXCHARS];
-static int my_nsubrs, my_nchars;
-
-static short sidebearing[MAXCHARS];
-static char tok[LINELEN];
-static int sp_npnts, sp_nloops;
-
-/*
- * interpreter globals
- */
-
-
-static float mat[2][2];
-static char *pcstack[100];
-static char *pc;
-static int pcsp;
-static int coordpos;
-static int coordsave[7][2];
-static int incusp;
-static int retstack[1000];
-static int retsp;
-static int stack[1000];
-static int sp;
-static int savesplines = 1;
-
-static pschar ISOcharlist[NASCII] = {
- {"/space", 040, 0},
- {"/exclam", 041, 0},
- {"/quotedbl", 042, 0},
- {"/numbersign", 043, 0},
- {"/dollar", 044, 0},
- {"/percent", 045, 0},
- {"/ampersand", 046, 0},
- {"/quoteright", 047, 0},
-
- {"/parenleft", 050, 0},
- {"/parenright", 051, 0},
- {"/asterisk", 052, 0},
- {"/plus", 053, 0},
- {"/comma", 054, 0},
- {"/hyphen", 055, 0},
- {"/period", 056, 0},
- {"/slash", 057, 0},
-
- {"/zero", 060, 0},
- {"/one", 061, 0},
- {"/two", 062, 0},
- {"/three", 063, 0},
- {"/four", 064, 0},
- {"/five", 065, 0},
- {"/six", 066, 0},
- {"/seven", 067, 0},
-
- {"/eight", 070, 0},
- {"/nine", 071, 0},
- {"/colon", 072, 0},
- {"/semicolon", 073, 0},
- {"/less", 074, 0},
- {"/equal", 075, 0},
- {"/greater", 076, 0},
- {"/question", 077, 0},
-
- {"/at", 0100, 0},
- {"/A", 0101, 0},
- {"/B", 0102, 0},
- {"/C", 0103, 0},
- {"/D", 0104, 0},
- {"/E", 0105, 0},
- {"/F", 0106, 0},
- {"/G", 0107, 0},
-
- {"/H", 0110, 0},
- {"/I", 0111, 0},
- {"/J", 0112, 0},
- {"/K", 0113, 0},
- {"/L", 0114, 0},
- {"/M", 0115, 0},
- {"/N", 0116, 0},
- {"/O", 0117, 0},
-
- {"/P", 0120, 0},
- {"/Q", 0121, 0},
- {"/R", 0122, 0},
- {"/S", 0123, 0},
- {"/T", 0124, 0},
- {"/U", 0125, 0},
- {"/V", 0126, 0},
- {"/W", 0127, 0},
-
- {"/X", 0130, 0},
- {"/Y", 0131, 0},
- {"/Z", 0132, 0},
- {"/bracketleft", 0133, 0},
- {"/backslash", 0134, 0},
- {"/bracketright", 0135, 0},
- {"/asciicircum", 0136, 0},
- {"/underscore", 0137, 0},
-
- {"/quoteleft", 0140, 0},
- {"/a", 0141, 0},
- {"/b", 0142, 0},
- {"/c", 0143, 0},
- {"/d", 0144, 0},
- {"/e", 0145, 0},
- {"/f", 0146, 0},
- {"/g", 0147, 0},
-
- {"/h", 0150, 0},
- {"/i", 0151, 0},
- {"/j", 0152, 0},
- {"/k", 0153, 0},
- {"/l", 0154, 0},
- {"/m", 0155, 0},
- {"/n", 0156, 0},
- {"/o", 0157, 0},
-
- {"/p", 0160, 0},
- {"/q", 0161, 0},
- {"/r", 0162, 0},
- {"/s", 0163, 0},
- {"/t", 0164, 0},
- {"/u", 0165, 0},
- {"/v", 0166, 0},
- {"/w", 0167, 0},
-
- {"/x", 0170, 0},
- {"/y", 0171, 0},
- {"/z", 0172, 0},
- {"/braceleft", 0173, 0},
- {"/bar", 0174, 0},
- {"/braceright", 0175, 0},
- {"/asciitilde", 0176, 0},
- {"/", 0177, 0},
-
-
- /* nonstandard defs */
-
- {"/quotedblleft", 0200, 0},
- {"/quotedblright", 0201, 0},
- {"/quotedblbase", 0202, 0},
- {"/quotesinglbase", 0203, 0},
- {"/guilsinglleft", 0204, 0},
- {"/guilsinglright", 0205, 0},
- {"/endash", 0206, 0},
- {"/dagger", 0207, 0},
-
- {"/daggerdbl", 0210, 0},
- {"/trademark", 0211, 0},
- {"/bullet", 0212, 0},
- {"/perthousand", 0213, 0},
- {"/Lslash", 0214, 0},
- {"/OE", 0215, 0},
- {"/lslash", 0216, 0},
- {"/oe", 0217, 0},
-
- /* endnonstandard defs */
-
- {"/dotlessi", 0220, 0},
- {"/grave", 0221, 0},
- {"/acute", 0222, 0},
- {"/circumflex", 0223, 0},
- {"/tilde", 0224, 0},
- {"/", 0225, 0},
- {"/breve", 0226, 0},
- {"/dotaccent", 0227, 0},
-
- {"/", 0230, 0},
- {"/", 0231, 0},
- {"/ring", 0232, 0},
- {"/", 0233, 0},
- {"/", 0234, 0},
- {"/hungarumlaut", 0235, 0},
- {"/ogonek", 0236, 0},
- {"/caron", 0237, 0},
-
- {"/", 0240, 0},
- {"/exclamdown", 0241, 0},
- {"/cent", 0242, 0},
- {"/sterling", 0243, 0},
- {"/florin", 0244, 0},
- {"/yen", 0245, 0},
- {"/brokenbar", 0246, 0},
- {"/section", 0247, 0},
-
- {"/dieresis", 0250, 0},
- {"/copyright", 0251, 0},
- {"/ordfeminine", 0252, 0},
- {"/guillemotleft", 0253, 0},
- {"/logicalnot", 0254, 0},
- {"/hyphen", 0255, 0},
- {"/registered", 0256, 0},
- {"/macron", 0257, 0},
-
- {"/degree", 0260, 0},
- {"/plusminus", 0261, 0},
- {"/twosuperior", 0262, 0},
- {"/threesuperior", 0263, 0},
- {"/acute", 0264, 0},
- {"/mu", 0265, 0},
- {"/paragraph", 0266, 0},
- {"/periodcentered", 0267, 0},
-
- {"/cedilla", 0270, 0},
- {"/onesuperior", 0271, 0},
- {"/ordmasculine", 0272, 0},
- {"/guillemotright", 0273, 0},
- {"/onequarter", 0274, 0},
- {"/onehalf", 0275, 0},
- {"/threequarters", 0276, 0},
- {"/questiondown", 0277, 0},
-
- {"/Agrave", 0300, 0},
- {"/Aacute", 0301, 0},
- {"/Acircumflex", 0302, 0},
- {"/Atilde", 0303, 0},
- {"/Adieresis", 0304, 0},
- {"/Aring", 0305, 0},
- {"/AE", 0306, 0},
- {"/Ccedilla", 0307, 0},
-
- {"/Egrave", 0310, 0},
- {"/Eacute", 0311, 0},
- {"/Ecircumflex", 0312, 0},
- {"/Edieresis", 0313, 0},
- {"/Igrave", 0314, 0},
- {"/Iacute", 0315, 0},
- {"/Icircumflex", 0316, 0},
- {"/Idieresis", 0317, 0},
-
- {"/Eth", 0320, 0},
- {"/Ntilde", 0321, 0},
- {"/Ograve", 0322, 0},
- {"/Oacute", 0323, 0},
- {"/Ocircumflex", 0324, 0},
- {"/Otilde", 0325, 0},
- {"/Odieresis", 0326, 0},
- {"/multiply", 0327, 0},
-
- {"/Oslash", 0330, 0},
- {"/Ugrave", 0331, 0},
- {"/Uacute", 0332, 0},
- {"/Ucircumflex",0333, 0},
- {"/Udieresis", 0334, 0},
- {"/Yacute", 0335, 0},
- {"/Thorn", 0336, 0},
- {"/germandbls", 0337, 0},
-
- {"/agrave", 0340, 0},
- {"/aacute", 0341, 0},
- {"/acircumflex",0342, 0},
- {"/atilde", 0343, 0},
- {"/adieresis", 0344, 0},
- {"/aring", 0345, 0},
- {"/ae", 0346, 0},
- {"/ccedilla", 0347, 0},
-
- {"/egrave", 0350, 0},
- {"/eacute", 0351, 0},
- {"/ecircumflex", 0352, 0},
- {"/edieresis", 0353, 0},
- {"/igrave", 0354, 0},
- {"/iacute", 0355, 0},
- {"/icircumflex", 0356, 0},
- {"/idieresis", 0357, 0},
-
- {"/eth", 0360, 0},
- {"/ntilde", 0361, 0},
- {"/ograve", 0362, 0},
- {"/oacute", 0363, 0},
- {"/ocircumflex",0364, 0},
- {"/otilde", 0365, 0},
- {"/odieresis", 0366, 0},
- {"/divide", 0367, 0},
-
- {"/oslash", 0370, 0},
- {"/ugrave", 0371, 0},
- {"/uacute", 0372, 0},
- {"/ucircumflex",0373, 0},
- {"/udieresis", 0374, 0},
- {"/yacute", 0375, 0},
- {"/thorn", 0376, 0},
- {"/ydieresis", 0377, 0},
-};
-
-
-static short STDvsISO [][2] = {
- {0341, 0306}, /* AE */
- {0351, 0330}, /* Oslash */
- {0302, 0222}, /* acute */
- {0361, 0346}, /* ae */
- {0306, 0226}, /* breve */
- {0317, 0237}, /* caron */
- {0313, 0270}, /* cedilla */
- {0303, 0223}, /* circumflex */
- {0250, 0244}, /* currency */
- {0310, 0250}, /* dieresis */
- {0307, 0227}, /* dotaccent */
- {0365, 0220}, /* dotlessi */
- {0373, 0337}, /* germandbls */
- {0301, 0221}, /* grave */
- {0315, 0235}, /* hungarumlaut */
- {0055, 0255}, /* hyphen */
- {0305, 0257}, /* macron */
- {0316, 0236}, /* ogenek */
- {0343, 0252}, /* ordfeminine */
- {0353, 0272}, /* ordmasculine */
- {0371, 0370}, /* oslash */
- {0264, 0267}, /* periodcentered */
- {0312, 0232}, /* ring */
- {0304, 0224}, /* tilde */
-};
-
-/* from objfont.c, rest is in lfm_s !!*/
-
-/* START 5.2 */
-
-static int chartoindex(objfnt *fnt, int c)
-{
- if(c<fnt->charmin)
- return -1;
- if(c>fnt->charmax)
- return -1;
- return c-fnt->charmin;
-}
-
-
-static chardesc *getchardesc(objfnt *fnt, int c)
-{
- int index;
-
- index = chartoindex(fnt,c);
- if(index<0)
- return 0;
- return fnt->my_chars+index;
-}
-
-static objfnt *newobjfnt(int type, int charmin, int charmax, int fscale)
-{
- objfnt *fnt;
-
- fnt = (objfnt *)MEM_mallocN(sizeof(objfnt), "newobjfnt");
- fnt->freeaddr = 0;
- fnt->type = type;
- fnt->charmin = charmin;
- fnt->charmax = charmax;
- fnt->my_nchars = fnt->charmax-fnt->charmin+1;
- fnt->scale = fscale;
- fnt->my_chars = (chardesc *)MEM_mallocN(fnt->my_nchars*sizeof(chardesc), "newobjfnt2");
- memset(fnt->my_chars, 0, fnt->my_nchars*sizeof(chardesc));
- return fnt;
-}
-
-
-static void addchardata (objfnt * fnt, int c, short * data, int nshorts)
-{
- int index;
- chardesc *cd;
-
- index = chartoindex(fnt,c);
- if(index<0) {
- fprintf(stderr,"Addchardata bad poop\n");
- return;
- }
- cd = fnt->my_chars+index;
- fnt->freeaddr = 0;
- cd->datalen = nshorts*sizeof(short);
- cd->data = (short *)MEM_mallocN(cd->datalen, "addchardata");
- memcpy(cd->data, data, cd->datalen);
-}
-
-static void addcharmetrics(objfnt *fnt, int c, int movex, int movey)
-{
- int index;
- chardesc *cd;
-
- index = chartoindex(fnt,c);
- if(index<0) {
- fprintf(stderr,"Addcharmetrics bad poop\n");
- return;
- }
- cd = fnt->my_chars+index;
- cd->movex = movex;
- cd->movey = movey;
-}
-
-
-static void fakechar(objfnt *fnt, int c, int width)
-{
- short chardata[1];
-
- chardata[0] = PO_RET;
- addchardata(fnt,c,chardata,1);
- addcharmetrics(fnt,c,width,0);
-}
-
-
-static void freeobjfnt(objfnt * fnt)
-{
- int i;
- chardesc *cd;
-
- cd = fnt->my_chars;
- for(i=0; i<fnt->my_nchars; i++) {
- if(cd->data)
- MEM_freeN(cd->data);
- cd++;
- }
- MEM_freeN(fnt->my_chars);
- MEM_freeN(fnt);
-}
-
-
-/* END 5.2 */
-
-static short STDtoISO(short c)
-{
- short i = (sizeof(STDvsISO) / (2 * sizeof(short))) - 1;
-
- for (;i >= 0; i--){
- if (STDvsISO[i][0] == c) return (STDvsISO[i][1]);
- }
- return(c);
-}
-
-
-/*
- * read the font matrix out of the font file
- *
- */
-
-static char * newfgets(char * s, int n, PackedFile * pf){
- int c;
- char * p;
-
- p = s;
- while (n > 0){
- c = ((char *) pf->data)[pf->seek];
- pf->seek++;
- if (pf->seek > pf->size){
- return (0);
- }
- if (c == 10 || c == 13){
- *p = 0;
- return(s);
- }
- *p++ = c;
- n--;
- }
- *p = 0;
- return(s);
-}
-
-static int readfontmatrix(PackedFile * pf, float mat[2][2])
-{
- char *cptr;
- float a, b, c, d, e, f;
-
- pf->seek = 0;
-
- /* look for the FontMatrix def */
- while(1) {
- if(!newfgets(oneline, LINELEN, pf)) {
- fprintf(stderr,"fromtype1: no FontMatrix found\n");
- return(-1);
- }
- cptr = strchr(oneline,'/');
- if(cptr) {
- if(strncmp(cptr,"/FontMatrix",11) == 0) {
- cptr = strchr(cptr,'[');
- if(!cptr) {
- fprintf(stderr,"fromtype1: bad FontMatrix line\n");
- return(-1);
- }
- sscanf(cptr+1,"%f %f %f %f %f %f\n",&a,&b,&c,&d,&e,&f);
- break;
- }
- }
- }
-
- mat[0][0] = 1000.0*a;
- mat[1][0] = 1000.0*b;
- mat[0][1] = 1000.0*c;
- mat[1][1] = 1000.0*d;
-
- return(0);
-}
-
-/*
- * Decryption support
- *
- *
- */
-static void resetdecrypt(int n)
-{
- mr = n;
-}
-
-
-
-/*
- * decryption subroutines
- *
- */
-
-static char mdecrypt(char cipher)
-{
- char plain;
-
- plain = (cipher^(mr>>8));
- mr = (cipher+mr)*MC1 + MC2;
- return plain;
-}
-
-static void decryptdata(char * cptr, int n)
-{
- while(n--) {
- *cptr = mdecrypt(*cptr);
- cptr++;
- }
-}
-
-static int decryptprogram(char *buf, int len)
-{
- int i;
-
- resetdecrypt(4330);
- for(i=0; i<len; i++) {
- if(i<SKIP) {
- mdecrypt(buf[i]);
- }
- else {
- buf[i-SKIP] = mdecrypt(buf[i]);
- }
- }
- return len-SKIP;
-}
-
-static void decryptall(void)
-{
- int i;
-
- for(i=0; i<my_nsubrs; i++)
- my_sublen[i] = decryptprogram(my_subrs[i],my_sublen[i]);
- for(i=0; i<my_nchars; i++)
- my_charlen[i] = decryptprogram(my_chars[i],my_charlen[i]);
-}
-
-
-/*
- * decode the eexec part of the file
- *
- */
-
-static int decodetype1(PackedFile * pf, char *outname)
-{
- char *hptr, *bptr;
- int i, totlen, hexbytes, c;
- char *hexdat;
- char hextab[256];
-
- /* make hex table */
- if(!firsted) {
- for(i=0; i<256; i++) {
- if(i>='0' && i<='9')
- hextab[i] = i-'0';
- else if(i>='a' && i<='f')
- hextab[i] = 10+i-'a';
- else if(i>='A' && i<='F')
- hextab[i] = 10+i-'A';
- else
- hextab[i] = NOTHEX;
- }
- }
-
- pf->seek = 0;
-
- /* allocate buffers */
- totlen = pf->size;
- hexdat = (char *)MEM_mallocN(totlen, "hexdat");
- bindat = (char *)MEM_mallocN(totlen, "bindat");
-
- /* look for eexec part of file */
- while(1) {
- if(!newfgets(oneline, LINELEN, pf)) {
- fprintf(stderr,"fromtype1: no currentfile eexec found\n");
- return(-1);
- }
- oneline[16] = 0;
- if(strcmp(oneline,"currentfile eexe") == 0)
- break;
- }
-
- /* initialize decryption variables */
- mr = 55665;
-
- /* first byte == 0 for binary data (???) */
-
- c = ((char *) pf->data)[pf->seek];
-
- if (hextab[c] != NOTHEX){
- /* read all the hex bytes into the hex buffer */
- hexbytes = 0;
- while(newfgets(oneline, LINELEN, pf)) {
- hptr = (char *)oneline;
- while(*hptr) {
- if(hextab[(int)*hptr] != NOTHEX)
- hexdat[hexbytes++] = *hptr;
- hptr++;
- }
- }
-
- /* check number of hex bytes */
- if(hexbytes & 1)
- hexbytes--;
- datbytes = hexbytes/2;
-
- /* translate hex data to binary */
- hptr = hexdat;
- bptr = bindat;
- c = datbytes;
- while(c--) {
- *bptr++ = (hextab[(int)hptr[0]]<<4)+hextab[(int)hptr[1]];
- hptr += 2;
- }
-
- /* decrypt the data */
- decryptdata(bindat,datbytes);
-
- } else {
- datbytes = pf->size - pf->seek;
- memcpy(bindat, ((char *) pf->data) + pf->seek, datbytes);
-
- if ((bindat[2] << (8 + bindat[3])) == 0x800){
- /* order data (remove 6 bytes headers) */
- i = datbytes;
- hptr = bptr = bindat + 4;
- hptr += 2;
-
- while (i > 0){
- if (i > 2046) c = 2046;
- else c = i;
-
- memcpy(bptr, hptr, c);
- bptr += 2046;
- hptr += 2046 + 6;
- i -= 2046 + 6;
- datbytes -= 6;
- }
-
- /* decrypt the data */
- decryptdata(bindat+4,datbytes);
- } else{
- decryptdata(bindat+6,datbytes-6);
- }
- }
-
-#ifdef DEBUG
- outf = fopen(outname,"wb");
- fwrite(bindat,datbytes,1,outf);
- fclose(outf);
-#endif
-
- MEM_freeN(hexdat);
-
- return 1;
-}
-
-/*
- * fake file reading funcs
- *
- *
- */
-
-static void fakefopen(void)
-{
- fakepos = 0;
- fakemax = datbytes;
-}
-
-
-static void fakegettoken(char *str)
-{
- int c;
- char *cptr;
- char *start;
-
- start = (char *) str;
- cptr = bindat+fakepos;
- c = *cptr++;
- fakepos++;
- if(c != '\n') {
- while(isspace(c)) {
- c = *cptr++;
- fakepos++;
- }
- while (fakepos<fakemax && !isspace(c)) {
- *str++ = c;
- c = *cptr++;
- fakepos++;
- }
- if(c == '\n')
- fakepos--;
- }
- *str = 0;
- if(fakepos>fakemax) {
- fprintf(stderr,"fromtype1: unexpected eof\n");
- strcpy(start, "end");
- }
-}
-
-static int fakefgets(char *buf,int max)
-{
- char *cptr;
-
- cptr = (char *)(bindat+fakepos);
- while(max--) {
- *buf++ = *cptr;
- fakepos++;
- if(*cptr == 10 || *cptr == 13)
- return 1;
- cptr++;
- if(fakepos>fakemax)
- return 0;
- }
- return 0;
-}
-
-static char *fakefread(int n)
-{
- fakepos += n;
- return bindat+fakepos-n;
-}
-
-static void applymat(float mat[][2], float *x, float *y)
-{
- float tx, ty;
-
- tx = ((*x)*mat[0][0])+((*y)*mat[0][1]);
- ty = ((*x)*mat[1][0])+((*y)*mat[1][1]);
- *x = tx;
- *y = ty;
-}
-
-static void setcharlist(void)
-{
- char *name; /*found;*/
- int i, j;
-
- for(i=0; i<NASCII; i++) ISOcharlist[i].prog = -1;
-
- for(j=0; j<my_nchars; j++) {
- name = my_charname[j];
- if(name) {
- /*found = 0;*/
- for(i=0; i<NASCII; i++) {
- if(ISOcharlist[i].name && (strcmp(name,ISOcharlist[i].name) == 0)){
- ISOcharlist[i].prog = j;
- /*found = 1;*/
- }
- }
- /*if (found == 0) printf("no match found for: %s\n", name);*/
- MEM_freeN(name);
- my_charname[j] = 0;
- }
- }
-}
-
-
-static objfnt * objfnt_from_psfont(PackedFile * pf)
-{
- int i, k, index;
- int nread, namelen;
- char *cptr;
-
- fnt = 0;
- bindat = 0;
-
- /* read the font matrix from the font */
- if (readfontmatrix(pf,mat)) return(0);
-
- /* decode the font data */
- decodetype1(pf, "/usr/tmp/type1.dec");
-
- /* open the input file */
- fakefopen();
-
- /* look for the /Subrs def and get my_nsubrs */
- while(1) {
- if(!fakefgets(oneline,LINELEN)) {
- fprintf(stderr,"fromtype1: no /Subrs found\n");
- my_nsubrs = 0;
- fakefopen();
- break;
- }
- cptr = strchr(oneline,'/');
- if(cptr) {
- if(strncmp(cptr,"/Subrs",6) == 0) {
- my_nsubrs = atoi(cptr+6);
- break;
- }
- }
- }
-
- /* read the Subrs in one by one */
- for(i=0; i<my_nsubrs; i++)
- my_sublen[i] = 0;
- for(i=0; i<my_nsubrs; i++) {
- for(k=0; k<MAXTRIES; k++) {
- fakegettoken(tok);
- if(strcmp(tok,"dup") == 0)
- break;
- }
- if(k == MAXTRIES) {
- fprintf(stderr,"dup for subr %d not found in range\n", i);
- /*exit(1);*/
- }
-
- /* get the Subr index here */
- fakegettoken(tok);
- index = atoi(tok);
-
- /* check to make sure it is in range */
- if(index<0 || index>my_nsubrs) {
- fprintf(stderr,"bad Subr index %d\n",index);
- /*exit(1);*/
- }
-
- /* get the number of bytes to read */
- fakegettoken(tok);
- nread = atoi(tok);
- fakegettoken(tok);
-
- /* read in the subroutine */
- my_sublen[index] = nread;
- my_subrs[index] = fakefread(nread);
- fakegettoken(tok);
- }
-
- /* look for the CharStrings */
- while(1) {
- fakegettoken(tok);
- cptr = strchr(tok,'/');
- if(cptr && strcmp(cptr,"/CharStrings") == 0)
- break;
- }
-
- fakegettoken(tok); /* skip my_ncharscrings */
- fakegettoken(tok); /* skip dict */
- fakegettoken(tok); /* skip dup */
- fakegettoken(tok); /* skip begin */
- fakegettoken(tok); /* skip newline */
-
- /* read the CharStrings one by one */
- my_nchars = 0;
- for(i=0; i<MAXCHARS; i++) {
-
- /* check for end */
- fakegettoken(tok);
- if(strcmp(tok,"end") == 0)
- break;
-
- /* get the char name and allocate space for it */
- namelen = strlen(tok);
- my_charname[i] = (char *)MEM_mallocN(namelen+1, "my_charname");
- strcpy(my_charname[i],tok);
-
- /* get the number of bytes to read */
- fakegettoken(tok);
- nread = atoi(tok);
- fakegettoken(tok);
-
- /* read in the char description */
- my_charlen[i] = nread;
- my_chars[i] = fakefread(nread);
-
- /* skip the end of line */
- fakegettoken(tok);
- fakegettoken(tok);
- my_nchars++;
- }
-
- /* decrypt the character descriptions */
- decryptall();
- setcharlist();
-
- /* make the obj font */
- makeobjfont(savesplines);
-
- if (bindat) MEM_freeN(bindat);
- /* system("rm /usr/tmp/type1.dec"); */
-
- return (fnt);
-}
-
-
-
-
-/*
- * pc stack support
- *
- */
-
-static void initpcstack(void)
-{
- pcsp = 0;
-}
-
-static void pushpc(char *pc)
-{
- pcstack[pcsp] = pc;
- pcsp++;
-}
-
-static char *poppc(void)
-{
- pcsp--;
- if(pcsp<0) {
- fprintf(stderr,"\nYUCK: pc stack under flow\n");
- pcsp = 0;
- return 0;
- }
- return pcstack[pcsp];
-}
-
-/*
- * Data stack support
- *
- */
-
-static void initstack(void)
-{
- sp = 0;
-}
-
-static void push(int val)
-/* int val; */
-{
- stack[sp] = val;
- sp++;
-}
-
-static int pop(void)
-{
- sp--;
- if(sp<0) {
- fprintf(stderr,"\nYUCK: stack under flow\n");
- sp = 0;
- return 0;
- }
- return stack[sp];
-}
-
-/*
- * call/return data stack
- *
- */
-
-static void initretstack(void)
-{
- retsp = 0;
-}
-
-static void retpush(int val)
-/* int val; */
-{
- retstack[retsp] = val;
- retsp++;
-}
-
-static int retpop(void)
-{
- retsp--;
- if(retsp<0) {
- fprintf(stderr,"\nYUCK: ret stack under flow\n");
- retsp = 0;
- return 0;
- }
- return retstack[retsp];
-}
-
-
-/*
- * execute the program:
- *
- *
- */
-
-static void getmove(int *x, int *y)
-{
- *x = delx;
- *y = dely;
- /* printf("ingetmove\n"); */
-}
-
-static void getpos(int *x, int *y)
-{
- *x = curx;
- *y = cury;
-}
-
-static void subr1(void)
-{
- coordpos = 0;
- incusp = 1;
-}
-
-static void subr2(void)
-{
- int x, y;
-
- getmove(&x,&y);
- if(coordpos>=7) {
- fprintf(stderr,"subr2: bad poop\n");
- /*exit(1);*/
- }
- coordsave[coordpos][0] = x;
- coordsave[coordpos][1] = y;
- coordpos++;
-}
-
-static void subr0(void)
-{
- int x0, y0;
- int x1, y1;
- int x2, y2;
- int x3, y3;
- int noise;
-
- pop(); /* xpos, unused */
- pop(); /* ypos, unused */
- noise = pop();
- if(coordpos!=7) {
- fprintf(stderr,"subr0: bad poop\n");
- /*exit(1);*/
- }
- x0 = coordsave[0][0];
- y0 = coordsave[0][1];
-
- x1 = coordsave[1][0]+x0;
- y1 = coordsave[1][1]+y0;
- x2 = coordsave[2][0];
- y2 = coordsave[2][1];
- x3 = coordsave[3][0];
- y3 = coordsave[3][1];
- rcurveto(x1,y1,x1+x2,y1+y2,x1+x2+x3,y1+y2+y3);
- x1 = coordsave[4][0];
- y1 = coordsave[4][1];
- x2 = coordsave[5][0];
- y2 = coordsave[5][1];
- x3 = coordsave[6][0];
- y3 = coordsave[6][1];
- rcurveto(x1,y1,x1+x2,y1+y2,x1+x2+x3,y1+y2+y3);
- getpos(&x0,&y0);
- retpush(y0);
- retpush(x0);
- incusp = 0;
-}
-
-static void append_poly_offset(short ofsx, short ofsy, short * data)
-{
- int nverts;
-
- if (data == 0) return;
-
- while(1) {
- switch(chardata[nshorts++] = *data++) {
- case PO_BGNLOOP:
- nshorts --; /* for the first time */
- break;
- case PO_RETENDLOOP:
- case PO_RET:
- return;
- }
- nverts = chardata[nshorts++] = *data++;
- while(nverts--) {
- chardata[nshorts++] = (*data++) + ofsx;
- chardata[nshorts++] = (*data++) + ofsy;
- }
- }
-}
-
-
-static void append_spline_offset(short ofsx, short ofsy, short * data)
-{
- int nverts = 0;
-
- if (data == 0) return;
-
- while(1) {
- switch(chardata[nshorts++] = *data++) {
- case SP_MOVETO:
- case SP_LINETO:
- nverts = 1;
- break;
- case SP_CURVETO:
- nverts = 3;
- break;
- case SP_RETCLOSEPATH:
- case SP_RET:
- return;
- }
-
- for (; nverts > 0; nverts--) {
- chardata[nshorts++] = (*data++) + ofsx;
- chardata[nshorts++] = (*data++) + ofsy;
- }
- }
-}
-
-
-
-/*
- * graphics follows
- *
- *
- */
-
-
-/* poly output stuff */
-
-static void setwidth(int w, int x)
-{
- thecharwidth = w;
- thesidebearing = x;
-}
-
-static void poly_beginchar(void)
-{
- npnts = 0;
- nloops = 0;
-}
-
-static void poly_endchar(void)
-{
- if(nloops == 0)
- chardata[nshorts++] = PO_RET;
- else
- chardata[nshorts++] = PO_RETENDLOOP;
-}
-
-static void poly_close(void)
-{
- chardata[nvertpos] = npnts;
- npnts = 0;
-}
-
-static void poly_pnt(float x, float y)
-{
- int ix, iy;
-
- applymat(mat,&x,&y);
- ix = floor(x);
- iy = floor(y);
- if(npnts == 0) {
- if(nloops == 0) {
- chardata[nshorts++] = PO_BGNLOOP;
- nvertpos = nshorts++;
- } else {
- chardata[nshorts++] = PO_ENDBGNLOOP;
- nvertpos = nshorts++;
- }
- nloops++;
- }
- chardata[nshorts++] = ix;
- chardata[nshorts++] = iy;
- npnts++;
-
-}
-
-/* spline output stuff */
-
-static void spline_beginchar(void)
-{
- sp_npnts = 0;
- sp_nloops = 0;
-}
-
-static void spline_endchar(void)
-{
- if(sp_nloops == 0)
- chardata[nshorts++] = SP_RET;
- else
- chardata[nshorts++] = SP_RETCLOSEPATH;
-}
-
-static void spline_close(void)
-{
- chardata[nshorts++] = SP_CLOSEPATH;
- sp_npnts = 0;
- sp_nloops = 0;
-}
-
-static void spline_line(float x0, float y0, float x1, float y1)
-{
- applymat(mat,&x0,&y0);
- applymat(mat,&x1,&y1);
-
- if(sp_npnts == 0) {
- chardata[nshorts++] = SP_MOVETO;
- chardata[nshorts++] = floor(x0);
- chardata[nshorts++] = floor(y0);
- sp_npnts++;
- sp_nloops++;
- }
- chardata[nshorts++] = SP_LINETO;
- chardata[nshorts++] = floor(x1);
- chardata[nshorts++] = floor(y1);
- sp_npnts++;
-}
-
-static void spline_curveto(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
-{
- applymat(mat,&x0,&y0);
-
- applymat(mat,&x1,&y1);
- applymat(mat,&x2,&y2);
- applymat(mat,&x3,&y3);
- if(sp_npnts == 0) {
- chardata[nshorts++] = SP_MOVETO;
- chardata[nshorts++] = floor(x0);
- chardata[nshorts++] = floor(y0);
- sp_npnts++;
- sp_nloops++;
- }
- chardata[nshorts++] = SP_CURVETO;
- chardata[nshorts++] = floor(x1);
- chardata[nshorts++] = floor(y1);
- chardata[nshorts++] = floor(x2);
- chardata[nshorts++] = floor(y2);
- chardata[nshorts++] = floor(x3);
- chardata[nshorts++] = floor(y3);
-}
-
-static void savestart(int x, int y)
-{
- startx = x;
- starty = y;
- started = 1;
-}
-
-static void sbpoint( int x, int y)
-{
- curx = x;
- cury = y;
-}
-
-static void rmoveto( int x, int y)
-{
- if(incusp) {
- delx = x;
- dely = y;
- } else {
- curx += x;
- cury += y;
- savestart(curx,cury);
- }
-}
-
-static void drawline(float x0, float y0, float x1, float y1, float dx0, float dy0, float dx1, float dy1)
-{
- if(x0!=x1 || y0!=y1)
- poly_pnt(x1,y1);
-}
-
-
-static void rlineto( int x, int y)
-{
- float dx, dy;
-
- nextx = curx + x;
- nexty = cury + y;
- dx = nextx-curx;
- dy = nexty-cury;
- if (savesplines) spline_line( curx, cury, nextx, nexty);
- else drawline( curx, cury, nextx, nexty,dx,dy,dx,dy);
- curx = nextx;
- cury = nexty;
-}
-
-static void closepath(void)
-{
- float dx, dy;
-
- if(started) {
- dx = startx-curx;
- dy = starty-cury;
- if (savesplines) {
- spline_close();
- } else {
- drawline( curx, cury, startx, starty,dx,dy,dx,dy);
- poly_close();
- }
- started = 0;
- }
-}
-
-static void bezadapt( float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float beztol)
-{
- float ax0,ay0,ax1,ay1,ax2,ay2,ax3,ay3;
- float bx0,by0,bx1,by1,bx2,by2,bx3,by3;
- float midx, midy;
- float linx, liny, dx, dy, mag;
-
- midx = (x0+3*x1+3*x2+x3)/8.0;
- midy = (y0+3*y1+3*y2+y3)/8.0;
- linx = (x0+x3)/2.0;
- liny = (y0+y3)/2.0;
- dx = midx-linx;
- dy = midy-liny;
- mag = dx*dx+dy*dy;
- if(mag<(beztol*beztol))
- drawline(x0,y0,x3,y3,x1-x0,y1-y0,x3-x2,y3-y2);
- else {
- ax0 = x0;
- ay0 = y0;
- ax1 = (x0+x1)/2;
- ay1 = (y0+y1)/2;
- ax2 = (x0+2*x1+x2)/4;
- ay2 = (y0+2*y1+y2)/4;
- ax3 = midx;
- ay3 = midy;
- bezadapt(ax0,ay0,ax1,ay1,ax2,ay2,ax3,ay3,beztol);
-
- bx0 = midx;
- by0 = midy;
- bx1 = (x1+2*x2+x3)/4;
- by1 = (y1+2*y2+y3)/4;
- bx2 = (x2+x3)/2;
- by2 = (y2+y3)/2;
- bx3 = x3;
- by3 = y3;
- bezadapt(bx0,by0,bx1,by1,bx2,by2,bx3,by3,beztol);
- }
-}
-
-static void drawbez( float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
-{
- bezadapt(x0,y0,x1,y1,x2,y2,x3,y3,beztol);
-}
-
-
-static void rcurveto( int dx1, int dy1, int dx2, int dy2, int dx3, int dy3)
-{
- int x0, y0;
- int x1, y1;
- int x2, y2;
- int x3, y3;
-
- x0 = curx;
- y0 = cury;
- x1 = curx+dx1;
- y1 = cury+dy1;
- x2 = curx+dx2;
- y2 = cury+dy2;
- x3 = curx+dx3;
- y3 = cury+dy3;
-
- if (savesplines) {
- spline_curveto( x0, y0, x1, y1, x2, y2, x3, y3);
- } else{
- drawbez( x0, y0, x1, y1, x2, y2, x3, y3);
- }
- curx = x3;
- cury = y3;
-}
-
-/*
- * saveobjfont -
- * save an object font.
- *
- */
-
-/* generic routines */
-
-static void makeobjfont(int savesplines)
-{
- int i, c;
-
- if(savesplines)
- fnt = newobjfnt(SP_TYPE, 32, 32+NASCII-1, 9840);
- else
- fnt = newobjfnt(PO_TYPE, 32, 32+NASCII-1, 9840);
-
- for(i=0; i<NASCII; i++) {
- c = i+32;
- if(ISOcharlist[i].prog>=0) {
- /*printf("decoding %s\n", ISOcharlist[i].name);*/
-
- nshorts = 0;
- drawchar(ISOcharlist[i].prog);
- addchardata(fnt,c,chardata,nshorts);
- addcharmetrics(fnt,c,thecharwidth,0);
- sidebearing[c] = thesidebearing;
- } else if(c == ' ') {
- printf("faking space %d\n",i);
- fakechar(fnt,' ',400);
- }
- }
-}
-
-/*
- * run the character program
- *
- *
- */
-
-static void drawchar(int c)
-{
- if (savesplines) {
- spline_beginchar();
- } else {
- poly_beginchar();
- }
- initstack();
- initpcstack();
- initretstack();
- pc = my_chars[c];
- runprog();
- if (savesplines){
- spline_endchar();
- } else {
- poly_endchar();
- }
-}
-
-static int docommand(int cmd)
-{
- int x, y, w, c1, c2;
- int dx1, dy1;
- int dx2, dy2;
- int dx3, dy3;
- float fdx1, fdy1;
- int i, sub, n;
- char *subpc;
- chardesc *cd;
- short *ndata;
-
- switch(cmd) {
- case WHAT0:
- fprintf(stderr,"\nYUCK: WHAT0\n");
- break;
- case HSTEM:
- pop();
- pop();
- /*printf("hstem: %d %d\n", pop(), pop());*/
- break;
- case VSTEM:
- pop();
- pop();
- /*printf("vstem: %d %d\n", pop(), pop());*/
- break;
- case VMOVETO:
- y = pop();
- rmoveto(0,y);
- break;
- case RLINETO:
- y = pop();
- x = pop();
- rlineto(x,y);
- break;
- case HLINETO:
- x = pop();
- rlineto(x,0);
- break;
- case VLINETO:
- y = pop();
- rlineto(0,y);
- break;
- case RRCURVETO:
- dy3 = pop();
- dx3 = pop();
- dy2 = pop();
- dx2 = pop();
- dy1 = pop();
- dx1 = pop();
- rcurveto(dx1,dy1,dx1+dx2,dy1+dy2,dx1+dx2+dx3,dy1+dy2+dy3);
- break;
- case CLOSEPATH:
- closepath();
- break;
- case CALLSUBR:
- sub = pop();
- subpc = my_subrs[sub];
- if(!subpc) {
- fprintf(stderr,"\nYUCK no sub addr\n");
- }
- pushpc(pc);
- pc = subpc;
- break;
- case RETURN:
- pc = poppc();
- break;
- case HSBW:
- w = pop();
- x = pop();
- setwidth(w, x);
- sbpoint(x,0);
- break;
- case ENDCHAR:
- closepath();
- break;
- case RMOVETO:
- y = pop();
- x = pop();
- rmoveto(x,y);
- break;
- case HMOVETO:
- x = pop();
- rmoveto(x,0);
- break;
- case VHCURVETO:
- dy3 = 0;
- dx3 = pop();
- dy2 = pop();
- dx2 = pop();
- dy1 = pop();
- dx1 = 0;
- rcurveto(dx1,dy1,dx1+dx2,dy1+dy2,dx1+dx2+dx3,dy1+dy2+dy3);
- break;
- case HVCURVETO:
- dy3 = pop();
- dx3 = 0;
- dy2 = pop();
- dx2 = pop();
- dy1 = 0;
- dx1 = pop();
- rcurveto(dx1,dy1,dx1+dx2,dy1+dy2,dx1+dx2+dx3,dy1+dy2+dy3);
- break;
- case DOTSECTION:
- break;
- case VSTEM3:
- /*printf("vstem3\n");*/
- pop();
- pop();
- pop();
- pop();
- pop();
- pop();
- break;
- case HSTEM3:
- /*printf("hstem3\n");*/
- pop();
- pop();
- pop();
- pop();
- pop();
- pop();
- break;
- case SEAC:
- if (0) {
- printf("seac: %3d %3d %3d %3d %3d\n", pop(), pop(), pop(), pop(), pop());
- } else{
- c2 = STDtoISO(pop()); /* accent */
- c1 = STDtoISO(pop()); /* letter */
-
- cd = getchardesc(fnt, c1);
- if (cd) {
- memcpy(chardata, cd->data, cd->datalen);
- nshorts = cd->datalen / sizeof(short);
- }
-
- cd = getchardesc(fnt, c2);
- if (cd && cd->data && cd->datalen) {
- ndata = cd->data;
-
- if (nshorts) {
- if (savesplines) {
- switch (chardata[nshorts - 1]){
- case SP_RET:
- nshorts--;
- break;
- case SP_RETCLOSEPATH:
- chardata[nshorts - 1] = SP_CLOSEPATH;
- break;
- }
- } else {
- switch (chardata[nshorts - 1]){
- case PO_RET:
- printf("PO_RET in character disription ?\n");
- nshorts--;
- break;
- case PO_RETENDLOOP:
- if (ndata[0] == PO_BGNLOOP) {
- chardata[nshorts - 1] = PO_ENDBGNLOOP;
- } else {
- printf("new character doesn't start with PO_BGNLOOP ?\n");
- }
- break;
- }
- }
- }
-
- /* instead of the sidebearing[c1] maybe thesidebearing should be used */
-
- dy1 = pop();
- dx1 = pop() + sidebearing[c1] - sidebearing[c2];
- pop();
-
- fdx1 = dx1;
- fdy1 = dy1;
- applymat(mat, &fdx1, &fdy1);
- dx1 = floor(fdx1);
- dy1 = floor(fdy1);
-
- if (savesplines) {
- append_spline_offset(dx1, dy1, ndata);
- } else{
- append_poly_offset(dx1, dy1, ndata);
- }
-
- /*printf("first: %d %d\n", cd->data[0], cd->data[1]);*/
- }
- fflush(stdout);
- }
- break;
- case SBW:
- w = pop();
- y = pop();
- fprintf(stderr,"sbw: width: %d %d\n",w,y);
- y = pop();
- x = pop();
- fprintf(stderr,"sbw: side: %d %d\n",x,y);
- setwidth(w, x);
- sbpoint(x,y);
- break;
- case DIV:
- x = pop();
- y = pop();
- push(x/y);
- break;
- case CALLOTHERSUBR:
- sub = pop();
- n = pop();
- if(sub == 0)
- subr0();
- else if(sub == 1)
- subr1();
- else if(sub == 2)
- subr2();
- else {
- for(i=0; i<n; i++) {
- retpush(pop());
- }
- }
- break;
- case POP:
- push(retpop());
- break;
- case SETCURRENTPOINT:
- y = pop();
- x = pop();
- sbpoint(x,y);
- break;
- default:
- /*fprintf(stderr,"\nYUCK bad instruction %d\n",cmd);*/
- break;
- }
- if(pc == 0 || cmd == ENDCHAR || cmd == WHAT0 || cmd == SEAC)
- return 0;
- else
- return 1;
-}
-
-
-/*
- * Character interpreter
- *
- */
-
-static void runprog(void)
-{
- int v, w, num, cmd;
-
- while(1) {
- v = *pc++;
- if(v>=0 && v<=31) {
- if(v == 12) {
- w = *pc++;
- cmd = 256+w;
- } else
- cmd = v;
- if(!docommand(cmd)) {
- return;
- }
- } else if(v>=32 && v<=246) {
- num = v-139;
- push(num);
- } else if(v>=247 && v<=250) {
- w = *pc++;
- num = (v-247)*256+w+108;
- push(num);
- } else if(v>=251 && v<=254) {
- w = *pc++;
- num = -(v-251)*256-w-108;
- push(num);
- } else if(v == 255) {
- num = *pc++;
- num <<= 8;
- num |= *pc++;
- num <<= 8;
- num |= *pc++;
- num <<= 8;
- num |= *pc++;
- push(num);
- }
- }
-}
-
-/***/
-
-static VFontData *objfnt_to_vfontdata(objfnt *fnt)
-{
- VFontData *vfd;
- chardesc *cd;
- short *_data, *data;
- int a, i, count, stop, ready, meet;
- short first[2]={0,0}, last[2]={0,0};
- struct Nurb *nu;
- struct BezTriple *bezt, *bez2;
- float scale, dx, dy;
- struct VChar *che;
-
- if (!fnt || (fnt->type!=SP_TYPE)) {
- return NULL;
- }
-
- vfd= MEM_callocN(sizeof(*vfd), "VFontData");
- scale = 10.0/(float)fnt->scale; /* after IRIX 6.2, scaling went wrong */
-
- for (i = 0; i < MAX_VF_CHARS; i++) {
- cd = getchardesc(fnt, i);
- if (cd && cd->data && cd->datalen) {
- che = (VChar *) MEM_callocN(sizeof(VChar), "objfnt_char");
- BLI_addtail(&vfd->characters, che);
- che->index = i;
- che->width = scale * cd->movex;
-
- _data = data = cd->data;
-
- do{
- /* count first */
- _data = data;
- count = 0;
- ready = stop = 0;
-
- do{
- switch(*data++){
- case SP_MOVETO:
- first[0] = data[0];
- first[1] = data[1];
- case SP_LINETO:
- count++;
- last[0] = data[0];
- last[1] = data[1];
- data += 2;
- break;
- case SP_CURVETO:
- count++;
- last[0] = data[4];
- last[1] = data[5];
- data += 6;
- break;
- case SP_RET:
- case SP_RETCLOSEPATH:
- stop = 1;
- ready = 1;
- break;
- case SP_CLOSEPATH:
- stop = 1;
- break;
- }
- } while (!stop);
-
- if ((count>0) && last[0] == first[0] && last[1] == first[1]) meet = 1;
- else meet = 0;
-
- /* is there more than 1 unique point ?*/
-
- if (count - meet > 0) {
- data = _data;
- nu = (Nurb*)MEM_callocN(sizeof(struct Nurb),"objfnt_nurb");
- bezt = (BezTriple*)MEM_callocN((count)* sizeof(BezTriple),"objfnt_bezt") ;
- if (nu != 0 && bezt != 0) {
- BLI_addtail(&che->nurbsbase, nu);
- nu->type= CU_BEZIER+CU_2D;
- nu->pntsu = count;
- nu->resolu= 8;
- nu->flagu= CU_CYCLIC;
- nu->bezt = bezt;
- stop = 0;
-
- /* read points */
- do {
- switch(*data++){
- case SP_MOVETO:
- bezt->vec[1][0] = scale * *data++;
- bezt->vec[1][1] = scale * *data++;
-
- break;
- case SP_LINETO:
- bez2 = bezt++;
- bezt->vec[1][0] = scale * *data++;
- bezt->vec[1][1] = scale * *data++;
- /* vector handles */
- bezt->h1= HD_VECT;
- bez2->h2= HD_VECT;
- dx = (bezt->vec[1][0] - bez2->vec[1][0]) / 3.0;
- dy = (bezt->vec[1][1] - bez2->vec[1][1]) / 3.0;
- bezt->vec[0][0] = bezt->vec[1][0] - dx;
- bezt->vec[0][1] = bezt->vec[1][1] - dy;
- bez2->vec[2][0] = bez2->vec[1][0] + dx;
- bez2->vec[2][1] = bez2->vec[1][1] + dy;
- break;
-
- case SP_CURVETO:
- bezt->vec[2][0] = scale * *data++;
- bezt->vec[2][1] = scale * *data++;
- bezt->h2= HD_ALIGN;
- bezt++;
- bezt->vec[0][0] = scale * *data++;
- bezt->vec[0][1] = scale * *data++;
- bezt->vec[1][0] = scale * *data++;
- bezt->vec[1][1] = scale * *data++;
- bezt->h1= HD_ALIGN;
- break;
-
- case SP_RET:
- case SP_RETCLOSEPATH:
- stop = 1;
- ready = 1;
- break;
- case SP_CLOSEPATH:
- stop = 1;
- break;
- }
- } while (stop == 0);
-
- if (meet) {
- /* copy handles */
- nu->bezt->vec[0][0] = bezt->vec[0][0];
- nu->bezt->vec[0][1] = bezt->vec[0][1];
- /* and forget last point */
- nu->pntsu--;
- }
- else {
- /* vector handles */
- bez2 = nu->bezt;
- dx = (bezt->vec[1][0] - bez2->vec[1][0]) / 3.0;
- dy = (bezt->vec[1][1] - bez2->vec[1][1]) / 3.0;
- bezt->vec[2][0] = bezt->vec[1][0] - dx;
- bezt->vec[2][1] = bezt->vec[1][1] - dy;
- bez2->vec[0][0] = bez2->vec[1][0] + dx;
- bez2->vec[0][1] = bez2->vec[1][1] + dy;
- bezt->h2= bez2->h1= HD_VECT;
- }
-
- /* forbidden handle combinations */
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(bezt->h1!=HD_ALIGN && bezt->h2==HD_ALIGN) bezt->h2= 0;
- else if(bezt->h2!=HD_ALIGN && bezt->h1==HD_ALIGN) bezt->h1= 0;
- bezt->radius= 1.0f;
- bezt++;
- }
-
- }
- else {
- if (nu) MEM_freeN(nu);
- if (bezt) MEM_freeN(bezt);
- }
- }
- _data = data;
- } while (ready == 0);
- }
- }
-
- return vfd;
-}
-
-VFontData *BLI_vfontdata_from_psfont(PackedFile *pf)
-{
- objfnt *fnt= objfnt_from_psfont(pf);
- VFontData *vfd= NULL;
-
- if (fnt) {
- vfd= objfnt_to_vfontdata(fnt);
- freeobjfnt(fnt);
- }
-
- return vfd;
-}
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 0a416e624cb..7cbef85b938 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -47,13 +47,13 @@
#include <time.h>
#include <sys/stat.h>
-#if defined (__sun__) || defined (__sun) || defined (__sgi)
+#if defined (__sun__) || defined (__sun) || defined (__sgi) || defined (__NetBSD__)
#include <sys/statvfs.h> /* Other modern unix os's should probably use this also */
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
#include <sys/statfs.h>
#endif
-#if defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__)
+#if defined (__FreeBSD__) || defined (__OpenBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#endif
@@ -70,9 +70,6 @@
#include <fcntl.h>
-#if !defined(WIN32)
-#include <sys/mtio.h> /* tape comando's */
-#endif
#include <string.h> /* strcpy etc.. */
#ifndef WIN32
@@ -173,7 +170,7 @@ double BLI_diskfree(char *dir)
return (double) (freec*bytesps*sectorspc);
#else
-#if defined (__sun__) || defined (__sun) || defined (__sgi)
+#if defined (__sun__) || defined (__sun) || defined (__sgi) || defined (__NetBSD__)
struct statvfs disk;
#else
struct statfs disk;
@@ -195,7 +192,7 @@ double BLI_diskfree(char *dir)
if (statfs(name, &disk)) return(-1);
#endif
-#if defined (__sun__) || defined (__sun) || defined (__sgi)
+#if defined (__sun__) || defined (__sun) || defined (__sgi) || defined (__NetBSD__)
if (statvfs(name, &disk)) return(-1);
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
/* WARNING - This may not be supported by geeneric unix os's - Campbell */
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 2812f17d58f..ed3e07b7f7e 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -142,10 +142,10 @@ void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
tslot->do_thread= do_thread;
tslot->avail= 1;
}
+
+ MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
+ thread_levels++;
}
-
- MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
- thread_levels++;
}
/* amount of available threads */
@@ -235,18 +235,21 @@ void BLI_end_threads(ListBase *threadbase)
{
ThreadSlot *tslot;
- if (threadbase) {
+ /* only needed if there's actually some stuff to end
+ * this way we don't end up decrementing thread_levels on an empty threadbase
+ * */
+ if (threadbase && threadbase->first != NULL) {
for(tslot= threadbase->first; tslot; tslot= tslot->next) {
if(tslot->avail==0) {
pthread_join(tslot->pthread, NULL);
}
}
BLI_freelistN(threadbase);
+
+ thread_levels--;
+ if(thread_levels==0)
+ MEM_set_lock_callback(NULL, NULL);
}
-
- thread_levels--;
- if(thread_levels==0)
- MEM_set_lock_callback(NULL, NULL);
}
void BLI_lock_thread(int type)
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 3c441a81d6b..acf236d382b 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -54,6 +54,8 @@
#include "BKE_utildefines.h"
+
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c
new file mode 100644
index 00000000000..7dad854af3a
--- /dev/null
+++ b/source/blender/blenlib/intern/voxel.c
@@ -0,0 +1,198 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#include <math.h>
+
+#include "BLI_voxel.h"
+
+#include "BKE_utildefines.h"
+
+
+#if defined( _MSC_VER ) && !defined( __cplusplus )
+# define inline __inline
+#endif // defined( _MSC_VER ) && !defined( __cplusplus )
+
+static inline float D(float *data, int *res, int x, int y, int z)
+{
+ CLAMP(x, 0, res[0]-1);
+ CLAMP(y, 0, res[1]-1);
+ CLAMP(z, 0, res[2]-1);
+ return data[ V_I(x, y, z, res) ];
+}
+
+/* *** nearest neighbour *** */
+/* input coordinates must be in bounding box 0.0 - 1.0 */
+float voxel_sample_nearest(float *data, int *res, float *co)
+{
+ int xi, yi, zi;
+
+ xi = co[0] * res[0];
+ yi = co[1] * res[1];
+ zi = co[2] * res[2];
+
+ return D(data, res, xi, yi, zi);
+}
+
+// returns highest integer <= x as integer (slightly faster than floor())
+inline int FLOORI(float x)
+{
+ const int r = (int)x;
+ return ((x >= 0.f) || (float)r == x) ? r : (r - 1);
+}
+
+// clamp function, cannot use the CLAMPIS macro, it sometimes returns unwanted results apparently related to gcc optimization flag -fstrict-overflow which is enabled at -O2
+// this causes the test (x + 2) < 0 with int x == 2147483647 to return false (x being an integer, x + 2 should wrap around to -2147483647 so the test < 0 should return true, which it doesn't)
+inline int _clamp(int a, int b, int c)
+{
+ return (a < b) ? b : ((a > c) ? c : a);
+}
+
+float voxel_sample_trilinear(float *data, int *res, float *co)
+{
+ if (data) {
+
+ const float xf = co[0] * res[0] - 0.5f;
+ const float yf = co[1] * res[1] - 0.5f;
+ const float zf = co[2] * res[2] - 0.5f;
+
+ const int x = FLOORI(xf), y = FLOORI(yf), z = FLOORI(zf);
+
+ const int xc[2] = {_clamp(x, 0, res[0] - 1), _clamp(x + 1, 0, res[0] - 1)};
+ const int yc[2] = {res[0] * _clamp(y, 0, res[1] - 1), res[0] * _clamp(y + 1, 0, res[1] - 1)};
+ const int zc[2] = {res[0] * res[1] * _clamp(z, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 1, 0, res[2] - 1)};
+
+ const float dx = xf - (float)x;
+ const float dy = yf - (float)y;
+ const float dz = zf - (float)z;
+
+ const float u[2] = {1.f - dx, dx};
+ const float v[2] = {1.f - dy, dy};
+ const float w[2] = {1.f - dz, dz};
+
+ return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] ) )
+ + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] ) );
+
+ }
+ return 0.f;
+}
+
+
+float voxel_sample_triquadratic(float *data, int *res, float *co)
+{
+ if (data) {
+
+ const float xf = co[0] * res[0], yf = co[1] * res[1], zf = co[2] * res[2];
+ const int x = FLOORI(xf), y = FLOORI(yf), z = FLOORI(zf);
+
+ const int xc[3] = {_clamp(x - 1, 0, res[0] - 1), _clamp(x, 0, res[0] - 1), _clamp(x + 1, 0, res[0] - 1)};
+ const int yc[3] = {res[0] * _clamp(y - 1, 0, res[1] - 1), res[0] * _clamp(y, 0, res[1] - 1), res[0] * _clamp(y + 1, 0, res[1] - 1)};
+ const int zc[3] = {res[0] * res[1] * _clamp(z - 1, 0, res[2] - 1), res[0] * res[1] * _clamp(z, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 1, 0, res[2] - 1)};
+
+ const float dx = xf - (float)x, dy = yf - (float)y, dz = zf - (float)z;
+ const float u[3] = {dx*(0.5f*dx - 1.f) + 0.5f, dx*(1.f - dx) + 0.5f, 0.5f*dx*dx};
+ const float v[3] = {dy*(0.5f*dy - 1.f) + 0.5f, dy*(1.f - dy) + 0.5f, 0.5f*dy*dy};
+ const float w[3] = {dz*(0.5f*dz - 1.f) + 0.5f, dz*(1.f - dz) + 0.5f, 0.5f*dz*dz};
+
+ return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] ) )
+ + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] ) )
+ + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] ) );
+
+}
+ return 0.f;
+}
+
+float voxel_sample_tricubic(float *data, int *res, float *co, int bspline)
+{
+ if (data) {
+
+ const float xf = co[0] * res[0] - 0.5f, yf = co[1] * res[1] - 0.5f, zf = co[2] * res[2] - 0.5f;
+ const int x = FLOORI(xf), y = FLOORI(yf), z = FLOORI(zf);
+
+ const int xc[4] = {_clamp(x - 1, 0, res[0] - 1), _clamp(x, 0, res[0] - 1), _clamp(x + 1, 0, res[0] - 1), _clamp(x + 2, 0, res[0] - 1)};
+ const int yc[4] = {res[0] * _clamp(y - 1, 0, res[1] - 1), res[0] * _clamp(y, 0, res[1] - 1), res[0] * _clamp(y + 1, 0, res[1] - 1), res[0] * _clamp(y + 2, 0, res[1] - 1)};
+ const int zc[4] = {res[0] * res[1] * _clamp(z - 1, 0, res[2] - 1), res[0] * res[1] * _clamp(z, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 1, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 2, 0, res[2] - 1)};
+
+ const float dx = xf - (float)x, dy = yf - (float)y, dz = zf - (float)z;
+
+ float u[4], v[4], w[4];
+ if (bspline) { // B-Spline
+ u[0] = (((-1.f/6.f)*dx + 0.5f)*dx - 0.5f)*dx + (1.f/6.f);
+ u[1] = (( 0.5f*dx - 1.f )*dx )*dx + (2.f/3.f);
+ u[2] = (( -0.5f*dx + 0.5f)*dx + 0.5f)*dx + (1.f/6.f);
+ u[3] = ( 1.f/6.f)*dx*dx*dx;
+ v[0] = (((-1.f/6.f)*dy + 0.5f)*dy - 0.5f)*dy + (1.f/6.f);
+ v[1] = (( 0.5f*dy - 1.f )*dy )*dy + (2.f/3.f);
+ v[2] = (( -0.5f*dy + 0.5f)*dy + 0.5f)*dy + (1.f/6.f);
+ v[3] = ( 1.f/6.f)*dy*dy*dy;
+ w[0] = (((-1.f/6.f)*dz + 0.5f)*dz - 0.5f)*dz + (1.f/6.f);
+ w[1] = (( 0.5f*dz - 1.f )*dz )*dz + (2.f/3.f);
+ w[2] = (( -0.5f*dz + 0.5f)*dz + 0.5f)*dz + (1.f/6.f);
+ w[3] = ( 1.f/6.f)*dz*dz*dz;
+ }
+ else { // Catmull-Rom
+ u[0] = ((-0.5f*dx + 1.0f)*dx - 0.5f)*dx;
+ u[1] = (( 1.5f*dx - 2.5f)*dx )*dx + 1.0f;
+ u[2] = ((-1.5f*dx + 2.0f)*dx + 0.5f)*dx;
+ u[3] = (( 0.5f*dx - 0.5f)*dx )*dx;
+ v[0] = ((-0.5f*dy + 1.0f)*dy - 0.5f)*dy;
+ v[1] = (( 1.5f*dy - 2.5f)*dy )*dy + 1.0f;
+ v[2] = ((-1.5f*dy + 2.0f)*dy + 0.5f)*dy;
+ v[3] = (( 0.5f*dy - 0.5f)*dy )*dy;
+ w[0] = ((-0.5f*dz + 1.0f)*dz - 0.5f)*dz;
+ w[1] = (( 1.5f*dz - 2.5f)*dz )*dz + 1.0f;
+ w[2] = ((-1.5f*dz + 2.0f)*dz + 0.5f)*dz;
+ w[3] = (( 0.5f*dz - 0.5f)*dz )*dz;
+ }
+
+ return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] + u[3] * data[xc[3] + yc[0] + zc[0]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] + u[3] * data[xc[3] + yc[1] + zc[0]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] + u[3] * data[xc[3] + yc[2] + zc[0]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[0]] + u[1] * data[xc[1] + yc[3] + zc[0]] + u[2] * data[xc[2] + yc[3] + zc[0]] + u[3] * data[xc[3] + yc[3] + zc[0]] ) )
+ + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] + u[3] * data[xc[3] + yc[0] + zc[1]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] + u[3] * data[xc[3] + yc[1] + zc[1]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] + u[3] * data[xc[3] + yc[2] + zc[1]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[1]] + u[1] * data[xc[1] + yc[3] + zc[1]] + u[2] * data[xc[2] + yc[3] + zc[1]] + u[3] * data[xc[3] + yc[3] + zc[1]] ) )
+ + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] + u[3] * data[xc[3] + yc[0] + zc[2]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] + u[3] * data[xc[3] + yc[1] + zc[2]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] + u[3] * data[xc[3] + yc[2] + zc[2]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[2]] + u[1] * data[xc[1] + yc[3] + zc[2]] + u[2] * data[xc[2] + yc[3] + zc[2]] + u[3] * data[xc[3] + yc[3] + zc[2]] ) )
+ + w[3] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[3]] + u[1] * data[xc[1] + yc[0] + zc[3]] + u[2] * data[xc[2] + yc[0] + zc[3]] + u[3] * data[xc[3] + yc[0] + zc[3]] )
+ + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[3]] + u[1] * data[xc[1] + yc[1] + zc[3]] + u[2] * data[xc[2] + yc[1] + zc[3]] + u[3] * data[xc[3] + yc[1] + zc[3]] )
+ + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[3]] + u[1] * data[xc[1] + yc[2] + zc[3]] + u[2] * data[xc[2] + yc[2] + zc[3]] + u[3] * data[xc[3] + yc[2] + zc[3]] )
+ + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[3]] + u[1] * data[xc[1] + yc[3] + zc[3]] + u[2] * data[xc[2] + yc[3] + zc[3]] + u[3] * data[xc[3] + yc[3] + zc[3]] ) );
+
+ }
+ return 0.f;
+}
diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h
index 49155260b31..4032f778f4b 100644
--- a/source/blender/blenloader/BLO_sys_types.h
+++ b/source/blender/blenloader/BLO_sys_types.h
@@ -78,7 +78,7 @@ typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__NetBSD__)
/* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h>
diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript
index 19a89b7e604..0a9b8d05747 100644
--- a/source/blender/blenloader/SConscript
+++ b/source/blender/blenloader/SConscript
@@ -11,4 +11,4 @@ incs += ' ' + env['BF_ZLIB_INC']
defs = []
-env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [135, 30] )
+env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core'], priority = [135] )
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 1f276913ea8..33641a0b004 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -200,7 +200,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
buf[2]= buf[2]?buf[2]:' ';
buf[3]= buf[3]?buf[3]:' ';
- fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (intptr_t)bhead->len+sizeof(BHead));
+ fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)bhead->len+sizeof(BHead));
}
}
fprintf(fp, "]\n");
@@ -331,11 +331,7 @@ BlendFileData *BLO_read_from_file(char *file, ReportList *reports)
fd = blo_openblenderfile(file, reports);
if (fd) {
fd->reports= reports;
- bfd= blo_read_file_internal(fd);
- if (bfd) {
- bfd->type= BLENFILETYPE_BLEND;
- strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1);
- }
+ bfd= blo_read_file_internal(fd, file);
blo_freefiledata(fd);
}
@@ -350,11 +346,7 @@ BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports)
fd = blo_openblendermemory(mem, memsize, reports);
if (fd) {
fd->reports= reports;
- bfd= blo_read_file_internal(fd);
- if (bfd) {
- bfd->type= BLENFILETYPE_BLEND;
- strcpy(bfd->main->name, "");
- }
+ bfd= blo_read_file_internal(fd, "");
blo_freefiledata(fd);
}
@@ -383,11 +375,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
/* makes lookup of existing images in old main */
blo_make_image_pointer_map(fd, oldmain);
- bfd= blo_read_file_internal(fd);
- if (bfd) {
- bfd->type= BLENFILETYPE_BLEND;
- strcpy(bfd->main->name, "");
- }
+ bfd= blo_read_file_internal(fd, "");
/* ensures relinked images are not freed */
blo_end_image_pointer_map(fd, oldmain);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 3029e482312..0231d841c2b 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -94,6 +94,7 @@
#include "DNA_sdna_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
+#include "DNA_smoke_types.h"
#include "DNA_sound_types.h"
#include "DNA_space_types.h"
#include "DNA_texture_types.h"
@@ -134,6 +135,7 @@
#include "BKE_multires.h"
#include "BKE_node.h" // for tree type defines
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_property.h" // for get_ob_property
@@ -142,12 +144,13 @@
#include "BKE_scene.h"
#include "BKE_softbody.h" // sbNew()
#include "BKE_bullet.h" // bsbNew()
-#include "BKE_sculpt.h"
#include "BKE_sequence.h"
#include "BKE_texture.h" // for open_plugin_tex
#include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND
#include "BKE_idprop.h"
+#include "BKE_sound.h"
+
//XXX #include "BIF_butspace.h" // badlevel, for do_versions, patching event codes
//XXX #include "BIF_filelist.h" // badlevel too, where to move this? - elubie
//XXX #include "BIF_previewrender.h" // bedlelvel, for struct RenderInfo
@@ -1363,20 +1366,17 @@ void IDP_LibLinkProperty(IDProperty *prop, int switch_endian, FileData *fd);
static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData *fd)
{
- IDProperty **array;
+ IDProperty *array;
int i;
/*since we didn't save the extra buffer, set totallen to len.*/
prop->totallen = prop->len;
prop->data.pointer = newdataadr(fd, prop->data.pointer);
- if (switch_endian) {
- test_pointer_array(fd, prop->data.pointer);
- array= (IDProperty**) prop->data.pointer;
+ array= (IDProperty*) prop->data.pointer;
- for(i=0; i<prop->len; i++)
- IDP_DirectLinkProperty(array[i], switch_endian, fd);
- }
+ for(i=0; i<prop->len; i++)
+ IDP_DirectLinkProperty(&array[i], switch_endian, fd);
}
static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *fd)
@@ -1388,19 +1388,22 @@ static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *f
prop->totallen = prop->len;
prop->data.pointer = newdataadr(fd, prop->data.pointer);
- if (switch_endian) {
- if(prop->subtype == IDP_GROUP) {
- test_pointer_array(fd, prop->data.pointer);
- array= prop->data.pointer;
+ if(prop->subtype == IDP_GROUP) {
+ test_pointer_array(fd, prop->data.pointer);
+ array= prop->data.pointer;
- for(i=0; i<prop->len; i++)
- IDP_DirectLinkProperty(array[i], switch_endian, fd);
- }
- else if(prop->subtype == IDP_DOUBLE) {
+ for(i=0; i<prop->len; i++)
+ IDP_DirectLinkProperty(array[i], switch_endian, fd);
+ }
+ else if(prop->subtype == IDP_DOUBLE) {
+ if (switch_endian) {
for (i=0; i<prop->len; i++) {
SWITCH_LONGINT(((double*)prop->data.pointer)[i]);
}
- } else {
+ }
+ }
+ else {
+ if (switch_endian) {
for (i=0; i<prop->len; i++) {
SWITCH_INT(((int*)prop->data.pointer)[i]);
}
@@ -2487,7 +2490,8 @@ static void lib_link_mball(FileData *fd, Main *main)
mb= main->mball.first;
while(mb) {
if(mb->id.flag & LIB_NEEDLINK) {
-
+ if (mb->adt) lib_link_animdata(fd, &mb->id, mb->adt);
+
for(a=0; a<mb->totcol; a++) mb->mat[a]= newlibadr_us(fd, mb->id.lib, mb->mat[a]);
mb->ipo= newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX depreceated - old animation system
@@ -2500,6 +2504,9 @@ static void lib_link_mball(FileData *fd, Main *main)
static void direct_link_mball(FileData *fd, MetaBall *mb)
{
+ mb->adt= newdataadr(fd, mb->adt);
+ direct_link_animdata(fd, mb->adt);
+
mb->mat= newdataadr(fd, mb->mat);
test_pointer_array(fd, (void **)&mb->mat);
@@ -2813,6 +2820,11 @@ static void lib_link_texture(FileData *fd, Main *main)
tex->ima= newlibadr_us(fd, tex->id.lib, tex->ima);
tex->ipo= newlibadr_us(fd, tex->id.lib, tex->ipo);
if(tex->env) tex->env->object= newlibadr(fd, tex->id.lib, tex->env->object);
+ if(tex->pd) {
+ tex->pd->object= newlibadr(fd, tex->id.lib, tex->pd->object);
+ tex->pd->psys= newlibadr(fd, tex->id.lib, tex->pd->psys);
+ }
+ if(tex->vd) tex->vd->object= newlibadr(fd, tex->id.lib, tex->vd->object);
if(tex->nodetree)
lib_link_ntree(fd, &tex->id, tex->nodetree);
@@ -2845,6 +2857,16 @@ static void direct_link_texture(FileData *fd, Tex *tex)
memset(tex->env->cube, 0, 6*sizeof(void *));
tex->env->ok= 0;
}
+ tex->pd= newdataadr(fd, tex->pd);
+ if(tex->pd) {
+ tex->pd->point_tree = NULL;
+ tex->pd->coba= newdataadr(fd, tex->pd->coba);
+ }
+
+ tex->vd= newdataadr(fd, tex->vd);
+ if(tex->vd) {
+ tex->vd->dataset = NULL;
+ }
tex->nodetree= newdataadr(fd, tex->nodetree);
if(tex->nodetree)
@@ -2922,19 +2944,49 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache)
{
if((cache->flag & PTCACHE_DISK_CACHE)==0) {
PTCacheMem *pm;
+ int i;
link_list(fd, &cache->mem_cache);
pm = cache->mem_cache.first;
- for(; pm; pm=pm->next)
- pm->data = newdataadr(fd, pm->data);
+ for(; pm; pm=pm->next) {
+ if(pm->index_array)
+ pm->index_array = newdataadr(fd, pm->index_array);
+
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(pm->data[i] && pm->data_types & (1<<i))
+ pm->data[i] = newdataadr(fd, pm->data[i]);
+ }
+ }
}
else
cache->mem_cache.first = cache->mem_cache.last = NULL;
- cache->flag &= ~(PTCACHE_SIMULATION_VALID|PTCACHE_BAKE_EDIT_ACTIVE);
+ cache->flag &= ~PTCACHE_SIMULATION_VALID;
cache->simframe= 0;
+ cache->edit= NULL;
+ cache->free_edit= NULL;
+}
+
+static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointCache **ocache)
+{
+ PointCache *cache;
+
+ if(ptcaches->first) {
+ link_list(fd, ptcaches);
+ for(cache=ptcaches->first; cache; cache=cache->next)
+ direct_link_pointcache(fd, cache);
+
+ *ocache = newdataadr(fd, *ocache);
+ }
+ else if(*ocache) {
+ /* old "single" caches need to be linked too */
+ *ocache = newdataadr(fd, *ocache);
+ direct_link_pointcache(fd, *ocache);
+
+ ptcaches->first = ptcaches->last = *ocache;
+ }
}
static void lib_link_particlesettings(FileData *fd, Main *main)
@@ -3059,7 +3111,7 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
psys->flag &= ~PSYS_KEYED;
}
- if(psys->particles->boid) {
+ if(psys->particles && psys->particles->boid) {
pa = psys->particles;
pa->boid = newdataadr(fd, pa->boid);
for(a=1,pa++; a<psys->totpart; a++, pa++)
@@ -3082,14 +3134,12 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
sb->bspring= NULL;
sb->scratch= NULL;
- sb->pointcache= newdataadr(fd, sb->pointcache);
- if(sb->pointcache)
- direct_link_pointcache(fd, sb->pointcache);
+ direct_link_pointcache_list(fd, &sb->ptcaches, &sb->pointcache);
}
link_list(fd, &psys->targets);
- psys->edit = 0;
+ psys->edit = NULL;
psys->free_edit = NULL;
psys->pathcache = 0;
psys->childcache = 0;
@@ -3097,9 +3147,7 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
psys->childcachebufs.first = psys->childcachebufs.last = 0;
psys->reactevents.first = psys->reactevents.last = 0;
- psys->pointcache= newdataadr(fd, psys->pointcache);
- if(psys->pointcache)
- direct_link_pointcache(fd, psys->pointcache);
+ direct_link_pointcache_list(fd, &psys->ptcaches, &psys->pointcache);
psys->tree = NULL;
}
@@ -3399,11 +3447,13 @@ static void lib_link_object(FileData *fd, Main *main)
if(ob->pose) {
free_pose(ob->pose);
ob->pose= NULL;
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
}
}
for(a=0; a<ob->totcol; a++) ob->mat[a]= newlibadr_us(fd, ob->id.lib, ob->mat[a]);
+ ob->gpd= newlibadr_us(fd, ob->id.lib, ob->gpd);
+
ob->id.flag -= LIB_NEEDLINK;
/* if id.us==0 a new base will be created later on */
@@ -3460,9 +3510,6 @@ static void lib_link_object(FileData *fd, Main *main)
bSoundActuator *sa= act->data;
sa->sound= newlibadr_us(fd, ob->id.lib, sa->sound);
}
- else if(act->type==ACT_CD) {
- /* bCDActuator *cda= act->data; */
- }
else if(act->type==ACT_GAME) {
/* bGameActuator *ga= act->data; */
}
@@ -3539,6 +3586,17 @@ static void lib_link_object(FileData *fd, Main *main)
if(fluidmd && fluidmd->fss)
fluidmd->fss->ipo = newlibadr_us(fd, ob->id.lib, fluidmd->fss->ipo);
}
+
+ {
+ SmokeModifierData *smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke);
+
+ if(smd && smd->type == MOD_SMOKE_TYPE_DOMAIN && smd->domain)
+ {
+ smd->domain->coll_group = newlibadr_us(fd, ob->id.lib, smd->domain->coll_group);
+ smd->domain->eff_group = newlibadr_us(fd, ob->id.lib, smd->domain->eff_group);
+ smd->domain->fluid_group = newlibadr_us(fd, ob->id.lib, smd->domain->fluid_group);
+ }
+ }
/* texture field */
if(ob->pd)
@@ -3613,10 +3671,8 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
clmd->sim_parms= newdataadr(fd, clmd->sim_parms);
clmd->coll_parms= newdataadr(fd, clmd->coll_parms);
- clmd->point_cache= newdataadr(fd, clmd->point_cache);
- if(clmd->point_cache)
- direct_link_pointcache(fd, clmd->point_cache);
+ direct_link_pointcache_list(fd, &clmd->ptcaches, &clmd->point_cache);
if(clmd->sim_parms) {
if(clmd->sim_parms->presets > 10)
@@ -3630,6 +3686,43 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
fluidmd->fss= newdataadr(fd, fluidmd->fss);
fluidmd->fss->meshSurfNormals = 0;
}
+ else if (md->type==eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData*) md;
+
+ if(smd->type==MOD_SMOKE_TYPE_DOMAIN)
+ {
+ smd->flow = NULL;
+ smd->coll = NULL;
+ smd->domain = newdataadr(fd, smd->domain);
+ smd->domain->smd = smd;
+
+ smd->domain->fluid = NULL;
+ smd->domain->view3d = NULL;
+ smd->domain->tex = NULL;
+
+ direct_link_pointcache_list(fd, &(smd->domain->ptcaches[0]), &(smd->domain->point_cache[0]));
+ direct_link_pointcache_list(fd, &(smd->domain->ptcaches[1]), &(smd->domain->point_cache[1]));
+ }
+ else if(smd->type==MOD_SMOKE_TYPE_FLOW)
+ {
+ smd->domain = NULL;
+ smd->coll = NULL;
+ smd->flow = newdataadr(fd, smd->flow);
+ smd->flow->smd = smd;
+ smd->flow->psys = newdataadr(fd, smd->flow->psys);
+ }
+ else if(smd->type==MOD_SMOKE_TYPE_COLL)
+ {
+ smd->flow = NULL;
+ smd->domain = NULL;
+ smd->coll = NULL;
+ /*
+ smd->coll = newdataadr(fd, smd->coll);
+ smd->coll->points = NULL;
+ smd->coll->numpoints = 0;
+ */
+ }
+ }
else if (md->type==eModifierType_Collision) {
CollisionModifierData *collmd = (CollisionModifierData*) md;
@@ -3820,9 +3913,7 @@ static void direct_link_object(FileData *fd, Object *ob)
}
}
- sb->pointcache= newdataadr(fd, sb->pointcache);
- if(sb->pointcache)
- direct_link_pointcache(fd, sb->pointcache);
+ direct_link_pointcache_list(fd, &sb->ptcaches, &sb->pointcache);
}
ob->bsoft= newdataadr(fd, ob->bsoft);
ob->fluidsimSettings= newdataadr(fd, ob->fluidsimSettings); /* NT */
@@ -3908,6 +3999,10 @@ static void direct_link_object(FileData *fd, Object *ob)
ob->derivedDeform= NULL;
ob->derivedFinal= NULL;
ob->gpulamp.first= ob->gpulamp.last= NULL;
+ link_list(fd, &ob->pc_ids);
+
+ if(ob->sculpt)
+ ob->sculpt= MEM_callocN(sizeof(SculptSession), "reload sculpt session");
}
/* ************ READ SCENE ***************** */
@@ -3922,6 +4017,14 @@ static void composite_patch(bNodeTree *ntree, Scene *scene)
node->id= &scene->id;
}
+static void link_paint(FileData *fd, Scene *sce, Paint *p)
+{
+ if(p && p->brushes) {
+ int i;
+ for(i = 0; i < p->brush_count; ++i)
+ p->brushes[i]= newlibadr_us(fd, sce->id.lib, p->brushes[i]);
+ }
+}
static void lib_link_scene(FileData *fd, Main *main)
{
@@ -3944,19 +4047,13 @@ static void lib_link_scene(FileData *fd, Main *main)
sce->world= newlibadr_us(fd, sce->id.lib, sce->world);
sce->set= newlibadr(fd, sce->id.lib, sce->set);
sce->ima= newlibadr_us(fd, sce->id.lib, sce->ima);
+ sce->gpd= newlibadr_us(fd, sce->id.lib, sce->gpd);
- sce->toolsettings->imapaint.brush=
- newlibadr_us(fd, sce->id.lib, sce->toolsettings->imapaint.brush);
- if(sce->toolsettings->sculpt)
- sce->toolsettings->sculpt->brush=
- newlibadr_us(fd, sce->id.lib, sce->toolsettings->sculpt->brush);
- if(sce->toolsettings->vpaint)
- sce->toolsettings->vpaint->brush=
- newlibadr_us(fd, sce->id.lib, sce->toolsettings->vpaint->brush);
- if(sce->toolsettings->wpaint)
- sce->toolsettings->wpaint->brush=
- newlibadr_us(fd, sce->id.lib, sce->toolsettings->wpaint->brush);
-
+ link_paint(fd, sce, &sce->toolsettings->sculpt->paint);
+ link_paint(fd, sce, &sce->toolsettings->vpaint->paint);
+ link_paint(fd, sce, &sce->toolsettings->wpaint->paint);
+ link_paint(fd, sce, &sce->toolsettings->imapaint.paint);
+
sce->toolsettings->skgen_template = newlibadr(fd, sce->id.lib, sce->toolsettings->skgen_template);
for(base= sce->base.first; base; base= next) {
@@ -3985,14 +4082,16 @@ static void lib_link_scene(FileData *fd, Main *main)
if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
if(seq->sound) {
- seq->sound= newlibadr(fd, sce->id.lib, seq->sound);
+ if(seq->type == SEQ_HD_SOUND)
+ seq->type = SEQ_SOUND;
+ else
+ seq->sound= newlibadr(fd, sce->id.lib, seq->sound);
if (seq->sound) {
seq->sound->id.us++;
- seq->sound->flags |= SOUND_FLAGS_SEQUENCE;
+ seq->sound_handle= sound_new_handle(sce, seq->sound, seq->startdisp, seq->enddisp, seq->startofs);
}
}
seq->anim= 0;
- seq->hdaudio = 0;
}
SEQ_END
@@ -4027,6 +4126,13 @@ static void link_recurs_seq(FileData *fd, ListBase *lb)
link_recurs_seq(fd, &seq->seqbase);
}
+static void direct_link_paint(FileData *fd, Paint **paint)
+{
+ (*paint)= newdataadr(fd, (*paint));
+ if(*paint)
+ (*paint)->brushes= newdataadr(fd, (*paint)->brushes);
+}
+
static void direct_link_scene(FileData *fd, Scene *sce)
{
Editing *ed;
@@ -4036,7 +4142,10 @@ static void direct_link_scene(FileData *fd, Scene *sce)
sce->theDag = NULL;
sce->dagisvalid = 0;
sce->obedit= NULL;
-
+ sce->stats= 0;
+
+ memset(&sce->sound_handles, 0, sizeof(sce->sound_handles));
+
/* set users to one by default, not in lib-link, this will increase it for compo nodes */
sce->id.us= 1;
@@ -4052,14 +4161,14 @@ static void direct_link_scene(FileData *fd, Scene *sce)
sce->toolsettings= newdataadr(fd, sce->toolsettings);
if(sce->toolsettings) {
- sce->toolsettings->vpaint= newdataadr(fd, sce->toolsettings->vpaint);
- sce->toolsettings->wpaint= newdataadr(fd, sce->toolsettings->wpaint);
- sce->toolsettings->sculpt= newdataadr(fd, sce->toolsettings->sculpt);
+ direct_link_paint(fd, (Paint**)&sce->toolsettings->sculpt);
+ direct_link_paint(fd, (Paint**)&sce->toolsettings->vpaint);
+ direct_link_paint(fd, (Paint**)&sce->toolsettings->wpaint);
+
+ sce->toolsettings->imapaint.paint.brushes= newdataadr(fd, sce->toolsettings->imapaint.paint.brushes);
+
sce->toolsettings->imapaint.paintcursor= NULL;
sce->toolsettings->particle.paintcursor= NULL;
-
- if(sce->toolsettings->sculpt)
- sce->toolsettings->sculpt->session= MEM_callocN(sizeof(SculptSession), "reload sculpt session");
}
if(sce->ed) {
@@ -4246,11 +4355,14 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
static void lib_link_windowmanager(FileData *fd, Main *main)
{
wmWindowManager *wm;
+ wmWindow *win;
for(wm= main->wm.first; wm; wm= wm->id.next) {
- wmWindow *win;
- for(win= wm->windows.first; win; win= win->next) {
- win->screen= newlibadr(fd, NULL, win->screen);
+ if(wm->id.flag & LIB_NEEDLINK) {
+ for(win= wm->windows.first; win; win= win->next)
+ win->screen= newlibadr(fd, NULL, win->screen);
+
+ wm->id.flag -= LIB_NEEDLINK;
}
}
}
@@ -4846,7 +4958,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
}
else if(sl->spacetype==SPACE_LOGIC) {
SpaceLogic *slogic= (SpaceLogic *)sl;
-
+
if(slogic->gpd) {
slogic->gpd= newdataadr(fd, slogic->gpd);
direct_link_gpencil(fd, slogic->gpd);
@@ -4957,8 +5069,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
static void direct_link_sound(FileData *fd, bSound *sound)
{
- sound->sample = NULL;
- sound->snd_sound = NULL;
+ sound->handle = NULL;
sound->packedfile = direct_link_packedfile(fd, sound->packedfile);
sound->newpackedfile = direct_link_packedfile(fd, sound->newpackedfile);
@@ -4973,7 +5084,11 @@ static void lib_link_sound(FileData *fd, Main *main)
if(sound->id.flag & LIB_NEEDLINK) {
sound->id.flag -= LIB_NEEDLINK;
sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system
- sound->stream = 0;
+
+ sound_load(main, sound);
+
+ if(sound->cache)
+ sound_cache(sound, 1);
}
sound= sound->id.next;
}
@@ -5244,6 +5359,9 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
bfd->curscene= fg->curscene;
MEM_freeN(fg);
+
+ fd->globalf= bfd->globalf;
+ fd->fileflags= bfd->fileflags;
return blo_nextbhead(fd, bhead);
}
@@ -5635,7 +5753,7 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
tf = ((MTFace*)me->fdata.layers[b].data) + a;
tf->mode &= ~TF_ALPHASORT;
- if(ma && (ma->mode & MA_ZTRA))
+ if(ma && (ma->mode & MA_ZTRANSP))
if(ELEM(tf->transp, TF_ALPHA, TF_ADD) || (texalpha && (tf->transp != TF_CLIP)))
tf->mode |= TF_ALPHASORT;
}
@@ -5678,6 +5796,14 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->regiontype= RGN_TYPE_CHANNELS;
ar->alignment= RGN_ALIGN_LEFT;
ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+
+ // for some reason, this doesn't seem to go auto like for NLA...
+ ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_UI;
+ ar->alignment= RGN_ALIGN_RIGHT;
+ ar->v2d.scroll= V2D_SCROLL_RIGHT;
+ ar->v2d.flag = RGN_FLAG_HIDDEN;
break;
case SPACE_ACTION:
@@ -8222,20 +8348,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* add point caches */
for(ob=main->object.first; ob; ob=ob->id.next) {
if(ob->soft && !ob->soft->pointcache)
- ob->soft->pointcache= BKE_ptcache_add();
+ ob->soft->pointcache= BKE_ptcache_add(&ob->soft->ptcaches);
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
if(psys->soft && !psys->soft->pointcache)
- psys->soft->pointcache= BKE_ptcache_add();
+ psys->soft->pointcache= BKE_ptcache_add(&psys->soft->ptcaches);
if(!psys->pointcache)
- psys->pointcache= BKE_ptcache_add();
+ psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
}
for(md=ob->modifiers.first; md; md=md->next) {
if(md->type==eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData*) md;
if(!clmd->point_cache)
- clmd->point_cache= BKE_ptcache_add();
+ clmd->point_cache= BKE_ptcache_add(&clmd->ptcaches);
}
}
}
@@ -8523,7 +8649,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* create new particle system */
psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- psys->pointcache = BKE_ptcache_add();
+ psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
part = psys->part = psys_new_settings("ParticleSettings", main);
@@ -9109,9 +9235,69 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Tex *tx;
ParticleSettings *part;
Object *ob;
- PTCacheID *pid;
- ListBase pidlist;
-
+ //PTCacheID *pid;
+ //ListBase pidlist;
+
+ bSound *sound;
+ Sequence *seq;
+ bActuator *act;
+
+ for(sound = main->sound.first; sound; sound = sound->id.next)
+ {
+ if(sound->newpackedfile)
+ {
+ sound->packedfile = sound->newpackedfile;
+ sound->newpackedfile = NULL;
+ }
+ }
+
+ for(ob = main->object.first; ob; ob= ob->id.next) {
+ for(act= ob->actuators.first; act; act= act->next) {
+ if (act->type == ACT_SOUND) {
+ bSoundActuator *sAct = (bSoundActuator*) act->data;
+ if(sAct->sound)
+ {
+ sound = newlibadr(fd, lib, sAct->sound);
+ sAct->flag = sound->flags | SOUND_FLAGS_3D ? ACT_SND_3D_SOUND : 0;
+ sAct->pitch = sound->pitch;
+ sAct->volume = sound->volume;
+ sAct->sound3D.reference_distance = sound->distance;
+ sAct->sound3D.max_gain = sound->max_gain;
+ sAct->sound3D.min_gain = sound->min_gain;
+ sAct->sound3D.rolloff_factor = sound->attenuation;
+ }
+ else
+ {
+ sAct->sound3D.reference_distance = 1.0f;
+ sAct->volume = 1.0f;
+ sAct->sound3D.max_gain = 1.0f;
+ sAct->sound3D.rolloff_factor = 1.0f;
+ }
+ sAct->sound3D.cone_inner_angle = 360.0f;
+ sAct->sound3D.cone_outer_angle = 360.0f;
+ sAct->sound3D.max_distance = FLT_MAX;
+ }
+ }
+ }
+
+ for(scene = main->scene.first; scene; scene = scene->id.next)
+ {
+ if(scene->ed && scene->ed->seqbasep)
+ {
+ for(seq = scene->ed->seqbasep->first; seq; seq = seq->next)
+ {
+ if(seq->type == SEQ_HD_SOUND)
+ {
+ char str[FILE_MAX];
+ BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name);
+ BLI_convertstringcode(str, G.sce);
+ BLI_convertstringframe(str, scene->r.cfra);
+ seq->sound = sound_new_file(main, str);
+ }
+ }
+ }
+ }
+
for(screen= main->screen.first; screen; screen= screen->id.next) {
do_versions_windowmanager_2_50(screen);
do_versions_gpencil_2_50(main, screen);
@@ -9140,7 +9326,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* move to cameras */
if(sce->r.scemode & R_PANORAMA) {
- for(base=scene->base.first; base; base=base->next) {
+ for(base=sce->base.first; base; base=base->next) {
ob= newlibadr(fd, lib, base->object);
if(ob->type == OB_CAMERA && !ob->id.lib) {
@@ -9184,30 +9370,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* set old pointcaches to have disk cache flag */
for(ob = main->object.first; ob; ob= ob->id.next) {
- BKE_ptcache_ids_from_object(&pidlist, ob);
+ //BKE_ptcache_ids_from_object(&pidlist, ob);
- for(pid=pidlist.first; pid; pid=pid->next)
- pid->cache->flag |= PTCACHE_DISK_CACHE;
+ //for(pid=pidlist.first; pid; pid=pid->next)
+ // pid->cache->flag |= PTCACHE_DISK_CACHE;
- BLI_freelistN(&pidlist);
+ //BLI_freelistN(&pidlist);
}
}
if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 1)) {
- }
-
- /* TODO: should be moved into one of the version blocks once this branch moves to trunk and we can
- bump the version (or sub-version.) */
- {
- World *wo;
Object *ob;
Material *ma;
Tex *tex;
Scene *sce;
ToolSettings *ts;
+ //PTCacheID *pid;
+ //ListBase pidlist;
int i, a;
for(ob = main->object.first; ob; ob = ob->id.next) {
+ //BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ //for(pid=pidlist.first; pid; pid=pid->next) {
+ // if(pid->ptcaches->first == NULL)
+ // pid->ptcaches->first = pid->ptcaches->last = pid->cache;
+ //}
+
+ //BLI_freelistN(&pidlist);
if(ob->type == OB_MESH) {
Mesh *me = newlibadr(fd, lib, ob->data);
@@ -9254,7 +9444,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
mmd->lvl = mmd->totlvl;
orig = CDDM_from_mesh(me, NULL);
- dm = multires_dm_create_from_derived(mmd, orig, me, 0, 0);
+ dm = multires_dm_create_from_derived(mmd, 0, orig, ob, 0, 0);
multires_load_old(dm, me->mr);
@@ -9295,15 +9485,45 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ma->mode &= ~MA_HALO;
}
+ if(ma->mode & (MA_ZTRANSP|MA_RAYTRANSP)) {
+ ma->mode |= MA_TRANSP;
+ }
+ else {
+ ma->mode |= MA_ZTRANSP;
+ ma->mode &= ~MA_TRANSP;
+ }
+
/* set new bump for unused slots */
for(a=0; a<MAX_MTEX; a++) {
if(ma->mtex[a]) {
- if(!ma->mtex[a]->tex)
- ma->mtex[a]->texflag |= MTEX_NEW_BUMP;
- else if(((Tex*)newlibadr(fd, ma->id.lib, ma->mtex[a]->tex))->type == 0)
+ tex= ma->mtex[a]->tex;
+ if(!tex)
ma->mtex[a]->texflag |= MTEX_NEW_BUMP;
+ else {
+ tex= (Tex*)newlibadr(fd, ma->id.lib, tex);
+ if(tex && tex->type == 0) /* invalid type */
+ ma->mtex[a]->texflag |= MTEX_NEW_BUMP;
+ }
}
}
+
+ /* volume rendering settings */
+ if (ma->vol.stepsize < 0.0001f) {
+ ma->vol.density = 1.0f;
+ ma->vol.emission = 0.0f;
+ ma->vol.absorption = 1.0f;
+ ma->vol.scattering = 1.0f;
+ ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f;
+ ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f;
+ ma->vol.density_scale = 1.0f;
+ ma->vol.depth_cutoff = 0.01f;
+ ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED;
+ ma->vol.stepsize = 0.2f;
+ ma->vol.shade_stepsize = 0.2f;
+ ma->vol.shade_type = MA_VOL_SHADE_SINGLE;
+ ma->vol.shadeflag |= MA_VOL_PRECACHESHADING;
+ ma->vol.precache_resolution = 50;
+ }
}
for(sce = main->scene.first; sce; sce = sce->id.next) {
@@ -9364,31 +9584,57 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->gm.depth= sce->r.depth;
//Physic (previously stored in world)
- //temporarily getting the correct world address
- wo = newlibadr(fd, sce->id.lib, sce->world);
- if (wo){
- sce->gm.gravity = wo->gravity;
- sce->gm.physicsEngine= wo->physicsEngine;
- sce->gm.mode = wo->mode;
- sce->gm.occlusionRes = wo->occlusionRes;
- sce->gm.ticrate = wo->ticrate;
- sce->gm.maxlogicstep = wo->maxlogicstep;
- sce->gm.physubstep = wo->physubstep;
- sce->gm.maxphystep = wo->maxphystep;
- }
- else{
- sce->gm.gravity =9.8f;
- sce->gm.physicsEngine= WOPHY_BULLET;// Bullet by default
- sce->gm.mode = WO_DBVT_CULLING; // DBVT culling by default
- sce->gm.occlusionRes = 128;
- sce->gm.ticrate = 60;
- sce->gm.maxlogicstep = 5;
- sce->gm.physubstep = 1;
- sce->gm.maxphystep = 5;
- }
+ sce->gm.gravity =9.8f;
+ sce->gm.physicsEngine= WOPHY_BULLET;// Bullet by default
+ sce->gm.mode = WO_DBVT_CULLING; // DBVT culling by default
+ sce->gm.occlusionRes = 128;
+ sce->gm.ticrate = 60;
+ sce->gm.maxlogicstep = 5;
+ sce->gm.physubstep = 1;
+ sce->gm.maxphystep = 5;
}
}
+ if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 2)) {
+ Scene *sce;
+
+ for(sce = main->scene.first; sce; sce = sce->id.next) {
+ if(fd->fileflags & G_FILE_ENABLE_ALL_FRAMES)
+ sce->gm.flag |= GAME_ENABLE_ALL_FRAMES;
+ if(fd->fileflags & G_FILE_SHOW_DEBUG_PROPS)
+ sce->gm.flag |= GAME_SHOW_DEBUG_PROPS;
+ if(fd->fileflags & G_FILE_SHOW_FRAMERATE)
+ sce->gm.flag |= GAME_SHOW_FRAMERATE;
+ if(fd->fileflags & G_FILE_SHOW_PHYSICS)
+ sce->gm.flag |= GAME_SHOW_PHYSICS;
+ if(fd->fileflags & G_FILE_GLSL_NO_SHADOWS)
+ sce->gm.flag |= GAME_GLSL_NO_SHADOWS;
+ if(fd->fileflags & G_FILE_GLSL_NO_SHADERS)
+ sce->gm.flag |= GAME_GLSL_NO_SHADERS;
+ if(fd->fileflags & G_FILE_GLSL_NO_RAMPS)
+ sce->gm.flag |= GAME_GLSL_NO_RAMPS;
+ if(fd->fileflags & G_FILE_GLSL_NO_NODES)
+ sce->gm.flag |= GAME_GLSL_NO_NODES;
+ if(fd->fileflags & G_FILE_GLSL_NO_EXTRA_TEX)
+ sce->gm.flag |= GAME_GLSL_NO_EXTRA_TEX;
+ if(fd->fileflags & G_FILE_IGNORE_DEPRECATION_WARNINGS)
+ sce->gm.flag |= GAME_IGNORE_DEPRECATION_WARNINGS;
+
+ if(fd->fileflags & G_FILE_GAME_MAT_GLSL)
+ sce->gm.matmode= GAME_MAT_GLSL;
+ else if(fd->fileflags & G_FILE_GAME_MAT)
+ sce->gm.matmode= GAME_MAT_MULTITEX;
+ else
+ sce->gm.matmode= GAME_MAT_TEXFACE;
+
+ sce->gm.flag |= GAME_DISPLAY_LISTS;
+ }
+ }
+
+ /* put 2.50 compatibility code here until next subversion bump */
+ {
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
@@ -9439,7 +9685,17 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
// XXX
bfd->user->uifonts.first= bfd->user->uifonts.last= NULL;
bfd->user->uistyles.first= bfd->user->uistyles.last= NULL;
-
+
+ // AUD_XXX that's bad because if the user has saved No Audio, it changes to OpenAL always
+ if(bfd->user->audiochannels == 0)
+ bfd->user->audiochannels = 2;
+ if(bfd->user->audiodevice == 0)
+ bfd->user->audiodevice = 2;
+ if(bfd->user->audioformat == 0)
+ bfd->user->audioformat = 0x24;
+ if(bfd->user->audiorate == 0)
+ bfd->user->audiorate = 44100;
+
bhead = blo_nextbhead(fd, bhead);
/* read all attached data */
@@ -9452,7 +9708,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
return bhead;
}
-BlendFileData *blo_read_file_internal(FileData *fd)
+BlendFileData *blo_read_file_internal(FileData *fd, char *file)
{
BHead *bhead= blo_firstbhead(fd);
BlendFileData *bfd;
@@ -9463,6 +9719,9 @@ BlendFileData *blo_read_file_internal(FileData *fd)
bfd->main->versionfile= fd->fileversion;
+ bfd->type= BLENFILETYPE_BLEND;
+ strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1);
+
while(bhead) {
switch(bhead->code) {
case DATA:
@@ -9885,6 +10144,9 @@ static void expand_mball(FileData *fd, Main *mainvar, MetaBall *mb)
for(a=0; a<mb->totcol; a++) {
expand_doit(fd, mainvar, mb->mat[a]);
}
+
+ if(mb->adt)
+ expand_animdata(fd, mainvar, mb->adt);
}
static void expand_curve(FileData *fd, Main *mainvar, Curve *cu)
@@ -10130,6 +10392,16 @@ static void expand_modifier(FileData *fd, Main *mainvar, ModifierData *md)
expand_doit(fd, mainvar, dmd->map_object);
expand_doit(fd, mainvar, dmd->texture);
}
+ else if (md->type==eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData*) md;
+
+ if(smd->type==MOD_SMOKE_TYPE_DOMAIN && smd->domain)
+ {
+ expand_doit(fd, mainvar, smd->domain->coll_group);
+ expand_doit(fd, mainvar, smd->domain->fluid_group);
+ expand_doit(fd, mainvar, smd->domain->eff_group);
+ }
+ }
}
static void expand_object(FileData *fd, Main *mainvar, Object *ob)
@@ -10154,6 +10426,8 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
expand_doit(fd, mainvar, ob->poselib);
expand_constraints(fd, mainvar, &ob->constraints);
+ expand_doit(fd, mainvar, ob->gpd);
+
// XXX depreceated - old animation system (for version patching only)
expand_doit(fd, mainvar, ob->ipo);
expand_doit(fd, mainvar, ob->action);
@@ -10289,6 +10563,9 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
if(sce->r.dometext)
expand_doit(fd, mainvar, sce->gm.dome.warptext);
+
+ if(sce->gpd)
+ expand_doit(fd, mainvar, sce->gpd);
}
static void expand_camera(FileData *fd, Main *mainvar, Camera *ca)
@@ -10479,7 +10756,7 @@ static void append_named_part(FileData *fd, Main *mainvar, Scene *scene, char *n
}
}
- if(idcode==ID_OB) { /* loose object: give a base */
+ if(idcode==ID_OB && scene) { /* loose object: give a base */
base= MEM_callocN( sizeof(Base), "app_nam_part");
BLI_addtail(&scene->base, base);
@@ -10581,14 +10858,16 @@ static Library* library_append(Main *mainvar, Scene *scene, char* file, char *di
fix_relpaths_library(G.sce, mainvar); /* make all relative paths, relative to the open blend file */
/* give a base to loose objects. If group append, do it for objects too */
- if(idcode==ID_GR) {
- if (flag & FILE_LINK) {
- give_base_to_objects(mainvar, scene, NULL, 0);
+ if(scene) {
+ if(idcode==ID_GR) {
+ if (flag & FILE_LINK) {
+ give_base_to_objects(mainvar, scene, NULL, 0);
+ } else {
+ give_base_to_objects(mainvar, scene, curlib, 1);
+ }
} else {
- give_base_to_objects(mainvar, scene, curlib, 1);
- }
- } else {
- give_base_to_objects(mainvar, scene, NULL, 0);
+ give_base_to_objects(mainvar, scene, NULL, 0);
+ }
}
/* has been removed... erm, why? s..ton) */
/* 20040907: looks like they are give base already in append_named_part(); -Nathan L */
@@ -10619,7 +10898,8 @@ void BLO_script_library_append(BlendHandle **bh, char *dir, char *name,
if(fd) fd->reports= NULL;
/* do we need to do this? */
- DAG_scene_sort(scene);
+ if(scene)
+ DAG_scene_sort(scene);
*bh= (BlendHandle*)fd;
}
@@ -10864,7 +11144,7 @@ BlendFileData *blo_read_blendafterruntime(int file, char *name, int actualsize,
return NULL;
fd->reports= reports;
- bfd= blo_read_file_internal(fd);
+ bfd= blo_read_file_internal(fd, "");
blo_freefiledata(fd);
return bfd;
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index f0e00b75b67..2a0b6c327d3 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -69,6 +69,7 @@ typedef struct FileData {
int fileversion;
int id_name_offs; /* used to retrieve ID names from (bhead+1) */
+ int globalf, fileflags; /* for do_versions patching */
struct OldNewMap *datamap;
struct OldNewMap *globmap;
@@ -107,7 +108,7 @@ struct Main;
void blo_join_main(ListBase *mainlist);
void blo_split_main(ListBase *mainlist, struct Main *main);
-BlendFileData *blo_read_file_internal(FileData *fd);
+BlendFileData *blo_read_file_internal(FileData *fd, char *file);
FileData *blo_openblenderfile(char *name, struct ReportList *reports);
FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 0f693b6de31..88c6f205d15 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -130,6 +130,7 @@ Any case: direct data is ALWAYS after the lib block
#include "DNA_sdna_types.h"
#include "DNA_sequence_types.h"
#include "DNA_sensor_types.h"
+#include "DNA_smoke_types.h"
#include "DNA_space_types.h"
#include "DNA_screen_types.h"
#include "DNA_sound_types.h"
@@ -156,6 +157,7 @@ Any case: direct data is ALWAYS after the lib block
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_packedFile.h" // for packAll
+#include "BKE_pointcache.h"
#include "BKE_report.h"
#include "BKE_screen.h" // for waitcursor
#include "BKE_sequence.h"
@@ -405,13 +407,13 @@ static void IDP_WriteIDPArray(IDProperty *prop, void *wd)
{
/*REMEMBER to set totalen to len in the linking code!!*/
if (prop->data.pointer) {
- IDProperty **array = prop->data.pointer;
+ IDProperty *array = prop->data.pointer;
int a;
- writedata(wd, DATA, MEM_allocN_len(prop->data.pointer), prop->data.pointer);
+ writestruct(wd, DATA, "IDProperty", prop->len, array);
for(a=0; a<prop->len; a++)
- IDP_WriteProperty(array[a], wd);
+ IDP_WriteProperty_OnlyData(&array[a], wd);
}
}
@@ -581,19 +583,27 @@ static void write_boid_state(WriteData *wd, BoidState *state)
/* TODO: replace *cache with *cachelist once it's coded */
#define PTCACHE_WRITE_PSYS 0
#define PTCACHE_WRITE_CLOTH 1
-static void write_pointcaches(WriteData *wd, PointCache *cache, int type)
+static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
{
- writestruct(wd, DATA, "PointCache", 1, cache);
+ PointCache *cache = ptcaches->first;
+ int i;
- if((cache->flag & PTCACHE_DISK_CACHE)==0) {
- PTCacheMem *pm = cache->mem_cache.first;
+ for(; cache; cache=cache->next) {
+ writestruct(wd, DATA, "PointCache", 1, cache);
- for(; pm; pm=pm->next) {
- writestruct(wd, DATA, "PTCacheMem", 1, pm);
- if(type==PTCACHE_WRITE_PSYS)
- writestruct(wd, DATA, "ParticleKey", pm->totpoint, pm->data);
- else if(type==PTCACHE_WRITE_CLOTH)
- writedata(wd, DATA, 9 * sizeof(float) * pm->totpoint, pm->data);
+ if((cache->flag & PTCACHE_DISK_CACHE)==0) {
+ PTCacheMem *pm = cache->mem_cache.first;
+
+ for(; pm; pm=pm->next) {
+ writestruct(wd, DATA, "PTCacheMem", 1, pm);
+ if(pm->index_array)
+ writedata(wd, DATA, sizeof(int) * pm->totpoint, pm->index_array);
+
+ for(i=0; i<BPHYS_TOT_DATA; i++) {
+ if(pm->data[i] && pm->data_types & (1<<i))
+ writedata(wd, DATA, BKE_ptcache_data_size(i) * pm->totpoint, pm->data[i]);
+ }
+ }
}
}
}
@@ -651,8 +661,8 @@ static void write_particlesystems(WriteData *wd, ListBase *particles)
if(psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild ,psys->child);
writestruct(wd, DATA, "SoftBody", 1, psys->soft);
- if(psys->soft) write_pointcaches(wd, psys->soft->pointcache, PTCACHE_WRITE_PSYS);
- write_pointcaches(wd, psys->pointcache, PTCACHE_WRITE_PSYS);
+ if(psys->soft) write_pointcaches(wd, &psys->soft->ptcaches);
+ write_pointcaches(wd, &psys->ptcaches);
}
}
@@ -770,9 +780,6 @@ static void write_actuators(WriteData *wd, ListBase *lb)
case ACT_SOUND:
writestruct(wd, DATA, "bSoundActuator", 1, act->data);
break;
- case ACT_CD:
- writestruct(wd, DATA, "bCDActuator", 1, act->data);
- break;
case ACT_OBJECT:
writestruct(wd, DATA, "bObjectActuator", 1, act->data);
break;
@@ -1093,7 +1100,7 @@ static void write_defgroups(WriteData *wd, ListBase *defbase)
writestruct(wd, DATA, "bDeformGroup", 1, defgroup);
}
-static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo)
+static void write_modifiers(WriteData *wd, ListBase *modbase)
{
ModifierData *md;
@@ -1114,7 +1121,25 @@ static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo)
writestruct(wd, DATA, "ClothSimSettings", 1, clmd->sim_parms);
writestruct(wd, DATA, "ClothCollSettings", 1, clmd->coll_parms);
- write_pointcaches(wd, clmd->point_cache, PTCACHE_WRITE_CLOTH);
+ write_pointcaches(wd, &clmd->ptcaches);
+ }
+ else if(md->type==eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData*) md;
+
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ writestruct(wd, DATA, "SmokeDomainSettings", 1, smd->domain);
+ else if(smd->type & MOD_SMOKE_TYPE_FLOW)
+ writestruct(wd, DATA, "SmokeFlowSettings", 1, smd->flow);
+ /*
+ else if(smd->type & MOD_SMOKE_TYPE_COLL)
+ writestruct(wd, DATA, "SmokeCollSettings", 1, smd->coll);
+ */
+
+ if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
+ {
+ write_pointcaches(wd, &(smd->domain->ptcaches[0]));
+ write_pointcaches(wd, &(smd->domain->ptcaches[1]));
+ }
}
else if(md->type==eModifierType_Fluidsim) {
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
@@ -1147,13 +1172,13 @@ static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo)
else if (md->type==eModifierType_Multires) {
MultiresModifierData *mmd = (MultiresModifierData*) md;
- if(mmd->undo_verts && write_undo)
+ if(mmd->undo_verts)
writestruct(wd, DATA, "MVert", mmd->undo_verts_tot, mmd->undo_verts);
}
}
}
-static void write_objects(WriteData *wd, ListBase *idbase, int write_undo)
+static void write_objects(WriteData *wd, ListBase *idbase)
{
Object *ob;
@@ -1183,11 +1208,11 @@ static void write_objects(WriteData *wd, ListBase *idbase, int write_undo)
writestruct(wd, DATA, "PartDeflect", 1, ob->pd);
writestruct(wd, DATA, "SoftBody", 1, ob->soft);
- if(ob->soft) writestruct(wd, DATA, "PointCache", 1, ob->soft->pointcache);
+ if(ob->soft) write_pointcaches(wd, &ob->soft->ptcaches);
writestruct(wd, DATA, "BulletSoftBody", 1, ob->bsoft);
write_particlesystems(wd, &ob->particlesystem);
- write_modifiers(wd, &ob->modifiers, write_undo);
+ write_modifiers(wd, &ob->modifiers);
}
ob= ob->id.next;
}
@@ -1284,6 +1309,7 @@ static void write_mballs(WriteData *wd, ListBase *idbase)
/* direct data */
writedata(wd, DATA, sizeof(void *)*mb->totcol, mb->mat);
+ if (mb->adt) write_animdata(wd, mb->adt);
ml= mb->elems.first;
while(ml) {
@@ -1549,6 +1575,11 @@ static void write_textures(WriteData *wd, ListBase *idbase)
if(tex->type == TEX_PLUGIN && tex->plugin) writestruct(wd, DATA, "PluginTex", 1, tex->plugin);
if(tex->coba) writestruct(wd, DATA, "ColorBand", 1, tex->coba);
if(tex->type == TEX_ENVMAP && tex->env) writestruct(wd, DATA, "EnvMap", 1, tex->env);
+ if(tex->type == TEX_POINTDENSITY && tex->pd) {
+ writestruct(wd, DATA, "PointDensity", 1, tex->pd);
+ if(tex->pd->coba) writestruct(wd, DATA, "ColorBand", 1, tex->pd->coba);
+ }
+ if(tex->type == TEX_VOXELDATA && tex->vd) writestruct(wd, DATA, "VoxelData", 1, tex->vd);
/* nodetree is integral part of texture, no libdata */
if(tex->nodetree) {
@@ -1656,6 +1687,11 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
}
}
+static void write_paint(WriteData *wd, Paint *p)
+{
+ if(p && p->brushes)
+ writedata(wd, DATA, p->brush_count * sizeof(Brush*), p->brushes);
+}
static void write_scenes(WriteData *wd, ListBase *scebase)
{
@@ -1668,6 +1704,7 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
TimeMarker *marker;
TransformOrientation *ts;
SceneRenderLayer *srl;
+ ToolSettings *tos;
sce= scebase->first;
while(sce) {
@@ -1685,13 +1722,22 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
base= base->next;
}
- writestruct(wd, DATA, "ToolSettings", 1, sce->toolsettings);
- if(sce->toolsettings->vpaint)
- writestruct(wd, DATA, "VPaint", 1, sce->toolsettings->vpaint);
- if(sce->toolsettings->wpaint)
- writestruct(wd, DATA, "VPaint", 1, sce->toolsettings->wpaint);
- if(sce->toolsettings->sculpt)
- writestruct(wd, DATA, "Sculpt", 1, sce->toolsettings->sculpt);
+ tos = sce->toolsettings;
+ writestruct(wd, DATA, "ToolSettings", 1, tos);
+ if(tos->vpaint) {
+ writestruct(wd, DATA, "VPaint", 1, tos->vpaint);
+ write_paint(wd, &tos->vpaint->paint);
+ }
+ if(tos->wpaint) {
+ writestruct(wd, DATA, "VPaint", 1, tos->wpaint);
+ write_paint(wd, &tos->wpaint->paint);
+ }
+ if(tos->sculpt) {
+ writestruct(wd, DATA, "Sculpt", 1, tos->sculpt);
+ write_paint(wd, &tos->sculpt->paint);
+ }
+
+ write_paint(wd, &tos->imapaint.paint);
ed= sce->ed;
if(ed) {
@@ -1988,6 +2034,10 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
else if(sl->spacetype==SPACE_CONSOLE) {
writestruct(wd, DATA, "SpaceConsole", 1, sl);
}
+ else if(sl->spacetype==SPACE_USERPREF) {
+ writestruct(wd, DATA, "SpaceUserPref", 1, sl);
+ }
+
sl= sl->next;
}
}
@@ -2123,45 +2173,21 @@ static void write_texts(WriteData *wd, ListBase *idbase)
static void write_sounds(WriteData *wd, ListBase *idbase)
{
bSound *sound;
- bSample *sample;
PackedFile * pf;
- // set all samples to unsaved status
-
- sample = samples->first; // samples is a global defined in sound.c
- while (sample) {
- sample->flags |= SAMPLE_NEEDS_SAVE;
- sample = sample->id.next;
- }
-
sound= idbase->first;
while(sound) {
if(sound->id.us>0 || wd->current) {
- // do we need to save the packedfile as well ?
- sample = sound->sample;
- if (sample) {
- if (sample->flags & SAMPLE_NEEDS_SAVE) {
- sound->newpackedfile = sample->packedfile;
- sample->flags &= ~SAMPLE_NEEDS_SAVE;
- } else {
- sound->newpackedfile = NULL;
- }
- }
-
/* write LibData */
writestruct(wd, ID_SO, "bSound", 1, sound);
if (sound->id.properties) IDP_WriteProperty(sound->id.properties, wd);
- if (sound->newpackedfile) {
- pf = sound->newpackedfile;
+ if (sound->packedfile) {
+ pf = sound->packedfile;
writestruct(wd, DATA, "PackedFile", 1, pf);
writedata(wd, DATA, pf->size, pf->data);
}
-
- if (sample) {
- sound->newpackedfile = sample->packedfile;
- }
}
sound= sound->id.next;
}
@@ -2305,7 +2331,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
write_groups (wd, &mainvar->group);
write_armatures(wd, &mainvar->armature);
write_actions (wd, &mainvar->action);
- write_objects (wd, &mainvar->object, (current != NULL));
+ write_objects (wd, &mainvar->object);
write_materials(wd, &mainvar->mat);
write_textures (wd, &mainvar->tex);
write_meshs (wd, &mainvar->mesh);
diff --git a/source/blender/blenpluginapi/SConscript b/source/blender/blenpluginapi/SConscript
index 776c188d73b..af69b4519b4 100644
--- a/source/blender/blenpluginapi/SConscript
+++ b/source/blender/blenpluginapi/SConscript
@@ -11,4 +11,4 @@ if env['WITH_BF_QUICKTIME']:
defs.append('WITH_QUICKTIME')
incs += ' ' + env['BF_QUICKTIME_INC']
-env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'player'], priority = [170, 35] )
+env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [170] )
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt
index b7a868ad537..c40b18ea099 100644
--- a/source/blender/editors/CMakeLists.txt
+++ b/source/blender/editors/CMakeLists.txt
@@ -31,17 +31,21 @@ SET(INC ../windowmanager
../../../intern/guardedalloc ../../../intern/memutil
../blenlib ../makesdna ../makesrna ../blenkernel
../include ../imbuf ../render/extern/include
- ../../../intern/bsp/extern ../radiosity/extern/include
+ ../../../intern/bsp/extern
../../../intern/decimation/extern ../blenloader ../python
- ../../kernel/gen_system ../../../intern/SoundSystem ../readstreamglue
- ../quicktime ../../../intern/elbeem/extern
- ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include
+ ../../kernel/gen_system ../readstreamglue
+ ../../../intern/elbeem/extern
+ ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include ../../../intern/smoke/extern
+ ../../../intern/audaspace/intern
../nodes
../gpu
../blenfont
- ${SDL_INC}
)
+IF(WITH_GAMEENGINE)
+ ADD_DEFINITIONS(-DGAMEBLENDER)
+ENDIF(WITH_GAMEENGINE)
+
IF(WITH_INTERNATIONAL)
ADD_DEFINITIONS(-DINTERNATIONAL)
ENDIF(WITH_INTERNATIONAL)
@@ -55,7 +59,7 @@ IF(WITH_OPENJPEG)
ENDIF(WITH_OPENJPEG)
IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
+ SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile
index dbd0ca779aa..6a9d695ab0e 100644
--- a/source/blender/editors/Makefile
+++ b/source/blender/editors/Makefile
@@ -65,5 +65,7 @@ DIRS = armature \
space_text \
space_sequencer \
space_logic \
+ space_userpref \
+ sound
include nan_subdirs.mk
diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript
index 0a13082faaf..ccffbdb15d5 100644
--- a/source/blender/editors/SConscript
+++ b/source/blender/editors/SConscript
@@ -15,6 +15,7 @@ SConscript(['datafiles/SConscript',
'gpencil/SConscript',
'physics/SConscript',
'preview/SConscript',
+ 'sound/SConscript',
'space_buttons/SConscript',
'space_file/SConscript',
'space_image/SConscript',
@@ -32,6 +33,7 @@ SConscript(['datafiles/SConscript',
'space_sequencer/SConscript',
'space_logic/SConscript',
'space_console/SConscript',
+ 'space_userpref/SConscript',
'transform/SConscript',
'screen/SConscript',
'sculpt_paint/SConscript',
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
new file mode 100644
index 00000000000..e3418fa194f
--- /dev/null
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -0,0 +1,2266 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
+ * All rights reserved.
+ *
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <float.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "DNA_listBase.h"
+#include "DNA_anim_types.h"
+#include "DNA_action_types.h"
+#include "DNA_armature_types.h"
+#include "DNA_camera_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_space_types.h"
+#include "DNA_constraint_types.h"
+#include "DNA_key_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
+#include "DNA_meta_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_gpencil_types.h"
+#include "DNA_windowmanager_types.h"
+#include "DNA_world_types.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "BKE_animsys.h"
+#include "BKE_action.h"
+#include "BKE_depsgraph.h"
+#include "BKE_fcurve.h"
+#include "BKE_key.h"
+#include "BKE_material.h"
+#include "BKE_object.h"
+#include "BKE_context.h"
+#include "BKE_utildefines.h"
+
+#include "UI_interface.h"
+#include "UI_interface_icons.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_anim_api.h"
+#include "ED_keyframing.h"
+#include "ED_keyframes_edit.h" // XXX move the select modes out of there!
+#include "ED_screen.h"
+#include "ED_space_api.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+/* *********************************************** */
+// XXX constant defines to be moved elsewhere?
+
+/* extra padding for lengths (to go under scrollers) */
+#define EXTRA_SCROLL_PAD 100.0f
+
+/* size of indent steps */
+#define INDENT_STEP_SIZE 7
+
+/* macros used for type defines */
+ /* get the pointer used for some flag */
+#define GET_ACF_FLAG_PTR(ptr) \
+ { \
+ *type= sizeof((ptr)); \
+ return &(ptr); \
+ }
+
+
+/* XXX */
+extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
+extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
+
+
+/* *********************************************** */
+/* Generic Functions (Type independent) */
+
+/* Draw Backdrop ---------------------------------- */
+
+/* backdrop for top-level widgets (Scene and Object only) */
+static void acf_generic_root_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ View2D *v2d= &ac->ar->v2d;
+ short expanded= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
+ short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
+
+ /* darker blue for top-level widgets */
+ UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
+
+ /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
+ uiSetRoundBox((expanded)? (1):(1|8));
+ gl_round_box(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
+}
+
+/* backdrop for data expanders under top-level Scene/Object */
+static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ View2D *v2d= &ac->ar->v2d;
+ short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
+
+ /* lighter color than top-level widget */
+ UI_ThemeColor(TH_DOPESHEET_CHANNELSUBOB);
+
+ /* no rounded corner - just rectangular box */
+ glRectf(offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc);
+}
+
+/* backdrop for generic channels */
+static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ View2D *v2d= &ac->ar->v2d;
+ SpaceAction *saction = NULL;
+ bActionGroup *grp = NULL;
+ short indent= (acf->get_indent_level) ? acf->get_indent_level(ac, ale) : 0;
+ short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
+
+ /* get context info needed... */
+ if ((ac->sa) && (ac->sa->spacetype == SPACE_ACTION))
+ saction= (SpaceAction *)ac->sa->spacedata.first;
+
+ if (ale->type == ANIMTYPE_FCURVE) {
+ FCurve *fcu= (FCurve *)ale->data;
+ grp= fcu->grp;
+ }
+
+ /* set color for normal channels
+ * - use 3 shades of color group/standard color for 3 indention level
+ * - only use group colors if allowed to, and if actually feasible
+ */
+ if ( (saction && !(saction->flag & SACTION_NODRAWGCOLORS)) &&
+ ((grp) && (grp->customCol)) )
+ {
+ char cp[3];
+
+ if (indent == 2) {
+ VECCOPY(cp, grp->cs.solid);
+ }
+ else if (indent == 1) {
+ VECCOPY(cp, grp->cs.select);
+ }
+ else {
+ VECCOPY(cp, grp->cs.active);
+ }
+
+ glColor3ub(cp[0], cp[1], cp[2]);
+ }
+ else // FIXME: what happens when the indention is 1 greater than what it should be (due to grouping)?
+ UI_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
+
+ /* no rounded corners - just rectangular box */
+ glRectf(offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc);
+}
+
+/* Indention + Offset ------------------------------------------- */
+
+/* indention level is always the value in the name */
+static short acf_generic_indention_0(bAnimContext *ac, bAnimListElem *ale)
+{
+ return 0;
+}
+static short acf_generic_indention_1(bAnimContext *ac, bAnimListElem *ale)
+{
+ return 1;
+}
+#if 0 // XXX not used
+static short acf_generic_indention_2(bAnimContext *ac, bAnimListElem *ale)
+{
+ return 2;
+}
+#endif
+
+/* indention which varies with the grouping status */
+static short acf_generic_indention_flexible(bAnimContext *ac, bAnimListElem *ale)
+{
+ short indent= 0;
+
+ if (ale->id) {
+ /* special exception for materials and particles */
+ if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
+ indent++;
+ }
+
+ /* grouped F-Curves need extra level of indention */
+ if (ale->type == ANIMTYPE_FCURVE) {
+ FCurve *fcu= (FCurve *)ale->data;
+
+ // TODO: we need some way of specifying that the indention color should be one less...
+ if (fcu->grp)
+ indent++;
+ }
+
+ /* no indention */
+ return indent;
+}
+
+/* basic offset for channels derived from indention */
+static short acf_generic_basic_offset(bAnimContext *ac, bAnimListElem *ale)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+
+ if (acf && acf->get_indent_level)
+ return acf->get_indent_level(ac, ale) * INDENT_STEP_SIZE;
+ else
+ return 0;
+}
+
+/* offset for groups + grouped entities */
+static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale)
+{
+ short offset= acf_generic_basic_offset(ac, ale);
+
+ if (ale->id) {
+ /* special exception for materials and particles */
+ if (ELEM(GS(ale->id->name),ID_MA,ID_PA))
+ offset += 21;
+
+ /* if not in Action Editor mode, groupings must carry some offset too... */
+ else if (ac->datatype != ANIMCONT_ACTION)
+ offset += 14;
+ }
+
+ /* offset is just the normal type - i.e. based on indention */
+ return offset;
+}
+
+/* Name ------------------------------------------- */
+
+/* name for ID block entries */
+static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
+{
+ ID *id= (ID *)ale->data; /* data pointed to should be an ID block */
+
+ /* just copy the name... */
+ if (id && name)
+ strcpy(name, id->name+2);
+}
+
+/* Settings ------------------------------------------- */
+
+/* check if some setting exists for this object-based data-expander (category only) */
+static short acf_generic_dsexpand_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ switch (setting) {
+ /* only expand supported */
+ case ACHANNEL_SETTING_EXPAND:
+ return 1;
+
+ /* visible - only available in Graph Editor */
+ case ACHANNEL_SETTING_VISIBLE:
+ return ((ac) && (ac->spacetype == SPACE_IPO));
+
+ default:
+ return 0;
+ }
+}
+
+/* get pointer to the setting (category only) */
+static void *acf_generic_dsexpand_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Object *ob= (Object *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(ob->nlaflag); // XXX
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* check if some setting exists for this object-based data-expander (datablock only) */
+static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ switch (setting) {
+ /* expand is always supported */
+ case ACHANNEL_SETTING_EXPAND:
+ return 1;
+
+ /* mute is only supported for NLA */
+ case ACHANNEL_SETTING_MUTE:
+ return ((ac) && (ac->spacetype == SPACE_NLA));
+
+ /* other flags are never supported */
+ default:
+ return 0;
+ }
+}
+
+/* *********************************************** */
+/* Type Specific Functions + Defines */
+
+/* Scene ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_scene_icon(bAnimListElem *ale)
+{
+ return ICON_SCENE_DATA;
+}
+
+/* check if some setting exists for this channel */
+static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ switch (setting) {
+ /* muted only in NLA */
+ case ACHANNEL_SETTING_MUTE:
+ return ((ac) && (ac->spacetype == SPACE_NLA));
+
+ /* visible only in Graph Editor */
+ case ACHANNEL_SETTING_VISIBLE:
+ return ((ac) && (ac->spacetype == SPACE_IPO));
+
+ /* only select and expand supported otherwise */
+ case ACHANNEL_SETTING_SELECT:
+ case ACHANNEL_SETTING_EXPAND:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_scene_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ return SCE_DS_SELECTED;
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ *neg= 1;
+ return SCE_DS_COLLAPSED;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_scene_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Scene *scene= (Scene *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ GET_ACF_FLAG_PTR(scene->flag);
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(scene->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (scene->adt)
+ GET_ACF_FLAG_PTR(scene->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* scene type define */
+static bAnimChannelType ACF_SCENE =
+{
+ acf_generic_root_backdrop, /* backdrop */
+ acf_generic_indention_0, /* indent level */
+ NULL, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_scene_icon, /* icon */
+
+ acf_scene_setting_valid, /* has setting */
+ acf_scene_setting_flag, /* flag for setting */
+ acf_scene_setting_ptr /* pointer for setting */
+};
+
+/* Object ------------------------------------------- */
+
+static int acf_object_icon(bAnimListElem *ale)
+{
+ Base *base= (Base *)ale->data;
+ Object *ob= base->object;
+
+ /* icon depends on object-type */
+ if (ob->type == OB_ARMATURE)
+ return ICON_ARMATURE_DATA;
+ else
+ return ICON_OBJECT_DATA;
+}
+
+/* name for object */
+static void acf_object_name(bAnimListElem *ale, char *name)
+{
+ Base *base= (Base *)ale->data;
+ Object *ob= base->object;
+
+ /* just copy the name... */
+ if (ob && name)
+ strcpy(name, ob->id.name+2);
+}
+
+/* check if some setting exists for this channel */
+static short acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ switch (setting) {
+ /* muted only in NLA */
+ case ACHANNEL_SETTING_MUTE:
+ return ((ac) && (ac->spacetype == SPACE_NLA));
+
+ /* visible only in Graph Editor */
+ case ACHANNEL_SETTING_VISIBLE:
+ return ((ac) && (ac->spacetype == SPACE_IPO));
+
+ /* only select and expand supported otherwise */
+ case ACHANNEL_SETTING_SELECT:
+ case ACHANNEL_SETTING_EXPAND:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_object_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ return SELECT;
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ *neg= 1;
+ return OB_ADS_COLLAPSED;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_object_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Base *base= (Base *)ale->data;
+ Object *ob= base->object;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ GET_ACF_FLAG_PTR(ob->flag);
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(ob->nlaflag); // xxx
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (ob->adt)
+ GET_ACF_FLAG_PTR(ob->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* object type define */
+static bAnimChannelType ACF_OBJECT =
+{
+ acf_generic_root_backdrop, /* backdrop */
+ acf_generic_indention_0, /* indent level */
+ NULL, /* offset */
+
+ acf_object_name, /* name */
+ acf_object_icon, /* icon */
+
+ acf_object_setting_valid, /* has setting */
+ acf_object_setting_flag, /* flag for setting */
+ acf_object_setting_ptr /* pointer for setting */
+};
+
+/* Group ------------------------------------------- */
+
+/* backdrop for group widget */
+static void acf_group_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ View2D *v2d= &ac->ar->v2d;
+ short expanded= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0;
+ short offset= (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
+
+ /* only for action group channels */
+ if (ale->flag & AGRP_ACTIVE)
+ UI_ThemeColorShade(TH_GROUP_ACTIVE, 10);
+ else
+ UI_ThemeColorShade(TH_GROUP, 20);
+
+ /* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
+ uiSetRoundBox((expanded)? (1):(1|8));
+ gl_round_box(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
+}
+
+/* name for group entries */
+static void acf_group_name(bAnimListElem *ale, char *name)
+{
+ bActionGroup *agrp= (bActionGroup *)ale->data;
+
+ /* just copy the name... */
+ if (agrp && name)
+ strcpy(name, agrp->name);
+}
+
+/* check if some setting exists for this channel */
+static short acf_group_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ /* for now, all settings are supported, though some are only conditionally */
+ switch (setting) {
+ case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
+ return ((ac->sa) && (ac->sa->spacetype==SPACE_IPO));
+
+ default: /* always supported */
+ return 1;
+ }
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_group_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ return AGRP_SELECTED;
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return AGRP_EXPANDED;
+
+ case ACHANNEL_SETTING_MUTE: /* muted */
+ return AGRP_MUTED;
+
+ case ACHANNEL_SETTING_PROTECT: /* protected */
+ //*neg= 1; - if we change this to edtiability
+ return AGRP_PROTECTED;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
+ *neg= 1;
+ return AGRP_NOTVISIBLE;
+ }
+
+ /* this shouldn't happen */
+ return 0;
+}
+
+/* get pointer to the setting */
+static void *acf_group_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ bActionGroup *agrp= (bActionGroup *)ale->data;
+
+ /* all flags are just in agrp->flag for now... */
+ GET_ACF_FLAG_PTR(agrp->flag);
+}
+
+/* group type define */
+static bAnimChannelType ACF_GROUP =
+{
+ acf_group_backdrop, /* backdrop */
+ acf_generic_indention_0, /* indent level */
+ acf_generic_group_offset, /* offset */
+
+ acf_group_name, /* name */
+ NULL, /* icon */
+
+ acf_group_setting_valid, /* has setting */
+ acf_group_setting_flag, /* flag for setting */
+ acf_group_setting_ptr /* pointer for setting */
+};
+
+/* F-Curve ------------------------------------------- */
+
+/* name for fcurve entries */
+static void acf_fcurve_name(bAnimListElem *ale, char *name)
+{
+ getname_anim_fcurve(name, ale->id, ale->data);
+}
+
+/* check if some setting exists for this channel */
+static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ FCurve *fcu= (FCurve *)ale->data;
+
+ switch (setting) {
+ /* unsupported */
+ case ACHANNEL_SETTING_EXPAND: /* F-Curves are not containers */
+ return 0;
+
+ /* conditionally available */
+ case ACHANNEL_SETTING_PROTECT: /* Protection is only valid when there's keyframes */
+ if (fcu->bezt)
+ return 1;
+ else
+ return 0; // NOTE: in this special case, we need to draw ICON_ZOOMOUT
+
+ case ACHANNEL_SETTING_VISIBLE: /* Only available in Graph Editor */
+ return ((ac->sa) && (ac->sa->spacetype==SPACE_IPO));
+
+ /* always available */
+ default:
+ return 1;
+ }
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_fcurve_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ return FCURVE_SELECTED;
+
+ case ACHANNEL_SETTING_MUTE: /* muted */
+ return FCURVE_MUTED;
+
+ case ACHANNEL_SETTING_PROTECT: /* protected */
+ //*neg= 1; - if we change this to edtiability
+ return FCURVE_PROTECTED;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
+ return FCURVE_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_fcurve_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ FCurve *fcu= (FCurve *)ale->data;
+
+ /* all flags are just in agrp->flag for now... */
+ GET_ACF_FLAG_PTR(fcu->flag);
+}
+
+/* fcurve type define */
+static bAnimChannelType ACF_FCURVE =
+{
+ acf_generic_channel_backdrop, /* backdrop */
+ acf_generic_indention_flexible, /* indent level */ // xxx rename this to f-curves only?
+ acf_generic_group_offset, /* offset */
+
+ acf_fcurve_name, /* name */
+ NULL, /* icon */
+
+ acf_fcurve_setting_valid, /* has setting */
+ acf_fcurve_setting_flag, /* flag for setting */
+ acf_fcurve_setting_ptr /* pointer for setting */
+};
+
+/* Object Action Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_fillactd_icon(bAnimListElem *ale)
+{
+ return ICON_ACTION;
+}
+
+/* check if some setting exists for this channel */
+static short acf_fillactd_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ switch (setting) {
+ /* only select and expand supported */
+ case ACHANNEL_SETTING_SELECT:
+ case ACHANNEL_SETTING_EXPAND:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_fillactd_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ return ACT_SELECTED;
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ *neg= 1;
+ return ACT_COLLAPSED;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_fillactd_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ bAction *act= (bAction *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_SELECT: /* selected */
+ GET_ACF_FLAG_PTR(act->flag);
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(act->flag);
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* object action expander type define */
+static bAnimChannelType ACF_FILLACTD =
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_fillactd_icon, /* icon */
+
+ acf_fillactd_setting_valid, /* has setting */
+ acf_fillactd_setting_flag, /* flag for setting */
+ acf_fillactd_setting_ptr /* pointer for setting */
+};
+
+/* Drivers Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_filldrivers_icon(bAnimListElem *ale)
+{
+ return ICON_ANIM_DATA;
+}
+
+static void acf_filldrivers_name(bAnimListElem *ale, char *name)
+{
+ strcpy(name, "Drivers");
+}
+
+/* check if some setting exists for this channel */
+// TODO: this could be made more generic
+static short acf_filldrivers_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ switch (setting) {
+ /* only expand supported */
+ case ACHANNEL_SETTING_EXPAND:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_filldrivers_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ *neg= 1;
+ return ADT_DRIVERS_COLLAPSED;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_filldrivers_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ AnimData *adt= (AnimData *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(adt->flag);
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* drivers expander type define */
+static bAnimChannelType ACF_FILLDRIVERS =
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_filldrivers_name, /* name */
+ acf_filldrivers_icon, /* icon */
+
+ acf_filldrivers_setting_valid, /* has setting */
+ acf_filldrivers_setting_flag, /* flag for setting */
+ acf_filldrivers_setting_ptr /* pointer for setting */
+};
+
+/* Materials Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_fillmatd_icon(bAnimListElem *ale)
+{
+ return ICON_MATERIAL_DATA;
+}
+
+static void acf_fillmatd_name(bAnimListElem *ale, char *name)
+{
+ strcpy(name, "Materials");
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_fillmatd_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ *neg= 1;
+ return OB_ADS_SHOWMATS;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* materials expander type define */
+static bAnimChannelType ACF_FILLMATD=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_fillmatd_name, /* name */
+ acf_fillmatd_icon, /* icon */
+
+ acf_generic_dsexpand_setting_valid, /* has setting */
+ acf_fillmatd_setting_flag, /* flag for setting */
+ acf_generic_dsexpand_setting_ptr /* pointer for setting */
+};
+
+/* Particles Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_fillpartd_icon(bAnimListElem *ale)
+{
+ return ICON_PARTICLE_DATA;
+}
+
+static void acf_fillpartd_name(bAnimListElem *ale, char *name)
+{
+ strcpy(name, "Particles");
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_fillpartd_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ *neg= 1;
+ return OB_ADS_SHOWPARTS;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* particles expander type define */
+static bAnimChannelType ACF_FILLPARTD=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_fillpartd_name, /* name */
+ acf_fillpartd_icon, /* icon */
+
+ acf_generic_dsexpand_setting_valid, /* has setting */
+ acf_fillpartd_setting_flag, /* flag for setting */
+ acf_generic_dsexpand_setting_ptr /* pointer for setting */
+};
+
+/* Material Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dsmat_icon(bAnimListElem *ale)
+{
+ return ICON_MATERIAL_DATA;
+}
+
+/* offset for material expanders */
+static short acf_dsmat_offset(bAnimContext *ac, bAnimListElem *ale)
+{
+ return 21;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dsmat_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return MA_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dsmat_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Material *ma= (Material *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(ma->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (ma->adt)
+ GET_ACF_FLAG_PTR(ma->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* material expander type define */
+static bAnimChannelType ACF_DSMAT=
+{
+ acf_generic_channel_backdrop, /* backdrop */
+ acf_generic_indention_0, /* indent level */
+ acf_dsmat_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dsmat_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dsmat_setting_flag, /* flag for setting */
+ acf_dsmat_setting_ptr /* pointer for setting */
+};
+
+/* Lamp Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dslam_icon(bAnimListElem *ale)
+{
+ return ICON_LAMP_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dslam_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return LA_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dslam_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Lamp *la= (Lamp *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(la->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (la->adt)
+ GET_ACF_FLAG_PTR(la->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* lamp expander type define */
+static bAnimChannelType ACF_DSLAM=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dslam_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dslam_setting_flag, /* flag for setting */
+ acf_dslam_setting_ptr /* pointer for setting */
+};
+
+/* Camera Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dscam_icon(bAnimListElem *ale)
+{
+ return ICON_CAMERA_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dscam_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return CAM_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dscam_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Camera *ca= (Camera *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(ca->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (ca->adt)
+ GET_ACF_FLAG_PTR(ca->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* camera expander type define */
+static bAnimChannelType ACF_DSCAM=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dscam_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dscam_setting_flag, /* flag for setting */
+ acf_dscam_setting_ptr /* pointer for setting */
+};
+
+/* Curve Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dscur_icon(bAnimListElem *ale)
+{
+ return ICON_CURVE_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dscur_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return CU_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dscur_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Curve *cu= (Curve *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(cu->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (cu->adt)
+ GET_ACF_FLAG_PTR(cu->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* curve expander type define */
+static bAnimChannelType ACF_DSCUR=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dscur_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dscur_setting_flag, /* flag for setting */
+ acf_dscur_setting_ptr /* pointer for setting */
+};
+
+/* Shape Key Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dsskey_icon(bAnimListElem *ale)
+{
+ return ICON_SHAPEKEY_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dsskey_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return KEYBLOCK_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dsskey_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ Key *key= (Key *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(key->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (key->adt)
+ GET_ACF_FLAG_PTR(key->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* shapekey expander type define */
+static bAnimChannelType ACF_DSSKEY=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dsskey_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dsskey_setting_flag, /* flag for setting */
+ acf_dsskey_setting_ptr /* pointer for setting */
+};
+
+/* World Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dswor_icon(bAnimListElem *ale)
+{
+ return ICON_WORLD_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dswor_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return WO_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dswor_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ World *wo= (World *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(wo->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (wo->adt)
+ GET_ACF_FLAG_PTR(wo->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* world expander type define */
+static bAnimChannelType ACF_DSWOR=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dswor_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dswor_setting_flag, /* flag for setting */
+ acf_dswor_setting_ptr /* pointer for setting */
+};
+
+/* Particle Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dspart_icon(bAnimListElem *ale)
+{
+ return ICON_PARTICLE_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dspart_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return PART_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dspart_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ ParticleSettings *part= (ParticleSettings *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(part->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (part->adt)
+ GET_ACF_FLAG_PTR(part->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* particle expander type define */
+static bAnimChannelType ACF_DSPART=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dspart_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dspart_setting_flag, /* flag for setting */
+ acf_dspart_setting_ptr /* pointer for setting */
+};
+
+/* MetaBall Expander ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dsmball_icon(bAnimListElem *ale)
+{
+ return ICON_META_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid */
+static int acf_dsmball_setting_flag(int setting, short *neg)
+{
+ /* clear extra return data first */
+ *neg= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ return MB_DS_EXPAND;
+
+ case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+ return ADT_NLA_EVAL_OFF;
+
+ case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+ *neg= 1;
+ return ADT_CURVES_NOT_VISIBLE;
+
+ default: /* unsupported */
+ return 0;
+ }
+}
+
+/* get pointer to the setting */
+static void *acf_dsmball_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+ MetaBall *mb= (MetaBall *)ale->data;
+
+ /* clear extra return data first */
+ *type= 0;
+
+ switch (setting) {
+ case ACHANNEL_SETTING_EXPAND: /* expanded */
+ GET_ACF_FLAG_PTR(mb->flag);
+
+ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+ if (mb->adt)
+ GET_ACF_FLAG_PTR(mb->adt->flag)
+ else
+ return NULL;
+
+ default: /* unsupported */
+ return NULL;
+ }
+}
+
+/* metaball expander type define */
+static bAnimChannelType ACF_DSMBALL=
+{
+ acf_generic_dataexpand_backdrop,/* backdrop */
+ acf_generic_indention_1, /* indent level */
+ acf_generic_basic_offset, /* offset */
+
+ acf_generic_idblock_name, /* name */
+ acf_dsmball_icon, /* icon */
+
+ acf_generic_dataexpand_setting_valid, /* has setting */
+ acf_dsmball_setting_flag, /* flag for setting */
+ acf_dsmball_setting_ptr /* pointer for setting */
+};
+
+/* ShapeKey Entry ------------------------------------------- */
+// XXX ... this is currently obsolete...
+
+#if 0
+static void dummy_olddraw_shapekeys ()
+{
+ case ANIMTYPE_SHAPEKEY: /* shapekey channel */
+ {
+ KeyBlock *kb = (KeyBlock *)ale->data;
+
+ indent = 0;
+ special = -1;
+
+ offset= (ale->id) ? 21 : 0;
+
+ if (kb->name[0] == '\0')
+ sprintf(name, "Key %d", ale->index);
+ else
+ strcpy(name, kb->name);
+ }
+ break;
+}
+#endif
+
+/* Grease Pencil entries ------------------------------------------- */
+// XXX ... this is currently not restored yet
+
+#if 0
+static void dummy_olddraw_gpencil ()
+{
+ /* determine what needs to be drawn */
+ switch (ale->type) {
+ case ANIMTYPE_GPDATABLOCK: /* gpencil datablock */
+ {
+ bGPdata *gpd = (bGPdata *)ale->data;
+ ScrArea *sa = (ScrArea *)ale->owner;
+
+ indent = 0;
+ group= 3;
+
+ /* only show expand if there are any channels */
+ if (gpd->layers.first) {
+ if (gpd->flag & GP_DATA_EXPAND)
+ expand = ICON_TRIA_DOWN;
+ else
+ expand = ICON_TRIA_RIGHT;
+ }
+
+ switch (sa->spacetype) {
+ case SPACE_VIEW3D:
+ {
+ /* this shouldn't cause any overflow... */
+ //sprintf(name, "3DView:%s", view3d_get_name(sa->spacedata.first)); // XXX missing func..
+ strcpy(name, "3dView");
+ special= ICON_VIEW3D;
+ }
+ break;
+ case SPACE_NODE:
+ {
+ SpaceNode *snode= sa->spacedata.first;
+ char treetype[12];
+
+ if (snode->treetype == 1)
+ strcpy(treetype, "Composite");
+ else
+ strcpy(treetype, "Material");
+ sprintf(name, "Nodes:%s", treetype);
+
+ special= ICON_NODE;
+ }
+ break;
+ case SPACE_SEQ:
+ {
+ SpaceSeq *sseq= sa->spacedata.first;
+ char imgpreview[10];
+
+ switch (sseq->mainb) {
+ case 1: sprintf(imgpreview, "Image..."); break;
+ case 2: sprintf(imgpreview, "Luma..."); break;
+ case 3: sprintf(imgpreview, "Chroma..."); break;
+ case 4: sprintf(imgpreview, "Histogram"); break;
+
+ default: sprintf(imgpreview, "Sequence"); break;
+ }
+ sprintf(name, "Sequencer:%s", imgpreview);
+
+ special= ICON_SEQUENCE;
+ }
+ break;
+ case SPACE_IMAGE:
+ {
+ SpaceImage *sima= sa->spacedata.first;
+
+ if (sima->image)
+ sprintf(name, "Image:%s", sima->image->id.name+2);
+ else
+ strcpy(name, "Image:<None>");
+
+ special= ICON_IMAGE_COL;
+ }
+ break;
+
+ default:
+ {
+ sprintf(name, "<Unknown GP-Data Source>");
+ special= -1;
+ }
+ break;
+ }
+ }
+ break;
+ case ANIMTYPE_GPLAYER: /* gpencil layer */
+ {
+ bGPDlayer *gpl = (bGPDlayer *)ale->data;
+
+ indent = 0;
+ special = -1;
+ expand = -1;
+ group = 1;
+
+ if (EDITABLE_GPL(gpl))
+ protect = ICON_UNLOCKED;
+ else
+ protect = ICON_LOCKED;
+
+ if (gpl->flag & GP_LAYER_HIDE)
+ mute = ICON_MUTE_IPO_ON;
+ else
+ mute = ICON_MUTE_IPO_OFF;
+
+ sel = SEL_GPL(gpl);
+ BLI_snprintf(name, 32, gpl->info);
+ }
+ break;
+ }
+
+ if (group == 3) {
+ /* only for gp-data channels */
+ UI_ThemeColorShade(TH_GROUP, 20);
+ uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
+ gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
+ }
+}
+#endif
+
+/* *********************************************** */
+/* Type Registration and General Access */
+
+/* These globals only ever get directly accessed in this file */
+static bAnimChannelType *animchannelTypeInfo[ANIMTYPE_NUM_TYPES];
+static short ACF_INIT= 1; /* when non-zero, the list needs to be updated */
+
+/* Initialise type info definitions */
+void ANIM_init_channel_typeinfo_data (void)
+{
+ int type= 0;
+
+ /* start initialising if necessary... */
+ if (ACF_INIT) {
+ ACF_INIT= 0;
+
+ animchannelTypeInfo[type++]= NULL; /* None */
+ animchannelTypeInfo[type++]= NULL; /* AnimData */
+ animchannelTypeInfo[type++]= NULL; /* Special */
+
+ animchannelTypeInfo[type++]= &ACF_SCENE; /* Scene */
+ animchannelTypeInfo[type++]= &ACF_OBJECT; /* Object */
+ animchannelTypeInfo[type++]= &ACF_GROUP; /* Group */
+ animchannelTypeInfo[type++]= &ACF_FCURVE; /* F-Curve */
+
+ animchannelTypeInfo[type++]= &ACF_FILLACTD; /* Object Action Expander */
+ animchannelTypeInfo[type++]= &ACF_FILLDRIVERS; /* Drivers Expander */
+ animchannelTypeInfo[type++]= &ACF_FILLMATD; /* Materials Expander */
+ animchannelTypeInfo[type++]= &ACF_FILLPARTD; /* Particles Expander */
+
+ animchannelTypeInfo[type++]= &ACF_DSMAT; /* Material Channel */
+ animchannelTypeInfo[type++]= &ACF_DSLAM; /* Lamp Channel */
+ animchannelTypeInfo[type++]= &ACF_DSCAM; /* Camera Channel */
+ animchannelTypeInfo[type++]= &ACF_DSCUR; /* Curve Channel */
+ animchannelTypeInfo[type++]= &ACF_DSSKEY; /* ShapeKey Channel */
+ animchannelTypeInfo[type++]= &ACF_DSWOR; /* World Channel */
+ animchannelTypeInfo[type++]= &ACF_DSPART; /* Particle Channel */
+ animchannelTypeInfo[type++]= &ACF_DSMBALL; /* MetaBall Channel */
+
+ animchannelTypeInfo[type++]= NULL; /* ShapeKey */ // XXX this is no longer used for now...
+
+ // XXX not restored yet
+ animchannelTypeInfo[type++]= NULL; /* Grease Pencil Datablock */
+ animchannelTypeInfo[type++]= NULL; /* Grease Pencil Layer */
+
+ // TODO: these types still need to be implemented!!!
+ // probably need a few extra flags for these special cases...
+ animchannelTypeInfo[type++]= NULL; /* NLA Track */
+ animchannelTypeInfo[type++]= NULL; /* NLA Action */
+ }
+}
+
+/* Get type info from given channel type */
+bAnimChannelType *ANIM_channel_get_typeinfo (bAnimListElem *ale)
+{
+ /* santiy checks */
+ if (ale == NULL)
+ return NULL;
+
+ /* init the typeinfo if not available yet... */
+ ANIM_init_channel_typeinfo_data();
+
+ /* check if type is in bounds... */
+ if ((ale->type >= 0) && (ale->type < ANIMTYPE_NUM_TYPES))
+ return animchannelTypeInfo[ale->type];
+ else
+ return NULL;
+}
+
+/* --------------------------- */
+
+/* Check if some setting for a channel is enabled
+ * Returns: 1 = On, 0 = Off, -1 = Invalid
+ */
+short ANIM_channel_setting_get (bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+
+ /* 1) check that the setting exists for the current context */
+ if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
+ {
+ /* 2) get pointer to check for flag in, and the flag to check for */
+ short negflag, ptrsize;
+ int flag;
+ void *ptr;
+
+ flag= acf->setting_flag(setting, &negflag);
+ ptr= acf->setting_ptr(ale, setting, &ptrsize);
+
+ /* check if flag is enabled */
+ if (ptr && flag) {
+ switch (ptrsize) {
+ case sizeof(int): /* integer pointer for setting */
+ {
+ int *val= (int *)ptr;
+
+ if (negflag)
+ return ((*val) & flag) == 0;
+ else
+ return ((*val) & flag) != 0;
+ }
+ break;
+
+ case sizeof(short): /* short pointer for setting */
+ {
+ short *val= (short *)ptr;
+
+ if (negflag)
+ return ((*val) & flag) == 0;
+ else
+ return ((*val) & flag) != 0;
+ }
+ break;
+
+ case sizeof(char): /* char pointer for setting */
+ {
+ char *val= (char *)ptr;
+
+ if (negflag)
+ return ((*val) & flag) == 0;
+ else
+ return ((*val) & flag) != 0;
+ }
+ break;
+ }
+ }
+ }
+
+ /* not found... */
+ return -1;
+}
+
+
+/* quick macro for use in ANIM_channel_setting_set - set flag for setting according the mode given */
+#define ACF_SETTING_SET(sval, sflag, smode) \
+ {\
+ if (negflag) {\
+ if (smode == ACHANNEL_SETFLAG_TOGGLE) (sval) ^= (sflag); \
+ else if (smode == ACHANNEL_SETFLAG_ADD) (sval) &= ~(sflag); \
+ else (sval) |= (sflag); \
+ } \
+ else {\
+ if (smode == ACHANNEL_SETFLAG_TOGGLE) (sval) ^= (sflag); \
+ else if (smode == ACHANNEL_SETFLAG_ADD) (sval) |= (sflag); \
+ else (sval) &= ~(sflag); \
+ }\
+ }
+
+/* Change value of some setting for a channel
+ * - setting: eAnimChannel_Settings
+ * - mode: eAnimChannels_SetFlag
+ */
+void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting, short mode)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+
+ /* 1) check that the setting exists for the current context */
+ if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) )
+ {
+ /* 2) get pointer to check for flag in, and the flag to check for */
+ short negflag, ptrsize;
+ int flag;
+ void *ptr;
+
+ flag= acf->setting_flag(setting, &negflag);
+ ptr= acf->setting_ptr(ale, setting, &ptrsize);
+
+ /* check if flag is enabled */
+ if (ptr && flag) {
+ switch (ptrsize) {
+ case sizeof(int): /* integer pointer for setting */
+ {
+ int *val= (int *)ptr;
+ ACF_SETTING_SET(*val, flag, mode);
+ }
+ break;
+
+ case sizeof(short): /* short pointer for setting */
+ {
+ short *val= (short *)ptr;
+ ACF_SETTING_SET(*val, flag, mode);
+ }
+ break;
+
+ case sizeof(char): /* char pointer for setting */
+ {
+ char *val= (char *)ptr;
+ ACF_SETTING_SET(*val, flag, mode);
+ }
+ break;
+ }
+ }
+ }
+}
+
+/* --------------------------- */
+
+// XXX hardcoded size of icons
+#define ICON_WIDTH 17
+// XXX hardcoded width of sliders
+#define SLIDER_WIDTH 70
+
+/* Draw the given channel */
+// TODO: make this use UI controls for the buttons
+void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ short selected, offset;
+ float y, ymid, ytext;
+
+ /* sanity checks - don't draw anything */
+ if ELEM(NULL, acf, ale)
+ return;
+
+ /* get initial offset */
+ if (acf->get_offset)
+ offset= acf->get_offset(ac, ale);
+ else
+ offset= 0;
+
+ /* calculate appropriate y-coordinates for icon buttons
+ * 7 is hardcoded factor for half-height of icons
+ */
+ y= (ymaxc - yminc)/2 + yminc;
+ ymid= y - 7;
+ /* y-coordinates for text is only 4 down from middle */
+ ytext= y - 4;
+
+ /* check if channel is selected */
+ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
+ selected= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
+ else
+ selected= 0;
+
+ /* set blending again, as may not be set in previous step */
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+
+ /* step 1) draw backdrop ........................................... */
+ if (acf->draw_backdrop)
+ acf->draw_backdrop(ac, ale, yminc, ymaxc);
+
+ /* step 2) draw expand widget ....................................... */
+ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_EXPAND)) {
+ /* just skip - drawn as widget now */
+ offset += ICON_WIDTH;
+ }
+
+ /* step 3) draw icon ............................................... */
+ if (acf->icon) {
+ UI_icon_draw(offset, ymid, acf->icon(ale));
+ offset += ICON_WIDTH;
+ }
+
+ /* step 4) draw special toggles .................................
+ * - in Graph Editor, checkboxes for visibility in curves area
+ * - in NLA Editor, glowing dots for solo/not solo...
+ */
+ if (ac->sa) {
+ if ((ac->spacetype == SPACE_IPO) && acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
+ /* for F-Curves, draw color-preview of curve behind checkbox */
+ if (ale->type == ANIMTYPE_FCURVE) {
+ FCurve *fcu= (FCurve *)ale->data;
+
+ /* F-Curve channels need to have a special 'color code' box drawn, which is colored with whatever
+ * color the curve has stored
+ */
+ glColor3fv(fcu->color);
+
+ /* just a solid color rect
+ * hardcoded 17 pixels width is slightly wider than icon width, so that
+ * there's a slight border around it
+ */
+ glRectf(offset, yminc, offset+17, ymaxc);
+ }
+
+ /* icon is drawn as widget now... */
+ offset += ICON_WIDTH;
+ }
+ else if ((ac->spacetype == SPACE_NLA) && acf->has_setting(ac, ale, ACHANNEL_SETTING_SOLO)) {
+ /* just skip - drawn as widget now */
+ offset += ICON_WIDTH;
+ }
+ }
+
+ /* step 5) draw name ............................................... */
+ if (acf->name) {
+ char name[256]; /* hopefully this will be enough! */
+
+ /* set text color */
+ if (selected)
+ UI_ThemeColor(TH_TEXT_HI);
+ else
+ UI_ThemeColor(TH_TEXT);
+
+ /* get name */
+ acf->name(ale, name);
+
+ offset += 3;
+ UI_DrawString(offset, ytext, name);
+ }
+}
+
+/* ------------------ */
+
+/* callback for widget settings - send notifiers */
+static void achannel_setting_widget_cb(bContext *C, void *poin, void *poin2)
+{
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+}
+
+/* callback for widget sliders - insert keyframes */
+static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin)
+{
+ ID *id= (ID *)id_poin;
+ FCurve *fcu= (FCurve *)fcu_poin;
+
+ Scene *scene= CTX_data_scene(C);
+ PointerRNA id_ptr, ptr;
+ PropertyRNA *prop;
+ short flag=0, done=0;
+ float cfra;
+
+ /* get current frame */
+ // NOTE: this will do for now...
+ cfra= (float)CFRA;
+
+ /* get flags for keyframing */
+ if (IS_AUTOKEY_FLAG(INSERTNEEDED))
+ flag |= INSERTKEY_NEEDED;
+ if (IS_AUTOKEY_FLAG(AUTOMATKEY))
+ flag |= INSERTKEY_MATRIX;
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS))
+ flag |= INSERTKEY_REPLACE;
+
+
+ /* get RNA pointer, and resolve the path */
+ RNA_id_pointer_create(id, &id_ptr);
+
+ /* try to resolve the path stored in the F-Curve */
+ if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
+ /* set the special 'replace' flag if on a keyframe */
+ if (fcurve_frame_has_keyframe(fcu, cfra, 0))
+ flag |= INSERTKEY_REPLACE;
+
+ /* insert a keyframe for this F-Curve */
+ done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag);
+
+ if (done)
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ }
+}
+
+
+
+/* Draw a widget for some setting */
+static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChannelType *acf, uiBlock *block, int xpos, int ypos, int setting)
+{
+ short negflag, ptrsize, enabled, butType;
+ int flag, icon;
+ void *ptr;
+ char *tooltip;
+ uiBut *but = NULL;
+
+ /* get the flag and the pointer to that flag */
+ flag= acf->setting_flag(setting, &negflag);
+ ptr= acf->setting_ptr(ale, setting, &ptrsize);
+ enabled= ANIM_channel_setting_get(ac, ale, setting);
+
+ /* get the base icon for the setting */
+ switch (setting) {
+ case ACHANNEL_SETTING_VISIBLE: /* visibility checkboxes */
+ //icon= ((enabled)? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT);
+ icon= ICON_CHECKBOX_DEHLT;
+
+ if (ale->type == ANIMTYPE_FCURVE)
+ tooltip= "F-Curve is visible in Graph Editor for editing.";
+ else
+ tooltip= "F-Curve(s) are visible in Graph Editor for editing.";
+ break;
+
+ case ACHANNEL_SETTING_EXPAND: /* expanded triangle */
+ //icon= ((enabled)? ICON_TRIA_DOWN : ICON_TRIA_RIGHT);
+ icon= ICON_TRIA_RIGHT;
+ tooltip= "Make channels grouped under this channel visible.";
+ break;
+
+ case ACHANNEL_SETTING_SOLO: /* NLA Tracks only */
+ //icon= ((enabled)? ICON_LAYER_ACTIVE : ICON_LAYER_USED);
+ icon= ICON_LAYER_USED;
+ tooltip= "NLA Track is the only one evaluated for the AnimData block it belongs to.";
+ break;
+
+ /* --- */
+
+ case ACHANNEL_SETTING_PROTECT: /* protected lock */
+ // TODO: what about when there's no protect needed?
+ //icon= ((enabled)? ICON_LOCKED : ICON_UNLOCKED);
+ icon= ICON_UNLOCKED;
+ tooltip= "Editability of keyframes for this channel.";
+ break;
+
+ case ACHANNEL_SETTING_MUTE: /* muted eye */
+ //icon= ((enabled)? ICON_MUTE_IPO_ON : ICON_MUTE_IPO_OFF);
+ icon= ICON_MUTE_IPO_OFF;
+
+ if (ale->type == ALE_FCURVE)
+ tooltip= "Does F-Curve contribute to result.";
+ else
+ tooltip= "Do channels contribute to result.";
+ break;
+
+ default:
+ tooltip= NULL;
+ icon= 0;
+ break;
+ }
+
+ /* type of button */
+ if (negflag)
+ butType= ICONTOGN;
+ else
+ butType= ICONTOG;
+
+ /* draw button for setting */
+ if (ptr && flag) {
+ switch (ptrsize) {
+ case sizeof(int): /* integer pointer for setting */
+ but= uiDefIconButBitI(block, butType, flag, 0, icon,
+ xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
+ break;
+
+ case sizeof(short): /* short pointer for setting */
+ but= uiDefIconButBitS(block, butType, flag, 0, icon,
+ xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
+ break;
+
+ case sizeof(char): /* char pointer for setting */
+ but= uiDefIconButBitC(block, butType, flag, 0, icon,
+ xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip);
+ break;
+ }
+
+ /* set call to send relevant notifiers */
+ // NOTE: for now, we only need to send 'edited'
+ if (but)
+ uiButSetFunc(but, achannel_setting_widget_cb, NULL, NULL);
+ }
+}
+
+/* Draw UI widgets the given channel */
+// TODO: make this use UI controls for the buttons
+void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *block, float yminc, float ymaxc)
+{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+ View2D *v2d= &ac->ar->v2d;
+ float y, ymid, ytext;
+ short offset;
+
+ /* sanity checks - don't draw anything */
+ if ELEM3(NULL, acf, ale, block)
+ return;
+
+ /* get initial offset */
+ if (acf->get_offset)
+ offset= acf->get_offset(ac, ale);
+ else
+ offset= 0;
+
+ /* calculate appropriate y-coordinates for icon buttons
+ * 7 is hardcoded factor for half-height of icons
+ */
+ y= (ymaxc - yminc)/2 + yminc;
+ ymid= y - 7;
+ /* y-coordinates for text is only 4 down from middle */
+ ytext= y - 4;
+
+ /* no button backdrop behind icons */
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+
+ /* step 1) draw expand widget ....................................... */
+ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_EXPAND)) {
+ draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_EXPAND);
+ offset += ICON_WIDTH;
+ }
+
+ /* step 2) draw icon ............................................... */
+ if (acf->icon) {
+ /* icon is not drawn here (not a widget) */
+ offset += ICON_WIDTH;
+ }
+
+ /* step 3) draw special toggles .................................
+ * - in Graph Editor, checkboxes for visibility in curves area
+ * - in NLA Editor, glowing dots for solo/not solo...
+ */
+ if (ac->sa) {
+ if ((ac->spacetype == SPACE_IPO) && acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
+ /* visibility toggle */
+ draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_VISIBLE);
+ offset += ICON_WIDTH;
+ }
+ else if ((ac->spacetype == SPACE_NLA) && acf->has_setting(ac, ale, ACHANNEL_SETTING_SOLO)) {
+ /* 'solo' setting for NLA Tracks */
+ draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_SOLO);
+ offset += ICON_WIDTH;
+ }
+ }
+
+ /* step 4) draw text... */
+ /* NOTE: this is not done here, since nothing to be clicked on... */
+
+ /* step 5) draw mute+protection toggles + (sliders) ....................... */
+ /* reset offset - now goes from RHS of panel */
+ offset = 0;
+
+ // TODO: when drawing sliders, make those draw instead of these toggles if not enough space
+
+ if (v2d) {
+ short draw_sliders = 0;
+
+ /* check if we need to show the sliders */
+ if ((ac->sa) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_IPO)) {
+ switch (ac->spacetype) {
+ case SPACE_ACTION:
+ {
+ SpaceAction *saction= (SpaceAction *)ac->sa->spacedata.first;
+ draw_sliders= (saction->flag & SACTION_SLIDERS);
+ }
+ break;
+ case SPACE_IPO:
+ {
+ SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first;
+ draw_sliders= (sipo->flag & SIPO_SLIDERS);
+ }
+ break;
+ }
+ }
+
+ /* check if there's enough space for the toggles if the sliders are drawn too */
+ if ( !(draw_sliders) || ((v2d->mask.xmax-v2d->mask.xmin) > ACHANNEL_BUTTON_WIDTH/2) ) {
+ /* protect... */
+ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) {
+ offset += ICON_WIDTH;
+ draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_PROTECT);
+ }
+ /* mute... */
+ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) {
+ offset += ICON_WIDTH;
+ draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_MUTE);
+ }
+ }
+
+ /* draw slider
+ * - even if we can draw sliders for this view, we must also check that the channel-type supports them
+ * (only only F-Curves really can support them for now)
+ * - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately,
+ * whereever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment,
+ * and wouldn't be able to auto-keyframe...
+ * - slider should start before the toggles (if they're visible) to keep a clean line down the side
+ */
+ if ((draw_sliders) && (ale->type == ANIMTYPE_FCURVE)) {
+ /* adjust offset */
+ offset += SLIDER_WIDTH;
+
+ /* need backdrop behind sliders... */
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ if (ale->id) { /* Slider using RNA Access -------------------- */
+ FCurve *fcu= (FCurve *)ale->data;
+ PointerRNA id_ptr, ptr;
+ PropertyRNA *prop;
+
+ /* get RNA pointer, and resolve the path */
+ RNA_id_pointer_create(ale->id, &id_ptr);
+
+ /* try to resolve the path */
+ if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
+ uiBut *but;
+
+ /* create the slider button, and assign relevant callback to ensure keyframes are inserted... */
+ but= uiDefAutoButR(block, &ptr, prop, fcu->array_index, "", 0, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc);
+ uiButSetFunc(but, achannel_setting_slider_cb, ale->id, fcu);
+ }
+ }
+ else { /* Special Slider for stuff without RNA Access ---------- */
+ // TODO: only implement this case when we really need it...
+ }
+ }
+ }
+}
+
+/* *********************************************** */
diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels_edit.c
index f518b5b0a2e..72d8f71bc26 100644
--- a/source/blender/editors/animation/anim_channels.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -17,11 +17,9 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
* Contributor(s): Joshua Leung
*
* ***** END GPL LICENSE BLOCK *****
@@ -56,6 +54,7 @@
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
+#include "DNA_meta_types.h"
#include "DNA_userdef_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
@@ -883,14 +882,6 @@ void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
/* ********************** Set Flags Operator *********************** */
-enum {
-// ACHANNEL_SETTING_SELECT = 0,
- ACHANNEL_SETTING_PROTECT = 1,
- ACHANNEL_SETTING_MUTE,
- ACHANNEL_SETTING_VISIBLE,
- ACHANNEL_SETTING_EXPAND,
-} eAnimChannel_Settings;
-
/* defines for setting animation-channel flags */
EnumPropertyItem prop_animchannel_setflag_types[] = {
{ACHANNEL_SETFLAG_CLEAR, "DISABLE", 0, "Disable", ""},
@@ -900,6 +891,7 @@ EnumPropertyItem prop_animchannel_setflag_types[] = {
};
/* defines for set animation-channel settings */
+// TODO: could add some more types, but those are really quite dependent on the mode...
EnumPropertyItem prop_animchannel_settings_types[] = {
{ACHANNEL_SETTING_PROTECT, "PROTECT", 0, "Protect", ""},
{ACHANNEL_SETTING_MUTE, "MUTE", 0, "Mute", ""},
@@ -931,202 +923,8 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
/* affect selected channels */
for (ale= anim_data.first; ale; ale= ale->next) {
- switch (ale->type) {
- case ANIMTYPE_OBJECT:
- {
- Base *base= (Base *)ale->data;
- Object *ob= base->object;
-
- if (setting == ACHANNEL_SETTING_EXPAND) {
- // XXX - settings should really be moved out of ob->nlaflag
- if (mode == ACHANNEL_SETFLAG_TOGGLE) ob->nlaflag ^= OB_ADS_COLLAPSED;
- else if (mode == ACHANNEL_SETFLAG_ADD) ob->nlaflag &= ~OB_ADS_COLLAPSED;
- else ob->nlaflag |= OB_ADS_COLLAPSED;
- }
- }
- break;
-
- case ANIMTYPE_FILLACTD:
- {
- bAction *act= (bAction *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG_NEG(act, mode, ACT_COLLAPSED);
- }
- }
- }
- break;
- case ANIMTYPE_FILLDRIVERS:
- {
- AnimData *adt= (AnimData *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG_NEG(adt, mode, ADT_DRIVERS_COLLAPSED);
- }
- }
- }
- break;
- case ANIMTYPE_FILLMATD:
- {
- Object *ob= (Object *)ale->data;
-
- // XXX - settings should really be moved out of ob->nlaflag
- if ((onlysel == 0) || (ob->flag & SELECT)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- if (mode == ACHANNEL_SETFLAG_TOGGLE) ob->nlaflag ^= OB_ADS_SHOWMATS;
- else if (mode == ACHANNEL_SETFLAG_ADD) ob->nlaflag |= OB_ADS_SHOWMATS;
- else ob->nlaflag &= ~OB_ADS_SHOWMATS;
- }
- }
- }
- break;
- case ANIMTYPE_FILLPARTD:
- {
- Object *ob= (Object *)ale->data;
-
- // XXX - settings should really be moved out of ob->nlaflag
- if ((onlysel == 0) || (ob->flag & SELECT)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- if (mode == ACHANNEL_SETFLAG_TOGGLE) ob->nlaflag ^= OB_ADS_SHOWPARTS;
- else if (mode == ACHANNEL_SETFLAG_ADD) ob->nlaflag |= OB_ADS_SHOWPARTS;
- else ob->nlaflag &= ~OB_ADS_SHOWPARTS;
- }
- }
- }
- break;
-
- case ANIMTYPE_DSMAT:
- {
- Material *ma= (Material *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG(ma, mode, MA_DS_EXPAND);
- }
- }
- }
- break;
- case ANIMTYPE_DSLAM:
- {
- Lamp *la= (Lamp *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG(la, mode, LA_DS_EXPAND);
- }
- }
- }
- break;
- case ANIMTYPE_DSCAM:
- {
- Camera *ca= (Camera *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG(ca, mode, CAM_DS_EXPAND);
- }
- }
- }
- break;
- case ANIMTYPE_DSCUR:
- {
- Curve *cu= (Curve *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG(cu, mode, CU_DS_EXPAND);
- }
- }
- }
- break;
- case ANIMTYPE_DSSKEY:
- {
- Key *key= (Key *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG(key, mode, KEYBLOCK_DS_EXPAND);
- }
- }
- }
- break;
- case ANIMTYPE_DSWOR:
- {
- World *wo= (World *)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG(wo, mode, WO_DS_EXPAND);
- }
- }
- }
- break;
- case ANIMTYPE_DSPART:
- {
- ParticleSettings *part= (ParticleSettings*)ale->data;
-
- if (ASUBCHANNEL_SEL_OK(ale)) {
- if (setting == ACHANNEL_SETTING_EXPAND) {
- ACHANNEL_SET_FLAG(part, mode, PART_DS_EXPAND);
- }
- }
- }
- break;
-
- case ANIMTYPE_GROUP:
- {
- bActionGroup *agrp= (bActionGroup *)ale->data;
-
- switch (setting) {
- case ACHANNEL_SETTING_PROTECT:
- ACHANNEL_SET_FLAG(agrp, mode, AGRP_PROTECTED);
- break;
- case ACHANNEL_SETTING_EXPAND:
- ACHANNEL_SET_FLAG(agrp, mode, AGRP_EXPANDED);
- break;
- case ACHANNEL_SETTING_MUTE:
- ACHANNEL_SET_FLAG(agrp, mode, AGRP_MUTED);
- break;
- case ACHANNEL_SETTING_VISIBLE:
- ACHANNEL_SET_FLAG_NEG(agrp, mode, AGRP_NOTVISIBLE);
- break;
- }
- }
- break;
- case ANIMTYPE_FCURVE:
- {
- FCurve *fcu= (FCurve *)ale->data;
-
- switch (setting) {
- case ACHANNEL_SETTING_MUTE:
- ACHANNEL_SET_FLAG(fcu, mode, FCURVE_MUTED);
- break;
- case ACHANNEL_SETTING_PROTECT:
- ACHANNEL_SET_FLAG(fcu, mode, FCURVE_PROTECTED);
- break;
- case ACHANNEL_SETTING_VISIBLE:
- ACHANNEL_SET_FLAG(fcu, mode, FCURVE_VISIBLE);
- break;
- }
- }
- break;
- case ANIMTYPE_GPLAYER:
- {
- bGPDlayer *gpl= (bGPDlayer *)ale->data;
-
- switch (setting) {
- case ACHANNEL_SETTING_MUTE:
- ACHANNEL_SET_FLAG(gpl, mode, GP_LAYER_HIDE);
- break;
- case ACHANNEL_SETTING_PROTECT:
- ACHANNEL_SET_FLAG(gpl, mode, GP_LAYER_LOCKED);
- break;
- }
- }
- break;
- }
+ /* set the setting in the appropriate way (if available) */
+ ANIM_channel_setting_set(ac, ale, setting, mode);
}
BLI_freelistN(&anim_data);
@@ -1395,47 +1193,19 @@ static void borderselect_anim_channels (bAnimContext *ac, rcti *rect, short sele
/* if channel is within border-select region, alter it */
if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
- /* only the following types can be selected */
+ /* set selection flags only */
+ ANIM_channel_setting_set(ac, ale, ACHANNEL_SETTING_SELECT, selectmode);
+
+ /* type specific actions */
switch (ale->type) {
- case ANIMTYPE_OBJECT: /* object */
- {
- Base *base= (Base *)ale->data;
- Object *ob= base->object;
-
- ACHANNEL_SET_FLAG(base, selectmode, SELECT);
- ACHANNEL_SET_FLAG(ob, selectmode, SELECT);
- }
- break;
- case ANIMTYPE_GROUP: /* action group */
+ case ANIMTYPE_GROUP:
{
bActionGroup *agrp= (bActionGroup *)ale->data;
- ACHANNEL_SET_FLAG(agrp, selectmode, AGRP_SELECTED);
+ /* always clear active flag after doing this */
agrp->flag &= ~AGRP_ACTIVE;
}
break;
- case ANIMTYPE_FCURVE: /* F-Curve channel */
- {
- FCurve *fcu = (FCurve *)ale->data;
-
- ACHANNEL_SET_FLAG(fcu, selectmode, FCURVE_SELECTED);
- }
- break;
- case ANIMTYPE_GPLAYER: /* grease-pencil layer */
- {
- bGPDlayer *gpl = (bGPDlayer *)ale->data;
-
- ACHANNEL_SET_FLAG(gpl, selectmode, GP_LAYER_SELECT);
- }
- break;
-
- case ANIMTYPE_NLATRACK: /* nla-track */
- {
- NlaTrack *nlt= (NlaTrack *)ale->data;
-
- ACHANNEL_SET_FLAG(nlt, selectmode, NLATRACK_SELECTED);
- }
- break;
}
}
@@ -1507,11 +1277,7 @@ void ANIM_OT_channels_select_border(wmOperatorType *ot)
}
/* ******************** Mouse-Click Operator *********************** */
-/* Depending on the channel that was clicked on, the mouse click will activate whichever
- * part of the channel is relevant.
- *
- * NOTE: eventually, this should probably be phased out when many of these things are replaced with buttons
- */
+/* Handle selection changes due to clicking on channels. Settings will get caught by UI code... */
static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, short selectmode)
{
@@ -1549,24 +1315,16 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
{
Scene *sce= (Scene *)ale->data;
- if (x < 16) {
- /* toggle expand */
- sce->flag ^= SCE_DS_COLLAPSED;
-
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ /* set selection status */
+ if (selectmode == SELECT_INVERT) {
+ /* swap select */
+ sce->flag ^= SCE_DS_SELECTED;
}
else {
- /* set selection status */
- if (selectmode == SELECT_INVERT) {
- /* swap select */
- sce->flag ^= SCE_DS_SELECTED;
- }
- else {
- sce->flag |= SCE_DS_SELECTED;
- }
-
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ sce->flag |= SCE_DS_SELECTED;
}
+
+ notifierFlags |= ND_ANIMCHAN_SELECT;
}
break;
case ANIMTYPE_OBJECT:
@@ -1576,226 +1334,87 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
Base *base= (Base *)ale->data;
Object *ob= base->object;
- if (x < 16) {
- /* toggle expand */
- ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX
-
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ /* set selection status */
+ if (selectmode == SELECT_INVERT) {
+ /* swap select */
+ base->flag ^= SELECT;
+ ob->flag= base->flag;
}
else {
- /* set selection status */
- if (selectmode == SELECT_INVERT) {
- /* swap select */
- base->flag ^= SELECT;
- ob->flag= base->flag;
- }
- else {
- Base *b;
-
- /* deleselect all */
- for (b= sce->base.first; b; b= b->next) {
- b->flag &= ~SELECT;
- b->object->flag= b->flag;
- }
-
- /* select object now */
- base->flag |= SELECT;
- ob->flag |= SELECT;
- }
+ Base *b;
- /* xxx should be ED_base_object_activate(), but we need context pointer for that... */
- //set_active_base(base);
+ /* deleselect all */
+ for (b= sce->base.first; b; b= b->next) {
+ b->flag &= ~SELECT;
+ b->object->flag= b->flag;
+ }
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ /* select object now */
+ base->flag |= SELECT;
+ ob->flag |= SELECT;
}
- }
- break;
- case ANIMTYPE_FILLACTD:
- {
- bAction *act= (bAction *)ale->data;
- act->flag ^= ACT_COLLAPSED;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_FILLDRIVERS:
- {
- AnimData *adt= (AnimData* )ale->data;
- adt->flag ^= ADT_DRIVERS_COLLAPSED;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_FILLMATD:
- {
- Object *ob= (Object *)ale->data;
- ob->nlaflag ^= OB_ADS_SHOWMATS; // XXX
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_FILLPARTD:
- {
- Object *ob= (Object *)ale->data;
- ob->nlaflag ^= OB_ADS_SHOWPARTS; // XXX
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
-
- case ANIMTYPE_DSMAT:
- {
- Material *ma= (Material *)ale->data;
- ma->flag ^= MA_DS_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSLAM:
- {
- Lamp *la= (Lamp *)ale->data;
- la->flag ^= LA_DS_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSCAM:
- {
- Camera *ca= (Camera *)ale->data;
- ca->flag ^= CAM_DS_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSCUR:
- {
- Curve *cu= (Curve *)ale->data;
- cu->flag ^= CU_DS_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSSKEY:
- {
- Key *key= (Key *)ale->data;
- key->flag ^= KEYBLOCK_DS_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSWOR:
- {
- World *wo= (World *)ale->data;
- wo->flag ^= WO_DS_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSPART:
- {
- ParticleSettings *part= (ParticleSettings *)ale->data;
- part->flag ^= PART_DS_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
+
+ /* xxx should be ED_base_object_activate(), but we need context pointer for that... */
+ //set_active_base(base);
+
+ notifierFlags |= ND_ANIMCHAN_SELECT;
}
break;
case ANIMTYPE_GROUP:
{
bActionGroup *agrp= (bActionGroup *)ale->data;
- short offset= (ELEM3(ac->datatype, ANIMCONT_DOPESHEET, ANIMCONT_FCURVES, ANIMCONT_DRIVERS))? 18 : 0;
- if ((x < (offset+17)) && (agrp->channels.first)) {
- /* toggle expand */
- agrp->flag ^= AGRP_EXPANDED;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- else if ((x < (offset+32)) && (ac->spacetype==SPACE_IPO)) {
- /* toggle visibility (of grouped F-Curves in Graph editor) */
- agrp->flag ^= AGRP_NOTVISIBLE;
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ /* select/deselect group */
+ if (selectmode == SELECT_INVERT) {
+ /* inverse selection status of this group only */
+ agrp->flag ^= AGRP_SELECTED;
}
- else if (x >= (ACHANNEL_NAMEWIDTH-ACHANNEL_BUTTON_WIDTH)) {
- /* toggle protection/locking */
- agrp->flag ^= AGRP_PROTECTED;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- else if (x >= (ACHANNEL_NAMEWIDTH-2*ACHANNEL_BUTTON_WIDTH)) {
- /* toggle mute */
- agrp->flag ^= AGRP_MUTED;
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ else if (selectmode == -1) {
+ /* select all in group (and deselect everthing else) */
+ FCurve *fcu;
+
+ /* deselect all other channels */
+ ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
+
+ /* only select channels in group and group itself */
+ for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next)
+ fcu->flag |= FCURVE_SELECTED;
+ agrp->flag |= AGRP_SELECTED;
}
else {
- /* select/deselect group */
- if (selectmode == SELECT_INVERT) {
- /* inverse selection status of this group only */
- agrp->flag ^= AGRP_SELECTED;
- }
- else if (selectmode == -1) {
- /* select all in group (and deselect everthing else) */
- FCurve *fcu;
-
- /* deselect all other channels */
- ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
-
- /* only select channels in group and group itself */
- for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next)
- fcu->flag |= FCURVE_SELECTED;
- agrp->flag |= AGRP_SELECTED;
- }
- else {
- /* select group by itself */
- ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
- agrp->flag |= AGRP_SELECTED;
- }
-
- /* if group is selected now, make group the 'active' one in the visible list */
- if (agrp->flag & AGRP_SELECTED)
- ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP);
-
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ /* select group by itself */
+ ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
+ agrp->flag |= AGRP_SELECTED;
}
+
+ /* if group is selected now, make group the 'active' one in the visible list */
+ if (agrp->flag & AGRP_SELECTED)
+ ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP);
+
+ notifierFlags |= ND_ANIMCHAN_SELECT;
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu= (FCurve *)ale->data;
- short offset;
-
- if (ac->datatype != ANIMCONT_ACTION) {
- /* for now, special case for materials */
- if (ale->ownertype == ANIMTYPE_DSMAT)
- offset= 21;
- else
- offset= 18;
- }
- else
- offset = 0;
- if (x >= (ACHANNEL_NAMEWIDTH-ACHANNEL_BUTTON_WIDTH)) {
- /* toggle protection (only if there's a toggle there) */
- if (fcu->bezt) {
- fcu->flag ^= FCURVE_PROTECTED;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- }
- else if (x >= (ACHANNEL_NAMEWIDTH-2*ACHANNEL_BUTTON_WIDTH)) {
- /* toggle mute */
- fcu->flag ^= FCURVE_MUTED;
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- else if ((x < (offset+17)) && (ac->spacetype==SPACE_IPO)) {
- /* toggle visibility */
- fcu->flag ^= FCURVE_VISIBLE;
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ /* select/deselect */
+ if (selectmode == SELECT_INVERT) {
+ /* inverse selection status of this F-Curve only */
+ fcu->flag ^= FCURVE_SELECTED;
}
else {
- /* select/deselect */
- if (selectmode == SELECT_INVERT) {
- /* inverse selection status of this F-Curve only */
- fcu->flag ^= FCURVE_SELECTED;
- }
- else {
- /* select F-Curve by itself */
- ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
- fcu->flag |= FCURVE_SELECTED;
- }
-
- /* if F-Curve is selected now, make F-Curve the 'active' one in the visible list */
- if (fcu->flag & FCURVE_SELECTED)
- ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
-
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ /* select F-Curve by itself */
+ ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
+ fcu->flag |= FCURVE_SELECTED;
}
+
+ /* if F-Curve is selected now, make F-Curve the 'active' one in the visible list */
+ if (fcu->flag & FCURVE_SELECTED)
+ ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
+
+ notifierFlags |= ND_ANIMCHAN_SELECT;
}
break;
case ANIMTYPE_GPDATABLOCK:
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c
index 13667159fe0..af2355b91a5 100644
--- a/source/blender/editors/animation/anim_deps.c
+++ b/source/blender/editors/animation/anim_deps.c
@@ -138,6 +138,7 @@ void ANIM_action_to_pose_sync (Object *ob)
*/
void ANIM_pose_to_action_sync (Object *ob, ScrArea *sa)
{
+#if 0 // XXX old animation system
SpaceAction *saction= (SpaceAction *)sa->spacedata.first;
bArmature *arm= (bArmature *)ob->data;
bAction *act= (bAction *)ob->action;
@@ -174,4 +175,5 @@ void ANIM_pose_to_action_sync (Object *ob, ScrArea *sa)
// XXX step 2 needs to be coded still... currently missing action/bone group API to do any more work here...
// XXX step 3 needs to be coded still... it's a messy case to deal with (we'll use the temp indices for this?)
+#endif // XXX old animation system
}
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 5970cf481ac..55fb1ccace0 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -62,6 +62,7 @@
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
+#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_space_types.h"
@@ -373,27 +374,29 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
*/
#define ANIMDATA_FILTER_CASES(id, adtOk, nlaOk, driversOk, keysOk) \
{\
- if (filter_mode & ANIMFILTER_ANIMDATA) {\
- if ((id)->adt) {\
- adtOk\
- }\
- }\
- else if (ads->filterflag & ADS_FILTER_ONLYNLA) {\
- if (ANIMDATA_HAS_NLA(id)) {\
- nlaOk\
- }\
- else if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) && ANIMDATA_HAS_KEYS(id)) {\
- nlaOk\
- }\
- }\
- else if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) {\
- if (ANIMDATA_HAS_DRIVERS(id)) {\
- driversOk\
- }\
- }\
- else {\
- if (ANIMDATA_HAS_KEYS(id)) {\
- keysOk\
+ if ((id)->adt) {\
+ if (!(filter_mode & ANIMFILTER_CURVEVISIBLE) || !((id)->adt->flag & ADT_CURVES_NOT_VISIBLE)) {\
+ if (filter_mode & ANIMFILTER_ANIMDATA) {\
+ adtOk\
+ }\
+ else if (ads->filterflag & ADS_FILTER_ONLYNLA) {\
+ if (ANIMDATA_HAS_NLA(id)) {\
+ nlaOk\
+ }\
+ else if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) && ANIMDATA_HAS_KEYS(id)) {\
+ nlaOk\
+ }\
+ }\
+ else if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) {\
+ if (ANIMDATA_HAS_DRIVERS(id)) {\
+ driversOk\
+ }\
+ }\
+ else {\
+ if (ANIMDATA_HAS_KEYS(id)) {\
+ keysOk\
+ }\
+ }\
}\
}\
}
@@ -856,71 +859,6 @@ static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_m
/* return the number of items added to the list */
return items;
}
-
-static int animdata_filter_shapekey (ListBase *anim_data, Key *key, int filter_mode, void *owner, short ownertype, ID *owner_id)
-{
- bAnimListElem *ale;
- KeyBlock *kb;
- //FCurve *fcu;
- int i, items=0;
-
- /* are we filtering for display or editing */
- if (filter_mode & ANIMFILTER_CHANNELS) {
- /* for display - loop over shapekeys, adding ipo-curve references where needed */
- kb= key->block.first;
-
- /* loop through possible shapekeys, manually creating entries */
- for (i= 1; i < key->totkey; i++) {
- ale= MEM_callocN(sizeof(bAnimListElem), "bAnimListElem");
- kb = kb->next; /* do this even on the first try, as the first is 'Basis' (which doesn't get included) */
-
- ale->data= kb;
- ale->type= ANIMTYPE_SHAPEKEY; /* 'abused' usage of this type */
- ale->owner= key;
- ale->ownertype= ANIMTYPE_SHAPEKEY;
- ale->datatype= ALE_NONE;
- ale->index = i;
-
-#if 0 // XXX fixme... old system
- if (key->ipo) {
- for (icu= key->ipo->curve.first; icu; icu=icu->next) {
- if (icu->adrcode == i) {
- ale->key_data= icu;
- ale->datatype= ALE_ICU;
- break;
- }
- }
- }
-#endif // XXX fixme... old system
-
- ale->id= owner_id;
-
- BLI_addtail(anim_data, ale);
- items++;
- }
- }
- else {
-#if 0 // XXX fixme... old system
- /* loop over ipo curves if present - for editing */
- if (key->ipo) {
- if (filter_mode & ANIMFILTER_IPOKEYS) {
- ale= make_new_animlistelem(key->ipo, ANIMTYPE_IPO, key, ANIMTYPE_SHAPEKEY);
- if (ale) {
- if (owned) ale->id= owner;
- BLI_addtail(anim_data, ale);
- items++;
- }
- }
- else {
- items += animdata_filter_ipocurves(anim_data, key->ipo, filter_mode, key, ANIMTYPE_SHAPEKEY, (owned)?(owner):(NULL));
- }
- }
-#endif // XXX fixme... old system
- }
-
- /* return the number of items added to the list */
- return items;
-}
#if 0
// FIXME: switch this to use the bDopeSheet...
@@ -947,7 +885,7 @@ static int animdata_filter_gpencil (ListBase *anim_data, bScreen *sc, int filter
for (sa= sc->areabase.first; sa; sa= sa->next) {
/* try to get gp data */
// XXX need to put back grease pencil api...
- gpd= gpencil_data_getactive(sa);
+ gpd= gpencil_data_get_active(sa);
if (gpd == NULL) continue;
/* add gpd as channel too (if for drawing, and it has layers) */
@@ -1155,6 +1093,14 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad
expanded= FILTER_CUR_OBJD(cu);
}
break;
+ case OB_MBALL: /* ------- MetaBall ---------- */
+ {
+ MetaBall *mb= (MetaBall *)ob->data;
+
+ type= ANIMTYPE_DSMBALL;
+ expanded= FILTER_MBALL_OBJD(mb);
+ }
+ break;
}
/* special exception for drivers instead of action */
@@ -1272,7 +1218,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
/* add channels */
if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) {
- items += animdata_filter_shapekey(anim_data, key, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
+ items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, key, ANIMTYPE_DSSKEY, filter_mode, (ID *)key);
}
},
{ /* action (keyframes) */
@@ -1287,7 +1233,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
/* add channels */
if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) {
- items += animdata_filter_shapekey(anim_data, key, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
+ items += animdata_filter_action(anim_data, adt->action, filter_mode, key, ANIMTYPE_DSSKEY, (ID *)key);
}
}
);
@@ -1338,12 +1284,25 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
}
}
break;
+ case OB_MBALL: /* ------- MetaBall ---------- */
+ {
+ MetaBall *mb= (MetaBall *)ob->data;
+
+ if ((ads->filterflag & ADS_FILTER_NOMBA) == 0) {
+ ANIMDATA_FILTER_CASES(mb,
+ { /* AnimData blocks - do nothing... */ },
+ obdata_ok= 1;,
+ obdata_ok= 1;,
+ obdata_ok= 1;)
+ }
+ }
+ break;
}
if (obdata_ok)
items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode);
/* particles */
- if(ob->particlesystem.first && !(ads->filterflag & ADS_FILTER_NOPART))
+ if (ob->particlesystem.first && !(ads->filterflag & ADS_FILTER_NOPART))
items += animdata_filter_dopesheet_particles(anim_data, ads, base, filter_mode);
/* return the number of items added to the list */
@@ -1508,6 +1467,14 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
worOk= !(ads->filterflag & ADS_FILTER_NOWOR);)
}
+ /* if only F-Curves with visible flags set can be shown, check that
+ * datablocks haven't been set to invisible
+ */
+ if (filter_mode & ANIMFILTER_CURVEVISIBLE) {
+ if ((sce->adt) && (sce->adt->flag & ADT_CURVES_NOT_VISIBLE))
+ sceOk= worOk= 0;
+ }
+
/* check if not all bad (i.e. so there is something to show) */
if ( !(!sceOk && !worOk) ) {
/* add scene data to the list of filtered channels */
@@ -1524,7 +1491,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
Key *key= ob_get_key(ob);
short actOk=1, keyOk=1, dataOk=1, matOk=1, partOk=1;
- /* firstly, check if object can be included, by the following fanimors:
+ /* firstly, check if object can be included, by the following factors:
* - if only visible, must check for layer and also viewport visibility
* - if only selected, must check if object is selected
* - there must be animation data to edit
@@ -1538,6 +1505,14 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
if (ob->restrictflag & OB_RESTRICT_VIEW) continue;
}
+ /* if only F-Curves with visible flags set can be shown, check that
+ * datablock hasn't been set to invisible
+ */
+ if (filter_mode & ANIMFILTER_CURVEVISIBLE) {
+ if ((ob->adt) && (ob->adt->flag & ADT_CURVES_NOT_VISIBLE))
+ continue;
+ }
+
/* additionally, dopesheet filtering also affects what objects to consider */
if (ads->filterflag) {
/* check selection and object type filters */
@@ -1660,6 +1635,23 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);)
}
break;
+ case OB_MBALL: /* ------- MetaBall ---------- */
+ {
+ MetaBall *mb= (MetaBall *)ob->data;
+ dataOk= 0;
+ ANIMDATA_FILTER_CASES(mb,
+ if ((ads->filterflag & ADS_FILTER_NOMBA)==0) {
+ /* for the special AnimData blocks only case, we only need to add
+ * the block if it is valid... then other cases just get skipped (hence ok=0)
+ */
+ ANIMDATA_ADD_ANIMDATA(mb);
+ dataOk=0;
+ },
+ dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);,
+ dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);,
+ dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);)
+ }
+ break;
default: /* --- other --- */
dataOk= 0;
break;
@@ -1736,6 +1728,12 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int
dataOk= ANIMDATA_HAS_KEYS(cu);
}
break;
+ case OB_MBALL: /* -------- Metas ---------- */
+ {
+ MetaBall *mb= (MetaBall *)ob->data;
+ dataOk= ANIMDATA_HAS_KEYS(mb);
+ }
+ break;
default: /* --- other --- */
dataOk= 0;
break;
@@ -1792,7 +1790,7 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
break;
case ANIMCONT_SHAPEKEY:
- items= animdata_filter_shapekey(anim_data, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact);
+ //items= animdata_filter_shapekey(anim_data, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact);
break;
case ANIMCONT_GPENCIL:
diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h
index e903007fbc0..462ef76ea8d 100644
--- a/source/blender/editors/animation/anim_intern.h
+++ b/source/blender/editors/animation/anim_intern.h
@@ -1,18 +1,42 @@
-/* Testing code for 2.5 animation system
- * Copyright 2009, Joshua Leung
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place * Suite 330, Boston, MA 02111*1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009, Blender Foundation, Joshua Leung
+ * This is a new part of Blender (with some old code)
+ *
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
*/
#ifndef ANIM_INTERN_H
#define ANIM_INTERN_H
-
/* KeyingSets/Keyframing Interface ------------- */
/* list of builtin KeyingSets (defined in keyingsets.c) */
extern ListBase builtin_keyingsets;
+/* for builtin keyingsets - context poll */
short keyingset_context_ok_poll(bContext *C, KeyingSet *ks);
+/* Main KeyingSet operations API call */
short modifykey_get_context_data (bContext *C, ListBase *dsources, KeyingSet *ks);
#endif // ANIM_INTERN_H
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index aecf437a30b..26edf930f0b 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -93,9 +93,8 @@ int geticon_anim_blocktype(short blocktype)
}
/* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings)
- * WARNING: name buffer we're writing to cannot exceed 128 chars (check action_draw.c for details)
+ * WARNING: name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.c for details)
*/
-// TODO: have an extra var to indicate if prop was valid?
void getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
{
/* sanity checks */
@@ -148,26 +147,14 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
propname= (char *)RNA_property_ui_name(prop);
/* Array Index - only if applicable */
- if (RNA_property_array_length(prop)) {
- static char *vectoritem[4]= {"X ", "Y ", "Z ", "W "};
- static char *quatitem[4]= {"W ", "X ", "Y ", "Z "};
- static char *coloritem[4]= {"R ", "G ", "B ", "A "};
+ if (RNA_property_array_length(&ptr, prop)) {
+ char c= RNA_property_array_item_char(prop, fcu->array_index);
- int tot= RNA_property_array_length(prop);
- int propsubtype= RNA_property_subtype(prop);
-
- /* get string to use for array index */
- if ((tot == 4) && (propsubtype == PROP_ROTATION))
- arrayname= quatitem[fcu->array_index];
- else if ( (tot <= 4) && ((propsubtype == PROP_VECTOR) || (propsubtype == PROP_ROTATION)) )
- arrayname= vectoritem[fcu->array_index];
- else if ((tot <= 4) && (propsubtype == PROP_COLOR))
- arrayname= coloritem[fcu->array_index];
- else {
- /* we need to write the index to a temp buffer (in py syntax), as it is a number... */
- sprintf(arrayindbuf, "[%d]", fcu->array_index);
- arrayname= &arrayindbuf[0];
- }
+ /* we need to write the index to a temp buffer (in py syntax) */
+ if(c) sprintf(arrayindbuf, "%c ", c);
+ else sprintf(arrayindbuf, "[%d]", fcu->array_index);
+
+ arrayname= &arrayindbuf[0];
}
else {
/* no array index */
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 9c039693b72..fedbe12c0e6 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -56,6 +56,8 @@
#include "ED_markers.h"
#include "ED_screen.h"
+#include "BKE_sound.h"
+
/* ********************** frame change operator ***************************/
/* Set any flags that are necessary to indicate modal time-changing operation */
@@ -91,6 +93,8 @@ static void change_frame_apply(bContext *C, wmOperator *op)
if (cfra < MINAFRAME) cfra= MINAFRAME;
CFRA= cfra;
+ sound_scrub(C);
+
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
}
@@ -121,6 +125,7 @@ static int change_frame_exec(bContext *C, wmOperator *op)
change_frame_apply(C, op);
change_frame_exit(C, op);
+
return OPERATOR_FINISHED;
}
@@ -376,13 +381,14 @@ void ANIM_OT_time_toggle(wmOperatorType *ot)
void ED_operatortypes_anim(void)
{
+ /* Animation Editors only -------------------------- */
WM_operatortype_append(ANIM_OT_change_frame);
WM_operatortype_append(ANIM_OT_time_toggle);
WM_operatortype_append(ANIM_OT_previewrange_set);
WM_operatortype_append(ANIM_OT_previewrange_clear);
- // XXX this is used all over... maybe for screen instead?
+ /* Entire UI --------------------------------------- */
WM_operatortype_append(ANIM_OT_insert_keyframe);
WM_operatortype_append(ANIM_OT_delete_keyframe);
WM_operatortype_append(ANIM_OT_insert_keyframe_menu);
@@ -394,8 +400,8 @@ void ED_operatortypes_anim(void)
WM_operatortype_append(ANIM_OT_add_driver_button);
WM_operatortype_append(ANIM_OT_remove_driver_button);
- WM_operatortype_append(ANIM_OT_keyingset_add_new);
- WM_operatortype_append(ANIM_OT_keyingset_add_destination);
+ WM_operatortype_append(ANIM_OT_add_keyingset_button);
+ WM_operatortype_append(ANIM_OT_remove_keyingset_button);
}
void ED_keymap_anim(wmWindowManager *wm)
@@ -404,10 +410,10 @@ void ED_keymap_anim(wmWindowManager *wm)
/* frame management */
/* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons */
- WM_keymap_verify_item(keymap, "ANIM_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "ANIM_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "ANIM_OT_time_toggle", TKEY, KM_PRESS, KM_CTRL, 0);
/* preview range */
- WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_set", PKEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_clear", PKEY, KM_PRESS, KM_ALT, 0);
}
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 849e2d2eede..8b9224511ba 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -151,33 +151,33 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla
/* create F-Curve with Driver */
fcu= verify_driver_fcurve(id, rna_path, array_index, 1);
- if(fcu && fcu->driver) {
+ if (fcu && fcu->driver) {
fcu->driver->type= type;
-
+
/* fill in current value for python */
- if(type == DRIVER_TYPE_PYTHON) {
+ if (type == DRIVER_TYPE_PYTHON) {
PropertyType proptype= RNA_property_type(prop);
- int array= RNA_property_array_length(prop);
+ int array= RNA_property_array_length(&ptr, prop);
char *expression= fcu->driver->expression;
int val, maxlen= sizeof(fcu->driver->expression);
float fval;
-
- if(proptype == PROP_BOOLEAN) {
+
+ if (proptype == PROP_BOOLEAN) {
if(!array) val= RNA_property_boolean_get(&ptr, prop);
else val= RNA_property_boolean_get_index(&ptr, prop, array_index);
-
+
BLI_strncpy(expression, (val)? "True": "False", maxlen);
}
- else if(proptype == PROP_INT) {
- if(!array) val= RNA_property_int_get(&ptr, prop);
+ else if (proptype == PROP_INT) {
+ if (!array) val= RNA_property_int_get(&ptr, prop);
else val= RNA_property_int_get_index(&ptr, prop, array_index);
-
+
BLI_snprintf(expression, maxlen, "%d", val);
}
- else if(proptype == PROP_FLOAT) {
- if(!array) fval= RNA_property_float_get(&ptr, prop);
+ else if (proptype == PROP_FLOAT) {
+ if (!array) fval= RNA_property_float_get(&ptr, prop);
else fval= RNA_property_float_get_index(&ptr, prop, array_index);
-
+
BLI_snprintf(expression, maxlen, "%.3f", fval);
}
@@ -232,7 +232,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op)
short success= 0;
int a, index, length, all= RNA_boolean_get(op->ptr, "all");
- /* try to insert keyframe using property retrieved from UI */
+ /* try to create driver using property retrieved from UI */
memset(&ptr, 0, sizeof(PointerRNA));
uiAnimContextProperty(C, &ptr, &prop, &index);
@@ -241,7 +241,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op)
if (path) {
if (all) {
- length= RNA_property_array_length(prop);
+ length= RNA_property_array_length(&ptr, prop);
if (length) index= 0;
else length= 1;
@@ -281,7 +281,7 @@ void ANIM_OT_add_driver_button (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array.");
}
/* Remove Driver Button Operator ------------------------ */
@@ -294,7 +294,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op)
short success= 0;
int a, index, length, all= RNA_boolean_get(op->ptr, "all");
- /* try to insert keyframe using property retrieved from UI */
+ /* try to find driver using property retrieved from UI */
memset(&ptr, 0, sizeof(PointerRNA));
uiAnimContextProperty(C, &ptr, &prop, &index);
@@ -303,7 +303,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op)
if (path) {
if (all) {
- length= RNA_property_array_length(prop);
+ length= RNA_property_array_length(&ptr, prop);
if(length) index= 0;
else length= 1;
@@ -344,7 +344,7 @@ void ANIM_OT_remove_driver_button (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array.");
}
/* ************************************************** */
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 7a618f4d222..4aff26105f3 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -258,14 +258,14 @@ static void draw_modifier__fn_generator(uiLayout *layout, ID *id, FModifier *fcm
/* add the settings */
col= uiLayoutColumn(layout, 1);
- uiItemR(col, "", 0, &ptr, "type", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "additive", 0, 0, 1);
+ uiItemR(col, "", 0, &ptr, "type", 0);
+ uiItemR(col, NULL, 0, &ptr, "additive", UI_ITEM_R_TOGGLE);
col= uiLayoutColumn(layout, 0); // no grouping for now
- uiItemR(col, NULL, 0, &ptr, "amplitude", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "phase_offset", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "value_offset", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "amplitude", 0);
+ uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0);
+ uiItemR(col, NULL, 0, &ptr, "phase_offset", 0);
+ uiItemR(col, NULL, 0, &ptr, "value_offset", 0);
}
/* --------------- */
@@ -287,14 +287,14 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor
/* before range */
col= uiLayoutColumn(split, 1);
uiItemL(col, "Before:", 0);
- uiItemR(col, "", 0, &ptr, "before_mode", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "before_cycles", 0, 0, 0);
+ uiItemR(col, "", 0, &ptr, "before_mode", 0);
+ uiItemR(col, NULL, 0, &ptr, "before_cycles", 0);
/* after range */
col= uiLayoutColumn(split, 1);
uiItemL(col, "After:", 0);
- uiItemR(col, "", 0, &ptr, "after_mode", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "after_cycles", 0, 0, 0);
+ uiItemR(col, "", 0, &ptr, "after_mode", 0);
+ uiItemR(col, NULL, 0, &ptr, "after_cycles", 0);
}
/* --------------- */
@@ -309,20 +309,20 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short
RNA_pointer_create(id, &RNA_FModifierNoise, fcm, &ptr);
/* blending mode */
- uiItemR(layout, NULL, 0, &ptr, "modification", 0, 0, 0);
+ uiItemR(layout, NULL, 0, &ptr, "modification", 0);
/* split into 2 columns */
split= uiLayoutSplit(layout, 0.5f);
/* col 1 */
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &ptr, "size", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "strength", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "size", 0);
+ uiItemR(col, NULL, 0, &ptr, "strength", 0);
/* col 2 */
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &ptr, "phase", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "depth", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "phase", 0);
+ uiItemR(col, NULL, 0, &ptr, "depth", 0);
}
/* --------------- */
@@ -503,11 +503,11 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
/* general settings */
col= uiLayoutColumn(layout, 1);
uiItemL(col, "Envelope:", 0);
- uiItemR(col, NULL, 0, &ptr, "reference_value", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "reference_value", 0);
row= uiLayoutRow(col, 1);
- uiItemR(row, "Min", 0, &ptr, "default_minimum", 0, 0, 0);
- uiItemR(row, "Max", 0, &ptr, "default_maximum", 0, 0, 0);
+ uiItemR(row, "Min", 0, &ptr, "default_minimum", 0);
+ uiItemR(row, "Max", 0, &ptr, "default_maximum", 0);
/* control points header */
// TODO: move this control-point control stuff to using the new special widgets for lists
@@ -559,13 +559,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* x-minimum */
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "minimum_x", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0);
+ uiItemR(col, NULL, 0, &ptr, "minimum_x", 0);
/* y-minimum*/
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "minimum_y", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0);
+ uiItemR(col, NULL, 0, &ptr, "minimum_y", 0);
}
/* row 2: minimum */
@@ -577,13 +577,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* x-minimum */
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "maximum_x", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0);
+ uiItemR(col, NULL, 0, &ptr, "maximum_x", 0);
/* y-minimum*/
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0, 0, 0);
- uiItemR(col, NULL, 0, &ptr, "maximum_y", 0, 0, 0);
+ uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0);
+ uiItemR(col, NULL, 0, &ptr, "maximum_y", 0);
}
}
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 2107e6e4252..abea38e129e 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -98,9 +98,7 @@ static ActKeyColumn *bezt_to_new_actkeycolumn(BezTriple *bezt)
/* store settings based on state of BezTriple */
ak->cfra= bezt->vec[1][0];
ak->sel= BEZSELECTED(bezt) ? SELECT : 0;
-
- // TODO: handle type = bezt->h1 or bezt->h2
- ak->handle_type= 0;
+ ak->key_type= BEZKEYTYPE(bezt);
/* set 'modified', since this is used to identify long keyframes */
ak->modified = 1;
@@ -134,6 +132,10 @@ static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt)
if (BEZSELECTED(bezt)) ak->sel = SELECT;
ak->modified += 1;
+ /* for keyframe type, 'proper' keyframes have priority over breakdowns (and other types for now) */
+ if (BEZKEYTYPE(bezt) == BEZT_KEYTYPE_KEYFRAME)
+ ak->key_type= BEZT_KEYTYPE_KEYFRAME;
+
/* done... no need to insert */
return;
}
@@ -340,7 +342,7 @@ static const float _unit_diamond_shape[4][2] = {
};
/* draw a simple diamond shape with OpenGL */
-void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short mode)
+void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short key_type, short mode)
{
static GLuint displist1=0;
static GLuint displist2=0;
@@ -371,6 +373,11 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel
glEndList();
}
+ /* tweak size of keyframe shape according to type of keyframe
+ * - 'proper' keyframes have key_type=0, so get drawn at full size
+ */
+ hsize -= 0.5f*key_type;
+
/* adjust view transform before starting */
glTranslatef(x, y, 0.0f);
glScalef(1.0f/xscale*hsize, hsize, 1.0f);
@@ -381,8 +388,22 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel
/* draw! */
if ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH) {
/* interior - hardcoded colors (for selected and unselected only) */
- if (sel) UI_ThemeColorShade(TH_STRIP_SELECT, 50);
- else glColor3ub(0xE9, 0xE9, 0xE9);
+ switch (key_type) {
+ case BEZT_KEYTYPE_BREAKDOWN: /* bluish frames for now */
+ {
+ if (sel) glColor3f(0.33f, 0.75f, 0.93f);
+ else glColor3f(0.70f, 0.86f, 0.91f);
+ }
+ break;
+
+ case BEZT_KEYTYPE_KEYFRAME: /* traditional yellowish frames for now */
+ default:
+ {
+ if (sel) UI_ThemeColorShade(TH_STRIP_SELECT, 50);
+ else glColor3f(0.91f, 0.91f, 0.91f);
+ }
+ break;
+ }
glCallList(displist2);
}
@@ -454,7 +475,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
/* draw using OpenGL - uglier but faster */
// NOTE1: a previous version of this didn't work nice for some intel cards
// NOTE2: if we wanted to go back to icons, these are icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3;
- draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT), KEYFRAME_SHAPE_BOTH);
+ draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT), ak->key_type, KEYFRAME_SHAPE_BOTH);
}
}
@@ -695,7 +716,7 @@ void gpl_to_keylist(bDopeSheet *ads, bGPDlayer *gpl, DLRBT_Tree *keys, DLRBT_Tre
ak->cfra= (float)gpf->framenum;
ak->modified = 1;
- ak->handle_type= 0;
+ ak->key_type= 0;
if (gpf->flag & GP_FRAME_SELECT)
ak->sel = SELECT;
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 77826eca87a..ac04dc7d1a8 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -655,7 +655,7 @@ static short set_bezt_bezier(BeztEditData *bed, BezTriple *bezt)
return 0;
}
-/* Set the interpolation type of the selected BezTriples in each IPO curve to the specified one */
+/* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */
// ANIM_editkeyframes_ipocurve_ipotype() !
BeztEditFunc ANIM_editkeyframes_ipo(short code)
{
@@ -669,6 +669,35 @@ BeztEditFunc ANIM_editkeyframes_ipo(short code)
}
}
+/* ------- */
+
+static short set_keytype_keyframe(BeztEditData *bed, BezTriple *bezt)
+{
+ if (bezt->f2 & SELECT)
+ BEZKEYTYPE(bezt)= BEZT_KEYTYPE_KEYFRAME;
+ return 0;
+}
+
+static short set_keytype_breakdown(BeztEditData *bed, BezTriple *bezt)
+{
+ if (bezt->f2 & SELECT)
+ BEZKEYTYPE(bezt)= BEZT_KEYTYPE_BREAKDOWN;
+ return 0;
+}
+
+/* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */
+BeztEditFunc ANIM_editkeyframes_keytype(short code)
+{
+ switch (code) {
+ case BEZT_KEYTYPE_BREAKDOWN: /* breakdown */
+ return set_keytype_breakdown;
+
+ case BEZT_KEYTYPE_KEYFRAME: /* proper keyframe */
+ default:
+ return set_keytype_keyframe;
+ }
+}
+
/* ******************************************* */
/* Selection */
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index fc67ee34a2e..f13d35c7d4a 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -127,11 +127,11 @@ void duplicate_fcurve_keys(FCurve *fcu)
{
BezTriple *newbezt;
int i;
-
- if (fcu == NULL)
+
+ /* this can only work when there is an F-Curve, and also when there are some BezTriples */
+ if ELEM(NULL, fcu, fcu->bezt)
return;
- // XXX this does not take into account sample data...
for (i=0; i < fcu->totvert; i++) {
/* If a key is selected */
if (fcu->bezt[i].f2 & SELECT) {
@@ -160,7 +160,7 @@ void duplicate_fcurve_keys(FCurve *fcu)
/* **************************************************** */
/* Various Tools */
-/* Basic IPO-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only */
+/* Basic F-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only */
void clean_fcurve(FCurve *fcu, float thresh)
{
BezTriple *old_bezts, *bezt, *beztn;
@@ -285,75 +285,145 @@ void smooth_fcurve (FCurve *fcu)
}
}
- /* if any points were selected, allocate tSmooth_Bezt points to work on */
- if (totSel >= 3) {
- tSmooth_Bezt *tarray, *tsb;
-
- /* allocate memory in one go */
- tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array");
-
- /* populate tarray with data of selected points */
- bezt= fcu->bezt;
- for (i=0, x=0; (i < fcu->totvert) && (x < totSel); i++, bezt++) {
- if (BEZSELECTED(bezt)) {
- /* tsb simply needs pointer to vec, and index */
- tsb->h1 = &bezt->vec[0][1];
- tsb->h2 = &bezt->vec[1][1];
- tsb->h3 = &bezt->vec[2][1];
-
- /* advance to the next tsb to populate */
- if (x < totSel- 1)
- tsb++;
- else
- break;
- }
+ /* if any points were selected, allocate tSmooth_Bezt points to work on */
+ if (totSel >= 3) {
+ tSmooth_Bezt *tarray, *tsb;
+
+ /* allocate memory in one go */
+ tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array");
+
+ /* populate tarray with data of selected points */
+ bezt= fcu->bezt;
+ for (i=0, x=0; (i < fcu->totvert) && (x < totSel); i++, bezt++) {
+ if (BEZSELECTED(bezt)) {
+ /* tsb simply needs pointer to vec, and index */
+ tsb->h1 = &bezt->vec[0][1];
+ tsb->h2 = &bezt->vec[1][1];
+ tsb->h3 = &bezt->vec[2][1];
+
+ /* advance to the next tsb to populate */
+ if (x < totSel- 1)
+ tsb++;
+ else
+ break;
}
+ }
- /* calculate the new smoothed F-Curve's with weighted averages:
- * - this is done with two passes
- * - uses 5 points for each operation (which stores in the relevant handles)
- * - previous: w/a ratio = 3:5:2:1:1
- * - next: w/a ratio = 1:1:2:5:3
- */
-
- /* round 1: calculate previous and next */
- tsb= tarray;
- for (i=0; i < totSel; i++, tsb++) {
- /* don't touch end points (otherwise, curves slowly explode) */
- if (ELEM(i, 0, (totSel-1)) == 0) {
- const tSmooth_Bezt *tP1 = tsb - 1;
- const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL);
- const tSmooth_Bezt *tN1 = tsb + 1;
- const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL);
-
- const float p1 = *tP1->h2;
- const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2);
- const float c1 = *tsb->h2;
- const float n1 = *tN1->h2;
- const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2);
+ /* calculate the new smoothed F-Curve's with weighted averages:
+ * - this is done with two passes
+ * - uses 5 points for each operation (which stores in the relevant handles)
+ * - previous: w/a ratio = 3:5:2:1:1
+ * - next: w/a ratio = 1:1:2:5:3
+ */
+
+ /* round 1: calculate previous and next */
+ tsb= tarray;
+ for (i=0; i < totSel; i++, tsb++) {
+ /* don't touch end points (otherwise, curves slowly explode) */
+ if (ELEM(i, 0, (totSel-1)) == 0) {
+ const tSmooth_Bezt *tP1 = tsb - 1;
+ const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL);
+ const tSmooth_Bezt *tN1 = tsb + 1;
+ const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL);
+
+ const float p1 = *tP1->h2;
+ const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2);
+ const float c1 = *tsb->h2;
+ const float n1 = *tN1->h2;
+ const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2);
+
+ /* calculate previous and next */
+ *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12;
+ *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12;
+ }
+ }
+
+ /* round 2: calculate new values and reset handles */
+ tsb= tarray;
+ for (i=0; i < totSel; i++, tsb++) {
+ /* calculate new position by averaging handles */
+ *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2;
- /* calculate previous and next */
- *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12;
- *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12;
+ /* reset handles now */
+ *tsb->h1 = *tsb->h2;
+ *tsb->h3 = *tsb->h2;
}
- }
-
- /* round 2: calculate new values and reset handles */
- tsb= tarray;
- for (i=0; i < totSel; i++, tsb++) {
- /* calculate new position by averaging handles */
- *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2;
- /* reset handles now */
- *tsb->h1 = *tsb->h2;
- *tsb->h3 = *tsb->h2;
+ /* free memory required for tarray */
+ MEM_freeN(tarray);
}
- /* free memory required for tarray */
- MEM_freeN(tarray);
+ /* recalculate handles */
+ calchandles_fcurve(fcu);
}
+
+/* ---------------- */
+
+/* little cache for values... */
+typedef struct tempFrameValCache {
+ float frame, val;
+} tempFrameValCache;
+
+
+/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
+void sample_fcurve (FCurve *fcu)
+{
+ BezTriple *bezt, *start=NULL, *end=NULL;
+ tempFrameValCache *value_cache, *fp;
+ int sfra, range;
+ int i, n, nIndex;
- /* recalculate handles */
+ /* find selected keyframes... once pair has been found, add keyframes */
+ for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {
+ /* check if selected, and which end this is */
+ if (BEZSELECTED(bezt)) {
+ if (start) {
+ /* set end */
+ end= bezt;
+
+ /* cache values then add keyframes using these values, as adding
+ * keyframes while sampling will affect the outcome...
+ * - only start sampling+adding from index=1, so that we don't overwrite original keyframe
+ */
+ range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) );
+ sfra= (int)( floor(start->vec[1][0]) );
+
+ if (range) {
+ value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache");
+
+ /* sample values */
+ for (n=1, fp=value_cache; n<range && fp; n++, fp++) {
+ fp->frame= (float)(sfra + n);
+ fp->val= evaluate_fcurve(fcu, fp->frame);
+ }
+
+ /* add keyframes with these, tagging as 'breakdowns' */
+ for (n=1, fp=value_cache; n<range && fp; n++, fp++) {
+ nIndex= insert_vert_fcurve(fcu, fp->frame, fp->val, 1);
+ BEZKEYTYPE(fcu->bezt + nIndex)= BEZT_KEYTYPE_BREAKDOWN;
+ }
+
+ /* free temp cache */
+ MEM_freeN(value_cache);
+
+ /* as we added keyframes, we need to compensate so that bezt is at the right place */
+ bezt = fcu->bezt + i + range - 1;
+ i += (range - 1);
+ }
+
+ /* bezt was selected, so it now marks the start of a whole new chain to search */
+ start= bezt;
+ end= NULL;
+ }
+ else {
+ /* just set start keyframe */
+ start= bezt;
+ end= NULL;
+ }
+ }
+ }
+
+ /* recalculate channel's handles? */
calchandles_fcurve(fcu);
}
@@ -371,7 +441,6 @@ ListBase animcopybuf = {NULL, NULL};
static float animcopy_firstframe= 999999999.0f;
/* datatype for use in copy/paste buffer */
-// XXX F-Curve editor should use this too
typedef struct tAnimCopybufItem {
struct tAnimCopybufItem *next, *prev;
@@ -530,8 +599,10 @@ short paste_animedit_keys (bAnimContext *ac, ListBase *anim_data)
bezt->vec[1][0] += offset;
bezt->vec[2][0] += offset;
- /* insert the keyframe */
- insert_bezt_fcurve(fcu, bezt);
+ /* insert the keyframe
+ * NOTE: no special flags here for now
+ */
+ insert_bezt_fcurve(fcu, bezt, 0);
/* un-apply offset from src beztriple after copying */
bezt->vec[0][0] -= offset;
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 7bee57708ec..d731ec6f148 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -262,9 +262,8 @@ static int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen
* NOTE: any recalculate of the F-Curve that needs to be done will need to
* be done by the caller.
*/
-int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt)
+int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag)
{
- BezTriple *newb;
int i= 0;
if (fcu->bezt) {
@@ -273,13 +272,34 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt)
if (replace) {
/* sanity check: 'i' may in rare cases exceed arraylen */
- // FIXME: do not overwrite handletype if just replacing...?
- if ((i >= 0) && (i < fcu->totvert))
- *(fcu->bezt + i) = *bezt;
+ if ((i >= 0) && (i < fcu->totvert)) {
+ /* take care with the handletypes and other info if the replacement flags are set */
+ if (flag & INSERTKEY_REPLACE) {
+ BezTriple *dst= (fcu->bezt + i);
+ float dy= bezt->vec[1][1] - dst->vec[1][1];
+
+ /* just apply delta value change to the handle values */
+ dst->vec[0][1] += dy;
+ dst->vec[1][1] += dy;
+ dst->vec[2][1] += dy;
+
+ // TODO: perform some other operations?
+ }
+ else {
+ /* just brutally replace the values */
+ *(fcu->bezt + i) = *bezt;
+ }
+ }
}
- else {
- /* add new */
- newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple");
+ else if ((flag & INSERTKEY_REPLACE) == 0) {
+ /* add new - if we're not restricted to replacing keyframes only */
+ BezTriple *newb;
+
+ /* allocate a new array only if we have to */
+ if ((flag & INSERTKEY_FASTR) == 0)
+ newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple");
+ else
+ newb= fcu->bezt;
/* add the beztriples that should occur before the beztriple to be pasted (originally in ei->icu) */
if (i > 0)
@@ -292,9 +312,11 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt)
if (i < fcu->totvert)
memcpy(newb+i+1, fcu->bezt+i, (fcu->totvert-i)*sizeof(BezTriple));
- /* replace (+ free) old with new */
- MEM_freeN(fcu->bezt);
- fcu->bezt= newb;
+ /* replace (+ free) old with new, only if necessary to do so */
+ if ((flag & INSERTKEY_FASTR) == 0) {
+ MEM_freeN(fcu->bezt);
+ fcu->bezt= newb;
+ }
fcu->totvert++;
}
@@ -313,13 +335,11 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt)
return i;
}
-/* This function is a wrapper for insert_bezt_icu, and should be used when
- * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere
- * else yet.
- *
- * 'fast' - is only for the python API where importing BVH's would take an extreamly long time.
+/* This function is a wrapper for insert_bezt_fcurve_internal(), and should be used when
+ * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere else yet.
+ * It returns the index at which the keyframe was added.
*/
-void insert_vert_fcurve (FCurve *fcu, float x, float y, short fast)
+int insert_vert_fcurve (FCurve *fcu, float x, float y, short flag)
{
BezTriple beztr;
int a;
@@ -337,21 +357,22 @@ void insert_vert_fcurve (FCurve *fcu, float x, float y, short fast)
beztr.h1= beztr.h2= HD_AUTO; // XXX what about when we replace an old one?
/* add temp beztriple to keyframes */
- a= insert_bezt_fcurve(fcu, &beztr);
+ a= insert_bezt_fcurve(fcu, &beztr, flag);
/* what if 'a' is a negative index?
* for now, just exit to prevent any segfaults
*/
- if (a < 0) return;
+ if (a < 0) return -1;
/* don't recalculate handles if fast is set
* - this is a hack to make importers faster
- * - we may calculate twice (see editipo_changed(), due to autohandle needing two calculations)
+ * - we may calculate twice (due to autohandle needing to be calculated twice)
*/
- if (!fast) calchandles_fcurve(fcu);
+ if ((flag & INSERTKEY_FAST) == 0)
+ calchandles_fcurve(fcu);
/* set handletype and interpolation */
- if (fcu->totvert > 2) {
+ if ((fcu->totvert > 2) && (flag & INSERTKEY_REPLACE)==0) {
BezTriple *bezt= (fcu->bezt + a);
char h1, h2;
@@ -370,10 +391,14 @@ void insert_vert_fcurve (FCurve *fcu, float x, float y, short fast)
/* don't recalculate handles if fast is set
* - this is a hack to make importers faster
- * - we may calculate twice (see editipo_changed(), due to autohandle needing two calculations)
+ * - we may calculate twice (due to autohandle needing to be calculated twice)
*/
- if (!fast) calchandles_fcurve(fcu);
+ if ((flag & INSERTKEY_FAST) == 0)
+ calchandles_fcurve(fcu);
}
+
+ /* return the index at which the keyframe was added */
+ return a;
}
/* -------------- 'Smarter' Keyframing Functions -------------------- */
@@ -503,19 +528,19 @@ static float setting_get_rna_value (PointerRNA *ptr, PropertyRNA *prop, int inde
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(ptr, prop))
value= (float)RNA_property_boolean_get_index(ptr, prop, index);
else
value= (float)RNA_property_boolean_get(ptr, prop);
break;
case PROP_INT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(ptr, prop))
value= (float)RNA_property_int_get_index(ptr, prop, index);
else
value= (float)RNA_property_int_get(ptr, prop);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(prop))
+ if (RNA_property_array_length(ptr, prop))
value= RNA_property_float_get_index(ptr, prop, index);
else
value= RNA_property_float_get(ptr, prop);
@@ -704,7 +729,7 @@ static float visualkey_get_value (PointerRNA *ptr, PropertyRNA *prop, int array_
float eul[3];
/* euler-rotation test before standard rotation, as standard rotation does quats */
- Mat4ToEul(tmat, eul);
+ Mat4ToEulO(tmat, eul, pchan->rotmode);
return eul[array_index];
}
else if (strstr(identifier, "rotation")) {
@@ -740,6 +765,12 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl
printf("ERROR: no F-Curve to add keyframes to \n");
return 0;
}
+ /* F-Curve not editable? */
+ if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) {
+ if (G.f & G_DEBUG)
+ printf("WARNING: not inserting keyframe for locked F-Curve \n");
+ return 0;
+ }
/* if no property given yet, try to validate from F-Curve info */
if ((ptr.id.data == NULL) && (ptr.data==NULL)) {
@@ -806,7 +837,7 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl
/* insert new keyframe at current frame */
if (insert_mode)
- insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST));
+ insert_vert_fcurve(fcu, cfra, curval, flag);
/* delete keyframe immediately before/after newly added */
switch (insert_mode) {
@@ -824,7 +855,7 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl
}
else {
/* just insert keyframe */
- insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST));
+ insert_vert_fcurve(fcu, cfra, curval, flag);
/* return success */
return 1;
@@ -911,8 +942,19 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_
/* we don't check the validity of the path here yet, but it should be ok... */
fcu= verify_fcurve(act, group, rna_path, array_index, 0);
- /* only continue if we have an F-Curve to remove keyframes from */
- if (act && fcu) {
+ /* check if F-Curve exists and/or whether it can be edited */
+ if ELEM(NULL, act, fcu) {
+ printf("ERROR: no F-Curve and/or Action to delete keyframe from \n");
+ return 0;
+ }
+ if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) {
+ if (G.f & G_DEBUG)
+ printf("WARNING: not inserting keyframe for locked F-Curve \n");
+ return 0;
+ }
+
+ /* it should be fine to continue now... */
+ {
short found = -1;
int i;
@@ -1286,6 +1328,15 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
short success= 0;
int a, index, length, all= RNA_boolean_get(op->ptr, "all");
+ short flag = 0;
+
+ /* flags for inserting keyframes */
+ if (IS_AUTOKEY_FLAG(AUTOMATKEY))
+ flag |= INSERTKEY_MATRIX;
+ if (IS_AUTOKEY_FLAG(INSERTNEEDED))
+ flag |= INSERTKEY_NEEDED;
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS))
+ flag |= INSERTKEY_REPLACE;
/* try to insert keyframe using property retrieved from UI */
memset(&ptr, 0, sizeof(PointerRNA));
@@ -1296,7 +1347,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
if (path) {
if (all) {
- length= RNA_property_array_length(prop);
+ length= RNA_property_array_length(&ptr, prop);
if(length) index= 0;
else length= 1;
@@ -1305,14 +1356,14 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
length= 1;
for (a=0; a<length; a++)
- success+= insert_keyframe(ptr.id.data, NULL, NULL, path, index+a, cfra, 0);
+ success+= insert_keyframe(ptr.id.data, NULL, NULL, path, index+a, cfra, flag);
MEM_freeN(path);
}
else if (ptr.type == &RNA_NlaStrip) {
/* handle special vars for NLA-strips */
NlaStrip *strip= (NlaStrip *)ptr.data;
- FCurve *fcu= list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), 0);
+ FCurve *fcu= list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), flag);
success+= insert_keyframe_direct(ptr, prop, fcu, cfra, 0);
}
@@ -1379,7 +1430,7 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
if (path) {
if (all) {
- length= RNA_property_array_length(prop);
+ length= RNA_property_array_length(&ptr, prop);
if(length) index= 0;
else length= 1;
@@ -1438,10 +1489,17 @@ int autokeyframe_cfra_can_key(Scene *scene, ID *id)
/* only filter if auto-key mode requires this */
if (IS_AUTOKEY_ON(scene) == 0)
return 0;
- else if (IS_AUTOKEY_MODE(scene, NORMAL))
+
+ if (IS_AUTOKEY_MODE(scene, NORMAL)) {
+ /* can insert anytime we like... */
return 1;
- else
+ }
+ else /* REPLACE */ {
+ /* for whole block - only key if there's a keyframe on that frame already
+ * this is a valid assumption when we're blocking + tweaking
+ */
return id_frame_has_keyframe(id, cfra, ANIMFILTER_KEYS_LOCAL);
+ }
}
/* ******************************************* */
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 01b8224298b..15d47211615 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -78,139 +78,174 @@
#include "anim_intern.h"
/* ************************************************** */
-/* KEYING SETS - EDITING API */
-
-/* Operators ------------------------------------------- */
-
-/* These operators are only provided for scripting/macro usage, not for direct
- * calling from the UI since they wrap some of the data-access API code for these
- * (defined in blenkernel) which have quite a few properties.
- */
+/* KEYING SETS - OPERATORS (for use in UI menus) */
-/* ----- */
+/* Add to KeyingSet Button Operator ------------------------ */
-static int keyingset_add_destination_exec (bContext *C, wmOperator *op)
+static int add_keyingset_button_exec (bContext *C, wmOperator *op)
{
+ Scene *scene= CTX_data_scene(C);
+ KeyingSet *ks = NULL;
+ PropertyRNA *prop= NULL;
PointerRNA ptr;
- KeyingSet *ks= NULL;
- ID *id= NULL;
- char rna_path[256], group_name[64]; // xxx
- short groupmode=0, flag=0;
- int array_index=0;
-
- /* get settings from operator properties */
- ptr = RNA_pointer_get(op->ptr, "keyingset");
- if (ptr.data)
- ks= (KeyingSet *)ptr.data;
-
- ptr = RNA_pointer_get(op->ptr, "id");
- if (ptr.data)
- id= (ID *)ptr.data;
-
- groupmode= RNA_enum_get(op->ptr, "grouping_method");
- RNA_string_get(op->ptr, "group_name", group_name);
-
- RNA_string_get(op->ptr, "rna_path", rna_path);
- array_index= RNA_int_get(op->ptr, "array_index");
-
- if (RNA_boolean_get(op->ptr, "entire_array"))
- flag |= KSP_FLAG_WHOLE_ARRAY;
-
- /* if enough args are provided, call API method */
- if (ks) {
- BKE_keyingset_add_destination(ks, id, group_name, rna_path, array_index, flag, groupmode);
- return OPERATOR_FINISHED;
+ char *path = NULL;
+ short success= 0;
+ int index=0, pflag=0;
+ int all= RNA_boolean_get(op->ptr, "all");
+
+ /* verify the Keying Set to use:
+ * - use the active one for now (more control over this can be added later)
+ * - add a new one if it doesn't exist
+ */
+ if (scene->active_keyingset == 0) {
+ short flag=0, keyingflag=0;
+
+ /* validate flags
+ * - absolute KeyingSets should be created by default
+ */
+ flag |= KEYINGSET_ABSOLUTE;
+
+ if (IS_AUTOKEY_FLAG(AUTOMATKEY))
+ keyingflag |= INSERTKEY_MATRIX;
+ if (IS_AUTOKEY_FLAG(INSERTNEEDED))
+ keyingflag |= INSERTKEY_NEEDED;
+
+ /* call the API func, and set the active keyingset index */
+ ks= BKE_keyingset_add(&scene->keyingsets, "ButtonKeyingSet", flag, keyingflag);
+
+ scene->active_keyingset= BLI_countlist(&scene->keyingsets);
}
- else {
- BKE_report(op->reports, RPT_ERROR, "Keying Set could not be added.");
- return OPERATOR_CANCELLED;
- }
+ else
+ ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
+
+ /* try to add to keyingset using property retrieved from UI */
+ memset(&ptr, 0, sizeof(PointerRNA));
+ uiAnimContextProperty(C, &ptr, &prop, &index);
+
+ /* check if property is able to be added */
+ if (ptr.data && prop && RNA_property_animateable(ptr.data, prop)) {
+ path= RNA_path_from_ID_to_property(&ptr, prop);
+
+ if (path) {
+ /* set flags */
+ if (all)
+ pflag |= KSP_FLAG_WHOLE_ARRAY;
+
+ /* add path to this setting */
+ BKE_keyingset_add_destination(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME);
+ success= 1;
+
+ /* free the temp path created */
+ MEM_freeN(path);
+ }
+ }
+
+ if (success) {
+ /* send updates */
+ ED_anim_dag_flush_update(C);
+
+ /* for now, only send ND_KEYS for KeyingSets */
+ WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL);
+ }
+
+ return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
}
-void ANIM_OT_keyingset_add_destination (wmOperatorType *ot)
+void ANIM_OT_add_keyingset_button (wmOperatorType *ot)
{
- // XXX: this is also defined in rna_animation.c
- static EnumPropertyItem prop_mode_grouping_items[] = {
- {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""},
- {KSP_GROUP_NONE, "NONE", 0, "None", ""},
- {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""},
- {0, NULL, 0, NULL, NULL}};
-
/* identifiers */
- ot->name= "Add Keying Set Destination";
- ot->idname= "ANIM_OT_keyingset_add_destination";
+ ot->name= "Add to Keying Set";
+ ot->idname= "ANIM_OT_add_keyingset_button";
/* callbacks */
- ot->exec= keyingset_add_destination_exec;
- ot->poll= ED_operator_scene_editable;
-
- /* props */
- /* pointers */ // xxx - do we want to directly expose these?
- RNA_def_pointer_runtime(ot->srna, "keyingset", &RNA_KeyingSet, "Keying Set", "Keying Set to add destination to.");
- RNA_def_pointer_runtime(ot->srna, "id", &RNA_ID, "ID", "ID-block for the destination.");
- /* grouping */
- RNA_def_enum(ot->srna, "grouping_method", prop_mode_grouping_items, KSP_GROUP_NAMED, "Grouping Method", "Method used to define which Group-name to use.");
- RNA_def_string(ot->srna, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name).");
- /* rna-path */
- RNA_def_string(ot->srna, "rna_path", "", 256, "RNA-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough
- RNA_def_int(ot->srna, "array_index", 0, 0, INT_MAX, "Array Index", "If applicable, the index ", 0, INT_MAX);
- /* flags */
- RNA_def_boolean(ot->srna, "entire_array", 1, "Entire Array", "hen an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used.");
+ ot->exec= add_keyingset_button_exec;
+ //op->poll= ???
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Add all elements of the array to a Keying Set.");
}
-
-/* ----- */
-static int keyingset_add_new_exec (bContext *C, wmOperator *op)
+/* Remove from KeyingSet Button Operator ------------------------ */
+
+static int remove_keyingset_button_exec (bContext *C, wmOperator *op)
{
- Scene *sce= CTX_data_scene(C);
- KeyingSet *ks= NULL;
- short flag=0, keyingflag=0;
- char name[64];
+ Scene *scene= CTX_data_scene(C);
+ KeyingSet *ks = NULL;
+ PropertyRNA *prop= NULL;
+ PointerRNA ptr;
+ char *path = NULL;
+ short success= 0;
+ int index=0;
- /* get settings from operator properties */
- RNA_string_get(op->ptr, "name", name);
+ /* verify the Keying Set to use:
+ * - use the active one for now (more control over this can be added later)
+ * - return error if it doesn't exist
+ */
+ if (scene->active_keyingset == 0) {
+ BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove property from");
+ return OPERATOR_CANCELLED;
+ }
+ else
+ ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
- if (RNA_boolean_get(op->ptr, "absolute"))
- flag |= KEYINGSET_ABSOLUTE;
- if (RNA_boolean_get(op->ptr, "insertkey_needed"))
- keyingflag |= INSERTKEY_NEEDED;
- if (RNA_boolean_get(op->ptr, "insertkey_visual"))
- keyingflag |= INSERTKEY_MATRIX;
+ /* try to add to keyingset using property retrieved from UI */
+ memset(&ptr, 0, sizeof(PointerRNA));
+ uiAnimContextProperty(C, &ptr, &prop, &index);
+
+ if (ptr.data && prop) {
+ path= RNA_path_from_ID_to_property(&ptr, prop);
- /* call the API func, and set the active keyingset index */
- ks= BKE_keyingset_add(&sce->keyingsets, name, flag, keyingflag);
-
- if (ks) {
- sce->active_keyingset= BLI_countlist(&sce->keyingsets);
- return OPERATOR_FINISHED;
+ if (path) {
+ KS_Path *ksp;
+
+ /* try to find a path matching this description */
+ ksp= BKE_keyingset_find_destination(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME);
+
+ if (ksp) {
+ /* just free it... */
+ MEM_freeN(ksp->rna_path);
+ BLI_freelinkN(&ks->paths, ksp);
+
+ success= 1;
+ }
+
+ /* free temp path used */
+ MEM_freeN(path);
+ }
}
- else {
- BKE_report(op->reports, RPT_ERROR, "Keying Set could not be added.");
- return OPERATOR_CANCELLED;
+
+
+ if (success) {
+ /* send updates */
+ ED_anim_dag_flush_update(C);
+
+ /* for now, only send ND_KEYS for KeyingSets */
+ WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL);
}
+
+ return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
}
-void ANIM_OT_keyingset_add_new (wmOperatorType *ot)
+void ANIM_OT_remove_keyingset_button (wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Add Keying Set";
- ot->idname= "ANIM_OT_keyingset_add_new";
+ ot->name= "Remove from Keying Set";
+ ot->idname= "ANIM_OT_remove_keyingset_button";
/* callbacks */
- ot->exec= keyingset_add_new_exec;
- ot->poll= ED_operator_scene_editable;
-
- /* props */
- /* name */
- RNA_def_string(ot->srna, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
- /* flags */
- RNA_def_boolean(ot->srna, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
- /* keying flags */
- RNA_def_boolean(ot->srna, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves.");
- RNA_def_boolean(ot->srna, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
+ ot->exec= remove_keyingset_button_exec;
+ //op->poll= ???
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
+/* ************************************************** */
+/* KEYING SETS - EDITING API */
+
/* UI API --------------------------------------------- */
/* Build menu-string of available keying-sets (allocates memory for string)
@@ -735,7 +770,7 @@ static bBuiltinKeyingSet def_builtin_keyingsets_v3d[] =
/* Keying Set - "Rotation" ---------- */
BI_KS_DEFINE_BEGIN("Rotation", 0)
BI_KS_PATHS_BEGIN(1)
- BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
+ BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
BI_KS_PATHS_END
BI_KS_DEFINE_END,
@@ -751,7 +786,7 @@ static bBuiltinKeyingSet def_builtin_keyingsets_v3d[] =
BI_KS_DEFINE_BEGIN("LocRot", 0)
BI_KS_PATHS_BEGIN(2)
BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM),
- BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
+ BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
BI_KS_PATHS_END
BI_KS_DEFINE_END,
@@ -759,7 +794,7 @@ static bBuiltinKeyingSet def_builtin_keyingsets_v3d[] =
BI_KS_DEFINE_BEGIN("LocRotScale", 0)
BI_KS_PATHS_BEGIN(3)
BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM),
- BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM),
+ BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM),
BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "scale", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
BI_KS_PATHS_END
BI_KS_DEFINE_END,
@@ -775,7 +810,7 @@ static bBuiltinKeyingSet def_builtin_keyingsets_v3d[] =
/* Keying Set - "Rotation" ---------- */
BI_KS_DEFINE_BEGIN("VisualRot", 0)
BI_KS_PATHS_BEGIN(1)
- BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "rotation", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
+ BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
BI_KS_PATHS_END
BI_KS_DEFINE_END,
@@ -783,7 +818,7 @@ static bBuiltinKeyingSet def_builtin_keyingsets_v3d[] =
BI_KS_DEFINE_BEGIN("VisualLocRot", 0)
BI_KS_PATHS_BEGIN(2)
BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM),
- BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "rotation", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
+ BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM)
BI_KS_PATHS_END
BI_KS_DEFINE_END
};
@@ -899,7 +934,7 @@ short keyingset_context_ok_poll (bContext *C, KeyingSet *ks)
Object *obact= CTX_data_active_object(C);
/* if in posemode, check if 'pose-channels' requested for in KeyingSet */
- if ((obact && obact->pose) && (obact->flag & OB_POSEMODE)) {
+ if ((obact && obact->pose) && (obact->mode & OB_MODE_POSE)) {
/* check for posechannels */
}
@@ -930,7 +965,7 @@ static short modifykey_get_context_v3d_data (bContext *C, ListBase *dsources, Ke
/* check if the active object is in PoseMode (i.e. only deal with bones) */
// TODO: check with the templates to see what we really need to store
- if ((obact && obact->pose) && (obact->flag & OB_POSEMODE)) {
+ if ((obact && obact->pose) && (obact->mode & OB_MODE_POSE)) {
/* Pose Mode: Selected bones */
#if 0
//set_pose_keys(ob); /* sets pchan->flag to POSE_KEY if bone selected, and clears if not */
@@ -1010,6 +1045,7 @@ short modifykey_get_context_data (bContext *C, ListBase *dsources, KeyingSet *ks
*/
int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra)
{
+ Scene *scene= CTX_data_scene(C);
KS_Path *ksp;
int kflag=0, success= 0;
char *groupname= NULL;
@@ -1022,7 +1058,7 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet *
/* suppliment with info from the context */
if (IS_AUTOKEY_FLAG(AUTOMATKEY)) kflag |= INSERTKEY_MATRIX;
if (IS_AUTOKEY_FLAG(INSERTNEEDED)) kflag |= INSERTKEY_NEEDED;
- // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE;
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS)) kflag |= INSERTKEY_REPLACE;
}
else if (mode == MODIFYKEY_MODE_DELETE)
kflag= 0;
@@ -1047,7 +1083,7 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet *
* normal non-array entries get keyframed correctly
*/
i= ksp->array_index;
- arraylen= i+1;
+ arraylen= i;
/* get length of array if whole array option is enabled */
if (ksp->flag & KSP_FLAG_WHOLE_ARRAY) {
@@ -1056,9 +1092,13 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet *
RNA_id_pointer_create(ksp->id, &id_ptr);
if (RNA_path_resolve(&id_ptr, ksp->rna_path, &ptr, &prop) && prop)
- arraylen= RNA_property_array_length(prop);
+ arraylen= RNA_property_array_length(&ptr, prop);
}
+ /* we should do at least one step */
+ if (arraylen == i)
+ arraylen++;
+
/* for each possible index, perform operation
* - assume that arraylen is greater than index
*/
@@ -1131,7 +1171,21 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet *
/* add property stored in KeyingSet Path */
if (BLI_dynstr_get_len(pathds))
BLI_dynstr_append(pathds, ".");
- BLI_dynstr_append(pathds, ksp->rna_path);
+
+ /* apply some further templates? */
+ if ((ksp->templates & KSP_TEMPLATE_PCHAN_ROT) && (cks->pchan)) {
+ /* if this path is exactly "rotation", and the rotation mode is set to eulers,
+ * use "euler_rotation" instead so that rotations will be keyed correctly
+ */
+ if (strcmp(ksp->rna_path, "rotation")==0 && (cks->pchan->rotmode))
+ BLI_dynstr_append(pathds, "euler_rotation");
+ else
+ BLI_dynstr_append(pathds, ksp->rna_path);
+ }
+ else {
+ /* just directly use the path */
+ BLI_dynstr_append(pathds, ksp->rna_path);
+ }
/* convert to C-string */
path= BLI_dynstr_get_cstring(pathds);
@@ -1161,7 +1215,7 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet *
RNA_id_pointer_create(cks->id, &id_ptr);
if (RNA_path_resolve(&id_ptr, path, &ptr, &prop) && prop)
- arraylen= RNA_property_array_length(prop);
+ arraylen= RNA_property_array_length(&ptr, prop);
}
/* for each possible index, perform operation
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index a5028973e4b..9f83733a640 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -99,7 +99,7 @@
/* ************* XXX *************** */
static int okee() {return 0;}
-static void BIF_undo_push() {}
+static void BIF_undo_push(const char *msg) {}
/* ************* XXX *************** */
/* **************** tools on Editmode Armature **************** */
@@ -713,7 +713,7 @@ int join_armature_exec(bContext *C, wmOperator *op)
/* get pose of active object and move it out of posemode */
pose= ob->pose;
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
if ((base->object->type==OB_ARMATURE) && (base->object!=ob)) {
@@ -724,8 +724,8 @@ int join_armature_exec(bContext *C, wmOperator *op)
/* Get Pose of current armature */
opose= base->object->pose;
- base->object->flag &= ~OB_POSEMODE;
- BASACT->flag &= ~OB_POSEMODE;
+ base->object->mode &= ~OB_MODE_POSE;
+ //BASACT->flag &= ~OB_MODE_POSE;
/* Find the difference matrix */
Mat4Invert(oimat, ob->obmat);
@@ -1034,8 +1034,8 @@ static int separate_armature_exec (bContext *C, wmOperator *op)
/* 1) store starting settings and exit editmode */
oldob= obedit;
oldbase= BASACT;
- oldob->flag &= ~OB_POSEMODE;
- oldbase->flag &= ~OB_POSEMODE;
+ oldob->mode &= ~OB_MODE_POSE;
+ //oldbase->flag &= ~OB_POSEMODE;
ED_armature_from_edit(scene, obedit);
ED_armature_edit_free(obedit);
@@ -4332,7 +4332,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
}
/* in weightpaint we select the associated vertex group too */
- if (G.f & G_WEIGHTPAINT) {
+ if (ob->mode & OB_MODE_WEIGHT_PAINT) {
if (nearBone->flag & BONE_ACTIVE) {
vertexgroup_select_by_name(OBACT, nearBone->name);
DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA);
@@ -4424,7 +4424,7 @@ static int bone_skinnable(Object *ob, Bone *bone, void *datap)
int a, segments;
struct { Object *armob; void *list; int heat; } *data = datap;
- if(!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
+ if(!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
if (!(bone->flag & BONE_NO_DEFORM)) {
if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
segments = bone->segments;
@@ -4489,7 +4489,7 @@ static int dgroup_skinnable(Object *ob, Bone *bone, void *datap)
int a, segments;
struct { Object *armob; void *list; int heat; } *data= datap;
- if (!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
+ if (!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
if (!(bone->flag & BONE_NO_DEFORM)) {
if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
segments = bone->segments;
@@ -4588,7 +4588,7 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m
float (*root)[3], (*tip)[3], (*verts)[3];
int *selected;
int numbones, vertsfilled = 0, i, j, segments = 0;
- int wpmode = (G.f & G_WEIGHTPAINT);
+ int wpmode = (ob->mode & OB_MODE_WEIGHT_PAINT);
struct { Object *armob; void *list; int heat; } looper_data;
looper_data.armob = par;
@@ -5387,7 +5387,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op)
Object *ob= CTX_data_edit_object(C);
bArmature *arm;
char newname[32];
- short axis= RNA_enum_get(op->ptr, "axis");
+ short axis= RNA_enum_get(op->ptr, "type");
/* paranoia checks */
if (ELEM(NULL, ob, ob->pose))
@@ -5434,7 +5434,7 @@ void ARMATURE_OT_autoside_names (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* settings */
- RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with.");
+ RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with.");
}
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index a1ce256a1af..1d87ca8a6df 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -466,12 +466,12 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo
{
if (template_name[i+1] == 'S' || template_name[i+1] == 's')
{
- j += sprintf(name + j, side_string);
+ j += sprintf(name + j, "%s", side_string);
i++;
}
else if (template_name[i+1] == 'N' || template_name[i+1] == 'n')
{
- j += sprintf(name + j, num_string);
+ j += sprintf(name + j, "%s", num_string);
i++;
}
else
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index f3f7bccde04..79d3d7b1366 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -2320,7 +2320,7 @@ void sk_drawSketch(Scene *scene, View3D *v3d, SK_Sketch *sketch, int with_names)
for (p = sketch->depth_peels.first; p; p = p->next)
{
- int index = (int)(p->ob);
+ int index = GET_INT_FROM_POINTER(p->ob);
index = (index >> 5) & 7;
glColor3fv(colors[index]);
@@ -2466,8 +2466,10 @@ static int sketch_delete(bContext *C, wmOperator *op, wmEvent *event)
void BIF_sk_selectStroke(bContext *C, short mval[2], short extend)
{
+ ToolSettings *ts = CTX_data_tool_settings(C);
SK_Sketch *sketch = contextSketch(C, 0);
- if (sketch)
+
+ if (sketch != NULL && ts->bone_sketching & BONE_SKETCHING)
{
sk_selectStroke(C, sketch, mval, extend);
}
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 8807b21e653..1b167518a5a 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -65,7 +65,7 @@
/* ************* XXX *************** */
-static void waitcursor() {}
+static void waitcursor(int val) {}
static void progress_bar() {}
static void start_progress_bar() {}
static void end_progress_bar() {}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index ef2e5188487..021bec05a3b 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -342,7 +342,7 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt)
uiItemIntO(layout, "Add New (Current Frame)", 0, "POSELIB_OT_pose_add", "frame", CFRA);
/* replace existing - submenu */
- uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu);
+ uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu, NULL);
}
uiPupMenuEnd(C, pup);
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 174bb39d7b9..9a72fce2bcf 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -126,7 +126,7 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
switch (ob->type){
case OB_ARMATURE:
- ob->flag |= OB_POSEMODE;
+ ob->mode |= OB_MODE_POSE;
base->flag= ob->flag;
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_POSE, NULL);
@@ -135,7 +135,8 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
default:
return;
}
- ED_view3d_exit_paint_modes(C);
+
+ ED_object_toggle_modes(C, ob->mode);
}
void ED_armature_exit_posemode(bContext *C, Base *base)
@@ -143,7 +144,7 @@ void ED_armature_exit_posemode(bContext *C, Base *base)
if(base) {
Object *ob= base->object;
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
base->flag= ob->flag;
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
@@ -527,7 +528,7 @@ void pose_select_constraint_target(Scene *scene)
/* paranoia checks */
if (!ob && !ob->pose) return;
- if (ob==obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if (ob==obedit || (ob->mode & OB_MODE_POSE)==0) return;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if (arm->layer & pchan->bone->layer) {
@@ -715,7 +716,7 @@ void pose_copy_menu(Scene *scene)
/* paranoia checks */
if (ELEM(NULL, ob, ob->pose)) return;
- if ((ob==obedit) || (ob->flag & OB_POSEMODE)==0) return;
+ if ((ob==obedit) || (ob->mode & OB_MODE_POSE)==0) return;
/* find active */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -759,6 +760,7 @@ void pose_copy_menu(Scene *scene)
break;
case 2: /* Local Rotation */
QUATCOPY(pchan->quat, pchanact->quat);
+ VECCOPY(pchan->eul, pchanact->eul);
break;
case 3: /* Local Size */
VECCOPY(pchan->size, pchanact->size);
@@ -807,11 +809,14 @@ void pose_copy_menu(Scene *scene)
break;
case 10: /* Visual Rotation */
{
- float delta_mat[4][4], quat[4];
+ float delta_mat[4][4];
armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
- Mat4ToQuat(delta_mat, quat);
- QUATCOPY(pchan->quat, quat);
+
+ if (pchan->rotmode > 0)
+ Mat4ToEulO(delta_mat, pchan->eul, pchan->rotmode);
+ else
+ Mat4ToQuat(delta_mat, pchan->quat);
}
break;
case 11: /* Visual Size */
@@ -989,20 +994,20 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
/* check if rotation modes are compatible (i.e. do they need any conversions) */
if (pchan->rotmode == chan->rotmode) {
/* copy the type of rotation in use */
- if (pchan->rotmode) {
+ if (pchan->rotmode > 0) {
VECCOPY(pchan->eul, chan->eul);
}
else {
QUATCOPY(pchan->quat, chan->quat);
}
}
- else if (pchan->rotmode) {
+ else if (pchan->rotmode > 0) {
/* quat to euler */
- QuatToEul(chan->quat, pchan->eul);
+ QuatToEulO(chan->quat, pchan->eul, pchan->rotmode);
}
else {
/* euler to quat */
- EulToQuat(chan->eul, pchan->quat);
+ EulOToQuat(chan->eul, chan->rotmode, pchan->quat);
}
/* paste flipped pose? */
@@ -1010,7 +1015,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
pchan->loc[0]*= -1;
/* has to be done as eulers... */
- if (pchan->rotmode) {
+ if (pchan->rotmode > 0) {
pchan->eul[1] *= -1;
pchan->eul[2] *= -1;
}
@@ -1105,7 +1110,7 @@ void pose_adds_vgroups(Scene *scene, Object *meshobj, int heatweights)
// XXX extern VPaint Gwp; /* from vpaint */
Object *poseobj= modifiers_isDeformedByArmature(meshobj);
- if(poseobj==NULL || (poseobj->flag & OB_POSEMODE)==0) {
+ if(poseobj==NULL || (poseobj->mode & OB_MODE_POSE)==0) {
error("The active object must have a deforming armature in pose mode");
return;
}
@@ -1646,10 +1651,10 @@ void pose_activate_flipped_bone(Scene *scene)
if(ob==NULL) return;
- if(G.f & G_WEIGHTPAINT) {
+ if(ob->mode && OB_MODE_WEIGHT_PAINT) {
ob= modifiers_isDeformedByArmature(ob);
}
- if(ob && (ob->flag & OB_POSEMODE)) {
+ if(ob && (ob->mode & OB_MODE_POSE)) {
bPoseChannel *pchan, *pchanf;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -1670,7 +1675,7 @@ void pose_activate_flipped_bone(Scene *scene)
pchanf->bone->flag |= (BONE_SELECTED|BONE_ACTIVE);
/* in weightpaint we select the associated vertex group too */
- if(G.f & G_WEIGHTPAINT) {
+ if(ob->mode & OB_MODE_WEIGHT_PAINT) {
vertexgroup_select_by_name(OBACT, name);
DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA);
}
@@ -2150,7 +2155,7 @@ void pose_special_editmenu(Scene *scene)
/* paranoia checks */
if(!ob && !ob->pose) return;
- if(ob==obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if(ob==obedit || (ob->mode & OB_MODE_POSE)==0) return;
nr= pupmenu("Specials%t|Select Constraint Target%x1|Flip Left-Right Names%x2|Calculate Paths%x3|Clear Paths%x4|Clear User Transform %x5|Relax Pose %x6|%l|AutoName Left-Right%x7|AutoName Front-Back%x8|AutoName Top-Bottom%x9");
if(nr==1) {
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index 6006c7e656b..d3bcdcb69bb 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -202,8 +202,11 @@ void ED_keymap_curve(wmWindowManager *wm)
RNA_int_set(WM_keymap_add_item(keymap, "FONT_OT_change_character", DOWNARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "delta", -1);
WM_keymap_add_item(keymap, "FONT_OT_text_copy", CKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "FONT_OT_text_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "FONT_OT_text_cut", XKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "FONT_OT_text_paste", PKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "FONT_OT_text_cut", XKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "FONT_OT_text_paste", VKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "FONT_OT_text_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "FONT_OT_line_break", RETKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FONT_OT_text_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last!
diff --git a/source/blender/editors/datafiles/blenderbuttons.c b/source/blender/editors/datafiles/blenderbuttons.c
index d7916989cae..722e3ada57b 100644
--- a/source/blender/editors/datafiles/blenderbuttons.c
+++ b/source/blender/editors/datafiles/blenderbuttons.c
@@ -1,5530 +1,5609 @@
/* DataToC output of file <blenderbuttons> */
-int datatoc_blenderbuttons_size= 176743;
+int datatoc_blenderbuttons_size= 179274;
char datatoc_blenderbuttons[]= {
-137, 80, 78, 71, 13, 10, 26,
- 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 88, 0, 0, 2,128, 8, 6, 0, 0, 0, 64, 11, 6,158, 0, 0, 10, 79,105, 67,
- 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112,114,111,102,105,108,101, 0, 0,120,218,157, 83,103, 84, 83,
-233, 22, 61,247,222,244, 66, 75,136,128,148, 75,111, 82, 21, 8, 32, 82, 66,139,128, 20,145, 38, 42, 33, 9, 16, 74,136, 33,161,
-217, 21, 81,193, 17, 69, 69, 4, 27,200,160,136, 3,142,142,128,140, 21, 81, 44, 12,138, 10,216, 7,228, 33,162,142,131,163,136,
-138,202,251,225,123,163,107,214,188,247,230,205,254,181,215, 62,231,172,243,157,179,207, 7,192, 8, 12,150, 72, 51, 81, 53,128,
- 12,169, 66, 30, 17,224,131,199,196,198,225,228, 46, 64,129, 10, 36,112, 0, 16, 8,179,100, 33,115,253, 35, 1, 0,248,126, 60,
- 60, 43, 34,192, 7,190, 0, 1,120,211, 11, 8, 0,192, 77,155,192, 48, 28,135,255, 15,234, 66,153, 92, 1,128,132, 1,192,116,
-145, 56, 75, 8,128, 20, 0, 64,122,142, 66,166, 0, 64, 70, 1,128,157,152, 38, 83, 0,160, 4, 0, 96,203, 99, 98,227, 0, 80,
- 45, 0, 96, 39,127,230,211, 0,128,157,248,153,123, 1, 0, 91,148, 33, 21, 1,160,145, 0, 32, 19,101,136, 68, 0,104, 59, 0,
-172,207, 86,138, 69, 0, 88, 48, 0, 20,102, 75,196, 57, 0,216, 45, 0, 48, 73, 87,102, 72, 0,176,183, 0,192,206, 16, 11,178,
- 0, 8, 12, 0, 48, 81,136,133, 41, 0, 4,123, 0, 96,200, 35, 35,120, 0,132,153, 0, 20, 70,242, 87, 60,241, 43,174, 16,231,
- 42, 0, 0,120,153,178, 60,185, 36, 57, 69,129, 91, 8, 45,113, 7, 87, 87, 46, 30, 40,206, 73, 23, 43, 20, 54, 97, 2, 97,154,
- 64, 46,194,121,153, 25, 50,129, 52, 15,224,243,204, 0, 0,160,145, 21, 17,224,131,243,253,120,206, 14,174,206,206, 54,142,182,
- 14, 95, 45,234,191, 6,255, 34, 98, 98,227,254,229,207,171,112, 64, 0, 0,225,116,126,209,254, 44, 47,179, 26,128, 59, 6,128,
-109,254,162, 37,238, 4,104, 94, 11,160,117,247,139,102,178, 15, 64,181, 0,160,233,218, 87,243,112,248,126, 60, 60, 69,161,144,
-185,217,217,229,228,228,216, 74,196, 66, 91, 97,202, 87,125,254,103,194, 95,192, 87,253,108,249,126, 60,252,247,245,224,190,226,
- 36,129, 50, 93,129, 71, 4,248,224,194,204,244, 76,165, 28,207,146, 9,132, 98,220,230,143, 71,252,183, 11,255,252, 29,211, 34,
-196, 73, 98,185, 88, 42, 20,227, 81, 18,113,142, 68,154,140,243, 50,165, 34,137, 66,146, 41,197, 37,210,255,100,226,223, 44,251,
- 3, 62,223, 53, 0,176,106, 62, 1,123,145, 45,168, 93, 99, 3,246, 75, 39, 16, 88,116,192,226,247, 0, 0,242,187,111,193,212,
- 40, 8, 3,128,104,131,225,207,119,255,239, 63,253, 71,160, 37, 0,128,102, 73,146,113, 0, 0, 94, 68, 36, 46, 84,202,179, 63,
-199, 8, 0, 0, 68,160,129, 42,176, 65, 27,244,193, 24, 44,192, 6, 28,193, 5,220,193, 11,252, 96, 54,132, 66, 36,196,194, 66,
- 16, 66, 10,100,128, 28,114, 96, 41,172,130, 66, 40,134,205,176, 29, 42, 96, 47,212, 64, 29, 52,192, 81,104,134,147,112, 14, 46,
-194, 85,184, 14, 61,112, 15,250, 97, 8,158,193, 40,188,129, 9, 4, 65,200, 8, 19, 97, 33,218,136, 1, 98,138, 88, 35,142, 8,
- 23,153,133,248, 33,193, 72, 4, 18,139, 36, 32,201,136, 20, 81, 34, 75,145, 53, 72, 49, 82,138, 84, 32, 85, 72, 29,242, 61,114,
- 2, 57,135, 92, 70,186,145, 59,200, 0, 50,130,252,134,188, 71, 49,148,129,178, 81, 61,212, 12,181, 67,185,168, 55, 26,132, 70,
-162, 11,208,100,116, 49,154,143, 22,160,155,208,114,180, 26, 61,140, 54,161,231,208,171,104, 15,218,143, 62, 67,199, 48,192,232,
- 24, 7, 51,196,108, 48, 46,198,195, 66,177, 56, 44, 9,147, 99,203,177, 34,172, 12,171,198, 26,176, 86,172, 3,187,137,245, 99,
-207,177,119, 4, 18,129, 69,192, 9, 54, 4,119, 66, 32, 97, 30, 65, 72, 88, 76, 88, 78,216, 72,168, 32, 28, 36, 52, 17,218, 9,
- 55, 9, 3,132, 81,194, 39, 34,147,168, 75,180, 38,186, 17,249,196, 24, 98, 50, 49,135, 88, 72, 44, 35,214, 18,143, 19, 47, 16,
-123,136, 67,196, 55, 36, 18,137, 67, 50, 39,185,144, 2, 73,177,164, 84,210, 18,210, 70,210,110, 82, 35,233, 44,169,155, 52, 72,
- 26, 35,147,201,218,100,107,178, 7, 57,148, 44, 32, 43,200,133,228,157,228,195,228, 51,228, 27,228, 33,242, 91, 10,157, 98, 64,
-113,164,248, 83,226, 40, 82,202,106, 74, 25,229, 16,229, 52,229, 6,101,152, 50, 65, 85,163,154, 82,221,168,161, 84, 17, 53,143,
- 90, 66,173,161,182, 82,175, 81,135,168, 19, 52,117,154, 57,205,131, 22, 73, 75,165,173,162,149,211, 26,104, 23,104,247,105,175,
-232,116,186, 17,221,149, 30, 78,151,208, 87,210,203,233, 71,232,151,232, 3,244,119, 12, 13,134, 21,131,199,136,103, 40, 25,155,
- 24, 7, 24,103, 25,119, 24,175,152, 76,166, 25,211,139, 25,199, 84, 48, 55, 49,235,152,231,153, 15,153,111, 85, 88, 42,182, 42,
-124, 21,145,202, 10,149, 74,149, 38,149, 27, 42, 47, 84,169,170,166,170,222,170, 11, 85,243, 85,203, 84,143,169, 94, 83,125,174,
- 70, 85, 51, 83,227,169, 9,212,150,171, 85,170,157, 80,235, 83, 27, 83,103,169, 59,168,135,170,103,168,111, 84, 63,164,126, 89,
-253,137, 6, 89,195, 76,195, 79, 67,164, 81,160,177, 95,227,188,198, 32, 11, 99, 25,179,120, 44, 33,107, 13,171,134,117,129, 53,
-196, 38,177,205,217,124,118, 42,187,152,253, 29,187,139, 61,170,169,161, 57, 67, 51, 74, 51, 87,179, 82,243,148,102, 63, 7,227,
-152,113,248,156,116, 78, 9,231, 40,167,151,243,126,138,222, 20,239, 41,226, 41, 27,166, 52, 76,185, 49,101, 92,107,170,150,151,
-150, 88,171, 72,171, 81,171, 71,235,189, 54,174,237,167,157,166,189, 69,187, 89,251,129, 14, 65,199, 74, 39, 92, 39, 71,103,143,
-206, 5,157,231, 83,217, 83,221,167, 10,167, 22, 77, 61, 58,245,174, 46,170,107,165, 27,161,187, 68,119,191,110,167,238,152,158,
-190, 94,128,158, 76,111,167,222,121,189,231,250, 28,125, 47,253, 84,253,109,250,167,245, 71, 12, 88, 6,179, 12, 36, 6,219, 12,
-206, 24, 60,197, 53,113,111, 60, 29, 47,199,219,241, 81, 67, 93,195, 64, 67,165, 97,149, 97,151,225,132,145,185,209, 60,163,213,
- 70,141, 70, 15,140,105,198, 92,227, 36,227,109,198,109,198,163, 38, 6, 38, 33, 38, 75, 77,234, 77,238,154, 82, 77,185,166, 41,
-166, 59, 76, 59, 76,199,205,204,205,162,205,214,153, 53,155, 61, 49,215, 50,231,155,231,155,215,155,223,183, 96, 90,120, 90, 44,
-182,168,182,184,101, 73,178,228, 90,166, 89,238,182,188,110,133, 90, 57, 89,165, 88, 85, 90, 93,179, 70,173,157,173, 37,214,187,
-173,187,167, 17,167,185, 78,147, 78,171,158,214,103,195,176,241,182,201,182,169,183, 25,176,229,216, 6,219,174,182,109,182,125,
- 97,103, 98, 23,103,183,197,174,195,238,147,189,147,125,186,125,141,253, 61, 7, 13,135,217, 14,171, 29, 90, 29,126,115,180,114,
- 20, 58, 86, 58,222,154,206,156,238, 63,125,197,244,150,233, 47,103, 88,207, 16,207,216, 51,227,182, 19,203, 41,196,105,157, 83,
-155,211, 71,103, 23,103,185,115,131,243,136,139,137, 75,130,203, 46,151, 62, 46,155, 27,198,221,200,189,228, 74,116,245,113, 93,
-225,122,210,245,157,155,179,155,194,237,168,219,175,238, 54,238,105,238,135,220,159,204, 52,159, 41,158, 89, 51,115,208,195,200,
- 67,224, 81,229,209, 63, 11,159,149, 48,107,223,172,126, 79, 67, 79,129,103,181,231, 35, 47, 99, 47,145, 87,173,215,176,183,165,
-119,170,247, 97,239, 23, 62,246, 62,114,159,227, 62,227, 60, 55,222, 50,222, 89, 95,204, 55,192,183,200,183,203, 79,195,111,158,
- 95,133,223, 67,127, 35,255,100,255,122,255,209, 0,167,128, 37, 1,103, 3,137,129, 65,129, 91, 2,251,248,122,124, 33,191,142,
- 63, 58,219,101,246,178,217,237, 65,140,160,185, 65, 21, 65,143,130,173,130,229,193,173, 33,104,200,236,144,173, 33,247,231,152,
-206,145,206,105, 14,133, 80,126,232,214,208, 7, 97,230, 97,139,195,126, 12, 39,133,135,133, 87,134, 63,142,112,136, 88, 26,209,
- 49,151, 53,119,209,220, 67,115,223, 68,250, 68,150, 68,222,155,103, 49, 79, 57,175, 45, 74, 53, 42, 62,170, 46,106, 60,218, 55,
-186, 52,186, 63,198, 46,102, 89,204,213, 88,157, 88, 73,108, 75, 28, 57, 46, 42,174, 54,110,108,190,223,252,237,243,135,226,157,
-226, 11,227,123, 23,152, 47,200, 93,112,121,161,206,194,244,133,167, 22,169, 46, 18, 44, 58,150, 64, 76,136, 78, 56,148,240, 65,
- 16, 42,168, 22,140, 37,242, 19,119, 37,142, 10,121,194, 29,194,103, 34, 47,209, 54,209,136,216, 67, 92, 42, 30, 78,242, 72, 42,
- 77,122,146,236,145,188, 53,121, 36,197, 51,165, 44,229,185,132, 39,169,144,188, 76, 13, 76,221,155, 58,158, 22,154,118, 32,109,
- 50, 61, 58,189, 49,131,146,145,144,113, 66,170, 33, 77,147,182,103,234,103,230,102,118,203,172,101,133,178,254,197,110,139,183,
- 47, 30,149, 7,201,107,179,144,172, 5, 89, 45, 10,182, 66,166,232, 84, 90, 40,215, 42, 7,178,103,101, 87,102,191,205,137,202,
- 57,150,171,158, 43,205,237,204,179,202,219,144, 55,156,239,159,255,237, 18,194, 18,225,146,182,165,134, 75, 87, 45, 29, 88,230,
-189,172,106, 57,178, 60,113,121,219, 10,227, 21, 5, 43,134, 86, 6,172, 60,184,138,182, 42,109,213, 79,171,237, 87,151,174,126,
-189, 38,122, 77,107,129, 94,193,202,130,193,181, 1,107,235, 11, 85, 10,229,133,125,235,220,215,237, 93, 79, 88, 47, 89,223,181,
- 97,250,134,157, 27, 62, 21,137,138,174, 20,219, 23,151, 21,127,216, 40,220,120,229, 27,135,111,202,191,153,220,148,180,169,171,
-196,185,100,207,102,210,102,233,230,222, 45,158, 91, 14,150,170,151,230,151, 14,110, 13,217,218,180, 13,223, 86,180,237,245,246,
- 69,219, 47,151,205, 40,219,187,131,182, 67,185,163,191, 60,184,188,101,167,201,206,205, 59, 63, 84,164, 84,244, 84,250, 84, 54,
-238,210,221,181, 97,215,248,110,209,238, 27,123,188,246, 52,236,213,219, 91,188,247,253, 62,201,190,219, 85, 1, 85, 77,213,102,
-213,101,251, 73,251,179,247, 63,174,137,170,233,248,150,251,109, 93,173, 78,109,113,237,199, 3,210, 3,253, 7, 35, 14,182,215,
-185,212,213, 29,210, 61, 84, 82,143,214, 43,235, 71, 14,199, 31,190,254,157,239,119, 45, 13, 54, 13, 85,141,156,198,226, 35,112,
- 68,121,228,233,247, 9,223,247, 30, 13, 58,218,118,140,123,172,225, 7,211, 31,118, 29,103, 29, 47,106, 66,154,242,154, 70,155,
- 83,154,251, 91, 98, 91,186, 79,204, 62,209,214,234,222,122,252, 71,219, 31, 15,156, 52, 60, 89,121, 74,243, 84,201,105,218,233,
-130,211,147,103,242,207,140,157,149,157,125,126, 46,249,220, 96,219,162,182,123,231, 99,206,223,106, 15,111,239,186, 16,116,225,
-210, 69,255,139,231, 59,188, 59,206, 92,242,184,116,242,178,219,229, 19, 87,184, 87,154,175, 58, 95,109,234,116,234, 60,254,147,
-211, 79,199,187,156,187,154,174,185, 92,107,185,238,122,189,181,123,102,247,233, 27,158, 55,206,221,244,189,121,241, 22,255,214,
-213,158, 57, 61,221,189,243,122,111,247,197,247,245,223, 22,221,126,114, 39,253,206,203,187,217,119, 39,238,173,188, 79,188, 95,
-244, 64,237, 65,217, 67,221,135,213, 63, 91,254,220,216,239,220,127,106,192,119,160,243,209,220, 71,247, 6,133,131,207,254,145,
-245,143, 15, 67, 5,143,153,143,203,134, 13,134,235,158, 56, 62, 57, 57,226, 63,114,253,233,252,167, 67,207,100,207, 38,158, 23,
-254,162,254,203,174, 23, 22, 47,126,248,213,235,215,206,209,152,209,161,151,242,151,147,191,109,124,165,253,234,192,235, 25,175,
-219,198,194,198, 30,190,201,120, 51, 49, 94,244, 86,251,237,193,119,220,119, 29,239,163,223, 15, 79,228,124, 32,127, 40,255,104,
-249,177,245, 83,208,167,251,147, 25,147,147,255, 4, 3,152,243,252, 99, 51, 45,219, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,
-255, 0,255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,215, 0, 0, 13,215, 1, 66, 40,155,120, 0, 0, 0, 7,
-116, 73, 77, 69, 7,217, 7, 23, 19, 9, 14,174, 17,223, 22, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236, 93,119,120, 20,213,226,
- 61,119,202,246, 77, 39,141, 4, 66, 71,186, 16, 64, 9, 96,144, 14,242, 80,121,162,128,160,226,243, 61,236, 15,177,128, 29, 20,
-136,250, 20,108,136,242, 84,120, 32,250, 19, 21, 36, 54,154,116, 8, 16, 68, 8,197, 8, 18, 8, 37,132, 68, 82,183,239,206,253,
-253,145,157,113,179,217, 50,193, 4, 81,238,249,190,249,182,204,204,153,219,231,220,115,239,157, 1, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,174,100,116, 97,156,140,147,113, 50, 78,198,201, 56, 25, 39,227,188,210,192, 93,196,
- 57,180, 17,194, 65,189, 91,230,159,128,179,177,226,222,144,220,153, 94,190,231,255, 36,225,204,188,140, 57,105, 35,240,210, 70,
- 40, 83,180, 17,202,125, 99,115,162,145,226, 78, 27, 33,223,159,255,147,132, 51,243, 50,228,244, 47, 63, 13,193, 27,168, 76,210,
- 6, 14, 39,109,132,112, 54, 22, 39, 26, 41,238,180,145,242,190, 33,239, 77,151, 45,132,203, 64, 96, 0, 0,241,225, 39,151, 49,
- 39, 26,137,179,161,195,183,177, 17, 56, 73, 35,148,129,231,189,188,155, 26, 80, 16,201,113,111,136, 60,162,141,192,219,152,226,
-170, 33,203,125, 99,115,162,145, 56, 73, 3,167,231,198, 70,224,108,168,186, 68, 27,161, 46, 53, 70,153,247, 47, 63, 13,193,235,
-207,217, 16,117,201,159,179, 33,202,253,165,224, 68, 35,113,146, 70, 72,211,198,184, 55, 93,182,224, 46, 50,177, 26, 3, 20,192,
-128,203, 92, 8, 53,150,200,108,104, 23,167, 49, 57, 27, 50,143,158,111,132,222,204,128, 6,204, 35, 18, 32,188, 13,201, 73, 26,
- 41,156, 13,145, 79,164, 17,234, 18,105,132,186, 68, 26,161,220, 95, 42,206,134,204,163,134,170, 75,164,145,234,146,127,124,159,
-111, 96, 78,210, 72,225,108,136,124, 10,196, 73, 26,129,179, 49,226,158,121, 25,243, 94,246, 16, 46,147,112, 52,134, 16, 66, 3,
- 58, 25,141,233,226, 52,150,211, 70, 26, 41, 93, 55, 53, 32,215,198, 70, 8,231,166, 6,236,209, 6, 18,132,207, 93,230,117,154,
-213, 37, 86,151, 46,183,186, 68,131,116, 86,158,187,204,202,121, 67, 58, 66,161, 56,126,111, 62,209, 32, 29, 53,218,128,225,108,
- 72,215,154, 92,162,250,116,217,129,187,140,194,210,208,243,123, 40, 26,199, 21,107,172,120, 55,100, 56, 7,252, 73,226,222, 24,
-225,124,190,145,226,254,103, 73, 83, 86,151, 88, 93,186, 28,235,146,111,153,108,168,176, 54,116, 57, 15,196,217,144,243,144, 26,
-178,140, 54,118,220,233,101,158,247,127, 10, 92,140,131,213, 88,189,227, 63, 3,103, 99,112, 55, 70, 56, 55,253, 73,210,180, 49,
-194,249, 60, 26,118,200,145, 52, 66, 88, 27,115,152,176, 49,202,102, 99,150,119,114,153,135,243,207,146,239,141, 17,206,134,170,
- 75,164, 17,234, 61,105,132,246,169, 49,203,102, 99,114, 54, 4,119, 99,132,179,177,242,158,129,129,129,129,129,129,129,129,225,
- 74, 69, 80, 37,217,189,123,247,108,189, 94,223, 38,216,126,139,197,114,246,199, 31,127,188,158, 37, 33, 3, 3,131, 10,112,248,
-109, 74,130,132,198, 25,226, 96, 96, 96, 96,184,108, 16,116,136, 80,163,209,180,218,188,121,115, 59, 73,146,224,118,187,225,241,
-120,224,241,120,224,118,187,225,112, 56,240,247,191,255,189,222,195,139,221,186,117,219,204,113, 92,139,250,156,227,241,120, 78,
-238,223,191,191, 95,176,253, 9, 9, 9,219, 1,180, 34,228, 55,173, 72, 8,129,252,219,247,127,142, 83,166,156,157, 57,117,234,
- 84,143, 80,156,132,144, 86,190,124,254, 92, 1,120, 67,114,182,111,223,126,143, 32, 8,169,129,206, 15,198, 45, 73,210, 47,121,
-121,121, 25,172,152, 94, 26,116,235,214,109, 51,207,243,245, 46,159, 63,254,248, 99,208,242,217,185,115,231, 31, 56,142,107, 26,
- 40,143,131,148, 39,222,227,241,252,228,229, 12, 40, 64,146,146,146,182, 83, 74, 91,169, 44,151, 50, 78,157, 58,117,170,103,184,
-122, 20, 42,156, 1,184, 67,114,250,138,171,148,148,148,172,248,248,248,123, 45, 22,139, 13, 0,229, 56,142,202,220, 50,175,199,
-227, 57,127,228,200, 17,246,240, 66, 6, 6,134,191,182,192,146, 36,137,179,219,237,200,207,207, 7,165,117,219,121,142,227, 60,
-245,189, 24,165,180,221,250,229, 75, 19, 12,241,137,240, 56, 29,208, 53, 73, 80,184,203, 14, 29,128,199,233,132,228,114,162, 73,
-207,107,229, 48, 96,192,128, 1,124, 24,218,212,169, 83,167, 38, 68, 68, 68,192,102,179,193,102,179,193,110,183,195,110,183,195,
-225,112,192,225,112,192,233,116,194,233,116,194,229,114,193,110,183,227,192,129, 3, 33,195, 78, 8, 73,125,232,161,135, 20, 78,
-187,221, 14,155,205,166,112,217,237,118,133,211,225,112,192,110,183,227,224,193,131, 33, 57, 5, 65, 72,221,187,119,111,130, 70,
-163, 1,165, 20,146, 36,129, 82, 90,107,243, 75, 43,244,237,219,215,201,138,232, 37, 69,187,149, 47,205, 78,208,197, 53,129,228,
-114, 33,238,234,116, 37, 47, 78,175,255, 22,146,203, 5,201,229, 66,218,223,198, 40,255,103,102,102,134, 43,159,105,159, 61, 59,
- 35, 90, 19, 17, 1,183,205,134,150,163,110, 86,118,228,189, 51, 15,212,229, 2,117, 59,209,245,145,167, 1, 0, 37, 37, 37,214,
- 14, 29, 58,156, 65,232,213, 91,169,199,143, 31, 79,144,195,224, 47,212, 57,142,171,181,109,221,186, 21, 19, 39, 78, 12, 23,247,
-212,167,158,122, 42, 65,174, 35,190,101,221,229,114, 41,245,199,237,118,195,229,114,193,225,112,224,135, 31,126, 80,229, 92, 37,
- 39, 39,191,212,191,127,255,201,203,150, 45, 51,125,241,197, 23,166,150, 45, 91, 66,163,209,128,231,121,240, 60, 15,142,227,192,
-243, 60,110,188,241, 70, 54, 55,131,129,129,225,175, 47,176,156, 78,231,241,161, 67,135, 82, 0,112, 56, 28, 41, 90,173, 86,227,
- 39,192,154,102,100,100,252,228,127, 94,184,161, 67, 67,124, 34, 62,104, 25, 11, 0, 24,123,172, 84,185, 41,172,184,174,187,114,
-204,248, 19,229, 53,199, 26, 12,224, 56,142,132, 17, 67, 48,155,205, 24, 58,116, 40,180, 90, 45,210,211,211,161,209,104, 32,138,
- 98,208, 77, 13, 76, 38, 19,102,206,156, 41,139, 35,152,244, 58,220,215,255, 90,232, 9,197, 7, 63, 30,129,221, 35, 65, 16, 4,
- 8,130, 0, 81, 20,235, 56, 82,129,160,209,104,112,224,192, 1,240, 60, 15, 65, 16,106,125,242, 60,143,213,171, 87,227,150, 91,
-110, 1,207,243, 48, 26,141, 0,155, 12,120,201,161,139,107,130,207, 50,107,140,200,219, 11, 43,149,255,191, 29,247, 55,229,251,
-164,211,213, 32,132, 64,163,209,168,203,247,136, 8,124,125,203, 8, 0,192,152,252, 98,165,204,236,159, 55, 27,162, 86, 11, 65,
-212,160,203,212,167, 80, 82, 82, 98, 29, 51,102,204, 86,189, 94,255,157,138,206, 10, 78,158, 60,169,112,137,162, 88,167,220,115,
- 28,135, 15, 63,252, 16, 39, 78,156, 80, 21,119,171,213,138, 57,115,230, 40,113, 11,196,235,251, 93, 69,220,185,164,164,164, 23,
-251,247,239, 63,113,217,178,101, 49,132, 16, 44, 88,176, 0,130, 32,224,134, 27,110, 64, 92, 92, 28,214,172, 89, 3,141, 70,131,
-199, 30,123,140, 21, 62, 6, 6,134, 43, 67, 96,253,248,227,143, 35,228,239,215, 92,115,205,225,173, 91,183, 94,229, 99,229,195,
-237,118,107,220,110,119, 59,121,216,208,237,118,195,110,183, 99,252,248,241, 33,123,244, 30,167,163,142, 64, 10, 38,156,212,194,
-225,112, 96,236,216,177,138,136, 9, 37,174,212,220, 24, 8, 33,176,219,237, 16, 4, 1,173,155,199,227,233,177, 61,209,151,167,
-176,150, 2, 40,169,198,157,201, 2,246,165,182,195,155, 39, 75,113,162,162, 10,130,160,110,180, 84,146,164, 90,130,202,255,251,
-194,133, 11, 49,110,220, 56,240, 60, 95,103, 8,137,225,210, 64,114,185,194,150,195,250,230,141,219,102, 3, 0,240, 62,130, 92,
- 20, 69,104,245,122,240,162, 8, 65,171, 65, 73, 73,137,117,200,144, 33, 59, 13, 6,195,146,164,164,164,211,167, 78,157, 10, 89,
- 62, 41,165, 16, 69, 17,130, 32, 4, 45,243, 31,126,248, 33,150, 46, 93,138,222,189,123,171, 42,243, 14,135, 3, 26,141, 6,179,
-103,207,174,179,255,157,119,222,169, 35,176,194,128, 0,224, 18, 19, 19,239, 91,190,124,121,164,124,253,184,184, 56,136,162,136,
-206,157, 59, 35, 34, 34, 2, 91,183,110,133,199,227, 81, 45, 86, 25, 24, 24,174, 76, 80, 74, 69, 0, 87, 3,136, 7,224, 1, 80,
- 9, 32,218,231,144,243,222,207,120,249, 55, 33,100,119, 0,158, 94,222, 99,206, 19, 66,118,251,252,118, 0,208, 6,248,191, 20,
-128,193,187,217, 1,108, 7,208,217,231, 58,242,121,240,191,174,172, 12, 50, 81,243,160,186, 1, 8,240,240, 59,121,184,240,200,
-145, 35, 1,135, 11,253, 2, 31,178,149,212, 53, 73, 80,156,171, 79, 91,199, 41,255,143, 43, 40, 83, 26,216,175,123,183,133,206,
-108, 66,207,231, 95, 9,155,232,242,141,161,184,184,184, 78,207,251, 98, 5, 22, 0,184, 92, 46, 24, 12, 58,124,255,238,117, 56,
-251,139, 27,179,179, 11,177,106,215,113, 8,130,128, 81, 87,181,197,223,221, 64, 86,172, 30,255,114,123,224,148,168,170, 27, 24,
-165,180,142,184,242, 21, 89,132, 16,229, 63,118,179,249, 99, 16,119,117,186,226, 92, 45,107, 22, 81,199,181, 2,128, 85,221, 91,
- 64, 31, 97, 70,231,135,167,171, 42,159, 45, 71,221,172, 56, 87, 95,165,183,130,160,209, 64,212,105,241,247, 31, 11, 1,212, 12,
- 11, 14,236,218,113, 83, 25,175, 93,124,199, 29,119,252,178,126,253,122,163,154,176,106, 52,154, 90,130, 45,144,184, 18, 4, 1,
- 46, 63,209, 24,170, 83, 17, 76, 56,201,245,170,158, 14, 22, 44, 22,139, 99,213,170, 85,120,243,205, 55, 17, 23, 23,135,161, 67,
-135, 34, 41, 41, 9, 43, 86,172, 0,165, 20, 15, 60,240, 0, 12, 6, 3, 12, 6, 3, 43,243, 12, 12, 12,161,180,200,117, 51,102,
-204,232,153,149,149, 53,167, 79,159, 62, 31,111,223,190,125, 57, 33, 36,219, 71,123,140,242,182,101,217,242,111, 74,105, 47, 95,
-145,229, 21,105,241,132,144,108,249,120,223,223,242, 39,165,116, 48, 0,173,252,123,198,140, 25,157,179,178,178,230, 76,159, 62,
-253,201,185,115,231,106,102,204,152,209, 53, 43, 43,107,142,124,157, 64,225,240, 21, 88, 33,159, 2,236,116, 58,143, 15, 30, 60,
- 88,213,138, 31,171,213, 90, 20, 70,128, 5,116, 6,124, 93, 1, 93,132, 25,134,136, 8, 16, 78, 93,131,235,114,185, 32, 8, 2,
- 56,142,195,218,181,107, 97, 48, 24, 48,114,228,200,139, 30, 34,148, 69,155, 86,171,129, 16,205,225,142,215,246,224,252, 5,139,
- 50, 36,184,174,160, 16,187, 12, 6, 60,221,177, 43,204, 85, 5,168,176, 59,126,151,131, 53,110,220, 56,216,108, 54,112, 28,167,
-252,199,113, 92, 88,177,202,208,120, 8,182, 8,129, 16, 2,125,100, 4,244,102, 51,120,129, 87,197, 69, 41,253, 77, 8,105,181,
- 16,117, 90, 8, 26,141, 34,174,134, 12, 25,178,179,140,215, 46, 62,125,250,244, 78, 0,122,181, 2, 75,118,176, 66,137, 43, 65,
- 16,224,116, 58, 85,137, 23,187,221, 14,141,230,183,153, 0, 39, 79,158, 12, 41,176,194, 69, 27,128, 68, 8,145, 90,181,106,165,
-156,147,152,152,136,232,232,104, 72,146, 4, 73,146,160,215,235, 97, 48, 24,106, 93,151,129,129,225,138, 69, 40, 45,162,203,202,
-202,154,227, 43, 96,252, 5,141,175,112,242, 19, 81,190, 34,173,115,152,182, 63,219, 95, 52,201,215, 37,132,100,207,157, 59,119,
- 84,152,112,156,247, 23, 88,114,131, 24, 16,190,195,133, 13,117,243, 10,117, 3, 51, 68, 69, 66,107, 50,193, 59,253,138,134,227,
-114, 58,157,202,156,147,123,239,189, 55,104,175,222,119,110, 74, 56, 56, 28, 14,240, 28, 15,232, 90, 66, 66,142,114,179, 82, 54,
-141, 6, 5,205,187,129, 20,157,134, 32,168,155,239, 47, 59, 88,178,136,122,224,129, 7,176,104,209, 34,101, 98, 50, 0,240, 60,
-143,246,237,219,227,216,177, 99,172,170,253, 1,160,148,134, 29,182,214, 71, 70, 64,103, 54,131, 87,225, 52,202,251,149, 57, 76,
-122, 29,120,141, 6,130,166,102, 88,112,244,232,209,155,202,202,202, 22,119,234,212,233,103,212, 60,198,128,168,173, 63,129,202,
-249,226,197,139,107,137,171,250, 56, 88,114, 61,242, 69,160,225,194, 49, 99,198,168,117,176, 40, 33,132,138,162,136,193,131, 7,
-163,107,215,174, 88,181,106, 21, 36, 73,194,253,247,223, 15,131,193,128,249,243,231,195,237,118, 35, 43, 43,139, 57, 88, 12, 12,
- 12,161,238,249,214,233,211,167, 63, 73, 8,201,246, 58, 73,121, 33,132, 84,160,182,189,151,159, 72, 59, 31,228,184, 81,129, 68,
-150,239,119, 25, 51,102,204,232,236, 31, 14, 95,199,204, 87, 96, 53,214,251,219,106,161,236,208, 1,101, 66,187, 60, 44, 72, 8,
-193,183, 25, 87, 65,107, 54, 65,111, 54,163,223,202, 45, 74,175, 25, 47,190,170,202,193,146,133, 83,105,105,105,216, 33, 66,181,
-174, 24,175, 17,177,211, 44,130,138,124,173, 27,150, 40,138,224, 4, 17, 5,241,237, 64,132, 53, 16, 60,110, 85, 55, 7,217,201,
-240, 93, 61,117,199, 29,119,128,227, 56, 69,100,117,239,222, 29,126,121,194,112, 9,113,102,195,119,248,230,182,154,186,234, 59,
- 44,152,221,187, 13,116, 17,102,232, 76, 38,100,174,222,174, 12,231, 98,254,123, 97, 57,143,188,255, 54,242, 94,159, 11, 65, 20,
-113,243,222, 2,197,185,234,123, 85,219,157, 14, 83,228,226,147, 39, 79,238, 4,192,221,118,219,109,209, 61,122,244, 80,101,139,
- 17, 66,106, 77, 60, 23, 4, 33,160,184, 18, 4, 1,110,183, 91, 85,220,157, 78,167, 42, 39, 73,118,177,212, 52,148,114, 58, 69,
- 69, 69, 33, 34, 34, 66, 89, 65, 43, 59, 87,242,252, 77,181,245,146,129,129,225, 47,143, 96, 90,196, 62,119,238,220,188,185,115,
-231, 42, 78,146,191,131, 21,228,190,123,131, 87, 76,197,203,226, 12,128, 61,208,252,172, 64,174,152,191,240,242,253, 47, 43, 43,
-107,142,127, 56,124,135, 37, 3,206,206,238,214,173,219, 55, 70,163,177,165,218,212,168,207, 67, 71, 61, 78,103,157,158, 56, 33,
- 4,122,179, 25,218, 8, 51,116,102,115, 80,151, 43,216,141, 70, 30, 34,228,121, 94,185,233, 44, 89,178, 4,102,179, 25,119,221,
-117,215, 69, 77,114,175, 17, 88, 60,190,212,228, 3, 26,161,206, 77,139, 23, 69,156,140,106, 6, 78, 20, 33,120,212, 57, 4,229,
-229,229,224,121, 30,207, 61,247, 28,178,178,178,148,101,244,190, 75,235,125, 93, 15,134, 75, 15,223, 73,238,181, 92,213,136, 8,
-165,124,250,254, 31,110, 78, 34, 33, 4,240,184,107, 86, 11,234,180,138,184, 26, 61,122,244, 38,135, 41,114,241, 85, 87, 93, 37,
- 59, 87,156,209,104, 12,187,106,214,183,110,200, 66,199, 95, 92,201, 46,169,252,221,229,114,169, 42,243,178,192, 90,180,104, 81,
-200,206,136,124, 93,181,229,148,227, 56,108,222,188, 25,123,247,238,197,189,247,222, 11,131,193,128, 55,222,120, 3,110,183, 27,
-179,102,205,130,193, 96,128, 86,171,101,133,143,129,129, 33, 20, 98,100,129,227, 21, 73,181,156, 37,239,220,169, 81,190,191, 3,
- 57, 92, 94,199,105,115,152,246,240, 43,175, 48, 11, 8,217, 73,243, 59, 39,219, 95,156, 9,126, 78, 9, 1, 0,173, 86,219,114,
-219,182,109,237, 36, 73,130,199,227, 65,168, 79,135,195,129, 91,111,189, 85,245, 67, 71, 37, 87,141,192,226,252, 86,202,233, 34,
- 35,160, 53,255,118, 3,243,185,137,133,109,197,101, 7,203, 87, 96, 61,247,220,115, 16, 4, 1,139, 22, 45, 2, 0, 60,250,232,
-163,245,118,176,168, 4,108,247,108, 68,211, 5,221, 64, 23,235,113,110,243, 97,136,162,136,164,222, 67, 32,245,252, 59, 74,181,
-145, 48,121,231, 85,169, 25,118, 44, 45, 45,197,137, 19, 39, 64, 8,193, 35,143, 60, 18, 82, 92,173, 93,187,150,205,193,250, 3,
- 5, 22,199,243,181,242,195,183,124,250,137,175,240,227,100,110, 55, 68,157,174,214,106,193,178,178,178,197, 39, 79,158,204, 1,
- 64, 38, 78,156, 24,109, 52, 26,241,254,251,239, 91, 0,104, 86,174, 92,105, 8,199,233, 59,143,207,223,185,242, 23, 88, 30, 79,
-248, 33,108,185, 83,161,198,237,173,143,192,146,203, 55, 33, 4, 30,143, 71,113,174, 92, 46,151,242, 91,167,211,177,130,199,192,
-192, 80, 71,139,248,225,188,223, 60, 39,226,231, 52,157, 15, 36,172,124,135, 3,229,239,132, 16, 87, 0, 94,135,223,208,161,255,
-255,242,103,233,220,185,115,191,151,157, 43,159,255,107,133, 35,168,131,197,113, 28,236,118, 59, 14, 29, 58,164,182,135,170,250,
-161,163,113,233,215, 96,252,137,114, 16, 66,176,166,127, 39,232,205,102,104,204, 38,100,124,182, 81,105,176, 11,178, 30,131,198,
-100, 70, 92,191, 33,170, 26,112,143,199, 83, 71, 96,149,149,149, 65, 20, 69,188,248,226,139,224, 56, 14, 47,189,244, 18, 82, 82,
- 82,112,246,236, 89,100,102,102,170,186,217,112, 18, 7,253,157,177,208,255, 43, 2,220,189,109,208,249,111,255, 66,121,101, 11,
-236,119,152,208,161, 58, 31, 49, 27,158,135, 83,114,171,122, 76, 3, 33, 4,110,183, 27,223,127,255, 61, 68, 81,132,219,237, 86,
-110, 62,148, 82,229, 41,249,242, 67, 29, 95,122,233, 37, 86,213,254, 0, 52,187,225, 38,220,113,198, 2, 0,248, 38,227, 42,232,
- 76, 38,104, 35,204,232,247,197,102,165,124,254, 50,103, 26, 52, 38, 51,162,123,245, 87,197,217,241,254, 71,209,225,190,105, 40,
- 41, 41,177, 14,238,222,121,115, 57,175,251,176, 75,151, 46,202,156, 43,163,209, 8,189, 94, 79, 80,251,117, 50, 97, 69, 11,199,
-113, 97,197,149,252, 93,109,167,194,127, 21,110, 40,129,165, 22, 28,199,225,174,187,238, 66,114,114, 50,222,124,243,205, 90,206,
-213,147, 79, 62, 9,151,203,133,249,243,231,179,194,199,192,192, 16,170,221,219,173,246, 88, 74,105, 47, 31, 49,181,251, 98,120,
-235,115,189, 96, 8,216,242,218,237,246,130, 65,131, 6, 33,200,190, 20,157, 78, 87,171,117,149, 31, 58, 26, 96,168,176, 11,128,
- 3,126, 17,255,109, 88,208, 59, 89, 88,235, 55,236,162, 53, 71, 64, 52,153,193, 5,110,196,235,112, 6,114,176,228,161,147,242,
-242,114,136,162,136, 55,223,124, 19,145,145,145,176,219,237,129,122,222, 1, 57,121,158,135,229,132, 5,199,159,217, 15,157,233,
- 40,218, 15,137, 64,132,120, 12,109,183,172,132,219,237, 0,124,134, 12,213,112,182,111,223, 30,207, 61,247, 92,157,199, 51, 4,
- 67,122,122,122, 88,206, 6, 0,227, 12, 34, 98,116, 17,102,232, 35, 34,130,150, 79, 33,240,179,155,106,113,202,251,101,231,170,
- 74, 99,252,240,228,241,227, 57, 0,184,137, 19, 39, 70, 25,141, 70, 44, 92,184,208, 2,128,123,225,133, 23,140,105,105,105,188,
-154,112,114, 28,135, 37, 75,150,212,153,115, 21, 76, 96,169, 9,167,219,237,174, 35,176,198,142, 29, 91,231, 65,163, 33, 28,172,
- 58,225,148,231, 96, 53,105,210, 4, 70,163, 81,121,237,150, 94,175,135, 94,175, 87,158, 14, 31, 98,168,149,149, 79,198,201, 56,
-175, 28,206, 75, 46,198, 26, 19, 1, 5,214,190,125,251,134, 7, 59, 33, 35, 35, 35,127,219,182,109,109,125,223, 77,232,118,187,
- 53,118,187,189,221,141, 55,222, 24,182,171, 44, 73, 18,116, 58, 29, 40,165,184,250,233,172,154, 46, 60,247,219,144, 32,165, 20,
-209,125, 7,131,240, 60, 60, 30, 9, 46,151, 43,236, 42, 66,155,205, 86,107, 2,122,160,229,235, 85, 85, 85, 33,159,243,227,207,
-105,181, 90,107,205,235, 34, 30,138, 95,214,173,168,187,154,208,123, 29,181,208,235,245,181,134, 77, 84,218,165, 12,151, 8,242,
- 3, 60, 41,165,232,252,208,244, 26,167,136,231,106,237,143,234,213, 31, 68, 16, 33,213,204, 91, 10,183, 48,132,156, 63,127,222,
- 58,122,244,232, 77,148,210, 15,110,188,241,198,159, 80,243,176, 58,106, 54,155,117,162, 40, 74, 0,126, 5, 64, 47, 92,184, 16,
-117,250,244,105,201,102,179, 53, 15, 23,206,205,155, 55,227,232,209,163,232,209,163,135,226,124,202,155, 60,124,127, 49, 14, 86,
-160, 39,194, 7,123,146,123,125, 28,172,168,168, 40,104,181, 90,188,248,226,139,208,104, 52, 48, 24,106, 70, 65,231,207,159,175,
-164, 57, 3, 3, 3,195, 95, 9,245,126, 97,179, 36, 73,124,176,225,195,112, 67,133, 30,143,231,212, 53,215, 92, 83,223,235,157,
- 11,115, 67, 60,181,101,203, 22,141,255, 11,105, 3,189, 0,215,231,191,176,156,187,119,239,214,132, 56, 63,208,247,115,245,137,
-187,154,249, 43,110,183,251, 52, 43,162,151, 14,110,183,251, 84,239,222,189, 3,239,124,238,165, 96,249,122, 46,140,104,249,185,
- 93,187,118,103,204,102,243, 87,137,137,137,165,219,182,109,139,235,213,171, 87,156,239, 49,189,122,245, 74,246, 59,205,129, 16,
- 43,122, 9, 33,167,238,184,227, 14, 77,152,242,232,255,253, 84,152, 78,197,169,188,188, 60, 77,160,242, 30,236,147, 82,122, 74,
- 69,178,158, 24, 49, 98, 4, 23,168, 14, 5, 72,203,243,172, 20, 50, 48, 48, 92,177, 2,203,102,179, 21, 14, 26, 52, 40,224,186,
-111,139,197,114, 50,212,185, 7, 15, 30,236,217,208, 17, 56,125,250,116,198,159,129,179, 49,226,206,112,249,231,209,193,131, 7,
-123, 3, 64,121,121, 57, 66,189,254,166, 62, 40, 44, 44,108,240,242,217, 24,156, 0,112,232,208,161, 62,172,100, 49, 48, 48, 48,
-129,165, 2,106, 31,199,192,192,192,192,192,192,192,192,112,165,130, 99, 73,192,192,192,192,192,192,192,192,208,176, 32,168, 89,
- 9, 16, 8,245, 89, 29,208,229, 34,174,125,128,113, 50, 78,198,201, 56, 25, 39,227,100,156, 87, 28,103, 56,238,203,114,117,226,
-229,134, 46,140,147,113, 50, 78,198,201, 56, 25, 39,227,100,156, 87, 26,216, 16, 33, 3, 3, 3, 3, 3, 3, 3, 67, 3, 67, 96,
- 73,240,135,129, 7,224,105, 40, 50, 74,105, 52,128, 96, 47,116,115, 16, 66,202, 46,146, 87, 11, 64,244,110, 0,224, 2,224, 34,
-132, 56, 88, 22, 50, 48,252,181,144,158,158, 62,153, 82, 58, 27, 53,111,129,122, 49, 55, 55,247, 45,150, 42, 12, 12, 13, 44,176,
- 90,183,110,189,135,227,184,212, 64, 47, 32, 14,246, 92, 28,143,199,115,234,200,145, 35,106,151,186, 11,201,201,201, 99, 77, 38,
-211,245, 60,207,247,245,158,191,173,186,186,250,251,179,103,207,126, 10,192,125, 49, 17,106,217,178,101,164,205,102,187,149, 16,
- 50,193, 43, 16, 62,210,235,245,255,119,252,248,241,138,139, 76,163, 54, 73, 73, 73, 31,137,162,200, 23, 22, 22, 94, 15, 0,205,
-154, 53,251,222,225,112,120,138,139,139, 39, 0, 56, 90, 79, 62, 78,163,209,100, 93,115,205, 53,253,182,108,217,242, 63, 0,239,
- 52, 80, 94,234, 56,142, 59, 17,104,135, 36, 73,105, 23, 33,172, 52, 0,162,230,207,159, 31,187,116,233,210,238,103,207,158,237,
- 10, 0,201,201,201,251, 39, 78,156,248, 3,165,244, 87, 0,229,132, 16, 39,171, 70,127,110,180,109,219,118, 15,199,113,169,245,
-121,150,156,247, 21, 85,167, 14, 29, 58,212, 51, 24, 39,207,243,169, 97,158, 71, 87,231,187, 36, 73,191, 28, 60,120, 48,224, 35,
- 35,218,181,107,183,131,231,249,150,225,194, 22, 40,156,193, 30,193,209,174, 93,187, 61, 60,207,167,214,151, 83,146,164, 95,242,
-242,242, 50, 26,146,243, 82,135, 19, 0, 50, 51, 51,117,213,213,213, 31,153,205,230,110,213,213,213,147, 37, 73,122,118,227,198,
-141,137, 28,199, 97,240,224,193,207,166,167,167, 31,215,233,116, 11,108, 54,219, 15,102,179,121,252,166, 77,155,236,172,198, 48,
- 48,252,254, 70,247, 92, 85, 85, 21,149, 33, 73, 18,117,185, 92,212,110,183, 83,171,213, 74,171,171,171,105,101,101, 37,173,168,
-168,160,229,229,229,180,180,180,148,118,238,220,217,255,161,139, 1,199,104, 83, 82, 82,186,180,111,223, 62,255,173,183,222,178,
- 23, 22, 22, 82,167,211, 73, 93, 46, 23, 45, 44, 44,164,111,191,253,182,189,125,251,246,249, 41, 41, 41,193,198,119, 3,253,207,
- 37, 39, 39, 15, 73, 78, 78, 94, 62,108,216, 48,199,250,245,235,169,221,110,167, 22,139,133,174, 94,189,154, 14, 24, 48,192,145,
-156,156,188, 60, 57, 57,121, 8, 2, 15,139, 6,187, 86,247,150, 45, 91, 30, 61,117,234,148,103,203,150, 45,206,184,184,184, 47,
-227,226,226,190, 44, 44, 44,244,156, 60,121, 82, 74, 77, 77, 61, 10,160,123, 61,194, 9, 0, 55, 79,155, 54,173,224,248,241,227,
-150,204,204,204, 29, 62,255, 19,132,127,114,123,151, 64,206, 21,165, 52,145, 82,154,132,154,135, 83,214,217, 40,165, 73,222, 99,
-162, 85,114,154,142, 29, 59,150,154,152,152,152,229,117,170,106,241, 17, 66, 28,137,137,137, 89,199,142, 29, 75,165,148,154,234,
- 17,247,223, 3,198,217, 72,156, 87, 93,117, 85, 81,117,117, 53,165,148, 82,143,199, 67,157, 78, 39,181,217,108,212, 98,177,208,
-170,170,170, 90,245, 92,222,202,202,202,104,151, 46, 93,206,133,224, 60,103,177, 88,106,181, 29, 14,135,131,218,108, 54,106,181,
- 90,169,197, 98,161,213,213,213,181,182,170,170, 42,218,189,123,247,194, 16,156,103,229,112, 74,146, 68,221,110, 55,117, 58,157,
-212,225,112, 80,187,221, 78,109, 54, 91,173, 77,254,175,119,239,222, 65,195,217,161, 67,135,115, 86,171, 85, 53,167,188,245,232,
-209,227, 76, 67,113,202,255, 93,125,245,213, 69,161, 56,109, 54,219,197,132,179, 48, 84, 89, 74, 79, 79,255,252,248,241,227,212,
-106,181,210, 33, 67,134,216, 31,121,228, 17,234,241,120,104,118,118, 54, 29, 59,118, 44,189,231,158,123,104,105,105, 41,157, 49,
- 99, 6,237,209,163,199, 23,172, 30, 49,206, 70,230,188, 50, 28, 44,142,227, 96, 50,153,240,241,199, 31, 7,124,253,140,255,247,
-180, 52,117, 38, 73, 98, 98, 98,207,212,212,212, 77, 43, 87,174, 52, 36, 36, 36, 40,255, 59,157, 78, 68, 70, 70,226,174,187,238,
-210, 14, 30, 60,184,237,237,183,223,190,211,237,118,103,158, 59,119,110, 79, 40,190,164,164,164, 49,113,113,113,111, 77,157, 58,
- 53,113,244,232,209,136,137,137,169,181,127,212,168, 81, 24, 57,114,164,230,151, 95,126, 25,247,233,167,159,142,251,223,255,254,
- 87, 84, 85, 85,245, 96, 81, 81,209,231,161,120,141, 70,227,224,182,109,219,190,191,126,253,250,212,232,232,104, 52,109,218,148,
-123,230,153,103,186,180,110,221,218,144,156,156,204,157, 57,115, 6,159,127,254,121,235,137, 19, 39,174, 58,121,242,228,100,187,
-221,190, 94, 69,244,181,177,177,177,143,253,235, 95,255,138,171,172,172,116,239,221,187, 87,118,191,180, 58,157,238,217,107,175,
-189,182,199,198,141, 27, 63, 1,176,248, 98,156, 43, 74,105, 5,126, 27,202,147,225,146,247,171,113,178, 40,165,218,189,123,247,
-198,244,237,219,247, 11,187,221,222,227, 31,255,248,199,233, 87, 94,121, 69, 27, 25, 25, 25, 9,128,148,149,149, 93,152, 57,115,
-166,231,141, 55,222,120,162, 83,167, 78,131,182,109,219,118, 51,165,148, 13, 25,254,201, 97, 52, 26,177,122,245,234,128,175,153,
- 10, 84,231,163,163,163,195,190,141,192, 96, 48, 96,237,218,181,202,121,190,175,150, 10,244, 61, 58, 58, 26,148,210,144,164,122,
-189, 30, 91,183,110, 85, 94, 3, 20,172, 93,146, 63,141, 70, 35, 8, 33, 92, 56,206, 77,155, 54,133,229,146, 63,205,102, 51, 80,
- 51,196, 31, 54,156,225,226, 44,127, 55,153, 76, 97,211, 83,167,211, 41,156,190, 28,193,126,155, 76, 38,132,235,180, 25, 12,134,
-110,137,137,137,200,201,201,193,243,207, 63,175,237,220,185, 51,242,243,243,193,113, 28, 38, 79,158,140, 78,157, 58,161,168,168,
- 8,157, 58,117,194,214,173, 91,187,179,154,194,192,208, 0, 2, 75, 70,176, 6,214,255, 59, 16,240, 53, 24,181,150, 90,166,165,
-165,233, 68, 81,252,108,245,234,213,134,184,184,223,222, 22,226,112, 56, 80, 89, 89,137,170,170, 42, 84, 86, 86,194,100, 50, 97,
-193,130, 5,134, 9, 19, 38,124,166,211,233,218,157, 56,113,194, 30,140,147, 16, 50,111,223,190,125,137,110,183, 27, 90,173, 54,
-168, 88,108,211,166, 13, 30,124,240, 65,244,235,215, 47,105,220,184,113,243, 0,124, 30,140, 19, 0,146,147,147,223,222,182,109,
- 91,170, 86,171, 69,126,126, 62, 78,157, 58,133, 41, 83,166,164, 73,146,132,194,194, 66,228,231,231,227,204,153, 51,120,239,189,
-247, 82, 39, 76,152,176,224,244,233,211,109, 67,197,221,139,123, 30,121,228,145,182, 49, 49, 49,220, 43,175,188, 82, 94, 85, 85,
-245,158,247,255, 25,243,231,207, 31,159,153,153, 25,255,143,127,252,131,110,219,182,237, 99,212,188, 46, 37,104,122,250,206,185,
-242, 14,231, 1,128,135, 82,122,216,239,156, 14, 62,251, 65, 41, 77, 4, 96, 39,132,148, 7,224, 36, 0, 34,135, 15, 31, 62,205,
-110,183,247,216,178,101,203,209,126,253,250,165, 1, 56, 75, 41, 61, 15, 0, 49, 49, 49,166,215, 95,127, 61,113,212,168, 81, 63,
- 13, 30, 60,184,199,240,225,195,167,157, 63,127,126, 54,165,180,132, 16, 66, 67,196,253,247,130,113, 54, 18,167,119, 40, 9,130,
- 32, 96,196,136, 17, 32,132, 4,124,223,230,142, 29, 59, 48,104,208, 32,136,162,136,187,239,190, 91, 53,231,176, 97,195,224,118,
-187,235,240,249, 11, 16,249, 29,157,161,226, 78, 41,173,245,142,208, 64,226,194,119, 11,192, 87,135, 83,146,164,128, 92,193, 68,
-150,252,178,122, 53,113, 87, 43, 46,195,133,211,151, 83, 20, 69,100,100,100, 96,239,222,189, 33,197, 86,184,112, 2, 64,117,117,
-245,157, 55,222,120,227,154, 41, 83,166,232, 1,160,164,164,164,214,139,232,143, 28, 57, 2,187,221,142,101,203,150,193,110,183,
-223,203,234, 17,227,108,100,206, 80,157,127, 17,192,213, 0,226, 81, 51,127,185, 18, 64,180,247, 94,169, 5, 80, 10,192,224,221,
-236, 0,170, 0, 52,241,158, 94,226,237,108,248,190,166,236,188,239, 75,161, 41,165,189,188,220,242, 43,187,226,125,142,149,175,
-225,255,219,255,179, 22,183, 92,171,229,225,159, 76,223, 10, 45,191,132, 53,156,184,146, 27, 71, 21, 9,244,192,140, 25, 51, 18,
-125,197,149,221,110, 71, 69, 69, 5, 42, 43, 43,149,207,252,252,124,104,181, 90,140, 29, 59, 54,145, 82,250, 64, 24, 90, 13,207,
-243,216,187,119, 47, 86,174, 92,137,227,199,143,215, 57,224,216,177, 99,120,253,245,215,241,234,171,175,162,162,162, 2, 0, 52,
-193,200,186,117,235,246,252,248,241,227,119, 14, 24, 48, 64, 39, 8, 2,246,237,219,135,118,237,218, 97,251,246,237, 56,121,242,
- 36, 46, 92,184,128, 35, 71,142,160, 75,151, 46, 56,122,244, 40, 42, 42, 42,208,185,115,103, 93,143, 30, 61,182,164,165,165, 61,
- 31, 42,156, 41, 41, 41, 79,254,235, 95,255,210,157, 61,123, 86, 90,178,100,201, 54, 0,219, 1, 76,121,234,169,167, 38, 13, 27,
- 54, 44,254,240,225,195, 21,187,119,239,222, 19, 68, 92, 5,114,174, 78,114, 28,119,130, 82, 90, 65, 41,181,162,102, 2,122,173,
-155,145,219,237,182, 91,173,214,242,210,210,210, 18,142,227, 78,112, 28,151, 15, 64, 23,140,115,226,196,137,173, 75, 74, 74,238,
-255,247,191,255,125,188, 95,191,126,105,148,210, 35,148,210, 82,111,129,181,187,221,238,210,178,178,178,159,250,246,237,155, 60,
-126,252,248,163, 37, 37, 37,247, 79,156, 56,177,117, 8, 78,134,203, 31,212,227,241, 64, 20, 69,108,220,184, 17, 91,183,110,197,
-214,173, 91,177,109,219, 54,108,223,190, 29, 59,118,236,192,142, 29, 59, 32, 8, 2,182,111,223,142,237,219,183,227,193, 7, 31,
- 12, 91,231, 61, 30, 15, 4, 65,192,166, 77,155,176,107,215, 46,101,219,189,123, 55,118,237,218, 5,131,193,160, 70, 12,249,118,
-166, 20,206, 64,219,219,111,191,173,136, 67,185,109,226, 56, 46,164, 43,230, 47, 92,252, 5, 75, 90,139, 22,117,246,133, 11,167,
- 44,218, 4, 65,192,127,255,251, 95,156, 62,125, 26,111,190,249, 38,142, 29, 59,134,151, 95,126, 25,121,121,121,152, 53,107, 22,
-118,239,222,141, 25, 51,102, 96,203,150, 45,242,203,223,105, 56, 78, 89, 92, 57,157, 78, 37, 60, 71,142, 28,193,156, 57,115,176,
-111,223, 62, 60,251,236,179,216,177, 99, 7, 30,123,236, 49,240,124, 72,147, 13,233,233,233,147, 9, 33,159,182,111,223, 94, 55,
-112,224, 64, 8,130,128, 57,115,230, 72,207, 62,251,108,241, 83, 79, 61, 85,156,157,157, 77, 91,183,110, 13,135,195,129,136,136,
- 8, 80, 74, 23,167,167,167, 63,192,170, 11, 67, 99,182, 69,254, 90,196, 7,215,205,152, 49, 99, 32, 33, 36, 59, 35, 35, 99, 34,
-128,104, 66, 72, 54, 0,173,247, 51,110,198,140, 25,189, 9, 33,217, 51,102,204,232, 9,160, 9, 33, 36,219,251,251,122, 0,113,
-242,111,239,241,241,126,226, 45,222,231,255,120,191, 99,181,129,126,251,127,250,115,251, 58, 88,196, 27, 49,226,219, 64,214, 71,
- 96,133,107,112,205,102,243,200,225,195,135,107,124,197,149,175,115, 37,127, 86, 86, 86,226,167,159,126, 66,151, 46, 93, 52,102,
-179,121, 36,128,255,132,181,226, 4, 1, 77,155, 54, 69, 73, 73, 9, 14, 28, 56,128,180,180, 52,184, 92, 46,124,247,221,119, 40,
- 43, 43,131, 70,163,129, 70,163,129,195, 17, 90,187,116,232,208, 97,196,210,165, 75,123,254,239,127,255,187, 32, 8, 2,142, 28,
- 57,130,143, 62,250, 8,148, 82, 52,105,210, 4, 22,139, 5,197,197,197,152, 55,111, 30,156, 78, 39,204,102, 51, 82, 82, 82,244,
- 15, 60,240, 64,191,153, 51,103,138, 39, 78,156, 8, 38,178,174, 25, 51,102, 76,100, 68, 68, 4, 30,126,248, 97,201,233,116,190,
- 10,224,218, 49, 99,198, 60,249,224,131, 15,198, 22, 20, 20, 56,238,185,231,158, 61, 78,167,115,158,108, 30,250, 11,166, 0,130,
- 53,168,115,229,118,187,229, 52, 61, 94, 89, 89,137,132,132,132,230,148, 82, 77,152, 60,210,108,223,190, 61, 3, 0,255,194, 11,
- 47,232, 41,165,231,124,195,224,116, 58,101, 78,119,121,121,121,241, 99,143, 61,230, 94,190,124, 57,239, 61,231, 16, 0, 27,107,
- 31,254,124,144,133,139, 40,138, 24, 49, 98, 68, 45, 65,177,121,243,102, 12, 31, 62, 92,169,239, 26,141, 70, 57, 46, 28,167,175,
- 43, 38, 59, 79, 50,239,247,223,127, 95,199,121, 81,217, 73, 83, 28,150, 64,194,199, 95,116,201, 29, 69, 53, 98, 40,144,200,146,
-219, 22,127,103, 72, 77, 56, 69, 81,196,131, 15, 62, 8, 65, 16,240,216, 99,143, 65, 20, 69, 92,125,245,213, 16, 4, 1,125,250,
-244,129, 32, 8,184,254,250,235, 85,119, 80,229,112,238,216,177, 3,233,233,233, 74,120,174,190,250,106,244,234,213, 11,130, 32,
-160,127,255,254, 16, 4, 1, 67,135, 14, 13,203, 73, 41,125,118,227,198,141,137,102,179, 25, 63,253,244, 19,120,158, 7, 33,164,
-116,239,222,189,137, 0,112,195, 13, 55,148,216,108,182, 56,155,205,134, 65,131, 6, 33, 35, 35, 35,126,249,242,229,207, 0, 96,
- 43, 11, 25, 26,181, 73,242,215, 34,178, 1,144,149,149, 53,135, 82, 58, 42,216,137,242,126, 66, 72,246,220,185,115, 71,121,203,
-121,157,223,178,203,228, 39,222, 58,251, 58, 80,242,121,190,215, 11,117,109,191,227,207,251, 11, 44, 10, 96, 64,160, 70, 55,144,
- 85,238,255, 93, 77, 3, 97,179,217,174,150,221, 43,155,205, 86, 75, 80, 85, 85, 85,213, 18, 90, 14,135, 3,173, 90,181,130,205,
-102,187,186,190, 55,139,228,228,100, 56,157, 78, 44, 90,180, 72, 17, 86,190, 34, 33, 20, 14, 30, 60,120,124,231,206,157, 61,210,
-211,211, 99,190,248,226,139,243,131, 7, 15,142, 31, 54,108, 24,244,122, 61,108, 54, 27,220,110, 55,174,185,230, 26,116,232,208,
- 1,197,197,197,248,230,155,111, 74,218,181,107,215, 36, 39, 39, 71, 42, 42, 42, 58, 17,130,122,208,160, 65,131, 64, 8,193, 55,
-223,124,243, 43,128, 92,189, 94,255,249,156, 57,115,162,237,118,187, 52,105,210,164,194, 95,127,253,245, 49, 0, 46,173, 86,251,
-159,235,174,187,238,154,245,235,215,127, 34, 73, 82,189, 27, 51,187,221, 94, 43,109, 43, 43, 43, 97, 52, 26,213, 60, 18, 66, 44,
- 43, 43,235, 10, 0, 70,163, 49, 22, 62, 43, 36,173, 86,171,146, 71,222,252,177,197,198,198,154, 0,192,123,142,200,218,133, 63,
- 47,228,155,247,198,141, 27,107,213,111,217,129,242,175,243, 90,173, 22,171, 87,175, 86,197,233, 43,166, 84, 12,231,133,116,155,
-100,129, 37, 8, 2,222,123,175,102,132,253,225,135, 31, 86,206,247,191,134,154,246, 66, 22, 67,130, 32,160,195,115, 18, 0, 39,
- 78,189,166,135, 40,214, 20,105,255, 48,123, 27, 83, 85,174,216,155,111,190,137, 81,163, 70, 33, 59, 59, 59,228,231,200,145, 35,
- 85,133, 83, 16, 4,232,116,186, 90,194,111,223,190,125, 1,121, 23, 46, 92, 24,118, 78,155, 36, 73,248,234,171,175,192,113, 92,
- 45,199,235,233,167,159,254,151,201,100, 50,111,218,180, 9,231,206,157, 67,117,117, 53,170,170,170, 16, 19, 19, 19, 61,104,208,
-160,125, 69, 69, 69, 5,135, 14, 29,186,153,213, 28,134, 70,114,177, 6, 4,248,223, 58,125,250,244, 39, 9, 33,217,211,167, 79,
-127,114,238,220,185,121,222,186,145,237, 87, 87,178,195,212,165,108,175, 24,218,237,173,203,218,130, 51, 63, 0, 0, 32, 0, 73,
- 68, 65, 84,189,252,196,219,121, 66,200,110, 74,233, 13,193,206, 5,224,240, 19, 84,181,134, 8,101,238,144, 14,150,255,220,132,
- 80,223,189, 22,119,184, 6, 87, 32,132,212, 17, 0,129, 28, 44,151,203,133,210,210, 82, 72,146,212,160,207,234, 10, 39,176, 14,
- 28, 56,112,215,228,201,147,207, 68, 69, 69,117, 43, 45, 45, 61,171,211,233,250,111,222,188,185,153,203,229, 66,100,100, 36, 34,
- 35, 35,241,245,215, 95, 35, 42, 42, 10,255,254,247,191, 79, 90,173,214,237, 38,147, 41,209,106,181,254, 88, 84, 84,244,116, 80,
-229, 34,138,131,250,247,239,143,220,220, 92,148,149,149,109, 0,208,109,194,132, 9, 67,155, 53,107, 70,102,207,158,109, 59,122,
-244,232, 91, 0,206,155, 76,166,255, 46, 93,186, 52,179, 71,143, 30,230, 73,147, 38, 97,211,166, 77,239,215,199, 25,178, 88, 44,
-181,132,149,156,166, 17, 17, 17,170,158,185,229, 77,111, 74, 8,161,114,207,223, 87, 88,249, 8, 96,202,243,188, 4,128, 54,116,
- 30, 49, 92,122, 7, 75,174,235,127,251,219,223,234, 76,110,215,104, 52, 88,179,102, 13,110,186,233, 38,165,195,146,158,158,174,
-218,109, 26, 61,122,180, 34, 8,214,172, 89, 19, 84, 96,133, 27,210,242,119,155, 30,122,232, 33,136,162,136,183,222,122, 11, 83,
-167, 78, 5,207,243,120,237,181,215,192,113, 28,158,121,230,153,122,139, 75, 81, 20,113,252,165,154,207,212, 71, 42, 80,250, 78,
- 34, 0, 32, 34, 50,178, 38, 62,146,164,254, 14,225,141,123, 56,231,202, 87, 88,133, 27, 34,244,117, 1,243,243,243,149,239,125,
-250,244,169,229, 92, 9,130, 16, 86,176,121,175, 55,107,224,192,129,179, 83, 83, 83, 19,166, 76,153, 66, 4, 65, 64,207,158, 61,
-155, 12, 30, 60,184, 92, 16, 4,253,163,143, 62, 26,104, 42,133, 8,160, 91,199,142, 29, 77,172,230, 48, 92, 98, 7,203, 62,119,
-238,220,188,185,115,231, 6,116,168,252,157,164, 80, 78,147, 44,172,188, 66, 40, 94, 22,109,168,153,159,188, 59,220,185,240, 14,
- 9, 6,114,185,124,225,239, 96,205,244,111,120,212, 8, 44, 53,243, 39,188,174,200,254,146,146,146, 62, 58,157, 14, 21, 21, 21,
-117,110,218,190,162,128,231,121, 20, 23, 23,195,104, 52,238,111,200,156, 11, 55, 68, 8,192,246,243,207, 63, 79,243,249,221,107,
-236,216,177,203, 63,249,228,147, 86,235,214,173, 67, 78, 78, 14,154, 52,105,130, 57,115,230,252, 82, 80, 80, 48, 30,192,238,226,
-226,226,176,215,109,221,186,117, 39,179,217,140,109,219,182, 1,192, 22, 0,119,222,119,223,125,196,233,116, 98,193,130, 5, 22,
- 0,235,162,162,162, 62, 95,177, 98, 69,183,110,221,186,233,214,173, 91, 87,153,147,147,179, 81,165,184,242, 80, 74, 3, 10,171,
-202,202, 74, 84, 87, 87,195,108, 54,171, 17, 88,238,200,200,200, 3,149,149,149,183, 90,173,214, 10,157, 78, 23, 81, 81, 81, 97,
-247,117, 24,171,170,170, 80, 93, 93, 13, 65, 16,196,252,252,252, 51, 0, 90, 71, 70, 70, 30,192, 69, 62,183,140,225,143, 7,199,
-113, 84, 22, 25,235,214,173, 11, 88,215, 69, 81,196,119,223,125, 87,171,190,127,243,205, 55, 97, 69,155, 32, 8,202, 74,194,112,
- 14,150, 79,227, 26,218,102, 21, 69,240, 60,143,119,222,121, 7,148, 82,197,185,226, 56, 14,211,167, 79,135, 78,167,195,139, 47,
-190,136,233,211,167,171,114,177,124, 93,177,150, 79, 88,127,107, 28,189,231, 58, 29,142, 26,151,158,227,124, 69,150, 42,167, 45,
-220, 4,247,250,136, 96, 95,167, 77,167,211, 5,157,220, 30,224,102, 21, 16,185,185,185, 31,116,239,222,253,104,124,124,252,218,
-140,140, 12,221,158, 61,123,240,224,131, 15, 18,187,221, 30,185,110,221, 58,229,186,129,210,171,186,186, 90,207,106, 14, 67, 35,
- 58, 88, 51, 3,252, 31, 35, 11, 39,175, 24, 82, 91,119,178,125,143,151, 57,252, 69,145,215, 17,219, 28,142, 43,208,185,193, 32,
- 4,171,132,254,141, 68, 56,161,165,166,247,105,181, 90,215,111,220,184,177,215, 77, 55,221, 36,132, 26, 30,172,170,170, 66, 98,
- 98, 34,142, 29, 59,230,182, 90,173, 97, 31,127,224,241,168,127, 32,122, 56, 7, 43, 0,118,151,148,148,184,157, 78, 39,218,182,
-109,139,148,148, 20, 88,173, 86,188,254,250,235,110, 0,187, 85,114,104, 76, 38, 19, 15, 0,229,229,229, 64,205,106,135,118,237,
-218,181, 67,110,110, 46, 46, 92,184,176, 10,192,160,153, 51,103,118,191,246,218,107, 53,159,124,242,137,229,222,123,239, 93,229,
-114,185,102,171,236,129, 59,220,110,119, 75,142,227,156,101,101,101,167,125,133, 85, 98, 98, 98,140,217,108,230,138,139,139, 93,
-106,146,167,107,215,174,187, 78,157, 58,133, 23, 94,120,225,252,156, 57,115,218, 85, 86, 86, 94, 40, 47, 47,119,203,194,170,162,
-162, 2, 86,171,149,139,143,143,215, 45, 92,184,208, 8, 0, 93,187,118,221, 5,128, 61,112,244,207,220,162,249, 45,104, 9,244,
-168, 6,181,147,209,253,133,203,141, 55,222, 88,199, 17,147,183, 21, 43, 86,212,154,215, 20,110,232, 77,230,124,251,237,183,241,
-240,195, 15, 67,167,211, 97,254,252,249,181,230, 96, 5,233, 17, 7,229,148, 69, 91,203, 39,172, 40,122, 35, 22,162, 40, 34,238,
-222,115,181,134, 8, 3,196, 77,149, 16,156, 51,103, 78,131, 12, 17,250,138, 62,249,145, 56,139, 22, 45,194,216,177, 99,177,101,
-203,150,139, 30, 34,108,217,178,229,210,215, 95,127, 93,119,232,208, 33, 84, 84, 84,224,252,249,243,176,217,108, 40, 44, 44, 84,
-242, 48,136, 83,110, 96,181,134,161,145,220,171, 96, 56,239, 55,127,138,248, 14,215,133,248,244, 63, 30, 62,255,249,242,158, 39,
-132,184, 2, 92,239,124, 0, 81,229,127, 13,223, 99,206, 7,114,176, 2,221,184, 85, 63,166,193, 59, 65, 50,156, 16,152,247,220,
-115,207,221,223,175, 95,191,216,200,200, 72,156, 57,115, 38,160,131, 21, 25, 25, 9,167,211,137,141, 27, 55, 86, 72,146, 52, 47,
- 76,134,184, 92, 46, 23, 18, 18, 18, 80, 82, 82, 2, 41,136,141,207,113, 28, 12, 6, 3,170,170,170,128, 48,147,199, 3,221, 40,
- 92, 46, 23,156, 78, 39,156, 78, 39, 92, 46, 87,125, 11,141,193,251, 76, 26, 84, 87, 87, 3, 64,117,211,166, 77, 91,235,245,122,
-121,213, 99, 62,128,129,195,134, 13, 19, 75, 75, 75,233, 61,247,220,179,131, 82,250, 96, 24, 87,200,177,113,227,198, 22, 0, 96,
- 48, 24,242, 1,160,176,176,208, 85, 86, 86,134,170,170, 42,197, 33, 52, 24, 12,184,249,230,155,147, 40,165,216,184,113, 99, 11,
-141, 70, 67, 67,136, 33,123,118,118,246,193,168,168,168,229, 89, 89, 89,227,111,184,225,134,188,174, 93,187,182,172,170,170, 42,
-182, 88, 44, 86,171,213, 74, 5, 65,208,196,197,197,233,214,174, 93,123,116,199,142, 29, 67, 34, 35, 35,151,103,103,103, 31, 68,
-205, 42, 67,134, 63, 99,139,230, 55,183, 41,144,168,170,207, 10, 58, 95,225, 34, 8, 2,190,251,238,187,144, 46,142, 90, 78, 95,
-145, 49,109,218, 52,188,241,198, 27,117, 28,172,217,179,107,250, 36, 79, 61,245, 84,189, 28, 34, 65, 16, 80,244, 70, 44,146, 30,
-250,181,142,131, 69,188,225,171,207, 16,161,124,254,172, 89,179, 32,138,162, 50,132, 55,100,200,144, 90, 67,131,106,133,149, 47,
-103,113,113, 49, 4, 65, 64,108,108, 44,198,143, 31,143,161, 67,135,214,225, 83,203, 91, 88, 88,248,195,171,175,190,218, 60, 37,
- 37, 5,159,124,242,137,195,100, 50,105, 7, 14, 28, 72,203,203,203, 73, 40, 7,203,106,181, 50, 7,139,225, 82,183, 83,187, 47,
- 37,111, 67, 92, 79, 8,215,232,254,206,199, 52,116,129,207,179, 50, 78,156, 56, 81,158,148,148, 52, 97,220,184,113, 95,188,243,
-206, 59,134,214,173, 91,227,200,145, 35,184,112,225, 2,156, 78, 39, 52, 26, 13,154, 54,109,138,170,170, 42,124,246,217,103, 22,
-139,197, 50,161,168,168,168, 60, 20, 39, 33,228,169, 17, 35, 70, 44,124,250,233,167,245,157, 58,117,194,133, 11, 23, 80, 85, 85,
-165,244,188, 8, 33,136,140,140,132,209,104,196,129, 3, 7,176, 99,199, 14, 43, 33,228,169, 80,156,129,132,166, 44,172,100,161,
- 21,110,101,146, 31,167,201,104, 52,202, 61, 63, 0,112, 55,111,222, 60, 17,128, 44,176, 78,180,106,213,234,233, 54,109,218,144,
-165, 75,151, 82, 74,233,186, 32,226, 74,225, 36,132, 92,160,148,150, 1, 72,116, 56, 28, 26, 0,168,168,168,112,198,197,197, 37,
-232,116, 58, 73,167,211, 73,122,189, 94, 58,123,246,172,219,237,118,107, 0, 32, 51, 51,211, 1,224,156,223, 92, 15, 95, 78,137,
- 82, 90,185, 96,193,130,231,239,188,243,206, 62,125,251,246,237,124,207, 61,247, 28,186,247,222,123,145,146,146, 18, 83, 85, 85,
-101,203,207,207, 47,123,231,157,119,108,187,118,237, 26, 34,138,226,137, 5, 11, 22, 60, 15,160,146, 16, 34,169, 77,207,139, 4,
-227,108, 36, 78,185, 60, 4, 18, 86,190,191, 85, 8,161, 90,225,148, 69,219,173,183,222,170,172, 62,244,119,174,234,203, 9, 64,
- 89, 65,248,248,227,143,215, 10,223,211, 79, 63,173,182, 87,236, 27,119,197,109, 18, 4, 1,229,139, 82,106,137,191,122,136,170,
- 58,156,130, 32,224,217,103,159, 85,237, 96, 5,152,131, 21, 52,156,153,153,153,168,174,174,134, 40,138, 88,179,102, 77, 80, 7,
- 43, 92,122, 26, 12,134,241,171, 86,173,250, 72,167,211,117,117, 56, 28,119,151,148,148, 44,177, 88, 44,205,203,202,202, 66, 58,
- 88, 54,155, 77,199,234, 17,227,196, 37,126, 22,214,159, 13, 33,187,120,110,183, 27,205,154, 53,171,245,110, 43,121, 50, 59,207,
-243,202,202, 19, 53, 43, 8,101, 20, 21, 21,173, 1, 48,230,230,155,111, 94,118,231,157,119, 70,116,232,208, 65, 76, 75, 75,131,
-213,106, 69, 65, 65, 1, 10, 10, 10,220, 27, 54,108,168,176, 88, 44,183,123,143, 13,137, 51,103,206,252,207,237,118,127, 55,113,
-226,196,103,187,119,239, 62,101,234,212,169,124,171, 86,173, 80, 94, 94,142,152,152, 24,196,199,199,163,160,160, 0,159,125,246,
-153,167,172,172,108,161,199,227,153, 85, 92, 92,124,190, 62,137,228,118,187,121,151,203,133,113,227,198, 65,146, 36,204,159, 63,
- 31,110,183,155,175, 7,133,211,233,116, 82, 0,164,164,164, 4, 0, 44,178,224,250,249,231,159, 1,224,100,139, 22, 45,204, 0,
-176,126,253,122,130,154,231, 99,169, 81,222,148, 82,170, 56, 89, 29, 58,116, 40,240,111, 20,101,231, 74,118,189,194, 77,164, 37,
-132,216, 40,165,231,237,118,251,176, 71, 30,121,228,217, 69,139, 22,141, 95,180,104, 81,157,227, 34, 35, 35,151,191,246,218,107,
-179,198,143, 31,127,158, 16,194, 30,207,240, 87,104, 12,252,220,170,250, 78, 1, 8,198,249,229,151, 95,214,231,225,154, 33, 93,
- 49, 66, 72,192, 21,137,161,218, 32, 21,157,161,160, 15, 20,253, 61,174,160, 32, 8,120,229,149, 87, 20,231,202,119,242,249,197,
- 56, 88, 50,103,108,108,108, 77,175,205,100,130, 36, 73, 24, 57,114,228, 69,243,122,223, 45, 56, 70,254,157,158,158, 62,235,227,
-143, 63,158, 77, 41,141, 3, 32,248,166,129,154,116,100, 96, 96, 80, 33,176, 60, 30,207,169, 1, 3, 6,192,183,247, 20,238,101,
-173,110,183,251,148, 74,145,245, 93,203,150, 45, 91, 45, 90,180,232, 97,147,201, 52,216,102,179,117, 5, 0,189, 94,191,191,186,
-186,122, 29,199,113,175, 23, 21, 21,169,126, 57,179, 87, 48, 61,192,113,220,252,137, 19, 39,206,206,200,200,184,229,158,123,238,
- 33,130, 32,224,211, 79, 63,165,167, 79,159, 94,193,113,220, 83,103,207,158, 61,118, 49,137,100, 52, 26,127, 90,177, 98, 69,235,
- 47,191,252, 18, 46,151, 11, 11, 23, 46,132, 78,167,251,169, 30, 20,231, 55,108,216,176,172,111,223,190,227,119,236,216,177, 28,
-192,129, 45, 91,182,124,116,221,117,215, 77,216,190,125,251,255, 1, 56,180,113,227,198,143, 50, 50, 50, 38,236,218,181,235,115,
- 0, 63,214,163,209, 85,156, 44,183, 59,240,136, 98, 16,231, 42, 20,103, 5,165,212, 57,121,242,228, 71,110,185,229,150, 69,185,
-185,185,215,200,143,111,136,142,142,222,159,158,158,158,179, 98,197,138, 35, 94,231,138,137,171, 63, 57,228, 9,233, 49, 49, 49,
-224, 56, 78,217,228,167,121,215, 87, 8,201,156,148, 82,196,196,196, 4,236,152,133,224, 12,169,106, 40,165, 48,155,205, 10,167,
-202,213,203, 97,109, 40,179,217, 92, 43,140, 42, 64,195,197,221, 63,156,106,210, 44, 28,167,201,100,130,211,233, 84,205, 9, 21,
-139, 6,124,145,155,155,251, 1,128, 15,218,180,105,243, 51,128, 54, 76, 84, 49, 48, 52,130,192, 58,114,228, 72,207,198,188,240,
-241,227,199, 43, 0,204,242,110, 13,130,211,167, 79, 31, 3,112,235,214,173, 91,255,179,125,251,246,103,188,141,235, 11,225,222,
-103, 24, 14, 63,254,248,227, 77,162, 40, 46, 88,188,120,113, 6,165, 20, 81, 81, 81,219,143, 30, 61,122, 95,125, 56, 60, 30,207,
-148, 29, 59,118, 76,133,119, 85,160,195,225,152,178,117,235,214, 71, 1, 84,203,251,119,238,220,169,252,174,231,205,140, 82, 74,
- 29,148,210,228, 32,135, 56,212,138, 43, 63, 39,203,177, 98,197,138, 42, 0,251,240,219,115,174, 92,222,205,238, 55, 44,200,240,
- 39,133,219,237, 62, 61, 96,192, 0, 33, 92, 7, 42,192,121,167, 66,117,208,250,247,239,143,139,224, 60, 29, 34,168, 39, 50, 50,
- 50, 56,181, 92, 50, 92, 46, 87,113, 8,241,117,170, 79,159, 62, 1,195, 25, 38,205, 66,198,189, 79,159, 62,245, 10,163, 55, 44,
-167, 27,154, 51, 76,122, 6,133,213,106,189, 16, 31, 31, 95,101,179,217, 68,187,221, 46,250, 59,246, 6,131,225,188,213,106,101,
-149,135,129,225, 15, 4,123,211, 56,227,100,156,140,147,113, 50, 78,198,201, 56,175, 56,112, 44, 9, 24, 24, 24, 24, 24, 24, 24,
- 24, 26, 22, 36,132, 10,173,207,234,128,139, 81,178, 7, 24, 39,227,100,156,140,147,113, 50, 78,198,121,197,113,134,227,102,171,
- 19, 27, 73,120, 49, 78,198,201, 56, 25, 39,227,100,156,140,243,202,227,252, 75,129, 13, 17, 50, 48, 48, 48, 48, 48, 48, 48, 48,
-129,197,192,192,192,192,192,192,192,192, 4, 22, 3, 3, 3, 3, 3, 3, 3, 3, 19, 88, 12, 12, 12, 12, 12, 12, 12, 12,191, 3,
- 36, 37, 37, 37, 51, 57, 57,185,207,149,154, 0, 2, 43, 3, 12, 12, 12, 12, 12, 12, 12, 13,129,102,205,154, 69,123, 60,158, 59,
- 1,220,215,186,117,235,214, 0, 64, 8, 57, 64, 41,125,221, 96, 48,124,116,236,216, 49,199, 21,163, 48, 89,113, 96, 96, 96, 96,
- 96, 96, 96,248, 61, 72, 78, 78,238, 14,224, 62,131,193,112,251, 53,215, 92,163, 29, 56,112, 32, 98, 98, 98,224,118,187,113,246,
-236, 89,108,216,176, 1,251,246,237,251,213,229,114, 45,112,185, 92, 11, 74, 74, 74,206, 93, 73, 2,107,147,247, 51,147, 21, 21,
- 6, 6, 6, 6, 6, 6, 6, 53, 72, 74, 74,122,117,248,240,225,143,196,196,196,160,109,219,182, 72, 74, 74,130,221,110,135,213,
-106, 5,165, 20,130, 32,128, 82,138,202,202, 74,236,217,179, 7, 57, 57, 57,238,138,138,138,229,132,144,215,207,158, 61,251,131,
- 31,221, 95, 70,139,200, 2,139, 2, 24,224, 23, 57, 6, 6, 6, 6, 6, 6, 6,134,144, 72, 78, 78, 62,183,126,253,250, 4,143,
-199,131,146,146, 18,216,237,118, 88, 44, 22, 69, 96,241, 60, 15, 74, 41,220,110, 55, 0, 64,146, 36, 28, 58,116, 8, 59,118,236,
- 64, 97, 97,225,107, 69, 69, 69,211,254,138, 90,132,243, 83,141, 76, 92, 49, 48, 48, 48, 48, 48, 48,212, 11,118,187, 29, 75,151,
- 46, 69, 73, 73, 9,154, 53,107,134,148,148, 20, 68, 69, 69, 65,175,215, 3,128, 34,174, 0,128,227, 56,116,238,220, 25, 19, 38,
- 76, 0, 33,100,130, 31,213, 95, 70,139,176, 73,238, 12, 12, 12, 12, 12, 12, 12,191, 7, 46,167,211,137,158, 61,123,226,248,241,
-227,200,205,205, 69,143, 30, 61,208,177, 99, 71,148,148,148,224,204,153, 51,181, 14,222,181,107, 23,246,238,221,139,235,174,187,
-238, 47,157, 40,188,247,147, 0,120, 30,192,157, 0, 22,179,178,194,192,192,192,192,192,192,160, 6, 17, 17, 17,191,110,218,180,
-105,104, 90, 90,154,152,158,158, 14,157, 78,135,147, 39, 79, 34, 39, 39, 7,102,179, 25, 93,187,118,133,205,102,195,230,205,155,
-177,122,245,106,148,149,149,161, 69,139, 22,192,187,239,225,231,215,204,229, 85, 85, 85,243,254,138, 90,196,119,146,123,166,247,
-115, 19, 43, 46, 12, 12, 12, 12, 12, 12, 12,106,145,156,156, 28, 71, 8,121,170,105,211,166,247,223,126,251,237, 98,155, 54,109,
-112,234,212, 41,148,148,148,224,194,133, 11,216,185,115, 39, 0, 32, 37, 37, 5, 41, 41, 41, 40, 40, 40,192,129, 3, 7,172,118,
-187,253,222, 51,103,206,252,239,175,168, 69,216, 99, 26, 24, 24, 24, 24, 24, 24, 24, 26, 74,104, 53, 3, 48,179, 77,155, 54,147,
-198,142, 29,203, 53,109,218, 20,167, 79,159,198,134, 13, 27,208,186,117,107, 20, 23, 23, 99,207,158, 61,158,138,138,138,133, 30,
-143,103, 86,113,113,241,121,150,106, 23, 7,246,166,113,198,201, 56, 25, 39,227,100,156,140,243, 10,227, 76, 76, 76,236,144,156,
-156,188,114,232,208,161,244,157,119,222,161, 15, 60,240, 0,237,209,163,135,148,156,156,252,105, 74, 74, 74,235, 43, 65, 0,177,
- 73,238, 12, 12, 12, 12, 12, 12, 12, 13,138,115,231,206, 29, 6,112, 19, 33,228,154,188,188,188, 39, 1, 64,146,164, 23,206,157,
- 59,183,231, 74, 73, 3, 38,176, 24, 24, 24, 24, 24, 24, 24, 26, 5,103,206,156,201, 1,240,183, 43, 49,238,236,101,207, 12, 12,
- 12, 12, 12, 12, 12, 12, 76, 96, 49, 48, 48, 48, 48, 48, 48, 48, 48,129,197,192,192,192,192,192,192,192,112, 69,129, 32,248, 74,
-128, 3,245,224,185,152, 21, 10, 7, 24, 39,227,100,156,140,147,113, 50, 78,198,121,197,113,134,227, 62,128, 43, 8, 23,251,188,
- 44,182,132,149,113, 50, 78,198,201, 56,255, 60,156,164,129, 56,137,119,227,188, 27,169, 39,247,165, 10,231,159, 37,238, 87, 10,
-231, 95, 10,225, 86, 17,250, 38,146,228,221,104, 3, 9, 54,174, 1,249, 24, 26, 71, 84,203, 21,131,178,124, 98, 96,248, 75,163,
- 33,219,122,185,237,224,125, 56, 61,222, 13,191,179, 45,105,140,123,210,229, 30,247, 43,153,243, 47, 41,176, 8, 0, 18, 31, 31,
-191, 38, 33, 33,225,250,146,146, 18, 9, 0, 8, 33,224, 56, 14, 28,199, 65, 16, 4,107, 65, 65, 65,100,125, 47,152,144,144,240,
-126,124,124,252,157,165,165,165,146,204, 69, 8, 1,207,243,224,121,222,122,236,216,177,200, 63, 58, 81,122,244,232,113,193,225,
-112,152,253,255,215,106,181,182,189,123,247, 70, 92, 9,229,162, 93,187,118,183, 25,141, 70, 67,144,253,244,135, 31,126, 88,164,
-150,172, 69,139, 22,187, 12, 6, 67,180, 32, 8,224,121, 30,130, 32,160,186,186,186,236,240,225,195,189,189,251,183, 25, 12,134,
- 56,158,231,229,178, 5,155,205, 86,122,232,208,161,190,236,190, 87, 23,153,153,153, 2,234,255,136, 21,247,166, 77,155,220,151,
- 42,140,148, 82,206,145, 27,209,134,184,173,221, 8, 71,163,168, 68,202,169, 96,248, 81,155, 94,121, 84, 85, 75, 77,136,244, 7,
- 39,115,115, 0,110, 0,103,234, 29,247, 0, 61,118, 1, 24,238, 1,198,121,127,218, 56,160,148, 0,249,113,192,103,231, 0,171,
- 95,227,123, 41,111, 68, 4, 0, 73, 77, 77,125, 61, 49, 49,241,174,202,202, 74, 11,207,243, 32,132, 80, 66,136,156, 23,190,249,
- 2, 73,146, 78, 29, 60,120,176,103,152,155,172,216,188,121,243,215,226,227,227,239,176, 88, 44, 22, 66,136,194, 41,111,190,220,
- 30,143,231, 84, 94, 94, 94,207, 75, 24,206, 63, 36,238,190, 92,242,111, 73,146, 66,197, 93,225, 76, 77, 77,125, 45, 49, 49,241,
-142,170,170, 42,139,247,190,249,187,195,121,153,115,254,101, 5, 22,151,144,144,176,170,119,239,222, 3,190,252,242, 75,238,240,
-225,195, 92,135, 14, 29,224,241,120, 32, 73, 18, 40,165, 72, 79, 79, 55,214,247, 98,137,137,137, 75,122,246,236, 57,110,245,234,
-213,220,170, 85,171,184, 94,189,122,129, 16, 2,143,199, 3,143,199,131, 65,131, 6, 25,126,103,124,204,130, 32, 76,213,106,181,
-153,110,183,187, 35, 0,136,162,120,200,110,183,111,114,187,221,243, 0, 84,169, 33,113,185, 92,198,188,188,188, 58,105,211,187,
-119,111,237,197, 6,172,109,219,182,219, 57,142,107,229, 91,200,194,125, 82, 74,127, 57,120,240, 96, 70, 48,206,246,237,219,135,
-229,244,255, 79,146,164, 95,242,242,242, 50, 66,149,137,182,109,219,142,235,212,169,147,254,211, 79, 63, 69, 97, 97, 33, 76, 38,
- 19, 36, 73,130,199,227,129,203,229,194, 77, 55,221, 84, 47,203,215, 96, 48, 68,110,216,176,161, 77, 66, 66, 2,138,139,139, 81,
- 82, 82,130, 41, 83,166,228,251,236,143,251,254,251,239,219,197,198,198,194, 98,177,160,188,188, 28, 19, 38, 76,248,211, 87,174,
- 33,253, 91,189, 72,128, 88,249,183, 71,194,175,235,183,253,242,244,239,229,181,219,237,103, 61, 30, 79,140,159, 32, 9,121, 14,
-207,243, 23, 0,196,135,211,194, 0,254,198,243,124, 91, 81, 20,175,162,148,182,112,187,221,137, 0,160,209,104,206,241, 60, 95,
-224,114,185,142, 56, 28,142,159, 1,172, 6, 80, 16,140,200,145, 27,209,198, 99,183,220, 82,109,151, 70, 74, 20, 73, 28, 65,145,
- 73,103,249,218,145, 27,177, 66,173,200,250, 3,209,178,105,211,166,175, 0,192,153, 51,103, 30, 3,112,252,247, 18,122,128,113,
-148,210, 40, 0, 40, 47, 47,143, 42, 44, 44, 76, 90,189,122,117,231, 57,115,230, 12,212,218,108, 47, 59,128, 67,161,206, 31,124,
- 93,235, 61, 2, 33,169,138, 90,166,210,169,117,155,127,105,136, 27, 19,151,146,146,242,250,136, 17, 35, 38, 46, 92,184,208,152,
-147,147, 99,236,218,181,171,183,227, 11,165,189,167,148, 42,101,236,218,107,251,132, 19,108, 66,211,166, 77,231,143, 24, 49, 98,
-252,130, 5, 11,140, 71,142, 28, 49,182,108,217, 82,225,244, 45,179,114, 7,251,234,171,187, 95,234,112, 54,106,220,135, 13, 27,
- 54,126,225,194,133,198,253,251,247, 27,219,181,107,167,112, 82, 90, 91, 59,115, 28,135,158, 61,123,169,226, 28, 62,124,248,248,
-119,223,125,215,152,155,155,107,236,216,177,163, 87,164, 65, 9,227,197,132,243, 50,231,252, 75, 10, 44, 46, 62, 62,126,105,207,
-158, 61,135,125,249,229,151, 60, 0,228,230,230,162,180,180, 20, 41, 41, 41, 48,155,205,208,235,245,176,217,108,245,234,101, 37,
- 36, 36,188,223,171, 87,175,113, 95,126,249,165, 8, 0,159,223,126, 19,126, 17,129, 7,139, 29,208,104, 52, 56,122,244, 40,120,
-158,255, 61, 61,183,235, 34, 34, 34,254,183,114,229,202,152, 30, 61,122,112, 37, 37, 37,104,217,178, 37,126,253,245,215,222,155,
- 55,111, 78,191,251,238,187,239,174,172,172,156, 4, 96,179, 90,194,175,190,250, 10, 38,147, 73,217,156, 78,231, 69,143, 37,243,
- 60,159,154,147,147,147, 96, 54,155,225,241,120, 64, 41,173, 85,129,253, 43,158, 36, 73,232,223,191,191, 51,100,230, 9, 66,106,
- 78, 78, 78,130,193, 96,168,195,229,241,120,160,213,106,193,113,156,220, 67,132,219,237, 70, 70, 70, 70, 40, 78,210,174, 93,187,
-219,100,113,197,113, 28, 62,249,228, 19, 36, 37, 37, 33, 33, 33, 1, 38,147, 9, 6, 67,253, 53,176, 32, 8,136,139,139,195,253,
-247,223,143,219,110,187, 13,203,150, 45,131, 40,138,181,246,199,198,198,226,219,111,191, 69,100,100, 36,210,210,210,106,237,255,
-179,130, 0,177,223,109,254,205,145,189,101,212,213,194,160,126, 45, 23, 40, 21,173,230, 32, 42,121, 93, 11,201,227,185,176, 97,
-251,201,103, 85,116, 0,154,108,219,182, 13, 58,157, 78,221,205,221,227, 65,239,222,189,155,132, 57,108,100,151, 46, 93, 62,191,
-255,254,251, 53,109,218,180, 33,162, 40, 66, 16, 4, 8,130, 32,151,199, 52, 74,105,154, 36, 73, 3,206,157, 59, 71,223,124,243,
-205,151, 55,110,220,120, 51,128,175, 3,198,221,109,237, 86,109,151, 70, 82,138,164,196,193,180,121,241, 58,130,106,187, 52, 50,
- 74,176, 30, 5,112, 57, 11,172, 72,131,193,240,204,167,159,126,170, 1,128,193,131, 7, 63, 99,181, 90,255, 13,160,162,161, 46,
- 16, 21, 21,133,168,168, 40,116,233,210, 5, 99,198,140,137,238,222,189,251,163, 45,236,246, 41, 5,128, 35,104, 29,226,184,212,
-111,190,207, 79,144,127,143,191,169,135,102,104,102,235,115,212,107,153,249,123,104,146,135,158, 90,191,237,120, 56, 1,198, 37,
- 37, 37,253,103,248,240,225,183, 46, 92,184, 48, 2, 0,222,127,255,125,140, 28, 57, 18, 73, 73, 73, 48, 24, 12,208,104, 52,208,
-104, 52, 16, 69, 81,249, 12,115,147,229,147,146,146, 94,190,225,134, 27,110, 89,176, 96, 65, 4, 0, 44, 89,178, 4,163, 70,141,
- 66, 92, 92, 28, 34, 35, 35,161,211,233,160,213,106,189, 92, 4, 52,124,171, 95, 39,156,247, 12, 29,136, 86, 6, 29,254, 54,251,
- 21, 68, 71, 71, 99,195,180,251, 32,114, 28,238,251,118, 19, 34, 35, 35,213,180, 31,117, 56,115,115,115,113,238,220,185,128,113,
-231,121, 62, 92,125, 83,226, 62,114,228,200, 91,100,206, 37, 75,150, 96,216,176, 97,136,139,139,131,217,108, 86,226,254, 27, 55,
-167,138,115,216,176, 97,183,188,251,238,187, 10,231,160, 65,131, 16, 27, 27,139,136,136, 8,104, 52, 26, 37, 61,235,147, 71,151,
- 57,231, 95, 82, 96, 17,175,123,117,107,118,118,182,146,243,162, 40, 66,167,211, 41,133,195,247,198,173,246, 94, 19, 31, 31,127,
-231,151, 95,126,169,156,228,240,171, 84,122,189,190,190,156,181, 58,120,215, 95,127,253,199,217,217,217,122,141, 70, 3,171,213,
-138,188,188, 60, 68, 69, 69, 65,171,213,226,198, 27,111,228, 51, 50, 50,226,174,191,254,250,207,126,250,233,167,241, 0,214,169,
- 24,226,128,217,108,174, 37,176, 40,189,120,253, 71, 8,129,193, 96,192,170, 85,171, 32, 8, 66,173, 66, 22,168, 17, 75, 76, 76,
- 12,235, 74, 0,128, 78,167,195,246,237,219,193,113, 28, 68, 81, 84,182,175,190,250, 10,211,166, 77,195,185,115,231,148,125, 17,
- 17, 97, 71, 55,137,209,104, 52,200,226, 74,206,123,131,193, 0, 81, 20,137, 32, 8,132,231,121,185, 73, 39, 80, 57,148, 33, 8,
- 2, 10, 10, 10,112,251,237,183, 99,241,226,197,120,225,133, 23, 48,126,252,248, 90,251, 43, 42, 42, 16, 19, 19,131,232,232,104,
-232,116,186,223, 83, 22, 46, 27, 72,126,169, 51,235,133,151,141, 18, 0,137, 74,128, 4, 80, 80,229,251,217,179, 71,241,234,127,
-222,224,213,114,235,116, 58,108,219,182, 13,190,195,174, 28,199, 65,163,209,212,250, 79, 16, 4, 36, 39, 39,171,225,155,185,114,
-229, 74,237, 39,159,124,130, 47,190,248, 2, 30,143, 7,162, 40, 66,175,215, 35, 50, 50, 18,177,177,177,202,150,150,150, 70, 62,
-248,224, 3, 77,183,110,221,102, 86, 84, 84, 4, 22, 88, 28,141,146,188,226, 10, 0, 18, 6,211,230,199,190,228, 99,162, 35,106,
- 92,156,203,184, 61,156,241,214, 91,111,197,165,167,167, 3, 0,222,122,235,173,184,201,147, 39,207, 0,240, 52,106,134, 12, 47,
-174,131, 5,124, 76, 8, 25,231,117,108,245, 67,134, 12,209,190,253,246,219,184,234,170,171,240,208, 67, 15,197,190,250,242,203,
-127, 3,176, 34,120, 89,170, 93,152,230,190,242, 70,180,111,135,234,183, 13,248,245,124, 1,158,121,230, 69, 21,250, 31, 92,211,
-166, 77,239,126,239,189,247,148,233, 16,177,177,177, 74, 27,228,223, 70,201,159, 33,218, 37,226,117,133, 38, 47, 92,184, 80,225,
-140,143,143,175,197, 33,138, 34, 10, 14,253,128,111,222,207,130, 41, 46, 25, 19,166,205,173,119, 56, 83,116, 90,164, 26,180,232,
-214,173, 27, 12, 6, 3,114,197,154, 91,153, 44,174,212,132,211,159,147,231,121, 37,140,148, 82,216,108, 54, 84, 86, 86,194,227,
-241,192,225,112, 32, 61, 61, 93, 85,220,223,125,247, 93,133,179, 73,147, 38, 74,251,238,219,206,203,155,220,129, 9, 19,206,201,
-255,253,239,127, 21,206,184,184, 56,133, 75, 16, 4,104, 52, 26, 44, 89,178, 4, 42, 29,109,213,156,245,205,119,127,206,227,199,
-143, 99,206,156, 57,208,104, 52,242, 20, 32,197,177, 76, 73, 73,193,155,111,190,169,234, 30,247, 87,115,176, 72, 73, 73,137,116,
-248,240, 97,110,207,158, 61,208,104, 52,136,143,143, 71,239,222,189, 1, 0, 78,167, 19,130, 32,192, 96, 48,144,182,109,219,158,
-147, 19, 77,254,244, 27, 75,151,151, 90,114,191,254,250,171,180,102,205, 26,110,217,152, 97,112, 80,160,251, 51,115, 49,108,212,
- 40,124,151,162, 5, 15,160,247,225, 18,104,181, 90, 33, 41, 41,201, 37,103,130,204,235, 55, 55,203,127,249,102,132,201,100,250,
- 96,245,234,213,122,142,227, 80, 89, 89, 9, 73,146,208,183,111, 95, 16, 66,176,127,255,126, 60,253,244,211,248,252,243,207,177,
-114,229, 74, 67,143, 30, 61, 62,176, 90,173, 29, 1, 84,250,112, 28, 8, 84, 56, 35, 35, 35, 97, 48, 24, 20,129,101, 48, 24, 72,
-251,246,237,207, 5,153, 71,112,250,224,193,131,233,193, 56,101, 39,225,230,155,111, 86,230,156,201, 55, 64,223,202, 38,127,207,
-203,203, 11,148, 95,117, 56, 37, 73, 66,191,126,253, 0, 0, 38,147, 9,102,179, 25,223,127,255,189,178,191, 71,143, 30,112, 56,
- 28,104,210,164, 9, 14, 29, 58,164,138,179,168,168, 8, 75,151, 46,133, 40,138,136,139,139,131, 40,138,154,117,235,214,189, 96,
- 50,153,162,120,158, 71,116,116, 52, 70,141, 26,181,208, 39, 12,158,175,191,254, 90, 8,198,201,243, 60,244,122, 61,150, 44, 89,
-130, 57,115,230,224,201, 39,159,244,119,247, 96,179,217, 16, 23, 23,135,152,152, 24,196,196,196,168, 10,103, 3,160, 81, 57, 41,
- 40,242,246,126,135,131,251,214,193, 67, 61,144, 60, 18,168, 68,225,145, 36,236, 93,187,171,221,217, 95,206,164, 80,208,154, 41,
-181, 0, 60, 85,213,238,204, 56,237, 85, 0, 86,109, 42,117,204, 15, 23, 78,158,231,225,116, 58,241,221,119,223,225,232,209,163,
- 88,179,102, 13,172, 86, 43,154, 52,105,130,232,232,104,100,100,100, 96,242,228,201,193, 4,214, 1,191,178,185,228,244,233,211,
-221, 51, 50, 50, 72,121,121, 57, 74, 74, 74, 80, 89, 89, 9,167,211, 9,167,211,169,228,161,201,100, 66, 82, 82, 18,172, 86, 43,
-181,219,237, 75,130,198, 93, 34,229, 28, 65,209,177, 85, 66,147,214, 55,186, 13,231,190,143,179, 91, 29, 26,247, 59,171,140,147,
-191,122,162,245, 80,142,114, 20,168,137, 58, 33,160,146,199, 83,178,110,203, 47,247,255,193,249, 62,101,234,212,169, 29,125,135,
-167, 39, 76,152,128,188,188,188,142,243,230,205,155, 2,224,173,250,114, 26,128, 20,212, 40,179,111, 81,179, 97,166,213, 74, 94,
- 88,181,234,102, 0,119,172, 92,185, 18,227,199,143,199,127, 94,126,185, 75, 0,129,117,192,183,195, 87,144,191, 25,199,243,183,
- 65,146, 36,239, 70,131,126,167,234,194, 73,170,170,170,108, 57, 57, 57,230, 15, 63,252, 16,177,177,177,104,209,162, 5, 34, 34,
- 34,160,211,233,234,136, 1,121, 11, 23,119,139,197, 98, 59,124,248,176,249,227,143, 63, 70, 92, 92, 28,210,210,210, 96, 50,153,
-160,215,235,149, 14,122,206,154,149,152, 50,233, 70,148,158, 60,130, 55,254,125,155,234,112,222, 51,100, 32, 82, 13, 90,220, 56,
-107, 46, 58,118,236,136, 21,183,141, 6, 71,128,123, 55,236,132, 40,138,248,112,228,117,208,233,180,184,119,195,110,213,156,187,
-119,239, 6,165, 20,105,105,105,176, 90,173,138,203,166,209,104,176,110,221, 58,140, 30, 61, 26,203,150, 45,195,181,215, 94, 27,
- 54,238, 85, 85, 85,182,253,251,247,155, 63,250,232, 35,196,198,198,162, 89,179,102, 48, 26,141, 10,159,175,136,105,213,170, 21,
-202,202,202,208,186,117,235,144,156,213,213,213,182,220,220, 92,243,178,101,203, 16, 27, 27,139,212,212, 84, 24,141,198, 90, 78,
-216,204,153, 51,107, 17,116,235,214,237,119,115,214, 55,223,253, 57,199,140, 25,131,214,173, 91, 35, 50, 50, 82, 73, 3,127,161,
- 93, 31, 80, 74,123,161,246, 52, 7, 7, 0,173,207,231,121, 66,200,238, 0,199,201,255,139, 0,174,246,238,243,120, 53, 64,116,
- 0,190, 96, 60, 37, 94, 83, 33,222,239,248, 90,215, 9, 36,176,228,250, 56, 0,192, 86, 0,232,208,161, 3, 74, 75, 75,161,211,
-233,208,187,119,111,156, 63,127, 94,177,249, 36, 73,194,216,177, 99,249, 39,158,120, 34,129,227, 56,184, 92, 46, 80, 74,193,243,
- 60,228,158,159,191, 14,224, 56, 14, 25, 25, 25, 56,232, 77,211, 97,163, 70, 33, 53, 53, 85,153,196,161,211,233, 48,126,252,120,
- 50,109,218, 52, 65,118, 47, 40,165,176, 90,173,232,214,173,155, 33,132, 59,242,239,207, 62,251, 44, 74,171,213, 42,226, 74, 14,
-203,225,195,135,241,234,171,175,226,142, 59,238,192,201,147, 39,145,156,156,140, 71, 31,125,212,156,149,149,245,111,167,211, 57,
- 43, 92,134,154,205,230, 90, 2,107,210,164, 73, 66, 70, 70, 70,130,209,104, 84,220, 45,175,168, 68, 70, 70, 6, 9,231, 96, 73,
-146,132,111,191,253, 54, 96,239,208,191,199, 64, 8, 1,165, 84, 21,103, 78, 78,142, 34,206,100,247, 66,222,159,151,151,167, 56,
- 88, 94, 33, 24,138,147,202, 66, 77,182,201, 69, 81,212,228,228,228,204, 78, 78, 78, 54, 79,154, 52, 9,149,149,149,104,218,180,
- 41,134, 14, 29, 10, 73,146,224,116, 58,241,224,131, 15,134,116, 94, 68, 81,196,174, 93,187,144,149,149,133, 39,158,120, 2, 11,
- 23, 46,196,224,193,131,107, 57, 88,114, 79, 55, 50,242, 15, 95,227,208,128, 22, 22,224,116,187, 96,177, 88, 65,169, 7, 30,137,
- 66,242, 72,216,191,113,111,187, 95,246, 29,237,156,189,124,169, 8, 0,182, 77, 43,125,207, 74, 30,179,224,255,218,103,198,136,
- 57,155, 46,184,114,194, 12, 59,227,190,251,238,195,179,207, 62,139, 91,111,189, 21,107,215,174,197, 83, 79, 61,133,187,239,190,
- 91, 17,239,114, 89, 80, 49,236,248,222,132, 9, 19,254,181, 98,197,138,171, 30,121,228, 17, 78,174,147, 70,163, 17,132, 16,216,
-108, 54,101, 59,124,248,176,244,207,127,254,243, 39,135,195,241, 94,208,130, 36, 24,126, 52,233, 44, 95,159, 45,229,218, 22,109,
-136,229,136, 16,233,140, 79, 27, 80,126, 67,187,193,116,240,109, 45, 98,168, 84,227,240, 81, 80,216,109,213,120,242,137,199,248,
- 63, 56,183, 70, 14, 25, 50,100,232,236,217,179,235,236,152, 61,123, 54, 14, 29, 58, 52,116,237,218,181, 5,193,134, 68,131,136,
-171,212,168,164,164,121, 0, 96, 40, 42,154,106, 5, 78, 1,192, 11,192, 48, 15, 48,122,237,218,181, 0,128,230,205,155, 67, 2,
- 58, 17,224,127, 60,240, 49,128,111, 2, 57,234, 78,151, 27, 86,171, 13, 18,173, 41, 71, 18,149, 32,121,106, 92, 80,127,145,165,
- 98,220,141, 2,144,120,158, 71,151, 46, 93, 48,108,216, 48,104,181, 90,152,205,102,165,157,247,111,147, 84,220, 20, 41, 0,137,
- 16,130, 86,173, 90, 97,232,208,161,208,104, 52, 48,153, 76,136,140,140, 84, 4, 22,207,243,232,146, 49, 16, 31, 47,123, 5, 19,
-135,117,198,164,235, 18,241,217,254, 18, 85,225, 76, 51,106,145,102,208,161, 67,135, 14,136,136,136, 0, 33, 0,207,115, 74, 56,
- 77, 70, 61, 52,202,240,163,186,184, 23, 21, 21,161,160,160, 0, 5, 5, 5,224, 56, 14,125,251,246,133, 86,171,133, 32, 8,200,
-207,207,199,172, 89,179,224,112, 56, 84,113,114, 28,135,182,109,219, 98,224,192,129,208,106,181,144,239, 21,190, 67,131,162, 40,
-162,178,178, 18,109,218,180,193,170, 85,171,208,191,127,255,176,156, 29, 59,118,196,128, 1, 3,160,209,104, 96, 48, 24,148,169,
- 58, 90,159,184, 86, 85, 85, 41,233,208,189,123,247,122,113,174,217,117, 18,139,214,124, 15,187, 67, 66,133,197, 85,235,132,228,
- 38,145,216,250,209, 19,170,226, 46,115,190,247,222,123, 40, 43, 43, 83,218, 33,121, 65,155,108,158,164,166,166,226,221,119,223,
- 13,122, 15,242,106,145, 77,126,251,226, 9, 33,217, 62,117, 98, 20, 33, 36,219,247, 51,216,113,222,175,215,205,152, 49,163,103,
- 86, 86,214,156, 62,125,250,124,188,125,251,246,229,193,248,130,241,204,152, 49,163,115, 86, 86,214, 28,223,227, 3, 92, 39,160,
-131, 37, 15,249,112,178, 51,147,146,146,162,140, 59,155,205,102,104, 52, 26,229, 96,183,219,141, 15, 62,248, 0, 9, 9, 9, 72,
- 76, 76, 84, 62,131,101, 0,199,113,160,148,226,161,243, 53, 83,128,190,109,170, 65, 1,128, 27,206, 83,133,207,227,241, 96,197,
-138, 21,136,136,136, 80, 42,186,217,108, 14, 57, 92,164,213,106, 7,244,234,213,139,179,219,237,138, 77,206,113, 28, 14, 31, 62,
-140,172,172, 44,140, 31, 63, 30,237,219,183,135,199,227, 65,117,117, 53,174,191,254,122,241,141, 55,222, 24,160, 86, 96, 25,141,
- 70,101,222,145,221,110,199,250,245,235, 17, 29, 29,141,152,152, 24,196,197,197, 33, 54, 54, 22, 58,157, 14,132,144,240, 45, 26,
-165,184,249,230,155,107, 57, 87,190,174,149,111,131, 38, 15,251,169,225,188,246,218,107, 21,247,202,108, 54,227,155,111,126,107,
-159,123,247,101,240, 54,107, 0, 0, 32, 0, 73, 68, 65, 84,238, 13, 74, 41,226,227,227,177, 99,199, 14, 53,141, 46, 36, 73, 66,
- 66, 66, 2, 68, 81, 36,235,214,173,123,193, 43,174,136, 40,138,248,225,135, 31,144,151,151,135,248,248,120,165, 87, 26, 14,213,
-213,213,103,223,120,227, 13,207,219,111,191, 13, 0, 24, 52,104, 16,202,203,203,139,125,246,151, 78,156, 56,177, 86,124, 47, 92,
-184, 80,250, 23,208, 87,112, 59,221,176, 88,109,168,170,172,134, 75,242,192,229,246,160,248,244,249,232, 39,166, 77, 21,255,243,
-224,100, 0,192,180,249,111,161,242,221,223, 26,176, 47,166,141, 75,184,249,213, 79,166, 3,184, 49, 20,191,197, 98,129,205,102,
- 67,243,230,205,177,123,247,110, 84, 86, 86, 98,240,224,193,181,220,223, 48, 67, 16,190,112,156, 62,125,186,239,168, 81,163,118,
-191,246,218,107,173, 59,117,234, 68,170,171,171, 81, 93, 93, 13,139,197, 2,249,251,129, 3, 7,232,242,229,203,127,177, 88, 44,
- 25, 8, 49,103, 72,155, 94,121,212,145, 27,177, 98,203,143,154, 81,127, 31, 51, 58,234,212,233, 66,119,169, 85, 95, 85,110,253,
-201,238,161,135, 64, 61, 20, 30, 74, 65, 61, 18, 60, 84,250,163,215,111,167,182,107,215,238,159,203,150, 45, 11, 40, 72,121,158,
-199,178,101,203,208,175, 95,191,127,230,231,231, 31, 70,136,201,253, 50, 90, 0, 90,183, 40, 62,241,127,255,247,127, 26, 0, 24,
- 56,112,224, 19, 45, 92,174,105, 5,128,163, 83,215,174,183,108,223,190, 61,202,104,172, 89, 39, 20, 21, 21, 5, 74, 41,111,177,
- 88,162, 50, 50, 50,110,217,191,127,127, 93,129, 37, 81,184, 92,110, 88,109,118,148,149, 87,193,229,112,193, 45,185,225,113, 75,
-112, 75, 53,238,168,219,227,129,228,246,192, 45,121,192, 11,124, 68,230, 53,205,170,106,188, 44, 82,182, 57,167,176, 89,160, 34,
- 90,179,194, 11, 72, 74, 74, 82,134,132,125,231,202,168,112, 49,234, 24,245, 53,109, 33, 85,218,198, 31, 55,102,163,248,208, 86,
-104, 8,133,228,113, 65,114, 59,225,113, 57,193, 67,194,161, 99,167,209,169,105,216, 54, 68, 9,231,240,103, 94, 68,239,222,189,
-241,217,184, 27, 65, 8,112,239,250, 29,208,104, 52, 88,126,211, 96,104,245, 90,252, 99,205, 78,181,225,172, 21,247,220,220, 92,
- 60,244,208, 67,120,233,165,151, 96, 48, 24,148,206,201,145, 35, 71,240,201, 39,159, 96,200,144, 33,170,227, 78, 72,205, 80,171,
-156,134, 51,102,204,192,153, 51,103, 48,111,222, 60,244,236,217, 19,162, 40,162,172,172, 12, 25, 25, 25, 56,119,238,156, 42, 78,
- 74, 37,196,198,198, 42,211,117,252,231,136,201, 29,217,250,228,145, 47,231, 93, 55, 37,227,203,109,203, 65, 64,176,243,163,169,
-181,238, 71,239,124,178,165,222,156,207, 62,251,108,173,112,214,211,189,146,181, 8, 9,114,207, 27,165,210,241,146,143,147, 19,
- 89,151,149,149, 53,199,255,252,112,124,190,251,253,206,119,248,137,178,115,106,134, 8, 41,199,113,144, 36, 9,102,179, 25, 90,
-109,141, 3,230,127, 35, 53,153, 76,181, 20,121,184,241,100,158,231, 65, 41, 85, 18,150, 15,176,127,199,142, 29,117, 68,192,127,
-255,251,223,144,227,180,110,183,187, 99, 68, 68, 4, 42, 43, 43,149, 57, 82, 90,173, 22,211,167, 79,199,196,137, 19, 21,113,165,
-213,106,177,120,241, 98,164,167,167,195,225,112,116, 12,149,160, 26,141,198,210,181,107, 87, 78,118,129, 12, 6, 3, 25, 63,126,
- 60,239,116, 58,161,215,235,107,185, 78,242,220,180,112, 98, 72,118,155,190,251,238, 59, 85, 14,150,218, 57, 72,148, 82,236,221,
-187,183,150, 80,243, 46, 53, 6, 0,236,219,183, 79,185,209,170, 29,239,246,120, 60, 48, 24, 12, 68,163,209, 16,147,201, 20, 53,
-105,210, 36,133, 87,206,115, 57,222,106, 38, 90,239,223,191,255,250,144,227, 53, 7, 14,252, 37, 31,199, 32, 73, 18,156, 46, 23,
-172, 86, 27, 42,171, 45,152, 57,215, 59,162, 54, 19, 57, 0,114,250, 78,121, 8,247, 13, 27, 50, 16,225, 87,247, 5, 68,108,108,
- 44, 62,255,252,115,136,162,136, 85,171, 86, 33, 50, 50, 18,163, 71,143, 70,100,100, 36,158,120,226, 9,220,118,219,109,245, 17,
- 88, 0, 80, 94, 90, 90,218,119,234,212,169,187, 95,126,249,229,230,205,155, 55,135,211,233,132,195,225,128,211,233,196,177, 99,
-199,176,124,249,242, 66,139,197,210, 23, 64,121, 56, 50,109,122,229,209,236, 71, 90,159,237, 55,230, 38,219,161,162, 53, 56, 87,
-116, 30,110,207, 41,184, 61, 30,184, 93,238, 26, 65, 32, 73,112, 59,221,224,121, 46,242,250, 62,105,235,106, 38,252, 19, 7,128,
- 17,151, 48,171,104,126,126,126,105,124,124,188,220,131,140,116, 56, 28,196,219,150, 80,252, 54,193,189, 26,128, 83, 13, 97, 33,
- 48,229, 63, 47,189,212, 76, 30,190,127,233,165,151,154, 61,250,200, 35, 83, 0,188,126,104,255,254,165,119,221,117,215,212, 79,
- 63,253,180,214, 57,119,221,117, 23, 14,237,223,191, 52, 88,207,199,229,114,193,106,181,163,164,228, 87,220,115,239, 51, 62,221,
-125,170,244,251,107, 38,189, 83, 0,208, 3, 64,201,185,159,241,224, 67,143,234, 66,117,168,188,245, 29,162, 40,214,153,132,236,
-219,190,171,104, 63,168,255, 20, 11,141, 70,131,163,219,179, 49,117,202, 45,128,199, 13, 56,171, 1,167, 5,212,105, 1,117, 84,
-131,104, 13,160, 46,155, 42, 94,143,199,163, 76,219, 16,120, 14, 58,237,111,237,166,209,104,128, 86,175, 85, 27,206, 58,113, 63,
-113,226, 4,238,191,255,126, 56, 28, 14,140, 25, 51, 6, 54,155, 13,118,187, 29, 54,155, 13,173, 90,181,130,213,106, 85, 29,119,
- 73,146, 20, 23,112,234,212,169,232,217,179, 39,102,205,154,133,199, 31,127, 28,173, 90,181,194,148, 41, 83,240,241,199, 31,163,
-115,231,206,176, 88, 44, 97, 57,229,182,196,108, 54, 67, 16, 4,165, 13,246,205, 43, 89, 96,169,205,163, 64,156,132,252, 54,239,
-214, 55,223, 31,158, 52,168,222,156,115,230,204, 65, 73, 73, 73, 29,231,202,215,193, 90,176, 96,193, 69, 85, 86, 63,151, 41,236,
-113,132,144, 92,239, 95,214,233,211,167, 63, 73, 8,201,158, 62,125,250,147,115,231,206,205, 83,195, 23,104, 63, 33,228, 43,239,
-253,247, 6,159,255,114,213, 8, 44,200,110,147,108,107,202, 9, 39,239, 3, 0,163,209,136,236,236,108,172, 88,177,162,214, 13,
- 37, 24,100,209,246,117,124, 77, 1, 24,233,117,174,228,223, 35,138, 37,140, 26, 53, 10,173, 90,181,170,229, 94, 25, 12,134,144,
- 98, 67,146, 36,156, 56,113, 2, 7, 14, 28, 64,159, 62,125, 80, 94, 94, 14, 1,192,180,253,251,209,105,210, 36,216,189,194, 79,
-171,213,226,159,255,252,167,170, 12,220,179,103, 79,173, 73, 64, 29, 59,118, 60,149,145,145,145,178, 99,199, 14,197,209,210,233,
-116,208,235,245,138,200, 80, 83,169, 41,165,184,229,150, 91,106,137, 33,127,129, 37, 87,158,111,191,253, 86,213, 16, 33,165, 20,
-153,153,153,138,123, 21, 17, 17,129, 47,190,248, 66, 57,230,186,235,174, 3, 33, 4, 9, 9, 9,248,230,155,111,194,114,202,105,
- 42,231, 61,207,243,168,174,174, 70,110,110, 46,180, 90,173, 50, 63,195, 96, 48, 40,241,103, 8,150,225, 18, 28, 46, 23, 44, 86,
- 27, 42, 43,107, 26,210,163, 7, 62,171,117,136,211,126,241,139,211,100, 39,180,162,162, 2,235,215,175,199,231,159,127,142,158,
- 61,123,214, 26, 30, 84, 59, 68,232, 59,143,224,215, 95,127,237,247,248,227,143,239,124,225,133, 23,154,198,197,197,193,233,116,
-226,196,137, 19,248,224,131, 15,206, 88, 44,150,126, 0,206,171, 79, 3, 10,183,203, 13,155,197,138,242,202,106, 60, 63,123,113,
-208, 38, 2, 0,156,142, 74,140, 26,145,169,189,196, 57,117, 26,192,221, 62,191,151, 2,144, 39,227, 87, 0,152, 88, 31, 50, 17,
- 24, 48,230,150, 91, 6, 78,157, 58, 85,249,111,234,212,169,216,185,115,231, 64,113,197,138, 3, 46, 96, 35,191, 98, 69,151,121,
-243,230, 41,199,204,155, 55, 15,159,175, 88,177,193, 3,108, 12,210,109,175,113,176,172, 54, 84, 85, 91, 17, 25,157,140,211,199,
- 55,133, 13,139,134,183,131,134,104,151,229, 54, 36,216,188,155,122,136, 43, 37,164,242,177,242,188,163, 46, 3,111,193,107,175,
-255, 23, 58,142,226,230,129,157, 16,111,144, 64,140,177,208,100, 78, 7,137, 78,171, 57,235,249,171,161,166,173,219,244,212, 52,
- 28, 51,233,241,207,181,219, 32,138, 34, 62, 31, 55, 18, 26,173, 6,119,124,181,185,102,113,207,228,155,161,209,105, 49,244,157,
- 79,212,220,168,149,184, 31, 61,122, 20,219,182,109, 67,135, 14, 29,240,243,207, 63, 43,115,108,229,251,150,202, 14,175, 18,119,
-185, 29, 47, 42, 42,194,168, 81,163,160,209,104,176,120,241, 98,108,218,180, 9,143, 63,254, 56,238,186,235, 46, 92,127,253,245,
-193,230,197,214,225,244,205,163, 96,243,163,234,155, 71,254,156, 74,249,253, 29,249, 46,115,202,147,219, 3,137,245,223, 59,177,
-221,199, 45, 74, 12,176,239, 6,127,231,137, 82,218,203, 59, 55,202, 62,119,238,220,188,185,115,231,142, 34,132,100,207,157, 59,
-119, 84, 48, 7, 43, 16, 79,128,253, 97,219, 65,193, 79,133, 14,240, 21, 81,218, 16, 99,217, 38,147, 9,119,223,125, 55,158,120,
-226, 9,101, 34, 99, 40,200,202, 53, 20,178,179,179,235,252,183,106,213,170,112, 67,132,135,163,162,162,122, 14, 28, 56, 16,229,
-229,229, 56,121,242, 36,204,102, 51, 58,189,250, 42,246,223,119, 31,174, 94,184, 16,220,192,129, 74,133,223,191,127, 63,116, 58,
-221, 97,155,205, 86,175, 76, 53,155,205,136,137,137,129, 94,175, 71, 68, 68, 4, 34, 34, 34, 96, 50,153, 20,161, 21,110,136, 80,
- 46,124, 95,125,245, 85, 72,231,202,215,242, 85, 35,134, 40,165,216,177, 99, 71, 29, 7, 75,190,166,188, 79,118, 50,212,112,122,
- 29, 75,170,211,233,192,243, 60,140, 70,163, 98,247,235,245,122,101, 83,235, 96,133,123,144,104, 90, 90, 90,173, 7,145,254, 63,
-123,231, 29, 30, 69,181,134,241,119,102,182,111, 54, 13, 82, 72, 15, 1, 2,129,208, 66,151, 38,160, 8, 72, 17, 68,176, 97,167,
-169,112,189, 82, 45, 24, 80, 1, 69, 64, 16, 1, 1, 5, 1, 1, 43, 77,138,244, 38,229,146,208, 99, 66, 40,233, 33, 36, 33,109,
-179,117,202,185,127, 36, 27, 55, 33,101, 55, 4, 80, 56,191,231,217,103,119,167,188,115,206,204,153,153,119,190, 83, 70, 46,151,
-151, 27,136,244,223, 95, 69,104, 70,177,190,184,206,245, 45, 22, 11,100, 50, 25,126,253,245, 87,116,234,212,169,204, 92,217,140,
-149,253,113,119,146,180, 91,183,110, 61,186,120,241,226,147, 11, 22, 44,240,212,235,245, 88,179,102, 77,129, 94,175,127, 20,165,
-237,136, 28,190, 24, 2,224,173, 2, 12,102, 51,244, 69, 37,251,224,234,197, 95,106, 52,101,255,102,154,183,106,245,226,234,213,
-171,111,155,190,122,245,106, 36, 38, 38,190,136,243,231, 15, 6, 1,203,167, 78,157,218,184, 93,187,118, 65, 0, 48,117,234,212,
-212, 32, 96,121,117,231,185,173,138, 80, 95,106,214, 77,197, 57,117, 22,105,173,248,192,119,167, 55, 68,134, 97,202, 76,198,227,
- 35, 94, 67,198,181,120, 68,104,115,224,227,225, 2,169, 40, 3,138, 62,209, 56,127, 75,139, 47,151,239,118, 42,157, 90,165, 2,
-106,205,223,213, 77,106,141, 26,170,210, 90, 5,134, 97,160,214,106, 32, 87, 42,157,206,123,124,124, 60,180, 90, 45, 68, 81,188,
-237,126,227,108,143,102, 66, 72,217,189,115,193,130, 5,152, 60,121, 50,214,172, 89,131,243,231,207,163, 77,155, 54,120,236,177,
-199,112,243,230, 77,156, 59,119, 14,102,179,217,225,116,218,223, 47,226,226,226,176,119,239, 94, 36, 36, 36, 32, 53, 53,181,214,
-199,189, 98, 53, 99,105, 13, 78,137,121,221,123, 6, 79, 63, 30, 85, 43,205,232,232,104,220,188,121,243,182,200,149,125,243,163,
-106, 34, 88,101, 94,164,154,242, 21, 99,111,130,108,145, 38,123, 67, 84,241, 63, 0, 79,219,180,105,211,166,189,231,232,122,246,
-255,109, 17, 48, 71,170, 22,237, 13, 22, 83,177,186,142, 97,152,178,157,110, 31,153,178,253,214,106,181,101, 81,166,144,144,144,
-106,163, 87,182, 19,142,227, 56,116,191, 86, 4,165, 82, 89, 86,157,215,255,166, 84, 46, 68, 30, 22, 22, 86,174, 13,150,253, 65,
-169, 12,179,217,124,240,224,193,131,109, 7, 15, 30,204,197,197,197, 65, 38,147, 65,146, 36,152, 59,119, 70,155,229,203,113,225,
-157,119,208,227,250,117,152,121, 30,106,181, 26,187,118,237,178, 26, 12,134,131,206, 20, 26,150,101, 25,155,193, 82,169, 84,112,
-117,117,133,155,155, 91, 89, 52,199,153,139, 80, 85, 79,136,246, 31,103, 78,104, 91,131,126,251, 27,171,237,248, 25,141,198,114,
-134,203, 81,236,171, 12,108,166,200,221,221,189, 92,181,168, 45,138,231,136,193,170,105, 32, 81,149, 74,229,118,248,240,225,198,
-110,110,110, 32,132, 32, 39, 39, 7,207, 62,251,236,229,127,125, 0, 11,164,164,145,187,209, 4,189,209, 84,231,250, 63,252,240,
- 3,174, 92,185, 2,171,213,138, 57,115,230,220,102,172,106, 25,193,178,113, 69,163,209, 72,253,250,245,195,241,227,199,161, 82,
-169,120,212, 98,252, 42, 34, 73,176,242, 2, 76, 70, 51,244,197,197,120, 24,184,116,254,252,207, 46, 46, 46,207, 2,208,229,231,
-231,115,238,238,238,208,106,181, 48, 26,141, 5, 92,105, 79,193, 36,192,162,225,249,207, 70,140, 24,177, 16, 0,100, 60,255, 89,
-117,227, 96,149, 25,172, 58,222,143,182,235, 86, 85,209,171,218,154, 43,134, 97, 74,186,231,179, 44,214,204,153,140, 8,109, 54,
-162, 26,186,192,116,243, 10, 84,110, 94, 96, 60, 66,241,229,242,221,136, 75,186,229, 84, 58,159, 91,247, 11,130,130,130,176,253,
-165, 33, 80,169, 84,120,246,151,189, 37,141,180,199,142,132, 66,173, 66,159, 37, 63,212, 42,239, 6,131,161,202, 72,149, 19, 17,
-172, 50, 77,155, 1,140,138,138, 66,147, 38, 77,112,240,224, 65, 68, 69, 69, 33, 49, 49, 17,137,137,137, 72, 74, 74,194,249,243,
-231,145,151,151,231,244, 49,218,180,105, 19,178,179,179,161, 80, 40, 80, 88, 88,136,235,215,175, 87,215,254,217,225,227,110,163,
-217,147,209, 0, 0,127,111,119,167, 12,150,189,230,188,121,243,156, 25,230,161,156, 76, 53,243,114, 42,180,117,178,253,183, 84,
- 48, 59, 21,255, 87, 92, 30, 0,110, 2,224,106, 88,175,226,255,156, 57,115,230, 28,180, 69,190, 74,117,185,170,218, 95, 85,140,
- 96,217,155, 0, 99,179,102,205, 52,246,245,167, 44,203,194,213,213,149,153, 52,105, 18,199, 48, 12,116, 58, 29,220,221,221, 17,
- 30, 30, 14,171,181,230,102, 9, 10,133,194,216,177, 99, 71,141,125,232,149, 97, 24,184,184,184,112, 83,166, 76, 97, 86,173, 90,
- 85,233,122, 91,183,110,173,182,112, 11,130,176,112,212,168, 81,175,167,165,165,121,250,250,250, 34, 51, 51, 19, 10,133,162,100,
-180,216, 94,189,208,253,218, 53, 88, 75, 13, 67,124,124, 60, 86,174, 92, 89,108,181, 90, 23, 58,123,209,208,233,116,168, 95,191,
- 62, 84, 42, 85,185, 94, 49,118,161, 85,135, 34, 88,117,105,174,108,154,246, 55, 86,219,239,177, 99,199,150,253,119,230, 34,169,
- 80, 40,200,147, 79, 62, 89,246, 14, 66, 15, 15, 15,120,121,121, 33, 43, 43,235,239,158, 58,165,145, 59, 71, 13, 86, 77, 3,137,
-202,229,114, 88,173,214,178,234,204, 37, 75,150,220,137, 49,248,231, 24, 44, 65, 98,116, 58,111,248,251, 55,133,183,143, 9,146,
- 36,214,153,182, 32, 8, 24, 55,110, 92,185, 49,175,108, 55, 98,219, 32,182,182, 30,190,246,225,127,103,159,196,239, 56, 58, 66,
- 0, 94, 40,141,226, 25, 44,255,186, 99, 24, 18, 18,226,150,156,156, 92, 89,187,168, 74,123,251, 1,127, 15,201,192, 1,159,164,
-164,164,180,116,119,119, 71,223,190,125,177,109,243,230,173, 31, 2,101, 33, 27, 35,144,166,185,113,227, 63,165,191,211,107, 10,
-234,217,170, 8,139, 13,117,109,214,153,219,162, 87,119, 90,149,195,178, 37, 15,102,191,125,243, 25, 34, 52, 89,104, 19,172,194,
-177, 19,231,208, 41,136,128,152, 21,181, 78,167, 78,167, 43,105,140,175,213, 66,165,250,187,205,149, 74,171,129, 66,169,170,117,
-222,237, 35, 85,119, 26,193, 98, 24,182,220,126,124,253,245,215, 49,117,234, 84,244,237,219, 23,137,137,137, 56,124,248, 48, 46,
- 95,190,140, 9, 19, 38, 32, 50, 50, 18, 79, 60,241,132, 83,199,232,183,223,126, 67, 65, 65, 1, 8, 33,200,206,206,134,201,100,
-194,140, 25, 51,238,248,184,219,184,182,103, 54, 0,224,151, 61,177,181,214,156, 62,125,122,217, 24,140,182,123,126, 13, 81, 43,
- 71,238,119,167,170,251,239,236,250,247,130, 74, 13,214,229,203,151, 43,237, 43, 31, 17, 17,145,213,167, 79, 31,159,132,132, 4,
-232,116, 58,132,135,135,195,108, 54, 87, 87, 13,209, 18,165, 99,101, 92,186,116,169, 82,205,176,176, 48,235,227,143, 63, 46,111,
-208,160, 65,185,200,149,173,135,141,189, 51,174,168, 89, 74,145,201,100, 26,221,181,107,215,181, 59,119,238,212,132,135,135,163,
-160,160,164,253,237,154, 53,107,240,214, 91,111, 65,163,209, 32, 33, 33, 1, 67,134, 12, 49, 24, 12,134,209, 40, 63, 6, 86,101,
-154,183, 25, 25,133, 66, 81, 86, 77,102,171, 42, 83, 86, 31,138,190, 77,147, 97, 24, 44, 94,188,184,210,177,160, 42,178,124,249,
-242,202,220,124,165,233,252,226,139, 47,234, 76,243,228,201,147,229,222, 49, 56,112,224,192,111,158,120,226, 9,164,166,166,150,
-171, 22,172,193, 96,149,211,172,105, 32, 81,142,227,224,235,235,139,143, 63,254, 24, 94, 94, 94,104,208,160, 65,101, 6,171,218,
- 99, 84, 75,238,170, 38, 97, 73,204,162, 5,209,221,190,249,246, 23,185, 74,201,226,248,225, 95, 80,152,119,163,124, 4,214,250,
-119,151,104,101, 84, 31, 88, 98,247, 57,148, 78,179,217,140,207, 63,255, 28,209,209,209,136,142,142,174, 54, 65, 85,116,135,174,
- 49,239,246, 6,203, 65,179,117,155,166, 36,137,140, 90,235, 9,173,139, 63, 34, 35, 61, 33,145,154,199,234,148,238,255,113, 55,
-164,166,166,186, 7, 5, 5,225,242,229,203, 12,254,110,143,245,247,177, 82, 42,159,173, 96,176,110, 63,223,129,243, 27, 54,108,
-104,217,170, 85, 43, 44, 89,178, 4, 0, 94,250,252,143, 63, 70, 70, 27, 75,194,153, 28,176,177,212,140,213,152, 78,145,136,140,
- 90,235, 1,141,174,116, 63, 74,142,143,121, 74,170,201,187,237,230,119, 39, 15,122,149,105,218,214,191,122,252,119, 60,217, 63,
- 16,127,158, 60,143,125,105, 46, 8, 82,101,192,207,144, 13, 41,251, 47,252,103,120, 20,190,252,185,228, 38,126,254,116,205,154,
- 12,195,224,232,164,209,208,169, 85,120,122,195, 14,200,229,114, 28,124,231,101, 40, 20, 10,244, 92, 80, 82, 37,123,225,243,233,
-144,169,148,136,152, 16,237, 80, 58, 43,214,212,216,218, 92,217,155,171, 26, 34, 88, 85,230, 93,175,215, 35, 47, 47, 15,107,215,
-174,197,171,175,190,138,155, 55,111,226,250,245,235, 72, 72, 72,192,198,141, 27,203,221,227,224,196, 49,154, 54,109, 26,222,125,
-247, 93,176, 44,139,150, 45, 91, 34, 58, 58, 26, 93,186,116,113,250, 24, 85, 60,238, 21,113, 32,122, 85,165,230,162, 69,139,156,
-238,176,245, 32,226, 84, 3, 13, 91, 36,203,203,203, 11, 46, 46, 46, 0, 80,238, 6, 91, 83, 53, 97, 85,154,130, 32, 64,163,209,
- 64,163,209,148, 27, 22, 97,240,224,193, 53, 70,176, 74,217,149,144,144,240,124,139, 22, 45,190,139,142,142,118,121,244,209, 71,
-229,254,254,254,104,215,174, 29, 18, 18, 18,240,251,239,191, 91,151, 46, 93,106, 48, 24, 12,175, 2,216, 83, 27,243,108,107,248,
-109, 63,162,189, 51,136,162,152,122,253,250,117,191, 47,190,248,130, 99, 24, 6, 11, 23, 46, 44, 55, 64,107,197, 60,158, 56,113,
- 66, 32,132, 92,169, 33,138,145,122,253,250,117,191,249,243,231,151,211,180,125, 42,154, 20, 71, 52,171,194,150,231,138,251,192,
-145,147,167,166,129, 68,101, 50, 25,226,227,227,241,209, 71, 31,129, 97,152,114, 29, 39,254,205,252,249,191,204, 85, 93,218,193,
-243,217,225,189, 91, 49, 96, 97,169, 36,210,203,229,230,151,153,171,161,243, 55,225,183,119, 71, 58,114, 44,174, 31, 58,116, 40,
-120,246,236,217, 28,199,113,152, 55,111, 94,185,178, 84,241,184,239,223,191, 95,212,104, 52, 41,181,205,135,213,106,117,164, 23,
- 85, 85, 39,248,177,197,243, 62,234,251,205,234,109,114,134,177,224,248,161, 95, 80,144, 95,121,215,116,165, 92,134,117, 27,182,
- 10, 50,142, 77,189,207,135,238,155,199, 30,123,108,198,222,189,123,101, 65, 65, 65,181, 22, 9, 4,182, 45, 94,188,184,255,168,
- 81,163,234, 53,111,222,220,214,249, 68, 89,250, 65,233,200,238,187, 28, 52, 73, 91,190,252,226,163,151, 86,172,222,166,100, 25,
- 43,142, 31,254, 5, 5, 21,204,250,237,209,104, 57,214,111,216, 98,149,201,184,248,154,174,193,181,233,193,236, 8,109,159,124,
- 21, 95,239, 88, 9,159, 86,253,241,204,160,110, 56,186,228, 37,140,104,110,132,245,199,231,208,242,153,117, 88, 51,189, 36,122,
-211,230,167,233, 14,221, 43,220,116,127, 15, 88,201,178, 44, 84,106, 13,228,202,191,163, 47, 74,173, 22,156, 19, 17, 91, 91,222,
-171,139, 84, 57,187, 63, 56,142, 67, 88, 88, 24, 26, 53,106,132,174, 93,187,162,109,219,182,232,213,171, 23,206,157, 59,135,115,
-231,206, 97,194,132, 9,213,153,171, 26,143, 81,223,190,125,209,175, 95,191, 59, 62, 54, 21,143,123, 93,224, 72, 89, 26, 63,126,
- 60, 0,220, 81, 52,235,129, 54, 88,222,222,222, 80, 42,149,181, 50, 84,149,105, 90, 44,150, 50, 99,165,209,104,202, 34, 86, 91,
-183,110,117,166,128,239, 49, 26,141,145, 31,124,240,193, 68,141, 70,211,203,104, 52, 70, 0,128, 86,171,253,203, 96, 48, 28,176,
- 90,173,139, 0,228,223, 73, 90,237, 13, 70, 37, 81,174,106, 31,241,179,179,179,159,120,241,197, 23,247,176, 44,219,176,186, 23,
- 51,219,153,213,164,172,172,172,254, 53,105,190,240,194, 11,149,106, 86,166,235,136,102, 21,230,176,156,169,178,239, 97,232, 80,
- 33,171, 97, 32, 81,185, 92, 14,157, 78,135,205,155, 55,163,126,253,250, 15,212, 9,118, 60, 38,243,243,234,230,247,172,175, 60,
- 4,192,123,232,252, 77, 41,135,114,173, 33, 67,231,111, 74,254,237,221,145,193, 53, 24,158, 71,230,206,157,123,148,231,249, 16,
- 7,203,109,178,217,108,238,230,108,218, 9, 33,136,143,143,151, 94,127,253,245,156,236,236,236,103,106,147,255,195,199,147, 23,
-116,235,232,239, 53,124, 72,183, 14, 96, 24, 88, 44, 85, 52,234,101, 64, 8, 33, 68,198,177,169,135, 78,164,190,126,159, 95,161,
-113, 54, 57, 57,121, 86,227,198,141,199, 0,168,234, 78,184,177, 38,145, 36,192,162, 52,155,191,104,223,190,253,148,247,222,123,
-207, 99,208,160, 65, 8, 10, 10,130,187,187,243,111, 11, 58,118, 42,125, 76,231,118, 98,224,211,131,187, 61,193, 50, 12, 49, 91,
-170,111, 28,205,216,246,167,140,139, 63,124, 50,173,117,117,209,121,155, 41,191, 27,209,134, 62,195, 95, 65,159,225,175,148,149,
-167,125, 63, 63,138,152,244, 63,208,142, 77,135,121, 69, 55, 48,110,182,162, 94,243, 48, 55, 44,203, 98,208,234,205, 80, 40, 20,
-101,233,124,100,110,249,126, 1,225,111, 58,254, 46,117,251,188,219, 71,176, 42,185, 22, 59,213, 6,139,227, 56,228,228,228, 32,
- 33, 33, 1, 89, 89, 89, 48, 24, 12,136,139,139,131,197, 98, 65, 94, 94, 30, 90,182,108,233,220,211,253, 93, 56, 70,247, 83,243,
- 97, 48, 86,181, 50, 88,132,144,180, 78,157, 58,213,116, 51,118,170,151,145, 76, 38, 51,117,235,214,141,169,172,183,129,237,183,
- 70,163,113,244,241, 57,223,106,181, 70, 91,173,214,104,148, 86,133, 89,173,214, 59,110, 72, 34,138, 98, 70,199,142, 29,185,234,
- 46,250,146, 36, 85, 59, 98, 92, 78, 78, 78,113, 78, 78, 78,157,190, 58,252,110,104, 86,114,210,136, 99,198,140,169,214, 73,185,
-184,184, 84,219,184,168,166,129, 68, 13, 6, 67,230,139, 47,190, 40,218, 87, 53,219, 15, 68,250, 64,195,144,228, 1,207,190, 22,
-114, 40,215, 26, 2, 0, 54,147, 5, 66,146,171, 90,229,244,233,211, 89, 0, 26,223,237,164, 93,187,118,205,210,169, 83,167,245,
- 69, 69, 69,227, 1, 24,106,171,115,244, 84,198,244,127,225,145, 57, 11, 96,236,157,138, 88,128, 56, 95,147,105, 92,244,135, 31,
- 62,253,209,135, 31,134, 75, 64,125,148,142, 81,197, 57, 96,210,236, 57, 17,115,163,206,199, 6, 19, 69, 49,237,145, 71, 30,113,
-122,157,154,230, 87, 51,146, 56,126, 64, 16,112,218,121,205,187,145, 78,155,102,171, 86,173,208,166, 77,155,178,111, 27,246,211,
-219,182,109,235,144,102, 84, 84, 20,154, 55,111, 94,229, 8,237, 21,219, 92,221,239,188,219,176, 61,250,182,109,187,187,206, 52,
-239, 52,157,148,234,105, 73, 53,169, 38,213,252,215,106,114,116,127, 82, 77,170, 73, 53,239,161,230, 3, 5, 75,119, 1,133, 66,
-169,234, 1,147,238, 2, 10,133, 66,169, 29, 76, 53, 46,212,153,158, 59,181,113,178, 23,168, 38,213,164,154, 84,147,106, 82, 77,
-170,249,208,105,214,164, 93,215, 61,135, 31, 72,104,248,148,106, 82, 77,170, 73, 53,169, 38,213,164,154, 15, 29,180,138,144, 66,
-161, 80, 40, 20, 10,165,142,145,209, 93, 64,161, 60,220, 68,223,225,131, 86,244,109, 99,131, 62,220,233,164, 80, 40, 20,128, 70,
-176, 40, 20, 10,133, 66,161, 80,168,193,162, 80, 40, 20, 10,133, 66,161, 6,139, 66,161, 80, 40, 20, 10,229, 33,131,161,187,128,
- 66,121,184,137,166,109,176, 40, 20, 10,165,206,161, 17, 44, 10,133, 66,161, 80, 40,148, 58,198,214,139,208,254,125,125, 52,170,
- 69,161, 80, 40, 20, 10,229, 94,243, 64,121, 17, 25, 53, 86, 20, 10,133, 66,161, 80,254, 33, 60, 48, 94,132,173,194, 57, 82, 40,
- 20, 10,133, 66,161,220,107, 30, 24, 47,194, 62,136,174,145, 66,161, 80, 40, 20,202,191,146, 7, 54,130, 69,163, 88, 20, 10,133,
- 66,161, 80,238, 23, 15,140, 23,145, 61,104,142,145, 66,161, 80, 40, 20,202,191,146, 7,202,139,220,237, 97, 26,232,155,198,169,
- 38,213,164,154, 84,147,106, 82, 77,170,249,208, 65,199,193,162, 80, 40, 20, 10,133, 66,161, 6,139, 66,161, 80, 40, 20, 10,133,
- 26, 44, 10,133, 66,161, 80, 40,148,135, 10, 25,221, 5, 20,202,195, 77,244,191,228, 29,125,209,244, 93,130, 20, 10,229, 95, 4,
-141, 96, 81, 40, 20, 10,133, 66,161,212, 49, 12,170,238, 9,112,193, 9,157,218,244, 38,184, 64, 53,169, 38,213,164,154, 84,147,
-106, 82,205,135, 78,179, 38,237, 11,160,220, 21,227, 69, 53,169, 38,213,164,154, 84,147,106, 82,205,135, 79,243,129,130, 86, 17,
- 82, 42, 34, 67,245,109,243,106,154,127,175, 52, 41, 20, 10,133, 66,249, 71,223, 76, 41, 20, 27, 93, 0, 12, 44,253,189, 29,192,
-113, 39,231,223, 43,205,251, 66, 84, 84,148, 70,173, 86,247,221,191,127,191, 34, 62, 62, 30, 39, 78,156, 32, 63,252,240, 3,111,
- 50,153,254,136,141,141, 53,210,226,243, 96,208,182,109,219, 39, 24,134,153, 10, 0,132,144,207,206,156, 57,179,251, 14,228,152,
-198,141, 27, 79, 80, 42,149, 3,228,114,185,191, 40,138,140,217,108,206, 48, 26,141,123,210,211,211,231,163,118, 13,247, 59,120,
-121,121,141,141,140,140, 12,191,118,237, 90,106, 74, 74,202, 58, 0,187, 1, 60, 17, 28, 28,252, 98, 88, 88, 88,208,197,139, 23,
- 47,231,228,228, 44, 7,240,191,251,152, 78, 10,133, 26, 44, 7, 96, 61, 61, 61, 31,215,104, 52, 19,245,122,125,148,155,155,219,
- 69, 65, 16, 22,103,102,102,110,167, 39,222, 3, 85, 22, 6, 18, 66,228, 0,192,113,220,144,142, 29, 59,134, 48, 12, 35, 49, 12,
- 67, 8, 33,204,201,147, 39,219,138,162,200, 2, 0,195, 48, 3, 75, 47,222, 66,109, 53, 5, 65, 96, 78,159, 62,237,172,230, 93,
-161, 69,139, 22,179, 9, 33,254,213,238, 32,153,172,253,190,125,251,154,109,217,178, 69, 88,183,110, 93,254,200,145, 35,117, 47,
-191,252,178,108,205,154, 53, 95, 3,248, 79,197,229,155, 55,111,190,128,101, 89, 47, 71,182, 47, 73, 82, 78, 92, 92,220,127,105,
- 49,188,255, 48, 12, 51,245,181,185, 7,123, 72, 4,248,110, 90, 79,182,212,188,212,214,172,125,255,212, 83, 79, 61,219,180,105,
- 83,153, 36, 73,224,121, 30,102,179,185, 89,108,108,236,163,187,119,239,110,159,148,148,244,140,147,146, 3,167, 77,155,182,114,
-214,172, 89,222,114,185,156,225,121,190,243,143, 63,254,216,111,236,216,177,103,151, 47, 95,222,102,196,136, 17,174,182,233, 31,
-125,244, 81,255, 57,115,230,188, 3, 96,227,125, 72, 39,133, 66,111,170,213,205,212,233,116, 77,188,189,189,223, 45, 44, 44,236,
-223,190,125,251,130,209,163, 71, 95, 61,119,238, 92, 92,100,100,164,126,245,234,213,159,242, 60,191,212,211,211,243,143,194,194,
-194,249, 89, 89, 89,113, 78,110,187, 9,128,209, 0,250, 3, 8, 4,144, 1, 96, 39,128,149, 0,226,107,147, 25,127,127,255, 86,
- 46, 46, 46, 83, 24,134,233, 92, 92, 92, 28,232,226,226,146, 65, 8, 57, 89, 84, 84, 52,239,198,141, 27,177,181,209, 12, 8, 8,
-104, 4,224,109,153, 76,214, 93, 20,197,134, 28,199, 37,139,162,120, 68, 20,197, 37,153,153,153,151,107,163,249, 72,160,110,144,
-164,115,155,207,115,154, 32,189, 73, 80,232, 84, 50, 94, 46,153, 82,165,226,252,105,167, 82,139,127,249, 39, 20, 12,165, 82,201,
-174, 91,183,174,141, 82,169, 4, 0, 88, 44, 22, 68, 70, 70,222,209,123,162,228,114, 57, 59,111,222,188, 54, 10,133, 2, 0, 96,
-181, 90,209,187,119,239,127,196,187,167, 24,134, 9,140,137,137,113,183,165,173, 34,162, 40, 98,200,144, 33,161, 74,165, 18,203,
-151, 47, 23,114,114,114,162,190,251,238,187,152,175,191,254,218,235,251,239,191, 31, 94,153,193, 98, 89,214,171, 42, 77, 81, 20,
- 97,181, 90, 33, 8, 2, 44, 22, 11,122,245,234, 69,175, 70,255, 16, 8, 33, 33, 4,192,206,115, 38, 0,168,127, 39, 90, 26,141,
- 38, 98,232,208,161,178,236,236,108,200,229,114, 88,173, 86,220,184,113, 3,141, 26, 53,226, 44, 22, 75, 83,103,245,154, 53,107,
- 54,118,206,156, 57, 62, 59,118,236,176,174, 95,191,222,252,216, 99,143, 41, 94,125,245, 85,183, 30, 61,122,116, 15, 12, 12,100,
-191,251,238, 59,243,222,189,123,173, 47,188,240,130,106,246,236,217, 62, 59,119,238,124,246,252,249,243, 27,239,117, 58, 41, 20,
- 74, 53, 6, 75,167,211, 29,210,233,116,141,223,120,227,141,248,241,227,199,255,161,211,233, 68, 0,184,113,227,134,106,200,144,
- 33,217,195,134, 13,187,105, 48, 24,184,165, 75,151, 6,127,245,213, 87,123,116, 58, 93,186, 94,175,239,232,200,189, 12,192, 68,
-150,101,223,238,219,183,239, 33,158,231,179, 55,111,222,252,211,240,225,195,187, 73,146,228,178,127,255,254,223, 69, 81,252, 6,
-192, 23, 78, 68,199,184,176,176,176,104, 47, 47,175, 73,203,150, 45, 83, 53,108,216, 16, 90,173, 22, 69, 69, 69,193,151, 47, 95,
- 14,154, 56,113,226, 96,141, 70,179,216,221,221,253,131,216,216, 88,222,209,123,174,191,191,255,127, 92, 93, 93, 63,249,244,211,
- 79,213, 45, 90,180, 96,180, 90, 45,146,146,146, 90, 30, 63,126, 60,242,219,111,191,125,149,101,217,153,233,233,233, 14,167,179,
- 39, 32, 51, 55,246,222,237, 26,218,178,215,242,149,223, 50, 94, 46, 90,200, 24, 6,188,213, 42,207, 50, 24,195,222, 26, 55,230,
-167,206,170, 75,199,138,228, 89,125,226,226, 96,189,199,101, 65, 0,176,157,227,184, 33, 74,165,146, 29, 50,100, 8,246,238,221,
-203,152, 76, 38, 25, 0,168,213,106, 97,200,144, 33,208,104, 52,176, 88, 44, 18, 74,170,243, 4, 0,170,210,245,205,213,105,202,
-229,114,182, 87,175, 94,134,211,167, 79,231, 26, 12, 6,185, 77,179, 87,175, 94,245, 84, 42,149,150,231,121, 71, 53,239,166,169,
-196,149, 43, 87,110, 51, 66, 55,111,222, 68,110,110, 46,204,102, 51,147,151,151, 7, 81, 20, 97, 54,155,179, 69, 81, 4,203,178,
-182, 50, 93, 41, 10,133, 2, 9, 9, 9,183, 77,183, 90,173, 48, 26,141,224,121, 30,133,133,133, 26,181, 90,221,184, 91,183,110,
-105, 0,182,232,245,250,249,231,206,157, 75,166,151,167,251, 70,202,239,103, 76,193, 0,172, 0,174,221,161,113,151, 0,224,200,
-145, 35,200,202,202, 66,118,118, 54,178,179,179, 17, 20, 20, 4, 66,136,211,209,255,248,248,248, 69,109,219,182,101,206,158, 61,
-187, 13,192,202, 77,155, 54, 13,189,117,235,214,178,201,147, 39,215,155, 55,111,222,173, 41, 83,166,140, 3,240,219,166, 77,155,
- 94,105,213,170,213,160,243,231,207,127,121, 63,210, 73,161, 80,170,105,228, 78, 8,241,111,210,164,201,173,133, 11, 23, 54,155,
- 54,109, 90,125,189, 94,207,149, 70,137, 76, 0, 96, 48, 24,184,169, 83,167,122,207,157, 59,183,153, 74,165,202, 19, 4,193,187,
- 18,153,202,186, 90,190,237,230,230, 54,248,234,213,171,155,154, 53,107, 86,111,206,156, 57,103, 92, 92, 92,200,151, 95,126, 25,
-219,168, 81, 35,191,228,228,228,181,110,110,110,189, 1, 76,170, 34,105,183,105,134,134,134,126, 52,124,248,240, 73,199,142, 29,
- 83,181,110,221, 26,174,174,174,224, 56, 14, 30, 30, 30,232,212,169, 19,115,248,240, 97,213,128, 1, 3, 38, 20, 20, 20,204,115,
- 84, 51, 32, 32, 96, 82,191,126,253, 62, 61,125,250,180,166, 79,159, 62,140, 82,169, 68,126,126, 62,148, 74, 37,186,116,233,194,
- 44,251,122,137,166,101,139,230, 31, 5, 6, 6,206,114, 84,211,220,196,107,207,200,241, 83,123,111,223,185,155,241,245,245,197,
-213, 47,102,225, 72,143, 72, 36,126, 60, 13,126,126,126,216,182, 99, 23, 51,112,212,248,110,110,188,239,126, 71, 53,235, 0,123,
-205,227,145,145,145, 49,113,113,113,232,222,189, 59,126,250,233,167,214,147, 39, 79, 30, 63,121,242,228,241, 63,253,244, 83,235,
-238,221,187, 35, 46, 46, 14,145,145,145, 49, 40,105, 43, 53, 30,192,173,210,207,248,234, 52, 15, 29, 58,132,222,189,123,231,109,
-218,180,169,209,140, 25, 51,102,207,152, 49, 99,246, 79, 63,253, 20,214,187,119,239,188, 67,135, 14, 57,171,121, 55,242, 94,102,
-168, 42,126, 8, 33,144, 36, 9, 62, 62, 62, 55,119,236,216, 65, 6, 14, 28,200, 53,104,208, 32, 99,200,144, 33,170,147, 39, 79,
- 18,134, 97,182, 59,147, 78, 66, 8,140, 70, 35,140, 70, 35,174, 93,187,166, 89,188,120,113,183, 73,147, 38, 53,249,241,199, 31,
- 3, 38, 76,152, 48,206,205,205, 45,182,117,235,214, 33,247, 58,239, 84,179, 44,242,120,163,212, 92, 21,179, 44,155, 82, 91,205,
- 97,195,134,181, 12, 9, 9,241,253,241,162, 39,242, 20,205, 32,202,221, 33, 41, 60, 32,214,239,128, 68, 69, 63,248,251,251,251,
- 6, 7, 7,119,113, 50,157,123,206,158, 61,219, 31,192,114, 0, 34,128,159,167, 76,153,242, 58,195, 48,191, 76,153, 50,101, 12,
-128,159, 75,167,175, 58,127,254,252, 32, 0, 7,238, 83, 58,105, 89,162,154,117, 10, 33,164, 3, 33,228,201,210, 79, 71, 66, 72,
-167, 10,255,149, 21,150,123,172,138,239, 39, 43,252,239, 80, 97,189, 14,117,109,176,136,221,199,246, 68,195,127,254,249,231, 39,
-190,253,246,219,189,153,153,153,126, 97, 97, 97, 79, 14, 29, 58, 52,164,176,176,144, 29, 54,108, 88,168,159,159,223,192, 3, 7,
- 14, 52, 24, 54,108,216,254,225,195,135, 31,103, 24,198,145,118, 51,141, 56,142,123,231,236,217,179, 71, 67, 67, 67,173, 25, 25,
- 25,174,109,219,182, 45, 2,128,240,240,112, 67,110,110,174,198,213,213, 21, 59,118,236, 56,197, 48,204,104, 0,205,106, 18,244,
-243,243,107,235,229,229, 53,233,147, 79, 62, 81,113, 28, 87,233, 50, 42,149, 10,159,124,242,137,202,205,205,237, 13,127,127,255,
-206, 53,105,250,250,250, 70,184,186,186, 70, 47, 94,188, 88,109,177, 88, 96,181, 90,225,235,235, 11,157, 78,135,204,204, 76,164,
- 95,191,142,155, 73, 73,152,240,218,107, 26, 23,141,230, 29, 63, 63,191, 54, 53,105,118, 11,209, 13,209, 5, 52,127,244,173,183,
- 39,226,210,196,215,176, 55, 64,137, 6,111, 79, 69,235,131, 23, 16, 56,115, 62, 14,132,185, 33,230,153,199,241,206, 59,239, 66,
-225, 19,246, 72,151, 64,151,145,247, 37,164, 41,147, 17,149, 74, 5,147,201, 36, 59,114,228, 72,119, 65, 16,228,130, 32,200, 15,
- 31, 62,252,232, 31,127,252,209,127,206,156, 57, 79,104, 52,154,113,157, 59,119,254,158, 97,152, 69,132, 16, 13, 33, 68, 3, 96,
-158, 93,228,233, 54, 77,185, 92, 14,163,209, 40, 63,125,250,244, 24, 81, 20,149,162, 40, 42, 79,159, 62,253,230,129, 3, 7, 94,
- 92,190,124,185,211,154,247, 10,142,227, 32,147,201, 32,151,203,209,166, 77,155,171, 27, 54,108,224,253,253,253,101, 43, 86,172,
-240,244,241,241,113,249,254,251,239,243,243,242,242, 62,119, 70,211, 98,177,192,108, 54,195,104, 52,226,200,145, 35, 13,223,120,
-227, 13,153,197, 98, 17, 71,141, 26,117,139,231,121,243,155,137,186,117,110, 0, 0, 32, 0, 73, 68, 65, 84,111,190,233,166,211,
-233,222,165,207,127,247, 7, 66,136, 8,160, 24,128,158, 16, 98, 6,128,144,144, 16,149,191,191,127,171,144,144, 16,135,203,163,
- 94,175,255,102,193,130, 5,129,172,202, 3, 71, 45, 3,176,137,204,194, 30,143,175,145, 29, 58, 25,190, 65, 77,208,175, 95, 63,
- 31,134, 97,150,212, 65,146,183, 0, 24, 14,224,215,218,172,124,183,211,217,190,125,251,238,237,218,181, 59, 29, 21, 21,149,217,
-174, 93,187,211,237,219,183,239,126,167, 25,158, 57, 6,143,205,125,139, 77,155, 53, 22,100,238, 91,108,218,204, 49,120,140,150,
-220, 7,227,244,171,232, 69,236,240,102, 24,102, 59,195, 48,219,167, 79,159,222, 11, 64,253, 10,255, 31,177, 95, 14,128,178,178,
-111,219,199,110,186, 55, 33,228, 73,187,245,188,235,236,126,106,247,187,210,106, 14,111,111,111,203,123,239,189,119,214,100, 50,
- 93,248,254,251,239, 27,143, 31, 63,190,109, 72, 72, 72,194,176, 97,195,126,215,106,181,130,173,141,142,131,188, 54, 96,192,128,
- 29,245,234,213, 99,114,114,114, 20, 22,139, 69,118,227,198, 13,133, 40,138, 12,199,113,196, 96, 48,200, 18, 19, 19,229, 86,171,
- 85,234,220,185,243,214,227,199,143,143, 6,240, 78,117,130, 90,173,246,205, 21, 43, 86,168,171, 50, 87,162, 40, 66,175,215, 67,
- 16, 4,204,156, 57, 83, 61,105,210,164,137, 0, 78, 84,167, 41,151,203, 39, 44, 92,184, 80,109,171, 2,146, 36, 9,177,177,177,
-200,185,121, 19,230,162, 66, 88,138, 10, 97, 41,200, 3,171, 47,192,139,253,159, 80, 47,255,117,243,127, 1,188, 88,237, 77, 85,
-165,155,251,253,202,111, 33,138, 34, 50, 54, 87,222, 36,226,214,177,131, 16, 5, 30,179, 63,155,199,188,243,218,136, 57, 64,241,
-166,127, 74,169, 87, 42,149,236, 23, 95,124,209, 76,169, 84,130, 97, 24, 98,177, 88,208,162, 69, 11,230, 14, 53,185, 69,139, 22,
-181, 85, 40, 20,140, 77,179,101,203,150,204, 63,237,140, 87, 40, 20,208,104, 52, 8, 13, 13, 53, 14, 26, 52,232,248,162, 69,139,
-130, 57,142,211,202,100,178, 93, 5, 5, 5,115, 46, 93,186,228, 84, 53,146,217,108,134,201,100,130,201,100, 66, 74, 74, 74,131,
-198,141, 27, 51,255,249,207,127,196,226,226,226,176, 85,171, 86, 93,217,180,105,147,118,201,146, 37,195, 0,188, 77,175,183,247,
-150, 70,141, 26, 41, 1,184, 7,215,151, 21,203, 57, 20,103, 10,130,111, 64, 64,192, 84, 65, 16,218,135,135,135,123, 38, 38, 38,
-230,249,251,251,159, 96, 89,118, 99, 90, 90, 90,102, 13, 70,141, 17, 4, 1, 99, 58,230, 99, 92,103, 22,130, 32, 32, 63, 63, 31,
- 41, 41, 41,184,120,241, 34, 78,158,188, 88,171, 52,134,134,134,190,166, 86,171,251, 42,149,202, 80, 81, 20, 89,131,193,144,108,
- 54,155,247,102,100,100,124, 83,197,141, 9,247, 35,157,118,250,243,135, 14, 29,234,239,238,238,142, 51,103,206,248,159, 59,119,
-110, 62,128,246,119,116,237,144,179,223,141,122,125, 73, 64, 61, 15, 15, 36,197,109, 11,216,178,243,199,239, 0, 41,144,150,224,
- 7,130,170,238, 1,217,132,144,129,165, 1,160,237,115,230,204, 25, 88, 90,190, 6,218,255,119,160, 60,222,182, 28,195, 48,219,
- 43,155, 94,151, 6,139, 84,147, 49,168,213,106,113,236,216,177, 9, 91,183,110, 13,109,223,190,253, 95, 85, 53, 6,174,129,174,
-205,154, 53, 75, 62,117,234, 20,241,246,246,182, 72,146,196,104,181, 90, 81,163,209, 72, 5, 5, 5,224,121,158, 36, 39, 39,203,
- 82, 82, 82, 20, 94, 94, 94, 10, 0, 53,134,234,228,114,121,151,134, 13, 27, 86, 25, 41,208,235,245, 40, 42, 42,130,217,108,134,
-175,175, 47,195,178,108,167, 26,195,122, 44,219,173, 89,179,102, 76, 94, 94, 30,252,253,253,113,244,232, 81,232, 11,242, 97, 46,
- 42,130,185, 32, 31,214,194, 2,136,133,249,200,191,153,137, 80,191, 64,134, 97,152, 46, 53,105, 10,156, 38,196, 71,231,130,196,
- 89, 83,209, 33, 54, 25,140, 92,129, 83, 45,253, 64,248,146,166, 86, 29,207,103,128, 81, 40,241,215,132,151,209,224,249, 55,192,
-179,170,128,251, 81,178, 5, 65, 96,204,102, 51,212,106,181,208,189,123,247, 35, 28,199, 61,170, 84, 42,217,113,227,198,225,198,
-141, 27,229, 78,128,113,227,198, 65,163,209,192,108, 54, 11, 0, 38,163,138, 54, 83,130, 32, 48, 60,207, 67,163,209,240,237,219,
-183,255,134,227,184, 55,149, 74, 37,215,180,105,211,172,185,115,231,102,184,184,184,184,164,164,164,220, 82, 42,149,105,161,161,
-161, 29, 53, 26, 77, 72, 77,154,247, 18,149, 74, 5,153, 76, 6,150,101, 81,191,126,253,226,220,220,220,147,215,174, 93,123,174,
- 54, 90,162, 40,194, 98,177,128,231,121,152, 76, 38, 72,146,132,115,231,206, 65,165, 82,201, 69, 81,188, 40,138,162, 86, 46,151,
-131,227, 56, 58, 70,221, 61, 38, 42, 42,234,209, 80, 13,230,143,243, 51,123, 54, 26,232,162,215,170,184,226,103, 55,243, 29, 30,
-123,236,153, 39, 38, 79,158,170,243,242,242, 82, 94,191,126,221,244,229,151, 95, 54,252,237,183,223, 24,148,180, 19,173,146,140,
-140,140, 95,230,206,157, 91,239,209, 71, 31, 13,147,203,229, 76,126,126, 62,178,179,179,113,243,230, 77,164,164,164,144,164,164,
-164,171,130, 32,252,228, 76, 26, 91,181,106,181,106,224,192,129,163, 90,180,104, 33, 39,132,128,231,121, 24, 12,134,182, 39, 79,
-158, 28,124,244,232,209,238,215,175, 95,119,186, 92,102,102,102,254,244,217,103,159,185,244,236,217,179,153, 92, 46,103,235, 34,
-157, 21,110,104,254, 58,157, 14,123,247,238,133,155,155, 27,106,234,173,235, 8, 86, 65, 10,168,231, 81, 31,166,203, 11,224,239,
- 22, 2,171, 32, 5,208, 18,252, 64, 69,177,152, 74, 76,208,255, 8, 33, 79,222,169, 25,186, 91,102,170, 86, 17, 44, 27, 55,110,
-220, 80,233,245,122,153, 36, 73,172,217,108,150, 75,146, 4,185, 92,206, 59,185,189, 22, 67,135, 14, 61,209,161, 67, 7, 67,105,
- 4, 67,112,119,119, 23, 10, 10, 10, 80,106,176, 36,153, 76,102,210,233,116,166,176,176, 48,192,129, 42, 66,163,209, 24,172,209,
-104,110,155,110, 48, 24,160,215,235,203, 12,150,193, 96,128,155,155, 27,138,139,139,107, 60,185, 69, 81, 12,213,106,181,200,200,
-200, 0, 0,232,243,243, 96, 42, 44,132,181,168, 0,214,252, 60,240, 5,249,224, 11,242,192, 26,141,240, 8, 12,130, 32, 8, 65,
- 53,105, 22,155, 69, 37, 7,130,155,219,127,129,239,155,147,171, 92,238,214,145, 3,208, 53,110, 10,163,209,122, 63,198, 40,235,
-114,241,226,197,118,205,155, 55,199,144, 33, 67,240,204, 51,207,156,211,104, 52, 62, 75,150, 44,105,145,158,158,126,219,194, 79,
- 61,245, 20,222,126,251,109, 12, 29, 58,116,237,217,179,103,151, 86,167,217,179,103, 79,244,234,213,171,222, 51,207, 60,147,164,
-211,233, 98, 86,174, 92,217,113,230,204,153, 89, 6,131, 33, 61, 38, 38,166, 85, 90, 90,154, 54, 60, 60,252, 96,100,100, 36,187,
- 99,199,142,144, 26, 52,239,181,233, 4,207,243,176, 90,173, 48,155,205, 32,132, 56, 28,101, 35,164,124, 64,129,231,249,178, 30,
-132, 38,147, 9, 60,207, 51, 91,182,108,198,182,109,219,216,184,184, 75,129,211,166, 77, 71,126,126, 62, 68, 81,164,151,217,123,
- 68,187,118,237,250,203,136,180, 98, 68, 3, 94,253,130,175,160,151,177, 68,127,249,219, 15,138,207,121,200,204,230, 98,198,245,
-253, 15, 62,240,188,114,229,138,245,179,207, 62,203, 28, 50,100,136,250,245,215, 95,111,190, 99,199,142,238, 65, 65, 65,223,166,
-166,166,230, 87, 21,248,236,220,185,243, 9, 79, 79,207, 70,235,215,175,207,202,200,200,168,199,243,188,214, 98,177, 88, 45, 22,
-203, 21,171,213,122,212, 98,177,236,189,113,227, 70,140, 51,105,213,233,116,173, 71,142, 28, 41,207,203,203,131, 76, 38,131,213,
-106, 69,118,118, 54,162,162,162,184,125,251,246,181,168, 77,254,227,226,226, 22,228,231,231, 31,220,182,109, 91, 95, 23, 23,151,
-118, 74,165,178,129, 40,138,162,201,100,202, 50,153, 76,103,107,147,206, 10, 55,180,140,216,216, 88,127, 87, 87, 87,164,167,167,
-131, 97,152,140, 59, 61,102, 10, 57,155,154,244,215,214, 32,127,183,134,136,143, 63, 1,133,156, 77,165, 35, 6, 61,216, 17, 44,
-187,182, 82, 3,107, 48, 73,198,105,211,166,189,199, 48,204,246,105,211,166,189, 87, 77, 4, 75,180, 95,206,110,249, 58,123,168,
-175,246, 38, 94, 84, 84, 36,251,223,255,254, 87, 63, 37, 37, 69,215,160, 65, 3, 67,100,100,100, 62,195, 48, 68, 20, 69,246,214,
-173, 91, 46,105,105,105,106, 79, 79, 79,115, 80, 80, 80,129,131,219,187,252,214, 91,111,245,156, 49, 99, 70,204,227,143, 63,158,
- 3, 0,121,121,121,200,206,206,182,245,210, 66, 70, 70, 6,123,250,244,233,122,187,118,237,106, 11, 7,122,240,104, 52,154,148,
-162,162,162,166, 30, 30, 30,101, 55, 52,155,169,178,255,182, 90,173, 40, 42, 42,130,139,139, 75,141, 39, 55,203,178,233,233,233,
-233,141,141, 70, 3,146, 19, 19, 97, 46, 42,128,181,176, 0,124, 97, 62,248,252,124,136,249,183,192,234,139,160,211,104, 80,116,
- 43, 23, 28,199,221,168, 73,211, 69,197, 89,120, 65, 84,122,247, 27, 12, 48, 85,223,159, 61, 58,117, 3,137,104, 13,141,230, 87,
-254, 30, 23,106, 25,128,129,182, 49,169, 52, 26, 13, 62,253,244, 83,196,196,196, 72,213, 85, 3, 43,149, 74,176, 44, 43, 58,162,
-169, 82,169, 52, 51,102,204,208,156, 61,123, 86,173, 84, 42,161,211,233,180,103,207,158,109,245,231,159,127,178, 6,131,129,107,
-220,184,241,208,128,128, 0,125, 13,154,119,213, 72, 85, 54, 77,175,215,151,181,155,186,117,235,150, 76,173, 86,135,119,239,222,
-253,184,197, 98,249, 73, 16,132,213,177,177,177,133, 85, 62,105, 91,111,239, 12, 42, 73, 18, 4, 65,128, 32, 8,144,201,100,210,
-150, 45, 91,241,213,210, 69,248,121,211,175,164,103,207,158,204,142, 29, 59, 32, 73, 82, 26,189,206,222, 27, 36, 73,154,127, 96,
-234,211,106,136,162,222,124,112, 67,241,238, 92, 89,241,183, 23, 14,156,206,229,205,170, 38, 77,194, 34,220, 92,221,217,239,215,
-125,123, 43, 51,235,234,229,175,190, 74, 11,154, 61,123,182, 71, 88, 88,152,123, 66, 66, 66, 0,128,252, 42,140, 80,232,203, 47,
-191,252,234,173, 91,183,228, 43, 87,174, 92,147,158,158,126, 24,192,213,138, 65, 51,148,180, 51,148, 3,240, 69, 73, 15,218, 61,
- 0,214, 86, 99, 86, 36,134, 97,112,240,224,193,219,122,251, 73,146, 84,107,135,145,153,153,153,215,169, 83,167,214,151, 47, 95,
-222,146,159,159,191,190,146,235,236,224,200,200,200,103, 79,157, 58,245, 33,128, 43, 78, 70,176,222,137,139,139,251, 92,146,164,
- 16,150,101,147, 9, 33, 83,238,244,152, 89,172,210,235, 91,119,110, 90,105,225,197, 96,165,156, 75,177, 88,165, 55,104, 73,126,
-224,177,181,145,130,189,113,170,196, 24,253, 57,103,206, 28,205,220,185,115, 49,103,206,156,139,149, 69,176,108, 70,107,206,156,
- 57, 23,109,203,217, 45,127,184,174, 13, 22, 83,201,141, 69, 55,125,250,244,174,109,219,182,205,120,244,209, 71, 51, 27, 54,108,
-104,176,205,211,106,181, 22, 15, 15, 15,139,217,108, 86,101,100,100,120,255,245,215, 95, 13, 37, 73,210, 56,176,189,253, 30, 30,
- 30,245, 78,159, 62, 93,127,227,198,141, 77, 98, 99, 99, 67,158,127,254,249,158,102,179, 25, 22,139, 5,215,174, 93, 11, 89,177,
- 98,133,164, 80, 40,242, 25,134,249, 31, 74,122,195, 84, 11,207,243,199, 47, 95,190, 28,222,169, 83, 39,134,231,249,114,166,202,
-254,183, 82,169, 68,122,122, 58,145, 36,233,164, 3,233, 60,113,250,212,169,198, 45,155, 55,135,185, 32, 15,150,194,124, 88, 11,
-242, 33, 20,228, 67, 42,204, 7,171, 47, 66,253,122,114,104, 52, 46,184,156,145,137,210,180, 86,139, 92, 48, 38,165, 23, 20, 54,
-109, 28,253, 5, 14,132,185,129,240,214,178,106, 65, 0,101,213,133,143,252,149,141, 35,127, 30,135, 76, 52,167,223,207,146,108,
-177, 88,164, 97,195,134,157, 98, 89,182,206,222, 55,197,243,188, 52,126,252,248, 50,205,212,212,212, 91,169,169,169,106,163,209,
-200,234,116, 58,253,253, 62,123,121,158,175,212, 32, 89, 44, 22, 24,141, 70,100,102,102, 42,247,236,217,211,253,248,241,227,138,
- 75,151, 46,225,248,241,227,109,182,108,217, 50,189, 89,179,102,173,227,227,227,111, 56, 98,218, 36, 73,130,237, 62, 72, 8, 1,
- 33,132, 3,128,173,191,109, 71,191,126,253,152,162,162, 34,108,219,182,173, 78,170, 81, 40, 14, 83, 12, 65,212, 88, 14,109, 40,
-126, 55, 81, 89,120,209, 32,251, 36, 38, 38,102,247,128, 1, 3,142,248,251,134,185, 1,128, 74,161,243,230,136,171,206,219,219,
- 91, 5, 0,254,254,254,237,120,158, 95,154,158,158,222,173, 50,193,167,158,122,234, 17, 31, 31,159,182, 59,119,238, 60,155,158,
-158,126,164, 18,115,133,166, 77,155,206,188,112,225, 66,127,185, 92,206,216, 93,252, 73, 85, 6,107,216,176, 97, 77,149, 74,101,
-253, 29,151,221, 81,168,104, 12,137,205, 7,225, 84, 16, 61, 90, 35, 89,209, 2,190,190,127,213,215,106,181,109,174, 94,189,122,
-214,201,252, 7,143, 24, 49,226,247, 85,171, 86, 69,244,235,215, 79,121,236,216,177,219, 12, 86, 68, 68,196,176,125,251,246, 13,
- 31, 55,110, 92,235,245,235,215, 15, 2,144,232,168,120,108,108,236, 49,148,188,177,161,206,248,232, 27,236, 5,196,144,210, 64,
- 4, 45,193, 15,120,244,170,148,108,187,232, 83, 54, 0,166,194,255,179,165,231,144,133, 16, 98, 91, 54,219, 46,106,101,169, 16,
-245,170,108, 94, 54,195, 48,117, 22,220,144, 85,243,228,189,231,218,181,107, 29, 70,140, 24,145,109,111,174,236,171, 71,116, 58,
-157,217,205,205, 77,127,234,212, 41,127, 81, 20, 15, 58,176,189,149,251,246,237, 59,176,120,241,226, 13,245,234,213,227, 95,124,
-241, 69,118,234,212,169, 71,114,115,115, 73,110,110, 46,150, 44, 89,210,163,123,247,238, 71,146,147,147,197,152,152,152, 87, 0,
-244,171, 73,208, 96, 48,124,253,230,155,111, 62,123,228,200, 17,181,197, 98, 65,126,126,254,109,209, 43,158,231,193,113, 28,150,
- 46, 93,106, 46, 46, 46, 94,228, 64, 36,227,155,175,191,254,122,248,138,175, 22,171,101,188, 21,134,252, 60,136,165, 31,206, 84,
- 12,157,154, 69,227,182,222,200,207, 80, 97,221,206, 99, 70, 65, 16,190,174,209, 96,153,244,147,199,141, 25,189,125,207,254, 3,
-168,223,173, 55,114, 14,236,186, 61, 26,228,237, 11,139,213,138, 79,102, 69, 19,198,152, 63,245, 94, 7,112, 0,108, 47, 29, 77,
- 29, 0,182,159, 61,123,246,120,155, 54,109,250, 91, 44,150,234,140, 24, 36, 73,226,106,163,169, 82,169,210,154, 54,109,186,191,
- 81,163, 70, 67, 1,160,121,243,230,191,177, 44,219,187, 6,205,187,106,176,102,204,152,129,185,115,231, 98,218,180,105,101, 6,
-201,246, 0, 96, 54,155, 27,238,218,181, 75,121,236,216, 49,178,110,221,186,156,167,159,126,218,227,249,231,159,247, 88,191,126,
-253,127, 0, 76,173, 74,115,202,148, 41, 88,190,124, 57,198,142, 29,123,219,124,142,227,164,244,244, 52,152, 45,102,178,117,235,
-214, 12,153, 76,230,249,229,151, 95,106, 38, 77,154,196,208,107,237,189, 65, 20,197,247,187, 45,216, 50, 17,208,240,130, 32, 44,
- 58,127, 62,230, 96,105,212,198,103,193,130, 5, 74, 0,248, 98,222, 23,114, 66,136,220, 54, 48,236,199, 31,127,172, 30, 51,102,
-140, 79, 85,154,191,252,242, 75,222,199, 31,127, 92,255,245,215, 95,239,119,224,192, 1,245,169, 83,167,118,161,228, 45, 5, 57,
-165,142,192, 43, 33, 33,225,152,183,183,183,223,166, 77,155, 26,247,237,219,215,165, 70, 23, 88, 92,252,237,178,101,203, 66,231,
- 31,118,197,142,226,161, 72, 37,207,128,212, 35,168,167, 40, 66,115, 93, 10,122,250,165,250,175, 95,191,126, 37,128,118, 78,100,
-191,197,211, 79, 63,189,121,213,170, 85, 13, 71,143, 30,157,118,236,216,177, 84, 0, 51, 43, 46, 20, 19, 19,147,251,242,203, 47,
- 39,175, 89,179,166,177, 36, 73,187, 55,108,216,208, 15,192,101, 90,122, 40,247,204,121, 57, 16,200,168,205,178,119, 19, 89, 53,
- 23,157,215,242,242,242, 34,167, 77,155,246,185,191,191,127,112,116,116,244,245,230,205,155, 23,219,230,231,230,230,234, 14, 29,
- 58, 20, 86, 88, 88, 88, 36, 8,194, 40, 0,231, 42,145,105,137,242, 99,101, 36, 75,146,244,121,155, 54,109,158,253,241,199, 31,
- 15,185,186,186, 22,158, 56,113,194,205,205,205,173,224,210,165, 75, 46, 28,199, 25,174, 94,189,138,189,123,247,246, 0,240, 85,
- 21, 79, 73,229, 52, 51, 51, 51,207, 40,149,202, 47, 38, 77,154, 52,233,195, 15, 63, 84, 75,146, 4,163,209,136,162,162, 34,152,
- 76,166,178,198,201, 27, 55,110, 52,155,205,230, 21, 25, 25, 25, 39, 28,208, 60,206,113,220,242, 69, 95, 46, 26,255,198,179, 35,
-148, 36, 63, 23, 5,153, 70, 48,166, 98,232,212, 74,180,232, 29,128,226, 92, 6,171, 14,157,182,220,178, 88, 55,101,100,100, 28,
-172, 73,243, 88,170,254,247, 78,202,196,189, 31,207,138,126,108,250,234, 95, 33, 73, 18,254,122,243, 69,228, 29,222, 11,109,243,
- 86,120,228,175,108, 88, 44, 22, 76,155, 50, 9,156, 33,235,200,201,212,226,159, 29,216,159,117,129,189,230,113,252,253,238, 50,
- 1,192,248,115,231,206,141,138,136,136,192,184,113,227,240,212, 83, 79,149, 91,113,243,230,205, 88,182,108, 25,204,102,243, 40,
- 0,177, 0,150, 58,163,217,176, 97,195,142, 45, 90,180,224,252,253,253, 13,165,102,163,247,197,139, 23, 59, 68, 68, 68,212,164,
- 89,231,121, 39,132,228, 37, 38, 38,186,205,155, 55,143,177, 90,173,152, 57,115, 38,108,198,210, 22,113,122,255,253,247,253, 93,
- 93, 93, 49,127,254,124, 75, 78, 78, 78,159,220,220,220,125,139, 23, 47,246,218,184,113,227,115,118, 6,203, 94,243,102, 92, 92,
-156,235,242,229,203, 89, 65, 16,176, 96,193,130,219, 34, 90,239,188,243, 14,172, 86, 30,114,153,220, 98, 54,153, 91,104, 52,154,
- 43,158,158,158, 26, 73,146,200, 61, 60,238, 15,181,230,249,243,231,247,160,164,106,174, 82,108,237,232,140, 70, 35,114,114,114,
-144,147,147, 3,119,119,247,138, 79,219,229, 52,141, 70,227,217, 41, 83,166,196,124,243,205, 55,253,254,252,243,207, 17,135, 15,
- 31, 30,176,119,239, 94, 83,114,114,178,192,243, 60,241,243,243,147,117,235,214, 77, 61, 96,192, 0, 23,149, 74,197,190,255,254,
-251, 57,159,126,250,169, 23,128,220,170, 52, 9, 33,156, 36, 73,248,111,247, 66, 76,233, 37,131,217, 92,242, 64,153,145,145,142,
-139, 23, 47,226,248,241,120, 48, 12,195, 58,185, 63, 23,173, 95,191, 62, 76,169, 84, 50, 27, 54,108, 8,222,176, 97,195,132,154,
-118,222,218,181,107, 67, 55,108,216,176, 20,192, 99, 40,105,248, 68,203, 18,213,164, 56, 99,176, 74,185, 40, 8, 66,191,148,148,
-148,110,163, 71,143,254, 44, 34, 34,194, 44, 8,130,124,247,238,221,205,114,114,114,148,130, 32, 76,129,243,245,149,203, 77, 38,
- 19,134, 12, 25, 50,165, 81,163, 70,251, 98, 99, 99, 91, 63,249,228,147,187, 55,111,222,220, 77, 16,132,171, 23, 46, 92, 24, 5,
- 96, 81,169,193,114,136,164,164,164,153,123,247,238,101, 78,156, 56,241,238,180,105,211, 84,222,222,222,140,135,135, 7,140, 70,
- 35, 82, 83, 83,201,154, 53,107,204,102,179,249, 43,119,119,247, 15, 28,213,244,246,246,158,122,248,244,105,101,194,149,196, 87,
- 94,233,255,184, 58, 56,188, 41,116, 12,160,191,149,139, 67,135, 50,177,250,228, 89, 83,142,197,250, 3,199,113, 14,119,165, 15,
-188,146,221,111,207,166, 85, 59, 15,238,223,255,216,236,185,159, 51,254, 47,188, 1,151,144,134,144, 66,155,224,208,193,131,248,
-244,227,153,132,211,103, 29,230,175,100, 61,126, 31,203,132,205, 1,168, 0,204,147, 36, 73, 86,250, 52,143,183,223,126, 27,246,
-175,206, 89,182,108, 25,140, 70, 35, 0,200, 24,134,153, 7,224, 59, 84, 61,162,123,101,154, 65,191,255,254,123,144,189,102, 68,
- 68,132,163,154,117, 74, 86, 86,214, 7,175,189,246,218, 92,185, 92,238, 46, 73,210,109,141,211, 1,192,197,197, 5,133,133,133,
- 16, 69, 81,168, 87,175, 94, 60,207,243,144,201,100, 85,158, 71,197,197,197, 31,140, 29, 59,246, 19,134, 97,170,140,116,104, 52,
-154,228,163, 71,143, 54,121,254,249,231,217, 77,155, 54, 93,123,238,185,231, 84,127,254,249,167,136, 90,142,105, 68,185,251, 16,
- 66, 80, 92, 92, 12, 84, 63, 36, 66,202,143, 63,254, 56, 37, 38, 38, 70, 61,118,236,216,118, 47,188,240,130, 91,175, 94,189,116,
-246, 11, 24,141, 70,105,219,182,109,197,203,151, 47,207, 61,124,248,240,255, 94,125,245,213,161, 0,170, 12, 23,103,100,100,252,
-190,100,201, 18,247,158, 61,123,134,139,162,136,156,156,156,178, 54, 88,105,105,105, 72, 78, 78, 78,150, 36,105,171,147,217,121,
-243,249,231,159,223,177,102,205,154,144,209,163, 71,167,109,220,184,113, 43,128,202,218,212,234,134, 13, 27, 54,120,205,154, 53,
- 33, 99,198,140, 73, 1, 48, 1,180, 85, 57,133, 82,167, 12,225, 56,238, 79, 0, 67,156,112,184, 85, 17, 2,224, 19,148,212,155,
- 22,148, 58,225,217, 0, 26,213, 86,211,223,223,191, 85,120,120,248, 15, 77,155, 54,189, 30, 16, 16,192, 55,109,218, 52, 57, 60,
- 60,124, 83,131, 6, 13,162,106,171,233,231,231,215, 53, 40, 40,104,119, 96, 96, 96, 78,112,128, 63, 9, 12, 12,188, 21, 28, 28,
-188, 55, 32, 32,160,103,109, 53, 59, 5,233, 6,118,106, 26, 16,223, 46,178,137, 57,188, 81, 67, 18,213,162,137,185,115,179,160,
-132,142,193, 46,195,238, 96,127,222,201, 83, 72,101,168, 0, 24, 72, 41, 12,195,240,109,218,180, 89, 30, 21, 21,181, 52, 42, 42,
-106,105,235,214,173, 87, 48, 12,195,219,230, 3, 48,224,239, 65, 65,239,165,230,221,200,123,165,116,235,214,109,237,134, 13, 27,
-196,217,179,103, 23,116,238,220, 57,119,246,236,217, 5, 27, 54,108, 16,187,117,235,182,182,182,154,173, 91,183, 14,233,222,189,
-251,173,181,107,215, 10,151, 47, 95, 38,107,215,174, 21,186,119,239,126,171,194, 72,238,247, 61,239, 15,163,230,240,225,195, 19,
-137, 29, 22,139,133,100,103,103,147,132,132, 4,114,228,200, 17,242,248,227,143, 39, 58,160, 41, 3,208, 11,192,130,192,192,192,
- 61, 93,187,118,189,220,189,123,247, 43,141, 26, 53,250, 83,161, 80,172, 7,240, 50, 74,222,119,232,135,146, 97, 73,124,171,211,
-244,243,243,235, 18, 17, 17, 49,187,109,219,182, 91, 59,119,238,124,172, 93,187,118,199,155, 54,109,186,189, 97,195,134,115,253,
-252,252, 30,169,101,222,131, 71,140, 24,113, 81,175,215,139, 61,122,244,216, 86,217, 74, 81, 81, 81,107,244,122,189,248,194, 11,
- 47, 36,160,228, 61,178,180, 44, 81,205,187,161, 73,121, 88, 11,138, 51,163, 56, 63, 32,121, 31, 95,106,114, 12, 40,255,218,154,
-154,230,223,107,205,123,178, 63,155, 55,111,238,249,216, 99,143,189,185,117,235,214,119,175, 94,189,250,238,214,173, 91,223,237,
-219,183,239,155,205,155, 55,247,188,147,116,182,110,221, 58,164, 91,183,110, 95,117,237,218, 53,173, 91,183,110, 95, 85, 48, 87,
-244, 34,126,159, 52, 7, 13, 26,180,115,196,136, 17,137, 35, 71,142,188, 50,114,228,200,196,225,195,135, 39, 14, 29, 58, 52,113,
-208,160, 65,137,253,250,245, 75,236,213,171,215,206, 7, 40,239,193, 29, 58,116,248,193,213,213,245,133,202,102, 42, 20,138,193,
- 93,186,116,249, 25, 64, 99, 90,150,168, 38, 53, 88,212, 96, 81,205,186,209, 84,161,250,215,213, 84, 54,255,126,104,210,227, 78,
- 53,169, 38,213,164,154,212, 96,253, 99,144,209, 93, 64,169, 1,243, 29,206,191, 87,154, 20, 10,133, 66,161,252, 99, 96,170,113,
-161,206,244, 14,168,141,147,189, 64, 53,169, 38,213,164,154, 84,147,106, 82,205,135, 78,179,162,246,211, 21,166, 87, 28, 7,114,
- 5,181,107,117,115, 96,168, 38,213,164,154, 84,147,106, 82, 77,170,249,240,105, 86,198,232,127,171, 1,162, 47,148,165, 80, 40,
- 20, 10,133, 66,161, 6,139, 66,161, 80, 40, 20, 10,229,159,141, 67,141,220, 21, 10, 69, 36, 33,228, 85,134, 97, 26, 48, 12,115,
-131, 16,242,157,213,106,189,248,176,237, 44,133, 66, 17,201, 48,204,171,132,144, 6,132,144, 27, 12,195,220,215,253, 64, 0,102,
-102,116,201,104,210, 31, 69,131, 48,213, 15,124, 72,161, 80, 40, 20, 10,229,126, 27,172,144,192,192, 17, 44,199, 44,182,242,162,
- 39, 47, 8,236,146, 37, 75,216, 65,131, 6, 97,219,182,109,152,240,246,219, 19, 88,142,149, 20, 50, 89, 30,145,132, 9,201,105,
-153, 63, 58,178,177,161, 67,135,102,241, 60, 95,229,168,214, 28,199,221,220,178,101,139,239,157,102,202, 63,234,153, 44,222,106,
-173,114, 59, 50,153,252,102,230,217,159, 29,218, 78, 96,160,223, 8,142, 97, 23,243,162,228, 41,138, 18,251,213, 87, 95,149,237,
-135,183,222,122,107,130, 92, 38,147, 20,114, 46, 79, 18,201,132,228,180,180, 31,239,213,129,179, 55, 87, 0, 48, 51, 26, 12,137,
- 6,168,201,162, 80, 40, 20, 10,229, 31,108,176, 24, 22, 75, 55,124, 51,207, 51,247, 86, 30, 54,110,222,141,136,136, 8, 92,186,
-116, 9, 17, 17, 17,232,214,177, 53,251, 68,151, 54, 44,199,194,123,198, 87,235,150, 2,112,200, 88,240, 60,239,243,219,111,191,
-129, 97, 24,136,162, 8, 65, 16, 32, 8, 2,120,158, 71, 81, 81, 17, 38, 78,156,232, 83, 23,153,226,173, 86,159,171,255,251, 21,
-114,142, 1, 47, 18,240, 2, 1, 47, 72,176,138, 4,133, 6, 1,189,159,124,222,225,237,176, 96,151,126,183,120,158,103,126, 65,
- 1,126,221,177,167,220,126,232,221,181, 3,251,204,128, 71, 89,173, 70,225, 61,122,234,103, 14,239,135,186,192,222, 92,149,155,
- 22, 77, 13, 22,133, 66,161, 80, 40,255, 88,131,101,225, 69, 79,223,122,238, 88,253,221,119,152, 50,237, 99, 52,107,214, 12,132,
- 16, 48, 12,131,247, 62,156,133,133, 31, 79,195,200,254, 61,192, 11,146,103, 53,250,183,117,213,100, 24, 6,215,175, 95,135,209,
-104, 44,247,137,140,140,116, 52,205, 14,117,255,148,115, 12,126,143, 45,130,149,151, 96, 21, 74, 63,188,132, 94, 45, 93,157,210,
-228, 69,201,211,195, 77,135,149,223, 44,195,148, 89,243,202,237,135,169,239,125,136,175,231,126,128,119,198,189, 4, 11, 47,122,
-214, 38,157, 78, 66, 53,169, 38,213,164,154, 84,147,106, 62,168,154, 15,164,193,234, 9,224,160,205, 3,149,153, 11,139, 9, 45,
-130,234, 99,217,252, 79, 64,192, 66, 34, 4, 32, 0,145,120, 52,244,210,194,104, 48, 56,189, 65, 73,146, 96,181, 90,193,243, 60,
- 86,172, 88, 1,189, 94, 15, 73,146, 16, 17, 17, 1, 0,136,138,138,178,143,192,164,196,198,198,134,212,164,233,221,114, 72, 50,
- 8,130,237,167,125, 52,239, 91, 28,139,189, 10, 66, 0,149, 70,139,225, 47,140,129, 40, 17, 88,121,231,223, 79,106, 50, 24,224,
-167,147, 99,225,167, 31,130,149, 43,192,130, 1,203, 50, 96, 25, 9,205, 2, 61, 97, 46,121, 57,241, 61,229,163,104,144,138, 81,
-172,143,162, 65,162,105,153,166, 80, 40, 20,202,191,147, 74,189,200,191,221, 96, 29,172, 44, 51, 22,147, 17,129,158, 10, 52,208,
-185, 67, 16, 68, 92,180,250,161,200, 96,130,213,202, 35,217,106,197,149, 51,153,120,228,145, 71,192,243,188,104,181, 90,161, 80,
- 40, 10,182,108,217, 82,175, 38,131,197,243, 60,172, 86, 43,138,139,139,177,126,253,122,200,100, 50, 72, 82,137,241, 41,121,199,
-111,201,119,215,174, 93,131, 29,202, 5, 65,240,149, 83,191,192, 85,205, 65,144, 8, 4,129,128, 23, 1, 81, 34, 48, 88, 36, 12,
-123,237, 3, 8,146, 4, 65,146, 96,113,192, 96,217, 27, 54, 1,192,144,233, 27, 1,232,202,230,187,169, 8,166,116,101,161, 80,
-170,160, 84,112, 48, 27, 13,247,252,192, 49, 0, 33,209,127, 87, 21,210, 70,238, 20, 10,133, 66,249,151,115,240, 65, 48, 86, 21,
- 13,150,189,123, 60,244,183,193, 50, 64,224, 69,240,130, 8,129, 23, 80,160, 55,226,243,207, 63,135, 74,165, 2,195, 48,101,102,
- 73,146, 36,150,231,121, 12, 24, 48,192,179,166, 13,138,162, 8,171,213, 10,171,213, 10, 66, 8, 56,142, 67,167, 78,157,110, 91,
-238,196,137, 19, 78,101,196, 85,205,161,225, 99,211,111,155,126,242,151, 79, 64, 8,129, 40,150,124, 28, 49, 88, 53, 25,182,182,
- 61,159,129,217,194,131, 16, 0,164, 36,194,117, 63, 96, 0, 98,107,115, 21, 77, 79, 76, 10,133, 66,161, 60, 24,148,243, 34, 15,
-138,193, 42,231, 30,205, 70, 35,120, 94,128, 32,136,224,249, 18, 99,164,209,104,208,163, 71,143, 18, 31, 98, 23,109,218,189,123,
- 55,172, 86,107,141, 27,180, 53,106, 47, 53,102, 32,132, 96,227,198,141,144,203,229,101, 31,133, 66,225,116, 70, 4,145, 96,250,
-212,255, 66, 33, 99, 33,151,177,101,223, 34, 33, 32,164,196, 28,137, 18,129,153,119, 44,200, 83,157, 97, 3, 0,139,217, 10, 16,
- 2, 2, 2, 99,113, 49, 61, 29, 40, 20, 10,133, 66,169, 27, 30,136, 72,150,205, 96, 61,138, 74,170,151, 44,198,226,210,232,149,
- 8, 94, 16,202, 12,212,252,249,243, 33,147,201,160, 84, 42, 33,147,201,202, 12,145, 35, 6,203,100, 50, 33, 44, 44, 12, 22,139,
- 5, 17, 17, 17, 32,132,224,217,103,159,189,109,185, 83,167, 78, 57,149, 17, 94, 36,152,243,217,130,219,166, 31,253,233, 99,180,
-106,222, 16, 29,155,184,192,100,149, 80,104, 16,238,216,176, 1, 40,137, 96, 1, 32, 4, 48, 22, 27,232,233, 64,161, 80, 40, 20,
-202,157, 81,169, 23,249,183, 27,172, 67,149,185, 69,147,193, 0,129, 23,202, 76,150,197, 98,129, 36, 73,120,251,237,183,111, 19,
-218,183,111, 31, 44, 22, 75,245, 27,147,201,110,190,241,198, 27,229,134, 72, 32,132,224,151, 95,126,129, 74,165, 42, 23,197, 98,
- 24,231,204, 43, 47, 18, 68,191, 63, 9, 74, 57, 87,206, 16, 73, 18,176,237,247, 63,176,237,247, 63,202,150,229, 56,249,205, 59,
- 49,108, 0, 96,177,148, 70,176, 8, 65,177,190,136,158, 22, 20, 10,133, 66,161,220, 25,149,122,145,127,187,193,170, 20,147,177,
- 24,188, 93, 27, 44,171,213, 10, 65, 16,176, 98,197,138,114,213,121,114,185, 28, 44,203,214, 24,193,218,188,121,115,185,193, 61,
-163,162,162, 8, 33, 4,195,135, 15, 47,171,110,124,229,149, 87, 48,122,244,104,167, 13,150, 32, 18,204,156, 61,191, 76,103,192,
- 99,221, 49,164,127, 79, 72,165, 94, 56,251,226, 22,167, 4,171, 51,108, 0, 96, 49,151,180,193, 34, 0, 12, 69,180,138,144, 66,
-161, 80, 40, 20,138, 3, 6, 75, 46, 99, 11,174, 36,223,112,247,114, 81, 67,144,204, 16,164,146,158,127,162, 40, 98,244,232,191,
- 95,110,253,220,115,207, 97,212,168, 81, 85, 25,172,150,168, 97,172, 12, 73,146,112,244,232, 81, 48, 12, 3,150,101,203, 62,213,
- 80,169,102,177, 89,194,177, 31,103, 65, 34, 4, 18, 1, 36, 82,226,167, 44,130, 67,209,198,219, 52,107, 50,108, 42,157, 7, 56,
-150,128, 97,128, 43,105, 89,144,113,108,129,179,121,175, 5, 84,147,106, 82, 77,170, 73, 53,169,230,131,170,249,112, 24, 44, 34,
-146, 9,203,183,159, 88,204,139,146,187,109, 90,139, 22, 45, 96,181, 90,177,107,215,174, 50,227,193,113, 92, 89,149,158, 35,109,
-176, 42,144,210,163, 71,143,234,134, 98, 72,113, 72,133, 65, 74,251, 94, 35,130,171,155,239,108,194,106, 50,108,171, 14,255,253,
- 10, 66, 25,203, 22,128,144, 9,180, 56, 81, 40, 20, 10,133, 66,169,214, 96,165,102,100,172, 3,176,206,126, 90,155, 54,109,244,
-131, 7, 15,214, 8,130, 0,139,197, 2,171,213, 10,139,197, 82,246, 81,169, 84, 78,141,184,233,200, 32,162,142,144,125, 97, 75,
- 72,157,238, 21, 7, 12, 91,102,102,102, 8, 45, 62, 20, 10,133, 66,161, 80,156, 50, 88,149, 97, 48, 24, 60, 24,134,145,101,100,
-100,220, 54,239,198,141, 27, 64,201,184,156,255,122,234,220,176, 81, 40, 20, 10,133, 66,161, 6,171, 42, 14, 29, 58, 36, 60, 40,
- 38,138, 66,161, 80, 40, 20, 10,229,110,193,210, 93, 64,161, 80, 40, 20, 10,133, 82,183, 48, 40,233, 9, 80, 25,206,244, 14,104,
- 89,139,109, 95,160,154, 84,147,106, 82, 77,170, 73, 53,169,230, 67,167, 89,147,182,253,250,163, 1,172,160,118,173,110, 14, 12,
-213,164,154, 84,147,106, 82, 77,170, 73, 53, 31, 62,205,202, 24,253,111, 53, 64,180,138,208, 25,162, 70,203,233, 78,160, 80, 40,
- 20, 10,133, 82, 19,178,123,181,161,232,232,104,246, 14,215,151,238,219, 94, 10, 24,214,152,147,225,243,214,193, 1,253,207,228,
- 14,221, 65, 68,102, 42,210,127,189, 66,139, 79,237,104,227, 2, 47,158,145, 15,244,212,169,135, 4,187,202, 58, 39,230, 24,254,
- 52, 88,165,109,132,225,183,196, 21, 33,143,238, 33, 10,133, 82,233,165, 56, 32,192,243,216,177, 99,193, 93,187,118, 77, 73, 79,
- 79,207,115,116, 94, 85,248,134,181, 27,229,170,211,190,105, 50,155, 27,186,187,185,221,188,149,155,187, 60,243,218,153, 37,182,
-249, 13, 27, 54,116,219,176, 97,131,255,115,207, 61,151,113,253,250,245, 66,122, 4, 40,247,212, 96,181,111,223,190,161, 36, 73,
- 47, 1,120,129, 16,114,246,204,153, 51, 79,215, 70,103,223,190,125, 1, 60,207,119, 16, 4, 33, 10, 64,148, 70,171,107, 99, 54,
-155,110, 50, 32, 47,247,239,223,255,140,179,122, 81, 81, 81,191, 3, 24, 80,217, 60,134, 97,102,198,196,196, 68, 59,170,197,201,
-240,249, 31, 91, 86, 13,201, 52,104,112, 40, 38,249,169,239,190,152, 6, 0, 67,255,137, 7,212,207,207, 79, 3,224,101,150,101,
-251,168, 84,170,112,147,201,148, 4,224, 60,195, 48, 75,211,211,211, 51,106, 41,203, 70,234,228,175,105, 53,218,126,126,174,202,
-168,244,188,194,116,147, 85, 58, 34, 49,214,121,206, 26,162, 70,128,210,167,158,199,161,119,135,117,139,104,221,162, 9,164,228,
-179, 48,229,103, 15,142, 73, 55, 12,254,230,228,205,255, 90,138, 12, 81, 87, 1,139, 35, 90,129,129,129,126,162, 40,202, 50, 51,
- 51, 83,109, 23, 67,179,217,220, 30, 64, 4,128,191, 84, 42,213,233, 59,189, 40,254, 91, 52, 3, 2, 2,252, 37, 73,122,221,215,
-215,247,201,172,172,172,223, 89,150, 93,117, 7,199,155,242,144, 16,210,233,197, 5, 12,203,120, 57,179, 14,145, 72, 78,242,201,
-117,255,189,151,233, 36,164,100,164,231,128,128,128, 87,130,131,131,155, 16, 66, 18, 8, 33, 95, 86, 56, 7,110,155,199, 48, 76,
-149,175,242, 8,105,209,101,243, 27, 47, 61,215,123,226,184, 87,116, 90,173, 6, 6,163,169,254,210,149,223,127,177,116,229,250,
- 1, 73,151,142,245, 7, 0,127,127,255,161, 65, 65, 65,161, 22,139,229, 58, 33,228,251,154, 52, 41,148, 59, 54, 88,205,155, 55,
-119, 81, 42,149,195, 89,150,125,185, 85, 84,231,110,131,159,121,153,225, 25, 45, 62,157,244,156,211, 67, 56,196,198,198,170, 50,
- 51, 51, 63,110,216,172,221,127, 30,237, 59,132,109, 30,209, 12, 94,245, 61, 33,177, 74,172,217,117,185,254,193,111, 94, 89, 2,
-160, 75, 45,146, 57,224,199, 29, 39,145,153, 47,130, 97, 0,134, 1, 88, 6,208,155, 36,188,247,106,183,143, 0, 56,102,176,162,
- 70,203, 35, 26,248,244,191,124, 75,141, 93, 23,120, 0,254,208,122,250,246, 55,120,143,150, 35,118, 5,255, 79, 58,152, 13, 26,
- 52,136,170, 87,175,222,215,175,188,242,138,103,120,120,184,159, 82,169,212,154, 76,166, 38,201,201,201, 13, 23, 46, 92,248,120,
-131, 6, 13,230,222,184,113,227, 87,103, 52,155,185,171,130, 67, 27,248,254, 56,117,220, 75, 29,195,195,130, 32,179, 20,131,152,
-245, 65,201,215,175,118,153,189,234,215, 55, 24,198,244,236,165, 66, 97,175,163,122,106, 87,197,251,239,141,126, 54,162,177, 43,
-129,229,210, 81,200, 56, 2,181,171, 39, 58, 6,115, 96, 64,154, 71,239,207,120, 15, 69,214,143, 28, 48,146,179, 68, 81,124, 15,
- 0,211,160, 65,131, 31,229,114,249,169,246,237,219, 55, 27, 57,114, 36,211,170, 85, 43,156, 57,115,166,249,182,109,219,158, 22,
- 4, 33,222, 98,177,156,172, 95,191,254,217,184,184, 56,171,131,229, 91,145,155,155,219, 70,169, 84,118,250, 39,107,250,249,249,
-105, 44, 22,203, 75,129,129,129,163, 31,121,228,145, 86,131, 6, 13, 98,154, 54,109,138,248,248,248,118, 59,119,238,252,232,200,
-145, 35,231,211,210,210, 86, 40,149,202,239, 51, 51, 51, 29, 26, 4,120,120, 31,196,255,188, 15,205,106, 59,191, 2, 30, 0,212,
- 0, 50, 29, 9, 38, 0,208, 2,184,118, 31, 52,239, 70,164, 37,142, 97,152,122,165, 55,100,219,131, 93,185,223,246,223,162, 40,
- 22,167,164,164, 52,170, 78, 51, 40, 40,168,185, 36, 73,156,253, 52,185,188,234, 86, 11,130, 32, 72,105,105,105,151,170,211,100,
- 88,198,107,197,215, 11,220,101, 44, 32,146,210, 15, 79, 32, 18, 2, 73, 2, 68, 9, 16, 37, 9,130, 72, 32, 4,150,212,198, 0,
- 0, 32, 0, 73, 68, 65, 84, 17, 9,188, 64, 48,243,163,247,238,231,101,238, 73, 0, 61, 0, 28, 6,176,168,154,121, 95, 86, 39,
-226,221,168,205,139, 47, 61, 59,188,215,123,147,222,212, 17, 66, 64, 8,129, 70,173,194,228,137, 99,149, 38,147,165,171, 95,147,
-246,163, 51, 19, 79,175,100, 24,166, 23,128,246, 0, 78, 3,248,158, 90, 6,202,221, 50, 88, 76,187,118,237,122, 16, 66, 94,110,
-224, 31, 56,124,216,243, 99, 52,161, 77, 90, 66, 47,185,225,122,142,132,216, 3, 27, 0, 96,147, 51, 27,223,189,123,119,123, 66,
-176,122,220,180, 5,205, 90,183,237,128, 11,233, 2,142,165,138, 40,190, 34, 66,198, 25, 33, 73, 0, 33,196, 92,219,204,165,229,
- 9, 56, 18,111, 1,199, 2, 44, 11,112, 44, 3,206,217,247,116,199,174,224, 47, 5, 15,221,241,199,169,244,167,160,246,133, 33,
- 47, 29,134,188,172,157, 72,219,252,143, 50, 87,254,254,254,189, 67, 67, 67,191,156, 56,113, 98,131,204,204,204,122, 39, 79,158,
-132, 74,165,130,167,167,167,204,203,203,171,217,180,105,211, 10,102,207,158, 61,217,199,199,231,204,205,155, 55,147, 28, 50, 5,
- 46,138,136,238,173, 34,254,156, 49, 43,218,221, 28,179, 19,249, 63,255, 12,142,149,160,112,209,193, 79,163,197,162, 39, 67,235,
- 77,219,157,250, 43,107,181, 68, 92, 48,153,210, 29,209, 12,242,169,215,183,113,120, 83,228,111, 95,138,196,124, 51,142,103,153,
- 49,184,103,123, 52,246,212,160,173, 32,162,190, 90,214,187, 38,131, 21, 16, 16,224, 41, 73,210,212,164,164, 36, 86,161, 80, 48,
- 13, 27, 54,124,118,197,138, 21,164,121,243,230,101,111,221,238,210,165, 11,186,116,233,194,232,245,250,136, 99,199,142, 69,108,
-222,188,153, 47, 40, 40,136,201,200,200, 88, 83,117,100, 41, 44,197,108, 54, 5,153,204, 22,211,194,133, 11,127,232,220,185,179,
-164, 84, 42,113, 39,154,165,198,119,189, 86,171,213,206,152, 49, 35,167, 67,135, 14,164, 46, 52, 67, 67, 67,255,232,216,177, 99,
-175,190,125,251,202,186,118,237, 10,127,127,255,178,121, 94, 94, 94,232,222,189, 59,147,154,154,218,250,200,145, 35, 75,255,248,
-227,143,197,103,206,156, 57,144,148,148,212,215,129, 67,212,244, 14,231,151, 11,254, 2,152, 3, 96, 37,128, 99,213, 61,198, 0,
-120, 14,192,231,247, 73,179,250,135, 2,181, 58,203,100, 50,249,148,254,190,105, 50,153,124,107,188, 88, 50,140,110,225,194,133,
- 62, 10,133, 2, 44,203, 66, 20, 69,136,162, 8, 73,146, 64, 8, 41,251,182,189,114,108,214,172, 89, 98, 77,154,146, 36,177, 11,
- 22, 44,144,107, 52, 26, 0, 0,207,243,229,190,109,216,254,207,154, 53,203,161,107,148, 70,201,225,195, 73,163, 59,178,162, 69,
- 93,237,246, 57,165,233,181,201, 95,158,186, 15,102,213, 51, 32, 32,224, 37, 0,131, 0,216,206,241, 86, 1, 1, 1,251, 43, 44,
-218,170,244,187, 56, 32, 32,224, 0,128,223, 3, 2, 2, 86, 87, 86, 93,232,238,226, 58,246,221,183, 95,119, 37,132, 96,230,207,
- 57,152,249, 75, 14, 62, 28, 90, 15,147, 7,104,241,234, 11, 79,187,172, 94,247,211,152,210, 50,102, 35, 1, 37,189,238,105,244,
-138, 82,247, 6,171,109,219,182, 59,250, 15, 29,213,175,115,143,190, 16, 20, 62,136,191,201, 32,245, 58,129,140, 19,192, 66,194,
-181,255,109, 33, 44,203, 86,116,248, 85,118,213,220,177, 99,199,127,131, 27,183,153,251, 94,244, 28,238, 66,150, 18,171,143, 24,
- 33,154, 11, 96,204,185,130,226,155,151, 81,116, 35, 14,249,233, 23,206,179, 44, 27,237,168,230,237, 97,101, 64, 34, 4, 12, 97,
- 0, 9, 37,231, 6, 91,169,195,170, 86,147,136,204,212,152, 63, 86, 63,213,118,200,116, 92, 62,178, 14, 32,236, 84, 7, 54,127,
- 55, 94,130,121,161,138, 72,198,227, 33, 33, 33,243,198,140, 25, 19,120,238,220, 57, 55,131,193, 80,124,234,212,169, 67,153,153,
-153,190, 94, 94, 94,169, 35, 71,142,124,196,199,199,199,167, 71,143, 30,218,221,187,119,191, 15,224,245,154, 52, 35,181,138,200,
-174, 29, 90, 30,255,100,222,124,151,156, 95, 23,195,114,253, 28,142,103,153,112, 46,219, 72, 2,220, 10,152, 17, 45, 61,225,162,
-148, 97,116, 39, 31,221,127,182, 37,125, 6, 19,158,119, 36,239, 13, 3,124, 27,241, 70, 35, 76, 70, 43,118, 92, 46, 48, 30,207,
- 43,240, 97, 93,211,178, 39, 63,213, 94,205,229,100,160,129,171,188, 9,110, 58,183, 63, 25,134,129, 86,171,173,116,158,187,187,
- 59,186,116,233,130, 70,141, 26,201,159,123,238,185,206, 0,214, 84,165,105,181, 90,253,210,211, 51, 16,222, 52, 92,213,167, 79,
- 31,134,227, 56, 88, 44,150, 59,210, 4, 0, 23, 23,151, 65, 81, 81, 81,178,181,107,215,230, 39, 37, 37, 93, 28, 54,108, 88,186,
- 86,171, 45,119, 67,213,106,181, 8, 14, 14,198,248,241,227,229,111,188,241, 70,141,154,190,190,190,143,175, 91,183, 14, 12,195,
-148,221,188, 43, 18, 18, 18,130, 6, 13, 26, 96,192,128, 1,178,167,159,126,250,241,164,164,164, 42,247,231,240, 62,136,183,153,
-167,225,125,170,191,137,148,206, 79,168, 36,146, 85, 49,157,185, 0,150, 3,248, 13,192,240, 42, 12, 81, 87, 0, 63, 3,232, 15,
- 84,122,228,171,212, 84, 40, 20, 10,171,213,234, 89,137,241,113, 86,179,236, 84,143,137,137, 65,187,118,237, 80,241,219,102,132,
- 24,134,241,113,244,220,228, 56, 14,203,150, 45, 3,203,178, 80, 40, 20,144,203,229, 80, 40, 20,183,125,218,182,109,235,240,249,
- 46,151,203,177,108,217, 50,136,162,200, 38, 37, 37,189, 44,138,226, 16,147,201,228,163,209,104,178, 21, 10,197,246,158, 61,123,
-126,167, 82,169, 4,103, 52, 89, 14, 96, 69,139,122,239,238,173, 46, 85,173,100, 54,155, 49,112,200, 8,176, 12,123,207,175,117,
-199,142, 29, 11, 14, 14, 14,110, 90, 26,157, 2,128,195,233,233,233, 61,236,254,219,115, 56, 61, 61,221,214, 52, 36, 49, 37, 37,
- 37, 56, 36, 36, 36,175,162,166,197, 98,109,168,211,185,128, 16,130,153,191,228,192,180, 54, 12,234, 81,215,240,106, 39, 51, 92,
- 93, 93, 33, 8, 66,179,128,128,128,239, 1,132,151, 70,175, 6, 7, 4, 4, 52, 37,132, 28,104,216,176,225,111,118, 85,250,247,
-236, 58,255,144,104, 86,115, 63, 39, 29, 0,120,219, 77,178, 0,176, 61,173,230,148, 26,224,250, 21,166,219, 47,103,251,206,182,
- 5, 50, 75,215, 35,118,186,217, 12,195,252,175,174, 13, 22,177,115,231, 85,197,120,220,210,140, 30,208, 95,247,130,140,149, 32,
-227, 24,200, 56, 0, 96,144,155, 22, 7, 75,113,238,209,152,152,152,235,142,108,116,215,174, 93, 93, 66,155,119,252, 44,250,147,
- 47,216,239, 14, 27, 81, 96, 48, 33,231,210, 86,100,158,250, 54, 83, 18,172, 91, 89,150, 61,205,178,108,108, 84,235, 86,241,126,
-126,126, 98,109, 51, 39,145,146, 16,119,153,177,146, 0,166, 54, 15, 32,233,191, 94, 65,216,251,229,255,255, 67, 8, 8, 8,232,
- 31, 22, 22, 54,103,204,152, 49, 33,177,177,177,174, 69, 69, 69,217,123,247,238,141,183, 90,173,103, 88,150, 93,148,145,145,209,
-115,221,186,117,218, 41, 83,166,244,109,218,180,105,211, 63,254,248,195, 80, 99,228, 74, 43,111,253,194,139, 35,142, 15, 25, 61,
- 65,125,241,151, 37, 80,197,199, 98,197,165, 60,241,116,150,241,125,147, 94,248, 82,163,149,117,205, 55, 9,123,222,237,238,199,
-250,185,202, 17,228,174,120,244, 92,145, 99, 47,250, 86,202, 85, 50, 34, 83,195, 98, 22, 80,108,145, 44,113, 57, 40,126, 92, 16,
-173,196,197, 75, 13, 0, 50,142,173,209,244,167,167,167,231,249,249,249,125, 22, 26, 26,250, 1,195, 48,164, 71,143, 30,151,218,
-181,107, 87, 44, 73, 18,140, 70, 35,172, 86, 43,228,114, 57,140, 70, 35,146,147,147,113,242,228, 73,184,187,187, 59,181, 95,243,
-243,243, 17, 26, 26, 10,173, 86,123,199,154,146, 36, 49, 75,151, 46, 85, 95,188,120, 81,253,219,111,191,213,251,239,127,255, 91,
-208,182,109,219,184,167,158,122, 42,181, 94,189,122,214,179,103,207,226,248,241,227,200,203,203, 67,199,142, 29, 29,210,180, 90,
-173,144,201,100, 48, 26,141, 80,169, 84,144,201,100, 16, 4, 1,146, 36,149,153, 46,189, 94,143, 91,183,110, 65, 46,151,215,248,
- 34,118,155, 89, 26,222, 7,228,167,159,255,188, 89, 82, 55, 84,200,195, 90,192, 67, 40,224,193, 23,240,224,243,249,103, 38,206,
-111,253,243, 62, 56, 19, 7, 62, 81,106,174,126,174,196,100,117,181,155,126,214, 89, 77,171,213,122,212,102,124,212,106,181,143,
- 45,186,160, 82,169,120,179,217,220,203, 73, 77,196,196,196, 32, 42, 42,138, 43,213, 36,132, 16, 91,123, 27,167, 47, 26, 12,195,
-128,227, 56,200,229,114,112, 28,135,168,168, 40, 12, 26, 52, 8, 77,155, 54, 69, 90, 90, 26, 14, 30, 60,136,203,151, 47, 67,161,
- 80,148,171, 58,172, 9,185, 92, 14,150,101,217,132,132,132,239,250,244,233,211,120,194,132, 9,202,224,224, 96,196,199,199, 55,
- 88,186,116,233,168,125,251,246,245, 28, 58,116,232, 40, 0, 66,117,213,135,229,140, 96,169,105, 50,155,205,136,139,139,171,126,
- 89,167,171, 0,238,156,174, 93,187,166, 16, 66, 18, 81, 82,245,215, 42, 61, 61,189, 71, 64, 64,192, 14, 0, 21, 13, 97,113,122,
-122,250,128,128,128,128, 2, 0,231, 1, 36, 48, 12,147, 82,153,166,135,187, 91,182, 94, 95,236,235,226,162,197,251, 67, 60,160,
- 30,117, 13,111,247,226,192,243, 60,174, 94,189,142,134,161,129,204,166,213, 91,108, 85,131,237, 79,159, 62, 13,148, 84, 21, 38,
-165,166,166,250,119,234,212,137, 54,120,191, 75, 62,170, 26, 47,226,205, 48,204,118, 59,195, 53,208,246,127,218,180,105,239,205,
-153, 51,231, 34,195, 48,219,237,167,219, 47,103,255, 93,122,142,110, 39,132, 12,156, 62,125,122,228,220,185,115,103,219,150,189,
- 47, 17, 44,142,227,134, 93,216,245,229,137, 38, 86, 18,226, 27,249,100,185,253,144,124,118, 23, 36, 73, 90,227,136,206,241,227,
-199,213,130,132,239,166,188, 55,139,253,230,128, 17, 89, 55, 50,144,113,232,115, 24,111,198,173,214,104, 52,239,246,233, 55,240,
-142, 11,110, 84, 84, 84,164, 71,253, 6, 48, 91, 73,169,193, 42,111,178, 30, 20,252,252,252, 6,133,133,133,205,218,186,117,107,
-136,209,104,116, 61,118,236, 88,254,158, 61,123, 18,173, 86,235,170, 27, 55,110,172, 47, 93,108,171, 76, 38,251,152, 16, 2,157,
- 78, 39,227, 56, 78, 83, 93,168, 59,210, 77, 30,245,210, 11, 47, 28,253,239,162,149,234,196, 11,103,177,120,211, 14,168,136, 85,
-188,148,107,121,234,162, 94, 40, 41,180, 6, 97,127, 64,142, 49,157, 16, 4,201, 89, 6,245,180,242, 6,157, 1,245, 9,192, 84,
- 83,154,189,130, 66, 88, 33, 32, 12, 71, 12,102,232,220, 20, 74, 0, 8, 8,111,193,157, 45, 20,112,236,212, 95, 80,171, 61, 21,
-142,228, 61, 51, 51,115,134,191,191,127,232,158, 61,123, 88,131,193, 80,124,238,220, 57,212,175, 95, 31, 62, 62, 62,112,115,115,
- 67,124,124, 60,246,238,221,139,132,132, 4, 16, 66,170,139, 18, 84, 74, 86, 86, 22, 10, 11, 11,235, 68, 83, 16, 4, 6, 0, 34,
- 35, 35, 17, 25, 25,169, 76, 79, 79,247,217,190,125,187,231,236,217,179,111,248,249,249,237, 54, 26,255,110, 30, 85,177,186,167,
-186,136, 2, 0,152, 76, 38,152,205,102, 40, 20, 10,168,213,106, 40, 20, 10, 20, 22, 22, 34, 43, 43, 11, 69, 69, 69, 37, 55, 19,
- 15,143,178,229, 29, 66,148,128, 19,221, 78,223,238,230, 95,246,169,101, 81, 61, 86,106,162,246, 3,176, 29,223, 44, 91, 64, 12,
-213, 87,245, 85,167, 89,110,127,216, 69,153,228,181,209,180, 69,170, 24,134, 41,119,149, 80,171,213, 55,109,145,171,210, 72, 89,
-141, 90,182,106, 65,165, 82,137,200,200, 72,188,251,238,187,136,143,143,199,209,163, 71,225,227,227,131, 39,158,120, 2, 50,153,
- 12,169,169,169, 96, 89,214, 33,131,165, 80, 40,192,243, 60, 18, 19, 19, 95,238,221,187,119,216,226,197,139,149, 73, 73, 73,136,
-143,143,135,155,155, 27, 62,254,248, 99,213,212,169, 83, 3,119,239,222,253, 70,155, 54,109,150, 57,124,109,103, 74,170,255, 6,
- 14, 25, 81,137, 17,113,145,175, 93,243,173,210,102,188,216,251, 48,176, 79,122,122,122, 30, 33,100, 1,128,133,165,213,130, 61,
- 0,184,164,167,167,247,178,187, 9,147,210,106, 65, 0, 56,159,158,158,222, 27, 0,169,170, 65,122,230,205,204,229,159, 47,250,
-102,225,204,247,222, 81, 78, 30,160,197,171,157,204, 16, 69, 17, 28,199, 97,241,242,213,252,229,184, 11,231,218,183,111,191, 29,
-192,224,211,167, 79,163,125,251,246, 69, 0, 46, 3,184,174, 84, 42,105,231,145,251,233,192, 42,152, 32,155,113,154, 51,103,206,
-192,202, 76, 85, 37, 15, 63,229,166,207,157, 59,119,182,221,255, 58,237,197, 46,171,224, 28,171,123, 10,247,243,240, 14,168, 55,
-230,249, 39,176,249,156,237,133,132, 4, 86,179, 1, 55,226, 15, 24, 44, 22,203,207,142,108, 48, 55, 55,247,227, 87,223,157,223,
-248,116,138, 12,153,121, 6,100,236,155, 69,172,249, 73,195, 7, 13, 26,180,185, 46, 50, 20, 21, 21, 21,233,233,229,127,240,131,
-207, 86, 98,127,162, 5, 18, 1, 24,130,191,141,213, 3, 50,242,151,191,191,127, 19, 15, 15,143, 47,182,108,217,226,163, 84, 42,
- 93,207,159, 63, 47, 30, 58,116, 40,131,231,249,165, 55,110,220,216,104,183,220, 11, 45, 91,182,228, 93, 92, 92,144,153,153,105,
-226,121, 94, 95,213,177,110,161, 86, 7, 70,181,138, 56,252,223, 69, 43,213, 38,139, 5, 5, 70, 51,188,253,252,196,163,231,227,
-158,138,211,139,101, 79, 4,205,117,178, 71,218,135, 7, 4,176, 26, 87,192, 80,136,244, 66, 75,134, 35,230, 10, 0, 92, 92, 61,
-216,192,246,143,162,253,196,175,112, 41,250,125, 2,228,194,195,215,159,237, 53,254, 83,232,218, 13,194,178, 9, 47, 75,127, 71,
-112,107,196, 24, 30, 30,142, 51,103,206,216,202, 22,114,115,115, 17, 22, 22,134,197,139, 23,151, 91,208,145,155, 98, 21,229,245,
-142, 53, 37, 73, 98, 42, 68, 29, 49,110,220, 56,249,206,157, 59, 93,236,205,149, 51,154, 22,139,165,204, 80, 16, 66, 96,177, 88,
- 96,177, 88,224,226,226,130,196,196,196,242,126, 73, 20, 43,173,234,172, 58,193, 5,149,135,187,248,220, 59,105,119,120, 12,128,
-194,206, 4,249, 2,232, 86, 75,115,117,155,241,169, 11, 98, 98, 98, 42,189, 14,218,170, 30, 99, 98, 98, 72,187,118,237,124, 29,
-213, 35,132, 64,169, 84, 98,240,224,193,248,235,175,191,144,145,145, 1, 87, 87, 87,152,205,102,152,205,102, 68, 69, 69, 33, 43,
- 43,203,225,232,149,157,110,255,183,223,126, 91,125,253,250,117,220,186,117, 11,106,181, 26,130, 32, 64, 20, 69,188,241,198, 27,
-234,241,227,199,247, 3,224,184,193,226, 24, 60,246,242,103,149,182,173,218,255,237,127,122,170, 84,170,178,234, 22,142,253, 71,
- 93, 64,237, 31, 20,157,218,137,217,215, 47, 44, 91,183,241,183,199, 5,171,181,215,107, 47,141,112,213,185,104,113,245, 90, 18,
-150,173, 90,203,239, 63,114,106,127, 86, 90, 98,127, 0, 76, 64, 64, 64,211,210,200,213,229,244,244,244,151,170, 51,109,148, 58,
-141, 98, 85,100, 52, 74, 59,182, 84,101,156,156, 49,104,246, 17, 46, 27,211,167, 79,143,156, 51,103, 78,157,182, 49,148, 85, 81,
- 88, 43,154,150,182, 30, 94, 1, 7,166,207, 94,169,251,237, 28,135,188,204, 4,152,110, 38, 32, 40,106, 8,178, 18,142,129,136,
-252,175,113,113,113,197, 53,109,108,247,238,221,225, 65, 77,219, 79,108,211,174, 19, 62,255, 93, 15,253,165,141,176,228, 93, 95,
- 54,112,224,192,186, 51, 87,245,253, 14,190, 55,119,101,189,109, 23,229,200,205, 72, 64,252,150,169, 16,173,183,213,138,237,112,
- 70,183, 39, 32, 19, 60,173,120,188, 57,131,155,127, 26,144,217, 19, 50, 28,186,191, 47,189,206,200,200, 72,244,240,240,248,126,
-229,202,149, 99, 91,183,110,173,157, 56,113,226,229,194,194,194, 79, 50, 51, 51,127,180, 51, 87,189,195,194,194, 38,205,154, 53,
-171,113,114,114, 50, 14, 31, 62,156,200,113, 92,149,245,203,151, 76,166, 52,246,252,165,165, 71,127, 88, 53,153, 13, 14,199,166,
- 89, 83,132, 63, 47,196, 13,142,211,139, 59,203,204,149,139, 34,162, 75,100,163,237,111, 78, 24,195,138,103,119, 33, 62,249, 38,
- 50,245,252, 62,135,159, 70,139, 12,188, 92,165,129,174, 65, 40,146,141,146,194,223,223,255,100, 90,190,241,255,236,157,119, 84,
- 20,215,223,198,159,153,237,187,176, 75, 47, 75, 21, 21,144,170, 32,160,162,216,162,177,196, 22, 19,123,212,152, 24, 53,137,198,
-168,137, 53,138, 13,141,209,168,104,138, 49, 54, 18,197,246,198,196, 26,163, 34, 22,172, 20, 59, 34, 34,125,169,210, 89,216, 54,
-247,253, 3,240,135,132,178,148,244,249,156,179,103, 97,102,246,217,123,103,238,222,251,204,247,150,225,211, 28, 46,104, 46, 31,
- 73, 5,149,205,106,196, 25,230,247, 33,201,186,166, 5, 64,147, 93,100, 77, 58,185, 86,104,214, 68,176,126,231, 87, 52, 26,170,
-165,154,181, 13, 86, 93, 51, 85,223, 57,106,150,193, 82, 23,215,127, 13, 84,249,109, 49,177,163, 38, 33,130,214,152,171, 26,227,
- 83, 51, 0, 93, 40, 20,190, 48, 42,250, 70,153, 26,138, 96, 53,182, 95,239,150,159,162,192, 48, 12,120, 60, 30,156,157,157,113,
-237,218, 53,200,100, 50, 24, 26, 26, 66, 34,145, 64, 40, 20, 66, 38,147, 65, 32, 16,128,166,105,208,122, 26, 23,141, 70, 3,149,
- 74,101,109,103,103,135, 39, 79,158, 64, 36, 18,189,120, 9, 4, 2,184,186,186,162,180,180,180, 89,166,179, 57,166,137,243, 47,
- 90,154, 58,229, 97,212,235,214, 46, 1,147, 15,254,223,137,247, 43, 43, 85, 94,157, 92, 59,226,209,189,152, 59,217,233,137, 67,
- 88,143,243,183, 49,206, 53,124,135,170, 89,162,109,210,141, 87,159,201, 90,191,126,125, 72,237, 40, 88, 91, 27, 44, 52,102,174,
- 22,174,253, 78,118, 56,134, 70,161, 34, 30, 41,103,150,148,232,212,229, 5, 12,163,113, 44,120,122, 5,120,121, 64,110, 99,141,
-161,127, 96,255,145,244,197, 71, 42,168, 75, 50, 81,124,255, 96,178, 80, 40, 92,212,150,230,106,209,186,157,166, 63,221,225,226,
-121,230, 99, 60, 61,181,184, 72,167, 46,239, 31, 19, 19,211,236,117,180,222, 3,120,223, 1,154, 17, 22, 22,163,100, 66,122,195,
-180,209, 82,244, 30, 32,134,140, 47,195,170, 47,232, 71,101,129,204,130,156, 40, 28,135, 47,120,136,193, 95, 50,163,240,193,131,
- 7,107,119,238,220, 73,107,181,218,105,106,181, 58, 88,161, 80,188,136, 34,202,229,242,129, 14, 14, 14, 27, 86,175, 94,109,151,
-156,156, 44,184,126,253,250,243,216,216, 88, 70,167,211,173,111, 76,243, 94,177,234,211, 15, 63,156,205,233,104,111, 51, 59, 49,
- 61,125,196,253, 18,221,153,154,125,158, 18,190,103, 96, 23,183,171,171, 87, 46,150,170,175, 31, 69, 89, 86, 58,182, 95,207, 42,
-102,116,154,197,122, 70,221, 76,175, 92, 56,143,197,211,167, 50, 37, 37, 37,144, 8,248, 76,122,252, 83,206,228, 1,189,117,159,
- 47,156, 79,103,101,101,161,188,172,140, 99, 99, 99, 99,154,153,153,249, 92, 31,205,250, 12, 69,125,141,107,179, 12, 70,253,141,
-121,139, 53,235, 70,176, 26, 51, 88,250,106,214,238, 18,107,234,124,232,116,186,230,117, 17,106, 27, 48, 88,234, 92,117, 43,139,
-108, 42, 69, 81, 14, 53,127,183,197,111,160,162,162,194,178, 86, 84, 12, 0,168,150, 70, 43,171, 35, 88,141,238,111,142,201,170,
-137, 96, 37, 38, 38,194,194,194, 2, 90,173, 22, 6, 6, 6, 16,139,197, 16,139,197, 80, 42,149, 16, 8, 4,224,112, 56,205, 74,
-167, 80, 40,204,138,143,143,119, 52, 49, 49,129, 78,167,123,201,100, 61,123,246, 12, 70, 70, 70, 57,250,142,191,170,138, 96, 1,
-231,246, 46,172,119, 22,161,177,145,193, 75, 66, 28,138,194,223,136,218,227,116, 90, 20, 85,202, 74,184,249, 3,128, 31,108,109,
-109,247,237,255,254,164,159,159,159,223,201,214,106,178,252,193,238,171,218, 24,213, 30, 75,181,104,209,162, 22,175, 29,178,104,
-209,162, 37,245, 69,180,218,210, 96, 81,117,222,255,103,174,204,108, 34, 22,172,222, 33,219,127,155, 70,145,226, 17, 50,207, 45,
- 43, 98,212,229,253,105,154, 86,164, 69,125,119, 4, 64,121, 76, 76, 76,164,158,141,161,111, 39, 23, 23, 28,190,175, 69, 69,214,
- 29,208, 20,217, 59, 96,192,128,242,214,102,162,198, 92,125, 26,242,157,233,225, 88, 46, 10,170, 76, 96, 17,211, 2,115, 53, 65,
- 32,232,200,163,233, 13,246, 93,220, 94, 27,151,148, 90,218,175,131,200,120,104, 71, 33, 56,215,143,225,184, 77, 14,158,155, 95,
-192,172,205,182, 29,163,126, 46,254, 37, 70, 88,246,188,139,183,151,236,182,193,189,147, 26,162,251, 52,239, 50,254,244,193,239,
-137,137,137,171,173,172,172,126,202,206,206,126, 49, 58,213,214,214,118,136,131,131, 67,200,170, 85,171,218,165,165,165, 73,227,
-226,226,138,143, 28, 57,242,140,166,233, 85, 89, 89, 89, 57, 77,105,222, 47,213,204, 39,169,138,239, 31,148,233,226, 95, 68,174,
- 36,188,206,147, 39,143,187, 54, 96,252,219,162,164,139,251, 96,154,254, 0, 91,110,230,232,210,139, 42, 38,196, 43,145,165,143,
-185, 18, 8, 4,135, 67,143, 30,125,226,229,229, 69,149,151,151, 67,163,209, 32, 55, 55, 23, 95,252,120,248, 62,195, 48, 48, 49,
- 49,193,249,243,231,153,143, 62,250,232,176,141,141,205, 24,125, 76, 22,195, 48, 47, 26,171,134,162, 64, 98,177,184,121, 6,163,
-250, 51,181, 13, 76,107, 52, 27, 50, 88,117, 35, 91,205,212,172,250, 1, 87, 15,110,111, 40,162,199,225,112,192, 48, 76,189,145,
-190,134,195, 36,133, 13, 24,172,156,214,222, 72, 56,162,241,137, 52,127, 25, 34,145, 40,187,218, 60, 49, 13, 45,197,208,220, 8,
- 22, 0, 8, 4, 2, 68, 69, 69, 97,240,224,193, 96, 24, 6, 66,161, 16, 98,177, 24, 34,145, 8, 55,111,222, 4,159,207, 7,135,
-195,105, 86, 55, 33,143,199, 59,189,125,251,246,169,235,215,175, 23, 51, 12, 3,129, 64, 0,177, 88, 12,161, 80,136, 47,191,252,
- 82, 41, 16, 8,206, 52,203, 96,161,233, 89,132,181,205,216,159, 77,157,101, 26,234, 46,197, 80,155,186, 75, 56, 52,184, 76,131,
-141,141,141,169,157,157,221,187,132, 16,143,234, 77, 47,205, 22,172,117,104, 77,197,226, 98,107,107,187,175,158, 89,132, 44,109,
- 31,189, 66, 3,117, 68,110,157,232,149,170,214,255,185, 0,168,234,255,115,107, 25,176,218,127,171,234,217,150,191,110,221,186,
-136, 90,145,171,220,182,204, 76,131, 17,172, 46, 93,186,184, 25,155,217, 68,204, 91,189, 67,182,239, 6, 7, 69,138,135,200,139,
-248,172,136,104,149,181, 77, 75,175,102,126,159,143,165,165, 25,242,162, 42,160, 41,120, 2,138,162, 98, 90,155, 1,127,127,127,
-103,169,145,197,197, 5,107,190, 51, 61, 16,205, 69, 97,230,255, 76, 96, 75, 34, 87, 92,154,254, 98,211,175, 7, 71, 8,179, 30,
- 65,121,231,162, 49,239,121, 58,238,231,168,113, 56, 42,171,228,226,213,157, 87,104,119, 18,212,127,130,177, 97,255, 9,166,216,
- 50,235,140,105,118,197, 3,220, 72, 56, 49, 50,100,241, 9,130,191,104,117,247,218,230, 74, 46,151, 15,183,177,177, 89,121,242,
-228, 73, 71,173, 86, 43,189,116,233, 82,201,145, 35, 71,158,106,181,218,208,172,172,172,147,122, 71,199,202,212, 47,204,149,167,
-140,231, 59,109,202,148, 43, 31,109,254, 86,244, 32,250, 22, 54,236, 59, 9, 41, 79,163,139,206,172, 24,243,160,236,127,221,135,
-141,158, 87, 46,119,213,129, 3, 7, 12,220,221,221,169,252,252,252, 23, 13,190, 90,173, 70,113,113, 49,138,138,138,160, 82,169,
-224,229,229, 69,175, 88,177,194, 96,249,242,229,171, 0,124,208, 68,132, 32,103,229,202,149,150,239,189,247, 30,100, 50, 25,242,
-243,243,161,209,104, 94, 68,155,132, 66, 33,140,141,141, 81, 88, 88,136,115,231,206,129, 16,210,168,185,228,243,249, 10, 91, 91,
- 27,123,177,196, 64, 37,145, 72,136,161,161, 97,171, 53,171, 27,219,172,161, 67,135, 90,175, 92,185, 82, 80,187,145, 86,171,213,
- 84, 75, 53, 9, 33,229,175,190,250,170, 36, 52, 52, 20,142,142,142, 80,169, 84, 96, 24,230, 69, 4,171,102,105,128,212,212, 84,
-172, 93,187, 22,132, 16,253,111,100, 52, 5, 26,216, 77,177,128, 58, 95, 3,117,190, 6,170, 60, 13,212, 57, 26,104,203,255,118,
- 83, 68, 90, 50, 0, 93,143, 72,152,101,107, 35, 88, 20, 69,129, 16, 2, 62,159,143,180,180, 52,156, 63,127, 30, 1, 1, 1,144,
- 74,165, 40, 43, 43,195,181,107,215,144,149,149,213,162, 8, 86,255,254,253,247,158, 61,123, 54,232,195, 15, 63,116,154, 57,115,
-166,216,205,205, 13,201,201,201,216,188,121,115,197,195,135, 15, 51,230,204,153,179,179, 57,122,116,245,210, 53,122,205, 34,164,
-255,124,111,220,192, 50, 13, 67, 27, 56,188,246, 18, 14,117,151,105,120,193,177, 99,199,156,108,109,109,221, 80, 53,190, 10,248,
-253,108,193,218,220,190,125,251,182, 31,216, 89,132,127,117,228,234,214, 63, 45,205,220,134,127,116,244,199,221,222, 88, 42,219,
-123,157,139,130,140,251, 40,186,188,162,174,185,210, 7, 47,212, 90, 43,131, 39,146,122,105, 9, 31, 64, 5,180,133, 79, 33, 16,
- 8, 98, 91,144,230,151, 52, 25,134,153,223,253,141,165,166, 97,183,184, 40,202,124,136,220,139,203, 91, 98,174,188, 0,220,123,
- 15,224,217,251,120,188, 38,204,126,140,138,139,225,160, 0,124, 31, 91,134,107,233,170, 47,213, 42,213,154,135,197,170, 66, 91,
- 49, 76,194, 67,114,150, 15,121,221,251, 35,215,113,231,112, 35,247, 27, 64, 2,152, 88,112,135,228,248,106,107,119, 23,190,148,
-206, 54,162, 81, 77, 27, 27, 27,103, 67, 67,195, 47, 78,159, 62,109, 33, 16, 8,100, 15, 30, 60,208, 29, 61,122, 52, 77,167,211,
-109,170, 61,240,189, 57,154, 30, 34,145,157,123,123,251,200, 57,155,190, 22,149,148,150,161, 76,165,134,141,131,173, 46, 50,250,
-209, 27, 15,202,212, 63,235,163,105,105,105,217,111,244,232,209,157,187,118,237, 74, 55,100,174,138,139,139, 81, 90, 90,138,244,
-244,116, 4, 5, 5,209,110,110,110, 94,149,149,149,253,114,114,114, 34, 26, 74,167, 66,161, 8, 14, 15, 15,239,121,232,208,161,
- 97,211,167, 79,151,142, 30, 61, 26, 98,177, 24,101,101,101,176,183,183, 7,195, 48,184,124,249, 50, 18, 18, 18, 74, 0,156, 80,
- 40, 20, 87, 27, 75,231,179,103, 73, 14, 0,104, 59, 59,187,158,131, 7, 15,110, 19, 77, 0,200,205,205,237, 24, 25, 25,185,112,
-228,200,145,115, 7, 13, 26, 36, 93,178,100, 9,223,201,201, 9, 58,157,142,106,169,102, 65, 65,129, 81, 76, 76,204,198, 94,189,
-122,125, 48,120,240, 96,110, 72, 72, 8,140,140,140,160,211,233, 32, 22,139, 81, 92, 92,140, 85,171, 86,225,202,149, 43, 90, 66,
-200, 87, 69, 69, 69, 11, 26,211,172,189, 14,214,152, 57, 95,118,105,172, 16, 54,178, 14,214,159, 94,230,171, 35, 77, 4,205,235,
- 26,108, 50,157,213, 3,218,127,183, 30,150,190,154, 53, 75, 47, 8, 4, 2,112,185, 92,228,230,230,226,236,217,179, 47,173,127,
- 37, 16, 8, 94, 44,227,208, 64, 4,171,222,116, 74,165, 82,230,205, 55,223,156,118,250,244,233,169,243,231,207, 31, 89, 82, 82,
- 98, 41,147,201,114, 13, 12, 12, 78,204,153, 51,103,183,177,177,113, 99, 75, 52,252, 78,147, 67, 83, 13,206, 34,124, 41,106,202,
- 17, 84, 52, 48, 92,235, 15,189,238,117,150,105,168,187, 20, 67,109,234, 46,225, 80,119,153,134, 23,154,163, 70,141,122,134,170,
-197, 67,233,234,247,186,179, 5,107,112,185,125,251,182,159,159,159,223, 37, 0, 98,252,126, 22,225,159, 94,230,255,229,154,255,
- 42, 26, 27,131, 37,186, 26,157, 0, 90,152,131,146, 27, 95,180,196, 92,253, 14,109,101, 89,226,234,131, 73, 62, 58,149, 18,218,
-226,148,199,131, 95, 27,154,211,218, 12, 16, 66, 12,174,196, 36,130, 43,202, 71,225,245,207, 11, 41, 93,101,255,152,152,152,184,
-150,104,125, 7,104, 38,222,121,116,241,233,149,243,175,216, 0, 72,121,174, 66, 92,252,243,179,199,148,202,249, 53,199,100, 92,
- 71, 1,128,185,191,114,239,117, 50,117, 41, 26,104,100, 3,228,164,106, 80,144,171, 61,253, 87,141,197,170, 33, 51, 51,243,137,
-135,135,199,190, 93,187,118,205,242,245,245, 53,156, 61,123,118, 66, 81, 81,209, 75, 3,223,155,203,131,138,138,116, 36, 38,127,
-115,241,251,205,159,136,220, 2,112, 52,100,177,238, 82,116,252,168,251,165,106,189,251,172,133, 66, 97,223, 89,179,102,241,203,
-203,203, 27, 52, 87,197,197,197, 40, 41, 41, 65,113,113, 49,226,226,226, 48,122,244,104,225,163, 71,143,250, 2,136,104,172,206,
- 79, 79, 79,191,220,161, 67,135,155,223,124,243,205,128,176,176,176,129,239,188,243,142,160,111,223,190,120,240,224, 1,110,222,
-188,169, 82,171,213,191,137, 68,162,115, 79,159, 62,213,119, 16,214, 31,161,169, 85, 42,149,107,197, 98,113,232,145, 35, 71,214,
- 92,184,112,225,173,169, 83,167, 26,104,181, 90,170, 53,154, 69, 69, 69,115,205,205,205,151,157, 58,117,106,239,217,179,103, 71,
-189,245,214, 91,244,156, 57,115,176,109,219, 54, 28, 61,122,148,209,233,116, 63,243,120,188, 41,121,121,121, 77, 78, 64,169,189,
- 14, 86, 99,235, 92, 53,181, 95, 15,254,136,187,208, 86,107,214,141,132,213,204, 22,172, 49, 85,205,233, 30,172, 77,231,206,157,
- 95, 90,231,170,102, 64,123,205,139,195,225,128,203,229, 54,171,139,208,211,211, 19, 60, 30,143,241,241,241,217, 13, 96, 55,240,
-242, 35,115,120, 60,222,139, 69, 77,245,161, 82,203,224,251, 93,251,110,106, 25, 2, 29, 67, 64, 24, 64, 67, 0, 70,199, 64,199,
- 16,232, 24,166,106, 89, 52, 2, 40, 43,116,127,122,189, 86,107,153,134, 47,235, 89,138,225, 5,245, 44,225,208,224,115, 3, 51,
- 51, 51,159, 19, 66,106,198,163,214, 55, 91,176, 70,115, 95,245,118,113, 70, 70,198,228,198, 52, 89, 88,154, 99,176,150,148, 70,
-111,213, 0, 48,163, 40,106,113, 76, 76,204,131,214,126, 25,135, 67, 47,206, 57,254,118, 40, 1, 10, 56, 20, 22,183, 69, 6,116,
- 58,221,210,178,152, 80,134, 16, 98, 76, 81,212,162,232,232,232, 86,165,147,104,181,239,127,177,243,242,151, 22, 70,130,129,121,
-133,149,167, 64, 81,245,174,218,174, 5,249,240,135,207, 83, 63, 55,177,224, 14, 41,200,213,158,102,104, 44,252, 59, 92,208, 7,
- 15, 30,132,236,220,185,147,243,237,183,223, 78, 83,169, 84, 47, 13,124,111,177,102,169,250,211,143, 63, 93,198,233,228,100, 55,
- 59, 62, 57,117,228,253, 82,253,186, 5,107, 33,176,181,181,189, 95, 94, 94, 14,138,162, 80, 89, 89,249,146,161,170,109,176,212,
-106, 53,114,114,114,224,228,228, 4,138,162,244,106, 33,170, 77,201, 73, 51, 51,179, 75, 91,183,110,125,109,219,182,109,129, 12,
-195, 68,169,213,234,147,249,249,249,165, 45,201,243, 31,161, 89,253,185,143,180, 90,237,250,109,219,182,109, 20,137, 68,126, 57,
- 57, 57,145,173,209,172, 54, 79,111,152,154,154,218,236,219,183,239,240,174, 93,187,186,115,185,220,235, 20, 69,141, 41, 42, 42,
-106,201,122, 61,143, 91,185,191, 41,142,254, 1,197,190,213,154,181,199, 92,181,180,155,241,165,250, 65,171, 45, 93,188,120,113,
- 78,221,103, 14,214, 94,243,170,246,187, 74,165,170,208, 67,147,249,236,179,207, 26,189,137,171,109,180, 42, 42, 42,154,236,210,
- 37, 12,201, 27, 58,246,253,230,213,145, 12,201,251, 11,171,184,227, 0,158, 84,191, 72, 35,251,154,149, 37, 84,173,209,150, 76,
- 8, 73,174,163, 91,123, 59, 11, 75,219, 24,172,152,152,152, 52, 0,111,183,229,151, 13, 30, 60,248, 60, 0,183,182,212,188,115,
-231, 78, 10,128,183,218, 74,239,128, 74,149, 8, 96,216,123, 57, 42,222,143,104, 56, 34, 85, 61,160,253,245, 58,221,130,127, 11,
-234, 27,248,222, 90,238,151,106,230,147,164,140,151, 6,190, 55,163,177,249, 85, 40, 20, 82,197,197,197, 80,171,213, 40, 41, 41,
-121, 97,174,106,155, 44,173, 86, 11,138,162, 80, 82, 82, 2, 67, 67, 67,104, 52,154,102,221, 41, 86,155,148,240, 62,125,250, 28,
-137,140,140,108,147,101, 52,254, 8, 77,165, 82,153,165, 84, 42, 39,246,233,211,135,219, 86,154,207,159, 63,207, 4, 16,216,161,
- 67, 7, 65, 51,162, 96, 13, 70,178, 90,186, 95, 15,190,253, 3,138,252,143,127,183,138, 53, 37, 37,197,189,173, 53,211,210,210,
- 30,182,121, 58,111,252, 48,239,159,208, 80,213, 68,141,108,109,109,247,165,166,166, 58, 80, 20,149, 90, 55,146,212,216,190,198,
- 52, 1,192,201,201,233, 88, 90, 90,154,141, 80, 40,204,212,103, 59, 11,203,223, 1, 47, 86,147,213,100, 53, 89, 77, 86,147,213,
-100, 53, 89,205, 22,242,222, 63,213, 0,253,139,150,141, 99, 97, 97, 97, 97, 97, 97, 97,249,123, 64, 53,226, 66,155, 51, 59,160,
- 37, 78,246, 30,171,201,106,178,154,172, 38,171,201,106,178,154,255, 57,205,166,180,107,127,254, 61, 84,173,228,206,210, 6, 23,
-134,213,100, 53, 89, 77, 86,147,213,100, 53, 89,205,255,158,102,125,176, 93,132, 44, 44, 44, 44, 44, 44, 44, 44, 44, 85,112,217,
- 83,192,162, 15,182,182,182,235,186,117,235,246,254,173, 91,183, 54,165,165,165,173,106,161,134,141,153,153,217, 90, 0,129,132,
- 16, 33,135,195,121,152,151,151, 23,146,158,158,126,185,165,233,146,203,229,246, 22, 22, 22,107, 1,116,103, 24,134,207,227,241,
-238,103,103,103,175,201,204,204,188,222, 82, 77,115,115,115, 3,185, 92,238, 71, 8,177, 36,132,208, 60, 30,175, 32, 35, 35, 35,
- 46, 55, 55, 55,135, 45, 9, 44, 44, 44, 44, 44,173, 54, 88,193, 31, 66, 14, 53,184,193,223, 33,173,122,147, 12, 85,139,174,185,
- 1,120,132,170,199, 11,180,246,145, 1,255, 20,205,191, 59,180,177,177,241,171, 18,137,228,163,210,210, 82, 31,153, 76,118, 95,
-171,213,134, 42, 20,138, 19, 0, 90,245,136, 19, 11, 11, 11,203, 81,163, 70, 45,218,186,117, 43,166, 77,155,182,236,228,201,147,
-155,155,187,110,147,155,155,219, 8,169, 84,186, 99,245,234, 53, 22, 1, 1, 1,148, 72, 36, 66, 98, 98,162,237,210,165, 75,124,
-205,205,205, 15,199,198,198,126,208,220,116,121,120,120,140,145, 74,165,161, 33, 33, 33, 22,126,126,126, 20,151,203,197,221,187,
-119,237, 86,174, 92, 25, 96, 97, 97,177, 47, 46, 46,110,126,115, 53, 61, 61, 61,157, 12, 13, 13, 3,215,172, 89, 35, 10, 8, 8,
-128, 80, 40,196,195,135, 15, 13,150, 44, 89, 98,161, 80, 40,158,196,198,198,222,104,142,158,239,123,209, 60,190, 68,205, 5, 0,
-117, 57, 95, 27,243, 93, 87,141,190,219,216,234,137,133,133,133,229, 95,104,176, 86,206,196, 42, 74,139, 37,160, 65,125, 52, 30,
-135,182, 29,162,111,246,239,223,191,211, 59,239,188, 67, 85, 63, 58,194, 61, 60, 60,252,141, 19, 39, 78,196, 51, 12,115, 3, 64,
- 28, 0,181,158,223,203, 7,208,133,166,233,110,127,115,205,191, 61,134,134,134,206, 22, 22, 22,243,139,139,139,135,248,249,249,
- 21,207,156, 57, 51,249,250,245,235, 73,254,254,254, 21,187,118,237, 10,209,104, 52, 95, 27, 27, 27,255, 86, 82, 82,178,177,165,
-235, 98,241,120, 60, 55,138,162,144,145,145, 1, 30,143,199, 19, 8, 4,238, 0,244, 54, 26,118,118,118,114,169, 84,250,237,161,
- 99,191, 90, 22, 87,210,120,146,203, 0, 40,135,142, 54,199,234, 13,219,204, 54,174, 93, 54,161,172,172,236,202,147, 39, 79, 14,
-234,171, 41,151,203,237,165, 82,105,232,133, 11, 23, 44,133, 66, 33, 24,134, 65, 73, 73, 9, 44, 45, 45,177,110,221, 58,211,213,
-171, 87,191, 83, 84, 84,116, 41, 57, 57,249,184,190,154,230,230,230, 6,134,134,134,129, 17, 17, 17, 34,129, 64, 64,105, 52, 26,
-170,178,178, 18,214,214,214,228,203, 47,191, 20, 46, 93,186,212,181,176,176, 48, 43, 57, 57, 57, 85, 47,115,181, 35,154, 87,252,
-107, 68, 15,146,166, 92, 6, 0,148, 72,188,166, 79,112,242,205,140,187, 71, 2,154,218,230,187, 35,250, 90,204, 12,214,100,177,
-252,185,200,229,242,158, 78, 78, 78,199, 82, 83, 83,163, 56, 28,206,184,148,148,148,202, 54,144,181, 3,224, 4,192, 4, 85, 19,
-171,158, 3, 72, 6, 94,220,184, 55, 27,179, 14,125,135, 67, 40,121, 27,132,116,161, 1,128,166,227, 24,117,217,158,252,132,139,
-199, 91,165, 41, 50,152, 6,134,233, 66,131, 48,160, 57,119,136,182,108,103, 94,252,197,211,108,201, 96,105, 51,131, 21,252, 14,
- 76, 40, 96,225,226,153,239,209, 92, 14,135, 10,217,241,221,248, 91, 81,199,137,220,161,203,139, 71,110, 4, 5, 5, 33, 40, 40,
-136,218,176, 97,131,219,133, 11, 23,220,246,239,223,175,137,138,138,138, 6,176,183,161, 47, 11,153, 45, 78,213,106,148,246,160,
-197, 21,237,186,127,189, 63, 48, 48,136, 17, 10,133,104,141, 38, 0,188,255, 38,247,183, 74,202,158,234, 59,108,121, 74, 91,105,
-254, 67,204, 85,164, 84, 42,141, 96, 27,225, 0, 0, 32, 0, 73, 68, 65, 84,237, 56, 99,198,140, 39,179,102,205,186,100, 96, 96,
- 64, 0, 32, 39, 39,199,224,181,215, 94, 43, 24, 53,106, 84,126,121,121, 57,190,249,230, 27,251,208,208,208,223,164, 82,105, 70,
- 73, 73, 73, 64,115,202,135, 92, 46, 95, 63, 96,192,128,121, 19, 39, 78,132, 84, 42,197,212,169, 83, 81, 89, 89, 25,117,225,194,
-133, 13, 10,133, 98, 25,128, 38,159,157, 97, 98, 98,178, 98,229,202,149,150,165, 42, 14,150,133, 37,226,121,105,149,111,144, 8,
-104,124,240,138, 16,147, 39, 79, 49,138,141,141,221, 0, 64,111,131,101, 97, 97,177, 54, 36, 36,196,162,230, 90,151,150,150,162,
-180,180, 20, 37, 37, 37, 40, 45, 45,197,196,137, 19,101, 79,158, 60,217,130,170,213,157,245,109, 92,252,214,172, 89, 35, 18, 8,
- 4, 56,126,252,120,231,138,138, 10,174, 70,163, 1, 33, 68,219,169, 83,167,184, 41, 83,166,240, 19, 18, 18,122, 0,208,203, 96,
-201,179,192, 43, 82, 42,191,218,254,249, 39, 22, 0,240,225,194, 47,190, 2,148,221,136, 30,219,228, 89,240,143, 1, 88,131,213,
- 56, 28, 0,175,243,120,188,209, 29, 59,118,244,123,242,228, 73,172, 86,171,253, 63, 0,255,135,214,159,187, 87,108,108,108,214,
-102,102,102,110, 7,240,195,127,229,132,118,232,208,225,167,253,251,247,155,157, 58,117,106,196,234,213,171,199, 2,216,215, 10,
- 57, 30,128, 30,213,166,234, 81,181,177, 66,181,209,234, 4,160, 3,128,171,205,185,225, 53,115, 9, 52, 4, 87, 22,222,163,103,
-159, 94, 99,222, 24, 37,181, 48, 53, 66, 89,165, 14, 9,201, 89, 14,103, 79,253,212,231, 49, 95, 28,165, 85, 23,141,207, 79,136,
- 42,109,174,102,191,254, 3,123,245,127,101,128,212,200,200, 24,249, 37, 26, 60, 77, 78,119,140,252,237,231, 32,154, 43,190, 4,
- 74,243, 86,206,189,223,202,217,159, 28, 75,115,208,107,144, 59, 69, 81, 48, 48, 52,168,119,159,145,145, 17,250,246,237,139,144,
-144, 16, 30,128,238,117,118,191, 52, 85, 83,167, 83,201,151,125, 48, 27, 2, 46, 17,190, 54,100, 16, 37,147,201, 90,173, 9, 0,
- 86,166,218, 1,221, 92,149,125,178,227,230, 76,138,139, 92,235,165,170, 40,252,221,147, 78, 37, 18, 9,156,157,157,177,116,233,
- 82,189, 52,219,128, 63, 92,147, 16, 98,227,238,238, 94,178,121,243,102,215,229,203,151,155, 84, 84, 84, 24, 0,176,115,247,233,
-105, 67,211,180,189, 74,165,146, 6, 7, 7,155,127,254,249,231,174, 22, 22, 22,133,132, 16,139,230,164, 83, 46,151,111, 14, 9,
- 9,153,191,103,207, 30,202,223,223, 31, 82,169, 20, 61,122,244, 64, 88, 88, 24,189, 98,197,138, 69,114,185,124,189,158,121, 15,
- 10, 8, 8,160, 24, 0, 5,165, 90, 68,172,235,138,171, 95,248,163, 92,197,160,168,164, 20, 74,165, 18, 34,145, 72,108,102,102,
-102,216,140,243,217,221,207,207,143, 2,240,194, 84,149,148, 84,189, 74, 75,203,160, 82,169, 65,211,180,204,209,209, 81,216,140,
-243,105, 25, 16, 80,229, 63, 43, 42, 42,184, 35, 70,140,192,176, 97,195, 80, 82, 82,194, 45, 46, 46,134, 74,165, 2, 77,211,252,
-234,134,189, 73, 77,149,132, 71, 49,132,177, 50,144,136,205, 13, 36, 98,115,134, 48, 86, 0,160,207, 54,149,132, 71,253,197,229,
-211,130,166,233,221, 29, 58,116,120, 72,211,244, 62, 0,214,173,212,244, 7, 16, 34, 22,139,207,185,185,185,165, 73, 36,146, 11,
- 0,214, 87, 55,192, 45,209, 20, 72, 36,146, 11, 33, 33, 33,135, 99, 99, 99,199,158, 63,127,222,233,238,221,187,111,108,216,176,
- 33,220,208,208,176,230,193,188, 45,254,109, 58, 57, 57,237,186,113,227,134,127, 96, 96,224,247, 0,132,109,244,123,231, 0,240,
-169, 54, 28,127,139, 58,164, 54,182,182,182, 29,125,124,124,204, 57, 28, 14,130,130,130, 64, 8, 9,106,165,102, 32,128, 44, 0,
-145, 0,114,171,111,198,116, 0,242, 0, 92,174,190, 81, 9,106,150, 38, 87, 22,254,209,199,159, 14, 94, 48,251, 93,105, 76,138,
- 14, 59,207, 42,112,232, 74, 46, 50, 74,132, 24, 56,114,154, 81,159,161, 19, 7,113,249, 70,225,205,213, 92,180,104,201,224,119,
-167, 78,146,222,203,164,113,248,106, 30,174, 60, 42, 70, 57,101,130,190, 35,223, 51,113, 15, 24,242, 26, 5,254,222,191,195, 53,
-250, 15,104,254, 7, 34, 88,187, 80,176,114, 38, 62, 15,249,230,187,101, 52, 69, 17, 59,151, 65, 15,156,156,187,151, 49, 12, 3,
-165, 82, 9,181, 90, 13, 30,143, 7,165, 82,137,148,148, 20,220,184,113, 3, 70, 70, 70,205,250,226,194,162, 34,216,218, 57, 65,
- 34,145,180,137,230,244, 55, 71,113, 83, 21, 10,110, 84, 76, 68,215,131, 91,247,119,181,239, 48,240, 81,151,190,159,222, 51, 52,
-114, 80,198,197,197,225,218,181,107, 40, 40, 40, 64, 77, 3,250,111,128,162, 40,205,198,141, 27, 99, 50, 51, 51,113,249,242,101,
-159,149, 91,126,108,119,175,184, 3, 55,183,148,240, 44, 12,179, 29,221,196,143,117, 5,207,159, 39,205,159, 63,255,130, 92, 46,
- 87,205,158, 61,187,143, 62,186,182,182,182, 34,138,162,186, 14, 26, 52,232,131, 41, 83,166, 32, 57, 57, 25, 11, 22, 44, 80,197,
-197,197, 21,118,237,218,213,100,227,198,141,252,247,222,123, 15, 81, 81, 81,243, 35, 34, 34,142, 0,184,159,145,145,209,216,179,
-212, 4, 34,145, 8, 40,170,186, 81, 85,107, 9,106,134,133,149,150,150,130, 38,133,224,243,249, 52, 77,211, 22, 0,244,186,243,
-100, 24,134, 47, 16, 8, 80, 86, 86,134,210,210, 82,100,228,150, 34, 37,187, 12, 37,101,149, 80, 42, 53,168,172, 32, 16, 74,173,
-104, 77,110,174, 25,128, 12,125, 52, 9, 33,116, 77,119,163, 74,165,130, 82,169,132, 74,165,130, 74,165,122,241, 56, 31, 14,135,
- 35,181,181,181,149,101,100,100, 20, 52,217,154, 10,196, 90, 14,205, 15, 89,178,230,171, 96, 0,224,208,252, 16, 67, 84, 48,250,
-108,227, 8,196,218,191,176,104, 9, 45, 44, 44, 34, 14, 31, 62,236,238,236,236,140,103,207,158,185,141, 25, 51,166,155, 66,161,
-240, 1,208,220,187,120, 9, 77,211,159, 79,153, 50,229,253, 9, 19, 38, 80, 46, 46, 46,224,114,185,208,106,181,118,137,137,137,
-253, 14, 29, 58,180,112,215,174, 93, 59,117, 58,221,124,125,175, 61, 0, 90, 32, 16, 28,220,177, 99, 71,239,110,221,186, 97,223,
-190,125,184,121,243, 38,227,239,239, 79, 79,158, 60, 25,142,142,142,221, 39, 79,158,124,180,178,178,114,152, 62, 17,214,122,112,
-236,209,163,135, 61,135,195, 65, 96, 96, 32, 63, 42, 42,202, 23, 64, 84,107, 3,206,118,118,118,145,125,251,246,245, 57,119,238,
- 92, 76, 86, 86, 86,223,102,228, 23,114,185,124,164,149,149,213, 6,169, 84,106,162,239,103, 74, 75, 75,203,179,179,179, 23,100,
-102,102, 30,209,179,252, 7,122,123,123, 67,171,213,194,200,200, 8,214,214,214,189, 40,138,154,111,100,100,244,122,113,113,241,
-188,140,140,140,155,205,200,175,109,245, 13,124,205,115, 1,219, 85, 71,173,128,170,231, 89, 62, 3,144, 4,192, 6,128, 61,244,
-232, 46, 52,235,208,119,120, 96, 80,191, 94, 65,221,188,232,117, 71,146,161, 99, 24,112,161, 3,151,195, 32, 79,199, 3, 69, 81,
-112,116,245,231, 88,221,187,221, 93,171, 86, 15,207, 79, 56,119, 92, 31,205,193,131, 6, 5,117,114,117,161, 55, 29, 75, 69, 97,
-198, 61, 93,246,163, 11,121, 20, 77,163,125,151,129,230,142,174, 62,156,142, 62,175,240,178,147,239,245, 83,119,236, 61,160, 32,
-241,210, 57,214, 54,176,180,196, 96,145,218,119, 86, 43,190,197,114, 51, 99,180,123,112,239, 14,157,150,165, 42,187,115,231, 14,
-204,204,204, 96,105,105, 9,153, 76,134,248,248,120,156, 59,119, 14,143, 31, 63, 6, 33, 4, 62, 62, 62,205,250,226,236,172, 44,
-228, 63, 47,105, 83, 77, 7,185, 28, 14,114, 57, 55,175,160, 16,215,238,220,117, 63,190,115, 64,167,108,122,198, 30,165, 82,249,
-226, 24,141,230,223,215,235, 98,105,105,169,251,240,195,217,249,211,191, 74,234, 48,190,191, 45,103,100, 15,107, 28,139, 82,112,
-194, 47,114,200,178,119, 58,231, 37, 38, 38,232,157,105, 7, 7,135,181,189,123,247,254,132,203,229,242,222,123,175,106,249,145,
- 57,115,230, 84,222,189,123,215, 35, 61, 61, 61,169,178,178,178,211,188,121,243,238, 30, 61,122,148,247,238,187,239, 82, 21, 21,
- 21, 55,121, 60, 30,137,140,140, 92,165, 80, 40,130,235, 53, 26, 28, 78,236,131, 7, 15,218,105, 69, 54, 48,151,210, 24,180, 44,
-166,170,197, 17, 18,228,101,103,224,126,226, 45, 88, 88, 88, 24,153,155,155, 63,202,201,201,169,204,206,206,254, 40, 41, 41,105,
-111, 99,233,228,241,120,247,239,222,189,107,103,101,101,133,210,210, 82,164,229,148, 97,247, 53, 10,229,149, 98, 0, 98,112, 32,
-133,212,220, 94,218,158,148,199,153,152,152,168, 85, 42,213,162, 39, 79,158,252,208,132,102,193,195,135, 15, 13,108,109,109,193,
-225,112,212,135, 14, 29,226,171, 84, 42, 16, 66,180,167, 78,157, 26, 87, 88, 88, 24,216,161, 67, 7,218,209,209,113,163,131,131,
-131, 82,161, 80, 76, 79, 78, 78,110,240, 65,195,103,230,116, 84,247, 9,190,248,117,225,179,180, 67, 0, 96,219,205,253,249,137,
- 96, 95, 85,159,224,210, 38,183,157,153,211,241,175, 28, 39,248,246,146, 37, 75,220, 77, 77, 77, 49,115,230, 76,172, 92,185, 18,
-203,151, 47,119,158, 57,115,230,123, 0, 54, 55, 67, 71,108,109,109,125,107,235,214,173,110, 61,123,246,196,169, 83,167,112,224,
-192, 1, 36, 37, 37,105,157,156,156,184,221,186,117,195,138, 21, 43, 48,104,208,160,233,179,103,207,238,147,153,153,233,171,167,
-233,152,182, 98,197,138,145,189,122,245,194,212,169, 83, 43, 47, 94,188, 56, 22,192,217,223,126,251,173,127,100,100,228,145, 31,
-127,252, 81, 28, 18, 18, 50,120,222,188,121,179, 0,108,111, 65,254, 71,245,238,221, 27, 0,208,171, 87, 47,108,216,176, 97, 80,
- 43, 13,150,192,204,204,236,228,190,125,251,124, 92, 93, 93,241,214, 91,111,249,142, 29, 59,246,100, 65, 65,193, 64, 0,122, 61,
- 55, 82, 46,151,127,190, 99,199,142,142, 98,177, 88,239, 47, 85,169, 84,166, 51,102,204, 88,223, 28,131,229,229,229,133,139, 23,
- 47, 98,192,128, 1,240,244,244,236, 56, 99,198,140,141,131, 6, 13,194,199, 31,127,124, 69,171,213,218,100,103,103,235,251,160,
-103, 71, 0, 53,207, 45,117, 0,224,140,170,238, 64, 0,232, 86,253,254,172,218,108,117,210,199, 96, 65,100,240,246,136, 97,195,
-164,255, 23,149, 3, 29,195,192,205, 86, 4,119, 7, 25,146,115, 42,144,156,145, 15, 30,165,134, 84, 44,132,119,224,107, 38,207,
-179,147,223,134, 62,195, 3,132,146,183, 71,141, 24,102,248,211,181, 28, 20,102,220, 39, 41,183, 14, 93,208, 84,148, 77, 7,128,
- 7,151,126,248,214,202, 68, 52,208,165, 75, 87, 78,121,208, 72,147,200, 99,223,188, 93, 0,176, 6,235,143,135, 52, 35,202,251,
-207,139, 96,213,144, 95, 8,165,153,181, 59,210,178, 98,171,254,207,207, 71,126,126, 62,218,183,111,143,208,208,208,151,142,109,
-233, 19,232,255, 8, 77,115, 19, 99,140,232,215,135,115, 47,254, 27,142,146, 81,182,137,230,223,182, 36, 18, 66, 40,138,162, 82,
-242, 52,198,121,197, 26,254,184,126,246,132,199,161, 49,190,159, 3,181,253,120, 10, 63, 79, 41, 49,230,112, 56, 52, 33,164,201,
- 59,121, 95, 95, 95,158,151,151,215, 39,187,118,237,226, 41, 20, 10, 24, 27, 27, 67,163,209, 32, 54, 54, 54, 83,161, 80, 36, 1,
- 64, 86, 86, 86,252,205,155, 55,179,117, 58,157,157,155,155, 27,102,204,152,129, 78,157, 58, 81,243,231,207, 95,120,240,224,193,
- 85,168,103,198, 98,118,118,118,200,210,165, 75,123,175,221, 16,106, 54,169, 27,133,178,114, 21, 74, 75, 75,145,156,112, 31,164,
- 84,133, 77,155,190,132, 88, 44,166, 0,240,115,115,115,249,193,193, 43,190, 55, 54, 54, 30, 22, 29, 29, 61,186, 65,131,158,157,
-189,102,197,138, 21, 1,155, 54,109, 50, 45, 45, 45,133,178,162, 2, 37, 74, 1,110,124, 89, 21,161,236, 54,239, 38,182,127,177,
-145,246,114, 52, 48, 43, 45, 45,197, 39,159,124,178, 85, 34,145,116,143,139,139,123,191, 33,205,140,140,140,184, 37, 75,150, 88,
-108,219,182, 77,216,169, 83,167,187,197,197,197, 40, 40, 40,160,143, 30, 61,186,218,209,209,209,116,235,214, 80, 74, 34,145, 0,
- 0,210,210,210,248,203,150, 45, 61,104,104,104,248,227,189,123,247,166, 54,116,121, 34,131,251, 86, 2, 68, 97, 99,211,190, 99,
-249, 53, 58,216,198,166,226, 74,100,112,102, 24, 64, 20,213,113, 72, 98,109,109, 61, 41,117,159,176, 87,101, 37,179, 37, 43, 43,
-229, 49,240,215, 62, 84,214,220,220,124,246,200,145, 35,177,126,253,122, 28, 63,126,124,158,169,169,233,151, 43, 87,174,132,141,
-141,205,135,153,153,153, 91,170, 43, 64,125,248, 98,243,230,205,110,110,110,110,152, 50,101,138,234,220,185,115, 75, 0, 28, 3,
-144,114,249,242,101,135,189,123,247, 14, 63,120,240,224,250,173, 91,183,138,182,109,219,214,241,141, 55,222,216,194, 48,204, 59,
- 77,137, 90, 89, 89,125, 60, 97,194, 4,108,220,184, 17, 23, 47, 94,124, 3,192,169,234, 93,167,175, 94,189, 58, 60, 36, 36,228,
-252,178,101,203,176,121,243,230,185,233,233,233,205, 53, 88,134,238,238,238,159, 13, 30, 60, 24,151, 47, 95, 70, 80, 80, 16,122,
-244,232, 49,239,218,181,107,161,168,234,218,106, 46,180,161,161,225,193, 61,123,246, 4,181,107,215, 14,107,214,172,193, 39,159,
-124,130, 93,187,118, 5,189,245,214, 91, 7,203,202,202, 70, 67,143, 89,190,134,134,134,134, 98,177, 24,235,215,175, 39,169,169,
-169, 77, 70, 79,229,114,185,201,103,159,125, 70, 25,233,215, 13,192,177,177,177, 49,178,178,178,234,109,109,109,141,173, 91,183,
-194,210,210, 18,243,230,205,131,153,153, 25,202,202,202, 48,122,244,104,222,245,235,215,199, 3, 8,213, 51,223,102, 0,106, 34,
- 94,238,213,230,170,164,250,255,235, 0,122, 85, 27,172,231, 0, 76,245, 58,145,132,120,153, 24,203,144,121, 55, 27, 92,104,225,
-230, 32,197,237,196, 50,168,117, 4, 18, 3, 67,148,149, 20,162, 75, 71, 11, 20,151,219, 1, 96,244, 90, 4,147,207,161,187, 10,
-132, 98,228, 20, 23, 33,235,225,249,124,181,174,114, 70,209,179,171,105, 0, 96,210, 62,104,198,253, 27,103,110,143, 30, 18,100,
-153, 91,224, 0, 66,152, 0,176,176, 52,231,199,223,212, 1, 12,243,251,223,126,237,136, 80, 13,106,117,235,110,184,255, 8,205,
-250,248, 35, 52,255, 14, 62,203,214,132, 91,100, 32,162,181,191,221,206,209,105,180, 58,252,122, 59, 75, 39, 17, 82, 90, 19,161,
-170,152, 97, 24,189, 26,196,152,152, 24,205,229,203,151,247, 45, 94,188, 24,155, 55,111,198,211,167, 79,193,227,241,224,234,234,
-106,101,103,103, 39,175,174,184,237, 61, 61, 61,205, 57, 28, 14, 18, 19, 19,113,224,192, 1, 4, 7, 7,147,232,232,232, 93, 13,
- 53, 20, 10,133, 34, 54, 59, 59,123,199,186, 85, 75, 10,121,149,153,144,232,114,161, 43,124, 10,158,174, 8,179,231, 45,198,179,
- 60, 29, 98,159,149, 32,246, 89, 9,178,148, 34,124,182,102, 19,199,217,217,121,184,173,173,237,160,134,210,154,153,153,121, 93,
-161, 80,132, 45, 95,190,188, 40, 47, 47,239, 69,249, 81,107, 25,168,181, 76,221,198, 9,235,214,173, 51,150,203,229,227,108,108,
-108,250, 54,164,153,155,155,155,147,153,153,153,184,120,241, 98,117,110,110, 46,138,139,139,113,230,204,153, 55,218,183,111,111,
- 58,127,241, 42,234, 89, 30,121,145,206, 34,198, 24, 27, 67,119,114, 58,116,232, 48, 81, 46,151, 55, 58,142,200,198,198,182,163,
-187,123,135,195,215,175, 95,159,218,177, 99,199,247,107,140, 85,141,145,114,114,114,154, 25, 29, 29, 61,205,199,199,227,176,149,
-149,117,167,191,184, 44,245, 27, 55,110, 92, 39,134, 97,112,248,240,225,187, 0, 54,255,244,211, 79,183, 42, 43, 43, 49,126,252,
-120, 39, 0,131,245,212,241,159, 56,113,226,251, 65, 65, 65,152, 59,119,174,250,220,185,115, 93, 1,124,137,170,217, 99, 4, 64,
- 10,128,208,200,200,200, 46,179,103,207,174, 12, 8, 8,192,212,169, 83,167,161,225, 49, 57, 53, 4, 78,152, 48,193,141, 97, 24,
-132,135,135,223,169,101,174,106,184,112,228,200,145,235, 42,149, 10,147, 38, 77,106, 15,160,127, 51,242,206, 23, 10,133,135, 87,
-175, 94,109,156,145,145,129,201,147, 39, 87,198,199,199, 35, 56, 56, 88,108,100,100,116, 10,128, 97,115, 79,166, 80, 40,252,238,
-155,111,190, 25,233,237,237,141, 89,179,102,169,190,254,250,235, 57,239,191,255,190,170,107,215,174,248,234,171,175, 70, 10, 4,
-130,102, 61, 2, 36, 59, 59,187, 48, 50, 50,210,172,169, 87, 86, 86, 86,182, 62,122,246,246,246,198,158,158,158,119,253,253,253,
-243, 58,119,238,220, 1, 0,238,223,191,159,123,248,240, 97, 98,102,102,134, 51,103,206,224,187,239,190, 67,207,158, 61, 33,149,
- 74,199, 55, 51, 10, 65,106,253, 93,223,254,186,199, 53, 14, 69,145,162,114, 45,184, 52, 13, 30,135, 32, 37,187, 2,106, 29, 1,
-159, 71,131,199, 1,184, 52,129,153,148, 7, 30,143, 3,125,111, 82,104,138, 66, 65,153, 6, 92, 14, 5,158,128, 79,209, 90,221,
-139, 16, 33,205,213,137,133, 34, 33,101,105,196, 7,159, 75,129,162,192,194,210,118, 17, 44, 0,208,233,126, 31,248,168, 47, 10,
-164, 82,169, 90,149,144, 63, 66,179, 62,254, 8,205,191,146,226,226, 98,110,100,100,164, 17,143,199, 51, 24,230,221, 51,255,243,
- 67, 9,230, 43,247, 63,134,128, 3,106,120,103, 90,113, 49,226, 28, 85, 80, 80, 96,226,236,236, 92,160,143, 94, 82, 82,210,244,
-176,176,176, 53, 52, 77, 7,232,116,186, 67,155, 55,111,198,246,237,219, 37, 51,103,206,140,215,233,116, 25, 46, 46, 46,246, 91,
-182,108, 17, 2, 64, 88, 88, 24,126,253,245,215, 81, 60, 30,239,102,106,106,106, 86, 99,186,119,238,220, 89, 86, 88, 88, 24,149,
-148,148, 20, 74, 81,148,177, 84, 42, 53,249,233,167,159, 40, 69,161, 10,203,194,158,190,152, 89,104, 32,228, 96,241,235, 22,120,
-243,205, 49,220, 39, 79,158,124,145,145,145,241,107, 67,154,177,177,177,243, 10, 11, 11, 35, 19, 18, 18, 54,243,205, 92,205, 68,
- 94,239, 73,251, 47,174,234,126,148,155, 10, 65, 87, 87,136, 69, 69, 69,200,203,203,195,180,105,211,140,215,174, 93,187, 48, 51,
- 51,243, 98, 67,154,113,113,113,215,139,138,138, 20, 9, 9, 9,221, 9, 33, 2, 35, 35,163,158,155, 55,111,166, 82,158,171,176,
-104,111, 34, 74, 42,170,210, 41, 21,241,176,106,130, 29,166, 78,157,202,125,246,236,217,231, 10,133,162, 87,253,230,202,198,217,
-221,221,253,240,254,253,251,221,183,108,217,242,252,201,147, 39,101,114,185,124,101,237, 99,146,147,147, 43,215,173, 91,151, 31,
- 22, 22,230, 58,121,242,228,195, 49, 49, 49, 99, 91,186,164, 70,107,145,201,100,235,103,204,152,129,131, 7, 15,162,160,160, 96,
- 75,117, 25,219,188,127,255,254,240,233,211,167, 35, 44, 44,108,125,110,110,238, 25, 61, 26,197, 33,227,199,143,199,233,211,167,
-113,254,252,249,207, 0, 60,104,224,184,132,203,151, 47, 47,252,249,231,159,183, 78,152, 48, 1,187,119,239, 30,140,170, 1,208,
- 13, 49,112,208,160, 65, 56,117,234, 20,242,243,243,191,170,239,128,194,194,194,175,127,249,229,151,238,131, 6, 13,194,186,117,
-235, 6, 2,184,160, 71,214,221,140,140,140,246,108,221,186,213,223,219,219, 27, 19, 39, 78,172, 80,171,213,131, 63,249,228,147,
-227, 7, 14, 28,144,238,219,183,207,239,189,247,222,187,145,147,147,243,110,117, 4,166,233,198,155,166, 67, 54,109,218,244, 78,
-223,190,125, 49,111,222, 60,237,175,191,254, 58, 2,192,217, 51,103,206, 36,126,250,233,167, 39, 55,109,218,196,217,184,113,227,
- 59, 31,125,244, 81, 46,195, 48, 75,254,138,235, 77, 81,212,198, 77,155, 54,185,123,120,120,160,162,162, 2, 79,159, 62, 69,118,
-118,246,254, 51,103,206,156,189,119,239,222,134,172,172,172,163, 86, 86, 86,211,231,205,155,103,231,239,239,239, 95, 86, 86,102,
-162,207,248,195, 90,145,169, 28, 0, 15, 81, 53,177,168,230,188,117, 67, 85,215, 32, 80, 53,163,176, 64,207,196,222, 77,120,150,
-209,222,196, 80,134, 2, 70,128,103, 25,121, 16, 27, 24,128, 38, 52,180,202, 2, 56, 59, 90,130, 33, 64,113, 94, 6,104,154,186,
-171,143,164, 70,199, 68, 39,167,101,219, 26, 27,136,224,220,117,168,217,157, 11,187,127,144,181,239,249, 30,151, 67,113,120, 2,
-195, 29, 19, 39, 76, 49,215,232, 8, 74, 11, 20,160, 56,244, 77,176,176,180,117, 4,171,110,191,127,221, 40,144, 88, 44, 70,101,
-101,243,150, 75,249, 35, 52,245,249,206,182,214,252, 43,209,104, 52,210,247,223,127,191, 87,122,122,186,204,213,213, 53,113,168,
-191,197,181, 93,115,218, 95,235, 38,123, 80,190,244, 53,234,154,189, 40,251,150, 80, 40, 76, 45, 40, 40, 16,132,133,133,249,106,
- 52, 26,137, 62,186, 89, 89, 89,169,153,153,153,135,143, 28, 57,242,195,137, 19, 39,208,169, 83, 39, 92,186,116, 73,154,144,144,
-224, 22, 17, 17, 97,224,236,236,140,163, 71,143,226,151, 95,126,217,169, 80, 40,126,110,202, 92,213,144,154,154,122, 38, 46, 46,
-174, 99,126,126,126, 71, 99, 99, 99,141,177,177, 49,234,206, 44, 44,171,212,161,176,184, 4,198,198,198,144, 72, 36, 78, 77,105,
- 38, 39, 39, 31,191,115,231, 78,123,152,186, 5,113,146,246, 23,125,253, 97, 39,124,253, 97, 39,172,126,171, 3,172, 77, 4, 40,
- 44, 44, 68,110,110, 46,114,115,115, 65, 8,129, 78,167,115,215, 67, 51, 53, 46, 46,238, 96, 70, 70,198, 57, 11, 11, 11,202,208,
-208, 16, 4, 64, 65,169, 26, 87, 55,248,227,234, 6,127, 20,148,170, 81, 82, 90, 6, 91, 91, 91, 72,165,210,122,187, 35, 76, 76,
- 76,164,132,144,189,223,127,255,189,155, 84, 42,229, 76,159, 62,221,248,218,181,107,189,174, 93,187,182,168,206,171,215,135, 31,
-126,104, 34,145, 72, 56,187,119,239,118,225,112, 56,123, 28, 29, 29,141,254,228,226,196, 1,240,193,244,233,211,253, 68, 34, 17,
-182,111,223,158, 4,224,199,234,125,135,191,254,250,235,120, 0,152, 51,103,142, 39,128,121,104,124, 38, 37,248,124,126, 87,119,
-119,119, 92,187,118, 13, 0,126,106,226,187,143, 68, 69, 69,193,217,217, 25, 34,145,200,191,137, 99,157,236,237,237, 17, 31, 31,
- 15, 0,177, 13,121,239,248,248,120,216,219,219,131,162, 40, 39, 61,242, 62,242,213, 87, 95,189, 27, 17, 17,225, 31, 24, 24,136,
-119,222,121, 71,117,227,198,141,161, 0, 46,197,198,198,246,155, 52,105, 82,153,139,139, 11, 34, 35, 35,221, 38, 77,154, 20, 69,
-211,244, 26, 61, 52,167,173, 90,181,106,241,168, 81,163,176,106,213, 42,114,232,208,161,137, 0,206, 86,239,251, 53, 60, 60,124,
-242,218,181,107,201,232,209,163,177,114,229,202,197, 0,102, 53, 38, 86, 94, 94, 94,164,211,233, 80, 94, 94,174,215, 29,162,190,
-199,183,111,223,126,136,135,135, 7,126,254,249,103, 8, 4, 2,252,246,219,111,160,105,250,100, 86, 86,214,217,232,232,104,239,
-204,204,204,213, 10,133,226, 72, 98, 98, 34,130,130,130,104,157, 78, 55, 90,207,242,244, 12,128,119,245,223,105,168, 26,143, 21,
- 8,160, 39,128,132,234, 72, 38, 80,245, 60,187,103,250, 8, 50,170,210,125,231, 79, 29, 41, 50, 49,228,195,220,196, 0, 86,230,
- 50,112, 52,101,128,170, 16, 29, 29,173, 16,224,110,141,103, 57, 42, 68,157, 59, 92, 88, 94, 90,174,215,242, 18, 58,117,217,158,
-243,103,126, 46, 50, 53,228,163, 93, 71, 15, 12,159, 56,215,199,205,187,219,111, 94,190,189,126, 93,182, 34,164,243,171,189,220,
-169, 7,105, 21,184,126,254, 88, 65,121, 73,241, 30,214, 50,176,180, 52,130, 85, 95, 0, 52,103,222,188,121,150,243,231,207,135,
- 76, 38, 67,126,126, 62, 52, 26,205,139,104,147, 80, 40,132,177,177, 49,242,243,243, 17, 30, 30,142,234,187,149,134,107,112,142,
- 64,177,230,171,109,246, 20,199, 64, 37, 20, 75,136,169,164,245,154, 0,160,210,112,115,190, 9, 63,106, 58,164,119, 15,174,131,
- 92,254,187,253, 45,209,252,135, 24,172,223,178,178,178,252, 58,117,234,148,229,232,232,168,172,168,168, 0, 81, 42, 75, 78,133,
-111,233, 96,111, 52,235, 41, 77,211, 68, 44, 22, 51,198,198,198,101, 79,159, 62,165,180, 90,109, 68,115,244, 9, 33, 51,103,206,
-156, 73, 95,190,124,121,226, 91,111,189,133,118,237,218, 33, 54, 54, 22, 97, 97, 97, 56,114,228,200, 94, 62,159, 63,167, 37,233,
- 78, 75, 75, 43,117,119,119,127, 41, 2, 82,119,102,161,166, 50, 23, 12,195,232, 61, 56,191, 32, 38,236, 49,199,220, 92,227,233,
-240,191,229, 68, 10, 10, 10,144,155,151,135,220,220, 92,228, 85,191, 19, 66,244, 14, 97, 82, 20, 85,162, 82,169,234,164,243,127,
-221,143,101,101,101, 80, 87,230, 64,167,211,213,171, 89, 80, 80, 80, 34,151,203,183,133,134,134,110, 90,189,122,181,229,230,205,
-155,159, 63,122,244,168,152,166,233,138, 58, 55, 49,162,142, 29, 59, 74, 55,110,220,104, 21, 26, 26,250,156, 97,152,109, 41, 41,
- 41, 69,127, 98, 81, 26,229,237,237,189,119,200,144, 33,210,247,223,127, 31,161,161,161, 80, 40, 20,139, 0,212,204,100,100,242,
-242,242, 62,253,234,171,175, 78, 44, 92,184, 16,106,181,122,227,169, 83,167, 86,198,196,196,204,172,101,194, 94,194,194,194,194,
-142,203,229, 34, 38, 38,166, 24,192,211,166, 60,125, 76, 76, 76, 54, 69, 81, 86,114,185,188, 67, 82, 82, 82,131, 7,154,154,154,
-118,148, 74,165,200,200,200, 64, 35, 13,115,114,102,102, 38, 17, 8, 4,148,141,141,141,115,245,177, 13, 98, 98, 98,242,233,247,
-223,127,207,141,136,136,192,138, 21, 43,210, 83, 82, 82, 38,213,138,162,197, 68, 71, 71, 7,245,235,215,239,192,194,133, 11, 93,
- 63,255,252,115, 42, 62, 62,126, 86, 76, 76,204,178,198, 52, 29, 29, 29,103, 78,155, 54, 13,219,182,109,195,142, 29, 59,102, 1,
- 56, 92,231,144, 3, 95,125,245,149,137,153,153,217,182, 25, 51,102, 96,207,158, 61,147,158, 61,123,246, 77, 67,122, 25, 25, 25,
- 11,199,141, 27,183,252,249,243,231, 33,250, 92, 80,125,142,151,203,229, 35,252,252,252,172, 8, 33, 8, 13, 13,205,218,182,109,
- 91,121,113,113,241,143, 10,133, 34,162, 78, 36,238,232,153, 51,103,230,189,255,254,251,136,136,136,216, 30, 25, 25, 73, 20, 10,
-197,247, 77, 36, 65,129,170,117,174,220,171, 35, 88,105,248,253, 64,118,215,234,247,116,125,242,148,159,112,241, 56,135, 39,186,
- 26,119,243,226,171, 78,158, 65, 60, 75, 19, 41,108,157,205, 97,106,200, 7, 1,112, 47, 69,137,235,151,206,106,114, 20,169, 81,
-250,204, 32,172,209,124,194, 23, 71, 73,204, 29, 95,109,239,209,139,235,228,236,130,129, 61, 59,155,152,201,120, 80,105, 8,126,
-139, 43,194,181,200,211,154,156,236,180, 8,118, 6,225,159, 23, 88,253, 47, 69,184,130,184, 92,238, 23,159,126,250,233,142,135,
- 15, 31,238, 72, 72, 72,216, 17, 19, 19,179, 99,205,154, 53, 59,130,131,131,119,248,249,249,237,160,105,250, 11, 84,141,157,168,
- 27, 17,243,250, 51, 52,251,244, 1,119,226, 96,172, 89, 53,147, 91, 30,182,198, 94,147,123,105, 44, 33,247,103,145, 85, 51, 65,
- 90,145,206,214,242,103,105,122,114,185,220, 51,142,142,142,215,247,237,219,119, 48, 38, 38,102,183,169,169,105,230,154, 53,107,
-190,159, 51,103, 78,184,181,181,245, 77, 30,143,119, 14, 64,231,150,166,211,202,202,234,141,183,222,122,139,156, 62,125,154,188,
-249,230,155,196,198,198,102,104,107,243,222,189,123,247,172,123,247,238,145,135,105,101,228,141,181,113,164,231,130, 91,164,231,
-130, 91,100,240,178,155,228,219, 3,103,201,138, 21,193,196,203,203,235, 92,115, 52,187,116,233,146,144,147,147, 67, 8, 33,228,
-249,243,231, 36, 62, 62,158, 92,190,124,153, 28, 61,122,148,236,216,177,131,132,132,132, 48,157, 59,119,222,219, 28,205, 30, 61,
-122, 60,127,242,228, 9,121,144, 90, 70, 70,173,190, 83,157,206,155,100,216,138,104, 18,126,242, 58, 89,181,106, 21,241,240,240,
- 56,212,152,166, 92, 46, 31,191, 96,193, 2,197,243,231,207, 53,254,254,254,145,117,247,251,250,250, 30,203,203,203,211, 44, 93,
-186, 52,219,198,198,102,202,159, 93,150,204,204,204,174,166,167,167,147,164,164, 36,242,201, 39,159, 16, 14,135, 83,111,227, 73,
-211,244,246,185,115,231,146,167, 79,159,146,204,204, 76, 34,151,203, 99, 27, 73,231, 48, 75, 75,203,219, 0, 70,233,153,158, 97,
-150,150,150, 55, 1,140,110, 44,239, 14, 14, 14, 15,210,211,211,137,135,135,199,243,198,196,156,157,157,211,210,211,211,137,139,
-139, 75,134, 30,231,243, 53, 43, 43,171,104, 0,107, 1,136, 26,185, 25,253,216,218,218,250, 42,128, 15,244,208, 28,233,234,234,
- 26, 3, 96,118, 19,249,126,207,201,201, 41, 14,192,107,127,246,117,247,244,244,188,150,145,145, 65,118,238,220, 73,228,114,249,
-194,198, 62,212,174, 93,187,159,143, 31, 63, 78, 20, 10, 5,241,241,241,137,209, 51,157, 92, 0,125, 80, 53, 14,206, 26, 85, 11,
-143,242, 0, 88, 1,232, 11,160, 31,170,158,192,161,119, 29, 98,230, 18,104,104,229, 53,228,132,199,171,179,159, 79, 93, 23, 65,
- 22,238, 77, 36,159,253,152, 68,230,134, 94, 33,254,195,230, 62,183,233,252,218, 9, 51,151, 64,195,230,106,202,189,135,158,236,
- 60,244,227,231,111,175, 59, 79,150,236,123, 74,130, 15, 36,145,143,182, 68,146,128, 17,115,243,237, 58, 15,255,201,210,107,160,
-228, 47,174,231,255, 43,154,245,254, 70,254,237, 70, 75, 0,224, 53,169, 84, 26,186, 98,197,138, 29, 55,110,220,216, 49,108,216,
-176, 29, 2,129, 32,180,186, 98, 16,180,224, 2,180,185,230,224, 0, 72,167,141,160,119,175,158,197, 85, 31,219,220, 73,179,106,
- 38, 72, 27,164,243,159, 82,160,123,241,120,188,107,222,222,222, 17, 82,169, 52,183, 93,187,118,151,121, 60,222, 77, 0,189, 91,
-155, 78, 43, 43, 43,243,119,222,121,135,121,246,236, 25,153, 50,101, 10,209,163,251,170, 73, 77,123,123,251,254,163, 71,143,214,
-164,101, 21,146,203,113,105,228,196,165, 7,100,255,137,107,100,199,129,179,100,203, 55,123,201,192,129, 3, 43,173,172,172, 28,
-155,163,233,224,224, 48,120,196,136, 17,133,121,121,121, 36, 62, 62,158, 92,186,116,233,133,185,250,230,155,111, 72,231,206,157,
-243,109,109,109,109,154,163,233,232,232, 56,114,210,164, 73, 26, 69,126, 25,185,241, 32,139,252,118, 35,145, 28,187,112,135, 28,
- 56,113,141,236, 61,240, 19,233,211,167, 79,133,185,185,185, 85, 83,154,114,185,124,220,216,177, 99,159,184,186,186,126, 91,143,
- 25,248,106,236,216,177, 41, 54, 54, 54,147,255,162,178, 52,216,214,214, 54,158,207,231,159, 4, 48,185,137,207,141,231,114,185,
-199,173,173,173,111, 1,120,253, 47, 40,243,195, 44, 45, 45,175, 3, 24,161,135, 97,187,222,128,193, 99, 27,197,170, 50, 57,172,
- 75,151, 46,113,214,214,214,155,208, 68,151,175,173,173,173, 72, 46,151,127,225,227,227,115,205,218,218,122,116, 51,211,105, 87,
-125, 99, 59,178,250, 21,132,170,181,175, 90,156,119, 51,151, 1,195,109,125, 70, 28,179,233,252, 90,138, 77,231, 97, 41,118,190,
- 35,143,153,185, 12, 24,222, 90, 77, 59,223,145, 63,219,116, 25,150,106,215,101,120,178,131,239,200, 99,230,157, 6, 12, 97,205,
- 16,107,176,254, 44, 12, 1,140,167,105,122, 59,128,241,104,122, 86,141,215, 95,161, 57,184, 15,108,223,127,147,115,106,209, 84,
- 94,110, 27,166,243,159, 82,160, 71,114,185,220,168,234,138,172,205,210,233,236,236,252,253,140, 25, 51,116, 14, 14, 14,219,218,
- 74,211,221,221,125,211,240,225,195,213,223,125,247, 29,249,229,151, 95,200,247,223,127, 79, 62,249,228, 19,210,183,111,223, 74,
- 87, 87,215,169, 45,209,244,246,246, 94,221,191,127,255,188,240,240,112,114,240,224, 65,178,125,251,118, 18, 18, 18,194,248,248,
-248,228,184,186,186, 14,107,137,166,151,151,215,119, 35, 71,142, 84,239,219,183,143, 92,184,112,129, 28, 60,120,144, 44, 91,182,
-140,244,233,211,167,194,197,197,229, 13,125, 53, 59,116,232,208,144,193,135,175,175, 47,143,173,112, 89, 77, 86,147,213,100, 13,
-214,127,215, 96,213,192,253, 3, 46,192, 63, 69,243, 63,251, 35,145,203,229,226,182,214,180,177,177,233,236,233,233,121,190, 91,
-183,110, 5,254,254,254, 57, 94, 94, 94, 71,229,114,185,125, 43,211,233,227,235,235,123,216,199,199,231,137,175,175,239,125,111,
-111,239,111,107,150,153,104, 69, 58,187,121,123,123, 95, 12, 8, 8, 40,244,247,247,207,246,240,240, 8,175, 19,185, 98,203, 18,
-171,201,106,178,154,172, 38,107,176,154,109, 64,234,242, 71, 60,198,227,159,162,249,159, 69,161, 80, 40,219, 90, 51, 51, 51,243,
- 78,102,102,230, 43,109,156,206, 88,133, 66, 49,166,141,211,121, 35, 51, 51,179, 47, 91, 10, 88, 88, 88, 88, 88,244,129,102, 79,
- 1, 11, 11, 11, 11, 11, 11, 11, 75,219, 66,161,225, 48, 95,115,158,148,221,146, 80,225, 61, 86,147,213,100, 53, 89, 77, 86,147,
-213,100, 53,255,115,154,117,181,235,142,101,173, 59,251,247, 59,176,180,201,133, 97, 53, 89, 77, 86,147,213,100, 53, 89, 77, 86,
-243,191,167,249,175,130,237, 34,100, 97, 97, 97, 97, 97, 97, 97, 97, 13, 22, 11, 11, 11, 11, 11, 11, 11, 11,107,176, 88, 88, 88,
- 88, 88, 88, 88, 88, 88,131,197,194,194,194,194,194,194,194,194,194, 26, 44, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22,150,255, 10,132, 61, 5, 44, 44, 44, 44, 44, 44, 44,172, 23,105, 29,108, 23, 33, 11, 11, 11, 11, 11, 11, 11, 11,107,
-176, 88, 88, 88, 88, 88, 88, 88, 88,254, 25, 6,139,237, 26,100, 97, 97, 97, 97, 97, 97,249, 43,249, 87,122,145, 62,213, 25,235,
-195, 94, 95, 22, 22, 22, 22, 22, 22, 22,214,139,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,180,
- 28,246, 73,227,172, 38,171,201,106,178,154,172, 38,171,201,106,254,231, 96,103, 17,178,176,176,176,176,176,176,176,176, 6,139,
-133,133,133,133,133,133,133,133, 53, 88, 44, 44, 44, 44, 44, 44, 44, 44,172,193, 98, 97, 97, 97, 97, 97, 97, 97, 97, 97, 13, 22,
- 11, 11, 11, 11, 11, 11, 11,203,223, 6, 10, 13,207, 4,184,215, 12,157,150,204, 38,184,199,106,178,154,172, 38,171,201,106,178,
-154,172,230,127, 78,179, 41,237,123, 96,249, 67,140, 23,171,201,106,178,154,172, 38,171,201,106,178,154,255, 61,205,127, 21, 92,
-246, 20,176,176,252,179, 33,135,193,129,101, 39, 39, 48,196, 6, 92,129, 2, 23,238, 62,165,130,193,180, 90,211,198,195, 17, 42,
-141, 21,196,162, 92,252,122, 39,169,181,154, 44, 44, 44, 44,172,193, 98, 97, 97,249,231, 32,119,115,133, 14,235,192,129, 28, 68,
-157,136,158, 30,235,128, 7,173, 11,177,155,185,185, 66,195,172, 1,151,182,131, 74,253, 24,189, 59,173, 7,226, 31,176, 39,155,
-133,133,133, 69, 63,254,146, 65,238,126,126,126,209,126,126,126,171,251,244,233, 35,100, 47, 1,203, 31, 69,159, 62,125,132,126,
-126,126,171,253,252,252,162,255,173,121, 36,119,189, 36,208,234,134,168, 52,140,237,153,168, 66,203,242, 10,157, 43,248,218,161,
-228,170,139, 97,171, 52,121,212,171, 21, 26,198,225,135,223,202,173,202, 42,180,238,160,209, 42,205, 26, 60, 61, 61,141,253,253,
-253,207,116,233,210,197,156, 45,161, 44, 44, 44,172,193,106, 99, 24,134,241,181,180,180,156,167, 84, 42, 83,186,118,237, 58,226,
-191,116,194,187,117,235, 22,213,189,123,247,236, 30, 61,122,100,247,232,209, 35,166,169,237,255, 70,228,114,185,171,151,151, 87,
-138,135,135,199,227,218,219, 45, 58,191, 30,232, 22, 52,121,133,153,199,200, 62,173,253,142,174, 93,187,142, 80, 42,149, 41,150,
-150,150,243, 24,134,241,253,215,158,204, 50,198, 10, 52,167,223,131,228,114, 73, 86,161,198, 42, 58,190, 92, 10,194,233, 11, 53,
-228,173,210,100, 72,255,184, 68,165,193,181,167, 22, 86,151,239, 85,202, 64,232,126, 32,148,117,107,147, 43, 16, 8,102, 17, 66,
- 6,242,120,188,185,108,245,251,159,199, 11,192, 8, 0,254,109,168,249,121,167, 78,157, 50, 0,124,196,158, 94,150,127,140,193,
-122,211, 9, 61, 39,180, 71,228, 88, 39,148,140,107,143,210, 73,237,113,229,141, 14,104,113, 67,120,244,232, 81,113, 88, 88,152,
-165,135,135, 71,120, 64, 64,192,149,174, 93,187,186,180, 68,199,207,207,239,140,159,159,223,152,186,219,186,118,237, 58,174,246,
- 54,127,127,255,251,254,254,254, 69,126,126,126, 79,245,209,245,245,245,125,226,235,235, 91,230,231,231,247,164, 78,195, 61,206,
-223,223,255, 76,157,239, 27, 83,119, 91,131, 39,156,166,237,142, 31, 63,110,149,141, 59, 80, 0, 0, 32, 0, 73, 68, 65, 84,121,
-242,228, 73, 75, 46,151,107, 85,119,251,137, 19, 39, 94,218,222,130,243, 49,221,207,207, 47,170, 78, 94,222,173,187,173, 9,115,
- 18,229,235,235,251,110, 29,221, 40, 63, 63,191,233,109, 97,174,122,247,238,125, 37, 54, 54,214, 65, 42,149, 26,215,222,103,109,
-102, 60, 40,234,196, 87,243,166,142,121,117,150,133,251, 40,239, 22, 26, 43,151,128,128,128, 43, 30, 30, 30,225, 97, 97, 97,150,
- 71,143, 30, 21,255, 91,127,188,228,161, 59, 31, 90,166, 55,195, 16,139, 7, 79, 43, 44,134,190,246, 38, 55,238,137,210, 66,163,
-213,153,130,226,244, 37, 23, 29,133, 45,210,212,104,130, 24, 66,172,206,199,241, 45,250, 14,255,144, 19,113,151,107,161,209,233,
-204,160, 65,159,150,104,214, 42,135, 60, 14,135, 51,111,198,140, 25, 52, 69, 81, 31,118,232,208, 65,240, 95,170,108, 3,188, 96,
-219,191, 43,231,166,175, 59,122,182,161,172,167, 68, 34,185, 13,192,245, 31,118, 58,124, 1, 72, 0,252, 2,192, 10,109, 51, 92,
-101,243,170, 85,171, 62,189,119,239,158, 77,251,246,237, 87, 2,224,176, 77, 60,203,223,222, 96,141,115, 66,176,149,181,237,217,
-165,155,247,247,254, 62, 50,201,240,235,227, 49, 6,243, 22,134,244,180, 54,177, 56, 53,169, 3,214, 55,242,209,123,141,220,201,
-226,233,211,167, 8, 13, 13, 21, 5, 7, 7, 7, 26, 25, 25,221, 9, 8, 8,216,226,238,238,110,208, 68,114, 94,210, 36,132,244,
-228,241,120,223, 7, 4, 4,236,169,169,176, 41,138,234, 41, 20, 10,191, 11, 8, 8,248,161,166, 27,178,107,215,174,237,111,222,
-188, 41,163, 40,202, 74,159,116, 6, 4, 4,200,163,163,163, 37, 64, 85, 36,160, 79,159, 62, 66,127,127,255, 48, 91, 91,219, 29,
- 64, 85, 5,217,161, 67, 7, 65, 64, 64,192, 30,123,123,251,157, 20, 69,245,212, 39,239, 52, 77,195,216,216, 24,251,247,239, 7,
-135,243,191,223, 63, 69, 81, 48, 54, 54,198,143, 63,254, 8,138,162,154,125, 62,221,221,221, 13,252,252,252,142,202,229,242, 45,
- 12,195,244, 0, 0, 47, 47, 47,137,191,191,255, 17, 91, 91,219,173, 53,219,244,209, 36,132,244,224,243,249, 91,252,253,253,143,
-120,121,121, 73, 0,128, 97,152, 30, 92, 46,119,179,159,159,223,209,230, 92, 35, 31, 31,159, 25,222,222,222,153,222,222,222,153,
-174,174,174,107,173,172,172, 46,110,219,182,205,172,118,222,107, 34, 87,217, 57,249, 5, 81,183,238,199,207,155,241,102, 95, 7,
-123,171, 73, 70,157, 71, 26,233,147,247,154,252, 7, 4, 4,108, 49, 50, 50,186, 19, 28, 28, 28, 24, 26, 26, 42,122,250,244, 41,
- 4, 2, 1, 90, 82, 62, 91,193,159,167,153, 79, 89,130, 34, 3,226, 83,148,162,118,206,126, 6,150,110,111,194,194,152, 43,188,
-246,176, 76, 10, 14, 94, 1, 79, 98,209, 50, 77,238, 43,247,147,148, 98,147,246, 67, 36,254,221,123,131, 50,112, 17, 94,140, 45,
-147,129, 75,183, 76,179,214,125, 90,143, 30, 61, 4, 3, 6, 12,128,141,141, 13,199,200,200,104,210,223,234,124,254,129,154, 1,
- 94,176,149,138, 4, 55, 54,173,250,216,207,198, 76,242,179,158, 38,171,169,116,122, 90, 90, 90, 70,124,245,213, 87, 93,165, 82,
-233, 37, 61, 77,214,223,225,124,250, 2,224, 3,184, 94,253,255, 3, 0, 65,173,212,220, 28, 28, 28, 60,119,241,226,197, 40, 41,
- 41,193,212,169, 83,101, 0, 54,233,171,105,104,104,232,236,237,237,253,131,135,135, 71,106,151, 46, 93, 84,110,110,110, 21,174,
-174,174,201,158,158,158,123,133, 66,161,211,191,189,124,254,141, 52, 27,190,249, 35, 68, 64, 8,233, 71, 8,121,141, 16,242, 10,
- 33, 36,160,250,111,255,234,215,107,132,144, 1,117,222,253,171, 63, 91,179,191, 91, 3, 26,175,213,253, 92,173,207,212,253,255,
-165,191,245, 49, 88,164,206,251, 11,198,180, 71,160,153,181,237,167,159, 31,187, 37,102, 18,226, 16,253, 78,127,196,127, 52, 10,
-226, 39,113, 88, 52,123,145, 88, 42, 53,153,253,102,123,244,107,201, 9,123,252,248, 49,194,195,195, 97,110,110, 78,237,218,181,
- 75, 56,102,204,152, 89, 50,153, 44,205,207,207,111,146,190, 26, 28, 14, 71,183,103,207, 30,195,145, 35, 71,142, 55, 53, 53,189,
-239,235,235,219,158,166,105,221,190,125,251, 12,199,141, 27, 55, 70,165, 82, 61,236,218,181,171, 75, 76, 76,140,238,214,173, 91,
-160,105,253,130,118,209,209,209,218,211,167, 79,191,136,138, 16, 66, 30,174, 95,191,126,252, 79, 63,253, 36, 53, 50, 50, 98,124,
-125,125,219,219,219,219,223,255,252,243,207, 39, 29, 57,114, 68, 42,147,201,244,154, 97, 69, 81, 20, 42, 42, 42, 32, 18,137, 94,
- 50, 82, 20, 69, 65,169, 84, 66, 40, 20,234,157,198, 90,145, 1, 79, 51, 51,179, 71,235,214,173, 27,121,236,216, 49,177, 84, 42,
-133,159,159,159,187,177,177,113,252,134, 13, 27, 70,253,252,243,207, 98,169, 84,170,183, 30,159,207,199,143, 63,254, 40,153, 56,
-113,226, 8,161, 80,248,200,207,207,207,157,207,231,227,192,129, 3,146, 73,147, 38, 13,147, 72, 36, 15,125,125,125, 61,245,209,
-210,104, 52,203,111,221,186, 37,191,120,241,162,220,209,209,113,206,215, 95,127,109,197,227,241, 0, 0, 58,157,238,165,200,213,
-164,209, 3,187,205, 93,254, 85,132,178,162, 82,181,102,209,180,190, 60, 29,186,235, 25,181,155, 36,147,201,210,198,140, 25, 51,
-107,215,174, 93, 66,115,115,115, 42, 60, 60, 28,143, 31, 63,254,215,222, 25,145,195,224,128,209,249, 2,232, 24,243, 88,105,222,
-165,247, 36, 46,114,126, 65,128,187, 33, 55, 50,166,212,146, 16,226, 8, 45, 9, 32, 23,251,112,155,165,201, 33, 93, 64, 49, 46,
-103, 99, 41,243,192, 1,147,184, 41, 41, 41,112,114,239,203, 57,113, 11, 86,132, 16, 39, 48,240,107,142,102,109,120, 60,222,138,
-177, 99,199, 26, 36, 39, 39, 35, 48, 48, 80, 34, 16, 8,150,183, 69, 20,143, 92,119,117, 36,145, 46,125,201, 85, 23,121, 75,211,
-246, 71, 71,174,100, 34,193,245, 3, 63, 28,180,241, 14,154, 78,237,248,216,209,212, 66,202,251,185,149,145, 44, 79, 75, 75,203,
- 11, 55,110,220, 48,123,245,213, 87, 17, 28, 28,108, 33,147,201,244, 53, 89,127,117,228,170,198, 92,137, 81,213, 61,152, 1,192,
-174, 21,154, 91,131,131,131,231, 46, 89,178, 4,215,175, 95,199,134, 13, 27, 48,100,200, 16,152,152,152, 52, 89,127,188,245,214,
- 91,146,192,192,192,232, 17, 35, 70,196,205,157, 59,119,210,137, 19, 39,236,247,236,217,195,127,251,237,183,133, 99,199,142,117,
-252,248,227,143,167, 12, 29, 58,244, 94, 64, 64,192,141, 55,223,124, 83,212, 66, 99, 64, 17, 66, 40, 54,158,163,223,233,106,200,
-139, 0,232,188,120,241,226, 0,138,162, 78, 44, 94,188,216, 15,128, 57, 69, 81, 39, 0, 88, 0,176,168,254, 91, 80,231,221,130,
- 16, 50,160,214,126,179,250, 52,106, 94,181, 63, 87,243,153,122,190,163,238,223,122, 69,176,250, 0,184, 84,247, 0, 46,193,170,
- 25,243, 86,139,158,237,253, 18,138, 31, 54,131,206,203, 0,167, 48, 11,149,151,126,129,230,242,113, 76,238,209, 67, 44,166,168,
- 53, 45, 57,147, 82,169, 20,124, 62, 31, 9, 9, 9,120,248,240, 33,134, 14, 29,202, 15, 13, 13, 53,246,244,244,252, 46, 48, 48,
- 48,206,207,207,175,179, 62,134,197,217,217, 25,227,199,143, 23,124,244,209, 71, 29, 68, 34, 81, 12, 33,132,231,228,228,132,113,
-227,198,241, 23, 46, 92,216, 78, 36, 18,221, 98, 24,134, 47,145, 72, 26,139, 14,253, 78, 87, 44, 22, 3, 0,207,197,197,229,118,
-120,120,184, 83,207,158, 61,185,103,207,158, 69,113,113, 49,215,213,213, 53,238,192,129, 3, 29, 3, 3, 3,185, 87,174, 92, 65,
- 89, 89, 25,209, 87,183,172,172, 12, 98,177,248,119, 6,171,172,172,236,119,198, 75, 15,115, 49,189, 99,199,142,183,194,195,195,
-237,130,130,130, 56, 17, 17, 17, 40, 41, 41,129,163,163,227,237,240,240,112,187,158, 61,123,114,162,162,162, 80, 82, 82,162,183,
-166, 64, 32,128,147,147, 19,198,142, 29,203, 91,176, 96,129, 29,143,199,187, 37, 16, 8,224,232,232,136,177, 99,199,242,231,207,
-159,111, 39, 16, 8,110,232,217,101,200, 1, 0,173, 86,139, 49, 99,198, 24,136,197, 98,164,165,165,129, 97, 24, 48, 76,149, 39,
- 85,228,230,223,189,122,235,222,163,121, 51,199,244, 41,171,172,172,252,245,226,237,135, 30, 46,142,118, 20, 69,218, 53,145,247,
-206,129,129,129,113,158,158,158,223,133,134,134, 26, 15, 29, 58,148,255,240,225, 67, 36, 36, 36,128,207,231,163, 57,166,242, 31,
-135,137,135, 25, 56, 24,152,146,169, 18, 10, 12,236,164,134,230,157,128,231,151,208,222, 70, 8, 16, 74,116,235, 81,185, 1,104,
- 50, 16,200, 51,107,150,166,142, 25,152,148,161, 18,170,197, 94,134, 54,182, 14,200,207,207,135,189,147, 27, 42, 97, 33,136,186,
- 87,102, 8,210, 76,205,106,186,116,233, 18,100,111,111,111,221,174, 93, 59,228,229,229,193,217,217, 25,134,134,134, 38,190,190,
-190, 3, 91, 92, 19, 95,116, 20,162, 8, 61,161,166, 54,129,162, 87,130,112,215,129,155,235, 75,162,125,121,127, 59,115,245,227,
- 65, 91, 51,185, 27,112,239, 29, 88,153, 10,176,107,113, 23, 83, 11,169,176,165, 38,203,211,202,202,234,194,141, 27, 55,204, 69,
- 34, 17,162,163,163,225,225,225,129, 47,191,252,210,194,196,196,228,239,108,178,106,155, 43, 83, 0, 74, 0, 12,128, 9, 45,140,
-134, 80, 0,182,175, 94,189,122,206,146, 37, 75,112,237,218, 53,216,218,218, 34, 39, 39, 7, 65, 65, 65, 41, 5, 5, 5,141,182,
- 75, 30, 30, 30,118, 9, 9, 9, 25, 31,127,252,177,111, 88, 88,152,216,192,192, 0,133,133,133,216,185,115, 39, 22, 47, 94, 12,
-138,162, 64, 8,193,238,221,187, 37,211,166, 77, 11, 72, 76, 76,204,112,116,116,212,107,248, 70,181,169, 18, 16, 66, 36, 0, 12,
- 0, 72, 8, 33,162,217,179,103, 11, 0, 8,171,205,165, 8, 0, 15, 44,117,169,215,139, 0, 48, 95,191,126,125, 8, 33,100,216,
-250,245,235, 67,106,181,157, 39, 26,105,111,107,155, 38, 0, 64, 93, 13, 66,200,176,218,239,181, 63, 75, 8, 25, 70, 8, 25, 86,
-251,243,141,125, 95, 99, 6,235, 98,117,198,234,218,201,206,214,237, 59,161,240,183,195, 16,115,168,151, 94,116,210, 93,216,139,
-184,208, 16,226,217,146,179,104,104,104,248,226, 69,211, 52, 20, 10, 5, 56, 28, 14,150, 47, 95, 46,154, 61,123,182, 55,159,207,
-191, 22, 20, 20,180,174, 41,195, 2, 0, 55,111,222,132,179,179, 51,181,100,201, 18, 89,159, 62, 85,119,177,119,238,220, 65,199,
-142, 29,169,181,107,215, 74,135, 15, 31, 78, 73, 36, 18,189,163, 67, 52, 77, 67, 44, 22,163,111,223,190,212,158, 61,123, 12,133,
- 66, 33, 78,158, 60,137,188,188, 60,188,250,234,171,220, 61,123,246, 24,138, 68, 34, 68, 70, 70,162,168,168, 72,111, 93,138,162,
- 80, 89, 89, 89,175,193,170, 47,178,213, 24, 61,122,244,216,101,109,109,189, 37, 44, 44, 76, 40, 22,139, 17, 17, 17,129,162,162,
- 34,140, 31, 63, 94,251,227,143, 63,138,100, 50, 25,162,162,162, 80, 84, 84,212,162, 82,126,243,230, 77,116,236,216,145, 90,186,
-116,169,184, 71,143, 30, 26, 0,136,141,141,133,139,139, 11,181,116,233, 82,177, 76, 38,219,220,179,103,207, 93,141,105, 48, 12,
- 3,133, 66,129,123,247,238, 33, 41, 41, 9,121,121,121,200,205,205, 69, 73, 73, 9,180, 90, 45, 0, 64, 82, 82,124,114,251,158,
-227,113, 6, 98,177,164,155,183,139,195,141,152, 7, 57, 6, 98,177,196,197,201,193, 21, 8,174,247,196, 6, 5, 5,173,227,243,
-249,215,102,207,158,237,189,124,249,114, 17,135,195,129, 66,161, 0, 77,211, 47,149,171,127,233, 45, 30, 5,158,202, 5,132,242,
-189,254,160,212, 52,104,208, 4, 62,114, 79, 3, 68, 3, 80, 92,244,235,102,199,253,249, 74,153, 21, 24,116, 6, 31,110,132,128,
-210, 75,147,171,118, 6, 40,191,179,209, 90,179, 94,131,102,241,211,211,211,193,231,243, 33, 20, 10,225,211,243, 13,238,129, 8,
-141, 53,128, 46,224,161,147, 62,154,181, 17, 10,133,159, 77,155, 54,205, 32, 35, 35,227,133,230,144, 33, 67, 12, 36, 18,201,138,
- 22,155, 43, 90,210, 3, 90, 50,247,126,146,210,113,237, 94,133,219,211, 52,165, 27, 8,230, 67,163,241,105,173,201,114,112,112,
-232,235,226,226,146,212,174, 93,187, 94,173, 52, 87,215,194,127, 60,104,107,106, 93,101,174,160, 43, 7, 56, 98, 88, 91,154, 96,
-215,138,190,166, 22, 50,113,115, 77,150,167,149,149,213,249,235,215,175,155,139, 68, 34,220,190,125, 27, 2,129, 0, 34,145, 8,
-222,222,222,216,177, 99,135,133,169,169,233,223,197,100,153, 0, 24, 4,224, 77, 0,111,212, 50, 87, 78, 0,250, 3, 24, 8,192,
- 26, 64, 36,128, 56, 61, 53,123,113, 56,156,147,157, 59,119,206,228,114,185, 15, 66, 66, 66, 62, 88,184,112, 33,182,110,221,138,
-190,125,251, 62, 93,180,104, 17,226,227,227,181,229,229,229, 35, 0, 52,218, 16,150,150,150,254,178,116,233, 82,163,215, 95,127,
-189,230,127, 92,185,114, 5,251,246,237,131,129,129, 65,109,179,132,225,195,135, 99,250,244,233, 38, 42,149,234,104, 99,154,150,
-150,150,175, 68, 68, 68,184, 0, 16, 84, 27,168, 26,131,101,112,238,220, 57, 99,145, 72,100, 26, 16, 16, 32,171,222, 46,121,253,
-245,215,205,184, 92,110, 47,176,160, 41, 47,210,144,193,169,107,128,234,219, 87,159,121,106,113,253,219,200,247, 53,102,176,250,
- 86, 23,244,223,161,126,158, 13, 33,116,144,112, 40,136,185, 84,213, 59,135,130,152, 98,192, 45,200, 6,213,194,224,167,161,161,
- 33,164, 82,233,239,140,150, 82,169, 68,105,105,169, 94, 70,163,102, 44,143,137,137,201,139, 70,187,166, 97, 53, 53, 53, 69,101,
-101, 37, 40,138,130,129,129, 1, 12, 12, 12,154, 21,193, 18,137,170, 34,194, 81, 81, 81,184,122,245, 42,184, 92, 46, 76, 77, 77,
- 1, 0,183,111,223,198,221,187,119, 33, 16, 8, 96,102,102,214, 44, 93,181, 90, 93,111, 23,161, 74,165,106, 86, 23, 33, 77,211,
-168,168,168, 32,183,111,223,198,189,123,247, 32, 20, 10, 97, 97, 97, 1,129, 64,128,180,180, 52, 60,122,244, 8, 2,129, 0, 22,
- 22, 22, 45,186, 62, 50,153, 12,133,133,133, 96, 24,166, 38,154, 7,153, 76,134,210,210, 82,208, 52,173, 87, 58, 25,134, 65, 70,
- 70, 6,242,242,242,144,154,154,138,220,220,220, 23, 38,171,166,139,176,165, 80, 20,133,210,210, 82, 40,149,202,223, 25,171,154,
-114,245,175,228,138,167, 17, 40,222,171,185,133, 26, 97,110,169,192,200,170,227, 0, 32,239, 52, 64,113, 0,158, 9,186,251,182,
- 71, 74,150,206, 32, 62, 85, 37,130, 6,131,112,193,213, 68, 47, 77, 14,111, 96, 78,145, 70,152, 92,104, 33,115,247,234,138,156,
-156, 28, 8,133, 66, 8,133, 66,248,117,127, 5, 73,153,140,228,193, 51,165, 4, 4,175,234,165, 89,141,143,143, 79, 7,177, 88,
-220,195,215,215,151,202,206,206,134, 80, 40,132, 72, 36, 66,143, 30, 61, 64,211,180,119,151, 46, 93,220,154, 85,193, 37,118, 16,
-128, 39,233, 14,144,185,143,158,149,219,252, 28,165,116, 29, 62,234, 13,211,205,135,114,220, 30, 61,171,112,130, 74,187, 0,101,
-234,174, 45, 53, 89,142,142,142,125, 12, 13, 13, 79,124,246,217,103, 78, 66,161,240,116,187,118,237,130, 90, 84,191, 9, 57,223,
-126, 54,119,130,173, 73,141,185,210,150, 1, 28, 49,192,145, 84,153, 44, 43,115,172,249,104,128,169,132,207,251, 63,125, 53,197,
- 98,241,129,237,219,183, 91,212,152, 43, 62,159, 15,145, 72,244,226,229,235,235,139,229,203,151, 91,152,154,154,238,255,139, 75,
-169, 41,170,198, 85,221, 1,112, 20,192,249, 90,230,202, 25,192,255, 85, 71,173, 98, 0,164,232,169, 25, 56,120,240,224,136,167,
- 79,159, 14,141,139,139,147,103,101,101,185,205,159, 63, 31, 91,182,108,193,194,133, 11,247, 19, 66, 92, 15, 31, 62,236,115,243,
-230, 77,111,125, 34, 98, 89, 89, 89, 19, 23, 45, 90,148,151,151,151, 7, 0,240,242,242, 66, 97, 97, 33, 22, 44, 88,128,185,115,
-231,214,148, 93, 0, 64, 78, 78, 14, 54,110,220,152,157,149,149, 53,181, 49, 77,157, 78,151,246,211, 79, 63,245, 80,169, 84, 14,
-213,134, 82, 8, 64,146,146,146, 98, 84, 86, 86, 38,227,112, 56, 82, 3, 3, 3,153, 80, 40, 52,152, 54,109, 26,255,193,131, 7,
-238, 90,173, 54,131,245, 84, 47,209,160, 23,169, 47,210,212,208,182,150, 30,175,175,201,106,174,193,138, 4,208,251,119, 6,134,
-194,157,212, 91,145, 48,245,240,125, 57,130,197,165, 32,145,202,144,148,145, 6, 62,168,251, 45, 72,224,239, 26, 67, 67, 67, 67,
- 40, 20, 10, 44, 90,180,168,252,135, 31,126,184,171, 82,169,122, 92,190,124,121,177, 62, 17, 44, 75, 75, 75,164,166,166,146, 47,
-190,248,162,248,244,233,211,218,154,109,105,105,105,100,217,178,101, 37, 7, 15, 30, 36,205,233, 34,172,137, 96, 69, 70, 70,146,
- 21, 43, 86, 20,101,102,102, 18, 83, 83, 83,152,153,153,225,220,185,115,218,197,139, 23, 23, 37, 38, 38, 18, 83, 83, 83,152,154,
-154, 54,203, 96,105,181, 90,136,197,226,151, 12, 10, 69, 81,208,104, 52,191,139,108, 53,198,213,171, 87,223, 41, 42, 42,250,120,
-193,130, 5,202,135, 15, 31, 18, 11, 11, 11, 88, 88, 88, 96,239,222,189,220, 41, 83,166, 40,239,220,185,243, 98, 91, 75, 48, 55,
- 55,199,227,199,143, 73, 72, 72,136,242,252,249,243, 60, 0,176,176,176, 64,124,124, 60, 89,181,106,149,178,176,176,240,227,171,
- 87,175,190,211, 68,133,131,164,164, 36, 20, 23, 23, 67,167,211,161,178,178, 18,185,185,185, 72, 79, 79,127, 97,176,148, 6,178,
-193, 31,190, 61,188, 75,153, 82, 89,126,227,110, 66,106, 55, 95, 15,203, 50,165,178, 60,225, 89,234, 99, 32,184,222,177,109,151,
- 47, 95, 94,172, 82,169,122,252,240,195, 15,119, 23, 45, 90, 84,174, 80, 40,234, 45, 79,132,144,127, 95,245, 67, 24,107, 16,210,
-235,202,221, 82,227,129,175,141, 19, 80,197, 55, 1, 77, 41,192, 51, 1,120,198,224,138,204, 48,228, 21, 31,206,158, 95,139,173,
- 65, 49,129, 16, 9,155, 30,223,194, 16, 43, 48, 76,208,185,219, 21, 38,189,134,206, 22, 60,127,254, 28, 52, 77,191, 48, 88, 18,
- 3, 3,188, 50,236, 45,122,247,175,149,214, 96, 72, 79,112, 56,122,143,153,225,243,249,159,190,253,246,219,252,130,130,130,151,
- 52,197, 98, 49, 70,141, 26, 37,148, 74,165,203,244,206,250, 67,119, 62,178,133,221,193,144,185,241,201, 74,155,159,174, 42, 93,
-231, 47,223, 45,246,236,220, 13, 51, 71, 90,138,215,134,229,120,196, 37,150, 59,129,214,205, 67,185,202,143,236,104,158,201,106,
-215,174, 93,144,129,129,193,201, 99,199,142, 73,250,245,235,135,249,243,231, 27, 8,133,194,211,142,142,142,189,155,123,153,202,
- 74,116, 31,174,218, 28,150,125,231,208, 32, 64, 91, 82,109,174,254,247,202, 41, 98,176,124,123, 68,145, 70, 71, 38,232,171,169,
- 84, 42,167,188,251,238,187,249, 71,143, 30,253,157,185, 18,137, 68,120,246,236, 25,214,174, 93,251,252,249,243,231, 83,255,226,
- 82,234, 3, 32, 22, 64, 69,117, 52, 66,130,170,153,130, 61, 0,156, 3,160, 3,144, 13, 64,161,175, 32,135,195, 89,248,245,215,
- 95,115,149, 74, 37,166, 79,159,142,180,180, 52,100,102,102, 98,233,210,165,207, 24,134,153, 82,173, 25, 7,224,145, 62,122,106,
-181, 58,190,160,160, 96,216,224,193,131, 11, 11, 10, 10,208,185,115,103, 12, 27, 54, 12,214,214,214,176,177,177,193,136, 17, 35,
-224,226,226,130,252,252,124, 76,152, 48,225,121,110,110,238, 32, 0,141,206, 66,207,207,207, 79, 60,116,232, 80,226, 7, 31,124,
-224,159,150,150,230, 5, 64,174,209,104, 76,149, 74,165, 84,171,213, 26,202,100, 50,179,174, 93,187, 90,204,156, 57,211,248,214,
-173, 91, 30,233,233,233,165,205, 48,152,255, 21,234,245, 34,173,184, 17, 63,217,154, 72, 85,125, 17, 48,125,169,105,225,169, 58,
-239,255, 43,132,192,242,125, 71,246, 85, 8, 28, 93, 96,228,214, 5, 18,145, 8, 98,161, 0, 98, 99, 83, 84, 48, 12,190,127,150,
- 85, 94, 70,200,178, 22, 36,254,165,136, 3,195, 48,216,177, 99, 71,197,154, 53,107, 10,179,178,178,102, 94,190,124,185,203,237,
-219,183,239,232, 99,132,138,139,139,113,248,240, 97,229,158, 61,123,158, 42,149, 74, 95, 62,159,175, 81,169, 84,216,191,127,127,
-197,150, 45, 91,146,203,203,203,253,121, 60,158,186, 57,221,111, 53, 99,176,120, 60,158,166,162,162,194, 55, 60, 60, 60,241,228,
-201,147, 74,153, 76, 6, 30,143,167, 41, 47, 47,247, 14, 11, 11,139, 15, 15, 15, 87,202,100,178,102, 25, 55,134, 97,234,141, 96,
-233,116, 58, 8,133,194,102,141,193,186,125,251,246, 78,181, 90,221,109,255,254,253,233,187,119,239,174,144,201,100, 0, 0,141,
- 70,227,191,111,223,190,244,111,191,253,182,178,185, 99,145, 84, 42, 21,116, 58, 29,194,194,194, 42, 15, 28, 56,144,174,213,106,
-253,107,182,237,222,189,187, 34, 44, 44, 44, 93,173, 86,119,187,125,251,246,206,166,180,116, 58,157,174,176,176, 16, 92, 46, 23,
- 79,159, 62,173, 20, 10,133,224,112, 56, 72, 72, 72,120, 97,176, 44,205, 77, 61,122,250,123,185,125,249,237,225, 72, 3,161, 80,
- 56,168,175,159,251,131,132,148,116, 66,168,228, 38,242,126,231,242,229,203, 93,178,178,178,102,174, 89,179,166,112,199,142, 29,
- 21, 12,195,188, 84,174,254,149, 6, 75, 13, 9, 40,136, 19,210, 42,165, 34,158,134, 66,214,255, 1,124,147,106,131, 85,245,178,
-177,181,195,173, 71,229, 82, 80, 16, 64,165,177,108, 82, 83, 67, 12, 64, 65,114, 47, 5, 82, 46, 95, 76,101,101,101,189,136, 52,
-213, 24, 34,167,142,238,136, 73, 40, 53, 4, 69,132,168,154, 90,175,119, 69,101,104,104,200, 85, 40, 20, 47,180, 94,104, 58, 57,
-113, 52, 26,205, 32,189,243,158,171,147,131, 97, 62,124,156, 90, 97,243,255,236,125,119,120, 20,213,254,254, 59, 51,219, 75, 26,
-233, 64, 8, 4, 82, 72, 8,189,247, 34, 85,186, 40, 69,148, 34,213,139,160, 32,162,136, 34, 29,164,138, 82,148,222, 4, 66,239,
- 32, 29, 41, 1, 66, 73, 2, 41,164,247,108,218,110,182,151,153,243,251, 35, 9, 2,166,108,128,251,189,247,231,157,247,121,246,
-201,206,236,204,155,211,230,156,119, 62,159,207, 57,231,232,159,134,128, 47,190,219, 38,147, 49,133, 64,242, 58, 52, 10,240,194,
-204, 49, 77,197,115,183,168, 26,221,141,214,215, 7, 69, 38,163,145,214,238,183,139,186,117,235,118,148,203,229,103,142, 30, 61,
- 42, 87, 40, 20, 72, 72, 72, 64,147, 38, 77,176,112,225, 66,185, 92, 46, 63, 93,167, 78,157,174,213,169,166, 59,177, 72,209, 22,
-179,237,102,111, 78,203,126,148,196,150, 8, 43,186, 68, 92,169,212, 4,159,204, 59, 81, 84,168, 49,190,119, 59,210,118,169, 26,
-180, 15,212,106,117,175,121,243,230,229,231,229,229,189, 36,174, 82, 82, 82,202,132, 64, 87, 0, 81,255,225, 86,170, 64, 73,240,
-122, 16,128, 6, 0,154, 2,176, 1, 40, 46, 21, 66,213, 70, 72, 72, 72,115, 95, 95, 95,108,220,184, 17, 91,182,108, 41, 92,189,
-122, 53, 8, 33, 8, 8, 8,112,124, 93,206,220,220,220,240,152,152,152,222, 77,155, 54,125,178,126,253,250,116,111,111,111,110,
-194,132, 9, 24, 63,126, 60,220,221,221,217,117,235,214,165,118,234,212, 41,242,217,179,103,239,232,245,250,199,246, 52,247,188,
-188,188,155, 91,183,110, 13,239,209,163,135,195,216,177, 99, 61,183,108,217,226,245,244,233,211, 58,122,189,190, 86,110,110,174,
-226,218,181,107,146,157, 59,119,122, 69, 71, 71, 39, 25,141,198,112,148, 31,208,253,191,138, 10,181, 8, 0, 85,169,208, 49,191,
-242, 87, 85,197,111,246,222, 91,238,119, 59,174,171, 16, 85,206,184, 57,152,136,155, 31,214, 47, 90,177,112,219,230, 47, 71, 55,
-110, 40,171, 91, 47, 24,172,182, 8,143,179,179,177, 51, 75,173,183, 18,242,115, 88, 34, 46,191,174,192, 98, 24, 6,231,206,157,
- 99,247,238,221,107, 33,132,252,170,209,104,190,125,242,228,137,206, 94, 30,142,227,152,113,227,198,105, 11, 11, 11, 15,103,101,
-101, 77, 78, 72, 72, 48,119,236,216,145, 25, 53,106,148,182,160,160,224, 56, 69, 81, 19,238,223,191,111,234,208,161, 67,181, 6,
- 91,138,162, 32, 18,137, 64, 81, 20,238,221,187,151, 20, 28, 28,220,232,246,237,219,191,196,198,198,126, 64, 8, 97, 34, 34, 34,
-210,154, 55,111,222,228,230,205,155,235,159, 62,125, 58,146,227, 56,198, 94,222, 50,235,216,139, 66,138,166,233,231,162,142,170,
-166,207, 53, 34, 34, 34, 42, 56, 56, 56, 56, 60, 60,124,199,196,137, 19,123, 3,144,223,187,119,239, 73,104,104,104,195,219,183,
-111,239,248,248,227,143,251,148,190, 65,218, 55,126, 91, 44, 24, 60,120,176, 94,173, 86,159, 45, 46, 46, 30, 19, 25, 25,169,111,
-222,188,121,217,185,115, 69, 69, 69, 99,170, 81, 71, 11,126,250,233,167,239, 74,235,106,199,154, 53,107, 62,153, 53,107,150,123,
- 70, 70,198,115,129,149,155, 87,112,169,253,187,211,216,252, 34,181,121,219,154,217,195,100, 82,137,248,219,101,219,174, 88,153,
-231,211,184,171, 18,153,123,130,131,131,143,133,135,135, 47,186,123,247,238,196, 81,163, 70,137,122,247,238,205,136,197,226,127,
-166,192, 18,179, 26, 16, 58,115, 88,119, 23,201,186,159,183,138,198, 14,172, 47, 13,109,232, 91, 34,174, 68, 46,184, 27, 93,132,
-239,126, 60,200, 45,159,226,158, 8, 14,105, 96, 17, 83, 37,167, 82,160,129,209,154,251, 73,111,145,100,233,175, 51,252, 58,244,
-255, 82, 18, 28,218,250,185, 16,122, 26,117, 15,107, 22, 79,227,150, 79,174,145, 8,142,202,132,205, 62, 43, 1, 0,216,108,182,
- 97,203,150, 45, 59, 59,118,236, 88, 69,163, 70,141,158,115, 38, 37, 37, 97,249,242,229, 6,147,201,244,158,125,125, 6, 40, 92,
- 23, 52, 99, 89,214, 99,207,249,124,255,207, 63,155, 44,151,209, 5, 64,226,202, 18,241, 34,116, 66,179, 80, 55,124,247,153,151,
-112,230,210, 19, 33, 55,126,241,211,194, 42, 10, 6,144,105, 15,191, 64, 32, 56,181,100,201, 18,185, 76, 38, 67, 92, 92, 28,100,
- 50, 25,164, 82, 41, 90,180,104,129,181,107,215,202, 63,253,244,211, 51, 93,186,116, 81, 94,189,122,213, 86, 29,145,213, 38,144,
-109, 55,123,195,179, 91, 43,166, 59,123, 53, 9,114, 67, 94, 49,240,201,247, 39, 11, 11, 52,134,247,171, 41,174,158,139,172,162,
-162,162, 94, 51,102,204, 56,191,125,251,118,215,224,224, 96,164,165,165, 97,196,136, 17,249, 42,149,170,219,127,129,184, 2, 0,
- 29,128, 90, 0, 98, 81, 18,139, 20,143,146,184,164,215,158,229, 25, 29, 29, 29,145,146,146,226, 61,126,252,120,104, 52, 26,151,
-225,195,135, 35, 33, 33, 1,177,177,177, 15,222, 36,161, 70,163,241,110,122,122,122,227,207, 63,255,124,244,236,217,179, 59, 56,
- 56, 56,212, 35,132, 16,141, 70,147,200,178,236, 13, 0,123,129,106,237,195, 73, 0,196, 63,123,246, 44,241,217,179,103,158, 59,
-118,236,112, 46, 45, 3,160, 36,176, 95, 93,106,189, 99,193,163, 58, 99,242,221,255,196,189,255, 39, 24, 86, 15, 29,198,214,167,
-174,142,242, 67,241, 72, 63,104,199, 54,160,236, 89,104,180,220,221,182,155, 55,111, 78,108, 54, 27, 57,127,254, 60,233,219,183,
-175,174, 99,199,142,213, 89,104,244, 37,206,174, 93,187,254,109,161,209,174, 93,187,158,109,221,186,245, 75, 11,141,118,233,210,
- 37,170, 75,151, 46,234,206,157, 59, 39,216,147,206,206,157, 59, 63,237,208,161,131,174,115,231,206, 47, 13, 36,173, 90,181, 26,
-212,189,123,247,151, 76,142,173, 91,183, 30,248,234,185,138,242,254,206, 59,239,164,197,198,198,146,212,212, 84,210,175, 95,191,
-231, 29,127,143, 30, 61,210, 30, 62,124, 72, 98, 99, 99, 73,159, 62,125, 50,171, 83,158, 47,162,101,203,150, 19, 58,117,234,116,
-243,149, 52,127,242,234,185,202, 56, 59,117,234,116,179, 85,171, 86,159,188,122,174, 26, 11,141, 86,152, 78,111,111,239,192,102,
-205,154,229,174, 89,179,134,248,249,249,229,190,248, 91,163,174,227,230, 21,105,180,154, 89, 11, 54, 30, 40,103,161, 81,187,118,
-110,111,209,162, 69, 64,199,142, 29,111,244,237,219, 87,119,254,252,121, 98,179,217, 72,243,230,205,201,235,150,231,107,224,223,
-206, 73,158, 4,139,200,159,193, 29,200,181,224, 83, 79,119,249, 62, 25,211, 75, 97,186,191,183, 15, 33, 79,191, 36,183, 15,142,
- 39,237,130,197,236,159,191,248,196,146,107, 13,207,144,235,129,157,201,153,114, 23,244,252, 59,231,181, 6,157,200,181,134,103,
-162,119,248, 62, 25,220,217,221,188,119,215,102, 18, 31, 31, 79,142, 31,217, 75,218, 6,203, 75, 57,131,207,147,107,193,221,236,
-225,124,229,153,239,208,174, 93, 59,237,129, 3, 7, 72, 92, 92, 28,185,112,225, 2,105,223,190,189,190, 89,179,102,221,236,205,
- 59, 33,160,200,213,144,193,182,203, 65, 55,190, 30,161, 44,250,164,183,212, 52,162,155,216, 60,168,157,200,210,171,185,200,214,
- 33, 88,192, 54,241,163,185, 96, 31,144, 94, 45,100, 38,114, 45,232, 58,185, 17,220,219,222,116, 6, 4, 4,164,214,173, 91,151,
- 84,244, 9, 12, 12, 84,149, 77,160,169,110,189,183, 9,132,239, 59,173, 36, 89, 23,127,237, 70, 6,116,118,200,111, 27, 42,232,
-254, 22,218, 82, 51, 55, 55,183,188,237,219,183, 19, 79, 79, 79, 21,128, 70,255, 13,237,179, 20, 53, 0, 12,194, 95,211,216,149,
- 0,186, 1,240,123, 3,206,246,189,122,245,178, 70, 68, 68,144,132,132, 4,114,246,236, 89,210,161, 67, 7, 27, 74, 98,118,240,
- 95,148,119,158,147, 71,133,102,184,183, 93, 1,145,229, 9,172,222,189,123, 27,174, 94,189,170, 53,155,205,147,238,223,191,127,
-252, 77, 57,255, 29,233,252,119,112,118,235,214,237, 38, 77,211,126,165, 83,128, 51, 47, 94,188,216,188, 84, 20,222,100, 24,198,
-175,212,186,151,121,233,210,165,230,255,180,188,191, 40,178,104,154, 62, 7,192,148,145,145,241,124,182,147,123,200,192,118, 53,
- 92,156,186, 21, 21,169, 31,228, 68, 29, 63,243, 38,233,108,209,162,197, 64,177, 88,188,185, 75,151, 46,202,115,231,206,201, 34,
- 34, 34,168,127, 82,121,146, 51,245,197,112, 16,183, 4,139, 57,145, 9,250,122,223,110,205,171,223,191, 87,123,225,142,131,215,
-184, 21, 83, 61,158,181, 15, 81, 36,129,226,150,131, 53,133, 83, 93, 83, 76,118,115,202,169,214,128,112,206,195,103,122,223, 89,
- 27, 10,253,223, 25,240, 9,115, 34,108, 51,247,227, 84,215,103,237, 67,148,169, 0,150,131,211,223,178,151,243, 85,145, 37,145,
- 72,206,140, 28, 57, 82,185,111,223, 62,131,209,104,236,255,224,193,131,203,213,201, 59,185, 25, 84, 7, 54,106, 49, 64,124,170,
- 46, 54, 58, 30, 54,110, 33,213, 61, 38,245,191,161,222,219, 4,194, 87,225, 32, 57,169, 55,217,102,216,105,185,178, 39,157,205,
- 92, 92, 92,118, 23, 22, 22, 14,183,211,114,245,127,153,119,119,148,172,115, 37, 40, 29,107,162, 80, 69, 12,147, 29,156, 29, 25,
-134,249,170,126,253,250, 77, 18, 18, 18, 34, 89,150,253, 17, 37,179,206,254,241, 99,199,255, 8, 39, 47,176,222,180, 2, 58,118,
-236,120,159,101,217,179, 34,145,104,241,213,171, 87, 77,124,227,227, 57,255, 29,156, 93,186,116,145, 88, 44,150,185, 12,195,244,
-185,113,227, 70,139,127, 90,222, 95, 20, 89,247, 99,117,126, 75,247, 20,248,126, 49,220, 37,213, 14,113, 85, 57,103,169,200, 10,
-143,209,215, 93,190,183,216,119,230,112,101,170, 29,226,202,174,188, 55,111,222,188,131, 84, 42,221,105, 48, 24, 38,216, 33,174,
-254, 46,176,158, 4,139, 80,104,173, 5, 27, 19, 10, 26, 21, 47,211,207, 17, 61,132, 76, 36,178,144, 67,189,255,196,194, 63, 71,
- 60, 39,207,201, 11,172,255,107,252, 71, 86, 61,174, 96,176,227,193,227,173,162, 84,188,207, 43,253,252,243,222,142,250, 38,152,
-201,153,250,247,224, 32, 94,214, 34, 80, 54,237,240, 98,153, 30, 28,149, 14,138, 91, 91,133,184,170,138, 51, 28,114,235,178,214,
-129,178, 25, 71, 22,203,244, 0,178, 65,176,166, 10,113,101, 23, 34, 34, 34,254,132,253,110,162,191,167, 47,248,137, 5, 64, 18,
- 33, 72,198, 15,149,188, 32,126, 15, 66, 81,124,240, 48, 15, 30, 60,254,199, 4, 22, 15, 30, 60,222,162,200,122, 18,124, 23,249,
-204, 44,176,240,131,196,150,130, 34, 91, 54,213, 55,197,252,134,156,119,144, 79, 77, 7,135, 64,136,109,207, 80,100,126, 35,206,
-183,158,239, 18,241, 84,177,128,154,207,183, 13, 30, 60,120,240, 2,139, 7, 15, 30,111, 34, 54, 74,172, 58,233,165,159,255, 90,
- 78, 30, 60,120,240,248,159,234,155, 81,241, 76,128,234,248, 86, 95,103, 54, 65, 36,207,201,115,242,156, 60, 39,207,201,115,242,
-156,255,115,156, 85,113,243,177, 93,255, 38,225,197,115,242,156, 60, 39,207,201,115,242,156, 60,231,255, 30,231, 63, 10, 52, 95,
- 4, 60,120,240,224,193,131, 7, 15, 30,111, 23,255,209, 24, 44,153,107,128, 55, 4,116, 19,138, 35, 13, 1,128,208,212, 83,216,
-184, 71,134,252,184,172, 55, 38,247, 8,149, 43,133,204, 94,173,149, 29,133,220, 72,253, 91, 74,114, 71, 0,190, 40,217, 59,234,
- 6,223,124,120,240,224,193,131, 7, 15, 30,213, 18, 88, 1,237, 6, 95, 87,200, 20,254, 0,192, 17, 2,150, 3, 52,133,185,183,
- 82, 31,255, 49, 4, 0,188, 67,186, 31, 17, 43,220,218,113, 28, 1, 71, 8,108, 28,129,205,100,136,207,123,114,218,174,157,231,
- 21,238,129, 67,186,191,211, 99,104,255,254,239, 6, 53, 14,109,220, 0, 0, 30, 71, 62,126,118,242,228,169,152, 75,127, 80,135,
-117,170,216, 35,111,146, 49,165, 80, 56,175, 85,235, 54,189,239,222,189, 51, 87, 11,124,243,150,202, 75, 68,110,244,219, 69,117,
- 60,221,131,111, 58, 60,120,240,224,193,131, 7,143,106, 11, 44,133, 76,225,127,233,216, 86,143, 35,215,211, 0, 0,239,180,240,
-194, 15,171,182, 15,222,242,248,143, 24, 0,104,215,185,111,224,183,159,143,193,205, 40, 21, 8, 33,104,230, 95, 3,131, 63,252,
-212,174,127, 42,245, 12,110, 53,108,216,123,163,102,205,154, 57, 48, 62, 62, 62,121,223,190,125,215, 1,160, 83,231,206,254, 75,
-150, 44,249, 96,165, 75, 13,201,254,176, 67, 25,198,156, 39,175,181,127,144,194,179,190, 91,195, 32,255, 79,246,254,246,163,160,
-123,191, 17,227, 83,173,154, 53,186,156,132,188,215,225, 18,215, 14,241,115, 18,138,126,160,104, 90, 96,210, 22,120, 0,128,139,
- 79,179,147, 18, 7, 15, 86, 42,149, 61,214, 25, 12, 59,115,159,156,221, 2,126,195, 78, 30, 60,120,240,224,193,131, 71, 85, 2,
- 11, 0,148, 82, 1, 98,146, 74,188,117,206,114, 96,226,199,239, 33, 39, 39, 59,208, 98,227, 48,122,248, 16, 68,196,100, 33, 54,
- 73, 5, 66,128,192,218,118,239, 37, 12, 6, 92,203,113,227,199,117, 57,119,254,124,248,188,111,231,237,162, 40,220, 2,128,205,
-191,254,214,238,187,239,191,155, 48,250,227,209, 61,195,194,194,162, 0,188,150,192,162, 69,206,107,150, 47,254, 65,153,145,103,
- 52,126, 54,243, 75,102,214,231,211, 87, 2,248,248,117,196, 85,176, 79,237,197,215,207,135,201,229,114, 57,182,108,217, 34, 1,
-142, 97,254,172,113,210,119,251,247, 7, 11,166,253,143,191,236,107,114, 94, 44, 30,175,215,235,135,228,199,253,145,197, 55, 41,
- 30, 60,120,240,224,193,131, 71,165, 2,139,229, 8,158, 38,102,151,136, 22, 70,128,119, 59, 56, 97,229,162,175, 96, 48,177,120,
-152,168,198,209, 63,211, 96,210, 21,129, 16,160, 67,168, 71,121, 54,156,151,166, 90,174,252, 76,214,156, 17, 11,135,223,138, 85,
-212,173,225,226,226, 18, 23,190, 75,247,221,135, 57,193, 2,155,229,254,162, 19,173, 18, 21, 14,226,246, 7,195,194, 66, 6,244,
-239, 47,118,116,116,154, 45,114,238, 89,155, 51, 90,102,170, 83,174,170, 43,226,124, 21, 10,207,144, 46, 3,222,237,247,174,151,
-151, 39, 59,114,201,173,167, 63, 79,107, 81, 39, 32,176, 97,215, 88,171,190,139, 46, 39,246,106, 5,183, 69,150, 39,174, 26,120,
-123, 46,190,122, 54, 76,110, 52, 26,145,152,152,136,252,252,252,146, 31, 41, 10, 52,205,160,150,183, 55,214, 47,157, 41,223,119,
-164,113,139,121, 75, 55, 30, 3,208, 26,127,149,194,191, 99,154, 41,207,201,115,242,156, 60, 39,207,201,115,254, 83, 57,255, 81,
- 40,155, 69, 88,174,123,235, 89, 90, 62, 98, 18,179,208,188, 97, 45, 52,168,235,133,240,184, 66,236,189,148,134,109,231,147,113,
-233,145, 10,156,208, 1,217,197, 20,226, 83,114, 16,155,156, 87,165,143,140, 17, 11,135,207, 88,161,158, 21,226,167,105,123,229,
-192, 52,212, 84,198,133,124,181,170,104, 26, 35, 22, 14,247,240,114,222, 55,107,250,228, 15, 29,228, 50,177,217,100, 70,189,186,
- 62,210, 41, 19,198,141, 21, 41, 21,251,236,205,140,155, 91,176, 66, 44, 83,236, 90,252,221, 76,233,234, 35,113,169, 58, 51, 90,
-120,157,249, 0, 0, 32, 0, 73, 68, 65, 84,209,133,221,204, 76,152, 53,231, 59, 13, 35,148,253,234,230, 22,172,176,135, 71, 92,
- 59,196,207,215,213,117,241,141,115, 97,114,139,197,132,204,204, 76,152,205,102,216,108,182,231,215, 16, 0,197, 6, 27, 18,179,
- 12,232,210,185, 3,211,188, 89,163,134,238, 13,251, 78,226,155, 20, 15, 30, 60,120,240,224,241, 90,248, 71,133,218, 84,184, 76,
-131,206,160,139,255,104,210,172, 92,127,135, 44,243,144,110,193, 0, 1, 84, 89,201,136, 14, 63,135,184,251,231, 81,172, 74, 5,
- 33, 64,221,186,117, 32, 50, 36,154, 55,111,218,144,203,217,140,241, 21,241, 13,236,233, 93, 59, 62, 67, 65,175,152, 85,231, 86,
- 92,108,150,219,212, 89,219, 17, 23,155,229,182, 98, 86,157, 91,241, 25, 10, 90, 46, 98,219,127, 60, 98, 16, 53,168,127, 31,124,
-245,213, 44, 12,234,223, 7,179, 38,127, 64, 73,197,194,182,246,102,198, 40,150, 46,155, 51,111,129, 67,118,145,197,124, 39, 86,
- 99, 82,202,229,146, 63,159,234,244, 38, 34,179, 12, 28, 62, 81,101, 18, 9, 22,216, 35,174,188, 29, 29, 23,223,252,227,144,156,
- 16,130,244,244,116, 88, 44, 22, 88,173, 86, 88,173,214,231,215, 21,105,173, 72, 85, 25,144,146,171, 71,100,178, 6,125,251,244,
-145, 11,132,226, 15,249,231,131, 7, 15, 30, 60,120,240,224, 81,161,192,138,187,117,180, 83,196,197,221,158,121, 57, 57,106,133,
- 68, 0, 1, 77, 35, 55, 61, 1, 59, 87, 77, 71,216,207, 51, 81,148, 21, 15, 66, 0,153,136,129, 73,155,175,206,126, 24,230,153,
- 95,201, 12, 66, 10,214,158,191,236, 78,170,151,156, 69,156,246,158,213, 10, 1, 96,239, 89,173, 48, 57,139, 56,253,178, 59,169,
-158,152,168,192,177, 44,250, 15,122, 15,187,118,108, 65,187,238,131, 16,118, 45, 21,122,131,197,174,253,207, 36, 30, 1,117, 61,
-188,188,222,155, 49,186,135, 67,235, 64, 23,101,128,143, 51,195, 8, 69, 54,177, 80,194,157,184,167,206,232,221,127, 8, 45, 87,
- 56,246,145,120, 4,212,173,140,199, 73, 40,250,225,207,243,135,228, 12,195, 32, 53, 53, 21, 22,139, 5,102,179, 25, 38,147,233,
-185, 5, 75,163,183, 34, 35,223,128, 52,149, 30,169, 42, 61,158,164,106, 32, 86,184,192,106,181,242, 11,175,241,224,193,131, 7,
- 15, 30, 60,236, 91,104, 52, 51,183, 0, 53, 28, 24,184,215,172,135, 81,211, 87, 2, 0, 88,206, 6,130,146,229, 25,236,177,233,
- 17, 8, 47,252,107,116,189,196,186,222,148,250,195,190,114, 3, 0,124,216, 87,110,168,235, 77,169,255, 53,186, 94,162,158,117,
-177,176, 44,139, 27, 81,185, 88,177,255, 9,230,109,127,132,115,247,236,143, 25, 23, 8,101, 51,150, 47, 93, 34, 23, 48, 20, 21,
-149, 82,172,205, 42,176,105, 69, 34,161, 69, 40, 22, 88,181,102,202,144,172, 98,243,251,188, 63, 53,137, 97,132, 83,171, 76, 43,
-225, 64, 8,129,201,100,130,217,108,126,254, 41,179, 96, 21,104, 45,200,204, 55, 34, 85,101, 64, 90,233, 39,167,208, 0, 66,248,
-137,132, 60,120,240,224,193,131, 7,143,151, 5, 86,185,187,211,115, 0,226,146, 85,144, 8, 56,212,174,211,224,175, 43, 8, 64,
- 8, 96,181,113,118,253,163,227, 23,178,210,253,106,233,200,236,149,169,237, 66, 27,186, 62,154, 50,210,231,105,104, 67,215, 71,
-179, 87,166,182,243,171,165, 35, 86, 78,204, 18, 66, 64, 56, 2, 66, 8, 8, 1, 56,206,126,193, 66, 81, 76,219,102, 13,125, 5,
- 63,236,139, 79,153,186, 33,246, 41, 37, 16, 88,197, 98,177,205,211, 73, 70,213,118,147, 9,138, 77, 48, 6,133, 54,183, 82, 64,
-243,202,120,212, 86,203,247, 29,122,191,175,183, 88,108,240,241,241,129,217,108,126,238, 34, 44,179, 96, 21,105, 45,200, 40, 48,
- 34, 77,101, 64,170,202, 0,131,145,197,227,167,201,160,104,134, 15,250,227,193,131, 7, 15, 30, 60, 94, 31,229,106,145,255,159,
- 5, 22,245,194,231,111,240,245,241,196,157,200, 20,212,241,148,192,209,201, 1, 79,159,165,131,102, 4, 96,104, 10, 54,214,254,
-114, 32,102,235,254,213,179,157, 86,166,102,177,183, 55,236, 78,136, 79,205, 98,111,175,158,237,180,146,152,173,251,129, 18,193,
-198, 17, 2,238,133,191,118,115, 19,206,195,205, 73, 34,184,251, 76, 91, 64, 49, 2,147, 72, 40, 48,121,187, 74, 40,111, 55,153,
-192,199, 85, 38, 86, 72,133,180,183,167, 39, 7, 66, 60, 43,227, 49,167, 71, 39,102,107, 52,115, 59,245,122, 79, 47, 20, 10,225,
-231,231,247,220,130, 85, 38,176, 74, 44, 88, 6,164,170,244,200, 46, 48, 66, 38,161,241,240,214, 69, 61,203, 90,119,242,207, 6,
- 15, 30, 60,120,240,224,241, 90,168, 84,139,252,255,134,170,183,202, 33, 4, 10,185, 12, 28, 45,197,141,123,207,208, 48,184, 9,
-182, 31, 15, 71,131,208, 54,200, 42,182,129, 84, 99, 59,195, 89, 63, 25, 34, 0, 68, 12,236, 41,175, 61,164,111,173,158, 4,194,
- 11, 27,126,215,164, 3, 64, 80, 91,148, 10,171, 18,203, 21, 71, 74,150,137,168, 70,173,100,166,230,234,148,245,188, 20,120,146,
-102, 54, 57,200,165, 54,103,185, 72,224,238, 36,102, 28,101, 2,129, 64, 68,211, 69, 69,170, 98,128,202,172,138,203,156, 30,157,
-152,138,144,185,157,251,142, 88,124,253,236, 1,121,253,250,245,241,240,225,195,231, 46, 66,189,209, 6,170,216, 2,161,140, 32,
-160,150, 18, 79, 35,174,179,249,185, 25,209,133,177,103,183,240,207, 7, 15, 30, 60,120,240,224,193,195, 46,117,196,113, 4,238,
-110, 46,144, 40,157,144,168, 50, 67, 11,119,168, 13, 20, 56, 22, 96,109,149,138,160,114,131,190,143, 95,200, 74, 63,118, 33,111,
-235,241, 11, 89,233, 47,107,185,191,220,131,132,144,138, 92,132,161,229,235, 64,246,204,201, 11, 55, 10, 6,183,245,112,166,133,
- 66,131, 88,194, 88,100, 82,161, 85, 46, 17,192,195, 73, 36,174,237, 34,146, 92, 57,245, 59, 77,113,228,146, 61,156,230,244,232,
-196,164,220,220,185,221,251,143,212,123,122,121, 97,244,232,209,168, 83,167, 14, 0,160,134,130,134,175, 11, 13,129, 41, 27, 87,
-143,111,213, 61,189,127,249, 62, 88,211, 16,188,108,214,228,119, 89,231, 57,121, 78,158,147,231,228, 57,121,206,255, 81,216,181,
-217,115,125,111, 5,252,107, 41, 96, 52,123,194, 96,102,161, 51,217, 80,172,183, 66,173,183, 34, 57, 91,143,216, 43,111,158, 16,
- 82, 42,176, 64, 40,112,132, 0, 84,137,155,144,216,105, 40,212, 9, 53, 43,151, 47,249, 97,196,129,131, 71,200,103,253,188,107,
-223,137, 55,164, 73, 24,161, 89, 46,161, 5,142, 50,154, 77, 74, 76,202, 60,127,242,247, 70,122,169,126,140,189,105, 50,167, 71,
- 39,198, 1,115,131,154,119,255, 1, 4, 2,179, 65,173,152,211, 33, 4,231,206,158, 50,136,111,220,183, 82, 2,113, 36,199, 90,
-118,151, 90,174,248, 8,119, 30, 60,120,240,224,193,131,135,125, 2, 75,111,208,199,247, 28,250, 73,233,134,207, 4, 44, 91, 98,
- 89, 98,203, 92,121, 28, 1,107, 49,196,191,105, 66, 88,142, 11,223,184,125,127,191,166,205,218, 48, 33,190, 14,208, 20,229,225,
-222,157, 91, 54,194,113,183,236, 34, 72, 73, 49,217, 60,164, 31,188,255,222,224,223,199, 79,254, 76,219,169, 75, 55,185,171,171,
-163, 45, 47, 55, 95,179,115,203,129,194, 35, 7,246, 52,162, 56,238, 35,164,164,152,170,147, 46,115,122,116,162, 25, 40, 91,223,
-170, 59, 16,210, 69,151,249,104,128, 14,184,196, 55, 31, 30, 60,120,240,224,193,131,199,107, 9,172,248,219, 71, 59,253, 95, 36,
-164,160, 32,103,244,238,223, 15, 47,218,115,224,120, 7,147,197, 82,139, 3,147,198, 90,173, 87, 37,197,249,223,217,203,161,203,
-141,137,134,175,111,203,223,126, 94,249,249,175,191,172,238, 1,142,109, 0,138, 74,162, 56,114, 73, 43,213,143, 71,102,245,196,
- 85, 57,200,163, 58,158,238, 5, 32,143,111, 58, 60,120,240,224,193,131, 7,143,215, 22, 88,255, 87, 40, 76, 8, 47, 46, 4, 62,
-123, 99,162,148, 20,147, 22, 88,138,146,207,219, 70, 36,248,253,151,120,240,224,193,131, 7, 15, 30, 85,128,230,139,128, 7, 15,
- 30, 60,120,240,224,193,227,237,130, 66,197, 51, 1,170, 99,169,121,157,217, 4,145, 60, 39,207,201,115,242,156, 60, 39,207,201,
-115,254,207,113, 86,197,205,123,138,254, 77,194,139,231,228, 57,121, 78,158,147,231,228, 57,121,206,255, 61,206,127, 20,120, 23,
- 33, 15, 30, 60,120,240,248,159,131,107,192, 0,165,107,192, 0,165,189,215,187, 5, 15,243,116, 11, 30,230,201,151, 28, 15,123,
- 33,224,139,224,173, 64,130,146,109, 27, 45,255,169, 4, 56, 59,215,115,180, 57,184, 29,161, 57,211,114, 77,250,227, 11,111, 59,
-127, 33, 33, 33,205, 0, 32, 58, 58,250, 1,128, 55,157,141, 9,185, 71,224, 72, 23, 71,231, 73, 22,206,204,234,117,250,141,186,
-156,184,176,183,153, 96, 55,183, 96,133, 89, 34, 91, 1,138,244, 5, 1, 77,104,234, 34,163,177,126,161, 86, 63, 82, 87,118,159,
-207,192, 37, 13,199, 15,123,247,219,173, 97,167, 22,165, 29,255,230,233,171,191,187,244,249,201,225,179,209, 61,102,255,188,255,
-228,242,252, 19, 95,105,249,166, 95,125,248,116, 24,233,108, 19,120, 49, 89, 87, 87,229, 87,231,190, 90,129,109,163,132, 66,161,
-187,197, 98,201,205,140,187, 99,215,219,115,237,160,118, 17, 12, 67,215,100,109, 92,122,122,236,173,150,124,233, 87, 13,153,119,
- 80, 51,138,101,191, 34, 28, 43,228,192,172, 49,229,197,223,120, 19, 62,111,111,111,153,147,147, 83,103, 71, 71, 71, 31,185, 92,
- 46, 45, 44, 44, 52, 20, 22, 22,166,166,164,164, 92, 2, 96,251, 79,228,209, 45,100,208,215, 12,141,239, 75,191,255,144, 23,125,
-108,105,229,215, 15, 92, 68, 81,214,175, 75,191, 47,205,139, 62,254,237,127, 67, 93,121,132, 14,105, 3,194,125, 78,211, 76,123,
-150,216,150,168, 34,143,111,168,206,253,109,219,182, 29,108,181, 90, 37,101,199, 66,161,208,116,251,246,237,163,252, 83,240, 31,
- 18, 88,181,130,135,185, 88, 5,100,190,128,161,223,227, 8,113,200,126, 24,166,248,111,206, 96,157,214,163,239,209, 52, 93,251,
-197,115, 28,199,165,167,134,239,126, 91,157,109,237, 85, 51, 90,124,149,147,111,208,252,184,231,233,194,138,196,135, 71,211, 17,
- 55, 41,154,242,163, 40, 10, 52, 5, 48, 52, 5, 0,153,105,225,123,202,219,124,218,219, 81, 33, 8,212,232,108,145, 0,170, 28,
-132,164, 53,252,107, 10, 92, 60,175,118, 29, 50,173,222,189,115,219,131, 89,139,165,135, 46, 55, 38,250, 45,228,205,189, 65,131,
- 6,173, 24,134,113,157, 54,109,154, 8, 0,214,172, 89,227,207,178,108,254,179,103,207,238, 2, 80,189,150,184,114, 15, 26,189,
-238,199, 31,118,245,237,219, 23,153, 42, 29, 86,172,217,208,245,236,201, 3,239,191, 53,145,229,221, 92,102, 19, 51,145,159,126,
-254, 93,237,126,221, 90, 9,138,180, 86,156,190,116,123,116,216,182, 21,221,157,208,164,113,101, 34,139,211, 23,125,235,233, 64,
-250,112,250, 34, 0, 24,249,183,246,175,180,190, 83, 67,142,190,222, 18,193,195,124,224,112,149, 73,105,249,209, 57,161, 72,228,
- 75, 81,116, 73,189, 51, 20,232,210, 54, 96,179,154, 83,158,221,216,222,251,191,162,163,110,254, 97, 54, 5,202,149, 46, 77, 31,
- 69, 1, 52, 77, 67, 64, 1, 32, 68,147,120,107,135,235, 91,248, 55, 78,161,254,206,141, 58,248,235,182, 94, 77, 44, 80, 10, 58,
-207, 56, 69, 17,122, 67,234,245,213, 15,237,185, 89, 42,149,186,156, 56,113,194,189, 79,159, 62, 78, 30,141, 6, 93,181,231, 30,
- 49,163, 13, 57,121,242,184,168, 79,159,222,213,104,159,129, 61, 65,211,187, 41, 64,200,113,100, 13,195,145, 3,218,252,216,103,
-168,230, 98,194,238,141, 6, 45, 0,133, 96,187,111, 32,120,162,138, 58,246,221,107,150, 45, 35,243, 8, 26, 35,147, 74,103,249,
- 7, 54, 12, 76, 78, 74,136,213,104,212,171, 13,185,177, 91, 75, 95,254,236, 6,101, 99,103,156,191,116,115,152, 64, 40,164,122,
-119,107,165, 48, 1,189,171,203,241, 34, 60, 61, 61, 7,175, 95,191,190,126,187,118,237, 0, 0, 54,155,205,241,224,193,131, 94,
- 11, 23, 46, 84,196,198,198, 30,126, 29,206,154, 53,107,214,114,114,114,170, 35,147,201,106, 1,128,193, 96,200, 80,171,213,169,
-153,153,153, 25, 85,166,167,233, 48, 55,194, 90, 23,156, 61,252,171, 0, 0,122, 15,157,180,168,110,151, 89, 46, 20, 35, 52,148,
-119, 61,107, 51, 43, 76,133, 73,159, 95, 60,177,157, 2,128, 30, 3,199,206,113, 11, 30,246,115,222,147,176,156,255,200,195, 58,
-108, 24,227, 22,103, 25, 76, 17,234,139,230, 45, 90,180, 29, 58,168, 47, 66, 26,212,196,224, 17, 83,102, 1,168,150,192,178, 90,
-173,146,176,176,176,218, 52, 77, 51, 22,139,197, 56, 98,196,136,220, 55, 73,154,127,135,143,110,130,162,124, 44, 54,219,111, 41,
-183, 27, 44, 2,230,115,175,166,221, 59, 73, 48, 23, 20, 61,129,112, 92, 90,246,131,223,219,243, 2,171, 20,174, 1, 3,148, 86,
- 1,137,236,218,169,173,235,215, 83,134,136, 55, 29,184,142,227,160, 50,178, 30, 30,172,245,223,154, 65,154,166,107, 31,219,187,
-222, 67, 38, 97, 0, 0, 90, 3,139,161,163,167, 85,253, 0,183, 28,117, 5, 20,130,202,124,168, 44,107,147, 10, 4, 66, 35, 5,
- 0, 84,201,236, 0,153, 76,124,123,102,219, 24,245,216, 1,126, 31,125,245,115,196, 14, 0,206, 0,178,203,237,180,104,186,246,
-239,219,214,120,212,114,149, 66,192, 80,208, 26,108, 24,242,209, 23,108,121,130,109,235,220,118, 11, 70,247,173, 59,220,163,207,
-161,161, 69,197,230, 51,149,165, 83,225, 25,220, 80,238,228,126, 97,232,196, 5, 53, 13,112,196,183,139, 86,123,220, 60, 31,118,
- 61, 43, 35,197,146,154,158,174,183, 89,172, 49,249, 5, 89, 51,181, 89,113,113,246,118,212, 74,165,178,190, 82,169,108,218,164,
- 73, 19,233,172, 89,179,132, 93,187,118,125,254,227,196,137, 19, 69, 87,174, 92,241, 94,185,114,101,191, 71,143, 30, 25,181, 90,
-237, 67,173, 86,155, 0,128,181,183, 78,188,188,220,255,245,222,224, 1,232,254,222,167, 96, 57, 10, 19,166,206,192,185, 51,135,
- 39, 3,120, 43, 2, 75,201,208, 63, 76,152,246, 77,237, 46,237, 90, 8,150, 29,140,135,147, 92,132,222,109, 90, 10, 36,204,108,
-239,223,183,173, 92, 13, 53,198,149,103,185,226,244, 69,223,134,186, 89, 70, 12,108,239,135,227,191, 91, 70,160,199,151,160,229,
-206,207, 45, 89,245,251, 76,115,144,176,185,235,107, 57, 51, 30, 18, 54,119,125,253, 62,211,254, 72, 56,187,190,184,178,180, 8,
- 69, 34,223,173, 63, 47, 14,168,161, 20,129, 97, 40, 8,104, 26, 12, 67,193,100,102, 49,122,202,215,111,171,153, 51, 50,143,128,
-126, 52, 48, 22, 37, 35,225,118, 67,110,220,233,234,212, 9, 69, 51,174, 7,183,173, 20,120, 56,137,193, 48, 20, 24,186,228,147,
-148,109,192,103, 95,206,119,122, 83,161,222,183,131, 71,171, 47,135, 7,245,110, 27, 90,163,201,254, 91,148,115,219,190,195, 93,
-243,140,178, 49,191, 31,187, 50,130,116,250,252, 14, 33,220,143,233, 55,214,157,175,140,196,100, 50,229,244,238,211,215,145, 18,
- 40,228,127, 28,217,209,185,108,179,121, 43,203,253,181, 57, 60, 1,202, 94, 98, 56, 2, 76,252,100, 60,122,247,233,171,231,108,
- 92,122, 53, 58,141,221,103,255,184,225,110,180, 18,172, 90,191,101,129, 78,157,183, 32,241,169,107,178, 86,157,247,185, 33, 55,
-238,184,253, 74, 5,193,177, 55, 15, 14,217,123,242, 22, 66, 67,130,193,114, 37,251,171, 6,214, 86, 96,223,169,219,104, 24,212,
-176,100,241,102,142, 32,200, 71,137, 46,239,126,244,154,197,219, 69,160,240, 84,237, 27, 60,124,236,176, 33,239,141,128,179,163,
- 18,102,139, 41,240,210,249, 51,191,110, 92,191,162,131, 54, 59,102, 76,117,196, 33,199,177,226,191,190, 91,165, 0,132, 0,204,
-175, 91,249, 53,107,214,116,111,213,170,213,243, 99,155,205,134,122,245,234, 33, 35, 35, 35,168,218, 47, 2, 30, 30,242,154, 53,
-107,190, 59,115,230, 76,143,110,221,186, 9,221,221,221, 1, 0, 42,149,170,214,229,203,151,155,175, 90,181, 42, 55, 51, 51,243,
- 84,110,110,174,190, 66, 81,193, 25, 69, 12, 17, 48, 18,137,172, 84,215,130,158, 53,109, 84, 19,119,119,247,114, 95,142,243,243,
- 11,196,223,127,255, 29, 37, 16, 8, 75,174, 39,132, 38, 28, 91,225, 30, 35,237,218,181, 27,104,177, 88,164,229,253,150,103,115,
-239,103,228,196,195, 81,186,153,177,128, 97, 10,179, 30, 30,114,183,251, 65,106, 60,176,151, 32,129,108, 28, 48,104, 80,221,193,
-253,186,194,219,221, 9,151,110,199, 96,250,220, 85,176,218,216,181,175,213,121, 48,140, 32, 55, 55, 55,217,197,197,197,235, 45,
-140,183,126,199,246,254,228,113,249,250,189, 57, 63, 75,126,159, 98,182,142,177,150,109,127,199,114, 4,242,124,145,176,243,160,
-158, 14,174,181, 2,101, 91,126, 94, 38,228, 45, 88, 47, 86,132,152, 89,216,177,125, 43,215,175,103,140, 23, 47,220,114, 21,183,
-206,159, 50,100, 61, 12,123, 43,226, 74,233, 30,216,142, 98, 4,147, 40,134, 81, 80, 52, 37,230, 88, 46,205,102, 54, 47, 50,228,
-199,101,189, 41, 55,203, 1,135,254,172,166, 48, 39,196,255,215, 95, 86,121,120, 58, 75, 96, 48,219, 48,238, 95,243,176,121,237,
- 2, 7,119, 39, 49, 76, 22, 22,219,143,221,205,107,162, 91, 77,198,246,243,251,104,241,214,168,195, 63,238,126,122,184,178, 78,
-140,166,104,120, 56, 73,176,104, 95, 12, 28,229, 66,212, 80,138, 65,211,229,139,171,177, 3, 74, 56,139,138,205, 54, 0,226,138,
- 58, 55,133, 87,163, 78, 14,110, 53,195,134,124,178,192, 61, 78, 69,129, 16, 51, 18,156, 36, 24, 58,122,138,115, 3, 47, 25, 20,
- 82, 6,201,105, 89,245,190,156, 61,187,101, 36,161, 91,153,178, 99, 82,171,202,118,221,186,117,135,246,239,223, 95, 62,115,230,
- 76,161,143,143, 15,118, 31, 60,231,219,115,216,103, 3, 50,178,243,125, 56, 2,120,122,212, 72, 27, 63,188,223,137,211,167, 79,
-167,164,165,165, 9, 87,172, 88,209,230,200,145, 35, 33,217,217,217,118,191,137,178,132,192, 96,102,193,178, 28, 88,142,130,170,
-232,181, 60,142,116,197,111,213,100, 80,175,174,173, 5,107,142, 38,160, 88,111,133, 76,196, 32, 62, 75,135,118,237, 90, 9, 14,
-108,167,186,149,119,199,248, 97,239,126,235,233, 64,250, 12,108,239, 7, 15, 23, 57,182,253,188, 24,199,111, 38,246,201, 41,166,
-176,158, 48,147,188, 37,130,158, 10, 46,107,125,215,150,254, 94, 61, 90,248,226, 94, 75,127,175,107,247,159,198,202,222, 95, 53,
- 45, 67, 43,252,163,240,236,103,197, 21,213,123, 13,165, 8, 91,206, 37, 67, 33, 17, 66, 33, 21,148,124, 36, 2,208,244,155,109,
- 24, 47,245, 14,246, 97, 56,118, 60,195, 8,198,143,248,224,253,154, 35, 71, 12, 35, 20,205,224,224,225, 19,131,246,236,217,157,
-101,181,152,183,176, 52,179,213,152,245, 36,173, 74, 45, 64, 1, 30, 78, 98,124,249, 91, 36, 28,228, 66, 56,202,133,112,144, 9,
-209,163,169,251,155,164,211,101,242,160,250,253, 38, 15,169,219, 45,168,142, 50,224,225, 51,117,244,248, 69,247,214, 94, 41,234,
- 54, 99,253,154, 16, 87,113,161, 73, 48,111,214, 39,130,140,204,172,110, 7, 79, 92,237,206,154,199,197,216, 44,186,111, 84,143,
- 14, 30, 43,143, 44, 61,230, 86,243, 90,109,135, 73, 45, 90,235,227,135,177,233, 13, 10,140, 98, 68,167,104, 74,203, 84, 8,101,
- 89,217,150,150,111, 86,122, 50, 10,244,204,141, 12, 87,186, 27,174,222,170,150, 43,202, 96,225,240, 48, 81,139,186,129,205,225,
-229, 93, 19,230,126,163,234,134, 95, 58,116, 44,252,234,177,165,250,236,167,223,216,203,179,247,228, 45, 44, 92,186, 54, 14, 20,
-158,148,142,230,193, 51,191,152, 22,176,106,245,250,151,206, 77,249,116,106,192,235,138,107,185,103,238,158,119, 6,142, 25,214,
-164, 77, 79,196, 61, 75, 64, 92,212, 61,244,120,167, 55,250,246, 31, 2,179,201,248,209,214, 95,215,223,213,229,196,252,242,183,
- 62,215,171, 97,199,198,161,193,123,106,122,215,244, 33,164,116,107, 50, 66, 96, 50, 25, 49,251,243, 9,208,107,139, 17, 20, 20,
-218,193,185, 83, 47, 19, 40, 6, 28, 71,144,159,159,167,139,121, 26,253,142, 49, 55,230,142,189, 9,212,235,245, 86,149, 74,133,
- 7, 15, 30, 32, 54, 54, 22, 81, 81, 81,200,207,207,135,147,147,147, 86,167,211,217,157, 81,103,103,103,199,198,141, 27,143, 58,
-112,224,128,212,201,233, 47,205,111, 54,155, 33,151,203, 49,120,240, 96, 97,199,142, 29,107,141, 29, 59,246, 99,139,197,178,183,
-168,168, 72, 83, 30, 79,193,227, 83,153,158,161,131, 54,245, 27, 54,113, 10, 0,136, 36,202,196,117,191, 29,142,170,236,127,139,
-164,142,190,239, 12, 30,215, 0,132,128,162,168,117,249, 49, 71,178, 43,186,214, 98,177,200,246,239,223, 95,139,162,168,151,198,
-215, 5, 63,237,111,255, 56, 46,235,157,141,243,191, 18, 56, 40, 36,200, 83,155, 49,105,202, 52, 55,187,197, 85,232,192,169,173,
-154, 53,255,101,222,172, 9, 80,200,101, 56,127, 59, 1,159,127,189,212, 86,144,151,187, 11, 20,181, 38, 47,250,232,155,122, 45,
-222,202,118,111, 1,181,148,112,232,221, 78, 58,225,131,174, 82,179,149, 69,161,214, 10,147,133, 5, 71, 8,212, 58, 43,162, 83,
-138,225,230, 36,194, 22,252,243, 81, 45,129, 37, 16,138,251,127, 54,166,159,120,229,222, 59,184,117,126,175, 33,235, 65,152,252,
-185, 50,104, 49, 60, 49,253,254,126,191, 87,110,137,180,103,144, 16, 80,204,234,246,109, 91,246,154, 56,105, 10,105, 18,228, 43,
- 2,104, 60,137, 75,178,110,219,186,101,204,229, 27,226,181,154,244,200,111, 95, 24, 76,171, 53,125,147,227,184,244, 87, 45, 86,
- 28,247,183,183,217,200,242, 6, 28,103,133, 16,155, 78, 37,150,188, 25,131,192, 73, 46,196,190,203,233,208, 20,100,228, 53, 49,
-172,254,115,124, 63,143,129,139,182, 70, 31,219,112, 34,231, 62,128, 40, 0, 57, 21,113, 82, 52, 32, 96, 40, 56, 41, 68,112,146,
- 11,225,164, 20,130,166,168, 10,197,213,188, 95, 31,237, 0, 16,243,138,184,122,206, 41,247, 8,108,228,224, 90,235,232,123,147,
-151,184, 60, 78,181,128,166, 1, 63, 47, 5, 92,148, 98,152,173, 64,178,202, 82,154, 87, 71, 76,157, 57,223,125,206, 23,147, 79,
-231,100,119,105, 2, 92,181, 85,150,119,189, 94, 47, 30, 61,122,180,208,106,181, 90,198, 78, 95,212, 43, 43, 39,111,208,218, 37,
- 95, 74,220,220, 92,161, 51,218,240,224, 73,114,240,210, 31,127,246, 59,115, 37,252,200,156,201,131,142,247,233,211,199,105,255,
-254,253, 92,117,234, 93,149,147,247,243,246,221, 97,187,214,172, 92,138,167,201, 5,216,246,235, 6, 16,214,182,169,138,170,124,
-137,115,243,230,205, 30, 59,118,236,160,111,223,190,157,255,170, 0,165, 40, 40, 10,212, 38, 56, 43, 68,144, 75, 4,240,114,150,
-192,213, 65, 4,137,136, 6, 77,191,212,137, 60,231,220, 26,118,106, 17,167, 47,194,241,223, 45, 35,182,253,188, 24,227,254, 53,
- 23,145,121,162,179,180,220,121,209,191,134, 15,250,170,134, 28,125,107, 57,211, 30, 61, 90,212,133, 66, 42,194,215,159,141, 70,
-171,251,201, 30,233, 69,220,220, 2, 61,154,206, 63,139,111,203, 75, 39,205, 80, 16, 48, 52, 28,100, 66, 92, 57,181, 47, 87, 95,
-172, 86, 83, 76,137,133,197,106,182,164,216,217,140,255, 86,158,114,143,192, 57,205, 26, 55, 90, 60,101,226,120,186, 67,187,214,
-132,166, 5,200,211, 88, 40, 2,130, 25,255,154,140,169,147, 39,120,165,103,228,124,247,203,134,205,223, 94,186, 64, 22,234, 84,
- 79,231, 87,198,201, 80, 52,104,154,130, 66, 38,132, 82,250,215,199,104,230, 64, 81, 96,106, 53, 31,174, 6, 5, 80, 20,149,153,
-126,239,247, 96,123,210, 89,179,113,223,139, 87,115, 69, 13,245,167,141,183,226,227, 34, 22,133, 63, 74, 13, 7, 80,224,211,217,
-249, 99,171,149, 64,107,180, 33, 41, 71, 15,155,153, 80,227,250,248,162,222, 48, 42,104,201,182,136, 93,103, 30,193,241,133,206,
-254, 37,206,140,219, 97, 70,215,208, 33,195,215,252,180,249,238,202,197,115,153,124,141, 25, 44, 1,100, 98, 6,210,210,143, 76,
-196,192,168, 83,227,151, 77,191,101,219, 64, 13,197,213,202,219,252,223, 59, 13,242,225,208,126,157,127,167, 0, 49, 69,139,210,
-107,250,214,245,237,222,127,140,180,199,128,143,192,218, 44,115,238, 95, 39,151,245,185, 49, 23,237,225, 12, 13, 9, 6, 40, 60,
- 81, 69, 30, 27, 90, 50, 72, 14, 58,220, 48,168, 97,192,171,231,252,253, 3, 3,236,169,247,178,102, 37,115, 15,152,232,223,176,
-241,236,182, 29,187,215,205,204, 55,193,165,150, 63, 30, 68,220,199,185,131,191, 68, 24,138, 11, 87,158, 59,121,100,246,194,101,
-107,155,246, 31,252, 1,142, 29, 61, 48, 83,151, 19,179,161,180, 76,159,115, 18,142,251,112,199,150,205, 62, 66,145, 4, 86,150,
-192,106,227, 96,101, 57, 88,109, 4, 89, 89,153, 40,214,106, 33,149, 57, 64,225, 88, 3, 86, 91,137,165,208,100,178, 42, 38,127,
-212,127,170, 17,184, 83, 94, 58,235,182,254,240, 30,104,170,118,201, 59,106,105,157,153,140,122,111,111,239, 93, 0, 32,145, 72,
- 32,145, 72, 96,179,217,240, 56, 19, 51,188,189, 58,127, 13, 82, 90,217, 28,151,158,253,224,247,150, 21,229,221,199,199,103, 64,
-121,226, 74,171,213,226,207,187,143,156,182,239, 63,223, 39, 57, 45,187, 62,199,122,152,100, 94, 77,123, 23, 21, 93, 30, 80, 81,
-121,230, 68, 30,155,234,211,101, 58, 61,115,202,104,255,117,191,133,133,199,159, 91, 84,169, 57,185, 94,143,175,204,179,167,142,
-108,185,124,221,182,184,140,107,235, 62,175,170,142, 68, 34,145, 80,165, 82, 61,127,190, 23,172, 63,212, 55, 53, 71,243,206,143,
-139,231,138, 30, 36,104,241, 40, 41, 11, 99,122,250,218,253,188,123,133, 12, 14,170, 93,167,214,218,181, 11,167, 35, 54,211,128,
-245,135,194,113,245,212,174,251, 22, 99,241,187,170,232, 19,185,175,211,135,188, 5,129,245, 55,206,178,129,224,242,163, 60, 20,
- 27, 74,132,149,149,229, 80,108,176, 33,183,200, 4,181,206, 10,173,209,138, 49,239,248, 86, 95,253, 17,210, 10,128, 59, 0, 21,
- 69, 81,119, 95, 60, 46,211,160,101, 67,204, 43,199,121,165, 22, 67,215,210,177, 66,252, 2,173,249, 5, 35, 70,121,231,203,238,
-143, 6, 16, 92,202,201, 2, 8,167, 40,170,208, 30,129, 69,202,204,149, 47, 20,114,185,175,172,172,205, 90,187,166,183, 55, 56,
-146,254,210, 37,190,173,135,235, 63, 27,255,190,108, 37,107,211,101, 61, 60,100,119, 76,150,210, 61,160,189, 72, 36, 62,181,116,
-217, 10, 50,124, 64, 23,113,182,218,106,136,206, 48,170,180, 38, 98,243,114,111, 32, 89,182,124,185,114,201,178,149,159, 30, 57,
-204, 21,105,115,162,127, 44,143,195,187,229,136,123, 20, 69,215,166,255, 50,203,131,112, 36, 61,227,222,190,150, 0,240, 38,177,
- 86, 58,163, 13, 12, 67, 65, 88, 26,147,162, 55,179,208, 23,101,231, 55,209,175,253,115,124,159, 18,113,117, 39,195, 43,129, 97,
- 84, 22, 0,149,186, 32,104,138,130, 70,111,133,163, 76, 8, 39,133, 8,206,114,209,139, 22,172,242,196, 85, 84,101,156, 34,139,
- 37,141,181,154,140,132,101,209,175,149, 59, 60,156,196,240,118,145, 64, 42, 22,192,202, 2, 6, 51, 7,131,153, 69, 74,174, 30,
-197,122, 9, 26,119, 25,225,239,230,125, 71,159,157,212,114, 71,126,202,189, 73,149, 90,152, 88, 22,123,194,206,249,103,100,229,
- 14, 58,182,123,181, 36, 87,109,197,163,100, 45,114, 11,205, 32,148, 19,190,254,246, 91,201,188,121,223, 15, 57,112,244, 98, 82,
-251,150,129,233,213, 45, 87,189, 42,102,247,193, 67, 97, 63,191, 59, 96,176, 67,116,248, 25,196, 61,184, 56, 79,151, 91,189,248,
- 43, 95, 95, 95,246,151, 95,126,113,222,180,105,147,255,177, 99,199,210, 84, 42, 85, 98,217, 67,229,234, 32,202,188,112,233,154,
-107,151, 14,157, 5,105,121, 70,184, 57,136,224,235, 41,199,253,155,151,205, 52, 69,157, 45,143,175,212, 13, 56, 18, 61,190,196,
-241,155,137,125,162,242, 37, 87, 62,153, 48, 46,249,194,169,240,252,159,118, 95, 92, 81, 75,105,125, 40,229,114,215,223,111,233,
-239, 53,103,218,104, 44,253,105, 55,174,222,127,154,171,163,107, 46,206, 50,217, 42,156, 84,192,208,128, 80, 64,193, 65, 38,132,
- 94,167, 86, 71, 93,220, 24,248,150, 94,142, 62, 62,119,116, 55, 93, 80,108, 69,122,158,129,202,204, 47,134,141,227,224,172, 16,
-195,198, 1, 69, 5,121,212,158, 61,187,113,247,238, 45, 26, 12,253, 9,128,249, 85, 89,176, 24,154,130, 82, 42,128, 82, 86, 98,
- 5, 82,202, 4,176,216, 56, 4,248,249, 96,237,130,207, 28,221, 61, 60,209,107,232, 36,187, 19, 40, 83,184, 52,221,185,113, 33,
-174,220,122,216,245,114,252,190, 86, 30,161, 77,127, 18,178,194,149, 32,196, 96,178,178,208,168, 11, 97, 52,165,161,117,173, 60,
-212, 80,176, 72,214,120, 35, 50, 59, 78, 89, 85, 71,159, 31,121,228, 1, 69, 6,127,123,240,196,165,165,189,123,118, 69, 84,146,
-166, 68, 92,137, 74,196,149,128,226,176,122,211,102,107,161,186,184,127,126,212,177,188,215,104,159,127,148,118,198, 37, 2,129,
-213,186,239, 89,255,237,206, 9,179, 87,244,238, 61,228, 99, 42,242,238,229,111,244,192, 69,123,173,231,127, 63, 71,236, 58, 87,
- 81, 87,226,209,160,229,222,237, 59,246, 13, 15, 9,240, 65, 78,145, 21,153,133, 22, 92,191, 31,143, 35,155,191, 41, 42,202, 73,
-248, 16, 22,173,150,163,108,234,243,231, 78,156,253,244,179,217,104,212,168,105, 93, 77,186,198,241,213,216, 67,142,161, 54,127,
- 52,126,242,112, 79, 15, 79, 7,174,212,130,197, 17,130,160,160, 16,244, 27, 48, 20, 87,174,221, 68,116,212,163,146,243, 28, 64,
- 8, 65, 81, 97,126,182,205,106,222, 81, 97, 59, 98,168,218,219, 55,173,246,160, 41,192, 98,227, 96,182,114,152,243,245, 60,243,
-244,239,214,119,236,221,161, 73, 20, 3, 78,147,154, 85,228,124, 55, 38,171, 49, 37,116,244, 30, 53,241, 43,145,193,194, 66,163,
-183,226,226,193,117, 21,102,218,219,175, 73, 59,101,157, 14,227, 39,206,221, 36,145, 48,180,165, 81,160, 79, 98,151,182,141,210,
-234,212,116, 43, 94,178,110, 79,235,155,247, 99,250, 13,125,111,136,116,120,253, 16,170,166,171,212, 97,242,212,105, 77, 88,255,
- 14, 31,229,196,255,185,171,194,193, 79, 32, 41,242,169,237,243,220,149,232,222,104,208, 35, 0,175,142,252, 41,170,168, 99, 77,
- 0,192,195,211,203, 72, 9, 37,197,213, 16, 4, 4, 0,126,248, 41,172, 95,186, 74, 59,236,199,197,115, 69, 15, 18,117,120,144,
-160,134, 88,196,192,100,177, 63,172,141,165,200,140,175,166,141, 19, 22,232,108,184,252, 72,133,200,123,151,136,205,162, 25, 67,
- 40,193, 88,183, 70,131, 62,162,128,122, 4, 72,162, 41,252,106,166,177, 67,253,232,152,250,117, 45, 88,238,193, 67,218, 83, 12,
-250, 49, 2, 81, 43,128,107,104,179, 90, 61,104,134,201,203,121,116,200,179, 26,121,135, 62, 55, 14, 43,150,124,135,181, 91,142,
- 32, 60,182, 0, 78,182, 52, 28,219,182, 24, 51,151,238,129,222,204, 86,150,134,138,244,136, 59, 69, 81, 39, 9, 33,253, 9, 33,
-239, 0, 16,151, 29,151,244, 97,212,201,210,255,253,210,241,156, 57,115,190, 89,186,116,105, 84,217,181,101,231,203,174,173,236,
-252, 11,247,187,126,253,245,215,161,203,150, 45, 91,210,174, 93,187,223,111,222,188,153, 8,192, 46,129,245, 98, 38, 42,124,202,
- 61, 66, 7,182, 38,132, 99,188, 92,149,240,247,243,129,226,253,177,178,211, 20,165, 99, 24,154,222,190,230,107,105,190, 65, 0,
- 1,195,216,109,239,149,122, 4,181,145, 41, 21,167,247, 31, 56, 68, 2,234,122,137, 15,221, 46, 74,189,159,168,127,110,210,213,
-168, 82,196,254, 53, 76,204,240, 15,134, 42,206,158,191, 48, 67, 11,252, 88,254,192, 64,215,254,105,245,114, 15, 7,153, 16, 52,
- 5,104, 12, 54,204,248,226,171, 55, 30,189, 8, 8, 51,245,139,239, 65, 83, 37,131,143, 86, 93,128,197,107,182,107,135,214,190,
-116, 99,124, 31,183,129,139,182, 70, 31, 59,255, 68, 22, 63,100, 72,119,117,114,114,114, 97,102,102,102,229, 46, 24,194,166, 15,
-251,120,186,136,166, 75,220, 70, 20, 69, 1, 96,115, 94, 71, 92, 1, 64, 81, 81,146, 70, 42, 86, 14,217,189,122,218,150, 58,181,
-107,213,112,144, 75,161, 84, 72,168,134, 65, 13,164,109,219,180,147,249, 54,104, 36,186,246, 68,139, 84,149, 1, 9, 25, 26, 72,
-220, 67,133,195,187,246,196,238,117, 95,245,203, 79,185, 87,101,254, 47,221,138, 28,176, 97,229, 92, 73, 78,161, 5, 79,210,138,
-145, 93, 96, 66,118,161, 17,217,133, 38, 40,165, 2,180,237, 49, 84,114,252, 98,216,224,246, 45, 3,127,122,157,242, 77,120,150,
-120, 36, 37, 35,107, 76,147,102,173,177,103,231,246,182,168, 85, 75,138,140, 12,163,189,247,111,217,178,165,160,121,243,230,110,
- 63,254,248,163, 46, 40, 40,168,233,230,205,155,253, 98, 99, 99,175,212,175, 95,127,192,198,117, 11,175, 76,159,187,210, 87, 0,
-155, 83,219, 14, 29, 24,185,152,194,237,107,231, 77, 59,182,108,202,180, 20,105,103, 87, 58,122,201,157, 23,229, 20, 83,112,175,
-233, 19,169, 16, 90,123, 9,229,150,216,194,221,159,237, 46, 4, 14,215,239, 51,237,143,203,247, 98, 98, 91,220, 79,246,184,116,
- 63, 54,183, 64,111, 13, 76, 56, 59,179,210, 14,151,161, 74, 45, 88,242,191, 44,150, 30, 77,134,197, 19,138,114, 47, 19, 54, 20,
- 74, 44, 90, 84,201, 67,152,153, 17,113,192,142,192,104,138,112, 28, 16,155,174, 69,177,193, 6,163,213, 6, 31, 55, 5, 84, 57,
-233,216,248,211, 14, 68,220,187,139, 94,125, 7,226,151,223,246, 96,194, 71,239, 27,171,122, 48,105,154, 2, 77, 83,165,150,171,
- 18,113,165,148, 10, 0, 10, 40,210, 89,113,248, 70, 26, 26,248,209,160,170,225, 45,116, 80,202,160, 46, 54,130, 22, 42,241,244,
-250, 46,249,153, 75,225, 95,207, 95,185,245, 75,141, 54, 39,245, 89,244, 45, 4,185,228,195,175,166, 25, 81, 57, 78,184, 87, 80,
- 23, 65, 13,234,131, 22,221,181,139, 59, 47,170,241,138,227,244,161,254,173,154,133,180,171,227,225, 4,131,153, 45,181, 98, 9,
-176, 99,251,118, 36, 39,165,143,207,143, 62, 22,241, 54,148,172, 46, 55, 81, 37,241,240,255,244,241,237,139,137,131, 63,156, 10,
-175, 90,117,154, 22,165, 62,176, 51, 60,193, 62, 49,197,217, 39,176,232, 26,117,155,237,220,185,251,224,112,191, 58, 94,184, 16,
-158,132,136,103,133,112,116,112, 6,163,240, 70, 96,151,177,206,143,207,174,123,207,144,167,221, 41, 20,201, 63,105,221,182, 3,
- 8, 33,136,121, 26, 85,160, 86, 59,253,173, 9, 24,178, 98, 30,220,202,138,113,124, 73, 20,187, 53,108,234,224, 84,227,129,209,
-194, 34, 35, 35, 29,127,222,188,210,220,144, 21,243,160, 58,229, 37, 17,209, 56,127, 63, 23, 22, 27, 7,139,149, 67,243,198, 13,
-141, 66,145,172,211,242, 45,167,218,102,231,228,210,114,165, 19,231,228, 86, 95,228,108,205, 54, 61, 76, 84,139, 44, 54, 14,245,
-189, 43,127, 47,151,215,168,191,228,243, 47,166, 7, 11,196, 50,104,116, 38,115, 86,122,134,215,175,251, 46,107,159,196, 68,215,
-170, 87,183,142,227,194,133,243, 69, 26, 35, 65,110,145, 9,121,197, 22,234,131,145,227,107,238,218,246,203,135, 0,118, 85, 35,
-233,141,127,223,181,201, 90, 67, 41,162,138,245, 86,162,210, 24,217,169,159,206,104,252, 38,109,231, 37,113,149,160,195,131,196,
- 34, 72, 68, 12, 36, 34, 6, 86,155,125, 33,146,110,193,195, 20,110,174,138, 15,219, 52,243,199,185,251, 42, 8, 24, 10, 6,157,
-198, 44,149, 40, 35, 27, 54, 12,160,155, 53, 13, 69,215,142,237,241, 44, 49, 57,232,220,133, 75,107,194,239, 70, 44, 22, 54, 26,
- 60, 59, 47,234,232, 47,213, 73,107, 74,134, 74,145, 99,243, 25,225,225,229, 22, 58,112,224, 0, 73,157, 90,158,148,155,171, 51,
- 88,136, 48,101,234,191, 60,236,246, 26, 17, 2, 2, 96,217,130,175, 97, 50,155,225,225, 44, 6, 33,192,182,245, 63,192,108, 54,
-163,166,171, 20,106,157,181, 42,161, 87,161, 30, 41, 79, 16,189, 42,180,202,190,151, 93,183,116,233,210,254,175, 8,192,254, 21,
- 8,195,191, 93, 87,118,255,178,101,203,150,188,240,187,190, 58, 46, 66,170,178, 76,185, 53, 30,220, 65, 34,150,157,255,101,233,
- 12,186, 72,103,129, 68, 68,163,190, 95, 61, 76,251,108,186,188, 71, 51, 15, 24,224,136, 67,251,118,104,108,172,245,164, 93,111,
-182,158,254, 45, 21, 50,249,217,109, 59,247,113, 94, 30,110,212,175,127,168, 18, 85, 26,219,243, 37, 14, 98,239, 28,231,238,157,
-251,213,155,128, 58, 43,151,202,252, 77,102,147, 75,133, 61, 78,105,133,110, 59,159, 12,134,166,193,188,165,149,189,104,154,102,
-127,251,105, 33,220, 28, 75, 98,174,126, 88, 88, 25, 0,227, 0, 0, 32, 0, 73, 68, 65, 84,187,187,120,128,251,217, 75, 47,138,
-171,102,205,154,169,155, 54,109, 90, 68,211, 85,255,211,180,187,123,203,155, 45,241, 90,226,170, 12,198,156,199,119,141, 64,168,
- 58,249,175,115,103,208, 92,232, 86,239,224,204, 17,163, 62,252,218,179,209, 0,135,164, 44, 53,196,180, 21,173,130,189,113,229,
-220, 97, 46, 45,241,201,100,123,184,115,243,213, 62,110,174,174,136, 72,208, 34, 51,223,136,172,130, 18,113,149, 93, 96,132,198,
- 96, 67,179,122, 30, 40, 82,107,125, 94, 91,192, 82,228,232,185,179,231,198,244, 29, 52, 28,211,190,156,223,119,203,134, 85,143,
-180, 30, 14, 31, 25,115,159,134,219,115,127, 88, 88, 24,123,239,222,189,196,188,188,188, 86,179,103,207, 46,174, 87,175,158,215,
-194,133, 11, 39,214,175, 95,191,102,143,110,221,212,119, 47,183,221, 57,253,203,249,221,190,153,190,197,143,166,233, 28,194,145,
-227,153, 58,235,247,200,123, 98,168,180,158,142,127,243,244,251, 4,203,152, 30,157, 92,143,187,202,232, 16, 33,101, 26,137,224,
-249, 7,240,100,190, 37,225,236,250, 98,217,251,171,166,101, 20,113,115,141,180,215,226,170,196, 85,137, 5,139,130,217,194,193,
- 81, 38, 44,155, 57, 10, 16,120,111, 88,191, 74,238,238, 36,129,128,161, 32,100,104,168,245, 86,228,107,204,248,114,246,108,123,
- 75,144, 99, 57, 14,122, 19, 11,131,217, 6, 10, 20,138, 53,121,248,250,203,207,209,119,192, 80,140,159,252, 5,138, 12,192,189,
-196, 98, 88,172,214, 42,101, 17, 67, 1,122,147, 13,227,123,251, 34,191,216, 2,157,209, 6,179,133,131, 92, 42,128, 64, 64, 67,
- 33, 17,192, 65, 38, 4, 69, 17,145,151,151,215, 68, 0, 16, 10,133,198,180,180,180,221, 21,187,231, 9,234,250,120,194, 96,161,
-209,122,248, 74,188,211, 46, 16, 15, 46,108, 21, 92,187,243,216,239,203,249,107, 48,117,100, 59,132,197, 52, 64, 13,143,186, 80,
-202,165,176, 18, 26, 0,177, 51, 32,111, 62, 71, 91,134,140,220,244,219,182,152, 5,243,190,146, 22,234, 40, 72, 68, 2, 92,186,
-244, 7,110,221,185,183, 46, 47,250,216,238,183, 25, 75, 33, 36,180,167,163,147, 35,164, 98, 6, 22,139,201,238,128,111,150, 35,
- 0, 65,176,123,232,160,195,165,117, 31,204,149,115,206, 14, 11, 22,229, 84, 51,116,251,166, 45,123, 62,244,246,242,192,145,139,
-143,176,115,203,207,168, 21,218, 23,241,247, 55,193,167,197, 96, 40,253,186, 67,236,112,112, 34,205, 8, 26, 79,157,254,245,208,
- 22, 45,219,225,230,245,203,200,205,206,218, 4,196,216, 21,131,198, 8,169,207,186,189,211, 31, 38, 11,139, 78,221,251,227,236,
-137, 35,211, 80, 58,121,226,117,193, 48, 52,247,175, 9, 35,132,185, 69,102, 97,174,218,132,140, 60, 3, 18,179,117, 56,182,127,
-171,221,102, 59,138,161, 91,117,105, 90, 91, 56,113,197,165, 52,159,218,222, 38,161,201, 32,139,125,246,172,225, 39, 99, 62, 20,
-214,243, 15,162, 85, 69, 38,168,212,102,168,212,102,232,140, 86, 52,168, 89,135, 54,217, 4,237,170,155, 86, 15, 39,169,240,151,
-147,137,112,148, 11,208, 62,216,245,181,131,176, 57,142,251, 75, 92, 45, 42,177, 92, 61, 76, 84, 67, 42, 98, 32, 22, 50,144,136,
-104, 88, 89, 98,231, 88,100, 27, 49,105,204, 7, 50,179,149, 32, 79, 99, 6, 67, 83,240,114,115,149,248,120, 7, 98,219,202,127,
- 1, 0, 38,124,181, 1,159,140, 27,141,160, 64,127,168,213,197,178, 79,166, 76, 95, 13,192, 46,129, 69, 8, 33,123,142, 93, 11,
-185, 23,153, 50,243,227, 49, 31, 9,135, 15,236, 76, 71, 36,104,144, 85, 96, 66, 66,188, 30,102,107,245, 86,163,177,177, 37, 62,
-223,237, 7, 78, 66, 46, 98,160, 82,151, 60, 46,139,214, 31,128, 82, 38, 64,118,161, 25, 28, 87,169,245,174, 82, 61, 82,145,213,
-169, 58,120, 81,132, 85,118,158,162,168,147,115,230,204,249, 6, 0,153, 51,103,206, 55,101,199, 75,151, 46, 53, 0,200,180, 87,
- 96,161, 34,183,160, 91,227,193, 29,100, 98,233,249, 93,235,191,145, 93,140, 37, 88,119,254, 62,250,181,245,134, 72, 64, 65,170,
-244,194,131,196, 34, 92,188,120,172,248,250,173, 59, 70,138,182, 86, 57, 45, 74,230, 21,216, 92, 46, 81,252,241,243,230,157, 54,
- 79, 47, 47,236,187, 81,152,153,175,181, 89,255,114, 79, 89,169,123,231,126,245,179,113,214, 62,198,156,248,187, 85,189,121,115,
-132,136,150,110, 60, 14, 66, 8,192,177,224,192,129, 17, 73, 20,117, 90,127,152, 3, 10, 96, 89, 78, 42, 96,104,227,115, 63, 72,
-201,208,148,158, 26,190,175,101, 85, 53,236, 40, 23, 98,255,213,116,168, 11, 50,243, 6,184,159,253,179, 76, 92,157,141,146,196,
-183,104,209, 76,221,166, 77,155, 34,137, 68, 2,134, 97, 94,167,142,223, 72, 92, 85,140, 8,107, 94, 18,150, 29, 58, 36, 29,216,
- 87, 17,218, 70, 76, 9,209,162,161, 55,174,156, 63,194,221, 58,179,117,136, 33, 55,238,148,189, 38, 94,173,209,134,204, 2, 3,
- 50,242, 12,200, 42, 44,181, 96, 21,152, 64, 81,128,209,252,102,203,215, 24,114,227, 78,236,222,189,117,147,201,138,201,157,122,
- 13,198,204,249, 63,251,239,222,180,226,122, 50,177,181,210,171,226, 31,219,245,198,149,146, 98,218,179,103, 79, 68,113,113,113,
-207,213,171, 87,107,131,131,131,197, 50,153, 44, 31,128, 52, 46, 38, 70,116,233,244,193, 36, 85,102,230, 36,171,213,122,215,222,
-116,249,118, 25, 35,145, 89, 34, 38,250,202,219,247,174,239, 37,135,175, 92,215,187,161,242,225,143,249,221,167, 47, 81, 93, 90,
-151,155,101,178, 93, 40,208,163,105,134, 86,248,135, 93,157,141,197,156, 50,106,210, 28, 48, 52, 5,139,201,156,242,220, 29,225,
- 36,193,252,221, 79,224, 32, 19, 66, 41, 19,194, 65, 38, 64,135, 96, 87, 84,195, 64, 68,172, 54, 2,131,217, 6,131,137,133,193,
-100,131, 91, 29,103,252,182, 43, 12,169, 42, 3,142,223,205,195,211,100, 13, 2,125, 20, 32,164,106,187, 19, 71, 88,221, 7, 19,
-231, 58, 48, 52, 13,134, 2,221,208,191, 46, 10,180,102,136, 4, 52,196, 98, 49,228, 82, 1, 28,229, 66, 8, 5, 66,132, 63,122,
- 4,147,201,132, 54,109,218, 72,171,114, 56, 56, 40,101, 8,240,171, 9,139,213,134,211,215,162,177,104,198, 16,244,236,220, 18,
- 95, 50, 98, 60, 53, 53,131, 67, 13, 7,112, 20, 3,139,141,131,201,202, 2,160, 42, 19,192,237, 75,227, 34,140, 0,110,103,199,
- 28, 73,101,153, 65, 19,207,156,191,180,123, 64,191, 94,136,120, 24,133, 67, 71,142, 95,207,115, 85,207,122,209, 42,129,191,102,
-193, 69,189,102,115,165, 8, 77,207,104,215,161, 43,180,133,185,200, 73, 75,178,187, 83, 15,169,227,128,207,103, 76, 11, 8, 10,
- 10, 10, 96, 57, 2,142, 35, 8,241,117,192,164, 41, 83, 2, 26,248, 7, 6,112,165,179, 8, 27,250, 56, 84,202,163,240, 12,154,
-186,120,245,198,143,124,124,124,112,246,198, 19, 44,157, 59, 57, 66, 46, 87,214,107, 89,195,193,153, 11,106,138,196,200, 11,168,
- 81,183, 8,142,158, 1,181, 7,246, 28, 83,187,239,187,131,241,248,225,125,172,253,113,225, 45, 29, 35, 91, 98, 79, 90, 21, 30,
-126,238, 77,155,183, 30,229, 88,195, 19,133,106, 45,148, 46, 30, 8,110,210,114, 84,244, 67,211, 87,186,220, 68,213,235, 62,235,
- 28, 33, 48, 89, 56, 20,104, 45, 72, 87, 25,144,148,163, 71, 82,182, 30, 28, 71,200,139, 46,234,202,251, 99,138, 82, 72, 4,130,
- 26,214,248, 58,143,254,184, 68,124,125, 60,169, 21, 11,103, 51, 22, 34, 65,174,218, 12,149,198, 12,149,218, 4,149,166, 68, 96,
-185, 40, 5,224, 8, 87,237,217, 25, 5, 90, 11, 28,100, 2, 56, 41, 68, 96,217,215,143,249,158,191,102, 95,251,116,149,182,199,
-143,139,230,138, 30, 36,233,240, 40, 81, 13,137,136, 46,177, 94,149, 10, 44,123,221,194,140,128,158,246,238, 59,109,144,166, 50,
- 66,192,208, 16, 48, 52,252, 27, 53,135,155,156, 67,143,225,115, 0, 0, 3,250,149, 44, 67,146,152,165,195,137,219, 89, 0, 32,
-178, 55,173,185,121, 26,233,145, 11, 17,211,247,253,182, 66,108,100,133,216,120, 42, 25, 70, 51, 11,137,168,212,237, 46,174,222,
-248,102, 99, 75, 44, 88,105, 42, 11,116, 38, 22, 26,189, 5,132, 0,225,241,197,208,155, 88,168,245, 22,180, 13,170, 81,229, 51,
- 87,197,248,212,255,141, 60, 84, 37,247,171,240, 87,156, 86,149, 22,172,165, 75,151, 70, 45, 93,186,180, 92,139,152, 61, 2,171,
-124,113, 37,146,158,223,249,211, 55,178, 63, 98, 8,174, 60,202,199,176, 78,181,145,159,155,142, 45, 27,214,113,132, 0, 18,169,
- 56,155,181,113,103,140,156,109,182,250,209,201, 74,253,190,114,183,224, 38, 82,177,228,210,210,181,155, 44, 94,222,181,185,195,
-183,139,114,213,122,246, 37, 91, 33,107, 50,209,132, 35, 34, 99, 78,188, 93,131, 34, 77, 83,150,249,211,134,128, 35, 4,223,175,
- 59,128,165, 51, 71, 64, 41, 21,200, 41,138,146,235,140, 54,204, 88,184, 21,171,191, 29,231, 32,151, 8, 74,133, 1,139,201,211,
-190,180, 79, 4,152, 88,232, 10,179,243, 27,107,215,188, 34,174, 90,168, 91,181,106, 85,228,226,226, 2,133, 66,241, 58, 2,235,
-111,226,202,203,203,171,166, 92, 46,175, 81,102, 13, 99, 24, 6, 44,203,234,226,227,227, 95,107,209, 55, 77, 81,222,209,204,164,
-200, 54, 29,186,190,139,171,231,143,114,183, 78,111, 25, 82,157, 41,230,206, 78,142,105,247,163, 83,130, 1, 37, 50,242,141,200,
- 46, 52, 34,171,192, 4,139,141,131,175,167, 28,233,105,169,112,118, 82,166,217,203, 39,243,244,239, 67, 19,102, 18, 71,225, 55,
- 67, 78,204,105, 0,208,101, 70, 79, 57,176,123,211,227,168,168,135,107,251,143,152, 38,238,249,222, 20,209,230,101,159,206, 1,
- 48,194,238,206, 33, 55, 87,127,252,248,241, 91, 53,107,214,236,255,253,247,223,155, 0,136, 77, 38,147,124,220,184,113,242,148,
-148,148,207, 1,216,149,198,142, 99,183,185, 81, 82,210, 71, 68,140, 35,125,229,186, 94,221, 59,183, 67,251, 80, 31,164,119,110,
- 7, 0,159,165,232,149,129,166,250,191,237,183,178, 56,179,113,199,233,165, 19,134,119,255,124,183, 96,254,234,172,147,243, 43,
-181,136,197, 94,223,214,187,188,174, 67, 88, 26,248,254,162,192,178,177,164, 58, 46, 56, 98,101, 57,232, 77, 54,232, 77, 54,104,
-141, 86, 92,124,144,139,156, 34, 51, 10,117, 22, 24, 77, 44, 8, 0,139,149,148,173, 42, 82,185, 88,189,181,211,185,236,123,173,
-230,195,213,235, 22, 76,115, 60,116, 35, 29, 10, 73, 73, 60,150,147, 66, 12, 71,185, 16, 0,193,149, 43, 87, 80, 54, 61,190,170,
-183,248, 67,103,195,177,122,199, 37,156,221, 58, 27, 82, 49,131,166,131, 23, 96,204,224, 54,224, 56,130,103, 49,145, 57, 1,193,
-205, 60,105,165, 28, 52,141,178,152,148,202,202,211, 21,192,113, 0,253, 1,188, 11,128,168,162,143, 21, 30,101,243,117,151, 78,
-237, 83,232, 12, 38, 91, 97,202,147,159,161,203,235, 82,150,132,210, 55,224, 43, 0, 58,191,174, 49, 91,230, 17,184,238,147, 41,
- 51,134, 53,104, 80, 31, 7,246,110, 3, 33,212, 33,123,111,222,125,226, 22,214,172,125,121,198,224,164, 41, 83, 2, 54,111,220,
-248,210,185,143,198, 77,172,108, 22, 33,229,236,238, 61, 59,168, 97, 8,110, 71,165, 99,197,188,169, 17,198,220,196,145,102,165,
-235, 36,139, 46,235,139,144,208,102,240,242,116, 69,118, 86, 14,186, 13,234,137,190,189,123,227,241,195,251, 88,244,221,151,183,
-160, 55,247,170,202,106,251,151, 16, 18, 78,238,218,123,176, 80,111,178, 96,253,138,239, 48,105,214, 98,180,237, 54, 64, 24,249,
-224,206,100, 0, 11,236,205,179,217,202,161, 91, 19,119,152,173, 44, 44, 86, 14,199, 19, 25,193,223, 45, 5,128,128,161,233,102,
-245, 75,220,187, 26,131,181,242, 74, 16, 80,217,133,154,226,186, 63, 47,158,206,232, 76, 44, 84,106, 19,114,139,204, 80,105, 76,
-200, 83,155, 74,196,149,218,140, 60,181, 9, 2,134, 66, 92, 98, 6, 24,134,170,118,252, 93,145,206,130,214,129, 46, 0, 40,208,
-175,233, 14,201,179,185,247,125, 24,155,222, 99,197,194,185,162, 7,137, 90, 60, 74,210,148, 10, 43, 26,226, 23, 4, 22,103, 71,
- 8,150,123,240,128,246, 35,135,246,107,228,168,144, 34, 35,166, 24, 2,154,130,128,161,224,232,238, 3, 39,169, 17,211,166, 78,
-130,107, 13, 39,164,230, 25,177,238, 72, 44, 30, 69,199,131, 51, 84, 47,219, 27,246,156, 29,242,209,135,195, 37,180, 80,138,221,
-231, 19, 33, 22, 49, 16,192,140,232, 59,215, 76, 57,233, 73,150, 98, 77,145, 66, 32, 16,218, 69, 74, 1,196,198,114, 32,132, 96,
-201, 15, 95,227,247, 29, 27,112,246, 94, 14, 8, 74,150,106,248,243,240, 42,204,152,179, 8, 42,141, 25, 0,245,218, 10,150,162,
-168, 83,132,144,119, 95, 21, 66,175,138,164, 23, 44, 80,229,113,220,125,145,163,236,250,138, 4,220,139, 49, 89,176,115,177,109,
- 65, 57, 74,145, 42, 19, 87, 82,177,248,252,142,117, 95,203, 46,198,226,185,184, 50,104,243,176,107,235,102, 45, 1,247, 78,110,
-212,241,112,123, 11, 68,238, 30, 16, 42,145, 75,174,206, 93,180,206, 84,179,182,159,237,244, 3, 77,126,177,145,253,155, 25, 68,
- 36, 87,176, 10, 39,119,163, 64, 44, 89, 45, 52,152,191,203,203,123,162,171,170, 74, 57, 66,112,226, 78, 54,192,149, 84,226,129,
-107, 25, 37,235,248, 48, 20, 88,174,196,207,125, 33, 34,247,249, 57,251, 42, 16,216,127, 62, 34,175, 34,113,229,236,236, 12,103,
-103,103, 40,149,202,234,182,141,114, 45, 87,114,185,188,198,185,115,231,164,142,142,142, 96, 24, 6, 38,147, 9, 61,123,246,124,
-173,198, 39,247, 8, 28,209,182,251,144,165, 29,187,189,139,203,231, 14,115,183, 78,111, 31,106, 80, 85, 99,253, 30, 0,125, 59,
- 55, 57,177, 98,213,122,191, 89,115,230, 74, 20, 82, 1, 10,181, 22, 48, 52, 5, 95, 15, 25, 92,149, 12,110, 93, 58,105, 28,217,
-167,153,221,226,207,167,118,221, 93,171,214,109,114, 93,189,252,135, 94, 15,174,155, 61,139,138,146, 52, 0, 96, 80,197,109,138,
-141,164, 98,106,215, 57,127,181,105,231, 33,240,168,229,223, 47, 41, 39,166, 90,249, 85,169, 84,185,135, 15, 31,126, 18, 18, 18,
-210,114,232,208,161,100,201,146, 37, 46,233,233,233, 7,237, 21, 87, 0,208,189,119,251, 25, 10,161,181,157,171,140, 14,169,239,
- 37, 71,251,208, 18,239,231,240,119, 59,162,182, 79, 29, 36,100,235,155,229, 27, 56,145,206, 42,172,191,113,211,182,187,190, 53,
- 4, 19,108, 90, 67, 52,128, 99,213,238, 28, 80,218, 73,202, 75,197,149, 84, 0,165, 76, 8,142,148,252,102,191, 5,139,131,217,
-194, 65,111,182, 65,111, 98, 75,196,150,153, 5,199,149, 4, 43, 83, 20, 5,139,149,173,242,109,176,188, 94,210,209,197, 13,126,
-117, 75,210,248,252, 35, 19,130,162, 0,119,119,119,184,186, 86,189,238, 40,199,113, 48, 91,108,165,131, 46,251,124, 82,135,217,
- 98, 3, 33, 4,177,177,113,179,147, 19,147, 7,249, 7, 52,232, 28,210,164, 89, 13,153,152, 70,169,117,170,178,183,218,145, 0,
-172,120, 97,205, 52, 33, 3,227,145,195,135, 20,253, 7, 12, 40,180,232,242, 94,156, 44,193, 0,232, 83, 42,198, 12,213,173, 38,
-133,123,224, 96, 23,215, 26,139, 71,143,157, 20,216,237,157,222,184,114,241, 2,142, 31,222,183, 83,175,138, 61,111, 47, 73, 80,
- 80,208,223,102, 17, 54,240, 15,252,219, 44,194,186,126, 1, 21, 10, 44, 39,167, 38,142, 77, 90,117,245, 73,201,179,224,204,153,
-211,208,169,179,231,153,205, 90, 61,132,100,203, 31,135,127, 29, 63,114,242,247,142,109, 91,181,132,179,131, 28,110, 46, 74,220,
-191,119, 11,203, 23,204,189, 5,189,185, 87,213,253,103, 41,130,131, 69,181,100, 62,211,125,235, 55,194,253, 59, 55,240, 44, 54,
- 50,234,193,221, 91,141,252, 67,219,192,189,166,239,244, 20, 55,102, 25,158, 60,169,114,167, 10,194,146,244,143, 39,126, 81, 58,
-232,149,156,107,219,212, 79,252,247, 70, 72,193,102,181,176,187, 55, 47,207,125,113, 22, 97, 69,188,198,226,162,176,235,119, 30,
-127, 57,176,119, 39,170,204, 21, 88, 38,170, 94, 61,246,175,165,192,179,199, 79, 57,171, 78,125,168,122, 85, 78,114,166, 76,253,
- 76, 86,146,118, 14,164,100, 97,181,234,182, 27, 24, 89,209,168,141, 63,124, 67, 61, 76,214,225,113,146,166,196, 45, 88, 42,176,
- 36, 34, 6,226,210,191,132,216,161, 47,104,122,197, 71,239,247, 70,158,218, 12,142,144,210,181,244, 40, 8, 4, 66,164,104,128,
- 52,141, 22,170,162, 28, 36, 38, 37, 67,157,157, 8,154,102,224, 90,203, 31,250, 84,251,210, 90,204, 42, 3,173, 28, 26,188,223,
-191, 19,115,244,102, 22,100, 18, 1,138,243,210,112,227,220, 1, 3, 97,217, 77,102,171,249,119, 15, 34,142,124, 18, 25,102,177,
-179,235, 80,105,116,102, 79,137,136,193,129,237, 63,227,131, 49, 83,158, 91,179, 1,224,203,185, 11, 65, 81, 20, 10,213, 90, 0,
-148,202, 14,203,213,139,199,170, 23, 44, 79,127, 59,126, 65, 20,149,119, 76,149, 30,155, 43,224, 48,191, 34,170,204,175,156, 55,
-191,194,103,215,226,200, 21, 90,176,132, 52,115, 97,251,218,111,164, 81,185, 18,132, 63,205,198,176, 78,181,161,215,228, 97,243,
- 47,107,180, 70,171,165,111, 94,164,253,226,170,180,161,244,254, 96,220,204,168,250,254,193,230,139,145,197,137, 69, 58,107,133,
-113, 12,109,134,125, 19, 21,113,234,231,126,106,107,226, 84,133,119, 8,203,217,108, 43, 12,170,216, 31,202,239,196,137,248,251,
-117, 7, 74,196, 21,199,225,171,229,187, 64, 56,182,116, 1, 63, 22,132,229,240,175,121, 27, 96, 43,253,206,114, 44, 40, 43, 43,
-175, 42,185, 74,169,232,124, 99,237, 26,167, 87,197, 85,243,230,205,139,156,157,157,225,234,234, 10, 23, 23, 23,148, 9,162, 55,
-117, 11,210, 52, 13,165, 82,137, 43, 87,174, 64,169, 84, 66,161,120,189, 5,242, 21, 30, 65, 31,180,238, 62,120, 79,183, 1,227,
-232, 63,142,108,102,239, 92, 57, 57,204,168,138,177, 91, 4,176, 44, 75, 89,173, 86,244,238,218, 34,229, 65, 76,234,217,133, 63,
-252,208,167, 85,247,247, 36,237,131, 60, 96, 48,219,144,158,150,134, 91,151,143, 27,253,235,184,157,109,223, 50, 48,221,106,181,
-130,101,217, 42, 7,112,147,201,156, 79, 11,165,174,195, 71,140,146,220, 13, 15,223, 35,247, 8,220, 71, 51,220, 67,194, 50, 77,
- 64,184, 15,154, 52, 14,134,197,198,193,160,215, 20,188, 78,190,163,162,162,238,174, 90,181, 42, 72, 40, 20,214, 14, 11, 11,203,
- 43, 44, 44,172,214,118, 65, 23, 78,133,175, 19, 40,173,113,101, 22,172,180, 78,237, 48,162,127, 71,252,126,234, 6, 46, 95,187,
-133, 20,189,242,129,206,204, 28, 77, 79,207, 52,133,184,168, 15, 15,238, 80,143, 57,180, 75,115, 40,170,235,236,247, 9,145, 93,
-200,187, 58,223,238, 9, 30, 20, 5,104, 12,214, 23, 44, 88, 37,241, 77, 52, 77,217,109,193,162,128,196,107, 55,239,135,182, 8,
- 12,198,131, 4, 13, 84,133, 38,232,205, 37,237,158,128,192,213, 81, 4,137,136, 65, 74, 82, 34, 56, 98, 73,170,222, 56, 3, 85,
-223, 97,147, 4,165,175, 47, 2,161, 80,240, 60, 32, 66, 38, 21,107, 61, 60, 60,236, 18, 88, 86,150,197,208,222,109,208,182, 85,
- 19, 12,154,188, 10, 0,112,113,231, 87,112, 81,138, 16, 22, 22,134,180, 63,215,238,246,107, 55,249,124,228,227,232,247,162, 34,
-110,142,234,219, 66,214,204, 75,144, 37,170, 68, 21, 31, 43,117, 17,118, 3,208,179,212, 50,101,101,109, 92,106,159, 62,189, 57,
-150,229, 94,140,137,112, 1,208, 14, 64, 1,128,251,165,162,172,146, 23,192,160,119, 64, 99, 31, 40, 74,170,148,201, 83,234,213,
-171, 95,179, 85,219, 54, 78,131,135,190, 15,177, 72,140, 63, 46,156,195, 79,107,150, 29,208,102, 61, 25, 87, 45,247,152,157, 1,
-237,149,185,139,212,106, 39, 93,108,244,131,194,196, 28,179,139,192, 57, 0, 66,137,195, 36,202,169,230, 58, 70,162,252,190, 86,
-219, 49,142, 23,111,132, 35,234,193, 77,212,116,147, 33,241, 89,188, 62,242, 97,196, 6, 61, 37,252, 1,121, 79,244,246,166, 83,
-158,207,190,215,118,116, 31, 23,163,133,197,245, 75,167,140,156,141,235,115,251,234,233,103, 62,129,173,164,161,173,122,184,228,
- 29,219, 50, 84, 15,252, 94, 21, 79,114,248,158,191,133, 94, 48,228,253,204,211, 23,174, 41,107,214,241,103, 64,209, 48, 25,116,
- 80,165, 68,218,140,154, 28,125,110,228,177,154,118,133, 3,216, 50,230,125,183,108,211,212, 22, 77, 27, 41, 8, 17,191,100,177,
- 42,251,158, 95,108, 46,137,153,213, 21, 33,225,241, 13,163, 42, 94,253,117,229,125,157, 85,158,159, 95,240,124,106,190, 76,235,
- 92, 87,237,164,150, 60, 31,214, 25,192, 73,237,252,220, 82,145,159, 95, 32,102, 89,171,220,158,199,211,217, 65,138,199, 73,153,
-207, 3,218, 37, 34,186, 52,246,234, 47, 75,150,157,207,121, 11,129, 88,129,140,124, 35,104, 66,192,113, 54,216,172,102,104, 53,
- 26,100,102,100, 35, 39, 39, 23,218, 98, 53,100, 74,103,132, 54,107, 9, 7, 7, 7, 60,185,119, 25, 0,117,194, 46, 49,200,137,
- 2, 90,181,108, 41,140, 74, 46,134,197,202, 65, 8, 11,174,159,221,111,180, 89,205, 3,114, 35,143, 93, 2,236,216, 74,228, 69,
-247, 32, 71,254,136,140, 73,105,228,227,230, 77, 69, 36, 20, 97,215,175,235, 75,102,147,218, 74,172,153, 81,169, 58,100,230,235,
-144,145,150, 66,192,177,127, 84,231, 89,162, 40,234,110,101,199,175,105, 9,123, 99,142,215, 18, 88, 54,155, 77, 90,199,183, 46,
- 70, 76, 26,141, 13, 27, 54, 34, 54, 33, 5,191,254,178,182, 68, 92, 61, 62,250,167,157,252,161, 40, 93, 43, 67,159, 19,179,194,
-232,210, 58,253,196,195, 66,218, 96, 38,182,202, 59,187,122,232, 52,110,245, 57, 67,113,129,152, 53,233, 5, 39,118,143,219, 87,
- 30, 39, 0, 48, 52,101, 46,117, 11,130,162, 40,148,185, 5, 55, 44,152, 0,185,132, 1, 69, 81,208,155,108,248,232,243,213,216,
-185,186,228,205,234,147,169, 51,245, 21,165,179, 76, 8,125,222, 46,142, 26,219,199,111,224,162,173,209,199,110, 36,187, 38,188,
-251,110, 23,117,179,102,205,138,100, 50, 25, 20, 10, 5, 28, 29, 29,225,232,232, 8,103,103,231, 42,243, 94, 10,207,170, 98,174,
-104,154,134,163,163, 35,100, 50, 89, 69,194,237, 85,206,151,197,149,103,192,251,173,187, 14,218,215,125,224,120,250,143, 35,191,
-114,247,174,156,120,223,168,138, 61,106,111, 29,149, 90, 29, 30, 14, 29, 58,180,241,164, 73,147, 68,223, 76, 29,122,238,220,149,
-251,177,135, 47, 28, 26, 80, 80, 84,236, 67, 8,129,179,147, 50,109, 88,207,198, 39, 58,181, 10, 74,185,120,241, 34,183,111,223,
- 62, 19, 69, 81,143,171, 74,103, 94, 94,238,246,139, 23, 47, 45,239,220,165, 43,126,221,177,239,221,232,232, 39,239, 62,139,143,
-131,143,111,125,212,171, 31, 0, 61,229,140,139, 87,175,163,184, 32,103,187,157,229,249,215, 15,161,161,181, 24,134,169, 93, 84,
- 84,100,156, 55,111, 94, 16,203,178,199, 67, 67, 67, 91,114, 28,151, 21, 29, 29,157,110, 79,222,111,237,254, 72, 5, 96,151,111,
-151, 49, 7, 51, 45, 69,211, 1, 44,243,169, 83, 7,151,175,221,194,237, 63,239,108,204,147,215,249, 97,236,168,143, 39,212,117,
- 21, 78, 24,212,190, 46,227,225, 34,199,222, 95, 87, 49,199,110, 38,175, 73,206,183,254,182,252,234,252, 69,246,212, 81, 25, 10,
-138, 45,232, 16,226, 10,155,141,128, 37, 4, 52, 69,193, 65, 38,168, 72, 96,253,141, 83, 96,150,140,155, 50,121,210,179,208, 38,
-205,102,140, 26, 51, 73,212,172, 65, 29,132,199, 21, 2,160,224,234, 40, 71,102,102, 22,174, 31,255,205, 86,152,241,116, 35,195,
-112, 11,170, 83,158, 25, 17,251,253,203,190,123,121,121, 77,124, 16, 25,137, 43, 87,174,192,213,213, 21,101,226,170, 2, 23,225,
- 75,156,133,133,197,127, 46, 92,245, 91,135, 9, 31, 14, 66,255,174,141,112,245,238, 51,152,173, 28, 44, 54,238,121,144,107,226,
-173, 77,226,233,195,235,155,167, 14, 13,212,232,173,226,228,239,147, 53, 87,241,242, 34,178,175,166,211, 12,224, 28,128, 54, 0,
- 6, 1, 56,255,202, 30,131, 20, 74,226,174, 26, 1,184, 5, 32,209,174,188,211,216,123,255,238, 61, 87,139,141,195,245, 59, 15,
-131,187,119,104, 6,194, 17,220,189,123, 15, 91,182,109, 49, 62,126,244, 96,165, 46,199,107, 1, 42,222, 50,166,220,242,180,119,
- 22, 97, 5, 2,171,148,243,170, 45, 59, 57,104,227,205, 27, 87,231, 74,106,182, 68,195,126,223, 12,204,120,120,124,160, 87, 72,
-111,184, 53,232,128,204,135, 71, 17,241,231,222,211,247,108,182, 57, 82,142, 78,209,231,197,232,236,125,222,203, 32,145,202,167,
- 53,106,222, 5,105,169,201, 72,138,139,220,105, 44,136,207, 76,121,198,236,204, 72, 79,153, 92, 47,164, 3,110,156,251,253,179,
- 74, 4, 86,165,109,222, 77,172,222,120,229,198,205, 17, 25, 7,143,123, 22,107, 13, 50,129,128,214, 75, 24,228,136,244,207,246,
-219,157,206, 39, 79, 44, 69,245, 29,135,142,154,244,237,169, 53,203,231, 9, 61,156, 37,200, 46, 52, 66,163,183,226,255,177,119,
-223, 97, 81,156,235,223,192,191,187, 59,219,216,165,215,165, 7, 41, 42,138, 5,123, 84,236, 81,140, 13,163,137,198, 22, 61, 49,
- 26,245, 36, 26,253, 25, 79, 44, 88,210,142, 38,150, 20, 19, 99,143,189,197, 18,107, 20,209,168,104, 20, 65, 20,233, 32, 32,101,
-129,101,105,219,103,119,222, 63, 20,142,241, 80, 22,147,188,231, 28,189, 63,215,197,165,192,236,151,153,217,103,118,239,125,102,
-230,121, 42,181, 38, 8,120, 64,176,151, 45,180, 53,149,136, 59,185,211,196, 25, 85,163,129,120, 83, 67,153,174,109, 70,172,210,
-149,101,205, 94,188,120, 17, 4, 98,123,175,128,254,139,140,143,170,242,167, 6, 51,119, 6, 2, 90, 44,130,190,178,112,248,226,
-197,139, 90,113, 28, 55,192,181,205,136,170, 39,230, 34,172,119,219,203,170,140,152,208,207, 23, 6,211,163,241,195,204,230, 71,
-215,218, 89, 30,143,106,142,198,251,149,235, 50, 57, 64,180,255,231,107,120, 88, 92, 14,173,222, 4,131,145,133,129, 53,131,207,
- 23,192,201,201, 9,193, 45,194,225,232, 96, 15,101,105, 25,126,187,246, 43,226, 82,111,103,113,192,170, 82,231,138, 93,214, 60,
- 71, 60, 70, 30,236,225,238,202, 43,174, 50, 64, 42, 17, 32,238, 98,172, 9,192,182,218,226,170, 57,239, 29, 0, 80,161, 81,127,
-249,225,202,245,227,191,253, 98,153,162,125,128, 61,242, 74,117,200, 47,209,162, 74,199, 2,224,192,154, 57, 24,116, 21, 72,249,
-237,116, 17, 11,205,151,120,206, 53,220,131, 37, 20,234,127, 75, 76,149,124, 24,189, 26,201,233, 89,216,188,241,171, 26,125,243,
-138,171,127,179,109, 86,139,189,127,197, 70,212,119, 90,208,194,113, 56, 30, 87, 84, 55,237, 71,237,169,194, 91,233,234,166,226,
-132,171,231,116,252,191,218, 66,104,195,145,135,113, 18, 73,169, 37, 55, 55,183,124,215,174, 93,117, 69,143, 64, 32, 64,237,245,
- 82, 6,131,161,201,187,138,156,236,197,109, 39, 70,190,244, 70, 67,197,149, 64, 32,128,197, 98,169,235,189,106,238,169, 71,153,
- 91,203, 65, 93,250,142,218,219,127,228,223,248,231,127,250,193,114,243,226,177, 49, 53, 37,169, 71,154,187, 47,213,106,245, 93,
- 0,105,107,214,172,233,184,121,243,230, 22,243,231,207,207,252,225,211, 25, 27, 30,125,130,123,244, 89, 38, 62, 62,158,155, 57,
-115,166, 94,167,211,101,149,151,151,223,130, 21,147, 92,107,138, 83,214,108,251,246,159,173,242, 30, 22, 78, 9,106,219, 13,174,
- 1, 93,161, 8,234, 6, 85,181, 17,215,211, 31, 34,243,222,121, 36, 95, 61,184, 79, 91,226,241, 9,144,106,245,250,118,232,208,
-193,143,207,231, 15,231, 56,174,165, 92, 46, 15,224, 56, 78,204, 48,204, 88, 30,143,151,198,178,236,189,208,208,208,243,201,201,
-201, 86,207, 25,246, 32,118,187,222,191,207,148,245, 15, 52,242,190,153, 69,154,240, 7, 26,121,188, 70,226, 48,175,228,194,122,
-253,118,129,247, 90,152,202,238, 30,220, 81,113,120,247,166, 47, 4, 19,166,127, 96, 78, 82,217,191,199,216,218, 52,171,183,140,
-207,227, 21,206,159,191,224, 95,195, 52,240, 30,157, 24,124, 60,100, 67,129, 53, 25,143,199, 52, 90,152,120, 79,248,117,210,251,
- 51, 86,182,235,210,115, 98,159, 33,111,240,109, 69,114,156, 59,242, 29,151,149, 24,115,128,225,204, 31,105, 75, 50,179,254,232,
-241,101, 48, 24,126, 87, 88, 89,211,123, 5, 0, 37, 46, 21,125,127, 62,123,113,202,137,211,177,159, 70, 14,234,229,242,205,146,
-215,241,207,239,143,194, 86, 38, 1,103, 49,227,245,126,190, 99,150,254,173,245,112, 95, 15,169,247,161,152,252, 75,179,215, 38,
- 45,212,104,140,169,104,122,222, 59, 14, 64, 28,128, 96, 0,195, 31, 47, 47, 7, 80, 3,160,250,241,239,127,122,252,189,213,140,
-172, 5,217,197, 58, 28, 61,124, 16, 9,215,207, 35, 57, 57,165, 42,249, 94,242, 87, 60,134, 91, 91, 83,156,166, 2,210,154,189,
-239,204,245,222, 49,136,250,239, 44,108, 68,141,192,230,147,248, 19,171,251,134,244,255,123, 15,151,160,158,112,242,127, 84, 83,
- 86,228, 39, 33,239,183,131, 71,171, 10, 68, 99,129,187,166,154,103,124,142,189,124, 91,132, 88, 4, 98, 92,189,120, 18,156,197,
-178, 17, 0, 56,139,101,227,237, 95, 79,206,232, 22, 57, 13,206,238,254, 29,212,185,241,141, 14,229,211, 16, 27,134,173,248,121,
-251, 39, 7,178,179,179,113,255,254,125,164,167,167, 67,165, 82, 97,247,238,203,205, 26,171,169, 36,243,218, 57,158,128, 25, 60,
-254,173,247,143, 71,189, 22, 37,245, 11, 8,226,183,242,177,135,139, 29,131,148,140,135,200, 72, 74,179,164, 39, 94,210,113, 90,
-229,168,146,140,171, 13,246,142,184,134,142,241,224,243, 77, 31,158, 63,246,104,110,193,129, 35,167,182,250,191,217,243,187, 59,
-187, 56,213,251, 58,174, 42, 43, 23, 71, 71, 47,109, 85,187,124, 83,115, 17,242, 5,130,170,233, 51,230,200,249, 60,126,221,105,
- 64,174,118,183,213,254,195,113, 0, 15, 16, 9,153, 38,159,178, 41, 81,189,192, 90, 44,168,214, 26, 81,173, 49, 66, 93,173, 67,
- 81,169, 26,119,239,101,224,198,229, 83,200,206, 72,175, 98, 89, 54, 6, 28, 14,151,184, 84,236,171,103, 96,221,134,123, 88, 33,
-240,115,118,178, 67,118,185, 14, 54, 34, 6, 5,185,233,172,145,213, 61,243, 32,235,101, 9,199, 11, 5,109, 71,188,242,214,187,
-255, 56, 29, 17,209,219,190,125,120,103,185,171,189, 29, 68, 12, 15, 25,185,197,184, 19,255, 91,205,131,212,219,149,102,147,118,
- 72,217,221,227,127,120,150,150,255,217, 2,203,104,102, 7,126,240,143,207,206,154,205,102, 27, 70, 32,208,154, 56,203,144, 63,
- 82, 92,253, 85, 56,206,146,255,238,123, 11,126,247,129,192,100,182,216,252,237,221,249,218, 39, 63, 32,240, 76,102, 89,109,207,
- 21,199,113,141,245,106, 8, 74,212,250,170, 69,223, 38,236,248,124,199,189,131,120, 52,130,107,254, 31, 93,207,242, 74, 67,130,
-203,160,253, 35,171, 52, 44, 15, 64,114, 61,153, 53,253,251,247,175, 43,182, 30,159,174,179,250,245, 82, 44,149,205,232, 55,124,
- 42,255,252,209,205,150,223, 98,142,142,125,150,226,234,201,167, 95,167,211, 93,215,233,116, 73, 31,125,244, 81, 23, 15, 15, 15,
-143,165, 75,151, 74, 43, 43, 43,133,223,124,243,141,174,180,180,180,168,178,178,242, 26,154,119, 93,139,165, 60,255,206, 91, 63,
- 31, 50,125,199, 59,184,229, 21, 39,119,239,193,142,174,190, 45,203, 75,242, 51, 42,203,242, 79,243, 44, 56, 87, 93,146,122,173,
-185, 43,154,144,144,144, 27, 22, 22,246,147, 64, 32,240, 49,155,205,174, 60, 30,207,150,227,184,114,150,101,203, 45, 22, 75, 97,
-115,138,171, 39,139, 44,223,214,189,246,148,105, 45, 98, 35, 79,186,231, 65,236,118, 61, 0, 40,207, 45,208, 0, 56,134,190,255,
- 23,117,244,106,246, 87,119,203,237,231,148,196,254,243,120,115,243, 11,110,239, 15,254,179,218,191,174,240, 94, 62,128, 41,119,
-110,226,139,164,248,107,203,120, 28,132,102,176,171,180,202,244,155,127, 70,190, 80, 40,212,117,238,220,185,222,187, 5, 37, 18,
- 73,227,227,150,197,198,178, 74, 96, 51,250,244,217,126,250,252,229, 41,167,206,253,250,105,247, 30,189, 92,164, 18, 47,248, 59,
- 25,177,125, 65,167,191,159,143, 47,185, 49, 98,193,165,111, 51, 11,116,137,104,252,250,171,250,164, 3,168,120,220,147,181, 9,
-192,244,199,199, 86, 82,179, 11, 1, 11,222,236,209,163,235,110, 30,143,199,112,172,229,159,215,132,130, 61,186,194,228,124,252,
-193,233, 67,218, 7,216, 99,250,140, 25, 33,129, 65,255,186,139,176,237, 75,118,152, 48,229,237, 16,255, 22, 33,117, 63,107,229,
-219,196, 7,170,194,120,109,181,123,216,160,148,179,107,150,184,100, 92,121,215,198,217,199,182,166, 52, 71, 85,158,115,115,141,
- 70,233,177,166,158, 25, 26,154, 37, 59,253,238,218, 45, 95, 44,156, 95,248, 48, 99,179,166, 36,237,209, 89,135,146,180,164,228,
- 91, 88, 82, 90,148, 63,191, 76,153,185,230, 89,247, 69, 77, 77, 77,193,174, 93,187, 28,123,246,236,201,247,240,240, 64, 73, 73,
- 9, 98, 98, 98, 44, 22,139,229, 97,115,179,148,105,151, 99, 16, 24,232,188,103,123,197, 63, 25, 27,187,161,172, 25, 94, 28,199,
-129,225,243, 10,141,250,138,211, 37,142,218, 5,184, 19,215,104, 59,226, 44,102, 30,199,231,248,181,115, 11, 90, 44, 22,222,234,
-175,119,230, 8,132,226,122, 79,169,154, 77, 6,153,197, 98,177,122, 46,194, 98,193, 3,151, 48, 83,235,166,239,226,227,128, 36,
-222,253, 38, 62,156,114,103, 94,142,156, 52,152,101,205,166,199,199, 71,237,151,146,227,120, 23,192, 51,159, 45,117,174,186,214,
-156,162,234,119, 47,244, 70,163, 35,248, 34,216,201, 76,224,131,135,202,138, 10,137,155, 89,156, 92,250, 7,218,146,242,238,177,
-187,202, 62,125,252, 13,191, 92,152, 28,123,249,202, 88,206, 98, 9, 48,115, 0, 56, 94,182,193,168, 59,160,180, 47,221,241,172,
-235,251,191,134,247, 23,231, 91,117,186,228,191, 48, 83, 4,192, 21,143,134,196, 47,254,147,215,179,193,185, 5,255,200,182,219,
- 42, 90,247,146, 72,101, 11, 52,154,170,205, 90,101,218,241, 63,121,127, 58, 72, 36,146,112, 91, 91, 91, 97,105,105,233,245,199,
-111,106,207,227,243, 94,167,215, 91, 91, 93,251, 15,126,249,253,115, 63,223, 88,255,248,244, 97, 29,239, 49, 95, 74, 39, 12,141,
-152,183,243,240,137,181,245,220, 69,248, 63,191,237,127, 89,102,159, 62,140,123,185,253, 20,179,217,178,170,127, 72,149,166, 40,
- 43,101,230,229, 59, 37,215, 1, 84,253,193,245, 28,255, 68, 15,214,158,255,150,109,119,107, 59,114, 5,120, 8,181, 58,129, 67,
-114,201,221,163, 75,155, 92,207,208, 80,145,172, 4, 78,154, 82,215,178,103, 40,172,254, 19,109, 73,208,174, 93,187,222, 34,145,
-200,207,108, 54,203, 12, 6,131, 70,171,213,102,231,228,228, 92, 69,195, 19,146,255,165,235,233, 30, 54,114,173, 80, 40,124, 15,
- 0, 76, 38,211,122,101,210,209,185,141, 61,176,145,229,255,250,253, 57,102,140, 0, 7, 15,154,255,138,231,200,171,227,107,106,
-147,137,173,155,123, 72, 36,100, 42, 30,222, 62,228,248, 31,108, 75,164,153, 79, 42,101, 82, 38,101, 82,230,211,248,180, 63, 41,
-243, 63,153,233, 25, 58,204,215, 51,116,152,213,131, 37, 55,176, 60,237, 79,210, 32,134,118, 1, 33,228, 63,192, 66,187,128,252,
- 39, 21, 38,159,200,251, 43,151, 39,132,215, 72, 21,218,156,174,191,103,169,100,147, 40,147, 50, 41,147, 50, 41,147, 50, 41,243,
-133,203,108, 42,155, 78, 61,254, 69,133, 23,101, 82, 38,101, 82, 38,101, 82, 38,101,190,120,153,207, 21, 62,237, 2, 66, 8, 33,
-132, 16, 42,176, 8, 33,132, 16, 66,168,192, 34,132, 16, 66, 8,161, 2,139, 16, 66, 8, 33,132, 80,129, 69, 8, 33,132, 16, 66,
- 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,
-132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8,249,235,208, 76,227,148, 73,153,148, 73,153,148, 73,153,148,249,194,161,
-145,220, 9, 33,132, 16, 66,168,192, 34,132, 16, 66, 8,161, 2,139, 16, 66, 8, 33,132, 10, 44, 66, 8, 33,132, 16, 66, 5, 22,
- 33,132, 16, 66,200,127, 13, 30, 26,190, 19, 32,169, 25, 57,207,114, 55, 65, 18,101, 82, 38,101, 82, 38,101, 82, 38,101,190,112,
-153, 77,101, 39,129,252, 37,133, 23,101, 82, 38,101, 82, 38,101, 82, 38,101,190,120,153,207, 21, 58, 69, 72, 8, 33,132, 16, 66,
- 5, 22, 33,132, 16, 66, 8, 21, 88,132, 16, 66, 8, 33, 84, 96, 17, 66, 8, 33,132, 16, 42,176, 8, 33,132, 16, 66, 8, 33,132,
- 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 27,194, 75,109, 0, 0, 32, 0, 73,
- 68, 65, 84, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,127, 33,154,105,156, 50, 41,147,
- 50, 41,147, 50, 41,147, 50, 95, 56, 52,146, 59, 33,132, 16, 66, 8, 21, 88,132, 16, 66, 8, 33, 84, 96, 17, 66, 8, 33,132, 80,
-129, 69, 8, 33,132, 16, 66,168,192, 34,132, 16, 66, 8,249,175,193, 67,195,119, 2, 36, 53, 35,231, 89,238, 38, 72,162, 76,202,
-164, 76,202,164, 76,202,164,204, 23, 46,179,169,236, 36,144,191,164,240,162, 76,202,164, 76,202,164, 76,202,164,204, 23, 47,243,
-185, 66,167, 8, 9, 33,132, 16, 66,168,192, 34,132, 16, 66, 8,161, 2,139, 16, 66, 8, 33,132, 10, 44, 66, 8, 33,132, 16, 66,
- 5, 22, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8,
- 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,228, 47, 68, 51,141, 83, 38,101, 82, 38,101,
- 82, 38,101, 82,230, 11,135, 70,114, 39,132, 16, 66, 8,161, 2,139, 16, 66, 8, 33,132, 10, 44, 66, 8, 33,132, 16, 42,176, 8,
- 33,132, 16, 66, 8, 21, 88,132, 16, 66, 8, 33,255, 53,120,104,248, 78,128,164,102,228, 60,203,221, 4, 73,148, 73,153,148, 73,
-153,148, 73,153,148,249,194,101, 54,149,157, 4,242,151, 20, 94,148, 73,153,148, 73,153,148, 73,153,148,249,226,101, 62, 87,232,
- 20, 33, 33,132, 16, 66, 8, 21, 88,132, 16, 66, 8, 33, 84, 96, 17, 66, 8, 33,132, 80,129, 69, 8, 33,132, 16, 66,168,192, 34,
-132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16,
- 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132,252,133,104,166,113,202,164, 76,202,164, 76,202,164,
- 76,202,124,225,208, 72,238,132, 16, 66, 8, 33, 84, 96, 17, 66, 8, 33,132, 80,129, 69, 8, 33,132, 16, 66, 5, 22, 33,132, 16,
- 66, 8,161, 2,139, 16, 66, 8, 33,228,191, 6, 15, 13,223, 9,144,212,140,156,103,185,155, 32,137, 50, 41,147, 50, 41,147, 50,
- 41,147, 50, 95,184,204,166,178,147, 64,254,146,194,139, 50, 41,147, 50, 41,147, 50, 41,147, 50, 95,188,204,231, 10,157, 34, 36,
-132, 16, 66, 8,249,147, 49,245,254,176,235,170, 98,150,101,221, 1,128, 97, 24,165,233,198, 98, 69, 99, 33,190,158,158, 3,205,
-192, 15, 0, 32, 0,222,206, 47, 44, 60, 87, 79,230, 57,150,101,157, 30,103,150,155,110, 44,126,165,177, 76, 97,215, 85,103,159,
- 92,158,189,177,120,208,211,203,112, 0, 95,216,117, 85,225, 83,235,234,105,237,198,243, 0,203,255,143,245,252, 95,201,124,145,
- 9,187,173, 42, 54,153, 30,181, 35,161,144, 81, 26,175, 55,222,142, 68,221, 86, 21, 62,185,188,233,250, 98,143,167,151, 17,247,
-248, 36,215,100, 98, 61, 1, 64, 34, 22,151, 4,251,123,172,107, 44, 51, 51, 79,249,190, 86,167,119,123,156, 89,104,184,246, 15,
-191,255,213, 99,211, 90, 30, 30, 30,157,249,124,254, 98, 30,143,103,255,196,143, 19, 11, 10, 10,222,167, 86, 73, 8,121,238, 10,
- 44,150,101,221,111, 29, 89,134, 26, 61, 48, 96,210, 42,247, 22,163, 54,237,126,122, 25,147,174, 92,172, 73, 59,218, 70, 96, 82,
- 59, 57,218,112, 78,105,105,105,124, 0,240,242,242,250, 1,128, 95, 61,153, 78,183,142, 44,131,198, 0, 68,140, 91,238,212,193,
-223,223,190,146,199,251,192,198,198,166,191, 78,167,107, 11, 0, 82,169,244,174, 86,171,189, 96,207,113, 95, 60,189,124, 67, 27,
-240,228,186,246,159,184,202,189,101,212, 15,127, 55,155,205, 98,125,230,254, 62,150,170, 7,140,192,108,248,122, 72, 97,225,169,
-239, 1,179, 53, 59,228,201,191,219,231,141,127,184,248,122,122, 14,180,145,201, 58,203,108,109,123,155,205,230, 80,139,197, 2,
-139,197,146,172,173,169,185,204,154, 76, 55,205, 38,141,203,173,159, 62,177, 52,182,158, 79,111, 75, 39,128, 81, 42, 20, 99,109,
-108,109,251, 10, 4,130,158, 0, 96, 54,155,175,104,171,171, 47,186, 23, 21, 29,176,102,219,173,221, 63,207,186,252,139,198,100,
- 98,221,179,206, 44,131,222, 4,132,191,246,169,123,251, 55,119,236, 1, 0,131, 50,193,163, 58,237, 88, 55, 0,144, 7, 13,187,
- 46, 81,132, 23, 3, 0,243,160,208, 61,245,196, 71,208,155,128,208, 97,203,221,235,203, 52, 24,140,190,233, 39,151, 64,111, 2,
-254, 22,125,208,115,193,140, 49, 50, 0,136,249,233,251,160,179, 7,215,191, 10, 0,175,140,121,239,231,126,163,222,201, 0,128,
-213,223, 29,244,220,245,241, 24,232, 77, 64,216,200,149,190,207,122,108,178,250, 10,145, 58,245, 68,176,169,178,192,201, 87,206,
- 40,154,123,108, 58, 0, 14,213,192,108,158, 64,208, 43, 56, 56,184, 19, 0,100,100,100,220,178,176,236,175,182,192,215,127,102,
- 91, 18, 8, 4,127,127,248,240,225,240, 39,127,230,237,237, 77, 13,146, 16,242,124, 22, 88, 0, 80,163, 7, 98,211,129, 62,221,
-219, 99,250,132, 87,109,159,252,221, 79,219, 62,243,125,120,247,108,232,234,189,235, 4, 45, 91,182, 68, 90, 90,154, 85,127, 76,
- 99, 0, 46,166, 1, 18, 93,182,157, 70, 40,204,140, 94,188,216,190, 87,175, 94,140,151,151, 23, 0, 64,169, 84,118,191,124,249,
-114,231,229,203,151,207,148,232,178,203, 53, 6, 84, 93,180, 34,186,118, 93,219,182,124, 9, 31,205, 25,231, 0, 0,235, 62, 56,
-208,249,228,213, 4,231,236,236,236, 1,159,124,242, 73,153,247,181,107, 27,109, 45,150,173, 41,197,197,121,214,172,231,190, 83,
-241, 54,193,198,115, 45,198, 76,157,122,216,207,207, 79,230,227,227,195,147, 74,165, 16, 8, 4,168,174,174,246, 74, 73, 73, 25,
-120,251,246,109,237,165,107, 71,133, 9,241,163,179, 10,132,225, 90,107,182, 93,196,150, 74,107, 66, 66,238,141,137,140,244, 25,
- 54,108,152, 52, 32, 32, 0, 0,144,157,157, 29,242,243,207, 63,143, 63,121,242,228, 82, 17, 91,202,106, 12,208, 53,181,237,181,
-153, 0, 32, 4, 94,118,118,119,159, 32, 20, 10,195, 88,150,245,126,220,187,240,208,100, 50, 37,169,148,202, 93, 79, 47, 79,254,
-157,222, 4, 36, 23, 2, 3,123,135, 99,226,232,129,114, 0, 88,248,198,199,221, 31,100,167,139, 12, 6, 3, 90,182, 10,237,185,
-242,211, 47,207,128,207,199,143,135,127,169, 91,190,209,194,150,227, 35, 77, 9, 36,222,207,194,178,143, 55,112, 69,137, 7,187,
-176,229,247, 6,149,149,150, 50, 0,224,226,234, 58,118,223,158, 93,231, 20,237,199,252,150, 81, 92, 83,183,188, 53,237,189,190,
- 99,243,228,222, 13, 94, 15,147, 46,180,249,246,204,102,161,159,159, 31,146,146,146,154,117,108,162, 34,197, 78,230,233,153, 28,
-189, 96,129, 34, 34, 34, 2,114,185, 28, 66,161, 16, 38,147,105,224,149, 43, 87, 6, 46, 91,182,108,102,101, 69, 74,141,181,199,
-166, 21,125,135, 95,120,180,236,211, 47,106,196, 80,207,254,125,186, 99,244,144,158,212, 16, 9, 33,207,111,129,197, 48,140,114,
-208,228, 79,220,123,119, 11,195,111, 9,169, 21,217,185, 69,213,181,191, 83,223, 63, 18, 50, 35,170, 67,216,166,147, 39, 96, 52,
- 26,113,245,234, 85,220,188,121, 19, 87,175, 94,229,190,248,226, 11,173, 0,120,187,129,204,242,136,113,203,157, 36,250, 60,219,
- 78, 46,121, 1,251,246, 92, 20,104,181, 90,196,198,198,162,188,188, 28, 18,137, 4,222,222,222,232,221,187, 55, 19, 19, 19,227,
-252,198,248, 9, 14,175,140,154,150,165,151,248, 86, 51, 12, 83,206, 54,180, 1, 12,163, 28, 48,105,149,123,155,144,151,144,145,
- 83, 80,241,209,167,155,171, 45,102,142,209, 61,200, 55, 94,186,116, 9, 29, 59,118,196,190,125,251, 92,202,203,203,151,108,223,
-190,125,177,199, 87,219,214, 23,231,167,124,128,134,243,202, 35,198, 45,119,106,105, 62,239,119, 96,247, 86, 81, 66, 66,130,104,
-227,198,141, 80,169, 84, 16,139,197,112,112,112,128, 66,161, 64,203,150, 45,121, 51,103,206,148,245,235,151,134,143, 62,152,234,
- 87,228, 20,149,210,208,122,214,102,138, 12,133,178, 16,193,205,160, 31,118,236,224,119,237,218,149,247,228, 50,126,126,126,232,
-219,183,175, 52, 42, 42, 42,104,230,172, 57,150,129, 81,239,100, 24,197,158,154,166, 50, 81,147,103,227,162,185,230, 53,112,220,
-184,227,209,209,209,142,158,158,158,144,201,100, 0,128,138,138, 10,159,156,156,156,238,203,150, 45, 27,115, 61,113, 31, 19, 49,
- 44,175, 0,114, 95,109, 99,251,243, 69, 37, 20, 50,202,218,158, 40, 59,185, 77,121, 94,126,113,205,163, 94, 40, 3, 12, 6, 3,
-244,122, 61,222,157,249,142,224,237,215,186, 6,251,247,254,251,237,236,135,197,170,208, 95,226,156,107, 31,107,170, 63,179,180,
-205,136,149, 78, 0,192,175,204,170, 41,207, 57,251,183, 15,231,206,245, 86, 40,102, 64, 36, 18, 1, 0,182,109,221,202,148,149,
-149, 69,174, 92,185, 50,140,147, 15,168,108, 51, 98,165,252,241, 99,203, 77,205, 60, 54,203, 83, 79,180,248,120,246,224, 14, 63,
-124,122, 2,102,179, 25,113,113,113,184,116,233, 18,190,252,242, 75,238,212,169, 83, 21,246,114,121,163,199, 38, 42, 82,236,122,
-121, 22, 5,126,254,249, 33,158, 88, 44,198,209,163, 71,113,255,254,125,240,249,124,180,111,223, 30, 19, 39, 78,196,192,129, 3,
- 21,211,167,191,195, 69, 12,121, 35, 19, 14,173,170,254, 88, 91,138,230,179, 78,119,254, 62,123,250,155,158,175,141, 28,140, 13,
- 95,125, 75, 5, 22, 33,228,249,198, 1,188,128, 81,155,246, 28,184,197,157, 8, 24,181,105, 15, 7,240, 56,128, 39, 1,252,250,
-247,239,111,168,174,174,230, 18, 18, 18,184,177, 99,199,150, 47, 92,176, 96,203,142,109,219,162,245, 26,205,187,157, 58,116,152,
-200, 61, 26,250,161,254, 76, 71, 71,251,192,192,192,146,188,188, 60,238,212,169, 83,220,242,229,203,185,221,187,119,115,167, 79,
-159,230,206,159, 63,207,157, 62,125,154,219,191,127, 63,151,144,144,192,165,167,167,115, 65, 65, 65, 37, 1,142,142,246,141,100,
-242, 57,128, 31, 28,245,253, 7, 7,111,154,163, 67,162,126,120,159, 3,248, 65, 10, 69,171, 65,131, 6,153, 15, 29, 58,196,237,
-218,181,139,219,177, 99, 7,151,152,152,200,149,150,150,114,222,254,129, 37,181,143,107,104, 61, 57,128, 23, 30, 30, 94,162, 86,
-171, 57, 63, 63, 63, 78, 36, 18,113,238,238,238, 92,203,150, 45,185,238,221,187,115, 67,134, 12,225,198,143, 31,207, 45, 89,178,
-132, 83,171,213,156,191,191,127,113,237,227, 26,202,236,238,237, 45, 13, 10, 10,202,189,115,231, 14,215, 16,157, 78,199,149,150,
-150,114, 23, 46, 92,224,130,130,130,114,187,123,123, 75, 27,203, 20, 2,225, 97, 97, 97, 37,165,165,165,156,197, 98,225, 52, 26,
- 13, 87, 86, 86,198,149,149,149,113,229,229,229,156,193, 96,224, 44, 22, 11,103,177, 88,184,148,148, 20, 46, 48, 48, 80, 41, 4,
-194, 27,202,124,193,219, 60,191,190, 47,111, 15,143, 33, 10,133, 66,123,232,208, 33,238,225,195,135,220,246,237,219, 57, 62,240,
-241,211,203,213,151, 57, 38,116,140, 40, 60,124,186,141, 64, 96,243,234,203, 47,191,108,190,122,245, 42,119,235,214, 45,238,195,
- 15, 63,228,134, 15, 31,206,141, 24, 49,130,139,142,142,230,114,115,115,185,188,188, 60,238,149, 87, 94, 49, 11, 4, 54,175,134,
-135, 79,183, 25, 19, 58, 70,212,156, 99, 83, 10,248, 14, 27, 54, 76,107, 52, 26,185,204,204, 76,174,109,219,182,249, 2, 96,130,
- 8, 8, 13, 4,196, 77,181, 79,123,192,209,211,211,179,240,218,181,107,220,161, 67,135, 56,127,127,255, 18, 1,240,150, 4, 8,
-144, 0, 1, 2,224,173, 22, 45, 90,148, 92,187,118,141, 43, 45, 45,229,252,252,252, 10,237, 1,199,103,111, 75,209,124,247,182,
-163,182,174,252,234, 16,151,146, 95,195,173,252,234, 16,231,209,178,111, 46,199,113,156,167,167,231, 57,106,145,132,144,231,178,
- 7,171, 33,124, 27,155,101,159,126,250,169, 72,171,213, 98,197,138, 21, 37,239,206,152,177,202,213,221,221, 40, 20, 10, 33,148,
- 72,154, 14,176,183,127,127,209,162, 69,142, 6,131, 1,241,241,241,232,212,169, 19,164, 82, 41,132, 66, 33, 68, 34, 17, 24,134,
-129, 66,161, 64,105,105, 41, 60, 60, 60, 48,115,230, 76,135,175, 55,108,120, 31,106,245,138,198, 98, 45,102,142, 1, 0,179,217,
- 44,246,245,242,154,222,182, 93,187, 47,102,206,156,201,151,203,229,208,235,245,208,235,245, 72, 73, 73,129,139,139, 11,100, 54,
- 54, 86,109, 51,159,207,231,219,218,218, 34, 54, 54, 22, 91,183,110, 69, 86, 86, 22, 10, 10, 10, 96,111,111,143,142, 29, 59, 34,
- 52, 52, 20, 61,123,246, 68,122,122, 58,120, 60, 94,147,111, 50,197, 2,193,236,137,227,198,185,135,133,213,127,103,171, 94,175,
-135, 90,173,134, 90,173,134,135,135, 7, 34, 35, 35,221,143, 31, 61, 58, 27,192,154,250,150,151, 1,138,128,144,144,227, 55,110,
-220,112,229,243,249,136,141,141,133, 70,163,129, 78,167, 3,203,178,224,241,120,144, 74,165,232,209,163, 7, 92, 92, 92, 16, 18,
- 18,130, 35, 71,142,184, 13, 26, 52,232,103, 89,113,113, 56,128, 66,106,254, 77,203, 47, 46, 62,219, 9,112,121,243,205, 55, 79,
- 37, 38, 38, 70, 76,152, 48, 1,197,197,197,255, 16,124,248, 97,185, 25, 88,219,216, 99, 15, 36, 31,100,125, 0,185,179,155,219,
-247,159,125,246, 25,191,168,168, 8,243,230,205, 43, 43,200,203, 91, 36, 5,174, 1,192,207,199,142,245,216,185,115,231,167,187,
-118,237,114,217,177, 99, 7,191, 83,167, 78,155,148,241,155,218,220, 2, 42,154, 83,185,232,128,191,175, 91,183, 78,170,211,233,
- 48,104,208,160, 76, 77,118,118,123, 22,208, 90,251,248,106, 96,118,244,130, 5, 10,137, 68,130,249,243,231,151,150, 62,120,208,
-150, 5, 74,158, 88, 36, 71,158,149,117,106,210,164, 73,119, 19, 19, 19, 93,215,174, 93,171,120, 45, 42,106, 54,128, 85,214,254,
-141,127, 93,208,206,183, 55,219,198,134,140, 26, 18,233,209,170,133, 59, 14, 29, 61,131,175, 55,237,222, 6,117,198,247,222,222,
-222,179,249,124,254,106,106,121,132,144, 23,170,192,114,114,114,234, 28, 20, 20,132,243,231,207,163,117,235,214, 71,220,107,139,
- 43,161, 16,102,115,211,215,144,219,200,229, 3, 34, 34, 34,152,171, 87,175, 34, 32, 32, 0, 54, 54, 54,117,133, 85,109,145, 37,
- 20, 10,161, 80, 40, 80, 81, 81,129, 94,189,122, 9,183,110,221, 58, 0,192,138,166,178, 11,115, 82,108,145,185,245,205,229, 43,
- 87, 6,118,238,220, 25, 70,163,241, 81, 33, 34,147, 65,175,215, 67, 40, 20,194,104, 52, 66,103,224, 42,173,217, 86,179,217,108,
- 22, 8, 4,240,243,243,195,210,165, 75,161,211,233,234, 78,235, 84, 86, 86, 66,173, 86, 35, 62, 62, 30,217,217,217,176, 88, 44,
- 92, 83,121, 50, 91,219,200, 17, 35, 70,136,235,251,157,193, 96,168, 43,174, 42, 42, 42,160,211,233,208,161, 67, 7,241,133, 11,
- 23, 34, 27, 42,176,120, 82,233,152, 29, 59,118,184,139,197, 98,232,116, 58,164,165,165, 33, 35, 35, 3, 41, 41, 41,122,149, 74,
-197,218,218,218,242, 60, 61, 61, 5, 21, 21, 21,226, 73,147, 38,241,170,170,170, 0, 0, 81, 81, 81, 46,219,182,108,121, 29, 6,
-195, 90,106,254,214,185, 5,232,131, 12,134,225, 93,187,118,189,240,219,111,191,117,122,239,189,247,144,152,152,248, 79,217,190,
-125,151, 52,192,237, 70,219, 37, 48,115,245,194,133,158,114,185, 28, 19, 39, 78, 84,105,242,242,218,179, 64,209, 19,139,164,186,
-100,103,159,158, 60,121,114, 82, 98, 98,162,211,218,181,107, 21,175,143, 25, 51, 19,192,167,205, 89, 71, 7, 7,135,174, 10,133,
- 2,167, 79,159, 70,110,118,246,194,230, 20, 87, 0,192, 19, 8,122,245,233,211, 7, 63,253,244, 19,242, 31, 60, 88,248, 84,113,
- 5, 0,168, 1, 74,152,204,204,133,219,182,109,219, 58,117,234, 84,240, 25,166, 23, 88,235, 79, 16,214,119, 65,251,187, 11, 87,
-227,200,233,184,109,202,187,237,254, 6,252,100, 1,112,131, 90, 28, 33,228,121,208,172,113,176, 90,180,104,209, 66, 34,145, 32,
- 39, 39, 7,221,186,117,203, 22,138,197,144,136,197,144,216,216, 88,247, 41, 91,167,107,167, 80, 40, 80, 89, 89, 9, 87, 87, 87,
-136, 68, 34,136, 68, 34,136,197, 98,136,197,226,186,239,237,236,236,192,231,243,225,237,237, 13,157, 78,215,174,169, 92,182, 34,
-205,253,204,246,133,179, 78, 30,217, 25, 24, 21, 21, 5, 47, 47, 79,120,123,123, 65, 46,151,131, 97, 24,248,249,249, 33, 40, 40,
- 8, 91,182,108, 1,207, 62,228,186, 53,235,250,100,209, 36, 16, 8, 96, 54,155, 81, 92, 92,140,148,148, 20, 36, 38, 38,226,218,
-181,107,136,143,143, 71,117,117,181, 85,219,174,209,104, 58,214,215,209,245,116,113,165, 86,171, 81, 82, 82,130,140,140, 12, 84,
- 85, 85,133, 55, 88,236,186,184,140, 14, 11, 11, 19, 0,128, 84, 42, 69,139, 22, 45,240,221,119,223,177,231, 78,159,126,221,230,
-183,223, 28,205, 23, 46, 56,236,249,241,199,215,167, 77,155,102,190,126,253, 58, 42, 43, 43,145,154,154, 10, 55, 55, 55, 70, 98,
- 99,243, 58, 53,253,230,201, 0,106,228, 85, 85, 67, 94,126,249,229,172,138,138, 10,172, 94,189,154,207,216,217,125,255, 14, 32,
-104,244, 0, 19, 8,122,247,235,215, 15, 71,143, 30, 69,254,131, 7, 31,150,253,190,184, 2, 0,148, 1, 69,217, 25, 25, 11,183,
-109,219,134,200,200, 72, 48, 12,211,187,185,235,215,189,123,247, 48,142,227,112,231,206, 29,136,129,184,230, 62, 62, 56, 56,184,
-147,173,173, 45,238,223,191, 15, 33,112,169,161,229,132,192,165,248,248,120,216,216,216,160, 77,155, 54,157,155,247, 87,132, 95,
-120,180,236, 83,248,238,194,213, 56,124,250, 10, 0,224,167,227,167,138, 31, 21, 87,209, 22,106,101,132,144, 23,182,192, 2, 0,
-142,227, 32, 16, 8, 32, 98, 24,216, 72, 36, 16, 75, 36, 16, 11,133,214,127, 82,230,241, 32,145, 72,254,173,168,170, 45,180,106,
-255,149,203,229, 86,103,154, 10,127,141,152, 50,121,146,216,214,214, 22,102, 51, 11,134, 97, 32,147,201,160, 80,120,160, 85,171,
- 86, 80,169, 84, 24, 62, 98,148,238,129,138, 57, 46,244, 25,144,248, 44, 59,138,101, 89,212,212,212,160,188,188, 28, 42,149, 10,
-149,149,149,208,233,116,176,226,236, 96, 93,157,150,155,155,139,189,123,247,162,172,172,172,193,226, 42, 51, 51, 19, 59,119,238,
- 68,118,118, 54, 4, 2,129,213,207,207,128, 1, 3,112,226,196, 9, 65,223, 1, 3, 54, 63,240,247, 47,124,224,239, 95,216,119,
-192,128,205,199,142, 29, 19,120,123,123, 35, 55, 55, 23,241,241,241, 80,169, 84,176, 88, 44,116, 13,214, 51, 40, 0,202, 53, 42,
-213,212,127,252,227, 31,156,173,173, 45,214,172, 89,211,113, 11, 48,190,177,199, 4, 6, 5,117,178,181,181, 69,114,114, 50,100,
-141, 20, 46, 50,224,210,173, 91,183, 96, 99, 99,131, 86,161,161,157,159,229,184,180, 88, 44, 48,155,205,245,142,239,102,205,113,
- 41, 20, 10,193,231,255, 85, 99, 15, 71,243, 89,167, 14,127,159, 61,123,142,231,223,231,188,139, 11,177,143,106, 64, 65,117,102,
- 26, 21, 87,132,144,231, 81,179, 78, 17,102,100,100,100,235,116,186,208,128,128, 0,220,189,123, 55,160,109,187,118,137, 66,161,
- 16, 18,161,176,241,143,241,143, 73,165,210, 59,197,197,197, 61,125,124,124, 96, 50,153,234, 78, 9,214,158, 38,172,253, 30, 0,
- 36, 18, 9,146,147,147, 33,149, 74,239, 52,185, 17,230,106,255, 22, 45, 90,160,168,168, 24, 18,137, 4, 78, 78,142,176,177,177,
-129, 68, 34,197,167,159,126,106,217,188,105,211, 55,146,182,179,213,115,167, 45,228,110,172,250,225, 63,178,163,101, 50,217,157,
-128,128,128, 30,114,185, 28, 71,142, 28, 65,118,118, 54,212,106,117,221,117, 83, 90,173, 22,122,189, 30, 82,169, 20,109,218,180,
-129,179,179, 51,238,222,189,219,224,182,151,151,149, 29, 78, 74, 74,234,209,165, 75,151,186, 93,223,183,111, 95, 94,223,190,125,
- 93,159,232, 53, 67, 89, 89, 25, 18, 18, 18, 16, 27, 27, 11,150,101,113,239,222, 61,179, 94,171,221, 71, 77,255,217,232,128, 43,
-130,109,219,182,206,152, 49, 99, 90,207,158, 61,193, 1, 67, 1,252,216,224, 39, 24, 62,159,199, 48, 12,120, 60, 94,163,133, 15,
- 15,176,112, 28, 87, 91,236, 52,187, 0,190,118,237, 90,146,217,108,238,217,178,101, 75,232,129,174, 0, 78, 52,231,241,233,233,
-233,183, 76, 38,211,192, 14, 29, 58,224,240,129, 3, 17, 0,114,234,253, 48, 3, 68,132,135,135, 67,171,213,226,222,189,123, 55,
-173, 45,174,220,219,222,217, 60,123,250,155,111,189, 54,114, 48, 14, 29, 61,131,159,142,159,206,251,246,243, 5,190, 28,103, 49,
- 82,171, 34,132,188,240, 61, 88, 21, 21, 21,191,221,191,127, 31,221,187,119, 71,122,102,102,148, 94,171, 21,213,246, 98,241, 5,
- 77,151, 88,218,154,154,243,191,254,250, 43,219,177, 99, 71, 84, 87, 87,215, 21, 85, 79,246, 94,213, 22, 92,114,185, 28,167, 78,
-157, 50,106,107,106,206, 55,149,107,102,205, 22, 62,159, 15, 30,143, 7,189, 94,143,194,194, 34,232,116,122,252,240,195, 15,216,
-178,105,211,248,252,194,194,247, 33,113,210,254, 21, 59,208,218,247, 66,173, 86,123,254,252,249,243,166,128,128, 0, 76,153, 50,
- 5,115,231,206,197,220,185,115,241,206, 59,239,224,173,183,222,194,132, 9, 19, 48,122,244,104,116,235,214, 13,110,110,110,200,
-202,202, 50,105,181,218, 6,183,157,211,233, 14, 78,158, 60, 89,169,211,233, 96, 54,155,161,215,235,161,213,106,235,122,217,226,
-227,227,113,248,240, 97,108,218,180, 9, 63,255,252, 51,106,106,106, 80, 89, 89,137, 91,183,110,169, 5, 38,211,126,106,250,127,
-232,160, 57,244,235,175,191,194,201,201, 9, 94, 62, 62,125, 26,253, 80,146,158,126,219,108, 54,163,125,251,246,168, 1, 26, 92,
-182, 6,232,211,177, 99, 71,232,116, 58, 36,223,187, 23,223,220,117,170,170,170,186,145,149,149,133,190,125,251,194,211,199,231,
- 11, 15,192,166, 57,143,183,176,236,175, 87,174, 92,193,164, 73,147,224,223,162,197,231,114,192,237,233,101,228,128, 91, 64, 80,
-208,231,111,189,245, 22,206,158, 61, 11, 11,203,254,218, 80,158,135,135, 71,103, 79, 79,207, 99, 94, 94, 94,177, 30, 65,231,114,
-162,134,116,127,235,201, 11,218, 57,117,198, 88,111,111,239, 93,124, 62,127, 62,181, 40, 66,200, 11, 95, 96, 89,180,218,229,139,
- 22, 45, 50, 8, 4, 2,204,154, 53,203,237,235,111,191, 93,190,127,255,254, 46, 9,119,238, 40, 12,122,125,211, 21, 86,101,229,
-186,149, 43, 87,170,141, 70, 35, 90,183,110, 13,149, 74, 5,179,217, 12,129, 64, 0,134, 97, 32, 16, 8,192,231,243, 33,147,201,
-144,148,148,132,125,251,246, 85,162,178,114, 93,147,235,101,177,220, 57,114,228, 8, 24,134,225,164, 82,105, 93,209,179, 97,195,
- 6,229,180,194,194,195, 0, 32, 16, 8, 12, 0,192, 23,240,172,186, 42,151,207,231, 55,121,225,186, 88, 44,174,189,184,191,233,
-139,220, 89,118,221,119,223,125, 87,149,150,150, 6,141, 70, 83,119,106,176,186,186, 26, 85, 85, 85,117,223,215, 22,137,151, 46,
- 93,170,146,177,108,131,219,174, 1,138,178,211,210,134,119,233,210,165, 44, 39, 39, 7,213,213,213, 72, 79, 79,199,181,107,215,
-112,226,196, 9,196,196,196, 32, 35, 35, 3, 6,131, 1,142,142,142,168,172,172,196,177, 99,199, 42,245,213,213,131, 53,245, 92,
- 7, 68,254,197,215,211,115,128,135,187,123,158,155,171,235, 67, 95, 79,207, 1,245, 20, 26,169,169,169,169, 48,155,205, 8, 12,
- 12,116,110,236, 58, 44, 51,203,254,122,237,218, 53, 76,152, 48, 1, 10,111,239, 79,221,234, 41, 92,220, 0, 55, 79, 31,159, 79,
-167, 76,153,130,243,231,207,195,220, 72,225,210, 16, 41,176, 97,193,130, 5, 90,145, 72,132,125,251,246, 5,218, 7, 7,167, 48,
-192,155, 98,160,117, 16, 32,106,234,241,182,192,215, 75,150, 44, 41, 2,128, 93,187,118,185,122, 6, 5,221,101,128, 41, 82,224,
- 37, 41,240, 18, 3, 76,241, 12, 10,186,187,111,223, 62, 87,150,101, 49,119,238,220, 34, 91,224,235,134,242, 4, 2,193,223, 11,
- 10, 10,134, 63,124,248, 48,162, 40,253,170,239,183,159, 47,192,133,216, 56,124,189,105,247, 54,229,221,118,127, 83, 42, 31,222,
- 40, 40, 40,152,248,240,225,195, 36,106,113,132,144,231, 81,189,221, 47, 76,215, 85,197, 0,231,222,167,123,123,252,150,144, 82,
-225,226,228,112,186,246,119,234,251, 71, 66, 94,239,235,223,113,249,242,229,224,241,120,184,127,255, 62, 18, 19, 31, 93,214,180,
-122,245,106, 13,159,227,162,158,152,239, 44, 12, 64,210,227,204,115, 44,203, 58, 73,244,121,182,225, 78, 89, 45,126,220,177, 77,
- 96,103,103,135,234,234,106, 8, 4, 2, 72,165, 82,200,229,114, 72, 36, 18, 36, 38, 38, 98,210,148,169,230, 12,182,195,191, 6,
- 26,253,215,124,103,117,153,181,227, 15,245,116,113,145,229,138, 68, 31,184,121,120, 44,152, 51,103,142, 77, 68, 68, 4,196, 98,
- 49, 58,119,235, 93,100,211,113,193,122,190,128,199, 22,148, 86, 44, 14,122,201,203,225, 94, 90, 14, 0,158,210,116, 99,177,231,
- 19,167,108,254,109, 61,219, 73, 19, 3,127,252,118,133,125,219,182,109,193,113, 28, 42, 42, 42, 80, 92, 92, 12,165, 82, 9,181,
- 90, 13,173, 86, 11,139,197,130, 95,126,249, 5,191, 92,207,172, 44,182,123, 37,179,161,245,252,215,182,231,216,133,218,164, 6,
-172, 95,251,133,192,201,201, 9,197,197,197, 40, 45, 45,173, 59, 85,104, 54,155, 81, 85, 85,133,163,199,127, 54,103,154,219,101,
-235, 37, 47, 85, 53,149,137,154, 60, 27,231,234, 43,222,157,195, 2,184,119,222,121,199,206,222,222, 30, 22,139, 5, 42,149, 10,
-217,217,217, 72, 77, 77,197,229,203,151, 53,202, 74, 19,167,117, 29,148, 95, 55,208,104, 61,153,127,162,255,185,204, 39,199,178,
-242,242,244, 44,124,240,224,129,187,217,108,134,183,183, 55,171, 86,169, 62, 19, 3,103, 69, 64, 1, 15,224,170,128, 37,107,215,
-175,159, 58,114,228, 72,116,237,218, 53,175,168,184,248,165,250,218, 18, 7,240,189, 0, 39,145,191,127,114, 92, 92,156, 91,106,
-106, 42, 38, 79,158, 92, 82,144,151,247,129, 61, 16, 11, 0,149, 64, 31, 47, 95,223, 47,246,236,217,227, 22, 22, 22,134,246,237,
-219,151,232,179,179, 67, 11,128,242, 6,218,103,131,199,102,121,234,137, 22,179,162,194,186,188,251,238,187, 96, 89, 22,177,177,
-177,184,126,253, 58,114,115,115,113,229,202, 21,181,189, 92,254, 70, 99,199, 38, 42, 82,236, 34, 67,106, 2,119,237,250,145, 39,
- 18,137,176,109,219, 54,196,199, 63,234, 76, 11, 15, 15,199, 91,111,189, 5,150,101, 49, 97,194, 68,238,231, 20,155,127, 13, 52,
- 90, 79, 91,242,246,246, 14,179, 88, 44,107,120, 60,158,200, 44,118,239, 82,148, 21, 47,245,108,217,171,160, 40,109,128,111, 51,
-175,185,162,246, 73,153,148,249,226,100, 62, 87,154,156,139,112,213, 70, 56,252,126, 58,142,183, 11,143,110,251,140, 25,250,234,
-240,208,197, 31, 45, 18,180,107,215, 14, 22,139, 5, 93,187,118,197,228,201,147,101,161,161,161, 77,205,119, 86,253,202,168,105,
- 89,175,188,242,138,227,172, 89,179, 28,250,244,233, 35,172,157, 42,231,206,157, 59, 56,121,242,164,113,239,222,189,149, 15,197,
-189,213, 87, 78,109,169,182,102,190,179, 43,101,101, 26, 0, 43, 90, 26,141,155,150,124,244, 81,116,219,118,237,166,189,255,254,
-251,124, 91,185, 76,184,106,241,219, 82, 0,248,248,171,189, 14, 35,199,188,137,117,193, 64,159,241,245,207, 29,247,228,122,230,
- 23, 42, 31,188, 57,117,108,240,180, 9, 81,150, 81,163, 70,201, 28, 28, 28,224,235,235, 11, 71, 71, 71,100,101,101,225,206,157,
- 59,220,217,179,103,171, 19,238,231, 10,119,238, 63,251, 64,108,235,110,205,188,129, 85,175,140,156,156, 61,101,202, 20,167,168,
-168, 40,187,182,109,219, 10,133, 66, 33, 36, 18, 9, 74, 75, 75,145,159,159,111,140,137,137,169,126, 40,234, 81,126,229,244,246,
- 42, 43,231, 34,212, 70,140, 91,158,126,254, 76,244,251, 9, 9, 9, 19, 1,116, 48, 26,141, 62,102,179,153,199,231,243, 11,205,
-102,115,162,174,186,122, 43, 27, 30,189,142,230, 34,180,142,217,108, 22,153,205,102,168,213,106,156, 59,119,142,201,200,200, 88,
-156,144,144,176,184,160,160, 0, 70,163, 17, 99,198,140, 65,120,120, 56, 46, 94,188,136,146,226,226,227,141,101, 21, 0,229,204,
-131, 7, 83,103,206,156,121, 98,251,246,237,188, 59,119,238,184,109,221,186,245,199, 91,183,110, 1, 0, 58,117,234,132,169, 83,
-167,130, 97, 24, 76,158, 60,153,203,205,206,158,202, 2,229,141,180,207,198,142,205,146,147,123, 55, 36,140, 26, 61,166,205,178,
- 37, 31, 9,123,246,236, 9, 55, 55, 55,244,238,221, 27, 70,163,209,209,138, 99,179, 42, 98,200, 27,153, 29, 58,116,144,175, 93,
-187, 86, 49,117,234, 84,204,158, 61, 27, 0,160,213,106,113,246,236, 89,204,157, 59,183, 40,151,233, 86,115, 43,102, 95,163,237,
-243,113,207,212, 32, 0,240,242, 66, 44,128, 8,126, 77, 78, 38, 93,208, 78, 8,121,161, 11, 44,224, 95,243,157, 93,190,158,132,
- 39,167,227,120,196, 57,217,228, 28,149, 57,117,238,103,109, 4, 38,181,147, 13, 99,112, 74, 76, 72,224,103,101,101, 53,250,199,
-106,231, 59,211, 75,124,171,205,133,101, 93, 54,172, 91,247,254,230,205,155, 7,212, 14,197, 32,149, 74,239,104,107,106,206,163,
-178,114,157, 62,192,247, 66,115,231,206, 75, 45, 43, 43, 6, 48, 35,200, 98, 89, 63,101,218, 59,171,121,182,190,204,162, 85, 63,
-232, 4, 2,129, 33,243, 97, 49,214, 5, 3,114, 43,198, 67,213, 24,128, 59,101,238,236, 93,174, 79,202,154,207, 62,155,183,241,
-235,175,187,217,216,218, 70, 24,141,198, 80,139,197, 2, 0,201, 58,141,230, 18,107, 52, 94,127,232, 53,253, 75,177,173, 59,103,
-237,188,129,122,105, 64,149, 92,123,185,203,161, 3, 7,222, 59,117,234,212,191,109,187, 29,176, 94,111, 31,112,222,154,109,127,
-114, 25, 19,112, 21, 74,229,213,198,186, 42,105, 46, 66,235,240, 57,238,109, 39, 39,167, 31, 7, 12, 24, 32, 29, 56,112, 32,134,
- 14, 29,138,151, 95,126, 25, 22,139, 5, 28,199,161,170,170, 10,251,247,239,199, 63,255,249,207, 52, 15, 96,121, 83,121, 44,112,
-154, 57,122,116, 68,167, 78,157,182,174, 93,187,214,101,198,140, 25,176,121, 60,180,137, 86,171, 69, 76, 76, 12,230,206,157, 91,
-150,147,153, 57,149, 5, 78, 55,149,215,248,177, 41, 77,101, 29, 71,102,191, 49,251,179, 96, 83,101,129,147,139,140, 85,220, 77,
-186, 99,245,177, 9,135, 86, 85, 21,241,251,187,190, 22, 21, 53,155,207, 48,189,106,135, 98,184,119,239,222,205,218,201,158, 17,
-254,214, 47,205,105, 75, 28,247,104,236, 57,142,227,232,130,118, 66,200,139, 93, 96, 49, 12,163,172,237,229, 97, 24, 70,153,245,
-211,244, 55, 27, 11,241,245,244, 28,248,248,211, 49,154,154,139,176,246,255, 89,106,117,213,227, 17,218,235, 29, 68, 84,248,212,
-242,205,153,239, 44,163,184, 56, 5,192,171,192, 3, 32,229,242,163,188,174,171, 62,124,114,155, 26,220, 33,191,251,187, 34, 85,
-126,113,241,101, 0,151, 1,252,179,222,245,244, 19,169,154, 90,207,167,183, 61,225,193,131,202,199,219, 93,255,182,187, 55,189,
-237, 79,103, 54,249, 68,255,129,253,249,162, 41, 44, 41,249, 9,128,220,245,196, 9,143,147, 39, 78,188, 62,111,222,188,215,188,
-188,188,130, 93, 93, 93,157,236,236,236,248,113,113,113, 89, 6,157,110,125, 16,176, 61, 21,208, 88,147,201, 2, 39, 21,153,153,
-173, 71, 12, 27,246, 62,159, 97,122,133,134,134,134, 3, 64,114,114,114,188,133,101,127,117, 3,214,177,128,202,138,231,177,121,
-199,166,164,249,199,102, 5, 80, 1, 96, 21, 88, 22, 72, 76,252,195,199,166,197, 98, 89,229,237,237, 93, 69, 35,180, 19, 66,200,
-159, 39,140, 50, 41,243, 57,202, 20, 0,176,167,253, 73,153,148, 73,153,148,249,151,100, 62, 87,248,180, 11, 8,177,154, 25, 64,
- 37,237, 6, 66, 8, 33, 77,225, 53, 82,133, 54,231,238,128,103,169,100,147, 40,147, 50, 41,147, 50, 41,147, 50, 41,243,133,203,
-108, 42,155,238, 78,252,139, 10, 47,202,164, 76,202,164, 76,202,164, 76,202,124,241, 50,159, 43,116,138,144, 16, 66, 30,139,142,
- 6,159,227,192,227,184,104, 62,199, 29, 16,112,220, 24, 1,199,225, 15,205,221, 57,102, 76,253, 3,209,206,121, 19,118,180,199,
- 9,121,126, 49,180, 11,254,115, 20, 10,133,159,135,135,199,247, 28,199,241,148, 74,229,244,162,162,162, 92,218, 43,255,125,156,
-157,157, 7, 0,128, 74,165, 58,255,188,110, 99,155, 0, 68,113, 60,180,126,242,103, 60, 11,114,239,229,252,126,158,197, 54, 47,
- 97, 34,199,255,253, 88, 90, 60, 14,247,239,101,227, 72,115, 62,216,141, 26,224,182, 6, 0,126, 58, 95, 50, 31,207, 48, 57,117,
- 83, 60, 61, 61, 91,186,184,184,156, 17, 8, 4,140,217,108,158,153,148,148,116,162,169, 15,154,239,142,198, 34,182,200,117,209,
-146, 25, 60,161, 65,191, 90,173,215,233, 42,248,124,126,182, 72, 36,186, 60,103, 2,119,250,171, 93,166,187, 13, 60,190,193,245,
-111, 27,128, 72,190,190,205,240,240,214, 89,153,107,198,118, 93,215,103,154,171, 48,235,230,109,219,141, 71,114,191,119,112,244,
- 24,254,247, 55,138, 78, 72,108,204, 19,255,185, 21,213,116,164, 89,231, 19,192,217, 8,180, 19, 73, 36, 62,102,150,245, 0, 0,
- 1,195, 20,155,244,250, 60, 17,144,184, 8, 80,255,151,100,186,154, 24, 38, 76, 36, 22,251,152, 77, 38, 15, 30,192, 65, 40, 84,
- 90, 12,134, 60, 51,203, 38, 69, 3,101,207,186,158, 66,137,196,215,204,178, 30, 60,128,251,179,182,253,207,204, 36, 77, 20, 88,
-129,129,129, 55,249,124,190, 15,159,255,168,147,235,201, 57,247,106,255,255,244,191,102,179, 57, 63, 37, 37,165,179,181,127, 60,
- 32, 32,192, 94,167,211,189,206,227,241,222, 4, 0,142,227,118, 75,165,210,253,217,217,217,207,116, 33,113, 64, 64,128, 61,199,
-113,243,109,108,108,250,235,116,186,182, 0, 32,149, 74,239,106,181,218, 11, 60, 30,111,205, 51,230, 50,158,158,158, 99,229,114,
-121, 63,150,101,251,113, 28,199, 99, 24, 38, 70,163,209, 92, 40, 44, 44, 60, 0,160,217, 35, 30,120,122,122,218,184,184,184,124,
-236,232,232, 56,126,214,172, 89,101,206,206,206,173,150, 47, 95,254,155,139,139,203, 30,149, 74,245, 81, 97, 97,161,246,191,164,
-125, 4, 41, 20,138,221, 66,161, 80,144,151,151,215, 15, 0,124,125,125, 99, 12, 6,131, 89,169, 84,190, 9, 32,163, 57, 97,174,
-174,174,114,161, 80,216, 93, 46,151,119,150,203,229, 17,102,179, 57,212, 98,177,192, 98,177, 36,215,212,212, 92, 50,153, 76, 55,
- 77, 38, 83, 92,105,105,105,205,127,209, 49, 98, 39, 18,137,126,100, 89, 22, 0, 66, 0, 84, 61,143, 47, 4, 28, 15,173,239,221,
- 77,110,245,187, 98,170,109,232,191, 47,199,135, 95, 3,203, 89, 93, 96, 13,237,229, 56,100,120,100, 7, 62, 0, 24, 13,191, 13,
- 57,249,171,250,228,159, 93, 92, 13, 29, 58,244,234,250,245,235,157,244,122, 61, 22, 44, 88,176, 91,175,215,127,147,158,158,190,
-168,177,199,217,219, 59,204, 91,241,201,215,178,199,175,103,238, 22,139,197,189,176, 32, 47, 36,229,254,157, 33, 41,247,147, 62,
-157, 51,230,254, 53, 45,107,126,103,203, 79,184,111,205,122,132,190,132, 97,195, 71, 71,189,186, 98,105, 52,198,143, 31,255,210,
- 93,149,206,198,251,110,130,184,134,179, 13,114,117,247, 25,177,240,163,207,121,113, 87, 47,142, 56,176,119,243,133,255,155,106,
-234, 79, 69, 86,147,120,171, 24,166,187, 67,112,112,196, 27, 63,253, 4, 91, 95, 95,134,145, 72,248, 0,192,234,245,190,213,121,
-121,158,251, 70,140,232, 22,157,154,122, 49, 26,184,254,159,204, 92,193, 48, 61, 29,130,131,123,142, 63,121, 18,182,158,158, 12,
- 95, 36,226, 3,128,197,104,244,169, 44, 40,240,220,247,234,171, 93,163,211,211, 47, 69,179,108, 28,172,152,106,237,127,104,219,
-137, 53, 5, 22,159,207,247,137,143,143,119,151,203,229,120, 92,252,192,108, 54,195,108, 54,227,241,155, 98,221,192,139, 28,199,
-129,101, 89,244,237,219,215,170, 79,175,158,158,158,253, 1, 76, 9, 14, 14,126,109,254,252,249,162,158, 61,123,194,108, 54,227,
-194,133, 11,189,215,174, 93,251,149, 94,175, 63, 12, 96,123, 97, 97,225,121,107, 63,221, 42, 20,138,193, 2,129, 96,215,226,197,
-139,237,123,245,234,197,212,142, 14,175, 84, 42,187, 95,190,124,185,243,242,229,203,103, 42, 20,138, 9, 69, 69, 69,103,172,221,
- 57,222,222,222, 97, 50,153,236, 96,100,100,164, 79,231,206,157,165, 45, 91,182, 4,199,113,184,125,251,246,212,148,148,148,113,
- 39, 79,158,223,178,194,155, 0, 0, 32, 0, 73, 68, 65, 84, 92,166,209,104,198, 52, 99, 62, 53, 94, 80, 80,208,100, 59, 59,187,
-143,231,205,155,231, 60,106,212, 40,113, 82, 82, 82,121, 96, 96, 32,239,240,225,195,110,199,143, 31,159,249,205, 55,223,140,149,
-201,100, 31,101,100,100,236,176,230,192, 11, 14, 14,190,201,231,243,125,172, 41,128,155, 89, 4,119, 12, 8, 8,216,127,233,210,
-165,128,156,156, 28,115, 84, 84,212, 78, 0,184,114,229, 74,123,142,227,120, 61,123,246, 60,149,159,159,255, 58,128,219,214,108,
-184,151,151, 87,123, 7, 7,135,163,163, 70,141,114,246,243,243,147,249,248,248,240,164, 82, 41, 4, 2, 1,170,171,171,189, 82,
- 82, 82, 6,222,190,125, 91,123,229,202, 21,149, 72, 36, 26, 81, 80, 80,144,216,140,118,252,178,187,187,251, 68,161, 80, 24,198,
-178,172, 55, 0, 48, 12,243,208,100, 50, 37, 41,149,202, 31, 1, 92,125,214, 3,196,195,195,227,171,181,107,215,186, 22, 23, 23,
-115,209,209,209, 95, 85, 84, 84, 76,126,158, 95, 16,146,110,199,225,242,149, 75,248,110,211,143, 21, 28,135, 7,255, 86, 96, 89,
-144,222,182,109,168,219, 59,111, 79,116,238,221, 51, 2, 97, 29,187, 55,153, 57,178,191,203, 10,177,136,113,209,232,245,215, 75,
-243,249, 71,101,114, 81,212,132,209,157, 51, 1,224,244, 47,119,162,186, 6, 58,253,234,234, 99, 25, 41,147, 72,186, 25,140,108,
-217,209, 11,101, 75,155, 83, 76, 41, 20,138, 51,182,182,182, 50,181, 90, 93, 84, 86, 86,182, 49, 50, 50,114,213,218,181,107,157,
- 50, 51, 51,145,151,151,135, 41, 83,166,216, 62,124,248,112,150, 94,175,191,150,151,151,215, 96, 79, 86,101, 85,197,186,143,163,
-231, 45,179,115,112, 18,200,108,228,176,181,179, 71, 64,139, 16,116,233,214, 27, 3, 95, 25,129,204,140,148, 30,251,119,109,190,
- 61,115,116,254,167, 41, 42,172,140,141,109,248,181,169,141, 63,250,140,120,237, 81,113,181,116, 69, 52, 82, 83,238, 87,229,228,
-242,231,252,124,139, 47,139,236,223, 70, 98,208, 87,231,196, 93,189, 24,208,253,229,190, 0,208,249,192,222,205, 23,162,223, 52,
- 13,136,222,253,124, 22,240,127, 70,113,181, 66, 40,156, 60,120,237, 90,247,240,153, 51, 69,213,217,217,198,204,239,190,211, 20,
- 95,186,100,102, 36, 18,206,119,200, 16,158, 91,191,126,210,153,201,201,162, 43,159,125, 22, 33, 92,190, 60,240, 35,163,113,215,
-127, 42,115,232,134, 13,110, 29,167, 79, 23, 85,102,102, 26, 83,191,250, 74, 91,244,203, 47,172, 72, 42,181,248, 12, 29, 42,240,
- 24, 52, 72, 50,243,238, 93,209,181,213,171,123, 50, 75,150,180, 88,108, 50,253,248,156,108, 59,105, 70,129, 5,185, 92,142,189,
-123,247, 66, 40, 20, 66, 40, 20,130, 97,152, 6,255,239,239,239,111, 77, 17, 52,218,197,197,229,235,121,243,230,121, 12, 31, 62,
- 28, 78, 78,191,159,101, 99,216,176, 97, 24, 58,116,168, 40, 43, 43,107,220,129, 3, 7,198,237,220,185,179,168,186,186,122, 78,
- 81, 81,209,225, 38,222,188,251, 5, 4, 4, 28,222,187,119,175,141, 86,171, 69,108,108, 44,202,203,203, 33,145, 72,224,237,237,
-141,222,189,123, 51, 49, 49, 49,206,227,198,141, 59,204,231,243,135, 21, 20, 20,196, 88,241,198,218,217,201,201, 41,118,211,166,
- 77,210,214,173, 91,243,210,211,211,209,161, 67, 7, 0, 64, 89, 89, 25,134, 13, 27, 38, 29, 53,106, 84,208,172, 89,179,174,177,
- 44,219,183,184,184,248,102, 19,219,222,201,195,195, 99,199,144, 33, 67,188, 62,252,240, 67,123, 91, 91, 91,228,228,228, 20, 42,
- 20,138,144,218, 34,104,228,200,145,226, 65,131, 6,121,110,220,184,113,253,201,147, 39, 23,148,148,148, 76, 46, 42, 42,186,213,
-104,181,202,231,251,220,186,117,203, 93, 38,147,161,184,184, 24,187,118,237,194,172, 89,179,192, 48, 12,148, 74, 37,246,239,223,
-143, 57,115,230,128,207,231,163,178,178,210,170, 34, 88, 38,147, 13, 12, 14, 14,222,114,254,252,121, 31, 71, 71, 71,120,121,121,
-241,151, 44, 89, 18, 22, 24, 24,104,227,233,233,201, 47, 40, 40,192,225,195,135, 3, 39, 78,156,120, 52, 55, 55,119,170, 94,175,
-111,242,212,153,139,139,203,214,157, 59,119,250, 37, 36, 36, 96,227,198,141, 80,169, 84, 16,139,197,112,112,112,128, 66,161, 64,
-203,150, 45,121, 51,103,206,148,245,235,215, 79, 22, 29, 29,189, 21, 64, 71, 43,218,111, 7,119,119,247,239,251,245,235, 23, 24,
- 29, 29,237,232,233,233, 9,153, 76, 6, 0,168,168,168,240,201,201,201,233,190,108,217,178, 49, 55,111,222,204, 82, 42,149,239,
- 0, 72,104,230,241,209,177, 77,155, 54,195, 70,141, 26, 37, 40, 42, 42,194,230,205,155,135, 85, 84, 84,116,180,182,168,252, 95,
-116,249,202, 37,244, 27, 50, 14, 90,214, 70,120,252,200, 46,174,234,204,151, 46,182,142,142, 12, 0, 84,171,213,236,208, 55, 63,
-176, 12, 27, 49,193,216,127,200, 72,205,133,211,187,101,214, 20, 88, 98, 17,227,178,111,203,140,188, 75,113,105,161,103, 46,228,
- 12, 28, 53, 98, 32,159,145,183, 10, 2,128, 15,222,127, 91,252,211,177, 95,190, 25,220,255,165,194,136,238, 33,121,111, 76,251,
-206,183, 57,197, 85, 96, 96,224,197, 51,103,206,120,136,197, 98,148,151,151,187,108,219,182,237,203,238,221,187,243, 51, 50, 50,
-112,255,254,125,100,103,103, 67,173, 86,163,107,215,174,182,247,238,221,219, 8,160,193, 2,235,219, 67,248,248,179,133, 30, 27,
-220, 60,221, 2, 76, 6,189, 27,171, 47,110,123,254, 76, 66,251, 67,251, 53,157,220, 21, 62, 33,227, 38, 76,199,194, 37,159, 11,
-143, 28,220,177, 20, 49,103, 17,219,216, 40,254, 60,188,252,143, 15, 23,161, 82,163,199,132, 55,223,198,196, 9,111,187,112, 22,
-131, 39,103,209,201, 13,186,114, 71, 7, 81,202,137, 29,219,246, 71, 1,240,121,162,200, 58, 79, 69, 86,253, 86, 48, 76,183, 87,
-190,248,194,189,195,204,153,146,132,229,203,107, 74, 47, 93,210,182, 24, 58,180, 60,124,198, 12, 61, 0, 84,101,103,139, 82,151,
- 45,147,185, 69, 68,216,244,252,191,255,115, 52,105, 52,138, 21,159,124,210,117, 41,112,163,185,153, 1,227,199,155,215, 28, 62,
-220, 37,238,179,207,250, 98,229, 74, 65,191,240,240,219, 75,190,251, 46,223,154,204, 85, 12,211, 61,242,155,111,220,219,189,245,
-150,228,230,162, 69, 53,234, 27, 55,180, 65, 81, 81,170, 46,115,231, 26, 32, 16, 64,147,159, 47,204, 88,190, 92,238,208,173,155,
- 77,143, 15, 62,112, 52, 27, 12, 30,209,203,150,117,107,172,135,104, 5,195,116, 27,178,110,157, 91,135, 25, 51, 36, 9,171, 86,
-213, 20, 92,184,160,175, 12, 13, 69,199,215, 94, 43,243,118,113,209, 63,235,182, 63,153, 89, 26, 19,243,135,247, 39,169,239,101,
-160, 1, 45, 91,182, 44, 78, 73, 73,113, 63,116,232,144, 85, 5,150,151,151, 23,122,247,238,173, 76, 74, 74,242,104,228, 5, 49,
- 47, 47, 47,207,135,101, 89,136,197,226, 70, 87,172,170,170, 10,137,137,137, 24, 55,110, 92,126, 97, 97, 97,131, 47,186, 78, 78,
- 78,118, 78, 78, 78,153, 49, 49, 49,174,247,238,221,195,205,155, 55, 17, 24, 24, 8, 39, 39, 39, 8,133, 66,152, 76, 38, 84, 85,
- 85, 33, 56, 56, 24, 50,153, 12, 67,135, 14, 45, 85,169, 84,129,229,229,229, 13,190,136,249,251,251, 75,132, 66, 97,218,161, 67,
-135,124,195,194,194,112,227,198, 13,248,250,250, 66,161, 80, 0, 0,178,179,179,113,229,202, 21, 68, 70, 70, 34, 41, 41, 9, 51,
-102,204,200, 51,153, 76, 33, 15, 30, 60,208, 55,120,186, 32, 52,180,240,192,129, 3,249,173, 91,183,214,213,212,212,240,139,139,
-139,133,151, 46, 93, 98,171,171,171,109,213,106,181,176,162,162,130,169,168,168, 16,214,212,212, 8,249,124,190, 72,175,215, 11,
-227,226,226, 4, 42,149,170,209,129, 45, 91,181,106, 85,124,255,254,125,247, 99,199,142,161, 93,187,118, 56,116,232, 16,230,207,
-159,143, 43, 87,174,192,199,199, 7, 7, 15, 30,196,252,249,243,113,255,254,125,184,185,185,161,127,255,254,141, 62, 71, 0, 16,
- 20, 20,148,158,152,152, 24, 36, 22,139,145,145,145,129,252,252,124, 68, 68, 68,192, 98,177,160,168,168, 8,105,105,105, 40, 40,
- 40, 64, 80, 80, 16,222,124,243,205,140,135, 15, 31, 6, 55,213,208,194,195,195, 75,206,159, 63,239,218,190,125,123, 20, 21, 21,
-193,209,209,177,238,203,193,193, 1,142,142,142,104,209,162, 5,230,205,155,135, 14, 29, 58, 40, 31, 60,120,224,209, 84,241, 19,
- 22, 22,118,230,194,133, 11,174,206,206,206,208,233,116,208,233,116,117, 31, 14,100, 50, 25,132, 66, 33, 0, 32, 45, 45, 13,195,
-134, 13, 43,201,204,204, 28,210,140,226,136,239,225,225,113, 63, 33, 33, 33,196,206,206, 14,121,121,121, 72, 74, 74,194,180,105,
-211,210,106,106,106, 90,227, 47,184,110,232, 63, 41,180, 5, 22,223,187,155,220,170, 77,155,208,138, 73, 83,223, 17,142, 28, 62,
-178, 38,254,250, 89,147, 80,127,177,250,149,222, 14, 5, 0,112, 62,174,202, 93, 47,236, 45,234,220,117, 48,239,232,209,163,210,
- 29,219,191,103,238,222, 77, 86,180,105, 27,154,146,156,133, 85, 13,101,191,218,215, 97,210,252,217, 67, 66, 35,122, 70, 48,149,
- 53,156, 98,203,214, 31,186, 62,200,201,244, 0, 0,255,151, 2,139,167, 77,125,251,134,189,156, 87,116,233,202, 37,118,205,215,
-167,147,127,190, 88,177,211,138,222,229, 64, 95, 95,223,107,219,182,109,115,117,117,117,133,131,131, 3, 52, 26, 13,140, 70, 35,
-238,221,187,167,219,183,111,159,201,222,222,222,174,168,168, 8,229,229,229, 96, 24, 6,113,113,113,185,197,197,197,245,125, 18,
-172,187,217,231,192,129,104,166, 79,103, 63, 39, 17,159,179, 17,155, 83,188, 24, 1, 39,230,193,209,227,124,108, 92,135,139,177,
-151, 38, 12, 29,254,134, 91,143,158,253,240,249,170,133,166,236,188,188,142,143, 79, 23,254, 91, 91,104, 29,128,254,163, 70, 71,
-141, 93,177, 52, 26,209, 43,150,227,196,241,159, 42,108,109,248,122,123, 59,161, 67, 68,175,158,186,121,115, 94,207,211, 84,169,
-125,191, 92,187,102,252,160, 33, 81, 62,221, 95,238,139,184,171, 23,113, 96,239,230,155, 34, 9,157, 46,124, 82, 52,224,228, 24,
- 24,248,206,236,180, 52,209,157,232,232,106,182,160,160,188,243,220,185,165,245, 45,155,127,238,156, 92,236,229,101,239, 50, 98,
-132,211, 90,127,127,152,148,202,239,235,187,134,168,190,204, 27,158,158,142, 71, 98, 98, 6, 88, 24,166,207,172,217,179,109, 6,
- 14, 28,136,202,202, 74,156, 56,113, 2,123,118,239,214, 43, 20,138, 68,199, 27, 55,110, 7, 22, 22, 46,174, 47,243, 19,192,217,
-174,101,203,233,179,146,147, 69,241,139, 23, 87, 67,165, 82,133,207,153, 83,102, 54,155,121,211, 87,173, 26,154, 89, 88,216,167,
-184,180,212, 31, 0,220, 29, 29,243, 90,123,122,198,111,216,185,243,222,215,173, 90,113,213, 5, 5,223, 71,215, 51, 7,233,211,
-235,185,239,202, 21,143, 83, 37, 37,127,115,114,114,178, 41, 45, 43, 19,136,132, 66, 85,167,144,144,125,159,207,153, 19,171,189,
-121, 83,252,172,219,222,121,238,220,210, 10,141,134,249,104,195,134,158, 5,101,101, 47,213, 24, 12,193, 21,213,213, 10,214,104,
-228,219,217,216,148,189, 20, 20, 84, 92,121,225, 66,145,127,117,245,123,235, 53, 26, 37,181,202, 63,216,131,197,227,241,192,113,
-156, 85,197,149, 80, 40,252,221,105,168, 70,136, 4, 2, 1,110,220,184, 1,165, 82,137,118,237,218, 33, 32, 32,224,119, 11,100,
-102,102,226,228,201,147, 40, 47, 47, 71,167, 78,157, 0, 64,212, 88,160,157,157,221,251,139, 22, 45,114, 52, 24, 12,136,143,143,
- 71,167, 78,157, 32,149, 74, 33, 20, 10, 33, 18,137,192, 48, 12, 20, 10, 5, 74, 75, 75,225,225,225,129,153, 51,103, 58,108,216,
-176,225,253,242,242,242, 21, 13,101,114, 28, 55,123,220,184,113,238, 97, 97,143,238, 66,205,203,203,171, 93, 23, 0,128,187,187,
- 59,110,223,190,141, 78,157, 58,193,195,195, 3,145,145,145,238, 71,143, 30,157, 13, 96, 77,131, 27, 46, 18,241, 91,183,110,221,
- 5, 0,228,114, 57,248,124,126,170,189,189,189,155,135,135,135,220,222,222,254,223,182,113,219,182,109,106,177, 88,108,178,102,
-167, 22, 21, 21, 33, 44, 44, 12,106,245,163, 99,169,166,166, 6,193,193,193,168,168,168, 0, 0,232,245,122,120,121,121,213, 21,
- 32, 13,105,223,190,125,116,235,214,173, 95,145,203,229, 18,134, 97,144,144,144,128,240,240,112,236,219,183, 15,254,254,254,144,
-201,100, 72, 73, 73, 65,251,246,237, 17, 27, 27, 11, 55, 55, 55,180,109,219, 86,226,238,238,126, 89,165, 82,197, 60,120,240, 32,
-186,145,158, 54,190,173,173, 45, 98, 99, 99,177,117,235, 86,100,101,101,161,160,160, 0,246,246,246,232,216,177, 35, 66, 67, 67,
-209,179,103, 79,164,167,167,131,215,116, 99, 82,132,132,132,156,184,113,227,134, 43,159,207, 71,108,108, 44, 52, 26, 13,116, 58,
- 29, 88,150, 5,143,199,131, 84, 42, 69,143, 30, 61,224,226,226,130,144,144, 16, 28, 57,114,196,109,208,160, 65, 39,139,139,139,
- 59, 2, 40,106,106,159, 58, 57, 57,189,183,116,233, 82, 95, 15, 15, 15, 84, 85, 85, 65,163,209,192,203,203, 11,131, 6, 13,242,
- 62,121,242,228,123, 6,131, 97,237,115,245, 73,203,130,220, 54,109, 67,193,113,120,112,252,200, 46,206,199, 77, 26,214,183,147,
-197, 61,245, 30,211, 35, 46, 46,169, 45, 0, 56,201, 3, 18, 66, 66,141,169,177,191,157,203, 63,113,108, 79,130,217, 12,126,104,
-155,208, 86,124, 14, 15, 27,203, 46,205,231, 31, 61,115, 33,103, 96,251,246,189, 5, 27,190, 92, 54,114,250,212,193, 18,103,167,
-222,188,202,252,253,184,114,235,142,255,146, 37, 31,186,175, 92,249,217,241, 51, 23,114,204,165,249,252,143,173, 89,223,160,151,
-156,191, 58,244,133,208,181,170,106, 55, 18,210,109,193,179,105,143,128, 22, 65,168,172,172,132, 68, 34,145,142, 31, 63,222,188,
-104,209, 34,141,157,157,157,236,113, 91, 86,242,249,252,193, 77, 6,223, 79, 6,219, 46,152, 21,218, 25, 44, 22,206, 86, 11, 93,
-133,232, 78,122, 38,122,247,139, 44,238,218,169,227,170,207,214,172, 93, 28, 24,220,202,109,252,164,119,132, 95,124,190,248, 59,
-128,235, 93,111, 76, 54, 46,240, 14, 29,177, 1,240,234,138,165,209,200,204, 76,115,154, 62, 90,189,156, 17,216,120,181,110,215,
-199,238,187,109,231,134, 4,183,108,245,210,244,153,239,253,188,105,227,250, 87,159,236,201,218,187,123,211, 81,192, 60, 0,214,
- 93,155,243, 34,104, 63,241,196, 9,104,114,115, 77,170,203,151,117, 3,190,254,186,180,211,164, 73,107,141, 38,147, 43,143,199,
-251,221,165, 16, 60, 30, 15,176, 88,120,204,154, 53,124,206,203, 11, 38, 71,199, 41, 72, 77,109,217, 84,230,103, 38,211,232, 81,
- 29, 59,190,186,101,215, 46,248,251,251,215,101, 58, 56, 56, 96,246,236,217,152, 57,115,166, 36, 49, 49,177,219,201,147, 39,187,
-237,252,230, 27, 15,148,148,140,126, 58,208, 8,180, 27,127,236, 24,170,179,179,141,170, 27, 55,116,253,215,175, 47,187,248,219,
-111,206, 31,126,243,205,146,118,225,225,222,223, 70, 71, 75,252,252, 30,221, 31,146,155,155, 27,188,126,221, 58,191,126,131, 6,
-245, 92,248,193, 7,219,110,207,155,215, 6,143,166,100,107,112, 61,139, 46, 93, 50,156, 82,169,254,118,224,224, 65,199, 86,173,
- 90,129,227, 56,164,167,167,187,111,221,186,245,157, 62, 51,103, 78,252, 96,220,184, 37,131,178,178,202,205,101,101,226, 97, 95,
-125, 37,220, 59,118,108,219,166, 50,107,247, 39, 0,188, 54,127,254,251, 93, 95,126,185, 77,228,248,241,206, 94, 94, 94, 60, 27,
- 27, 27, 24,141, 70, 20, 21, 21, 57,165,164,164, 4,157,175,168,168, 60,123,251,246,143,208,104, 6, 81,147,252,131, 5, 22, 0,
-152,205,230,102, 21, 88, 86, 22, 89,117, 61, 94,165,165,165, 72, 74, 74,130,191,191, 63, 76, 38, 19,206,156, 57, 3,181, 90, 13,
-145, 72, 4,145, 72, 4,131,193,208,100,150, 92, 46, 31, 24, 17, 17,193, 92,189,122, 21, 1, 1, 1,176,177,177,169, 43,172,106,
-139, 44,161, 80, 8,133, 66,129,138,138, 10,244,234,213, 75,184,117,235,214,129,104, 96, 30, 64, 0,176,181,181, 29, 58, 98,196,
-136,186, 46,182,154,154, 26, 8, 4,143,238,180, 54, 24, 12,168,170,170, 66, 89, 89, 25, 42, 42, 42,160,211,233,208,161, 67, 7,
-241,133, 11, 23,134, 54, 86, 96, 61, 73,163,209, 84, 43,149, 74,199,222,189,123, 59,109,223,190, 61,165, 71,143, 30,191,187,104,
-248,226,197,139, 58,189, 94,207,136,197, 98,171, 46,118,223,181,107, 87,221,190, 47, 40, 40,192,247,223,127, 15,139,197, 2, 30,
-143,135,180,180, 52,108,216,176,161,238, 90,185,198,158,163,214,173, 91, 71,254,248,227,143,157,119,238,220, 89,206, 48, 12, 82,
- 82, 82,176,123,247,110,112, 28, 7, 87, 87, 87,104, 52, 26, 40,149, 74,172, 93,187, 22, 70,163, 17,182,182,182,240,246,246,150,
-206,158, 61,187,215,242,229,203,133,141, 21, 88,102,179,217, 44, 16, 8,224,231,231,135,165, 75,151, 66,167,211, 65, 36,122, 84,
- 87, 86, 86, 86, 66,173, 86, 35, 62, 62, 30,217,217,217,176, 88, 44,141,190,177, 72,165,210, 49, 59,118,236,112, 23,139,197,208,
-233,116, 72, 75, 75, 67, 70, 70, 6, 82, 82, 82,244, 42,149,138,181,181,181,229,121,122,122, 10, 42, 42, 42,196,147, 38, 77,226,
- 85, 85, 85,129,227, 56, 68, 69, 69,185,108,217,178,229,117,131,193,176,174,137, 93,234,166, 80, 40,254, 49,125,250,116,105,237,
-126,179, 88, 44, 40, 41, 41,193,216,177, 99,101, 49, 49, 49,139, 12, 6,195,110, 0, 37,207,203, 11,193,147,119, 11, 86,157,249,
-210,229,236,217,111, 95, 74,189,199,244, 16,160,172, 91,120,159,247, 24, 0,184,127,115, 91,207,244,228, 27,102, 91, 11, 47,243,
-231,221,107,174,217,133,188, 83, 6,224,104, 99,189,128, 67,123, 57, 14,145,201, 69, 81,163, 70, 12,228,111,217,250, 67,215,233,
- 83, 7, 75,220, 59,252,192, 3, 0, 39,137, 15, 94, 54,125,192,215, 25,106,164, 91,182,254,208,117,212,136,161,215,179,115, 30,
-172,117, 81, 56, 30, 57,249,171,250,116, 99,189,132,158,174,140,183,147, 77, 41,156,124, 7,194, 63,212, 9,241,241,241, 56,122,
-248, 42,130, 91,117,129,193, 96,128,201,100,146, 15, 27, 54, 76,115,240,224, 65, 93, 89, 89, 89,149,209,104,236, 83, 88, 88,152,
-218,100,125,133, 82, 75, 7,190,197, 40, 54, 11, 89,109,141,184,102,206,146,195,175,119,125, 57,178,147,179,159,183,208, 69,202,
- 30,239,219, 39, 98,215,158,157,223,207,251, 96,225, 74,116, 8,239,241,242, 28,209,111,109,191,218,101,186, 83, 95, 86,114, 14,
- 78,240,143, 28, 97, 51, 83,211, 95,125,144,151,147,223,210, 87, 97,200,200,229, 76,239, 45,250,110, 80,239,129, 99,218, 7,181,
-234, 46,190,123,255, 42,111,222,220,121,123,190,252,114,245,248,218, 34,235, 82,236,153, 62,209, 83,114,196,209,219,161,167,183,
- 40, 64, 36,145,248,216,250,251, 51,217,219,183,107, 3,135, 15, 47, 7, 0, 19,203,186,198, 93,191,238, 32,147,201,192,113, 28,
- 76, 38,211,239,174, 17,174,189, 46,120, 96,223,190, 30,214,100,230,125,251,109,251, 89,179,102,161,168,168, 8, 44,203,214,245,
-126, 63,241,154,141,202,202, 74,140, 30, 61, 26,219, 54,110,172,247,188,184, 80, 34,241,181,245,245,101,178,183,111,215, 6,189,
-250,170, 10,102, 51,111,225, 55,223, 44,253, 96,193,130,128,177,175,191,254,187,207,141,161,161,161,248,118,227, 70,241,238,221,
-187,189, 63,219,184,113,106,164, 68,146, 9,189,190,209,245,172,106,219, 22, 78, 73, 73, 54,173, 90,181,170, 43, 40, 67, 66, 66,
-240,249,231,159, 75, 38, 76,152, 32,158, 60,113,226, 23,119, 91,181, 90, 31,157,157,157,238,210,178,165, 61, 35,145,248, 52,149,
- 89,187, 63, 1,160,218, 96, 8,139, 94,185,210,233,250,245,235, 40, 40, 40, 0,199,113,117,127,167,125,251,246,188,215, 95,127,
-221,161,123,231,206, 93,169, 69,254, 73, 61, 88,245, 21, 88, 13, 21, 90,214, 22, 87, 79,255, 13, 79, 79, 79, 24,141, 70,252,240,
-195, 15,117,133, 85,221, 39, 2,163,177,201, 12,157, 78,215, 78,161, 80,160,178,178, 18, 45, 91,182,172,203,168, 93,175,218, 47,
-169, 84, 10,157, 78, 7,111,111,111,232,116,186,118, 77, 20, 64, 29, 29, 28, 28,106,123,179,160,127,220, 72, 13, 6, 3,212,106,
- 53,212,106, 53, 12, 6, 3,202,203,203, 81, 93, 93, 13,181, 90,141,170,170,170,112,107,182,217, 98,177, 32, 41, 41, 41,163, 85,
-171, 86, 29, 5, 2, 1,108,109,109,229, 53, 53, 53,168,189,153, 64,165, 82, 97,199,142, 29, 53,147, 38, 77,114,141,139,139,211,
- 90,179, 15,231,204,153, 3,137, 68, 2,141, 70,131,141, 27, 55, 98,206,156, 57, 16,137, 68,168,170,170,194,198,141, 27, 49,111,
-222, 60, 48, 12, 3,189, 94,143,125,251,246, 53,252, 38,123,239, 94,118, 92, 92, 92,120,167, 78,157,156,142, 28, 57, 82, 50,112,
-224, 64,183,193,131, 7,215,237, 59,150,101,209,173, 91, 55,180,110,221, 26, 74,165, 18,167, 78,157, 42, 13, 9, 9,113,189,126,
-253,186,165,168,168,232, 65, 19,219, 93, 87, 52, 9, 4, 2,152,205,102, 20, 23, 23, 67,173, 86,163,164,164, 4, 5, 5, 5,200,
-207,207, 7,195, 52, 61,114,136,139,139,203,107, 97, 97, 97,130,199,197, 22, 90,180,104,129, 15, 62,248,128,213,106,181, 99, 1,
-156,122,188, 88,228,158, 61,123,142, 4, 7, 7, 51, 94, 94, 94, 72, 75, 75,131,155,155, 27, 99, 99, 99,243, 70, 83, 5,150, 66,
-161,216,118,252,248,113,231,218, 59,104,107,105,181, 90,176, 44,139,113,227,198, 57,111,217,178,101,155,209,104, 28,250, 60,190,
- 40,216, 58, 58, 50,175,244,118, 40,136,139, 75,106, 27,222,231, 61,198,185,229,178, 71, 5, 56,192,196, 95, 90, 31,222,187, 91,
-216,238,218,235,178, 26, 51,106,128,219,154,225,145, 29,248, 19, 70,119,206,100,228,173,130,118,237, 88,239,225,236,212,251, 95,
- 47, 20,140, 51,228, 82,160,181,191,153,127,237, 68,166,199,188,121,173, 12,187,191,251, 91,230,174,195, 55, 7,138,196, 9,253,
-127, 58, 95, 50,175,161,236,187,153,166, 99, 21, 58,231, 80,135,138,195, 60,184,188,141,240,240,112,184,185,121,225,219, 77, 63,
-194,251,165, 78, 48, 24, 12,176,183,183,151, 61,122, 25, 49,238,178,166,184, 2,128,232,232, 88, 75, 68, 68, 31, 35,227,230,202,
-206,158,253,229,232,193,145,163, 67,251,244, 29,192,157, 59,119,218,248,114,168,177, 96, 64,159,238, 69, 23, 99, 99,211,138,138,
- 30,134,180, 14,109,143,148,187, 55, 7,115, 28,146,120,188,250,123,155,238,102,225,180,142,119, 47,102,223,130,233, 22,173, 33,
-222,102,213, 55,119, 34, 95, 29, 57, 57, 44,162, 87,111,203,185, 95,206, 26,196, 80, 39,219,246,122,249,225,228,137,111, 28,217,
-183,255,208, 43, 49,191,156, 8,174, 80, 23,159, 88,243, 35, 21, 87,117, 31,206, 88,214,131,145, 72,248,197, 49, 49,108,135,105,
-211,234,246,139, 76, 38,195,209,163, 71, 33, 22,139, 33, 18,137, 32, 22,139,235,190, 68, 34, 17, 20, 10, 5,120, 28,199,111, 78,
-102, 97, 97, 33,138,138,138,224,224,224, 0, 55, 55, 55, 20, 21, 21,225,202,149, 43, 72, 75, 75, 3,195, 48,136,140,140, 4,191,
-129,247,205,167, 50, 13,127, 91,177, 98, 72,219,246,237,189,158, 46,174,106,223,219, 84, 42, 21,250,244,233,195, 59,119,238,156,
-219,165,204,204,145,208,235,127,108, 44,179,221,136, 17,101,202,243,231,235,253,219,109,218,180,225, 29, 57,122, 84, 50,126,220,
-184,185,159,111,218,180,110,201, 23, 95, 20,129,101, 21,205,217,118, 30,143,199,231,241,120,240,245,245,133, 74,165, 66,117,117,
-117,109,135, 3,156,156,156, 96, 50,153, 96,177, 88,132,212, 34,173,199,111,170, 24,120,186,144,106,232,139,207,231, 63, 83,145,
-213, 24,107, 10,172,218, 34, 67, 34,145,252,238,224,170,253,122,242,224,171, 45, 98,172, 32,168,172,172,196,225,195,135,161, 82,
-169, 80, 85, 85,245,187,226,170,182,231, 42, 43, 43, 11,123,246,236,193,195,135, 15, 33, 16, 8,172, 26,180, 53, 43, 43,235,102,
- 64, 64, 64,199,218, 30,177,126,253,250,249, 92,190,124,185,160,182,152, 91,188,120,113,105,247,238,221, 93,159,126,115,111,116,
-101, 5, 2, 92,185,114, 5, 26,141, 6, 28,199, 65, 36, 18, 33, 37, 37, 5, 44,203,130,227, 56, 48, 12,131,146,146,146, 38,123,
-176,146,146,146,222,154, 58,117,234,186,105,211,166,197, 44, 92,184,240, 92,255,254,253,243,120, 60, 30, 76, 38, 19,236,237,237,
-161, 80, 40,144,154,154, 10,173, 86,139,247,223,127, 63,119,231,206,157,191,108,220,184, 49,102,243,230,205,235,242,243,243,167,
- 54,231,185,101, 89, 22, 53, 53, 53, 40, 47, 47,135, 74,165, 66,101,101, 37,116, 58,221, 51,181,161, 1, 3, 6,224,196,137, 19,
-130, 1, 3, 6,108,241,247,247, 47,242,247,247, 47, 26, 48, 96,192,150, 99,199,142, 9,188,189,189,145,151,151,135,248,248,120,
-168, 84, 42, 88, 44, 22, 94, 19,189,171,253, 38, 78,156,216,203,207,207,143,103, 52, 26,161,215,235, 97, 48, 24, 96, 52, 26, 97,
- 54,155,145,155,155,139, 54,109,218,240,253,252,252,122, 0,232, 71, 47, 33,205, 83,153,191, 31,156,242,107,112,170,189,176, 40,
-191, 65,141,238,217,114,202,203,203, 63,126,247,147, 10,165,185, 34, 6,247,110, 29, 70,149,150,129, 79,112, 63,188, 51,109, 28,
-126,187, 30,131,178,178, 50, 36, 39, 39, 35, 34, 34, 66,196,227,241,154,213, 54,247,238, 61, 97, 30, 63,238,255, 94, 31, 48,120,
-116,231, 1, 3,135,154,207,157, 59,175,191,113,237,244,205,224, 0,123, 37,199,170,139, 29,236,101,183,210, 83,147, 17,210,170,
- 13, 76,172, 37, 2,136,110,180, 77,101,102,194,240,115,145,167,249,245, 57, 73, 19, 7, 15,159,210, 97,192,192,193,166, 51,167,
-143,155, 47,159, 61, 24, 63,184,223, 75,177,159,174,222,237,171, 50,181,108, 43,181, 87,156,236,209, 81,214,123,198, 40,191,233,
-212, 82,234,233,117,146, 74, 45,120,252,186,201,227,241, 96,177, 88,126, 87, 84, 61,253,101,205,123,210,147,153,181, 56,142,131,
- 90,173, 70, 90, 90, 26, 86,175, 94,141,219,183,111,195,108, 54,215,245,100, 53,248, 62,244,248,148,174, 72, 42,181, 0, 64,102,
- 97, 97,159, 89,179,102, 73,234, 43,174,202,202,202, 80, 90, 90,138,135, 15, 31, 34, 50, 50, 82, 84,233,236,220,177,169,245,244,
-118,119,215,203,164,210,226,212,212,212,127, 91,223,170,170, 42, 72, 36, 18,124,253,205, 55,162, 19, 73, 73,115, 46, 95,185,226,
-216,156,253, 89,155,195,227,241,224,238,238,142,160,160, 32,132,135,135,163, 93,187,118,144, 74,165,184,123,247, 46,190,255,254,
-123, 8,120, 60,150, 90,226,159,208,131,213, 80,129, 85,223,255, 25,134, 65,115, 10, 2,107, 89,115,138, 80, 42,149,222, 41, 46,
- 46,238,233,227,227, 3,147,201, 84,215,123, 85,123,154,176,246,123, 0,144, 72, 36, 72, 78, 78,134, 84, 42,189,211, 88,166, 76,
- 38,187, 35, 16, 8,122,116,233,210, 5, 71,142, 28, 65, 76, 76, 12,178,178,178,160,213,106,161,211,233,160,213,106,113,247,238,
- 93, 88, 44, 22,132,133,133,193,193,193, 1, 50,153,236, 78, 83,235, 90, 83, 83, 83,200, 48, 76, 43, 27, 27,155,127,157,234,240,
-244, 68,105,105,169,197,100, 50, 97,199,142, 29,149, 10,133, 66,110, 99, 99, 99,245,254,228,241,120, 80, 42,149,240,245,245, 69,
-101,229,163, 97,190,170,170,170,224,238,238, 14,163,209, 8,139,197, 2,189, 94, 15, 91, 91,219,186, 46,223,198, 58, 4,211,211,
-211, 63,120,226,251, 46, 99,199,142,221,179,111,223,190, 22,191,252,242, 11,174, 95,191, 14, 87, 87, 87,124,242,201, 39, 89, 57,
- 57, 57,227, 1,252,166, 84,254, 63,246,174, 59, 60,138,234,237,158,153,237,233,189, 46, 9, 36, 33, 36, 33, 9, 37, 36,160,244,
- 42, 16, 64, 1, 41, 42, 8,136, 8, 40,162,136, 82, 68,169, 34, 72, 19,108, 72, 7,233, 82,165,151, 64, 2,129, 72, 47,105,132,
-244,178,233,125,179,125,103,230,126,127,144,240, 11, 24,146, 77, 64, 63,203,156,231,217, 39,187,147,153, 51,183,205,189,103,222,
-247,222,247,254,245,243, 29, 75, 74, 74, 14,198,198,198,190, 28, 22, 22,246,184,119,232,217,179, 39,213,179,103, 79,199,218, 38,
-253,146,146, 18,220,189,123, 23, 81, 81, 81, 48, 26,141, 72, 72, 72, 96, 53, 26,205,222,250,250, 28,185, 92,190,253,203, 47,191,
-180,100, 24, 6, 2,129, 0, 34,145, 8, 12,195, 64, 42,149, 62,182,212,102,101,101, 97,216,176, 97, 54,235,214,173,219,166,211,
-233, 90, 2, 48,252,155, 58,133,170,242,114, 38,226,119,165,179,157,133,215,221,196,155,219,186, 4, 84,247, 19,137, 55,183, 50,
- 50, 11,143,107,215,238,106,172, 58,201,202, 27,236,104,143, 68, 20,125,106,208,223, 24,112,250,252,253, 97, 51, 63,158, 36,105,
-222,194,167,224,202,173,251,205, 59, 27,103,210, 22, 50, 64,165, 5, 74, 43,128,196, 76, 1,215,188,133, 79,193,141, 91, 15, 36,
-171,215,110,246, 81,171,244, 53, 46,194,103, 66,161, 80,104, 47, 19, 50,116,230, 26,243,168, 55,198, 8, 36, 18,153, 61,148,165,
-201,104,222, 92,142, 81, 67,187,224,135, 77,103, 97, 99,107, 7, 23, 23, 23, 80, 20,101,209,136,236, 83, 49, 17,183, 39,190,253,
-206,228,151,250,189, 18,206,158, 57,123, 18, 17,103, 14, 93,219,190,118,238, 33,131, 80,105, 65,179, 85,102, 30,205, 92,239,165,
-167, 37,189,213,189,231, 43,144,153,153,183, 4, 2,234, 28,197, 91,183,192,219,160,225, 9, 14, 89,135,118, 46,148,189,253,206,
-123,157,251, 15,124,149, 57,115,234, 8,206, 28,251,229,247, 5, 31,182, 56,153,118,119,183, 56,230,122,142,108,232,136,169,101,
-199, 35, 18,244,175, 47,246, 74,114,111,213, 94, 3,164,241,163, 83,205, 11,164, 80, 88,192,232,116, 30,205,250,247, 23,168, 51,
- 51, 69,150, 46, 46, 76,205, 75, 90,237,151,234,167, 45, 88, 52, 77, 3, 52,205,153,194,105,106, 90, 52, 26, 13,184,103,196, 62,
-164,106, 56, 7, 14, 20,168,115,114, 68,133, 37, 37, 45, 90,180,104,241,196, 57, 70,163, 17, 37, 37, 37,143, 63,229,229,229,144,
-201,100, 40, 53, 26, 93, 76, 73,103,247,182,109,119,172, 89,189,250,211,141,155, 54, 61,118,245, 40,149, 74, 84, 86, 86,162,162,
-162, 2, 52, 77, 99,214,236,217,210,217,139, 23,127, 48, 88, 40,156, 1,134, 49,185, 60,107, 94,214,105,154,134, 80, 40, 68,102,
-102,230,227, 79, 86, 86, 22,100, 50, 25, 8, 69,113,124,139,124, 1, 2,171,102,146,123, 67,226,170,230,187, 64, 32, 48,205,220,
- 91,253, 38,240,162, 44, 88, 42,149,234,124,116,116,116,167,254,253,251, 11, 99, 98, 98,224,230,230,246, 7, 55,161, 80, 40, 4,
- 69, 81, 48, 55, 55,199,169, 83,167, 12, 42,149,234,124, 3, 15, 81, 68, 68, 68, 68,232, 39,159,124, 34, 26, 63,126, 60,226,226,
-226, 48,101,202, 20,148,149,149,161,178,178, 18, 37, 37, 37,208,104, 52,232,212,169, 19,100, 50, 25,146,147,147,141, 26,141,166,
-161, 80, 5,164,176,176,176,202,201,201,201,237,233,127,140, 24, 49,194,229,167,159,126, 82, 39, 38, 38, 26,187,116,233, 98, 13,
-160, 81,130,117,207,158, 61,143,235,236,193,131, 7, 88,191,126,253,227,121, 8,183,110,221,194,170, 85,171,192,178,172, 41, 2,
-235,105,220, 40, 46, 46,102, 12, 6, 3,124,125,125, 33,151,203,161,209,104,176,110,221, 58, 6,192,141, 63,163, 65,154, 98,193,
-210,106,181, 7,198,141, 27, 55,251,206,157, 59,110, 98,177,184,198,116, 13,142,227, 96, 48, 24,144,145,145,129,132,132, 4, 36,
- 39, 39,163,184,184, 24,132, 16,232,245,122,220,186,117,171,220,104, 52,238,127, 22,175,147,147,211, 23, 91,182,108,113, 53, 51,
- 51,251, 67, 96,221,154, 78,167,198,245,234,236,236,140,158, 61,123, 58, 95,184,112,225, 11,131,193, 48,255,159,222, 17,212, 68,
-104, 39, 28,146,195,223,154,201, 77,157, 50, 81,220,170,181, 33, 41, 57,225, 58,123,251,210,186, 16, 0,144, 89,120, 92,107,229,
-223, 33,254,114,172, 37, 55,232,237, 89,237, 3,188, 33,160, 8,252, 41,130,226,167, 35,190,215,188,163,157,140, 46, 63,217,209,
-199, 46,250,200,111,231,127,156, 51,115,210,245, 47,191,156,227,172,213,171,100, 1,205, 89, 26,120, 36,174, 98,226, 44,180, 75,
-150, 76,186,190,124,245, 14, 46, 43,197, 48,227,122,106,249, 51, 87,248,214, 22, 45, 52,157, 43,115,245,153,145,235,213,170,119,
-139,123,191,111,160, 28,173, 5,176,106, 61, 24, 3, 7,188,130,115, 17,209,200,204,211,160,250, 5,160,222,176, 7,173,155, 99,
-108, 13, 39, 69, 67, 54,118,194,123,221, 7, 14,124,149,156, 60,241, 27,115,228,215, 95,162,247,236, 93,181,159, 22,139,133, 6,
-206, 90, 79, 9,180,229,172,192, 54, 78, 85, 81, 10, 0, 16, 9,197,214,245,248, 7, 60,227,227, 18,253, 3, 3, 3, 92,199, 78,
-152,108, 19, 62,240, 53,114,242,228, 17,110,255,174, 29, 23,247,127,215,102, 23,103,172, 20,231,101,168,165, 21, 74, 99, 5, 17,
- 72,108,171,148,156,186, 64,219, 82,235,254,251, 8, 3,112,128, 31,157,106,198, 1,157, 46,167, 42, 59,219,205,190, 71, 15,105,
-242,194,133,230, 46,157, 58,105, 41,138,106, 80, 96, 9, 4, 2,144,103,204,227,123,154,179, 49, 2,139, 80, 84,157,139,143, 88,
-157, 46,187, 42, 51,211,205,177, 71, 15, 89,202,252,249,230,117, 89,237, 75, 74, 74, 80, 90, 90,250,132,192,170,238,107, 76, 74,
-231,202,143, 63,254, 61,108,252,248,210,152,152, 24,151,151, 95,126,153,170,172,172,124, 44,174,106,190, 59, 57, 57, 81,158, 45,
- 90, 88,157, 87, 40,124,234,154,131, 85, 87,121,154,146,119,154,166,159, 89,158, 60,158,195,130,101,170,192, 50, 97,112, 52, 26,
-141, 70, 56, 59, 59,163,184,184, 24, 28,199, 61,179, 34,205,204,204,106,124,192,245,174,164, 83, 42,149,107,151, 44, 89, 50,173,
- 87,175, 94,142, 1, 1, 1, 40, 42, 42,130,179,179, 51, 4, 2,193,227,116,213,240,197,198,198, 98,223,190,125,149, 74,165,114,
-109, 3,249,254,246,231,159,127,254, 32, 60, 60,220,222,201,201, 9,118,118,118,184,119,239, 30,108,109,109,161, 84, 42,241,224,
-193, 3, 88, 89, 89,129,162, 40,232,116, 58, 92,186,116, 73,201,113,220,183, 13, 60,152,228,202,149, 43, 6,115,115,243,123, 37,
- 37, 37,130,226,226, 98, 65,117,120, 6, 81, 69, 69,133,232,244,233,211,142, 54, 54, 54,234, 11, 23, 46, 20,121,122,122, 10,210,
-211,211, 5,122,189,190, 65,149, 69, 81, 20, 62,254,248, 99,136,197, 98,232,116, 58,172, 93,187, 22, 51,103,206,132, 80, 40,132,
- 94,175,199,138, 21, 43, 48,111,222,188,199,130,249,216,177, 99,141,106, 32, 53, 19, 72, 13, 6, 3, 12, 6, 3,140, 70,227,159,
-218, 32, 77,116, 17,230, 63,124,248,112,112, 88, 88,216,217, 35, 71,142, 56, 88, 91, 91, 35, 55, 55, 23, 69, 69, 69, 40, 40, 40,
- 64, 97, 97, 33,148, 74, 37,116, 58, 29,108,109,109,145,153,153,137,179,103,207, 86, 86, 85, 85,189,130,122, 86, 16, 10, 4,130,
-113,221,187,119, 23, 62,157, 6,154,166, 31,183, 39,145, 72, 4,137, 68, 2,133, 66,129,238,221,187, 75,162,162,162,198, 1,248,
-199, 11,172,154, 8,237, 65, 65,173,157, 6,191, 58,198, 16,218,177,127, 85,212,141,115, 57,150, 28,149,218,173, 83,240,110, 0,
-184,118, 87, 99,117, 57,214,146,107,215,161, 47, 53,104,176,166,253,246,173, 27, 37,241,113,241, 94,129,193,129,245, 70,244,119,
-108,198,189,214,191,119,139, 60,107, 11, 74,184,100,201,242, 99, 91,182,110,234, 24,115,252,127, 97, 26,150, 44,121, 20,166,161,
-127,239, 22, 76,252,131,164,215,144,138, 95, 76, 21, 45,131, 7,247,191,189,101,219, 62, 40,146,143,185,127,251,169,153, 4, 37,
-133,128,121, 7,116, 15,117,192,205,205, 9,184,123,247,110, 62,199,113,245,187,114,105,120,198,198,198,251, 7, 5, 7,186,190,
- 61,225, 61,155,240,240,215,112,242,228, 81,236,220,182, 49,234,101,219,144, 45,153, 55,138, 5,114,127, 59,177,185,173, 68, 44,
- 20,203,132, 98,161,184,216, 96,124,100, 93, 23,138, 69,214,192,200,122, 7,157, 41,147,199,216,244,238,247, 26, 78, 84,115,126,
-217,126,196,102, 47, 97,107,170,211,167, 43,167,122, 53,247,106,174, 82, 23, 84,210,180,196,160,213,113, 86, 43, 55,103,172, 73,
- 77, 25,151, 10, 96, 53,248, 85,132, 53,184,183, 51, 60,188,227,244,148, 20,177, 83,215,174,102,185, 23, 47,154, 63,237, 34,172,
- 75, 96, 9,133, 66,128,166, 25, 83, 56,169,115,231,104, 0, 16,139,197,207,124,177, 23,139,197, 80,171,213, 96, 40,170,206, 19,
-196,192,189,157,131, 7,119,154,158,146, 34,178,239,213,203,220,233,206,157,172,244,244,116,191,144,144, 16,176, 44,251,132,229,
-170,230,163,213,106,161,215,235, 33,147, 74, 99, 77, 73,103, 66, 66, 69,103, 0, 0, 32, 0, 73, 68, 65, 84,193,165, 75,218,121,
- 19, 38,204,255,224,253,247,191,219,183,127,191,204,218,218, 26,149,149,149, 80, 42,149,143, 63, 58,157, 14,161, 97, 97,162, 95,
- 30, 60, 24,139,178,178, 5,166,148,167, 75,175, 94,234,134,250,228,106,193,202,187, 8, 27, 1,186, 33, 11,214,115,134,105, 8,
-126,138,115,222,192,129, 3,181,105,105,105,240,240,240,120, 44, 82,106,223,211,218,218, 26,182,182,182,136,143,143,199,150, 45,
- 91, 52, 20, 69,205,171,143,179,172,172, 76,169,213,106, 71,191,241,198, 27, 26,145, 72, 4,127,127,255,199,110, 29, 66,200,227,
-185, 87,177,177,177, 24, 55,110,156, 90,171,213,142,174, 35, 6,214, 19,156,153,153,153, 21, 42,149,234,173, 49, 99,198,168, 19,
- 19, 19,209,173, 91, 55,220,185,115, 7, 42,149, 10, 85, 85, 85, 72, 79, 79, 71, 96, 96, 32, 12, 6, 3, 14, 28, 56,160, 86,169,
- 84,111,101,102,102, 86,212,199,169, 84, 42,135,124,243,205, 55,130,147, 39, 79,122,185,187,187, 7,133,133,133, 5,244,238,221,
-187,229,176, 97,195,154,135,135,135,187,181,106,213, 74,219,191,127,127,167,129, 3, 7, 58, 9, 4, 2, 81, 74, 74, 74, 30, 33,
-100, 96,125,156,181, 5, 64, 82, 82, 18, 12, 6,195, 31,230, 92,213,172, 38,100, 89,214,164, 58,170, 75,100,215, 8,171, 26,161,
-101,130, 37, 44,184,142, 52, 54,120,145, 68, 34,169,177,112, 18, 19, 56,239, 36, 36, 36,244,235,220,185,243,237,113,227,198, 41,
-179,178,178, 32, 22,139, 33,151,203,209,188,121,115, 88, 88, 88,160,180,180, 20, 7, 14, 28, 80,159, 58,117, 42,182,178,178,178,
- 39,254, 24, 3, 43,248,169, 52,166,215,213,185, 10, 4,130, 63, 8,172,154,157, 2,104,154, 78,111, 76,121, 54, 17,127, 25,231,
-228, 73, 99,237, 7, 13,121,205,234,232,209,163,178,245,235, 55,199,119,235,246,222, 14, 75,183, 15, 78, 91,186,125,112,186,211,
-203,239,238,254,254,231,109, 15, 15,255,246,155,217,160, 65,195,108,166,190, 55,214, 29, 20, 37,108,136,211, 92, 42,237,212,253,
-165, 86,229,151,174, 92, 98,150,175,222,193,118,233, 22,126,237,187,239,127,222,255,221,247, 63,239,239,210, 45,252,218,242,213,
- 59,216, 75, 87, 46, 49,221, 95,106, 85,110, 46,149,118, 50, 37,157, 83, 38,143,177, 25, 20,254, 26,142, 31, 63,204,236,217,177,
-118,197,209, 72,125,143, 17,179,181, 5,153, 15, 35, 8,242,151,194, 89, 18,141,172,172,172, 10,134, 97,122,213, 49,193,189, 78,
-206,169,239,141,169, 45,174, 46,197,167, 99,211,198,219,183,217,159, 38, 44, 52,238, 62,115, 88,115, 60,234,118,101,212,205,172,
-178,162,135, 21,169, 42,101,165,158,227, 56, 16,142, 21, 44, 90, 4,170,190, 58,234,210,165, 39, 46,156,219,141, 29, 91, 55, 84,
-112, 28,180, 35, 15, 28, 96, 71,254,180,144, 52,111,222,162,249,174, 93,187,169,193, 67,134,218, 16, 2,110,200,208,215,108,247,
-236,218, 67,121,123,123,183,240,241,129,248,159,222,150, 94, 20,231, 66,160,172, 50, 51, 51,234,198,186,117,122,151,209,163,237,
- 37, 46, 46,214,224, 56,170,161, 57, 88,117, 88,176,158,201,233, 98,111,175, 56,115,230, 12,252,253,253, 33,151,203,159,240,200,
-136, 68, 34,120,122,122,194,201,201, 9,103,207,158, 5, 1,110,214,197, 57, 23, 40, 47, 79, 77,141,188,182,114,165,206,101,196,
- 8,187,246,222,222, 55,191, 91,183, 78,207,178,236, 99,171, 85,237,191,101,101,101, 96, 89, 22, 23, 47, 92,208, 87,105, 52, 91,
-234, 75,231,173, 31,126,208,213,228,189,147, 86,171, 26, 26, 26,186,108,236,216,177,134,244,244,116,176, 44,139,218,150,172,194,
-194, 66, 88, 89, 89, 65,163,213, 54,115,118,118, 54, 55,133,179,240,228, 73, 75, 52,208,175, 11, 4,130,167, 93,132,127, 70,189,
-255,119, 44, 88, 12,195,192,195,195,227,137, 56, 35, 53, 19, 7,107, 44, 67, 38, 90,174, 0, 0,185,185,185,191, 48, 12,115,102,
-236,216,177,243,219,183,111, 63,101,198,140, 25, 2,111,111,111, 84, 84, 84,192,206,206, 14, 78, 78, 78,200,200,200,192,193,131,
- 7,217,242,242,242,159, 89,150, 93, 92, 88, 88, 88,100, 2,239, 69, 0,131, 95,121,229,149,125, 31,124,240,129, 77,143, 30, 61,
- 68, 53, 3,224,253,251,247,113,242,228, 73,195,222,189,123, 43,181, 90,237,104, 83,162,184, 3, 64,126,126,254, 89, 0,175,143,
- 31, 63,126,215,176, 97,195,172,180, 90,173, 40, 45, 45, 13,122,189, 30, 12,195,160,180,180,212, 16, 25, 25, 89,165, 86,171,199,
- 84,159,219, 16,223,173,252,252,252, 64,131,193, 48,238,246,237,219, 75, 95,127,253,117,135,206,157, 59,139, 25,134, 65,116,116,
-116, 81, 72, 72,136,115,101,101,165,225,202,149, 43, 37, 90,173,118, 94,110,110,174, 73, 91,229, 80, 20,133,202,202, 74, 56, 58,
- 58, 66,171,213,130,227, 56,232,245,122, 88, 89, 89, 61,222,222,136, 16,242,232,225,104,188,139, 16, 12,195, 8,140, 70, 35,222,
-120,227, 13,112, 28,135,181,107,215,130, 97, 24, 65, 99,121, 44, 45, 45,111,198,197,197, 13, 14, 10, 10,122,156, 30,154,166, 65,
-211, 52,164, 82, 41, 28, 29, 29,225,224,224,128,243,231,207,131,166,233,155, 38,210,222, 45, 46, 46,238,112,230,204,153,206,119,
-239,222,125, 27, 64, 59,131,193,208,140,101, 89,138,166,233, 60,150,101,239, 85, 85, 85,109,129,137, 91,229, 20, 22, 22, 46, 29,
- 55,110, 92,200,158, 61,123, 44,133, 66,225,227,242,162,105, 26, 98,177, 24,142,142,142,144,201,100,104,217,178, 37, 52, 26, 13,
-190,248,226,139, 74,181, 90,189,244,223,212, 33,116,235,210, 29, 23, 78,239, 54,223,177,125,167,146,101, 65, 87,135, 98,120,140,
- 0,111, 8,182,111,221, 40,145, 9,181,118,221,186,116, 55,201,181,162, 55, 48, 37,163, 39,254,236, 81,189, 85,206,210,244,140,
-204,111,119,255,252,110, 42, 0,172, 94,187,217, 39, 43,197, 48, 35,254, 65,210,107,235, 55, 71,118,210, 27, 24,147, 54,192,253,
-159,104,217, 85, 1, 2,109,110,110,238, 53,138,146,123,117,123,199, 48,207,191, 5,245,106, 65, 9,167,160, 40,234,195,220,220,
-220, 84, 83,243,222,185,115, 15, 68,158,219,131, 29,219,118, 85, 80, 28,180, 53,207,223, 1,128, 28, 88, 24, 69,128,168,154, 83,
- 85, 83, 95,199,162,121,179,166,204,172, 84, 86,172, 89,255, 83,253,110,147,182,237, 94, 66,219,118, 47, 97,218,135,159,219, 4,
- 6, 5,120, 2,192,129, 3, 96,131,188,226,143,205, 95,188,240,213,197,243, 23,162, 82,173, 67,205,182, 58, 15, 18,227, 79,164,
-166, 65,207, 15, 79,255,195,124,134,185,134,207, 62,107,165,173,168,112,234, 58,123,182,163,112,229, 74,186,230, 5,250,105, 11,
-214, 99,235, 85, 35, 56, 79, 71, 68,156,248,236,211, 79, 21,171, 86,174,236,191,252,155,111,204, 90,183,110,141,252,252,124, 4,
- 4, 4, 64, 46,151, 35, 58, 58, 26,103, 79,157, 82, 85,105, 52,243, 92, 93, 93,215,231,229,229,213,201,185, 16,184, 38,156, 55,
-175,165, 94,165,114, 89,181,117,235,195,222,125,251, 22,108,217,178,165,217,128, 1, 3,104,181, 90,141,138,138, 10, 84, 84, 84,
- 64,167,211, 65, 44, 22, 35, 87,161,224,114, 20,138,123, 89, 89, 89, 91,234, 77,231, 39,159,180, 82,151,150, 58,117,157, 61,219,
-209, 88, 82, 34,155,153,145,145, 67,111,223,254,205,148,201,147, 63,157,241,201, 39,210,102,205,154, 81, 58,157,238,177,208, 50,
- 26,141, 48, 51, 51, 51, 50, 12,227, 0, 64,109, 10,167,236,196, 9,166,164,164, 4,246,246,246,143,195, 46,209, 52, 13,153, 76,
- 6, 59, 59, 59, 84, 85, 85,129, 16,194, 7,192,109,140, 71,230, 89,255,240,247,247,191, 41, 20, 10,155,213, 54, 17,214,181,183,
- 93,237,239, 12,195,228,196,197,197,133, 62,165,112,235, 52,125,202,229,114, 31,142,227,190,238,220,185,243,235,147, 38, 77,162,
-162,162,162, 16, 17, 17, 65, 20, 10,197, 1,154,166,231, 41, 20,138,212,122,222,108,234,228,180,179,179,179,178,178,178,250,216,
-194,194,162,111, 77, 40, 6,153, 76,118, 95,165, 82,157, 87, 42,149,107,235,137,222,254, 76, 78, 47, 47, 47,107,142,227, 62,178,
-176,176,232, 87, 92, 92,220, 30, 0, 28, 29, 29,239,168, 84,170,115, 52, 77,175,171,103, 3,233,103,114,186,185,185,153, 89, 90,
- 90, 46,181,183,183,127,107,210,164, 73, 14, 81, 81, 81,121,119,238,220, 17, 87, 86, 86,238,102, 24,166,190,205,158,255,192,217,
-186,117,235, 39,246, 34,124,145,117, 4, 0,109,219,182, 61, 62,100,200,144, 65,111,189,245, 22,140, 70, 35,126,254,249,103,156,
- 61,123,246, 68, 74, 74,202,224, 6,222, 62,159,224,116,113,113,113,148,203,229,145, 99,198,140,105, 62,116,232, 80,115, 27, 27,
- 27, 8, 4, 2,168, 84, 42,164,166,166,226,254,253,251,228,236,217,179, 85,241,241,241, 57, 26,141,166,103, 65, 65, 65,177,169,
-229,249,156,111,201, 79,112, 10,133,194, 30, 30, 30, 30,123, 23, 44, 88, 96,213,175, 95, 63, 51, 7, 7, 7, 8,133, 66, 48, 12,
-131,130,130, 2,196,198,198,226,228,201,147,170, 95,127,253, 85, 85, 82, 82,242, 6,106,141,186,127,101, 58, 95, 52,103, 77, 36,
-247, 39,218, 86, 96,235,248,196,116, 44,123,226,152, 23, 62,137,143,139,111, 83,219,114, 85, 43,146,187, 73,233, 12,239,106, 27,
-254,250,208,176,190, 0,112,240,200,141,243, 13,108,246,252,116, 58,191,140,143, 75,124,106,179,233,128, 7, 9,105, 88,210,228,
-188,123, 97,126,108,108,252, 19,156,193,193,129, 15, 18,210,159, 29,157,254,105, 67,111,157,207,102,205,124,177, 39,207,204, 74,
-200,248,159, 11,180,117, 11, 12,126,237,245, 97,131, 62,159, 51, 23, 95, 47, 95,134,163, 7, 15,159, 72,200,120,188,157,207, 63,
-178, 45,253,137,156,212, 87, 66,225, 75,230,110,110,221,247, 56, 58,206, 61,115,238,156,101,205,252,218,154, 57,146, 79, 47,184,
- 10, 9, 9, 41,188,123,247,174,139, 41,156,131,191,255,222,160,181,178,146, 46,255,249,231, 30,106,189,190,199,204,153, 51,133,
- 55,111,222,196,222,221,187, 25, 77,118,246,174,124,150,253,232, 25,222,143, 63,228,253, 43,145,168,147,204,193,161,103,171,185,
-115,165,203,247,237, 27, 47,111,214,204,101,240,144, 33, 98,161, 80, 8,149, 74,133,220,220, 92, 92,137,142,214,102,102,101,197,
-106,181,218, 97, 57, 57, 57,121,166,230,125,240,247,223, 27,108,125,124, 96,233,226,194, 93,190,114,197,118,246,130, 5, 83, 92,
-220,220,108,186,118,235, 38, 50, 55, 55, 71, 89, 89, 25,178,178,178,112,249,242,229,194,212,212, 84,119, 0,172, 41,156,191,221,
-191,223,246,194,181,107, 35, 62,251,236, 51, 73, 64, 64, 0,172,172,172, 80, 89, 89,137,132,132, 4, 92,185,114, 69,183,111,223,
-190, 10,149, 74, 53, 37, 39, 39,231,183, 63,177,222,255, 27, 2,235,175,122,240, 92, 92, 92, 66,105,154,254,178,218, 29,181,164,
-161, 61,253,254, 77,157,142,171,171,171,167,157,157,221, 70,141, 70, 67,116, 58,221,228,252,252,252,172,191, 97, 58,133,161,161,
-161, 63, 21, 22, 22,118, 38,132,192,198,198,230,106, 92, 92,220,251,168,223, 23,255, 44, 78,129,171,171,107,103, 11, 11,139, 78,
- 22, 22, 22, 61, 12, 6, 67,235,234,121,120, 9,106,181, 58,202,104, 52, 94,203,207,207,191, 90,221, 33,252,127,230, 93, 0,160,
-159,187,187,251,187, 28,199,249,210, 52,109, 91,237, 42, 45, 39,132, 36,151,149,149,109, 6,112,238,111,144,206, 23,198, 25,232,
-133, 97,132, 66,192, 19,157, 3,135,172,167, 39,175,215, 76,134,127,226, 60,130,196,248,116, 28,110, 68, 58,233,161,125,156, 86,
- 1,143, 86, 26,162,254,137,179, 79,138, 33, 19, 68, 75,163, 5, 86,115,140,171,147, 51, 19, 59, 77,228,227,158,167,142, 2,155,
-163, 7, 40,116,230, 40, 92, 75, 76,199,133,127, 99, 95,247, 34, 57,191, 6,236,127,245,243,187, 74, 11,133,174, 20, 69,209, 0,
- 64,209, 52,199, 1, 44,104,154,169,237, 22,124,234,133,178, 94, 78, 3,208, 70, 44,149, 54, 99, 25,198,165, 68, 44,182,186, 98,
- 97,209, 65, 7, 84,185,178,236,151, 17,165,165, 15, 26,155,206,133,128, 29,128, 64,161, 84,234,121,197,220,124, 72,169,157, 93,
-135, 50,134,113, 1,192, 73,165,210,184, 42,181,122, 75,118,118,246,230, 58, 60, 21, 13,166, 83, 36,149,122,176, 12,227, 66, 1,
-132, 22, 10, 11,207, 72,165, 30, 69, 78, 78,111,171, 53,154,230, 82,169,212, 8,160,210, 96, 48,140,201,206,206,142,104, 12,103,
-150, 64, 16,120,207,202,170, 27,107,109,237, 96, 0, 44, 12, 28,103, 48, 24,141,217, 58,157,238,190, 64, 32, 88,163, 80, 40, 82,
-254,228,122,231,209,200,135,132,231,228, 57,121, 78,158,147,231,228, 57,121,206, 63,153,211,217,217,217,220,213,213,213,179,250,
- 37,241,159,152,247,127, 21,132,124, 17,240,224,193,131, 7, 15, 30,255,124, 20, 22, 22,170, 81,199,156, 43, 30,255, 63,168,111,
-245, 75, 99, 76,127, 77, 81,178,177, 60, 39,207,201,115,242,156, 60, 39,207,201,115,254,231, 56, 27,226,230, 93,143,127,146,240,
-226, 57,121, 78,158,147,231,228, 57,121, 78,158,243,191,199,249,175, 2,205, 23,193, 51,225, 82,253,121,209,231,242,248,119,183,
-133,167, 33,175,254, 52,230,124, 55,190,200,121,240,224,193,227,159,141,255,143, 57, 88, 53, 3, 85,193, 11, 58,239, 69, 95, 11,
- 0,203, 40, 10,179, 0,128, 16,172, 0, 48,247,121,206, 37,207,216,209,253,105, 4, 5, 5, 57, 82, 20,213,199,198,198,166,141,
- 82,169,140, 37,132,156,187,127,255,126, 9,101,226,254, 79, 30, 30, 30, 94, 50,153,108, 60, 69, 81,173,171,239,155,160,213,106,
-183,103,103,103,167,191,128,122,163, 0,188, 39,149, 74, 71,217,218,218,250,150,149,149, 37,235,245,250, 95, 1,108, 64, 19, 34,
- 78,187,185,185,249, 1, 24,199,113,156,144,166,233, 61,121,121,121,119, 77,189,214, 57,232,181,253, 4,104, 5,128,230, 40,110,
- 4, 77,232, 3, 0, 56, 10,120, 88, 24,119,116,212, 11,110,175,141,105, 11, 79,190,189,208,244,114, 66,184,207, 0,128,162,232,
-149, 44,203,126, 94,223,249, 2,129, 96, 53,225,184,143, 64,129, 80, 20,189,146,227,184, 57,124, 23,197,131, 7, 15, 30,255, 1,
-200,229,242,129,110,110,110,187,220,220,220,118,201,229,242,129, 38, 92, 18, 92,199, 96,197, 82, 20, 88,224,201,248, 58,141, 56,
-175, 33,179,100,237,107, 87,153,152,181,218,156, 46, 20, 5,150, 84,131,162,192, 57, 59, 59,111,116,119,119, 95,251,244,199,217,
-217,121, 35, 69,129,171,117, 46, 91, 75,220, 5,215, 22, 88, 13,125, 66, 66, 66, 28,222,121,231,157,117, 10,133, 98,131,193, 96,
-216,152,149,149,181, 97,228,200,145,235,252,253,253, 93, 77,201,187,183,183,247,208,215,134,190, 30,121, 41,230,230,131,164,228,
-204,220,248, 7,169, 25,103,206, 95,190,214,127, 96,248,121,111,111,239,161,141,168, 35, 10,192,100,161, 80,120,209,210,210, 50,
- 71, 40, 20, 94, 4, 48, 85, 32, 16,252,182,108,217,178,140,184,184,184,130,232,232,232,242,200,200, 72,197,196,137, 19,147, 41,
-138, 58,134, 63, 90, 66,131, 27,178,226,184,185,185, 45,206,206,206,190,153,151,151,119,171, 89,179,102, 63, 62,197, 81,151,213,
-231, 49,167, 83,208,107,247, 10, 43, 12,164,176,194, 64,156,130, 94, 35,181,190,223,107,100,147,110,168, 45,253,161, 45, 88, 88,
- 88,248, 63, 37,228, 93,158,193,249,135,107,237,237,237,221, 9, 33,116,203,150, 45, 59,202,229,242, 31,228,114,249, 15, 45, 91,
-182,236, 72, 8,161,237,237,237,221,101, 82,105,131,109,233, 5,130,231,228, 57,121, 78,158,243,239,198,249,223,181, 96, 17, 66,
-222, 78, 78, 78, 54,231, 56, 14,254,254,254, 99, 1,156,106,140, 85,137,162, 48,139,227, 30, 89,115,104,154,154,221,171, 87,239,
- 16, 51, 51,179, 39, 34, 22,107, 52, 26,201,197,139, 23,250,112, 28,161,170,207,155, 69, 8,214,153,104,141,114,161, 40,204,210,
-235,117,180, 72, 36,129, 64, 64,207, 12, 14,110, 19, 90, 92, 92, 28,193,178,236,207,117, 4,175,108,216,108, 67, 81,216,178,101,
- 75,107, 23, 23,151, 63,236,161, 82, 80, 80, 32, 30, 50,100,112,163,248,222,110,211, 70,166, 77, 77,237, 70,139, 68,158, 6,163,
-209, 17, 0, 68, 34, 81,137,204,210,210,227,139,121,243,204, 45, 44, 44,184,146,146, 18, 84, 86, 86, 82,211,166, 77,147, 77,155,
- 54,173, 31,128, 29,245,113, 54,107,214,204, 59,184,109,251,233,219,183,109,235, 84, 81, 90,170,221,188,102,253,109,157, 80,170,
-110,222,218, 79,252,229,130,175,108, 22,207,159, 59,217, 96, 48,196,230,228,228,164, 53,100,116, 1,112,248,227,143, 63, 14, 26,
- 60,120,176, 68,169, 84,202,212,106,117,139, 93,187,118,125, 17, 22, 22,102, 25, 18, 18, 34,217,187,119, 47, 85, 94, 94, 14, 66,
-136,121, 64, 64, 0, 25, 57,114,164,118,255,254,253,211, 0,124,215, 24, 11, 16,203,178,162,154, 72,233, 12,195, 72,170,219,162,
-193, 20,139, 17, 5, 60, 12,234, 58, 18,160,224, 27, 23,253,171, 44,168,219, 72, 45, 8,146, 41,224, 97,245,139,192, 36,142,227,
-188,158, 97, 85, 74, 87, 40, 20,155,154,242,176, 12, 26, 52, 24, 0, 54,222,186,117,235, 82, 81, 81, 81, 51,142, 99,199,152,106,
-217,162, 40,138, 18, 10,133,227, 0, 44,215,104, 52, 19, 35, 34, 34,218, 3, 64,159, 62,125,196, 0,110, 18, 66, 58,227,207,143,
- 75,199,131, 7, 15, 30, 60,254,166, 2, 75, 12, 0,151, 46, 93, 2, 33, 68,210,132,251, 81,181,133,203, 71, 31,125, 4, 55,183,
- 39,167,155,228,229,229, 33, 50,242,226,243,228,233,137, 65,106,233,210,165, 54, 37, 37, 37,175,110,217,178,165, 63,128, 47, 10,
- 10, 10, 34, 27,184,190,128, 16,172,160,105,106, 54, 69, 81,144, 72,164,233,147, 39, 79,190, 89,157,127,159, 99,199,142,153, 15,
- 25, 50, 68, 77, 81, 84, 42, 0, 72, 36, 82,103,129,128,246, 34,132,212, 12,180,207, 20,130,175, 91, 90,250, 19, 66,134, 76, 89,
-189,154,237, 16, 30, 46,180,118,118, 22,128,166, 81,148,149,229,176,241,199, 31, 59, 63, 56,123, 86,234, 26, 16,144,165,151, 72,
-202,147,146,146,224,230,230, 6,177, 88,220,224, 91,130,185,185,249,196,143,103,124,234, 84, 81, 90,166, 49, 42,149, 6, 75,142,
-101,172,101, 34,170,178,168,164, 60, 61,219, 90, 61,113,234,116,225,252, 57,159, 76, 4,240,121, 3, 84,211,102,204,152,209,186,
- 99,199,142,242,125,251,246, 81, 21, 21, 21, 16, 10,133,150,237,219,183, 71,104,104, 40, 27, 17, 17, 65,121,123,123, 35, 56, 56,
- 24,209,209,209,184,114,229, 10, 21, 18, 18, 98,126,248,240,225,177, 70,163,241,187,134, 68,181, 64, 64,207, 25, 49, 98,228, 64,
-115,115,115,163, 70,163,193,164, 73,147,160, 82,169,208,186,117,235,182, 61,123,246,140,209,233,116,162,163, 71,143, 4,179, 44,
-135,250,196,117,141, 27,176,218, 98,213, 6, 4,201, 69,113, 71,219,214,252,159,227, 56,175, 7, 15, 30, 4,150,151,151,131,227,
-184,199,123, 50, 2, 64,247,238,221, 27,211,150, 10, 8,193,138, 33, 67, 6,207, 6, 40,244,238,221,187,100,250,244,233,108, 66,
- 66, 66,207,225,195,135,189,244,240, 97,114,125, 47, 1, 5, 20, 69,175,164,105,106, 22, 69, 81,212,248,241, 19, 10, 44, 45, 45,
-135,121,120,120, 60,160, 40, 74, 40, 22,139,107,158, 3, 65,235,214,173,157,130,131,131,167,218,217,217, 21, 10,104,218,153,128,
- 16,138,162, 87, 18,194, 21,240, 93, 20, 15, 30, 60,120,252, 7, 4, 22, 69, 81,197,119,238,220,113,211,106,181,160, 40,202, 20,
-107, 80,236, 83, 3,206, 79, 52, 77,189, 79, 81, 20,130,131,219,164,173, 93,187,182,174,253,182,244,193,193,109,210, 4, 2,218,
-155, 16, 2,138,162,215, 63, 53,208,196, 54, 52, 32, 74, 36,210, 89, 0,224,230,230, 94,112,252,248,113,227,136, 17, 35,176,114,
-229, 74,201,156, 57,115,190,162,105,122,116, 94, 94, 94, 78, 61,233, 4,128,185, 78, 78,206,246, 91,182,108,105, 61,121,242,228,
-155,185,185,185, 31, 3,128,187,187,251, 90, 0,109, 40,138, 74,173,117, 12, 27, 54,108, 8,157, 56,113, 98, 66, 97, 97,225,220,
-103,113,190,110,101,229,235,224,238, 62,116, 85,116, 52, 17, 50, 12, 85,113,243,102,121, 78,126,190, 65,207,178,244,169,180,180,
- 78,163, 39, 76, 16,187,184,185,145,163, 27, 54, 52, 87,139, 68,132,149,201, 42,226,226,226,136,193, 96,184,223, 80,222, 41,138,
- 10,176,179,181,179,216,188,122,253, 77, 39,169,128,114,244,112,167,196,214,182, 66,218,210, 74, 74, 4, 2, 77,115, 15,119, 43,
-138,162, 2, 26,170, 35,177, 88, 60,182,127,255,254,230,123,247,238,165,130,131,131, 97,107,107,139, 75,151, 46,225,206,157, 59,
- 40, 43, 43,163, 25,134, 65, 88, 88, 24, 86,172, 88, 1, 15, 15, 15, 84, 84, 84, 32, 35, 35,195, 81, 44, 22, 59, 25,141,198,103,
-149,231, 19,130,119,214,172, 89,112,118,118, 6,203,178,200,203,203, 67, 85, 85, 21, 44, 44, 44, 96, 99, 99,131,220,220, 92, 28,
- 61,122,196,148,182,100, 18, 94,126,249,101, 53,128,140,167, 45, 88,141,225,148,203,229,103, 11, 11,139,186,245,234,213, 11,229,
-229,229,134, 5, 11, 22,160,125,251,246,104,213,202,175,193,116,178, 44,251,185,163,163,227, 86, 7, 7,135,213,211,167, 79,119,
-117,112,112,128, 78,167,155, 87, 82, 82,130, 89,179,102, 1, 0, 66, 67, 67,219, 16, 66, 78, 76,156, 56, 17, 94, 94, 94,138,210,
-210,210,172, 7, 15, 30, 76, 46, 44, 44,140,173,181,197,209,159,177,100,153,231,228, 57,121, 78,158,243,239,198,249,175, 20, 88,
-164,214, 64, 72,240, 12, 87, 5, 33,164, 76, 46,151,187,153,153,153,129, 16, 82,214,216,155,113, 28, 55,205,193,193,161,112,238,
-220,185, 93,253,252,252,244,211,166, 77,139,205,200,200,152, 87,251,156, 22, 45, 90, 44,253,225,135, 31,144,148,148,148,177,108,
-217,178,232,146,146,146, 37,141,188,205, 28, 66,176, 22, 0,114,115,115,139,143, 29, 59,214, 49, 42, 42,106,206,218,181,107,221,
-166, 77,155, 38,153, 62,125,250, 84, 19, 44, 57, 16, 10,133,154,186,220,130,117,193,197,197,197, 32, 20, 10,159,181,127, 32, 38,
-119,232, 32, 37, 28, 55,244,155, 75,151, 56, 46, 39, 71,123,114,219, 54,172,188,114,101,138,141,163,163,167,147,147, 19,241,106,
-214,172,200,140, 97, 10, 42,139,138,232,144,254,253, 69,103,118,236,104, 46,245,242,138, 63,112,224, 64, 21,199,113,103, 77, 72,
- 66,149,222,104,212, 89,120,184, 27,135,188,214,191,205,253,235,119,146,204,236,237,233, 54, 97,237, 3, 19,147, 51,110, 81,128,
- 30,104,120,243, 88, 27, 27, 27,191,226,226, 98, 84, 86, 86,194,201,201, 9,235,214,173,131,139,139, 11,212,106, 53,226,226,226,
- 72,179,102,205,168,203,151, 47,195,221,221, 29, 69, 69, 69,208,235,245, 80,171,213,133,122,189,254, 89,121, 47,160,105,193,102,
-154,166, 38, 81, 20, 5, 95,223, 86, 5,223,125,247,157,145, 16,130,128,128, 0, 12, 27, 54, 12,151, 46, 93, 66, 92, 92, 92,141,
-149,201,232,229,229, 93, 64,211,148,243,163,230, 86,191, 69,176,129,182, 6, 0, 25,121,121,121,115,155,114,189, 92, 46,151,177,
- 44, 59,197,215,215,119,240,155,111,190,105, 16,139,197, 80,171,213, 53,101, 97, 24, 48, 96, 64,201,144, 33,131, 29, 78,156, 56,
- 81,111, 58,139,139,139, 83, 91,183,110, 61,233,211, 79, 63,221,185,126,253,122,219,207, 63,255,252,241, 38,220, 44,203,130,227,
-184,199, 86,182,195,135, 15, 35, 61, 61,253,235,194,194, 66,190,227,226,193,131,199,127, 17, 38,105,145,127,162, 5,235, 47,201,
-140, 64, 32,216,112,246,236,217,246,221,187,119, 23,246,233,211, 39,248,244,233,211,193, 10,133, 34,182,122, 80, 11,238,211,167,
- 79,176,179,179, 51,214,173, 91,167, 22, 8, 4, 27,154,120,155,199,131, 93, 94, 94, 94, 12, 69, 81, 95, 30, 58,116,104,203,228,
-201,147,225,226,226,210, 62, 55, 55,247, 47, 45,228,178,164,164, 46,227, 23, 47,230,100,128,224,196,206,157,228,171,232,232,111,
-246,255,250,171,216,199,199, 7,132, 16,100,100,100, 88,255,188,101,139,253,232,126,253,226,242, 85, 42, 42, 37, 63,159,141, 63,
-126,156, 46,161,233,239, 83, 83, 83,139,107,111,214, 92, 23, 12, 6,195,141,172,204, 76,191, 46,221,186,184, 93,186, 25,127,123,
-248,208,193,189,104, 33, 77,167,103,230,221,112,114,176,183,184,114, 53,186,210, 96, 48,220,104, 40,157, 42,149, 42,157, 97, 24,
-123, 66,136, 83,100,100, 36, 28, 29, 29, 81, 86, 86, 6,163,209, 8,131,193,160, 87,171,213,178,196,196, 68,232,116, 58,232,116,
- 58, 88, 91, 91,227,254,253,251, 5, 12,195, 92,120, 22, 39,203,178,239, 1, 88, 76, 8, 65, 82, 82,146,162,218,245,217,202,214,
-214,118, 55,195, 48,200,205,205, 69,100,100,228,152,188,188,188,164,218,250,166,250,175,162,201, 79, 41, 33, 77,174, 47, 39, 39,
-167, 96,177, 88, 60,247,195, 15, 63,116, 9, 10, 10,130, 86,171, 5, 0, 88, 90, 90, 66,173, 86,195,218,218, 26,157, 59,119, 78,
- 88,178,100,137,129, 16,140, 7,144, 95, 31, 95, 66, 66, 66,145,159,159,223,135,147, 39, 79, 94,228,231,231,231, 77, 8,129,175,
-175, 47,250,247,239,143,147, 39, 79,226,225,195,135, 80,169, 84,236,245,235,215,247,102,103,103, 31,231,251, 88, 30, 60,120,240,
- 34,235,223, 99,193, 66,117,134,200,159,125,195,194,194,194,162,196,196,196,211,183,110,221, 26, 60,106,212, 40, 68, 70, 70,142,
- 7,240, 9, 0, 72,165,210,241,163, 70,141,194,173, 91,183,144,152,152,120,186,176,176,176,232, 69,220,147,162, 40,181, 94,255,
-200,128, 35,147,201,204, 26, 57, 80,251, 84,187, 6, 65, 8,241,121,214,177, 6,172, 97,158, 47, 15, 27, 70, 87,221,185, 83,190,
-248,204,153,143,247, 28, 58, 36,246,240,240,128, 82,169,132, 64, 32,128,181,181, 53,213, 63, 60,220,110,243,158, 61,174, 30, 86,
- 86, 87,166, 78,152,240,224,235,115,231,212, 87, 42, 42, 76, 10,175,160,213,106,183, 44, 93,242,101,175,157,187,246, 7,248, 7,
-248,218,157, 60,123,241,182,131,131,181,153,151,151,143,180,162,188, 92,247,195,218,149, 66,149, 74,181,181, 33, 30,141, 70,115,
- 56, 34, 34, 98,168,135,135,135, 83,108,108, 44,244,122, 61, 88,150, 69,223,190,125, 65, 8,145, 2,224,132, 66, 33, 18, 18, 18,
- 96, 48, 24, 10, 31, 62,124,168, 72, 73, 73,145, 2, 88,222, 0,245, 19, 66,137,166,233,209,131, 7, 15, 6,195, 48,232,223,191,
- 63,142, 28, 57, 50, 10,192,162,103,157,255, 28, 22,172, 22,110,110,110,203,170,239,105,210,228,118, 87, 87,215,174, 45, 91,182,
- 92,180,106,213, 10,202,197,197, 13, 44,203,192,104, 52,160,168,168, 4, 74,165, 18,129,129,129,240,244,244,196,242,229,203, 1,
-224, 72, 67,226,170, 6, 73, 73, 73,201, 0,222,152, 48, 97,130,248,210,165, 75,161, 90,173,246,219,126,253,250,225,246,237,219,
-184,123,247,238, 91,206,206,206,133, 30, 30, 30,140, 92, 46,159, 68, 81,148,181, 76, 38,219,243, 34,202,129, 7, 15, 30, 60,254,
- 97,248, 75,180,200, 95, 45,176,234,205,152,179,179,179,121, 89, 73,225, 71, 94, 94, 94, 50, 0,144,138, 5,189, 29, 28, 28,190,
- 46, 41, 41,169,106,236, 77,213,106,245,254, 93,187,118,189,178,102,205, 26,113,120,120,120,203, 67,135, 14,117, 4,128,240,240,
-240,150, 86, 86, 86,216,181,107,151, 65,173, 86,239,127, 81,153,228, 56,174,127, 88, 88, 24, 74, 75, 75,145,145,145,113,179, 49,
-215, 30, 59,118,204, 28, 64,155,134,142,213, 7,189,209,232,100,237,230, 38, 44,184,116,201,160, 97, 24, 79, 63, 63, 63, 40,149,
- 74, 72, 36, 18,232,116, 58,164,167,167, 67, 44, 22, 83, 15,211,210, 28,231,124,242,201,101, 51, 63, 63,203,154, 21,134,166, 32,
- 47, 47, 79, 3, 96,250, 87, 75,191,218,189,106,229, 74,231,210,146,178, 36,177,196, 76,107,110, 38,181,159,253,233, 18, 82, 80,
- 80, 48,179,122,143,170,134,176,124,247,238,221, 3, 94,121,229,149,123, 30, 30, 30,206,197,197,197,174,149,149,149,164,180,180,
-148,170,110, 27, 20, 0,220,187,119, 15,153,153,153, 12,203,178,151, 1, 44,134, 9,238,199,199,166, 41,185,220,174, 99,199,142,
- 3, 28, 28, 28, 30,187, 34, 67, 66, 66, 6, 0,248, 94,161, 80,148,189,200,198,125,246,236, 89,115,142,227, 2, 1, 96,192,128,
- 1,166,138,241,183, 71,143, 30, 77,153,153, 89,128, 97, 24, 72,165, 98, 72,165, 82, 88, 90, 90,195,222,222, 30,153,153,153,232,
-221,187, 55,151,150,150,118,212,220,220,124, 91, 99,211,116,241,226,197, 87, 59,118,236,248,201,212,169, 83, 97, 52, 26, 49,116,
-232, 80, 40, 20,138, 85,233,233,233,251, 92, 93, 93,199,204,155, 55,207,209,193,193, 1,179,102,205, 50, 3,176,144,239,107,121,
-240,224,193,139,172,127,135,192,122,214,160, 24,102,103,103, 55,173,176,176, 80, 86,227,122,161, 40, 74,214,174,101,203, 13, 98,
-177,248,167,188,188,188, 43,141,185,105,121,121,121,101, 90, 90,218,209,152,152,152,145,195,135, 15,199,185,115,231,198, 1,192,
-240,225,195, 17, 19, 19,131,180,180,180,163,229,229,229,149, 47, 34,131,238,238,238,175,247,236,217,115, 92,199,142, 29,113,236,
-216, 49,176, 44,123,161, 49,215,215, 94, 49, 88,215, 42,194,154, 99,166,112, 73, 30,197, 57, 2,203,178, 16, 8, 4,208,106,181,
-200,203,203,195,131, 7, 15, 96,109,109,141,178,210, 82,202,218,222,222,160,211,233,216,198,230, 51, 47, 47, 47,231,206,205,223,
- 83, 52, 90,173,200,206,193, 94,109,101, 33, 33,149, 74, 37,125,239,222,237,188,194,194,194, 12, 83,181, 32, 33,164,199,153, 51,
-103,230, 11, 4,130, 81,114,185, 28, 35, 71,142,164,250,244,233, 3,137, 68, 2,141, 70,131,242,242,242,154,114,244, 6, 0, 71,
- 71, 71, 23,115,115,243,131, 52, 77, 23,164,167,167, 79,108,232, 6, 44,203, 14,127,237,181,215,132, 70,163, 17, 75,150, 44,193,
-194,133, 11, 49,112,224, 64,225,141, 27, 55,134, 3,216,244,162, 26, 54, 33, 4,175,188,242,202,227, 73,238, 79, 77,110,175, 19,
- 61,122,244, 16,166,165,165,249,200,229,114,100,100,100,192,220,220, 28, 46, 46, 46,176,181,181,133,163,163, 35,214,172, 89,131,
-111,191,253,246,174, 64, 32, 88,159,151,151,151,210,216, 52,121,122,122, 78, 26, 59,118,236,164,145, 35, 71, 66,169, 84, 34, 38,
- 38, 6, 93,186,116,193,178,101,203, 92,163,163,163,103,132,133,133, 65, 40, 20, 34, 42, 42, 10, 44,203,102,243,125, 44, 15, 30,
- 60,120,252,243, 5, 22,245,148,114, 4, 0,216,218,218, 90,203,100,178,201,225,225,225, 93,135, 14, 29,138,254,253,251, 63,113,
-241,186,117,235, 44, 35, 35, 35,103,127,247,221,119, 61, 0,172,207,205,205, 45,109,132, 85,233,240,238,221,187,195, 95,126,249,
-101,243, 94,189,122,249, 0,128, 84, 42,213,239,222,189, 91,205,113,220,225, 38,228,229,137,232,237,114,185, 60, 76, 32, 16,140,
- 31, 56,112, 96,216, 59,239,188,131,184,184, 56,236,218,181, 43,193,207,207,239, 92, 65,129,233,243,166,159, 90, 49, 88,215, 42,
-194,181, 13, 89,179, 36, 34, 81, 81,101, 94,158,131,208,205, 77, 98, 33,145,100,223,184,113,195,167,101,203,150, 84, 90, 90, 26,
-146,146,146, 96, 48, 24,112,231,206, 29, 66, 3, 57, 2,107,107, 58,243,222, 61, 74, 44, 18, 53, 58,102,151,153,152,235,240,197,
-172,247,124,181, 90, 77, 96, 69, 69, 5, 35, 20, 10,133, 82, 17,155,214, 72, 26,157,135,135,199,107, 44,203, 58,234,245,122,163,
-139,139,139,232,252,249,243,144, 72, 36,120,180,250, 51, 24, 18,137, 68, 47,151,203,149, 0, 96,105,105, 73, 47, 91,182, 76, 52,
- 99,198,140,184,134,136, 67, 66, 66, 68, 18,137,100,180,159,159, 31,174, 94,189,138,248,248,248,212,171, 87,175,250,116,232,208,
- 1, 30, 30, 30,163,221,220,220,182,223,190,125,219,248,162, 4, 22, 26, 57,201, 61, 42, 42,138,115,119,119, 7, 69, 81, 16, 8,
- 4, 80,171,213, 72, 75, 75, 67,231,206,157,177,117,235, 86,172, 93,187,246,151,252,252,252,109, 77, 73,207,132, 9, 19,196,109,
-219,182,125,123,228,200,145, 72, 77, 77,197,242,229,203, 75,242,243,243, 47,158, 57,115,102,248,212,169, 83, 5, 93,186,116, 65,
-113,113, 49,182,111,223,206,220,190,125,123, 91,120,120,248,206,141, 27, 55,242, 61, 20, 15, 30, 60,254,107,150,171,186,190,255,
-187, 44, 88,238,238,238,131,100, 50,217,187,163, 71,143, 22,248,251,251,163,160,160, 0, 86, 22, 82, 61, 69, 81, 18, 0,176,178,
-144,233,141, 70, 35,166, 78,157,138,246,237,219,119,156, 61,123,118, 24,203,178,191, 20, 20, 20, 28, 52,229,198,133,133,133,106,
-154,166, 15,188,255,254,251,203,239,220,185,237, 13, 0,215,175, 95, 79,203,205,205,157, 99,162, 59,171, 54,106,130, 83, 82, 50,
-153,217, 61, 95, 95,223,146,208,208, 80,187, 97,195,134,193,209,209, 17,183,111,223,198,178,101,203,226,180, 90,237,180,168,168,
- 40,230,175, 46,100,134, 97,178,174, 29, 63,110,247,202,152, 49,118, 75, 70,143,254,225,157, 9, 19, 86,124,189,108,153, 88, 46,
-151, 83,214,214,214,184,123,247, 46,217,188,105,147, 97,223,202,149, 63, 8,204,204,196,151,142, 28,145,176, 70, 99,114, 99,238,
- 33,151,203,123,132,117,234, 24,188,106,205,119,208,168,171,112, 61,230, 56,202, 74,139,177, 97,211,161, 54,114,185,188,135, 66,
-161,136,106, 68,122,125, 14, 28, 56,240, 72, 28, 74, 36, 88,188,120, 49,220,221,221, 97,109,109,141,170,170, 42,188,247,222,123,
-146,143, 62,250, 8, 0, 16, 31, 31, 15, 75, 75, 75, 83,173,108,189, 38, 79,158,108,109, 52, 26,113,234,212, 41, 29,203,178,211,
-207,157, 59,119,184, 93,187,118,210,238,221,187, 91,239,220,185,179, 55,128, 51,255,143,207, 3, 71, 8,201, 58,123,246,172,231,
-200,145, 35, 33, 22,139, 81, 86, 86, 6, 43, 43, 43,172, 90,181,138, 24, 12,134,131, 77, 37, 86, 40, 20, 18, 71, 71, 71, 9,203,
-178, 56,112,224, 0, 42, 43, 43, 39,230,228,228,228,183,108,217,242,240,236,217,179,103,250,250,250,122, 37, 39, 39,103,178, 44,
-187, 82,161, 80,164, 3, 0, 47,176,120,240,224,193,227, 95, 40,176, 0,188,117,250,244,105, 1,199,113,216,184,113, 35,110,221,
-186, 69, 44,173,237, 63,182,178,161,118, 88, 91, 91,179,229,229,229,111,173, 88,177, 98,232,252,249,243,169,110,221,186, 33, 38,
- 38,134,242,246,246, 30, 14,160,246, 32, 20,140,122, 98,101, 84, 84, 84,220, 40, 40,200,247,174, 21,181,221, 91, 42,149, 53,180,
-218,237,105,206,167,131, 89,182, 91,186,116,105,172,179,179,179, 49, 54, 54, 22,235,215,175,231,110,221,186,117, 2,192,170,194,
-194, 66,141,137,156, 47, 2,143, 57,237,252,252,174,108,157, 59, 55,228,229, 87, 95, 37,189, 71,141,226, 86, 75, 36,159,126,185,
- 96,193,244,210,202, 74, 15,142,227,224, 96, 99,147,245,203,210,165,107,186,116,235,166,185,255,251,239, 22,209,191,253,102,230,
-210,162,197,229,198,164, 83,161, 80, 68, 69, 70, 94,198,246, 77,107, 96, 48,232,144,167,200, 4, 0, 20,151, 84,160, 1,113,245,
- 7, 78,154,166,203,199,143, 31,111,174,215,235,169,209,163, 71,139, 10, 11, 11,209,178,101, 75, 0, 64,101,101, 37, 78,156, 56,
-129,128,128, 71, 97,181,238,223,191,255,248,123, 67,233, 52, 55, 55, 31,213,181,107, 87,100,100,100, 32, 46, 46,238,100, 97, 97,
- 97, 81,124,124,252,201,204,204,204,225,161,161,161, 56,124,248,240,200,122, 4, 86,163,234,168, 38,176,104, 35,219, 18, 24,134,
-153,125,248,240,225,201, 49, 49, 49, 61, 62,249,228, 19,170, 79,159, 62, 0, 0,149, 74,197,154, 56,223,240,153,233,172,113, 15,
-115, 28, 7, 15, 15, 15, 21, 0,164,164,164,164, 3,248,160,169,156, 47,162,125,242,156, 60, 39,207,201,115,254, 77, 56,255, 51,
- 2,139,225, 56, 14,145,145,145, 56,116,232, 16,171,215,235,231,230,231,231, 63,168, 30,204, 1, 96,219,157, 59,119, 46, 15, 31,
- 62,124,117, 82, 82,146, 32, 62, 62, 30,132,144, 70,205, 29,210,106,181,198,167, 35, 16,104,181,218,231,118, 17,109,221,186, 21,
-249,249,249,250,204,204,204,223, 12, 6,195,174,146,146,146,188,166,114,189,136, 85,132, 27,110,221,210,189,110,101,117,100, 78,
-175, 94,195,151,156, 62, 45, 27, 56, 97,130,190,231,128, 1, 95, 67,175,215,139, 68, 34, 14,102,102, 2,129,153,153, 56,254,247,
-223, 45, 86, 77,153,226, 64,209,244,209, 31,227,227, 53,141,181, 96,245,236,217, 13,227,223,157, 1,141,166, 10,191, 95, 61,142,
-242,210, 98,196,220, 72,130,206,128, 70, 89,176,132, 66,161,167,209,104,148, 50, 12,163, 32,132,224,237,183,223, 6,203,178,208,
-106,181, 80, 42,149, 40, 45, 45,213,126,248,225,135,116,181,104,194, 43,175,188, 98, 82, 84,127, 31, 31, 31, 79,161, 80,136, 51,
-103,206, 64, 32, 16, 28,124, 36,136, 5, 7, 35, 34, 34,134,143, 30, 61, 26,114,185,220, 47, 53, 53,181,193,198, 16,174, 11, 0,
- 0, 32, 0, 73, 68, 65, 84,201,141,143, 55,123,166,224, 11, 0,160,224,235, 20,244,218,189,154,205,158,105,154, 78,111,223,190,
-189, 73,243,174,158, 70, 81, 81, 81, 33, 30, 77,220,255,117,214,172, 89, 83, 59,118,236, 24,188,104,209, 34, 0, 16, 60,183,121,
-140,227,192, 48,204,115,133,144,224,193,131, 7, 15, 30,255,112,129, 69, 81,212,222, 94,189,122,189, 65, 8, 17,208, 52,189,171,
- 70, 92,213, 70, 78, 78, 78,154, 92, 46,223,232,229,229,245,102,181,229, 99, 79, 35,239, 95, 64, 8,190,161,105,170,246,222,115,
- 5, 77,224, 88, 81,205, 65, 9,133,162, 93,215,174, 93,251, 60, 55, 55, 55, 31, 0,251,188, 5,244, 34, 86, 17, 2,192, 65,165,
- 50,249,117, 75,203,163, 83,219,181, 27, 50,116,250,116, 18,218,175,159,141,107,139, 22, 12, 99, 52,178,169,247,238, 81,209,135,
- 15,139,163,127,251,205, 76, 64, 81,199, 14,170, 84, 15, 26,155, 78,133, 66, 17,117,225, 98,212,217, 17,195,195, 95,241,241,114,
- 7, 0,164,166,231,162,184,180,226,108, 99,196, 21, 0,100,102,102,234, 0,232, 92, 93, 93,135,239,223,191,255, 0, 69, 81, 84,
-237,237,102, 0,232,132, 66, 97, 43, 0, 80, 42,149,205, 15, 31, 62,188, 91, 40, 20,230, 52,196, 27, 31, 31,191,119,193,130, 5,
- 99,210,210,210,126, 83, 40, 20, 41,213,233, 78,185,124,249,242,250,220,220,220, 49,153,153,153, 59, 97,194,202, 17, 2,180,138,
-139,254,181, 13, 0, 4,117, 29,137,184,232, 95,101, 0,218, 4,117, 29, 89, 83, 22,207, 61, 89,190, 58, 46,215, 71,215,175, 95,
-127,185,127,255,254,227, 9, 33,133,207,195, 39,147,201,140, 58,157,142, 97, 89, 86,104, 48, 24,136, 76, 38, 51,242,221, 15, 15,
- 30, 60,120,252,123,241,103, 79, 34, 51,213,132,248,196, 4,245, 38,114, 54,134,163, 65, 78, 55, 55,183,105, 20, 69,249,152, 74,
- 64, 8, 73,205,203,203,251,161, 46, 78, 66, 30,185, 47,129,103,111,246, 76,140,198, 76,153,143,207,229, 95,238,223,215,214, 33,
-118,185,198,148,167,175,175, 47, 73, 78, 78, 54,181,126,235,229,148,203,229, 50,161, 80,248,180,133, 74, 87, 45,194,106,183, 35,
- 1, 0,166,145,245,222,164, 58,122,108,193, 2,104,142,226, 70,208,132, 62, 0,128,171,177, 96,253, 9,237,179, 73,233,172, 93,
-239, 0,224,227,227,243,126, 64, 64,192,152,123,247,238,237,207,206,206, 94,215,224,195,217,200,122,255,147,158, 77,158,147,231,
-228, 57,121,206,191,138,179,161,113, 54, 12,128, 83,245,207,154, 56,153, 78, 79,125,215, 3,168, 61,102,213,252, 46,162, 40,234,
- 70, 45,142,199,199, 77,184, 22, 0,138, 1,220,163, 40, 74,143,191, 9,130,121, 78,158,147,231,252, 31,122,244,232, 33,228,203,
-147,231,228, 57,121, 78,158,179,241,226,138, 16, 50, 8,143,188, 28,132, 16, 50,168,230,247,211,223,107,206,169,253,187,250, 47,
-158, 62,207,148,107, 1,144, 57,115,230,204, 37,132,244,106, 76,154,105,240,224,193,227, 47,195,255,199, 42, 86, 30, 60,120,240,
-248, 23,192,137,162,168,227,132,144,193,132,144,193, 20, 69, 29,175, 71,140, 13,174,253,183, 62,212,197, 83,115,143,218,191,151,
- 47, 95,254, 53,128, 70,237, 4, 35,172, 71,133, 54,198,244, 23,220,132,255,197,242,156, 60, 39,207,201,115,242,156, 60, 39,207,
-249,159,227,124, 81,215, 63, 55,234, 18,107, 53, 66,174,246,239, 57,115,230,124,142, 70,236, 90,242, 87,128, 55,159,242,156, 60,
- 39,207,201,115,242,156, 60, 39,207,249,188, 66,232,153, 46,189,250,220,133, 79,127, 55,197, 69, 88,223,185,141, 73,179, 16, 60,
-120,240,224,193,131, 7, 15, 30,127,111, 20,213,182, 54, 85, 91,152,216, 57,115,230,124, 94,115,172,218,202,164, 3, 32,125,250,
-226,167,174,171, 23,141, 57,151, 23, 88, 77, 64,187,150,244, 18, 79, 79,231,208,234, 66, 6,169, 14, 81,192, 85, 71, 17, 32, 53,
-193,140, 8, 7,194, 17,228,230,149,223,186,159,134, 47,159,161,188, 27,156,235,214,173,155,171,189, 64, 83,245, 45,203,177, 93,
- 0,128, 2,125, 73, 36,178,253, 36,226,186,162,188,214,106,178,122, 17,224,131,214, 50, 33, 62,227, 56,180,165, 40,128,162,112,
- 79,203, 96,101, 98, 42, 18, 94, 64,145, 80, 65,222,120, 79, 34, 53, 31,109, 99,107,231, 91, 86, 82,252,208, 96,208,253, 26,159,
-142, 13,104,194,166,156,254, 62,104, 15, 22,179, 89, 14, 34, 33,141,111, 19, 51, 16,205,183, 58, 30, 60,120,252, 69,214,144,231,
-154,127, 92, 87,159, 76, 8,161,158,147,147, 15,144, 87,127,249,220,168,158,232, 94, 35,122,138, 0,220, 95,182,108, 89,217,178,
-101,203,106, 31,187, 11,160, 93,245,121, 69,117, 8, 37,125,245,111,125, 29,231,232, 77, 57,247, 79, 17, 88,129,205, 48, 21, 4,
- 11, 65,129, 0, 88, 20,159,131,245,141,186,190, 37,250,202,132,130,205, 32, 16,104,141,236, 76,194,226, 82,157, 5, 41, 64,119,
-153, 72,176, 26, 20, 56, 45,195, 78,140, 79,193,121, 83,239, 17,228,139, 1, 66,138,222,201,113, 68,196,114,100, 7, 56, 28,183,
- 52,226,202,239, 10,104, 27,147, 86, 79, 79,231,208, 35,231,243, 94,185,184,119, 58, 58,181,247, 5,225,140, 0, 97, 96, 30,240,
- 25, 34,126,121, 27,157,218,120, 62, 58,198, 25, 97, 25,178, 26, 3,187,218,144,251,105, 77,219,159,186, 91, 55, 87,123, 51,142,
-187,183,126,203, 78, 87, 79,223,151, 41,194,233,144,124,231,212, 91, 31,205,154,215,171, 79, 71,121, 91, 0, 13,238,241,216,214,
- 23,239,122,122,250,127, 54, 99,222, 26,218,221,189,153, 37,199,232,153,188,236,248, 14,223,175, 89,112, 80, 76,103,174,190,151,
-140,205,166,182,227, 64, 47, 76, 22,138, 36, 35,205,204, 45,124,213,106,101, 50,107, 52,254, 74, 11,132, 3, 86,174, 88,219,190,
- 71,175,129,150,156, 46,159, 54, 50, 84,224,190,253,123,154,255,240,211,250,240,216, 84,246, 85, 0, 92,163, 50,205,226,227,251,
- 71,223, 27, 33, 18, 10,168,128, 65,155, 44, 0,166,127,163, 57, 0, 4,121, 33,136, 52, 28, 9, 29, 20,240, 99, 92, 58,226,154,
- 82, 63, 1, 94,216, 66, 1,126, 0, 14, 80, 4,123,227, 51, 80,200,119,119, 60,120,252,187, 32,151,203, 47, 42, 20,138, 94, 47,
-152,179,147, 66,161,184,198,151,238,139, 19, 89,117, 28,190, 94,199,177, 27,127,135,244, 54,214,130,245, 85, 92,114,182, 29, 56,
- 3,130,252,124,150, 0,141, 19, 88, 50,161, 96,199,141,123, 5,174, 32, 6,108, 90,243,254, 62,189, 17, 96, 24, 3, 88,198, 8,
-150, 49, 62,250,206, 26,193, 49, 90, 44,248, 54, 18, 96,148, 8,109,223,106, 7,192,186,153,122, 15, 17,232,157,183,174,156,181,
-167,152, 10,236,219,190,236,195,204,220,170, 15,207, 95,207, 45, 14, 20,105,230,198,103, 96, 91, 99, 6,241,139,123, 63,194,174,
-131, 39,115,214,109,218,159,200,129,192,206, 82,234, 63,118,120,156,199, 47, 7, 47,102,175,221,170, 77, 36, 28,129,173,149,212,
-127,220,171,201,158,207, 83, 9, 2, 77,213,183, 63,109,218,230,234,217,188, 57,101, 76,255, 10, 48,234,224,225, 25, 46,152, 55,
-227, 93,183, 69, 43,126, 92, 3, 96, 92,189,214, 32,111, 4,182,240,105, 61,115,199,190,171,158,170,170, 66,253,133, 19,159,167,
- 80,132, 24, 29, 29, 3,196,139,191, 90,101,246,197,220, 25,159,232,217,156,107, 15,210, 16,223, 64, 82,232,214, 94, 56,250,245,
-215, 43,219,246,233, 55,196,146,213, 23, 9,180, 85, 74,191,205,219,182, 44, 12, 8,234,104,222, 53,164,153,184,232,202, 20, 74,
-173, 44,133,129,152, 73,123,135,246,177, 86,143, 29,101,220,242,203,158,105,241,105,248,174, 81,250,138,249, 95,172, 17, 3, 3,
- 25, 0, 17,154, 48,129,144, 0, 31,220,137,185, 56,153, 41,187, 1,112,134,106,209,107, 0, 56, 35, 72,173,191, 47,189,185, 13,
- 0,166, 52,165,126,104, 10,175,156, 63,127,195,173,160, 32, 47,236,219,111,191,158, 75,168, 27,167, 64, 97,103, 66, 26,162,154,
- 34, 10,121,240,224,241,247,132,187,187, 59,155,155,155, 43,120,145,156,114,185, 60, 92,161, 80,156,124, 30, 14, 55, 55,183,207,
- 0,188, 91,253,115,115, 94, 94,222,202,231, 77, 87,104,104,104, 51, 66,136,107,181,112,201,191,121,243,102, 14,223, 2,254,127,
- 5,150, 12,132, 3,174, 12, 5,168,198, 45, 87,172, 30, 12,101,160, 4,128,177, 10,175, 13,238, 11, 71, 7, 55,128, 85, 1,172,
- 6, 96,212, 0,251,232, 83, 92,148, 9, 48, 42,160,232, 20, 24, 66,164,141,206,149,177, 2, 40,252, 21,175,188,236, 9, 91, 43,
- 25, 62,122, 35,208,113,227,145,164,205,155,143, 60,232, 27,159,134,209, 38,165,149, 16,116, 10,241,197,186, 77,170,196, 99,145,
- 69,253, 1, 32,188,135,195,233, 78,109,154,123,172,221,170, 77, 60,121,169,108, 0, 0, 12,232, 98,125,170, 99,176,171, 39,247,
- 28,219,159,176, 28,219,213,179,101, 8,197,100,173, 0, 77,151,161,170,170, 24,217,169,219,225,232,210,159,102, 56,174,123, 67,
-215,155, 9, 49,231,163,207,150, 11, 85, 85, 5,122,194, 20,114, 46,150,197, 98, 17, 40, 1,167,186,172,215,228,151, 87,125,252,
-193, 88,102,230,156,175,231, 0, 24, 83, 31, 79,160, 55,166,173, 94,177,182, 77,151,142,254,206,249,209, 31, 81, 85, 21, 5, 48,
- 18, 51,233,171, 61,186,192,174,121, 32, 87,112,103, 53, 37,117,235, 11, 59, 47, 31,228,220,223,133,204,123,135,168,110, 29,135,
- 75,119,236, 22,143, 5, 12,117, 10, 44, 95, 87,116,237,255, 74,199,125, 62,205,221,221, 8,225,192,113, 28, 8,225,160,213,179,
-152,251, 67, 10, 84, 26, 6,131,251,190,212,197,193, 70,160,163, 1, 16,194, 33, 59,183, 68,125,225,106, 98,159,212, 92, 52,248,
-230, 71, 1, 63,182,123,185, 87,215,123,215, 99, 2, 12,185,199, 17, 54,108, 89, 34,133,255,185, 27, 9,208,245,118,196,182, 0,
- 96, 91,147, 95,154, 8, 1,155,245,251,114, 52, 11,121, 79,176, 97,219,105,167,138, 18,197,184, 67,251,127, 26,241,211,198, 13,
-187, 18,211,154, 38,218,120,240,224,241,247, 67,110,110,238, 11, 23, 89, 87,175, 94,205,125, 30,145, 21, 26, 26,218, 61, 55, 55,
-119, 69,110,110,110,141, 8, 92,209,177, 99,199,249, 53,227,212, 83,168, 32,132,140,185,121,243,230,165,250, 56,103,204,152,225,
-126,229,202, 21,175,155, 55,111, 2, 0,194,194,194,188, 66, 67, 67,189,234, 58,215,220,220,156,109,215,174, 93,198,183,223,126,
-155,203,183,144, 63, 87, 96, 37,230, 95,254, 56, 68, 95,170, 6,128, 68, 19,206,127, 98,169,165,214,200, 46,223,190,118,220,242,
- 32, 63, 59, 84, 42,245, 56,119, 57,163,218,130,197,128,101,141,143,255,246,127,217, 17,157,153, 41,248,110,239, 3, 48, 44,183,
-172, 62,206,167, 97,224,184, 55,219,119, 31,181,159, 35, 68, 98,110, 78, 87,180,244,112,112,158, 57,182, 29,253,209, 27, 65,208,
-104,153, 81,187, 79,165, 92, 72,200,192, 38,147, 56, 57,166, 14,225, 85,199, 49,142,109, 48,239,207, 66, 59,127,179, 78,195, 6,
-118,179,134,177, 20,172, 42, 29,122,150, 67, 94,158, 10,105,185, 98,216,112, 5, 38,113,114, 28,218,186,186,186,153, 95, 61, 59,
- 59,221,217,170, 76,236, 96,198,138,197, 20, 71,104, 35, 17,232,245,137, 90, 59,247,190, 34,142, 67,219,134,234,200,204,204,234,
-237,110,189, 6,217,100, 69,188, 75,153,121, 12,132,179,119, 51,164,223,218,142,194,216,227, 40, 41,204,164,108, 72, 25,204, 91,
-249, 96,224,240, 55,176, 98, 90, 40, 42, 43,171, 64, 21,165,218, 72, 36, 82, 91,192, 80, 39, 39,161, 49,102,245, 55, 75,221,132,
- 66,250, 81,121, 18, 6, 32, 70,128, 24,161,172,210, 65,175,215, 67, 38, 38,176,144, 17,160,218, 13,203,178,122,243,182,125,230,
-188, 15,176,215, 26,202,123, 92, 58,226, 2,189, 16, 13,194, 4, 16, 86, 3, 10,136,142, 79,255,159,232, 9,242, 66, 80,135, 62,
- 19, 62,160,128, 31,155, 82, 71,193, 45, 48, 56, 52,192,210,194,140, 73, 68, 78,228,135, 72, 97,101,196,165,205,187,120, 99,204,
- 52,243, 13,155, 55, 14, 1,200, 84, 60, 57, 7,237,207, 88, 94,204,115,242,156,255, 72, 78,107,107,107,239, 22, 45, 90,204, 55,
- 26,141,221,197, 98,177,139,193, 96, 0,199,113,249, 18,137,228,114, 70, 70,198,226,202,202,202,180,191, 91,222, 79,157, 58,213,
- 24,145,213, 32,167, 72, 36,194,201,147, 39,147, 27, 33,178,158,224,164,105,122,231,129, 3, 7,176,127,255,126, 0,192,197,139,
- 23,209,170, 85, 43,139,186, 46,204,206,206,182,120,253,245,215,119, 2,240,168,143,243,225,195,135,222, 75,151, 46,197,129, 3,
- 7, 0, 0,191,252,242, 11,252,252,252,234, 76,204,221,187,119, 5, 95,124,241,133, 55,128,220,191,160,142,254,181, 2,139,160,
-225,173, 85, 82, 93,173, 68, 33, 48, 26, 1, 32,181,177, 55, 75, 72,197, 55,235,182,156, 30, 16,113,232,199,238, 50, 9,141,133,
-223,206,204, 46, 42, 82,190, 36, 20, 60,114,179, 48, 44,104, 59, 91, 73,204,178, 15,219,121,150, 85,104,241, 91,148,226, 82,124,
- 26, 26,101, 10,141, 79,197, 57,128,179,173,182, 13, 65, 85, 89,232, 55,110,222,185,189,123,191, 25,208,118,198,152,182, 56, 26,
-153, 49, 3, 96, 26,220,171,142,112, 28, 8, 97, 30, 79,106,175, 62, 88,237,114,250,223, 49,142, 16,128, 24, 65, 26, 57,207,123,
-209,162,145,194,163,123, 15, 15,176,144, 10,191,159, 50,105,178,181,177, 36, 30, 21,229, 44,242,139, 85,200, 44,178, 5,107,214,
- 18, 73,113,215, 88, 1, 77, 55, 56,255,140,162, 81, 73,140, 42, 43, 59, 51, 51, 58,176,227,251,110, 21,177,159, 87, 74, 5, 70,
-129,109,251,165, 86, 5,247, 87,103, 49,186,194, 42,138,126, 82, 1,213,217, 25,218,216,180,210, 41, 51, 4, 21,229, 37,176,109,
- 19,136,129,175, 14,193,194,137,173,161, 84,170, 80, 84,114,149,248, 54,183,161,180,183,119, 99,222,219, 1, 40, 41,206,131,222,
- 8,208,149,218, 82,173, 94, 91,245,108, 75, 32, 54,124, 60,115,214,155,205,155, 57, 89,212, 44, 22, 32, 28,139,118,193, 62,232,
-215,171, 19,206,197, 92,197,141,219, 73,224, 8, 87,189,152,128, 69, 78, 97,121,129,214,192,110,111,148,117,148, 99, 30, 89, 66,
-235, 16, 96,104,130,107, 48, 56, 24,230,172, 10, 95,134,181,182,154, 56,251,237,230, 86, 86, 18, 10, 90, 51, 22, 90,173, 17,202,
-196, 31,224,208,172, 13,204,101, 50, 42, 36, 68, 35,188,125, 27,252,190,130, 60,120,212,194,136, 17, 35,100, 5, 5, 5,145, 30,
- 30, 30,129,125,251,246, 53,239,222,189, 59, 84, 42, 21,206,156, 57, 3,181, 90,221,220,195,195,163,249,217,179,103,135,103,102,
-102,198,123,120,120,244, 60,112,224,128,182,177,247,168,153, 84,254,162, 39,135, 75, 36, 18,196,196,196,188, 80, 75,150, 68, 34,
-193,245,235,215,147,155, 98,201, 82,169, 84, 98, 87, 87, 87, 56, 56, 56,128,101, 89,168, 84, 42, 28, 57,114, 4,149,149,149,224,
- 56, 14,102,102,102, 88,125,170, 2,218, 7, 7,176,249,251,165,168,168,168, 16, 55,196, 89, 92, 92, 76,249,251,251, 67,167,211,
-129, 97, 24,104,181, 90,156, 63,127,254,241,111,161, 80,136, 37, 7, 10,160, 75,218,139, 29, 27, 86,163,184,184,152,250, 11,155,
-143, 41, 90,228, 31, 37,176,106, 50,244,167,103,140,101,153,185, 27,183,239,141,153,251,225,104, 76,123,187,143,199,226,239, 14,
-247, 77, 72,195, 14, 0,104,237,141,113, 99,195,125, 61,109, 45, 68, 88,244,243, 77, 0,100,238,243,222, 47, 46, 19, 73,129, 62,
-220,140,195,145,153,145,159, 79, 12,129,143,135,117,171, 50, 67,169, 36, 53,213,132,249, 62,156, 17,118,150, 82,255,240, 30, 14,
-167, 65, 56,216, 90, 74, 3, 64, 88,216, 90, 73,253, 7,116,177, 62,197, 17, 2, 91, 11,113, 0,225, 76, 15,206,221, 49, 88, 58,
-201, 76, 68, 79,178,176,178,245,252,120,202, 88,179, 65,131, 94, 55,179,144, 16,148,196,159, 68, 37, 9,130,222,194, 2, 68, 93,
-142,180,135,177,236,169,168,155, 10,169,131,219,167, 64,122,253,201,100,113, 41, 55, 59, 97, 88, 11,223,190,182, 69, 55,231, 21,
-122,247,217,237, 69,131,165, 85, 49,195, 11, 45,172, 2,197,209,119, 99, 25,142,197,213,134,210,166,172,172,204, 48, 26,224,166,
- 53,138,172, 82,174,111,195,156,177, 65, 40, 47, 43,130, 86,199,160, 92,197, 24,220, 28, 13, 82,109,217,125,232,244, 12,116, 6,
- 2,145,185, 59,206,198,196, 22,115,140,241,212, 51, 21,121, 30,238,164,238,186, 99, 89,251,152,143, 27,218,205,182, 51,187, 3,
- 86,131,204,172, 92,236, 56, 24, 19,146,154,135, 59,207,247, 72, 50, 32,204,255,250,232,154,201,239, 77,153,220, 30,208, 28, 29,
-197,140,232,251, 69,115, 6, 5,246, 12, 98,165,148, 54, 15, 20, 0,115,153, 16, 58, 25, 11, 27,153, 15,136, 65, 73,212, 90,109,
-121, 92, 44,248,200,236, 60,120,212,130,191,191,191,171, 66,161,136,155, 57,115,166,253,176, 97,195, 30,139,129,237,219,183, 99,
-237,218,181, 88,184,112, 33,140, 70, 35, 54,110,220,104,126,240,224,193,142, 63,254,248, 99,142,167,167,103, 80, 86, 86, 86,190,
-137,162, 74, 92, 61,118, 61,154, 85, 64, 8,187,104,209, 34,178,112,225, 66,212, 28, 3,192, 2, 13,191, 84, 62, 75, 12, 73, 36,
- 18, 36, 38, 38,190, 16,145, 37, 18,137, 32, 22,139, 33,145, 72,240,224,193,131, 70,139, 44,134, 97, 4, 57, 57, 57,168,172,172,
- 68,191, 33, 67,176,118,249,114,116,239,222, 29,125,251,246, 5, 33, 4, 17, 17, 17,232,108,151, 4,251, 33, 61,144,144,144, 0,
-163,209,104,146,103, 42, 39, 39, 7, 37, 37, 37, 24, 48,100, 8, 54,253,244, 19, 58,116,232, 0,127,127,127, 0, 64,100,100, 36,
-250,200, 51, 96,233,223, 23, 73, 73, 73,127,101,243,249,203,180,200, 95,109,193,250, 75, 16,151,138,223,185,195, 81,199,223, 24,
- 20, 54,120, 72,239, 64,108,218,123, 97, 41,164,149,123, 1,192, 65, 42,253,234,237, 65, 62,136, 79, 45, 67,196,245,220,227, 9,
-233,248,253, 69,220,147, 99,225,232, 96,107, 14,208, 18,168,245, 44, 99,109,221,240,196,100, 14, 4,230,173,231, 96,236,176, 4,
-143, 78,109, 60, 60, 8, 97,170, 87, 12,174,193,184, 87,147, 61,195,130, 92, 60, 31,185,188,140,176,238,188, 27,224, 44, 26, 76,
- 71,183,246,178,179,159, 78,255,240,229, 65, 67,222, 48, 19,155, 59,128,211,100,195, 88,122, 15, 37,105, 23,161, 51,107,143,162,
-156,116,236, 61,250, 91, 69, 98, 90, 65,165, 64, 64,159, 19,218,184,204, 58,127, 62,173,138,162,234,111,103, 90, 1,150, 45,156,
- 63,119,208,222, 93,123,108,204,220,187,225,225,209,240,114,137,192, 40,117,150,251, 65,195, 88,177,171,182, 30,183, 85, 1,203,
- 27, 74,159, 90, 85,121,232,124,196,233,209,190,110, 93,173,210, 99,143, 67,173,214, 67,103, 4,130, 59,244, 2,203, 17, 9, 69,
- 83,156,181, 64, 64, 21, 20,148,130, 50,114, 5,151,111,167,231, 69,223, 72, 21,232,232,134,185,159,104,116, 98,193,244, 33,125,
-219, 1,172, 6,175,246, 11,198,183, 91, 35, 62, 4,216, 9,207,247, 88, 26, 65, 88, 13, 8,208, 53,208, 11, 63,115, 64,215, 91,
-167,190, 13, 8, 29, 56, 3,141,177, 96, 5,121, 97, 96,160,159,251,182,111,151,206,181,183,119,246, 16,128,213,128, 98, 42, 9,
- 87,250, 59,132,170,135,176,110, 54, 8,172, 77, 23,108,248,105, 85, 21,199,145,189,104, 66,136, 10, 30, 60,254,205,208,106,181,
-135,150, 47, 95,110, 63,120,240,163,213,238, 85, 85, 85,184,122,245, 42, 54,111,222, 12, 11, 11,139,218, 98, 9,225,225,225, 32,
-132,216, 47, 88,176,224, 16,128,151,159,197,217,185,115,231, 33,107,214,172,201, 2,240, 16,143, 98, 28,137,241,104,131,121,114,
-254,252,121, 26, 0, 58,118,236,200, 94,191,126,157, 3, 64,198,140, 25, 35, 58,122,244,104, 43,149, 74, 21,213, 84,129, 37,145,
- 72,160, 80, 40,158, 91,100,137, 68,162,199,124, 98,177, 24, 10,133,162, 81, 34,139, 97, 24,225,137, 19, 39,112,251,246,109, 44,
- 10, 9,193, 71,110,110,112,112,112, 64, 84, 84, 20, 8, 33,176,176,176, 64,105,105, 41,246,238,221,139, 94,189,122,129, 97, 24,
-177, 41,188, 71,142, 28,193,173, 91,183,176, 36, 52, 20, 31, 90, 88,192,214,214, 22,145,145,145, 0, 0,169, 84, 10,133, 66,129,
-243,231,207,163,103,207,158,124,163,254,179, 5, 86, 15, 64, 88, 74,193,213,104,208,128, 48, 4,160,224,222,186, 53,196, 9, 9,
-141,127, 75,160,129,121,235,182, 30, 31,244,237,220, 87,169,247, 70,132,184, 47,254,241,226, 84, 0,152, 56,202, 79,110, 46, 21,
- 98,221,222,120, 66, 3,243, 94, 68, 6, 91,183,134,152,210, 97,106,191, 46,254,200, 45,214, 35, 53,171,226, 66, 66,186,105, 46,
-157,136, 29, 99,241,203,161,200,236,181,219,158, 92, 49,184,237,200,173,172,213, 59,180,137, 4, 4,182,102,162,128, 9,175,118,
-110,112, 21, 97,199, 96,233,164,217, 51,102,188,252,218, 91,179,204,140, 57,135,161,203, 56, 1,176,106,168, 85, 20, 42, 25, 95,
-228,101,229, 96,209,183,123,178,117, 70,250,205,155,241,218, 70, 9,203,135, 15, 81, 37,244,174, 28,182,252,155,249,231,190, 94,
-180,192, 82,170,136,168, 20, 9,161,162, 29,186,139,190,154,191, 94,168,172,208,191,158,154, 5,101, 67, 60, 58, 26,203,191, 89,
-253,221,160,119,199, 14, 75,244,243,232,233,192,230,167, 58,168, 43, 42, 10,119,159,186,229, 90,253, 54, 65, 1, 64, 74,122, 9,
-138, 74, 85, 12,203, 24,163,172, 12, 88, 28,175, 48,125,245,159,183, 51,156, 6,247, 14,122,203,201, 86, 2,141,170, 12,206,118,
- 98,244,239,218,242, 45,163, 54,105,118, 90, 97,227, 98,140, 60,161,175,170, 93,132, 49,155,123, 7,128, 51, 4, 16,206, 8,125,
-230,206,166,188, 62,205,152, 49,186,185,141,189,133,158,166, 88, 21, 32,178, 3, 36, 78, 20,109,230, 5,129,153, 39, 50,146,111,
- 50, 51,222, 31, 93,146,145,145,191,197,145, 96, 37,223,133,240,224,241, 36, 50, 51, 51,223,254,252,243,207,163, 59,117,234,228,
-226,232,232,136,224,224, 96, 28, 59,118, 12,159,126,250,233,227,115,218,183,111, 15, 0, 40, 41, 41,193, 55,223,124,147,159,155,
-155,251,118,189, 47,230,113,113,137, 59,119,238,236,218,182,109, 91,189, 88, 44, 46,171, 17, 89,153,153,153, 66,149, 74, 69,233,
-245,122, 98, 97, 97,193, 73,165, 82,227,200,145, 35, 13,215,175, 95,111,165, 82,169, 50,159,199,130, 21, 26, 26,122,191,188,188,
-188,130,162,168,231, 14,225, 80, 35,174, 2, 2, 2,156,244,122, 61, 11,160,180, 41, 33, 28, 24,134, 65,104,104, 40,206, 95,186,
-137, 83,151,238,163,170, 40, 21, 99, 94,239,143,128,128, 0,156, 57,115,166,201,117, 22, 26, 26,138,243,231,163, 17,121,243, 1,
- 10, 50,227, 49,246,141,161,240,247,247,199,249,243,231,249, 6,253, 2, 4, 86,189, 38,185, 0, 79,180,163,173, 37,191,204,123,
-181,101,160, 48,120, 33, 40,161, 25, 14,111, 59,214,101,238,215, 63, 39, 10, 42,178,198,196,154,176,218,235,137,135, 37, 29,113,
- 4, 15,246,220,141, 15,120,235,213,238, 30,216,244,171,249,151, 0, 48,170,159, 55,174,199, 23,225, 90,108,225,158,248, 38,198,
- 44,170,141, 96,103,152,179, 58,236,249,102,214,107, 61,155, 55,115,197,230,253,209,160, 8, 14,153, 52,208, 18, 66, 58,181,245,
-196,218,109, 79,175, 24,116,243, 92,189, 67,155,120,246,170,114, 32, 0,244,123,201,252, 84, 88,107,123, 79, 66,234, 95, 70, 40,
- 19,209,239, 13,124,245,109, 51,166,224, 12,184,210, 95, 33,146,136,161, 81,177,200, 43,212, 65, 99,110,134, 11,151,163, 52, 85,
-106,102,198,189,100,166, 73, 86,187,132, 52,164,138,133,183,179, 84, 26,141,155,165,125, 75, 21, 77,129, 84,233, 69,228, 86,188,
- 66, 21,159,133, 7,166,112,164,166, 66,255,146,156,233,182, 97,199,175,243, 69, 34,201, 40,129, 0,148,179,173,133,211,207,235,
-150,192,202,202, 18,132, 81,130,232,138, 49,108,226,215, 69,177,201, 70,111, 0,104,213, 10,150,221,218,138,118, 8,105, 42,231,
-226, 29,195, 23, 13,221,131, 18, 96,202,152, 87,219,137, 56,163, 10,211, 23,236,195,134,175, 94,197,216, 33,173, 69, 39, 46, 36,
- 77, 1,176,184,233,102,202, 71, 46,194,151,223,187,148, 72, 1,209, 4,232,122,243,248, 87, 1,104,132,231, 49, 36, 4, 34,182,
-138,106,221, 90,174, 23,177, 57,123, 65,201,228, 68,224,216, 19,176,104, 69, 17,203, 96,252,176,110,126,213,166,205,155,207,114,
- 20, 22, 61,200,104, 48,228, 5, 15, 30,255, 85,164,230,230,230, 14, 8, 15, 15,143, 56,115,230,140,125,112,240,163, 29, 85,110,
-221,186, 5, 0,143, 93, 81, 5, 5, 5,120,243,205, 55,139,243,242,242, 6,160,129, 57,189, 74,165, 50,237,240,225,195, 46, 26,
-141, 38,236,139, 47,190, 40,104,209,162,133,210,104, 52, 18,165, 82, 9,134, 97,136,147,147,147,168, 67,135, 14, 84, 80, 80,144,
- 38, 34, 34,194, 33, 59, 59, 91, 9, 32,163, 41,137,127,247,221,119,113,240,224, 65, 0,192,139,136,139, 37, 22,139, 17, 30, 30,
- 46,191,122,245,170,162,154,179,201,113,177, 8, 33,184,119,239, 30, 46, 39,179,144, 88,216, 33, 35,177, 18,231,127, 59,138, 49,
-239, 77, 6,195, 52,125,182,194,221,187,119,177,247,252, 93,184,200, 91,162, 66,119, 15, 71,142, 28,193,212,169, 83,159,139,179,
-137,248,215,184, 7,159,182, 96,253, 33, 67, 62, 62,144, 72,245, 88,208,175,163,124,214,200, 62, 45, 5,140, 58, 23, 28,199, 65,
- 0,192,209,138,198,214, 77, 27,188,127, 61,124, 50,230,251,239,126,252, 14,122,110, 94,108, 33,212,141, 48, 99, 45, 88,179,253,
-202,168,157, 75,122, 8,167,142, 8,176, 7, 0,177,136,198,186, 61,113, 12,104, 44,120,158, 76,189, 36,135,172, 74,140,247,156,
-157,109,190,156,251,254, 32,251,158,157,252, 16, 21, 19,139,239,118,197, 92,146,216,225, 23, 83, 31, 59,194, 49, 79, 76,104,127,
-116,172, 14,227, 23,105,184, 17,178, 28,113,149,152, 59, 66,155,113, 18, 66,137, 20, 12, 99, 64, 81,129, 26,233,249, 28,100,238,
- 34, 92,191,151,169, 25,250,214,176, 19,207,211, 48, 45,204,101,238, 11,190, 90,213, 76,163, 81, 50,149,229,197,140, 80, 28, 35,
- 52, 55,147,230, 63,218, 57,192, 52,252,174,128,182,123, 59, 81, 7, 16, 78, 32, 21, 16,245,220, 25,227, 45, 20, 73,103,224,235,
-148, 11, 10, 4,102,238,131, 96,101, 33, 16,119,109, 43,202, 2, 0, 11,115,115,201, 55,139, 63,181,249,120,246,162,203,166, 88,
- 19,253,156, 93, 63, 14,246,181, 71,212,181, 4, 92,186,145, 25,119,233,247,164,160, 94, 29,221,225,231,109,251,145,196,182,124,
-121, 83, 44,162,143,234,224,145,139,176,102, 21, 97,144, 23,130,194, 6,127,241,172,213,131,117,194,235, 54,184, 36,111, 2,138,
- 18,128,128, 2,180, 10, 48,217, 59, 33,240,254,144, 28, 58,250,149,102,243,166,205, 75, 18, 50,120,171, 21, 15, 30, 13,161,162,
-162,226, 94, 98, 98, 98,255,118,237,218,109,159, 62,125,186,213, 91,111,189,229,254,238,187,239,210, 0, 80, 80, 80,192,173, 93,
-187, 54,247,251,239,191,175, 40, 46, 46,158, 96, 52, 26,239,155,242,132,231,229,229, 93,221,186,117,107, 81,116,116,116,208, 75,
- 47,189,100, 30, 22, 22,198, 57, 59, 59,139,213,106, 53,155,157,157,173,137,137,137, 97,147,147,147,109,202,203,203,147, 1,164,
-160, 9,238,123,119,119,119,208, 52,189,216,195,195, 99,190, 66,161,104,243, 34,230, 96,249,250,250,186, 3, 72,150,203,229,190,
-141,117, 15,254, 97,192, 22, 10, 81, 86, 86, 6,101, 78, 10,212, 37,197,240, 23,168,209,222,222, 17, 86, 86, 86,207, 37,134, 42,
- 42, 42, 32,212, 21, 32,245, 94, 38,202,243, 51, 16,216, 60, 20, 22, 22, 22,208,233,116,255, 31,205,135,250,183, 60, 7,207,116,
- 17, 6, 54,195, 84, 51, 96,237,248,145,222, 98,239,230,205,160, 47,186,133, 59, 41, 85,248, 98, 75,199,120,129,216, 74, 55,109,
- 92,191, 14,189,250, 58,161, 71,207,142, 84,139,230,182, 31, 45, 95,190,254,131, 64, 73,241,167,241,217, 88,103,202,141,227, 83,
-145,198,113,133,155, 47,222, 80, 76,105,230,164, 1, 1,193,197,155,121,184,159, 82,182, 57, 49, 29,105,141,201, 68, 96, 75,244,
- 21, 82,244, 62,194, 18,153,141,149,133, 50, 48,160,153, 99,223,174,109,233, 1,189,194, 32, 22, 2,209,215,238, 98,198, 87,135,
-126,231, 36,100,144,201, 43,190, 8,247, 7,225,244,104,197, 32,243,196,138, 65, 66, 8, 1,199,128,144,250,167,117, 9,104, 42,
- 95, 85,112,211, 85, 98, 21, 8, 67,201, 5, 20, 20, 84, 33, 46,213,128, 42,120,160, 44, 39, 7,132,176, 89, 11, 22,252,218,228,
- 39,196,209,209,209,217,187,149, 95,203,239, 55, 29,128, 65, 87,129,212,248,109,168,170,204,199, 87,203,126,107, 41,151, 59,244,
- 80, 40, 20, 81,166,183,110,202, 47,226,194, 30,103, 16, 64, 32,148,226,196,198,253, 40, 22,154,193,209, 70, 12, 78, 91,136,247,
- 38,141,177, 9, 31, 52,198, 6, 0,178, 82,238,194,211,222, 52, 93,109, 40,199,240, 81, 19,252,109,193,170,241,203,145,187, 90,
-154,194,128, 95,126,139, 75,233,213,193, 86, 54,170, 95,115,187,197, 27,202, 95, 7,176,167, 73,250,138, 99,159, 88, 69,216,148,
-213,131, 7, 0, 54,128, 32,101,207,249, 34,203,145,225, 33,102, 98, 33, 69, 17,173, 2, 28, 37,166,214,253,184, 85, 41,161,176,
-145, 31, 58,121,240, 48, 13, 26,141,230,150, 70,163,105,243,217,103,159,189,249,249,231,159,119,183,176,176,240, 6, 0,149, 74,
-149,102, 52, 26, 47, 85, 63,235,108, 99, 30,115, 0,201, 41, 41, 41,105, 41, 41, 41, 46,191,252,242,139, 45, 0, 89,245,255,180,
- 0,202, 1, 20, 52,146,243, 9,212,136, 41,119,119,247,249, 47,170, 28,106,196,148, 92, 46,247,109,202,245, 2,129,128,165,233,
- 71, 59,251, 72,165, 82, 92,190,124, 25, 3,187,118,195,221,243,153, 8,112,241, 64,175, 49,227,113,228,226, 69, 8, 4,130,154,
-243, 27, 53,142, 8,133, 66, 68, 71, 71, 99,196,224,158, 56,114,228, 8,124, 66,219,225,195, 15, 63,196,233,211,167, 33, 20,242,
-187,233,253, 41, 2, 11, 4,139,207,237,251, 90, 12,206,136, 3,187, 87,224,220, 13,181,254,129, 2,243,252,115,176,246, 0,148,
- 92, 97,241,193, 41, 39, 34, 83, 87,190, 51, 97,176,121,239, 30,253,208,187,123, 47, 97, 80,187, 30, 95, 2, 79, 8,172, 96,212,
- 19, 43,131, 53, 98,201,198,131,137,147,247,157, 76,162,192, 40, 49,250,213, 48,194, 26,177,164,129, 52,255,129,211,198,220,114,
- 95,244,229, 24, 59,176, 85,200, 79,191, 40,115,117,241, 6,136, 17, 15, 31, 38,225,135,173, 71,184,200,152, 7, 59,245, 2, 76,
- 79, 77,128,202, 84,206, 71,138,138,129,141,165,228, 15, 43, 6,109,205, 68, 1,253, 94, 50, 63, 69, 8, 33, 86,230,162, 0, 82,
-183, 5,235, 9, 78,173,145,219,184,115,199,166, 85, 19, 39,190,107, 81,162, 83, 32, 41, 59, 14, 90,129, 28, 2,243,150,136,187,
-121, 70,163, 49,114,155, 76,168,175,103,150,103,113,113,113,225,173,155,165,216,183,125, 25,140, 70, 29, 10,243, 30,105,212,188,
-130, 74, 88, 91,203, 99, 20, 10,133,201,156, 6,134,171, 24, 62,236, 61,177,153, 12,102, 99, 70, 13,146,164,228,234, 16,226,111,
-245,168, 89, 24,138,145, 24,121, 25,189,156, 31, 77,134, 76, 73, 20,192,243, 37,119,147,210,105,101, 37,158, 62,176,155, 28,105,
-153,249,184,124, 75,177, 35, 45, 23,185, 44,201,219,145,146,245,127,236,157,119,120, 20, 85,219,198,239,153,217,154, 77,239,187,
-155,102, 8, 33, 36,212,132, 78,130,116, 8, 77, 64, 64, 64, 4, 65, 69, 41, 98, 65,165, 55, 1, 1, 17, 68,138, 8,136,136, 32,
- 2, 82, 69,164,247, 30, 18, 2,132,144, 16, 18, 18, 82, 54,189,111,157,157,242,253,145,242, 6, 76,217, 4, 62,124,229,157,223,
-117,237,181,217,157,201,189,115,230,204,204,185,207,115, 90,225, 7,131,187,123,227,219, 29,247, 62, 4,204,187,234,147,246,230,
-190,104,206, 1, 97,224,205,224, 25, 3,120, 32,172,185, 47,154, 91, 56,114,240,111,154, 34, 18,111,174,222,157, 60,247,247,115,
- 57,131,191,120,183,139, 93,104,167,126, 82,112,102,190, 68,103, 52,199, 62, 66,241,179,228,209, 51, 32,104, 10,154,255, 86, 77,
- 22,192, 14,179,217,188,163,176,176,240,121,106,102,224,239,243, 50, 61, 83,218,171, 54, 7,102,100,100, 80,106,181,154,181,160,
-147,123, 93,154,215,171, 26,173,242,232, 85, 93, 81,172,167, 53, 51, 58,116,232,224, 52,104,208, 32, 48, 12,131,132,132, 4,164,
-164,164, 96,208,132,241,112,116,116,196,245,123,247,144,144,144,128,249,243,231,131, 97, 24,220,184,113, 35,173, 46, 77,177, 88,
- 76,183,110,221, 90, 50,100,200, 16, 48, 12,131,196,196, 68, 36, 39, 39,227,195, 15, 63,132,189,189, 61,238,221,187,135,196,196,
- 68,204,159, 63, 31, 70,163, 17, 73, 73, 73,244, 11,186,150,254, 71, 12, 22, 1, 22,156, 25, 69, 17, 11,240,195, 17,208, 52,131,
-192,123,105,120, 84,209,241,228, 94, 26, 54, 82,252,237, 63,110,199,220, 79,138,188,222, 67,138,226, 59,168,111,205,225, 65, 26,
- 52,182,138,146, 18, 48, 37,118,200,249, 11,143,210, 75, 74, 31,164, 65,211,128,232, 5, 1, 86, 7, 20,221,196,193, 35,231, 32,
-147,223, 66, 68,212,125,246, 74,100,252,110,146,199,226,216,100, 60,168,191, 38, 15,155, 54,107,240,246,107, 15,203, 70, 12,242,
-102,240, 28, 3,251,208, 93, 24,255, 90,103,239,118,129, 14,222,224,204,224,121, 51, 28,123,158, 5,230,202,107,213,187,113,215,
-184,165, 75,176,124, 88, 73,113,110,135,222,221,187, 89,187, 6,188,129,162, 7,247, 16, 19,117, 82,127,243, 78,252,213, 27,119,
-141, 91,158, 37, 35, 61, 60, 60, 94,237,217,179, 41, 70,190, 61, 11,180,177, 16,137, 49, 63,161,164, 56, 19, 23, 47,219,224,254,
-227,226, 78, 0, 44,142, 96, 93,141, 97,154, 3, 5, 8,109, 33,126,108, 39, 53, 41,199, 14, 31, 8,153,200, 0,206, 92, 2,130,
-206,197,195,124,186,104,216,130, 52, 22, 0, 20,114, 66,100, 45, 42,178,179, 40,210,232,231,220, 68, 33, 49,227,151, 67, 49,224,
-136,178,101,150, 56, 2, 27,127,249,227,225, 7,139,167,134,160,153,159, 99,235, 91, 9,217, 21,109,240,150, 86,105,167,220, 60,
-188, 40,208, 16, 51, 15, 60,103,198,165,149,142,129, 93, 62, 47,152,130, 6, 46,139,115, 55, 17,233, 0, 62, 0,171,219,244,209,
-210, 99,243,218,182,184, 23, 54,253,131,193,118, 32,132,133,209, 5, 4, 4, 94, 60, 58,157,238,253, 25, 51,102,108,162, 40,202,
- 21, 0,193,243, 60,140, 70,163,232,199, 31,127, 20, 51, 12, 67, 82, 20,197,202,229,114, 38, 50, 50,210,204,113, 92, 14, 77,211,
-239,215,165,105, 50,153, 30,174, 95,191,190,177,217,108,174, 28,113,104, 52, 26,177, 99,199, 14, 24,141, 70,200,100, 50,216,216,
-216, 32, 49, 49, 17, 4, 65,208, 44,203, 62, 20,114,226,121, 26, 44, 96, 81,232,235, 11, 22,128, 7, 1, 2, 11,239,165,253,125,
- 50,166, 59,233,200,104,230, 73,127,210, 60,184,235,130,114, 83,182,168,190, 7, 96, 96,217,225,237,218, 4,252, 6, 0, 70,142,
-125,171, 33,137, 40, 54,232,223, 8,110,223,105, 55,199,243, 34,134,229,127, 36, 73,236, 51, 0,177,137,143,234, 30, 57, 87, 19,
- 25,154,194,200,126, 97,246,124,197, 18, 56,149,205,130,229,211, 49,240, 60,207, 87, 54, 11,206,149, 35, 55,207, 88,103,111,234,
-139,183, 12,125,218,183,144,189,119,252,124,212, 68,150,227,149, 20, 73,100, 26,204,220,230,103, 53, 87,229,181,163,243,167, 78,
-165,159,184, 29,230,222,199,165,124,154,213,220, 66, 32,183, 8, 39,210,211, 75,207, 55, 68,179, 64,111, 30, 60,123,229,161,195,
- 82, 17, 37, 2,120,112, 92, 89,122, 13, 52,155, 95,102,194,128,150,254, 80,127,254, 35,243, 27, 69, 17, 41,117,233, 93,191,163,
-249,118,228,231,167, 62,139, 73, 40,248, 49, 57,189,172,230,147,156,142,187,123,142, 63,154,247, 48,181,228,179,187, 9, 5,223,
-160,158,253, 38, 8, 96, 67,187,215, 22,252,237,187,103, 61,159,247, 31, 35, 26,192, 80,240,105,189, 71, 78, 90, 55,157, 32, 32,
- 44, 19, 33, 32,240, 63, 68, 69, 20,139, 36,201, 47,159,151,102, 69, 20, 11, 64, 66, 61,142,227, 58,128,150,207, 51,109, 81, 81,
- 81,121, 0,242,132, 92,254,119,211, 66,208, 4,120,158, 39,159,229, 85,223,227,244,247,247,231,235, 97, 84,132, 60, 18, 52, 5,
- 77, 65, 83,120, 38, 63,227, 51,153,231,121,226, 89, 94, 66, 30,189,124, 8,205, 30, 47, 0,130, 32,184, 23,249,123, 9, 9, 9,
-132,112,214, 5, 4, 4, 4, 94,220, 51,249,121, 47,217, 35,240,239,135, 20, 78,129,128,128,128,128,128,128,128,192,115, 54,221,
-168, 57,204, 87,159,209, 1, 13, 9, 21,222, 21, 52, 5, 77, 65, 83,208, 20, 52, 5, 77, 65,243,127, 78,179, 46,109, 97,116,226,
-255,147,241, 18, 52, 5, 77, 65, 83,208, 20, 52, 5, 77, 65,243,127, 79,243,165, 66,104, 34, 20, 16, 16, 16, 16, 16, 16, 16, 16,
- 12,150,128,128,128,128,128, 25, 33, 81,140, 0, 0, 32, 0, 73, 68, 65, 84,128,128,128, 96,176, 4, 4, 4, 4, 4, 4, 4, 4,
- 4,131, 37, 32, 32, 32, 32, 32, 32, 32, 32, 32, 24, 44, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,129,151,
-157,138,165, 85,186, 10,167, 66, 64, 64, 64, 64, 64, 64, 64,240, 34,207, 47, 81, 85,223, 5, 4, 4, 4, 4, 4, 4, 4, 4, 47,
- 34,184, 70, 1, 1, 1, 1, 1, 1, 1,193,139,252,119,186, 70, 1, 1, 1, 1, 1, 1, 1, 1,193,139, 60, 35,194, 40, 66, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,129,231,136,176,210,184,160,
- 41,104, 10,154,130,166,160, 41,104, 10,154,255,115, 8,125,176, 4, 4, 4, 4, 4, 4, 4, 4, 4,131, 37, 32, 32, 32, 32, 32,
- 32, 32, 32, 24, 44, 1, 1, 1, 1, 1, 1, 1, 1,193, 96, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 75, 64, 64, 64, 64, 64,
- 64, 64,224,191, 6, 2, 53,143, 4,184, 91, 15,157,134,140, 38,184, 43,104, 10,154,130,166,160, 41,104, 10,154,130,230,255,156,
-102, 93,218,119, 33,240,255, 98,188, 4, 77, 65, 83,208, 20, 52, 5, 77, 65, 83,208,252,223,211,124,169, 16,154, 8, 5, 4, 4,
- 4, 4, 4, 4, 4,158, 51,162,127,216,220, 85, 24, 60, 14,255, 89, 69,251,191, 77, 83, 64, 64,224, 57,208,165, 53,102, 72, 37,
-226, 9, 6,218,188,226,114, 52,126,234, 26, 2,103,134,195,114,185, 68,212,197,104, 98,190,190,116, 27, 63,214, 83,146,120,234,
-179,112,175, 63, 35,189,123,247,158, 8, 96, 1,207,243, 60,199,113,115,206,156, 57,179,253,121, 60,235,149, 74,229, 40, 0, 10,
- 0, 32, 73,178, 40, 35, 35, 99,175, 37,255,216,181,107, 87, 81,105,105,105, 50, 0,143,242,175, 30, 68, 69, 69, 5,212,181, 77,
-160,254, 68, 68, 68,240, 62, 62, 62,104,217,178,101, 92,102,102,230, 58, 0, 27,133,179,242, 95,100,176, 2, 92,229, 29, 95,241,
-114, 29,112, 44,242,241,156,186,110, 56, 15, 15,143,229,174,174,174,147,116, 58,157, 1, 0, 79,146, 36, 79, 16, 4, 42, 94, 0,
-192,178,108, 78, 92, 92,156,165, 97,200,231,166,217,164, 73,147,155, 36, 73,122, 86,252, 15, 0,212,245, 55,199,113,105,177,177,
-177,109,235, 58, 72,165, 82,217,151, 36,201,153,117,237,199,113,220,242,204,204,204,227,181,237,211,162, 69,139, 40,107,107,107,
-119,146, 36,137,154,246,225,249,255,148, 57, 12,195,240, 58,157, 46,235,222,189,123, 33,245,205, 91,181, 90, 61,135,231,249, 16,
- 0, 63,107, 52,154,163, 0,216,103,185, 86,212,106,245, 48,158,231,231,150,159,195, 37, 25, 25, 25,251,234,243,255,254,254,254,
- 55, 37, 18,137, 39, 69, 81,196,211,121, 82,221,103,142,227,120,147,201,148, 22, 31, 31,223, 86,184,237, 95, 60,157, 90,163, 99,
- 99, 95,213,252,169,111,118,199,103,203,119, 79, 13,109,193,228, 74,164,146,141,195,194, 26, 59, 52,243,115,192,151,155,174, 78,
- 3,184,250, 24, 44,194,203,203, 43,216,221,221,221, 87,175,215, 87, 92,139, 60, 69, 81, 79,236, 68,211, 52, 29, 23, 23,119, 84,
-200, 1, 11, 11, 4,145,104,254, 31,127,252,161,226, 56, 14,253,251,247, 95, 8,224,121, 24, 44, 66, 38,147, 89, 61,122,244, 8,
-102,179,153,244,241,241,177,169,103, 25,229, 18, 25, 25, 9,154,166, 77,157, 58,117,242,169,186, 77, 42,149,186, 92,185,114, 5,
- 0, 76,109,218,180,241,105,232, 1, 6, 5, 5, 89, 91, 91, 89,125, 74, 17, 68, 47,150,231, 3, 1,128, 34,136,251, 44,207,159,
-210,234,245,171, 99, 99, 99,181, 47,123,222,159, 60,121, 18, 19, 39, 78,196,157, 59,119,154, 30, 61,122,244,251, 57,115,230, 76,
-209,104, 52,221, 1,228, 8,119,198, 63,108,176, 26, 43,173,155,186, 58, 58, 28, 89,177,116, 17,142,245,121,187, 54,131, 69,170,
- 84,170, 21, 93,186,116,153,176,115,231, 78,235, 3, 7, 14, 88,251,250,250, 66, 34,145,128,162, 40, 80, 20, 5,146, 36, 65, 81,
- 20, 6, 15, 30, 76, 88,106,174,170,106,158, 62,125,218, 58, 32, 32,160,178,144,229,121,190,210,100,245,239,223,191, 78, 77,146,
- 36, 61,163,162,162,220,228,114,121,229,255,115, 28,247,196,139,231,249,202, 23,203,178,232,210,165,139,101, 7, 74,146, 51, 99,
- 99, 99, 95,213,106,181, 79,104, 84,252, 70,197,223,175,190,250, 42, 0, 28,175, 67, 75,125,249,226,105, 55,130, 78, 2,152,124,
-240,148, 19, 32,109, 4,144,178,106,247,207,207,207, 71,247,238,221,169,134,228,175,171,171,235,216,115,231,206,249, 63,122,244,
-104,200, 87, 95,125,149,119,245,234,213,239, 1,108,213,104, 52,169, 13,209,227,121,126, 73, 82, 82, 82, 19,158,231,225,231,231,
-183, 24, 64,189, 12, 22, 69, 81,158, 39, 79,158,116,147, 74,165,149,249, 92,211, 59,203,178,160,105, 26,225,225,225,140,112,203,
-255, 67, 15, 26, 2,139, 71,190,214, 27,122, 51, 9,179,153,113, 85,185,218,238,152, 54,182,171, 24,188, 9,219, 15, 71,193,204,
-112, 63,213,215, 92,245,235,215,207,103,227,198,141,162,216,216, 88, 81, 80, 80, 16, 88,150,173,124,113, 28, 87,175,251, 82,160,
-210, 96, 17, 36, 73, 34, 61, 61, 29, 54, 54, 54,246,221,186,117,203, 96, 89,118,246,197,139, 23,183,255, 63,252,220, 19,145, 45,
-130, 32,180, 26,141,102,215,139, 78,115,235,214,173,187,200,197,226,221,139, 22,124,226, 22,216,188, 5,233,236,234,140,135, 15,
-211, 32, 21,241,161, 15,227, 30,116, 88,188,236,187, 15, 90,183,110, 61, 50, 58, 58,250,226,203,150,223,222, 67,183,124,207, 49,
-244, 36, 0,216, 20, 1, 0,155, 81, 82, 82,130,119,223,125, 23,135, 14, 29, 10,234,216,177,227,114,150,101, 39, 8,119,198, 63,
-104,176,252,212,114, 15, 27,137,252,196,166, 31,214, 17,230,146, 44,199, 58,110,168, 37, 93,186,116,121,107,231,206,157,142, 4,
- 65,224,244,135,239,192,129, 54, 64, 61,255,107, 56,186,184,194, 52,115, 34,108, 89, 6, 45,207, 68,215,231, 38,125, 66, 51, 46,
- 46, 14,249,249,249,112,117,117,133, 66,161,128, 76, 38,131, 68, 34,129, 84, 42,181,236,233, 77, 16,144,203,229, 56,121,242, 36,
- 68, 34, 81,229,139,162,168,106, 63,187,187,187, 91,124,174, 56,142, 91, 30, 24, 24,216, 42, 62, 62,222,174,160,160, 0,157, 58,
-117, 42, 38, 8,226,118, 21,227,209,234,246,237,219,118, 22,151, 52,116, 18, 74, 31,255, 0,190, 96, 31,224,240, 58, 88,187,145,
- 48,160,209, 19,133, 76,133, 41,100,217,134, 7,157,114,114,114,232, 11, 23, 46, 32, 56, 56, 24,187,119,239,118, 46, 40, 40,152,
-255,243,207, 63,207, 93,179,102,205, 28,141, 70,179,188, 1,146, 78, 0, 16, 23, 23, 7, 0,142, 13, 57, 38,169, 84,138,107,215,
-174,129,231,249, 74, 83, 78,146, 36, 72,146,196, 31, 9, 46,208,154, 72,232,178,238, 98,218, 32, 31,248,250,250,254, 45,170, 37,
-240, 98, 8,107,133,254,109, 90,181,232,232,227,229,141,115, 87,110, 64, 34, 21, 59, 76, 30, 55, 16,182, 54, 34,172,220,250, 39,
-247, 56, 45,127,234,165,219, 22, 71, 74, 8,149, 74,213,170, 79,159, 62, 94, 27, 55,110,148, 0,192,221,187,119,161,209,104,224,
-230,230, 6,185, 92, 14,177, 88, 12,138,162, 32,145, 72,132,147, 95, 15, 66, 66, 66,154, 55,111,222,220,154,101, 89,232,116, 58,
-252,240,195, 15,246,114,185,220,126,224,192,129, 22, 71,178,106,104,182, 11, 52, 26,141,122,149, 74,165, 0,192,145, 36, 89,250,
-116,100, 11, 0, 84, 42,149,117, 53,146, 12,128,220, 54,109,218,120, 0,144, 2,120, 80,117,155,201,100,170,105,155,165,105, 14,
- 13,105,213,244,232,226, 37, 11,172, 51,179, 30,192,222, 46, 19,156, 57, 27,223,127,255, 61,172,172,236,176,112,225,108,209,193,
-182,109,148, 31,127, 50,235,136, 72, 36, 10,191,121,243,230,213,151, 41,207, 57,134,158,212,186,109,231,202,207,219, 79,174,133,
-209, 62, 4,233, 11, 23, 98,205,154, 53,104,210,164, 73,251,251,247,239, 11, 55,199, 63,101,176,154,123,217, 57,240, 28,127,226,
-199,141,171,165,160,181,142,113, 17,151,171,110,174, 58,212,146, 0, 64,186,187,187, 79,222,181,107,151, 93, 69, 97, 23, 64,176,
-112, 0,141, 87,154, 53,131,194,222, 1, 89, 12, 13,222, 76, 67, 42,145,212, 84, 32,214,169, 73,146, 36,196, 98,241, 19, 47,169,
- 84,138,170,209,142, 90, 52,171,214,230, 64, 81, 20, 78,158, 60, 9,179,217,140,225,195,135, 87,107,182,106,160, 90,205,204,204,
-204,227,106,181,250, 54,207,243,175,114, 28, 7,130, 32,110,103,100,100,116,173,216,174, 84, 42,251,182,110,221,122, 38,199,113,
-203,235,210,228,121, 30, 96,242,192,231,239,130,109,167, 92, 20, 95,117, 1, 97,221, 11, 44,124,112, 55, 33, 19,167,111, 38, 35,
- 55,191, 20,109, 2,220,208,167,147, 31, 56,142,179,248, 56,171,162, 82,169,154, 4, 5, 5, 5,154,205,102, 92,184,112, 1, 44,
-203,162,101,203,150, 24, 63,126, 60,185,118,237,218,241, 0,150,215, 87, 19, 64,116,100,100,100,175,204,204, 76, 0,184, 99,193,
-254,119,171, 51,194,191,252,242, 11, 12, 6,195,223,118,118,236,250, 21, 62,123,221, 7,227, 63,220,142,175,227,247, 98,195,134,
- 13, 79, 52,151,214,227, 56,235,139,160,249,183,140,194,248, 17, 67,135,128,146, 88, 35,238, 97, 26,186,118, 12,129,155,155, 27,
-110,199, 62,196,227,244,252, 44,130,192,219,125, 59, 75,151,235,245,166,185, 23,163,177,181, 46, 77,149, 74,213,104,243,230,205,
-226,170,223, 73, 36,146,202, 40,120,213,104,248,211, 77,134, 66, 30, 85,175, 25, 18, 18,210,188,119,239,222, 23, 23, 44, 88, 96,
-251,248,241, 99, 92,190,124, 25, 62, 62, 62,208,235,245,213,221, 55,181,105, 86,215,108,199,101,102,102,254,218,144,227, 60,127,
-254, 60, 3,192,179,186, 29,106,219,102, 73,218, 91,180,104,161,144,136, 68,123,190, 92, 60,207, 58, 50,242, 40, 58,135,134,195,
-202,214, 31, 12,157,134,188,252, 82, 20, 36,100, 96,217,178,213,152, 59,119, 22,190, 90,186,216,118,212,152,241,187, 59,118,236,
-216,228,218,181,107,134,151, 37,223, 73,145,100, 99,244,205, 43,147, 0,160, 56,118, 63, 62, 26,221, 25, 37, 37, 9,248,224,131,
-121, 72, 79, 79,199,131, 7, 15, 34, 95,240,113,190,180, 6,139,199,223, 59,141,214,138,135, 7,228,172,217,124,228,251,111,151,
-219,219,218, 40, 92,111,158, 56,136,148,148,204, 90,255, 71,167,211,153, 14, 29, 58,132, 19, 83, 38,160, 9,193,192,113,254, 74,
-184,169,213, 40,154, 48, 24,165,102, 26,141,255,186, 1,153,141, 13,164,214, 54, 22, 71, 28,116, 58,157,233,236,217,179,136,137,
-137,129, 72, 36,130,141,141, 13,172,173,173, 33,147,201, 42,141, 85,197, 3,216, 82, 77,158,231, 33, 18,137,112,247,238, 93,164,
-164,164,192,193,193, 1,151, 47, 95, 70,175, 94,189,158, 48, 87, 20, 69, 61,209,199,203, 82, 42,154, 22,171, 51, 96,168,163,105,
-240, 9,196, 46,128,211, 91, 40,185,166, 6, 28,199,192,204,219,131,227, 57,220, 74,200,195,251, 99, 6, 0, 0, 38,207,253, 1,
-189, 58,248, 86, 54, 65,214, 7,181, 90,253,126,203,150, 45, 87, 79,154, 52,137,180,182,182,134,209,104,132,209,104, 68, 92, 92,
- 28,156,157,157,161, 80, 40, 26, 20, 38,224,121,254,145, 90,173,134, 92, 46, 7,207,243,143, 26,162, 65, 16, 4,246,236,217, 83,
-237,182,183, 87,223,131,168,172,123, 22, 54,110,220, 8,134, 97,192,243,188, 16,194,250, 39,224,225,225,174,244, 4,201,155,145,
-145,149,139,193,253,251, 64, 36,177, 65,114, 90, 46, 90, 55,243, 83,189, 57, 40, 84, 69, 17, 12,190, 88,177,107, 50,192,109,181,
-224,126,103, 99, 99, 99,197,209,209,209,160, 40, 10,118,118,118, 80, 40, 20,144, 72, 36,144,201,100,149,198, 74,136, 96,213, 78,
-159, 62,125,166,114, 28, 55,155,227,184,130,118,237,218,169, 23, 45, 90,100,159,150,150,134,187,119,239, 98,215,174, 93,185, 60,
-207, 51,229,157,221, 23, 62,235,111, 89, 16,217, 2, 65, 16,245,238,231, 20, 20, 20, 36, 97,232,194,143,236,173,216,215, 68,164,
-157, 15, 83, 92,250,168,216, 76, 30,138, 79,203, 88, 91, 30,253,170, 17,153, 88, 60,117,205,202,217,238, 46,206, 52,250,246,125,
- 13,137,143, 10, 48,107,214,112, 20, 23, 27,176,243,151, 85, 0,164,160, 25, 10, 33,237,195,161, 82,121, 33,172,115,152,234,194,
-165, 11,147, 1,172,122, 89,174,129,199, 7,222,155, 12, 96,177,183,183,247,249, 31,150, 45,243,239,217,179, 39, 0,224,244,233,
-211,248,105,244,104, 44, 4,198,218, 2,154,143,128, 89, 47,244,137, 81, 79, 47,242,223,110,176, 42, 18, 84,159,132, 17,114,198,
-118,239,162,217, 83,125,189, 27,249, 41,175,255,185, 7, 73, 73,233,200,202, 42,168,237,164,113, 4, 65,112,141, 26, 53,130,157,
-217, 0,123,222, 4, 55,149, 26,182, 78,206, 40, 48,151, 71,174,172,173, 33,181,182,177,244,225, 88,169,217,172, 89, 51,100,101,
-101, 65, 34,145,192,198,198, 6,182,182,182,149, 6,171,194, 92, 89,250,192, 37, 8, 2, 28,199, 65, 36, 18,225,246,237,219, 8,
- 11, 11,131,151,151, 23,118,239,222,141,190,125,251,254, 45,138,213,144,166,167,138, 62, 87, 85, 35, 87, 36, 73,206,180,164,115,
-251, 19, 72, 27,131,177,125, 3,164,162, 39,104,222, 14, 70, 94, 85,222, 36,200,227,207, 27, 89,136, 79,201,125,162,185,208,114,
-243,236,161,150,203,229,219,103,205,154,213,163,109,219,182,160,105, 26, 0,160, 80, 40, 96, 52, 26, 33, 22,139, 65,211, 52,244,
-122,125,250, 63,113,225, 86,156,243, 19, 39, 78,128, 32,136, 74,163, 91,209, 84,168,213,164, 98,252,180,157,144,138,128,219,183,
-111, 35, 48, 48, 80, 40, 81,255, 33,172,228,114,103,169,220, 30, 28, 99,128, 72, 44,134,183,215, 43,224, 88, 35, 10,138,117,120,
-251,141, 65,136,186,115, 15, 71,207, 94,103,204,102,110,173,165,154, 1, 1, 1,200,206,206, 6, 69, 81,176,181,181,133,181,181,
- 53,154, 54,109,138,212,212,212, 39,162, 88, 2, 53, 67,146,228,156,163, 71,143,186, 83, 20,165,100, 24, 6,169,169,169,184,125,
-251, 54,214,173, 91,151,165,213,106,187, 69, 69, 69,197, 55, 64,182,166,102,187,234, 58,171, 55, 36,178, 85,181,242,231,111, 39,
- 51,157, 90,185, 98,138,103,203,214,237, 8, 57,101, 83,164,123,152, 29,118,227,250,213,208,185, 91,127,159,154, 82,168,235,153,
-157,157, 93, 99,229,141, 34,201, 94, 77,155,183, 32, 57, 46, 13,148, 36, 16,223,174,254, 12,249, 5, 90,148,150,232, 1, 72, 97,
- 50,139, 96, 52, 18,232,222,163, 39,118,239, 57,132,118,109,219, 81, 20, 73,246,121,153, 12, 22, 0, 80, 20,181,252,224,193,131,
-254,114,185, 28, 75,151, 46,133,173,173, 45,174, 45, 94,140,159, 36, 18, 88, 1,216, 72,211, 51,241,226, 12, 86, 67,188,200,191,
- 34,130, 85, 47, 60, 61, 61, 87,117, 12,237,240,106,163,102,237,228,215,143,237, 71,194,131, 20,228,230, 22,129, 7,244,181,157,
- 60,130, 32,120,177, 88, 12,183, 47,190,132,119,203,150,208, 77, 28,134, 2, 51, 13,191, 63,175, 65,102, 99,131,251,189, 67,192,
-155, 76,232, 18,155,101,169,113,225, 9,130,224, 1,192,197,197, 5, 18,137, 4,114,185, 28,114,185,188,178,239, 85,213,151,165,
-102,136,227, 56, 20, 23, 23,227,209,163, 71,152, 56,113, 34, 20, 10, 5, 8,130, 64, 86, 86, 22,124,124,124, 64, 81, 20,210,211,
-211,113,230,204, 25, 52,106,212, 8, 82,169,180, 94, 23, 67,149, 78,237,173,212,106,245,121,158,231, 91,221,188,121,211,174,109,
-219,182,168, 87, 4,139,144,192, 8, 31,176,240, 4,199,255,167,175,149,153,121,178,242, 86, 97,178, 44,193,221,221, 61, 40, 48,
- 48,240,234,186,117,107,109,221,220,220,193,113, 44,204,102, 51,138,138,138,161,211,233,224,237,237, 13,107,107,107,126,229,202,
-149, 4,203,178,255,216, 80,222, 10, 67, 85, 17, 65,172,232,127, 69,146, 36,166,189,230,141,130, 2, 91, 80, 84,217,103, 75,211,
- 46,240,252,177,182,182,117, 18, 73,172,193,145, 34,216,219, 59, 66, 36,181, 6,199,136,192,114,128,173,189, 11,174, 68,197,225,
-234,157,146,247,179,243, 96,201,208,125, 94, 36, 18,241, 20, 69,193,205,205,173,210, 76,137,197,226,138,107, 23,197,197,197,160,
- 40,170,242, 59,129,218, 43,146,201,201,201,208,106,181,184,118,237, 26,246,236,217,147,243,180,185,234,221,187,247, 36,133, 66,
- 49,215, 96, 48, 44, 61,126,252,248,247,181,105, 54,160,217,174, 33,145,175,128,144,144, 16,177,152, 47, 56,250,215,254,213,158,
-118,108, 20,129,228,247,128,248,226, 88,155, 27,110,157,123,182, 31, 72, 52,251,242, 99,159,193,243, 86,255,149,157,141, 32,212,
- 48,226,153, 7, 90,200,173,228, 0, 79,224,242,165, 99,101,205,130,249, 37, 40,213, 26, 96,164, 41, 24, 77, 4, 12, 52,129,158,
-189,194,177,121,235,111,208,100, 23,128, 7, 90,190,108,215, 65,147, 38, 77,218,120,120,120,224,227,143, 63,134, 97,215, 46,148,
- 2, 24, 8,224, 96,121,165,218, 22,152, 46,220, 45, 47,208, 96,121,120,120, 76,109,213,170,213,187, 91,126,222,105,179, 98,222,
- 23,197, 5,177,119, 40,147,158,182, 54,154,205,166,135,154,188,181,117,152,161,178, 90,167,131, 35, 20,118,246, 48, 62, 21,185,
-226, 77, 38,112,180, 9, 18,203, 31,142, 60, 65, 16,224,121, 30, 86, 86, 86,144, 74,165,213, 70,174,234, 19,193, 2,128,194,194,
- 66,236,217,179, 7,237,219,183,135, 66,161, 0, 69, 81,104,213,170, 21, 98, 99, 99,225,231,231, 7, 0, 56,120,240, 32, 94,127,
-253,117, 36, 36, 36, 32, 40, 40,200, 38, 34, 34,162, 94, 6,139,101, 89,156, 56,113,194,142,231,249, 87,121,158, 71, 78, 78,195,
- 70,195,178, 44, 11,173, 86,139, 19, 39, 78, 32, 35, 35, 3, 74,165, 18, 69, 69,182,176, 83,115,149,102,177,226,101,225,131,247,
-139,119,222,121,199,214,198,198, 6, 44,203, 64, 44, 22, 87, 26, 87,177, 88,130,184,184, 56,140, 30, 61,186, 40, 57, 57,249,243,
- 6,142,250, 33, 68, 34,194,189,168,168, 0, 37,197,133,160, 40,120, 1,160,208,128,169, 31, 72,146,172,124,175,120, 17, 4, 1,
-137,152,130,210,221,181,178,227,123,121,244, 78,104, 34,124,129,190, 10,192, 72, 0,111, 21,148,152, 68,249, 37,122,128, 49,225,
- 81,242, 35, 20,106,105,240,140, 25,143,211, 52,208, 26, 57,228,229,151,160,117,155,190,235,206,158, 61, 59,135,166,233,217, 0,
-142, 88,114,205, 71, 68, 68,224,194,133, 11,184,116,233, 18, 42, 58, 74, 3,128,157,157, 29, 78,158, 60,137,238,221,187, 11,185,
- 80, 11, 52, 77, 47,237,211,167,207,108,165, 82, 41, 95,181,106,149,189,183,183, 55, 8,130, 40,126, 58,114,213,182,109,219, 57,
- 51,103,206, 84, 13, 31, 62,124, 26,128,239, 27,248,115,181,117, 86,175,181,140,170,110, 42,134,236,236,204, 73,155,182,143,119,
-181, 22, 63,202, 64,242,183,229,230,139, 2,116,197,192,217,157,144,188,250,101,242,152, 30,147,221, 50, 74,214,190,147,158,153,
-190,185,134, 7, 29, 23, 23,159,130, 13, 27,214, 96,238,220,201,216,181,115, 13, 56, 94,130, 18,173, 25,238,234, 96,152,204, 28,
- 8, 82,140, 78,157,187,224,210,149,235, 0, 75, 99,218,196,171, 47,221, 92,107, 15, 30, 60,184,145,146,146, 18, 56,111,222, 60,
-108,243,240,128,173,173, 45, 62, 93,176,224, 42,203,178,157,133,187,228,249, 24, 44,139, 67,114, 30, 30, 30, 67, 85, 42,213,138,
-157, 59,119, 90,101,100,100, 64,221,164,185,221, 31,191,239, 49,186,217, 72,244,154,252,130,113,209, 25,218, 58,135,219,147, 36,
- 9,102,241,167,200, 99, 76,240,253,227, 10,100, 54, 54,136,239,219, 22,188,201,132,206,145,201,144,217,216, 64, 36,183,170,119,
- 98,170,139, 88, 85,125, 85, 20,198,117, 97, 50,153, 28,122,245,234,133,158, 61,123, 98,216,176, 97,149, 77,129,193,193,193,248,
-237,183,223, 48,116,232, 80, 68, 71, 71, 67,173, 86,163,105,211,166,104,218,180, 41,206,158, 61, 91,191, 56,104,121, 4,171,111,
-223,190,197, 4, 65,220,230,121,190,213,141, 27, 55,236,234,171, 81, 97,160, 78,156, 56,129, 1, 3, 6,192,207,207, 15, 81, 81,
- 81, 56,249,229, 74,136,108, 92, 0,210, 13, 60,199, 87, 70,182, 44,233,131, 37,145, 72,194, 26, 53,106,132,204,204, 44,200,100,
- 50, 56, 58, 58,192,202,202, 10, 50,153, 28,203,150, 45,227, 54,111,222,188,158, 32,136, 47, 53, 26, 77,126, 3,204,121, 99, 23,
- 23,151, 95,198,141, 29,211,193,217,217, 5,238,238, 42,204,156, 49, 43,124,215,111,187, 99, 30, 63,126, 60, 42, 35, 35,227,142,
-165, 90, 4, 65,192,100, 50,129,162, 40, 28,140,119,133,214, 68,160, 56, 45, 18, 31,189,230, 83,105,182, 42,154,122, 43,166,191,
- 16,120, 49, 80, 20,181,237,211, 79, 63,237, 54, 98,196, 8, 66, 66,154, 77, 39,143,111, 23,177, 44, 67,124, 54,251, 71,246,220,
-197,243, 36,203, 50,196,176,209,211,185,163,103,238,144,239, 79, 91,201, 6,119, 28,128,187,119,239, 42, 7, 14, 28,184,196,108,
- 54, 91,100,176, 42,242,184,134,223, 23,154, 8,235,224,244,233,211,235, 1,172,239,221,187,119,166, 66,161, 64,105,105,233,223,
-250, 41, 6, 5, 5, 89, 39, 37, 37, 73,164, 82, 41,218,180,105,227,202,113, 92, 60, 65, 16,171, 78,156, 56,177,165, 62,191, 85,
- 67,100,171,193,211, 52,216, 58,177,131, 90,182,107,106, 27,103, 61,207,214, 74,108,184,245, 74,188,220,142, 0, 80,164, 87, 38,
- 94, 78, 27, 85, 74,102, 83,173, 91,246,104, 6, 91,177,226, 53, 0,213, 26, 44, 2,184,173, 45, 41,233,163,211, 51, 56,127, 46,
- 26,195,135,123,195, 64,147,208, 27, 72,208,102, 30, 36, 37, 1, 65, 73, 48,110,194,187, 48, 49, 28, 10, 53, 26, 16, 64,244,203,
-118, 29,176, 44, 59,115,240,224,193,237,150, 46, 93, 26,244,233,167,159, 2, 0,212,106,117,167, 57,115,230,220,251, 7,230,193,
-122,105,154, 7,159,142, 96,213,154,176,174, 93,187,110, 49,155,205, 67,242,243,243, 29,223,125,247, 93, 58, 55, 55, 23, 7, 14,
- 28,192, 79, 63,253,164,211,154,169,155,133,121,204,216, 36,141, 54,205,146, 66,145, 36, 73, 72,204,102,240,204,127, 34, 87,156,
-209, 88, 25,201, 18, 91, 41,234,151, 35,229, 17,172,234, 76, 85, 69, 36,171, 62, 15, 91,153, 76, 86,120,233,210, 37,183,180,180,
-180, 39, 58,180,251,250,250, 2, 0,110,220,184,129,107,215,174, 97,212,168, 81, 16,137, 68,144, 72, 36,184,125,251,118, 73,125,
-142,185,194,240, 84,140, 34, 84, 42,149,125, 59,116,232, 80,211,232,193, 58,181, 30, 63,126, 12, 63, 63, 63, 24,141, 70, 56, 56,
- 56, 32, 79,243, 8,143, 31, 37, 65,103,140, 71, 35,165, 28,217,217,217,144,201,100,150,222,112,108, 69,193,101, 52, 26,161,209,
-100, 66,173, 86, 99,199,142,157,216,178,101,203, 40,141, 70,179,183, 33,215,154, 74,165,154,222,191,127,255, 37, 67,134, 12, 17,
-233,180,165,224,185, 50,195, 35,145, 74,240,221,119,223, 53, 61,115,230,204,173,117,235,214,125, 37,151,203,151, 36, 38, 38,154,
-234,202,115, 0,216,182,109, 27, 0, 64,209,113, 1,102,142,120, 5,111, 77,222,142, 85,171,246, 63,145, 86,138,162,176,104,209,
- 34,161, 68,125,129,116,236,216, 49,120,246,236,217,226,138, 62,113,106,239,165, 12, 77,211, 28, 0, 4,182,122,245, 63,145,202,
-190, 64, 66, 66, 2, 86,173, 90, 5,173, 86, 11,145, 72, 36, 49,155,205, 22,253, 70,175, 94,189,208,183,111,223,202,102, 66, 23,
- 23, 23,208, 52, 13,134, 97, 4,115, 85,207, 72,214,128, 1, 3,102,115, 28,199,115, 28, 55,175,226,251,144,144, 16, 43, 55, 55,
-183,203,107,214,172,113,102, 24, 6,211,167, 79,119,200,205,205,117,152, 50,101,202, 44, 0, 91,106, 40, 39,234, 51,187,186, 69,
-211, 52, 84,215,167,139, 32,136, 70,214,214,246,200, 65, 38, 10, 93,204,193,133,206, 76,254, 9,205,251,183,189, 82, 91, 7, 90,
-177,102, 63,178,216, 4,123, 43, 59,128,227,155,212,248,156,227,184, 19,177, 49,247,122,122,122,248, 81,135,254, 56,135, 1,131,
-134,194, 96, 34, 96,160, 73, 16,148, 24, 4, 37, 65,187, 14,157,225,235, 23, 0,142, 3,238, 69, 71,210,102,142,251,235,101,202,
-251,170,243, 96, 77,255,238, 52,230, 44,254, 22, 99,134,245,197,248,241,227,255,201,121,176, 94,218, 62, 88, 53,153,171,183, 29,
- 29, 29, 71, 79,152, 48,193,234,198,141, 27, 88,188,120,177,232,228,201,147,116, 68, 68, 4,195,178,236,244,140,140,140, 77,245,
-249, 81,146, 36,209,104,231,159, 80, 43,149,120, 16,222,238,137,200,213,249, 86,158,224,140, 70,244, 78, 42,170,119, 98, 42,154,
-178, 42,140, 85,133,185,170,101, 42,133,218,106,224,213,206,123,245,193, 7, 31, 96,203,150, 45,232,220,185, 51,252,253,253, 33,
- 18,137, 42,155,165, 26, 18,193,170,160,222,163, 7,159,170,205,123,123,123,227,206,157, 59,176,183,183,199, 47,191,252, 2, 47,
- 79, 15,140,237,227, 11,147,201, 4,179,217, 12,173, 86, 91, 17,193,170,243, 64, 57,142,139, 57,112,224,128,223,136, 17, 35,120,
-145, 72, 68, 24,141, 70, 0,192,218,181,107,179,235, 59,227,122,121,109,104,152, 76, 38,219, 58,106,212, 40,219,166, 77,155, 34,
- 43, 43, 11,215,175, 95,197,172, 89, 51,175,139,197, 34, 67,120,191,254,221,130,130,154, 99,242,228,201,100,112,112,240,220, 89,
-179,102, 77,247,244,244, 28,159,150,150,182,167, 46,147,245,219,111,191, 1, 0,222,249,238, 62, 76,166,178,130,121,227,198,141,
- 80, 42,149, 79,236,251,240,225, 67, 97, 20,225, 11,132, 97, 24,158, 36, 73, 34, 53, 53,149, 86, 40, 20,132,147,147,147, 72, 38,
-147,193,104, 52, 86, 26,173,132,132, 4, 28, 57,114, 4,105,105,105,112,114,114, 34,237,237,237,193, 48, 76,129,165,215,124,213,
-209,130, 21,134, 74, 48, 87,245,231,252,249,243,235, 1,172,175,248,220,179,103,207,137, 4, 65,204, 48,155,205,118, 91,182,108,
-113,176,179,179, 35,142, 28, 57, 98,250,225,135, 31, 74, 41,138, 42, 0,176,178,182, 50,229,121,205,174, 94, 75,228, 11, 44,131,
- 7, 5,165, 73, 62, 98, 27, 21, 23,109, 32,174,124,156, 58, 51,176,128,108,226, 78, 52,111,206, 12,207,142,185, 60,214,156,216,
- 57, 39, 43,155, 96,121,190,198, 73,156, 10,138,138,190,223,250,243,238,143, 14,236,219,238, 45,183, 83, 96,204, 91, 83,113,226,
-212, 69, 72,101, 10, 92,191,121, 11, 38,154, 69,242,227,116,140,122,115, 12, 84,110,206,160,116, 25, 26,163,201,180,233,101,202,
-251, 39,230,193,106,219, 25,151,247,175,196,111,241,222, 72, 95,188,248,159,158, 7,235,165,139, 96, 85, 75,251,246,237,109, 11,
- 11, 11,191,251,228,147, 79,172,180, 90, 45,114,115,115,145,151,151,135,235,215,175,159, 52,155,205, 31,213, 54, 74, 3,101,171,
-109,223,125,186, 80,164, 40, 10, 78,174,110,144,217,216,130, 55,153, 42, 35, 87, 18,133, 53, 56,163, 17, 28,109, 2,106,110,206,
-169, 86,147, 32,136,191, 69,173,234, 97,174,158,208,172,136,136, 85, 55,169,168,151,151, 23,190,250,234,171,191, 77,211, 96,201,
-113, 2,101,163, 5,121,158,111, 85, 17,121,226,121,190,149, 82,169,236,107,225,200,193,106, 53, 57,142, 67,215,174, 93,113,242,
-228, 73,220,185,115, 7, 36, 73,162, 95,191,126, 32, 8, 2,246,246,246, 16,137, 68,149,102,174, 98, 64, 64,109,154, 44,203,190,
-245,211, 79, 63,125,246,215, 95,127,125,241,225,135, 31, 90,189,250,234,171, 21,253,188,114, 80,182,198, 99,189,142,147,227,184,
-133,183,111,223,182,101, 24, 6, 75,151, 46,197,205,155, 55,181, 15, 31, 62,252, 68,163,209,108, 5,192, 23, 20,150,140, 73, 76,
-124,180, 97,254,252,249,182, 61,122,244,192,141, 27, 55,228, 94, 94, 94,243, 1,236,169, 43,237,215,175, 95, 7, 69, 81, 96,242,
- 83, 48,121,230,110,216, 40,196,136,139,139, 67, 94, 94, 94,229,181, 86, 75, 83, 82,181,154,207,136,160, 9, 32, 34, 34,226,247,
-245,235,215,127, 48,110,220, 56, 9,207,243,108, 74, 74,138, 25, 0,161, 84, 42,169,136,136, 8,238,240,225,195,208,235,245,240,
-244,244, 36, 61, 60, 60,136,147, 39, 79,114,177,177,177,215,121,158,159,109,233,113, 86, 53, 87, 98,177, 24,122,189,222, 82,115,
- 37,228, 81,237, 44,216,191,127,191,202, 96, 48, 64, 42,149, 98,239,222,189,244,246,237,219,239, 21, 23, 23,119,137,138,138,210,
- 55, 68,179, 1,211, 52,212,170, 89, 82, 64, 30, 57,121,226, 94, 43,115,247, 31,137, 15, 51,243,194, 42, 43,174, 4,225,178,215,
-189,133,139,188,125,235,116,155, 11,223,144,165,188,238,112, 77,154,137,137,137, 38,219,224,224,215, 63,253,108,222,217,197, 11,
- 23,216, 46,255,122, 5,238, 14, 24,142,194, 34, 29,140, 38, 22, 52,195, 97,225,194, 47,225,230,228, 0, 71, 9, 93, 90,168, 39,
- 94,143,141,141,165, 95,166,124,127,198,121,176,254, 63,142,243,165,162, 78,247,161,211,233, 22, 7, 4, 4, 72, 99, 99, 99,241,
-240,225, 67,196,199,199,131,101,217,132,244,244,244,129, 13,253, 81,146, 36, 97,111,111, 15,169, 84,138, 78,119,210, 33,149, 72,
- 32,181, 46, 91,158,170,119, 82, 17,192,243, 32,165,178,122,107, 62, 61,231,213,179,140, 34, 98, 89,182,114,134,246,170,235, 25,
- 62, 61, 90,173,190,145, 43,146, 36,103, 94,189,122,213, 46, 37, 37, 5, 60,207, 99,255,254,253,118,195,134, 13,155,217,144,232,
- 21,207,243,200,203,203, 3,199,113, 16,139,197,232,209,163, 7, 66, 66, 66, 80, 90, 90, 10,150,101, 43,155, 47, 37, 18, 73,189,
- 70, 17,102,103,103,235, 0, 44, 50,155,205,155,230,206,157,187,168, 69,139, 22,239,126,252,241,199, 36, 26, 56, 40,130, 32, 8,
-134, 97, 24,236,221,187, 23,251,246,237, 43,225,121, 62, 64,163,209,100, 86,137,222,237,188,118,237,218,201,161, 67,135, 38, 36,
- 38, 38,218, 21, 21, 21, 1,117,204, 97, 83,126,109,194,223,223, 31, 44,203, 98,197,100, 79,148,148,180, 4,203,178, 96, 24, 6,
- 10,133,226,137, 37,136,132, 89,220, 95,112,205,152,227,102,205,153, 51,231,216, 87, 95,125, 53,115,218,180,105, 29,198,141, 27,
- 39,150, 72, 36, 92,122,122, 58,179,107,215, 46,162, 73,147, 38,164, 88, 44, 38, 78,156, 56,193,221,184,113,227, 26,195, 48, 43,
- 0,212,107, 41,146,170,230, 74,232,115,245, 92,217, 51, 98,196,136,113,195,135, 15,183, 10, 14, 14,150,253,244,211, 79,133, 90,
-173,182, 38,115,245,183,224,101, 77,211, 52, 60,167, 9, 72, 1, 0, 26,141,102,211,151, 11, 46, 76, 30,227, 63,186,201,187,206,
-175,224,148, 54, 27, 5, 98,138,180,115, 32, 17,236, 67, 65, 87,152,232,118,234,198,254,120,141, 70,179,173, 54,157, 91,183,110,
- 69,145, 36,217,245,173,183,223, 57, 48, 97,220, 4,245, 23, 31,127, 36, 62,114,242, 44, 88,179, 17, 23, 79,159,134,139, 13,201,
-210,218,172,140, 34, 51, 57, 56, 42, 42,234,165,235,127, 85, 62, 15,214,100, 0,163, 22, 44, 88,176,107,242,228,201,224, 56, 14,
-231,206,157,195,134, 25, 51,176,144,101,199,218, 2,186,143,202,246, 17,120, 94, 6,171, 93,187,118,175,104,181,218, 95, 76, 38,
- 83, 48,199,113,210,243,231,207,195, 96, 48, 32, 54, 54, 86,207,113,220,239,207,240,155, 41,253,250,245, 35,159, 94, 47,174, 6,
-147, 99,105,231,186,148, 94,189,122, 61, 55, 77,142,227,210,170,174, 97, 86,147,110,213,207, 12,195,164, 89,114,160, 28,199, 45,
-239,212,169,211,223,190,107, 96, 33,150,212,179,103, 79,250,105,211, 85,221,223, 85,210,159,102,169,126,110,110,110, 22,128,247,
- 57,142, 91, 51,126,252,248, 5, 0, 18, 26,104,176,150, 4, 5, 5,205, 45,251,147, 88,156,145,145,145, 89,141,169,203, 81,171,
-213,239,122,121,121, 85, 46, 0, 93, 87,218,123,247,238, 77,215,181,200,115,213,200, 21,199,113,105,194, 45,255, 66,185,168,211,
-233, 46, 46, 91,182,172,203,134, 13, 27,102,125,240,193, 7,237, 71,142, 28, 41,234,218,181, 43,142, 30, 61,202,158, 59,119,238,
-186, 94,175, 95, 94, 95, 99, 69, 16, 68,233,211,247, 80, 45,149, 16,131,144, 13,245,227,244,233,211,159,118,238,220,121,193,158,
- 61,123,146,125,124,124,100, 4, 65, 48, 22,154,171,231, 62, 77, 67,109, 70,142, 42, 53, 12,218, 57,250,131, 35,193, 31,190,227,
-211,183,115, 27,185,103, 99,149, 50, 46, 37, 15,169,183, 79,234, 19,207,111,120,196, 27,242, 6,193,130,136,123,100,100,100,180,
-159,159, 95,192,166,159,182,188, 35,161,168,222, 28,207,135,124, 62,101, 44, 72,130,136,162, 89,246,100,113, 73,201,214,186,250,
-132,254,219,145, 73, 36, 99,167, 76,153,130, 29, 59,118,224,192,154, 53,232,155,150,134,223, 36, 18, 88, 73, 36,216, 72,211,147,
- 32, 24,172, 6, 81,163, 19, 9, 8, 8,248, 45, 63, 63,127,120,113,113, 49,195, 48, 12, 75, 16, 4, 67, 16,132,158,227,184, 47,
- 57,142,251, 1,101,157,208,234, 66, 8,197, 11,154,130,166,160, 89, 65, 23, 59, 59,187,143, 57,142, 67,105,105,233, 26, 11,141,
-149,112, 62,255, 33,205,238,221,187,175, 38, 73,178, 3,203,178, 63,159, 59,119,110,243,179,104,214,179,243,123,125,142, 83,164,
- 84, 42, 39,240,142, 54, 3, 97, 22,249,243, 52, 21, 71,209,249, 71,202, 35, 87,156,144,239,150,105,198,197,197,241, 78, 78, 78,
-200,207,207,199,190,166, 77,159,216,102, 11,108,172, 33,130,245, 66,155, 8,121,158,111, 7,192,181,162,254, 15, 32, 14, 64, 27,
- 0, 86, 0,140, 0, 74, 1,184, 84,249,151,188,242,109, 21,219, 47, 16, 4, 97,198, 75, 68, 11, 65, 83,208, 20, 52, 5, 77, 65,
- 83,208, 20, 52, 5,205,103, 52, 88, 3, 80, 22,216,225,103,206,156, 57,139,231,249,240,153, 51,103,206,170,242,185,114,123,217,
-238,252,128,167,182,183,195, 75,134,112,241, 9,154,130,166,160, 41,104, 10,154,130,166,160,249, 92, 12, 86,109,239, 53,253, 93,
-229,253,133, 66,212,114,146,238,254, 63,159,232,187,130,166,160, 41,104, 10,154,130,166,160, 41,104,254,207,105,214,165,125,183,
- 58,131, 69, 16,196, 17,158,231, 7, 86,125,175,178,125, 32, 0, 84,108,171,248,187,234,118,130, 32,254,196, 75,132,224,238, 5,
- 77, 65, 83,208, 20, 52, 5, 77, 65, 83,208,124, 38,254,141, 17,172, 26, 71, 17,242,123,247, 82,233, 65,176,147, 90, 41, 36, 0,
- 96,210,235,104,143, 88, 20, 19, 35, 70,176, 16, 16, 16, 16, 16, 16, 16, 16,120,193, 16, 4,113,100,230,204,153,179,255, 13,199,
- 42,170,201, 92,229,182, 85,184,136,140, 5, 1, 44, 67, 7, 2,128,136,228,239,231,182,117,140,231,247,238,205,125,222, 38, 43,
- 60, 60,124, 54,207,243,238, 98,177,248, 79,165, 82,121,110,243,230,205,102,225, 50,122,241,240, 60, 95,231, 98,141,109,218,180,
-113, 52, 26,141, 43, 57,142,235, 81,190,206,223, 57,137, 68,242,217,173, 91,183,242, 9,130,168,113, 72,180,183,183,247, 46, 63,
- 63,191, 0,190, 12, 0,120, 98, 94,174,138,239, 42,182, 63,126,252,248, 65, 90, 90,218,155,150, 30,187,151,151,151,175, 92, 46,
-127,155, 32,136,160,114,157, 88,131,193,240,115,106,106,234,163,255,181,124, 84,169, 84, 86, 60,207, 15, 17,139,197,227,156,156,
-156,218,231,228,228, 44,204,200,200,248,246, 25,158, 17,211, 29, 28, 28, 70, 57, 56, 56, 52,202,207,207, 79, 44, 46, 46,222, 3,
- 96, 21,128, 58,239,211, 47,167,168, 59,190,218,191,235,188, 11, 71,207, 47,158,191, 33,227,218,211,219, 23, 78, 87, 57,247,232,
- 25, 58,239,175, 63,175,124,185,108, 67, 70,125,215,182, 36,203, 95, 64,217,136,177,138, 14,174,255,173,249, 18, 12, 96, 6,203,
-178, 98,146, 36,191,205,204,204,188,244,223,126, 45, 53,109,218,244, 11,169, 84, 58,137, 36,201,196,172,172,172, 9, 26,141,230,
-121, 77,117, 66,250,248,248,216,166,164,164,148,192,178,201,139, 5, 0,116,236,216, 49,139,166,105,183,218,246,145, 72, 36,217,
-215,174, 93,115,127, 9,147,159, 91,209,244, 7, 32, 27, 0, 85,254,217, 84,254,158, 85,229,187,172, 26,182,255,243, 6, 43, 61,
- 8,118, 34, 99, 65, 64, 94,214,189,145, 57,154, 91,111, 0,128,171, 42,120,143,179,123,179,221,233, 65, 82, 90,217,116,168,141,
- 88, 33,250,158,162,196,193, 6,147,209, 69, 44, 18,231,210,140,249, 22,105,226, 39,103,198, 29,120,108,201, 15, 15, 28, 56, 48,
- 0,128,125, 72, 72, 72,196,197,139, 23,219,127,251,237,183,170,125,251,246,181,138,140,140, 28, 61,104,208,160, 63,120,158, 63,
-126,228,200, 17,125,189, 82,211,181,171,200,173,208,105, 44, 37, 18, 13, 2,208,138,231, 1, 16,212,109,206, 76,255,153,237,152,
-247, 51,202,230,104,105,216,133, 29,226, 20, 64,112,244,231, 98,138,239, 98,102,137,139, 60, 41, 89,121, 45, 42, 63,222,114, 3,
-160,234, 37, 21, 17, 63, 2,128,137,225,223, 77, 77,213,156,122,150,253,106,120,128,247, 6,176,147, 32, 8, 49,128,141, 44,203,
- 30,204,202,202,138,134, 5,147,118, 90, 66,179,102,205, 92, 9,130,184,189,186,195,126,171, 0, 0, 32, 0, 73, 68, 65, 84,122,
-245,106,231, 14, 29, 58, 80, 28,199,225,204,153, 51,111,206,157, 59,183,111,243,230,205, 91,148, 95,244,213,226,231,231, 23,112,
-250,244,233,214,199,142, 29, 67,231,206,157,193,113, 28, 56,142,131,131,131, 3, 14, 31, 62,140, 14, 29, 58, 84,126,231,238,238,
-142,174, 93,187, 34, 45,205,178,103,121,163, 70,141,134, 52,111,209,122,218, 39,159,207,112,119,115,118,177,101, 88,134, 78, 79,
-215,168,215,124,187,162,163, 88, 44,254, 62, 41, 41,233, 96, 67, 42, 74,158,158,158, 35,197, 98,241, 64, 0, 65,229,223,197,154,
-205,230, 35,105,105,105,187, 45, 45,200, 91,181,106,117,129, 36,201, 87,234,243,195, 44,203, 62,190,115,231, 78, 88, 67,242, 72,
-173, 86,143, 80,171,213, 63,117,236,216, 81, 17, 28, 28, 12,137, 68,130,175,191,254,122,186, 5, 6, 75, 4, 96,186, 66,161, 24,
-105,109,109,237, 87, 90, 90,250, 80,175,215,239,147, 74,165,189,190,251,238, 59,175,208,208, 80,219,172,172, 44,130,162, 40,247,
- 63,254,248, 99,236,186,117,235,250, 50, 12,211,179,174,107,171, 32,145,155, 39, 19, 7,118, 41,120,120,118, 30,128,126, 79,111,
-103, 12,242,113,148,216,107, 32,197, 71,165,150,155, 54,139, 11,104, 79, 79,207,239,220,221,221,199,235,245,122, 3, 65, 16,124,
-249,171,162,150, 11, 0, 48,153, 76, 5,241,241,241, 77,107, 19,122,165,163,227, 77,138,164,106,156,187,137,229,216,180,228,107,
- 5,109,159, 67, 5,230,227,232,232,232,225, 34,145,136,104,221,186,181, 53,128,190,150,154, 11,149, 74, 21, 64, 16,196, 28,158,
-231, 35, 52, 26,205,247, 0, 88,181, 90,221,157,231,249, 47,202,211,251,117, 70, 70,198,217,242,107,224,123,127,127,255,215, 18,
- 18, 18, 54,102,100,100, 44,105,232,241,250,251,251, 79,158, 58,117,234,130, 73,147, 38, 89,229,229,229,249,244,233,211,231, 87,
-141, 70,211,229, 89,206, 65, 72, 72,136, 56, 51, 51,115,186,171,171,235,135,237,218,181, 83,221,187,119, 47, 51, 37, 37,101,173,
- 82,169, 92, 21, 21, 21, 85,167, 97,111,217,178,165, 90, 36, 18,141, 7, 48,182,188, 0,253, 13,192,207,183,110,221, 74,252, 95,
- 48, 88, 52, 77,187,157, 90, 50, 15, 4, 69, 65,222,165, 23, 56,142, 67,238,202, 5, 96,242,115,225,178,100, 45, 24,134, 65,175,
- 94,189,220, 94,210,200,213,141,127,219, 49, 87,107,176,164, 86, 10, 9,203,208,129, 57,154, 91,111,180, 15, 95,107, 15, 0, 55,
-142, 77,123,195,217,163,249, 93,169, 72, 17, 47,179,147,239,127,125, 80,175,224,225, 3,187, 18,158, 42, 55,164,105,178,221,183,
-254,118, 60,252,200,241,179,251, 81, 54, 47, 69,157, 20, 23, 23, 47,245,241,241,113, 61,125,250,116,178, 84, 42,181,146,203,229,
-196,136, 17, 35,172, 70,143, 30,221,236,204,153, 51,126,199,142, 29, 27,254,218,107,175, 29,147, 72, 36,127,254,254,251,239,117,
-174, 79,230,214, 98, 72, 51,178, 68,246,251,224, 33,253, 94, 25,208,219, 77,234,163,116, 5,199,201, 17,151, 68,123,159,188, 24,
- 21,126,244,216,137,207,217,160, 33, 35,114, 98, 15,222,177,244,228, 52,111,110,231, 96, 69,242,159, 90, 73,249, 81,221, 58,251,
-251, 14,234,215,153,104,212,184, 17,226, 99,227,253,206,158,143, 24, 47,163,238, 61,210,155,136,223,244, 28,177, 58, 38,166,184,
-176, 54, 45,169,136,216,118, 59, 38, 65,205,178, 44,190, 94,241,213, 73,142, 39, 43,103, 87,175,120, 85,204, 66,254,205, 55,223,
-192,104, 52,162, 93,112,243,109,248,207,188, 49,150,240,235,189,123,247,156,117, 58, 29,142, 29, 59, 54, 75,163,209,204, 58,126,
-252,184, 38, 53, 53,245,115,141, 70,243,219,115,168,221,175,223,184,113,163,115,251,246,237, 41,154, 46,155,223, 52, 52, 52,148,
-154, 61,123,182,211,178,101,203,214, 0, 24, 85, 75,225,194, 31, 59,118, 12,191,252,242, 75,238,138, 21, 43,210, 0,192,197,197,
-197,227,205, 55,223,116,221,185,115,103,206,234,213,171,211,120,158,135,179,179,179,231,200,145, 35, 93,121,222,178, 67,245,244,
-244,108,212,162, 85,240,180,159,183,109,235, 80,148,159,111,248,113,245,198, 40,163, 72,166,243, 9, 10,144,204, 91,176,196,254,
-203,249,179,222,167,105,250,110, 90, 90, 90,146,165,137, 84, 42,149,222, 50,153,108,255,236,217,179, 91,132,133,133,137,221,220,
-220,144,149,149,133,184,184,184, 22,151, 47, 95, 30,114,240,224,193,233, 70,163,241,245,204,204,204, 58, 43, 19, 60,207, 55, 57,
-244,245, 87,110, 50,103, 23,112,102, 51, 28, 91, 6, 87,110,203, 56,115, 28,156,217, 12,206,108,134,215,128, 33,149,145,188,238,
-221,187, 55,104, 74,114, 15, 15, 15,117,147, 38, 77,118,204,156, 57, 83, 98, 52, 26,113,235,214, 45, 92,189,122,149,203,206,206,
-174,107, 34, 91, 17, 65, 16, 39, 22, 44, 88,224, 25, 22, 22,102,155,155,155, 11,150,101, 93, 14, 30, 60, 56, 57, 36, 36,196,206,
-211,211, 83,186,125,251,246,138, 21, 2,156,252,252,252,156, 70,143, 30,109,250,229,151, 95,166, 3, 88, 81, 83,228,170,240, 33,
- 55, 79, 67,249,133, 55,109,251, 54, 50, 69,199,195, 63,233,131,191, 28,252,200,202, 72, 86,184,159,159,109, 81,186,213, 12, 27,
-187, 22, 78, 69,233, 39,103,132,251,249,109, 57,150,152,104,201,162,233,164,135,135,199,119,253,251,247,127,115,227,198,141,138,
-216,216, 88, 69, 80, 80, 16, 56,142, 3,195, 48, 96, 89,182, 98,221, 77, 84,157, 48,184, 38, 40,146,242,188,188, 63,198,205,202,
-202,170,242, 62,172,120,215,106,181,232, 59,174,227,115,121,216,114, 28, 39,173,184,174, 25,134,145, 3, 16, 3,176,116, 2,203,
- 69, 87,174, 92, 25,241,215, 95,127,141, 89,178,100, 73, 19,141, 70, 51,149,227,184,121,177,177,177, 93, 1, 32, 40, 40, 72, 10,
-224,172, 74,165,154,240,193, 7, 31, 76,154, 50,101, 10,198,141, 27, 55, 47, 35, 35, 99,105, 67,239,123,169, 84, 58,255,131, 15,
- 62,176, 50,155,205,176,178,178, 2, 77,211,141,159, 37,253, 65, 65, 65,146,252,252,252,125,139, 22, 45, 26, 56,120,240,224,138,
- 37,188,148, 23, 46, 92, 88,246,217,103,159,117, 14, 9, 9, 25, 90,147,201, 10, 9, 9, 9, 6,240,165,175,175,111,223,113,227,
-198, 81,161,161,161, 40, 45, 45,197,137, 19, 39,230,236,223,191,127, 78, 72, 72,200, 21, 0,243,162,162,162,206,189,236, 38,139,
-178,177, 69,220,235,221,225, 23,155, 7, 0,200,252,190,108,105, 72,187,249,223, 8, 33,190,127,131,193,170, 11,157, 78, 23, 50,
-107,218, 88,144,100, 89, 45,209,191,145, 55,150,205,158, 72, 28, 58,114, 60,164,142,240,230,106,150,101,155, 56, 57, 57,125,158,
-151,151, 39, 95,179,102,141, 60, 61, 61, 61,112,223,190,125,124,116,116, 52, 36, 18, 9,236,237,237,209,163, 71, 15, 89,120,120,
-120,227, 43, 87,174,120,239,223,191,127,112,255,254,253,127, 62,122,244,232, 31, 53,233, 58,183, 24,212,196,197,213,245,252, 55,
- 75,222,115,106,209,200, 15, 38,179, 25,105,217,233,224, 33,133,210,205, 26, 99,134,180,150,132,182,149,248,175,218,112,250, 28,
- 65,190,246,106,118,204,225,152,186,210, 24, 22,162,184,209,189,211, 43,109, 94,235,219,153,244, 15,106, 6,137, 76,241,159, 90,
- 84, 72, 8, 90,134,132, 16, 19, 39,150, 52,138,142,138,158,123,236,244,245,217,246, 18, 38,242, 82,148,174,125,205, 37, 45,100,
- 21,107,167,189, 62,236, 13, 4, 4, 4, 60,241, 48,175,248, 59, 57, 57, 25, 4, 65, 32, 55, 55, 23, 28, 15,105, 3,242, 6,215,
-174, 93, 67,235,214,173,209,167, 79, 31,140, 26, 53, 74,117,240,224,193, 95,215,175, 95,223, 53, 61, 61,125,226,179, 92, 44, 44,
-203,134,134,132,132, 80, 52, 77,131,162, 40,228,229,229, 33, 41, 41, 9,126,126,126, 20,203,178,221,234, 48, 26,232,220,185, 51,
- 86,172, 88,145,118,225,194,133, 16, 0,232,210,165, 75, 84,135, 14, 29, 92, 87,175, 94,157,118,233,210,165, 54, 0,208,185,115,
-231,200,182,109,219,186, 90,122, 76, 10,133,226,157,143, 63,249,204,181, 40,191, 64,111, 46, 41,161,109, 56,150,177,147,139,137,
-226,156,188,194, 71,169,118,186,119, 38, 77, 19,205,159,249,233, 59, 0, 44,106,179, 87, 42,149,222,129,129,129, 55,182,108,217,
-226,230,236,236,140,194,194, 66,228,229,229,225,198,141, 27,224, 56, 14,225,225,225,178,144, 86,173, 66, 86,173, 94,125, 21, 64,
- 39, 75, 76,150,204,217, 5,251,186,150,221, 26, 35, 18,243, 42, 35, 44,199, 70, 13,170,220,103,116, 74,217,226,230,114,185,188,
-193,203,250,240, 60,223, 41, 52, 52, 84, 2, 0,211,167, 79, 47,214,106,181,203, 8,130,248, 85,163,209,164,215,241,175,211,231,
-206,157,235,209,168, 81, 35,159, 95,127,253, 21,165,165,165, 0,224,214,168, 81, 35, 52,105,210,132, 61,127,254, 60, 2, 2, 2,
- 96,107,107,139,243,231,207,227,218,181,107, 8, 14, 14,182,149, 72, 36,111,208, 52, 93,173,193,122,181,127,215,121, 50,113, 96,
-151,166,109,223,134,141,157, 10, 91,118,237, 70,220,205,159,187, 24,205,247,231,205,194,249,183, 40, 94,246,118,246, 99,235,153,
-190,109,187, 57,251, 55, 31,140, 87,218,220,114, 49,178, 23,146,230,246,110,180, 92, 36, 55,108, 95,184, 74,147, 87,147,185, 82,
- 42,149, 43,251,245,235, 55, 98,227,198,141, 14, 0,112,231,206, 29,100,102,102,194,213,213, 21,114,185, 28, 98,177, 24, 34,145,
-168, 94, 75,101, 89, 89, 89, 65,163,209,160,162,226,192,178, 44, 74, 74, 74, 42, 23, 13, 95,184, 16,228,194,133,150, 69,155,148,
- 74,101, 88, 72, 72,200, 78, 79, 79, 79,175,170,223, 27,141, 70, 76,156, 56, 17, 90,173, 22,193,193,193,161,238,238,238, 70,130,
- 32,192,113, 28,178,178,178, 74,239,220,185,211, 59, 35, 35,227,122, 13,181,119,125,102,102, 38, 38, 77,154,132,199,143, 31, 79,
-217,177, 99, 71, 10, 65, 16,114,169, 84, 90,177, 93,170, 82,169, 2, 2, 2, 2,190,123,239,189,247,144,156,156,140,248,248,248,
- 27,207, 82,169,146,201,100, 90,150,101,221, 24,134,129, 94,175, 71,120,120,184,156,227,184, 44,177, 88,124,191,176,176,112, 76,
- 90, 90,154,198,210,114, 70,165, 82, 41,181, 90,237,198,105,211,166,245,239,218,181, 43,238,223,191,143, 99,199,142,225,181,215,
- 94, 67,183,110,221, 48,103,206,156, 1,243,230,205,155, 14,160,166,202,192,239,251,246,237,243,245,244,244,172, 92, 18,201,206,
-206, 14,239,188,243, 14,198,142, 29,139,163, 71,143,118,254,234,171,175,246,117,237,218,213,237,252, 51,180, 84,252, 27,144,181,
-237, 12,191,216, 60, 36, 6, 57,151,181, 14,148, 27,173,138,207,240, 8, 17,156,205,127,179,193, 50,233,117,180,136,228,239,187,
-170,130,247,220, 56, 54,173,178,137, 16, 12,127,223, 68,235,232,178,176, 57,143, 98, 29, 3, 43, 25,137,100, 77, 9,238, 38,230,
- 86, 39,117,247,169,194,255,147,181,107,215,226,235,175,191,238,167,215,235, 75,147,146,146, 52,165,165,165,218, 49, 99,198, 16,
- 98,177, 24,151, 47, 95,198,163, 71,143,208,178,101, 75, 56, 56, 56, 32, 44, 44, 76,210,167, 79, 31,175, 9, 19, 38,188, 5,224,
-143,234, 52, 49,124, 56, 37, 73, 33, 14,175, 92, 50,210,137,160,226, 17,255,184, 16,141, 61,219,195,217,222, 11,233, 57,165,136,
-188,119, 20,241, 15,255, 68, 99, 79,111, 76,124,179,177,195,183, 63,228, 28, 65,200,196,198,136,122,162,159,215,223,134,132,202,
- 37,108,187,133,107,163,193,106, 31,130, 55, 63, 6, 79,103,254,189,112,119,240, 66, 96,107,119, 40,164,174,228,157,216,111,219,
-213,150,118, 35,195,127,177,116,241,162,173,173,130,219,160,168,168, 8,235,214,173,171, 52, 86, 60,207, 87,214,184, 59,118,236,
- 8,179,217,140,173, 91,183,194,204,149,133,255,107, 59,206,167, 24,221,161, 67,135,221, 60,207, 75,173,172,172, 50, 91,183,110,
-237, 51,117,234, 84,209,200,145, 35,161,215,235,223,219,178,101,203,241,204,204,204, 3,245,212, 44,107, 70,121,229,149,176,110,
-221,186, 89, 81, 20, 5,154,166, 81, 84, 84,132,180,180, 52, 36, 37, 37,193,197,197, 5,248, 79, 95,152, 26, 53,159, 94, 11,145,
-231,121,190, 34,253, 85,141, 88,197,121,177,228, 56, 9,130, 8,116,116,112,180,254,113,213,198,155,174, 50,138,112,241, 82, 19,
- 18, 59, 7, 17,105, 99, 43,227, 41, 74,239,227,165,182, 37, 8, 34,176,134,100, 61,173, 73,200,100,178,253,219,182,109,115, 19,
-139,197, 96, 89, 22,174,174,174, 72, 74, 74, 66, 97, 97, 33, 74, 74, 74,144,116, 63, 22,190,158,158,248,104,226,187,170, 69,223,
-172,222, 15,160,237, 83,133,216,223, 23,227, 54,155,159, 62,230,154, 66,224,176,240, 56,107,138,144, 60,202,200,200,128, 66,161,
- 64, 80, 80,144, 77, 68, 68,196,197,140,140,140,244,186, 52,229,114,249, 27,161,161,161,182,187,118,237, 66,155, 54,109, 96,111,
-111,143,179,103,207,226,206,157, 59,160,105,154, 44, 41, 41,129,141,141, 13,150, 47, 95, 14,111,111,111, 20, 21, 21, 33, 37, 37,
-197, 89, 44, 22,187, 84, 24,146,167, 53, 47, 28, 61,191,184, 32,241,236,188, 76,234,120,248,150, 93,187,241,222,232,145, 80, 50,
-137, 23, 29, 27,147,139,251, 13,232, 60,159, 18,123, 13,180,182,109,225,216,164,197, 96, 72,164, 54,152,250,197,151,136,191,123,
-216, 81, 87,114,103, 10,107, 78,245, 90,184,106,239, 71,213,164,157, 0, 64,170,213,234,119, 55,109,218,100, 91,233,184, 72, 18,
- 98,177,248, 9, 99, 85,177, 24,123, 13,231,244,110, 53,149, 7,208, 52, 13,154,166,193,113, 28,114,114,114, 80, 82, 82, 2, 71,
- 71,199,178, 29, 22, 0, 88, 0, 2, 68,141,134,229,110,149,227, 25,179,123,247,110, 47,133, 66,241,183,157, 82, 83, 83, 81, 84,
- 84, 4,107,107,107, 56, 56, 56,192,108, 54,131, 97, 24, 24,141, 70,155,110,221,186, 77, 6,112,189, 58, 77,138,162, 62,157, 52,
-105, 82,232,145, 35, 71,252,150, 44, 89, 2,154,166, 87,230,228,228,224,189,247,222, 3,199,113, 8, 11, 11,235,200,243,124,220,
-180,105,211,202,194, 93,139, 22,153, 75, 75, 75, 63,104,232,181,228,230,230,214,172, 85,171, 86,142,167, 78,157, 66, 88, 88, 24,
-140, 70, 35, 38, 79,158,108,247,238,187,239,218, 93,185,114,197,117,205,154, 53,219,211,210,210,122,213,166, 25, 18, 18, 34,206,
-202,202,154,209,173, 91,183,233,189,122,245,178,207,205,205,133, 76, 38,195,158, 61,123,240,227,143, 63,254, 69,211,244,220,125,
-251,246, 45,221,188,121,115,248,224,193,131,177,121,243,230,105, 26,141,230,107,148, 53,155, 62,173,169,246,242,242,194,237,219,
-183,225,232,232, 8, 23, 23, 23, 20, 21, 21,225,218,181,107,184,113,227, 6, 2, 3, 3, 65, 16,132, 99,121,153,198, 60,203,125,
- 84, 79, 94,184,102,229, 26,171, 85,174, 93, 0, 96,107,119,211, 22,205,138,175, 86,171, 7, 59, 56, 56, 76,225,121, 94, 84, 80,
- 80,176, 73,161, 80,252, 94,203, 50, 65,194, 66,207, 22, 26,172,138,124,233, 6,224,188, 71, 44,138,115,219, 58,198, 59,187, 55,
-219,237,236,209,188,236, 36, 50,252,125, 74,230, 24,239,126, 83, 87, 12, 0,180,153,199,149,251, 5,184,157,144,133,219, 15, 50,
- 97, 35,175,187,214,237,236,236,140,206,157, 59,227,208,161, 67, 72, 77, 77,181, 89,190,124,121, 19,154,166,233, 65,131, 6,101,
-188,242,202, 43, 5, 97, 97, 97, 16,139,197,184,126,253, 58,138,139,139, 65, 81, 20,164, 82, 41, 56,142,171, 49,210,230,246,128,
-125,123,220,196, 16, 63, 23, 7, 18,127, 92, 62,142,142,129, 67,161,144,137,145, 83,160, 7, 73, 16,120,248,232, 20, 88,214, 26,
-209,247, 31,163, 83, 11,107,116,233, 96,239, 89,122, 58,127, 98, 46,176,193,146, 19, 68,167,159,131,244,149,215, 1,121,115,240,
-166,135,224, 76,233,224,197,110,208,234,228,200, 77, 78,193,253,107,191,131,103,116,117,234,164,165,105,126,218,186,109,123,216,
-185,177,111,191,205,113, 28, 86,172, 88,113, 46, 33, 33,161,123,213,125,252,252,252,206,206,153, 51,167, 91, 65, 65, 1,142, 31,
- 63,254,115, 93, 11,149, 62,141, 70,163, 57, 5,192,169,138,161,245,142,138,138,218,181, 99,199,142, 78,111,189,245, 22,246,238,
-221,251,121, 53, 6,171, 86,166, 77,155, 38, 62,116,232, 80, 95, 43, 43,171,117,243,230,205,179, 49,153, 76,208,104, 52,200,204,
-204,172,140,182,197,196,196,176, 34,145,232, 74, 29,133,127,181,139, 77, 63,109,176,170,124,103,105,205,187,212,100, 54, 27,173,
-189,212,230, 65,131,251,182,188,115,227, 86,188,149,147, 19,217,178, 93,112,179,251, 9,201,145, 68, 89, 19,140, 69,205, 48,158,
-158,158, 35, 23, 44, 88,208,210,206,206, 14, 28,199,193,222,222, 30, 57, 57, 57,149,134,210, 84, 82, 12,186,184, 8,183, 83,146,
- 16,214,173, 7,250,116,234, 24,244,167,217, 60, 50, 45, 45,237,183,218,116,157, 90,133, 84, 70,174,246,250, 57, 87,126, 63, 42,
-185,176,210, 0, 28,109,239, 15,153,141, 53, 90,124, 60,171,193, 55,115,102,102,102,212,169, 83,167,142,134,135,135,247,159, 56,
-113, 34,153,153,153,121,140, 97,152,208,236,236,236,123,181,253,159,141,141, 77,227,220,220, 92,148,148,148,192,222,222, 30,107,
-214,172,129,155,155, 27,116, 58, 29, 34, 34, 34,120, 79, 79, 79,226,236,217,179,240,240,240, 64, 94, 94, 30,104,154,134, 78,167,
-203, 52,153, 76, 53,246,145, 44,111, 6,236,247, 73,111,252, 21,119,243,231, 46, 30, 72,138, 24,254,121,151, 7,209, 55,226, 83,
-207,156,190,188,152, 49,200, 83, 11,211, 78,206,104,212, 46,218,101,202,231,139,176,126,229, 2,196, 93, 63,159,239,238, 93,178,
-129, 37,140, 63,215, 17,165, 53,196,198,198,218, 70, 71, 71,131, 36, 73,216,217,217,193,218,218,186,114, 97,243, 10,115, 37, 18,
- 89, 30,160,175,168,224, 84,152,171,156,156, 28, 60, 76,137,199,190, 51,219, 97,102,204, 46,219, 58,216,101,250, 73, 36,183,139,
-154,231,206,206,139, 65, 84, 29, 5,224,166, 81,163, 70,141,244,240,240,176,173,250,125,235,214,173,241,230,155,111,226,216,177,
- 99,184,121,243,230, 19, 21,172,156,156, 28, 13,203,178, 53,166, 59, 53, 53,181,144,227,184,240,119,223,125, 55,242,192,129, 3,
-118,223,124,243, 77,101,151,130,138,102,209,138,247, 93,187,118, 33, 50, 50,114, 94, 86, 86,214,253,134, 92, 71,238,238,238,129,
- 3, 7, 14,188,176, 97,195, 6,135,172,172, 44,228,230,230, 66,171,213, 66, 44, 22,131, 97, 24,248,251,251, 19, 44,203,250,214,
-213, 28, 72,211,244,225, 51,103,206,244,109,210,164, 9, 0,192,108, 54,227,242,229,203,152, 56,113, 98,158, 66,161,120, 35, 37,
- 37, 69,171, 82,169,230, 28, 57,114, 36,188,117,235,214,104,217,178,165, 50, 59, 59,219, 54, 37,165, 60,156, 91,205,179,130,101,
-217,202,252,217,186,117,107,229, 54,131,161,108,201, 73,147,201, 68,180,109,219,214,247,230,205,155, 47,237,224,150,148, 29, 91,
-144, 60,251, 67,248, 92,140, 3, 0, 68, 54, 43,235,114,229,115, 62,182,108,135,177, 99,235,165,167, 82,169,156,121,158,127,175,
- 89,179,102, 31,135,135,135,187,170, 84, 42, 56, 59, 59,227,206,157, 59,161,199,143, 31, 95,103, 52, 26,127, 96, 89,246, 7, 75,
-162,245,207,129, 39,188,200,203, 20,193, 34,202, 19, 71, 16, 35, 70,176,252,222,189,185,233, 65, 82, 90, 42, 82,196, 3,128,137,
-214,209,238, 55,117,197,196,136, 17,172,107,243,193,224,193,131,229,202,163, 13, 60, 15,214,194,113, 32,134,251,195,192, 21, 30,
-134,155,227, 96,108,222,124, 0,217,217,217,146, 53,107,214,188,114,224,192, 1,207, 49, 99,198, 60,246,247,247, 47,234,209,163,
- 7,182,111,223, 14,165, 82, 9,147,201, 4,142,227,106,116,111,182, 78,236,240, 14, 45,253,169,248,148, 59,104,219,100, 24,124,
- 85, 97,120,152, 94,132,130, 18, 35,242,138,244, 8, 8,248, 28, 89,249, 58, 20,107, 13,184, 19,247, 43, 60, 85,141, 72, 74,252,
- 48, 28, 22, 26, 44,227,195,157, 48, 38,237,134, 68,213, 29,210, 70, 35, 33,118,233,132,212,184,115,184,117,106, 53,210, 30, 92,
- 2,207,177,112,247, 10,180,180, 9,103,225,218,181,107,199, 44, 91,182, 76,244,225,135, 31,118, 91,190,124,121,183,140,140,140,
-115, 0,160, 86,171,187,189,253,246,219,221,108,109,109,177,116,233, 82, 51,207,243, 11,159, 53,115, 51, 51, 51, 31,171,213,234,
- 41,167, 78,157,138,158, 48, 97, 2, 2, 3, 3, 67,226,227,227, 73, 88,208,177,214,223,223,127,162, 84, 42, 29,207, 48, 76,147,
-209,163, 71,147,239,189,247,158,141,155,155, 27,146,147,147, 97, 52, 26, 65,146, 36, 36, 18, 9, 98, 98, 98,184,195,135, 15, 23,
- 73, 36,146,105, 22, 68, 88,224,226,226,226, 17, 22, 22, 22, 9, 0, 78, 78, 78,158, 28,199,193,217,217,217,179, 83,167, 78,145,
- 0,224,232,232,232, 81,157, 17,171,209, 0,211,116,196,227,148,148,128,208, 46,161,170, 11, 55,239, 69,189, 62,100, 96,119, 82,
- 68,146,143, 82, 52, 17,174,206, 78,214,151,175, 92, 42,166,105, 58,194, 18, 45,177, 88, 60, 48, 44, 44, 76, 84, 80, 80, 0,181,
- 90,141,156,156, 28,164,167,167,195,108, 54,195, 80, 84, 0,186,184, 24,116, 81, 33,120, 93, 41, 18, 35,174, 35,200,203, 67,118,
-162,172, 19,252,111,117,213, 56,171,139, 80, 17, 4, 81,249,157,204,214, 6, 86,182,182,149,205, 31,245,120, 56, 14,182,179,179,
-155, 81, 82, 82,114, 52, 35, 35, 99,137,201,100,154,186,108,217,178,118, 95,126,249,165,203,140, 25, 51,236,102,204,152,177, 87,
- 46,151, 7,167,164,164, 24,107,116,168,165,165, 15,205,102,179, 51, 0,247,211,167, 79,195,213,213, 21,197,197,197, 48,155,205,
-208,235,245, 38, 71, 71, 71,121, 94, 94, 30, 12, 6, 3, 76, 38, 19,236,236,236, 16, 25, 25,153,207, 48,204, 31,117, 29,159, 67,
- 99,114,177,209,124,127,158, 83, 51,235,116,150,119,238, 90,162,231, 10, 22,174,210, 44, 6,176, 42,220,207,111,139,137, 59,159,
- 20,127,247,144, 99, 82,196,217,252,140, 7, 58,191, 31,143, 38,149,212,241,240,229, 8,130,224,155, 54,109,138,156,156, 28, 80,
- 20, 5,107,107,107,216,216,216, 32, 48, 48, 16,169,169,169, 13, 54, 88, 85,205,213,169,171, 71,144, 91,170,193,150,149,187,224,
-161,244, 34, 1,184,166,103,166,246,158, 48,125, 68,135,199,118,143,150, 61,186, 92,184,188,150,138,206, 45,141, 70, 99,247, 68,
-248, 69,173,238,238,232,232,120,134,166,105, 36, 39, 39,227,196,137, 19,221,210,211,211,235, 85,128,164,167,167, 39,242, 60, 31,
- 62,100,200,144,237, 45, 91,182,108,204,243, 60, 2, 3, 3, 49,120,240, 96,236,219,183, 15,247,238,221, 67,113,113, 49,119,241,
-226,197,109, 26,141,166, 65, 29,114,148, 74,101,211,254,253,251, 95, 90,191,126,189, 99,110,110, 46, 12, 6, 3, 74, 75, 75,241,
-251,239,191, 35, 52, 52, 20,114,185, 28,107,215,174, 45,102, 24,102,125,109,230,138,231,249, 67, 7, 14, 28,232,235,231,231,135,
-251,247,239,227,226,197,139,112,117,117,133,149,149, 21, 6, 13, 26,228,188,123,247,238,169, 65, 65, 65,171,181, 90,237,226,254,
-253,251,131,101, 89,220,188,121, 83, 83, 62,170,176,198, 60,170,177, 92, 49, 24,192,243, 60,204,102,243, 26,146, 36,223, 8, 9,
- 9,233, 19, 21, 21,117, 3, 47, 9, 30, 30, 30,205,197, 98,241, 71, 0,144,147,147,131, 66, 14,176,201, 47, 27,116, 91, 84,254,
-184,204,207,207,175,124,214,248,251,251,255,169,215,235,103,167,167,167,215, 24,101, 82,171,213,173, 20, 10,197,199,221,187,119,
- 31, 51, 96,192, 0,138,166,105, 28, 57,114, 4,235,215,175, 71,120,120, 56,252,253,253,241,249,231,159,219, 27,141,198,153,199,
-142, 29,155,113,225,194,133, 99, 37, 37, 37,179,106,211,124, 78, 84,122,145,151,201, 96,241,229,174,177, 44,133,101, 83, 49, 20,
-148,215,104, 92,156,156,156,214,179, 44,219, 61, 32, 32, 0, 12,159,133,228,135, 15, 80, 82,192,193,108, 50,130,227,120,240,156,
-101,231,130, 43, 60, 12,187, 87,121, 20, 95, 32, 64,211, 52,220,220,220,176,124,249,114, 20, 21, 21,137, 38, 76,152,224,187,104,
-209,162, 91, 6,131, 1, 90,173, 22,122,189, 30,122,189,190, 86,131, 37,145, 27, 91,250,184, 55, 65,137,190, 61, 20, 82, 41,242,
-138,141, 40, 40, 49, 34,183,208,128,253,135, 70,195,168,215,129, 49,153,192,210, 12,108,220,135,194,223,169, 59,128, 4,139, 38,
- 72,171, 12,162,112, 12,232,244,147,160,211, 79, 66,209,122, 14, 14,173,125,235,137,253, 24,198,178, 38,255,204,204,204,199, 7,
- 15, 30,252,126,252,248,241,211,134, 12, 25,130, 31,126,248,225,235,140,140,140,182,229, 81,132,175,135, 14, 29,138,152,152, 24,
- 92,184,112, 97,227,243,170, 45,240, 60,239,236,228,228, 4,146, 36,161,211,233,140,117,153,171,223,127,255,157, 88,180,104,209,
-177, 65,131, 6,117,154, 58,117,170, 66,169, 84,130,231,121,152, 76, 38,164,165,165,129, 36, 73, 20, 22, 22, 98,235,214,173,218,
-155, 55,111,242, 82,169,244,138, 88, 44,126, 63, 38, 38, 38,163,174,190, 67,142,142,142, 24, 61,122,180,107,251,246,237, 93,171,
-142, 24,124,227,141, 55, 92,219,182,109, 91,249,157,167,167,167,197,233, 51, 24, 12, 91,151, 46,158,215,125,199,206, 61,129, 77,
- 3,253, 29,143,158, 56, 27,229,236,108,103,229,235,235, 39, 43, 42, 44, 52,174, 95,179, 82,164,213,106,127,178, 80, 46,200,197,
-197, 5,153,153,153, 72, 72, 72,128,209,104, 44,107,194,209,149,194, 84, 88, 8,186,168, 0, 48,232, 33,101, 89, 24,115,179,224,
-235,231, 11,252,103,132, 97,237, 79,140, 42,102,234,233, 38, 65,130, 32, 96,101,111, 7,169,181, 53, 40,177,200,226, 62, 88, 74,
-165,178, 77,112,112,240,158,205,155, 55, 75, 62,253,244,211, 14,215,175, 95, 95,159,146,146,146, 34, 18,137,122,174, 92,185,242,
-198,146, 37, 75,100, 99,198,140,105,186,105,211,166,113, 0, 54,213,114, 14,247, 28, 61,122,244, 77,111,111,111,247,187,119,239,
-194, 96, 48,128,227, 56,244,235,215, 15, 0,228, 21,251,197,197,197,233,245,122,125, 86, 76, 76, 76, 73, 74, 74, 10, 13, 11, 70,
-253,205,223,144,113,237,147,156, 11,175,171, 84,234,171, 82,153, 79, 35, 82, 23, 57,244,147,225, 30,223,124,251,123,186,225, 88,
- 98, 98,201,220,222,141,150,235, 74,238, 78,113,244,212,110,248,254, 72,146, 37, 29,220, 43, 71, 11,186,184,184, 84, 54, 9, 74,
- 36,146,138,232, 11,138,138,138,234,106, 34,172,182,240, 46, 42, 42, 66, 81, 81, 17, 30, 60,186,143,156, 18, 13, 78,254,118, 21,
- 44,203, 86, 70, 71,212,238,158, 56,245,219, 13,219,110,195,219,205, 46,110, 89,120, 54,255, 14, 34, 44,189, 78, 73,146,252,120,
-216,176, 97,160,105, 26,131, 7, 15,198,174, 93,187, 62,110, 72, 13, 61, 35, 35,227, 90, 70, 70, 70,147,132,132, 4, 59,179,217,
-252,218,160, 65,131,126,238,223,191, 63,174, 94,189,138,211,167, 79,119, 51,153, 76,241, 44,203,234, 85, 42,213, 50,158,231,221,
- 8,130, 88,166,209,104,106, 29,237,220,164, 73,147, 49,182,182,182, 75,173,172,172, 74, 26, 55,110,172,174,136, 92,105,181, 90,
- 48, 12,131,180,180, 52,252,245,215, 95,154,163, 71,143,106,120,158, 87,148,150,150, 46, 72, 77, 77,253,189,166,102,193,210,210,
-210,131,135, 15, 31, 14,247,243,243,195,249,243,231,177, 98,197, 10, 52,110,220, 24,219,182,109, 67,231,206,157,225,235,235, 11,
- 39, 39,167,143,138,139,139, 59,173, 88,177,162,127, 72, 72, 8, 14, 28, 56,128,236,236,236,117,181, 61,159,106,123,206,234,245,
-122,240, 60,143, 30, 61,122, 76,252,244,211, 79, 49,104,208,160, 19,109,218,180,105, 31, 25, 25,249,224,223, 94, 72,171, 84,170,
-229, 61,122,244,152,209,170, 85, 43,236,220,185, 19,198,182, 97,176,222,246, 7,238, 14, 12, 5, 15, 64,189,237, 80, 89,123,221,
-107,101, 3, 58,124,123, 14,199,140, 25, 51,250, 15, 29, 58,212, 27, 64,243, 26, 52,191, 25, 51,102,204,244,183,222,122, 11, 81,
- 81, 81,216,180,105, 19,110,221,186, 85, 89,230,153,205,102,196,198,198, 34, 54, 54, 22, 42,149, 10, 3, 7, 14, 36,222,127,255,
-253,126,253,250,245,115, 69, 89,183,136,255,239, 40, 86,183,151,169,137,176, 70,215,232,238,238,238,226,232,232, 24,179,126,253,
-122,231, 14, 29, 58, 80, 12,195,224,244,153, 51,248,236,195, 9, 8, 31, 56, 5, 6,163, 20,140,129, 0, 43,177,177,236, 23,237,
- 6,162,248, 2, 1,206,166, 63, 76, 38, 19, 38,238,146,192,129,200,194,154,183,221, 1,128,208,235,245, 48, 26,141,208,235,245,
-208,106,181,208,106,181, 96, 89,182,198,167,100, 73,161, 53, 77,155, 57,164,103,167, 32, 77,115, 23,246, 54,222,224, 73, 47,100,
-229,235, 64,192, 13,102, 67, 28,184,242, 27,211,168, 79,131,214,248,108,166,152, 45, 73,170, 38, 50, 99,121,159, 74,150,101,151,
-174, 92,185,114,226,250,245,235,101, 83,166, 76,105,179,100,201,146,215, 0,224,189,247,222,107, 35,151,203,177, 97,195, 6, 35,
-203,178, 75,159, 83,254, 82, 36, 73,126,252,234,171,175,162,184,184, 24, 49, 49, 49, 71,234,250,135, 57,115,230, 76, 30, 54,108,
- 88,167, 69,139, 22, 41, 12, 6, 3,116,186,178,230,207,162,162, 34,104,181, 90,100,101,101, 97,250,244,233, 5, 52, 77, 79,122,
-244,232,209,190,122, 24, 61, 28, 62,124, 24, 59,118,236,120, 98,196,224, 27,111,188,225,186,107,215,174,236,181,107,215,166,243,
- 60,207, 59, 57, 57,121, 14, 31, 62,220,205,210, 22, 66,141, 70,163, 7, 48,109,201,210, 37,191,126,179,114,165, 91,126, 94, 65,
-188, 68,106,101, 80, 88,201,156,102,124,182,152,207,202,202,154,158,157,157,173,179,244, 56, 11, 10, 10,144,148,148, 4, 43, 43,
- 43, 72, 36, 18,176,186, 82,112, 90, 45,140, 5,121, 32, 77, 70,200, 88, 22, 78, 10, 25,188,220,221,225,237,102, 89, 95,124,205,
-217, 19,248,107,228,192, 39,154, 5, 9,130,192,177,206, 77, 33,181,177,134,220,198, 6, 97, 7, 47,150, 85, 24, 36, 18, 96,205,
-102, 75,154,113, 92, 84, 42,213,225,117,235,214, 73,114,115,115, 17, 19, 19, 19,157,146,146, 82,228,232,232,104,107, 54,155,185,
- 7, 15, 30,156,138,139,139, 27,232,235,235, 11,158,231,235, 26,253,181,106,255,254,253,189, 67, 67, 67, 25, 95, 95, 95,235,156,
-156, 28,239,130,130, 2, 66,163,121,178, 15,115, 68, 68,132,252,241,227,199, 58,142,227, 14,148,155,171, 58, 47,252, 79,134,123,
-200,175, 68, 97, 90, 87, 23,223, 86,246,174,173,144,107,190,213,234, 90,116,230,180, 79,134,123,172,253,246,247,116, 3, 75, 24,
-127,102,205,169, 94, 34,185, 97,123,125,154, 16,120,158, 71, 68, 68, 4, 46, 94,188,136,139, 23, 47, 34, 57, 57,185,114, 7,123,
-123,123,156, 60,121, 18,221,187,119,183,248, 70,209,233,116, 80,169, 84,112,112,112,192,129,115,191,224,199,111,118, 85,118,116,
-175, 32, 55, 55, 23, 10,133, 2, 75, 63, 91,109, 51,225,139,225,139,243,145,219,199, 18,109, 79, 79,207, 70,161,161,161, 3,220,
-221,221, 81, 80, 80, 0, 87, 87, 87,180,107,215,110, 16, 77,211,190,217,217,217, 13,106,202, 50,153, 76,147,187,119,239,190,100,
-250,244,233, 48,155,205, 24, 57,114, 36,146,146,146,246, 36, 38, 38,174,241,241,241,153, 54,101,202, 20,119, 23, 23, 23, 76,158,
- 60,217, 26,192,235, 53,233, 52,109,218,244,147, 47,190,248,226,171,177, 99,199,202,204,102, 51, 78,159, 62, 93, 25,165,102, 24,
- 6, 41, 41, 41, 88,176, 96,129,166,184,184,184,107,122,122,250, 67, 11, 42,145,211, 15, 30, 60,216, 47, 32, 32, 0,199,142, 29,
-195,164, 73,147,254,180,177,177,105, 62, 96,192, 0,111,107,107,107, 68, 71, 71,131,166,105,168, 84, 42,247,153, 51,103, 14,236,
-219,183, 47, 78,157, 58,133,197,139, 23, 31, 81, 42,149,171,158,190,230,158, 54,193, 34,145, 8,230,167,250, 52, 82, 20,133, 91,
-183,110,161, 71,143, 30,152, 49, 99, 6, 0,224,212,169, 83,118,125,250,244,185,219,181,107, 87,187,243,231,207, 27,255,205,133,
-180,181,181,245,248,109,219,182, 33, 33, 33, 1,151, 46, 93, 66, 94, 94, 30, 76, 38, 19,138,184,178,155, 65, 86, 30,185,226, 61,
-124,208,121,250,108,140, 26,248, 58, 52, 26, 13, 72,146,116,169,165,194, 55,102,246,236,217,248,235,175,191,176,124,249,114, 20,
- 23, 23, 87,187,159,149,149, 21,218,181,107,135,224,224, 96, 36, 37, 37, 1,128,203, 11, 72,242, 75, 25,193,170, 41,234,176,230,
-251,239,191,119, 14, 13, 13,165,180, 90, 45, 56,142, 67,167,142, 29, 49,238,237,113, 56,126,224,119,168, 26,117, 7,101,176, 2,
- 99,171,176,204, 96,120,253,140,252,252,124,200,100, 50,200,203, 59,148,222, 78,171, 12,239,194, 96, 48, 84,154,171,138,247,218,
- 96, 76,210,200,216, 68,214,171,184,244, 22,174, 71,238,128,217,100,130,111,147, 89, 48, 50, 46,176,118,123, 7,122,250, 48,232,
-194,178,145,187, 82,187,110,200,202,202, 5, 64, 88, 20,226,172,174,144,231,244,127,239,236,206,177,150, 27,172,236,236,236,156,
-139, 23, 47,174,186,117,235,214,156,126,253,250,225,199, 31,127, 92,206,243, 60,250,247,239,143,136,136, 8, 68, 71, 71,175,202,
-206,206,206,121, 30,121,171, 84, 42,183,110,216,176,161,191,187,187, 59,246,239,223, 15,158,231,235, 52, 68, 82,169,244,189,105,
-211,166, 41, 42,162, 24, 82,169, 20,122,189, 30,153,153,153,160,105, 26, 7, 14, 28, 48,154, 76,166, 79,147,147,147,247,213,231,
- 96,120,158,231,219,183,111,143,213,171, 87,167, 93,190,124,185, 13, 0,116,234,212, 41,178,109,219,182,174,107,215,174, 77,191,
-126,253,122, 27, 0,104,223,190,253,205,224,224,224,122,205,227,162,209,104,210,110,221,188,246, 80,111, 48,136, 29,157,157,116,
-182,214, 82,190,184,164,132,188,125, 59, 74,147,157,157,157, 92, 15,169,216,152,152,152, 22,233,233,233, 72, 73, 73, 1,171, 43,
- 5,105, 52,130, 48,234,209,179, 83, 71, 88,129,135, 12, 28, 36,156, 25, 98, 74,132,146,146, 82, 0,136,173, 51,106, 91,165, 64,
-168, 48, 87, 4, 65, 64,110, 99, 3,169,173, 13,100, 54, 54, 79, 68,180, 44, 49,151, 86, 86, 86,191,110,218,180, 73,165, 82,169,
-240,237,183,223, 66,165, 82, 5, 42,149, 74,157,173,173,173,149,139,139, 11, 2, 2, 2,208,182,109, 91,156, 61,123, 22, 4, 65,
-212, 85, 48, 50, 60,207,247,185,116,233,210,244, 43, 87,174,140, 80,171,213,196,216,177, 99, 17, 30, 30, 14,153, 76, 6,189, 94,
-143,130,130, 2,252,249,231,159, 4,199,113, 33,229, 6,207, 71, 38,147,237, 34, 8, 34, 45, 57, 57,249,141,167, 5, 55, 46,105,
-169, 46,209,115, 19, 72,173,213,235, 93,251,250,182,236,209,183, 23, 26, 53,233,137, 30,125, 83, 1, 96,185,139,248,209,200, 21,
-179, 29, 14, 56,218, 17,219,174, 28, 60, 53, 63,172, 95,247,185, 11,233,115,139, 23,174, 43,168, 51,138, 69, 16, 68,101, 97, 75,
-146,100,181, 81, 42,138,162, 64,146,164,101,207, 36,142, 77, 11,127,187, 83,229,103, 51,243,127,236, 93,119, 88, 20, 87,223, 61,
- 51,179, 59, 91,216, 5,145,190,128, 5,177, 2, 42,210,172, 17,177,196,196, 24,141, 73,140, 37,150, 24, 75,212, 88, 98,137, 26,
- 83,176, 98, 52,118,141, 45,177, 36, 81,163,168, 49, 26, 35,106, 16,187,210, 81, 68, 81, 1, 41,187, 75, 83,154,176,125,103,190,
- 63, 96, 9, 32,101, 33,250,165,188,115,158,103,159,221, 41,123,230,150, 41,103,206,253,221,123,117,118, 46, 78, 45, 72,147,115,
- 5, 0,197,197,197,200,200,200,128, 94,175,135,173,173, 45,244,122, 93,215, 70,188, 84,205, 30, 53,106, 20,161, 86,171, 49,127,
-254,124,172, 91,183, 14,195,135, 15, 39,110,221,186, 53, 27,192,220,198, 94,216,206,206,206,235,102,204,152, 49,255,131, 15, 62,
- 64, 97, 97, 33,194,195,195, 17, 20, 20,132,111,191,253,214, 62, 60, 60,124,117,175, 94,189, 64, 81, 20,206,159, 63, 15,157, 78,
-119,191,129,235,125,214,248,241,227,133,153,153,153,160,105, 26,126,126,126,200,202,202, 66,105,105, 41,114,115,115,177,124,249,
-242,236,162,162,162,126, 10,133,226,145, 25, 73, 35,221,221,221,231,180,107,215, 14,127,252,241, 7,102,204,152,241,187, 68, 34,
-121,187,160,160, 96,154, 70,163,217, 50,116,232, 80,244,234,213, 11,247,239,223,199,155,111,190, 9,127,127,127,132,135,135, 99,
-209,162, 69,191, 89, 88, 88,188,211,192, 56, 88, 15, 34, 34, 34, 58,251,249,249,161,180,180, 20, 37, 37, 37,224,243,249,176,182,
-182, 70, 82, 82, 18,218,183,111,143, 69,139, 22, 97,195,134, 13,152, 55,111, 30,243,234,171,175, 26,116, 58, 29,109,234,101,249,
-111, 70,105,105, 41,171, 84, 42, 97,101,101,133,163, 71,143,226,246,133, 48,156,153,245, 33, 68,159,175, 3,203,178,200, 90,185,
- 24,253, 63,253, 28, 61,226, 83,160, 84, 42,113,224,192, 1,144, 36,137, 26, 29, 80,158,123,182, 21, 21, 21,161, 91,183,110,162,
- 66,194,102, 0, 0, 32, 0, 73, 68, 65, 84,136,138,138,194,129, 3, 7,176,113,227,198, 74,183,150,207,231,163, 95,191,126, 24,
- 52,104, 16, 30, 60,120,128, 93,187,118,193,202,202, 10, 28,154, 38,176,136, 26,223, 85,220, 25,166,191,191,191, 63,245,236,217,
- 51,168,213,106,228,228,228, 32, 45, 45, 13, 98,177, 24,242,220, 12, 4,180,125,134,108, 66,139,196,184,100, 35, 65,241,227, 26,
-178,225,117, 58, 29,180, 90, 45, 18, 18, 18,202,187,190,183, 15,169, 12,126,174,136,249,128, 90,173, 70, 68, 68, 4, 43, 22,139,
- 33,145, 72,136,250,218,222, 25,131,230,247,139,215,226,135,140, 27,209, 95,112, 62,226, 59,232, 53, 6, 60,211, 88,163, 84,173,
- 69,137,138, 15,173,112, 48, 8,226, 10, 72, 74,136, 94,221,218, 34,252,234, 3,181, 81,175, 59,107,158, 42, 48,130,178,233, 10,
-227,211,132, 42, 2,171,250, 27, 22, 45,148,194,104,104, 92,175, 96,145, 72,180,110,253,250,245,179,190,255,254,123,203,105,211,
-166,117, 48, 61, 44,182,111,223, 94, 34, 18,137,214,253,213, 58,149,201,100,227,220,220,220,150,127,245,213, 87, 46,221,186,117,
- 67, 76, 76, 12, 66, 66, 66,126,203,206,206, 62,105,198,155,177,171,173,173, 45,158, 61,123, 6,129, 64, 0,163,209,136,220,220,
- 92,100,100,100, 64, 40, 20, 34, 50, 50, 82,219,170, 85,171,227, 77, 73,152, 57, 1,237, 85,123, 84, 54, 6, 98,154,241,253,252,
-211,169,237,212,106,149,103, 73, 73,137,129,199,227,241,132,124, 99,106, 99, 56,244,122,253,233, 43, 87,174,188,213,167, 79, 31,
- 97,114, 66, 28,116, 69, 69,208, 23, 23,130, 54, 26, 96,227,219, 13,164, 86, 13, 66,171,135,139, 7, 11, 85,161, 4,215, 98, 83,
-244,122,189,190, 65, 87,208, 36,176, 72,138,170, 30,119,101,101, 9,129,180, 92, 96, 85, 93, 79, 52,208,174,229,224,224, 96,209,
-183,111,223, 1, 62, 62, 62, 96, 89, 22,235,214,173,131, 86,171, 21,232,245,122,232,245,122,232,116, 58,148,148,148,224,216,177,
- 99,248,225,135, 31,174, 53,107,214,108,159, 66,161,104, 40,153, 6, 23, 23,151,143, 25,134,113, 48, 24, 12, 58,123,123,123,250,
-200,145, 35, 16,137, 68, 32, 73, 18,221,186,117,131, 72, 36,210,200,100, 50, 29, 0,216,219,219,235,215,175, 95,207,155, 60,121,
- 50, 93, 27,153,119, 64,135, 5, 70,214, 54, 80, 32,108,229,214,204,190, 43,218,180, 31, 0, 0, 24, 52,116, 18,218,180,107,129,
-162,188,132, 54, 90, 77,250, 8,138,120,210,252,199, 27,242,164, 87, 44, 58,127,240, 36, 43, 34, 25,192,247,230,158, 75, 3, 6,
- 12,192,171,175,190, 90,217, 28,232,224,224, 0,173, 86, 11,131,193, 96,182,184, 2, 0,211, 32,162,193,193, 32,241, 21,176,175,
-187,101, 54,128, 74,123,178,168,168, 8,153,153,153, 72, 79, 79,175,188, 79, 49,172,121,111,215, 50,153, 76,220,166, 77,155,137,
- 94, 94, 94, 8, 15, 15, 71, 66, 66,130,252,210,165, 75, 46, 1, 1, 1,112,117,117,253,128,101,217,207, 42, 92, 88,179, 96,103,
-103, 39,233,222,189,251,172, 15, 62,248, 0,247,239,223,199,162, 69,139,158,100,103,103,159, 56,125,250,244,228, 79, 62,249,132,
- 12, 12, 12, 68,110,110, 46,118,238,220,105,140,140,140,252,166,121,243,230,203,179,179,179,235, 43,199, 84,133, 66,209, 90,173,
- 86,227,201,147, 39, 48, 13,201,112,246,236, 89,132,133,133,229, 20, 22, 22,246, 83, 42,149, 15,205, 73, 91,171, 86,173, 44,125,
-125,125, 29,147,147,147,113,248,240, 97,232,116,186,207,211,211,211,117, 86, 86, 86, 63,109,223,190,253, 43,119,119,119,155,190,
-125,251,162, 87,175, 94, 96, 89, 22,167, 78,157, 66,112,112,240,111, 98,177,248,237,164,164, 36, 93, 3,244, 35, 86,172, 88,177,
-194,206,206,238,189,177, 99,199,146,190,190,190,136,142,142,134,209,104,196,128, 1, 3, 42,197,213,217,179,103, 15,158, 61,123,
-246, 93, 0,180, 84, 42, 21,253,219,221, 43, 19,212,106, 53,146,147,147,225,232,232,136,118, 1, 61,177,232, 78, 26,174, 92,191,
- 1,150,101,209, 39, 49, 13,207,158,149, 98,223,190,125,136,137,137, 1, 69, 81,112,119,119,111,144, 83,167,211,225,225,195,135,
-200,203,203,195,240,225,195,241,254,251,239, 99,237,218,181,208,233,116, 88,186,116, 41,158, 62,125,138,221,187,119,227,225,195,
-135,224,241,120,144, 74,165,255, 31, 89,173, 83,139,252, 39, 29, 44,160,188,237,155, 97, 24, 40, 20, 10, 68, 69, 69, 33, 45, 45,
- 13, 18,137, 4, 42, 3,195,108,189, 25,207,144, 4, 95,110,100,113,149, 53,224,211,134,148,184, 94,175, 39,120, 60, 30,174, 95,
-191,142, 71,143, 30,193,170, 29, 91,233, 94,233,245,122,104, 52, 26,148,149,149,129,207,231, 63,187,113,227,198,227,232,232,232,
- 54, 60, 30,175,206, 94, 96,185,237,169,253,231, 47,252,177,192,183,155,103,135,129,129,193, 56,125,250, 75, 20, 22, 23,163, 84,
-195,195, 51,149, 14,165,106, 22,206,150,109,209,189,171, 15,242,158,104,241, 32, 49, 38, 43,159,182,105,176, 13, 70,111, 36,139,
- 14,110,155,214,108,216,187, 51, 32,114,234, 11,109,218, 17, 48,170,156, 74,129, 69,139, 44, 97,101,215, 18,197,207, 84,184,150,
-148, 10,189,145, 44, 50,183,208,211,210,210,138, 53, 26,205,170,107,215,174,125,109,234,249,115,249,242,101,164,164,164,172, 82,
- 42,149,197,141,169, 64,153, 76, 54, 16,192, 33, 0, 34, 7, 7,135, 28,127,127,127,217,171,175,190, 42, 10, 12, 12, 4, 69, 81,
-136,141,141,197,180,105,211,206, 73,165,210,183, 97,198,152, 56, 2,129, 32,167,168,168,168,153, 80, 40,132, 94,175, 71,118,118,
- 54,238,223,191, 15,149, 74,133,156,156, 28, 16, 4,161,136,136,136, 80, 53,246, 68, 51,245,208,170,249,144,172, 77, 60, 55,178,
- 23, 33, 92, 92, 92, 2,253,187, 7,116,254,102,195, 22,168,202,158, 33,242,198,105, 20, 60,205,199,174, 61,199,187,184,184,184,
- 4,154, 27, 76,156,149,149,245,243,241,227,199,231,123,123,121,249,184,183,104,129,219,233,105,160, 25, 35, 4, 70, 35, 40,173,
- 26,164, 81, 3,215,206, 44, 72, 82,138,156,236, 18,236, 56, 23,126,167, 98, 84,247,250,211,247,250, 48,140, 73, 47, 2, 65, 16,
- 56,247,138, 39, 68, 82, 41,104,169, 4,189,142, 69, 84,138,170,199,107, 22,130,150, 72,209,220,191,225,129, 49,115,115,115,203,
-174, 93,187, 22,125,239,222, 61,255,142, 29, 59, 98,217,178,101,200,204,204, 4,203,178,200,205,205, 85,231,229,229,201,159, 60,
-121,242,152, 32,136, 19, 10,133, 98, 15,204, 28, 45,156, 97, 24,135, 83,167, 78, 1, 0, 13, 0,127,252,241, 7,156,157,157,209,
-172, 89, 51, 20, 23, 23, 99,252,248,241,194, 47,190,248, 2, 0, 16, 27, 27,203, 23,137, 68,117,114, 37,198,221, 95, 95, 80,204,
- 22,144,165, 49,111,231, 27,226,186,244, 31,156,133, 65, 67, 63,192,249,211,251, 16, 30,118, 1,118,252,180, 84,163,248,217,239,
-121,169,249, 37,202,210,246, 59, 61,253, 38, 83,138,103, 97,187,102, 12, 75,230,185,202,152,163, 75,118,212, 63,112, 47,203,178,
-160, 40,234,185,128,246,198,138,171,170, 8, 14, 6,131,175, 64,180,225,243,226,228,217,153,131,157, 29, 93, 43, 95, 46, 50, 50,
- 50,144,153,153,137,118,237,218, 33, 45, 61, 5, 2, 1, 29,103,230,121, 63,118,232,208,161,150, 90,173, 22,191,252,242,139,129,
- 32,136,161,167, 78,157,138,246,246,246,230, 5, 5, 5, 89,238,219,183,111, 44,128, 61,141,105, 49,146, 74,165,180, 94,175,199,
-254,253,251, 33,151,203, 3,115,114,114,146, 88,150,221,249,209, 71, 31,125,235,225,225,209, 46, 41, 41,233,129, 74,165,154,161,
- 84, 42, 19,234,107,114, 3,128,194,194,194, 9,175,189,246,218, 81,134, 97, 90,245,238,221, 91, 50,102,204, 24, 43,150,101,225,
-225,225,129, 51,103,206, 40,148, 74,165,217, 49, 76,233,233,233, 37, 87,174, 92,201,241,244,244,116,148,201,100,160,105,122,141,
-147,147,211, 74,138,162,190,121,243,205, 55,109,142, 28, 57,130,208,208, 80, 72, 36, 18,164,166,166, 42,238,221,187,183,201,201,
-201,105,179, 57, 35,184,199,198,198,166, 2, 24,227,239,239, 31,188,113,227,198,207, 73,146, 28,119,238,220,185,202,177,206, 76,
-226,202,205,205,109, 66,104,104,232,251,255, 49, 35, 68,175,213,106, 97,107,107,139,188,188, 60,228,230,230,162,101,203,150,232,
-217,179, 39,244,122, 61, 78,158,254, 13, 87,174, 92, 1,203,178,176,179,179,131,149,149, 21,226,227,227, 1,160,190,222,195,122,
-157, 78, 7, 27, 27, 27, 20, 22, 22, 34, 62, 62, 30, 14, 14, 14,152, 55,111, 30,180, 90, 45,142, 28, 57,130,184,184, 56,144, 36,
- 9,123,123,123, 88, 90, 90, 34, 46, 46,174, 33, 78, 14,141, 21, 88, 20, 69, 93,188,120,241,226,187, 93,187,118,229, 61,120,240,
- 0, 15, 30,148, 95,111, 42,149,202,192,163, 16,154,123,251,228,152,122,254,222, 25, 85,198,202, 16, 8, 4, 59,222,125,247,221,
- 25,147, 38, 77,194,204,153, 51, 65,146, 36,190,143,213, 32, 35,131,129, 78,167, 67, 78, 78, 14,110,223,190,205,250,251,251, 19,
- 12,195,232,250,245,235, 55, 37, 38, 38, 38,128,162,168,226,186, 56, 17, 26,106, 52,116,126,115,248,246, 29,123,174, 79,156, 56,
-209,102,216,240,237,136,189,155,136,194,210,242, 86, 38,103, 59, 9,186,119, 92,136,220, 39, 26,132,253,126,186,128, 49,168,223,
- 65,226,207,250,250,210, 9, 0,121,101, 42,135,157, 7,142,175, 59,124,236,196,148,169, 19,198,136,250,245,155, 0,126,201,109,
- 24,159,196,192,185,125,111, 16,148, 5,110,197,199, 34,225, 97,166,186, 76, 77,237, 41,214,169, 22, 54,196, 89,205, 75, 39,201,
-173,187,119,108, 89,125,246,124, 4,165,211,233, 48,228,181, 1, 70,146, 36,183, 54, 80, 29,207,113, 90, 88, 88, 28,142,143,143,
-183,209,104, 52,200,202,202,106,211,161, 67, 7,176, 44,139,244,244,116,108,218,180,201,112,230,204,153,237, 34,145,104, 81, 61,
-111,136,213, 56,245,122,253,161,253,251,247, 47,249,248,227,143, 69,185,185,185,184,119,239, 30, 74, 75, 75,161,211,233, 16, 19,
- 19,163,214,235,245,135,205, 56,175,158, 75,167, 73, 96,217,216,216,184,116,239,222,221,212,139,208,133, 97, 24, 52,111,222,220,
-213,223,223, 63, 26, 0,154, 53,107, 86, 87, 47,194, 58,203, 83, 46,151, 95,138,136,184,130,253,123, 54, 64,167,211, 64, 41, 47,
-119, 26,242,159, 20,161, 1,113, 85,147,147, 85,171,213,111,111,220,180,233,230,244, 9,227,156, 94,233, 63, 0,153, 9,241,208,
- 62,205, 3,105, 52,128,207,242, 80,150, 43, 70, 78,206, 51,172, 62,115, 33, 87,165, 86,215, 38, 90,107, 77,103,101,179,160,149,
- 37,132, 82, 41, 4, 21,174,149,105,155, 64,106, 9,190, 68, 10,138,166,107,107,242,122,142,179,172,172,236,157,169, 83,167, 38,
-156, 57,115,166,249,152, 49, 99, 48,108,216,176,216,194,194,194,160,130,130,130, 18, 51,175,253,231, 56, 73,146,204, 29, 50,100,
-136,131, 86,171, 53,140, 26, 53,138,151,159,159, 15, 83, 23,251,146,146, 18,252,254,251,239,232,216,177,124,214,153,196,196, 68,
-120,122,122,214,201, 57,101,209, 29, 57,128, 21,159,188,235,242,205,205,248,236,217, 0,214,180,105,231,138,240,176, 11,184, 18,
-126,125,113,143,206,204,150, 55,198, 6, 44, 23,245,127,111,161,167,239,100, 74,106, 37,195,129,227,199,168,187, 49,223,173, 82,
-151,222,113,199,142,227, 11,235, 74, 39, 65, 16, 96, 89,182,154,184,226,241,120, 40, 43, 43, 51, 87, 92,213,125,109, 18, 96,139,
-189, 10, 62,159, 56,111,100,207, 63, 14,223,178,148, 72, 36,149, 49, 63,109,219,182, 5,143,207,195,247, 39,182,150, 22, 22,230,
-127, 97, 14,167, 68, 34,249, 56, 40, 40, 8, 41, 41, 41, 72, 72, 72, 56,166, 84, 42, 19, 88,150, 61,150,154,154, 58, 42, 32, 32,
- 0, 63,255,252,243,199,245, 8,172, 90, 57, 77, 35,214, 87,184,189, 79, 1, 64,169, 84,198, 3,232,241,232,209,163, 70,229,189,
- 98,176,208,222, 21,229,154, 57, 98,196, 8, 43,131,193,128, 10,241,108,219,200,115,137, 81, 42,149,155, 35, 35, 35, 67,186,117,
-235,134,209,163, 71, 15,138,142,142, 30,228,237,237, 13,119,119,119, 20, 20, 20, 32, 34, 34,226, 71,134, 97, 62, 82, 42,149,106,
- 0,108, 61, 2,176,214,188, 71, 69, 69, 61, 4, 48,222,199,199,231, 61, 30,143, 7, 43, 43, 43, 74, 46,151, 83,231,206,157, 3,
-128,169,161,161,161,198, 38,213,123,211,241,210, 57, 9,130, 88, 58, 97,194,132,157,211,166, 77, 19, 5, 4, 4,160,168,168,168,
- 82,244,159, 57,115, 6, 21, 61,177, 97,107,107,139,135, 15, 31,226,196,137, 19,218,162,162,162, 77, 52, 77,175,169,143,115,252,
-248,241,213, 56, 77,226,237,244,233,211, 48,117, 34,177,181,181,197,131, 7, 15,112,252,248,113,117, 81, 81,209, 6,173, 86,187,
-246, 37,231,253,127, 75, 96, 61,125,250,116,206,146, 37, 75,130, 62,252,240, 67, 91,149, 74, 69,217,217,217, 65,161, 80, 24,194,
-194,194,158,150,148,148,204,105,204,193,110,220,184, 49,243,141, 55,222,216,180,119,239,222,221,187,119,239, 14, 28, 61,122, 52,
-198, 15, 25,130, 25, 61, 37,208,104, 52, 32, 8, 2, 97, 97, 97,247, 47, 94,188,216,134,166,105, 77,112,112, 48, 3,224,102, 67,
-188, 79,238,156,122, 64,117,126, 43,112,203,214,111, 67,125,252,122,180,106,237,214, 90,216,187, 69, 51,232,244, 70,228,228, 62,
-193,165,235,119, 53, 15,238,198,103, 50, 58,237,200,188,164,134, 71,113, 7,128,164, 36,232,128,146, 57, 30, 30,150,203,214,238,
- 56,184,227,135,163,199, 70, 76, 25,253, 54,207,183, 75, 16,210,178, 79,226,114,244, 69, 67, 65, 9,123,162, 68, 75, 77, 79, 74,
- 42, 41,104,108,193,203,229,114,181,136,207, 22,169,213,106,155,180,180, 52,228, 40, 21,197,114,185, 66,221,148,102, 55,141, 70,
-131,148,148, 20, 92,184,112, 1,177,177,177,184,118,237,154,238,220,185,115,123, 73,146, 92, 85,207, 64,147,181, 95,217,157, 59,
-127,253,221,119,223,189,107, 52, 26,221,251,245,235, 39,178,177,177, 65,126,126, 62, 34, 35, 35,181,113,113,113, 41,157, 59,119,
- 94,219,212,147,205,201,201, 9, 35, 71,142,116,240,245,245,117, 48,245, 24,108,209,162, 5,222,121,231, 29, 7,111,111,239,202,
-117, 45, 91,182, 68, 99,134,106,112,113,113, 9,236,215,239, 21, 76,156,252, 9, 84,170,103,184,121,253, 52, 10,159,230,227, 70,
- 84, 50, 52, 58, 4, 54,166, 59,124, 69,239,205, 30, 43, 55,109, 57,254, 90,119,127,143, 14,206, 78, 66, 91,183,214,144,216, 59,
-225,233,147, 39,184, 25,255, 72,191,237,252,165, 59, 42,181,250,109,115,123,122, 50, 12, 83,217,203,205,115,246, 98,144, 36, 89,
- 57, 11,130,105,187,149, 95, 31,144, 60, 62,140, 44,160,211,233, 26,116,239,148, 74,101, 22, 65, 16,239,204,154, 53,235,143,253,
-251,247,147,253,250,245,235,246,235,175,191,254,165, 73,115,229,114,185,107,133, 43, 90,108,101,101,197,251,224,131, 15,160,215,
-235, 81, 86, 86,134,226,226, 98, 60,121,242, 68, 51,119,238, 92, 33, 0,208, 52,173,127,237,181,215, 26,188,127,108, 12,149,171,
- 63,121,215,101,139, 29, 63,109, 84, 81, 94, 66, 27, 59,126, 90,106,143,206,204,150,141,161,114,181,131,117,217, 74,121, 94, 68,
-178,226, 89,216,174, 3,199,143, 81, 19, 70,188, 99,148, 73, 31, 44,182,107,129,163,102,221,188,106, 8,172,166, 58, 87,207,221,
- 79, 18, 17,155, 37, 73, 9, 9, 26, 25,240,217,202,249,235,165,118,246,118, 48, 24, 12, 72,205, 72,193,222,227,219, 74, 75, 52,
- 5,171,158, 38, 33,218, 28,174, 54,109,218,184, 81, 20,133,147, 39, 79, 2,128,105,104,131,109,191,255,254,251,168,177, 99,199,
-162,101,203,150,158, 12,195, 8,235, 27, 70,163, 54,247, 78,175,215, 55,186, 25,189,193,182, 25,130, 72,137,143,143,119,113,113,
-113, 33, 14, 31, 62,252, 76,167,211, 5, 55,225, 26, 95,255,219,111,191,189,194,178,236,107, 62, 62, 62,104,213,170, 21, 0,224,
-238,221,187,184,114,229,202, 33,185, 92, 62, 17, 47,102,114,103,150, 32, 8, 20, 23, 23,155,198, 53,209, 73,165,210,255,228,164,
-209, 10,133,226, 7,131,193, 16, 22, 28, 28,252,101,219,182,109, 63,154, 58,117, 42,213,161, 67, 7, 20, 21, 21,193,202,202, 10,
- 50,153, 12,114,185, 28, 63,252,240,131, 49, 55, 55,119, 47, 73,146,203,148, 74,165,162,169,156,205,155, 55,135, 76, 38, 67, 86,
- 86,150,137,115,183, 94,175, 95,158,159,159,159, 3, 14,141,187,166,204,217,169, 98,152,134,205, 70,163, 49,200,228,106, 61,125,
-250,116, 78, 78,121,196,120,147,212,253, 27,111,188,209, 54, 63, 63,127,183, 78,167, 11, 28, 54,108, 24, 70,143, 30,141, 55,223,
-124, 19,163, 71,143,166, 76,174,213,175,191,254,122,175, 81,111, 12, 21,147, 61,147, 20, 61,148,101,217,174, 0, 8,130, 36,205,
-153,236,185, 65, 37,222,205,195,210, 93, 44,100,246,136, 5, 76, 31,149,150,188,170,210,144, 83,226,146, 74, 82,254,202,155, 77,
-197,196,206, 63, 1,128, 70,207,142,203,202, 82,158,111,108,121, 86, 52, 17, 30, 38, 8,130, 98, 89,118, 43,203,178,135,101, 50,
- 89,138, 57,182,123, 77, 78,150,101, 73,160,124,112,209, 11, 23, 46,124, 73, 16,196, 56,141, 70, 99, 47, 20, 10,243, 88,150,253,
-113,224,192,129,203,183,108,217,162,175,231, 6,205,212,149, 78, 87, 87,215,131,206,206,206,237, 43,142, 83, 45,230,202,244,109,
- 90, 95, 49, 30,209, 35,185, 92, 62,214,220,242,116,111,227, 18,230,238,230,242,170,187,155, 51, 0, 32, 37, 77,129,148, 52,249,
-185,148, 84,249,224, 38,214, 81,229,100,207, 68,197, 80, 12,172,121,147, 61, 87,227,244,244,244,140,166, 40,202,181, 49, 23, 37,
-195, 48,138,196,196, 68, 31,115,210, 41,147,201,198,180,104,209, 98,141, 66,161, 56,158,149,149,245,201,139,120,243,150,201,100,
-189, 72,146, 60,195, 48,140,184,166,195,101, 18, 97,117, 4,185,215,201,249,245,103, 94, 95,244, 14,124,101,196,181, 75, 87, 78,
- 44, 90,157,184,162,234,182,153,111, 53,159, 52,118,230,156,181, 7,183,111,254,116,251, 47, 5,123, 27, 74,103,151, 46, 93, 34,
- 0,180, 55,185, 89,245,193,104, 52, 42, 18, 19, 19,253,154,226, 58,216,116,129,191,181,196,110,133, 86,167,243, 38, 9,176,124,
-154,142, 47, 44,204,255,162, 14,113, 85, 43,167,139,139,203,154,118,237,218,205,121,244,232,209,161,172,172,172, 15,171,148,241,
- 55,173, 91,183,158,153,153,153,185, 45, 43, 43,107,161,185,117,228,230,230,102,229,237,237, 93,176,108,217, 50,242,171,175,190,
- 66,100,100,164,141, 92, 46, 47,120, 17,245,222,178,101, 75, 39,145, 72,116,128, 97, 24,119,163,209,184, 61, 53, 53,117,125, 83,
- 56, 61, 60, 60,232,194,194,194, 57, 45, 90,180,152,231,232,232,232,152,147,147,147,158,145,145, 17,146,157,157,253, 93, 35,196,
- 85,131,117,228,227,227,163, 1,202,167, 19, 51, 51,222,234, 95,233, 96,213, 56,159,220, 25,134, 89,229,237,237,253,238,164, 73,
-147,136,164,164, 36,156, 63,127, 30,143, 31, 63, 62, 81, 17,207,247,224, 69,112,134,133,133,177,233,233,233, 71, 73,146,252, 92,
- 46,151,167,252, 63,230,157, 67, 35, 79,148,122,241,198, 27,111,180, 13, 8, 8,136,232,210,165, 11,211,165, 75,151,146, 23,193,
-249, 50,210,249,167,134,179,147,188,104,206,151,145,206,166,112,178, 44, 75,254,149,207, 63, 33,239,237,218,181, 99, 97,254,252,
-107,255,186, 58,250,183,114,238, 88,217,197,249,214,133,247, 54,238,249,186,243,115,147,151, 7,207,106,110,249,199,201,183,215,
- 6,207,106,110,249, 31, 45, 79,178,137, 47,184,157,107,127, 49,107,177,243,173,183,222, 50,182,104,209, 98,247, 63, 60,239, 68,
-171, 86,173,132,220,117,244,226, 57, 29, 29, 29,253,100, 50,217, 41,153, 76,118,202,197,197, 37,224, 5,115,254,226,228,228,228,
-243, 55,229,157,195,203, 56,249,222,124,243, 77,135,183,222,122,203,134,187,240, 56, 78,142,147,227,228, 56,235,231,148,201,100,
- 98,174, 60, 57,206,255, 32,231,127, 10,188,127, 74, 66, 78,157, 58,149,203, 85, 7, 7, 14, 28, 56, 52,140,198, 12,237,192,129,
- 3,135,191, 7, 68, 61, 42,180, 49,109,171, 77, 81,178,119, 56, 78,142,147,227,228, 56, 57, 78,142,147,227,252,159,227,108,136,
-155,139,237,122, 73,194,139,227,228, 56, 57, 78,142,147,227,228, 56, 57,206,255, 61,206,255, 20, 72,174, 8, 56,188,108,108,153,
- 12,151, 45,147,225,242,178,246,231,192,129, 3, 7, 14, 28,254,105,224,253,215, 50,228,235,235,235,201,178,236, 88,130, 32,222,
- 5, 0,150,101, 67, 9,130, 56, 24, 19, 19, 99,214, 8,180, 34,145, 40, 91,173, 86, 59, 84,252,206, 85,171,213,178, 42,155,137,
- 42, 31,160,188,183, 90,213, 79,173,112,115,115,203,214,104, 52,230,204,175, 23, 71, 16, 68, 44,195, 48, 49, 82,169,244,234,195,
-135, 15,147,205,205,247,192,129, 3, 63,146, 72, 36, 95,168, 84,170,181,231,206,157,219,252,255, 80,212,221, 91, 56, 59,237,211,
- 27,116, 76,118,238,211,165, 0,106,157,134,103,251, 36,132, 16, 44, 22, 86,252, 94, 55,115, 47,150,212, 71,218,216,253,235,129,
- 31,159,207,255,216,209,209,241,245,172,172,172,104, 0,159,130, 27,133,152, 3, 7, 14, 28, 56,252, 19, 5, 86, 15, 31,155, 14,
- 4,163, 91,200,167,216, 87,244, 70,226, 10, 75,210,235,110,198, 62, 77,254, 43, 9,144,201,100, 45, 8,130,232,199,178,172, 7,
- 73,146,183, 25,134, 57,167, 84, 42,159, 52,134,195,199,199,167, 5,128,209, 0,198,116,239,222,189,243,244,233,211,209,174, 93,
- 59,168,213,106, 68, 70, 70, 46,254,233,167,159, 22,179, 44,123, 7,229, 83,202, 28,142,141,141,205,172,139, 75,173, 86, 59,152,
-198,102, 34, 8,194,225,221,119,223,141,172, 50, 9, 47, 97,154, 92,150,101,217,155, 0,110, 16, 4,113,253,231,159,127,206,234,
- 96, 47,234,209,186,133,253, 27,103, 99, 50,150,214,228,212,104, 52, 14,113,167, 78,128, 53, 24,241, 76,158,129,182,111,143,174,
-220,118,254,237, 1, 96, 75,139,193, 23,210,113, 65,191, 94,143, 5, 16,147,145,145, 17,219,170, 85,171,228,250, 56,107,162, 91,
-183,110,203,131,131,131,237,134, 13, 27,246, 49,128, 58, 5, 86, 99, 56,235,129,176,135, 95,215,139,167,142, 29, 22,129, 32,241,
-214,136,119, 15, 93,139,185, 51, 30, 64,181, 9,160,183, 79,132, 35, 65, 96,225,244,185,211, 41, 0,248,118,211,142, 79, 55,190,
-143, 45,159,252,132,108,103,103,231, 32,150,101, 63,173, 40,231,181, 10,133,226,226,246,137,112, 4,176,104,250,220,233, 4, 0,
-236,216,180, 99,225,246,137,216, 60,115, 63, 26, 59,192,221,140,137, 19, 39,110, 89,181,106, 21, 85, 49, 8,223,107,158,158,158,
- 29,138,139,139, 61, 1,112,193,193, 28, 56,112,224,192,225,239, 23, 88, 94, 94, 86,214, 98,146,157, 39, 22,176,163,251,245,106,
-231,246,230,235,189,136, 54,109,219, 32, 57, 41,217,253,226,165,168, 15,132,212,221, 52,149,150, 56,172, 98,136, 13,137,137,245,
-207, 31,246,249,100,232, 13,134,242, 99,242,120, 48, 30, 56,231,122, 34, 40, 40,200,109,210,164, 73,240,241,241, 65,116,116,116,
-208,209,163, 71,231,252,246,219,111, 81,122,189,254,140, 80, 40,140,104,104,132, 99, 31, 31,159, 53, 46, 46, 46,159,206,159, 63,
-159,240,243,243,131, 80,248,231,176, 43, 82,169, 20, 3, 6, 12,192,128, 1, 3,144,157,157,221, 57, 34, 34,162,243,193,131, 7,
- 67,124,124,124,214,198,198,198, 46, 54,167,128,190,248,226, 11,223, 90, 86,135, 17, 4,241,136, 36,201, 24, 15, 15,143,172,182,
- 78,146,142,118, 54,214,167,191, 94,181, 12,103, 95,157, 88,167,112,249,101,112, 47, 0,168, 38,176,116,249, 57, 16, 89, 74,227,
-104,177, 56, 22, 64, 12,128,216, 86,173, 90,197,153,203, 9, 0,129,129,129,194,251,247,239, 19, 44,203, 34, 32, 32,192,134, 32,
-136,100,146, 36, 55,159, 61,123,118, 71,213,253, 26,195,217,144,123, 21,188,112, 38,157,159, 18,135,123,215,207, 97,184,175,139,
- 40, 54,241,254, 74,181, 86,127,172,190, 63, 17, 4, 73,238,143,182, 91, 12,228,206, 97, 24,230,139,164,164,164, 64, 0,240,240,
-240, 16, 0,184,120, 32,178,249,144,137,189,138,254,202, 36,159, 52, 69, 81,219,247,238,221, 59,121,252,248,241, 72, 79, 79,199,
-213,171, 87, 33,149, 74,177,124,249,242,214,243,231,207, 15, 49, 24, 12,115,184,203,158, 3, 7, 14, 28, 56,252,173, 2,171,143,
-143, 69,100, 80,207,214,190,195, 6,247, 34,219,121,120,130, 22, 90, 84,110,235,226,227,131, 46, 62, 62,196,212,169, 37,109,226,
- 99,227, 63, 63,251,199,173,207,154,209,134,152,171,177,101,117, 14,122,102, 48,128, 23,178,234, 32, 0,224,192,158,177, 84,114,
-114,178,155, 88, 44,174, 42, 20, 16, 24, 24, 72,134,132,132,116,191,120,241, 98,247,195,135, 15,235,244,122,253, 38,133, 66, 81,
-223,212, 25,159, 30, 61,122,148,160, 40, 10, 20, 69,213,185,147,147,147, 19, 6, 13, 26, 4, 39, 39, 39, 98,225,194,133,159, 2,
-168, 85, 96,137, 68,162, 92,130, 32, 28, 0,160,121,243,230,198,224,224,224,120,182, 2, 0,192, 48,204, 77,138,162,110, 16, 4,
-113,243,196,137, 19,114,119,103,145,139,148, 22,158,219,189,115, 43,244,197, 57,117,142,227, 85,166,200, 50,169,140,106,235, 5,
- 18,139, 56,129, 68, 18, 43,144, 74, 99, 0,196, 18, 4, 17,103, 46,167, 73, 92,137,197,226,203, 59,119,238,108, 14, 0,179,102,
-205,178, 46, 43, 43,179,158, 50,101,202, 98, 0,149, 2,171, 49,156,245,192,250,149,158,126,143,223,121,243, 53, 43,159,238,125,
-112, 51,244, 91, 20, 22,150,162,180,164, 12, 12,195, 60, 55,243,239,204,253,200,217, 62, 9,235,190,221,184, 99, 17, 65,146,132,
-247,224, 79, 49,216,134,157,157,255,227,143,137, 0,248, 2,129,160,162, 72, 8,158,139,139,139,179,165,115,135,117,237,250,116,
-196,142,205,219,193, 50, 12, 11, 96, 93, 35,220, 43, 7, 75, 75,203,147,231,206,157,235,238,239,239,143,155, 55,111, 34, 37, 37,
- 5, 51,103,206,212,206,156, 57,147,158, 48, 97, 2, 49,111,222,188, 89,107,215,174, 13, 5,112,141,187,244, 57,112,224,192,129,
-195,223, 38,176, 68,180,209, 63,120, 75, 60,140,165,143,192,234, 51,192,234,178,159,219,199,194,186, 5, 58,121, 59,194, 66, 96,
- 79,222, 78,218,232, 95, 99,115,189, 93, 45, 77,226, 42,116,189,179,151,170, 84, 73, 3,128, 88, 34,211,189, 51, 79,158,232,239,
-239, 15,123,123,123,250,250,245,235,243,128,106,115,147,213,228, 36,180, 9,209,184,247,102,111,180,189,247, 20, 22, 22, 22, 48,
- 61,184, 77, 72, 78, 78,198,229,203,151,145,158,158, 14,119,119,119,224,249, 17,148, 43, 57,213,106,181,211,224,193,131, 35,214,
-174, 93,219,119,205,154, 53,183, 15, 29, 58,212, 15, 64, 89,173,238, 94, 11, 43,107,198,192,158,219,179, 99, 35, 31,218, 82,155,
-251, 81,215,234,204,187,219,155,239, 96,122, 97,121,211,227, 17, 79,103,136,172,164, 16, 74, 45,227, 6,133, 69, 85, 58, 87, 4,
- 65,196,153,203, 25, 20, 20,244, 1,143,199, 91,170,211,233,154,237,218,181,203,218,218,218,154, 60,121,242,164,110,231,206,157,
- 37, 52, 77,107, 9,130, 88,221,148,116,214, 7, 62, 69,173,248, 38,120,161,149, 5,105, 64,236,153, 31,145,149,158,129,132,135,
-114,253,207, 87,238, 26,181,122,227,164,218, 56,103,238,197,146,121,111, 9,246, 69, 43,221, 79, 13,253,106,102,251,149,195, 28,
-161,211,233,246,228,229,229, 97,202,148, 41, 96, 24, 6,125,250,244,233,205,178,172,124,246,236,217,112,119,119,199,158, 95, 31,
-148,241,138,111,245, 59, 24, 94, 18,109,102, 58, 59,183,106,213,234,220,197,139, 23, 29, 93, 92, 92, 16, 17, 17,129,236,236,108,
-200,100, 50,204,156, 57, 83,176,102,205,154, 3,197,197,197, 35, 87,173, 90, 37,186,115,231,206,225,176,176,176, 22, 40,143,153,
-123, 25, 93,129, 57, 78,142,147,227,228, 56, 57,206, 23, 12,150,101,253, 1,216, 3,200, 35, 8, 34,170,234,114,197, 46,246, 21,
-223, 53,151,243, 43,158,249, 85, 39, 47,207,175,120, 6,216, 3, 48, 2,136, 36, 8,162,224, 69,167,217, 36,176, 2, 1, 68, 0,
- 88, 6, 32,184,230, 78, 58,121, 4, 4,173,223, 6, 68, 94, 96,181,143,192,104,229, 96,249, 14, 40, 45, 19, 33,255,113, 58,238,
-221, 12, 5,107, 40,107,248, 96, 60, 24,182,110, 26,203,179,180, 0,104,161,189,174,164,164, 4, 18,137, 4,170, 82, 37, 61, 97,
- 74,165,179, 69, 95,188,120, 17, 49, 49, 49,112,118,118,110, 80, 4, 2, 0,171, 45,111, 69,212,106,181,208,106,181,200, 30, 18,
- 0, 73,143,190, 40, 24, 55, 19, 23, 46, 92, 64, 94, 94, 30,104,154, 6, 77,211, 48, 24, 12, 13,166,147,172,152,137,215,100, 90,
-213,182,143,139, 11, 68, 70,189,254,244,214, 13,171,173,172,164, 22,142,209,231,126, 65,122,122,182, 89,133, 46,144, 88, 64, 32,
-182,136, 19, 72,196,213,196, 85, 99, 56, 41,138, 90,126,236,216, 49, 23,141, 70, 3,154,166, 17, 26, 26,170,219,191,127,127, 98,
-105,105,233, 43,177,177,177,170, 23,145,206,154,176,181,183,255,237,237,247,167,205, 92,249,225, 32,168, 74,213, 56,113,229, 46,
-254,184,157, 54, 12,192, 85, 0,165,117,253,111,195, 47,218,135,206,206, 69, 3,166, 76,153, 18,119,252,248,113,187,111,190,249,
- 6, 70,163, 17, 6,131, 1, 6,131,161,242,183,209,104,196,161, 67,135,112,245,214,221,217, 74,101, 73,180,153,201,114,118,115,
-115,187,112,235,214, 45,123, 11, 11, 11,156, 63,127, 30,133,133,133,152, 49, 99, 70,165,115, 85, 88, 88, 56,122,199,142, 29,239,
- 60,126,252,248,155, 43, 87,174, 60, 1, 64, 1, 48,128, 3, 7, 14, 28, 56,252,147, 80,159, 22,177, 39, 8,226, 52,203,178, 67,
- 89,150, 29, 8, 64, 96, 90, 6, 0,130, 32, 78, 87, 60,183,171, 45, 47, 94,188,248,179,144,144,144, 68,211,178,105,159, 37, 75,
-150,120,173, 89,179,102,117,207,158, 61, 15, 95,191,126, 61, 21,192, 75, 19, 88, 17,168,103, 94, 44,205,163,159,160, 73,253, 25,
-180, 44, 8,130, 54,163,192,183,235,137,204,251, 17,136,187,176, 1, 89, 15,174,130,101,140,112,108,209,169,193,131,173,252, 14,
-124,153, 76, 22,163, 80, 40, 16, 27, 27,139, 71,143, 30, 65, 36,122,174,101, 9,127,252,241, 7, 0,192,209,209,209, 60,193,226,
-223, 27, 45,226,149,200,244, 46,239,240,215, 34, 94, 9, 0, 88,189,100, 9, 4, 2, 1,104,154,174,220,215,104, 52, 54,200, 71,
- 84, 68,181, 87, 52, 11,214,214, 59,144, 16, 25, 44,143,126,181,248,227, 86,110,238,237,156,111,253,118, 4,169,169,114,228,228,
-152, 87, 63, 66,169, 36, 78,104, 41,137, 21,136,255,108, 22,108, 2,231,145,145, 35, 71,126, 48, 98,196, 8,113,143, 30, 61,132,
-223,127,255,125, 97, 77,113,245, 87,211, 89, 21, 78, 78, 78,131,223,120,227,141,223,166, 78,157,138,225,175, 13,196,216, 62, 30,
-108, 86,110,145, 10,192,249,138, 55,128,122,161, 80, 40,228, 0, 6,189,253,246,219, 63,121,121,121,121,176, 44,139, 78,157, 58,
- 97,248,240,225, 56,118,236, 24,238,222,189,139,146,146, 18,221,149, 43, 87, 54, 41,149,202,189,102, 38,203,162,121,243,230,103,
-195,195,195,237, 45, 44, 44,112,238,220, 57,148,149,149, 61,231, 92,173, 94,189, 90,148,150,150,182, 45, 44, 44,172, 53,202,135,
- 38,225,196, 21, 7, 14, 28, 56,252,243, 80,175, 22, 49, 9, 39,150,101,135, 86, 21, 76, 53,133,150,233,183,105,191,144,144,144,
-161, 85,197, 23, 0,172, 89,179,102,117,149,229,178,151,145, 25,147,192,234, 87, 33, 36,250, 1,184, 84,195,150, 43,255,193, 24,
-160,147,159,135, 78,126, 30, 22,222, 75,113,114,203,184,106, 68,230, 56, 67,181, 65,173, 86,131, 47,176,213, 29,216, 51,150, 6,
- 0, 35, 43,209, 61,119,236,134,173, 67,179,143,103, 78, 58, 9,130, 32,171,240, 62, 39, 30, 92, 93, 93,215,247,236,221,189, 79,
-187, 46, 1, 22,183,206, 30,199,195, 7,233,200,207, 47, 2, 88,168,235,226, 60, 63,234,117,148,166, 36, 67,108,101, 21, 55, 56,
- 60,190,154,115,213, 20,206, 11, 23, 46, 44,232,209,163,199, 23,161,161,161, 10,119,119,119, 33,143,199,211,213, 16, 87, 77, 74,
-103, 85,200,100,178,222, 60, 30,239, 28, 73,146,226,160,160, 32,204,158, 61, 27,155, 55,111, 54, 48,124,209,208, 29,103,163, 71,
- 62,211,232,150,154, 35,174,170,136,172, 4,133, 66,225,153,156,156, 44, 52, 24, 12, 65,111,190,249,230,153, 33, 67,134,224,198,
-141, 27,184,112,225, 66,123,157, 78,167,172, 56,238,114, 0,142, 36, 73,174,173,103, 38,119,146,166,233,195, 23, 46, 92,240,114,
-118,118,198,249,243,231, 81, 86, 86, 86,233, 92, 77,156, 56,177,154,115,117,253,250,245, 39,156,184,226,192,129, 3,135,127, 52,
-234,212, 34, 85,221,167,218, 68,150, 57,168, 34,190, 84,139, 23, 47,254,140, 32,136,211, 21, 14,151, 10,128,226,101, 9,172, 75,
- 21,170,145, 69,195, 51,188,195, 88,146,250,220, 58,134,105,250,115,171,253,192,176, 68,177, 88,140, 29, 59,118,192,194,194,162,
-209,194,169,244,204,113,100,206,124,191,210,185, 50, 57, 89, 24, 60,161,169, 2,203,228, 96,221, 68,141, 38, 66, 23, 23,151,143,
-187,116,233,242,225,238,253, 63, 89,174,249,226,211,162,226,123,137, 60,117,153, 70,162,209, 27,116,143,114,242,235, 28, 30,193,
- 80, 92, 8,161, 68, 18,199,183, 16, 63, 39,174,154,202,121,243,230, 77,117,255,254,253,247,173, 94,189,186, 7,195, 48,251, 95,
- 68, 58,171,138, 43, 91, 91,219,176,109,219,182,137,197, 98, 49, 52, 26, 13,214,174, 93,139, 63,254,248, 99,104,118,118,118, 24,
-128,176,166,214,183, 78,167,155, 60,112,224,192,141, 11, 22, 44,128, 94,175,199,168, 81,163,240,248,241,227,115, 15, 31, 62,220,
-236,234,234,186, 96,198,140, 25,206,118,118,118,152, 62,125, 58, 13, 96, 98, 29, 52, 95, 31, 60,120,112,168,183,183, 55, 46, 93,
-186,132,162,162, 34,200,100, 50,124,252,241,199,130,144,144,144, 3, 37, 37, 37, 35, 67, 66, 66, 56,231,138, 3, 7, 14, 28,254,
- 61, 48, 75,139, 84,117,162, 26,131, 42,255,227,135,132,132, 36,134,132,132, 84,115,184, 94,150,192, 98,171,168,199, 6,221, 33,
- 70,245,124, 12, 15, 99, 52, 52, 38,147,102,237,103, 78,115, 30,240,103, 12, 86, 45, 66,233,185,229, 70,196, 96,133,177, 44,123,
-189,170,192,114,113,113,121,203,201,201,233,235,131, 7, 15,138, 21, 10, 5, 92, 59,116,110,246,219,177,159, 53,142, 18,161, 58,
-235,233,211, 9, 9,138,210,208,186, 56, 25,117,105,156, 72, 34,141, 21, 89, 72,107,138,171, 38,115, 2, 64,120,120,248,252,154,
-235,254, 42,167, 76, 38,235,109,103,103, 23,182,109,219, 54, 11,133, 66, 1,154,166, 33,149, 74, 17, 30, 30,142, 10,113,213,100,
-184,184,184, 4,207,156, 57,243,171,137, 19, 39,162,160,160, 0, 23, 46, 92, 64, 80, 80, 16,182,109,219,214, 42, 60, 60,124, 99,
-175, 94,189, 64, 81, 20,206,159, 63, 15,189, 94,255,160, 14,154, 17, 83,167, 78, 93,240,206, 59,239, 32, 50, 50, 18, 74,165, 18,
-211,167, 79,215,126,252,241,199,149, 49, 87,223,126,251,237, 59,105,105,105,156,115,197,129, 3, 7, 14,255, 30,212,169, 69,106,
- 60,203,127, 99, 89,246,141,154,174, 86, 77,241,101,114,168,170, 46,215,220,191, 98,187,250,101,100,198, 36,176,234,118,173, 88,
- 35, 40,155,174, 48, 62, 77,168, 34,176,148,213,118,161,133, 82, 24,205, 16, 46,159, 79,134,222,222, 90,201,251, 97, 57, 9,190,
-192, 86,215,126, 96, 88, 98, 93,251, 74,165, 82, 48, 12, 99,150, 14,163,135,188, 67,181, 29,252, 22, 82,186, 56,129,213,235, 42,
-157, 44,124,246, 89, 53,113, 69,211, 52,180, 90, 45,208,112,179, 86, 36, 65, 16,143, 41,138,186, 1,128, 13, 12, 12,220,163,215,
-235,223, 42, 40, 40,104, 62,101,202, 20, 93,126,126, 62, 78,156, 56,129,125,251,246,169,158,233,120,209, 5, 79,244,227, 82,149,
-165, 89,245,240,197,189,113, 41,177,154,115,245, 2, 56,159,195,139,224,148,201,100,189, 29, 28, 28, 42,197,149, 80, 40,132, 84,
- 42,133, 92, 46, 7,143,199,251, 75,131,116,182,106,213, 74,232,235,235,187,104,194,132, 9,184,119,239, 30, 22, 47, 94,172, 84,
- 40, 20,199, 79,158, 60, 57,125,222,188,121,188,192,192, 64,228,230,230, 98,231,206,157,250,200,200,200,213,217,217,217,235,106,
- 61,105,121,188,201, 43, 86,172, 96, 21, 10, 5,145,146,146, 82,205,185, 42, 46, 46, 30, 25, 18, 18, 34, 74, 77, 77,229,156, 43,
- 14, 28, 56,112,248,119,161,190, 22,180,252, 10,241,148, 83,203, 50, 85, 69, 88,213, 92,206,173,177, 12, 0,218, 26,219,227, 95,
-166,192,170, 21,122, 35, 89,116,112,219,180,102,195,222,157, 1,145, 83, 95,104,211,142,128, 81,229, 84, 10, 44, 90,100, 9, 43,
-187,150, 40,126,166,194,181,164, 84,232,141, 21,225, 15,183, 0, 0, 32, 0, 73, 68, 65, 84,100, 81,125,124, 6, 3,120,179,230,
-254,217, 91,208,218,218, 26, 69, 69, 69,213, 28, 45, 11, 11, 11, 56, 59, 59,163,184,184, 24,161,161,161, 96, 89,246, 90, 3,110,
-216,138, 9, 19, 38,124, 57, 99,198, 12,178,237,152, 73,120,118,243,202,115,174,149, 72, 36,130, 88, 44,134, 92, 46,199,253,251,
-247, 25,150,101, 87, 52,160,142,111,145, 36, 25,247,243,207, 63,103, 5, 6, 6, 78,108,222,188,249,152, 73,147, 38,137, 35, 35,
- 35,177, 98,197, 10,222,249,243,231,117, 81, 81, 81, 6,163,209, 56, 95,161, 80,236,108,240,140, 33,136,154,226,234, 47,115,214,
- 34,174,254, 50,167, 76, 38,235,229,236,236, 28,182,121,243,102,139,236,236,108, 8,133, 66, 88, 90, 90, 34, 35, 35, 3, 43, 86,
-172, 40, 53, 24, 12,175,253,197,243, 77, 40,145, 72,132,122,189, 30,251,247,239,135, 92, 46,239,153,157,157,157,193, 48,204,206,
-143, 62,250,104,139,135,135, 71,167,251,247,239, 63,120,246,236,217,204,156,156,156,123,117,145, 88, 91, 91,247,180,183,183, 39,
-110,220,184,129,233,211,167,107,103,205,154, 85, 25,115,197, 57, 87, 28, 56,112,224,240, 31, 84, 94, 4, 17, 89,223,242, 63, 17,
-245, 78,246,156, 87,166,114,216,121,224,248,150, 81,239, 13, 80,135,133,135, 3,173, 38,128,239, 50, 24,160, 68,112,110,223, 27,
-246,173,123, 32,254, 97, 54, 78, 92, 73, 84, 39,203,181, 91,242,202, 84, 53,231,219,171,119,182,237,162,162, 34,180,110,221, 26,
-143,194,135,120, 69, 29,237,228,227, 99,179,213,167, 5,214,123,133,135,135, 99,253,250,245,207,146,147,147, 55,180,111,223,126,
- 65,125,156,113,113,113,203, 50, 51, 51,187, 45, 89,178,228,236,210,172, 98, 20, 44,223,142,226,185, 19,144, 61,160, 11, 44, 44,
- 44, 96,103,103,135,210,210, 82, 92,190,124, 25,241,241,241,103,213,106,117,183,184,184,184,101,245,113,178, 44,123,211,195,195,
- 35, 37, 32, 32,192,178,168,168,104,243,132, 9, 19,196,165,165,165,200,207,207,199,147, 39, 79,112,235,214,173,243, 90,173,214,
-171, 1,209, 82,201,201, 48, 76,165,184,122, 81,156, 85,241,162, 56, 37, 18,201,194, 19, 39, 78, 88,144, 36, 9,161, 80,136,102,
-205,154, 33, 51, 51, 19,203,151, 47, 47, 85,169, 84,175, 41,149, 74,115, 7,232,172,179,222, 25,134,129,193, 96, 0,203,178, 16,
- 8, 4,197, 0,144,147,147,115, 47, 53, 53,117,192,169, 83,167,100,143, 30, 61,234, 87,135,184,170,228,204,207,207,143,120,252,
-248, 49, 36, 18, 9,102,205,154, 37, 88,189,122,245, 15,155, 55,111, 86,135,132,132,208, 3, 7, 14,220, 22, 22, 22,214, 81,165,
- 82,245, 53, 67, 92,253, 47,207, 90,207,113,114,156, 28, 39,199,249, 79,227,252, 79,161, 94, 7, 43, 41, 9, 58,160,100,142,135,
-135,229,178,181, 59, 14,238,248,225,232,177, 17, 83, 70,191,205,243,237, 18,132,180,236,147,184, 28,125,209, 80, 80,194,158, 40,
-209, 82,211,147,146, 74, 26,236,251,207,227,193,176,100,233, 88, 30, 0,240,249, 48,124, 54,116,104,132,151,151, 87,159, 97,222,
-185,244,244, 89,229,206,214,142,173, 99,233,136,136,136,163, 66,161,112, 87, 90, 90, 90,177, 92, 46,111, 48, 19,241,241,241,183,
- 1,188, 78, 81, 84,223, 5, 11, 22,124, 61,196,205, 53, 96, 68,207,126,224,243,249,136,138,138,194,211,167, 79, 35, 73,146, 92,
- 20, 23, 23,119,217,156, 66,249,245,215, 95,179, 0,160,172,172,108, 69,251,246,237, 5, 73, 73, 73,120,244,232, 17,146,147,147,
- 97, 52, 26, 31,202,229,242, 70, 5,196,137, 68,162, 91, 4, 65, 36,190, 72,206,170,120, 81,156, 42,149,106,245,202,149, 43, 95,
- 93,182,108,153,208,210,210, 18,113,113,113, 88,182,108, 89,169, 90,173,110,140,184,170, 23, 44,203, 66,175,215, 55,170,231,103,
- 45, 88,228,237,237,221,113,229,202,149,237, 43, 98,185, 56,231,138, 3, 7, 14, 28, 56,252,123, 4,214,159, 66,171,164, 0,192,
-123,221, 60, 44,221, 87,111,255,105,143, 88,192,244, 81,105,201,171, 42, 13, 57, 37, 46,169, 36,197,220,131,173,252, 14,252,234,
-107,148,176,182,182,150,100, 58,225,153,105, 77,102, 14,160, 84, 42,215, 54, 37, 51,209,209,209,151, 1,116,103, 89,118,196, 25,
-130,248, 12, 72, 5,203,178,171,227,226,226, 78, 52,134,199,223,223,191,117,105,105,233, 15, 26,141,166, 27,195, 48,130, 75,151,
- 46, 65,173, 86, 35, 41, 41, 73,197, 48, 76,104, 99,211,149,150,150,150,248,162, 57, 95, 70, 58,229,114,121,212,233,211,167, 7,
- 18, 4,113, 97,209,162, 69,194,229,203,151,191, 80,113,101, 99, 99, 83,150,157,157,253, 68,173, 86,219,230,228,228,104,109,108,
-108,202,210,211,211,155, 66,245,176,184,184,184,203, 39,159,124,178,124,193,130, 5, 11,191,254,250,107,154,139,185,226,192,129,
- 3, 7, 14,255,122, 4, 6,218, 73,204,220,213, 44, 11,241,243,201,208, 47,158, 8,118,241, 68,176,159, 79,134,254, 69,112, 54,
- 18,213, 56, 59,116,232,112,216,206,206,206, 64,211,180,134, 36,201, 50,138,162,138,121, 60, 94, 54, 73,146,211, 97,198, 48, 22,
-255,102, 78, 0,112,116,116,244,243,244,244, 60, 44,147,201,122,189,136,242,172, 10, 39, 39,167, 87, 93, 93, 93,143, 56, 59, 59,
-247,123, 65,156,254,175,189,246,218, 99,177, 88,124,221,220, 23,134,255,207,115,137,227,228, 56, 57, 78,142,147,227,228, 0,238,
- 68,225, 56,255,165,156, 68, 19,196, 21, 87,158, 28, 39,199,201,113,114,156,156,192,122,105, 32,185, 34,224,240, 31, 0, 11,174,
- 89,144, 3, 7, 14, 28, 56,252,131, 64,212,163, 66, 27, 51, 83,118, 83,148,236, 29,142,147,227,228, 56, 57, 78,142,147,227,228,
- 56,255,231, 56, 27,226,190, 3, 14, 47, 69,120,113,156, 28, 39,199,201,113,114,156, 28, 39,199,249,191,199,249,159, 2,215, 68,
-200,129, 3, 7, 14, 28, 56,112,224,240,130,209,232,192, 96,127,127,255,118, 0, 16, 21, 21,245,240, 37,166,235, 99,153, 76, 54,
-165,107,215,174, 30, 52, 77,147, 69, 69, 69,203, 46, 93,186,180,172,182, 29,187,118,237, 26,253,234,171,175,186, 95,188,120, 81,
- 11,252, 57,255,160,233,219,104, 52,102,197,196,196,248,113, 85,253,247,192,201,201, 41, 76, 36, 18,181, 42, 31, 96,148,133,129,
- 49,194,200,176, 48, 26, 25,232,141, 44,116, 90,117,186,182,172,120,112,147,184,189, 71,180, 52, 26,153, 16, 22,236, 14,130, 37,
-166,179, 4,187,131, 96,137,143, 88,146,216, 65, 48,236, 52,240, 12,223,192,192, 91,192, 99,248, 75,149, 73,161,153,255,133,242,
- 12, 14, 14, 38,255,226,255,107,157,127,170, 91,183,110,167, 69, 34, 81,219,186,254, 87, 86, 86,166, 76, 72, 72, 8,250, 47,159,
-171,142,142,142,125, 73,146,220, 10,192,171,198,166,123, 0,230, 40,149,202, 63,254,234, 49,252,197, 98,158, 29, 69, 77,227, 19,
-196,167, 0,160,103,217,181,249, 70,227,174, 40,149,234, 31, 19, 67,104,111,111,127,153,162,168,246,165,101,101,165,207, 74, 74,
-220,165, 82,105,138,216, 66, 34, 49, 26,140, 15,158, 60,201,235,203,221,213, 56,112,120, 65, 2,203,199,199,167, 3,128, 64,130,
- 32, 2, 89,150,237,219,190,125,123,199,178,178, 50, 24,141,198, 28,130, 32, 46,179, 44,123, 9,192,165,216,216,216,228, 23,145,
- 32,146, 36,215,109,220,184,113,254,172, 89,179, 42, 69,210,157, 59,119,208,165, 75,151, 90,247,167, 40,202,117,205,154, 53,205,
- 50, 50, 50, 64,211, 52, 4, 2, 65,229,135,162, 40,244,232,209,163, 81,199,111,222,188,185,165,131,131,195, 50,130, 32, 70,146,
- 36, 73, 53,180, 63,195, 48, 70,150,101,143,230,230,230,126, 85, 80, 80, 80,210,152, 99,249,249,118,209, 3, 68, 29,199, 96,141,
-209, 49,183,249,245,253,191, 67,135, 14,209, 60, 30,207,181,170,160, 52,161,234,114,213,223, 70,163, 49,235,238,221,187,126,230,
-150,133,200,194, 98, 33, 65,242, 6,130,101, 58,149,147,145,247, 88,198,112, 65, 93, 86,182,206,156,252, 10,133,194, 86, 49,177,
-177,237,239,222, 79,133,123,155,150,208,234, 12,208,104,245, 56,121, 33, 10,222, 30,110, 24, 54,100, 80,147,207, 21, 3, 67, 4,
- 47,253,120, 92,255,213, 91, 15,249,127, 54,107,140,116,245,214, 67,126,159,205, 26, 99,185,122,219, 33,191,165,179,199, 90,174,
-220,122,208,111,233,236,177,205, 86,109, 61,168, 5, 48,185, 41,199,152,212,185,101, 41,105, 52, 8,107,173,123,138,167,217,123,
- 39, 67,242,119, 92,184,171, 87,175,238,160,211,233,146, 38,142,242, 91,209,169,157, 67,110,109,251, 20, 21,229, 58, 60,186, 23,
-253, 5,248,180,135, 71,192,103,245, 94,159, 52, 77,183,185,124,249,114,123,211, 72,251, 70,163, 17, 70,163, 17, 6,131, 1, 90,
-173, 22,239,188,243, 14,239, 69,164,219,215,215,119, 18,203,178,171,202, 79, 75, 98,101, 76, 76,204,182,191, 64, 39,229,241,120,
-159, 8, 4,130, 64,131,193,224, 1, 0,124, 62, 63, 73,163,209, 92, 50, 24, 12, 27,129, 63,199,215, 51,243,222,179, 41, 50, 50,
-210,211,210,210, 18, 58,157,174,114, 98,120,138,162, 58,117,239,222,125, 59,128,246,127, 53,255,118, 20, 53,173, 87,159, 62,155,
- 39,205,157, 75, 21, 68, 69, 97,235,158, 61,155, 80, 80, 0, 0,219, 27,250,175,139,139, 75, 52, 65, 16,174,141, 57, 30,203,178,
- 89,114,185,188, 81, 47,152, 20, 69,181,127,156,161,112,104,221,210, 25,207, 74, 74, 96, 97, 33,145, 68,221, 73,115,240,245,106,
-205, 61, 49, 57,112,120, 17, 2,203,199,199,231, 12,128,192, 78,157, 58,137, 7, 13, 26, 4, 31, 31, 31,180,106,213, 10, 34,145,
- 8, 0,240,244,233, 83,199,187,119,239,190, 23, 23, 23,247,222,141, 27, 55, 0, 64, 5,224,106,108,108,108,173,110,196,128,161,
-125,102,137,164,194,205, 0,144, 39,127,162,204, 74,201,221,170, 84, 42,215, 1,168,250, 70,237, 62,126,252,248,121,179,103,207,
-198,233,211,167,113,232,208, 33,104, 52, 26, 20, 21,213, 61,197,161,209,104,204, 26, 63,126, 60, 47, 57, 57,217, 80,151,131,213,
-152, 2,113,112,112, 88, 54,106,212,168,185,158,158,158,149,211,186,232,245,250,202,239,130,130, 2,204,155, 55,207,116,243, 2,
-195, 48, 8, 15, 15,159,245,233,167,159,162,160,160,224,147,218, 56, 7,246,117,143,230, 17,132, 43,243,167, 40,203,186,112, 37,
-213, 15, 32,168,168,232,120,162,198, 13, 17, 0, 16,224,223,173, 65,113,199,227,241, 92, 99, 99, 99, 29,104,154, 54, 43,111, 12,
-195,192,199,199,199,172,125,157,157,157,131, 40, 30,125,104,196,232, 15,155,119,243,241,225,187, 58,203,160, 55, 24,144,154,150,
- 17, 16, 31, 23,211,237,220,169,159,167,136, 68,162, 49, 10,133,226, 98,125, 60,122, 35,131,248,196,135, 56,127, 53, 22,111,210,
- 34,148,169,181, 40, 41,211,226,135, 95,175, 33, 43,183,168,201, 39,110, 64, 64,128, 75,158, 65,219,125,246,228,183, 36,223,124,
-123, 64, 50,123,242, 91, 88,191,227,135,202,239, 89, 31, 14,199,186,111, 15, 72,103,127, 56, 28, 91,119,238,235,233, 22, 16,224,
- 18, 25, 25, 89,231,180, 0,117,213, 17,105, 52, 8,247,220,149, 83, 0,144,183,115, 39,116, 57, 57,112,254,234, 43, 0,192, 84,
- 47, 87, 97, 99,210,236,229,229, 85, 41,136,235, 21,142, 6, 67, 86, 98, 98,162, 95, 67,226,202, 96, 48,176, 60, 30,239,139, 43,
-191, 47, 11,237, 21,208,161, 90, 97, 38, 63, 72,110, 22,252,229, 87,239, 30, 57, 91,194,190,247,154,101, 82, 82,228,234,122, 69,
- 22,195, 48,164, 70,163,193,131, 7, 15,106, 29,101,159, 36, 73, 99, 83,234, 41, 48, 48, 80, 88, 90, 90,122, 80, 42,149,118, 45,
- 45, 45,157,196, 48,204,151, 17, 17, 17,142, 36, 73, 98,224,192,129, 95,250,250,250,166, 9,133,194,111,213,106,117,156, 84, 42,
- 29,115,233,210, 37,141,153,212,125, 45, 45, 45,127,248,229,151, 95,154,251,248,248,144,249,249,249,112,115,115,195,211,167, 79,
- 3, 46, 95,190,236,251,225,135, 31,126, 88, 82, 82, 50, 30,192,229, 70, 36,183,163, 68, 34, 97, 39, 76,152, 64, 24,141,127,102,
-247,251,239,191,135,111,219,156,182,131,186,137,202,212, 58,182,232, 74,130,232, 35,150,100,175,166,167, 23, 53,250, 4,230, 19,
-196,167,147,230,206,165,104,165, 18,146,228,100, 12, 37, 8,222,238,114, 55,171, 65,129, 69, 16,132,235,178, 61,115, 28, 4, 2,
- 1,244,122,125,229,135,101, 0,176, 0,203, 0, 44,195,130,101, 1,176, 4, 24, 35,131,245, 75,246, 52,249, 26,179,144, 72, 44,
- 28, 29,157,114,196, 22, 22, 22, 44, 56,112,224,240, 34, 29,172,215, 35, 34, 34, 96, 48, 24, 96,105,105, 9,138,170,254,188,183,
-177,177, 65,223,190,125,209,189,123,119, 12, 28, 56, 16,247,239,223, 23,127,253,245,215,117,218, 17, 99,231, 15, 69,139,246,142,
- 38, 17, 33,187,114, 58, 54,228,187,101,199,236,148, 74,101,213,185, 6, 39, 77,157, 58,149,120,242,228, 9, 70,142, 28,121, 89,
-163,209, 12, 7, 80, 92, 95, 6, 18, 18, 18,252, 18, 18, 18, 94, 88,129, 16, 4, 49, 82, 38,147,225,240,225,195,208,106,181,207,
-109,183,178,178, 66, 98, 98, 98,213,183, 61,116,235,214,141, 34, 8, 98, 36,128, 90, 5, 22, 73, 16,174,191, 71, 60,172,156,167,
-113,212,176,110,244,160,190,238, 57,207,212,122, 22, 0,177,116,233,210, 74,113,197,178, 44,150, 47, 95,110,118,122,105,154,198,
-189,123,247, 64, 81, 20, 82,250,116, 0, 0,116,142,205, 4, 69, 81,136,239,234, 12, 0,232,249,160, 0, 60, 30, 15, 82,169,212,
- 92,113,213,207, 81,230,250,203,146,175, 66, 44,213,122, 22,191,133, 71, 34, 67,113, 30, 44,203, 66,230, 96,131, 94,190, 62,124,
-143, 46, 93, 29,246,110, 95,247, 11,128,225, 10,133, 34,162,110,177, 96,132, 71,135, 54,216,255,203,101,172,250, 54, 20, 79,138,
-213, 40, 41, 43, 47,215,129, 61, 61,241,253,250,166,213, 19, 69, 81,235, 58,181,105,211, 98,255,145, 48,244,234, 17,128,253, 71,
-206,162,103,143, 0,236, 63, 90,190,124,224,104, 24, 94,233,217, 29, 7,142,134,161,179, 71,251,150, 79, 30, 23,173, 3, 48,186,
- 78,247,162,102, 29, 13, 47,175, 35, 94,161,145, 48,213,205,227,233,211,203,203,167, 66, 96, 53,250, 98,171, 16,196,102,184,198,
- 13, 58, 87, 6,131, 1,185,185,185, 68, 97, 97, 33,107,109,109,253,110, 85,145,101, 18, 87, 63,255, 94, 12, 85,242, 86,226,167,
-159, 46, 49,239,191, 31,152,148, 20,185,218, 3,229,205, 93,207, 65,167,211,165,189,250,234,171, 44, 0,104,181, 90, 23,129, 64,
- 64,215, 16, 96,206,189,122,245,122, 78,160, 53,212,116, 88, 90, 90,122,240,232,209,163, 35, 28, 29, 29, 49,124,248,240,115,158,
-158,158, 2, 11, 11, 11,252,254,251,239,112,117,117,181,179,178,178, 58, 19, 18, 18,130, 13, 27, 54,180, 60,119,238,220, 33, 0,
- 35,204, 40,202,129, 65, 65, 65,135, 79,159, 62, 45,162,105, 26, 42,149, 10,137,137,137,104,214,172, 25, 4, 2, 1,134, 15, 31,
- 78,245,234,213,203, 54, 40, 40,232, 88,114,114,242, 24, 0, 23,204,173, 35,149, 74,197, 46, 89,178, 4, 22, 22, 22,144, 72, 36,
-149, 31,177,192, 72,236, 8,110, 35,158,187, 38, 91,188,244,211,247,215,236,222,123,234, 34,195,176, 95,102,102, 22, 23, 54,246,
- 60, 40,136,138,130, 36, 57, 25,234,232,232, 70,159, 67,174, 84, 23, 44, 94,176,216, 36,122, 33, 16, 8,170, 57,247,166,223, 52,
- 77,163, 91,183,110, 13,242,117,234,212,105, 39, 69, 81,246,213,210, 87, 80, 64,125,241,249,103,134,219,137,247, 37,122, 3, 36,
-106,173, 30, 43,151,127,105,160, 72,138,242,242,242, 58,193,178,108,222,221,187,119, 63,226, 30,159, 28, 56, 52, 93, 96, 65, 42,
-149, 34, 42, 42, 10, 4, 65,192,210,210, 18, 86, 86, 86,104,214,172, 25,138,139,139,113,247,238, 93,220,187,119, 15,105,105,105,
- 32, 73, 18,238,238,238,192,243,163,135, 87,118,181, 60,184,254, 52, 68, 82, 33, 8, 2,240, 31,212, 21,126,253,189,113,231, 86,
-202,156,168,115,216,163, 84, 42, 31, 0,224,117,238,220,249,195, 30, 61,122, 96,195,134, 13,208,104, 52, 27,235, 16, 87,207,117,
-223,156,246, 22,239, 10,205, 35, 91,232, 12, 76,230,174, 95, 12,175,120,123,123, 71,251,248,248,184,221,190,125, 91,111,114,179,
-106, 54,147,213,136,203,170,198,153,159,159, 15,134, 97,204,118,133, 10, 11,107,189,199,222,169,233, 74,153,176, 50,100,131,117,
- 73, 81, 46, 86,172,253, 17,122,189, 30,243,231,207, 7,195, 48, 96, 24, 6, 70,163, 17, 5, 5, 5,229, 35, 59, 53,144,119, 83,
-158, 40,138,170, 38,128, 27, 90,174,143,211,206,206, 78, 66, 82,252, 67, 11,150,174,176, 76, 72,206,194,233,240, 72,176, 44,139,
-147,187,191, 4, 0, 12,159,186, 28,114,101, 30,122,249,118,194,196,105,159, 88,110, 10, 89,122,200,206,206,174,109,126,126,126,
-105,109,156,122, 3,131,208,179, 55,160,124,242, 12,227, 71,244,135, 70,171, 71,110,142, 18,251,190,253, 6, 51, 62, 56,142,230,
- 82,177,147,216,190, 77,114,213, 50,178,180,180,164,212,106,245,229, 7, 15, 30, 76,174, 43,157,122,189,254,245, 37,115,167, 96,
-211,158, 80,120,185, 59,226,244,249,155,240,239,220, 10,103,194, 35,209,179,139, 27,206, 94,138, 70, 47,111,119, 92,188,113, 7,
-115, 62,122, 31, 11,231, 92,126,189, 81,117,180,122,131,117, 73,113, 46,126, 91,125, 0,185,219,182, 33,125,214, 44,248, 87,156,
- 19, 81, 36, 9,218,197, 5,176,106,184, 60,107,195,189,123,247,160,209, 60,111,212, 8,133, 66,116,234,212,169, 94, 78,147,115,
-149,147,147, 67,228,228,228, 64, 34,145, 16, 73,137,119,140, 30, 94,157,223, 53, 62, 61,178, 7, 0,202,157,171, 98,148,221,223,
- 2,213,131,173,160, 11,111,147,187,151, 79,211, 78,253,114, 87, 82,149,107,244, 78,141, 23,149,202,242,233,222,189,251,189,171,
- 87,175,118,172,226, 2,195, 96, 48,208, 6,131,161,189,169,217,208, 96, 48, 64,163,209, 96,204,152, 49, 84,125,121, 23,139,197,
- 93, 29, 29, 29,113,235,214, 45, 4, 7, 7, 11,188,188,188,240,224,193, 3,144, 36,137, 73,147, 38,193,211,211, 19,121,121,121,
-240,247,247,199,149, 43, 87,186,153, 81,158,150, 18,137,100,239,169, 83,167, 68, 36, 73,162,164,164, 4, 12,195,160,119,239,222,
- 32, 8, 2,183,111,223,198,231,159,127,142,227,199,143,227,151, 95,126, 17,251,250,250,238, 45, 43, 43,243, 0, 80, 98, 70, 29,
-177, 26,141,134, 21,137, 68, 16,137, 68, 16, 10,133, 16, 10,133,160,105, 26, 42, 45,133,105, 95,165,105,248, 66, 41,211,181,139,
-123,219, 25, 83, 71,144, 43,214,236, 11, 7,112,210,220,122, 7,202, 99,174,182,125,247,221,150, 55, 42, 58, 24, 29, 45, 41, 97,
-244, 44,187,214,156,107, 19, 0, 20,108, 34,108,188, 8,156,219, 23,141,225,211,251,130,230, 11, 64,243,105, 8,104, 1,248, 21,
-191,105, 62, 13, 1, 95, 8,202, 78,221, 32, 39,159,207,183,139,141,141,181,174,122,127, 48, 24, 12, 73,179,102,205,114, 31, 49,
-108,168,227,145,227,167,169,113,163,134, 27,157, 28, 29,242, 51, 51,211, 31, 2,176,246,245,245,101, 27,123,206, 55, 1, 28,231,
-255, 38,103,157, 96, 89,214, 31, 64,213,151, 1, 45, 0,129,233,177, 93,113,111,179,173,177, 30, 0,242, 42,190,237,235, 88,206,
- 7,112, 23,128, 71,197, 58, 35,128, 72,130, 32, 10,254,106,154, 77, 2,171,234, 5, 67,212,146, 49, 20, 23, 23,163,184,184, 24,
-153,153,153,216,177, 99, 7,248,124, 62,120, 60, 30,120, 60, 30, 72,146,172,140, 87,168, 11,127,156,190,186, 21,192, 86, 31, 31,
- 31,254,119, 55, 66,207, 44,221, 63,103, 64,247, 65,190, 84,244,249,219,239, 2, 88, 9,224,245, 9, 19, 38,216, 1,192,129, 3,
- 7,242, 1,252,110,182,139,195, 35, 91,108,217,252, 99,203,217,115,198,153, 4,133,235,158, 61,123,154,103,101,101, 85,123,163,
-163,105,186,193,184, 44,150,101,143, 62,124,248,112,174, 76, 38,171,124,144, 84,109, 38, 52, 24, 12, 16,137, 68,149, 98, 72,163,
-209,224,224,193,131, 6,150,101,143,214,195,137,228,196, 63,240, 32,241, 34,140, 70,166,154,152, 82,171,213, 8, 14, 14,174,116,
-175, 0, 96,122,133, 83, 98, 46,234,115,174, 40,138,194, 85,247,114, 37, 48, 36,143,125, 46, 86,171, 38,248, 2,209,252, 33,111,
-191,111, 99, 96,169, 74,113, 85,158,135,114,113, 33,224,243, 32, 22,242,241, 32, 37, 19,110, 46,190, 24,240,218, 91,205, 47,156,
- 57, 54, 31, 64,173,157, 16,244, 70, 6, 67,250,249,226,219,195, 23, 81,252, 76,141,226,194,167,200,207,188,135,164,132, 72, 8,
- 4, 2,220,188,121,211,178, 89, 51,107,203, 54,109,220, 96, 52, 50,184,122, 51, 26, 22, 22, 98, 28, 62,244,147,155, 70,167, 71,
-198,227,180,201,117, 8, 91, 94, 47, 63, 15, 20,231,103,128,199,227,161,151, 79, 91,240,120, 60,244,246,109, 15,138,162,208,199,
-191, 35, 40,138, 66, 96,119, 79,180,109,219, 22, 12,195,240, 26,184,120,145,124,231, 15, 36,223,189, 8,150, 97, 96,100,202,155,
-127, 89, 0, 58,165,242,249,124,101,103,131,181,114,104,202, 77, 2,139, 22, 45, 42, 84, 40, 20,186, 90,156, 67,250,248,241,227,
-214,245, 77,132, 77,211,180, 7,143,199, 75,122,250,244, 41, 99, 97, 97, 65, 26,141, 6,198,195,171, 51,117,229,247,101,149,115,
- 79, 6, 47, 95, 22,250,222,107, 86,239,254,184,239, 20, 75,219,247, 38, 8, 74,104,152,242,229, 46, 1,248,180, 7,160, 51,231,
-165,129,212,104, 52,184,127,255,126,131,147,114,179, 44, 91,239, 9, 85, 90, 90, 58,113,248,240,225,231, 62,250,232, 35,145,233,
-229,133,199,227, 85,138,254, 71,143, 30,129, 36, 73,236,222,189, 27, 26,141,166,193, 19,159,199,227,205, 61,118,236, 88, 51,129,
- 64, 80, 41,174, 88,150, 5, 69, 81,184,119,239, 30,214,175, 95,143, 9, 19, 38, 32, 35, 35, 3, 50,153, 12,243,231,207,151,174,
- 89,179,102,174, 78,167, 51,199, 22, 78,208,106,181,126, 98,177, 24, 66,161, 16, 38,161, 5, 0, 49,143, 28,239,164,165,165,117,
-105,217, 82,226,228,230,121,251,215,126,125,186,122,219,218, 90,247, 76, 77, 47, 58,217,152,250,207,208,235,119, 43, 74, 75, 63,
- 31,185,119,175,195,229, 95,127,101,238,252,250,107, 22,207,104,220,101,238,255,165,207, 90,162, 36,153,135,192,192, 64, 92,186,
-116, 25, 67,135, 14,133,145,166,193, 8, 4, 96, 4, 2,176, 52, 13, 8, 4, 32, 4, 2,176, 22, 22,102,157,146, 20, 69, 33, 59,
- 59,187,218,186,169, 83,167,166,191,255,254,251, 14, 0, 11,133, 66,206,126, 50,119,182, 60, 63, 63,159,117,116,116,228,108, 9,
- 14, 47, 85, 71,213,163, 69,236, 9,130, 56, 93,229,222, 51,212,180,188,120,241,226,207, 66, 66, 66, 18, 9,130, 56, 93,117,189,
-105,191, 10, 67,226,116,109,203, 21,255,181, 93,178,100, 73,231, 53,107,214,172,238,217,179,231,225,235,215,175,167, 2,120, 97,
- 2,139,168,200,152, 89,243,215,213,246,144,110, 72, 96,153, 16, 27, 27,171,119,118,118,254,238, 94,116,234,128,142,126,237, 33,
-150, 8, 7, 1,216, 42, 20, 10, 63, 25, 63,126, 60,110,222,188,137, 59,119,238,124,143, 70,140,204,173, 51, 48,153,179,231,140,
-131,206,192,100,154, 28,170,249,243,231,211, 87,175, 94,213,213,229, 96,213,197,149,155,155,251, 85,100,100, 36,234, 11,114,127,
-239,189,247,170, 62,140, 42,131,220,235, 60, 99, 24, 22, 58,157, 30,165,165,170,114, 97, 85,241,240, 54, 26,141, 40, 45, 45,197,
-168, 81,163, 42, 69, 23,195, 48,200,205,205,109, 82,101,146, 36,217, 24,231,170,118, 14,138, 26,220,213,219,135, 31,126, 61,161,
-218,195,245,173,105, 43, 33,160,203,197,149, 88, 68, 67, 44,228, 35, 83,145,131, 78, 30, 94,244,165,243,167, 7,215, 41,176, 12,
- 70,108,253,233, 60, 64, 16, 8, 61, 29, 14, 63, 55, 11, 44,251,124, 17, 70,142, 28, 9,129, 64,132, 99,199,142, 98,221,246,253,
-152,222,170, 21, 88, 0,221,253,186, 97,237,206,195, 88,177,124, 57,121,244, 72,104,159,134,210,203,231,243, 65, 81, 84,229, 67,
-187,230, 55, 69, 81, 13,138,132,202, 58,210,235, 81, 86,170,130,145, 97,192, 48, 44, 88,134, 1, 88, 22, 46,171, 86,193,101,213,
- 42, 68,145,229, 29,248, 60, 75, 75,161, 82,169,128,126, 93, 27, 45,174,180, 90, 45, 20, 10,133, 46, 33, 33,161,182, 39, 85,142,
- 86,171,173, 55,189,159,125,246, 89,242,234,213,171, 61,108,108,108,146, 18, 18,226,245, 93,187,122,243,107,198, 96,117,104,223,
-161, 40,120,249,178,208,113, 31,188,249,238,206,207, 71, 27, 62,250,234, 7,158, 41,208, 61,244,108,112,195,215,147, 78,151, 54,
-112,224, 64,179,194,110, 84, 42, 85,118, 93,219, 76, 1,237, 29, 58,116, 16,246,239,223, 31,151, 47, 95,198,170, 85,171, 24,131,
-193,144, 15, 0,189,122,245,178, 95,177, 98, 5,113,247,238, 93, 88, 91, 91, 35, 55, 55,119,191,175,175,239,138,250, 2,223, 5,
- 2, 65, 63,127,127,127, 82,163,209, 84,190,148,144, 36,137,123,247,238, 97,205,154, 53, 24, 51,102, 12, 58,116,232, 80,121,109,
- 5, 5, 5,241,183,108,217,210,207, 28,129, 69,146,228,156, 1, 3, 6,124,131,242, 94,132, 85,111,114, 73, 0, 22, 2, 64, 70,
-198,147,236,152,152,228,196, 1,129, 62,126,109,221, 92,100,145, 49,143,235,229,116,112,112, 88, 66,146,228,123, 0, 40, 0,153,
-133, 36,217,206,222,222,222,177,239,208,161,120, 70, 16,212,174,179,103, 9,158, 88, 44, 69,102,166, 89, 77,141, 79,248,143, 32,
-243, 17,131,230,211,152,240,233, 48,156, 62,125, 26, 51,131,223,175,112,178,202, 29, 44, 62,159, 6,205, 23, 64, 96,223,180,142,
-137, 21,247, 38,194,202,170, 25, 0,160, 89,179,102,166,251, 38, 1,128, 37, 73,146, 11,201,226,240,178,208,160, 22, 49, 9,164,
-154, 66, 43, 36, 36,100,104,205,117, 85,197, 84,109,191,171,254,119,205,154, 53,171,171,112,151,189,136,204,240, 94, 84,169,232,
-245,245,207,209, 28, 20, 20, 52,203,210,210,114,179,105,249,241, 53, 57, 30, 95,147,195,163,163, 87,111, 31,111,191,194, 49, 99,
-198,192,214,214, 22, 11, 23, 46,100, 1,236,109,204,177,119,253, 98,120,165,234,114,124,124,188, 95,124,124,124,147,242, 81, 80,
- 80, 80, 82, 17,172,254,201, 11,180, 54,161,215,233, 81, 90,166,134, 78,167,131, 94,111,132,193, 96,132,175,167, 37,126,216,181,
- 8, 90,173, 14,122, 99,249,186,114,167,204, 8, 33,173, 65,223,238,174,122, 16,164,234,242,205, 12,171,250,248,189, 98, 50, 64,
- 81, 20, 18,188, 93,106,117,174, 6, 41,116,102, 11, 45,150, 49,118,116,116,116, 64,198,217, 91,229,111,204, 22, 34,132, 29, 88,
- 1,137, 69,249,155,252,235, 19, 62, 43, 23, 89, 66, 26, 58,157, 22, 14,142,173, 97, 48,234, 59,214,197,103,208,235,180, 93,219,
-187,192,218, 82,140,248,168, 27,248,228,227,201,152, 52,233, 67,208, 34, 75, 92,186,116, 17, 25,138, 92, 60,202, 42,192,199, 95,
-125, 11,189,222, 8,157,193, 8,189,129,193,166,125,167,161, 51, 54,172,140,104,154,198,252,249,243,197,117,109, 63,124,248,176,
-202, 44,129,197, 86,136,224, 50, 21, 52,106, 13,180,186,242,186, 48,182,225, 99,229,231,239, 67,175,215, 67, 53,186, 39,116,122,
- 61,140,115, 70, 64,167,211, 33,211,130, 71,246,246,149,233, 65,144,170,107,209,114, 43,115, 5, 86, 93,233, 97, 89,182,214,166,
-195,186, 68, 86,215,174,222, 73, 19, 70,249,133, 92,187, 30,149,119,237,122,212,115,251,181,233,224,151,242,209,202,195, 75,204,
-233, 69, 88,205,198,169,210, 92,248, 23,207,251, 47, 35, 34, 34, 28,165, 82, 41,146,147,147, 65, 81, 20, 8,130,120, 18, 27, 27,
-235, 8, 0,111,188,241, 70, 62,159,207,183,165, 40, 10,115,231,206, 5, 69, 81,246, 51,103,206,252, 2, 64,157, 2,203, 96, 48,
-120, 88, 90, 90,162,164,164,164,178, 28, 5, 2, 1, 22, 47, 94,140,113,227,198, 85,138, 43,129, 64,128,253,251,247,195,215,215,
- 23, 90,173,214,195,156,244,202,229,242, 40, 0,175,152, 33, 64,202,227,242, 24,166,193, 19,139, 36,201,137,241,211,167,183, 83,
- 71, 70, 98, 6,195,120,118,236,216, 17,106,245,159, 77,119,109,219,182,109,153,149,149,149, 45,147,201,126, 2,240,173, 82,169,
-140,171,215,193, 42,109, 1,117,154, 0, 70,154,198,225,147, 39, 49,110,220, 56, 8, 4,194, 74,231, 10, 52, 13, 66, 32, 0, 73,
-211, 48, 82,194, 70,215, 25,195, 48, 40, 46, 46,166,246,239,223,223,198,203,203,139, 96, 1,116,234,228, 73,156,254,237,183,150,
- 82,169, 52,213,198,198, 70, 7, 14, 28,254, 78, 5, 86, 69, 32,189, 8,174,197,139, 23,127, 6,128, 93,188,120,241,103,166,229,
-144,144, 16, 21, 0,197, 63, 70, 96, 53,228, 96,109,216,176,161,206,161, 22, 76, 15,151, 45, 91,182,224,135, 31,126,216, 0, 32,
-165, 49,199,158, 58,156,119,203, 66, 76,203,202, 84, 58,229,238,147,134,238, 93,187,118,141,238,217,179,103,155,232,232,232, 58,
- 29,172,186,198,198,122, 25,195, 52,176, 44, 11,173, 78,143,178, 50, 21,212, 90, 45,230, 45,218,110, 86,221,235,180, 37,188, 55,
- 94,235, 43,110,200, 73, 52, 39, 6,171,161,166,193,234, 98,217, 0,147, 6,120, 86,166, 70,208,152,197,136,250,181, 92, 27,155,
-196,149, 88,200,135, 72,192, 7, 73, 0, 68, 61,198,167, 94, 85, 60,236,211, 89,147,175,236,248,254, 7,215,183,250, 78,193,236,
-217,179,193, 19, 88,160,185,173, 61, 12, 70, 22, 45,157, 29,240, 40,171, 0,199,182, 45,170,240,134, 89,244, 29, 27,140, 13,159,
- 79,193,186,224,134,223,192, 41,138,194,182,109,219, 84, 53, 93,171,170, 78,150,185, 34,216,228, 50,170, 52, 90, 44, 88,242,173,
-249,117, 52,248, 21,177,185,101, 91, 91,199, 9,115, 5, 88, 77,145, 85,225,138,212,217,232, 39,180, 5, 60,122, 15,249,252,239,
-188, 25, 50, 12,131,223,126,251,237, 57,119,181,102, 29,154,235,182, 50, 12,131,244,244,116,220,185,115, 7, 61,123,246, 68, 81,
- 81, 17,120, 0,230,223,190, 13,207,241,227,161,169, 8, 93, 16, 8, 4,152, 58,117,234,203,122,199, 46, 23, 88, 68,253, 21,229,
-228,228,180,190, 83,167, 78,237, 82, 10, 10, 16, 19, 31,143,128,138,244, 92,189,122,181,170, 3,136,177, 99,199, 10, 82, 83, 83,
- 63,188,119,239,222,135, 44,203,110,200,206,206,158, 95, 23,103,169, 69, 22, 28, 59, 11,177,119,205, 9,204, 90, 62, 1,246,157,
- 68, 88,191,100,119,229,246,117,223, 5, 87,196, 97, 9, 32,146, 54, 62,107,197,197,197,188,111,214,175,239,218, 61,160,135,120,
-220,132, 73,164,214,192, 96,229,215,155,169, 35,135, 14,216, 30, 56,240,163, 88, 36, 18, 37,113,143,120, 14,127, 39, 94,148,184,
-170,233, 96,133,132,132, 36,134,132,132, 60,231,134,189, 84,129, 69, 81, 20,170,118, 89,174,237, 33,111, 78, 12,214,188,121,243,
- 96,105,105, 89,235, 54,157, 78,199, 38, 36, 36,220, 85, 42,149,123,234,123,123,173, 11, 2, 62,233,184,225,155,125,174,179,231,
-140, 99,128,242,222, 90,219,183,111,183, 54,197, 96, 85,141,195,106, 40, 6,203,193,193, 97,217,218,181,107,103,191,254,250,235,
- 36, 73,146,213, 30,126,166, 97, 25,170,126,244,122, 61, 78,157, 58, 53, 59, 36, 36,164,206, 97, 26, 88,182,188,249,169,180, 76,
- 5,181,166,252, 1,251,232, 78,168,185,103, 64,195,142, 67,133,115,213, 35,249,105,173,206,213, 89,199,242, 7,215,144,188,134,
-185, 8,146, 74, 78, 75,207, 12,112,178,179, 70, 65,209, 51, 8, 43,154, 5, 77, 48,137, 43,177,144, 70,243,102, 82, 60,125,146,
- 11, 62,159, 95,159, 59,146,158,171, 76,127,101,212,136, 33,231, 72,138, 39,170,186,129, 47,182,178, 56,127,237,118,243,156,130,
- 50, 48, 85,242,201,176, 44,102,173, 48,207,196,228,243,249,152, 57,115,102,157, 2,231,228,201,147,170,198, 11, 44, 77,227,234,
-168, 17, 78,102, 67, 14,150,185, 2,171, 38, 76,189, 11,105,154,246,168, 16, 95,102,163,107,215,174,191, 91, 88, 88,184,153,187,
-191,185,131,142, 18, 4,177,188,127,255,254,171, 92, 93, 93, 29, 62,250,232, 35,130,199,227,193,207,207,207,110,224,192,129, 69,
- 0,208,177, 99, 71, 75,211, 61,102,211,166, 77, 72, 74, 74,202, 35, 8, 98, 69,189,215,186, 64,112,175, 89,179,102,126,253,251,
-247, 71, 81, 81, 17, 50, 50, 50, 32,149, 74,225,185,126, 61,110,207,152, 1,239,157, 59, 65,246,239, 95, 46, 48,133, 66,220,190,
-125, 27, 66,161,240, 94, 85,215,168, 42,156,157,157,187,179,229, 65,230,189,241,103,179, 4, 11,224, 26, 65, 16,159, 42, 20,138,
- 91,207,219, 82, 4, 89,254,162, 86,127, 69, 17, 4, 49,118,201,146, 37, 32,197, 98,200,122,246,132, 42, 37, 5, 58,157, 14, 61,
-122,244,128,191,191,127,249, 53,219,163, 7, 40,138, 66,187,118,237, 96, 99, 99,131,227,199,143,143, 5, 80,167,192, 18, 20, 57,
- 66,147, 41,196,196,137, 19, 65,211, 2, 64, 32,192,130, 5, 11,170,220,227, 4,160, 42,226,177, 24,163,192,156, 55,120,182,198,
- 11, 0, 33, 20, 8,132, 19, 62,248,144,252,116,193, 39,140,222, 96, 96,120, 60, 62, 57,127,233,106,242,193,253, 59,194,210,210,
- 82,146,104,204,219, 26, 7, 14, 47,193,193,170, 42,180,170,184, 80,117, 33,175,106, 92, 86, 93, 2,173,106, 76, 22, 0,205,139,
- 72, 43,175,218,123, 89,117, 60,136,143,143,111,239,229,229,133,140,140,140,186,122,202,149,119, 97, 22,139,241,240,225, 67, 0,
-120, 80,215,129, 46, 94,188,184, 21,192, 86,211,178, 76, 38,235,217,111,100,191,107,222,253,125, 16,186,241, 72,145, 82,169,244,
-198,159, 99, 98, 17,206,206,206,227,248, 2,222,123,109, 59,183, 12, 52, 50,204,218,139,167,174, 45,171,139,187,102, 12,150,193,
- 96,104,114, 12, 22, 65, 16, 35, 95,127,253,117,242,238,221,187, 24, 53,106, 20,126,252,241,199, 58, 11,111,220,184,113, 56,124,
-248, 48, 6, 15, 30, 76,174, 89,179,166,206, 97, 26, 88, 22,208,235, 12, 40, 45, 83, 67,173,214,188,180, 19,239,175, 58, 87, 0,
-192, 50,134, 11,183,227, 98,186,117,241,237,201, 79,203,204,134, 72,192,175, 38,176, 44,132, 52, 68,194,242,117, 78,246,205, 17,
-121,253,146,206, 96,208, 55,212, 13, 62, 93,167,126,246,220, 32,141, 44, 65, 37, 15,234,221,165,121,173,142,231,146, 9,232,242,
-243, 6,179, 4,214,247,223,127,175,170,203,189, 50,183, 12, 88, 22,149, 77,132,101,170, 23, 91, 71, 14, 14, 14,246, 14, 14, 14,
- 59,172,173,173, 69,166,216,161,218,182, 55,107,214, 76, 84,159,195,213,144,184,170, 24, 23, 43,105,245,234,213,141, 18, 89, 2,
-129,192,237,218,181,107,237, 77,113,129,245,125,107,181, 90,188,247,222,123,102,217,130, 49, 49, 49,123,187,117,235,246,200,222,
-222,254,124,175, 94,189,132,119,239,222,197,202,149, 43, 9, 62,159,111,101,186, 46, 75, 74, 74,192,227,241, 80, 80, 80, 0,130,
- 32, 38,198,196,196,156,173,143, 83,163,209, 68, 68, 68, 68,116, 27, 54,108, 24,149,148,148, 4, 30,143, 7,134, 97,160,233,209,
- 3,222, 59,119,226,206, 39,159,160,111, 90, 26, 52,122, 61, 68, 34, 17,206,158, 61,171, 43, 43, 43,139,168, 39,239,187,111,220,
-184,225, 37, 18,137,160,211,233,192, 48, 12, 72,146, 36, 40,138,234,227,229,229,181, 5,128,127,213,253, 91,183,182,119,240,243,
-238,208,209,200, 48, 70,185, 34, 47,207, 12, 71, 8, 63,254,248, 35,122,244,232,129,192,192, 64,200,229,114,164,164,164, 96,200,
-144, 33,149,251,196,199,199, 35, 54, 54, 22,109,219,182,109,216, 1,181,204,131,189,135,176, 50,222,138,230,211,160,121,229,194,
-202,228, 92,209,124, 26, 52, 45,128, 80, 96, 86, 88, 0, 91,243,124, 52,197, 94, 73, 36, 22, 76,187,118,237,238, 62,120,248,200,
- 19, 0,217,172,153,181,217,177,182, 28, 56,252, 37,143,184, 30,161, 84,245,114,168,178,156, 7,128,168, 88,206,171, 34,164,242,
- 8,130,136, 98, 89,214,191,198,190,166,237,218, 26,223,166,237,241, 47, 34, 35,245,221, 40,135, 76,158, 60,121,231,171,175,190,
- 58, 96,254,252,249,144, 74,165, 80, 42,149,149, 23,152, 64, 32, 64,139, 22, 45,160, 82,169,112,249,242,101, 20, 22, 22,134, 3,
-152,102,238,129,149, 74,229,205,135,113, 15,158,244, 25,214,221,214,163,123, 71,235,172,228,172, 30, 74,165,242, 58, 0,194,197,
-197,229,187,209,159,188,254, 65,208,219, 1,160, 5,124,100, 62,204,198,197, 83,215,234,228,170, 25,131,245, 87,198,198, 34, 73,
-146, 34, 8, 2,163, 70,141, 50,107,255,209,163, 71,227,210,165, 75,168,175, 57,177,188,137, 80,135,178, 82, 21,202, 94,160,192,
- 34, 8, 2, 70,163,177,210,185, 50,125, 6, 41,116, 32, 73,178, 82, 88,188,158,203,152,205,169, 46, 43, 91,119,229,194,201,169,
- 29, 61,187,218,247,244,233,128, 7,169,153, 88,247,217,159, 77, 45, 11,166,143,198,254,195,167,224,236,100, 11,141,234, 25,194,
-206,156, 42, 42, 46, 46, 94,215,212, 60,236, 63,113, 9, 0,240,202,216,234,125, 4, 70,205, 3, 16, 15,255, 0, 0, 32, 0, 73,
- 68, 65, 84,221,100,222, 9,204,227, 97,210,164, 73,117, 58, 88,231,207,159, 87, 85,117, 34, 27,170,163,210, 82, 53,202, 84,170,
- 23, 86, 71, 50,153,204,219,223,223,255,252,174, 93,187,108,237,236,236,160, 80, 40,170, 9, 44,153, 76,230,237,231,231,119,126,
-215,174, 93,182,246,246,246,200,200,200, 48,123,136,144, 26,226, 10,121,121,121, 68, 65, 65, 1,211,188,121,243, 70,137, 44,146,
- 36,161,209,104,144,148,148,100,238, 53, 98,246,160,163,110,110,110, 63,110,222,188, 89,248,248,241, 99,232,245,122,220,189,123,
-247,185, 78, 8, 20, 69, 97,241,226,197, 88,186,116,233, 14, 0,173,234,227, 51, 24, 12, 27,199,143, 31, 63, 89, 46,151, 55,119,
-116,116,132, 82,169, 4, 77,211, 96, 89, 22, 68, 80, 16, 94, 73, 77,133,206,104,132, 88, 44,198,253,251,247,177,103,207,158, 82,
-157, 78,183,177, 54, 46,119,119,119, 1,128,246, 52, 77,227,253,247,223,175,182,237,192,129, 3,232,233, 81,224,103, 29, 64, 63,
- 51,178,180,230, 25, 60,126, 39, 73,146,240,243,233,208,161, 79,207, 46,157, 19,239,166, 61, 82,228, 62,189,214, 64,246,245, 90,
-173, 22,157, 58,117, 66, 84, 84, 20, 46, 92,184,128,254,253,251,163,111,223,190,136,136,136, 64,116,116, 52, 98, 99, 99, 65, 16,
- 4,108,109,109, 77,113,172,245, 6,179,242,139,108,161, 83, 8, 1,154,254, 51,222,170, 34,230,138, 18, 8, 42,123, 20,178, 2,
- 1, 24,129,121, 3, 16, 87, 21, 77, 21,105,209,108,218,184, 78, 40,145, 72,140, 0, 96, 41,149, 24,143, 28,216, 14, 91, 27, 27,
- 13,219, 20,123,149, 3,135, 23,243,188,139,250, 59,254,251, 82, 4, 86,108,108,108, 42,128,129, 0,198, 94,190,124,121,195,188,
-121,243,236,251,244,233,131,167, 79,159,162, 85,171, 86,144,201,100,136,142,142, 70,124,124,124, 62,203,178,243, 99, 98, 98,106,
-179,122, 58,163,158, 49,103, 20, 41,202,163,186,178,178, 25,222,125, 58,226, 82,232,149, 16, 39, 39,167,105, 60, 30,111,206,132,
- 37,195, 62,232,247,150, 63,146, 99,211,112,243,220,109, 40, 51,242,235,229, 52, 39, 6,171,234,119, 45, 49, 88,149,156, 12,195,
- 24,181, 90, 45,126,254,249,103,179, 68,214,161, 67,135,160, 86,171,193, 48,140,177,174,188, 27, 25, 35, 97,105,101, 15,151,150,
- 30,208,105, 75,193, 48,230,191, 5,178, 13,148,167,193, 96,192,178,101,203,176,112,225, 66,172, 88,177,162, 94, 33,178,125,123,
-173,177, 95,213, 56, 11, 10, 10, 74,132, 66,225,184,195,223,111, 14, 29, 59,101,182,165,107, 47,111,236, 61,114, 6,122,157, 30,
- 34, 33, 15,205,173,164,104,231,230, 2,173,186, 12,223,110,221, 80,172, 86,171,198,213, 18,123, 86, 95,189, 87,195,196, 17,129,
-248,122,207,175,184,114,240, 79,131,242,149,177, 95,225,167,111,102,193,199,103, 95,189,156, 70,163, 17,124, 62, 31, 7, 15, 30,
- 84,213,213,155,144,162, 40,212, 35,176,170,213,145,149,149, 61, 92, 91,123, 66,171,126,246,194,234,200,214,214,118,225,255,177,
-247,221, 97, 81, 92,253,247,103,102,182, 23,122,219,165, 42, 32, 74, 19, 65, 84, 84,236,177, 99, 52, 81, 99,137,141, 36, 38, 26,
- 91, 52,177,197,216, 98,130, 45,209,152,216, 19,149, 52, 21, 91, 98,195,104, 84, 84,196, 66, 83, 41,162,130, 74, 91, 88, 58, 11,
-108,223,153,223, 31, 2, 81, 35,176,152,228,247,190,223, 55,115,158,103,159,221,217,153, 57,115,231,206,157, 59,103,206,189,247,
-115,191,253,246, 91, 59,181, 90,141,204,204, 76,100,102,102,130, 32,136,140,231,215,215,214,214,226,206,157, 59, 13, 34, 39,195,
-220,252,108,112,174, 74, 74, 74, 8,133, 66, 1,177, 88, 76,222,186,117, 75, 19, 20, 20,148,129,250, 62, 90, 45,157,187, 86,171,
-125, 52, 96,192,128,166, 28, 35, 23,129, 64,240,204,148, 77, 13, 65, 71, 95,208, 84,248,167,116,230,229,229,165,124,245,213, 87,
-238,237,219,183,199,174, 93,187,180, 22, 22, 22,252,249,243,231,131,162, 40, 98,243,230,205, 76,121,121,185,126,241,226,197,252,
- 43, 87,174,160,182,182, 54,197,140, 58, 68,165,209,104,166,247,232,209,227,251,211,167, 79,139,124,124,124, 26,103,122,216,183,
-111, 31,102,205,154, 5,145, 72,132,172,172, 44,140, 28, 57,178,174,174,174,110, 58,158,141,129,213,200,105, 52, 26, 9, 46,151,
-203,208, 52,141,101,203,150, 61, 19, 88, 84, 44, 22, 67,196, 55, 97,231,106, 47,201, 7,235,138, 36,115,102, 78,158,252,164,156,
-208,166,180,244,135, 15,118,238,249,245, 2,158,141, 18,255,167,115, 39, 8,226,227,207, 63,255,124,123,207,158, 61, 69, 82,169,
- 20, 62, 62, 62,136,143,143, 71,124,124, 60, 46, 95,190,220,112,253, 97,107,107,139,202,202, 74,228,229,229,169, 9,130,248,184,
- 57, 78,218,170, 10,246, 62, 79, 28, 44,110, 67,204, 43,158,224,153,209,131, 79,226, 96, 61,137,139,213, 82,126, 62,223,189,195,
-214,214,214,216,185,115, 72,186, 90,173,166, 26,180,148,189,189,253,157,250,109, 25, 55, 55, 55,221,159,139,188,249,247,123, 43,
-192,114,254, 59, 57,255,167,208,162,213,159,146,146,242, 83, 64, 64,192,233,181,107,215,174, 61,122,244,232, 59,115,230,204, 33,
- 44, 45, 45, 17, 19, 19,195,148,151,151,239,229,243,249, 31, 93,187,118,237,165,226, 69, 48, 12,179,239,202,241,107, 51, 38,124,
- 48,130,152,179,113,106,207,148,139,119, 50,130,122,250,160, 99, 15, 31, 36,158, 79,199,214,165,251,127, 48, 26,140,203,139,138,
-138,114,155,227, 49,167, 15, 86,195,135,195,225,180, 24, 7,235,232,209,163,115,134, 13, 27, 70,222,184,113,227, 79,125,174,158,
-238,135,117,246,236, 89,232,245,122,196,196,196,208,205,197,193,162,129, 95, 54,109, 92, 62,229,187,232,147,124,146,208, 35,225,
-210, 97, 84, 85, 20, 53,155, 55, 60, 30, 23, 63,254,252,139,158,195,161,238, 54,147,214,199, 73, 73, 73,118,235,214,173,163, 72,
-146,196,214,173, 91,159,113,174,158,199,237,219,183,105,131,193,208,226,181, 82, 40, 20,103,105,154, 30,191, 99,211,234,125,253,
- 6,191,106,237,235, 27,192,113,116,116, 7,135, 36, 81, 89, 94,130,155,215,174, 24, 99, 79, 30,171,212,233,116, 83, 21, 10,197,
-217,191, 82, 0,163,118, 30,123,225,255,163,231,124,217,146,139, 98, 52, 24, 12, 28,137, 68, 2,163,209,248, 66,113, 53, 96,192,
- 0, 81,124,124,188, 90,175,215,131,162,168,102, 21,211,147,107,180, 98,202,119,223,255,189,215,200,100, 50,249, 85, 84, 84,160,
-182,182, 22,137,137,137,204,214,173, 91, 75, 42, 43, 43,151, 62,189,190,188,188, 28, 42,149, 10, 55,111,222,100,118,237,218, 85,
- 82, 93, 93,189,212,220,252,107,136,139, 85, 81, 81, 65,139,197, 98,210, 96, 48, 24,130,130,130,132, 60, 30,207,207, 92,142,212,
-212,212, 33, 77,173,235,209,163,199,189,248,248,248,118, 79,207, 77,104, 52, 26,121, 90,173,214,103,228,200,145, 45,214, 31, 34,
-145,104,194,225,195,135,127, 18, 10,133, 29, 53, 26,205,219, 74,165,114, 31, 0,119,138,162,112,255,254,253, 82,163,209, 56,118,
-217,178,101,223,213,214,214,222,150, 74,165, 19,205, 76,114,108, 86, 86,214, 68,127,127,255, 61, 43, 87,174,148,244,237,219,151,
-235,236,236,140,206,157, 59, 35, 43, 43, 11, 39, 79,158,212,111,219,182,173,174,174,174, 46, 18,192,217,102, 94, 58, 24, 0,132,
-209,104,124,102, 14, 83, 62,159, 15, 46,151,139, 58, 45,137,119,150,101,171,105,112,213,159,111,248,225, 36,195,128, 40, 84,148,
-150, 22, 21, 87, 94,231, 24, 12,151, 30, 43,106,170,154,114,198, 52, 26, 77, 48,195, 48,156,234,234,234,205, 90,173,118,234,252,
-249,243,229,235,215,175, 71, 80, 80, 16, 74, 75, 75, 97,107,107, 11,185, 92,142,154,154, 26,228,228,228,152,244,122,253, 14,147,
-201,180, 90,169, 84, 54,219,236,104, 42, 21,163,141,101, 96,227, 11, 35, 65, 16, 32,105, 18,132,158, 0,101,162, 64, 25, 40, 16,
- 28,206, 19,119,203,188, 41,180, 24,163,209,136,136,136, 8,156, 56,113, 2,163, 70,141, 98,208, 76,255,147, 19, 39, 78,192, 28,
- 71,152, 5, 11, 22,102,142, 34, 76, 75, 75,171, 4,240, 46, 65, 16,209,179,103,207, 62, 65,211, 52,151,166,233,225,169,169,169,
-151,255,202,193,139,138,138,146,174,158, 76, 92,234,224, 98, 29, 53,100, 98, 79, 4,116,241,128,201,104, 66,252,169, 20,236,253,
-252,216,254,252,188,252,105,120,118,174,194, 23,194,156, 62, 88,207, 59, 88, 77,113, 41,149,202, 21,107,214,172,193,103,159,125,
-214,234, 81,132, 77,109,147,144, 88,248,110, 88,103,218,117,244,171, 61, 7,147, 4,193,104,155,233,103, 67, 16, 96, 26,122, 69,
-112, 56,212,221, 75,215,243,131,154,201,191, 1, 51,103,206,252,157, 36, 73,143,167, 45,254,102, 30,246,138,178,178,178, 65,230,
- 92,155,226,226,226,211, 46, 46, 46,237,227, 98,127, 93,114,229,220,233,190, 38,147,222,155, 0, 1, 30,143,247,192, 96, 50, 94,
- 52,232,116, 81, 5, 5, 5,127, 57, 16,219,146,119, 71,225,113, 97, 41, 56, 28,234, 73,236,169,250,128,166,135,183,204, 71, 72,
-200,143, 77,238, 39, 16, 8, 78,239,217,179, 39, 98,242,228,201, 4,135,195,105,108,118,107, 56,127,146, 36,113,237,218, 53,181,
- 78,167,195,222,189,123, 25,145, 72,212,108,224,218,127,234, 26,213,212,212, 68,142, 28, 57,114, 31, 0, 1,128,251, 85, 85, 85,
-239, 41, 20,138,252,167,215,143, 26, 53,106, 31, 0, 1, 65, 16,127, 90,223, 18, 26, 66, 54,216,216,216,100,212, 59, 87,194,151,
-233,232,222, 76,249,166,154,106, 62, 52,167,169,176,126,110,193,215, 27,150, 59,119,238,188,122,198,140, 25, 79, 79,246,124, 9,
-128,215, 75, 36,237,172, 90,173, 14, 88,182,108,217, 92,145, 72,212, 79,173, 86,251, 2,128, 88, 44,206,172,171,171,187,160,215,
-235,191, 2,208,108,108,169,236,236,108, 93,219,182,109,179,140, 70, 99,160,163,163, 99,227,232, 67, 62,255,137,243,115, 45,211,
- 54,177,176,176,176,203,147,113,154,215,205, 78,216,169, 83,167,218,216,216,216, 12, 34, 8, 98, 12,195, 48, 29, 84, 42,149,118,
-249,242,229, 87,227,226,226,170, 51, 51, 51,135,244,234,213,139,144,201,100,120,248,240, 33, 83, 83, 83,115,136, 36,201,143, 21,
- 10, 69,139, 35,167, 25,134,201,111,206,165,110,106,159,230,214,235,116,186,146,171, 87,175,218,158, 59,119,142, 50,153, 76,136,
-141,141,109,124,145,124, 81,107, 96,118,118, 54,116, 58,157,134,125,116,178, 96,209, 50,254,233,209, 32,102, 89,136,114,185,124,
-156, 80, 34,152,233,209, 94, 30, 84,152,163, 76, 87, 85,214,253,168, 80, 40,118,226, 73,200,122,214, 62,253, 31,229,228,137, 44,
-206, 16, 20,207,163,201,135,131, 73,255, 88,175, 86, 13,126, 17,103,215,174, 93, 93,120, 60,222, 6,173, 86, 59,180,185, 40,237,
- 20, 69, 25, 69, 34,209,105,141, 70,243,209, 11, 38,123,254, 63,151,159, 43, 87,174,124,161,125, 96,238, 40,194,149, 43, 87,210,
-173, 73,103, 80, 80,208, 5,177, 88, 44,127,209,186,186,186,186,220, 91,183,110, 13,250, 47,201,207,167, 71, 0,154,205,249, 82,
-163, 8, 91,224,244,240,240, 16,232,245,250, 16, 0,237, 1, 88, 3, 40, 55, 24, 12,177,165,165,165,197, 78, 78, 78,161, 36, 73,
-126, 82, 47, 94, 63, 45, 46, 46, 78,252, 79,222,155, 46, 46, 46, 66, 75, 75,203, 13, 36, 73,202,205, 20,220, 58,165, 82, 57,191,
-172,172,172,136,173,235, 88, 78,176, 77,132,255, 81, 4,178,156, 44, 39,203,201,114,178,156, 44, 39,203,201,114,254,219,192, 54,
-166,179, 96,193,130, 5, 11, 22, 44, 88,252,205, 32,154, 81,161,173,177,254, 94, 70,201,222, 97, 57, 89, 78,150,147,229,100, 57,
- 89, 78,150,243, 95,199,217, 18, 55,219,244,248, 15, 9, 47,150,147,229,100, 57, 89, 78,150,147,229,100, 57,255,125,156,255, 83,
- 96,155, 8, 89,176, 96,193,130, 5, 11, 22, 44,254, 83, 2, 75,226,228,235,103,239, 17,180,207,198,181,227, 45, 27,215,142,183,
-236, 61,130,246, 73,156,124,253,254,141,153, 38,151,203, 69, 50,153,108,162,155,155,219,217, 78,157, 58, 85, 59, 59, 59,127,192,
- 22,165,214,163, 15,192, 25, 7,188, 63, 25,200,157, 12,228,142, 3,222,239,243, 55, 78, 64,254,223,130,213,239, 59,135, 93, 58,
- 61,241,244,234,247,157, 95, 24,128,109,229, 2,185,221,149,216,177, 95, 45,121,223,217,246,111, 58,164,133,163,163,227, 46, 39,
- 39,167, 71,142,142,142,143, 29, 29, 29,247, 0,176, 98, 75, 28, 11, 22, 44, 88,252,255,131, 89, 15, 51, 27,247,192,183,189, 61,
-189, 63, 90,189, 98, 9,225, 34,115, 16, 27,140, 38,253,195, 71,249,254, 43,214,172, 61, 84,200,231,124, 89,145,123,231,219,151,
- 56, 54,225,234,234, 58,142,203,229, 70, 0,104, 16,106, 25, 6,131,225, 68,126,126,254, 1,152, 55,220, 26, 29, 59,118,188, 66,
- 81,148,123,107, 14, 76,211,244,163, 91,183,110,245,126,153, 12,115,118,118, 30,235,236,236,188, 39, 44, 44, 76, 28, 28, 28, 12,
- 30,143,135,245,235,215, 47, 40, 44, 44,220,100,190,178,232,195,113,172,180,157, 76,113, 56, 35, 0, 4, 49, 12, 0,130,186, 69,
- 27,244, 39,149, 54,101,251, 16, 23,103, 86, 24,113,153, 76,182,148, 32,136,169,245,121,245,173, 66,161,216,240, 79, 20, 18,185,
- 92,238, 70, 16, 68, 63,134, 97,124, 73,146,188, 77,211,244,111, 10,133,162,236,175,242, 58, 1,239,246, 8, 15,255,106,202,130,
- 5,148,250,210, 37,124,181,103,207,102, 84, 87, 3,192,214,214,150,165,110,221,130,199, 88, 88, 32,130, 0, 66, 64,128, 32,193,
-164,148, 87,146,167,110,222, 76, 62, 0, 51, 98,169, 53,133,144,144,144,147, 0, 26, 38,142, 59,149,156,156, 60,188,181, 28, 21,
-217,244, 39, 2,174,111,175,138, 7, 23, 62, 1, 48,244,249,245, 70,141,112, 10,197,117,139,160,152,228, 60, 0, 95,252,197,108,
- 21, 59, 56, 56,220, 58,118,236,152,107,183,110,221, 56, 0,144,152,152, 56, 57, 34, 34,162,127, 73, 73, 73, 32,128,234,255, 68,
- 69, 19, 22, 22,102, 99, 52, 26,163, 41,130, 8,163,105,218, 26, 0, 72,146,172, 52, 49,204, 53, 14,135, 51,229,101,131, 21,179,
- 96,193,130,197,255, 89,129, 37,113,236,224,239,227,221,110, 65,236,209,104,183,202,242, 74,205,214, 13,251,146,213, 28,126, 93,
- 91,127, 31,222,150, 47,215, 89,207,154,247,225, 60,189,214,112,189, 86,121, 55,221,220,131,202,100, 50,119,129, 64,112,100,233,
-210,165,129,225,225,225, 92, 71, 71, 71, 20, 23, 23,227,238,221,187,129,241,241,241,163,142, 29, 59,182, 64,171,213,190,222, 82,
- 4,119, 0,144,240,121,158, 7,214,125, 46,227, 91,219,128, 49, 25, 97, 29,208, 9, 0,192,208, 52, 20, 23,207,130, 54, 24,192,
-208, 38,184, 14,121,245,201,255, 12,131,174, 93,187,242, 94, 38,179, 92, 92, 92,156,125,124,124,126, 88,188,120, 49, 79,171,213,
- 34, 37, 37, 5, 9, 9, 9,180, 82,169, 92,107, 46,135, 99,224, 40,127, 82, 37, 56, 52,114,212,208, 54,195, 7, 58,242, 61,100,
- 14,160,105, 33,238,230,232,221,207, 94, 78, 30,114, 42,246,183,143, 76,126,163,198,150,100, 28,187,221, 28, 79, 64, 64, 64, 88,
- 69, 69,197,103, 5, 5, 5, 13,194,111,125,215,174, 93,151, 63,189,205,243,129, 2,105,154, 6,135,195, 41,174,171,171, 27,151,
-150,150,150,252, 34,222,101,111,195, 96, 52, 62, 41, 23, 28, 14, 76,209,191,185, 30,237,215,175, 95,219,200,200, 72,132,132,132,
- 32, 49, 49,177, 95, 76, 76,204,220,147, 39, 79,222, 52, 24, 12,167, 4, 2,193,197,199,143, 31,191,212, 4,139, 60, 96,225,148,
- 5, 11, 40,233,163, 71,144,166,164,224,205,234,106,206, 58, 96, 97,107, 4, 86, 72, 72,136,167,157, 13, 14,141,122,189,143,159,
- 76,230,207,227,114,237,193, 48, 12, 12,134,242,246, 37, 37, 25, 99,172,172,176,184,170,138, 26,125,243,230,205,251,230,240,133,
-134,134, 58,209, 52,189,131, 97, 24, 30, 65, 16,179, 1, 12,139,141,141,133,201,100,194,240,225,195,135,133,132,132,120, 50, 12,
-243,181, 84, 42,101,212,106,245, 91,137,137,137,197,205, 57, 87,149, 15,232, 79, 20,148,215,144, 14,161, 83, 81,196, 57, 51,228,
-131, 65, 56,109,237, 69,126,186,124,107,225, 53, 0, 24,226,229,101, 81, 85, 32, 90, 36,181, 12,180,173, 42, 56,187,104,136,151,
-215,238,216,236,108,213,203,222,208,206,206,206, 27,162,163,163,221,194,194,194, 26,131,228, 6, 7, 7, 83,235,215,175,119,153,
- 63,127,254,230,138,138,138,105,102,138,234,246,118,118,118,103,104,154,214,166,167,167,183,111,248,223, 33,232,181, 30,118, 22,
-146, 1, 37, 21,170, 75,101,233,191,196,153,195,213,185,115,231, 72,194,100,218,245,229,178, 89,148, 95, 80, 16,196,246,142,208,
- 23, 22,162,214,104,176,189,150,154, 54,124,221,166, 93, 37,157, 59,119,158,158,148,148,180,135,173,146, 89,176, 96,241,175, 17,
- 88, 2, 1,127,241,138,143, 23, 17, 21,101,149,106,189,170, 90, 47,102,116, 70, 75,177,144,168, 86,150, 84, 62,180, 20,215,205,
-159, 55, 71,184,104,241,199,139,107,129, 55,205, 21, 87,190,190,190, 55,118,239,222,237,104,107,107,139,170,170, 42,148,149,149,
-225,198,141, 27, 96, 24, 6, 67,135, 14, 21,116,234,216, 49,228,203, 77,155, 18, 0,116,111, 73,100,113,184, 28,130, 43,145,224,
-112,159, 16,144, 60, 30, 70,103, 42,158,136, 11,131, 30,177,227, 71, 0, 0, 40, 62, 31,111,220, 83, 2, 0,132, 66,225, 75,103,
- 22,195, 48,221,123,246,236,201, 3,128, 5, 11, 22, 84,215,214,214, 70, 17, 4,241,147, 66,161, 40, 48,103,127,187,192, 17, 62,
-246, 14, 14,113, 27,215,188, 99, 27,232,233, 5,157,193,128,124,101, 1, 24,240, 33,115,148,224,205, 81,157,120, 61, 67,121,237,
-190,216,250,251, 69,130,124,181,183, 50,237,215,180, 38,133,165, 68, 18,189,121,243,102, 28, 60,120, 16, 0,112,225,194, 5,248,
-248,248, 72, 90, 74,195,221,187,119,189,166, 78,157,186, 31, 64,187, 23,173, 55, 26,193,137,250,236, 39, 0, 64,244,238,137, 84,
- 86, 86, 86, 91,145, 72,244,148,249,214, 7,125,250,244, 33,163,162,162,186, 93,184,112,161,219,254,253,251,245, 6,131, 97,115,
- 97, 97, 97,204,203,228,169,250,210, 37, 72, 83, 82,128, 75,151, 90,189,111,167, 78,157,220,253,252,236, 18,190,216,184,220,225,
-248,137, 52,108,220,184, 7, 15, 30, 60, 0, 0,120,121,121, 97,226,132,177,220,159,126,220, 17,176,120,241,202,171, 38, 83, 72,
-120,114,114,114,139,209,205,105,154,222, 17, 21, 21,245,170, 84, 42,197,226,197,139,179, 60, 61, 61, 97,105,105,137,157, 59,119,
-194,198,198, 6, 6,131, 33,107,253,250,245,156,194,194, 66,108,217,178,229,187,167,220,173, 63,161,247,176, 62,159, 8,184,190,
-189, 58,132, 78,133,212, 82,142,221, 63, 31,192,221,196,125,189,180,134,204, 79,150, 32,110, 18,197, 8,166, 42,115, 37,139,219,
-134,246,181,107, 23, 48, 18,109, 58,167,216,107, 77,151,114,150, 13,244, 92,203, 17,106,162, 87,126,241, 2,151,112, 76, 12, 21,
- 88,125,211,246,206, 89, 73, 25,208, 24, 52,148,168,255,128,102, 48,162, 79,159, 62, 84,131,192,126,244,232, 17,116, 58, 29,252,
-253,253, 73,157, 78,215,207, 92,113,213,187,119,239, 43, 63,252,240,131, 93,175, 94,189,158,153,186, 69,102,103, 61, 56,238,200,
-230, 57,159,125,245,163,239,247, 12, 81,217,210,139, 64,231,206,157, 35, 59,182,247,250,118,243,250, 21, 4, 85,155, 15,142,117,
- 25, 64,151, 65,177,255, 59, 64,108,139,225,239,205, 71,151,110,221,168, 57,243,150,126, 75,132,134, 50,137,137,137,123,217,106,
-153, 5, 11, 22,255, 10,129, 69, 51,116,144,131,131,173,112,203,134,125,137,114, 33, 73,200, 92,157, 9,190,165, 53, 7, 82,137,
-128,164,184,106, 47, 47, 87, 30,205,208, 77, 77, 21,242,252, 80, 75, 66, 32, 16, 28,217,187,119,175, 35,151,203, 5, 77,211,112,
-112,112, 64, 78, 78, 14, 42, 42, 42, 80, 83, 83,131, 7, 25, 25,104,227,230,138, 57,211,223,145,127,186,241,139, 35, 0, 66,241,
-108,115,225, 51,156, 12,205,128, 54, 62,219,162, 70, 16,196, 11,219, 23,155,153, 70,198,172, 33,161, 52, 77, 63, 44, 44, 44,132,
- 88, 44,134,159,159,159,244,230,205,155,151, 11, 11, 11, 11,204,226, 28, 51,134,226, 61, 38,126,221,176,102,156, 45, 65,101, 33,
- 43,183, 18,222,174, 93, 97,103,229,134,130,146, 26, 36,165,159, 66,214,131,147,240,118,117,199,244,137,222,214,155,118,148,156,
- 64,200,116,111, 36,239, 50,188,136, 83,165, 82, 73,221,221,221,225,226,226, 2,154,166, 97, 50,153,144,150,150,214,248,187, 97,
-190,196,134,223,155,127,138,135, 13, 85,138,113,175, 13, 67,121,121,185,212,220,115,111, 16, 87,135,190,112, 14, 80,215, 42,120,
- 0, 32,146,200,245,163,231, 23,164,117,233,210, 5, 14, 14, 14,188,171, 87,175,206, 7, 16,211,218,252,212, 3,235,191,218,187,
-119,203,155, 85, 85, 36, 0,124, 75, 16,180,254, 73, 84,109,179,202,146,131, 61,113,116,211,166, 79, 28, 8, 38, 29,182, 86,235,
-112,227,198, 99,232,245, 79,174,124, 89,153, 18,179,223,175, 6,135, 99,129, 47,190, 88, 97,247,198,184, 25,135,241,100,212, 11,
-221, 92, 58, 25,134,225,101,102,102, 34, 32, 32, 0,251,247,239,231, 80, 20,133,235,215,175, 67, 36, 18, 97,234,212,169, 8, 12,
- 12,228,136, 68, 34, 92,190,124, 25,213,213,213, 68,115,233,188,116, 42,238,211,138,236, 11,159, 20, 81,103,134,236,254,249, 0,
-222,153, 48, 14, 50, 99,246,101, 27,111,242,211,161,195,123, 44,167,184,110, 17, 18,139, 64, 27,159,192,145,224,241,165,152,181,
-112, 53,178,238,252,106, 83,167,186,253,190,201,144,231,182,242,139,152,185,127, 74,231,161,177,166, 41,123, 47,117, 62,231,158,
-236,113, 39,101,250,117, 69,242,174, 91,127, 28,218,143, 3, 82,109,221, 32,174,238,223,191,143, 7, 15, 30,128,162, 40,168,213,
-234,103, 38,245,125,154, 51, 56, 56,248, 93,147,201,180, 28, 0,116, 58,221, 62,145, 72, 20,249,245,215, 95,219, 81,212, 31, 51,
- 69, 53, 56, 87,197,202,178,138,171, 55,211,238,206,127,119, 76,223, 75,215,238,228,233,185, 35,115,171,110,253, 82,245,162,252,
- 12, 11, 11,179, 33,105,122,215, 87, 27, 87, 17,166,236,223, 33,240,235, 11,142,212, 7, 38, 67, 1, 52, 21, 53, 80,231, 20, 65,
-191,243, 27,120,189, 55, 15, 27,214,127, 70, 76,152,244,214, 46, 47, 47,175, 35,217,207, 58,120,255,196,112,109,150,147,229,100,
- 57,255, 59, 57,255, 93, 2,139, 32,200,106,189,222,192,181,116,115, 49,140,126,189,119,199,228,235,119,178,164,182, 86,100,167,
-174, 29,253,239,100,229, 39,193,104,210, 19, 4,105, 86,191, 14, 87, 87,215,113, 43, 86,172,232,104,105,105, 9,154,166, 97,101,
-101,133,146,146, 18,232,245,122, 84, 87, 87, 67, 91,163,130, 94, 85,141,212,220, 71, 8,239,219, 23, 3,187,119,247, 59,101, 48,
-140,203,207,207,223,223, 20,167,137,164, 24,187,144,174, 24,155, 93, 6, 90,175, 67,140,151, 93,163,107, 53,254, 81, 37, 8,130,
-128, 73,167,197,169,174,237, 32,144, 74, 16,244,209,138,151,206,172,162,162,162,228,115,231,206,157, 30, 50,100,200,208,233,211,
-167,147, 69, 69, 69,177, 70,163,177,167, 82,169,108,177,121,212,241,158,105,234,148,233, 33, 94,246,214, 36,142,199,159, 65,152,
-239,107, 16, 11,184, 40,169, 80,131, 36, 8, 60,120,120, 14, 38,147, 4,169,153,185,232, 30, 40, 65,175,110, 86,174, 53,191,151,
- 79, 47,109,186,185,140,168,168,168,128, 82,169,132,193, 96,128,209,104,196,152,177, 99, 17,189,111, 31,106,107,107,161,209,104,
-160,211,233, 64,211, 79,244, 68, 81, 73, 13,110,164,198, 34,180, 99,251, 6,199,227,197, 5,130, 3,227,215,155, 39,114, 44,196,
- 0, 79,224,160, 87,169, 84,144, 72, 36, 80,215, 42,120, 83,222,105,116,182,120, 23, 46, 92, 64, 82, 82, 18,156,157,157,205, 42,
- 71, 47,194, 3, 96,215, 67,147,105,217,208,163, 71, 29,227,143, 30,165,175, 29, 63,158, 47, 80,169,118,154,179,111,183,110,193,
- 99,102,205, 26,238, 39, 18,138,144,159,187, 25,190,190, 60, 44,248,192, 14, 81,235, 74, 1, 0,115,102,185, 34, 52,212, 14,213,
-149,135, 96,239,184, 20, 11,230,143,242,174,169, 97, 38, 39, 36,164,236,107,190,188, 19,179,127,252,241,199,172, 65,131, 6,113,
-146,147,147, 33, 16, 8, 32, 18,137, 32, 20, 10, 33, 18,137, 80, 84, 84, 4,157, 78,135,152,152, 24, 99,125, 19, 98,147,168,111,
- 6, 28,250,193, 64,156,190,155,184,175,151, 11,153,147, 58,106,126,143,135,201,215, 83,107,206,255, 30,255,169, 81, 35,204,171,
-204, 63,187,200,179, 75,170,253,251, 31,173,194, 55, 27, 86,224,238,245,184,114, 39,119,213, 86, 19,161,125, 97, 58,251,244, 89,
-201,113,117,149, 25,102, 70,142,182, 58, 33,191,250,206, 9, 14, 74,139,203,111,111, 68,246, 13,181,192, 39, 96, 82,123, 79, 66,
-119,254,252,121, 81,239,222,189,161, 86,171,159,220, 11, 20,133, 31,127,252,145, 54, 26,141, 23, 94,196,105, 48, 24,150, 39, 37,
- 37,201,235,234,234, 48, 97,194,132, 57, 43, 87,174,148,112,185,220, 39,247,151,201,244,140,115,181,102,211,247,103,230, 45,223,
-122,225,204,254,117,206,107, 22, 71,246,125,115,214,103, 23, 0,196,190,216, 13, 53, 70,111, 90,183,132, 18, 88,235, 65,116, 25,
- 4,189, 82,141,199,223, 78,135,174, 74,141,246,159,174, 6,192,131, 78, 79,225,196,168,177,160,108,157,241,118,239,158,156,157,
-113, 87,162, 1,140, 98,171,102, 22, 44, 88, 60,247,242,219, 5,128, 67,253, 98,105,253,115,204, 14, 64,131,203,238, 0, 64, 7,
-128,255,212,110,207, 47, 63,189,237,243,203, 79,255, 46,173, 55,118, 28,240,100,202,190, 27, 4, 65,180,186,159,104,195, 40,194,
-167, 13, 31,230, 57,215,230,210,131,236, 71,234,190,125, 66,229, 23,110,220, 75, 30,242,218,192,174,189,251,119, 11, 43, 46,171,
-206,150, 57, 88, 74,174, 94,191, 38,160,105,218,172,246, 29, 46,151, 27, 17, 30, 30,206,169,168,168,128, 88, 44, 70, 73, 73, 9,
- 10, 10, 10,160,215,235,161,174,170,132,182,178, 2,234,138,114, 24, 84,149,120,112,243, 58, 58,184,187, 8,234, 59,193,155,133,
-231, 29,170,134,217,230, 9,146,132,208,210, 2, 34, 75, 75, 80, 84,235, 34, 83,200,229,242,145, 29, 58,116,184,230,236,236,188,
-172,254, 13,255,253,168,168,168, 82,134, 97,176,104,209, 34, 75, 75, 75,203, 24, 15, 15, 15, 65, 75, 60, 22,182,166, 49,221, 58,
-182,163,178, 30,223, 70,168,207,104,180,149,247,198,131,130, 42,148, 84,105, 80, 84, 94,139,246,237, 63,130,131,243, 59,176,146,
-189,135,219,119,243, 32,151,181, 37, 41, 46,111, 72, 11,130,239,153,229,159,127,250, 9,117,117,117,104,215,174, 29,198,143, 31,
-143,133, 11, 23, 98,220,184,113,112,118,118, 70,175,118, 28, 68, 78, 26, 3,165, 82,217,108, 58,215,124, 11,238,218,159,228,201,
- 83, 86, 48,201,237, 6,156, 78,123,240,224, 1,178,178,254,220,178,246,251,239,191,163,170,170,170,241, 1,108, 14, 28, 29, 29,
-151,200,100,178, 91, 50,153, 44, 77, 38,147,157, 42,118,118,206, 52,120,121, 57,245, 28, 53,138,240,127,227, 13, 42, 79, 34, 33,
- 30,186,185, 73,205,225,178,180,196,240,208,208,112,126,101,197,158, 70, 83, 42,114,154, 3,174,196, 5, 32,254,114,103,204,158,
-229, 5,146, 16,130, 32,121,168,171,253, 29,254, 1,129, 60, 11, 11,166,217,178, 84,223,161, 61, 59, 32, 32,128, 51, 99,198, 12,
- 8, 4, 2, 68, 71, 71, 99,251,246,237,248,242,203, 47,145,149,149, 5, 15, 15, 15,200,229,114, 56, 57, 57,113, 0,100,215,239,
-211, 44,172,189,201, 79,181,134,204,203, 54, 62,146,108,130,116,236,161, 53, 10, 71,175,252, 66, 81,182,102, 91,206, 23, 15,239,
-170,189, 50,175,199,149,101,221,249,133,206,185,121,161,180,240, 94,141,215,154,109, 57, 95, 68,109, 45, 44,127, 17, 87, 92,220,
- 10,211,177, 83,113,250,218,154, 58,206,200,161, 3,212,239, 77, 27,223,222, 86,220,225, 71,184, 12, 10,110,227, 38,159,180,226,
-243, 45,186,183,103,204,211,127,251,221, 30, 70,165, 82,161,186,186, 26, 95,125,245,149,241,248,241,227, 5, 38,147,105, 94, 19,
- 73,164,234, 5, 17,198,142, 29, 43, 17,137, 68,200,203,203,107,116, 65, 1, 64, 81, 82,118, 59,254,230,157,204,249,239,141,237,
- 83,171,213,106,207, 92, 76,204,240,247,241,112, 37, 8,166, 77, 83,231, 77, 17, 68, 88, 64, 80, 16, 24,166, 18, 36,199, 29,249,
-223,111,132,186,168, 28,117, 37,229, 32,185, 18, 24, 32,132,158,225, 67, 24,212, 21,143,147, 82,224, 36,181, 4,135, 32,122,178,
-143, 18, 22, 44,254,189, 58,170, 41, 45, 2,192,129, 32,136, 19, 4, 65,156, 88,178,100, 73, 63, 0,118, 4, 65,156,168, 23, 65,
- 14,245,191,249, 13,219, 52,177,236,240, 52,207,115,251, 62,253,219,126,201,146, 37,253, 9,130, 56,209,163, 71,143, 73,245, 66,
-174,213,104, 81,109, 80, 26, 93,212,146,101, 43, 72, 75, 41,223,194,223,175,173,205,241,223, 46, 37,199, 95, 75,201,176, 16, 11,
- 5, 53,181,181,252, 47,191,222,238, 78,212,169,205,237,228,237,103,111,111, 15,189, 94,143,251,247,239, 35, 63, 63, 31,122,189,
- 30,198,186, 90,104, 43, 43,161,169,168, 0, 93, 87, 3,158,137,134,186,180, 4, 54, 66, 62,240,199, 8,195,230,148,109,163,152,
-122,145,224, 34, 8, 2, 66, 75, 11,240, 45,164, 32, 57,148,217,153, 35,147,201, 58, 7, 7, 7, 31, 60,127,254,124,183,240,240,
-240, 79, 61, 60, 60,172,138,139,139, 31, 23, 23, 23, 15,216,176, 97,131,214,193,193, 1,111,190,249,102, 7,131,193, 48,165, 37,
- 46,158, 80,219,209,195,201, 7,238, 78, 35,225,108, 23,134,178,106, 45, 74, 42,213, 40, 42,171,195,129,195,227,113,246,244,120,
-164, 92,158,132,251,215, 35, 81, 86,107, 9,161,109, 63, 0, 76,179,129,220,174, 93,187,134, 29, 59,118, 52,126,190,249,230, 27,
-148,151,151, 35, 32, 32, 0,121,121,121,136,141,141, 69, 81, 81, 17, 28, 28, 28,144,146,146,130,157, 59,119,226,250,245,235,173,
- 46, 36, 26,141, 6, 92,190,157, 62,122,247, 68, 68,239,158, 8, 19, 35,209, 63,157,247,102, 23, 54,146,156,170, 24, 53,170,163,
-194,218,218, 63, 40, 40,104,232, 27,111,188,225,213,173, 91,183,198,245,222,222,222,238, 28, 14,167, 72, 46,151,127, 43,151,203,
-131,155, 37,163,153, 16, 27, 91, 63,232,180,153,245,215,152, 3,130, 16,160,255,192, 12,244,236,149, 4,189,129, 15,130, 20,128,
- 36,132, 48, 26,203, 96,105,225, 4,134, 33, 90, 10,140, 55, 44, 54, 54, 22, 59,118,236, 64, 78, 78, 78, 99,243,104, 68, 68,196,
-236, 9, 19, 38, 28, 49,153, 76, 56,113,226, 4,142, 29, 59, 6, 79, 79, 79, 4, 7, 7, 67,175,215, 15,107,233,188,151,111, 45,
-188,246,211,151,167,199,115,141,214,193,124,129,135, 39,169, 18,143,156,217,199, 94, 2, 0,177,217,217, 42, 39,119,213,218, 58,
-213,157, 92, 27,215,218,117, 45,119,112, 39,152,196,172,180,235,251, 15,255, 86, 85, 92, 90,198, 13,233, 20,168,254,108,213, 71,
-188, 54,109,219,173, 95,177,104,166, 83, 65,181,176,106,224,156,211,153, 71, 98,111,212, 76,142,156,110,124,107,250, 44,205,153,
-223,126, 63, 74,211,116, 16,154, 24, 65, 72,211, 52, 20, 10, 5,238,220,185,131,156,156, 28,148,150,150,162,164,164, 4, 42,149,
-170,177, 89, 81,172,170, 62,249,205,222,227,169, 18,145, 72,220,173,163,143,251,245,228,116,165, 68, 36, 18,251,180,117,111, 15,
-188,120, 2,106,154,166,173,159,228, 33, 1,213,157, 75,208,148,171,160,174,172,129,186,188, 6, 90, 61, 5,141,150,132, 70, 79,
-194,190,215, 32,212,212,170,161, 41,175, 4,205, 48, 54,236, 51,134, 5, 11, 22,205, 60,239, 35,214,174, 93,251,121,115,235,159,
-250,214, 61,183, 12,130, 32, 78, 48, 12, 19,193, 48, 76, 68,189,152,106,208, 9, 39,158,230, 89,187,118,237,231, 12,195, 68, 92,
-189,122,245,103, 0,117, 47,147,214, 22,155,118,202,202,238,213, 88, 16,126,175,207, 91,180,252,212,143,187,183, 56,150,151, 87,
-100,241,132, 34,141, 80,200,183, 93,184,104,149,117,109, 93,213,235,181, 21,230,143,122,170,168,168,104,124,120,241,120, 60,152,
-234,106, 97, 82,215, 65, 83, 81, 6, 66,175, 5,207,100,130,173, 88, 12,119,103, 39,180,113,146,181,200, 71,209, 38,162,240,236,
- 41,156,153,244,218, 51,205,130,180, 94,135,216, 30, 29,192,151, 74, 32,178,182, 65,248,177,203, 79,132, 14,143, 7,172, 88,215,
- 34,175,147,147,147,189, 92, 46,255,245,235,175,191,230,149,150,150, 34, 45, 45, 45,245,241,227,199, 85, 54, 54, 54, 22, 6,131,
-129,190,119,239,222,185,187,119,239, 70,180,109,219, 22, 12,195,120,183,196,167,170,148,232,245, 6, 26, 5,202,199,200, 87,220,
-129,149,212, 29, 12,233,134,226,242, 58, 16,112,132, 65,115,183,177, 47,153, 86,157,143, 90, 45, 97, 86,126,234,245,122, 24, 12,
- 6, 24, 12, 6,232,116, 58, 76,158, 60, 25, 87, 19, 18,240,211,177,139,200,203,203,131,167, 76,140,241,227,198,162, 83,167, 78,
- 72, 76, 76,124,233, 66,237,243,202,153, 52,145, 72,132,237,219,183, 67, 44, 22,163,181, 2, 75, 38,147,125,225,235,235,219,238,
-110,109, 45,210, 51, 51,209,117,236, 88, 0,192,149, 43, 87, 26,183, 81,171,213,152, 56,113, 34, 63, 39, 39,231,173,204,204,204,
-183, 24,134,249,178,168,168,104, 65, 83,156, 39, 79, 38,224,189,247,210, 81, 82,242,196,217, 61,240,179,127,227,186,135, 57,122,
- 12, 25,254,164,229,202,218,218, 26, 95,124, 97, 94,208, 97,147,201,132,157, 59,119, 66, 36, 18, 53, 10, 44, 30,143,215,115,254,
-252,249,175,191,104,123,127,127,255, 22, 57, 63, 24,227, 34,188,146,202,188,111,213,174,109,160,149, 67, 16, 74,141, 41, 29,147,
- 11,138,102,127, 48,198,101,243,166, 67, 5, 26, 19,161,221,103, 50,228,185,113,132,154,104,115,210,152, 29,251,181,174,188,237,
-244,232, 34,101,213,199,179,166,191,105,103,109,227, 84,243,237,215, 81,214, 36, 73,226,120,146,174, 34,192,203,206,102,100,216,
- 87, 53,239,125,240, 73,178,206,248,120, 54,242, 78,220, 69, 51, 97, 79,104,154, 70, 65, 65, 1, 74, 75, 75,145,155,155,139,146,
-146, 18, 16, 4,129,146,146,146, 86, 57,148, 47,114,148,117,249, 5, 40, 58,250, 29,100, 19,223, 68,251,213,171, 65,211, 92,168,
-235,140, 56,212,107, 0,170,171,212,208,209, 4,172, 59,247,192,192, 19,151, 65,210, 70, 32,225, 42,251, 4, 97,193,130, 69,115,
-245,202,137,197,139, 23, 47, 53,115,219,115, 12,195,152, 21, 90,231,121,193,181,120,241,226,165, 13,199,138,138,138, 82, 3, 40,
-252,219, 5, 22, 0,168, 74, 51,178,211,211, 57,138,154, 58,181,208,198,214,166,206, 66,202,103,170, 42,171,168,204,251, 89,154,
-218,162, 7,119, 91,113,188,140,180,180,180,192,130,130, 2,228, 62,126, 12, 67, 93, 45, 8,157, 22,208,168,241, 74,175,158, 16,
- 2, 16, 18, 0,143,214,131,162,248,168,169,169, 6,128,140,150, 72,105,131,225,153, 74,189,177, 89,208,194, 2,124,169, 4, 2,
- 75,139,103, 28, 45,115, 32, 18,137,126,218,185,115,167, 92, 46,151, 99,211,166, 77,144,203,229,190, 50,153,172,206,194,194, 66,
-100,111,111,143,246,237,219, 35, 52, 52, 20, 23, 46, 92, 0, 65, 16, 15, 90,226, 51,234,248, 73, 25,217, 38,183,234,154, 20, 92,
- 79,250, 1, 6,157, 14,109,125,150, 64,107,180,135,196,241, 45,168,245,191, 66, 95,121, 17, 0,192,183,236,139,226,226, 82, 0,
-196,157,150,156,187,231,151,111,221,186,133,125, 71,175,192,221,175, 47,138,202, 99,113,231, 78, 34,156,108,126,131,143,127, 0,
- 12, 6, 67,107,222, 18,204, 22, 36,102, 22,244,137, 75,150, 44, 65,149, 72, 4, 12, 31, 14, 94,118, 54,244,122, 61,194,194,194,
-208,165, 75, 23, 0, 64, 88, 88, 24, 40,138, 66,187,118,237, 96,107,107,139, 35, 71,142, 76, 4,240, 66,129,197, 16, 68, 10,109,
- 42,243,245,242,242,106, 20, 88,209,223,151, 32, 57,241, 21, 16,224, 99,203, 55,127, 92, 18,119,119,119, 20, 21,229,128, 32,152,
-150, 58,101,158, 26, 62,124,248, 48, 27, 27, 27, 76,155, 54, 13, 34,145, 8,175,189,246, 26,212,106,245, 27,245,111, 52, 88,178,
-100, 9, 0, 96,197,138, 21, 88,185,114, 37,234,234,234,154, 12, 81,177,125, 77, 71,103,149,154,142, 36,235, 68,175,245,179,111,
- 27,212,127,240, 43,240,244, 25,128,254,131,243, 0,224,115,123,238,195,177,235,150, 90, 31,181,177, 36,246, 94, 61,118,110,121,
-248,208,126,203, 86,234, 47,126,186,242,235,138, 22, 95, 88, 42, 31,238, 82,101,114, 71,108,222,178,195,184,105,197,210,249,130,
-199,165,250,242,194, 10,186, 70, 34,224, 88,120, 59, 65, 58,123,225,167, 57,133,133,247, 63, 68,222,111, 89,230, 92,195,156,156,
- 28,104,181, 90,189,114,252, 0, 0, 32, 0, 73, 68, 65, 84, 90,152, 76, 38,104,181, 90,212,212,212, 32, 63, 63,191,241,250,170,
- 37,150, 67,102, 77, 27,209,169, 86,173,174,187,126,251, 94,238,178, 57,111,118,175, 85,171,235,238, 61,204,205, 2,182,208, 77,
- 92,243,202, 58, 85,141,173, 78,101, 64,101,106, 22,236,251,123, 64,103, 36,160, 53, 82, 40, 47, 85, 65,111, 2, 12, 36, 23,174,
- 99, 38,195, 72,112, 80, 93, 82, 4,242, 37,250, 57,176, 96,193,226,223,229, 96, 17, 4,113, 34, 42, 42, 42,226,159,226, 6,128,
-168,168,168,180,168,168,168,191,116,172, 6,129,213,247,169, 55,220,190, 47,170, 43,221,173,171, 92, 62, 95,250,186,179,193,160,
-243,173,169,169, 49,113, 56,124,142,155,149,186,168, 60,215,252,131, 25, 12,134, 19,151, 47, 95, 30,213,171, 87, 47,193,189,219,
-169,208, 86, 85, 65, 91, 85, 9, 30,109,132,173, 48, 20,164, 65, 7, 66,167,133, 75, 7, 26,234,106, 33, 18,110,222, 53, 24, 12,
-134, 19,205,102, 8, 24,134, 54, 62, 17, 14, 36, 73, 61,211, 84, 40,176,144,130, 47,149, 66, 32,181,120, 97, 19, 98, 83,112,116,
-116, 20,247,238,221,123, 64, 72, 72, 8, 24,134,193,134, 13, 27,160,211,233,248, 13, 78,145, 94,175,135, 74,165,194,225,195,135,
-241,253,247,223,199, 91, 89, 89,237, 45, 44,108, 94,220,210, 70,237,233, 11,241,169,195, 38,189,214,159,127,246,226,183, 48,104,
-141,168,209, 90,163, 86,163,131, 74,205,133, 78, 48, 24, 4,113, 25, 36, 37, 64,143, 96,111,156,191,114, 79, 99, 50,232, 99, 91,
- 35,134, 8,130,128, 86,171,133, 82, 89,130,114,213, 5, 64, 85, 0,123,189, 10, 53, 15, 31, 32,120,242, 20,232,116,186, 22,185,
-150,189, 13,131,131,181,130,243,253,106, 18, 92,190,157,222,231,149, 51, 77,134,138,144, 74,165,141,125,116,204, 65,117,117, 53,
-126,248,225, 7,132,133,133,161, 79,159, 62, 40, 40, 40, 64,118,118, 54,134, 13,251,163,149, 45, 53, 53, 21,201,201,201,240,246,
-246,110,129,139, 57, 85, 94,126,127,236,200,145, 35,121,215,174, 93, 3,195, 48,240,241,177,130,165,133, 20, 4, 41,128,159,159,
- 3,128,187, 32, 8, 2,125,251,246,133, 94, 95,104,172,173,197,169,230, 56,147,147,147,135,135,132,132,120, 26, 12,134,172,192,
-192, 64, 78, 81, 81, 17,198,140, 25,131, 3, 7, 14, 52,188,209, 96,241,226,197,207,236, 83, 83, 83,163,105,138,175, 83,215,246,
- 31,154, 24,187, 62,124,129,135,167,149, 67, 16, 60,125, 6, 0, 0, 6, 70, 68,194,179,157, 27,170, 74,110,121,234,180,143, 95,
-163,136, 50,155, 31,175, 21,164,247, 18, 7, 78, 43,205,187,120, 15,128, 57,129,123, 25,245,189,227,197,185, 92,203,131,135,126,
- 57,241,238,136, 17,175,114, 12, 38,218, 24,232,206,177, 58,112,228,164,178,224,113,238, 87,200,253, 45,237,153, 91,165,105,129,
-101,170,172,172,132, 84, 42, 69,118,118,182,118,196,136, 17, 2,181, 90,141,123,247,238, 53, 10, 44, 71,123, 91,255,158, 93, 2,
-125,215,108,250,254,140, 68, 32, 16, 12,238, 27,234,151,126,239,113, 62,195, 16,143,154,228,101,152,107,247, 50, 50,134, 59,216,
-187, 67,113,241, 42, 36,225, 67,161,213, 18,208,232,105,232, 76,128,145,226,193,170, 83, 87,136,188,252, 64, 51, 64,198,237, 84,
- 24, 25, 38,158,125,132,176, 96,241,175, 69, 75, 90, 4, 4, 65,156,232,222,189,251,254,167, 93,166,134,223, 0,180, 0,154,235,
- 19, 93,242,180,136,106,104, 54,108,234, 56,207,241,190,180,192,138, 67, 51, 35,203,236,237,237, 29,253, 58, 4,120,237,254,238,
- 91,232,181, 85,200, 78,223,139, 90, 85, 49, 62,249, 60,193,219,197,197,165, 79, 65, 65, 65,156, 57, 7,203,207,207, 63,112,228,
-200,145, 5,157, 2, 2, 66,218,184,186,226,214,163,135,224, 49, 38,240, 76, 38,144,122, 45, 56, 38, 29, 92,253,105,144,164, 4,
- 69, 69, 42,236,140,253,253, 78,125, 84,247,166,223,190, 9, 10,110, 35, 70, 99,194,192,225, 96, 12,122,252,214,203, 31, 66,169,
- 20, 2,107,107,244, 56,124,241, 73,200, 6,163, 1,143,214,126, 4,158, 68, 10,219,176,190, 45,166, 83,169, 84,214,197,199,199,
- 39,102,102,102,118,233,208,161, 3, 86,173, 90,133,188,188, 60, 48, 12, 3,165, 82,169, 41, 41, 41, 41, 40, 43, 43,123, 68, 16,
-196,209,194,194,194,221, 48, 35, 82,184,210,135,218,119,246,220,239, 31,118, 14,246,111,255, 74,159,149, 56,113, 98, 57, 42,171,
-171, 81,171,229,160, 70,173, 71,173,134,129,179,133, 55,186, 5,133,160,164, 76,135,123,105, 73,249,165, 60,219, 93,173,180, 78,
-145,154,154, 10, 15, 91, 2,233, 89,201,176,215,148,163,131,181, 20, 33,225,189,144,147,147, 99,150, 51,101, 52,130, 51,123,222,
- 31,163, 5,173,173,173, 81, 85, 85,245,204,126, 98,177, 24,206,206,206,168,174,174,198,161, 67,135,192,152,247, 80, 52,232,116,
- 58,248,250,250,226,230,205,155, 56,119,238, 28,250,247,239,143,222,189,123,227,226,197,139, 72, 76, 76, 68,114,114, 50, 8,130,
-128,157,157, 93,131,219,214,164,229,118,227, 70,106,140, 84, 74, 44,153, 54,109, 70,224,155,111,190,137,195,135,247, 35,114, 90,
- 7, 16,164, 0, 4, 33,192,171, 35,124,177,250,211, 68,116,235,214, 23,246,246, 60,156, 59,151,150,195,225, 88,125,111,134, 88,
-253,122,253,250,245, 28,161, 80, 8,157, 78,135,154,154, 26,148,149, 61, 9, 71,245, 34, 7, 75,173, 86, 55, 25, 88, 45, 45,229,
-238, 23, 21,213, 76, 5, 89,151,244, 90,169, 33, 37,168,255,224,124, 12,140,152,134,179, 39,246,226,252,153,115,176,231, 62,204,
- 49,137,106, 78,151,228,148,170, 10,107,124,118,250,135,190, 77, 41,106,207,236,152,249,106, 22,229, 42,167, 99,150,108,175,174,
-108, 41,189,229,233, 63,252,250, 43,131, 87,195,195,186,122,119,116,119,230,151,151, 41,113,228,151,211,105,250,135,135, 79,212,
- 87, 84,230, 88,145,171,183,108,217,178, 28, 0,104,154,222,183,105,211,166,183, 63,252,240, 67,135,130,130,130, 70,129,165, 44,
- 45, 63,223, 99,248,108, 83, 89,101,149,110,207,166,133, 99, 68, 66, 1,127,217,218, 61, 23, 13, 20,174, 53, 89,185,112, 56, 83,
-150,110,251,177,228, 80,204, 94,202, 65,200,195,149, 69, 43,144,253,251, 5,232, 9, 30, 6,255,118, 29, 58,189, 9,213,202, 50,
-156,159, 54, 19, 54,114, 91,156, 42,187,103,170, 82, 85, 79, 97,159, 49, 44, 88,252,107,209,156, 22, 41,121, 74, 16,149, 3,120,
- 20, 21, 21, 85,250,148,187, 84, 2, 32, 21, 64,167,250,237, 74,158,219,175,132, 32,136,155, 12,195,116,121,138,167,228, 41,161,
-245,244,111,221,115,219,164,254, 21,129,213, 44, 74, 75, 75,149, 55, 18,239, 32,254,236,118, 24, 13, 90, 84,213,219, 86,133,197,
- 26, 88, 90, 90, 38, 52, 68, 19,127, 1, 2,241,108,172, 12, 70,163,209,188,190,105,243,230,107,239, 78,153, 36,235, 61, 96, 0,
- 30,223,190, 5,109,121, 41, 40,147, 9, 20,193, 69, 77,169, 16,197, 69,213,136,250,245,180, 82,173,209,188,254,130, 7,196,243,
-156,141,157,220, 25,130,128,208,202, 18, 2,137, 4, 2, 43,203, 63, 28, 43,130, 0, 95,106, 1,174, 68, 10,138,199, 55, 39,157,
-168,171,171, 27, 61,125,250,244, 91,167, 78,157,178,153, 48, 97, 2, 94,125,245,213,228,202,202,202,126, 21, 21, 21,230,246, 55,
-123,150,243,208, 33,147, 49,112,196,200,173,219,119, 95,157, 58,117,170,237,171, 35,183, 34, 57, 61, 13,149,181,142, 0, 0,103,
-123, 9,186,117,248, 8,202, 50, 45,206,156, 62, 81, 65, 27, 53,163,145,118,192,208, 20, 39,195, 48,140,189,189,253, 51,174, 28,
- 69, 81,184,120,241, 34,230,206,157, 11,123,139,139, 80, 61,202, 70,199, 94,125, 48,240,205, 41,136,140,140, 4, 69, 81,176,179,
-179,123,222,205,248,211,185, 63,141,170,170, 42,180,105,211, 6,191,237,238, 16,160,211, 40,121, 33,182, 0, 1, 43,253,217,243,
-195,210, 46, 93,186, 84, 3, 96,183,143,143, 79,204,115, 35, 26,255,196, 73, 16,196,199,159,127,254,249,246,158, 61,123,138,164,
- 82, 41,124,124,124, 16, 31, 31,143,248,248,120, 92,190,252,164,127,156,157,157, 29,108,109,109, 81, 89, 89,137,188,188, 60, 53,
- 65, 16, 31, 55,195, 73, 87, 87, 83,163,206,158, 61,122,125,196,136,215,237,135, 12,233, 14,153, 76, 5,163,177, 20, 4,201,131,
- 64,232,136,221,187,215, 66, 89, 92,142,171, 9, 9,229, 53, 53,156,209, 73, 73,127,154,130,232, 69,233,212,199,198,198, 66, 40,
- 20,226,240,225,195, 70, 39, 39, 39,142,181,181,117,147, 14,150, 70,163, 17, 52,197,249,206,162, 59, 5, 0, 62,253, 96,140,203,
-198,171,105,197,163, 0,252,228,217,206, 21,231,207,156,195,229,243, 87, 23,135, 5,210, 91,134, 79,236,186, 90,216,255,141,143,
-252, 59,191, 77, 73, 45,229,136, 62,114,152, 74, 79,250,246, 51, 77,237, 29, 47,108, 63,242, 81, 11,215,136, 1,128, 26,101,241,
-146,168, 47,191,217, 23,181,106,185,104,195, 87,219, 10,213,165, 69, 75,235, 69, 63,211,140,123,213,200,153,147,147,179, 19,192,
-206,167,156,230, 31,214,174, 93,123,105,210,164, 73, 14, 13, 14,101, 73,250,175, 9, 37, 64, 66, 64,223,200, 79,122,116, 9,232,
-240,217, 87, 63,158,201,205, 43,254,177, 42,163, 49, 6,214,159,210,121,237,218,181,138,206,157, 59, 79,255,104,209,202,111, 87,
-173, 94, 65,248,206, 91,140,172,248,155,208,170,245,208, 51, 20, 12, 32,144,180,230, 75, 88, 56, 88,226, 10, 83,206,104, 41,242,
-157,236, 63,119,242,111,182,124,190, 36, 88, 78,150,147,229,252,239,228,108,206, 64,184,249,130,191, 95, 52,147,198,205,230,246,
-107,130,231, 31,129, 89, 2,203,197,197,165,247,192, 1, 97,232, 57,112, 6,244,218, 74,100,167,237, 65,141,170, 24, 46, 50, 1,
-178,115,171,187,215,171, 78,179, 80, 31,153, 61,236,179,205, 91,142, 12,238,218,197,207,199, 69, 46,176,110,227, 1,137,163, 19,
- 74, 75, 74,112, 61, 41,203,176,237,204,249, 59,106,141,198,172,169,114,104,154,102, 24,134, 1,143,199, 3, 67, 81,240,159,189,
- 8, 36, 73, 62, 55, 90,144,128,101,104, 56, 72, 14, 23, 6, 51,251, 12, 41, 20,138,124,130, 32, 70,207,158, 61,251,247,125,251,
-246,145,125,251,246, 13,254,245,215, 95,233,191,146,217,101,119,142,223,163, 2, 71,245,217,242,245,182, 67, 33,161, 97, 30,109,
-218,182, 17,244,116,179,130,222, 96, 66,177,178, 12,113, 87,211,181,247,210, 83,243,104,189,110,108, 73, 70,211, 81,220,235, 31,
-130,185,206,206,206, 78, 43, 87,174,132,209,104,132,201,100,130,209,104, 68,105,105, 41,146,147,147,209, 57,172, 59,124,223,122,
- 27,229,229,229,248,238,187,239,224,234,234,138, 97,195,134, 65,165, 82,225,210,165, 75,185, 77,187, 14, 48, 46,249,120, 34, 7,
- 0,184, 92, 24,151, 70, 68, 92, 12, 8, 8, 8,127,181,147,146, 55, 99,246, 19,103,107,221,218,137,188,139, 23, 47,198, 8, 4,
-130,157, 15, 31, 62,172,110, 70, 96,195,203,203,139,175,209,104,130, 25,134,225, 84, 87, 87,111,214,106,181, 83,231,207,159, 47,
- 95,191,126, 61,130,130,130, 80, 90, 90, 10, 91, 91, 91,200,229,114,212,212,212, 32, 39, 39,199,164,215,235,119,152, 76,166,213,
- 74,165,178,164,185, 60, 72, 76, 76,124,104, 50, 5,119, 47, 46,218,126,100,198,123,131,124, 12,134, 80,190,165, 85, 47, 48,140,
- 17,149, 21,121, 32,152, 91,250,163,199,126,127, 80, 89, 73,189,158,148,148,116,207,156,107, 68,146,228,123,199,143, 31, 71,195,
- 84, 57,133,133,133,217, 36, 73, 54,233, 96,153,131, 77,135, 10, 52, 0,126, 30, 51, 88, 62,175,170,228, 86,123,123,238,195,156,
-176, 64,122,203,166, 67, 5, 26, 71,235,186, 53, 5, 37, 23,179, 10,107,206,236,140, 62,114,152,154,242,218,104,147, 92,122,111,
-177,189, 27,204,137,140,207, 4, 5, 5,185,147,100,121, 91,101,217,221,196,200,119,222,125,195,138,167, 62, 21,228, 82,218,206,
-232,228, 47, 76, 79, 79,127,212, 10, 23,235,233,178,159, 5,160,247, 23, 95,124,113,230,121,107, 92, 89, 90,126,190,123,196, 44,
-166,178,178, 42,165, 36,227,215,219, 45,113, 53, 76,127, 51,121, 82,228,174,119,222,154, 78, 5,206, 89,136,252, 11,191, 3, 70,
- 3, 20,151,227, 32,182, 48,225, 68,233, 35, 83, 29, 69, 78, 79, 74, 74, 98,163,184,179, 96,193,226,127, 6,102,247,250,246,242,
-116, 57,227,213,214,101,144, 87, 91,103, 0, 64,246,195, 66,100, 63, 44,248, 45, 59,167, 96,240, 75, 42,220,198,201,158,137,250,
- 80, 12,140,121,147, 61, 63,195, 25, 16, 16,144, 76,146,164,115,107, 78,218,100, 50,229,167,167,167,135,154,147, 78,185, 92, 62,
-193,205,205,109,109, 97, 97,225,145,252,252,252, 15,254, 22,117, 95, 63,217, 51, 73,241, 34, 24,134, 9, 2, 64, 16, 36,105,206,
-100,207,141,156,206,206,206, 29, 69, 34,209, 78, 14,135,227,222,112, 29, 27,154,241,244,122, 61, 85, 85, 85, 37,212,233,116, 20,
- 0,130,199,227, 25,165, 82,169,134,203,229, 26, 77, 38, 83,174,193, 96,120,183,176,176,240,182,185,111, 33,126,126,126,146,136,
-208,140,154,134, 41,116,150,124, 60, 17,107,247, 53, 91,118, 26, 57,239,221,187,215,222,198,198,102, 28, 65, 16, 99, 24,134,233,
-160, 82,169,180,203,151, 47, 79,137,139,139,171,118,119,119, 31,210,171, 87, 47,226,214,173, 91,120,244,232, 17, 83, 83, 83,115,
-136, 36,201,143, 11, 10, 10,178, 91, 89,150,200, 30, 61,130,199, 91, 72, 49,156,102,208, 9, 96, 8,130, 32,110,215,212, 16,167,
-228,242,182, 63, 30, 58,116,200,244,178,111, 96, 33, 33, 33, 39,107,106,106,134,221,187,119,175,169,183,170,231,239,163, 38, 57,
- 55, 44, 13,252,184,123,159,240,209,241,113,151,143, 46,250, 60,237,211,167,215,189, 63,202, 38,114,226,251,115,215,255,180,245,
-171,133, 91,143, 85,236, 49, 39,157, 33, 33, 33,158, 0,198, 51, 12, 19, 64, 16,132, 15, 77, 67, 72, 16, 76, 57, 65, 16,233, 52,
- 77,167,210, 52,125,252,246,237,219,133,255, 13,111,180, 79, 79,246, 76,152, 76,214, 38,130, 48,119,178,103,214, 33, 96, 57, 89,
- 78,214,193,250, 63, 9,179, 35,112,103,231, 20, 12,206,206, 41, 64,187,118,237,152,251,247,239,183, 74,156, 53,245,246, 93, 31,
-161,125,255, 95, 33, 73, 75, 75, 11,249, 39, 51, 72,161, 80,252,172, 80, 40,126,254, 91, 73,227,226,140, 74, 96, 15,158,124, 94,
- 10,245, 2,169,155, 57,219,214,213,213,161,178,178,242,165,147,155,145,145, 81, 59, 42,236, 15,103,139,195,129,209,220,125, 7,
- 13, 26,244, 88,175,215,159, 3,144, 15,192, 26, 64,185,193, 96,136, 45, 45, 45, 45, 54,153, 76,161,143, 31, 63,254,164,222,137,
-252,180,184,184,248,101,227, 72,208, 87,175,166,252, 4,224,167, 63,175, 74,254, 75,151, 42, 57, 57,121,184, 92, 46, 79,182,179,
-179,243,214,104, 52,124,141, 70,195,101, 24,166,177,236,139, 68,162,146,134,136,233, 45,193,202, 18,209, 20, 81,102,103, 99, 73,
-252,201,169,177,119,193, 97,117,237,157,246,246, 46, 56,220,138,180,229,116,234,212,233, 7,146, 36,219,210, 52,237, 4,192,146,
- 97, 80,202, 48, 76,169,201,100,202,191,115,231, 78,225,127, 75, 69, 83, 47,160, 34,192,130, 5, 11, 22, 44,254, 54,133,203,114,
-178,156, 44, 39,203,201,114,178,156, 44, 39,203,249,175, 2,201,102, 1, 11, 22, 44, 88,176, 96,193,130,197,223, 11,162, 25, 21,
-218,154,182,213,151, 81,178,119, 88, 78,150,147,229,100, 57, 89, 78,150,147,229,252,215,113,182,196,205,246,237,250,135,132, 23,
-203,201,114,178,156, 44, 39,203,201,114,178,156,255, 62,206,255, 41,176, 77,132, 44, 88,176, 96,193,130, 5, 11, 22,127, 51,154,
- 28, 69,232,233,233,234, 79,154,232,158, 12, 67, 82, 12,201, 24,136,106,245,129,236,231,130,108,186,185,185, 89,115, 73,140, 32,
- 24, 70, 66, 16,180,137,166,200,248,156,156,252,116,115, 14,236,231,231,199, 3, 48,149,203,229,134,235,245,122, 57,151,203, 85,
-104, 52,154, 43, 92, 46,119, 95, 70, 70,134,254,191, 41,147,122,246,236, 57,254,208,161, 67,214, 17, 17, 17, 90,189, 94,111,228,
-241,120,156,253,251,247, 11,166, 77,155, 86, 25, 31, 31,255, 82,163, 32,131,131,131,251,173, 91,183,206,115,192,128, 1, 8, 15,
- 15,175, 29, 58,116, 40, 47, 52, 52,148,183,104,209,162,156,148,148,148, 11,173,225,114,116,116,244,231,112, 56,223, 19, 4, 65,
- 49, 12, 51,249,169, 16, 12,255, 4, 38, 0, 24, 11, 64, 14,160, 8,192, 65, 0, 47, 59,202,114, 8,128, 17, 0,130,234,151,111,
- 1, 56, 14, 32,246, 47,164,111, 8,128, 17, 4, 65,116, 2, 0,134, 97, 82,255, 70,206,160,122,206,191, 45,157,127,245,220, 67,
- 66, 66,150,243,249,252,119, 0, 64,167,211,237,145, 74,165, 81, 47,218, 46, 46, 46, 78,135, 38, 66,159,248,181, 5,147,126,220,
- 23, 0,224, 63, 34, 19, 0,208,210,114,198,195,151, 27, 69,204,164,251, 50, 47,226, 37,252, 51, 95,122, 84,178, 92, 46,159, 57,
-108,216,176, 69,177,177,177,159, 21, 20, 20,236, 2, 11, 22, 44, 88,252,183, 10, 44, 79, 79, 87,255, 49,163, 94,255,252,189,119,
-103, 16, 20, 69, 34, 35, 51,147,243,254,156, 15, 6,249, 58, 57,185, 72, 52, 26, 63, 6,160,213, 34,209, 29,181,186,174, 96,251,
-214,175, 45, 58,180,111,111, 50,153,104,236,216,185,125,232,161, 99, 71,150,182, 36,178, 28, 28, 28, 60,185, 92,238,230, 57,115,
-230, 56, 14, 26, 52,136,116,114,114, 66,126,126,190,229,209,163, 71,219,125,247,221,119, 17, 14, 14, 14,243, 74, 74, 74,114, 94,
-230,132,100, 50, 89, 47,185, 13,134,136, 4, 76, 63, 84, 19, 80, 27,137, 11, 10, 29, 19, 91, 84, 84,116,249,101, 51, 73,167,211,
-205,174,171,171, 11,243,247,247,167,183,111,223, 78, 76,159, 62,157, 33, 8,130, 84,171,213,123,241,146, 97, 38, 68, 34,209,214,
- 1, 3, 6,248,132,135,135,103,199,199,199, 15, 7,112,114,236,216,177, 94, 34,145,232, 30,128, 14,173,225,162, 40,106,111,122,
-122,122, 39,181, 90,141,208,208,208,239, 0,116,254,135,202,203,119, 54, 54, 54,134,109,219,182,237, 12, 14, 14,246,174,168,168,
-168,125,247,221,119, 95,185,125,251,118,127, 0,111,181,130, 71, 2, 96,139, 88, 44,166,230,205,155,119,250,181,215, 94, 75,149,
- 72, 36,210,187,119,239,114,231,206,157, 59, 57, 55, 55,119, 12,128, 57, 0,106, 91,203,105,103,103, 39, 90,179,102, 77, 82,143,
- 30, 61,148, 66,161, 80,148,147,147, 67,204,155, 55,111,250,221,187,119,255, 10, 39,111,245,234,213,241,125,251,246,205, 22, 8,
- 4,226,220,220, 92,234,195, 15, 63,140, 76, 74, 74,122,105, 78,107,107,107,254,242,229,203, 19,250,244,233,243, 72, 40, 20, 74,
-178,179,179,201,249,243,231,191,125,255,254,125,179, 57,123,247,238, 61, 94,173, 86,175,186,116,233, 18, 0,160,123,247,238,203,
-117, 58,221,178, 63,137, 26,134, 65,120,120,184,134, 36,201,119, 46, 93,186,244,194,242,186, 47,241,163,241, 0,240,225, 39, 13,
-203, 79,190, 95,180, 60, 53,116,195,126,194, 63,179, 85, 5,199,175,237, 19,113,183,253,242,172, 73, 0,240,254,135, 79,254,223,
-126,185, 97,253, 76,166, 53,162,205,217,217,249,221,174, 93,187, 46,185,126,253,122,116,104,104,232,220, 93,187,118,113, 35, 34,
- 34,214,208, 52,237, 61,100,200,144, 49, 9, 9, 9, 27,238,222,189,187,149,173,226, 89,176, 96,241, 95, 37,176, 72, 19,221,243,
-189,119,103, 16,227, 38,140, 47, 82, 20, 43,105,169,133,213,132,131, 49, 49,226,246,237,219,147,154, 45, 91, 96, 44, 45,133,105,
-193,130, 30,113,113,113,134, 89,243, 22,168,181,154,186,189,114, 39, 71,241,129,159,247,203,142, 28, 62,212, 19, 64,122,115,206,
- 21,151,203,221,124,248,240, 97,153,167,167, 39,116, 58, 29, 74, 74, 74,160,215,235,241,218,107,175, 81, 97, 97, 97,178,200,200,
-200,205,246,246,246,175,183,198,201,178,183,183,119,234,224,206, 61, 53,113,236,224,246,253,122,135,138,100, 46,109,129,124, 26,
- 5,217,247,186,252,126, 45,105, 78,204,217,139, 89,119,171,244,195, 74, 75, 75,139, 91,155, 73,101,101,101,139,222,125,247,221,
- 67, 65, 65, 65, 14, 2,129, 0, 78, 78, 78,196,219,111,191, 93,172, 80, 40, 86,191,108,198, 55, 68, 7, 39, 73,210,244,220,247,
-203,208,185, 90, 89, 89,193,210,210, 18, 0, 92,254, 74,129, 24, 51,102, 12,149,155,155,251, 14, 77,211,126, 79,255,175, 80, 40,
-188,140, 70, 99,233,195,135,143, 58,105,116,250,110, 51, 63, 92,181,102,220,136,126,150, 9, 9, 9,228,240,225,195,185, 23, 47,
- 94,156,208, 10, 39,107, 75,135, 14, 29,110,175, 95,191, 94,151,113, 47, 39,240,183,139, 9,164,163,173,132,246,108,211, 70,154,
-150,150,198,139,138,138, 42,137,138,138,218, 2, 32,178, 21, 73,223, 50,112,224,192,188, 37, 75,150, 80, 25, 89, 15,188, 46, 39,
-164,192, 82,202, 55,185,187, 58, 11, 19, 18, 18, 56,219,183,111,199,210,165, 75, 91,205,217,175, 95,191,123,159,126,250, 41, 83,
-164, 44,111,151,243, 80, 1, 11, 41,223,104,103,103, 39,186,120,241, 34,177,111,223, 62,221,220,185,115,183,208, 52,221, 42,206,
- 30, 61,122, 60, 88,177, 98, 5,145,121, 63,167,221,149,132, 20, 72, 37, 60, 99, 27,119, 87,225,141, 27, 55,136,175,191,254,218,
-176,124,249,114,179,210,201, 48,204,142, 13, 27, 54,224,151, 95,126, 1, 0,252,252,243,207,240,242,242,122,166, 0,169, 53, 26,
- 16, 4,129, 71, 15, 31,138,223,123,239,189, 29, 47,122, 33, 72, 63,238,139,125,137,192,212,169, 83,139,204, 58,131,140, 13,173,
-118,173, 26,132,213,140, 25, 51,242,155,216,108,210,214,141,230,139,172,158, 61,123, 46, 58,112,224,128,125, 76, 76,204,135, 71,
-143, 30, 5, 0,136,197, 98,241, 55,223,124, 51,115,228,200,145,120,235,173,183, 22,177, 2,139, 5, 11, 22,255,117, 2,139, 97,
- 72,138,162, 72, 40,139, 75, 13, 3, 95, 25, 20,249,205,182,109, 2, 62,159, 15,157, 78,135,218,243,231,193,104,181,176, 18,137,
- 48,108,216, 48,110, 96, 96,160,229,244,200,200,183,149,197, 69, 59, 41,138,148, 49, 12, 73,181,112,204,169,115,230,204,113,244,
-244,244,124,102, 2, 97,147,201,132,226,226, 98, 88, 88, 88,224,141, 55,222,176,255,225,135, 31,166, 2, 48,203,238,119,116,116,
-108,227,211,214,254,106,204,183, 31,202, 28,173, 9,160,228, 48,240,248, 30,240,147, 16, 62,142, 30,240,233,223, 91, 52,162, 91,
- 96,167,241,235,247,165,144, 36,217, 67,169, 84, 62,106, 77, 38, 61,122,244,232,138, 78,167,123, 71,163,209, 28, 3, 64,198,199,
-199, 51,185,185,185,239, 21, 23, 23, 63,126,217,140, 55,153, 76,168,172,172, 4, 77,211, 20,128,198,111,147,153, 83,249,252, 19,
- 24, 51,102, 12,149,151,151,247,174,159,159, 95,187,221,187,119, 67,169, 84, 66, 40, 20,130,166,105,116,239,222,221,253,149, 87,
- 94,121, 80, 82, 94,101, 99, 52,154,244,249,143, 31,134,174,221,144, 82,210,201,191,195,149,152,152,152, 96,123,123,251, 55,204,
- 20, 88, 67, 44, 44, 44, 56,159,125,246,153, 90,230,234, 53, 78,238,238,195,189,122,243,118, 22, 79,204,103,202,170, 84,170,148,
-148,148,172, 85,171, 86,245, 62,117,234,148,242,206,157, 59, 67, 96, 94,147,217, 16, 59, 59, 59,209,226,197,139, 9, 43, 59,231,
-129,225,189,221,185, 73,183,210, 31,240,197,124, 58, 60, 60,124,196,213,171, 87,191,155, 63,127,126,240,201,147, 39,171, 19, 18,
- 18,204,230,180,181,181,229,174, 94,189,218,228,228,236, 49,210,189,109, 59,174,139,204,222, 31, 0,238,102,221,255,182,184,184,
-248,193,123,239,189,215,237,244,233,211,170,216,216, 88,179, 57,173,172,172,120,203,151, 47,103,252, 2,131, 35, 3,130, 58,147,
-199,127,187,148, 32,146,240, 77,213,181,234,154,244,244,244, 7, 11, 23, 46,236,122,242,228, 73,213,205,155, 55, 91,228,172,171,
-171,179,112,117,117,133, 76, 38, 3,173, 86,163,186,186, 26, 71,142, 28,129, 74,165,130,201,100,130, 72, 36,194, 87,177,229,208,
-220, 63,142,157,155, 87, 67,173, 86, 91,252, 29,229,164,161,121,175, 53,226,170, 25, 97,133,167,132,215,164, 25,189,190, 97,154,
-107, 46,108,112,174,174, 92,185,146, 31, 19, 19,227,232,237,237,141,190,125,159, 76,224, 30, 25, 25,137, 87, 94,121, 5,191,252,
-242, 11,126,251,237,183,220, 81,163, 70,229, 36, 37, 37,109,200,207,207,223,193, 86,245, 44, 88,176,248,255,141, 23,218, 37, 12,
- 65,212,166,101,100,112,165,214,214,147,190,217,182, 77,192,229,114,241,232,209, 35,164,167,167,163,238,252,121,168,175, 94,133,
- 82,169,132, 74,165,130,131,131, 3,162, 54,108,144,240, 68,146,200,123,247,239, 83, 12,201, 60, 61, 65,241,159,134, 90,242,249,
-252,240, 97,195,134,145, 79,139,171,167, 81, 84, 84,132, 65,131, 6,113, 56, 28, 78,120, 19,105,126,158,147,112,118, 32,142, 31,
-220, 53, 79,230,200,185, 13,220,159, 11, 84, 94, 6,140,149,128,186, 6,120,120, 27, 56,250, 5, 92,203,239, 19, 63,205, 25,235,
-228, 34,226, 29,199,159,163,208, 55, 59, 36,212,197,197,197,203,219,219,123,247,232,209,163, 73, 0, 8, 15, 15, 39,188,189,189,
-119,186,184,184,120, 53,179, 91,179,156, 26,141,230, 90, 69, 69, 5, 49,124,248,112,187, 30, 61,122,156, 29, 62,124,184, 29, 0,
- 66,163,209, 92,123, 89,206,122,216,245,235,215,175,204,211,211,243,103, 15, 15, 15,129, 25,219, 55,114,230,230,230,190,227,235,
-235,219,110,247,238,221, 20, 69, 81,216,181,107, 23, 14, 30, 60,136, 75,151, 46,161,164,164, 68, 60,127,254,124,235, 95,207, 39,
-159, 59,123, 57,245,196,188, 25,239,210, 3, 59, 7,203, 5,165, 69,101,118,118,118, 67, 1,200,204, 76,231,136,217,179,103,159,
- 74, 78,127, 40, 35, 40,129,128,199,227, 9,101, 78,246,142,114, 71,167, 54,114, 71,167,246, 22, 98,177, 77,109,109,109,238,177,
- 99,199, 24, 60,233,163,100, 22,231,170, 85,171,110,164,223,203,117,100, 72, 30,159,199,227,242,236,109,172,109,199,188, 58,104,
- 4, 0,136, 5, 2,113,109,109,173,226,135, 31,126,104, 21,231,138, 21, 43, 46, 23, 20, 87,202, 56, 92,158, 64, 40, 16, 52,206,
- 18,110,107, 99,229, 34,149, 72,196, 58,157, 46,111,247,238,221,198,214,112, 46, 91,182, 44, 62,227,126,174, 19, 73, 82, 20, 73,
- 18, 28, 7, 59, 27,123, 59, 59, 59,185,157,141,173,139,136,207,151,212,212,212,228,255,252,243,207, 38,115, 57,139,139,139,145,
-153,153, 9,183, 46, 93,112,238,220, 57,184,185,185, 97,236,216,177, 24, 55,110, 28, 68, 34, 17,186, 90, 63,192,107, 67,122,224,
-193,131, 7, 77, 94,119,115, 4,147,179,179,115, 92,107,202, 18,240,164, 89,176, 57,113,245, 60,103, 19,219,221,121,222,185, 58,
-114,228,136,253,166, 77,155,130, 63,248,224,131,236, 35, 71,142, 32, 40, 40, 8, 25, 25, 25,112,113,113,193,254,253,251, 49,107,
-214,172,236,149, 43, 87, 6, 31, 60,120,208, 41, 48, 48,112,241, 75,222, 71,173, 5,203,201,114,178,156, 44, 90, 22, 88, 6, 26,
-199,103,207,157, 95, 23, 29, 29, 45,230,243,249,120,252,248, 49,138,138,138,112,244,240, 97,211,196,142, 29, 85,147,131,131,171,
-143, 30, 62,204,232,245,122, 48, 12,131,118,237,218, 97,216,176, 97,162,183,167,207, 80, 18,213,234, 3,205,190,209, 50,140,163,
-131,131, 67,227,164,185,207, 88, 91, 83,167,194,104, 52,194,194,194, 2, 4, 65, 56,154,115, 2,114,185,124,108,228,135, 3,220,
- 44, 61, 44,139,153,162,189,229, 0, 9,112, 44, 0,142, 37, 32,182, 4, 68, 22,128, 64, 2,109,226,213,114,134, 8,127, 52, 56,
-228, 13, 23,185, 92, 62,182, 53,153,100,111,111,191, 44, 38, 38,198,225,246,237,219,140, 74,165,130, 82,169,100, 22, 46, 92,232,
- 96,111,111,191,236,101, 51,190,176,176,112, 77,100,100,100,209,232,209,163,173,163,163,163,221, 71,143, 30,109, 29, 25, 25, 89,
- 84, 88, 88,184,230,175, 92, 80, 46,151, 75,157, 63,127,222,246,195, 15, 63, 28,111, 48, 24, 18,251,247,239, 95, 22, 28, 28,156,
-232,228,228,228,209,210,190, 52, 77,251, 53,136, 43, 0,160, 40, 10,124, 62, 31, 66,161, 16, 86, 86, 86,149, 57, 57, 57,198, 54,
-118, 60,142,169,182,162,206,195,138, 47, 12,239,228,239,236,232,234,254,122,109,109,109, 18, 0,133,153, 73, 12, 26, 50,100, 8,
- 71, 15, 1,102,190,245, 74,251,247,166,132,183,219,185,241,173,126, 91, 62,155,220,253,203, 85,147,250,172, 89, 50,113, 60, 65,
- 27, 13, 30, 30, 30, 94, 13, 29,213, 91, 2, 65, 16,157,122,245,234, 37, 50, 82, 2,242,122,202,189,236,187,247,243,148, 35, 6,
-135,135, 53, 30, 48, 36,100,156,157,157,221, 48, 79, 79,207,190, 4, 65, 12, 54, 55,157,125,251,246, 21,112, 69, 18,210,221,217,
-190,131,173,181,212,187, 97,133,131,131,195, 96, 39,153,236, 45,130, 49,213,202,229,114, 87,129, 64,208,201, 92,206,254,253,251,
- 11,140,148,128,148, 57, 88, 59, 58,218, 89,219,141, 26,210, 59,188,127,120,151, 30, 61,186,119, 29, 24,210,165,203, 84,152, 12,
-117, 30, 30, 30, 46,230,158,251,177, 99,199,240,245,215, 95,163,167,191, 63, 60, 60, 60,224,224,224,128,243,231,207,227,252,249,
-243,144, 72, 36,168,172,172,196,142, 29, 59, 16, 27, 27,251,151, 43,139, 6, 65,212,208, 49,253,239,192,243, 34,171, 37,177,119,
-229,202,149, 35, 49, 49, 49,240,246,246,198,180,105,211,188,246,238,221,155,157,157,157, 13,169, 84,138,212,212, 84,124,244,209,
- 71,217, 43, 87,174,244,154, 58,117, 42,246,237,219,135,212,212,212,104,182,154,103,193,130,197,127, 2, 13, 77,132, 76,189,171,
-195, 0, 32,242,242,242, 42,125,125,125, 93,188,189,189, 73,157, 78,135,170,170, 42,156, 57,125,218,180,255,224,193,147, 58,157,
-110, 14, 73,146,188,125,223,127,191,195,209,201,169,223,152,177, 99, 9,131,193,128, 1, 3, 6,240,207,159, 63,111,119, 59, 47,
- 79,213,220, 1, 41,138,106,116,143,102,206,156,137,205,155, 55, 3, 0,166, 76,153,242,135,192, 51, 24, 26, 38,209,109, 17, 98,
- 43, 83, 68,159, 87, 2, 44,242, 36, 95, 91,104,122, 84,171, 60,179, 92,174, 74, 85,146,174,224, 8, 57, 16, 75, 65, 27, 97,188,
- 87, 19,150,148,253,184,173,159,240,148,178,109,207, 14, 93,113, 48,225,104, 4,158,140,126, 51, 11, 34,145,168,171, 68, 34, 65,
- 70, 70, 70,121,104,104,104,165,165,165,165,149,143,143,143,189, 72, 36,234,250,178, 25,175, 84, 42, 31,114, 56,156, 62,175,191,
-254,250,251, 36, 73,190, 66,211,244,185,178,178,178,173, 74,165,242,161,153, 15,166, 25, 12,195,172, 0,112,168,225, 63,189, 94,
- 15,146, 36,193, 48, 12, 70,140, 24,129,181,107,215,250,159, 59,119, 14,151, 46, 93,178,157, 56,113,226, 53,185, 92, 94, 73, 16,
-196, 91,133,133,133, 77,186,100,101,101,101,216,190,125, 59, 40,138,130,181,181, 53, 44, 44, 44, 32, 20, 10,209,183,111,223,226,
-245,235,215,251,196,196,196, 24,202,218, 41, 25,126, 77, 85,173,157,200,199,153,180,119,240,124,127,250,187,215, 1,196,152,123,
-238, 82,169,212,194,130, 82,215, 80,140,134,218,180,101, 39, 71,204, 33, 33,225,242, 32, 36,107,136, 37,203, 63,101,132, 4, 37,
- 70, 43,230,201, 4, 0, 30,143, 39,182,226, 67,199, 19,115, 77, 82, 49,159,248, 59,110, 14,145, 72, 36,145,242,160,107,106, 61,
-159,228,240, 1, 8, 9,130,168, 51,151, 83, 40, 20, 74, 45,249,140,182,169,245, 22, 92, 30,143, 32, 8, 33,154,232,228, 62,102,
- 0,152,152,205, 79, 4, 78,231, 63,110, 25,152, 76, 38,116,233,210, 5, 7,127, 57,135, 51,151,211, 80,158,159,142, 73, 99,135,
-162, 77,155, 54,160,105,186,217, 52, 53,244,193, 50,227,165, 0,206,206,206,113,133,103,173, 90,220,214,220,166,193,167, 57,253,
- 71,100, 54, 59, 58,209,197,197,101,122, 80, 80,208,148,163, 71,143,162, 95,191,126,136,136,136, 64,135, 14, 29,188, 38, 78,156,
- 8, 0,232,221,187, 55,162,162,162,188,198,143, 31,143, 99,199,142,225,212,169, 83, 8, 13, 13,157,155,152,152,168, 84, 40, 20,
-219,216,234,158, 5,139,255,122, 60,163, 69,254, 87, 4,214,159, 32,208,235, 59,104,182,111, 71,221,185,115,224,159, 61,139,147,
-157, 58,213, 24,141,198, 5, 10,133, 34, 15, 0, 28, 29, 29,231,197, 28, 58, 20, 63,232,194, 5, 75, 93, 70, 6,220,238,220, 1,
-167,125,251, 96,115, 15, 28, 21, 21,213, 40, 10, 0, 32, 58, 58, 26,213,213,213,168,170,170,130,209,104,246, 92,194,224,114,137,
-158,142,246,238, 80,224, 30,104, 14,199,226,161,191,174,135, 68,109, 89,224,246,208,190,166,138,219,137,200, 82,118,178,208,168,
- 12,221, 72,158, 14,186, 74, 13,156,237, 92,192, 33, 57, 61, 91,147, 73, 13,142,142, 72, 36, 42, 79, 74, 74,122,181, 87,175, 94,
-191, 2,176,111,248,255, 47,184, 88,247, 11, 11, 11,231,190,148,245, 72,146, 43, 46, 94,188,232, 24, 19, 19, 51,235,155,111,190,
- 97, 0, 64,167,211, 53,118,146,215,233,116,224,112, 56,160,105, 26, 18,137, 4, 28, 14,199,233,232,209,163, 78, 35, 71,142,220,
- 10,160,201,235, 36, 22,139,225,228,228, 4, 46,151, 11, 43, 43, 43,212, 86, 87, 72,182,127,190,172,175,216,198,201,118,238,220,
- 5,228,212,169, 83,211,190,249,230, 27, 87,103,239,118, 1,153,153,153,185, 19,166, 69,198,239,223,191,191, 6,230,119,112,191,
-149,157,157,205, 15,240,107, 39, 60,121,168,134, 22,115, 24,136, 75, 63,131, 88, 36, 7,159,239, 10,177, 64, 0, 30,159,111,175,
- 40, 42, 42,102, 24,230,129, 89,119, 36,195,164,230,228,228, 80,109,221,101,124, 85,157, 81, 37,166, 76, 22,247,147,111,101,181,
- 11, 9,106, 15, 0,154,140, 91, 23, 5,109,189,249,138,138, 42,129,179,179,115,122, 43,210,201,115,114,114,226,167,101,220,223,
-109,111,107,233,238,228,228, 56, 16, 0, 12,234,186, 52, 66,167, 41,164, 56, 28,121,121, 69, 69,137, 70,163,185,111, 46,103, 86,
- 86, 22,199,187,141,171,224,200,137,179,123, 28, 45,165,110,246, 34,129,147,165,132, 39,229,155, 76,181,124,218, 84,200, 19, 8,
-100,133, 69, 69,165, 12,195,100, 53, 69,210,208, 97, 28,248,238,135,250,243,111,112,119,112, 53,155,129,141,131, 51,202,242,238,
-226,252,241, 99,152, 50,115,150, 89,247,211,198, 79,167,237,223,248,233,180, 38,195, 51, 60, 39,136,254,122,205,147,225, 23,247,
- 60,167, 66,209,124,133, 58,100,200,144,143,119,237,218, 37,110,164,200,200, 64,120,248,147,158, 4,171, 86,173,194,224,193,131,
-225,227,227,131,244,244,116,120,120,120,224,200,145, 35,160, 40,138, 59,125,250,244, 69,187,119,239,102, 5, 22, 11, 22, 44,254,
-191,162,201, 33,107, 52,195,208,166,138, 10, 48, 58, 93,131, 67,192, 48, 12, 35,254, 67,216,112,197,214,214,214, 4,215,197, 5,
-132, 80,248,228, 79,130,248,203, 61,180, 57, 28, 78,171, 4,150,201, 4, 10,132, 1, 12, 24, 0, 36, 8,144,168, 19,241,177,210,
- 41,130, 88, 34, 95, 68,149,136,109, 8,130, 34, 65,144, 4, 64, 0,140,129,134,137, 49,181, 86, 25, 49, 53, 53, 53,208,106,181,
- 54,222,222,222, 39, 53, 26,141, 77,253,131,141,249, 79, 93, 56,147,201,148, 77,146, 36, 38, 79,158,140, 6,165,175,211,233,144,
-149,149, 5,141, 70, 3,157, 78,135,244,244,116, 84, 87, 87, 67,167,211, 33, 49, 49, 17, 30, 30, 30,224,112, 56,242,230,120,141,
- 70, 35, 28, 28, 28, 32,151,203,161,173,173,150, 28,222,181,121,248,250, 85, 75,236, 39,120, 51,228,119, 91,190,160,219,183,111,
- 95, 25, 16, 16, 96, 47, 18,137, 42,130,130,130,202,246,239,223,127, 20,173, 11,209,112,124,201,146, 37,221,250,246,237,235, 99,
-109, 33, 50, 72,132,128,152,170, 5,159, 81,131,107, 44,134,143,103, 59,154, 16,139, 59,140, 31, 63, 94,139, 39,113,161,204,226,
-156, 63,127,190,119, 96, 96,160,220,198, 82, 80, 43,226, 17, 69, 66,202,164,168, 76,191,117, 13, 0, 4,214,182,106, 8, 68,129,
- 83,166, 76, 81,183,134,115,225,194,133,126,109,219,182,149,241, 56, 76, 29, 97, 50, 22, 54,174,209,106,138, 41, 46,175, 14, 60,
- 94,200,220,185,115,245,173,225,252,240,195, 15,125, 59,117,234,228,228, 96, 37,172, 21,113, 81, 40,162, 76,133, 92,157, 54,143,
-103,212, 21, 11,109,108,234, 32, 18, 7, 79,154, 52, 73,215, 20,103,131,123,245,188, 51,196,225,112, 80, 88, 88,136,242,135, 87,
- 81,254,240, 54,218,147, 42,116,115,114,128, 84, 42,109,241,126, 34,252, 51,137,140,135, 32, 50, 30,130, 32,252, 51,137, 23, 45,
- 63, 47,178,228,114,121,179,101,191,217,166,190, 12,191,184,151,225, 60,117,234,212,186,145, 35, 71, 26,198,141, 27,135,179,103,
-207,130, 32, 8, 92,185,114, 5, 5, 5, 5, 24, 60,120, 48, 24,134, 65, 74, 74, 10,244,122, 61, 50, 50, 50, 48,102,204, 24, 68,
- 68, 68,212,197,198,198,126,198, 86,245, 44, 88,176,248, 79,200,176,243,224, 0, 0, 32, 0, 73, 68, 65, 84, 9,172,190,245,150,
- 92,223,134, 21, 6,129, 32,141,158, 61, 27, 86,191,252, 2,238,189,123, 24,243,250,235,150, 2,129, 96,139, 76, 38,235, 44,151,
-203,123,138, 68,162,173,243,231,207,183,176,139,138,130,243,165, 75, 80,156, 61, 11, 3,151,123,179, 53, 7, 87,171,213, 13,110,
- 12,116,245, 66,206,218,218, 26, 52, 77,195, 92,237,194,152,144,160, 40,185, 7, 62,218,128, 1, 84,167, 85,253, 19, 38,100,175,
-118, 58,167,106,223,254, 94, 53,215,123,189, 99, 55,251,221,109,123,220, 84, 19,220, 26,158, 37, 31,133,133,133, 96, 64, 39,180,
- 38,157, 26,141,166,170,182,182,150,240,246,246,182, 79, 74, 74,242,110,215,174,157, 29, 0, 66,171,213,222,248, 43,153, 47,151,
-203,187, 7, 7, 7, 31, 12, 9, 9,201, 9, 14, 14, 62, 40,151,203,187,183, 98,247,239,146,147,147, 65, 81, 20,166, 79,159, 14,
-149, 74, 5,157, 78,135,188,188, 60,228,230,230, 66,167,211, 33, 45, 45, 13,153,153,153,208,233,116, 72, 73, 73,129, 86,171, 53,
- 71,184,193,194,194, 2,149,101, 74,201,129,237, 95, 12,255,108,213, 39,162,170,251, 73,200, 47, 44, 6,109, 82, 23,126,242,201,
- 39,217,222,222,222, 87,116, 58,157,175,201,100, 26, 6,224, 64, 43,203, 91, 74,135, 14, 29,250,110,220,184,177,231,234,117,223,
-243,173,164,213, 16, 88,219,130,111, 35, 6,223, 35, 20, 83, 62,250,146,179,115,231,182, 91, 87,174, 92, 41,129,121, 35,243, 72,
- 0, 41, 93,186,116,233, 89, 84, 84,212, 39, 36, 36, 36,212,165,109, 91,137, 68, 38,175, 16,200,156, 75,105,173,230, 26,100, 46,
-189,163,163,163,111, 92,184,112, 65,209, 26, 78, 15, 15,143,222,219,182,109,235,214,166, 77,155,110, 98, 75, 75,169, 70,165,250,
-193, 88, 87, 23, 67, 73,165,124,136, 36,131, 98, 99, 99,175,236,223,191,191,168, 53,156,126,126,126,189,162,162,162,186,116,238,
-220,185,155,171,151,151, 84,228, 40, 43,147, 56,187, 42, 69, 62,254, 60,200, 92, 95,137,142,142,190,122,241,226, 69,115,211, 9,
-146, 36,193,225,112, 32,149, 74, 17, 23, 23,135,136, 94, 29, 32, 39,203, 17,212, 70,142,161,211,222,194,111,191,253, 6, 46,151,
-139,191,234,182,190,192,125,109, 81, 16,181, 86,124,181,196,169, 80, 40,182, 37, 38, 38,126,245,198, 27,111,224,149, 87, 94, 65,
-106,106, 42, 22, 46, 92,152,125,241,226, 69, 0, 64,106,106, 42,214,172, 89,147,157,144,144,128,105,211,166, 33, 60, 60, 28, 41,
- 41, 41,209,108,240, 81, 22, 44,254,207,224, 79, 90,228,255, 50, 26,154, 8,227,158,254,246,178,177,177,208,104,234,242,227,226,
-226,244,195,134, 13,227,137, 68, 34,140, 29, 55,142,116,115,119,239, 21, 23, 29,125, 94, 34, 22, 19,227,150, 44,145, 6, 6, 6,
- 54, 86,242,191,254,250,171,186,170,170,178,204,205,205,205, 58, 47, 47,175,210,156,131,151,150,150, 66, 38,147,129,162, 40,212,
-214,214,130,162, 40, 72,165, 82,212,213,213,153,221, 7,171,182,154, 60,123, 37, 46,237,149,126, 99,103,170, 6,101,235, 37, 70,
-198,174,187, 5,201,192, 4, 3, 52,117, 12,140, 52,195,185,206, 88,119, 57,239, 19, 81,177,166, 93,233,221,252,115,219, 28,212,
-140,238,108,107, 50,169,162,162, 98,217,204,153, 51, 15, 4, 4, 4,216, 91, 88, 88,192,201,201,137,124,231,157,119, 74,242,242,
-242, 62,125,217,140,247,243,243, 27,239,235,235,187, 37, 38, 38,198, 54, 39, 39, 7, 0,218, 46, 89,178,164, 95,102,102,230,156,
-140,140, 12,115,130,151, 30,220,184,113,227,150,254,253,251, 75,194,194,194, 26, 5,150, 94,175,111,252,126,254,119, 67,115,108,
-115,160,105, 26, 66,161, 16, 49,223,110, 30,244,217,170, 79, 68,101, 25, 9,184,117,229, 44, 98, 31,106,235, 54,236,217,119, 77,
-216,224, 86,182,246,124, 29,196, 29, 45,172, 45, 14,246, 27, 56,196,121,212,148,153,228,170, 85,171,152,223,207,196, 48,123,190,
-153, 13, 47,223,175, 64, 16, 36, 50,239,166, 98,198,184,222, 76,218,237,180, 46, 0, 92, 91,203,185,110,221,186,218,204,204,204,
-170,131, 7, 15, 10,221,220,220,188, 73,146, 20, 20, 21, 23,151,141, 31, 63, 62, 53, 62, 62,190,156,166,233,217, 47,149,206,223,
-127,175,141,142,142, 22, 59, 56, 56,248,146, 36, 41,168,170,170, 42,157, 57,115,102,114, 76, 76,140,138,166,233, 57, 47,195, 25,
- 30, 30, 94,115,224,192, 1,177,187,187,123, 7,146, 36, 5,133, 69, 69,165,227,198,141, 75, 73, 72, 72,168,198,147, 64,163, 47,
-196,216,121,153,232,251,218,147,223, 34,145,168,204,207,207,207,110,216,176, 97, 48,153, 76,200,201,201,193,237,219,183, 49,100,
-226,155,176,181,181,197,133, 59,119,160, 80, 40,176,116,233, 82,168,213,106,220,191,127, 95,241,119, 86, 30,245, 77,123,140, 66,
-161,248,211,205,154,126,220,183, 49,136,232, 51,226,202,147,136,107,174,159, 85,115,156, 0, 48,104,208,160,105, 35, 71,142,196,
- 47,191,252,130,133, 11, 23,102,175, 92,185,210,107,220,184,113, 72, 79, 79, 71,112,112, 48, 22, 44, 88,224,181,113,227,198,108,
-134, 97,188,122,244,232, 1, 87, 87,215, 87, 21, 10,197, 71,236,115,139, 5,139,255, 19,136,123,238,251,127, 66, 96, 1, 79,117,
- 40, 99, 44, 69,227,118,109,219,106, 53,107,222,130, 90,127,127,127, 27, 39, 39, 39,144, 36,137, 33, 67,135, 18,221,207,156,177,
-224,202,229,176,235,216, 17, 12,195,128,166,105, 92,190,116, 9,231,207,159,175,253, 97,207,119, 46,145,111,191, 61, 2, 64,147,
- 35,119, 26,154,213, 8,130, 64, 73, 73, 73,163,192, 18, 10,133, 40, 44, 44,132, 76, 38, 3,143,199, 3, 69, 81, 28, 0, 20,128,
-102,155, 29,101, 50,217,247, 81,107,210, 23,231, 5,125,232, 25, 46, 38,137,211,181, 69, 32, 65,192,200,208, 32,213, 12,104,154,
-129,214, 0, 4,184, 80, 54,231,180,176,190,145,118, 54, 71, 38,147,125,175,248,127,237, 93,121, 92, 84,213,251,126,238,157,125,
- 99, 88, 5, 70, 80, 84, 16, 65, 80, 17, 23,114, 41, 67,201, 52, 41,203,181,178,220, 77, 49,205, 22, 83, 83,127,226,146,230,146,
-154,153, 75,106,185,175,153, 89, 46, 41,229, 23, 50, 23,100, 81, 17,149, 77, 65,129, 97,223, 97,214,187,252,254,128,161,145, 16,
-102, 80, 19,235, 62,159,207,253,220,185,115,103,158, 57,231,220, 59,231, 60,247,125,223,243, 30,181,229, 99,205,157, 59,119,206,
-105, 52,154,169,149,149,149, 71, 0,144,151, 46, 93, 98,238,222,189, 59,221,210,128,244,250, 32,149, 74,103, 31, 62,124,216, 97,
-233,210,165,197,191,255,254,123,105,255,254,253,109, 87,172, 88,225,248,230,155,111,206,134, 5,217,225,213,106,181, 6,192,174,
-220,220,220,233, 61,122,244, 64, 81, 81, 17,244,122, 61,226,226,226,208,190,125,123,196,196,196,192,199,199, 7,209,209,209,240,
-245,245, 5, 77,211,208,106,181,160, 45, 72,180,149,125, 63, 67, 33,211, 21, 43,179, 47,159,196,237,107, 49, 56,153,166,171, 90,
-253,221,193,147,157,187,118,175,180, 84,248,154,163,131,179,204,223,197,201,241,215,181,107,190,176,201,186,124, 10,135,182,174,
-101,127,251,229,151,110, 98, 37,222,237,245,210,251, 35,141, 6,180, 98, 88, 8,251,246,237,141, 87,187,221, 32, 4, 58, 20,255,
- 30,219,112, 38,243,250, 56,143,236,222, 31,168, 5,252,219,181,107,247, 42,143,199,107, 1,192, 64,211,116, 34, 44, 92,130,230,
- 97,229,212, 2,254, 42,149,234, 85,137, 68,226, 70, 16,132, 70,163,209, 36, 63, 14, 78, 79, 79,207, 87,121, 60, 94, 75, 0, 85,
- 52, 77, 39,193,202,165,114, 66, 66, 66, 86,239,216,177,227, 35,157, 78,231,104,102,109, 37, 78,157, 58, 5,189, 94, 15,145, 72,
-196,202,229,114,220,191,127,159, 5,160,102, 89,118,234,227,234, 56,134, 15, 31,142, 75,151, 46, 45, 6,176,168,161,207, 21, 21,
- 21,241, 29, 28, 28, 40,115,225,245,176, 44,240,150,112, 94,190,124,121,229,228,201,147,103,159, 62,125, 58, 51, 60, 60,188,235,
-184,113,227,112,236,216, 49,180,110,221, 26,183,111,223,198, 71, 31,125, 4,130, 32, 60,215,172, 89, 19,127,224,192, 1, 85, 78,
- 78,206,151,220,152,197,129,195, 51, 5,226,223, 82,145,122, 99,176, 8,134, 16,120,183,111, 79,235,171, 42,190,159, 52,126,124,
-213,141, 27, 55, 64,211, 52, 40,138,130, 54, 58, 26,149,191,254, 10,138,162,192,178, 44, 46, 95,186,132,153, 51,102, 84,104,171,
- 42,182,183,109,219,134, 37, 88, 86,110, 70,245,183,213,182,245, 38, 95, 32,170, 93,132, 26,141, 6, 2,129, 0, 10,133, 2,249,
-249,249, 16,137, 68,144, 74,165, 8, 8, 8, 32,221,221,221, 67,235, 41,222, 3,156,113,113,113, 70,148,233, 70,252, 52,246,131,
- 28,247, 42,138,157, 98,215, 22,173, 4,210,234,120, 43, 0, 45,108, 72,132,248,241,225,192, 47, 96,175,239,124, 75, 77, 80,165,
- 35,226,226,226,140, 13,113,214,133, 74,165,234,224,239,239,255,141, 41, 15,214,243,207, 63, 79,118,234,212,233,107,149, 74,213,
-161,129,175, 53,200, 41,145, 72,196, 0,112,246,236,217,162,168,168,168,193,103,207,158, 45, 2,192,154,222,183,132,147, 36,201,
-111,183,110,221, 10,153, 76, 6,138,162,160,215,235,161,211,233,160,215,235,255,182, 57, 57, 57, 33, 34, 34, 2, 12,195,156,104,
-172,156, 29, 59,117,169, 40,229,219,229,238, 60,254, 27, 78,165, 27, 42,154, 32,174,106, 57,253, 92,229, 62,110, 45,170, 5, 70,
-225,205,139, 72,185, 30,131,147, 39,126,142,215, 2, 89, 37,101, 88, 94, 82,134, 46,149, 90,216,247,236,136,130, 95,143,204, 37,
- 62, 30, 3, 2, 68,189,107,230, 89,196, 89, 35, 80,166,209, 52,221,147,166,233,158, 0,166, 53, 32, 90,172,226,212,106,181, 65,
- 26,141,230,177,114, 90, 91, 78, 83, 12, 22, 0, 44, 92,184, 48, 58, 42, 42,106, 84,116,116,116,127,211,150,144,144, 16,124,231,
-206,157,224,172,172,172,224, 59, 63,139,121, 9, 9, 9,252,152,152, 24, 65, 76, 76, 76,235,216,216,216,211,150,222,159, 15,131,
-121,128,187, 90,173, 14,175, 99,105,170,229, 36,252,110, 17,223,172, 9,219,115,248,240, 97,215,199,197, 9, 0,183,111,223,254,
-102,199,142, 29, 30, 1, 1, 1,238,166, 84, 12,219,183,111, 7, 80,157,201,126,237,218,181,232,213,171, 23,220,221,221,157, 99,
- 99, 99,219,101,103,103,111,181,246,191,217, 68,112,156, 28, 39,199,201,193, 2,129, 69, 48, 52, 77, 51,112,118,113,182,201,207,
-203,219, 24, 22, 54,173,112,201,146, 37,218,200,200, 72,232,111,221,130, 54, 46, 14, 17, 17, 17,248,224,131, 15,170,222,155, 58,
- 85,173,173,170, 88,239,234,226,236, 68,211, 12, 8,130,105,208, 66, 66,146,100, 90,114,114, 50, 0, 64,167,211,225,235,175,191,
- 54, 26, 12, 6, 40,149, 74,176, 44,139,109,219,182, 49, 0, 48, 96,192, 0,185, 64, 32,176,104, 9,146,236,236,236,107,101,247,
-179, 7,254,240,230,180,180,155, 7,126, 46,235, 92,168,199, 40,137, 10,175,119,102,209, 78,146,129,123, 23,191, 43,189,184,101,
- 88, 90, 85,241,253,151,179,179,179,175, 89,219, 72,174,174,174,255,183,111,223, 62,231,216,216, 88, 86,167,211, 33, 43, 43,139,
-157, 61,123,182,179,171,171,235,255, 61,138, 74, 47, 41, 41, 1, 73,146, 76, 77,187, 48,214,170,247,172,172,172,132, 35, 71,142,
-252,116,238,220, 57,184,187,187,131,166,233, 90,129,101,190,231,243,249, 32, 8, 2, 91,182,108, 41, 33, 8, 98, 94, 99,188, 34,
-145, 8, 91, 15,157, 60,245,201,230,163,135, 14, 69, 68, 31,109,170,229, 10, 0,100, 54,202,165, 95,174,254,194,214,228,106,220,
- 23,155, 93, 70,208,108,253,174, 58, 67, 86,245, 61, 82,191,192,106, 26,231,147, 40,231, 83,228,124,154,168,158,233,167, 38, 90,
-182,108,137, 31,126,248,193,234, 24, 44,191,118,196,223,130,219,155,202,153,144,144,240,197,168, 81,163,114,195,195,195, 55,105,
-181,218,202,154,135, 55,195,151, 95,126,185,230,253,247,223,207,205,202,202,226, 44, 87, 28, 56,112,120,170,168, 55, 77, 3,195,
- 35,255,220,178,117,243,224,131,251, 15,184,242,120,164,235,157, 59,119,175,188, 59,113, 98, 86, 84, 84,148,131,160,125,251,158,
- 36, 73, 50,250,185,115, 47, 86,148,149, 22,237,254,254, 59,143,182,109,219, 4,212, 44,246,204, 50, 60,242,207,134,126,176,168,
-168,104,231,172, 89,179,122,238,218,181, 75,184,122,245,234,202,172,172,172, 51,151, 47, 95, 30,188,105,211, 38,201,182,109,219,
-170, 74, 75, 75,143,159, 60,121,114,104,112,112, 48,165,215,235, 45,206, 47,148,151,151,151,136,188, 60, 95,114,237,182,183,147,
-182,238, 25,200,242,200,222,208, 10, 65,176,244, 5,146,170, 56,147,151,157,189, 15, 0,213,148, 70,146, 72, 36, 1, 82,169, 20,
- 41, 41, 41,197, 61,123,246,212,139, 68, 34, 65,155, 54,109, 28, 37, 18, 73, 64, 83, 27,158,101, 89,182,184,184, 24, 44,203,242,
- 1, 16, 52, 77,243, 1,128,105, 44,105, 81, 29, 8,133,194, 55, 39, 76,152,240,211,166, 77,155, 6, 14, 24, 48, 0,158,158,158,
- 48, 26,141,240,241,241,129, 94,175,135,183,183, 55,180, 90, 45,190,250,234, 43, 84, 84, 84,124,148,157,157, 93,220, 16, 31,195,
- 48, 16,139,197, 16,137, 68,240,233,216,169, 74, 34,145,160,169,226, 10, 0,228, 34,180,187,127,233, 4, 82,174,199,226, 96,156,
-186,164,210,192, 12, 74,202,175,186, 81,247,115, 85,122, 84, 6, 15,154, 86, 45,188,141,168,120, 28,156, 79,162,156, 79,155,211,
- 60, 6,203,146,207, 62, 46, 60, 44, 38,170, 33,220,188, 11, 98,218,243, 27, 89,220,220, 88,111,142,171,166,112,154,144,153,153,
-185,197,180, 4, 14, 73,146,169, 51,103,206,156,157,149,149,181, 78,173, 86,111, 82,171,213,139,184,174,157, 3, 7, 14,205, 82,
- 96,221,185,147,153,120,228,216,209,207,142,254,112,164, 15,203,146, 60,150, 32, 42, 1,242,231,196,196,196, 7,130,215, 61,237,
-237,109, 38, 76,158, 48,154, 96, 8, 1, 65, 48, 52,195, 35,255,188,115, 39, 51,177, 17,107,211,245,254,253,251,111, 12, 14, 14,
-158, 72,211,244,170,148,148,148, 51, 36, 73,198, 15, 26, 52,232, 19,138,162,214,164,165,165,157,241,241,241, 57,123,240,224,193,
- 79,105,154,182,214, 66, 68,101,103,103,239, 66, 3, 49, 96, 77,196, 18, 0,182, 98,177,184, 52, 54, 54,246, 64,159, 62,125,222,
- 36, 8,194, 22, 64,105, 83, 9,117, 58,221,204,242,242,114,167,209,163, 71, 27, 1,248,188,241,198, 27,243,146,147,147, 5,149,
-149,149,105,214,240,100,100,100,232, 60, 60, 60,134,134,133,133,109, 23, 10,133, 3,240, 87,146, 54,147,144, 3,203,178,160,105,
-250,120, 77,219, 60, 20, 2,129,160, 98,200,144, 33, 10, 11, 44, 92, 21,150,150, 47,167,160,124,230,178,157, 39, 87,232,140, 12,
- 67, 49,236,212,164,188,170,122, 71,253, 43,137,240,127,220,156,214,224, 89,225, 4,128,105,207,111,220,131,155, 27,107, 5,148,
-201,109, 88,247,248, 73,161,198,226,196, 2, 88,220,216,103, 27, 90, 87,176,169,156,117,145,149,149,245, 45, 55, 83,144, 3, 7,
- 14,255, 53,112,254,105,142,147,227,228, 56, 57, 78,142,147,227,228, 56,255,115, 32,185, 38,224,192,129, 3, 7, 14, 28, 56,112,
-120,188, 32, 26, 80,161,214,172,148,221, 20, 37,155,192,113,114,156, 28, 39,199,201,113,114,156, 28,231,127,142,179, 49,238, 4,
-112,120, 34,194,139,227,228, 56, 57, 78,142,147,227,228, 56, 57,206,255, 30,231,191, 10,156,139,144, 3, 7, 14, 28, 56,112,224,
-192,129, 19, 88,205, 2,239,162, 58, 41,100, 2,128, 95,107,142,155, 10, 41,128,185,102,124,167, 0,124, 10, 64,204, 53,115,179,
- 6,143,107, 2, 14, 77,133, 74,165,234,208,177, 99,199,216, 70,146, 21,115,224,192,225, 25, 6,255, 97, 39, 60, 61, 61, 47,144,
- 36,217,142, 36,171, 53,152,121, 46, 36,211,235,186,123,150,101,239,220,188,121,179,247,195, 56,219,182,109, 91,203, 73,146, 36,
- 8,130, 0, 73,146, 48, 26,141, 54, 60, 30,175,188, 62, 78,154,166, 51,147,146,146,186, 55,163, 54,219, 99,111,111,111,220,180,
-105,211, 55,129,129,129,237,139,138,138, 42,167, 76,153,242,114, 66, 66, 66, 8,128,119,172,228,234, 68, 16,196,238, 30, 61,122,
- 28,125,255,253,247, 15,251,249,249,217, 84, 86, 86,138, 15, 30, 60,232,186,101,203,150, 63,104,154,158, 0, 32,145,187, 77,155,
- 15, 92, 93, 93, 3, 9,130,216,168, 80, 40,186, 87, 84, 84, 92, 1, 48, 93,173, 86, 95,229, 90,230, 31,197, 36,145, 72, 52,200,
-219,219,187,167, 78,167, 43,190,115,231, 78,116, 77, 74,151,156,199,196,111, 11,224,255,196, 98,113,144,151,151, 87,171,228,228,
-228,251, 6,131,225, 50,170,211,181,148, 62, 42,185, 74,165,234, 16, 20, 20,116,126,249,242,229,142,243,230,205, 59, 31, 29, 29,
-221, 87,173, 86, 39,113,151,149,195,211, 64,171, 86,173,236, 42, 43, 43,183,147, 36, 25, 40,145, 72, 92,109,108,108,160, 80, 40,
-114,196, 98,113,188, 76, 38,155,120,242,228,201, 18,174,149, 30,179,192,226,241,120,238,209,209,209,206, 54, 54, 54,160,105, 26,
- 12,195,128, 97,152,218,245, 7,107,150, 20, 52, 9, 43,208, 52,141,224,224,224, 6, 87, 19,230,243,249,173, 98, 99, 99,157, 21,
-138,191, 82, 45, 25, 12, 6,116,233,210,133,137,139,139,115,174,187,144,176, 94,175, 71,183,110,221,216,102,212, 94, 99, 28, 29,
- 29,245, 25, 25,247,122,105,117,134,222, 97,179,151,254,223,232,215,250,217, 94,188,120,145,124,245,213, 87, 5,231,206,157,123,
- 23,192,110, 11,185,164, 4, 65,236, 88,176, 96,193, 23,124,161,204,249,200,201, 11,252,175,183,238,187,223,169, 99, 91, 98,214,
-140, 48,217,204,153, 51,163,125,125,125,191,163,105,250,121, 0, 58,238, 86,109, 30,255, 23,129, 64,240,211,138, 21, 43,220,114,
-212,106,172, 93,183,238, 57, 0,155, 0, 60,199, 53,205, 63,134,185,139, 23, 47, 94,241,246,219,111,131,162, 40,104, 52,154,150,
-169,169,169,254, 11, 22, 44,120, 35, 53, 53,181, 39,128,180, 71,228,111,225,237,237,125,107,214,172, 89, 14, 61,123,246, 4, 73,
-146, 40, 41, 41,105,121,254,252,249,231,118,236,216,241,238,189,123,247,124, 1,228, 63,202, 15,216,219,219,239, 93,179,102,141,
-163, 88, 44,198,247,223,127,239, 56,106,212,168, 63, 0, 60,255, 8, 34,139,116,116,116,156, 9, 32,152, 97, 24, 49,128,203,197,
-197,197,203, 0, 24,184,219,133, 67, 67,112,116,116,156,148,155,155,251,141, 76, 38, 19,218,217,217, 65, 42,149, 66, 40, 20, 66,
- 36, 18,181,182,183,183,111,173, 80, 40, 94,121,243,205, 55,167, 31, 56,112, 96, 59,215, 90,143, 81, 96,145, 36, 9,169, 84,138,
-131, 7, 15,130,199,227, 65, 40, 20, 66, 32, 16, 64, 32, 16, 60,240,218,116,220,170, 85,171, 70,127,204,100,149, 58,126,252, 56,
-108,109,109,161, 84, 42,209,177, 99, 71, 16, 4, 1,177, 88,140,136,136,136, 7,120,187,119,239,254, 72, 89,196,155,130, 17, 3,
-170,147,116,214,151,188, 49,116,122, 38, 94,125,123,249,240, 42,157,241, 5,150, 37, 52, 57,197,198,162, 37,171,191, 73,236,234,
-223,145, 56,116,232, 80, 55, 39, 39,167,183,172, 16, 88, 31,244,236,217,243, 56, 5,145,203,132,113,227,199,141, 39, 9,106,216,
-248,143, 23,159,143, 75, 45,222,238, 23,184, 47, 63, 63,115,234,215, 95,127,157, 20, 22, 22, 54, 19,192, 42, 75,203,223,189,123,
-247,123, 12,195,180,170, 17,201, 5, 82,169, 84, 21, 25, 25, 73, 53,131,123,173, 37,128,213, 0,140, 0, 86, 2, 48, 79,186,217,
- 65, 40, 20,174, 50, 24, 12, 69,168, 94,232,247,126,115,252,179,184,185,185,249,190,243,206, 59, 78,133,249,249, 88,187,110, 93,
-109,147,195,130, 69,201, 31, 55, 2, 3, 3,219, 73, 36,146,213, 0, 2,117, 58,157, 27, 0, 72,165,210, 44,150,101,127,212,104,
- 52,243,227,226,226, 52, 77,125,160, 5,224,143,135, 47,217,196,174, 90,181, 42,233,211, 79, 63,189,243, 20, 56,219,184,184,184,
- 44, 31, 57,114, 36, 78,156, 56,129,147, 39, 79, 26, 37, 18, 9,127,220,184,113,196,244,233,211,237,103,205,154,245, 10,128,175,
- 30,177,105, 95, 89,188,120,177, 67,199,142, 29,113,228,200, 17, 92,189,122, 85,211,161, 67, 7,105,191,126,253,192,227,241, 28,
-230,207,159, 63, 24,192,206, 71,249,129,226,226,226,101, 75,151, 46,221,181,113,227, 70,155,180,180, 52, 44, 94,188,216,233,253,
-247,223,143, 4,208,207, 10,145, 37, 6, 48, 19, 64, 48,143,199,123,126,220,184,113,212,140, 25, 51, 4, 36, 73, 26,215,175, 95,
-223, 98,251,246,237,163, 5, 2, 65, 96, 97, 97, 97, 5, 56,160,129,113,206,192, 48,140, 0,128, 4,128,174,177,227,127, 83,221,
- 29, 28, 28,166, 21, 21, 21,109,106,217,178, 37, 90,180,104, 81, 59,214, 50, 12,131,202,202, 74,104, 52, 26,180,107,215, 78,216,
-177, 99,199,109,211,167, 79, 23,124,243,205, 55,155,185, 59,198,122,129,213, 15, 64,164,217,123,253, 0, 68, 18, 4, 1,134, 97,
- 32, 16, 8,192,227,241,192,231,243,107,133,143,249,107,211,246, 16, 33,148, 80,231,102, 38,202,203,203,107,197,149,173,173,109,
-173, 37,204,104, 52,254,141,147,166,105,144, 36,201, 54,196,249,152, 80,203,121,120,189, 47,118,198,204,126,115,103, 76,245,241,
-224,183,171,247, 59, 99,128,136,203, 83, 87,175,218,220,167,213, 7,203,190, 95, 81, 88, 88,146,231,231,222,130,122,235,237,126,
- 30,162,130,220, 2,199,182,109, 67, 1,228, 89, 81,206,190, 83,167, 78, 61,114,228, 92,138, 92, 44, 22,137,120, 36,120, 29, 60,
-219, 9,220,148,237, 29, 90,188,220, 83,148,158,150,246,199,187,239,190, 59, 53, 44, 44,204,209, 76, 96, 53, 90,119,150,101, 85,
-103,206,156, 1,159,207, 71, 72, 72,136,125,205, 53,166, 44,169,251,147,104, 79, 51, 44,200,205,205,125, 83,171,213,162,123,247,
-238,175, 21, 22, 22, 6, 3,136, 7,208,121,232,208,161,127, 28, 62,124,216, 38, 46, 46, 14,207, 61,247,156, 20,192,168,167, 88,
-206,191, 65,165, 82,157, 1,240, 18, 65, 16,208,107,181,250,213, 95, 62,176,204, 93, 76, 29,113,245,196,203, 25, 16, 16,224, 43,
-145, 72, 46,124,249,229,151, 74, 63, 63, 63, 66, 32, 16,128,162, 40, 36, 39, 39,183,218,179,103,207,123, 87,174, 92, 25, 28, 24,
- 24,232, 87,207,162,230,150,212,221,255,143, 63,254,168,244,244,244,172, 87, 48, 86, 85, 85,241, 60, 61, 61, 95,124,136, 24,122,
-210,156,153,185,185,185,175,191,244,210, 75, 83,115,114,114,110, 81, 20, 53, 7, 64, 39, 39, 39,167,184,225,195,135, 67, 42,149,
- 6,107, 52,154,175, 30,229,186, 59, 59, 59, 15,237,221,187, 55, 54,110,220,136,149, 43, 87,134, 0,248,237,151, 95,126, 25, 80,
- 86, 86, 22,241,218,107,175,193,206,206,238,245,146,146,146,157,143,112, 47,117,232,217,179,231,182,143, 62,250,200,230,151, 95,
-126,129,183,183, 55,202,202,202, 48, 97,194, 4,231, 13, 27, 54,252, 15,192,139,102, 34,235, 97,156,126, 98,177,120,231,254,253,
-251, 21,158,158,158,158, 66,161,144,244,244,244, 68, 81, 81, 17,180, 90,173,120,217,178,101,157, 37, 18,201,213,175,190,250,106,
- 39,128, 97, 79,249,127, 84, 10, 64, 9,192, 14,214,185, 87, 19, 26,224,171,141, 79, 21, 8, 4, 16,139,197,144, 72, 36,144, 72,
- 36,184,115,231,206, 15, 60, 30,111, 60, 65, 16, 70, 75, 56,137,191, 6,174, 0, 0,209,141, 29, 3, 96,154, 65,191,228, 78, 16,
-196,122, 0,193,168,142,163,142,116,118,118,254, 32, 55, 55, 55,195, 82, 78,149, 74,229, 88, 88, 88,248, 85,203,150, 45,225,236,
-236,140,154, 7,114,116,239,222, 29, 90,173, 22, 55,110,220, 0,195, 48, 72, 77, 77,133, 82,169, 68,231,206,157,191, 10, 15, 15,
- 63, 18, 30, 30, 94,248, 4,235, 94,175, 22,121,214, 5,214,255,106,158, 44, 77,149, 49, 29,131,166,233, 90,129, 85, 87,252,212,
- 21, 92, 4, 65,128,101, 89,162, 17, 11, 22,169,215,235,107,197,149, 82,169,172, 21,103, 20, 69,213, 43,176,154, 10, 59, 59,187,
- 95, 75, 74, 74,214, 1, 56,211,148,239,143, 27, 55,238,111,241, 28,115,231,206,189,159,159,159, 79, 15,237,219, 65,188,123,247,
-137,194,119, 67, 95,116,245,243,114,247,145, 59, 58, 7, 84, 85, 85, 93, 1, 32,176,198, 32,226,231,231,103,179,121,127,100,222,
-219, 51, 87, 47,113,119, 81,208, 61,188, 93,148, 94, 14,114,145,163,132, 79,217,177, 84,137, 76, 38,243, 7, 80,104,109,217,109,
-109,109,113,252,248,241,230,118,175,217,107, 52, 26, 20, 23, 23, 99,203,150, 45,202,169, 83,167,158, 43, 44, 44,252, 96,232,208,
-161, 27,143, 28, 57, 34, 47, 41, 41,129,193, 96, 0, 0, 77, 51,252,159, 44,181,183,183,127, 33, 56, 56, 88,116,224,208, 33, 17,
-203,178,149,168, 94,142,168,130,101,217,247,255,233,194, 72, 36,146, 79,150, 45, 91,166,244,243,243, 35, 10, 10, 10,192,178, 44,
- 72,146,132,147,147, 19,102,207,158, 45,153, 63,127,190, 91, 82, 82,210,103,104,194,178, 51, 0,136,135, 9, 33, 0,144,201,100,
- 52,172,159, 28, 83, 47, 39, 69, 81, 68,159, 62,125,102, 23, 20, 20,116,214,104, 52,159, 91,192, 67, 1, 56,158,153,153,105,126,
-115, 95,189,117,235,150,134,207,231, 75,219,182,109, 27,148,152,248,104, 33,139, 29, 58,116,232, 37, 16, 8,112,249,242,101,157,
- 89,231, 30,121,237,218, 53,221,176, 97,195,196,173, 90,181,234, 85, 82, 98, 89, 72,138, 74,165,234,224,229,229,117,214,201,201,
- 73,106, 90,178,202,209,209, 81,176,106,213, 42,155,204,204, 76, 80, 20,133,121,243,230, 33, 52, 52, 20,246,246,246, 24, 63,126,
-188,203,182,109,219,246, 2,232,214,144,229, 74, 44, 22,239, 76, 73, 73,241, 81,169, 84,210, 75,151, 46,161, 75,151, 46, 40, 40,
- 40, 64, 78, 78, 14, 42, 42, 42,144,147,147,131,137, 19, 39, 58,175, 93,187, 86,213,140,254, 67, 37,124, 62, 31,114,185,220,174,
-180,180,244, 81,226,216,196, 0, 68, 0,192,231,243,107,197,149, 88, 44,134, 88,252,159,152, 23,228, 70, 16, 68,162, 64, 32, 16,
-203,229,114, 33, 73,146,144,203,229, 47,187,187,187,223, 8, 9, 9,233,180,103,207,158,116, 75, 72,180, 90,237,110,169, 84, 42,
-104,209,162, 5, 0, 96,224,192,129, 24, 55,110, 28,242,243,243,153,236,236,108,248,248,248,144,145,145,145,200,205,205,197,213,
-171, 87,209,163, 71, 15,129,131,131,195,110, 0,131,159, 96,221, 30,170, 69,158,101,129, 85,183,114,181, 96, 24,230, 1,113, 85,
-159,229,202,220,130,213,152, 59,143, 32, 8,208, 52, 13, 87, 87, 87,200,100, 50,200,100,178,218,115, 38, 49,103,190,177, 44,219,
-100, 23, 97,251,246,237,251,203,100,178,231,207,157, 59,247, 26,128, 8, 75,191, 55,114,214,173, 90,171, 85, 93, 4, 4, 4, 92,
-152, 55,111,222,160,223,127,255,189,184, 87,151,118,140, 56,251,126,161,204,222,169, 11,209,194, 57, 36,108,242,148,139, 0,246,
- 91, 81,196,108,173, 86, 43,110,227, 74,106,178, 75,203,244,237,148,182,118,237,108, 21,178, 54, 78,182,142,246, 18, 17, 41,119,
-113,110,105, 52, 26, 75, 0,100, 55, 70,100,238, 22, 20,139,197,122,130, 32,248,118,118,118,176,181,181, 53, 20, 23, 23,107, 3,
- 3, 3, 33, 18,137, 10,132, 66,161,197,238,194, 30, 61,122,228,210, 52,237,220,208,103,132, 66, 97,222,165, 75,151, 92, 44,172,
-239,252,128,128,128,126,155, 54,109,106,225,237,237,141, 45, 91,182, 40,143, 28, 57,178,115,239,222,189, 40, 41, 41,193,221,187,
-119, 49, 97,194,132, 50, 84,187, 17,155,155, 41,253,252,136, 17, 35,176,125,251,118,182,230, 33, 66, 78, 16, 68, 23, 91, 91,219,
-219, 55,111,222,252,199,227, 92, 72,146,124,217,199,199,135, 40, 45, 45, 5,203,178,224,241,120, 15,108,179,103,207,150, 78,156,
- 56,113,193,115,207, 61, 55, 91, 32, 16,148, 81, 20,117,160,162,162,226,243, 27, 55,110, 52,171, 96,213,231,159,127,254,195,251,
-247,239,135,122,120,120,252,252, 8, 52, 44, 69, 81,122,150,101,165, 60, 30, 79,240,168,101, 34, 8,130, 87,211, 31,105,205, 44,
-191, 84,205,177, 24, 86,204, 30,117,112,112,216,187,103,207, 30,119,119,119,119, 24,141, 70, 24,141, 70, 84, 86, 86, 34, 50, 50,
- 18, 58,157,174,118, 81,246, 47,190,248, 66, 59,125,250,116,201,161, 67,135,242, 52, 26,205,152, 70,104,103, 30, 62,124,216, 70,
-165, 82, 73, 53, 26, 13,210,210,210,208,173, 91, 55,148,151,151,163,178,178, 18, 85, 85, 85, 48, 24, 12, 40, 45, 45,181,163,105,
- 90,223, 92,174, 53,143,199,131, 88, 44,134, 64, 32, 40,105,213,170, 21, 72,146,148,100,100,100, 52,197,229,166, 4, 80,198,231,
-243, 69,230,194, 74, 34,145, 32, 33, 33,225, 96, 3,214,171,250,111, 30,243, 96, 98, 11,142,159, 54, 8,130, 88, 47, 16, 8,196,
-142,142,142, 66,211,123, 6,131, 65,104,111,111, 15, 15, 15,143,141, 0, 94,177,144,167,171,163,163, 35, 8,130,128, 80, 40,196,
-228,201,147, 17, 29, 29,253, 99,102,102,230,187,121,121,121,168,168,168,216,173, 84, 42,223,200,203,203, 3, 77,211, 72, 79, 79,
- 71, 64, 64, 64,215,127,168,154,207,188,176,170, 43,176,250,213,217,155, 44, 82,141, 90,174, 26,113, 17, 62, 0,131,193,160, 8,
- 13, 13,101, 76, 98,204, 52,139, 16, 0, 65,211, 52,132, 66,225, 3,156, 53, 2,171, 73, 55,184, 88, 44,198, 43,175,188, 34,145,
-201,100,199,126,249,229,151,215, 0,252,222,212, 70, 58,126,100,159,203,170, 69,243, 22, 57,180,108,235,245,217,103,159,241, 7,
- 15, 30, 28,113,224,192,129, 30, 78,125,251, 15,138,250,237,160,203,150, 57,199,127, 62,120,240, 96, 57, 44,143,191, 2,128, 63,
-127,252,241, 71,213, 39, 51,194,132,253,250,245,251, 97,108,231,143,248, 42, 17, 99,227, 32, 22,242,100, 60, 62, 41,110,213,102,
-208,111,145, 81,106, 0, 81, 22,116, 18,170,136,136, 8,216,217,217, 1,128, 72,175,215,195,206,206, 14, 91,182,108,145, 40,149,
- 74, 40,149, 74,244,238,221,219, 94, 40, 20, 54,230, 46, 52, 23,188,206,255,251,223,255,160, 80, 40, 80, 89, 89, 9,157, 78, 7,
-138,162,192,178,108,237,147,227,139, 47,190,232,108, 69,125,211,202,202,202, 94, 8, 11, 11,139,218,180,105, 83, 11, 47, 47, 47,
- 44, 89,178, 4,133,133,133,184,119,239, 30,198,140, 25, 83,118,231,206,157, 96, 60, 24,155,245,212,209,169, 83, 39,246,252,249,
-243, 56,117,234, 20, 94,125,245, 85,226,248,241,227, 6,154,166,133,217,217,217,215,179,179,179,159, 74,153, 40,138,178, 17,137,
- 68, 48, 26,141,224,243,249,181, 46,124,147,192,114,115,115,195,217,179,103,249, 85, 85, 85,252,194,194, 66,217,142, 29, 59,102,
-196,196,196,168, 0,188,245, 52,219,114,243,230,205, 30,147, 39, 79,190,199,231,243,217, 65,131, 6,189,147,145,145,241,186, 74,
-165,250,237,220,185,115, 95, 2,176, 58, 93,129,191,191,127, 12,143,199,115, 55, 26,141,194, 99,199,142, 25,105,154, 22,118,234,
-212, 41,215,100, 45, 50,141,141, 20, 69,101, 38, 39, 39,119,183,132, 79,163,209, 8,191,253,246, 91,163, 86,171, 21,118,238,220,
-185,150,203, 96, 48, 8,127,250,233, 39,163,209,104, 20,118,232,208, 33,198,146,153,205, 69, 69, 69, 99,102,205,154,245,199,193,
-131, 7,157,120, 60, 30, 50, 50, 50, 80, 84, 84, 4, 59, 59, 59,236,217,179, 7,109,218,180, 65, 68, 68, 68, 17, 77,211,147,182,
-111,223,190, 64,163,209,140,177, 32, 6,235,197,160,160, 32,143,146,146, 18,216,218,218,162,162,162, 2, 49, 49, 49,240,243,243,
- 67,118,118, 54, 72,146,132,157,157, 29, 54,111,222, 92, 69, 16, 68, 81,115,248, 15,145, 36, 89, 43,132,204, 4,145, 54, 40, 40,
- 8,127,254,249,231, 62, 43, 69,145,222,212,255,152,187, 6,197, 98, 49,120, 60,158,213, 46, 15,134, 97,132, 0,186,154, 6,244,
-198,142,155, 1,250,201,229,114, 97,221, 55,139,139,139,133, 62, 62, 62,207, 91, 49, 62, 58, 74,165,210,106,194,126,253,144,151,
-151, 71,123,122,122,142, 30, 61,122,180, 17, 0,166, 76,153, 50, 58, 63, 63, 95,107, 52, 26,121,124, 62, 31,249,249,249,104,215,
-174,157,227, 63, 81,191,186, 90,228, 89, 23, 88, 4,170,221, 29,230,251, 90, 11, 86, 99,150, 43,211, 57,147, 80,106,228,143, 86,
- 18, 27, 27, 43,151,203,229,181,239, 25,141, 70,116,237,218,149, 97, 24,134,168,251, 91,143, 98,193, 18,139,197,176,179,179,195,
- 91,111,189, 37,203,202,202,218,121,245,234, 85,119, 75,190, 87, 29,131,245,160,184,218,186,114,201,198,175, 87, 45,115, 76, 61,
-245, 61,182,111, 88, 67,203,229,138,184,128,128,128, 23, 74, 75, 75,117,118,114, 29,114, 10,113, 4,192, 94,107,250, 28, 0, 7,
- 47, 94,188, 24, 63,112,224,192,139,119,239,222,181,207, 72, 73, 57,175,212, 87, 84, 40, 90,181,165,132,206, 46, 67, 53, 6, 35,
-127,196,136, 17, 46, 0, 54, 88,240, 52, 2,134, 97,112,226,196, 9,216,216,216, 64,169, 84,194,206,206, 14, 38,113,213, 84,220,
-185,115, 7,153,153,153,144,203,229,144,203,229, 80, 40, 20, 80, 40, 20, 16,137, 68, 15, 88, 31,173, 64, 82, 89, 89,217, 7, 71,
-143, 30, 61,176, 98,197, 10, 20, 23, 23,163,178,178, 18,139, 22, 45, 66, 90, 90,218, 44, 84,199,100, 53, 27,116,238,220,153,189,
-112,225, 2,206,159, 63,143,202,202, 74,108,220,184, 17, 42,149,170, 63,128,133, 79,179, 92, 12,195, 8, 77,169, 78, 72,146,252,
-155, 5,203, 36,182,164, 82, 41,156,156,156, 48,111,222, 60,225,208,161, 67, 67,159,102,153, 87,173, 90,213,126,253,250,245, 59,
-118,237,218,117,106,204,152, 49,135, 18, 18, 18,198,219,218,218, 94,255,253,247,223,151,137,197, 98,166, 73,157, 23,159,239, 30,
- 31, 31,111, 46,242, 5, 52, 77,203,104,154, 6, 69, 81, 48, 26,141,168,170,170, 66, 72, 72,136,197,124,209,209,209, 50, 0, 88,
-184,112,161, 0,128,140, 97, 24,152,243,105, 52, 26,193,128, 1, 3, 44,234, 75,212,106,117,210,229,203,151,159, 31, 61,122,244,
-133, 3, 7, 14,216,123,120,120, 32, 51, 51, 19,217,217,217,240,242,242,194,134, 13, 27, 42, 89,150,237, 83, 35,170,126,178,176,
-218, 45,237,237,237, 5,247,238,221, 3, 69, 81, 8, 12, 12,196,230,205,155, 49,106,212, 40,248,251,251,163,188,188, 28,137,137,
-137,216,185,115,167,189, 80, 40, 28,222, 28,196,149, 73, 4,213,183, 53,241, 1, 67, 41,145, 72,202, 36, 18,137,200, 36,180,174,
- 92,185, 98,181,245,202, 12,241, 86, 30, 63, 53,152,250, 96,163,241,193,106,202,229,114,120,123,123, 91,204, 35,151,203, 9,211,
- 24,107, 52, 26,161, 86,171,233,132,132,132, 90,129,170, 82,169,232, 75,151, 46,209, 58,157,142,103, 99, 99, 3, 0,176,179,179,
-123,210, 34,243,161, 90,228, 89,183, 96, 69,213,217,215, 90,176, 76,130,167,161, 32,119, 62,159,111,169,192, 2,143,199,195,233,
-211,167,161, 80, 40, 96, 99, 99, 3, 95, 95, 95,147, 21,166, 94,171, 88, 83, 5,150, 72, 36,130,173,173, 45,206,156, 57,163,189,
-122,245,234,228,166, 90,174,182,174, 92,178,241,139,207, 23, 59, 22,222,188,136,204,108, 53, 10,115, 13, 49,127, 38,164,255,138,
-234, 4,163,192,205,142,145,132,223, 45,139,197,149,175,147, 52, 64,105,175,252, 41,248,165, 65,110,175,143, 13, 35,167, 79,159,
-222,107,220,184,113, 69,239,188,243,206, 76,169, 84,234, 79, 81, 84,113, 68,100,100,250,200,145, 35, 29, 75, 75, 75,199,193,130,
-152, 36, 30,143,167, 30, 56,112, 96, 43, 0,176,177,177,209,127,247,221,119, 34, 59, 59, 59,188,253,246,219,218,156,156, 28, 73,
- 77,123, 20, 91,106,189,170, 25,108,242, 38, 77,154,228,220, 72, 27,231, 89,217,164, 93, 67, 67, 67,183, 29, 60,120, 16,133,133,
-133,168,172,172,132, 80, 40,196,234,213,171,113,239,222,189,175,146,146,146, 18,154, 75,103,214,165, 75, 23,246,210,165, 75,184,
-126,253, 58,116, 58, 29, 38, 79,158, 12, 0,132, 90,173, 6,128,129, 79,219, 83,144,149,149,133, 61,123,246,128,166,105,140, 25,
- 51, 6,109,218,180,169, 21, 88, 57, 57, 57,248,238,187,239, 64,211, 52, 38, 77,154,132,214,173, 91,195,104, 52, 74,250,245,235,
-199,127, 90, 51, 74, 63,250,232,163,212, 31,127,252,241,212,253,251,247, 7,175, 92,185,178, 31, 65, 16,204,236,217,179,191, 80,
- 42,149,143, 52,251,178,184,180, 28,183, 83, 50, 64, 81, 84,189, 91, 11, 39, 7,171,249,146,211,238,129,162,232, 90, 14,154,254,
-139,207,209,193, 58, 62,181, 90, 93, 85, 88, 88, 88, 57,105,210, 36,187,109,219,182, 17,222,222,222,184,123,247, 46, 4, 2, 1,
-108,108,108,170,110,223,190,109,109,106,134,172,162,162, 34,111, 30,143, 39, 76, 73, 73,129,135,135, 7,122,246,236,137,229,203,
-151, 35, 63, 63, 31, 20, 69,193,217,217,153, 49, 26,141,113, 6,131, 33,234,105,255,143,234, 90,174, 76, 91,141,229,138, 4,240,
- 51,254, 30, 56,222,168, 21,203,220,130,213, 84,235,213, 19, 20,149, 79,108,102,162,183,183,119,164, 82,169, 54, 9, 83, 95, 0,
- 0, 32, 0, 73, 68, 65, 84, 12,189,117,235,214, 3, 86,172,183,222,122,203,224,229,229,245,135,165, 60, 74,165,178, 88, 36, 18,
- 57,106,181, 90, 92,188,120, 17,190,190,190,194,210,210,210, 21,168, 78,122,141,159,126,250,105, 69,110,110,174,208,205,205, 13,
- 0,224,227,227,131,210,210,210,226,127,160,249,254,166, 69,254, 13, 2,171, 94,179, 92, 93, 23, 97, 67, 34,203,148,144,180, 49,
- 75,139, 70,163,169,181,136,200,229,114, 48, 12,243,128, 59,178,174,192,170,103, 22,161,197,127,236,115,231,206,105,183,110,221,
- 58,162, 86, 12, 89, 0,243, 24,172,111,215, 46, 91,101, 18, 87,215,206,159,197, 79,183, 74, 11,102, 47, 95,187,190,169,141,221,
-209, 73,214,197,197,197,241,127,107, 87,127,161,204,186,124, 10,135,182,174,101,175, 69, 71,247,152, 22, 29, 61,124,218,180,105,
- 14,168,142,183,202, 2,112, 30,213,211,205, 45, 10,248,190,124,249,114,107,211,235, 30, 61,122, 24,149, 74, 37, 20, 10, 5,242,
-243,243,133, 10,133, 66, 18, 25, 25,105,117,172, 67,116,116,180,203, 99,190,215, 58,188,250,234,171, 81, 63,252,240,131,188,164,
-164, 4,233,233,233,248,244,211, 79,241,205, 55,223, 64,169, 84,226,196,137, 19, 54,161,161,161,255,187,125,251,118,111, 60,229,
-228,170, 1, 1, 1,108,116,116, 52,210,211,211, 65, 81, 20, 94,127,253,245, 70, 31, 30,254, 97, 11, 22, 59,107,214, 44,108,219,
-182, 13, 36, 73, 98,236,216,177, 40, 43, 43,171, 61,239,224,224, 80,223, 57, 30, 26,159, 81,250,228, 58, 26, 62,159,141,140,140,
- 92,217,175, 95, 63,220,191,127,127,112,183,110,221,190, 30, 63,126,124,214,163,242,218,219,218, 32,192,207, 19, 58,157, 14, 58,
-157, 14, 45, 91,182, 68,121,121, 57, 82, 83, 83,161,211,233,224,226,108,103, 53, 95, 87,255,246,208,235,245,208,233,116,112,118,
-118, 70,101,101, 37,238,222,189, 11,157, 78,135, 22, 45,236,173,161,107,245,242,203, 47,159,219,183,111,159,227,222,189,123,245,
-195,134, 13, 19, 45, 89,178,132, 80, 42,149,200,205,205, 69, 19,195,123, 34,207,159, 63,239, 17, 18, 18,226,147,152,152,136,168,
-168, 40,232,245,122,116,237,218, 21,201,201,201,232,213,171, 23,202,202,202, 46, 95,185,114,165, 89,204,114,169, 43,172, 98, 98,
- 98, 14, 10,133, 66, 22, 64, 83,173, 77, 0,128,204,204, 76,113,167, 78,157,116, 98,177, 88,116,225,194,133,125,143, 96,189,122,
-252, 79, 63,143, 62, 51,241,161,104,223,190,253, 44,119,119,247,144,192,192, 64, 36, 38, 38, 10,197, 98, 49,222,121,231, 29,195,
- 43,175,188, 98,224,243,249, 22, 79,184,145, 72, 36, 55,109,108,108, 94,208,233,116,208,235,245,136,136,136,128,131,131,195,167,
-161,161,161, 31,168,213,106,100,103,103,139,196, 98,113,173,149, 60, 56, 56, 24, 69, 69, 69, 55,255,129,230,171, 87,139, 60,235,
- 2,171, 94, 49,100,110,193,106,200, 61,104,169,192, 34, 73, 18,122,189, 30, 50,153,172, 86, 96,153,103,138,111, 10,231, 67,109,
-190,241,241, 23,210,210,210,190, 4,112,178, 41,223, 63,188,119,151,202,150,169,106,149,125,249, 36,110, 95,139,193,143,137, 37,
- 5,179,151,175,157,241,218,136,183,115,235, 10, 50,139,158, 60, 90,200, 58,185, 56, 87,139,171,194,155, 23,145,114, 61, 6, 39,
- 47,103,198,234,129,100, 0,159, 63,206,139,106,242,173, 55, 39,136,197,226, 89,166,217,130,105,105,105, 24, 51,102, 76, 73,122,
-122,122,216,235,175,191,254,205,175,191,254,106,111,111,111,143, 51,103,206,216,180,106,213,106, 5,128,167,233,206, 98, 99, 99,
- 99, 81, 88, 88, 61,121,179, 79,159, 62,205, 74, 92, 1, 64,108,108,172, 48, 52, 52,244, 55, 0,253,111,222,188, 9,134, 97, 46,
-196,197,197,245, 49,157,111,232,156, 37,250,173,188,188, 92, 96, 99, 99, 83,239, 96, 37, 20, 10,133, 77,176, 56,212,114,254,249,
-231,159, 95,124,249,229,151, 63,126,252,241,199, 41,143,200, 89,175, 5, 43, 52, 52, 20, 90,157, 17,153,185,165,160, 40, 10, 85,
-250,220, 71,178, 96,133,134,134, 66,163,213,227,158,186, 8, 20, 69,161, 66,107,177,161, 68,246,210, 75, 47,253,122,224,192, 1,
-215, 11, 23, 46, 64,175,215, 51, 49, 49, 49,119,167, 76,153,162,156, 56,113,162, 99,117,149,155,132, 13,111,189,245,214,136, 63,
-255,252,179,200,199,199,199,225,202,149, 43,200,203,203,131,209,104, 68,255,254,253, 33, 22,139, 51, 86,172, 88, 33,132, 5,161,
- 5,255,164,192,186,121,243,166, 73, 88,141,125, 92, 66,200,100,193,250, 47, 97,223,190,125, 89,223,125,247,157,159, 74,165, 90,
-255,206, 59,239, 4,183,108,217,146, 20,137, 68,145,124, 62,255, 3,130, 32, 50,172,104,187,241,246,246,246,169, 60, 30,143,151,
-149,149,133,148,148, 20,240,120, 60,176, 44, 43,210,104, 52,112,113,113, 1,143,199, 51, 89,199,224,238,238, 78, 39, 39, 39,143,
- 7,135,199, 35,176, 76, 88,186,116, 41,182,110,221,138,247,222,123,175,193,207,213,164, 5,168, 59, 16,117,130, 89,174, 12,211,
- 44,194,240,240,240, 7,190,103,114, 5,134,133,133, 61,240,229, 99,199,142,213,231, 34,124,128,243, 97, 72, 75, 75,179, 70, 1,
-215,114,154, 98,176, 70,142, 25,171,222,248,197,162,235, 59,143,255,214, 89,173, 97,213,179,151,175,253,168,174,184,178,148,211,
-215, 69,222, 81,229,228, 16,249,229,234, 47,108, 77,214,176, 3,113, 57,165,160,216,247,172,188, 94,141,214, 93, 32, 16,168,123,
-247,238,221, 10,176,216, 45,104, 81,123, 62,106, 57,117, 58, 29, 46, 93,186, 4, 0,152, 48, 97, 66, 73,122,122,250, 11, 0,110,
-164,167,167,223, 28, 52,104, 80,228,233,211,167,237,107,158,232, 11,159,102, 57,129,234, 25,173,124, 62,223, 20,211, 64, 60,238,
-107,244, 56,202,169, 86,171,223,155, 58,117,234, 86,157, 78,199,175,172,172,124,207,210,115,141,149,243,240,225,195, 41,222,222,
-222,253,240,240, 84, 12, 12,128,139,143,194,185,126,253,122, 0,240,121, 20,206,135, 89,176, 14, 30, 60, 8,154,166,225,238, 98,
- 11,157, 78, 7,243,120, 79, 75, 56,235, 90,176, 14, 29, 58, 4,134, 97,208, 90,229, 0,157, 78,215, 80,236,225, 3,156,142,142,
-142,107,119,237,218,229,126,243,230, 77,100,101,101, 97,221,186,117, 25,249,249,249,175,240,249,124,241,215, 95,127,253,191, 33,
- 67,134,184, 80, 20,165,107,194,189,164, 51, 24, 12,227,123,247,238,189,123,217,178,101,119,124,125,125, 91,245,238,221,219,190,
-168,168, 40, 47, 62, 62, 62,125,235,214,173, 10,138,162,198,227,225,174,167,127,236,127, 4, 0,217,217,217,199, 81,157,190,198,
- 90, 97,213,104, 57,163,163,163, 15,213,112,159,180,144,251, 31,169,251, 99,152,153,216, 96, 57, 39, 76,152,144,137,191,231, 55,
-179,170,156,103,207,158, 77, 31, 61,122,244,210, 78,157, 58,133, 43, 20, 10, 36, 37, 37,213,166, 69, 50, 61,160, 19, 4,129,145,
- 35, 71, 98,218,180,105, 56,115,230,204,210,145, 35, 71,166,255, 3,237,249,223, 16, 88, 52, 77,223, 79, 79, 79, 87,237,218,181,
-139, 71, 16, 4,246,236,217,131,186,129,181,166, 61, 0, 92,186,116,137, 98, 89, 54,181,161, 31,163,105,250,126, 76, 76,140,203,
-247,223,127, 47,144, 74,165, 16,139,197,200,206,206, 6,195, 48, 76,110,110, 46,185,111,223,190, 7,130,117, 47, 94,188, 72, 25,
- 12,134,123, 79,171,113,254, 72,204,248,224,244,137, 31,157,122, 61,247, 66,137,210,193,161, 94,161,114,120,189, 47, 8,191,134,
-173, 88,114, 27,229, 23, 95,174,254,194,206, 36,174, 14,198,229,148,104,117,116,240,173, 2,205,181,199, 93,230, 11, 23, 46,180,
-110,166,247,218,162,126,253,250, 49, 0,156, 0, 44, 64,181,229, 14, 0,110,220,189,123,247, 57,111,111,239,143, 81,189,240,245,
-162,167,105,189, 98, 24,198,220,114,218,108,131, 44,227,226,226,238, 0, 24, 96,237,185,198, 48,114,228,200, 52, 60,250,114, 51,
- 79,156,211,132,162,146, 50,164,222,205,170, 89,202,139, 6,157,145, 99, 22, 63,101, 68, 81,153,117,105,228,138, 75,203,145,122,
- 55, 19, 12,195, 86,243,209, 89,181, 65,238, 20, 69,161,160,164,113,175, 61,159,207,239, 27, 30, 30,254, 10, 73,146,228,165, 75,
-151,116,171, 87,175,190,159,159,159, 63, 20,192,189,154, 24,190, 23,143, 29, 59,182,215,130,148, 12,230,156, 4, 69, 81,166,129,
- 57,209,104, 52,246,154, 51,103,206, 76, 0,125, 1,180, 6,112, 15,213,161, 5, 27,208,140, 50,142, 19, 4, 49,246, 89,228,126,
- 20, 60, 43, 51, 19, 15, 30, 60,184,120,218,180,105,252,160,160,160,207,122,244,232, 65,222,189,123, 23,121,121,121,181, 15,151,
- 47,191,252, 50, 60, 60, 60,152,147, 39, 79, 46, 31, 54,108,216, 98,112,120,124, 2,171,160,160,224,229,177, 99,199,158, 37, 73,
-178,237,195, 22,119, 54,183, 46, 49, 12,147,158,155,155,219, 96, 18,178,130,130,130,151, 23, 45, 90,116,150,207,231,183, 53, 91,
-204, 89, 87, 88, 88, 24, 54,114,228,200, 77, 2,129, 64,108,110,237, 98, 24, 38, 67,173, 86,255,163, 1,197,117,243, 96, 13, 26,
-242, 70,193,163,114,202, 69,240,188,127,233, 4, 82,174,199,226, 96, 92, 78,113,185,158,126, 49,185,160,234,191,166,252,243, 0,
-132, 61,228, 92, 10,128,247,154, 65, 25,137,154,152, 63,130,235, 26,154, 63, 40,138,202, 12,233,255, 34,234,166,101,168,123, 76,
-211,116,166,165,124, 3,130,251, 61,148,199,244,186, 49, 62, 30,143,247,113, 80, 80, 16,239,227,143, 63,206, 61,117,234,212,111,
-197,197,197, 31, 1,168, 50,179, 48, 38,161,225,100,162,245,113, 58, 81, 20,101,190, 6,162, 14,213, 43, 60,172,226,238,132,102,
-137,103, 98,102,226,230,205,155, 23,206,158, 61,123,103,203,150, 45,247,244,237,219,215,199,203,203, 75,105, 99, 99,131,178,178,
-178,242,162,162,162,219, 39, 78,156, 24, 51,110,220,184, 59,220,229,108,158,232,244,172,113,142, 24, 0,150, 77,244,101,217, 68,
- 95,118,196, 0,176,150, 28, 55,198,217,193, 69,222,175,103,107,101,108,231,150, 54, 87,124,156,229,126,255,165,246,228, 56, 57,
-206,255, 32,103,107,145, 72,244, 19,159,207,239,251, 24, 57,157, 68, 34, 81, 11,238, 26,113,156, 79,146,115,196,136, 17,188, 17,
- 35, 70,240,158, 98, 57, 31, 10,150,101,123,176, 44, 59,164,102,111,122, 29, 98,122,175, 57, 10, 32, 62, 56, 60,128, 35,191,129,
-168,235,242,107,236,184, 49, 36,229, 86, 70, 90,251,196,202,129, 3,135,103, 22,247,244,122,253,208,199,204, 89,160,215,235,185,
-150,229,240,100,199,191, 35, 71,232,102, 92,188, 22, 4, 65,252,194,178,108, 40, 0,152, 94,155,191,215,220, 64,114,183, 20, 7,
- 14, 28, 56,112,224,192,129,195,227, 5,129,135,155,249,172,137, 17,106,138,169, 48,129,227,228, 56, 57, 78,142,147,227,228, 56,
- 57,206,255, 28,103, 99,220,127,251, 62,203,178, 67, 26,178, 96, 17, 4,113,226,191, 38,224, 56,159, 55,199,201,113,114,156, 28,
- 39,199,201,113,114,156,143, 4,150,101,135, 84,239,216, 33,230,175,205,246,205, 14, 92, 12, 22, 7, 14, 28, 56,112,224,192,161,
-185, 67, 51,119,238,220,207, 8,130,248, 5, 0,230,206,157,251, 89,115, 47, 48, 39,176, 56,112,224,192,193, 12, 42,149,234, 85,
- 0,139, 81, 29, 66,177, 66,173, 86, 31,226, 90,133,195,191, 9, 78, 78, 78,114, 71, 71,199,223, 72,146,244, 0, 30, 76,185, 84,
-223,250,191, 12,195,168,139,138,138, 6,230,230,230, 22,252,147,156,117,112, 97,197,138, 21, 85, 43, 86,172, 48, 5,180,231, 3,
- 32,106, 92,134,249,255, 10,129, 53,231,165, 54,207,183,116,115,219, 87, 82, 88, 24,167,171, 42,159,184,226,247,236,162, 38,254,
-182,163, 72, 36, 26, 45,151,203, 67, 88,150,245,228,241,120,183, 74, 75, 75, 35,140, 70,227, 1, 0, 21,220, 95,128,195,211, 70,
- 64, 64, 64,103,145, 72,244, 41, 65, 16,207, 81, 20,229, 46, 16, 8,178, 1, 92,214,233,116,171,227,227,227,227,184, 22,250,215,
-128, 84,169, 84, 95,217,217,217, 5,149,148,148,140, 1,240, 89, 82, 82, 82, 23,146, 36,225,231,231,247,153, 74,165, 74,181,177,
-177,217, 94, 94, 94,126, 65,173, 86,127,128, 38, 46,235,195,161,121,193,211,211, 51,134, 36, 73,119,243,229,218,234, 10,130,186,
-123,150,101,239,220,188,121,179,247,195, 56,221,220,220, 60,149, 74,229, 38, 0, 61,234, 19, 21,230,168,201,175,118,165,172,172,
- 44, 44, 43, 43,171,222, 68,188,246,246,246, 54,206,206,206,139, 9,130, 24, 73,146,100,163,233, 19, 24,134,161, 89,150, 61,156,
-151,151,183,168,184,184,184,252,161,131,175,163, 99, 68, 84, 84, 84, 15, 39, 39,167, 70,115,254, 81, 20,133,204,204,204, 22,161,
-161,161, 81,185,185,185,190,255, 36,167, 57, 8,130,208,163,122,237,198,103, 6, 86, 11, 44,130,198, 59, 19, 39,143,117, 43,185,
-159,228,182,235,192,233, 14,159, 13,228,191,184,252,204,189, 28,107, 56, 36, 18,201,104, 47, 47,175, 13, 27, 54,108,112,108,219,
-182, 45, 33,149, 74,161, 86,171,125,175, 94,189,250, 70,120,120,248,162,204,204,204,241, 20, 69,157,125,196,186,217, 57, 40,248,
-159, 22, 85, 80,243,184,174,132,131, 53, 24, 49, 98, 4,239,254,253,251,225, 74,165,242,147, 57,115,230,136,219,181,107, 7,133,
- 66,129,188,188,188,214,201,201,201,173, 54,109,218,244,106,175, 94,189,190, 22, 10,133,243, 35, 35, 35, 41,174,197,158,109,168,
- 84,170,175,162,162,162,222,111,217,178, 37,250,244,233,115,161,107,215,174, 74,153, 76,134, 83,167, 78,193,211,211,211,223,214,
-214,246,242,150, 45, 91, 4,139, 23, 47, 14, 56,122,244, 40,212,106,245, 12,174,213,254, 5,170,154, 36,221,227,226,226,156,101,
- 50, 25,104,154,174, 89, 13,128, 1,203,178,181,123,115, 49, 68,211, 52,130,131,131, 13,141,140,109,223, 92,191,126, 61,196,180,
-194,137,153,144,170, 23,217,217,217, 33,193,193,193,223, 0,168, 55,161,182,179,179,243,226, 81,163, 70,205,242,247,247,175, 93,
-106,142, 97,152,218,125, 65, 65, 1,166, 79,159, 94,251, 27, 12,195, 32, 42, 42,106,230,135, 31,126,136,226,226,226, 15, 27,168,
-187,135,147,147, 19,209,216, 18,120,225,225,225, 8, 15, 15,199,134, 13, 27, 8, 62,159,111,215, 72,123, 62,118,206,103, 29,214,
- 11, 44,176, 39, 79, 30, 57, 52, 49,180,159, 15, 49,110,104,160,247,222,227, 49, 23,231, 12,104,251,194,202,223,238,222,183, 80,
- 92,205,156, 58,117,234, 23, 75,150, 44,145,220,190,125, 27,137,137,137,160, 40, 10, 10,133, 2,157, 59,119, 38, 79,158, 60,169,
-154, 57,115,230,145, 63,254,248, 99,130,193, 96, 56,218,212,138,185,218,243, 86,203,165,188,183, 43, 52,236,101, 3, 77, 31,111,
-142,141,223,179,103,207, 51, 70,163,113,101,124,124,252,185,103,229,134, 9, 12, 12,236, 35, 20, 10, 23,137, 68,162, 65,255, 86,
-113,145,145,145,177,232,249,231,159,255, 36, 60, 60, 92,124,247,238, 93, 36, 37, 37, 65,173, 86,163,109,219,182,104,219,182, 45,
-177, 97,195, 6,201,215, 95,127, 61,227,234,213,171, 36,128,217,214,244,233,174,174,174,147, 6, 12, 24, 48,220,201,201,201, 54,
- 43, 43,171,244,207, 63,255,252, 73,173, 86,127,139,198,215,140,124, 40,167,147,147,211,184,208,208,208,225, 14, 14, 14, 14,106,
-181,186,232,183,223,126,251, 41, 47, 47,111,251, 35, 90, 90, 84, 0,186, 0,112,172, 57, 86,183,105,211,230, 70,122,122,122,222,
- 99,228,204,110,211,166, 77, 98, 83, 56,157,156,156,228,124, 62,255, 16, 65, 16, 45, 27,176, 16,100, 83, 20, 53,170,160,160,160,
-178, 33, 46,165, 82,249,156, 74,165,194,229,203,151,177, 96,193, 2,135,224,224, 96, 36, 39, 39,131, 36, 73,124,242,201, 39,132,
-159,159,159, 32, 39, 39, 7,221,187,119, 71, 68, 68, 68,239,154,229,110, 56, 88,134,195, 0,236, 0,188, 5,192,220, 21,228, 4,
-224, 24,170, 87,120, 24,246,180, 10, 39,149, 74,177,127,255,126, 8, 4, 2, 8,133, 66, 20, 23, 23,195,205,205, 13, 66,161, 16,
- 2,129,160,118, 19, 10,133,104,213,170, 85,163,124, 12,195,244,228,241,120,168,168,168, 0, 77,211,181,203, 44,149,150,150,130,
-101, 89,136, 68,162,218,247, 77,231, 24,134,233,217,128,213,102,100,203,150, 45,113,224,192, 1,212,151, 7, 77,169, 84, 34, 33,
-225,175, 9,119, 60, 30, 15, 1, 1, 1, 36, 65, 16, 35, 1,124,216, 0, 47, 11, 0,147, 39, 79,126, 96,121,186,186,155,105,237,
- 96,150,101,205,151, 16,251,199, 56,255,213, 2,107,110,255,182, 97,254,129, 1,171, 69, 34,129,148,161,141, 96, 40, 35, 24,163,
- 30, 12, 67,225, 78,134, 26,158,206, 34, 76, 24,236,229,177,251, 76,114,194,188,151,218, 7,173, 56,155,146, 84,135,162,238, 84,
-203, 54,254,254,254,139,151, 45, 91, 38,249,237,183,223,112,251,246,109, 44, 95,190, 28, 0, 32,151,203,113,234,212, 41,208, 52,
-141,181,107,215,218, 12, 26, 52,104, 83,118,118,118, 36,128,162, 70, 56,235,131, 71,251,118,170,161, 71,215,188, 32,246,127,227,
-200,250,156, 34,250, 4,128,134, 18,168, 61,137,101,107, 26,229,164, 40,234, 37,129, 64,208,187,107,215,174,175, 90, 40,178,158,
- 74, 57,205,197,149, 64, 32, 56,109, 48, 24,100, 34,145,136,223,128, 40,120,170,229,124, 20,206,128,128,128,206, 74,165,242,147,
- 69,139, 22,137, 47, 93,186,132,226,226, 98,228,229,229,225,131, 15, 62,192,230,205,155,225,239,239, 15,185, 92,142, 25, 51,102,
- 72,166, 79,159, 30,214,189,123,247,195, 49, 49, 49, 49, 22,148,147,236,215,175,223,254, 61,123,246,180,165, 40,138, 4, 0,163,
-209,104,159,145,145, 49,118,222,188,121,253,226,226,226,222,106, 66,123,146,189,123,247,222,179,119,239, 94, 47,145, 72, 68,214,
-116,214, 45,222,125,247,221,137,243,231,207, 15,142,141,141,125,187,129,251,190,161,246,236, 42,147,201, 58,134,133,133, 21, 12,
- 29, 58, 52, 11, 0, 98, 99, 99,137,248,248,248, 62, 99,199,142, 77, 15, 15, 15,143,111, 2,103, 55,153, 76,230,243,254,251,239,
-231,191,242,202, 43,217, 66,161,144,185,116,233, 18, 47, 33, 33,161,239,164, 73,147,210,230,207,159,127,205, 26, 78,129, 64,112,
-240,232,209,163,253,220,220,220,104,160,122, 53, 5,130, 32, 88,130, 32, 88,146, 36, 89,146, 36,145,150,150,214,102,196,136, 17,
-251, 0,188,214, 16,103, 73, 73,201,216,190,125,251, 70, 45, 88,176,192, 1, 0,162,162,162,192,231,243,107, 7,132,219,183,111,
- 67,167,211, 97,195,134, 13,134,242,242,242, 73,255,182,123,254, 9,115,182, 2,208, 19,192,239, 0,250,215,136, 44, 39, 0,231,
- 0,248, 1,248,243,105,149,147, 36, 73,208, 52, 93, 43,162,206,158, 61,139,205,155, 55,227,192,129, 3,112,115,115,123, 64, 96,
- 9, 4, 2, 60,196,229,151, 80, 71,100,152,250,118,208, 52,141,232,232,104,108,223,190, 29,206,206,206,112,114,116,132, 83,139,
- 22, 8, 10, 10,130,201,106, 70,211,116,125,188, 15,112, 22, 20, 20,128, 97, 44,123, 86, 98, 89, 22,101,101,101, 22,183,103, 67,
- 66,200,124,179,230, 26, 61, 34,231,127, 71, 96,169, 92,157,230,143, 24,254,146, 20, 52, 5, 24, 42, 1, 67, 21, 88, 67, 21, 88,
-125, 37, 8,145, 20,172, 81, 11, 57,175, 16,239, 13,112, 81, 30,185,152,123,115, 78,112,235, 33, 43,207,221, 59,221,192,147,226,
-194,173, 91,183,218, 94,191,126, 29, 73, 73, 73, 88,183,110, 29,150, 44, 89, 82,251,228,240,218,107,175,225,194,133, 11,208,235,
-245, 88,176, 96,129,195,156, 57,115,222, 47, 47, 47,183,122,145, 73, 87, 71,254,230, 67,187, 55, 56, 56, 72, 11, 48, 97,232, 21,
-199,111, 14,165,135,149, 86, 26,191,110,142, 23, 96,206,156, 57,178, 85,171, 86,253,108,133,200,122,106,150, 43,177, 88,124,122,
-225,194,133,242,133, 11, 23,210,143,137,211,159,207,231, 31, 52, 26,141, 31,199,199,199,255,218, 4,138,214, 61,122,244, 88,158,
-148,148,116,186,188,188,124,111,221,147, 66,161,240,181,110,221,186,141,185,120,241,226,103, 0, 82, 45, 33, 20,139,197, 51, 63,
-249,228, 19, 73,102,102, 38, 74, 74, 74, 32, 22,139, 31,232,220,196, 98, 49, 72,146,132, 72, 36,194,187,239,190, 43,217,177, 99,
-199, 71, 0,222,108,244,158,116,117,157,180,123,247,238,182, 6,131,129,172,172,172,132, 80, 40,132, 80, 40, 68,231,206,157,121,
-179,103,207,110, 53,107,214,172,169,185,185,185, 27,173,169,188,189,189,253,216, 61,123,246,120,137, 68, 34, 82,173, 86,163, 79,
-159, 62,184,124,249, 50,130,130,130,120,179,103,207,110, 61, 99,198,140, 41,249,249,249,155,173,181, 50,201,100, 50,255,168,168,
-168,251, 45, 91,254,101, 28,106,219,182, 45, 59,120,240,224,162,164,164, 36,159,216,216,216,194,110,221,186,221,183,130,211, 77,
- 38,147,249,254,250,235,175,234, 37, 75,150, 12,216,188,121,243,208, 26, 11,238,241,229,203,151,255, 86, 88, 88,232,119,249,242,
-229,194,160,160,160, 44, 43, 56, 29, 93, 93, 93,169,176,176, 48,155,186, 39, 22, 45, 90,132,197,139, 23, 99,231,206,157,133, 0,
-156, 27,172,108, 77, 64,187,191,191,191,178,127,255,254,136,138,138,194,140, 25, 51,116, 70,163, 49, 25, 0, 66, 66, 66, 58,132,
-135,135,139,226,226,226, 96,111,111, 47, 80,171,213,223,169, 84, 42, 46,240,221,114, 12, 5,240, 63, 0,254, 53, 34,107, 20,128,
- 35, 0, 58, 2, 72, 2, 48,226,105, 22,206, 36,176,178,178,178,176, 99,199, 14, 44, 95,190, 28,222,222,222, 48, 24, 12,224,243,
-249,181,226,138,207,231,131, 32, 8,176, 44, 75, 88,202,123,229,202, 21,236,222,189, 27, 11,230,207,135,141, 77,245,109,106, 48,
- 24, 80, 84, 92, 12,137, 68, 82, 43,194, 26, 17, 76,135, 83, 82, 82,102,185,185,185,213,186, 41,205, 93,132, 0,160, 80, 40,192,
- 48, 12, 40,138,130, 78,167,195,182,109,219, 40,150,101, 15, 55, 98,109,170, 21, 67, 31,126,248, 33,116,186,191,214, 7,239,210,
-165, 75,181, 53,164, 77, 27, 4, 4, 4,212, 30,155, 44, 84,150,112,110,239,211, 25, 26,179, 79,251,132,175, 1, 0,184,187,187,
-195,199,199, 7, 42,149,202, 34,206,127,139,192, 50, 45,112,251,192, 66,183, 57, 57,121, 43,119,110,249,110,141, 72, 64, 10, 66,
-122,251,192, 94, 76,129,144, 57, 64,216,111, 46, 8, 59,143,234, 47, 22,165, 65,255,235, 92,140, 10, 40, 32,119,235,120,199,194,
- 7,121,182, 8, 63,157, 86,111,112, 29, 73,146,207,181,110,221, 26, 81, 81, 81,104,219,182, 45, 22, 46, 92, 8, 95, 95, 95,200,
-100, 50,228,230,230,162,178,178, 18,114,185, 28, 52, 77, 35, 48, 48,144,103, 99, 99, 19,220, 4,129, 21,248, 74,255,110, 61,249,
- 74, 95,244, 25,212, 11,103, 54,245,147,239,252, 37,123, 94,105,165,241, 59,152, 45,184,218, 92,240,250,235,175, 35, 55, 55, 87,
-182,103,207,158, 38,139,172,158, 61,123,158,161, 40,234, 37, 11,204,225,231,206,159, 63,223,191,169,226,106,199,142, 29,114, 59,
- 59, 59, 52, 22,188,105,133,184, 58, 63,118,236, 88,229,158, 61,123,126,236,218,181,235, 27, 86,138,172,214,163, 70,141, 58,177,
-125,251,118,223, 33, 67,134, 40,162,162,162,254, 38,176,252,253,253, 95, 63,115,230,204, 27,211,166, 77,243,223,187,119,239,171,
-168, 94, 84,186, 49, 51,119,239,118,237,218,225,222,189,123,200,205,205,133, 78,167, 67,110,110, 46, 0, 32, 51, 51, 19,238,238,
-238,176,183,183,135,187,187, 59, 58,116,232, 64,144, 36, 25,100, 73, 97,131,131,131,135, 2, 32,211,210,210,144,159,159, 15, 91,
- 91, 91,200,229,114,184,185,185,161,127,255,254,124, 47, 47,175, 87,172, 21, 88,131, 7, 15, 30, 46,147,201,200,140,140, 12,164,
-167,167, 67,167,211, 33, 57, 57, 25,182,182,182, 8, 9, 9, 17,120,121,121,133, 54, 65, 96,117,154, 50,101, 74,158,185,184, 50,
- 65, 46,151, 19, 62, 62, 62, 69,118,118,118,221, 1, 88, 35,176, 58,205,152, 49, 35,119,197,138, 21, 47, 68, 68, 68,204, 49,189,
- 25, 17, 17,241, 41, 0,108,220,184, 49,202,193,193,161, 59, 0,107, 4, 22, 88,150,101, 38, 78,156,152, 34, 18,137, 96,218, 76,
-194,117,205,154, 53, 32, 73,210,214, 2,154,207,146,146,146,186, 40, 20, 10, 36, 37, 37,129,199,227,129, 32,136, 20,181, 90,221,
- 5, 0,156,157,157, 83,181, 90,173,167, 86,171,197,136, 17, 35,136, 33, 67,134,116, 94,183,110,221,124, 0,205, 69, 96,245, 0,
-176, 22,128, 30,192,124, 0,151,155, 89, 23,151, 11,224, 69, 51,145, 21, 15, 64, 92, 35,174, 94,172, 57,255, 84, 64, 16, 4, 24,
-134, 1,159,207,199,154, 53,107, 96, 48, 24,176,119,239, 94, 28, 57,114, 4, 36, 73,130, 32, 8, 16, 4, 1,165, 82,137,175,190,
-250,170,246,216, 18, 80, 20,133,239,191,255, 30,115,231,204,169, 21, 87, 53, 15,125,112,117,113,129,163,147, 19,210,210,210, 26,
- 21, 88,121,121,121,139,162,163,163,209, 80,144,251,176, 97,127,121, 88,205,131,220, 45, 41, 39,143,199,131, 78,167,195, 75, 47,
-253, 53,124,188,255,254,251,181,175,139,139,139, 77,255, 9, 16, 22, 86,158,199,227, 65,195, 2,175, 75,254,122,239,149,143, 63,
-126,192, 34,215, 0,103,189, 90,228, 95,105,193, 18,245,205,216,120,247, 2, 25, 48, 50,180,215, 56, 7,165, 20, 76,121, 54,132,
- 3,194,113,189, 72,134,245, 91,170,199,194, 89, 35, 2,209,233,165,101,208,125, 55, 16,253,219,232, 69,223,197, 73,103, 3, 88,
- 88, 31,159,147,147,147, 19, 69, 81, 32, 73, 18,114,185, 28, 14, 14, 14,144, 74,165, 40, 40, 40,192,204,153, 51,113,250,244,105,
-232,245,122, 8,133, 66,180,107,215, 14, 6,131,193,211,106,235,149, 61,127,251,186, 53,203,237, 10,211,246, 33,246,118, 9,100,
-182,238,152, 63,165,187,125,248,166,152, 69,249,197, 85,159, 54,199,139,224,231,231,135, 15, 62,248, 64,246,245,215, 95, 55, 73,
-100, 81, 20,181,148,207,231,247,249,248,227,143,165, 35, 70,252,253,129, 48, 49, 49, 17, 83,167, 78,213, 84, 85, 85,125,222, 20,
-113, 37, 18,137, 78,111,223,190, 93,110,107,107,139,123,247,238, 61, 54,113,181, 97,195, 6,165,167,167, 39, 4, 2,129,228,251,
-239,191,183, 70,100,117, 24, 54,108,216,201,237,219,183,123, 76,153, 50, 37, 51, 42, 42, 42, 29,213,211,234, 31, 64, 92, 92, 92,
-241,184,113,227, 50,118,238,220,233,197, 48,204,175,251,247,239, 15, 5,112,179,145,182,108, 45,147,201, 80, 80, 80,128, 89,179,
-102, 61, 16,160,106,114,103, 3, 64, 82, 82, 18,220,221,221,161,213,106,221, 44,169,179,131,131,131, 61,203,178,152, 60,121, 50,
-238,223,255, 75,155,184,185,185,225,254,253,251,160, 40,202,193,218,118,180,183,183,119, 48, 26,141,232,215,175, 31,180, 90, 45,
- 0, 96,212,168, 81, 16, 8, 4,200,203,203,131,193, 96,112,108,194,229,113, 26, 50,100, 72,246,195, 78,202,229,114,163,189,189,
-125, 27, 43, 57, 29, 67, 67, 67,179,182,110,221, 90,215, 85,135,232,232,232,215,108,109,109, 35, 28, 28, 28,124,154, 80, 86, 70,
- 44, 22, 67, 44, 22, 67, 32, 16, 64, 36, 18, 65, 44, 22, 67, 36, 18, 65, 32, 16,128,199,227, 89,228, 87, 97, 24, 6, 39, 78,156,
- 0, 73,146, 15,184, 46, 22, 44, 88,240,158, 76, 38,115,137,140,140,172,125, 0,172,168,168, 64,251,246,237,219,181,107,215,238,
-106, 78, 78, 78,250,205,155, 55,223,120,202,221,199,106, 0,166, 89,109,155, 1, 4, 52,195, 46, 46, 23,192, 72, 0, 49, 53,226,
- 74, 15, 96,248,211, 20, 87,230,215,158,207,231,215,254,207, 37, 18, 9, 2, 3, 3,107,197, 20, 65, 16,168,170,170,170,117, 17,
- 90,106,193, 42, 45, 45,133, 74,165,130,141,141, 13,218,123,123, 35, 37, 57, 25, 0,106, 95,139, 68,162, 90, 33,214, 16,138,139,
-139,203,107,130,213, 63,124,204,226,146, 5, 0, 62,191,225, 48,108,149, 74, 5,134, 97, 76,194,146,125, 28,156, 78, 78, 78,168,
-168,168,176,136,243,223, 34,176,254,166, 24,195,195, 65,234, 46,180,221, 49,242,149,158,227, 58,186,203,161, 43, 72,131, 72,225,
- 8,194,174, 13,214,111,249, 21, 55,211,171, 67,163,214, 31,137,195,206,121, 47,131,144, 57, 64,165,185, 13, 27,137,248,141,135,
- 9,172,194,194,194, 10,131,193,224, 32,149, 74,193,231,243, 33, 20, 10, 81, 80, 80,128,255,251,191,255,195,161, 67,135,208,166,
- 77, 27, 80, 20, 5,145, 72,132,252,252,124, 8,133, 66,171,102, 39,242,120, 24, 18, 54,238,165,182,114, 71,111, 20,198, 45,169,
-126, 83, 25,136, 41,163,120,162, 47,119,223, 24,155, 95, 92,245, 37,170,131, 42,155, 21, 20, 10, 5, 2, 2, 2,240,246,219,111,
-203,246,238,221,187, 11,128,187, 53,223,143,139,139,251, 51, 48, 48,112,224,218,181,107,207,168,213,106,105,215,174, 93,161, 80,
- 40,160, 80, 40,144,150,150,134, 37, 75,150,104,117, 58, 93,104, 83,172, 99,124, 62,255,251,137, 19, 39,202,149, 74, 37,210,210,
-210,224,224,224,240, 72,117, 13, 12, 12,244, 23, 8, 4,231, 55,108,216,160,244,242,242,194,173, 91,183,208,173, 91, 55,184,186,
-186, 74, 86,172, 88, 97,169,200,250,102,223,190,125,109, 68, 34, 17,177,127,255,254,214,251,247,239,159,217,216,239,238,222,189,
-187,205,254,253,251, 55, 0, 8, 65, 3,193,223, 66,161, 48, 51, 63, 63,223,171, 85,171, 86,216,177, 99, 7, 72,146, 68,118,118,
- 54,230,207,159,143, 21, 43, 86, 32, 40, 40, 8, 54, 54, 54,104,213,170, 21, 82, 82, 82, 32,145, 72, 44,138,120,206,202,202, 42,
- 2,224,124,250,244,105,228,231,255,149,178,197,195,195, 3, 69, 69, 69,208,233,116,133,214,182,101, 86, 86, 86, 33, 0,151,171,
- 87,175, 34, 61, 61, 29,131, 6, 13,194,177, 99,199,208,189,123,119,208, 52, 13,163,209, 88,216,132, 75, 68,243,120, 60,182,129,
- 78,148, 0, 96,111, 37, 39,213, 16,103, 77,191, 99, 45, 39, 88,150,101, 31, 38,174, 68, 34, 17, 26,249,205, 90,221,236,235,235,
-187,184, 93,187,118, 29,231,207,159, 47,224,243,249,232,219,183,111,135,225,195,135,103,144, 36,233, 56,119,238, 92, 89,125,198,
- 96, 0, 93, 58,118,236, 40,111, 6,221,135,185,149,174,185, 78, 58,113,174,177,248,137, 0, 24,106,246, 7,240, 87, 76,214, 83,
-181, 96, 9,133, 66,132,135,135, 99,218,180,105,112,113,113,193,156, 57,115,192,231,243,107, 55,147, 85,198,100,213,178,240,222,
-132,139,179,115,195,127,180,154, 32,247, 70, 30,162,158, 72,154, 6,147, 24,178, 36, 22,202,204,218,100,145,104,123, 68,206,127,
-141,245,202, 92, 96, 61, 96,150,171, 21, 87,131,186,141,243,117,151, 34, 62, 46, 1,157, 92,141, 96, 5,130, 6,238, 22, 35, 8,
-161, 28,118, 82,190,123, 3, 23, 32, 46, 61, 61,221,195,206,206, 14, 6,131, 1, 34,145, 8,157, 58,117,194,197,139, 23,161,211,
-233,160,215,235, 33, 22,139, 33, 20, 10,113,227,198, 13, 24, 12,134, 40,107,244,149,147,146,183,225,211,207,150,216, 32,107, 7,
-236,108, 68, 8,126,206, 11,144,119, 4,175,242, 54,214, 46, 8,117,120,111,254,177,245,185, 5,101,111, 54,183,139,160, 80, 40,
-144,145,145,129,253,251,247, 87,233,116,186,177, 77,225, 48,137,172, 67,135, 14,157,177,179,179,147, 6, 5, 5, 33, 57, 57, 25,
-159,127,254,185, 86,167,211, 13,105,106,124, 23, 69, 81,227,183,109,219,118,154,162, 40,185, 73, 92, 60,170,229,106,230,204,153,
- 54,237,219,183, 71,106,106, 42,108,109,109, 97, 99, 99,131,182,109,219, 66,165, 82, 73,102,206,156,105,137,200,154,254,246,219,
-111,159,220,185,115,167,199,148, 41, 83, 50, 15, 28, 56,112, 28, 64,105,125, 77, 59,108,216,176,215,118,238,220,233,241,222,123,
-239,221, 3, 48, 19,141,204,172, 99, 24,230, 66,106,106,170,167,175,175, 47,209,161, 67, 7,136, 68, 34,184,185, 85, 27,169,186,
-116,233, 2, 95, 95, 95, 8,133, 66, 0, 64,106,106, 42, 96, 97, 94,150, 63,254,248,227,167,164,164,164, 73,221,187,119,231,185,
-186,186, 62, 48, 59,105,197,138, 21,134,140,140, 12,171,215,209,250,253,247,223,143, 37, 36, 36, 76,238,219,183, 47,223,222,222,
- 30, 98,177, 24,157, 58,117,130, 74,165,194,231,159,127,110,184,123,247,110, 83,214,230,186,119,245,234, 85,137,183,183, 55,253,
-144,123,213,166, 9,150,135,204,216,216, 88,225,115,207, 61,119,252,212,169, 83,254,230, 39,122,246,236,121, 92,161, 80,216, 2,
-104,202,212, 60,198,220, 53,104,238, 42, 20,137, 68,224,243,249,141, 90,176,212,106,245,207, 46, 46, 46,119, 92, 92, 92,254,236,
-221,187,183,109, 76, 76, 12, 22, 46, 92, 40,212,233,116,173, 35, 34, 34,106, 7,226,250, 6,208,202,202, 74, 73, 51,232, 62,102,
- 1, 88, 7, 64, 6, 96, 78, 51, 28, 99, 92, 80, 29,208,238,131,106,183,224,168, 26,177,101,138,201,122,170, 34,139, 97, 24, 8,
- 4, 2,248,248,248,224,195, 15, 63,196,202,149, 43, 17, 22, 22,134,246,237,219,215, 94,123, 83, 12, 86,205,140, 55,139, 6,126,
-161, 80, 8, 23, 87, 87, 24,141,198, 90,235, 21, 0,164, 36, 39,131,207,231,131, 97, 24,232,116,186, 70, 93,132,206,206,206,139,
- 87,173, 90, 53,115,240,224,193,164,249,140, 59,150,101,107,211, 73,152,111, 70,163, 17, 63,255,252,243,204, 21, 43, 86, 52,152,
-166,193, 92,232,116,233,210,229, 1,183,224,198,141, 27,205,251,108,132,132,132, 88, 53,219,143,199,227,193, 39,124,205, 3,110,
-193,147, 45,254,106,182, 86,239, 78, 65,251,207, 55, 60,140,243, 95,229, 34,172,183,134,134,139, 30,203, 70,188, 28, 48,206,215,
- 77,140,171,113, 55,240, 75,180,250,118, 65, 65, 9,152,220, 4, 48,249,183, 48,107, 68, 32, 58,182,113, 64,199, 54, 14,152, 53,
- 34, 16, 76,222, 13,176,197,105, 96, 37,246,200,171, 36, 30,234, 94, 40, 42, 42, 90,189,116,233,210, 98,123,123,123, 72, 36, 18,
-136, 68, 34,100,102,102,194,207,207,175,246,184,230,201, 19, 11, 23, 46,204,207,207,207,223, 98,105, 69,228, 82,114,202,202,249,
-111,186, 8,197, 54, 64, 81, 20,148, 74, 5,118,108, 89, 3,232,178, 1, 82,132, 87, 67, 2,120, 42, 23,187,254, 0, 58, 52,183,
-139,112,239,222, 61,132,135,135, 87,105, 52,154, 71, 10,116,143,139,139,251,211, 96, 48, 12,220,178,101,139,230,151, 95,126,121,
-100,113,101,226, 52, 26,141,131,118,237,218, 85,121,239,222, 61, 40, 20,138, 38,215, 83, 40, 20,206,165, 40, 74,185,110,221, 58,
-230,165,151, 94,162,167, 79,159, 78,143, 31, 63,158, 30, 54,108, 24, 29, 18, 18, 66, 79,157, 58,149,214,233,116, 98,153, 76,182,
-170, 17,170,164,163, 71,143, 6, 79,154, 52,233,214,183,223,126,235,254,194, 11, 47,180, 1,176,168,238, 22, 24, 24,104,191,115,
-231, 78,143,105,211,166,165,238,223,191,255,101, 52,226, 30, 4, 0,157, 78,183,113,243,230,205, 90,146, 36,161, 80, 40, 32, 18,
-137,208,162, 69,139, 90, 33,108, 26,200, 13, 6, 3, 54,109,218,164,209,104, 52,235, 45,169,123, 97, 97,225,142,217,179,103,223,
- 61,115,230,140,209, 52,203, 39, 59, 59, 27,159,127,254,185, 97,203,150, 45, 89, 37, 37, 37,223, 90,219,158,101,101,101,223,127,
-250,233,167,233, 39, 78,156, 48,146, 36,137,226,226, 98,216,217,217,225,243,207, 63, 55,124,251,237,183, 89,229,229,229, 86,115,
-246,234,213, 43, 53, 43, 43,203, 70,167,211,253,205,250, 35, 16, 8, 8,137, 68, 98,154, 17,102, 49,186,119,239,158,154,158,158,
-174, 92,182,108, 89,100, 72, 72,200, 74, 27, 27,155,100, 27, 27,155,228,144,144,144, 85,155, 54,109, 58, 87,195, 25, 97,117,231,
- 69,146,181, 2,203,228, 42, 52, 89,177,106, 44, 89, 22,185, 8,125,125,125,247,237,222,189,219, 54, 57, 57, 25,101,101,101,136,
-143,143, 71, 92, 92, 92,173, 43,215, 52,152,153,111, 0, 80, 85, 85, 37,109, 6,221,199,255, 80,157,250,194,171, 70,200, 52, 55,
- 28, 49, 19, 87, 47,162,122,230,217,139, 53,199,254, 0,126,122,154, 22, 44,150,101,107, 31,118,222,124,243, 77, 68, 68, 68,160,
-125,251,246,181,162,202,124, 22,161, 53, 34,131,166,105,116,234,212, 9, 58,189,254, 1,129,206,231,243,209,162, 69, 11,164,166,
-166,130,162,168, 70, 45, 88, 4, 65,140, 28, 60,120, 48,153,152,152, 8, 95, 95, 95,196,197,197, 33, 46, 46, 14,241,241,241,184,
-122,245, 42,174, 95,191,142, 27, 55,110,224,230,205,155,232,214,173, 27, 50, 50, 50,240,242,203, 47,155,210, 52, 52,104,100,179,
-198,218,100,161,245,238, 73,112,254, 43, 44, 88,132,249,222,197, 94, 62,190,163,138,143,171, 87,111,226,120,108,209, 78,130, 32,
-143,198,221,213,253,242,114,187,114, 24, 14,189,133, 78, 35,247, 96,231,188,151,171,159, 0,242,110,192,112,248, 29, 16, 50, 39,
-164,148,201,161,209,151, 52,244,212, 28, 29, 19, 19,115,112,247,238,221, 19,199,141, 27, 39, 98, 24, 6, 82,169, 20, 31,125,244,
- 81,109,142, 16, 30,143,135,176,176,176,138,188,188,188,117,176,112,230, 23, 0,169,173, 92,176, 96,204,228,133, 18,220,223, 10,
-144, 66, 20,160, 43,186,188, 79, 84, 69,169, 0, 0, 6,157, 73, 68, 65, 84, 48, 17,121,233, 23,129,202,155, 0, 33,196,150, 47,
- 38, 57,189, 54,254,203,111,115,242, 75,158,111, 46, 23,224,214,173, 91, 88,180,104,209, 35,139,171,186,150,172,227,199,143,239,
-210,233,116,147, 31, 35,231,160,149, 43, 87,158,118,118,118,110,178, 91,196,205,205,237,221,130,130,130,137,150, 24,206, 44,209,
-165,135, 14, 29, 26,146,158,158,190, 60, 41, 41,169,222,153,171, 55,110,220, 56, 54,112,224, 64,153, 53,179, 8,227,227,227,227,
-130,130,130, 54,175, 91,183, 46,236,131, 15, 62,144, 72,165, 82, 40,149, 74, 36, 37, 37,161,117,235,214, 0, 0,141, 70,131,121,
-243,230,105,140, 70,227,206,152,152,152,139,150, 62, 44, 39, 36, 36,140,153, 58,117,234,164, 14, 29, 58,188,198, 48,140,163, 94,
-175, 47,204,200,200, 56, 81, 35,132,154,226,222, 97, 18, 19, 19,223,158, 54,109,218, 56,111,111,239,225, 6,131,193,145,162,168,
-194,251,247,239, 31, 47, 43, 43,219,209, 20,206,139, 23, 47,230,143, 31, 63, 62, 45, 39, 39,199, 79,165, 82,149,218,218,218,234,
-245,122, 61, 79,161, 80,216,136, 68,162,110, 0, 46, 18, 4,113,211, 26,206,152,152,152,220, 9, 19, 38,164,235,116,186, 14,219,
-182,109,139,146,203,229,191, 17, 4, 65, 8,133, 66,123,185, 92, 30, 12, 32,146, 32,136, 20,107,203, 74,146, 36, 99, 46,168,204,
-173, 88, 66,161, 16, 4, 65, 88, 36,176, 82, 83, 83,255, 92,186,116,105,231,118,237,218, 97,203,150, 45, 69, 10,133,194,102,248,
-240,225,252,210,210, 82,162, 33, 11,150, 70,163,145,128, 67,163,207, 22, 53, 86,222,161,102,150, 79, 83,224,251, 17, 0, 37, 79,
-179,112, 44,203, 62, 32,164, 90,183,110,253,128,168, 50, 63,103,141,192,162, 40, 10, 66,161, 16,124, 62, 31,174, 42, 85,173,152,
- 99, 89, 22,201, 41, 41, 40, 46, 46,174, 77,211,208,200, 61,206, 35, 8, 2,163, 71,143,182,232,119,223,124,243, 77, 68, 70, 70,
-162, 49,119,162,249,140,191, 54,109,218, 52, 42,134,106,202, 98,241, 44, 66,119,119,247,166,114, 18,117,246,255, 10,129,245, 0,
-178,139,170,150,109,255, 49,126, 94,118, 25,117, 84,220, 59,227,195,240,112,176,243, 6,180, 57,227, 46, 23, 13,236, 72,102, 65,
-247,109, 95, 16,202,234,193,134,173,200, 6, 33,119, 69,177,160, 53,126,142,203,201, 33, 5,188, 6,173, 15, 37, 37, 37,179,190,
-250,234, 43,222,233,211,167, 71, 46, 95,190,220,206,199,199, 7, 99,198,140,129, 94,175,199,245,235,215, 49,117,234,212,162,252,
-252,252,173, 37, 37, 37, 43, 45,173,132,147,146,255,127,235, 63, 27,232, 72, 50, 21, 64, 89, 44,192,183,133,147,131, 13,174,197,
- 68, 1,165, 49, 0, 41, 4, 72, 17,186,119,245, 69, 23,127, 47,223,156,223,175,244, 5,112,190, 57, 92,128,247,222,123,239,177,
-137, 43,115, 65, 4,160,221,227, 44,167, 73,100,125,252,241,199,167, 25,134,145, 53,233, 81,246,200, 17, 26, 13,231, 35,179,218,
-248,119,229,202,149,183, 31,118,210, 96, 48, 28,191,120,241,162,213, 73,102,141, 70,227,188,196,196, 68,188,255,254,251,211,222,
-121,231, 29,169,143,143, 15, 60, 60, 60,144,156,156,140,164,164, 36,108,222,188, 89,203, 48,204,142,146,146,146, 79,172,164,166,
-203,202,202,182, 70, 71, 71,111,125,140,109,192,148,150,150,126, 23, 29, 29,253,221,227, 34,156, 60,121,114, 66,114,114,114,145,
-155,155, 91, 16,143,199,235,140,234, 68,145,106, 0,223, 53, 69, 8, 1,192,180,105,211,174,166,166,166, 22,184,186,186, 6, 9,
-133, 66,175, 26,206, 44, 0, 59,154,200, 89,120,237,218, 53,175,158, 61,123, 50, 60, 30,143, 21, 8, 4,108,205, 96,200,242,249,
-124,150, 32, 8,246,215, 95,127,149,192,130,152,203,204,204,204,153, 59,119,238,100, 21, 10, 69, 80, 69, 69,197, 24, 0,187, 52,
- 26, 77,207,146,146,146,218, 65,184, 62,104,181, 90, 49,167,159, 26,197,235, 15,121, 63, 23, 64,223,230, 80,192,165, 75,151, 98,
-235,214,173,104, 44, 3,249,241,227,199, 27, 29,248, 77,247,138, 41,190, 74,175,215, 35, 49, 49, 17, 4, 65,212, 30,155, 39, 25,
-165,105,186,193, 76,239, 12,195,208,122,189, 30, 7, 15, 30,180, 72,100,237,223,191, 31, 90,173, 22, 12,195, 88,212,207,214, 36,
- 38, 69,113,113,113,109,234,132,192,192, 64,243, 62,212,234,246,228,241,120,240,241,241, 65, 65, 65, 1,156,156,156, 0, 84,187,
- 5,107,197,103,101,229,127,230,230,183, 88, 37,134,247,243,176,213,242,201, 31, 3,220,152, 23,187,123,136,225,100, 39, 1, 79,
- 32, 70,153,150, 64, 98,182, 22,231,111,150,221,167, 41, 54,116,249,239,233,150, 38,136,123, 78,165, 82,125, 70,211,180, 63, 73,
-146, 50,150,101, 43,120, 60, 94,124,118,118,246, 98, 0, 55,172,169,132,173,130, 76,177,151,243,108, 5, 34, 17, 75, 83, 12, 0,
- 18, 32, 73,128, 32, 1,240,106,246,213,199, 26,141, 65, 72, 51,196,209,188,130,194, 73, 79,187,241,159,127,254,249, 51,149,149,
-149,207, 92, 38,119,169, 84,186,136,199,227, 13,250,183, 47, 19,211,189,123,247,238, 82,169,244, 51,134, 97,122,104,181, 90, 87,
-169, 84,154, 75, 16, 68, 76,121,121,249, 23, 87,175, 94,189,196,141,157, 79, 15,143, 51,147,123, 93,152,114, 99, 57, 57, 57,121,
- 95,187,118, 77, 98,110,193, 50, 31, 12,107,222, 39,184,171,241,108,194,215,215,247,242,190,125,251,186,183,110,221,154, 52, 5,
- 92,147, 36, 89,187,153,220, 88, 38,107,203,165, 75,151,168,233,211,167, 95,188,118,237,218, 11, 15,227,244,242,242, 58, 19, 17,
- 17,241,146,185,133,202, 36,164,234,190,166,105, 26, 85, 85, 85, 88,180,104,209,217,212,212,212,122,151,202,241,241,241, 89,183,
- 96,193,130,153,175,188,242, 10, 73,146,228,223, 98,174,234,198, 97, 25, 12, 6, 28, 61,122,148,249,254,251,239, 55,220,190,125,
-251,161, 49, 88, 1, 1, 1,247,227,227,227,221, 77, 41, 19,234,110,117,103,212, 2,192,115,207, 61,167,142,142,142,110,249, 79,
-114,254,103, 4,150,233,243,115,250,123,140, 34, 64,142, 36, 9,166, 19, 8, 66,196,176, 72, 34,128, 51, 34,137,126, 83,248, 47,
-106, 77,157,207,119,194,227,207,200,203,113,114,156, 79,131,147,132,101, 75,207,112,237,249, 47,225,244,242,242, 74, 73, 73, 73,
-241,122,104,103,248,160,192,226,218,243, 25,227,116,114,114,146,183,104,209,226, 55,146, 36, 61, 30,182,184,179,185,184,102, 24,
- 38, 61, 55, 55,119, 64, 94, 94, 94,213,195, 56,221,220,220, 60, 37, 18,201, 55, 12,195,244,180,100,177,103,146, 36,163,181, 90,
-237,244, 58,139, 61,215,114, 62,198, 89,132, 15,148,211,207,207, 47, 53, 58, 58,218, 83, 42,149, 62, 16, 87, 88,183,206, 38,220,
-189,123, 23,195,135, 15,207,184,118,237, 90,155, 39,204,249,175,130,181,107, 17,178, 43,127,207, 56, 8,224, 32,247,252,195,225,
- 63, 6,134,107,130,255, 22, 52, 26, 77,113,139, 22, 45, 42,180, 90,173, 64,167,211, 9, 40,138,122, 96,128,147, 74,165,249, 26,
-141,134,107,168,103, 20, 5, 5, 5,149, 5, 5, 5, 65,143,147,179, 70, 40, 13,124, 92,124, 79, 42, 15, 86,113,113,113,104,143,
- 30, 61,126,229,243,249,226,186,226,167, 62, 49, 68,211,180,182,176,176,112,208, 63,205,249, 95, 19, 88, 28, 56,112,224,240,159,
- 64,118,118,118, 80, 35, 2,140,107, 36, 14,207, 36,212,106,117,146, 90,173,246,104,238,156,207, 58, 72,174, 9, 56,112,224,192,
-129, 3, 7, 14, 28, 56,129,197,129, 3, 7, 14, 28, 56,112,224,192, 9, 44, 14, 28, 56,112,224,192,129, 3, 7, 78, 96,113,224,
-192,129, 3, 7, 14, 28, 56,112,104, 50,254, 31, 88,120,209,239, 80, 73, 49,190, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
+137, 80, 78, 71, 13, 10, 26, 10, 0, 0,
+ 0, 13, 73, 72, 68, 82, 0, 0, 2, 88, 0, 0, 2,128, 8, 6, 0, 0, 0, 64, 11, 6,158, 0, 0, 0, 9,112, 72, 89,115, 0,
+ 0, 13,215, 0, 0, 13,215, 1, 66, 40,155,120, 0, 0, 10, 79,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67,
+ 67, 32,112,114,111,102,105,108,101, 0, 0,120,218,157, 83,103, 84, 83,233, 22, 61,247,222,244, 66, 75,136,128,148, 75,111, 82,
+ 21, 8, 32, 82, 66,139,128, 20,145, 38, 42, 33, 9, 16, 74,136, 33,161,217, 21, 81,193, 17, 69, 69, 4, 27,200,160,136, 3,142,
+142,128,140, 21, 81, 44, 12,138, 10,216, 7,228, 33,162,142,131,163,136,138,202,251,225,123,163,107,214,188,247,230,205,254,181,
+215, 62,231,172,243,157,179,207, 7,192, 8, 12,150, 72, 51, 81, 53,128, 12,169, 66, 30, 17,224,131,199,196,198,225,228, 46, 64,
+129, 10, 36,112, 0, 16, 8,179,100, 33,115,253, 35, 1, 0,248,126, 60, 60, 43, 34,192, 7,190, 0, 1,120,211, 11, 8, 0,192,
+ 77,155,192, 48, 28,135,255, 15,234, 66,153, 92, 1,128,132, 1,192,116,145, 56, 75, 8,128, 20, 0, 64,122,142, 66,166, 0, 64,
+ 70, 1,128,157,152, 38, 83, 0,160, 4, 0, 96,203, 99, 98,227, 0, 80, 45, 0, 96, 39,127,230,211, 0,128,157,248,153,123, 1,
+ 0, 91,148, 33, 21, 1,160,145, 0, 32, 19,101,136, 68, 0,104, 59, 0,172,207, 86,138, 69, 0, 88, 48, 0, 20,102, 75,196, 57,
+ 0,216, 45, 0, 48, 73, 87,102, 72, 0,176,183, 0,192,206, 16, 11,178, 0, 8, 12, 0, 48, 81,136,133, 41, 0, 4,123, 0, 96,
+200, 35, 35,120, 0,132,153, 0, 20, 70,242, 87, 60,241, 43,174, 16,231, 42, 0, 0,120,153,178, 60,185, 36, 57, 69,129, 91, 8,
+ 45,113, 7, 87, 87, 46, 30, 40,206, 73, 23, 43, 20, 54, 97, 2, 97,154, 64, 46,194,121,153, 25, 50,129, 52, 15,224,243,204, 0,
+ 0,160,145, 21, 17,224,131,243,253,120,206, 14,174,206,206, 54,142,182, 14, 95, 45,234,191, 6,255, 34, 98, 98,227,254,229,207,
+171,112, 64, 0, 0,225,116,126,209,254, 44, 47,179, 26,128, 59, 6,128,109,254,162, 37,238, 4,104, 94, 11,160,117,247,139,102,
+178, 15, 64,181, 0,160,233,218, 87,243,112,248,126, 60, 60, 69,161,144,185,217,217,229,228,228,216, 74,196, 66, 91, 97,202, 87,
+125,254,103,194, 95,192, 87,253,108,249,126, 60,252,247,245,224,190,226, 36,129, 50, 93,129, 71, 4,248,224,194,204,244, 76,165,
+ 28,207,146, 9,132, 98,220,230,143, 71,252,183, 11,255,252, 29,211, 34,196, 73, 98,185, 88, 42, 20,227, 81, 18,113,142, 68,154,
+140,243, 50,165, 34,137, 66,146, 41,197, 37,210,255,100,226,223, 44,251, 3, 62,223, 53, 0,176,106, 62, 1,123,145, 45,168, 93,
+ 99, 3,246, 75, 39, 16, 88,116,192,226,247, 0, 0,242,187,111,193,212, 40, 8, 3,128,104,131,225,207,119,255,239, 63,253, 71,
+160, 37, 0,128,102, 73,146,113, 0, 0, 94, 68, 36, 46, 84,202,179, 63,199, 8, 0, 0, 68,160,129, 42,176, 65, 27,244,193, 24,
+ 44,192, 6, 28,193, 5,220,193, 11,252, 96, 54,132, 66, 36,196,194, 66, 16, 66, 10,100,128, 28,114, 96, 41,172,130, 66, 40,134,
+205,176, 29, 42, 96, 47,212, 64, 29, 52,192, 81,104,134,147,112, 14, 46,194, 85,184, 14, 61,112, 15,250, 97, 8,158,193, 40,188,
+129, 9, 4, 65,200, 8, 19, 97, 33,218,136, 1, 98,138, 88, 35,142, 8, 23,153,133,248, 33,193, 72, 4, 18,139, 36, 32,201,136,
+ 20, 81, 34, 75,145, 53, 72, 49, 82,138, 84, 32, 85, 72, 29,242, 61,114, 2, 57,135, 92, 70,186,145, 59,200, 0, 50,130,252,134,
+188, 71, 49,148,129,178, 81, 61,212, 12,181, 67,185,168, 55, 26,132, 70,162, 11,208,100,116, 49,154,143, 22,160,155,208,114,180,
+ 26, 61,140, 54,161,231,208,171,104, 15,218,143, 62, 67,199, 48,192,232, 24, 7, 51,196,108, 48, 46,198,195, 66,177, 56, 44, 9,
+147, 99,203,177, 34,172, 12,171,198, 26,176, 86,172, 3,187,137,245, 99,207,177,119, 4, 18,129, 69,192, 9, 54, 4,119, 66, 32,
+ 97, 30, 65, 72, 88, 76, 88, 78,216, 72,168, 32, 28, 36, 52, 17,218, 9, 55, 9, 3,132, 81,194, 39, 34,147,168, 75,180, 38,186,
+ 17,249,196, 24, 98, 50, 49,135, 88, 72, 44, 35,214, 18,143, 19, 47, 16,123,136, 67,196, 55, 36, 18,137, 67, 50, 39,185,144, 2,
+ 73,177,164, 84,210, 18,210, 70,210,110, 82, 35,233, 44,169,155, 52, 72, 26, 35,147,201,218,100,107,178, 7, 57,148, 44, 32, 43,
+200,133,228,157,228,195,228, 51,228, 27,228, 33,242, 91, 10,157, 98, 64,113,164,248, 83,226, 40, 82,202,106, 74, 25,229, 16,229,
+ 52,229, 6,101,152, 50, 65, 85,163,154, 82,221,168,161, 84, 17, 53,143, 90, 66,173,161,182, 82,175, 81,135,168, 19, 52,117,154,
+ 57,205,131, 22, 73, 75,165,173,162,149,211, 26,104, 23,104,247,105,175,232,116,186, 17,221,149, 30, 78,151,208, 87,210,203,233,
+ 71,232,151,232, 3,244,119, 12, 13,134, 21,131,199,136,103, 40, 25,155, 24, 7, 24,103, 25,119, 24,175,152, 76,166, 25,211,139,
+ 25,199, 84, 48, 55, 49,235,152,231,153, 15,153,111, 85, 88, 42,182, 42,124, 21,145,202, 10,149, 74,149, 38,149, 27, 42, 47, 84,
+169,170,166,170,222,170, 11, 85,243, 85,203, 84,143,169, 94, 83,125,174, 70, 85, 51, 83,227,169, 9,212,150,171, 85,170,157, 80,
+235, 83, 27, 83,103,169, 59,168,135,170,103,168,111, 84, 63,164,126, 89,253,137, 6, 89,195, 76,195, 79, 67,164, 81,160,177, 95,
+227,188,198, 32, 11, 99, 25,179,120, 44, 33,107, 13,171,134,117,129, 53,196, 38,177,205,217,124,118, 42,187,152,253, 29,187,139,
+ 61,170,169,161, 57, 67, 51, 74, 51, 87,179, 82,243,148,102, 63, 7,227,152,113,248,156,116, 78, 9,231, 40,167,151,243,126,138,
+222, 20,239, 41,226, 41, 27,166, 52, 76,185, 49,101, 92,107,170,150,151,150, 88,171, 72,171, 81,171, 71,235,189, 54,174,237,167,
+157,166,189, 69,187, 89,251,129, 14, 65,199, 74, 39, 92, 39, 71,103,143,206, 5,157,231, 83,217, 83,221,167, 10,167, 22, 77, 61,
+ 58,245,174, 46,170,107,165, 27,161,187, 68,119,191,110,167,238,152,158,190, 94,128,158, 76,111,167,222,121,189,231,250, 28,125,
+ 47,253, 84,253,109,250,167,245, 71, 12, 88, 6,179, 12, 36, 6,219, 12,206, 24, 60,197, 53,113,111, 60, 29, 47,199,219,241, 81,
+ 67, 93,195, 64, 67,165, 97,149, 97,151,225,132,145,185,209, 60,163,213, 70,141, 70, 15,140,105,198, 92,227, 36,227,109,198,109,
+198,163, 38, 6, 38, 33, 38, 75, 77,234, 77,238,154, 82, 77,185,166, 41,166, 59, 76, 59, 76,199,205,204,205,162,205,214,153, 53,
+155, 61, 49,215, 50,231,155,231,155,215,155,223,183, 96, 90,120, 90, 44,182,168,182,184,101, 73,178,228, 90,166, 89,238,182,188,
+110,133, 90, 57, 89,165, 88, 85, 90, 93,179, 70,173,157,173, 37,214,187,173,187,167, 17,167,185, 78,147, 78,171,158,214,103,195,
+176,241,182,201,182,169,183, 25,176,229,216, 6,219,174,182,109,182,125, 97,103, 98, 23,103,183,197,174,195,238,147,189,147,125,
+186,125,141,253, 61, 7, 13,135,217, 14,171, 29, 90, 29,126,115,180,114, 20, 58, 86, 58,222,154,206,156,238, 63,125,197,244,150,
+233, 47,103, 88,207, 16,207,216, 51,227,182, 19,203, 41,196,105,157, 83,155,211, 71,103, 23,103,185,115,131,243,136,139,137, 75,
+130,203, 46,151, 62, 46,155, 27,198,221,200,189,228, 74,116,245,113, 93,225,122,210,245,157,155,179,155,194,237,168,219,175,238,
+ 54,238,105,238,135,220,159,204, 52,159, 41,158, 89, 51,115,208,195,200, 67,224, 81,229,209, 63, 11,159,149, 48,107,223,172,126,
+ 79, 67, 79,129,103,181,231, 35, 47, 99, 47,145, 87,173,215,176,183,165,119,170,247, 97,239, 23, 62,246, 62,114,159,227, 62,227,
+ 60, 55,222, 50,222, 89, 95,204, 55,192,183,200,183,203, 79,195,111,158, 95,133,223, 67,127, 35,255,100,255,122,255,209, 0,167,
+128, 37, 1,103, 3,137,129, 65,129, 91, 2,251,248,122,124, 33,191,142, 63, 58,219,101,246,178,217,237, 65,140,160,185, 65, 21,
+ 65,143,130,173,130,229,193,173, 33,104,200,236,144,173, 33,247,231,152,206,145,206,105, 14,133, 80,126,232,214,208, 7, 97,230,
+ 97,139,195,126, 12, 39,133,135,133, 87,134, 63,142,112,136, 88, 26,209, 49,151, 53,119,209,220, 67,115,223, 68,250, 68,150, 68,
+222,155,103, 49, 79, 57,175, 45, 74, 53, 42, 62,170, 46,106, 60,218, 55,186, 52,186, 63,198, 46,102, 89,204,213, 88,157, 88, 73,
+108, 75, 28, 57, 46, 42,174, 54,110,108,190,223,252,237,243,135,226,157,226, 11,227,123, 23,152, 47,200, 93,112,121,161,206,194,
+244,133,167, 22,169, 46, 18, 44, 58,150, 64, 76,136, 78, 56,148,240, 65, 16, 42,168, 22,140, 37,242, 19,119, 37,142, 10,121,194,
+ 29,194,103, 34, 47,209, 54,209,136,216, 67, 92, 42, 30, 78,242, 72, 42, 77,122,146,236,145,188, 53,121, 36,197, 51,165, 44,229,
+185,132, 39,169,144,188, 76, 13, 76,221,155, 58,158, 22,154,118, 32,109, 50, 61, 58,189, 49,131,146,145,144,113, 66,170, 33, 77,
+147,182,103,234,103,230,102,118,203,172,101,133,178,254,197,110,139,183, 47, 30,149, 7,201,107,179,144,172, 5, 89, 45, 10,182,
+ 66,166,232, 84, 90, 40,215, 42, 7,178,103,101, 87,102,191,205,137,202, 57,150,171,158, 43,205,237,204,179,202,219,144, 55,156,
+239,159,255,237, 18,194, 18,225,146,182,165,134, 75, 87, 45, 29, 88,230,189,172,106, 57,178, 60,113,121,219, 10,227, 21, 5, 43,
+134, 86, 6,172, 60,184,138,182, 42,109,213, 79,171,237, 87,151,174,126,189, 38,122, 77,107,129, 94,193,202,130,193,181, 1,107,
+235, 11, 85, 10,229,133,125,235,220,215,237, 93, 79, 88, 47, 89,223,181, 97,250,134,157, 27, 62, 21,137,138,174, 20,219, 23,151,
+ 21,127,216, 40,220,120,229, 27,135,111,202,191,153,220,148,180,169,171,196,185,100,207,102,210,102,233,230,222, 45,158, 91, 14,
+150,170,151,230,151, 14,110, 13,217,218,180, 13,223, 86,180,237,245,246, 69,219, 47,151,205, 40,219,187,131,182, 67,185,163,191,
+ 60,184,188,101,167,201,206,205, 59, 63, 84,164, 84,244, 84,250, 84, 54,238,210,221,181, 97,215,248,110,209,238, 27,123,188,246,
+ 52,236,213,219, 91,188,247,253, 62,201,190,219, 85, 1, 85, 77,213,102,213,101,251, 73,251,179,247, 63,174,137,170,233,248,150,
+251,109, 93,173, 78,109,113,237,199, 3,210, 3,253, 7, 35, 14,182,215,185,212,213, 29,210, 61, 84, 82,143,214, 43,235, 71, 14,
+199, 31,190,254,157,239,119, 45, 13, 54, 13, 85,141,156,198,226, 35,112, 68,121,228,233,247, 9,223,247, 30, 13, 58,218,118,140,
+123,172,225, 7,211, 31,118, 29,103, 29, 47,106, 66,154,242,154, 70,155, 83,154,251, 91, 98, 91,186, 79,204, 62,209,214,234,222,
+122,252, 71,219, 31, 15,156, 52, 60, 89,121, 74,243, 84,201,105,218,233,130,211,147,103,242,207,140,157,149,157,125,126, 46,249,
+220, 96,219,162,182,123,231, 99,206,223,106, 15,111,239,186, 16,116,225,210, 69,255,139,231, 59,188, 59,206, 92,242,184,116,242,
+178,219,229, 19, 87,184, 87,154,175, 58, 95,109,234,116,234, 60,254,147,211, 79,199,187,156,187,154,174,185, 92,107,185,238,122,
+189,181,123,102,247,233, 27,158, 55,206,221,244,189,121,241, 22,255,214,213,158, 57, 61,221,189,243,122,111,247,197,247,245,223,
+ 22,221,126,114, 39,253,206,203,187,217,119, 39,238,173,188, 79,188, 95,244, 64,237, 65,217, 67,221,135,213, 63, 91,254,220,216,
+239,220,127,106,192,119,160,243,209,220, 71,247, 6,133,131,207,254,145,245,143, 15, 67, 5,143,153,143,203,134, 13,134,235,158,
+ 56, 62, 57, 57,226, 63,114,253,233,252,167, 67,207,100,207, 38,158, 23,254,162,254,203,174, 23, 22, 47,126,248,213,235,215,206,
+209,152,209,161,151,242,151,147,191,109,124,165,253,234,192,235, 25,175,219,198,194,198, 30,190,201,120, 51, 49, 94,244, 86,251,
+237,193,119,220,119, 29,239,163,223, 15, 79,228,124, 32,127, 40,255,104,249,177,245, 83,208,167,251,147, 25,147,147,255, 4, 3,
+152,243,252, 99, 51, 45,219, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,177,142,124,251, 81,147, 0, 0, 0, 32, 99, 72, 82, 77, 0,
+ 0,122, 37, 0, 0,128,131, 0, 0,249,255, 0, 0,128,233, 0, 0,117, 48, 0, 0,234, 96, 0, 0, 58,152, 0, 0, 23,111,146,
+ 95,197, 70, 0, 2,177,101, 73, 68, 65, 84,120,218,236,157,119,120, 20,197, 31,198,223,217,221,235,119,233, 33, 29, 82,168,129,
+208,123, 9,189,137, 52, 5,233, 42, 88, 0, 5, 20,165,217, 16, 68,176,162,128, 74, 87, 17, 16, 17,164, 42,210,165, 55, 9,189,
+183, 0,105,164,215,235,101,231,247, 71,114,247,187,132, 36,119, 1, 68,132,249, 60,207, 62, 87,118,239,189,153,221,217,217,119,
+191, 83,150, 80, 74,193, 96, 48, 24, 12, 6,131,193,120,112,112,108, 23, 48, 24, 12, 6,131,193, 96,252,135, 12, 22, 33,164, 51,
+211,100,154, 76,147,105, 50, 77,166,201, 52,153, 38, 51, 88, 12, 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48,
+152,193, 98, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12,
+ 6,131,193, 96, 48, 24,143, 7,132, 77, 52,202, 96, 48, 24, 12, 6,131,241, 96, 17,202, 90,209,168, 81,163,223, 21, 10, 69,181,
+178,214,235,116,186,148, 83,167, 78,117, 96,187,144,193, 96,184,188,147, 35,132,195,255, 35,230, 34, 0, 74,217,221, 29,131,193,
+120, 18, 13,150, 84, 42,141,218,183,111, 95, 13, 81, 20, 97,179,217, 96,181, 90, 29,175, 38,147, 9,253,250,245, 19, 42,250,103,
+ 13, 26, 52,216,199,113, 92, 68, 69,126, 99,179,217,110,159, 62,125,186, 77, 89,235, 3, 3, 3, 15, 1,136, 34,132,216, 43,242,
+ 82, 95, 1,128,227, 28, 45,162,201, 9, 9, 9,141,202,211, 36,132, 68, 57, 93, 28,238,210,178,191,119, 87,179, 86,173, 90,199,
+ 5, 65, 8, 43,249,251,210, 62,219,223,139,162,120,227,236,217,179,173, 88, 49,125, 56, 52,104,208, 96, 31,207,243, 21, 46,159,
+167, 78,157, 42,179,124,214,173, 91,247, 36,199,113, 33,165, 29,227,210,142, 57, 0,222,102,179, 93, 62,125,250,116,155,178, 12,
+ 72,112,112,240, 33, 0, 81,229,149,157, 18,101, 19, 0, 18, 19, 18, 18,154,184, 58,143,202, 59,135, 74, 41,243,229,106, 58,155,
+171,208,208,208, 79, 43, 85,170, 52, 90,167,211, 25, 0, 80,158,231,105,237,218,181,139,237, 7,155,205,150,126,241,226,197,186,
+172, 36, 50, 24,140,199,218, 96,137,162,200, 25,141, 70, 92,185,114, 5,165,213,243, 28,199,217, 42,250,103,148,210, 26,187, 86,
+173, 8, 80, 86, 10,132,205, 98,134,220,175,146, 67, 59,231,226, 57,136,102, 51,108,102, 19,252,155,180,176, 87,184,232,208,161,
+ 3,239, 66, 54,236,173,183,222, 10,240,240,240,128,193, 96,128,193, 96,128,209,104,132,193, 96,128,201,100,130,201,100,130,217,
+108,134,217,108,134,213,106,133,209,104,196,153, 51,103,108, 46, 46, 8, 97,227,198,141, 11,240,244,244,116,232,217, 23,187,166,
+ 93,215, 98,177,192, 96, 48,224,220,185,115,229,106, 10,130, 16,118,226,196,137, 0,169, 84, 10, 74, 41, 68, 81, 4,165,180,216,
+ 82,146, 86,173, 90,153, 89, 17,125,168,212,216,240,249,172, 0,185,175, 31, 68,139, 5,126, 13, 26,219,203, 45,146,119,111,131,
+205,108,134,104,177, 32,188,215,179,142,239,219,181,107,231,170,124,134,255, 54,245, 29,111,169,135, 7,172, 6, 3, 34,123, 62,
+227, 88,113,126,225, 28,136, 22, 51,168,197,140,122,111,189, 15, 0,200,200,200,208, 71, 71, 71, 39, 3, 32, 0,202,138,240,132,
+221,184,113, 35,192,158,134,210, 76,191,243,114,240,224, 65, 12, 29, 58,212, 85,222,195,222,123,239,189, 0,251, 57, 82,178,156,
+ 91,173, 86,199,171,213,106,133,193, 96,192,201,147, 39,221,138, 92, 5, 7, 7,127, 22, 27, 27, 59, 98,229,202,149,234, 13, 27,
+ 54,168, 35, 34, 34, 32,149, 74,193,243, 60,120,158, 7,199,113, 16, 4, 1,189,123,247, 38,172, 8, 50, 24,140,199,222, 96,153,
+205,230,248,174, 93,187, 82, 0, 48,153, 76,161, 50,153, 76, 90,194,128,133,180,110,221,250,114,201,223,185,106, 58, 84, 86, 10,
+196, 15,145,190, 0,128,231,174,103, 58, 46, 12,107, 99, 27, 56,182, 25,124, 43,183,112, 91,165, 18, 28,199, 17, 23, 21, 56,212,
+106, 53,186,116,233, 2,153, 76,134, 38, 77,154, 64, 34,145,148,186, 72,165, 82, 72, 36,146,187,162, 71,165,161,209,104, 48,125,
+250,116,187, 57,130, 90, 33,199,216, 86, 77,160, 0,197,226,115, 87, 97, 18, 41, 4, 65,112, 44,238,104, 74,165, 82,156, 61,123,
+ 22,130, 32,128,231,121,199,171,253,253,166, 77,155,208,191,127,127, 8,130, 0,165, 82,137,162,139, 44,227, 33,162,240,243,199,
+218,182, 13, 1, 0, 67, 19,242, 29,101,236,207,129, 61, 29,219, 60,159,164, 5, 33, 4, 82,169,212,189,227,238,225,129, 45,253,
+159, 2, 0, 60,123, 37, 13, 18,137, 4,130, 32,224,204, 87, 31, 67, 34,147, 65,144, 74, 81,239,173,247,145,145,145,161,127,230,
+153,103, 14, 40, 20,138,109,110,220,172, 32, 33, 33, 1,130, 32,148, 89,222, 57,142,195,178,101,203,112,235,214, 45,183,242,174,
+215,235,241,201, 39,159,128, 16, 82,236,124, 41,235,189,171,188, 19, 66,184,160,160,160,143, 99, 99, 99,135,173, 92,185,210,135,
+ 16,130,111,191,253, 22, 82,169, 20, 61,122,244,128,159,159, 31,182,111,223, 14,169, 84,138, 73,147, 38,177,194,199, 96, 48,158,
+ 12,131,117,234,212,169,167,236,239, 91,180,104,113,241,192,129, 3,181,156, 66,249,176, 90,173, 82,171,213, 90,195,222,108,104,
+191,243, 29, 60,120,112,185,119,244, 54,139,249, 46,131, 84, 90, 69,237,206,133,203,201, 12, 98,192,128, 1, 0, 80,230,197,198,
+121,113,227,174, 27, 38,147, 9,130, 32,160,102,229, 74,248,160, 91, 67, 52,163, 22,104, 11, 8,172,185, 90,244,209, 88,112,177,
+118, 35, 44,186,157,142, 91,121, 5, 16, 4,247, 90, 75, 69, 81, 44,211, 92,241, 60,143, 5, 11, 22, 96,208,160, 65,224,121,190,
+204,253,194,248,103,177,153,205, 46,203, 97, 69,143,141,213, 96, 40,140, 44, 9,188,195, 92, 73, 36, 18, 72,228,114, 8, 82, 41,
+ 4,153, 20, 25, 25, 25,250,206,157, 59, 31,145,201,100, 63, 5, 6, 6, 38, 39, 38, 38,150, 91, 62, 41,165,197,181, 74,185,153,
+248,241,199, 31,177,124,249,114, 52,111,222,220, 29, 51, 4,147,201, 4,169, 84,138,143, 63,254,248,174,245, 11, 23, 46,188,203,
+ 96,185,208, 35, 0,184,192,192,192,215, 86,173, 90,229,105,255,127,127,127,127, 72, 36, 18,212,173, 91, 23, 30, 30, 30, 56,112,
+224, 0,108, 54,155,219, 55, 62, 12, 6,131,241,159, 55, 88, 37,140, 1,103, 52, 26,113,233,210, 37,184,234,151, 74, 41, 45,183,
+150,148,251, 85,114, 68,174,214, 84,245,115,124, 63,232,102,142,227,194,181,165, 89, 53,200, 52,106, 52,249,240, 11,183,205, 80,
+ 90, 90,154,227,206,219,213,226, 78, 69,110, 50,153,160, 82, 42,176,115,124, 93, 36,100,202, 48,237,112, 22,254, 56,117, 13, 18,
+137, 4,221,107,215,197, 83, 82, 15,188, 31, 46,195,248,171, 55, 97,161,212,173, 11, 24,165,180, 84, 99,101,127,111,111, 42,177,
+ 27, 44,198,195,199,175, 65, 99, 71,228,106,101,101,143,187,162, 86, 0,176,169, 81, 4,228, 30, 26,212,125, 99,138, 91,229, 51,
+178,231, 51,142,200,213, 31,141, 35,193, 75, 36,144,200,100,120,238,108, 18,128,194,102,193, 14,117,163,247,230,240,178,101,195,
+134, 13,139,255,235,175,191,148,238,164,181, 52,131,101, 55, 63, 63,254,248, 35, 86,172, 88, 1, 65, 16, 96, 54,155,221, 74,167,
+209,104, 44,211, 56,221, 75, 4, 11, 0,116, 58,157,105,227,198,141,248,230,155,111,224,231,231,135,174, 93,187, 34, 56, 56, 24,
+107,214,172, 1,165, 20, 99,198,140,129, 82,169,132, 82,169,100,101,158,193, 96, 60,121, 6,203,108, 54,199,119,238,220,217,173,
+ 17, 63,122,189,254,142, 11, 3, 86,106,100,192, 57, 42, 32,247,208, 64,174,209,128,115,115,150, 46,139,197,226, 48, 40, 59,118,
+236,128, 82,169, 68,143, 30, 61,238, 43,130,101, 54,155, 33,147, 74,192,249, 7,226,133,175,255, 66,102,190,222,113, 65,219,115,
+ 35, 30, 39, 82,211, 48,190,101, 39,168,149,105, 40, 48,153,220,142, 96,149, 52, 87,130, 32, 96,192,128, 1, 48, 26,141, 32,132,
+ 20,235,151,226,202,172, 50,254, 57,202, 26,132, 64, 8,129,194,211, 3, 50,181, 26, 60,207,187,165,229, 28,109, 18,100, 50, 72,
+228, 50, 8, 69,229,208, 30,185,202,225,101,203,146,146,146,142, 0, 80, 52,107,214, 76,233, 78,218,156, 13,150,179, 1,114, 54,
+ 87, 60,207,195, 98,177,184,101, 94,140, 70, 35,164,210,255,247, 4,184,125,251,118,185, 6,203, 69,158, 41, 33, 68, 36,132,136,
+ 81, 81, 81,142,223, 6, 5, 5,193,219,219, 27,162, 40, 66, 20, 69, 40, 20, 10, 40,149,202, 98,255,203, 96, 48, 24, 79,140,193,
+114,110, 46,124, 80, 23,175,242, 46, 96, 74, 79, 79, 72,213,106,251,104, 37,234,142, 25,178,247, 57, 25, 61,122,116,185,253, 82,
+236, 70,204, 13, 83, 9, 78,224,145, 18, 20, 9, 27,183,255,255, 23,200,162,133, 19, 36,184, 21, 84, 11,252,165,147,144,136,162,
+ 91, 23,176,146, 17,172, 49, 99,198, 96,201,146, 37,224, 56,206,177, 79, 4, 65, 64,245,234,213, 17, 31, 31,207, 74,231,191, 0,
+ 45, 39, 26,105,255, 94,225,225, 1,153, 70, 3,222,141,190,119, 37,205,144, 84, 46,135, 32,147, 66,144, 22, 54, 11,246,234,213,
+107,111, 78, 78,206,178, 58,117,234, 92, 69,225, 52, 6,156,187,231,144, 32, 8,197,140, 79,105,230, 74, 16, 4, 88,173, 86,183,
+111, 42, 74, 26,157,153, 51,103,222,181,109,191,126,253,220,141, 96, 81, 66, 8,149, 74,165,232,210,165, 11,234,213,171,135, 13,
+ 27, 54, 64, 20, 69,188,254,250,235, 80, 42,149,152, 51,103, 14,172, 86, 43, 62,251,236, 51, 22,193, 98, 48, 24, 79,158,193,122,
+144,228, 92, 56,235,232, 68,236,220, 44,184,181, 85, 45,200, 53,106,200, 53, 26,180,222,176,223,113,215,140,143,103,187, 21,193,
+178, 27,172,204,204,204,114,205,149, 59, 17, 44,135,193,146, 9, 88, 27,150, 13, 42,147, 64, 48, 89,138, 25, 44, 94,144, 32,193,
+ 47, 18,156, 68, 10,193,102,117, 75,147, 82,122, 87,147,224,139, 47,190, 8, 66,136, 99,196, 87,253,250,245,157, 47, 52,236,138,
+243,144, 73,222,189,205,209,161,221,185, 89,240,247,102,213,160,240,208, 64,166, 86,163,237,230, 67,142,104, 35,230, 44,118,169,
+121,249,251,239,112,118,206, 44, 72,100, 50, 60,123,242,150, 35,114,213,170,102,181, 35, 38,181,231,178,219,183,111, 31, 1,192,
+ 13, 28, 56,208,187,126,253,250,110,157,147,246, 78,246,101,153, 43,103,131,101,177, 88,220, 46,243,238,156, 31,246, 40,150, 27,
+229,157, 70, 71, 71,131,227, 56,120,122,122, 66,163,209, 56, 70,208, 42, 20, 10,168, 84, 42, 71,255, 77,119,207, 75, 6,131,193,
+248, 79, 27,172, 6, 13, 26,252,169, 82,169, 34,221, 21,169,200,164,163,206,157,136,237,230,138, 16, 2,133, 70, 3,153, 70, 13,
+185,135,166,204, 40, 87, 89, 23, 26,123, 19, 33,207,243,142,139,205, 79, 63,253, 4,141, 70,131,225,195,135, 87,184, 15,150,253,
+110,158,147,114,216, 46,223, 13, 94, 38, 20, 51, 87,130, 32,128,151, 72,112, 71, 19, 12, 78, 34,129, 96,117, 29, 21, 35,132, 32,
+ 55, 55, 23,130, 32,224,131, 15, 62,112,220,177, 59,155, 43,214,177,253,223, 71,116, 50, 35,197,162,170, 30, 30,142,242,233,252,
+189,171, 62,137,132, 16, 80,171, 5, 18,185, 28,146,162,129,184,246,200,149, 73,237,185,172, 86,173, 90,142,200,149, 74,165,178,
+143, 30,117,169,201,113, 92,177, 50,189,108,217,178, 98,230,170,100, 4,203,221, 50, 47,149, 74,177,100,201,146,114, 77,148, 84,
+ 42,117,123, 4, 37, 80, 56,109,196,222,189,123,113,226,196, 9,140, 30, 61, 26, 74,165, 18,243,230,205,131,213,106,197,140, 25,
+ 51,160, 84, 42, 33,147,201, 88,225, 99, 48, 24,143,191,193,146,201,100,145, 7, 15, 30,116, 76, 50, 90,222,171,201,100,194,128,
+ 1, 3,220,142,132,137, 69,163, 8,185, 18, 35,229,228,158, 26,200,139,154, 94,156,191, 39,110,212,226,246, 59, 96,103,131,245,
+225,135, 31, 66, 16, 4, 44, 89,178, 4, 0, 48, 97,194, 4,183,251, 96,217, 53, 97, 35, 72,164,215,209,240,235,254, 48,173,180,
+ 32,245,224,105, 8,130,128,128, 22, 79, 65,108,214, 31, 58,165, 6,130,205,234,246, 40,194,172,172, 44,196,199,199,131,231,121,
+188,245,214, 91,197,230, 42, 42,145,103,236,216,177,131,245,193,250, 23, 13, 22, 87,212,191,170,180,242, 89,194,124,185,110, 39,
+179, 89, 11,251, 93, 73,255, 63, 90, 48, 39, 39,103,217,237,219,183,143, 2,224,134, 13, 27,230,173, 82,169,240,253,247,223,235,
+ 0,200,214,172, 89,227,210,101,217,203, 77, 89,230,234, 94,154, 8,237,145, 96,231,126, 93,247,107,176,236,102,144, 16, 2,155,
+205, 6,165, 82, 89, 44,114,165, 80, 40, 32,151,203, 89,193, 99, 48, 24, 79,134,193,226, 56, 14, 70,163, 17, 23, 46, 92,112,247,
+ 14,213,237, 73, 71,253, 26, 55,199,224, 91,185, 32,132, 96,123,108, 29, 71,179, 75,171,223,246, 58, 42,236, 91,159, 76,128, 68,
+173,129, 95,108,215, 10, 93, 24,156, 13, 86, 78, 78, 14, 36, 18, 9, 62,254,248, 99,112, 28,135,207, 62,251, 12,161,161,161, 72,
+ 73, 73, 65,187,118,237,220,186,155,231,109, 60,130,159,143,134,234, 69, 47,120, 62,223, 22, 62, 93, 62, 68,146, 73,192, 33,131,
+ 10,109, 13,231, 33,219, 62, 23, 38,209,230,150,193, 34,132,192,106,181, 98,239,222,189,197, 58,178, 3,133, 77,135,246,233, 46,
+ 44, 22, 11,204,102, 51, 62,251,236, 51, 86, 58,255, 5, 42, 63,221, 23, 47, 36,235, 0, 0,127, 58, 53, 91,183, 89,191,223, 81,
+ 62,227,103,190, 5,137, 90, 3,159,166,177,110,105,214,126,125, 34,106,191, 62, 17, 25, 25, 25,250, 78, 13,234,236, 43,144,170,
+126,172, 91,183,110,177,200,149, 66,161, 32, 69,159,137, 59,101,137,227, 56,240, 60,239, 48, 87,118, 51, 85,154,193,114,247, 6,
+192, 98,177, 64, 42,149,186,109,176,220,133,227, 56,188,244,210, 75, 8, 14, 14,118, 68,174, 62,250,232, 35, 40,149, 74,188,243,
+206, 59,176, 88, 44,152, 59,119, 46, 43,124, 12, 6,227,241, 55, 88, 70,163,241,102,167, 78,157, 80,198,186, 80,185, 92, 94, 44,
+ 12,100,159,116,180,100, 83, 33, 33,164, 51,165,116,103,105, 23, 8,231,209, 88,242, 18, 81, 43,169,135, 39, 36,106, 13,184, 82,
+162, 77, 37, 53,237,119,198, 37, 13,150,125,201,205,205,133, 68, 34,193, 55,223,124, 3, 79, 79, 79,199,104,189,242, 52,237, 17,
+ 44,158,231,161, 75,200,199,197, 89, 59, 33, 83, 28, 66,181,174,131, 16, 44, 81, 66,122, 96, 29,244, 54, 75,185, 19,141,150,166,
+ 89,163, 70, 13, 76,157, 58,245,174,233, 25,202,162, 81,163, 70, 46, 53,239, 23,166, 89,186,166, 59,229,147,151,203, 93, 30,119,
+251,122,123,228,170, 64,170,250, 49, 62, 62,222, 30,185,242, 82,169, 84, 88,184,112,161, 14, 0, 55, 99,198, 12, 85,120,120, 56,
+239, 78, 58,121,158,199, 79, 63,253,116, 87,135,246,210,204, 85,105,211,126,148,150, 78,171,213,122,151,193, 26, 48, 96,192, 93,
+163, 7,203,138, 96,149,150, 78,123, 95, 53, 63, 63, 63, 71,228,202,102,179, 57, 70, 15, 90, 44, 22, 88,173,214, 50,155, 90, 89,
+249,100,154, 76,243,201,209,124, 34, 12,214,201,147, 39,187,151,245,131,214,173, 91, 95, 57,120,240, 96,117,155,205,230,252,140,
+ 66,169,193, 96,168,209,167, 79, 31,151,183,202,162, 40, 66, 46,151,131, 82,138,134,239,127, 10, 66,238,238,111,229,221,170, 19,
+136, 32,192,102,179,193, 98,177,184,156, 30, 66,175,215, 59, 46, 38,101,117,112, 47, 40, 40, 40,119,158,159,146, 23, 5,131,193,
+ 80,236, 66, 69,168,136, 91,187,126,189,107, 52, 97, 69, 34, 4, 0,160, 80, 40,138,245,187,114,149, 20, 86, 68, 31, 46,246, 41,
+ 21, 40,165,168, 51,118,114,225,113, 42,106, 46,180,155, 0,175, 38,177, 32, 18, 1, 34, 0,179,217,236,170,124, 18,123,159, 43,
+ 74,233, 15,125,250,244,185, 12,192, 8,128,106, 52, 26,185, 68, 34, 17, 1,100, 1,160,217,217,217, 94, 73, 73, 73,162,193, 96,
+168,226, 42,157,123,247,238,197,181,107,215,208,184,113, 99,199, 35,155,236,205,110,118, 19,227,108,176,220,141, 96,149, 54,167,
+ 86, 89,179,185,187, 11,207,243,240,242,242,114, 76, 98, 42,149, 74,161, 82,169, 0, 0,115,231,206,117,236,115, 6,131,193,120,
+236, 13,150, 11,131,196,151,213,124,232,170,169,208,102,179, 37, 54,107,214,172,162,255,151,234,226,130,152,184,111,223, 62,105,
+121, 15,121, 46,229, 59,151,154, 71,143, 30,149,150,243,251,210,222,167,186,202,123,243,230,205, 75,253,125, 89, 88,173,214, 36,
+ 86, 68, 31, 30, 86,171,181,236,242,249,225,167,101, 29,215, 84, 23,166,229,106,245,234,213,147, 53, 26,205, 31,129,129,129,153,
+ 7, 15, 30,244,107,218,180,169,159,243, 54, 77,155, 54, 13, 46,241, 51, 19,202,153,158,132, 16,146,248,194, 11, 47, 72, 93,148,
+241,146,159, 19, 93,220, 84, 36,158, 59,119, 78, 90,154, 86, 89,175,148,210, 68, 55,118,235,173,238,221,187,115,206,191, 45,171,
+236, 91,173,214,116, 86, 10, 25, 12,198, 19,107,176, 12, 6, 67, 66,167, 78,157, 74,237, 53,171,211,233,110,151,247,219,115,231,
+206, 53,121,208, 25, 72, 76, 76,108,245, 95,208,252, 39,242,206,120,244,143,209,185,115,231,154, 61,104,205,219,183,111,183,250,
+ 47,104, 2,192,249,243,231, 91,178,146,197, 96, 48,152,193,114, 3,119,167, 99, 96, 48, 24, 12, 6,131,193,120, 82,225,216, 46,
+ 96, 48, 24, 12, 6,131,193,120,176, 16, 0,157, 75, 91, 81,145,209, 1,132,144,206, 21,253, 99, 87,250, 76,147,105, 50, 77,166,
+201, 52,153, 38,211,124,252, 52, 93,105, 63, 54,163, 19, 41,165,255,216, 2,160, 51,211,100,154, 76,147,105, 50, 77,166,201, 52,
+153,230,147,182,176, 38, 66, 6,131,193, 96, 48, 24,140, 7,140,192,118,193,191, 3, 33,132,167,148,218, 30,160,164, 15,128,178,
+ 30,232,102, 2,144,125, 47,201, 4, 32, 45, 90,236, 19, 21, 89, 0,152,139, 22,234, 90, 98, 58,151,156,236, 19, 67,109,146,166,
+148, 16,137, 40,226, 84,149, 42,149, 79, 2,221, 77, 0,160, 9,170, 93, 91,163, 86,118, 54,154, 77,145,114,137,236, 66,142,182,
+ 96,135, 33,245,242, 77, 86, 66, 24,140,135, 79,147, 38, 77, 70, 80, 74,103, 22, 86, 81,228,227,227,199,143,127,203,246, 10,131,
+241,128, 13, 86,181,106,213,142,115, 28, 23,102,159, 12,179,188, 57,119,236,175, 54,155, 45,241,226,197,139,110, 13,117, 39,132,
+ 8,193,193,193,207,169,213,234, 14, 60,207,183, 46,250,253, 65,173, 86,251, 87, 74, 74,202, 26, 74,169,245, 94, 50, 20, 21, 21,
+229,105, 48, 24, 6, 16, 66,134, 0, 0,165,244,103,133, 66,241,235,141, 27, 55,242,238,209, 8, 85, 11, 10, 10,250, 89, 34,145,
+240, 9, 9, 9, 29, 0,160,114,229,202,127,153, 76, 38, 91, 90, 90,218, 16, 74,233,181, 10,234,113, 82,169,244,211,216,216,216,
+ 54,132,144,229,148,210, 5, 15,232, 88,202, 57,142, 43,213,152,136,162, 24,113, 15,122, 82, 0, 94,223,124,243,141,223,138, 21,
+ 43, 26, 38, 38, 38,214, 5,128,176,176,176,179,195,134, 13, 59, 57,118,236,216, 76, 0,185, 69, 70,171, 76,146,147,125, 98,210,
+238,220, 24,157,154,118, 97, 0, 0, 4, 5,215,253,149,231, 57,105,104,232,137,195, 42,255, 33,254, 53,107, 85, 29,245,203,247,
+223, 72, 35, 34, 43, 99,247,161, 19, 13,198,190,241,110,140, 34,176,230,108,102,178, 30, 30, 53,106,212, 56,206,113, 92, 88, 69,
+230,146, 43,122,130, 66,226,249,243,231,155,148,165,201,243,124,152,171,185,186, 74,126, 39,138,226,141,115,231,206,149, 58,101,
+ 68,205,154, 53, 15,243, 60, 31,233,110,125,228,156,206,178,166,224,168, 89,179,230,113,158,231,195, 92,105,150,252, 78, 20,197,
+ 27,103,207,158,109,229,174,166,139, 57,244,238, 41,157,238,104,150,151, 78, 0,104,223,190,189, 92,171,213,254,172,209,104,234,
+107,181,218, 17,148,210,169,123,246,236, 9,228, 56, 14,157, 59,119,158,218,164, 73,147,120,133, 66, 49, 95,175,215,159,212,104,
+ 52,131,247,236,217, 99,100,103, 12,131,113,159, 6,139,227,184,176, 19, 39, 78, 4,168,213,106, 20, 25, 21,216,103,111, 23, 69,
+ 17,162, 40,130, 82,234,120,181, 90,173,104,223,190,189, 91,127, 26, 22, 22, 86,183,102,205,154,107,199,140, 25, 83,165, 87,175,
+ 94,178,192,192, 64, 16, 66,112,231,206,157, 26,127,252,241,199,208,121,243,230,125, 24, 22, 22,214, 63, 49, 49,241,172,187,166,
+ 37, 56, 56,184, 19,128, 23,235,214,173,251,236,132, 9, 19,164,173, 91,183,134,205,102,195,238,221,187, 99,231,204,153,243, 77,
+ 72, 72,200, 58, 0,203, 82, 82, 82,118, 81, 74, 69, 55,117, 27, 70, 70, 70,254,186,127,255,254,200,155, 55,111,218,250,246,237,
+187, 28, 0, 14, 29, 58, 84, 95, 20, 69,210,186,117,235, 63, 9, 33, 3, 40,165, 39, 43,176,207,251,140, 29, 59,182,255,152, 49,
+ 99, 42, 13, 31, 62,252,121, 0, 11,138,254,139, 20,237,103, 90,193, 99,232,136, 92, 81, 74,203,155, 94, 59,168, 2,145, 44,117,
+124,124,188, 79,171, 86,173, 94, 75, 75, 75, 27,239,172,155,154,154,138,184,184, 56,243,172, 89,179,190, 62,116,232,208,252,200,
+200,200,108, 0,218,178,132,168, 77,210, 52, 53,237,194,128,182, 45,191,241, 2,128, 53,155, 94, 27,116,236,100,186,199,239, 91,
+ 23, 13,149, 41,164,198, 21,139,191,150, 86,175, 22,129, 61,199,175,226,232,133, 44, 82,183, 77, 79, 33,247,247,229, 93, 0, 44,
+ 98,167,231,195,129,231,249,208,227,199,143, 7,168, 84,170, 82, 31,232, 94,162,223, 5, 8, 33,160,148, 34, 54, 54,182, 60,205,
+176, 19, 39, 78, 4, 40, 20, 10, 71,221, 81,178,206,176,215, 43,142,178, 66, 41,218,182,109,107, 46,167, 78, 10,255,251,239,191,
+ 3, 84, 42,149, 67,167,180,244,149, 52, 26,109,219,182, 45, 55,157,113,113,113,142,116,186,163, 73, 41, 69,235,214,173,109,174,
+242,110,127, 98,133,171,124,219, 53, 91,182,108, 73, 43,162,233,102, 58,203,189, 1,210,106,181, 63,175, 89,179,230,153,192,192,
+ 64,244,233,211,103,123,157, 58,117,100, 42,149, 10, 91,183,110, 69,229,202,149,253, 61, 60, 60,182,124,242,201, 39,152, 61,123,
+118,149, 29, 59,118,172, 2,240, 12, 59, 99, 24,140,251, 55, 88, 80,171,213, 88,189,122,181,227,241, 48,246,199,100,148,246,190,
+ 74,149, 42,110,253, 97, 80, 80, 80,147,136,136,136,189, 27, 54,108, 80, 6, 4, 4, 56,190, 55,153, 76,240,244,244,196,139, 47,
+190, 40,235,210,165, 75,245, 33, 67,134, 28, 9, 10, 10,106,119,231,206,157,227,229,233, 5, 7, 7, 63, 27, 19, 19,243,237,248,
+241,227, 3,123,247,238, 13, 31, 31,159, 98,235,123,246,236,137, 30, 61,122, 72,111,220,184, 49,104,205,154, 53,131,150, 47, 95,
+126, 39, 56, 56,120,108, 74, 74,202,186,114, 29,134, 90,221,185, 65,131, 6,223,239,222,189, 59,204,219,219, 27, 33, 33, 33,220,
+ 7, 31,124, 80,183,106,213,170,202,160,160, 32, 46, 37, 37, 5,235,214,173,171, 58,108,216,176,141, 10,133, 98,132,193, 96,216,
+229,134, 97,147,249,250,250, 78, 28, 57,114,164, 95, 94, 94,158,245,196,137, 19, 87,237,223,203,229,242,169, 45, 90,180,104, 68,
+ 8, 89, 77, 41, 93,118, 47,145, 43, 74,105, 30,254,223,148,103,199, 98, 95,239,102, 36, 75,118,234,212, 41,223,150, 45, 91,174,
+ 51, 26,141,141, 70,143, 30,125,123,214,172, 89, 74, 79, 79, 79, 79, 0, 36, 47, 47, 47,123,250,244,233,166, 57,115,230, 76,174,
+ 93,187,118,167,195,135, 15, 63,219,160, 65, 3, 75,145,121,187,219, 96, 17,226, 72, 79, 66, 82, 58,246, 30, 18,101, 83,223,153,
+ 16,246,249,204,200, 91,127,159, 79, 16, 5,165, 39, 54,239, 59,135,212,204, 2,252,121,248, 60,130,252, 60,136, 84, 46,137,241,
+ 14,139,105,151,155,116,126,223, 61, 24, 78,198, 61,160, 82,169,176,121,243,230,187, 30, 49, 85,218,227,167, 4, 65,128,183,183,
+119,185, 79, 35, 32,132, 64,161, 80, 96,199,142, 29,197, 30, 47, 85,218,123,251,171,151,151, 23, 40,165,229, 62,226, 64,161, 80,
+224,224,193,131,224, 56,238,174,223,151, 76,179, 32, 8, 80,171,213, 32,132,112,174, 52,247,237,219,231, 82,203,254,170,209,104,
+ 0,160,220,231, 15,201,229,114, 28, 56,112,160,204, 60,151,124,175, 41,122,222,165, 43,205,131, 7, 15, 22,123, 68, 87,201, 71,
+119, 57,127, 46,186, 57, 46, 87, 84,169, 84,214, 15, 12, 12,196,177, 99,199, 48,109,218, 52, 89, 76, 76, 12,174, 94,189, 10, 66,
+ 8,134, 15, 31,142, 58,117,234, 32, 37, 37, 5,117,234,212,193,129, 3, 7, 26,178, 51,133,193,120, 0, 6,203,142, 59,230,202,
+254, 28,177,146, 21, 68,201,161,150, 17, 17, 17,114,141, 70,243,219,230,205,155,149,126,126,255,127, 90,136,209,104, 68,126,126,
+ 62, 10, 10, 10,144,159,159, 15, 15, 15, 15,204,159, 63, 95, 57,120,240,224,223, 34, 34, 34,106,220,188,121,211, 88,150, 38, 33,
+228,235, 83,167, 78, 5, 90,173, 86,200,100,178, 50,205, 98,181,106,213, 48,118,236, 88,196,198,198, 6, 13, 28, 56,240,107, 0,
+235,202,210, 44, 50,110,223, 29, 58,116, 40, 76, 42,149,226,202,149, 43, 72, 76, 76,196,168, 81,163,194, 69, 81, 68, 66, 66, 2,
+174, 94,189,138,164,164, 36, 44, 89,178, 36,108,240,224,193,243, 1, 84, 47, 47,239, 69,188,242,214, 91,111,213,240,245,245,229,
+190,248,226,139,220,130,130,130,197, 69,223,191, 51,119,238,220,193,109,219,182,173,244,242,203, 47,131, 16,242, 11,165,244, 46,
+195, 82, 66,179,180,200,149, 13,192,197, 18, 63,139, 46, 17,217, 10, 66,225,179,240,114, 74,209, 36, 0,188,186,118,237,250,150,
+209,104,108,116,224,192,129,107,173, 91,183, 14, 7,144, 2, 32, 29, 0,188,188,188,212, 95,127,253,117, 96,207,158, 61, 47,119,
+236,216,177, 81,215,174, 93,223, 74, 79, 79,159, 85,180,158,150,212, 20, 69,156, 10, 10,174,251,235,190,195, 99, 7,236, 57,104,
+146, 78,120,227,195,219, 85, 42, 71,228,158,186,146,101, 59,127, 35, 29,249,122, 43,158,233, 88, 15, 0,208,162,110, 21,124,187,
+250, 0, 94,127,243, 61,201,186, 95,151,247,187, 70,161, 6,240, 71, 57,251,243,190, 96,154,255, 55, 67,162, 40, 66, 34,145,224,
+169,167,158, 2, 33,228,174,103,109, 74, 36, 18, 28, 62,124, 24, 29, 59,118,132, 68, 34,193, 75, 47,189,228, 50,157,162, 40, 66,
+ 16, 4,116,237,218, 21, 86,171,245, 46,189,146,102,193,254,140,206,242, 52, 41,165, 16, 4, 1, 28,199,149,106,126, 74, 46,165,
+153,150,210,242,238, 74,203,121, 93,105,143,251, 41,169,105, 79,167, 59,230,202,174,233,110, 58, 5, 65, 64,171, 86,173,112,242,
+228,201,114,205, 22,199,113, 46,235,100,173, 86,251, 98,159, 62,125,182,143, 30, 61, 90, 1, 0,153,153,153,142, 7,209,243, 60,
+143, 75,151, 46,193,100, 50, 97,229,202,149, 48, 26,141,163,217,121,196, 52,255, 73,205, 39,198, 96,217, 43, 9,119, 13,150, 59,
+207,214,163,148,142,121,231,157,119, 2,203, 51, 87, 5, 5, 5, 72, 78, 78, 70,120,120, 56,158,123,238,185,192,229,203,151,143,
+ 1,240,101, 57,178, 82,158,231,113,236,216, 49,164,165,165,161, 94,189,122,136,140,140, 44,182,193,245,235,215,177,101,203, 22,
+228,228,228,160,113,227,198, 64, 97,255,162, 82,105,208,160,193,180,232,232,232,174,237,219,183,151, 75, 36, 18,156, 58,117, 10,
+141, 26, 53,194,234,213,171, 81,165, 74, 21,168, 84, 42, 92,190,124, 25,245,234,213,195,222,189,123, 81,169, 82, 37,196,196,196,
+200, 27, 55,110,188, 63, 43, 43,235,175,155, 55,111, 78, 43, 99,127, 74, 67, 67, 67,223, 29, 57,114,164, 44, 57, 57, 89,252,233,
+167,159, 14, 81, 74, 15, 17, 66, 70,189,247,222,123,207,119,235,214,173,210,137, 19, 39,242,254,254,251,239,191, 75, 51, 87,110,
+ 70,174,172, 37, 47, 70, 54,155,205,168,215,235, 77, 70,163,209,194,113,220, 77, 66,136,201,102,179,213, 40,235,102,254,197, 23,
+ 95,172,154,145,145,241,250,155,111,190, 25, 95,100,174, 46,161,176, 99, 59, 0,192,106,181, 26, 11, 10, 10,242, 90,182,108, 25,
+ 62,120,240,224,107,171, 86,173,122,253,197, 23, 95, 92,179,108,217,178, 2, 0,250,146,130, 85,170, 84, 62,201,243,156, 84,155,
+239,123, 99,237,154,165,227,183,108, 26, 83, 57, 33, 33,169,186,159,127, 37,173, 84, 83, 41,121,205,207, 63, 30, 7, 96, 74, 78,
+207,195,153,235,119, 32,145,240,184,144,144,139,182,221,159,147, 92,187, 50,179,141,221, 96, 49,254, 81,168,253,225,208,123,246,
+236, 41, 55,130,117,248,240, 97, 72, 36, 18, 40,149, 74,172, 94,189,186, 92, 81,187, 33,176, 71,135, 92,153, 24, 87, 15, 63,183,
+155, 12,251, 3,216, 75, 46,223,125,247, 29,222,124,243,205, 98,255, 81,164, 73,220, 73,103,105,233, 11,143,136, 64, 90,106,106,
+177,239,220,120, 72, 59,108, 54, 27, 36, 18, 9,150, 44, 89,130,158, 61,123,226,247,223,127, 47,247,181,200,216, 82,119,210,217,
+170, 85, 43,152,205,102, 71,154, 47, 93,186, 84,170,238,130, 5,229,119,239,108,210,164,201, 8, 66,200,204,154, 53,107,202, 59,
+116,232,128,125,251,246, 97,230,204,153,162,213,106,205, 0,128, 86,173, 90, 85, 26, 63,126, 60,137,139,139,131, 70,163, 65,122,
+122,250,178, 38, 77,154,204, 96, 29,223, 25,140, 7, 16,193,178, 87,186,174,204,149,253, 78,209,149,201,210,104, 52, 61,186,119,
+239,238, 48, 55, 6,131,193, 97,172,236,230,202,254,249,242,229,203,136,137,137,145,106, 52,154, 30, 46, 12, 86, 97, 70, 4, 1,
+ 33, 33, 33,200,200,200,192,217,179,103, 17, 30, 30, 14,139,197,130,109,219,182, 33, 55, 55, 23, 18,137, 4, 82,169, 20,102,115,
+185, 93, 18, 16, 29, 29,253,212,138, 21, 43,154, 44, 95,190, 60,219,126, 7,247,243,207, 63,131, 82,138, 74,149, 42, 65,167,211,
+ 33, 53, 53, 21,127,253,245, 23,172, 86, 43, 52, 26, 13, 66, 67, 67, 21, 99,198,140,105, 51,125,250,116, 9,128,105,101, 72, 55,
+239,215,175,159,167,167,167, 39,222,120,227, 13,106, 54,155,191, 36,132,180,120,246,217,103,223, 29, 59,118,172,239,205,155, 55,
+ 77,175,188,242,202,113,179,217,252,117,209,197, 68, 66, 41,181,184, 48,172,101, 70,174, 44, 22,139,125,159,198, 23, 20, 20,192,
+223,223, 63,220, 69, 31, 45, 0,144, 30, 60,120,176, 21, 0,126,198,140, 25, 10, 20, 62,192,218,145, 6,147,201,132,130,130, 2,
+104,181, 90, 75,110,110,110,218,196,137, 19,173,171, 86,173,226,139,126,115,161, 52,131, 5,116, 55,213,169,163,150, 81,202,191,
+183,104,209, 34, 77,183,110,221, 56,141, 70,131,252,252,124,207, 63,183,110,213,116,234,208, 38,106,214,167,159,111,247, 12,171,
+151,122,240,212, 13, 36,221,201,133,201, 98, 65, 84,176, 87, 97,252,139,241,143, 83,212,193,218, 17,193,114, 54, 19,251,246,237,
+ 67,247,238,221, 29,231,186, 84, 42,117,108,231,142,166, 32, 8,232,222,189,251, 93, 17,157, 61,123,246,148, 26,109,114, 85,135,
+ 56,155,161,146,166,168, 52,227,197,113, 28, 92,181, 50,219,163,119,165,153, 44,231, 40,126, 9,211,230,234,102, 18,130, 32, 96,
+236,216,177,144, 72, 36,152, 52,105, 18, 4, 65, 64,195,134, 13, 33, 8, 2, 90,182,108, 9,137, 68,130,142, 29, 59,150, 25,105,
+ 43,205, 92, 10,130,128, 35, 71,142,160, 81,163, 70,142, 52, 53,108,216, 16, 77,155, 54,133, 32, 8,136,141,141,133, 68, 34, 65,
+215,174, 93, 93,106,218, 59,180,107, 52, 26, 92,190,124, 25, 60,207,131, 16,146, 25, 23, 23, 23, 8, 0,211,166, 77,203,208,235,
+245,126, 6,131, 1,157, 58,117, 66,155, 54,109, 42,253,252,243,207, 31, 0, 96, 6,139,193,184,223, 8,150,189,210,117,215, 96,
+185,194, 96, 48, 52,176, 71,175, 74, 51, 87,206,175, 38,147, 9, 85,171, 86,133,193, 96,104, 80,209,139, 69,112,112, 48,204,102,
+ 51,150, 46, 93, 10,169, 84, 10,169,244,255,190,194,100, 42, 63, 56,116,254,252,249,248, 35, 71,142, 52,106,220,184,177,207,250,
+245,235,211,187,116,233, 82,169, 91,183,110, 80, 42,149,208,235,245,176, 88, 44,104,209,162, 5,162,163,163,145,150,150,134, 63,
+255,252, 51,163, 70,141, 26,254, 71,143, 30, 21,239,220,185,115,171, 28,233, 78,157, 58,117, 2, 33, 4,127,254,249,103, 38,165,
+ 52, 78,169, 84,174,159, 53,107,150,183,201,100, 18,159,127,254,249,132,172,172,172,137, 0, 44,114,185,252,203,110,221,186, 53,
+231,121,126,181,205,102,171,112,101, 86,114,223,106,181, 90, 40, 20, 10,119,166,132,144,100,101,101,213, 5, 0,181, 90,237, 11,
+192, 49, 66, 82,175,215, 23, 51,193, 38,147,201,224,235,235,171, 6,128,162,223, 72,202, 56, 30,149, 84, 42,213,218, 91,183,110,
+120, 56, 71, 46,189,189,189, 49,100,240, 96,174,117,171, 86,178,250, 13, 26,116,125,127,246,242,213, 33,126,158,166,168, 16, 63,
+ 88,108, 22,236,220,190, 77,164,162,101, 59, 59, 69, 31, 14,118,147, 81, 50,130, 37,145, 72,176,119,239,222,187,190,147, 74,165,
+216,188,121,179, 91,102,200,110,166,202,106, 34, 43, 97,134,136, 59, 81,117,158,231,177,100,201, 18,136,162,136,241,227,199, 23,
+107, 54,116,214,183,155, 29, 87,154,246,223, 68,127, 40, 2, 48, 33,241, 43,185,227,247, 37,211, 91,164, 73,220, 49, 67,223,124,
+243,141, 91, 17,172,167,159,126,218, 45,211,230,156, 47,123,186, 78,158, 60, 89,170,238,162, 69,139, 92,246,105, 19, 69, 17,127,
+252,241,135,195,156,218,249,224,131, 15, 70,122,122,122,106,246,237,219,135, 59,119,238, 64,171,213,162,160,160, 0, 62, 62, 62,
+222,157, 59,119, 62,117,231,206,157,155,231,207,159,103, 29,222, 25,140,123,141, 96,217, 43, 93,119,154, 9, 75,107,239, 47, 69,
+ 79, 32,132,192, 96, 48,148,106,172,156, 77,129,217,108, 70,102,102, 38, 68, 81,188,231,185,186, 74,171, 88, 93, 25,172,179,103,
+207, 14, 31, 49, 98, 68,178,151,151, 87,253,204,204,204, 20,185, 92, 30,187,111,223,190,202,102,179, 25,158,158,158,240,244,244,
+196,150, 45, 91,224,237,237,141, 55,223,124,243,182, 94,175, 63,164, 86,171, 3,245,122,253,233, 59,119,238,188, 95,166,115,145,
+ 72, 58,181,109,219, 22,113,113,113,200,201,201,217, 77, 8,169,255,242,203, 47,119,169, 92,185, 50,153, 57,115,166,225,218,181,
+107,223, 1, 72, 87,171,213, 75, 87,172, 88,209,174,113,227,198,154, 97,195,134,129, 16,242, 61,165,212,224,110,158,181, 90,109,
+ 49, 99,149,151,151,135,252,252,124,168,213,106,171,155,251, 76,130,194,190, 84,246,254, 84,142, 99, 83, 20,189,178, 31, 31, 42,
+ 8, 2, 45,220,132, 74,202,210, 83,171,213, 51,150, 47, 95, 94,172,207,157, 61, 58,154,154,154, 10, 79, 79, 79,124,240,254,251,
+210,143,222,126,185, 17,175, 9, 60,204,113, 4, 38, 51,205,161,162,105,155, 54,117,224,126,118,138, 62,156, 8,150,221, 16,244,
+238,221,251,174,102, 65,169, 84,138, 29, 59,118,160,111,223,190,142, 27,150,162,166,118,183, 12, 65,175, 94,189, 28,145,160,109,
+219,182,149,218,188,103,143, 64,185, 99, 4,237,219,142, 27, 55, 14,130, 32,224,219,111,191,197, 91,111,189, 5,142,227,240,213,
+ 87, 95,129,227, 56, 76,157, 58,181, 66,245,132,189, 46,187,249,121,225,107,216, 91,121,200, 92, 16, 8, 0,240,240,244,180,111,
+ 88, 33, 77, 65, 16, 28,145,171, 6, 13, 26, 64, 34,145,160,101,203,150, 16, 4,193, 17,185,234,209,163,135,243,180, 10,212, 29,
+ 77, 65, 16,112,229,202, 21, 71,154, 91,182,108, 89, 44,114, 37, 8,130, 91,134,141, 16,242, 81,199,142, 29,103,134,133,133, 5,
+140, 30, 61,154,240, 60,143, 38, 77,154,248, 79,157, 58, 53, 87, 34,145, 40, 39, 76,152, 80,218,121, 45, 1, 80,191,118,237,218,
+106,118,230, 48, 24,247, 17,193,170,136,193,114,167,114, 84,169, 84,103, 50, 50, 50, 90,202,229,242, 98,230,170, 52,163,197,243,
+ 60,210,210,210,160, 82,169,206, 60,200, 12,187,106, 34, 44, 50, 51,111, 59,237,135,166,207, 61,247,220,170,213,171, 87, 71,237,
+220,185, 19, 71,143, 30, 69,165, 74,149, 48,107,214,172, 27, 55,111,222, 28, 76, 41,253,219,157,255,173, 90,181,106, 29,181, 90,
+141, 67,135, 14, 1,192,126, 0, 47,190,254,250,235,196,106,181, 98,254,252,249, 58, 0, 59,188,188,188,214,253,246,219,111, 13,
+234,213,171, 39,219,185,115,103,254,209,163, 71,247,184,105,174,108,162, 40,222,101,172,156,247,169,135,135,135, 59, 17, 44,139,
+151,151,215,217,188,188,188,231,244,122,125,158, 92, 46,247,200,203,203, 51, 58, 27, 43,187,190, 32, 8,146, 43, 87,174, 36, 3,
+136,242,242,242, 58, 11,167,166,196, 98, 5, 76, 16, 58,117,234,212, 73, 40,121, 12, 82, 83, 83,113,231,206, 29,152,205,102, 52,
+110,220,152,240,196,194,103,221, 62, 61,146,157,146, 15, 31,142,227,168,253, 92,183,143,250, 43,109,228,224,182,109,219, 28,159,
+ 57,142,195,159,127,254,233,150,105,219,177, 99, 71,185, 29,209, 75,116, 72,119, 25, 10,183,111, 63,127,254,252,194,199, 81, 20,
+ 69,174, 56,142,195,148, 41, 83, 32,151,203, 49,115,230, 76, 76,153, 50,165, 88, 84,198, 85, 4, 75, 16, 4, 68, 76,210, 57,223,
+ 20, 21,158, 20, 69,253,157, 8, 33,206, 38,203,173, 72,155,171, 14,238,238, 68,254, 75, 75,167, 66,161, 40,179,131,123, 9,205,
+ 50,255,224,248,241,227, 63, 52,106,212,232, 90,165, 74,149,118,180,108,217, 82,126,252,248,113,140, 25, 51,134, 24,141, 70,207,
+157, 59,119, 58,254,183, 52,163,167,213,106,149,236,204, 97, 48,238, 35,130, 85,145, 78,238,238,244, 75,208,235,245,187,246,236,
+217,211,180, 79,159, 62, 66,121,205,131, 90,173, 22,129,129,129,184,126,253,186, 85,175,215,187,156,254,192,102,115,127, 66,116,
+ 87, 6,171,148,125,240,119, 76, 76,140,213, 98,177,160,122,245,234, 8, 13, 13,133,193, 96,192,156, 57,115,172,238,154, 43, 66,
+136,180, 73,147, 38, 60, 0,100,103,103, 3, 64, 38,128, 26, 53,106,212, 64, 92, 92, 28,178,179,179, 55, 2,232,252,209, 71, 31,
+ 53,108,222,188,185,116,245,234,213,186,209,163, 71,111,180, 88, 44, 51,221,209, 23, 69,209,100,181, 90, 35, 57,142, 51,231,228,
+228, 36, 57,239,207,192,192, 64, 95,181, 90, 77, 82, 83, 83, 45,238, 24,172,250,245,235, 31,187,125,251, 54,102,204,152,145, 62,
+107,214,172, 26,249,249,249,217,185,185,185, 86,103,147,101, 48, 24, 56,127,127,127,249,130, 5, 11,148, 0, 80,191,126,253, 99,
+101, 25, 44,173, 86, 91, 89,165, 82, 57, 62, 27,141, 70,220,185,115, 7,119,238,220, 65,106,106, 42,242,243,243, 17, 21, 21, 5,
+157, 78, 23,206, 78,199,127, 15,231,102, 50,231,243,219,249, 2, 94,145,115,221, 89,179,119,239,222,142,190, 91,246,136,152,125,
+ 89,187,118,109,177,142,227,174,154,222,236, 6,107,254,252,249, 24, 55,110, 28, 20, 10, 5,190,254,250,235, 98, 77,132,165,152,
+ 2,226, 78, 58, 35, 39,235,113,103,158, 47, 36, 18, 9,252, 70,167, 22,107,138, 43,101, 52,158, 91, 70,112,214,172, 89, 15,172,
+137,208,174, 25, 30, 94,120,170, 44, 89,178, 4,207, 61,247, 28,246,239,223,127,207, 77,132,145,145,145, 43,230,206,157, 43, 63,
+127,254, 60,242,242,242,144,158,158, 14,163,209,136,196,196, 68,199,190, 41, 13,157, 78,167, 96,103, 13,131,113, 31, 6,203,185,
+243,167, 43,131, 85,212, 65,210,149, 17,248,250,195, 15, 63,124,189, 77,155, 54,190, 30, 30, 30, 72, 78, 78,190,203, 92, 21, 20,
+ 20, 64,163,209,192,100, 50, 97,207,158, 61,121,162, 40,126,237,202, 20, 88, 44, 22, 4, 4, 4, 32, 35, 35, 3, 98, 25,253,162,
+ 57,142,131, 82,169,132, 86,171, 69, 89,102,160,188, 10,216,108, 54,195, 98,177,192, 98,177, 84,216,164, 1, 80,218, 39,108, 45,
+250,127,109, 72, 72, 72, 85,133, 66,129,248,248,120, 0,184, 2,160, 67,183,110,221, 36,153,153,153,244,149, 87, 94, 57, 76, 41,
+ 29,235, 98, 54,123,211,190,125,251, 34, 1, 64,169, 84, 94, 6,128,196,196, 68, 75, 78, 78, 78,177,200,160, 74,165,162,125,251,
+246, 13,166,148, 98,223,190,125,145, 82,169,148,162,140, 57,171, 0, 24, 54,110,220,120,222,203,203,107,213,167,159,126, 58,184,
+103,207,158,231,234,214,173, 27,169,213,106,211,244,122,189,222, 96, 48, 80,158,231,165, 62, 62, 62,138,237,219,183, 95, 59,124,
+248,112,103, 79, 79,207, 85, 27, 55,110, 60, 15,160,212, 72,155, 90,173, 78,212,233,116, 17, 26,141, 6,122,189,190,152,185,186,
+115,231, 14, 40,165,184,113,227, 6, 84, 42,213,109,118, 58,254, 59, 56, 71, 92, 74, 70, 90, 74,126,231,174,185,114, 54, 67,219,
+183,111, 47,119, 14, 44,119, 53,157,205,208, 91,111,189,133,121,243,230,221, 21,193,154, 57,179,240,158,228,253,247,223,119, 25,
+189,114, 70, 34,145,224,206, 60, 95, 4,141,203, 42,102,102, 0,128,216,211, 87,193, 41,217, 4, 65,192,140, 25, 51,238,234,124,
+238,220,132,231,174,177,114, 78,103, 90, 90, 26, 4, 65,128,175,175, 47,134, 12, 25,130,174, 93,187, 58,154, 26, 43,170,155,144,
+144,112,114,246,236,217, 85, 66, 67, 67,177,122,245,106,147, 90,173,150,117,236,216,145,230,228,228,144,242, 34, 88,204, 96, 49,
+ 24,174,225,220,169, 32,221,105, 38, 44,173,146, 36,132,116,118,254,124,243,230,205, 92,173, 86, 59,100,208,160, 65,122,163,209,
+136,170, 85,171, 66, 46,151,195, 98,177,192,100, 50, 65, 42,149, 34, 56, 56, 24,148, 82,172, 91,183, 78,175,211,233,134,220,188,
+121, 51,183, 60, 77, 66,200,123, 79, 61,245,148, 33, 62, 62, 30, 85,170, 84,129,135,135,199, 93,143,141,240,244,244,132,183,183,
+ 55, 46, 94,188,136,165, 75,151,234, 9, 33,239,149,167, 89,154,209,180, 27, 43,187,209,114, 53, 50,169,132,166,218, 30,197,209,
+233,116, 0, 96,173, 82,165, 74, 32, 0,220,184,113, 3, 0,110, 69, 69, 69,181,171, 86,173, 26,217,191,127, 63, 40,165, 59, 75,
+ 51, 87, 37, 52,179, 98, 99, 99,111,197,198,198,154, 76, 38,147,212,100, 50, 73,115,115,115,205,254,254,254, 1,254,254,254,254,
+129,129,129,190, 1, 1, 1,222,201,201,201, 86,171,213, 42,181,217,108,210,216,216, 88, 83,243,230,205,111,195,105, 54,247, 18,
+154, 34,128,188, 69,139, 22, 77,151, 72, 36,183, 90,181,106, 21, 51,121,242,228,155, 22,139,197, 24, 26, 26,234, 19, 20, 20,164,
+212,233,116,249,159,124,242, 73,218,188,121,243, 58, 75, 36,146, 91,139, 22, 45,154, 14, 32,175,232,183,119,105, 90,173,214, 93,
+ 59,119,238,180, 90, 44, 22, 36, 37, 37, 33, 57, 57, 25, 41, 41, 41,142, 87,111,111,111, 28, 59,118,204,102, 54,155,119, 86, 96,
+127, 62, 40, 99,193, 52,241,255,190, 63,229, 25, 43,119,186, 1,148, 76,167,221, 12, 61,247,220,115, 24, 56,112, 32, 6, 13, 26,
+132, 33, 67,134, 96,216,176, 97, 21,153,154,161,228,249,238,248,237,228,201,147,241,254,251,239,227,195, 15, 63,132, 92, 46,199,
+ 7, 31,124,128,105,211,166, 97,218,180,105, 37,205, 21, 41, 39,239,197,234,185,220, 37,161,208, 45,139,128,105,101,181,194, 38,
+ 66, 74,255,191,184,191, 63, 29,102,232,131, 15, 62,192,225,195,135, 49,113,226, 68,236,222,189, 27, 99,198,140,193,150, 45, 91,
+ 48,114,228, 72,252,241,199, 31,142,215,162,155, 64,234, 78, 58, 5, 65, 64,187,118,237,160,211,233, 28, 6,118,212,168, 81,197,
+244, 70,142, 28,233,214,254, 84, 42,149,131, 55,110,220,184,126,233,210,165, 55,178,178,178,186,222,188,121,243,182, 86,171, 37,
+185,185,185,142, 99, 88,114, 41,138, 68,203,217,121,196, 52,153,133,186,143, 8,150,213,106, 69,229,202,149,139, 61,219,138,227,
+184, 98, 75, 69,250, 17, 0, 64, 74, 74,202,246,224,224,224,103,159,121,230,153,149, 47,190,248,162, 71,116,116,180, 36, 34, 34,
+ 2, 58,157, 14,183,110,221,194,205,155, 55,173,187,119,239,206,211,233,116, 67, 83, 82, 82, 92,142, 34, 75, 74, 74, 90, 30, 24,
+ 24,184,109,232,208,161, 83, 27, 54,108, 56,106,252,248,241,124, 84, 84, 20,114,115,115,225,227,227,131,128,128, 0,196,199,199,
+ 99,239,222,189,182,156,156,156,133, 54,155,237,163,212,212,212,244,138,236, 36,171,213,202,155,205,102, 12, 26, 52, 8,162, 40,
+ 98,206,156, 57,176, 90,173,124, 5, 36,204,102,179,153, 2, 32, 25, 25, 25, 0,160,179, 27,174,171, 87,175, 2,192,237,136,136,
+ 8, 13, 0,236,220,185,147, 0, 56,228,238, 13,189,115, 36, 43, 58, 58, 58,222, 94, 41, 58, 95,228,236,235,139, 34, 87,174,110,
+195, 13, 3, 6, 12, 72,211,233,116,221,222,122,235,173,169,243,231,207, 31, 60,127,254,252,187, 54,242,244,244, 92,245,213, 87,
+ 95,125, 52, 96,192,128,180,178,162, 87, 69, 17,187,247, 95,120,225,133, 1,103,206,156,241, 80, 40, 20,208,106,181,200,204,204,
+132,217,108, 70, 84, 84, 20,210,210,210,176,124,249,242,124,189, 94, 63,141,157,142,255, 46,101, 25, 43,119,251, 88,150, 21,197,
+217,188,121,115,169,115, 76, 85, 84,179,164,201,112,119,110, 42, 55,110,134, 74,157,250,161, 34,245, 90, 89,154, 95,124,241,133,
+ 99,178,213,210, 34, 87, 21,137, 96,217, 53,125,125,125, 1, 20,206,190, 47,138, 34,158,126,250,233,123,214, 45,122,182,224,179,
+246,207, 77,154, 52,249,104,245,234,213, 51, 41,165,126, 0, 4,231,125,192, 30,170,192, 96, 60, 32,131,101,179,217, 18,219,181,
+107, 87,172, 98, 43,239,161,170, 69, 70, 36,209, 77,147,181, 45, 42, 42, 42,106,201,146, 37,111,168,213,234,206, 6,131,161, 30,
+ 0, 40, 20,138, 51, 90,173,118, 39,199,113,115, 83, 82, 82,220,126, 56,115,145, 97, 26, 19, 22, 22, 54,103,216,176, 97, 51, 91,
+181,106,213,255,149, 87, 94, 33,130, 32, 96,205,154, 53, 52, 49, 49,113, 45,199,113,239, 37, 39, 39, 95,191,151,157,164, 82,169,
+ 46,175, 93,187,182,234,230,205,155, 97,177, 88,176, 96,193, 2, 40, 20,138,203,238,254,158, 82,154, 46, 8,194,202, 86,173, 90,
+ 13, 62,124,248,240, 42, 74,233, 89,185, 92,254,115,108,108,236,144, 67,135, 14,253, 74, 41,189, 32, 8,194,207, 45, 91,182, 28,
+114,236,216,177,117,148,210,211, 21, 72, 94, 86,108,108,108, 54,128, 32,171,181,244, 22,197,216,216, 88, 19,128, 59,110,152, 43,
+ 59,121, 35, 70,140, 48,143, 24, 49,226,237, 1, 3, 6, 44,253,251,239,191,155,229,228,228,212, 3, 0,111,111,239, 51, 77,155,
+ 54, 61,246,235,175,191, 94, 42,138, 92, 25, 92,229,157, 16,210,183, 94,189,122,235, 62,254,248, 99,117, 76, 76,140, 80,189,122,
+117,220,188,121, 19,103,207,158,181,254,240,195, 15, 5,122,189,190, 55,165, 52,155,157,142,255, 14,246, 38, 66,111,111,239, 98,
+ 55, 79,246,161,251, 21,105,194, 43, 77,179,228,141, 25,207,243,229,105,186,116, 53, 26,141,198, 49,106,217,157,174, 9,229, 61,
+123,212,158, 78,187,166,125,113,195, 92, 81, 87,154, 69,143,233,169,136, 38,220,209,180, 88, 44, 14, 93, 55, 52, 43,244,167,199,
+143, 31,255, 1,192, 15,213,171, 87,191, 10,160, 26, 51, 85, 12,198, 63, 96,176, 46, 94,188,216,228,159,252,227, 27, 55,110,228,
+ 1,248,168,104,121, 32, 36, 38, 38, 94, 7, 48, 32, 40, 40,232,203, 67,135, 14,125, 0, 0,162, 40,206,112,245, 60, 67, 87,156,
+ 62,125,186,175, 68, 34,153,191,108,217,178, 86,148, 82,120,121,121, 29,186,122,245,234,107, 21,140,130,141, 34,132,140,183,143,
+ 10, 52, 26,141,163, 8, 33, 19, 40,165, 90,167,245,142,207, 21,132, 2, 48, 82, 74, 67,202, 88,111,172,128,185,114, 68,178, 0,
+152,126,253,245,215, 2, 0,167,240,255,121,174, 44, 69,139, 1, 78,205,130, 46, 46,112,127, 17, 66,170,127,240,193, 7,179,120,
+158,239,164,213,106, 67,213,106,117,130,213,106,221,165,211,233,222,163,148,102,178, 83,241,223,195,106,181, 38,181,107,215, 78,
+ 40,237,198,169,188, 11,120,121, 55, 84, 54,155, 45, 49, 54, 54, 22,247,160,153, 84, 78, 82,111,181,108,217,146,115, 87,203,142,
+197, 98, 73, 43, 47,157, 45, 91,182, 44,243,166,241, 94,243,222,178,101,203, 10,165,177,168,174, 74,122,208,154, 46,246,103,153,
+232,245,250,236, 74,149, 42, 21, 24, 12, 6,137,209,104,148,148,140,216, 43,149,202,116,118,230, 48, 24,247,104,176,254,203, 20,
+ 25,170, 94, 15, 74,175,168, 63,212,171, 15, 64,199, 80,226,179,182,188,207, 21,228,159,136, 0,137, 0,116, 15,104, 31,102, 0,
+120,133,157,114,143, 30,103,207,158,109,254,160, 53,207,159, 63,223,228, 31, 72,103,203, 7,173,121,238,220,185, 38, 79,170,102,
+121, 36, 37, 37, 53,103,103, 6,131,113,127,112,108, 23, 48, 24, 12, 6,131,193, 96, 60, 88, 8,128, 82, 71, 2, 84,228, 73,217,
+247, 50,154,192,149, 62,211,100,154, 76,147,105, 50, 77,166,201, 52, 31, 63, 77, 87,218, 21,241, 31,143, 52,165, 13,195,125, 80,
+ 11,128,206, 76,147,105, 50, 77,166,201, 52,153, 38,211,100,154, 79,218,194,154, 8, 25, 12, 6,131,193, 96, 48, 30, 48,204, 96,
+ 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24,140, 39, 8, 66, 8, 9, 11, 11,
+107, 23, 18, 18,210,242, 73,221, 7, 2, 43, 6, 12, 6,131,193, 96, 48, 30, 4, 85,170, 84,241,182,217,108, 47,134,132,132,188,
+ 86,181,106,213,170, 0, 16, 26, 26,122,150, 82, 58, 87,169, 84,254,124,237,218, 53,211, 19, 99, 50,217,163, 16, 24, 12, 6,131,
+193, 96,220, 15, 33, 33, 33, 13, 1,188,166, 84, 42,135, 54,111,222, 92,214,177, 99, 71,248,248,248,192,106,181, 34, 37, 37, 5,
+127,253,245, 23, 78,158, 60,153,101,177, 88,230, 91, 44,150,249,233,233,233,169,204, 96, 49, 24, 12, 6,131,193, 96,148, 65,112,
+112,240,236,238,221,187,191,229,227,227,131,234,213,171, 35, 40, 40, 8, 70,163, 17,122,189, 30,148, 82, 8,130, 0, 74, 41,242,
+243,243,113,252,248,113, 28, 61,122,212,154,151,151,183,138, 16, 50, 55, 57, 57,249, 36, 51, 88, 12, 6,131,193, 96, 48, 24, 37,
+ 8, 9, 9, 73,221,189,123,119,128,213,106, 69, 70, 70, 6,140, 70, 35,116, 58,157,195, 96,241, 60, 15, 74, 41,172, 86, 43, 0,
+ 64, 20, 69, 92,184,112, 1,135, 15, 31, 70, 66, 66,194, 87, 41, 41, 41,111, 63,142,251,133,117,114,103, 48, 24, 12, 6,131,113,
+ 95, 24,141, 70,172, 88,177, 2, 25, 25, 25,168, 92,185, 50, 66, 67, 67,225,237,237, 13,165, 82, 9, 0, 14,115, 5, 0, 28,199,
+ 33, 38, 38, 6, 67,135, 14, 5, 33,100,200,227,186, 79, 88, 39,119, 6,131,193, 96, 48, 24,247,131,197,100, 50,161, 73,147, 38,
+136,143,143, 71, 92, 92, 28, 26, 53,106,132,218,181,107, 35, 35, 35, 3,201,201,201,197, 54, 62,118,236, 24, 78,156, 56,129,182,
+109,219, 62,214, 59,133, 53, 17, 50, 24, 12, 6,131,193,184,103, 66, 67, 67,159,175, 84,169,210,130, 97,195,134, 41, 27, 52,104,
+128,196,196, 68, 36, 37, 37, 33, 59, 59, 27, 13, 27, 54, 68, 76, 76, 12,174, 95,191,142,109,219,182,225,196,137, 19,144,203,229,
+ 8, 11, 11,131,102,213, 47,248, 35, 36, 56, 41, 57, 57, 57,140, 25, 44, 6,131,193, 96, 48, 24,140, 18,132,132,132,248, 17, 66,
+222, 11, 13, 13,125,125,200,144, 33,146,234,213,171, 35, 49, 49, 17,233,233,233,200,206,206,198,145, 35, 71,236,102, 12, 97, 97,
+ 97,184,121,243, 38,206,156, 57,163, 55, 26,141,163,147,146,146,150, 51,131,197, 96, 48, 24, 12, 6,131, 81,182,209,170, 12, 96,
+122,181,106,213,158,127,238,185,231,184,144,144, 16, 36, 37, 37, 97,247,238,221,168, 86,173, 26, 82, 83, 83,113,252,248,113, 91,
+ 94, 94,222, 66,155,205,246, 81,106,106,106,250,227,186, 47,254,209, 78,238,132,144,206, 76,147,105, 50, 77,166,201, 52,153, 38,
+211,124, 50, 52,147,147,147, 19,146,147,147,135, 95,185,114, 37,102,230,204,153, 27, 23, 44, 88, 0,158,231, 17, 26, 26,138,221,
+187,119,211, 93,187,118,173, 45, 40, 40,168,153,156,156, 60,230,113, 54, 87, 0,235,228,206, 96, 48, 24, 12, 6,227, 1,115,231,
+206,157,139, 0,250,134,134,134, 54, 63,119,238,220,187, 0, 32,138,226,140, 59,119,238, 28,127, 82,246, 1, 51, 88, 12, 6,131,
+193, 96, 48,254, 17,146,146,146,142, 2,232,245, 36,230,157,205,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24,
+ 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24, 79, 20, 4, 64,169, 35, 1, 40,165, 59,221, 22,185,135, 17, 10,174,244,153, 38,211,
+100,154, 76,147,105, 50, 77,166,249,248,105,186,210,174,136,255,120,164,161,148,186, 92, 80, 52, 95, 86, 69, 23, 0,157,239,229,
+119, 76,147,105, 50, 77,166,201, 52, 31,190,230,189,212,245,165,105, 22,221,188, 19, 20,182,146,112,246,207,143, 90, 58,255, 43,
+121,127, 82, 52, 31,183, 69,112,225, 46, 29, 59,137, 16, 34, 2, 16,233, 3,152,153,148, 16, 98, 63, 0, 15, 68,143,241, 15,132,
+ 54, 11,143, 17,249,191, 15,103,199,137,193,120,140,207,247, 7, 86,215, 59,213, 29,188,211, 69,214, 6,192, 70, 8,193,253,212,
+ 37,255,196, 53,233, 81,207,251,147,172,249, 95, 71, 40,111, 71, 85,170, 84,105,123, 64, 64, 64,135,140,140, 12,177,232,123,132,
+134,134,130,227, 56, 8,130,160,143,143,143,247,172,232, 31, 6, 6, 6,126, 31, 19, 19,243, 98,102,102,166,200,113, 28, 42, 87,
+174, 12, 66, 8,120,158, 7,207,243,250,107,215,174,121,254,219, 59,165,113,227,198,217, 38,147, 73, 83,242,123,153, 76,102,136,
+139,139,243,120, 18,204,149,191,191,255,179,129,129,129,222, 89, 89, 89, 20, 0,194,194,194,192,243,124, 97,161, 17, 4,235,245,
+235,215,151,185,171, 23, 25, 25,121, 76,169, 84,122, 11,130, 0,158,231, 33, 8, 2,180, 90,109,206,133, 11, 23,154, 21,173, 63,
+168, 84, 42,253,120,158,183,151, 45, 24, 12,134,204,243,231,207,183,102,151,190,255, 38,107,215,174,229,187,133,190, 84, 77,160,
+250,250, 28, 71,189, 68,145,228, 90,137,242,244,182,164,239,175,185,243,251,254,253,251,219,254,229,115,160, 10, 0, 43,165, 52,
+249, 30,126,204,149, 82,209,118,183, 1, 3,139, 62, 26, 56, 32,147, 0, 87,106, 2,235,206, 3,250, 18,205, 10,226,195,190,145,
+170, 82,165,202,220, 74,149, 42, 13, 47, 40, 40,208,113, 28, 7, 66, 8,141,137,137,177,111, 83,236, 85, 20,197,196,115,231,206,
+ 53,113,113,145,149, 84,169, 82,229,171, 74,149, 42,189,160,211,233,116,132, 16, 16, 66, 40, 33, 4,245,234,213,187, 75,211,102,
+179, 37,158, 61,123,182,201,195, 74,231,191,149,247,186,117,235,150,170, 89, 86,222, 75,211,116, 78, 39, 33, 4, 49, 49, 49,247,
+157,206, 71, 81,243,177, 53, 88, 0,184,128,128,128,141,205,154, 53,107,191,105,211, 38,238,226,197,139, 92,116,116, 52,108, 54,
+ 27, 68,177,240,220,111,212,168,145,170,162,127, 22, 20, 20,244, 83,179,102,205, 6,109,218,180,137,219,184,113, 35,215,180,105,
+ 83, 16, 66, 96,179,217, 96,179,217,208,169, 83, 39,229,125, 86, 22, 26, 65, 16,198,203,100,178,118, 86,171,181, 54, 0, 72, 36,
+146, 11, 70,163,113,175,213,106,253,154, 82, 90,224,142,142,197, 98, 81,157, 59,119,238,174,125,211,172, 89, 51,217,189,166,173,
+ 70,141, 26,135, 56,142,139, 42,237,164, 45,235,149, 82,122,227,220,185,115,173,202,210,172, 85,171,214, 33,142,227,162,236,219,
+151,166, 81,242, 59, 81, 20,111,156, 61,123,182, 85,121,149, 78, 96, 96, 96,191, 86,173, 90,121,253,246,219,111, 36, 33, 33,129,
+ 40,149, 74,136,162, 8,155,205, 6,139,197,130,142, 29, 59, 86,104,254, 52,149, 74,229,185,107,215,174,106, 1, 1, 1, 72, 75,
+ 75, 67,102,102, 38, 70,142, 28,121,197,190, 94,169, 84,250,253,245,215, 95, 53,124,125,125,161,211,233,144,155,155,139, 33, 67,
+134,252,231, 79,174,174,109,171,126, 76, 0, 95,251,103,155,136,172,157, 7,174,191,127,191,186,181,106,213, 58, 33,147,201, 2,
+203, 58,230,165, 29,123,147,201,148,122,238,220,185, 70, 46,206,159, 8, 0,189,120,158,175, 46, 8, 66, 45, 0, 17, 86,171, 53,
+ 16, 0,164, 82,105, 42,207,243, 55, 45, 22,203, 37,147,201,116, 21,192,102, 74,233,205,178,180,186,133,190, 84,141, 88,117,253,
+243,141, 98, 15, 85,213, 79,107,234,174, 79,185,172,146,235,182,116, 11,125,105,173,187, 38,235, 95, 52, 87,145, 33, 33, 33, 95,
+ 20,189,159, 72, 41,141,191, 95, 77, 27, 48,144, 82,234, 5, 0,185,185,185, 94, 9, 9, 9, 65,155, 55,111,142,153, 53,107, 86,
+ 71,153,193,240,185, 9,184, 88,222,239,187,180,171,118, 92,224, 72, 24,138, 98, 0, 86, 42, 38,238,216,123,253, 65, 92,152,184,
+208,208,208,185,221,186,117, 27,182,112,225, 66,213,209,163, 71, 85,117,235,214, 5,207,243,246,250, 2, 37, 3, 15, 45, 90,180,
+ 40,119,247, 1, 16, 66, 66, 66,230, 60,245,212, 83,131,231,207,159,175,186,116,233,146, 42, 50, 50, 18, 69, 23,219, 98,101,211,
+254, 93,195,134, 13, 31,118, 58,255,209,188,119,239,222,125,240,130, 5, 11, 84,103,206,156, 81, 85,175, 94, 29, 28,199,129,227,
+184,187,244, 56,142, 67,147, 38, 77,220,210,236,218,181,235,224, 69,139, 22,169, 78,156, 56,161,170, 85,171,150, 99,223, 57, 53,
+207, 85, 56,157,143,184,230,227,103,176, 8, 33, 92,165, 74,149, 86, 52,105,210,164,219,166, 77,155,120, 0, 56,113,226, 4,178,
+178,178, 16, 26, 26, 10,141, 70, 3,185, 92, 14,131,193, 80,161,112, 95, 96, 96,224,247, 69,230, 74, 2, 0,235,134,246,197, 13,
+ 9, 48, 54,205, 4,169, 84,138,235,215,175,131,231,249,251, 9, 29,183,245,244,244, 92,190,126,253,122,159, 70,141, 26,113, 25,
+ 25, 25,136,140,140, 68, 86, 86, 86,179,125,251,246, 53,126,233,165,151, 94, 34,132, 60, 79, 41,221,231,174,230,150, 45, 91,160,
+ 86,171,161, 82,169,160, 86,171, 97, 54,155,201,189,166,143,231,249,176,163, 71,143, 6,104, 52, 26,136,162,232, 88, 74,180, 95,
+ 59, 16, 69, 17,109,219,182, 53,151,123,240, 4, 33,236,232,209,163, 1, 74,165, 18,148,210, 98,122, 54,155, 13,114,185,220,249,
+ 14, 17, 54,155, 13, 45, 91,182, 52,187,138, 92,217,205, 21, 0,172, 90,181, 10, 65, 65, 65, 8, 8, 8,128, 90,173,134, 82,169,
+188,151,188,195,207,207, 15,175,191,254, 58, 6, 14, 28,136,149, 43, 87, 66, 34,145, 56,231, 3,190,190,190,216,186,117, 43, 60,
+ 61, 61, 17, 30, 30, 94,108,253,127, 54, 18, 8,248,110,219,119,221, 17,145,237,223,179,129,208, 57, 54,106,190,163,114, 45,220,
+136,138,133,219, 82,209,102,203,222,117,240,214, 84,151, 87, 5,142, 11, 57,122,244,104,128, 92, 46,119,239,226,110,179,161, 81,
+163, 70,188,139,243,167, 71, 76, 76,204,186,215, 94,123, 77, 90,189,122,117, 34,149, 74, 33, 8, 2, 4, 65,176,151,199,112, 74,
+105,184, 40,138,237, 83, 83, 83,233, 55,223,124,243, 57, 33,228, 25, 74,233,150, 82,203, 38,213,215,207, 55,138, 61,246,159, 68,
+179,254,157, 39, 99,235,154, 41,205, 98, 27,138,240, 80,233,175, 1,120,100, 13, 22, 33,196, 83,169, 84,126,176,102,205, 26, 41,
+ 0,116,238,220,249, 3, 66,200,155,148,210,188, 7,245, 31, 94, 94, 94,240,242,242, 66,221,186,117,241,236,179,207,122, 55,108,
+216,112, 66,123,163,113,212, 30,160,204,115, 83,224,184,176, 63,255,186, 18, 96,255, 60,184,111, 99,105,183,246,213, 82, 11,111,
+196, 74,110, 77, 33,218,104,226,206, 3, 55,154,184,200, 43, 23, 20, 20,244,101,247,238,221, 7, 44, 92,184,208, 3, 0,190,255,
+254,123, 60,253,244,211, 8, 12, 12,132, 82,169,132, 76, 38,131, 68, 34,129, 84, 42,117,188,186,136, 8,241, 65, 65, 65,159, 63,
+253,244,211,253,231,207,159,239, 1, 0, 63,253,244, 19,122,246,236, 9, 63, 63, 63,120,122,122, 66, 46,151, 67, 38,147, 65, 42,
+149, 22, 51, 92, 21, 73,231,203, 93, 59,162,170, 82,142,158, 31,127, 14, 31, 31, 31,236,122,251, 53, 72, 56, 14, 99,182,237,131,
+135,135, 71,185,233, 44, 75, 51, 46, 46, 14,105,105,105,165,230,157, 16, 82,110,221,231,156,247, 30, 61,122,244, 95,176, 96,129,
+ 35,239,221,186,117,131,159,159, 31, 60, 60, 60, 32,151,203, 33,149, 74,139, 45,101,237, 3,103,205,238,221,187,247, 95,180,104,
+145, 7, 0, 44, 91,182, 12,157, 59,119,134,143,143, 15, 60, 60, 60, 28,251,178,162,199,232, 81,214,124, 44, 13,150,189,111, 84,
+ 64, 64,192,128,223,127,255,157,115,190, 0,202,229,114,199,137, 33,147,201,192,113, 92, 69, 42, 45, 18, 19, 19,243,226,166, 77,
+155, 28, 63, 50,149,168, 20,228,114,121,133, 52, 75,232,119,238,208,161,195, 47,191,255,254,187, 66, 42,149, 66,175,215,227,220,
+185,115,240,242,242,130, 76, 38, 67,159, 62,125,248,214,173, 91,251,181,111,223,254, 55, 66,200, 96,119, 70, 40, 80, 74,161,209,
+104,138, 25,172,251,105, 66,182,159,160,155, 54,109, 2,207,243,197, 10,153,253,213,249,125, 64, 64,128, 91,186,114,185, 28,135,
+ 14, 29, 2,207,243,144, 72, 36, 16, 4, 1, 18,137, 4,127,252,241, 7,222,126,251,109,100,100,100,128, 16, 2,137, 68, 2, 15,
+ 15,151,173,155, 36, 48, 48,208,219,110,174,138, 34,128, 80, 42,149,144, 72, 36, 68, 16, 4, 98,111,198, 35,132, 16,119,219,212,
+ 5, 65,192,205,155, 55, 49,116,232, 80, 44, 91,182, 12, 51,102,204,192,224,193,131,139,173,207,203,203,131,143,143, 15,124,124,
+124,160, 80, 40,238,185, 44, 60, 74,136, 37,246,206, 71, 51,191, 80, 65,164, 40,236,228, 33, 2, 34, 64, 65, 33, 82, 17,169, 73,
+215, 48,251,203,121,188,187,101, 73, 46,151,227,224,193,131, 14, 19, 36, 8, 2, 8, 33,112, 54, 70,246, 37, 40, 40,200,165,166,
+ 84, 42,157,190, 97,195, 6,217,202,149, 43,177,122,245,106,199,127,168,213,106,120,123,123,195,207,207,207,177,132,133,133,145,
+ 31,126,248, 65, 90,191,126,253,233, 0,182,148,110, 2,169,151,170,234,167, 53,251,119,158, 92,104, 46, 39, 83,100, 95,153,217,
+128,203,153,234,245, 8,155, 43, 1,192, 59,223,126,251,173, 95,227,198,141, 1, 0,223,126,251,173,223,136, 17, 35,222, 33,132,
+188, 79, 41,181,222,243, 13, 22,176,154, 16, 50,176, 40, 98,171,232,210,165,139,236,187,239,190, 67,173, 90,181, 48,110,220, 56,
+223,217,159,127,222, 11,192,111,101,151,165,226,133,233,211, 47,230,122, 83, 90, 88,126,168, 72,139,189,102,165,221,196, 7, 31,
+124,236,178, 78, 6,192,133,132,132,188,180,120,241, 98, 71,119, 8, 31, 31,159, 82,235, 38,137, 68,226, 88,202, 49, 69,164, 40,
+ 42, 52, 98,225,194,133, 14, 77,127,127,127, 72,165,210, 98, 23,216, 91, 23, 79, 97,203,210, 79,160,246, 13,194,208,137,159, 85,
+ 56,157, 97,114, 25,194,148, 50, 52,104,208, 0, 42,149, 10,113,146,194, 75,153,135,135,135,203,116,150,165,233, 92, 47, 3,128,
+ 78,167,115, 68,237, 77, 38, 19,154, 52,105,226, 86,222, 23, 45, 90,228,208,244,243,243,115,228,221,158, 46,231,186,222,126, 3,
+ 83,158,102, 72, 72,200,136, 37, 75,150, 56, 52,125,125,125,139,105, 72, 36, 18, 44, 95,190,252,174, 58,226,126, 53, 43,122,220,
+ 75,106,222,188,121, 19,179,102,205,114,212, 73,246, 40,158,189,171,209,188,121,243,220, 50,216,143, 85, 4, 11, 0,201,200,200,
+ 16, 47, 94,188,200,197,197,197, 65, 34,145, 32, 32, 32, 0, 77,155, 54, 5, 0,152,205,102,251, 69,151,212,170, 85, 43,149,227,
+ 56,216, 47,186, 28,199,193,106,181, 58,218,147,157,140, 12,151,149,149, 37,238,216,177,131, 91,241, 76, 87,152, 40,208,240,131,
+ 79,208,173,103, 79,108, 11,149,129, 7,208,236, 98, 6,100, 50,153, 16, 28, 28,108,177, 31, 4,187,182,115,223,172,146,230,136,
+ 16,226,161, 86,171,127,216,188,121,179,130,227, 56,228,231,231, 67, 20, 69,180,110,221, 26, 28,199,225,236,217,179,120,239,189,
+247,176,110,221, 58,108,216,176, 65,217,168, 81,163, 31, 8, 33,181, 41,165,249, 78,102,106,103,105,133,211,195,195, 3, 42,149,
+202, 97,176,236,121, 46,106, 83, 47,217, 36,147,116,238,220,185,198,101,105,218, 35, 9,125,251,246,117,244, 57,179,155,161,146,
+175, 82,169, 20,103,207,158, 45,205,244,221,165, 41,138, 34,218,180,105, 99,111,138,131, 70,163,193,158, 61,123, 28,235, 27, 54,
+108, 8,147,201, 4,127,127,127, 92,184,112,193,165,102,122,122, 58, 77, 78, 78, 38, 43, 86,172,128, 68, 34,129,159,159, 31, 84,
+ 42, 21,249,237,183,223,222, 81, 40, 20, 97, 70,163, 81,180, 88, 44, 8, 11, 11,155, 23, 30, 30,110, 63, 70,218,107,215,174,249,
+149,165,201,243, 60, 20, 10, 5,126,250,233, 39,204,154, 53, 11,239,190,251,110,177, 19,139,231,121, 24, 12, 6,248,251,251, 59,
+ 76, 86,201, 19,239,159, 24,182,251, 79,107, 82, 80,156, 59,177, 13,231,207,236,132,104, 19, 97, 19, 41, 40,181, 65,180, 2,113,
+ 59,142,212, 72,185,145, 28, 74, 65,129,162, 30, 55,150, 2,173,181,189,191,188, 22,128,141,123, 50,140,115, 92,165, 83, 16, 4,
+ 88, 44, 22,108,222,188, 25,215,174, 93,195,246,237,219,161,215,235, 29,251,177,101,203,150, 24, 49, 98, 4,130,130,130, 92,238,
+ 79, 74,233, 79, 9, 9, 9, 13,219,180,105, 67,114,114,114,144,147,147, 3,189, 94, 15,155,205, 6,171,213, 10, 65, 16,160, 80,
+ 40,160, 84, 42, 17, 24, 24, 8,131,193, 64,141, 70,227, 79,101,105,138, 34,201,213, 93,159,114,121,235,154, 41,205,250, 79,166,
+ 88,251, 25, 65,141, 8,185,110,239, 41,239, 17, 91,142,190,211,133, 80,142, 2,133, 89,231, 8,168,205,102,203,120,117,236,167,
+ 99, 30,246, 49, 42,193,168,241,227,199,215,118,110,158, 30, 50,100, 8,206,157, 59, 87,251,235,175,191, 30, 5,224,219,138,106,
+250, 0,161, 0, 96, 5,182,162,112,193, 90,189,158, 12,218,184,177, 47,128, 23, 54,108,216,128,193,131, 7,227,203,207, 63,175,
+ 91,210, 96, 21, 43, 75,148,226,230,149,253,184,121,245, 0, 68,145, 58, 69,193, 75,127, 79,221, 75, 39, 41, 40, 40, 48, 28, 61,
+122, 84,179,108,217, 50,120,123,123, 35, 42, 42,202,209, 74, 81,242, 2,107,255,236,170, 44,233,116, 58,195,197,139, 23, 53,191,
+252,242, 11,124,125,125, 17, 30, 30, 14,149, 74,229,208,148,201,100, 56,178,109, 61, 70, 13,237,129,140,155,231, 49,247,205, 1,
+110,167,243,229, 46, 29, 81, 89, 33, 67,223, 25,159, 34, 58, 58, 26,107, 7,246, 6, 71,128,209,187,143, 64, 42,149, 98, 89,143,
+182,144,201,101, 24,189,251,111, 87,233,116,104, 30, 63,126, 28,162, 40, 34, 34, 34, 2, 58,157, 14,158,158,158, 80, 40, 20,144,
+ 72, 36,216,177, 99, 7,250,244,233,131,149, 43, 87,162,101,203,150, 46,243, 94, 80, 80, 96, 56,115,230,140,230,231,159,127,134,
+175,175, 47, 42, 87,174, 12,149, 74,229, 8, 76,216,141, 22,207,243,136,138,138, 66,110,110, 46,170, 86,173, 90,174,166, 86,171,
+ 53,196,197,197,105,126,254,249,103,248,248,248, 32, 44, 44,204, 17, 97,179,155,162,105,211,166, 21,211,104,208,160,193,125,107,
+ 86,244,184,151,212,236,219,183, 47,170, 85,171, 6, 79, 79, 79,168,213,106,135,118,121,154,143,181,193,162,148,210,162, 81, 20,
+136,142,142, 70, 86, 86, 22,228,114, 57,154, 54,109,138,140,140, 12,104, 52, 26, 72,165, 82, 80, 74, 49,112,224, 64,126,226,196,
+137, 1, 69,166,202, 81,225,151,209,150, 46,114, 28,135, 86,173, 90,225, 92, 81,203, 79,183,158, 61, 17, 22, 22, 6,123, 39, 14,
+133, 66,129,193,131, 7,147,183,223,126, 91,176, 71, 47, 40,165,208,235,245,168, 95,191,190,178,156,232,200,155,191,253,246,155,
+151, 76, 38, 67,126,126,190,163,137,140,231,121, 92,188,120, 17, 95,126,249, 37, 94,120,225, 5,220,190,125, 27, 33, 33, 33,152,
+ 48, 97,130,230,211, 79, 63,125, 19,192, 71,174,118,142, 70,163,113,152, 43,149, 74,133, 97,195,134, 9,173, 91,183, 14,208,104,
+ 52,240,240,240,128,189,185,207,102,179,161, 85,171, 86,196, 85,212, 65, 20, 69,108,219,182, 13,130, 32,184,140, 96, 21,181, 89,
+187,165,121,244,232, 81,135, 57,115,190, 43, 34,132,224,220,185,115, 14, 51, 87, 84,152,203,211,164, 60,207, 67,173, 86, 35, 40,
+ 40, 8, 74,165, 18, 42,149,138,108,218,180,233,253,136,136,136,224,215, 94,123,141,203,203,203,227,154, 52,105,130, 30, 61,122,
+ 8,162, 40,194,108, 54,163, 99,199,142,229,238, 71,137, 68,130, 99,199,142,225,211, 79, 63,197,228,201,147,177,104,209, 34,116,
+238,220,185,152, 81, 32,132,160, 82,165, 74,240,244,244,124,124,206, 46, 17, 48, 91, 45,208, 21,232, 29, 77,184, 54,155, 13,103,
+246,156,170,113,227,212,149,152,223,127, 89, 41, 1, 0,195,158,245,206,191, 10,126,118,254,175, 53,219,251, 74,143,238,201, 50,
+ 31,117,209, 84,136,113,227,198, 97,234,212,169, 24, 56,112, 32,118,236,216,129,247,222,123, 15, 47,189,244, 82,177, 8,150, 59,
+ 88, 44,150,197,207, 63,255,252,200,181,107,215,214,154, 60,121, 50,103,143, 96,169, 84, 42, 16, 66, 96, 48, 24, 96, 52, 26,161,
+215,235,113,233,210, 37,241,149, 87, 94,185,108, 50,153, 22,151,165,103, 37,202,211, 42,185,110, 75,245, 42,124, 53,109,252, 23,
+ 30,109,154, 71,232,137,178,113,238,211,213, 59,211,206,131, 35,124, 64, 41,168, 88, 24,229, 51, 26,181,120,103,210, 4,254,223,
+ 60, 84,132,144, 30, 93,186,116,233, 58,115,230,204,187,214,205,156, 57, 19, 23, 46, 92,232, 74, 8,185, 89, 86,147,104,105,120,
+ 3, 97,138,160,160,175, 0,192,251,206,157,183,114,128, 68, 0, 24, 4,116,179, 1,189,119,236,216, 1, 0,168, 82,165, 10, 68,
+160, 14, 1,126,226,129,213,214,210,162,130,148,194, 98,177, 66,175, 55,150,107,172,236,159, 93, 5,151,237,117, 61,207,243,168,
+ 91,183, 46,186,117,235, 6,169, 84, 10, 15, 15, 15, 71,115, 78,105, 81, 12, 23, 77,247, 20,128, 72, 8, 65, 84, 84, 20,186,118,
+237, 10,169, 84, 10,181, 90,237, 48, 45, 50,153, 12, 60,207,163, 94,235, 78, 88,185,124, 38, 94,236,217, 8, 47,196, 6, 98,221,
+153, 76,183,210, 25,161,148, 33, 92, 37, 71,116,116, 52, 60, 60, 60, 64, 8, 32,240,255,175, 79, 85, 42, 37,100,114, 89,185,233,
+ 44,169,153,154,154,138,248,248,120,196,199,199,131,227, 56,180,105,211,198, 17,117,185,122,245, 42, 62,250,232, 35, 24,141, 70,
+183,242,206,113, 28,170, 87,175,142,142, 29, 59, 66, 38,147, 65,165, 82, 21,107, 26,180,239,211,252,252,124, 84,171, 86, 13, 27,
+ 55,110, 68,219,182,109, 93,106, 70, 71, 71,163, 93,187,118,144, 74,165,142, 27,105,165, 82,233,184,110, 20,153, 59,199,127, 52,
+106,212,168, 66,154,219,143,221,198,210, 29,127,193,104, 18,145,167,179, 20,251, 65,176,191, 39, 14,252, 60,217,173,188,219, 53,
+151, 44, 89,130,156,156, 28, 71, 29,100, 15,192,216,131, 39,149, 43, 87,198,130, 5, 11,158,172, 38, 66,251,101,193,238, 42, 67,
+ 67, 67, 97,239,231,161,209,104, 32,147,253,191,143,183,213,106,197,186,117,235, 16, 16, 16,224, 88,188,188,188,202, 44,208, 85,
+170, 84, 1,165, 20,227,210, 11,187, 25,108, 13,145,226, 38,128,167,211,169, 35,186, 99,179,217,240,219,111,191,193,217,192,120,
+120,120,148,219, 92, 36,147,201,218, 55,109,218,148, 51, 26,141,119,153,171, 79, 63,253, 20,131, 7, 15, 70,205,154, 53, 33,138,
+ 34, 10, 10, 10,208,161, 67, 7,201,188,121,243,218, 87,196, 96,169, 84,133,253,249, 77, 38, 19,246,236,217, 3, 31, 31, 31,248,
+249,249,193,215,215, 23, 30, 30, 30, 80, 40, 20, 32,132,184,108, 46,163,148,162,111,223,190,142, 66,231, 28,181, 42,105,182, 14,
+ 29, 58,228, 86, 51, 25,165, 20,205,155, 55,135, 90,173,134, 70,163,129, 70,163,193,182,109,219, 28,235,155, 53,107, 6, 81, 20,
+ 17, 16, 16,128,195,135, 15,187,172,116,195,194,194, 28,219, 75, 36, 18,242,219,111,191,189, 19, 25, 25, 25, 60,122,244,104,142,
+231,121,156, 56,113, 2,231,207,159, 71, 80, 80,144,163, 79,150,171,116,106,181,218,148,121,243,230,217,190,251,238, 59, 0, 64,
+199,142, 29,145,155,155,155,230,180, 62,115,232,208,161,142, 81,138, 0,144,149,149,149,249, 24,248, 43, 88,205, 86,232, 12, 6,
+ 20,228,235, 28,209,160,180,228, 84,239,201,111,143,151,124, 57,102, 56, 0,224,237, 57,223, 34,127,209,255, 43,176,245,111, 15,
+ 10,120,102,246,234, 41, 0,250,148,167,175,211,233, 96, 52, 26, 17, 30, 30,142, 99,199,142, 33, 63, 63, 31,157, 59,119, 46, 22,
+ 33,117,222,167, 46,142,189,137, 16,210,186,103,207,158,127,127,253,245,215, 85,107,215,174, 77,180, 90, 45,116, 58, 29,156, 95,
+207,156, 57, 67, 87,173, 90,117, 67,167,211,181,162,148,154,202,210,219,150,244,253,181,110,161, 47,173,221,119, 90,214,211, 63,
+234,178,103, 82,118, 85,107,102,146, 92,155,167,191,100,176,209,243,160, 54,192, 6, 17,212, 42,194, 6,138,127,115,252, 54, 33,
+ 36,172, 70,141, 26,175,174, 92,185,178,212,253,197,243, 60, 86,174, 92,137, 54,109,218,188, 74, 8,185, 88, 94,231,126, 59, 45,
+ 1,153, 65, 34,153,188,249,215, 95, 11,251,114,117,236, 56,185,165,197,242,246, 97,192, 84,167, 94,189,126,135, 14, 29,242,178,
+215, 43, 94, 94, 94,160,148,242, 58,157,206,171, 85,171, 86,253, 74,107,118,165, 34, 96,177, 88,160,215, 27,145,155,155, 15,147,
+217, 82, 84,103,138,176,217,172, 69,175, 34,172, 69,245,168, 68,224, 61,218,183,172, 82, 80,104,180, 72,206,222, 35,183, 43,151,
+ 81,215, 83, 66, 8, 2, 3, 3, 33,149, 74,139, 69,153,220,137, 94,149,130,205, 94, 23,250,249,249, 65, 38,147,225,244,158,223,
+145,118,225, 0,164,132, 66,180, 89, 32, 90,205,176, 89,205,224, 57, 30,151,174, 39, 35, 58,216,229,216, 33, 71, 58,187,125, 48,
+ 3, 45, 90,180,192,218,129,189, 65, 8,240,218,238, 35,144, 72, 36,248,185,111, 39,200,101, 82,188,178,227,136,187,233, 44,150,
+247,227,199,143, 99,220,184,113,248,236,179,207,160, 84, 42,237, 45, 39,184,120,241, 34,126,253,245, 87,116,233,210,197,237,188,
+ 19, 66, 28,121, 23, 4, 1, 83,166, 76, 65,114,114, 50,230,204,153,131,198,141, 27, 67, 34,145, 32, 39, 39, 7,173, 90,181, 66,
+106,106,170,219,251,211,222,140, 39,147,201,138, 69,155,236,198,239, 94,142,145, 93,115,120,223, 96,108, 58,184, 10, 4, 4, 71,
+126, 30, 95,236, 90,180, 96,245,254, 10,107, 78,157, 58,181, 88, 58,159,196,232, 85,169, 6,139, 82, 74, 67, 67, 67, 33,138, 98,
+ 49, 83, 85,178, 67,173, 61,228,231, 28, 82, 44,183, 15, 2,207, 67, 20, 69, 71, 97,224, 75, 89,127,248,240,225,187, 76,192,210,
+165, 75,203,189,128, 91,173,214,218, 30, 30, 30,197,162, 87, 82,169, 20, 83,166, 76,193,176, 97,195, 28,230, 74, 42,149, 98,217,
+178,101,104,210,164, 9, 76, 38, 83,237,242,210, 42,149, 74,117,245,234,213,227,236, 81, 32,165, 82, 73, 6, 15, 30,204, 91,173,
+ 86,199, 62,177, 47,246,190,105,174, 76,134, 61,218,180,125,251,118,183, 34, 88,238,246, 65,162,148,226,212,169, 83,197, 76,155,
+125, 20, 12, 0,156, 58,117,202,209, 63,203, 93, 77,155,205, 6,165, 82, 73,164, 82, 41, 81, 40, 20, 97,118,115,197,243,188,227,
+120, 59,247,201,115,117,162,156, 62,125,186, 67,121,235,207,156, 57,243, 88, 78,199, 32, 66,132,217, 98,129, 94,103, 66,126,129,
+ 30,211, 63,249,177,112,197,116, 28, 5,112,180,245,168,113,120,173, 91,151,142, 0, 42, 85,208, 16,192,126, 1,251,237,183,223,
+ 32,145, 72,176,113,227, 70,120,122,122,162,119,239,222,240,244,244,196,228,201,147, 49,112,224, 64,183, 35, 88, 69,101, 41,151,
+ 16,210,250,205, 55,223,252,251,139, 47,190,168, 82,185,114,101,152, 76, 38,152,205,102,152, 76, 38, 92,187,118, 13,171, 86,173,
+ 74,208,233,116,173, 41,165,185,174,244,182, 37,125,127,237,247,195,239, 36,199, 62,251,172,254, 98,234, 86,220,185,147, 9,171,
+ 53, 9,162,205, 10,179,181,112, 68,178,205,106,133,213,106,131,192,115,158, 11,190,158,184,163,176,195, 63, 49,245,239,223,255,
+169,135,120,168,232,149, 43, 87, 50, 43, 85,170,100,175,196, 60, 77, 38, 19, 41,186,129,163, 0,236, 29,220,181, 40,167, 35,186,
+ 51,199,128,145, 95,126,246, 89,152,189,249,254,147,207, 62, 11,155,240,214, 91, 35, 1,204,187,112,230,204,202,225,195,135,191,
+185,102,205,154, 98,191, 25, 62,124, 56, 46,156, 57,179,178,244, 16, 65, 81, 4,203, 96, 64,122,102, 54, 94, 30,245,190, 35,116,
+ 0, 80, 56, 59, 84, 90,248, 89, 1, 0, 25,169,215, 48,118,220,219,242,178,110,168,234,212,169, 3, 81, 20,139, 69, 67,238,161,
+239,149,115,100,200,177,157,167,167, 39,164, 82, 41,174, 29,250, 29,111,141, 26, 0,216,204,160, 22, 61, 96,214, 1,230, 2,136,
+ 38, 29,136, 84, 9, 88,244, 46,117,237,233,244,244,244, 44,236, 19, 42,240,144, 73,255,111,254,156, 35, 87,238, 92,184, 75,230,
+253,230,205,155,120,237,181,215, 96, 54,155,209,183,111, 95,152, 76, 38, 24, 12, 6,232,245,122, 68, 69, 69, 65,167,211,185,157,
+119,251,181, 83, 42,149, 98,252,248,241,104,210,164, 9, 62,250,232, 35, 76,154, 52, 9, 81, 81, 81, 24, 61,122, 52, 86,173, 90,
+133,152,152,152,114,117,237,154,133, 77,238,133,154,246,252,150,108,202,179,183, 20,184,123,140, 74,211,180,207, 46, 82,242,184,
+191,241,124,167, 10,107,126,250,233,167, 72, 79, 79,191, 43,114,101,127, 31, 26, 26,138,249,243,231, 63,145, 17, 44,199,112, 82,
+251, 5,212,126, 33,119,174,220, 85, 42, 21,214,173, 91, 87,172,115, 93,121, 97,105,142,227, 32,138, 34,182, 84, 42,252,125,143,
+162,200,149,243,231, 94,189,122, 33, 50, 50,178, 88,244, 74,169, 84,150, 91,104, 68, 81,196,173, 91,183,112,238,220, 57,180,104,
+209, 2,185,185,185,144,112, 28,222, 62,115, 6,117,158,127, 30, 38,169, 20,162, 40, 66, 38,147, 97,228,200,145,110,117, 84,255,
+251,239,191,125,156, 63,215,169, 83, 39, 49, 54, 54, 54,244,216,177, 99,142,142,239, 69,205,103, 14,163,225,230, 73,141,126,253,
+250, 21,139, 90, 57,155, 43,231,101,235,214,173,110, 53, 17, 82, 74, 17, 27, 27,235,136, 94,121,120,120, 96,195,134, 13,142,245,
+246,240,115, 96, 96,160, 91,154,246, 59,248,162,142,237, 48, 26,141, 98,126,126, 62, 23, 23, 23, 7,153, 76,230, 56, 38, 74,165,
+ 18, 10,133,226,190, 6, 39, 60,246,216, 68,152, 44, 22,232,245,122, 20, 20, 20,206, 16,114,237,108,241,126,204,102,227,189, 15,
+ 78,179, 71,169,242,243,243,177,107,215, 46,172, 95,191, 30,141, 27, 55,190,171,147,187,243,121,235, 70, 25, 77, 39,132,180,153,
+ 56,113,226,145,143, 63,254, 56,196,215,215, 23,102,179, 25,183,111,223,198, 15, 63,252,144,172,211,233,218, 80, 74,211, 43,224,
+218, 96,177, 88, 97,208, 25,145,155,151,143,105, 51,151,149, 89, 69, 0, 64, 86,218, 37, 12, 30, 60, 68,246, 48, 15, 19,165, 52,
+ 9,192, 75, 78,231,213, 10, 0,246,112,124, 30,165,116, 88, 69,244, 36, 64,251,103,251,247,239, 56,126,252,120,199,119,227,199,
+143,199,145, 35, 71, 58, 74,214,174, 61,103, 1,246,240,107,215,198,124,253,245,215,142,109,190,254,250,107,172, 91,187,118,183,
+ 13,216, 83, 86,221, 97,111, 34, 44, 40,208,195,211, 59, 24, 73,241,123, 93,166, 69,202, 27, 64, 69,209,229,141, 95,201,126, 55,
+ 37,235,167, 10,148, 31, 90,175, 94, 61,123,235, 2,164, 82, 41,234,118,236,143,217,115, 23, 67,206, 81, 60,219,185, 46, 42, 41,
+108,128,210, 23,210,182,147, 65,188,195,139,110, 58, 26,186,117,131,186,239,253, 9,184,161, 86,224,149,237, 7, 32,149, 74,241,
+219,192, 30,144,203,165,120,225,247,125,144, 74,165,248,125,196, 51,144,202,164,232,182,240, 87,183,110, 84,236,121,191,118,237,
+ 26, 14, 29, 58,132,232,232,104, 92,189,122, 21,206,253,108, 41,165,110,155,182,186,117,235, 58, 2, 18, 18,137, 4,119,238,220,
+ 65,207,158, 61, 29, 55,248,123,247,238,197,196,137, 19, 49, 98,196, 8,180,111,223,190,212,126,177, 37, 53, 99, 98, 98, 28,129,
+131,146, 38,216,185,217,182, 34,199,168, 52, 77, 71,249,189,199,227,238,172,249,241,199, 31,151,106,214, 43,162,249, 88, 27, 44,
+251, 9, 82, 86,187,179, 90,173,198,235,175,191,142,169, 83,167,194,223,223,223,101,223, 25,187,115, 45,143,205,155, 55,223,245,
+221,198,141, 27, 93, 53, 17, 94,244,242,242,106,210,161, 67, 7,228,230,230, 34, 33, 33, 1,106,181, 26,117,102,207,198,153,215,
+ 94, 67,131,133, 11,193,117,236, 8, 66, 8,100, 50, 25,206,156, 57, 3,165, 82,121,177,162, 17, 3, 15, 15, 15,248,248,248, 56,
+218,212,237, 70,203,201, 96, 81,119,204,208,150, 45, 91, 74, 29,161,115, 47,125,176,236, 21,239,145, 35, 71,138,245,191,114,110,
+230, 56,114,228,136, 35,130, 85,180, 61,113,117,156,138,238,234,168, 93, 79,165, 82,193,215,215, 23,114,185,220, 97,172,236,230,
+202, 29,115,233,106, 34,209,136,136,136, 98, 19,145, 74, 36,146, 98, 19,145,254,215,155, 8,245,122, 3, 10,242,245, 15,178, 73,
+171,208,156, 21, 13, 56, 89,183,110, 29,154, 55,111,126,151,185,178, 71, 29,239,193,112, 36, 18, 66,218,207,157, 59,247,232, 87,
+ 95,125,229, 83, 80, 80,128, 31,127,252, 49,183,160,160,160, 61,165, 52,177, 66, 90, 0, 44,102, 51,116, 6, 35,180, 5,133,251,
+224,250,185,223, 92,154,178,255, 50,181,235,213, 27,250,227,143, 63,222,245,253,143, 63,254,136,171, 87,175, 14,197,153, 51,123,
+154, 1,139,222,153, 60,185,122,227,198,141,195, 0,224,157,201,147, 19,155, 1,139,202, 59,207,205, 69, 77,132, 5, 5,133, 81,
+ 15,131, 54,227,193,148,211, 34,147, 81, 86,159,171,123,185, 32,218,235, 91,169, 84,138,174, 3, 95, 70,242,141, 75,136, 86,103,
+160,146,183, 10, 52, 47, 9,210,142, 31,226, 76,150, 10,115, 22,110,171, 80, 58,213,114, 25, 20, 10,185, 83,159, 43, 5,100, 10,
+185, 35,157, 10,165, 18, 18,185,172,194,121,191,124,249, 50,148, 74, 37,108, 54,219, 93,215,155,138,230,223,217,184,124,253,245,
+215,152, 56,113, 34,150, 45, 91,134, 51,103,206,160, 65,131, 6,232,220,185, 51,210,210,210,112,250,244,105, 24,141, 70,183,211,
+233,220, 47,238,252,249,243,248,243,207, 63, 17, 31, 31,143,132,132,132,123, 62,238,206,154, 37, 13,214,186,157, 39,209,175, 75,
+163,123,210,156, 54,109, 26,210,210,210,138, 69,174,156,163,155, 79,116, 4,203,222,196,228,116, 81,190, 43, 74,165, 86,171, 29,
+ 29, 34, 61, 61, 61, 93, 70,134,236, 6, 43,246, 70,126,177,190, 92,246, 72, 22, 0,140, 24, 49,226,174, 8, 86,201,201,233, 74,
+ 98, 52, 26,247,238,221,187,183, 97,175, 94,189,248,139, 23, 47, 58,154, 34, 77, 45, 91,162,193,194,133, 56, 59,126, 60,218,221,
+188, 9,131,217, 12,133, 66,129,109,219,182,153,117, 58,221,222, 10, 86, 22,196,217, 96,169,213,106,120,121,121, 57, 12, 70, 69,
+ 92,121, 89,119,136,206,159, 43, 18, 17,178,247, 57,179, 47,246, 11, 43, 33, 4,122,189,222,209, 89,179, 34, 81, 17,155,205,230,
+ 56,241,236, 29, 20,189,189,189, 29,149,134,125, 52,153,187,205,163,174, 38, 18, 85, 40, 20,158,251,247,239,175,102,159, 70, 34,
+ 35, 35, 3, 3, 7, 14,188,242, 95, 63,185, 40, 40,204, 86, 27, 10,244, 6, 20,232,117, 15, 92,127,229,202,149,184,118,237, 26,
+204,102, 51, 62,249,228,147,187,140, 85, 69, 58,185,151, 82,174,174, 53,106,212, 72,236,222,189, 59,142, 28, 57, 2,185, 92,110,
+161,148, 86,120,254, 42, 42,138, 48, 91,173, 48,232,245, 40,208,106,159,136,187,214,243,103,206,252,166, 86,171, 7, 2,208,228,
+228,228,240, 94, 94, 94, 80,169, 84,208,235,245,185,124,209, 72,193,195,128,201,219, 98,249,108,192,128, 1, 95, 1,128,194, 98,
+249,236, 48, 96, 42,239, 60,183, 88,139,204,250, 3,220,143,246,122,171,172, 58,233, 94,162,211,246, 11,169, 84, 42,133,192,243,
+248,113,214, 4, 68,171,211,209, 40,210, 3,198,212,171,144,121,248,131,120, 71, 96,206,194,109,184,112, 51,171, 66,233, 28,180,
+124, 45, 42, 87,174,140, 77,207,247,134, 66,174,192,160,117,187, 32,145, 72,176,125,244, 64, 72,101, 50,116,254,238,231,123,202,
+187, 86,171, 45, 51, 82,229,110, 4,171,100,222, 37, 18, 9, 26, 54,108,136, 26, 53,106, 96,207,158, 61,104,212,168, 17,174, 94,
+189,138,171, 87,175,226,230,205,155, 56,115,230, 12,178,179,179, 43,124,140, 86,175, 94,141,172,172, 44,200,100, 50,100,100,100,
+ 32, 62, 62,222,173,169, 88, 92, 29,119, 59,181,158,158, 6, 0, 8,169,228, 85, 33,131,229,172,249,249,231,159,223,101,218,159,
+196,150, 14,161, 12, 19,160,175, 85,171,150,210,185,253,148,227, 56,120,120,120,144,137, 19, 39,242, 69,239,225,229,229,133, 74,
+149, 42,185,213,236, 38,145, 72,244,205,154, 53, 83,218, 11,160,221, 56,169,213,106,126,210,164, 73,100,233,210,165,101, 70,181,
+ 92,244,193,250,106,216,176, 97, 47, 37, 38, 38,250, 4, 4, 4, 32, 37, 37, 5, 50,153,172,240,164,232,208, 1,177, 55,110,192,
+ 92,216,167, 8,151, 47, 95,198,226,197,139,181, 70,163,241,171,138,238, 40,141, 70, 3, 63, 63, 63, 71,211,160, 61,130,227,100,
+ 22,233,189, 84,100, 37,151,138, 68, 28,236,154,206, 6,203,126, 97, 29, 53,106, 84, 49,179,229,118,129, 16, 4,107,187,118,237,
+ 4,123, 58, 44, 22, 11,234,213,171,135,180,180, 52, 72, 36, 18,200,100,178, 98,145, 59,119, 12,150,171,137, 68, 5, 65,128,201,
+100, 66,219,182,109, 65, 8,193,183,223,126,123, 79,145,151, 71,206, 96, 89, 69,162,209,248, 33, 36,164, 38, 42, 5, 24, 32,138,
+ 15,238,233, 47, 86,171, 21,163, 71,143, 46, 22,177,178,143, 84,180, 55,241, 23, 54, 43, 89,238,121,210, 86,251,121,125, 63,243,
+191,137, 20,142,166, 45,173,214,240,159, 59,134,225,225,225,158, 69, 77,134, 37,249,133, 82,250,103,169,199,166,104, 74, 6, 30,
+152,113,251,246,237,186, 94, 94, 94,232,218,181, 43, 54,111,216,176,233, 23,192, 17,178,201, 1, 18,125,238,220, 25, 95,244, 62,
+201, 85, 80,175,176, 15,150, 17, 90,173,254,129,231,243,126,111,244, 74,187,161,230,121, 30,235, 22,126,138,104, 85, 42, 26, 86,
+145,227,208,145,147,104, 94, 25,128,233,222, 91,128,237,125,155, 84, 42, 37,164, 50,185, 35,157, 10,149, 10, 18,169,236,158,243,
+238, 92,159,150,172, 47,239, 37,130,231,188, 63, 95,126,249,101, 76,158, 60, 25, 93,187,118,197,213,171, 87,177,111,223, 62, 92,
+189,122, 21,227,198,141, 67, 76, 76, 12,186,117,235, 86, 33,205,181,107,215, 34, 55, 55, 23, 28,199, 33, 51, 51, 19,122,189, 30,
+ 83,167, 78,189,239,227,110, 39,126,231, 39, 0,128,223,118,156,184,103,205,247,222,123, 15,119,238,220, 41, 22,185,122, 82,162,
+ 86, 46, 13,214,229,203,151, 75,109,239,139,137,137, 73,237,210,165, 75, 64, 74, 74, 10, 52, 26,141, 75,115, 69, 8,233,108,159,
+ 43,227,220,185,115,165,106, 86,173, 90,213,220,165, 75, 23, 73,112,112,112,177,209,131,106,181,186,216,201, 90,154,102, 81,229,
+159, 79, 8,121,181,117,235,214, 63,109,221,186, 85, 85,163, 70, 13,228,229,229,129, 82,138,101,203,150, 97,204,152, 49, 80, 40,
+ 20,184,124,249, 50,122,247,238,173,211,233,116,175, 58,207,129, 85,154,102,105, 70,134,227, 56,199,252, 48,165,152,171,114,243,
+238,204,220,185,115, 29,115, 65,149,199,162, 69,139,128, 18, 83, 42,148,166, 73, 41,197,151, 95,126,249,192, 52, 47, 93,186,180,
+204,121,125,100,100,228,183, 79, 61,245,148,144,144,144, 80,204, 84, 57, 47,165, 84, 72,197, 52, 93, 77, 36,202,243, 60, 2, 3,
+ 3,241,241,199, 31,195,207,207, 15, 65, 65, 65,119, 69, 94, 92, 29,163,123,188,123,255, 71, 53, 41, 71,227,230,126, 53,173,205,
+162,239,215, 75,228, 50,224,240,190,223,144,151,125,167,120, 4,214,252,255, 33,209,178, 70,157, 96, 58,177,203,173,116, 26,141,
+ 70,124,254,249,231,152, 54,109,218, 93,115,224,148,113,220,239, 43,239,238,152,172,210, 52, 69, 81, 36, 42,181, 15, 20,234, 16,
+212,137,241,129,232,198, 92,157,226,191,127,220,117, 9, 9, 9, 94,149, 43, 87,198,149, 43, 87, 8,254,223, 31,235,255,199, 74,
+ 38, 27, 4,224,207,242, 52, 9,112,102,213,170, 85,117,235,213,171,135,111,191,253, 22, 0, 94,120,113,251,246,129,207,233,245,
+ 6,160,112,242,209, 34, 51,230, 50,157, 54, 74,137, 82,229, 13,133, 58, 24,117,234,122, 67, 20,221,159,243,148,150,147,119,251,
+197,175,100,244,170,130, 19, 73,223,165,105,191, 65,186,126,248, 15,244,236, 17,134,131, 71,207, 98, 87,130, 10, 97,178, 20,132,
+232,210, 33,166, 95,196,155,253, 27, 97,206,218,194,139,248,217, 56,215,154,132, 16, 28,124,251, 21,168, 85, 10, 60,187,234, 79,
+ 72,165, 82,252,245,230,243,144, 74,229,104,247, 85, 97,147,236,153,207,166, 64, 34,151, 35,250,141,105,110,165,179,100, 75,141,
+189, 43,135,243, 54,229, 69,176,202,203,123,126,126, 62,114,114,114,240,211, 79, 63, 97,248,240,225, 72, 75, 75,195,205,155, 55,
+113,229,202, 21,252,242,203, 47,142,209,233, 21, 73,167,221,188,188,245,214, 91,160,148,162, 78,157, 58,152, 54,109, 26, 90,182,
+108, 89,225, 99, 84,242,184,151,196, 85,244,170, 60,205, 57,115,230,220, 83, 89,122, 34, 12, 86,121,119, 37, 28,199,193,223,223,
+223, 81, 56,156, 11,222,189,220,233,242, 60, 15,171,213,234,232, 56,109, 95, 0,160, 87,175, 94,216,188,121,179, 59, 35, 35,182,
+ 18, 66,134,214,174, 93,251,135,233,211,167,107,218,181,107, 39,132,132,132,160,105,211,166,184,124,249, 50,254,248,227, 15,203,
+252,249,243,181, 58,157,110, 4,165,116,199,189,212,201,246, 71,207, 56, 47, 21,193,102,179, 37,196,199,199, 7,127,249,229,151,
+ 60,199,113,152, 51,103,142,243, 67,174,239, 42,132, 71,142, 28,177,186,106,146,177, 90,173, 9,241,241,241,193,179,103,207,230,
+ 9, 33, 14, 77,231,201, 95,157,247,157, 59,154,165,153, 75,251,128,135,210,150,210,210, 94,218, 49, 46,111, 34, 81, 65, 16,112,
+249,242,101, 76,157, 58, 21,132, 16,252,246,219,111,143,197,201,117,240, 88,242,210, 86, 77, 66,124, 6,245,111, 95,143,128,131,
+201,124,247, 0, 52, 62, 51,199, 97,174,158,153,189, 26,235,223, 30,232,142,217,185,118,236,216, 49,223,207, 63,255, 92,224,121,
+ 30, 95,127,253,117,177,201,126, 75, 30,247,163, 71,143, 90,239,169,121,175,232,124, 54,155,205,208,235,239, 45,106, 66, 57,114,
+104,206,231, 31,118, 89,244,227,102, 9, 33, 38, 28,222,251, 27,114,115, 74, 31,154, 46,147, 8, 88,177,106,147, 85,224,185,132,
+127,249,208, 45,234,220,185,243,212,157, 59,119, 10,149, 43, 87,190,103,145, 54,192,230,121,243,230, 61,245,252,243,207,251,214,
+174, 93, 27,235,215,175, 7, 0, 89,209,130,162,153,221,183,186,103,146,196,141, 95,127,241,225, 11,139,127,220, 44,227,136, 25,
+135,247,253,134,220, 18,102,189, 36, 82,169, 4, 43, 87,109, 52, 11, 2,127,201, 85,189,238, 28,189,186,223, 11,162,115,217,107,
+212,243, 37,124,251,199, 98, 4,212,235,142, 1,189, 98,113,224,219,231, 49, 32,218, 0,243,154, 33,168,219,127, 57,150,189, 83,
+ 24,189,105,184,246, 93,183,174, 63, 30, 30,106, 71, 7,114,142,227, 32, 87,168, 32,145,255,191,255,144, 76,165,130, 80,129, 72,
+150, 61,239,229, 69,170, 42, 26,193,226, 56, 14,145,145,145,168, 90,181, 42, 90,183,110,141, 70,141, 26,161, 67,135, 14, 56,125,
+250, 52, 78,159, 62,141,113,227,198,149,105,174,220, 57, 70, 93,186,116,193,165, 75,151,238,187,144,151, 60,238, 15, 2,119,202,
+210,107,175,189, 6, 0, 79,110, 31, 44, 87, 59,207, 94, 32,233, 3,232,140, 74, 8,129,201,100,114, 52,189, 57,207,171,100,239,
+244,238,230,124, 80, 59, 8, 33, 49, 31,124,240,193,120,133, 66,209, 65,167,211,213, 4, 0,181, 90,125,217,104, 52,254,165,215,
+235,191,166,148,230,220, 79, 90,157,167,101, 40, 37, 31,229,238,140,244,244,244,110,195,134, 13,219,193,113, 92,100,121, 15,231,
+117,186,243,191,153,154,154,250,148, 43,205,161, 67,135,150,170, 89,154,174, 59,154,165, 29,115, 81, 20,203, 52, 87,238, 84, 64,
+174, 38, 18,149, 72, 36, 80,171,213,216,176, 97, 3,252,253,253, 31,171, 19,236,208,241,228,207,203, 91,223,222, 95,190, 23, 64,
+165,103,102,175,190,189, 39,195, 20,222,222, 95,118,107,253,219, 3,171,148,247,155,236,236,236,174,111,189,245,214,159,130, 32,
+ 68,150,119,188,157,140,120,124,122,122,122,133,167, 61,160,148,226,210,165, 75,226,203, 47,191,156,145,158,158,254,220,189,228,
+127,236,248, 47,190,154,247,229,155,126,253,251,180,105, 10, 66, 96, 50,149,209,169,151,128, 82, 74,169,192,115, 9,175,191, 53,
+251,149,127,243,152, 81, 74, 79, 17, 66, 62,170, 86,173,218, 72, 0,101, 93, 9,127,113,165,179, 7, 48,203,140,198, 47,155, 52,
+105, 50,233,221,119,223,245,238,213,171, 23, 42, 87,174, 92,230,124,129,229,113,224,104,226,200,150, 77,130,195,250,245,110,211,
+141, 35,132, 26, 77, 70, 23,245,106,209,254, 20,248, 75,123,143, 36,212,119, 21,157,231, 56,174,194, 93, 20,220,161, 83,255,225,
+232,212,127,184,163, 60,237, 92,211, 30,113,201, 59,208,152, 75,132,113,113, 27, 16, 79,123, 81,231, 93, 94, 39, 56,142, 67,239,
+101, 27,139,165,179,245,103,197,163,179, 53,199,124, 80,161,107,143,243,224,171, 7,213, 7,139,231,121,100,100,100,224,242,229,
+203, 72, 77, 77,133, 78,167,195,133, 11, 23, 96, 54,155,145,157,157, 13,251, 72,195,123, 73,231,131, 58, 70,255,166,230,147,212,
+ 76, 88, 33,131,101,179,217, 18, 93, 61,245,220,106,181, 86,104,148,145, 32, 8,134, 54,109,218,144,210, 70, 27,216,223, 43,149,
+ 74,189,155, 21, 99, 14,128,169, 0,166, 22, 61,111, 10, 89, 89, 89,247,237, 2,109, 54, 91,114,179,102,205,248,242, 12,145,205,
+102, 75,117, 97,134,180, 0, 90, 62,200,131,247, 79,104,150,114,124,180,237,218,181,187,107, 30, 19,231,227,163, 80, 40,202,237,
+117,235,106, 34, 81,157, 78,151, 50,108,216, 48,155,115,179,160,243, 68,164,143, 53,132,222,234, 49,232,165,240, 61, 25,166,112,
+ 0,176,155, 44, 80,122,171,172,159, 36, 39, 39,235, 1,180,251,167,147,118,227,198, 13, 83,243,230,205, 87,230,231,231,191, 70,
+ 41,189,231, 94,250,227, 38,204,121,247,191,118, 88, 40,165,167, 0,140,186, 95, 29, 19,112,177,142,193,240,218,180, 15, 62,120,
+246,195, 15, 62,168, 33, 2,126, 64,225, 28, 85, 60,176,186, 34, 90,135,143,167, 60,240,185,193,108, 54, 91, 98,171, 86,173, 42,
+ 20,169,113, 85,199, 91,173,214,114,175, 19,171, 80, 25, 56, 94, 49,205,127, 34,157,206,154, 13, 26, 52, 64,195,134, 13, 29,175,
+118, 74,126,239,142,102,227,198,141, 81,167, 78,157, 50,103,104, 47,217,231,234,223,206,187, 93,211,110,251, 27, 54,220,254,192,
+ 52,239, 55,157, 79,148,193,178, 63, 99,240, 65,114,254,252,249,127,228,217, 40,148, 62,184,177,222,231,207,159,111,138, 39,148,
+ 75,151, 46,249,221,175,134,171,137, 68,207,156, 57,211,225, 73,221,191,123,210, 77, 47,222,245, 93,145,217,250,183,209,106,181,
+ 85, 40,165,247,212, 51,191,127,255,254,182, 39,245,152,130,210, 98, 19, 79,157, 47,156,160,244,167, 71, 49,169,231,206,157,123,
+224,117,250, 63,113,157,248, 39,210,201,242,254,232,107,254,215, 97, 51, 68, 50, 24,140,178,110, 82,108,108, 47, 48, 24, 12,198,
+189, 65, 0,116, 46,163,114,117,123,228, 14, 33,164,243, 61, 84,222, 59,153, 38,211,100,154, 76,147,105, 50, 77,166,249,100,105,
+186,210,126,208, 35,135,255,205,187,212,127,108, 1,208,153,105, 50, 77,166,201, 52,153, 38,211,100,154, 76,243, 73, 91, 88, 19,
+ 33,131,193, 96, 48, 24, 12,198, 3,134, 25, 44, 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48,152,193, 98, 48,
+ 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,131,113,239,144, 7, 56, 31, 39,131,193, 96, 48, 24, 12, 6, 3, 44,130,
+197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,
+131,193, 96, 48,152,193, 98, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24, 12,
+198,163, 96,176, 8, 33,157,153, 38,211,100,154, 76,147,105, 50, 77,166,201, 52,153,193, 98, 48, 24, 12, 6,131,193, 96, 48,131,
+197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,
+131,193, 96, 48,254, 37, 8,128, 82, 71, 2, 80, 74,119,186, 45,114, 15,163, 9, 92,233, 51, 77,166,201, 52,153, 38,211,100,154,
+ 76,243,241,211,116,165, 93, 17,255,241, 72, 67, 41,253,199, 22, 0,157,153, 38,211,100,154, 76,147,105, 50, 77,166,201, 52,159,
+180,133, 53, 17, 50, 92,221, 97, 8,132, 16,225, 94,215, 63, 44, 77, 6,131,193, 96, 48, 30, 37,216, 69,140, 81,158, 17,106, 9,
+160,103,209,251,223, 41,165,135, 43,178,254, 97,105, 62, 44, 26, 55,110,172, 84, 40, 20, 93,119,239,222, 45,187,112,225, 2,254,
+254,251,111,186,114,229, 74,179,193, 96,216, 30, 23, 23,167,103, 37,230,191, 79,163, 70,141,186, 1,152, 82,244,241,211, 19, 39,
+ 78,108,187,207,115,136, 84,171, 86,109,156, 76, 38,235, 33,149, 74, 67,172, 86, 43, 49, 26,141,201,122,189,126, 71, 82, 82,210,
+108, 74,169,120, 15,154, 77,253,253,253, 71,197,196,196,212,184,113,227, 70,194,237,219,183, 87, 0,216, 6,160, 91,149, 42, 85,
+134, 69, 69, 69, 85, 62,119,238,220,149,140,140,140,133,148,210,191,255,173,116, 50, 24,204, 96,185,119,242,113, 62, 62, 62, 93,
+148, 74,229, 27, 5, 5, 5, 13, 61, 61, 61,207, 91,173,214,121, 41, 41, 41,191,179, 19,239,177, 53, 87, 2,128,158,148, 82, 9,
+ 0,240, 60,223,167,101,203,150,225,132, 16,145, 16, 66, 41,165,132,227,184,134, 54,155,141, 43,218,190, 39, 33,228,111, 74,169,
+181, 34,154,205,155, 55,175, 44, 8, 2,165,148, 18, 74, 41,199,113, 92,253,138,104, 62, 40, 98, 98, 98,102, 81, 74, 67,202,219,
+ 70,173, 86, 55,217,189,123,119,173,141, 27, 55,218, 86,172, 88,145, 51,104,208, 32,205,240,225,195,133, 31,127,252,241, 59, 0,
+111,148,220,190, 78,157, 58, 95,113, 28,231,239,206,255,139,162,152,113,254,252,249,183, 88,201,251,215,153,242,242,103,123,219,
+ 82, 10,124, 63,165, 29, 87,100, 92,238,153,134, 13, 27,254,212,183,111,223, 65, 53,107,214, 20, 68, 81,132,197, 98,129,201,100,
+170,117,226,196,137,246,219,183,111,111, 2,224,185, 10,158,151, 61,167, 76,153,178,228,163,143, 62,170, 36,145, 72,136,197, 98,
+105,241,235,175,191,118, 31, 53,106,212,169,133, 11, 23, 54, 24, 48, 96,128,135,253,251, 15, 63,252,240, 41, 66,200,120, 74,233,
+ 47, 15, 59,157, 12, 6,195,133,193,242,240,240,168, 94,169, 82,165,183,253,252,252,158,106,210,164, 73,238,171,175,190,122,253,
+218,181,107,103, 35, 35, 35,117, 63,254,248,227, 76,139,197, 50,191,102,205,154,219,243,242,242,102,223,185,115,231, 66, 5, 43,
+138,234, 0, 94, 5,240, 20,128, 48, 0,201, 0,254, 4,176,132, 82,122,233, 94, 50, 19, 26, 26, 90, 79,173, 86, 79, 34,132,180,
+208,106,181, 97,106,181, 58,153, 82,122, 52, 63, 63,255,139,148,148,148, 19,247,162, 25, 22, 22, 86, 21,192, 88, 65, 16, 98,109,
+ 54, 91, 36,207,243,183,108, 54,219,126,155,205,246,109,114,114,242,149,123,209,108, 93,217,163,151,168,241,156,109,225,149,149,
+ 11, 12, 86,169, 70, 46, 88, 36,162, 33, 65,212,230, 76, 57,122,187,224,183, 71,177,160,200,100, 50,110,197,138, 21, 13,100, 50,
+ 25, 0,192,100, 50, 33, 38, 38,134,220,143,166, 68, 34,225,102,207,158,221, 72, 16, 4,152,205,102, 49, 63, 63,159, 62,251,236,
+179,255, 74,179, 53, 33, 36, 44, 46, 46,206, 75, 42,149,150,186,222,102,179,161,119,239,222,145, 82,169, 20, 11, 22, 44,176,100,
+102,102, 54, 92,186,116,233,137,249,243,231,251, 47, 91,182,172,127,105, 6,139,227, 56,255,178, 52,109, 54, 27,204,102, 51,172,
+ 86, 43, 76, 38, 19, 58,116,232,192,106,163, 71,131,112, 0,216,114,218, 0, 0,190,247, 43,166, 84, 42,163,159,121,230, 25, 33,
+ 61, 61, 29, 18,137, 4,102,179, 25,119,238,220, 65,181,106,213,248,141, 27, 55,214,172,168, 94,173, 90,181, 70,125,242,201, 39,
+ 1, 91,182,108, 49,175, 92,185,210,216,185,115,103,233,136, 17, 35, 60,219,182,109, 27, 27, 22, 22,198,253,240,195, 15,198,157,
+ 59,119,154,135, 14, 29, 42,159, 53,107, 86,192,159,127,254, 57, 8,192, 47, 15, 59,157, 12, 6,163, 28,131,229,225,225,177, 87,
+163,209, 84,123,229,149, 87, 46,189,246,218,107,219, 53, 26,141, 13, 0,126,254,249,103,161, 79,159, 62,233,207, 62,251,108,154,
+ 78,167,227,231,207,159, 95,229,155,111,190,217,225,225,225,145,148,159,159,223,204,141, 11, 25, 1,240, 6,199,113, 99,187,118,
+237,186,215, 98,177,164,111,218,180,105,205, 51,207, 60, 19, 75, 41, 85,239,222,189,251, 15, 66,200, 34, 0, 95,186, 27, 29, 35,
+132,240, 81, 81, 81,211,194,194,194, 38, 44, 88,176, 64, 30, 21, 21, 5,165, 82,137,252,252,252, 42, 87,174, 92,169,252,198, 27,
+111,244,174, 90,181,234, 60, 47, 47,175,247,227,226,226, 44,110,106,146,144,144,144, 55, 61, 61, 61, 63,158, 53,107,150,162,118,
+237,218, 68,173, 86, 35, 62, 62,190,238,145, 35, 71, 98,150, 46, 93, 58, 34, 44, 44,108,122, 82, 82,146,219,233,108, 79,136, 96,
+168, 90,105,187, 79,173,102,237, 23, 46,249,158,248,171, 85, 16, 8,129,197,108,150,164,234,244, 81, 99, 70,143, 92,211,178, 70,
+208,193,124, 73,106,167,243,231,169,249, 95, 50, 26,114, 0,160,148, 26, 9, 33,191,243, 60,223, 71, 38,147,113,125,250,244,193,
+206,157, 59,137,193, 96, 16, 0, 64,161, 80, 88,251,244,233, 3,165, 82, 9,147,201, 36, 2,248,189,172, 72, 83,105,154, 18,137,
+132,235,208,161,131,238,216,177, 99, 89,118, 77,149, 74,101,233,208,161,131,159, 76, 38, 83, 90,173, 86, 90,158,230, 63,100, 34,
+113,237,218,181, 98,223,229,231,231, 35, 61, 61, 29,153,153,153, 48,153, 76,200,201,201,129, 40,138,196,104, 52,166,139,162, 8,
+142, 43, 12,182,149,165, 41,149, 74,113,249,242,229, 98,223, 89,173, 86,104,181, 90, 24,141, 70,152,205,102,232,245,122,165, 66,
+161,168, 30, 27, 27,155, 8, 96, 99, 65, 65,193,236, 83,167, 78,221, 98,213,211,191,194,237,223, 79, 26,170, 0, 48, 1,136,127,
+ 0,231,147, 8, 0,251,247,239, 71,106,106, 42, 50, 50, 50,144,158,158,142,176,176, 48,220, 75,244,255,210,165, 75,115, 27, 54,
+108, 72, 78,157, 58,181, 25,192,146,213,171, 87, 63,147,149,149,181, 96,226,196,137,190, 95,124,241, 69,214,164, 73,147, 70, 3,
+ 88,191,122,245,234,225,245,234,213,235,117,230,204,153, 57,255, 70, 58, 25, 12, 70, 57,243, 96, 81, 74, 67,170, 87,175,158,245,
+245,215, 95,215,154, 50,101,138, 95, 65, 65, 1, 95, 20, 37, 50, 16, 66,168, 78,167,227, 39, 79,158, 92,233,211, 79, 63,173, 37,
+151,203,179,173, 86,107,165, 82, 52, 74, 27,106, 57,214,211,211,179,119,124,124,252,234, 90,181,106,249,126,242,201, 39, 39,149,
+ 74, 37,157, 59,119,110, 92,213,170, 85,131,111,221,186,181,220,211,211,179, 35,128, 9,101,164,235, 46,205,200,200,200,143,251,
+247,239, 63,225,224,193,131,242,250,245,235, 67,163,209,128,231,121,120,123,123,163,121,243,230,100,223,190,125,242, 30, 61,122,
+140,203,205,205,253,194, 93,205,144,144,144,119,187,119,239, 62, 51, 46, 46, 78,217,169, 83, 39, 34,147,201,144,157,157, 13,185,
+ 92,142, 22, 45, 90,144,133,243,191, 83,214,173, 83,251,195,176,176,176,143,220,213, 52, 87,247,223, 49,232,245,201, 29,126,255,
+115, 27, 9, 12, 12,196,245, 47, 63,194,254,182, 49,184, 58, 99, 10,130,131,131,177,121,203, 86,210,235,133,215,219,120, 90, 2,
+119,187,171,121,191, 56,107, 18, 66, 94, 3,144, 5, 32,139, 16,242, 26,165,244,112, 76, 76, 76,220,133, 11, 23, 16, 27, 27,139,
+ 53,107,214,212,159, 56,113,226,107, 19, 39, 78,124,109,205,154, 53,245, 99, 99, 99,113,225,194, 5,196,196,196,196, 57,247,149,
+114, 71,115,239,222,189,232,216,177, 99,246,154, 53,107,162,166, 78,157, 58,107,234,212,169,179, 86,175, 94, 93,181, 99,199,142,
+217,115,230,204, 49,150,167,249, 79,228,221, 57,178,228,188,136,226,255,175, 45, 1, 1, 1,105,191,255,254, 59,122,245,234,197,
+ 5, 6, 6,166,244,233,211, 71,126,236,216, 49, 10,224,247,138,164,211, 96, 48, 64,175,215, 67,171,213,226,246,237,219,202,249,
+243,231,183,153, 48, 97, 66,181, 53,107,214,132,142, 27, 55,110,180,167,167,231,137, 6, 13, 26,132, 63,236,188, 51, 77,128,227,
+184, 59, 0,204, 0,180, 28,199,221,186, 31,205,126,253,250,213,141,136,136, 8,252,245,156, 15,178,165,181, 32, 74,189, 33, 74,
+189, 97,243,107,138,107,178,167, 16, 26, 26, 26, 24, 30, 30,222,178, 34,154,148,210, 29, 39, 79,158,124,138, 82,186,144, 82,106,
+163,148,174,157, 52,105,210,203,132,144,223, 38, 77,154, 52,146, 82,186,182,232,251,165,167, 79,159,238, 69, 41,253,235,223, 72,
+ 39, 43, 75, 76,147, 81,142,193, 34,132, 88, 62,255,252,243, 35,223,127,255,253,206,148,148,148,224,168,168,168,167,159,121,230,
+153,240,220,220, 92,242,204, 51,207, 68, 6, 7, 7,247,220,187,119,111, 80,255,254,253,119,247,239,223,255, 48, 33,196,101,164,
+129, 16, 82,149,231,249,241,167, 78,157, 58, 80,165, 74, 21,115,114,114,178, 71,195,134, 13,243, 1,160, 70,141, 26,186,204,204,
+ 76,165,151,151, 23,182,110,221,122,140, 16,242, 42, 33,164,150, 43,205,224,224,224, 70,126,126,126,111,124,252,241,199,114,158,
+231, 75,221, 70, 46,151,227,227,143, 63,150,123,122,122,190, 18, 26, 26,218,194,149,102, 80, 80, 80,109, 15, 15,143,247,190,249,
+230, 27,133,209,104,132,201,100, 66, 96, 96, 32, 52, 26, 13, 82,146,147,145,124, 51, 30,169,241, 55, 48,238,229,151,148,106,165,
+114,124, 72, 72, 72, 3, 87,154,177, 17, 30,125,212, 97,117,218,143, 25,251, 6,206,141, 27,142,157,161, 50, 4,141,157,140,250,
+123,206, 34,108,250,108,252, 21,229,137,184,231,186,224,205, 55,223,130, 52, 32,170, 85,171,202,154,129,255, 66,228,234, 11, 74,
+169,146, 82,170, 36,132,204,109,213,170,213, 74,165, 82,249,218, 39,159,124,210,109,251,246,237,221,247,237,219,215,222,106,181,
+ 74,172, 86,171,100,255,254,253,177, 6,131, 65,144,203,229, 16, 4,129,186,171,217,178,101,203,159,148, 74,229,232, 5, 11, 22,
+116,251,235,175,191,134, 29, 63,126,252,117,155,205, 38,179,217,108,178,227,199,143,143,212,235,245, 18, 74,169,173, 44,205,135,
+141, 68, 34,129, 84, 42,133, 82,169, 68,195,134, 13,175,175, 90,181,202, 18, 28, 28, 44, 89,178,100,137, 79, 96, 96,160,122,217,
+178,101, 57, 57, 57, 57,159,185,171,103, 54,155, 97, 52, 26,161,215,235, 97, 48, 24,112,232,208,161,200, 17, 35, 70, 8, 38,147,
+201, 54,108,216,176, 44,139,197, 98, 28, 51,102,140,167, 70,163,121,155, 85, 79, 15,159,162,136,105, 1, 0, 45,165,212,104,255,
+ 62, 34, 34, 66, 30, 26, 26, 90, 47, 34, 34, 66,238,174, 86, 65, 65,193,162,175,190,250, 42,140,147,123,227,128,169, 7,126, 17,
+167, 99,187,215,183, 72, 11,159,128,128,176,106,232,222,189,123, 0, 33,228,219, 7,144,230,141,148,210,254,148,210,117,247,242,
+251,127, 58,157, 77,155, 54,141,109,210,164,201,241,198,141, 27,167, 52,105,210,228,120,211,166, 77, 99,239, 55,207,207,197,144,
+206,195, 26,240,137,253,235, 16, 58,172, 1,159,248, 92, 76,197,231,106, 98, 48,254,105, 92,118,114,175, 84,169,146,233,221,119,
+223, 61,101, 48, 24,206,254,244,211, 79,213,134, 14, 29,218, 48, 60, 60,252,242,179,207, 62,251,135, 70,163,177,218,251,228,184,
+201, 75, 61,122,244,216,226,239,239,143,220,220, 92,193, 98,177,240, 90,173,150, 7, 0, 81, 20, 97, 48, 24,248, 27, 55,110, 8,
+ 70,163,145,182,104,209, 98,211,225,195,135, 95, 5, 48,190, 60, 65,181, 90,253,218,226,197,139, 21,101,153, 43,155,205,134,252,
+252,124, 88,173, 86, 76,159, 62, 93, 49, 97,194,132, 55, 0, 28,113,113, 81, 29, 59,119,238, 92,185,213,106, 5,199,113,160,148,
+226,196,137, 19,200, 76, 75,131, 33, 63, 15,198,188, 92,152,243,114,193,107,243, 49,236,169,110,138,133,235, 54,188, 5, 96, 88,
+121,154, 38,185,230,211,159, 22, 47,133,205,102, 67,202,198, 95, 75,221, 38,235,224, 30,216,172, 22,124,242,217, 23,228,205,151,
+ 6,124, 2, 96,245,191, 85, 48,228,114,185,176, 98,197,138,193, 50,153, 12,148, 82, 98, 50,153,176,125,251,246,251,214, 92,190,
+124,249, 48,187,166,217,108,166,117,235,214,189,171,121,205,104, 52,210, 71,229, 4,145,201,100, 80, 40, 20, 48,155,205,168, 82,
+165,138,190,119,239,222,135,230,206,157, 91,133,231,121,181, 32, 8, 91,115,115,115,103,157, 59,119,238,134,187,122, 69,157,135,
+ 97, 50,153,160,215,235,113,251,246,237,160,208,208, 80,242,222,123,239,217,116, 58, 93,212,210,165, 75,175,253,250,235,175,170,
+111,190,249,230, 89, 0, 99, 89, 21,245,240,168, 86,173,154,204,211,211,211,171,138,159,160,149,240, 40, 72,163,212, 35, 34, 34,
+ 34,220, 98,177, 60, 75, 8,105, 81,163, 70, 13,159,171, 87,175,102,135,134,134, 30,225, 56,238,151,132,132,132, 20, 23,198,135,
+ 88,173, 86,140,108,150,131,215, 90,242,176, 88,114,145,155,155,139, 91,183,110,225,252,249,243, 56,122,244,220, 61,165, 51, 50,
+ 50,242, 37,133, 66,209, 85, 38,147, 69,216,108, 54, 78,167,211,221, 50, 26,141, 59,147,147,147, 23,209,162, 9,138, 42,104,208,
+254,145,116, 58,233,207,126,230,153,103, 66,188,188,188,112,242,228,201,144,211,167, 79,207, 6,208,228,190,206, 75,129,251, 97,
+198,151,223,134, 6,251,123,227,220,193,205,161,115,150,252,250, 3, 10,251,242, 50, 24,255, 29,131,101, 71,161, 80,216, 70,141,
+ 26,117,121,211,166, 77, 17, 77,154, 52,185, 88, 86,103, 96, 23,180,142,142,142,190,117,232,208, 33,248,250,250,154, 45, 22, 11,
+111, 48, 24, 56,169, 84, 74,179,178,178,136, 94,175,231, 78,159, 62,173, 72, 76, 76,148,250,248,248, 72, 0, 52,114, 35,194,208,
+ 50, 50, 50,178,116, 83, 99, 50,161,160,160, 0,249,249,249, 48, 26,141, 8, 12, 12, 36, 28,199, 53,119, 25,214,227,184, 54, 53,
+107,214, 36,217,217,217, 8, 9, 9,193,193,131, 7, 81,144,147, 3, 67,126, 30, 76,121,185, 48,231,230,192,146,155,131,156,180,
+100, 68, 4,135,145,162,169, 5,202,197,202, 43,195, 3, 52,106, 92,157, 49, 25, 77, 79,220, 2,145, 72,113,172,110, 48,168,165,
+176,171, 85,179, 51,201, 32, 82, 25, 46,142,123, 17,129, 67, 95,129,133,147,135, 62,228, 59,119, 35, 33,100, 34,199,113,115,229,
+114,185, 48,122,244,104,164,164,164, 20, 51, 63,163, 71,143,118,244,185,106,219,182,237,126,133, 66, 97, 77, 79, 79,135,209,104,
+148,184,163, 25, 17, 17,113,235,253,247,223, 63,102, 50,153,194, 66, 66, 66,188,141, 70,163,190,102,205,154, 33, 74,165, 50,208,
+100, 50,217,154, 52,105,178, 72,169, 84, 90, 10, 10, 10,168,213,106, 37,143,194, 9, 66, 8, 1, 33, 4, 86,171, 21, 86,171, 21,
+222,222,222,218,204,204,204,163,215,175, 95, 31,124, 47,122, 22,139, 5, 22,139,197, 17,197, 18, 69, 17,103,206,156,129, 66,161,
+144,136,162,120,206,102,179,169, 36, 18, 9,120,158,103,115,212, 61, 68, 26, 55,110,220,190,126,160,231, 87,163, 67,140,222, 85,
+123,169,181, 42, 25,175,253, 34, 83, 25,241,199, 79,218,213, 61,123, 12,244,152, 48, 97, 66,184,175,175,175,226,198,141, 27,134,
+ 57,115,230, 68,174, 95,191,158, 0,248,178, 60,205,228,228,228,223, 62,253,244, 83,223,246,237,219, 71, 73, 36, 18,146,147,147,
+131,244,244,116,164,165,165,225,246,237,219,244,230,205,155,215,173, 86,235,154,138,164,179,126,253,250, 75,135, 14, 29,250,124,
+157, 58,117, 36,148, 82,152,205,102,232,116,186,134, 71,143, 30,237,125,224,192,129, 88, 0, 21, 46,151, 41, 41, 41,107, 62,251,
+236, 51,117,187,118,237,106, 73, 36, 18,238, 65,164,179, 68, 61, 16,162,209,104,176,115,231, 78,120,123,123,195,213,104, 93,119,
+ 48, 90,196,208,160, 0, 63, 24, 14,126,133,234,190,225, 48, 90,196, 80, 86,138, 25,255, 89,131,149,158,158, 46,211,106,181,130,
+ 40,138,124,110,110,174, 74,165, 82, 89,101, 50,153,169,130,255, 87,167,119,239,222,199,154, 55,111, 94, 80, 20,209,176, 4, 4,
+ 4,152,115,115,115, 33,138, 34, 68, 81,180,122,122,122, 22, 88, 44, 22, 68, 69, 69,113, 0, 92, 54, 17,234,245,250, 42, 74,165,
+242,174,239,117, 58,157,195, 92, 21, 20, 20, 64,167,211,193,203,203, 11, 90,173,214,229,201,109,179,217, 34, 84, 42, 21,146,147,
+147, 1, 0,249,217, 89, 48,230,229,193,148,255,127,115,101,203,201,134,168,215,194, 59,172, 50,172, 86,107,101, 87,154, 90,163,
+ 77,198,131, 34,109,243,111, 8,124,109, 98,153,219,101, 31,216, 3,143,234,209,208,235,205, 15,125,142, 50, 74,233,252,134, 13,
+ 27, 54, 90,191,126,253,136,164,164,164,187,214,247,237,219, 23, 99,199,142,197,152, 49, 99, 46, 62,253,244,211,167, 55,111,222,
+140,215, 95,127, 29,162, 40, 54, 32,132,228, 82, 74,255, 44, 79,115,202,148, 41,199, 19, 18, 18,246, 92,185,114,101,116, 64, 64,
+128,188, 94,189,122, 87,235,213,171,199,175, 95,191, 62,240,149, 87, 94,137,235,222,189,251,205, 93,187,118,249,238,220,185, 83,
+ 33,138, 98, 99, 66, 72,210,191, 61, 15,150,189,137,216,100, 50,193, 96, 48,192,108, 54,195,102,179,145, 10,236,211, 98,159, 69,
+ 81,116,152, 53,163,209, 8,139,197, 66,118,236,216,142,205,155, 55,115, 23, 46,156, 15,155, 50,229, 29,228,230,230,194,102,179,
+177,218,233, 33,208,164, 73,147,167, 4, 42, 46, 30, 26,100, 85, 12, 14,180,106,165,132, 22, 92, 89,252,126, 65,124,184, 70,235,
+233,207,155, 60,253, 36, 33,147,167, 76, 14,190,126,237,186,241,243,207, 63,191,208,179,103,207,128, 87, 94,121,165,246,150, 45,
+ 91, 98,171, 84,169,242,253,237,219,183,115,202, 48,230,210, 17, 35, 70, 28,245,246,246,174,186,114,229,202,180,164,164, 36, 31,
+139,197,162,178, 88, 44,102,131,193,112,205,108, 54, 31, 48,153, 76, 59, 83, 82, 82,226, 42,146, 94,141, 70, 83,127,192,128, 1,
+146,156,156, 28, 20,141,190, 69, 90, 90, 26, 26, 53,106,196,239,218,181,171,206,189,236,131,243,231,207,127, 21, 18, 18,178,103,
+211,166, 77, 93,213,106,117, 99,153, 76, 22, 36,138,162, 77,175,215,167, 26, 12,134, 83,247,146,206, 18,251, 34,249,196,137, 19,
+ 33,158,158,158, 72, 72, 72, 0, 33, 36,249,126,143,155, 66,202, 37, 92, 56,176,169,114,117,223, 72, 28, 61,114, 4, 10, 41,151,
+192, 74, 51,227, 63,101,176,242,243,243,133, 19, 39, 78,248, 36, 36, 36,104,252,253,253, 13,181,107,215,206, 37,132,136, 28,199,
+209,148,148, 20,223,248,248,120,133,159,159,159,182,106,213,170, 89,110,254,223,149,113,227,198,197, 78,157, 58, 53,174, 75,151,
+ 46, 25, 0,144,157,157,141,204,204, 76,164,167,167,195,108, 54, 35, 57, 57,153, 59,126,252,184,239,214,173, 91, 27, 2,112,217,
+244,162, 84, 42,111,231,231,231,215,244,246,246,118, 92,208,236,166,202,217, 96,217,163, 89,106,181,218,229,201,205,113, 92, 82,
+ 82, 82, 82, 53,131, 94,143,219, 87,175,194,152, 95,216, 36,232, 48, 87,185, 89, 64, 65, 62,212, 10, 5,242,179, 50,193,243,252,
+ 29, 87,154,106, 57,111,178, 88,109,178, 74,221,123, 3,164,236,235,179, 87,179,214, 16,107,213,131, 82,185,214,242,111, 20, 8,
+142,227,108,229, 53,251,202,100, 50, 4, 6, 6,138, 45, 90,180,192,235,175,191,110, 55, 2,132, 16,210,158, 16,114,128, 82, 90,
+ 80,150,166, 40,138,220,133, 11, 23,158,185,118,237, 26, 47,145, 72,184,230,205,155,199,180,105,211,198, 36,147,201, 32,149, 74,
+133,130,130, 2,143,157, 59,119, 42, 44, 22, 11, 41,210,124,104,243, 96, 1,133,163,251, 74, 49,240,208,106,181,208,235,245, 40,
+ 40, 40, 64, 78, 78,142,160, 84, 42,107,182,109,219,246,136,209,104, 92, 99,179,217,126,136,139,139,203, 43, 75,211,108, 54, 23,
+ 51, 91,162, 40,130, 82, 10,155,205, 6,139,197, 2,137, 68, 34,110,218,180, 25,223,204,159,139,181,171,215,209,206,157, 59,147,
+173, 91,183, 66, 20,197, 68, 86, 61,253,243,136,162, 56,251,175,201,253, 20,176,218,180,198,189,171, 10,182,101, 9,218,239,207,
+253,117, 92, 47,112,121, 85,106,163, 94, 68,229,170,188,151,167, 23,183,108,249,226,204,173, 91,118, 95, 75, 76, 76,204,155, 49,
+ 99, 70,203,168,168, 40,175,203,151, 47,135, 2,200, 41,195, 8, 69, 12, 31, 62,124,120,118,118,182,116,201,146, 37,203,146,146,
+146,246, 82, 74,175,151, 48, 30,141, 8, 33, 95, 0,144, 0, 8, 4, 96, 5,176,131, 82,186,188, 28,179, 34, 18, 66,240,215, 95,
+127,221, 53,218, 79,116, 30,145, 81,241, 40, 86,118,243,230,205,235, 95,185,114,101, 99,118,118,246,202,146,235, 85, 42, 85,239,
+152,152,152, 65,199,142, 29,251,128, 82,122,173,130, 55,110,227, 47, 92,184,240,185, 40,138,225, 28,199,221,162,148, 78,122, 0,
+ 17,172,151,231, 44, 89,189,196, 96,182, 85, 81, 72,249,219, 70,139,248, 10, 43,205,140,255,140,193,178, 90,173,154,247,223,127,
+191,101,131, 6, 13, 82,218,182,109,123, 39, 50, 50, 82,103, 95,231,225,225,161,247,243,243,211, 27, 12, 6,229,173, 91,183,130,
+ 55,108,216, 80,195,102,179,169,220,248,191,221,222,222,222,190,199,143, 31,247,251,229,151, 95,170,159, 56,113, 34,124,200,144,
+ 33,237, 76, 38, 19,140, 70, 35,110,220,184, 17,190,120,241, 98, 81, 42,149,230, 16, 66,254, 6,224,242, 54,222, 98,177, 28,190,
+114,229, 74,141,230,205,155, 19,139,197,226, 48, 84,206, 38,171,160,160, 0, 82,169, 20,201,201,201, 84, 20,197,163,110,164,243,
+200,241, 99,199,170,213,173, 29, 13, 99,110,118,145,185,202,133, 53, 55, 27, 98,110, 22, 56,109, 1,252,124, 5,168, 20, 26, 92,
+ 78, 78, 65, 81, 90,203, 69, 98,213,223, 76,202,205,171, 89,109,218,151,248, 43,202, 19,212, 98,118, 52, 11, 2,112, 52, 23,182,
+186,152,142,253,135, 14, 67,176, 25,147, 30,213, 66,115,250,244,233,180, 33, 67,134,196,137,162,216, 8,229, 76, 81, 80,206, 93,
+120,126, 65, 65, 1, 50, 50, 50,108,153,153,153, 6, 0, 72, 75, 75,203,222,180,105,211, 5, 81, 20,155,221,139,230,131,192, 98,
+177,220, 21,125,178,217,108,176, 90,173, 48,155,205, 72, 79, 79,151, 29, 56,112,160,237,145, 35, 71,164,231,207,159,199,145, 35,
+ 71, 26,108,216,176,225,157,232,232,232,122, 23, 47, 94,188,227,202,180,145,210,141, 53, 15, 0,155,214,255,142, 65,131, 6,145,
+140,140, 12,108,216,176,225,129, 52,163, 48,220, 66, 11,171, 77,105,218,187,170,224,237,171,242,252,115, 58,126, 70, 92, 92,220,
+ 54, 74, 41,237,209,163,199,233,154,181,162,252, 1, 64, 46,211, 4,213,173, 91,183,157,143,143,143, 12, 0, 66, 66, 66, 26, 91,
+ 44,150,249, 0,218,148, 38,218,183,111,223, 86, 1, 1, 1, 13,255,252,243,207, 83, 73, 73, 73,251, 74,154, 43, 0,168, 89,179,
+230,244,179,103,207, 62, 37,145, 72,136, 83, 25,161, 0, 74, 53, 88,253,250,245,171, 25, 22, 22,230,183,229,138, 23,242,164,213,
+ 64,249, 92, 64, 80,192,230, 93, 31,183,164,181, 17, 20,116,201,175, 90,181,106, 13,174, 93,187,118,170,130, 17,166, 42, 3, 6,
+ 12,248, 99,233,210,165,209,221,187,119,151, 1,184,203, 96, 69, 71, 71, 63,187,107,215,174,254,163, 71,143,174, 79, 8,233, 69,
+ 41,189,234,174,126, 92, 92,220, 65, 0, 45, 31,228, 65, 91,115,142,238, 68,209,156,101, 12,198,127,206, 96,153,205,230, 29, 87,
+175, 94,109,218,175, 95,191, 12,103,115, 69, 41,117, 84, 6, 94, 94, 94,122,127,127,255,172, 83,167, 78, 85, 18, 69,113,175, 27,
+255,183,100,215,174, 93,127,205,155, 55,111,149,175,175,175,101,216,176, 97,220,228,201,147,247,103,102,102,210,204,204, 76,124,
+251,237,183,109, 99, 99, 99,247,223,186,117,203, 22, 23, 23, 55, 28, 64,119,151,181,163, 86, 59,255,245,215, 95, 31,180,127,255,
+126,133,125,158,162,146,209, 43,139,197, 2, 65, 16, 48,127,254,124,163, 86,171,157,235, 70, 36, 99,209,119,223,125,215,127,241,
+ 55,243, 20,188,217, 12, 75, 78, 22,172,185, 57,176,229,100,129,211,105,225,161, 32,168,222,168, 18,178,147,228, 88,177,237,160,
+222,106,181,126,231,210, 96, 25, 10, 38,142, 30,249,234,239, 59,118,255, 5,223, 54, 29,145,249,215,214,187,163, 67,149, 2, 97,
+ 50,155,241,241, 71,211, 40,209,231, 76,254,151,238,232,121,147,169,236,150, 95,147,201, 4, 81, 20, 19,207,159, 63,191,154, 16,
+146, 79, 8,105, 95,180,106, 79,105,209, 43,103, 77,142,227,196,218,181,107,175, 15, 12, 12,124, 6,128,182,118,237,218,235,229,
+114,121, 71,147,201,212, 92, 20,197,196,147, 39, 79,174, 35,132,220, 33,132,244, 44,250,233, 67,157, 7,203, 98,177, 96,234,212,
+169,248,244,211, 79, 49,101,202, 20, 71,126,237,205,132,102,179, 57,114,251,246,237,210,131, 7, 15,210,159,126,250, 41,243,185,
+231,158,243, 30, 50,100,136,247,138, 21, 43,198, 3,152, 84,150,230,164, 73,147,176,112,225, 66,140, 26, 53,234,110,119,197,243,
+ 98, 82, 82, 34, 76,102, 19, 93,190,124,121,178, 32, 8, 62, 95,127,253,181,114,194,132, 9,132, 85, 79,255, 60, 54,155,237,189,
+214,179, 55,188, 73,136,210,108,181, 90,231,158, 62,125,114,143,211,141,128,114,246,151,179, 5, 0,248,242,139,217, 18, 74,169,
+151,125, 98,216, 25, 51,102, 40, 70,142, 28, 25, 80,150,238,218,181,107,115,102,204,152,225,247,242,203, 47,119,223,179,103,143,
+138, 16,178, 5,192,223, 0, 50,138,110, 28,253, 1, 28,172, 84,169, 82,240,234,213,171,171,117,237,218, 85,237, 70, 93,247,253,
+130, 5, 11, 34,102,239,243,192, 22,237, 51, 72, 16,159, 3,245,166,240, 13,200, 71,109,205,109,116, 8, 77, 10, 89,185,114,229,
+ 18, 0,141, 43, 96,174,234,244,235,215,111,195,210,165, 75, 35, 95,125,245,213,196,131, 7, 15, 38, 16, 66,166,151,178,105,230,
+139, 47,190,120,107,217,178,101,213, 68, 81,220, 70, 8,233, 78, 41,189,194, 74, 16,131,113,111, 17,172,151, 8, 33, 49, 83,166,
+ 76,249, 60, 36, 36,164,202,180,105,211,226,107,215,174,173,117,156,109,153,153,154,189,123,247, 70,229,229,229,229, 91,173,214,
+ 97,148,210,211,165,156,188,157,157,231,202,160,148,222, 34,132,124,222,160, 65,131, 65,191,254,250,235, 94, 15, 15,143,188, 35,
+ 71,142,120,122,122,122,230, 94,184,112, 65,205,243,188, 46, 62, 62, 30,219,183,111,111, 11,224,155,210,238,146, 74,106,166,164,
+164,156,136,138,138,154, 59, 97,194,132, 55, 62,248,224, 3, 5,165, 20, 58,157, 14,121,121,121, 48, 26,141, 16, 4, 1,132, 16,
+172, 90,181,202,104, 52, 26, 23, 39, 37, 37, 29,113,165,153,156,156,124,184,114,229,202, 63,204,157, 51,231,229, 87, 6, 13,148,
+ 33, 55, 19, 57, 41, 73, 32,186, 2,104,148,114,196,116, 10,131, 54,147, 96,233,222,191, 77, 89, 70,243,234,164,164,164, 61,174,
+ 52, 15,220,206,255,163,101,141,128, 93, 51,102, 76,235,244,206,143,235, 32,138, 34, 46,190,254, 60,178,247,237,128,170,118, 61,
+180,186,152, 14,147,201,132, 41,147, 38,128,215,165,238, 63,114,187, 96,173, 43,205, 7,129,179, 38, 33,228, 53, 66,200,243,209,
+209,209, 24, 61,122, 52,250,246,237, 91,108,219, 13, 27, 54, 96,193,130, 5, 48, 26,141,207, 19, 66, 78, 80, 74,231, 19, 66, 14,
+ 20, 29,219, 2, 87,154, 17, 17, 17, 77, 99, 98, 98, 16, 18, 18,162, 43, 50, 23, 93,206,159, 63,223, 56, 58, 58,186,164,230,223,
+ 69,154,214,135,149,119, 74,105,246,213,171, 87, 61,191,248,226, 11, 98, 54,155, 49,125,250,116,216,141,166,189,229,229,221,119,
+223, 13,209,104, 52,248,242,203, 47, 77, 25, 25, 25, 29, 23, 44, 88,176,123,222,188,121,254,171, 86,173, 26,108, 55, 88, 37, 52,
+211, 46, 92,184,224,177,112,225, 66,206,106,181,226,171,175,190,186,171, 25,114,252,248,241, 48,155, 45, 16,120,193,100,208, 27,
+234, 40, 20,138,107, 62, 62, 62, 74, 81, 20,233,195,202,251,147,172,121,250,244,233, 29, 0,118,184,243, 59,131,193,128,244,244,
+116,100,100,100,160,168, 75, 2, 41, 43,157, 6,131,225,228,164, 73,147,226, 22, 45, 90,212,253,224,193,131,253,247,237,219,215,
+125,231,206,157,134, 91,183,110, 89, 45, 22, 11, 13, 14, 14, 22,218,180,105,163,232,209,163,135, 90, 46,151,115,239,189,247, 94,
+198,204,153, 51,253, 1,100,150, 83,127,242,148, 82,188,221, 54, 31,147, 58,240, 48,153,204,200,201,201, 65, 82, 82, 34,206,159,
+ 63,143,195,135, 47,130, 82,202, 85,112,127,206, 93,185,114,101,148, 76, 38, 35,171, 86,173,170,178,106,213,170,113,174,246,195,
+242,229,203, 35, 86,173, 90, 53,191, 72, 75,100,101,137,105, 50, 42,104,176,138, 78,232,115, 0,186, 19, 66,218,188,250,234,171,
+159, 69, 71, 71, 27,173, 86,171,100,219,182,109,181, 50, 50, 50,100, 86,171,117, 18,165,116, 95, 69,254,144, 82,186,144, 16,130,
+ 62,125,250, 76,170, 90,181,234,174, 19, 39, 78,212,239,221,187,247,182,245,235,215,183,177, 90,173,215,207,158, 61,251, 60,128,
+185, 0,190,113, 87, 51, 62, 62,254,253,157, 59,119, 90,143, 28, 57,242,246,228,201,147,229, 1, 1, 1,196,199,199, 7,201,201,
+201, 72, 76, 76,164, 63,254,248,163,209,104, 52,126,227,229,229,245,190,187,154, 50,153,236,237,125,199,227,200,229,107,215,134,
+191,244, 84, 87, 69,229, 26, 53,161, 33, 53,145,159,153,129,125,123, 82,177,236,239, 83,134, 84,131,233,103,158,231,221, 30, 74,
+ 31,122, 53,189,219,142, 95,150,254,185,103,215,238,206,179, 62,253,156,132, 12,125, 25,234,136, 72,136, 17,213,177,119,207, 30,
+204,156, 49,157,242, 5,169,251, 44,215, 82,187, 60,236,130, 96,159,179, 74, 20, 69, 1, 0,148, 74, 37,198,142, 29, 11,231, 71,
+227, 44, 88,176, 0,122,189, 30, 0, 4, 66,200, 23,132,144, 31,202,138, 90,149,161, 89,101,203,150, 45, 85,156, 53,163,163,163,
+ 75,211, 52, 62,236,252,167,166,166,190,255,226,139, 47,126, 34,145, 72,188,203,218, 70,173, 86, 35, 63, 63, 31, 54,155,205,230,
+235,235,123,201, 30, 25, 45,235, 60,210,106,181,239,143, 26, 53,234, 99, 66, 72,153,145, 14,165, 82,121,235,192,129, 3,213,135,
+ 12, 25,194,173, 94,189,250,198,224,193,131,229, 7, 14, 28,176, 1, 88,199,170,167, 71, 11,231, 1, 11, 90,173, 22, 0,104, 57,
+219,222, 38,132, 76,138,139,139, 83,140, 26, 53,170,241,208,161, 67, 61, 59,116,232,160,113,222, 70,175,215,139,155, 55,111,214,
+ 46, 92,184, 48,115,223,190,125,127,143, 24, 49,226, 25, 20,206, 32, 95, 42,201,201,201,127,124,243,205, 55, 94,237,219,183,175,
+ 97,179,217, 28,253,175,210,211,211,145,152,152,136,155, 55,111,222, 18, 69,113, 83, 5,179,245,250,144, 33, 67,182, 44, 91,182,
+ 44,252,213, 87, 95, 77,252,229,151, 95, 54, 1,200, 45,101, 59,205,179,207, 62,219,123,217,178,101,225, 35, 71,142,188, 13, 96,
+ 28,155,225,157,193,184, 15,131,229, 84, 89, 28, 0,208,146, 16,210,135,231,249,137, 5, 5, 5, 95, 81, 74, 55,222, 71, 69,181,
+144, 16,178,237,234,213,171, 47, 3,104,242,213, 87, 95,189, 3, 32, 1,133, 33,244,174,165,245, 87,112,161,103, 3,240, 65,104,
+104,232,111,211,167, 79,127, 32,207, 34,188,118,237,154, 9,192,235, 33, 33, 33,191,124,242,203,218,247, 41,165,141,120, 42,250,
+217, 8,151,205,113,220, 73,155,205, 54, 51, 49, 49,113,111, 69, 52,215, 20,166,179,107,139, 42, 30, 61, 39,141, 28,242,185, 85,
+162,140, 40, 48, 88,101,106,185, 96,146,218,140,183, 56,125,246,123, 71,110, 21, 60, 18, 23, 86,163,209,104,125,230,153,103,190,
+231, 56, 78, 4, 0,155,205, 38, 24,141,198,225,168,192,200,211,210, 52,251,246,237,251, 35,207,243,214,162,200, 16,103, 52, 26,
+ 95,186, 31,205, 7, 69, 70, 70, 70, 1,128, 49,229,109, 19, 27, 27,187,226,207, 63,255, 28,210,165, 75, 23,219, 31,127,252,145,
+246,244,211, 79, 11, 39, 78,156,160,132,144, 82,239,226,110,222,188,105, 68, 25, 79, 36,176,211,160, 65,131,240, 31,126,248,225,
+196,203, 47,191,236, 57,127,254,124,223, 99,199,142,217,150, 46, 93,154, 87, 80, 80, 48,155, 85, 79,143, 22, 18,137, 4, 42,149,
+ 10, 38,147, 9,233,233,233,112,213,167,156, 82,122,141, 16,242,244,196,137, 19, 99, 39, 78,156,248,116, 88, 88, 88,157, 42, 85,
+170, 84,225, 56,142, 75, 73, 73, 73, 79, 72, 72,184,105, 54,155,119, 1,248, 3,128,180,106,213,170, 39, 1,172, 40, 75,239,252,
+249,243, 31,135,132,132,252,181,126,253,250,167,229,114,121,109,153, 76,230,107,181, 90,185,130,130,130, 44,179,217,124,193,104,
+ 52,254,158,156,156,124,168,130,117,231,101, 66, 72, 7, 65, 16,254, 88,186,116,105,116, 74, 74, 74,196,222,189,123,123,149,220,
+174,113,227,198,203,150, 45, 91, 22, 62,122,244,232,107,171, 86,173,170, 80, 31, 44, 6,131, 25, 44,247, 78,198,141, 0, 54, 62,
+136, 63,166,148,222, 2,240,126,209,242, 64, 72, 74, 74, 58, 3, 96,200,131,220, 65,201,201,201, 7, 1,116, 3, 10,103,115, 78,
+ 40,188,104,222, 23, 71,110,231,255, 14,167,199,171, 60, 34,119,231, 70, 66,200,196,162, 81, 77, 0, 48,241,228,201,147,243, 75,
+ 68,164, 78, 59,175,119, 21,105, 42, 77,243,212,169, 83, 37, 53,207, 86, 68,243,223, 36, 59, 59,251,141,101,203,150, 29,123,253,
+245,215,229, 3, 6, 12,192,197,139, 23,241,221,119,223, 25,179,179,179, 87,221,171,230,169, 83,167,110, 53,104,208,160,209,146,
+ 37, 75,222, 94,188,120,113, 31, 66, 8,123, 22,225, 35,130,193, 96,184, 62,104,208, 32,112, 28, 71, 40,165,212,106,181, 58, 6,
+ 61, 20,205,103,118,221,141,243,202, 10,224,175,162,197, 21, 95,184, 81, 31, 29, 6,112,248, 1,159,251,183, 9, 33, 79,223,188,
+121,115,214,229,203,151,183,150,182,205,185,115,231, 54,116,237,218, 85,117,248,240,225,119, 43, 58,138,144,193, 96, 6,139,225,
+146,155, 15,192, 92, 61,202, 20,245,127,250,193,110,142, 42,186,254, 97,105,254, 91,156, 63,127, 62, 27,128,227,145, 33, 81, 81,
+ 81,232,217,179,231,125,235, 22,153,169,177, 96, 51,183, 63, 82,108,218,180,233,169, 39, 37,175,148,210,219,229,221,156,154, 76,
+166, 77, 0, 54,177, 82,193, 96, 48,131,197,184,247,138,214,120, 63,235, 31,150, 38,131,193, 96, 48, 24,143, 50, 4, 64,231, 50,
+ 46,122,110,143, 14, 32,164,226, 15,218,116,165,207, 52,153, 38,211,100,154, 76,147,105, 50,205,199, 79,211,149,246, 99, 51, 58,
+145, 82,250,143, 45, 0, 58, 51, 77,166,201, 52,153, 38,211,100,154, 76,147,105, 62,105, 11,123,160, 44,131,193, 96, 48, 24, 12,
+198, 3,134,245,193, 98,252,231,120,238,185,231,248,138,108, 31,239,237,205,229, 38, 86,153,173, 81,201,123,233, 12,198,217, 87,
+255,120,247,155,199, 97, 63, 4, 7, 7,215,242,244,244, 28, 6,160,142, 78,167, 11, 80,169, 84,105, 0,206,231,229,229,173, 72,
+ 73, 73,185,196, 74, 10,131,193, 96, 60,226, 6, 75, 38,147,197, 80, 74, 71, 16, 66,130, 8, 33,119, 40,165, 63,152, 76,166,115,
+ 79,218,206,146,201,100, 49,132,144, 17,148,210, 32, 74,233, 29, 66,200,191,188, 31, 8, 89,251, 92, 97, 20,178,255, 26,136, 0,
+165,172, 72,151, 98,174,146,170, 44, 30,222,167,233,139,147, 71,116, 64,163, 1, 95, 77, 66, 5, 38,177,125, 20, 33,132,240, 81,
+ 81, 81,175,135,135,135, 15, 92,180,104,145, 52, 42, 42, 10, 10,133, 2,122,189, 62,248,250,245,235,193,163, 71,143,110, 87,181,
+106,213,213, 55,110,220,248,174,104,142, 56, 6,131,193, 96, 60, 42, 6, 43,162,114,229, 1, 28, 79,230,153, 45, 54, 31,111,111,
+111,238,219,111,191,229,122,245,234,133,223, 55,111,198,216,177, 99,199,133,134,134,136, 82, 65,200,166,162,117,220,205,132,228,
+ 95,221,249,179,103,159,125, 54,213, 98,177,148, 57,171, 53,207,243,105, 27, 54,108, 8,188,223, 76,133, 54, 30,144,106, 49,155,
+203,252, 31, 65,144,164, 37,159, 92,227,214,255, 84,174, 28, 50,128, 39,220, 60,139, 77,244,241,241,241,225,190,249,230, 27,174,
+ 87,175, 94,216,188,121, 51,198,140, 25, 51, 46, 44, 52, 84,148, 74,248,108,209, 70,199,221, 76, 72,248,245,225, 29, 58, 66,214,
+174, 5,135,254,133,159,214,174, 5,215,191, 63,121,162, 77, 86, 70, 70, 6, 1, 0,127,127,127, 90,204, 92,245,110,250,226,123,
+175,118,194,204,197,187,160, 55,154, 86,254,215,243, 25, 21, 21,245,250,115,207, 61, 55,240,227,143, 63,150,114, 92, 97, 43,191,
+ 86,171,133, 94,175, 71,104,104, 40,246,236,217, 35,125,255,253,247, 7,110,216,176, 1, 0,230,177,106,142,193, 96, 48, 30, 33,
+131, 69, 56,204, 95,181,232, 11,159,204,172,108,252,178, 97, 27,162,163,163,113,254,252,121,212,138,142, 70,108,179, 6, 92,215,
+ 86,245, 57,129,144, 74, 31,124,179,124, 62, 0,183,140,133,197, 98, 9, 88,191,126, 61, 8, 33,176,217,108,176,217,108,246, 9,
+251, 80, 80, 80,128,113,227,198, 5, 60,136, 76, 89,204,230,128,235,127,175,131,132, 39,176,218, 40, 44, 54, 10,179, 85,132,217,
+ 74,145,167,179,162,227,211, 67,220,254, 31, 14,220,252, 31,191,249,210, 39, 59, 39, 7,235,255,220,233,216, 15,209,209,209,232,
+216,186, 25,247,220,211,237, 56,181, 66, 94,233,149,201,159,184,189, 31, 30, 4,107,159,251,191,185,114,254,174,255, 26, 60, 81,
+ 17,139,139, 23, 47,242, 70,163,113,144,167,167,103, 11,137, 68, 18,168,242, 14, 22,115,164, 85, 51,181, 36,232,134, 89, 43,107,
+ 59,162,111,181,238,239,190,220, 30, 51, 23,239,194,143,155,254, 94,230, 21,154, 48,245,191,156,223,224,224,224, 90,225,225,225,
+197,204,149,253,161,230,121,121,121,200,207,207, 7,199,113,152, 52,105,146,116,239,222,189, 3,131,131,131,119,178,230, 66, 6,
+131,193,120,132, 12,150,201, 98,243, 9,242,243,198,143, 63,252,136, 73,239,204, 64,173, 90,181, 64, 41, 5, 33, 4,239, 76,157,
+142,175, 63,154,130,129, 79,181,131,197, 42,250,148,165, 81,218, 80, 75, 66, 8,226,227,227, 97, 48, 24,160,215,235, 29, 75, 76,
+ 76,140, 91, 9,118,119,248,166,132, 39,248,227, 68,126,161,177,178,136, 48, 91, 69, 88,172, 34, 58,196,120, 84, 72,211, 98, 19,
+125,188, 60,212, 88,188,112, 62, 38,125,244, 69,177,253, 48,249,221,247,241,221,103, 31, 96,252,168, 23, 96,178,216,124,238, 37,
+157, 21,129,105, 22,231,208,161, 67,193, 42,149,234,171, 33, 67,134,132,140, 27, 55, 78, 70, 5,181,176,237,232, 45,175, 47,127,
+216, 21, 98, 48,153,249,167,219, 84,197, 75,125,155, 96,230,146,191,138,204,213,237, 87, 35,115,114,196,255,114,222, 61, 61, 61,
+135, 45, 90,180,232, 46,115,149,154,154,202, 21, 20, 20,192,108, 54,139, 69,207, 75,196,148, 41, 83, 36,239,191,255,254, 48, 66,
+200, 71, 69, 58, 70, 86,150,152, 38,211,100,154,143,170,230, 19, 99,176, 0,192,108,212, 35,166,138, 47, 22,206,254, 24, 34,229,
+ 64, 65, 65, 69, 10, 74,109,136,244, 87,195,168,211, 86,248, 15, 69, 81,132,197, 98,129,217,108,198,162, 69,139, 80, 80, 80, 0,
+ 81, 20, 81,187,118,109, 0, 64,227,198,141,157,155,184,110,199,197,197,133,187,210, 12,168,215,247, 22, 40,170, 56,127,247,225,
+ 23,223,227,208,201,235, 16, 69, 64,174, 84,161,255,176,145,176,218, 40, 76,150,138, 63,159,212,168,215, 33, 68, 35,193,156, 89,
+ 83, 65, 4, 9,120, 66, 64, 8, 1, 71, 68,212, 10,245,134,201,160,123,232, 7,174,255, 26,136,107,215, 22, 31, 5, 90,216, 15,
+235,201,137, 92,169, 84,170,175, 86,172, 88, 17,222,180,105, 83, 14, 0,142, 93,201,150,127,249,195,174,144,239,167, 61, 67, 26,
+213, 10, 66,102,174, 30, 51,151,238,197,238, 19,201, 91, 75,154,171,255, 48,117,162,162,162,138,153,171, 47,191,252,210,127,254,
+252,249,161, 0,208,175, 95,191,164, 78,157, 58,101, 92,190,124, 25,193,193,193, 36, 35, 35,227,105, 0,111, 20,221,220, 76,164,
+148,206,103,213, 30,131,193, 96,252,203, 6,203,100,212, 35,204, 91,134, 32,141, 0,139,197,138,243,150, 16,228,235, 12, 48,155,
+ 45,184,109, 54,227,198,169, 59,104,221,186, 53,158,121,230, 25,155,217,108,134, 84, 42,205, 93,191,126,189,175, 43,131,101, 54,
+155, 97, 54,155,161,213,106,177,114,229, 74, 8,130,224,120,112,170,243, 19,235, 91,181,106, 85,197, 61, 43,141, 42,215,142,253,
+ 6, 15, 5, 15,171, 72, 97,181, 82, 88, 69,192,106,163,208,155, 41,158, 25,241, 30,108, 54, 10,155, 72, 97,178,186,238,162, 84,
+204,176,249, 54, 69,239, 41,191, 0,208, 56,214,123,202, 41, 38,181,230, 33,147, 73, 32,147, 9, 48,232,244,255,194,161,163,180,
+127,127, 34, 62,169,157,220,141, 70,227,224, 33, 67,134,132,216,205, 21, 0,100,231, 25, 5,131,201,204, 55,170, 21,132, 46, 3,
+ 39, 96,199,234, 47,241,231,193, 43,240,209, 8,251,194, 30, 15,115, 5,157, 78, 23,160, 80, 40,160,213,106, 29,145,171,249,243,
+231,135,154, 76, 38, 14, 0, 4, 65, 18,150, 46,134, 42,108, 34,224,229,153,130,236,236, 92, 63, 74, 41, 41, 50, 88, 95, 16, 66,
+126, 96, 51,231, 51, 24, 12,198,191,108,176,204,122, 61, 44, 22, 43,172, 86, 27, 44, 86, 27,114, 11,244,248,236,179,207, 32,151,
+203, 65, 8,129, 40,138, 40,122, 0, 42,103,177, 88,240,244,211, 79,251,184,250, 67,231,126, 87,148, 82,240, 60,143,230,205,155,
+223,181,221,145, 35, 71, 42,148, 17, 15, 5,143,200,206,239,220,245,253,209,223, 62, 6,165,128, 77, 44, 50, 88,102, 55,174,179,
+ 46, 12, 91,131,182,253, 97, 50,153, 11, 35,122,148,222, 83, 36,239,129,153,172, 39,172,207,149, 29,153, 76,214,121,220,184,113,
+ 50,231,239,124, 60,229, 86,133, 76,106, 59,113, 49,133,236, 88,253, 37,119,252, 66,178, 40,147, 8, 84, 77,239, 68, 61, 46,249,
+ 86,169, 84,105, 58,157, 46, 88,175,215, 35, 47, 47, 15,121,121,121,197, 79,104,137,132,188, 58,106,140,191, 68, 42,131,197,108,
+194,159, 43,102,178, 90,142,193, 96, 48, 30, 53,131,101, 52,232, 96,177,218, 96,181, 20, 62, 65,222,100, 50, 65,169, 84,162,109,
+219,182, 69,151,119,234,120,221,190,125, 59, 76, 38,147,203, 63,180, 90,173,142, 8,150, 40,138,160,148,226,151, 95,126,129, 68,
+ 34,129, 84, 42,133, 68, 34,129, 68, 34, 1, 33,164, 66, 25,177,218, 40,222,157,252, 54, 36, 2, 7,169,192, 65, 34, 16, 72, 5,
+ 14, 54, 74, 65, 65, 97,181, 21, 46, 38,171,123,129,140,242, 12, 27, 0, 24, 77, 22,208, 66, 51, 6,157, 78,199, 74,210, 67, 36,
+ 35, 35,131,232,245,250, 8,111,111,111, 39,171, 73, 81, 73,101, 51, 14,239,213, 32,121,248,135,235, 66, 76, 22, 43,164, 2, 79,
+ 7,119,141, 78,222,181,126,143, 95,134, 49,135,216, 71, 23,254,199, 57,127,237,218,181,224,202,149, 43, 35, 47, 47, 15, 86,171,
+ 85,236,215,175, 95,146, 32, 72,194, 4,137,132,244, 28, 52, 70,188,115, 39,217,194,113, 60, 40,181,225,169,231, 70, 19,185, 66,
+ 41, 53,155, 76, 86, 0, 19, 89,244,138,193, 96, 48, 30, 5,131,165,215,195,106,177, 58, 76,150,217,108, 6, 0,204,158, 61,251,
+ 46, 67, 68, 41,117,172, 47, 87,211,104, 68, 84, 84, 20, 76, 38, 19,162,163,163, 65, 41,197,160, 65,131,238,218,238,216,177, 99,
+ 21,202,136,197, 70, 49,235,179,217,119,125,127, 96,205,199,168, 31, 29,137,230,213, 85, 48, 88, 68,228,106,173,247,109,216, 0,
+192,100, 50, 3, 69,211,225,235,181, 90, 86,146,254, 69, 44, 22, 11,178,179,179, 97, 44,200,182,214, 12,162,185, 47,247,172,106,
+ 76,207,210, 9, 28, 53, 88,195, 60,116,198,130,172, 36, 94,165, 82, 61, 22,121,205,203,203, 91, 49,122,244,232,118,251,246,237,
+147,114, 28,135,188,188, 60,116,232,208, 33, 35, 93, 12, 85,188, 58,106,140,127,114,114,146,213, 83, 41, 24,165, 82, 9,210,210,
+210,196,118, 61,134,232, 7,141,120, 51,228,205,247, 62, 89,148,124,112, 62,235,127,197, 96, 48, 24,143,132,193,210,105, 97,177,
+216,138,154, 8,173,142,168,211,216,177, 99,239,218,118,215,174, 93, 46, 13,150, 32, 8,105, 47,191,252,114,177, 41, 18, 40,165,
+ 88,183,110, 29,100, 50, 89, 49,211,118, 47, 17,172,105,239, 79,128, 76,194, 23, 25,162, 66, 99, 36, 82,138, 77,127,108,199,166,
+ 63,182, 59,182,229,121, 73,218,253, 24,182, 66,163,104, 1,165, 0, 5,160, 47, 96, 6,235, 97,226,239,239, 79,211,211,211,111,
+230,228,228,212, 84,171,213,200,204,204, 68, 86, 86, 22,114,114,114,160,207,203,182,170,173, 57, 90,147, 53, 11,130, 32,224, 78,
+ 66, 42,108, 54,219,157,199, 36,122,133,148,148,148, 75, 85,171, 86, 93,253,238,187,239, 14,154, 50,101,138, 68, 20, 69, 92,190,
+124, 25, 32,132, 74,164, 50,112, 28, 7,137, 68, 64,110,110,158,168,210,120,167,152, 41,175,146, 72,101,224,120, 41,155,112,148,
+193, 96, 48, 30, 41,131,101,181,194,106, 41,236,131,101, 54,155, 97,181, 90,177,120,241,226, 98,102, 72, 42,149,130,227, 56,151,
+ 6,107,253,250,245,197, 38,247,108,220,184, 49,165,148,162, 95,191,126,142,230,198,225,195,135, 99,228,200,145,176, 15, 67,119,
+ 59,138, 97, 3,166,207,156,237,208,233,209, 37, 22,125,158,106, 7, 42, 22, 26,181,180,179, 27, 42,228,216,202, 51,108, 64, 81,
+ 4, 11, 20,160, 20, 5,249,249,172, 36, 61,100, 76, 38,211,206,121,243,230, 69,188,255,254,251,178,172,172, 44,100,100,100, 32,
+ 59, 59,219,177, 20, 20, 20, 32, 40, 40, 8, 91,183,110, 53,231,229,229, 29,121,156,242,126,227,198,141,239, 54,109,218,132,189,
+123,247, 14,156, 50,101,138, 36, 40, 40,136,120,121,165, 18,139,217, 4,128,210,244,244,116, 81,165,241, 78,241, 15, 12,187,157,
+124, 39, 45,218, 98, 54, 65,180,153,121, 86,106, 24, 12, 6,227, 17, 48, 88, 18,129,203,189,114, 43,197,171,146, 90, 9,171,104,
+132,205, 84, 56,181,130,205,102,195,171,175,190,234,216,110,240,224,193,120,225,133, 23,192,113,220, 93,125,176, 8, 33,157, 93,
+205,149, 33,138, 34, 14, 28, 56, 80, 56,237, 1,199, 57,150,178, 40, 75, 83,107,180,225,224,175, 31, 65,164,128, 88,232,123, 64,
+ 65,220, 26, 53, 88,154,166, 43,195,166,240,240, 1, 7, 10,240,192,245,164, 52, 8, 60,151, 91,209,188, 87, 20,166,249,127, 77,
+185, 92,190,234,151, 95,126,233, 17, 27, 27, 27, 94,191,126,125, 46, 43, 43, 11, 5, 5, 5, 40, 40, 40, 0, 0,248,251,251,227,
+194,133, 11,226,173, 91,183,146,228,114,249, 47,143, 83,222,139, 30,127, 51, 47, 56, 56,120,231,212,169, 83,135,101,100,100, 60,
+157,157,157,227,247,251,143, 51,208,253,185,209,164, 93,143,193, 90, 19, 21, 20,137, 41,169,181,246,108,249,217,247,207,213,223,
+193,108, 50,141, 36,100,193, 69,251, 52, 13,172, 44, 49, 77,166,201, 52, 31, 53,205, 39,198, 96, 81, 27, 29,183,240,247, 35,243,
+ 44, 54,209,203,254, 93,157, 58,117, 96, 54,155,177,117,235, 86,135,241, 16, 4, 1,130, 32,184, 21,193, 42,133,219,109,219,182,
+ 45,111, 42,134,219,238, 29,105,220,110,210, 97, 64,149,242,214, 87, 52, 97,174, 12,219,146, 61,103,255,191, 19, 57, 46, 23,148,
+142, 99,197,233,225, 17, 29, 29,109, 59,116,232,208, 91,163, 71,143,254,170, 83,167, 78,161,125,250,244,145, 86,174, 92, 25,114,
+185, 28,215,175, 95,199,254,253,251,205, 55,110,220, 72,210,233,116,111,213,175, 95,255,177,108, 30, 75, 73, 73,185, 84, 52,137,
+232, 27,246,169, 24,228, 10,165,116,240,136, 55,195, 28,163, 8, 87,127, 7,163, 65, 15, 0, 2,155,166,129,193, 96, 48, 30, 1,
+131,117, 59, 41,105, 5,128, 21,206,223, 61,253,244,211, 5,189,123,247, 86,218, 71, 20,218, 71, 3,154, 76, 38,152, 76, 38, 40,
+ 20,138, 10, 77, 8,229,206, 36,162,238,144,118,102, 67,248, 3,221, 43,110, 24,182,228,228,228,112, 86,124,254, 93, 90,181,106,
+149,114,241,226,197, 33, 59,118,236, 24,188,111,223,190,206, 58,157, 46,130, 16, 2,165, 82,121,211,100, 50,237,148,203,229,171,
+ 30, 87,115, 85, 22,102,179,217, 58,101,250,151, 63,241,130,212, 42,138,102, 98, 54,155, 71,192,205,135,186, 51, 24, 12, 6,227,
+ 33, 24,172,210,208,233,116,222,132, 16, 33, 57, 57,249,174,117, 82,169, 20,183,110,221,178, 62, 14, 59,229,129, 27, 54,198, 63,
+ 70,116,116,180,173,232, 70, 96, 69,201,135, 61, 63, 9, 80, 74,141,132,144,137,132,144, 47,138,190,154,120,227,175,185,142,209,
+130,132,204, 59,227,188,142, 69,175, 24, 12, 6,227, 17, 52, 88,123,246,236,177, 2,168,136,137, 74,251, 7,210,156,198, 14,219,
+147,205,154, 53,107,216,136,184,226, 38,107, 62, 33,228, 7,187,225,114,119, 29,131,193, 96, 48, 30, 17,131,197, 96, 48, 30, 89,
+147,101,188,151,117, 12, 6,131,193,248,103, 32, 0,234,150, 81, 41,159,117, 91,132,144,186,247,112, 65, 56,251, 8,105, 6,148,
+163,185,211,133,102,231,123, 72, 39,211,100,154, 76,147,105, 50, 77,166,249, 68,106,186,210,126,108, 70, 39,210,162,217,200,255,
+137, 5, 64,221,255,136,102,103,166,201, 52,153, 38,211,100,154, 76,147,105,254,123,154,143,219,194,129,193, 96, 48, 24, 12, 6,
+131,241, 64, 41,181, 15, 86,165,152,190,224, 74,204,123, 46, 82, 32,253,220,134,123,218, 14, 0,166, 79,159,126, 95,102,238,195,
+ 15, 63,116,235, 41,205,149,234,246, 5,231,198, 24, 50,145, 0,233,103, 55,184,253,255, 36,188,239,251, 16,241,110,225, 7,124,
+ 78,111,111,152,198,138,207,189,209, 80, 67,252, 45, 68,210,211, 67, 33,233, 29,225, 33,105,121, 61,199,120, 72,103, 22, 55, 83,
+ 98,217,120, 62,143,102,179, 61,196, 96,252,243,248, 68,181, 30,226,231, 31, 52, 82,164, 84, 9, 0, 38,147,193,146,148,112,123,
+ 46,205, 62,191,186, 88,221,231, 91,187,127, 80, 72,216, 88,165, 66,173, 44,172,254,136, 41, 43,243,206,252,236, 27, 7,127,126,
+ 88,105, 37, 69,207, 78, 11, 13, 13,245, 62,120,240, 96,120,235,214,173,111, 37, 37, 37,229, 56,111, 83,218, 58,106,159,176,177,
+ 12,205,192,168, 70,207,123,104,212,175, 25,140,198, 72, 47, 79,207,180,172,204,204,133, 41, 55, 78,126,103,223, 38, 60, 60,220,
+115,245,234,213,193,131, 7, 15, 78,142,143,143,207,119,165,201, 96,184, 52, 88, 28, 1,214,172, 89, 13, 74,105,209, 36,155, 20,
+131, 7, 13, 46,117,187,202,242,228, 72, 81, 20, 95, 0, 48,148, 82,122, 42,217, 82,185,223,189, 36,100,215,174, 93,161, 22,139,
+165,169,213,106,109, 4,160,145, 82,165,105, 96, 52, 26,210, 8,232,139, 79, 61,245,212, 73,119,117, 56, 10, 44,249,113, 57,166,
+143,106,255, 7,128, 30,101,156, 88,211, 19,141,161, 21, 51, 72, 34,125,239,239,125,235,228,222, 42,130,106,141,159,157, 4,224,
+145, 52, 88, 33, 33, 33, 74, 0, 47,114, 28,215, 73, 46,151,215, 48, 24, 12, 55, 1,156, 33,132,204, 79, 76, 76, 76,190,199,202,
+141,139,209, 72, 94, 82, 41, 85,221,131,213,178, 70, 41, 57,121, 73, 58,139,184, 95, 36,230, 47, 42,106,136,170, 17, 34,171, 90,
+217,123,239,219,125, 98,163,235, 71, 87,133,237,220, 62,152,204,230,222,199, 83,116,189, 23,157, 76,125,171, 26, 33,141,174, 81,
+106,114, 51, 93,193, 0, 4, 74,105, 2, 0,132,133,133,249,136,162, 24, 11,160, 1,128, 83, 28,199,237, 79, 76, 76,188, 47,195,
+246, 31,210, 12, 17, 69,241,229,192,192,192,167, 83, 83, 83,255,224, 56,110,233,189, 30,111,198,147,129,175, 95,208,107,223,254,
+176, 86,102,255, 76, 69, 81, 50,168, 79,251, 97, 0,138, 25, 44,111,111,191, 23,127, 92,245,167,146,252,255, 9, 27,178, 49, 35,
+250,143, 4,240, 80, 12, 22, 33,132, 80, 74, 49,125,250,116,178,100,201,146,225, 85,170, 84,169, 78, 41,189, 60,109,218,180,185,
+206,219,149, 92,247,225,135, 31,210,162,223,210,210, 52,163, 98,218,108,124,233,133,129,237,199,141,126, 81,163, 82, 42,161,215,
+ 27,252, 22, 44, 89,254,229,119, 75, 87,244,124,161, 95,231,238, 0,176,120,241,226,190,149, 43, 87,142, 48,153, 76,241,211,166,
+ 77, 91, 94,158, 38,131,225,150,193, 42,114,233,184,122,241, 20,254,248,125, 11,142,157,186, 0,209,169, 56,213,169, 83, 71, 45,
+147,201,250,135,201,184, 23,235, 53,106,217,166,247,115, 47, 18, 11, 81, 97,230,132,193, 21,158, 7,235,196,137, 19,242,148,148,
+148, 25,145,181, 26,191,217,190,107, 31,174,118,116, 45,248,251,249, 64,228,100, 88,182,245,138,223,158, 69,195,191, 5,208,210,
+109, 31, 68,128, 87,134, 63,143, 80, 25,122,252,186,229, 40, 82,114,108, 32, 4, 32,164,208, 16, 22, 24, 68,188, 59,162,205,135,
+ 21, 55, 72,132,243, 86, 17,140, 95,101, 0,128, 71,242,185,110,193,193,193,141,252,252,252,190, 27, 62,124,184, 79,141, 26, 53,
+130,101, 50,153,202, 96, 48, 84,191,125,251,118,228, 87, 95,125,213, 37, 56, 56,248,211,148,148,148,117, 21,209,140,246, 86, 84,
+121,170, 86,248,175,147, 71,189,216,172,102, 68,101, 8,198, 2,136, 70,109,229, 91, 55,174,181,156,245,227,186, 87, 98,188, 36,
+131,206,229, 90,220,238,144,168,240,144,190,247,238, 75,131,163,171,169, 41, 76,103, 15, 66,194,243, 80,120,250,160, 57,207,131,
+ 35,180,246,135,251,147,222, 5,240,161, 27,149,238, 71, 0,222, 5, 64,164, 82,233,186,192,192,192,203,173, 90,181,170, 63,112,
+224, 64, 82,183,110, 93,156, 58,117,170,225,239,191,255, 62,162,114,229,202,167, 45, 22,203, 95,106,181,250,200,181,107,215,220,
+ 50,110,213,170, 85,147,105,181,218, 22, 18,137,164,195,163,172, 25, 18, 18,162, 52,153, 76, 47,132,133,133,189,218,187,119,239,
+122,189,122,245, 34, 53,107,214,196,165, 75,151, 26,255,249,231,159, 31, 54,104,208,224, 76, 98, 98,226, 98,153, 76,246, 83,114,
+114,178, 91,147, 0, 15,172, 75, 46,173, 62, 75,107,221,235,250, 18,199,200, 27,128,146, 82,154,236,198,182,129, 0,212,148,210,
+235, 15, 91,243, 31,186,209,185, 0,192,215,254,208,122,142,227, 28, 15,176,119,126,181,191,183,217,108,218,219,183,111, 87,117,
+161, 89, 83, 20, 69,183, 91, 2, 8, 33, 52, 37, 37,229, 82,153,117, 60,168, 12, 0,102,125, 56, 1, 73, 9,183,160, 55,104,245,
+ 57, 57,153,203, 74,110,151,147,157,181,226,229,161, 61,223,144,201, 20,146,208,202,225,120,119,250,151,176, 71,189, 30, 22,211,
+167, 79, 39, 31,126,248, 33, 22, 47, 94,220, 11, 64, 44,165,116,127,116,116,244,188, 18,215, 44,199,186, 15, 63,252,112,238,244,
+233,211, 9,128, 82,141, 80,165,168, 6,195,134, 13,234,219,254,157,183, 95,211,216,191, 83, 42, 21,120,251,141,145, 50,189,209,
+212,114,193,247,203, 95,157, 59,115,242, 18, 0, 29, 1, 52,161,148, 30, 7,176,188, 60, 77, 6,195,109,131, 37, 82,224,143,223,
+183,224,237, 41, 31,224,135,101, 63,225,167,207, 70,146, 38, 77,154,180,165,148,190, 24, 17, 85,173,255,179, 67, 70, 42, 35,170,
+215, 69,129,232,137,248, 12, 17, 39,254, 90,133,146,119, 62,174,216,182,109, 91, 19, 74,241,227,232, 41, 95,213,170,223,176, 41,
+206, 38, 89,113, 48,193, 6,237, 53, 27, 4, 94, 15, 81,172,248, 16,115,123,179, 95,227,198,141,145,152,109,197,254, 75, 38,240,
+ 28,192,113, 0,207, 17,240,228, 30,247,148,104,186, 50,227,199, 19, 49, 25,169, 34, 32,154,174, 60,106, 7, 50, 52, 52,180, 99,
+ 84, 84,212,156, 55,222,120, 35, 40, 37, 37,197,247,216,177, 99,144,203,229,240,241,241, 17,252,252,252,106, 77,153, 50, 37,119,
+214,172, 89, 19, 3, 3, 3, 79,166,166,166,222,116, 71,179,142, 70, 22,221,174, 81,204,161,169,211, 62,244, 50, 29,253, 19,217,
+171,214,128,231, 40,164,106, 13, 66,148, 74,204,235, 26,225, 59,121,119,194,186,122, 74,101,244, 25,189, 62,201, 29,205,202, 1,
+190, 93,171,215,172,133,236,245,223,226,106,158, 17,135,211,141,232,211,174, 25,170,249, 42,209,192,106,131,159, 66,232,232,202,
+ 96, 17, 66,124, 0, 76, 54,153, 76,156, 84, 42, 37, 10,133,162,255,178,101,203,118,215,172, 89,211, 96,223,166, 69,139, 22,104,
+209,162, 5,209,106,181, 13, 14, 30, 60,216, 96,253,250,245,230,224,224,224, 3, 41, 41, 41,115,202,210, 85, 42, 85,183, 13, 6,
+125,101,149, 90,109, 90,186,100,201,174, 22, 45, 90, 80,137, 68,130,251,209, 4,128,160,160,160,117, 17, 17, 17,254, 51,103,206,
+204,111,214,172,217, 3,209,140,140,140,220, 30, 27, 27,219,161,107,215,174, 66,235,214,173, 17, 18, 18,226, 88,231,239,239,143,
+216,216, 88,146,144,144, 80,127,255,254,253,243,183,111,223, 62, 47, 50, 50,242,175,248,248,248,174,174,142, 15, 5,106,222,207,
+250, 18,240, 0,102, 17, 66,150, 80, 74, 15,150,115, 60, 27, 1, 24, 2,224,179,127, 73,179, 92,148, 74,101,170,193, 96, 8, 0,
+ 0,133, 66,145,166,215,235, 3,221, 48, 55,154,207, 63,255, 60, 64, 42,149,130,231,121,216,108, 54,199, 66, 41,133, 40,138,197,
+ 58,195,126,246,217,103,110,205,237,118,231,206, 29, 45, 10, 71,127, 83,167, 69, 44,237, 53, 34, 34,194,223, 29,205,164,132, 91,
+240,176,196,103, 6,122, 40,195, 35, 61,188,103,180,110,221,122,134,243,250, 86,209, 94, 0,242,160,215,223,185,149,148, 0,191,
+127,161,110,243, 94,178,100,201, 11,139, 23, 47,238, 67, 8,209, 22,237,223,122,111,190,249,230, 95, 37,246,121,189,162, 87,109,
+ 72, 72,200, 30, 66,200,230,208,208,208, 31, 1,220, 21, 29,246,210,120,140,124,107,204, 43, 26, 0,152,190, 54, 3,211,214,166,
+227,131,103,124, 49,233,105, 53,134, 15,237,167,254, 97,249,175, 35, 1, 44,113,210,190, 20, 29, 29, 77, 46, 94,188,200,204, 21,
+227,193, 68,176,142,157,186,128, 31,150,253,132,161, 67,135,225,220,206, 69, 91,158,122,230,249,238, 45,218,118,133, 85, 26,128,
+ 75,105, 4, 9,241, 20, 2,111, 5, 7, 17, 55,254,222, 72, 57,142,251,169,132, 70,153,211, 38,108,217,178,229,173, 42,213, 26,
+124,250,238,180, 79,248,179,169, 50,252,184, 95, 15,155, 49, 23,250,140,107,208,166, 93, 65,254,157, 11,200, 73, 58,123,134,227,
+184,105,238,106,222,157, 7, 64,164, 20,132,146,194, 42, 7, 20,119,117, 26,131,155, 67, 66,205,218,139, 81, 53, 99, 98,178,101,
+ 54,192,172,189,232,250,191, 31,252, 48,211,178, 52, 67, 66, 66,186, 68, 68, 68,124, 49,114,228,200,176, 51,103,206,120,234,116,
+ 58,237,209,163, 71,247,166,164,164, 4,250,251,251, 39, 12, 28, 56,176, 85, 96, 96, 96, 64,219,182,109, 85,219,182,109,123, 15,
+192,203,174, 52,235,170,101, 49,177, 77,235, 30,254,248,243,217,234,140, 53,223,192,116,237, 52, 14,103,232,113, 38, 83, 79, 67,
+ 61,114,200,128,104, 95,168,100, 2, 70, 54, 14,212,188,177, 45,254,179,162,139,153,203,188, 71, 6, 7, 86,181,232,117, 48,232,
+ 45,216,114, 61, 87,127, 56, 47, 55,128, 59,125, 59,125, 82,175,166, 10, 62, 61, 25, 65, 26, 73,245,138,238, 79, 66, 8, 20, 10,
+ 69,169,235,188,189,189,209,178,101, 75, 68, 69, 69, 73, 7, 15, 30,220, 17,192,156,178, 52,205,102, 83,176, 40, 82,120,122,122,
+ 74, 59,117,234, 68, 8, 33,180,228, 3,204, 43,170, 9, 0,106,181,186, 91,131, 6, 13,248, 85,171, 86, 21,220,185,115,231,230,
+211, 79, 63,157,161, 80, 40,196, 18,219, 32, 60, 60, 28,175,191,254,186,244,229,151, 95,118,169, 25, 24, 24,216,101,197,138, 21,
+ 32,132, 56, 46,220, 37, 9, 15, 15, 71, 80, 80, 16,122,244,232, 33,244,235,215,175, 75,121,251,115, 96, 93,114,201,110,158, 6,
+212, 37,229, 94, 68, 6,212, 37,148, 0,151, 75, 70,178, 74,106, 82, 74, 51, 9, 33, 11, 1,172, 39,132,244, 47,205, 16, 17, 66,
+ 90, 3, 88, 11,224, 41, 74,105,154,171,227,238,172, 41,147,201,164,102,179,217,167,164,241,169,168,166,115,196, 39, 46, 46, 14,
+141, 27, 55,134,243,171,193, 96,112, 60,123,149, 16, 18,224,110,249,228,121, 30, 95,125,245, 21,120,158,135, 84, 42,133, 76, 38,
+ 43,245,181,105,211,166, 21,173, 67, 18, 8, 33, 92,149, 42, 85, 38,243, 60,255,178,201,100, 10,147,203,229,201, 54,155,109,153,
+175,175,239,204,184,184, 56, 11, 0,239,210,158, 13,235,172,169, 55,104,245, 84, 20,149, 38,147,193,162, 84, 43,195, 15, 30, 60,
+ 88,163,172, 99,110, 52, 26,209,169, 83, 39,164,230,107,211,237,191,121, 88,117,221,193,131, 7,195,171, 84,169, 82, 19, 64,108,
+209, 87,251,146,146,146,218, 58,125,118,102, 95, 82, 82,210, 83, 69,239, 47,223,190,125, 59,220,110,176,156, 53, 77, 38,115,164,
+ 70,163, 6, 0, 76, 91,155, 14,227,138,170,144, 15,187,142, 17,205,141,240,240,240,128,205,102,173,249,230,155,111,254,132,194,
+115,226,111, 74,105,223, 55,223,124,179, 22,128,221,225,225,225, 27, 0,228, 62,236,122,254, 73,208,124, 44, 13, 86, 81,147,178,
+189,105,153,136, 20, 24, 60,104, 48, 68, 10,108,221,186, 21, 98, 97,221,237,153,168,247, 70, 65,188, 63, 4, 78,132,192, 19, 8,
+ 60, 0, 16,100, 38, 94,128, 73,155,121, 32,209, 20, 26, 47,186,225,239,183,110,221,218, 50,162,118,179,207,166,125,252, 37,247,
+195, 62, 61,114,117, 6,100,156,223,132,148, 99,223,167,136, 86,243, 38,142,227,142,115, 28,119,162, 81,253,122,151,130,131,131,
+239,121,214,110,145, 2, 54,103, 99, 37, 2,228, 49,139,238,134,133,133, 61, 85,173, 90,181, 79, 70,141, 26, 21, 30, 23, 23,231,
+145,159,159,159,190,115,231,206, 75,102,179,249, 36,199,113,115,147,147,147,219,173, 88,177, 66, 53,105,210,164,174, 53,107,214,
+172,185,125,251,118,157,203,200,149, 90, 90,255,249, 33, 3, 15,247, 25, 53, 78,113,254,215,239, 32,191, 16,135, 69, 87,178,109,
+199,211,245,239, 25, 10,172,115,148, 42,161,117,182,209,186, 99, 66,243, 16, 46, 88, 45, 65,101, 79, 73,123,119,211, 43,147, 41,
+ 4, 42, 40, 96, 50, 89,161,181,136,166,243,233, 84,251, 86,187,122,102,170,246, 87, 0,128,192,113,130, 27, 39,118, 54, 33,228,
+ 51,153, 76,246, 62, 33,132,246,233,211,231,102,163, 70,141, 12, 0,160,215,235, 97, 52, 26, 33,145, 72, 96, 48, 24,112,227,198,
+ 13, 28, 57,114, 4, 62, 62, 62, 21,218,175,217,217,217, 8, 15, 15,135, 70,163,185,111, 77,155,205, 70,190,251,238, 59,217,185,
+115,231,100,191,253,246,155,231,132, 9, 19,180,205,155, 55,191,245,244,211, 79,167,121,122,122, 90, 79,157, 58,133,195,135, 15,
+ 35, 39, 39, 7,205,154, 53,115, 75,211,100, 50, 65, 16, 4,232,245,122,200,229,114, 8,130, 0,171,213, 10, 81, 20, 29,166,171,
+160,160, 0, 89, 89, 89,144, 74,165, 40,205, 40, 58, 99, 55, 75, 3,234, 18,250,235,150, 67,105,128, 72, 97,202,183,192,148,107,
+129,209,190,100, 91, 6,140,159,221,224,215,179,148, 84,160, 18, 62, 66, 8,233, 15, 96,109, 73,147,229,100,132,250, 83, 74, 79,
+ 85, 84,211,108, 54, 31,176, 27, 31,133, 66, 17, 64, 72,161, 49,148,203,229, 22,163,209,216,161, 34,154, 0, 16, 23, 23,135, 70,
+141, 26,241, 69,154,206,221,108,196,138,158,151,132, 16,240, 60, 15,185, 92, 14,142,227,208,188,121,115,244,235,215, 15,209,209,
+209, 72, 72, 72,192,246,237,219,113,241,226, 69, 72,165,210, 98, 77,133,238,208,190,125,123, 62, 50, 50,242, 80,151, 46, 93, 98,
+198,142, 29,171, 8, 15, 15,199,165, 75,151,170,204,255, 31,123,231, 29, 22,197,213,182,241,251,204,246,194,210,123, 17, 80, 64,
+170,138,128,136, 21, 75,108,177,199, 26,163, 49,177, 39,118, 99, 73,140, 61,154, 24, 99,141, 45,177,247,104, 98,239,189, 87,176,
+161,136,162,128,244,222,183,239,206,249,254, 0,124,213, 40, 44,232,251, 38, 95, 50,191,235,154, 11,157,157,185,231,204,204,153,
+ 51,247, 60,167,173, 90, 53,229,210,165, 75,221, 66, 66, 66, 66,163,162,162,170, 76,115, 70, 90,202,138,126,221, 34, 63, 45,200,
+207,219, 90,203,207, 98,150, 70,163,193,195,135, 15, 77,222,231,127, 85,198, 53,109,218, 52,137, 82,250,132, 82,122,145, 16, 82,
+ 47, 53, 53,181,133,139,139,203, 81, 74,169,252,181,107, 94,154,154,154,218,209,197,197,165,136, 82,122,143, 16, 18, 71, 8, 73,
+ 74, 73, 73,249,243, 71,146,133,121,118, 73, 73,169,131,153,153, 28,223,116,179,132,248,147,167, 24,221,138, 7,189, 94,143,103,
+207, 18,225,233,225, 70,118,110,216, 31, 10,224, 38,128,176,168,168, 40, 0, 8, 5,144,144,156,156,236, 84, 97,176, 56, 56,170,
+ 29,193,122,189, 23,160,125,189,238,168, 37,226,245,188,127,108,233, 53,111, 29,117,119, 8,252,176, 60, 18, 93, 22,169, 78,186,
+115, 12, 44,203,110,202, 52,161, 87,222,213,171, 87, 37, 6, 22, 27, 38,127, 61,135, 89,123, 86,133,204,140, 52,164,157, 95, 8,
+ 85,214,195,141, 82,169,116, 98,155, 14,157,139,106,114, 34, 47,247,104,116, 17,166, 4, 90,218, 56, 66,163,163,229, 6,235, 85,
+147,245, 79,193,217,217,185,139,151,151,215,156, 3, 7, 14,184,171, 84, 42,197,229,203,151, 11, 78,158, 60,249, 68,167,211,173,
+ 75, 79, 79,223, 86, 94,232, 28,224,243,249,115, 1, 64,161, 80,240,121, 60,158,180,178, 70,154, 65, 22,194,134,131, 63, 29,112,
+105,194,178, 95, 37, 79,238,223,193,178, 61, 71, 32, 54,106,141, 15,242,181,221,239, 23,235, 15,149,111,118,166,147,179, 44,149,
+130,186, 9, 24, 2,107,169,208, 49,130, 16,201, 85, 74,213, 85,165,217,214,205,157,209,215,242,196, 69,131, 26,102, 10,161, 8,
+ 0, 92,124,252,121,183, 85,122, 92,190,251, 16, 18,137,149,208,196,151,236, 12,123,123,251,198,231,207,159, 39, 37, 37, 37,234,
+123,247,238,193,218,218, 26, 14, 14, 14,176,176,176,192,195,135, 15,113,250,244,105,196,197,197,129, 82,138,250,245,235, 87,235,
+218,102,102,102,162,168,168, 8,221,187,247,104,157,150,150, 42,177,119,112,212,158, 57,125,234, 84, 77, 52, 89,150, 37, 0, 16,
+ 24, 24,136,192,192, 64, 65,106,106,170,229,161, 67,135,204, 22, 44, 88,224,108,103,103,119, 83,165, 82,189, 98,156, 76, 53, 88,
+ 0,160, 86,171,161,209,104, 32, 20, 10, 33,145, 72, 32, 20, 10, 81, 84, 84,132,204,204, 76, 20, 23, 23,191,136,184,153,170,251,
+226,211,100, 75,179, 91,127,206, 28,159,218,215,240, 75,247,114,185,201, 58, 67, 8,169,184,191,153,229,127,123, 85, 86,213, 87,
+133,230, 43, 17,150,151,162, 76,130,154,104,134,132,132, 84,104,188, 82, 74, 72, 36,146,172,138,200,149, 68, 34, 49,105,170, 46,
+ 66, 8, 88,150,133, 80, 40, 68,253,250,245,241,205, 55,223,224,193,131, 7, 56,123,246, 44,156,156,156,208,165, 75, 23, 8, 4,
+ 2, 36, 38, 38,190,210, 62,203,148,155,147,152,152, 56,165, 93,187,118,129,203,150, 45,147, 36, 37, 37, 33, 54, 54, 22,230,230,
+230,152, 51,103,142,120,234,212,169, 94, 87,174, 92,153, 1,224,199, 42,175, 97,222,195, 61,229, 6, 23,193,193,193,159,182,105,
+211,230,207,229,170,157,157,197,142, 29, 59,236, 43,140,215,203,251,252,175, 72, 77, 77, 45,152, 53,107,214, 18, 63, 63,191,165,
+229,213,130,205, 41,165,242,180,180,180,200, 61,123,246, 16, 0,232,213,171, 23,117,118,118, 62, 87,158, 55,238, 45, 93,186,180,
+ 85,108,108, 44,157, 53,107,214, 27,203,185,244,172,244, 53, 63, 46, 95,187,100,214,180,241,162,175, 58,201,240, 89,184, 6, 44,
+203,130,199,227, 97,217,234, 13,250,184, 7,247,238,134,134,134, 30,162,148,118, 47,143,102,150, 0,136, 35,132, 36,136, 68,162,
+180,103,207,158,113,238,129,163, 74,152,151,195,227,111,219, 40,235,222, 62,176, 44,235,100,105,231, 98, 61,252,227,246, 96, 89,
+192,192, 2, 6, 35,133, 74, 89,138,140, 71,103,149, 90,173,214,164,135, 46, 55, 55,119,238,224,113,223,123,221,122,206, 71,122,
+190, 22, 41,167,231, 80, 77,206,163,143,186,116,233, 50,164, 77,155, 54, 69, 53, 62,145,242,158,143, 46,194,148, 64, 43, 91,231,
+115,223, 46, 92,143,155,207,180, 96,233,127, 34, 89, 70, 22, 96,255, 33, 1, 44, 23, 23, 23,111, 43, 43,171, 69, 7, 14, 28,240,
+ 16,137, 68,138,248,248,120,227,185,115,231,210,244,122,253,170, 10,115, 85,110,194, 6, 4, 5, 5,233,101, 50, 25,148, 74,165,
+ 90,175,215,151,188,205, 92, 5, 74,165,174, 33, 65, 65, 23, 38, 44,251, 85,162,214,106, 81,168,210,192,206,201,209,120, 47, 95,
+217,253, 94,177,230,208,139, 8,151, 66,208, 36,180,142,139, 11,145, 40, 64, 1,164, 22,107,211, 76, 49, 87, 0, 32, 87, 88, 48,
+174,161,145, 8, 29,187, 2, 42,158, 5, 5, 0, 43,123,103,166,213,168,239,208, 97,217,121,104,248, 10,147, 45, 48,159,207,215,
+120,123,123,171,203, 11, 85,228,230,230,226,193,131, 7,200,203,203,195,138, 21, 43,240,232,209,163, 23, 47,221,234, 25,140, 23,
+ 47,113,100,103,103,137, 41,165,200,202,204, 16,213, 84,179,194, 96,189,116,239, 48,114,228, 72,126,105,105,169,228,101,115, 85,
+ 93,131, 85,145, 14, 74, 41,180, 90, 45, 10, 11, 11,161,213,106,241,228,201,147, 23,230,170, 60,130, 86,189,243,215, 22,235,223,
+184, 94,157,167,127,135,234,132,203, 0,132, 47, 13, 82,232, 80, 83,115,245,154,241,169, 86,244,167,170, 8, 22,222,208,128, 89,
+165, 82, 57, 80, 74, 73, 84, 84, 20, 76,105,127,245,178,193, 18,137, 68,232,221,187, 55, 98, 98, 98,144,156,156, 12, 62,159, 15,
+181, 90, 13,181, 90,141, 70,141, 26, 65, 36, 18, 85, 55,130, 69, 5, 2,193,128,209,163, 71, 75, 18, 18, 18,144,147,147, 3,134,
+ 97, 96, 48, 24, 96, 52, 26, 49,100,200, 16,169, 72, 36, 26,128,106, 54,196,190,125,251,118,251,203,151, 47,215,125,125,201,206,
+206, 46, 20,139,197,127,203, 50,112,207,158, 61,164, 87,175, 94,180, 87,175, 94,180,194,104,153, 74,118,194,253, 53,219,118,238,
+ 59,249,205,172,133, 37, 57,185,121,144,203,229,200,206,201,197,183,115, 23,233,207, 94,186,113,110,228,144,143, 35,150, 44, 89,
+242, 61,128,184,242, 93,226,150, 46, 93, 58,104,232,208,161, 91, 42,134,107,224,224, 48, 57,130, 85, 81, 69,248,150, 47,187, 96,
+ 75, 91,151,179,211,230,255,106,182,247, 46, 15,249,233,113, 80,103,197,193,173, 97, 55,100,198, 93, 6, 53,234,255,120,240,224,
+ 65,105, 85, 7, 59,126,252,184,143, 91,221,208,177, 13, 66,194,177,240,112, 9, 74, 30,236,132, 54, 63, 97,117,231,206,157,247,
+189,235,137,176, 20,152, 48,160, 73,160,149,141,211,185,175,191,255,213,250, 96,140, 0,185,105,113,120,180,127, 10,140,186, 63,
+213,138, 29,169,174,190,148,213,138, 74, 10, 50,161, 45, 54, 66,194, 40, 37,127,245,141, 75, 77, 77,125, 18, 24, 24,184,249,151,
+ 95,126, 25, 81,191,126,125,217,216,177, 99, 31, 23, 21, 21,205, 75, 75, 75,251,237,165, 23,121,235,218,181,107, 79,154, 51,103,
+142,215,243,231,207,113,225,194,133, 39, 60, 30,239,230,219, 52, 99, 84,170,148,122, 22,226, 85,151,182,175,251,138,231, 94, 23,
+187,102, 77, 54, 92,185,255,176,235,131, 98,195,209, 23,230,202, 76,228, 23, 17,232,125,232,203,209, 35, 24, 99,244, 49, 60, 74,
+206, 66,122,169,254,180,201,233, 46, 86,234, 5, 98, 41,204, 28, 61,144,164,102,133,174,174,174, 55,134,246,232, 34,100,120,124,
+ 48,124, 33,158, 21,104, 76,126,137, 27, 12, 6,241,195,135, 15, 9,128, 87,204,157, 90,173,126,107,196,231,125, 98,170,230,155,
+218, 71, 1,128, 94,175,175,177,230,203, 17,155,170,142,197,178, 44, 52,154,106,244, 21,209, 20,188,249, 30,168,114,244,239,227,
+178,149,255, 21,189,139,185,170, 48, 62, 21, 13,208,197, 98,241, 11,147, 98,106,148,169,146, 8, 86,141,126,127,147, 65, 23, 10,
+133,240,245,245,197,133, 11, 23, 96,105,105, 9, 51, 51, 51,200,229,114, 72, 36, 18, 88, 90, 90, 66, 36, 18,129, 97,170, 53, 68,
+ 32,213,233,116,181, 92, 93, 93,241,228,201, 19, 72, 36,146, 23,139, 88, 44,134,175,175, 47,148, 74,165, 11,254, 81,177,250,255,
+ 14,131,122,181,237,182,102,251,222,129,187,246, 30, 26,165, 81,171,131,124,235,122,211,216,251,209,119, 71, 14, 25,208,129,187,
+ 58, 28,239,213, 96, 85, 82,168, 4, 91,218,186,156,157,242,221, 47,230,187,163, 25, 20,164, 63, 66,210,177,175,139,141, 58,101,
+ 62,203,234,221,243,159, 94, 2,128, 77, 38,126,201,135, 53,105,221,141, 57, 23,171,133,174, 56, 13, 69, 49,187, 18,197, 98,241,
+212,247,113, 34,110,162,148, 64, 43, 27,167,115, 83, 23,252,106,189,247, 46, 31,121,105,113,120,122,100, 90,161, 81,167,108, 29,
+ 21, 21,245, 98, 28, 45,135,192,238,248,108,202, 18,108,248, 97,188,201,218,159,136, 68,221,250,250, 91,118, 30,210, 60, 13, 70,
+ 98,196,128,135,177, 29,157,155,147,110,105, 23,233,254,191,242,230,197,196,196,124,231,237,237,205, 24, 12,134,207,116, 58,221,
+172,180,180,180, 61, 47, 69,174, 62,112,119,119, 95, 56,119,238, 92,215,164,164, 36,209,213,171, 87,243,110,223,190,205, 26,141,
+198,239, 43,211,188, 87,168,153, 28,164, 16,242,188,221,156, 71, 63, 73, 73,233,122,191,200,112,172,226,183, 32,185, 40,176,121,
+ 3,191,203,115,103,125,173,208, 94,218,131,210,244,100,172,136,202, 40, 98,141,250,105, 38, 70,221,172,221,133,148, 76, 27,250,
+ 41, 91, 92, 92, 12,153, 72,200, 38, 63,122,202, 27,216,182,133,241,135, 41, 19,153,140,140, 12, 40, 75, 75,249, 46, 46, 46,214,
+169,169,169,121, 85, 68, 8,230, 0,104, 93,191,126,125,180,107,215, 46,113,246,236,217,177, 47,155,143,191,153,193,122,227,215,
+181, 78,167, 35, 53,213,124, 57,130, 85,149,193,170,118, 4, 75, 83,244,102, 35,165,204,126, 87,131,245,156, 16, 82,171,226,223,
+239,227, 30,168,213,106,251,151,170, 6, 65, 41,173,113, 56,171, 60,130, 85,227,223, 95,134, 97, 24, 80, 74, 33, 18,137, 16, 23,
+ 23, 7, 71, 71, 71, 24, 12, 6,200,229,114,200,100, 50,148, 71,148, 33, 18,137,192,231,243,171,147, 76, 86, 36, 18, 61,143,139,
+139,171,107,101,101, 5,163,209,248,138,201, 74, 72, 72,128, 92, 46, 79,173,110, 4, 43, 56, 56,248,184, 84, 42,117,127,125,189,
+157,157,157,197,223,245,229,245,114,228,170, 87,175, 94,116,220,184,113,213,214, 88,254,221, 87, 91, 1,108, 29, 55,110,220,230,
+237,235,142,132,134,134,134, 30,246,243,243, 35, 0,192,245, 24,228,120, 47, 6,171,162, 80,170,248, 91,209,158,201, 69,152, 18,
+108,105,227,124,118,210,220,181,230,219,111, 49, 40, 76,143, 69,218,169,233,133,172, 78,217,154, 97,152,244,228, 43,191,236, 1,
+160,140,142,142, 62,111, 23,216, 29,132,148,245,220,123,211, 72,238,229, 5,125, 67, 95, 31, 31,236,142, 49, 64,157,113, 23, 12,
+161,155,218,182,109,171,124,215,147, 8, 9, 9, 9,180,178,113, 58, 55,121,254, 47,214,187,111,243,145, 95,102, 2, 11, 89,157,
+178,117,170,206,245,149, 65, 74, 89, 2,108,248, 97, 60, 88, 19,138,225, 33,132, 88,241,228,146, 85, 3,219,133,245,113,175,227,
+ 10,150,234,193, 10, 41,122, 78,182,229,199, 69, 43,247,213,106,199,251,141, 45, 97, 71,165, 92,253,235, 70, 31,127,242,228,201,
+ 92, 71, 71,199,189, 25, 25, 25, 47, 90,167,186,186,186,118,244,240,240,152, 63,103,206, 28,143,148,148, 20,197,237,219,183,139,
+246,236,217,147,192, 48,204,156,244,244,244, 42,191,238,239, 23,235, 38, 6,154,137,214,197,148, 24, 94,140,161, 19, 32, 23,214,
+255,116, 96,255,171,109,251,127, 42,121,122,106, 43,172, 19, 30, 98, 89,116,166, 49,181, 88,221, 63, 86, 73, 51, 76, 49, 87, 98,
+177,120,207,138, 61,123,158,212,171, 87,143,148,150,150, 66,175,215, 35, 39, 39, 7, 63,110,219,253,128, 82, 10, 43, 43, 43,156,
+ 58,117,138, 29, 59,118,236, 30, 23, 23,151, 94,111, 51, 89, 47, 13,211, 0,161, 80, 72,164, 82,169,103, 98, 98, 98,162,135,135,
+135,250, 77, 38, 69, 44, 22, 87,219, 96, 73,165, 82,176,236,219,131, 0,213,209, 52, 24, 12,196,148,245,213,209,172, 72, 91, 69,
+227,246,215,215, 87,192,227,241,192,178,108,165,231,242,103,247,246,150, 8,150, 50,235,157, 12, 22,165,212,189,162, 35,205,223,
+173, 32, 44,143,132, 1, 0,251,182,161, 24,170, 19,193, 42, 55,123, 16,137, 68,184,112,225, 2,186,116,233, 2, 74, 41,196, 98,
+ 49,100, 50, 25, 36, 18, 9, 46, 95,190, 12,145, 72, 4, 30,143, 87,157, 40, 22, 53, 24, 12,219,126,254,249,231,175, 23, 44, 88,
+ 32,173, 56, 70,133,193,250,233,167,159, 84, 26,141,102,155, 41, 6,139, 88, 5,244,181,180,178,254,164,160, 32,119, 83, 19, 95,
+203, 74,123, 17,190,105,159,242,246, 88,255,117, 42,134,105,160,148,118,123,125, 40,134,138,109,198,141, 27,135,215,135,112,168,
+108,152, 6,103,103,103,171,117,235,214, 13,101, 89, 54,160,124,213,235,189, 5, 43,238, 99,197,251,169,162, 87,225, 43,189, 8,
+ 57, 56,170, 29,193, 98, 8,224,196,127,238,103,105,227,122,118,194,220,181,230,155,175,243, 80,152,254, 16, 57,103,191, 45,164,
+ 6, 85,235,168,168,168,219,246,245,186, 35,188,105,235,102,109, 63,236, 5,135,131,187,113,243,202, 25,252,184, 98, 3,190, 26,
+253,121,165, 31, 74,246,246, 54,200,185,162,134, 62,255, 9, 8, 33,209,239,122, 2,141, 26, 53,242,182,180,118, 60, 55,105,222,
+ 47,214, 59,162,248, 40, 72,251,143, 9,156,182,242,236,237, 47,134, 14,122,101,123, 83,167,199,249, 68, 36,234, 22,232,227,186,
+190, 95,199,166, 86, 22,196, 0, 67, 82, 44,214,125,218, 7, 81, 93,116,104,218,215, 2,141, 58, 41,224, 21, 44,233,115,228,215,
+188, 54,206,205,201,144,191, 50,154,245,178,185,114,118,118,238,226,234,234, 58,251,240,225,195,238, 6,131, 65,113,225,194,133,
+226, 61,123,246, 60, 53, 24, 12,203,211,211,211, 15,155, 28, 29, 43,209,190, 48, 87, 65, 22,194,134, 67, 62, 27,116,105,236,210,
+ 53,146, 7, 81, 55,177,112,219, 65,152,243,244,198, 91, 25,234,222, 49, 37,255,169, 62,172, 52,163,241,249,115,119,236,216, 33,
+247,247,247, 39,185,185,185, 47, 34, 45, 58,157, 14,133,133,133, 40, 46, 46,134, 70,163, 65, 80, 80, 16, 51,107,214, 44,249,183,
+223,126, 59, 23,192, 40, 83,211,107,103,103, 7,161, 80, 8,157, 78,247,194,164,136, 68, 34, 88, 90, 90,162,176,176, 16, 39, 79,
+158, 68, 85,131, 83, 10,133,162,116,134, 33,110,102, 10,133, 94, 46,151, 83,185, 92,254,167,109,170,171, 89,110,114,178, 59,118,
+236,104, 55,103,206, 28, 65, 72, 72,200,139,245, 21, 85,132, 53,209,164,148, 42,219,181,107, 39, 91,190,124, 57,220,221,221,161,
+213,106, 95, 49, 82, 12,195, 64, 40, 20, 34, 57, 57, 25,243,230,205, 3,165,212,244, 15, 25,117,190, 30, 65,131,236,161,202,213,
+ 67,149,171,135, 58, 71,135,210, 44, 61,244, 74,227,223,173, 0,171, 73, 3,116, 19, 34, 97,246,239, 26,193,170,168,174, 20,139,
+197, 72, 76, 76,196,241,227,199, 17, 17, 17, 1,115,115,115,148,150,150,226,226,197,139, 72, 77, 77,133, 88, 44, 6,143,199,171,
+ 86, 35,247, 90,181,106,253,112,227,198,141, 46, 99,198,140, 9, 24, 54,108,152,212,207,207, 15, 9, 9, 9, 88,178,100,137,250,
+222,189,123,241, 86, 86, 86,115,128,170,231,153,117,113,171, 53,118,221,182, 67,130,193,253, 59,142, 6, 74, 97, 74, 47,194, 87,
+247,249,223, 52,118,127,203, 48, 13, 29,223,178,249,203, 67, 56,188, 50, 76,195,203,236,219,183,207,211,197,197,197, 15,101, 61,
+ 3,129, 63,247, 22,124,153,155, 81, 81, 81, 97,224,122, 17,114,188, 15,131, 85, 94, 64,143, 15,255,232, 27,243, 77,215,248,200,
+ 79,141, 65,225,197,153, 47,204, 21, 80,214,240,221,190, 94,119, 24, 89,138,214, 29, 62,170, 24, 20,244,245, 66, 38,232,229,113,
+171, 4, 18, 69,144,129, 10, 1,168, 97, 40,120, 10,145, 72,116,187,186, 9,126, 93,147,101,217,137,141, 63,250,198,122,203, 77,
+ 62, 10,211, 30, 34,251,220,140, 66, 86,167,108,157,172,117,189,253,197,208, 65, 38, 53,106, 39,132,180,173, 24,211,227, 19,145,
+232, 91, 1,143, 76,255,176, 69, 67, 97,179, 96, 31,200,179, 18,145,145,146,134, 93, 15,179,243,226,243, 53, 67, 46, 19, 29,146,
+158,106,214,117, 26,106,109,109,229, 40, 64,231, 17, 54,214,215, 14, 22,237,115,105,205,232,168,142, 46, 72,187, 68,103,189,174,
+249,190,168, 74,211,197,197,197, 91,161, 80,252,120,236,216, 49, 59,145, 72,100,254,224,193, 3,227,222,189,123,147,141, 70,227,
+ 79,233,233,233, 59,107,162, 25, 40,149,186, 6,212,245, 60, 63,118,241,106, 73, 73,169, 18,165, 90, 29,156,221, 92,140,231,163,
+ 99, 63,138, 41,209,238, 55, 69,211,193,193,161, 85,255,254,253,235,135,132,132, 48, 47,155, 43,173, 86,139,162,162, 34, 20, 23,
+ 23,163,168,168, 8, 69, 69, 69, 72, 77, 77, 69,211,166, 77, 25, 63, 63,191, 32, 7, 7,135, 86,153,153,153,103, 95,215,124,105,
+152,134,175, 1, 48, 50,153, 44,238,202,149, 43,234,143, 62,250, 8, 82,169, 20,165,165,165,112,117,117, 5,203,178,184,120,241,
+ 34,226,226,226, 10, 0,236,200,200,200, 56, 85, 89, 58, 85, 42,101, 45, 66, 8,207, 92,161,104,219,190,125,251,254, 67,134, 12,
+177,124,121,251,154,104, 2, 64,118,118,182,199,133, 11, 23,190,237,214,173,219,232, 14, 29, 58,200,166, 77,155, 38,240,244,244,
+132,193, 96, 32, 53,213,204,207,207,183,136,142,142, 94,212,172, 89,179, 47, 58,116,232,192,159, 63,127, 62, 44, 44, 44, 96, 52,
+ 26, 33,149, 74, 81, 84, 84,132, 57,115,230,224,210,165, 75, 6, 74,233,202,194,194,194, 73,149,105,190, 50, 14,214,132,197, 13,
+ 42,203,135,111, 27, 7,235,175,200,243, 42,149,202,161,186, 81, 49, 83,210, 25, 29, 29, 77, 95, 31, 15,171,178, 8,214,155, 52,
+ 43,162, 75,124, 62, 31, 25, 25, 25, 56,116,232,208, 43, 99, 96, 85, 44,111,171, 34,124, 75, 58,233,185,115,231,140,132,144, 8,
+131,193, 48,101,220,184,113, 67,148, 74,165,171, 92, 46, 79,211,233,116,155, 44, 45, 45, 43,198,193, 18, 86,165, 41, 18, 73, 4,
+132, 97, 32,149,200,165, 42, 85,118,210,155,122, 17,190,118,173,147, 68, 34, 7,155,138,125,254, 87,247,253,181, 97, 26, 94, 25,
+138,225,181,125, 94, 25,194,225,245, 97, 26, 94,214,236,222,189,123, 2,128, 71,148, 82,134, 16,242,232,245,222,130, 47,201,214,
+141,138,138, 10, 11, 13, 13, 61, 79, 41,149,189,222,139,240,175,200,243,255,100,205,127,141,193, 2, 32,185, 28,245, 24,140, 56,
+ 11,197,215,127,124,197, 92,189,120,210, 89,224,230,149, 51, 96, 89,160, 69,187, 30, 85,154, 25,131,166, 52,126,238,174,103,193,
+ 70,173, 10,134,162,164,184, 14, 31,118,202,122,151,196,219, 5,245,128,155,144,202, 47, 69,199,131, 47,201, 69,193,181, 31, 10,
+136, 81,211, 58, 42, 42,234, 78,141, 51, 13, 48,109,245,209, 61, 66, 98, 97,141,187,227, 6, 35,173,160, 20, 71,159,229,255, 70,
+149,154, 81, 91,105, 89, 85,160,107, 4,185,184,254,155,140, 85,205,123, 90,244,177,117, 17, 96,241, 87,155, 32,153,106, 35,108,
+212,166,197, 95, 58, 71, 97, 69,195,247,117,235,214,141, 12, 9, 9, 49,251,242,203, 47, 31, 23, 22, 22,190,210,240,189,186,196,
+168, 84, 41,129, 10,209,234,179,191, 44,254, 74, 26, 24,142, 61,243,166, 25, 47, 68, 63,234,126,191, 88,123,200, 84, 13,177, 88,
+ 28, 57,106,212, 40, 97,105,105,233,159,204,213,235, 6,171,168,168, 8,119,239,222, 69,175, 94,189,196,177,177,177,145, 0,206,
+190, 37,130, 51,163,124,192, 73,190,173,173,109,246,234,213,171,187,109,217,178,165,231,144, 33, 67,196,145,145,145,120,240,224,
+ 1,110,220,184,161,209,106,181,127, 8,133,194,253,137,137,137, 38,181,242,166,148, 26, 1, 28,247,240,240, 56,191,122,245,234,
+110, 44,203,190,152,207,242, 29, 52,245, 0,102, 88, 91, 91, 47,218,179,103,207,194, 51,103,206,244, 31, 56,112,160, 68,175,215,
+147,119,208, 52, 0, 24,103,103,103, 55,253,200,145, 35,155, 78,156, 56,209,253,147, 79, 62, 97,198,140, 25,131, 21, 43, 86,224,
+247,223,127,103,141, 70,227,126,129, 64, 48, 40, 59, 59,187,202, 14, 40,175,140,131, 85,201, 56, 87, 85,253,110, 2,183,254, 11,
+ 89,255,157, 53, 95,143,132, 53,108,216,208,225,229, 94,154, 47,255, 53, 53,130, 69, 8, 65,104,104,232, 43,255,175, 24,146,129,
+199,227,189,178, 84,167,138, 16,128, 37,165,148, 5,176, 18,192, 10,188, 58,138, 59, 15,255, 25,233,221, 36, 92,220,220,145,154,
+ 12,155,156, 82,117, 65,229,147, 61, 59,216,184,184,185,255, 21,229, 90,193,172, 89,179,150,204,156, 57,115,201,235, 67, 49,188,
+188,221,235, 67, 56,204,158, 61, 27,111, 27,166, 33, 45, 45, 45,127,214,172, 89, 63, 0,128,159,159, 31, 41,175, 22, 12, 69,121,
+111,193,151, 52, 55,163,108,170, 28,217,176, 97,195, 6, 2,120,171, 38, 7, 71,117, 12,214,215, 37, 81,203,244, 0,108, 8, 33,
+211, 82,117,174, 15,254, 92,136, 0, 63,174,216,240,202,164,208,149,193,227, 49,211,178, 14, 14, 94, 78,129,124, 30,193,180,119,
+ 77,188,149,165, 57,140,197,198,111, 74,163,151,179,148, 82, 75, 66,200,212, 91,183,110, 61,120,103,103,110, 97,141,226, 57, 35,
+241,123, 76, 26,205, 40,213,247,216,170,125, 53, 82, 83,222,230,170,175,115,115,178,203,202, 89,176,119, 92,107, 27,114, 56,111,
+224,223,226,134,198,196,196,204,247,246,246,230,173, 89,179,230, 51,173, 86,251, 74,195,247, 26,107, 22,107, 39, 7, 41,132, 60,
+ 63, 79,183,209,177,137, 73,221,238, 23,155, 86, 45,248, 18, 34, 23, 23,151,251, 74,165, 18,132, 16,104, 52,154, 23,198,170,184,
+184, 24,133,133,133, 47,254,175,211,233,144,157,157, 13, 79, 79, 79,188, 52,102,210,219, 76, 70,250,203, 30,193,202,202,234,216,
+242,229,203,251, 47, 95,190,188, 13,128,211, 42,149,106, 71,126,126,126,141,134,254, 40, 55, 58,187,164, 82,217,143,132, 16, 23,
+177, 68,170,189,116,233,210,209,119,209,204,203,203, 43, 6, 48, 66, 42,149,206,253,249,231,159,151, 75, 36,146,176,172,172,172,
+119,210, 44, 55, 79, 31,217,216,216, 56,111,222,188,121,247,250,245,235, 27,243,249,252,107,132,144,222, 5, 5, 5,213,158,236,
+153,188,250,245, 94,237,223, 77,224,247,255, 66,182,127,103, 77, 83,135, 95, 48, 21,131,193, 80, 50,115,230,204,172, 55,205, 59,
+ 88, 97,166, 94, 94,167,211,233, 76, 26,230,196,209,209,209,228,177,200, 42, 27,122, 7, 0, 24, 66, 84, 0,164, 95,207, 94, 84,
+254,193,108,242,100,207, 32, 32,218,255,101,185, 54,115,230, 76, 58,123,246,108, 66, 8,217,143,178,241,168,158,188,222, 8,253,
+229,223,102,207,158,141,153, 51,103,210, 89,179,102, 85,169, 25, 27, 27, 75, 9, 33,167, 1, 36, 0, 72,124, 89,247,229,245, 21,
+251, 84,166,201,193, 81,165,193, 98, 41,144,170,115, 77, 6, 48,248,229,117,127,126,193,225, 79,109,174, 42,243, 88, 29, 58,116,
+ 56, 13,192,239,125, 37,190, 32,191, 16,196,186, 97, 82,126,126,238, 39, 89,247,247,191, 23, 77, 22,248,113, 72,163,200,175, 0,
+ 16, 10, 44,126,221, 92,189,242, 21,116,145,238,119,106, 74, 22, 52,106,211, 98,124,249,203,103,254,223,225,166,190,169,225,251,
+187,242,166,134,239,213,120,217,156, 16,139,197,164,184,184, 24, 42,149,234,149,104, 85, 81, 81, 17,148, 74, 37, 74, 74, 74, 80,
+ 49,181, 71, 73, 73, 9,204,204,204,160,215,235,171,245,165, 88,110, 82, 86,135,132,132,172, 43,175, 38,121,103, 84, 42,165, 43,
+ 0,132,132,132, 8,222,159,166, 42, 13, 64,207,247,169,153,155,155,155, 6,160,137,151,151,151,200,212,201,162, 43,139,100,213,
+244,119, 19, 88,243, 95,200,242, 91,241, 55, 35, 41, 41,201,255,125,107,166,165,165,197,189, 79,189,220,156,140,181, 95, 12,238,
+ 53,170, 98,210,103, 83, 38,123,174, 48,102,121,185, 25,107,255, 87,215,178, 98,154, 17, 0,212,197,197,101,243,243,231,207,221,
+ 9, 33, 73,175, 71,146, 94,255,109,214,172, 89,120,219,152,127, 47,107, 2,128,167,167,231,190,228,228,100,103,161, 80,152,254,
+178,238,235,235, 43,211,228,224,120, 83, 70,251,175, 45, 0,130,254,159,104,182,229, 52, 57, 77, 78,147,211,228, 52, 57, 77, 78,
+243,175,211,252,167, 45, 12,103, 49, 57, 56, 56, 56, 56, 56, 56, 56,222, 47, 4, 64,208, 91, 34, 91,247, 77, 22, 33, 36,168, 6,
+145,179,251,127, 35, 77,251, 74, 52, 79, 85,161,217,182, 6,233,228, 52, 57, 77, 78,147,211,228, 52, 57,205,127,165,102, 85,218,
+255,152,222,137, 92, 21, 33, 23,230,229, 52, 57, 77, 78,147,211,228, 52, 57, 77,174,138,144,171, 34,228,224,224,224,224,224,224,
+224,248, 91,243,214, 97, 26,122,214, 43,235, 62,252,199, 61,174,195, 4, 7,192,227,241, 22,180,104,209, 98,212,165, 75,151,126,
+210,235,245,115,106,162, 65, 8,113,118,112,112,248,142, 82,218,132, 16, 34,230,243,249, 15, 51, 51, 51,231,235,245,250,139, 53,
+ 77, 23, 33,196,205,209,209,241, 59,150,101, 27, 3, 16,242,249,252,152,180,180,180,121,148,210,107,239,160,105,238,232,232,216,
+138,101, 89,215,178, 83,231,101,165,167,167, 95,164,148,166,114, 57,129,131,131,131,131,163,198, 6,235,163, 0, 2, 6, 64, 64,
+ 36,156,102, 15, 39,252,153,107,105,114,197,139, 7,101,131,177,249, 1,136, 5,112,139, 82, 90,244, 46, 9,248,255,162,249,119,
+135, 16,194, 88, 90, 90,182,147,201,100, 99, 75, 74, 74,130,205,205,205, 99,202,167,199, 57, 84, 62, 40,225,187,104,219,247,239,
+223,127,234,186,117,235,208,167, 79,159,233,132,144, 37,148,210,146,234,104,216,216,216,116,245,244,244, 92,187,124,249, 10,187,
+102,205,154, 17,169, 84,138,216,216, 88,151, 81,163, 70,134, 58, 59, 59,239, 74, 75, 75,251,162,186,233,178,179,179,235, 93,167,
+ 78,157,229, 43, 87,174,180,107,210,164, 9, 17, 8, 4,136,138,138,114, 29, 59,118,108,184,147,147,211,166,244,244,244,137,213,
+213,180,182,182,246,175, 93,187,118,135, 85,171, 86,201,154, 54,109, 10,177, 88,140,187,119,239, 42,134, 15, 31,238,226,236,236,
+124, 55, 45, 45,237,100,117,244, 66,134, 71, 11,132, 50, 29, 31, 0,116, 74,161, 33,106,109, 67,189,169,235,184,226,137,131,131,
+131,227, 31,100,176,122, 7, 16, 16, 0,129,205, 48,135, 24,240, 53, 24,144,113,253,201,111, 43,126, 99,110,180,109,219,214,247,
+243,207, 63, 39,229, 83, 71,248,239,220,185,243, 35, 30,143,247,136,101,217,235, 0,238,184,184,184,232, 42,166, 37,120,157,246,
+222,228,197, 24, 89, 39,159, 66, 8,160, 1,195, 48,225, 85,105,126, 80, 7, 58, 66,128,227, 79,222, 28, 73,107,231, 69, 0, 10,
+156,124, 86, 61,205, 19,241,255,140,200,156, 66,161,240,182,179,179,155,104, 99, 99,211, 49, 52, 52,180,104,196,136, 17,137, 15,
+ 30, 60,120,236,235,235,171, 94,191,126,253,124,189, 94,191,202,199,199,231,100,113,113,241,162,119, 24, 23,203, 67,175,215,227,
+209,163, 71, 96, 24, 70, 0,192, 19,192,189,106, 24, 52, 39, 15, 15,143, 53,103, 47, 71,219, 23,105,121,120,146, 77, 1, 40,193,
+ 10, 29,177,122,195, 46,171, 25, 83, 70,247, 55, 55, 55,191, 84, 84, 84,180,171, 26,154,110,117,234,212, 89,126,255,254,125,123,
+137, 68, 2,150,101, 81, 92, 92, 12,103,103,103,172, 95,191,222,234,171,175,190,250, 76, 38,147, 93, 80, 42,149, 7,171, 99,204,
+107,215,174,221,225,193,131, 7, 50,177, 88, 76, 12, 6, 3,209,104, 52,112,115,115,163,219,183,111,151,140, 25, 51,166,129, 88,
+ 44,126,174,209,104, 30,155,100,174,126,137, 22, 20,229,156,141,160,201,170,233, 0, 64, 36,210,121,145,179,173,111, 20,229,156,
+109, 84,213,186,144, 95,112, 53,106, 24,103,178, 56,254,183, 56, 57, 57,133, 88, 89, 89,237, 41, 40, 40, 56,159,158,158, 62,164,
+124,102,131,119,253,248,115,230,243,249,158,148, 82,203,242,255, 23, 24, 12,134, 4, 83,230,220,124, 27,182, 94,173,186, 64, 44,
+ 27, 12,202, 54, 96, 0, 16,134,185, 99,212, 41, 55,230,196,157, 61,248, 78,154, 34,233,103, 0,109,192, 0, 44, 97,152,187,172,
+ 65,249,107,118,236,217,163, 92,206,224,120,111, 17,172,128,112, 88, 17, 96,202,180, 17,195, 24, 62,143, 71,230,175,253,165,223,
+205, 43, 7,169, 83,173, 6, 47,166,220,104,222,188, 57,154, 55,111, 78, 22, 46, 92,232,119,230,204, 25,191,237,219,183,235,175,
+ 92,185, 18, 5, 96,211,155, 52, 41, 5, 90,118,144, 62, 55,232, 85,110, 77, 63,144,170, 61, 26,175,218,222,164, 73,115, 86, 44,
+ 22,163, 50,205,147, 87,174, 68,125, 80,231,205,154,101,194, 64,157, 96,254, 73,151,134,110, 36,178,243,140, 36, 83, 53,223,150,
+206,255,103,230,234,188, 66,161,240, 26, 62,124,248,147,145, 35, 71, 94,144,203,229, 20, 0,148, 74,165,184, 75,151, 46,249,221,
+187,119,207, 85, 42,149, 88,189,122,181,219,242,229,203, 79,154,155,155,167, 22, 21, 21, 53,170, 78, 84, 12,192,204,174, 93,187,
+ 78,255,242,203, 47, 81,171, 86, 45,140, 25, 51, 6,122,189, 62,138, 16, 50, 3,192,247,166, 12,186,103,111,111, 63,115,233,210,
+165,246,165,122, 1,190,221, 18,143,188,146,178, 1, 69,101, 34, 6, 95,180,149, 96,244,232, 49, 22, 55,110,220, 88,136,215, 70,
+144,174, 12, 71, 71,199,239, 86,174, 92,105, 39,145, 72, 64, 41, 69, 73, 73, 9,138,139,139, 81, 82, 82,130,210,210, 82,140, 28,
+ 57,210, 34, 38, 38,102, 41,128,131,213,208,108,181,106,213, 42,153, 88, 44,198,201,147, 39,235,106, 52, 26,158, 86,171,133,209,
+104, 52,214,169, 83,231,209,151, 95,126, 41,190,127,255,126,123, 0, 38, 25, 44,167, 12, 8, 10, 85,170,149, 63,255,240,149, 29,
+ 0,124, 57,229,199,149,128, 42,156,154,176,206, 41, 3, 97, 0, 56,131, 85,121,254,228, 1,232, 33, 16, 8,122,122,121,121,133,
+ 62,121,242,228,182,193, 96,248, 3,192, 31,229,211, 19,189,139,118, 27,103,103,231,239,210,210,210,126,166,148,110,253,183, 92,
+ 83,123,123,251, 63,246,238,221,235,182,101,203,150, 79,127,253,245,215, 35,120,135, 81,242, 9, 33, 2, 0, 17,141, 26, 53,178,
+237,217,179,167,192,209,209, 17, 74,165, 18,241,241,241,178, 83,167, 78,217, 73, 36,146, 92,141, 70,115,181, 58,247,202,182,110,
+ 83, 51,240,205,119, 70,180,106,219,172,207, 71, 61, 20, 14, 54, 22, 80,105,141,120,146,148, 94,235,216,145, 3, 45,157,131, 62,
+188,162,211, 21,246,203,137,187, 92, 82, 93,205, 86, 29, 58, 55,107,219,166,141,194,194,210, 2,133,165, 58, 60, 77, 76,117, 63,
+123,242, 96,115,167,160, 15, 47,176, 68,255, 73,230,189, 19, 74,238,169,227,168, 14,127,106,228,190,251, 1,125,211,131, 2,185,
+153,252,141, 2, 22, 22, 22,136,140,140,196,252,249,243, 5, 0, 26,191,106,170,254, 51,108, 2, 3,192,104,212, 58, 77,255, 98,
+ 52, 68,124, 42,254,176, 99,123, 98,110,110,110,146, 38,239, 45,154, 0, 64, 25, 33, 28,172, 13,109,195,235,170, 90,102,222, 25,
+ 51,224,206,249,239,130,180,234, 2,193,235,154, 50,153, 12,222,222,222,248,230,155,111,222,148,206,247,222, 37,244,127,161, 73,
+ 41,117,246,247,247, 47, 94,186,116,105,221, 89,179,102, 89,169,213,106, 57, 0, 55,175,128, 70,174, 12,195,184,169,213,106,243,
+153, 51,103,218, 45, 92,184,176,174,157,157, 93, 1,165,212,174,154,233,156,187,114,229,202, 25,251,247,239,103,154, 55,111, 14,
+ 43, 43, 43,180,106,213, 10, 71,142, 28,225,255,244,211, 79,243, 1, 76, 55, 37,157, 12,195, 52,111,214,172, 25, 97, 89,138,252,
+ 18, 61,206, 46, 8,193,229, 31,195,160,212,178,200, 47, 40,130, 90,173,134, 76, 38,147, 18, 66,204, 76, 61,119,150,101, 27, 55,
+105,210,132, 0,101, 35,191,151, 45,165, 40, 46, 46,251,171,213,234, 32, 16, 8, 20,132, 16,113, 53, 52, 93,155, 54,109, 10, 0,
+ 80,169, 84,252, 54,109,218,144,214,173, 91,147,226,226, 98,126,197, 52, 62, 2,129, 64, 68, 8,225,155,162,169,149, 9, 8, 75,
+ 89, 7,185, 76,106, 43,151, 73,109, 89,202, 58, 0,128, 41,235,180, 50, 1,249, 43,243, 39, 33,196,142,199,227,109,240,242,242,
+122,200,227,241, 54, 19, 66, 28,223, 69,147, 16, 18, 70, 8,153, 47,147,201, 78,249,251,251, 39,203,229,242, 51,132,144,239, 9,
+ 33, 17, 53,209, 36,132,136,100, 50,217,153,249,243,231,239,190,125,251,118,159,211,167, 79,123,222,187,119,239,163,133, 11, 23,
+238, 52, 51, 51,187, 72, 8,145,189,203,179,233,233,233,185,254,250,245,235, 97, 77,154, 52, 89, 87, 89, 30,170,142, 38, 33,132,
+ 71, 8, 9, 38, 21,243,227,252, 13,202,144,151,113,117,117,117, 14, 12, 12,116, 19,139,197,104,214,172, 25, 40,165,145,239,168,
+ 25, 49, 98,196, 8,199, 9, 19, 38, 8,238,220,185,131,117,235,214, 97,255,254,253,200,202,202, 66,231,206,157,133,173, 91,183,
+118, 20,139,197, 17,213,210,228,155,239, 28, 59,110,124,135,175,198, 12, 85,220,125,174,195,198, 83,207,177,239,106, 58,178,148,
+ 34,116,249,104,144, 69,251,110,125,219,139,196, 22, 59,171,171, 57,117,202,148, 14,195, 62,251, 88,241, 32,157,197,129,107, 25,
+184,246,168, 16, 6,129, 37, 58,125, 52,196,170, 65,211, 14, 31,242, 33,216,244,119,184, 71,255,116,205,127, 69, 4,107,230, 58,
+154, 63,103, 36,249, 97,254,234, 95,166, 51,132, 80, 87,159,246, 15, 60,189, 27,151,178, 44, 11,149, 74, 85,241,162,129, 74,165,
+ 66, 82, 82, 18,174, 95,191, 14, 11, 11,139, 74, 15,116, 44,158, 98,222, 23,255, 57, 92, 65, 97, 33, 92, 92, 61, 33,147,201,170,
+212, 60, 90, 73,117, 30,159,150, 69, 67,134,246,234,206,127,158,158,206,191, 18,125, 54,100,215,178,237, 33,110,117, 62,136,109,
+ 16, 57,249,190,153, 69, 45,213,157, 59,119,112,245,234, 85,228,231,231,163, 81,163, 70,255,152,155, 71, 8,209, 47, 90,180, 40,
+ 58, 45, 45,141, 92,186,116,169,193,156,165,219, 61,239, 21,213,230,101,151, 80,129,157,217,115, 79,127,217, 99, 99, 97, 97, 97,
+194,196,137, 19,207, 58, 58, 58,106, 70,143, 30,221,210, 68, 93, 9, 0,223, 94,189,122, 77, 29, 53,106, 20,226,227,227, 49,116,
+232, 80,213,141, 27, 55,114,155, 52,105, 98,243,235,175,191, 74, 39, 76,152,128,243,231,207,207, 36,132,236, 5,144, 64, 41,125,
+235, 92,106, 44,203,138,164, 82, 41, 80, 84,246,161,170, 51, 84,204, 77, 11,148,150,150,130,143, 2,136, 68, 34, 6,128, 29, 0,
+ 83,191, 60,133, 98,177,248,133,185, 74,201, 42, 70, 82, 86, 9,138, 75, 52, 80,169,244,208,170, 1,177,185, 3, 15, 72,182, 1,
+ 96,106,227,116,158, 88, 44,134,193, 96,128, 78,167,131, 90,173,134, 90,173,134, 70,163, 65, 97, 97, 33,138,139,139,193,231,243,
+101, 0,204, 1,228, 85, 41, 38,146, 26,120,140,112,254,215,243, 86,206, 2, 0, 30, 35,156,111, 6, 53,107,202, 58,158, 72,106,
+248, 11,243,149,216,206,206,238,236,238,221,187,253,189,189,189,145,144,144,224,215,187,119,239,112, 66, 72, 48,165, 84, 89, 77,
+ 45, 25,195, 48, 63, 12, 30, 60,120, 84,255,254,253,137,143,143, 15,248,124, 62, 12, 6,131,107,124,124,124,171,223,126,251,109,
+ 10,159,207,255,213,104, 52, 78, 52,181, 93, 31, 33,132, 17,137, 68,187,214,174, 93,219, 34, 60, 60, 28,155, 55,111,198,141, 27,
+ 55,216,176,176, 48,102,224,192,129,112,119,119, 15, 31, 56,112,224, 62, 66, 72,167,154, 68,178, 8, 33,238, 3, 6, 12,112,227,
+241,120,104,210,164,137,240,202,149, 43, 13, 1, 92,121,199,107,106,230,234,234,122, 62, 50, 50, 50,248,212,169, 83,209,132,144,
+200,234,180, 99,116,118,118,238,230,224,224,176, 80,161, 80, 88,153,186, 79, 73, 73,137, 50, 51, 51,115, 82,106,106,170, 73,243,
+145, 82, 74, 27, 7, 5, 5, 33, 53, 53, 21, 94, 94, 94, 16, 10,133, 17, 46, 46, 46,195, 41,165, 29, 88,150,253,166, 58, 77, 12,
+ 8, 33,206, 17, 17, 17,182,145,145,145,228,251,239,191, 7, 0, 8, 4, 2, 24,141, 70, 48, 12, 3,129, 64, 0, 63, 63, 63,242,
+236,217, 51,107, 66,136,179, 41,213,133,182, 94,173,186, 52,105,211,161, 89,139,240,250,204, 79,123,158,192,200, 26,193, 35, 6,
+240, 9, 11, 86, 47,134, 88,200,131, 79, 96, 40,239, 81,204,221,112,219,186, 31,116,201,137, 59,121,208, 20,205, 14, 93,186, 54,
+247,247,245, 97,150,237,123,138,130,212,135,198,212,216, 11, 57, 12,143,129,127, 72,107, 91,159,128, 96, 94,112,120,164, 32, 45,
+ 33,166,149,181,119,203,182,121, 79,206,115,166,130,163,250, 6,139, 16, 66, 41,165, 47,190,172,102,172,166, 51,108,173,136,199,
+131,251,119,153,228, 12,109,233,221,187,119, 97, 99, 99, 3,123,123,123,152,155,155,227,209,163, 71, 56,117,234, 20,226,226,226,
+ 64, 41, 69,112,112,112,181, 14,156,153,145,129,220,188,226,119,214, 60, 26, 79, 49,119,100, 89,178,107, 57, 57,161,150,147, 19,
+ 63, 39,191, 0, 87,239,222,243, 63,248,107, 91,223, 76,102,248, 70,149, 74,245, 98,123,189,254,159, 87,235,226,224,224, 96,248,
+226,139, 47,243,134,173, 74,168,211,175,181, 51,175, 91,132, 35,246, 93, 73,231,237, 60,199,163, 51, 62,175,159,253,228,201, 99,
+147, 79, 90, 36, 18,125,215,177, 99,199,175, 40,165,130,177, 99,199, 2, 0, 6, 13, 26, 84,116,237,218, 53, 31, 74,105, 22, 33,
+196,249,243,207, 63,127,124,246,236, 89,217,248,241,227,121, 6,131,225, 1,159,207,167,132,144, 57,148,210, 89,111,204,100,124,
+254,237, 59,119,238,120,192,204, 29,182, 10, 30,218, 79,143, 6, 0,152,137,129,236,140, 20, 92,191,119, 14, 54, 54, 54, 22,205,
+155, 55,143,245,246,246,214,164,167,167,143, 45, 45, 45,221, 84,105,198,229,243, 99,162,162,162, 92, 93, 93, 93,203, 12, 86,142,
+ 10, 27,175, 50, 80,106,164, 0,164, 32,172, 28,230,246, 30, 10, 31, 93,209, 29, 59, 59, 59,157, 86,171,157, 90, 84, 84, 84,105,
+ 85, 15,143,199,203,186,127,255,190,194,205,205, 13, 0,244,251,246,237,227,107,181, 90, 80, 74,141,135, 15, 31,238,144,156,156,
+ 28,236,233,233,201,184,186,186, 78,245,246,246, 86,165,166,166, 14, 85,169, 84,111,173, 66, 57, 54,198, 75,215,114,214,185, 85,
+ 5, 9,201,191, 1,128, 75,184,127,222,161, 89, 13,181, 45,103,149, 84,185,238,216, 24, 47, 29, 70,255,101,237, 4, 7,127,253,
+245,215,254,214,214,214, 24, 49, 98, 4,102,207,158,141, 25, 51,102,120,143, 24, 49, 98, 24,128, 37,213,120,201, 74, 29, 29, 29,
+111, 46, 91,182,204,175,105,211,166, 56,114,228, 8,118,236,216,129,103,207,158, 25, 60, 61, 61,249,225,225,225,152, 57,115, 38,
+218,183,111, 63,116,244,232,209, 45, 9, 33, 13, 77, 52, 29,159,205,156, 57,179, 91,179,102,205,240,233,167,159,106,206,157, 59,
+215, 7,192,137,147, 39, 79,182, 62,127,254,252,158,109,219,182, 73,231,207,159,223,118,194,132, 9, 35, 0,172,168,193,249,119,
+111,209,162, 5, 0,160, 89,179,102, 88,184,112, 97,251,119, 49, 88,132, 16,145,141,141,205,225,205,155, 55, 7,215,173, 91, 23,
+159,124,242, 73,195, 62,125,250, 28, 38,132,124, 64, 41, 53,105,222, 72, 39, 39,167, 31,214,174, 93,235, 37,149, 74, 77, 62,174,
+ 86,171,181, 30, 62,124,248,247, 0, 76, 50, 88, 44,203, 54, 14, 10, 10,194,190,125,251, 48,124,248,112,248,251,251,215, 15, 14,
+ 14, 94, 51, 96,192, 0,140, 24, 49,162,141,157,157,157, 67,249,228,226, 85,191, 88,248,124,207,206,157, 59, 11,254,248,227, 15,
+ 0, 64,139, 22, 45,208,182,109, 91,220,191,127, 31,151, 46, 93, 2,143,199,131, 92, 46, 71,211,166, 77, 69,105,105,105,158, 0,
+170, 52, 88,140, 88, 54,184, 91,231, 78,138, 3,215,210, 97,100, 13, 8,245, 50, 71,184,159, 61, 30,165, 20, 33,234, 97, 10,140,
+ 90, 33,204,173,109, 16,209,178,157,117, 70,234,179,193, 48,165,121,128, 88, 54,184,103,183, 15,205, 14, 92, 77, 67, 65, 90, 44,
+125,114, 99,239, 25,189,186,116, 40, 0,220, 58,189,115,141,163,141,244, 3,159,144, 80, 94,228, 7, 93,173,254,216,145, 49, 24,
+ 0,103,176, 56,222, 45,130, 85, 65,110, 1, 84, 54,142,254, 72,206,184, 93,246,255,220, 92,228,230,230,162,118,237,218, 88,190,
+124,249, 43,219,170,213,234, 26, 37,224,191,161,105,107,101,137,174,173, 90,242,238, 63, 90,205, 83,177,170,247,162,249,119,165,
+124,210, 82, 38, 41, 71,111,153, 93,168, 19,246,109,229, 70, 5, 60, 6,253, 90,213, 34, 63, 31, 76, 18,102,149, 10, 44, 25,134,
+ 73, 98,217,170, 59, 18, 18, 66, 4,221,186,117,251,106,215,174, 93,130,216,216, 88,212,169, 83, 7, 58,157, 14,215,174, 93, 75,
+161,148,102,149, 31, 47,141,199,227,165,177, 44,235,221,160, 65, 3, 44, 88,176, 0,126,126,126,164, 83,167, 78, 83,202, 77,214,
+159, 14,148,150,150, 54,255,203, 47,191,108,241,203,198,157, 54,159, 52, 38, 40, 46,214, 64,169, 84,226,209,253,155, 40,205, 44,
+197,154, 53,107, 33,147,201, 8, 0, 97, 70, 70,134,112,194,132,241,235, 92, 93, 93, 59,167,164,164,244,124, 91, 90,211,210,210,
+230,141, 30, 61, 58,124,203,150, 45, 86,101,237,174, 84, 40, 86,137,113,125,113, 89,132, 50,124,194, 13,252,250,203, 58,166,158,
+135,220,166,184,184, 24, 67,135, 14, 93,230,228,228,212, 52, 61, 61,125,248,219, 52,211,211,211, 47, 14, 29, 58,212,229,183,223,
+126,147,120,123,123,199, 21, 22, 22, 34, 47, 47,143,217,182,109,219,104, 39, 39, 39,139,125,251,246, 19,185, 92, 14, 0,188,196,
+196, 68,225,151, 95,126,177,203,209,209,113, 91, 70, 70,198,167,111,187, 55, 0, 52,132, 32,221,217,185,182,151,242, 42, 51,203,
+217, 89,125,233,220,204,212, 45,132, 32,189,108, 27, 80,167,181, 78, 3,158,111, 22, 55,211,104,216,165, 25, 25, 73,113,148,130,
+ 98,230, 95,215, 9,195,214,214,118,116,183,110,221,240,253,247,223,227,224,193,131, 19,172,173,173, 23,207,158, 61, 27,206,206,
+206, 95, 18, 66,150, 86, 99,178,219, 31,151, 44, 89,226,231,231,231,135, 65,131, 6,105, 79,157, 58,245, 53,128,125, 0,146, 46,
+ 94,188, 88,107,211,166, 77, 93,118,237,218,245,253,178,101,203, 36, 43, 86,172,240,250,232,163,143,150, 2,248,220,132, 15,138,
+241,253,251,247,199,162, 69,139,112,238,220,185,143, 40,165, 71, 42,190,183, 8, 33, 93,230,207,159,127,122,250,244,233, 88,178,
+100,201,216,234, 26, 44, 66,136,153,191,191,255,183, 29, 58,116,192,197,139, 23,209,188,121,115, 68, 68, 68, 76, 32,132, 44,167,
+148,230,212,192, 92, 49,102,102,102,187, 54,110,220,216,220,195,195, 3,243,230,205,195, 87, 95,125,133,245,235,215, 55,255,228,
+147, 79,118, 17, 66,122,154,210,203,215,204,204,204, 76, 42,149,226,251,239,191,167,207,159, 63,207, 55,193,144, 89,125,251,237,
+183,196,162,170,170,133,255, 68,200,164, 98,177,184,137,175,175, 47,126,250,233, 39, 92,188,120, 17, 99,198,140,129,175,175, 47,
+ 82, 82, 82,208,181,107, 87,217,227,199,143,123, 1,216,104, 98,185,100, 97, 99, 99,131,172,172, 44, 8, 4, 2, 52,109,218, 20,
+251,246,237,131, 70,163,129,189,189, 61, 10, 10, 10, 94,212, 38,240,249,124, 11, 19, 75,187, 32, 91,107, 11,100,197,164,130, 15,
+ 3, 66,124,108,113,246,126, 46,116,122, 22,246, 54,150,200,200,202, 68,227, 32, 87,104,181,181, 64, 41,107,210, 76, 32, 34, 30,
+ 19, 34,150, 72,145, 87,156,131,212,135,231,114,117, 70,205,240,130,103,151,146, 1,192,186, 78,139,225,183, 46,157,188,213,251,
+195, 22,246, 37,165,110, 32,148,109, 4, 14,142,106, 80,229, 64,163,111,122, 49,191, 28, 17,170, 64,167,211,189, 83, 66,254, 27,
+154,111,226,191,161,249, 55, 48, 89,172,139, 21,191, 80, 46, 97, 12, 39,163,178,140,122,131, 17,199,111,101, 24,101, 98, 98,176,
+ 18,107,139, 88,150,165,132, 16,106,130,142,254,248,241,227,155,199,140, 25,131,197,139, 23,227,241,227,199, 16, 10,133, 8, 10,
+ 10,114,170,104, 31, 69, 8,177, 8, 9, 9,177,103, 24, 6,143, 30, 61,194, 79, 63,253,132,207, 62,251,140, 94,185,114,101,253,
+219, 94, 20,148,210,219,233,233,233,107, 39,141, 29, 94,192, 40,147, 33,167, 57,208,229, 61, 6,171,202,198,215, 51,231, 35, 33,
+151, 69,244,179, 98, 68, 63, 43, 70,142, 86,142,159,126,222,192, 11, 12, 12,236, 34, 16, 8,218, 87,146,214,107,233,233,233,155,
+199,143, 31, 95,144,149,149,245,194, 56,235, 12, 44,116,134, 87,147,161, 80, 40,176,102,205, 26, 75, 55, 55,183, 94, 2,129,160,
+ 85, 37,154,169,105,105,105,247, 70,141, 26,165, 73, 79, 79, 71, 97, 97, 33, 78,156, 56,241,129,171,171,171,197,172,249, 75, 72,
+ 66, 46,125,145,206, 18, 98,131, 13,219,254,224,249,248,248,124, 44, 16, 8, 34, 42,127,121,185,120,249,251,215,217,125,237,218,
+181, 79,189,188,188, 70, 85, 24, 43, 74, 65, 1,192,211,211,115, 68, 84, 84,212,103,193,193, 1,187, 29, 28, 28,125,255,202,188,
+ 68, 8,105,213,183,111, 95, 95,150,101,177,123,247,238,123,148,210, 37,123,247,238,189,169,209,104,208,175, 95, 63, 79, 0, 29,
+ 76,212, 9,251,248,227,143, 71, 53,111,222, 28,227,198,141,211,157, 58,117, 42,132, 82,186,152, 82,154, 72,203, 72,162,148, 46,
+ 63,127,254,124,131,209,163, 71,107, 26, 53,106,132, 79, 63,253,244, 51, 66, 72,243, 42,116,155,244,239,223,223,143,101, 89,236,
+220,185,243,238, 75,230,170,226, 30,158,217,179,103,207, 53,173, 86,139, 1, 3, 6,212, 38,132,180,174,198,185, 11,197, 98,241,
+238,185,115,231, 90,166,166,166, 98,224,192,129,154, 71,143, 30, 97,214,172, 89, 82, 11, 11,139, 35,149,181, 17,124,107,128, 68,
+ 44,254,101,245,234,213,221,234,213,171,135,145, 35, 71,106, 87,173, 90, 53,102,212,168, 81,218,144,144, 16,172, 92,185,178,155,
+ 72, 36,250,165, 90,145,255,204,204,130,115,231,206,217, 84,181,100,100,100,100,154, 24,253,150,121,123,123, 95,245,241,241, 41,
+242,247,247, 15, 53, 24, 12,120,252,248,241,211,223,127,255,157,245,245,245,197,166, 77,155,176,102,205, 26,180,105,211, 6, 12,
+195,244,170, 78, 90, 75, 75, 75, 33,145, 72, 32, 20, 10, 17, 21, 21, 5,141, 70, 3,153, 76, 6,137, 68, 2, 30,143, 7, 75, 75,
+ 75, 40, 20, 10, 0,160,166,221, 31,208, 34,165, 30, 2, 1, 3, 62,195, 34, 54,169, 16, 58, 61, 11,137,144, 7, 1,159, 0,148,
+133,165, 92, 0,137,136, 7,134, 16,214, 68, 77, 20,150,234, 32, 18, 50, 16, 8, 69,132, 49, 24, 95,132, 8, 25,190, 81, 42,149,
+138,136,173,185, 24, 18, 33, 55, 38, 55,199,123,142, 96, 1,128,209,248,231, 94,186,111,138, 2,105,181,218,119, 74,200,127, 67,
+243, 45, 97,243,127,212, 13, 44, 42, 42,226, 95,189,122, 85, 33, 20, 10,197,221,130,195,115, 22,254,246,216,110,246,182, 56,136,
+249, 32, 29, 3,105,230,209, 35, 7, 69,197,197,197,182,190,190,190,185, 38,222,135,161,132,144,121, 0, 2,248,124,254,161,141,
+ 27, 55,146,173, 91,183, 90,245,239,223, 63,158, 16,146, 26, 24, 24,232,190,113,227, 70,115, 0, 88,190,124, 57,221,181,107, 87,
+123, 0, 49,148,210,140,202,116,211,211,211,167,139,197,226, 43,143, 30, 61, 90, 46, 16, 8, 44,205,205,205,173,206,159, 63, 79,
+ 50, 11,117,248,118,203,179, 23, 61, 11,229, 98, 30,166,245,180,199,224,193,159,241, 31, 60,120,240, 35,128,227,111,211, 76, 77,
+ 77,157, 32,147,201,206,223,187,119,111,137,194,165,190,181,109,196, 4,243,214,211,202,170, 31, 29,173, 68, 96,202,203,196,130,
+130, 2,228,228,228, 96,194,132, 9,150, 19, 39, 78,156, 12,224,108, 37,233, 60, 33, 22,139,147, 98, 98, 98,218,241,249,124,177,
+153,153, 89,240,213,171, 87,201,243, 2, 61,166,109,122,138, 98,117, 89,109,171, 66, 34,192,236,254,174, 24, 61,122, 52, 63, 62,
+ 62,254, 7, 0,205,222,164,231,226,226,226,237,239,239,191,123,251,246,237,254, 75,151, 46,205,123,242,228, 73,169,179,179,243,
+236,215, 54,211, 44, 88,176, 32,119,203,150, 45,117, 7, 14, 28,184,219,209,209,177,207, 59, 12,169,241, 78,152,155,155,127, 63,
+124,248,112,236,218,181, 11,249,249,249, 75,203,243,216,146,237,219,183,239, 28, 58,116, 40,182,108,217,242, 61, 33,228,152, 9,
+ 81,172,142,253,250,245,195,209,163, 71,113,250,244,233,111, 41,165, 15,222, 98,106, 31, 19, 66,166,236,223,191,127, 89,255,254,
+253,177, 97,195,134, 14, 0, 42, 27,120,246,131,246,237,219,227,200,145, 35,200,205,205, 93,249,166, 13, 10, 10, 10, 86, 29, 56,
+112,160,113,251,246,237,177, 96,193,130, 15, 0,156, 49,193, 92,249, 89, 88, 88,108, 92,182,108, 89, 88,189,122,245,240,241,199,
+ 31,171,117, 58, 93,135,175,190,250,234,224,142, 29, 59, 20,155, 55,111, 14, 29, 54,108,216,117, 66,200, 16, 83, 7,177,229,241,
+120,243, 87,172, 88,241,121,100,100, 36, 38, 76,152, 96, 56,126,252,120, 87, 74,233, 9, 66, 72,252,228,201,147, 15,255,244,211,
+ 79,188, 69,139, 22,125,206,227,241,178,141, 70,227,215,127,201, 23, 54,195,204,157, 51,103, 78,227, 22, 45, 90, 32, 41, 41, 9,
+209,209,209, 48, 24, 12, 91,110,221,186,117,161, 69,139, 22,115,117, 58,221, 65,137, 68, 50,200,204,204, 44, 48, 48, 48,176,181,
+131,131,131, 44, 51, 51, 83,105,194,245, 44,136,143,143,151,219,219,219, 67, 32, 16,224,238,221,187,176,183, 47,155,242, 53, 43,
+ 43, 11, 65, 65, 65,224,241,120, 40, 40, 40, 0,128, 66,211,204, 16,115, 47, 62, 49,173,182,181, 66, 14, 24, 37,184,253, 40, 5,
+118,182, 86, 48, 18, 6, 25, 25,233, 8,246,117, 5, 33, 4, 5,185, 25, 32,132,152, 52,151,174,145,178, 81,207,211,178, 92,108,
+ 20, 98,212,107,220,206,230,234,177,236,173, 22,117,154, 13,227,243, 8, 79, 44, 49, 95,251,249,167,159,218,178, 44, 69, 65,110,
+ 38,248, 12,115,131,179, 12, 28,239,213, 96,177, 44, 11,169, 84,250, 74,132,233,245, 40,144, 84, 42,133, 70,163,169,214,129,165,
+ 82, 41,116, 6,188, 87, 77, 83,142,249,190, 53,255, 74, 12, 6,131, 98,226,196,137,225,225,225,225,169,109,218,180, 73,168, 91,
+215, 58,185,115, 99,169,237,178,245,123,131, 59,181,172, 23, 93,144,151,149,243,204,220, 92,147,152,152,104,255,235,175,191,134,
+235,245,122,153,137, 17,177,231, 0,158, 19, 66, 86,117,232,208,225,139,222,189,123,227,193,131, 7,246, 74,165,210, 94, 38, 43,
+147,216,186,117, 43,118,237,218,181,152, 82,106,242,192,155, 26,141,230, 24, 0, 47, 66,136,101,173, 90,181, 50,173,173,173,133,
+233, 37,165, 47,122, 22, 10,249, 12,154,126,117, 19,249, 5, 69,176,181,181,133, 66,161,240,172, 74,179,124,156,171,131,222, 31,
+ 76,174,175,186,183,246,220,166,141, 27, 45, 0,128,199, 16,216, 89, 8, 81, 80, 80,128,236,236,108,228,228,228,128, 97, 24, 24,
+ 12, 6,127, 19,210,249, 24,192, 99, 66,136,115,235,214,173,231, 42, 20, 10,176,121,165,200, 47,209,189, 82, 5, 89, 82,162,132,
+135,135, 7, 20, 10,197, 27,171, 35,172,173,173, 21, 98,177,120,211,186,117,235,252, 20, 10, 5,111,232,208,161,150, 67,135, 14,
+109,246, 54, 51, 38,147,201,120, 27, 54,108,240, 9, 14, 14,222,232,225,225,241, 65, 98, 98, 98,225,255, 42, 47,149, 15,121, 48,
+ 98,210,164, 73,161, 18,137, 4, 63,255,252,243, 51, 0,219,202,127,222,189,106,213,170, 25,253,251,247,247, 29, 51,102, 76,224,
+244,233,211, 39,148, 87, 21,190,117,140, 36,161, 80, 24,226,239,239,143,189,123,247, 2,192,222, 42, 14,191,231,202,149, 43,203,
+ 58,119,238, 12,137, 68, 18, 86,197,182,158,110,110,110,216,191,127, 63, 0,220,126,203, 54,183, 31, 61,122,132,158, 61,123,130,
+ 16,226,105,194,185,119,107,215,174,221,158, 5, 11, 22,240, 21, 10, 5, 62,255,252,115,237,245,235,215, 59, 81, 74, 47, 16, 66,
+ 90, 13, 24, 48,224,252,182,109,219,228,231,207,159,247,251,238,187,239,174,240,120,188,249, 70,163,113,122, 21,154,159,205,155,
+ 55,111, 90,247,238,221, 49,123,246,108,250,219,111,191,125, 76, 41, 61, 81,254,124, 29, 39,132, 12,180,178,178,218,246,205, 55,
+223,144,194,194,194,105,132,144, 20, 74,233,234, 74,242,121,161,209,104,116, 84, 42,149, 38,125, 33,154,186,189,141,141, 77,199,
+ 22, 45, 90,224,199, 31,127,196,152, 49, 99,176,105,211, 38, 10,224, 80,122,122,250, 93, 0, 45,202, 34,176,206,138,168,168,168,
+192,230,205,155, 11,239,221,187,247, 33,128,223, 76, 40,155, 18,207,158, 61,107,223,169, 83, 39,161, 76, 38,131,209,104, 68,110,
+110, 46,212,106, 53,130,130,130,208,184,113, 99,100,101,101,225,208,161, 67,186,130,130,130, 68,147,202, 59,109,233,230,147,135,
+255,104,213,165,223,112, 11,169,144, 7,163, 94,132,204,204,108, 20, 27, 13, 8,241,119, 71,243,224, 90, 72,202, 84,225,248,161,
+ 63,242,139,139,149,155, 77,209,212,107,148, 27, 79, 29, 59,216,178,121,199, 1, 22,114,223, 64,120, 58,141, 9,190,117,229,212,
+ 73,137, 72, 64, 6,244,239, 99,217,180,161, 55,238, 62, 43,194,209, 67,123,243, 11,139,138, 54,130,131,163, 38, 6,235,229, 6,
+238, 47,145, 53, 97,194, 4,251,137, 19, 39,194,220,220, 28,185,185,185,208,235,245, 47,162, 77, 98,177, 24,150,150,150,200,205,
+205,197,206,157, 59, 1, 32,171,242, 47, 58, 81,250,188,149, 43,220, 8, 79,174, 21, 75,101,212, 90,246,238,154, 0,160,213,243,
+179, 86,239,252,221,186, 99,139, 8,126, 45, 39,167, 55,133,233,171,173,249,255, 1,157, 78,119, 34, 33, 33, 33,172, 95,191,126,
+217,110,110,110, 42,181, 90, 13,149, 74, 85,124,104,199,178, 58, 46,230, 35,159, 49, 12, 67, 21, 10, 5,107,111,111, 95,120,250,
+244,105,123,131,193,112,174,154,135,152,208,167, 79, 31,230,212,169, 83, 35, 70,141, 26, 69,188,189,189, 17, 21, 21,133,159,127,
+254,153,110,222,188,121, 25,128,169, 53, 76,122,137, 70,163,121, 37, 2,242,114,207,194,146,146, 18,104, 85,153,208, 87,163, 71,
+ 66,252,169, 31, 31,213,174, 93, 91, 31,232,254,159,225, 68,242,243,243,145,157,147,243,194, 96,101,103,103, 3, 64,117, 66,152,
+ 69,127, 78,231,127,106, 30, 74, 75, 75,161, 86,102,192,104, 52,190, 81, 51, 47, 47,175,216,217,217,121,197,242,229,203,127,154,
+ 59,119,174,253,146, 37, 75,242, 98, 99, 99,139, 24,134, 81,191,246, 17, 35,241,242,242, 82, 44, 90,180,200, 97,249,242,229,121,
+ 44,203,174,248, 31,155,171,238,245,234,213,219,212,177, 99, 71,197,168, 81,163,176,124,249,114,164,167,167, 79,165,148, 26,202,
+203, 6,150, 16, 50,121,229,202,149,135,166, 76,153, 2,157, 78,183,232,200,145, 35,179, 9, 33, 35, 40,165,219,222,164,105,103,
+103,231,202,231,243, 17, 29, 29, 93, 68, 41,125, 90,133,161,207,168, 91,183,110, 38, 33,196,193,201,201,169, 78,101,219, 90, 91,
+ 91,123, 41, 20, 10,164,166,166, 2, 64,194, 91, 54, 75, 76, 75, 75,163, 34,145,136, 56, 59, 59,123, 87,117,254, 86, 86, 86,147,
+215,173, 91,199, 63,123,246, 44,102,206,156,153,146,148,148, 52,128, 82,122,177, 60,109,209,132,144,230,173, 90,181,218, 49,101,
+202,148,186, 63,252,240, 3,121,244,232,209, 72,188,101,136,146, 10,220,221,221, 71,124,246,217,103, 88,177, 98, 5,214,174, 93,
+ 59,146, 82,186,251,181,115,222, 65, 8,177,178,177,177, 89, 49,124,248,112,108,220,184,113, 0,128,213,149, 68,107,167,244,237,
+219,119, 70, 94, 94,222,124, 83,238,169, 41,219,187,184,184,180,106,221,186,181,151, 90,173,198,238,221,187,159,238,217,179, 39,
+223,104, 52,238, 44, 55, 87, 47,231,143,125,199,142, 29,155, 49,121,242,100,156, 61,123,118,163,179,179, 51, 47, 45, 45,109, 71,
+ 21,247, 52, 77, 34,145,228,220,189,123,215,209,207,207,143,113,114,114, 66,163, 70,141, 96,105,105, 9, 30,143,135,172,172, 44,
+ 92,184,112,129,141,143,143,207, 49,117,192,209,156,184,179, 7, 29,235,117,186, 28,125,253, 66,187,192,134, 77, 5, 46,182,214,
+136, 8,116,129,165,153, 16, 4, 64, 82,150, 10,103,206,156,212, 39, 36, 60,189,106, 74, 15,194, 10, 77,231,250, 31, 94,177,180,
+175,213, 46, 32,184, 41,191,142,175, 15,218,181,104, 96,101, 37, 23,130,165, 20,119,159, 21,226,228,137, 99,250,180,148,228,179,
+ 92, 15, 66,142,247, 29,193,154,181,118,237,218,166,235,215,175,239, 60, 97,194, 4,197,160, 65,131, 32,149, 74, 81, 90, 90, 10,
+ 55, 55, 55, 24, 12, 6, 28, 57,114, 4,209,209,209,197, 44,203, 30, 2,112,249,181, 7, 51,232,229,113,171,166, 45, 87,214, 42,
+ 27,188,178,180,233,236,181,245,223,139, 38, 0, 92,121,102,112,113, 78,207,153,149,155,127,100,188,187,139,147,176,125,179,198,
+124, 91,171,178,222,204, 38,106,182,125,223, 99,122,252, 47, 52, 13, 6,195,231,132,144,192,201,147, 39, 47,116,113,113,113,158,
+ 61,123,246,243,128,128, 0, 85, 81, 81, 17,213,106,181,108, 78, 78,142,108,247,238,221,158,185,185,185,197,122,189,126, 32,165,
+244,110,117,210, 73, 41,213, 1, 24, 69, 8, 57, 80, 88, 88,120,252,171,175,190,194,119,223,125,135,131, 7, 15, 54,167,148, 94,
+174,233,185, 83, 74, 13,158,158,158, 5,183,111,223,118, 16,217,248,192,193, 82,136, 14,223,150, 5, 35, 20, 98, 2, 85,105, 49,
+ 98,239,223, 69, 81, 81,209,173,106,104,106, 93, 92, 92, 10, 51, 51, 51,109, 29, 28, 28,202,204, 85,118,246, 11,115,149,151,151,
+135,220,220, 92,250,242,189, 55, 65,179,212,203,203, 75, 25, 27, 27, 43,226,201,220,224,104, 37, 70, 89, 21, 36,133,157,130,143,
+210,210, 98, 60,188,118, 21,133,133,133,231,222,166,153,150,150,182,211,217,217, 25, 0,126,154, 49, 99,134,109,135, 14, 29,158,
+220,184,113,163,229,203,199, 9, 9, 9,217, 55,123,246,236, 15,191,251,238,187,156, 77,155, 54, 77, 73, 79, 79,223,250,191,204,
+ 75, 54, 54, 54, 19, 15, 31, 62,172,208,233,116, 88,190,124, 57, 22, 47, 94,188,158, 82,250,251,107,215,226, 48,143,199, 91,201,
+ 48,204, 23, 95,126,249, 37,134, 15, 31, 46, 11, 13, 13,157,240, 82,148,235, 21,205,212,212,212,233, 33, 33, 33, 51,178,178,178,
+ 76, 50, 4,143, 31, 63, 30, 22, 18, 18, 50, 61, 43, 43,107, 97,101,231, 46,151,203,229, 70,163, 17, 9, 9, 9,249,148,210,194,
+183,220, 55,181,143,143, 79,170,209,104,116,149,201,100,214, 85,229,207,252,252,252,249,161,161,161,179, 50, 51, 51, 79, 0,152,
+247,250,144, 35,148,210, 59,132,144,192,177, 99,199,142,254,254,251,239,123,102,100,100,236,172, 74, 51, 41, 41,105,126,171, 86,
+173,190,141,139,139,219, 68, 41, 93,251,150,116,254, 76, 8,209,109,221,186,117,100, 66, 66,194,130,202, 52,211,210,210, 14, 1,
+ 56,100,234,253,125,219,246, 47,107, 50, 12, 51,121,218,180,105,204,182,109,219, 0, 96, 81, 74, 74,202,218,183,152,181,187, 46,
+ 46, 46,155, 67, 67, 67, 7,173, 94,189, 90,210,166, 77,155,225, 0,118, 84,149, 63, 53, 26,205,181, 43, 87,174, 52, 78, 76, 76,
+180,109,213,170,149, 16, 0,138,138,138, 80, 80, 80,128, 67,135, 14,233,226,227,227,115, 74, 75, 75,175, 85,167, 12, 49,104,139,
+250, 95, 57,179,127, 71,226,227,251, 17,145, 29,186, 89,105,117,174, 16,231,242, 80,144,155,129, 99,135,254,200, 79, 72,120,122,
+ 85,169, 44,232, 95, 29, 77,157,166,176,223,213,179, 7,118,166, 36,196, 54,110,209,170,147,149, 90,235, 14,177,144, 65,110,102,
+ 42,142, 29,222,159,151,144,240,236,162, 90,175,249,244,175, 42,231,255, 77,154,255, 56,104, 69,107,219, 74, 22, 0, 34, 0, 31,
+ 42, 20,138,229, 51,103,206, 92,123,253,250,245,181,157, 59,119, 94, 43, 18,137,150, 3,248, 16,128,232, 45,251, 5,253, 47, 53,
+ 59, 52,130,226,179,174,204,134,185, 35,249,186,125, 75,124,245,115, 70,128,154,168,217,214,148,235, 80,157,229,127,173, 9,160,
+153, 64, 32,184, 90,175, 94,189,179, 10,133, 34,219,195,195,227,162, 64, 32,184, 1,160,197,187,166, 19,128,109,223,190,125,217,
+226,226, 98,218,167, 79, 31, 10,192,226, 93, 53,197, 98,113,235,200,200, 72,253,243,244,124,122,241, 78, 50, 61,116,254, 1,221,
+126,240, 42, 93,187,227, 56, 93,178,114, 3,173, 95,191,190, 22,128,123,117, 52, 69, 34, 81,135,200,200,200,130,156,156, 28,250,
+232,209, 35,122,225,194, 5,186,103,207, 30,186,118,237, 90,186,106,213, 42,234,236,236,156, 11,192,185, 58,154, 82,169,180, 91,
+135, 14, 29, 12,169,217, 37,244,218,131, 12,122,234,250, 83,186,239,244, 93,186,243,208, 85,186,126,235,239,212,207,207, 79, 13,
+192,161, 42, 77, 39, 39,167,190,125,250,244,121, 82,183,110,221, 53,175,255,230,237,237,189,178, 79,159, 62, 73,206,206,206, 3,
+255,138,188, 4,160,131,139,139,203, 35,161, 80,120, 24,192,192, 42,246,235,199,231,243, 15, 58, 58, 58,222, 4,208,227,127,157,
+231, 1,116,182,183,183,191, 6,160,107, 21,251, 85,108,215,253,159,248,188,191, 15, 77,103,103,231,214,110,110,110, 23,156,157,
+157,191,169,106, 63,127,127,127,161,163,163,227, 92, 23, 23,151, 35, 78, 78, 78,109,170,147, 78, 0,206,102,102,102,205,204,204,
+204,186,152,153,153,117,177,180,180,108,246,242,115, 88,147,115,183,241,105,219,165, 86,195,174,251,220, 26,124,152, 84, 43,184,
+115,146,103, 72,183,125, 54, 62,109,187,188,171,166,123, 72,183,253,181,130, 59, 63,175, 21,220, 37,177,118, 88,183,125,182,190,
+109, 59,254,211,238,251,223, 89,243,159,182,152,188, 97,175,178,150, 43,102, 0,250, 49, 12,243, 51,128,126, 0,204,170,184, 1,
+ 65, 38,220,164,247,174,217,161, 37, 92, 70,245,226, 29,153,250,169, 32,219, 68,205,127, 76,134, 6,208,141,207,231, 95, 1,208,
+237,125,166,211,220,220,124, 93,239,222,189,141, 2,129, 96,197,251,210,180,177,177,249, 41, 34, 34, 66,183,108,217, 50,186,119,
+239, 94,186,118,237, 90, 58,122,244,104, 26, 20, 20,164,177,182,182,254,180, 38,154,142,142,142,243,234,213,171,151,183,117,235,
+ 86,186,115,231, 78,186, 98,197, 10, 58,107,214, 44,182, 86,173, 90,217,214,214,214, 93,107,162,105,111,111,255, 75,179,102,205,
+116,191,252,242, 11, 61,121,242, 36,221,190,125, 59,157, 56,113, 34,245,247,247, 87,203,229,242,143, 76,213,172, 83,167,142,232,
+109,191, 53,108,216, 80,192, 21,184,156, 38,167,201,105,114, 6,235,159,179,240, 77,141,116,237,126, 64,241, 81, 0, 41, 33,192,
+206,223, 31,178,123,122,250,195,240,251,131,119, 31,171,167,118,237,218, 37,132,144,157, 79,159, 62,221,227,238,238,110, 72, 76,
+ 76,124,103,205,163,231,104,106, 59, 79,210,233,100,162,145, 15,192, 96,250,176, 61,255,136,136,228,126, 0,251,223,183,110, 97,
+ 97,225, 16, 66,200, 24, 74,169,234,125,105,230,228,228, 76, 36,132,108,125,250,244,233, 34,185, 92, 30,108, 52, 26,245,106,181,
+250, 82,118,118,246, 4, 74,105,114, 77, 52,211,211,211,167, 19, 66,246, 78,157, 58,117, 42,128,250,132, 16,173, 94,175,191,146,
+149,149, 53,135, 82,154, 94, 19,205,204,204,204, 97, 66,161,112, 67,124,124,252, 2,169, 84, 90,159,101, 89,173, 82,169, 60,151,
+147,147, 51,158, 82,154,105,170, 78,124,124,252, 91,219,127, 69, 69, 69,113,243, 14,114,112,112,112,252,139,218, 96,189,194,239,
+ 15, 40,122,214, 35,232, 17, 4,195,239,247,222,143,105,121,250,244, 69,251,215,247, 58, 53,200,137, 4,250,222, 53,185,234,228,
+247,103,174, 94,210,188, 11,160,205,123,214,188, 13,160,247,251,212,212,233,116,215, 1, 68,114,185,128,131,131,131,131,227,189,
+ 27, 44, 0,248,227, 30,229,174, 26, 7, 7, 7, 7, 7, 7, 7, 71, 37, 16, 0, 65,111,137, 2,220, 55, 89,132,144,160,234, 30,
+184, 42,253,255,177,166,125, 37,154,167,170,208,108, 91,131,116,114,154,156, 38,167,201,105,114,154,156,230,191, 82,179, 42,237,
+127, 76,239,196,255,106, 11,122, 19, 26,164,255, 77, 52,185,134,138,156, 38,167,201,105,114,154,156, 38,167,201, 53,114,127,111,
+ 11, 55,193, 18, 7, 7, 7, 7, 7, 7, 7,199,123,134, 51, 88, 28, 28, 28, 28, 28, 28, 28, 28,156,193,226,224,224,224,224,224,
+224,224,224, 12, 22, 7, 7, 7, 7, 7, 7, 7, 7,103,176,222, 35,246,255, 79, 52, 57, 56, 56, 56, 56, 56, 56, 56,222, 27,228,
+223, 52,202, 57, 7, 7, 7, 7, 7, 7, 7,199,255, 2,174,138,144,131,131,131,131,131,131,131,131, 51, 88, 28, 28, 28, 28, 28,
+ 28, 28, 28,156,193,226,224,224,224,224,224,224,224,224, 12, 22, 7, 7, 7, 7, 7, 7, 7, 7, 7,103,176, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56,131,197,193,193,193,193,193,193,193,193, 25, 44, 14, 14, 14, 14, 14, 14, 14, 14,142,191,222, 96, 17, 66,218,114,
+154,156, 38,167,201,105,114,154,156, 38,167,201,105,114, 6,139,131,131,131,131,131,131,131,131,131, 51, 88, 28, 28, 28, 28, 28,
+ 28, 28, 28,156,193,226,224,224,224,224,224,224,224,224, 12, 22, 7, 7, 7, 7, 7, 7, 7, 7, 7,103,176, 56, 56, 56, 56, 56,
+ 56, 56, 56,254, 34, 8,128, 55,246, 4,160,148,158, 50, 89,164, 6,189, 9,170,210,231, 52, 57, 77, 78,147,211,228, 52, 57, 77,
+ 78,243,159,167, 89,149,118,117,252,199,223, 26, 74,233,127,109, 1,208,150,211,228, 52, 57, 77, 78,147,211,228, 52, 57, 77, 78,
+243,223,182,240,185, 32, 30, 7,199,255,115,246, 16, 30,242,125, 61, 65,169, 51,120,162,116,164,223,123,138,153,148,125,103,205,
+204, 0,119, 72,245, 14, 48, 72,178,145,121,247,217, 59,107,114,112,112,112,252,139,224, 12, 22, 7,199,255,119,178,253,234,130,
+143, 5, 96,224, 4,170,139,135, 93,192, 2, 0,247,223, 89, 83,200,206,131,145,113, 5,213,197,193,222,247,123, 0, 15,184,139,
+205,193,193,193, 97, 26,127, 73, 35,247,176,176,176,168,176,176,176,185,145,145,145, 98,238, 22,112,252,183,136,140,140, 20,135,
+133,133,205, 13, 15, 15,143,250,199,158,228,214,122, 50, 48,198,142, 90, 61,235,114,236, 94,129,189, 82, 99,172, 11,198,208, 9,
+ 27,234,154,189,147, 38,159,180, 83,235,216, 90,219,110, 40, 29, 74,181, 6,127, 80,188,155,102, 57, 65, 65, 65,150,141, 26, 53,
+ 58, 22, 28, 28,108,203,229, 80, 14, 14, 14,206, 96,189,103, 88,150,109,104,111,111, 63, 65,165, 82, 37,133,134,134,118,253, 55,
+ 93,240,198,141, 27, 95,137,136,136,200,108,210,164, 73,102,147, 38, 77,162,171, 90,255, 79,196,217,217,185,110,189,122,245,146,
+ 2, 3, 3,227, 94, 94,111,223,160,103, 19,255, 22,131,102,218, 6,118,111,249,174,199, 8, 13, 13,237,170, 86,171,147,106,213,
+170, 53,222, 96, 48, 52,252,199, 94, 76, 53,235, 0,134,215, 42, 38, 93, 41, 75, 47,210, 59, 68, 37, 42, 21, 0, 47, 18, 90, 56,
+213, 88,179,144,117, 0,104,235, 59, 41, 42,249,149, 60, 59,135,139, 79, 53,230, 96,152, 86, 80, 19,199,119, 77,174, 72, 36, 26,
+ 73, 41,253, 64, 32, 16,140,227,138,223,127, 55,132,144, 32, 66, 72, 87, 66, 72,216,123,212,252,193,207,207, 47,149, 16, 50,150,
+187,194, 28,255,111, 12, 86,239,218,164,233,199,117,200,249,190,181, 73,113,191, 58,164,100, 96, 29,114,169, 87,109,210,186,166,
+ 7,254,253,247,223,165, 91,182,108,177, 15, 8, 8,216, 25, 30, 30,126, 41, 52, 52,212,167, 38, 58, 97, 97, 97,199,194,194,194,
+122,191,190, 46, 52, 52,180,239,203,235, 26, 53,106, 20,211,168, 81,163,194,176,176,176,167,166,232,134,132,132, 60, 9, 13, 13,
+ 45, 13, 11, 11,123,242,218,139,187,111,163, 70,141,142,189,118,188,222,175,175,123, 27, 60, 30,207,245,224,193,131,246,135, 15,
+ 31,182,231,243,249, 14, 47,110, 4,195,188,113,125, 13,174,199,208,176,176,176, 43,175,157,203,144,215,215, 85, 97, 78,174,132,
+132,132, 12,121, 77,247, 74, 88, 88,216,208,247, 97,174, 90,180,104,113,233,246,237,219,181, 20, 10,133,229,203,191, 57,218, 88,
+182,191,114,104,229,132, 79,123,183, 27,105, 31,208,163, 94, 13,141,149, 79,227,198,141, 47,121,121,121,237, 92,176, 96,129,253,
+204,153, 51,101,255,216,167,119, 79,128, 16,132,109,193, 82,106,247, 48, 85,109,247, 97,215,222,252,219,201, 42, 59,189,209,104,
+ 13,240, 34,177,201, 67, 92, 35, 77,190,190, 57, 75,169,195,233, 68,129, 93,171, 62,163,121,103, 18,249,118,122,163,209, 6, 12,
+ 90,214, 72,243, 63,249, 80,192,227,241, 38, 12, 31, 62,156, 33,132,124,233,229,229, 37,250, 55, 21,182,225, 46,196,165,141, 55,
+255, 70,136, 51,105,250, 30, 13, 69,160, 92, 46,191, 69, 8,169,251,255,204, 92, 53, 4, 32,163,148, 30, 0,224, 64, 8,225,191,
+ 7,205, 37,115,230,204,153, 28, 19, 19,227, 92,187,118,237,217,132, 16, 30,247,138,231,248,219, 27,172,126,181,201, 44, 7, 71,
+151, 19,223, 44,217,222, 98,221,249,103,102,171, 14,221,150,143,159, 50,191,169,163,141,221,193, 1,117,200, 15,111,219,175,178,
+174,150, 34,145, 8,207,158, 61,195,242,229,203, 37,179,102,205,106, 98, 97, 97,113, 55, 60, 60,124,105, 64, 64,128,188,178,180,
+188,174, 73, 41,109, 42, 16, 8,214,133,135,135,111,172, 40,176, 9, 33, 77,197, 98,241, 47,225,225,225, 91, 43,170, 33, 67, 66,
+ 66,106,223,184,113,195,156, 16,226, 96, 74, 58, 27, 53,106,228,116,235,214, 45, 25, 80, 22, 9,136,140,140, 20, 55,106,212,104,
+139,139,139,203, 90, 0, 77, 1,192,203,203, 75, 20, 30, 30,190,209,205,205,237, 87, 66, 94, 45, 52,223,118,238,132, 16, 88, 90,
+ 90, 98,251,246,237,224,241,120,127, 90,191,117,235, 86, 16, 66,170,125, 61, 3, 2, 2,228, 97, 97, 97,191, 59, 57, 57, 45,101,
+ 89, 54, 2, 0,234,213,171, 39,107,212,168,209, 30, 87, 87,215,101, 21,235, 76,209,164,148, 70, 8,133,194,165,141, 26, 53,218,
+ 83,175, 94, 61, 25, 0,176, 44, 27,193,231,243,151,132,133,133,253, 94,157,123,212,176, 97,195,225,245,235,215, 79,171, 95,191,
+126,154,175,175,239,119, 14, 14, 14,231, 86,172, 88, 97,243,242,185, 87, 68,174, 50,179,114,243,175,220,140,121, 52, 97,120,175,
+200, 90,110, 14, 3, 44, 27,116,183, 48,229,220, 43,206, 63, 60, 60,124,169,133,133,197,221,105,211,166, 69,204,155, 55, 79,162,
+211,233, 32, 20, 10, 81,147,252, 89, 83,254,167,154, 57,196, 30,148,182,125,148,161,146,120,248,135,202,237, 67, 63,130,189,185,
+ 64,124,245,105,169, 2, 4,109,160,147,217,213, 72,147,240,219,196,164,170,164, 86,129,157,100, 97, 17, 45,192,216,248,136,207,
+197,149,154,131, 97,106,166,249, 31,122, 69, 68, 68,136,218,182,109, 11,103,103,103,158,133,133,197,128,191,213,245,252, 47,106,
+134,187, 16, 23,133,153,232,250, 79, 51,199,135, 58, 91,203,246,155, 98,178, 76,232, 62, 31,104,111,111,127,118,229,202,149, 33,
+ 10,133,226,130, 41, 38,235,239,112, 61,203,205,149,144, 82,122,173,124,213, 3, 0,205,223, 81,115,201,172, 89,179,198, 77,155,
+ 54, 13, 69, 69, 69, 24, 60,120,176, 57,128,159, 76,213, 84, 40, 20,222,245,235,215,223, 26, 24, 24,248, 60, 56, 56, 88, 27, 16,
+ 16,160,246,245,245, 77, 12, 10, 10,218, 36,145, 72, 60,255,233,249,243,239,162,249,175, 51, 88,125,234,144, 38,182,142, 46,147,
+127,216,119, 83,106,124,112, 11,183, 62,109,137,216, 47, 58, 65, 26, 23,133,105, 99,190,150,154,155, 91,125,217,187, 14,105, 85,
+147,131,199,197,197, 97,215,174, 93,176,181,181, 37, 27, 54,108, 16,247,238,221,123,164,185,185,121,114, 88, 88,216, 0, 83, 53,
+120, 60,158,113,227,198,141,102,221,186,117,235,103,109,109, 29, 19, 18, 18, 82,155, 97, 24,227,230,205,155,205,250,246,237,219,
+ 91,171,213, 62, 12, 13, 13,245,137,142,142, 54,222,188,121, 19, 12, 99, 90,208, 46, 42, 42,202,112,244,232,209, 23, 81, 17, 74,
+233,195,239,191,255,190,223,222,189,123, 21, 22, 22, 22,108, 72, 72, 72,109, 55, 55,183,152, 31,126,248, 97,192,158, 61,123, 20,
+230,230,230,172,137, 5, 1,212,106, 53,164, 82,233, 43, 70,138, 16, 2,149, 74, 5,137, 68,242,138,241, 50, 49, 50, 16,104, 99,
+ 99, 19,187, 96,193,130,110,251,246,237,147, 42, 20, 10,132,133,133,249, 91, 90, 90, 62, 90,184,112, 97,247,138,117,166, 34, 20,
+ 10,177,125,251,118,217,199, 31,127,220, 85, 44, 22,199,134,133,133,249, 11,133, 66,236,216,177, 67, 54, 96,192,128,206, 50,153,
+236, 97, 72, 72, 72,160, 41, 90,122,189,126,198,205,155, 55,157,206,159, 63,239,228,238,238, 62,102,213,170, 85, 14, 2,129, 0,
+ 0, 96, 52, 26, 95,137, 92, 13,232,249, 65,248,184, 25, 43,207,170,212, 26,237,188,169,159, 69, 10,140,104,108, 98,212,110,128,
+185,185,121,242,231,159,127, 62,106,251,246,237, 98, 71, 71, 71, 38, 42, 42, 10,197,197,197,213,190,150,255,127,162, 87,132, 7,
+190,177, 33, 0,175,168, 68,149,109,131,182,159,240, 17,127, 16,141, 60,205,248,103,227,138,237, 41, 67,221, 1,218, 8,179, 35,
+249,213,210, 20,208, 6, 96, 88,159, 19,241,196,182, 73,167, 1,252,164,164, 36,120, 54,136,228, 29,142,131, 3, 37,212, 19, 44,
+ 66,171,165,249, 18, 2,129, 96,102,159, 62,125,228, 73, 73, 73,104,218,180,169, 76, 36, 18,205,120, 47, 81,188, 53,190,238, 88,
+231,219, 18, 27,234, 58,225,124,228,223,174,227, 78,184, 11,113, 49, 55, 19, 93,219,177, 99,151,115,189, 14,195,200,218, 65, 30,
+214,118,230,130,253,239, 18,201, 42, 55, 87,103,174, 95,191,110,211,174, 93, 59,204,154, 53,203,206,220,220,252,194,223, 61,146,
+245,178,185, 34,132, 72,203,171, 7, 83, 1,184,190,131,230,178, 89,179,102,141,251,230,155,111,112,237,218, 53, 44, 92,184, 16,
+ 29, 58,116,128,149,149, 85,149,229,199,192,129, 3,101, 77,155, 54,141,234,218,181,235,157,241,227,199, 15, 56,116,232,144,219,
+198,141, 27,133,159,126,250,169,184, 79,159, 62,238,227,199,143, 31,212,169, 83,167,251,141, 27, 55,190,222,187,119,111, 73, 53,
+147,198, 7, 32, 42, 95, 4,101, 73, 37,132, 16,194, 39,132, 8,184, 8, 27,103,176,192,167,152, 51,108,226, 92, 73,194,166,197,
+200,220,245, 51,120, 5,153, 16, 20,231, 66,115,233, 48,244,151, 14, 96, 96, 68,132, 84, 74,200,188,154, 28,220,204,204, 12, 66,
+161, 16, 79,158, 60,193,131, 7, 15,208,169, 83, 39,225,138, 21, 43, 44, 3, 3, 3,127,105,218,180,233,157,176,176,176,250,166,
+ 24, 22,111,111,111,244,235,215, 79, 52,118,236,216, 58, 18,137, 36,154, 82, 42,240,244,244, 68,223,190,125,133, 83,166, 76,241,
+144, 72, 36, 55, 89,150, 21,202,100,178,183, 70,135,222,164, 43,149, 74, 1, 64,224,227,227,115,107,231,206,157,158, 77,155, 54,
+229,159, 60,121, 18, 69, 69, 69,252,186,117,235,222,217,177, 99,135, 87,147, 38, 77,248,151, 47, 95, 70,105,105, 41, 53, 85, 87,
+169, 84, 66, 34,145,252,201, 96, 41,149, 74,136,197, 98,147,211, 88,110, 46,134,122,121,121,221,220,185,115,167,107,243,230,205,
+121,231,206,157, 67,113,113, 49,220,221,221,111,237,220,185,211,181,105,211,166,188,171, 87,175,162,184,184,216,100, 77,145, 72,
+ 4, 15, 15, 15,244,233,211, 71, 48,105,210, 36, 87,129, 64,112, 83, 36, 18,193,221,221, 29,125,250,244, 17, 78,156, 56,209, 85,
+ 36, 18, 93, 55,177,202,144, 87,110,180,208,167, 79, 31,185, 76, 38, 67,114,114, 50, 88,150, 5,203,150,121,210,244,236,220,123,
+151,111,222,143,157, 48,162,119,203, 82,141, 70,115,252,220,173,135, 1, 62,238,174,132, 80,143, 42,206,189,126,120,120,248,157,
+200,200,200, 95, 15, 28, 56, 96,249,193, 7, 31, 8,110,222,188,137,231,207,159, 67, 44, 22,195,204,204, 12,124,254, 63,180,163,
+108, 81,128, 13, 88,124,144,148,173, 21,139, 45, 93, 21,102, 78,117,129,231, 23, 80,219, 78, 12, 30,195,147,220,124,166,148, 3,
+244, 3,212,202,177,169,158, 38,251,193,179, 44,173, 88,111, 29,100,230,236, 90, 11,185,185,185,112,171,227, 7,181,200, 78,116,
+229, 73,169, 25, 72, 53, 53,203, 9, 14, 14,110,238,230,230,230,232,225,225,129,156,156, 28,120,123,123,195,204,204,204, 42, 36,
+ 36,228,131, 26, 95,131, 77, 30, 98, 20,161, 41,192, 44,130,145,204,134,158,191, 0, 79,178, 27,226,151, 16,193,223,206, 92,237,
+220,229, 98, 83,203, 31, 56,252, 25, 28, 44,197, 88, 63,178,161,181,157,133,184, 70, 38,139, 16, 18,232,224,224,112,230,250,245,
+235,182, 18,137, 4,209,209,209, 8, 8, 8,192,226,197,139,237,172,172,172,254,182, 38,235, 53,115,101, 77, 41, 85, 1, 96, 1,
+244, 71, 13,122,189,150,155,149,159,231,206,157, 59,230,235,175,191,198,149, 43, 87,224,234,234,138,236,236,108, 52,111,222, 60,
+ 41, 63, 63,191,210,247, 82, 96, 96,160,235,227,199,143, 83, 39, 76,152,208,112,235,214,173, 82,153, 76,134,130,130, 2,252,250,
+235,175,152, 54,109, 26, 8, 33,160,148, 98,195,134, 13,178,193,131, 7, 55,138,143,143, 79,245,240,240, 48,165,249, 6, 1, 32,
+ 1, 32, 43, 95,228, 0,100, 59,118,236,176,232,214,173,155,121,249, 58, 41, 0, 41, 33,132,235,232,245,111, 54, 88, 20,168,239,
+232,233,139,194,147,187, 33,229, 19, 72,121,229, 11,159,128,121,122, 15,110, 18, 1,244,148, 6,214,228,224,102,102,102, 47, 22,
+134, 97,144,158,158, 14,134, 97, 48, 99,198, 12,201,152, 49, 99,234,137, 68,162,171, 45, 90,180, 88, 80,233, 9,148, 71,164,110,
+222,188, 9, 31, 31, 31,242,205, 55,223,152, 71, 70,150,125,197,222,187,119, 15, 94, 94, 94,100,254,252,249,138, 46, 93,186, 16,
+185, 92,110,114, 4,139, 97, 24, 72,165, 82,180,106,213,138,108,220,184,209, 76, 44, 22,227,240,225,195,200,206,206, 70,187,118,
+237,248, 27, 55,110, 52,147, 72, 36,184,112,225, 2, 10, 11, 11, 77,214,173, 42,130, 85,110,234, 76,162, 73,147, 38,235, 29, 29,
+ 29,151,110,217,178, 69, 44,149, 74,113,238,220, 57, 20, 20, 20,160, 95,191,126,134,109,219,182, 73,204,205,205,113,245,234, 85,
+ 20, 20, 20,212, 40,115,220,188,121, 19,222,222,222,100,250,244,233,210,136,136, 8, 61, 0,220,190,125,187,226, 58, 75,205,205,
+205,151, 52,107,214,108,125,101, 26, 44,203, 34, 61, 61, 29, 49, 49, 49,120,250,244, 41,178,179,179,145,147,147,131,226,226, 98,
+ 24, 12, 6, 0,128,172,184,232,240,207, 27, 15,222,145, 75,165,178,240,122, 62,181,174, 71, 63,200,146, 75,165, 50, 31,207, 90,
+117, 9,153,253,198, 11, 27, 17, 17,177,128,199,227, 93,157, 55,111, 94,253,233,211,167,139, 31, 61,122,132,232,232,232, 63,229,
+171,127,164,193, 34,132,128,104,125, 64, 72,195,107, 79, 75,173,155,119,238, 47,196,179, 99, 0,171, 7, 24, 62, 34,235,187,242,
+247,223, 43,117, 0, 69,125,104,224, 7,152,224,216, 9, 33,128,206, 27, 32,161, 39, 30, 27,108,154,246, 24, 41, 76, 77, 77,133,
+ 80, 40,132, 88, 44, 70,195,214, 31,241,119,220,209, 59,130,160, 1,116,240, 53, 73,243, 37,196, 98,241,183,159,125,246,153,252,
+101,205,142, 29, 59,202,101, 50,217,204, 26,155,171, 82, 89, 4, 12,116,108, 76,170,210,227,187,195, 25,254,241, 89, 42, 95, 80,
+ 58, 1,208, 7,191,171,201,114,119,119,143,172, 91,183,238, 51, 79, 79,207,102,239,100,174, 20,162,171, 59,119,238,114,177,118,
+ 43, 51, 87, 48,168, 1,129, 20,142,118,150, 88, 63,190,149,181,157,165,180, 90, 38,171,220, 92,157,190,118,237,154,173, 68, 34,
+ 65, 84, 84, 20,132, 66, 33, 36, 18, 9,234,213,171,135,181,107,215,218, 89, 91, 91,255, 45, 76, 22, 33,196,138, 16,210,158, 16,
+210,139, 16,242,209, 75,230,202, 19, 64,107, 66,200, 7, 0, 28, 1,156,167,148,222, 49, 81,179, 25,159,207, 63,220,160, 65,131,
+ 52, 62,159,255, 96,254,252,249, 95, 76,153, 50, 5,203,150, 45, 67,100,100,228,211, 41, 83,166, 32, 54, 54,214,160, 84, 42,187,
+ 82, 74, 15, 85,166, 85, 82, 82,114, 96,250,244,233, 22, 61,122,244,168,248, 63, 46, 93,186,132,205,155, 55, 67, 46,127,181, 21,
+ 68,215,174, 93, 49,116,232, 80, 43,173, 86,251,123,101,154, 14, 14, 14,109,174, 93,187, 22, 0, 64, 8, 64, 92, 97,176,238,223,
+191,111, 89, 84, 84,100,105,102,102,102,233,228,228,164,168, 48, 89, 61,122,244,176, 20, 8, 4,205,192,241,239, 52, 88, 0,160,
+203,203,132, 24, 70, 72,121, 4, 50,222, 75, 38, 11, 44,248,133, 89,213, 44,106,223,108,176, 20, 10,197, 11,163,165, 82,169, 76,
+142,184, 84, 24, 27, 43, 43, 43, 20, 23, 23, 67,175,215,191,120, 56,172,172,172,160,209,104, 0, 0,114,185, 28, 53,140, 96,225,
+202,149, 43,184,124,249, 50,248,124, 62,172,173,173, 1, 0,183,110,221,194,189,123,247, 32, 20, 10, 97,109,109, 93, 45, 93,157,
+ 78,247,198, 8,150, 78,167,131, 88, 44,174,150, 9, 84,171,213,244,214,173, 91,184,127,255, 62,196, 98, 49,236,236,236, 32, 18,
+137,144,156,156,140,216,216, 88,136, 68, 34,216,217,217,213,232,254,152,155,155, 35, 63, 63, 31, 70,163,241,197,181,176,176,176,
+ 64,105,105, 41, 24,134, 49, 41,157, 44,203, 34, 45, 45, 13,217,217,217, 72, 78, 78, 70, 78, 78,206, 11,147, 85, 81, 69, 88,163,
+140,203, 48, 32,132, 32, 58, 58,154,158, 57,115, 6,197,197,197,127,202, 75, 21, 17,210,127, 28,171, 2, 45,160, 23,180,203, 41,
+209,139,179,117, 66, 11,135,192,182,192,179,163, 0,195, 7, 36, 86,104, 28, 84, 27, 73,249, 70,249,163, 76,173, 4, 4,237,177,
+178,174,149, 73,154, 70,193, 7,217,197,122,113,162,206,206,220,191,126, 8, 50, 51, 51, 33, 22,139, 33, 22,139, 17,218,180, 45,
+158,229, 26,101, 15, 82, 85, 50, 80,180, 51, 73,179,156,134, 13, 27,214,145, 74,165, 17, 13, 27, 54, 36, 47,107, 70, 68, 68,128,
+ 97,152,122,193,193,193,126,213, 58,255, 21, 94, 34,232,100,141,193,167, 99, 31,164, 43,157,247,223, 87,215,237,210,253, 35,235,
+101,167,178,252, 31,102,104, 60, 65,245, 19, 65,117, 33, 53, 53, 89, 30, 30, 30, 45,205,204,204, 14,125,251,237,183,158, 98,177,
+248,168,167,167,103,243, 26,149,111, 82,222,154,111,191,232,239, 98, 85, 97,174,244, 74,128, 47, 5, 4, 82,128, 47,133,163,189,
+ 45,230, 13,253,192, 90, 38, 17,252, 97,170,166, 84, 42,221,177,114,229, 74,187,215,205, 85,197,210,176, 97, 67,204,152, 49,195,
+206,218,218,122,251, 95,108,174,172, 81,214,174,234, 46,128,223, 1,156,126,201, 92,121, 3,248,163, 60,106, 21, 77, 41, 77, 50,
+ 81,179, 73,135, 14, 29,206, 62,125,250,180,211,157, 59,119,156, 50, 50, 50,252, 38, 78,156,136,101,203,150, 97,202,148, 41,219,
+ 41,165,117,119,239,222, 29,124,227,198,141,122,148,210, 42, 35, 98, 25, 25, 25, 31, 79,153, 50, 37, 39, 39, 39, 7, 0, 80,175,
+ 94, 61, 20, 20, 20, 96,210,164, 73, 24, 55,110, 92, 69,228, 21,148, 82,100,102,102, 98,209,162, 69,153, 25, 25, 25,159, 86,166,
+105, 52, 26,147,119,239,222,221, 72,167,211,185,162,172, 90, 80, 92, 80, 80, 96,158,151,151,167,208,233,116,114,150,101,229,150,
+150,150,102, 0,100, 3, 7, 14,228, 63,120,240,192,223, 96, 48,164,114, 86,228, 95,106,176,120, 4,119,159,223,186, 0,235,192,
+144, 87,162, 87, 50, 30,129,212,220, 2,207,146,147, 32, 4,137,169,238,129, 41,165,175, 24,172,138, 23, 99,122,122, 58,166, 78,
+157,170,220,186,117,235, 61,173, 86, 27,113,225,194,133,105, 85,126,120, 3,176,179,179, 67, 82, 82, 18,253,241,199, 31,139,142,
+ 30, 61,106, 0, 0,123,123,123, 36, 39, 39,211,233,211,167, 23,239,218,181,139, 86,199, 96, 49, 12, 3,137, 68,130,115,231,206,
+209,153, 51,103, 22,166,167,167, 83, 27, 27, 27,216,216,216,224,212,169, 83,134,105,211,166, 21,198,199,199,191, 88, 87, 29,131,
+ 85, 97, 88, 94, 54, 40,111, 51, 94,149,113,233,210,165,207, 11, 11, 11,199, 79,154, 52, 73,245,240,225, 67,106,103,103, 7, 59,
+ 59, 59,108,218,180,137, 63,104,208, 32,213,221,187,119, 95,172,171, 9, 54, 54, 54,136,139,139,163,243,231,207, 87,157, 62,125,
+ 90, 0, 0,182,182,182,136,141,141,165,115,230,204, 81, 21, 20, 20,140,191,116,233,210,231, 85, 20, 56,120,250,244,233,139,136,
+149, 90,173, 70, 78, 78, 14,146,147,147, 95, 24, 44,149,220,188,195,151,131,187, 52, 40, 85,169,148,215,239, 61,126, 30,222, 48,
+192,190, 84,165, 82, 62, 78,120, 30, 71,233,204, 55,182,109,187,124,249,242, 52,131,193, 16,113,240,224,193,123,107,215,174, 85,
+230,229,229,189,209,176,255, 35, 13, 22,195, 58,130,208,102, 23, 31,151, 88,126,208,165,175,136,100,220, 0,116, 37,128,216, 10,
+ 16, 91,129, 47,183, 65,199,230,193,188, 77,215,138, 28, 65,217, 38, 16,138,171,110,223, 34,160, 14, 0,219,252,100,156,218,170,
+ 89,175,209,162,188,188, 60,240,120,188, 23,102, 72, 38,151,163, 77,247,129,204,134, 27, 26, 71,128, 54, 5,225,153,220,102, 70,
+ 40, 20, 78, 30, 60,120,176, 48, 63, 63, 31, 12,195,188,208,148, 74,165,232,209,163,135, 88,161, 80, 76, 55,249,220,247, 4, 8,
+ 33, 16, 55, 6,232,184, 71, 25,106,231, 3,247, 84,190, 19,191, 95, 47, 13, 12,110,132,225,145,246,210,239, 15,103, 5,222, 73,
+ 86,213, 6,140,227, 97,208,134, 86,215,100,121,122,122, 54,151,203,229,135,247,239,223, 47,107,213,170, 21, 38, 77,154, 36,151,
+ 72, 36, 71, 61, 60, 60, 90, 84,247, 54,149,150, 24,191,156,179,124, 75,230,221, 37,237, 1, 93,105,153,177,122,105,201, 42, 97,
+ 49, 99,253,153, 66,189,158,246, 55, 85, 83,165, 82, 13, 26, 50,100, 72,238, 31,127,252,241, 39,115, 37,145, 72,144,144,144,128,
+239,190,251, 46, 47, 47, 47,239,211,191, 56,151, 6, 3,184, 13, 64, 13,160, 37, 0, 89,121, 79,193, 8, 0,167, 40,165, 70, 74,
+105, 38,165, 52,221, 84, 65, 30,143, 55,101,213,170, 85,124,149, 74,133,161, 67,135, 34, 57, 57, 25,105,105,105,248,250,235,175,
+ 19, 88,150, 29, 84,174,121,135, 82, 26,107,138,158, 86,171,125,148,159,159,223,185,125,251,246, 5,249,249,249,168, 95,191, 62,
+186,116,233, 2, 71, 71, 71, 56, 59, 59,163, 91,183,110,168, 91,183, 46,114,115,115,209,191,127,255,188,236,236,236,246,148,210,
+ 74,123,161,231,230,230,198,111,223,190, 61,110,244,232,209, 13, 83, 82, 82,252, 1,216, 20, 23, 23,203,139,139,139,197, 90,173,
+ 86,106,101,101,101, 21, 28, 28,108, 59,108,216, 48,179,219,183,111,251,167,164,164,148, 0, 72, 2,199,191,211, 96,233,128, 25,
+155,119,111, 82,139,106,121,195,194,183, 1,100, 18, 9,164, 34, 17,164, 86, 54,208,176, 44,214, 37,100, 40, 75, 41,157, 94,221,
+ 3, 83, 74, 95,137, 52, 24,141, 70,172, 89,179, 70, 61,111,222,188,130,140,140,140, 17, 23, 46, 92,104,112,243,230,205,187,166,
+ 24,161,162,162, 34,236,222,189, 91,181,113,227,198,167, 42,149,170,161, 80, 40,212,107,181, 90,108,223,190, 93,189,116,233,210,
+ 68,165, 82, 25, 38, 16, 8,116,213, 49, 47, 21, 17, 44,129, 64,160, 87,171,213, 13,119,236,216, 17,127,232,208, 33,149,185,185,
+ 57, 4, 2,129, 94,169, 84,214,219,178,101,203,163, 29, 59,118,168, 20, 10, 69,181,140, 27,203,178,111,172, 34,100, 89,182, 90,
+ 6, 11, 0,110,222,188,249,171, 78,167, 11,223,190,125,123,202,250,245,235,213,230,230,230, 0, 0,189, 94, 31,182,121,243,230,
+148,213,171, 87,107,170,211,192,189,188,224,129,209,104,196,150, 45, 91, 52, 59,118,236, 72, 49, 24, 12, 97, 21,235, 54,108,216,
+160,222,178,101, 75,138, 78,167, 11,191,121,243,230,175, 85,105, 25,141, 70, 99, 81, 81, 17,248,124, 62,158, 62,125,170,169,136,
+208, 61,121,242,228,133,193,178,183,181, 14,104, 26, 22,228,183,120,205,238,243,114,177, 88,220, 62, 50,212,255,193,227,164, 20,
+ 74, 73, 98, 21,231,126,247,202,149, 43, 13,242,242,242, 70,172, 93,187,182, 96,219,182,109,106,163,209,248,138,201, 18,137, 68,
+255,196,167, 86, 6, 2,233,227, 44,141, 66,194, 24, 8,226,246,149,153, 43,137, 37, 32,177, 2, 36, 86,112,113,113,197,141, 4,
+165, 2, 12, 68, 48,234,237, 77,120, 32,229, 32,144,221,207,132, 66, 32,146,146,140,140,140, 23, 70,168, 98,241,244,246, 71,116,
+ 82,137, 25, 8, 21,131, 7,135,106, 60,235,157, 21, 10, 5, 63, 61, 61,253,207,154,158,158, 60,189, 94,223,222,228,115, 79, 51,
+ 58, 1,236, 23,113, 25,106,167,189,119, 74,125,199, 47,216, 32,149, 26, 11,128, 91,203, 17, 88,199, 25,227,123, 5,139,190, 57,
+144, 29,120, 51, 81, 89, 7, 60, 58, 28,108,137,201, 95, 23,158,158,158,205,100, 50,217,209,125,251,246,201,100, 50, 25,158, 62,
+125,138,122,245,234, 97,206,156, 57, 50,153, 76,118,196,221,221, 61,178, 58,183,233, 90, 6, 77, 42, 41, 54, 70, 76,222,253, 60,
+227,110,186,225, 21,115,149, 93, 74, 49,228,135, 3, 5,249, 69,234,143,174, 62,215,159,169,198,181,188, 93, 80, 80,208,110,250,
+244,233,185,217,217,217,175,152,171,164,164,164, 10, 35, 16, 73, 41,141,249,139,115,169, 28,101,141,215,125, 1,120, 1,104, 64,
+ 41, 53, 0, 40,166,148,214, 40,116, 29, 16, 16,208,208,221,221, 29,171, 87,175,198,186,117,235,242, 23, 47, 94, 12, 74, 41,124,
+124,124,204,107,170,153,153,153,121,227,209,163, 71,237,235,215,175,255,112,197,138, 21, 41, 78, 78, 78,236,176, 97,195, 48,100,
+200, 16,216,217,217, 25,151, 46, 93,250,188,121,243,230,247,227,227,227,219,150,150,150,222, 51,225,254,208,156,156,156, 43,191,
+252,242,203,181,214,173, 91,203, 6, 13, 26,100,183,127,255,126, 27,165, 82,233, 44, 22,139,237,181, 90,173,232,225,195,135,188,
+ 61,123,246, 56, 62,120,240, 32, 65,165, 82,221,160,229, 19,251,113,252, 11, 13,214,111, 79,233,149,210,226,130,133,115, 54,172,
+ 85, 61, 51, 16, 24,106, 7, 64,109,227,130,155, 5, 42, 76,122,152,162, 52,176,116,229,238,167,244,108, 77, 35, 88, 50,153, 12,
+167, 79,159, 54,126,241,197, 23,234, 27, 55,110,252, 82, 88, 88,232,118,243,230,205,109,166,234,176, 44,203,251,236,179,207, 74,
+ 46, 95,190,188, 59, 61, 61, 61, 48, 42, 42,234, 25,203,178,188, 1, 3, 6,148,156, 60,121,242, 15, 66,136,255,173, 91,183, 30,
+215, 32,196, 13,161, 80, 8, 66, 8,110,222,188,153,144,151,151, 23,120,237,218,181, 29,211,166, 77, 43,161,148,242,162,162,162,
+146, 75, 75, 75,235, 95,185,114,101,235,151, 95,126, 89, 66, 41,229,153,170, 91, 97,222, 94, 54, 82, 21,209,172,234, 26, 44, 0,
+136,138,138,138, 41, 40, 40,240,191,113,227,198,209, 97,195,134, 41,203,205,199,195,226,226, 98,191,107,215,174, 29, 30, 52,104,
+144,178, 58,122, 58,157, 14,221,187,119, 87, 94,189,122,245,112,113,113,177,223,205,155, 55, 31, 86,172,187,124,249,242,209,130,
+130, 2,255,168,168, 40, 83, 11,240, 57, 75,151, 46, 77,159, 55,111, 94,122,118,118,246,226, 37, 75,150,100,219,217,217, 65,167,
+211,189, 48, 88, 89, 57,121,103,154,124, 56,250,135,173,191,159,186,185,116,206, 23,173,164, 18,177,104,250,247, 27,206,233,121,
+184,102,162,201,220, 86, 84, 84,228,118,231,206,157, 95,198,143, 31,175, 62,113,226,132, 81, 42,149,194,204,204, 12, 98,241, 63,
+177, 13,169,177, 8, 44, 73,235, 29,106,149,186,116,213,175,154,251,207, 50, 95, 24, 43,136, 45,113, 51,190, 0,223,174,216,205,
+126,215,213,238, 25, 40,146,193,224, 81,213,154,252, 34,176, 36,107, 72, 35, 97,202,111, 63,141,211, 60,123,116,239, 21, 35, 20,
+123,247, 38,150,204, 28,205,206,239, 98,253, 12, 44, 73, 3, 65,172,169,169, 53, 24, 12,189, 22, 44, 88, 80, 26, 31, 31,255,138,
+102, 98, 98, 34,190,255,254,123,149, 70,163,249,200,228,135, 82,204,111, 96,164,212,126,219,213, 92,159, 17,195, 6, 75,165,134,
+ 60,224,250,143,128, 64, 6,136, 45, 16,236, 87, 7, 51,134,126, 40,152,184, 39, 35, 16, 96,221,193, 8,253, 77, 77, 39,159,207,
+ 63,188, 96,193, 2,153, 84, 42,197,147, 39, 79, 32,145, 72, 32,149, 74, 17, 26, 26,138,101,203,150,201, 68, 34,209,209,138,246,
+157,213, 54, 89, 59,158,100,220, 77, 86, 3, 2, 9,114, 74,129, 33, 63, 28,204,207, 43, 84,245,170,142,185,122,221,100,141, 27,
+ 55, 46, 55, 51, 51, 19, 18,137, 4,201,201,201,232,215,175, 95,238,223,196, 92, 1, 64, 41, 0, 23, 0,113, 0,226, 1,220, 33,
+132,136,240, 14,211,179, 61,120,240, 32, 58, 41, 41, 9,159,127,254, 57, 62,249,228, 19,171,143, 63,254, 24,207,158, 61, 67, 92,
+ 92,220,237,119, 73,168, 74,165,186,153,146,146, 82,111,220,184,113, 51, 92, 93, 93, 55,218,216,216,156,179,182,182, 62,235,234,
+234,186, 97,218,180,105,223,166,167,167, 55,208,233,116,119,170,113,127, 40,165,244, 73,124,124,252,129, 45, 91,182, 68,141, 27,
+ 55, 46,225,227,143, 63, 78, 25, 59,118,108,250, 47,191,252,146,118,251,246,237,199, 5, 5, 5,199,171,138,134,113,252, 3, 48,
+117, 86,232, 94,158,104, 58,184, 14, 57,255,113,109, 20,247,175,141,146,207,188,200,165,143, 60,209,186, 38,179,109, 55,108,216,
+144, 26, 12, 6,122,226,196, 9,218,177, 99,199,210,102,205,154, 93, 10, 9, 9,241,169,201, 12,222,145,145,145,199, 66, 67, 67,
+123,191,190,174, 81,163, 70,125, 95, 94,215,178,101,203,152,150, 45, 91, 22,182,104,209,226,169, 41,233,108,209,162, 69,108,211,
+166, 77, 75, 91,180,104, 17,251,242,250,176,176,176,110,173, 91,183, 62,252,242,186, 70,141, 26,117,125,125,221,219,206,189,109,
+219,182,201,113,113,113,244,249,243,231,180, 83,167, 78,105, 21,235,219,180,105,147,124,239,222, 61,250,248,241, 99,218,161, 67,
+135,180,154,206, 94, 30, 26, 26, 58,180,121,243,230, 87, 94, 75,243,144,215,215, 85,166,217,188,121,243, 43, 97, 97, 97, 67, 94,
+ 95, 23, 26, 26, 58,244, 93,103, 89,119,114,114,170, 27, 28, 28,156,181,116,233, 82, 90,187,118,237,172,151,127, 11,140,252,236,
+219,130,162,146,162, 73,115, 86,255,102,231,223,189, 94, 77,102,110, 15, 9, 9,241,105,209,162,197,165, 15, 63,252,176,244,198,
+141, 27,148, 82, 74, 27, 54,108, 72,255, 81,179,214,239,246, 23,210,181,254, 77,233, 26,255,195,177, 51,221, 31,126, 26, 46,215,
+ 68,253,212,137,210, 51,147,233,181,213, 67,104,132,167,200,120,121,146, 91, 28, 93,235,119,148,110,168,219,130, 46,175, 35, 50,
+ 73,115,157, 87,115,186,214,239,232,131, 25,238, 15,123,132,216,105,119,108, 90, 75,159, 60,121, 66, 15,236,217, 78, 27,215,150,
+149,105,174,241, 63, 65, 87,251,183, 50, 73,243,213,103,190,105, 68, 68, 68,201,111,191,253, 70,159, 60,121, 66, 79,158, 60, 73,
+155, 54,109,170, 12, 14, 14,110,101,242,185, 3,132,174, 14,232,110, 88,229,123,113, 90, 91,179,130, 33,225, 18, 77,255, 96,145,
+182, 91,160, 80,215,206, 91,104,104,226,206, 55, 54,112, 98, 88,127, 59,208,118,190, 82, 13, 93,227,123,129,174,241,111,111,106,
+ 58,125,124,124,158,123,120,120,208,183, 45,117,235,214,205,110,217,178, 37,191, 38,247, 61,220, 1,238,109,235,138,211, 79,207,
+105, 77,187,212, 87,228, 54,118,227,183,126,215,188, 4, 32,216,214,214, 54,103,227,198,141,212,193,193, 33, 27, 64,224,223, 34,
+127,150,173,179, 6,208, 13,128, 93,249,255,205, 0,180, 2, 80,251, 29, 52,155,180,107,215, 78, 31, 29, 29, 77,159, 62,125, 74,
+143, 29, 59, 70,155, 54,109,106, 0, 16,249,183,121, 54, 57, 77,110,121,105, 33,255,205,232, 36, 33,164,237,155, 6, 35, 11, 9,
+ 9,161,237,219,183, 87,157, 63,127,190, 68,171,213, 14,191,117,235,214,129,119,213,252,111,164,243,191,161,217,186,117,235, 43,
+ 12,195,212, 46,239, 2,156,118,234,212,169,134, 0,208,170, 85,171, 43, 60, 30,175,118,185,233, 77, 59,125,250,116,195,127,218,
+185, 87,224,236,236, 92,151, 97,152,227, 0, 52, 41, 41, 41, 47,122, 59,217, 7,118,139,176,182,178,104, 85, 80, 80,120, 59,227,
+254,254,163,239,146,206,208,208,208,174, 98,177,120,109, 68, 68,132,252,204,153, 51,178,168,168, 40,242,143,186,158, 43,188, 68,
+ 16,137, 66, 65, 49,245,126,170,210,243,219,131, 57,117, 62,108,211, 84,176,105,223,121,118, 97, 79,251,248, 38, 94,242, 4, 8,
+216, 31, 64, 52, 55,240,105,162,198,100, 77, 41,105, 4,163, 96,234,157,100,165,251,164, 63,242,189,219,126, 52,132,119,112,231,
+ 90,246,199,238, 54,241, 77,234,152, 61, 7,197, 15, 16, 43,175,154,172,249,234,115,223, 84, 44, 22, 31,237,223,191,191,217,142,
+ 29, 59, 84,106,181,186,115,116,116,244,217,106,157,251,122,191, 90, 48,146,121,160,212,173,234,175, 71, 60,129, 17,243,240, 69,
+236,243,191,195,125,111,236, 72,220,229, 22,226, 67, 74,149, 97,156, 41,145, 43, 83, 52, 9, 33,193, 86, 86, 86, 91,243,243,243,
+251,154, 18,185,250, 95,158, 59, 33,196, 14, 64, 88,121,212,138, 0,136, 49, 53,106, 83,137,102, 51, 30,143, 55,165, 78,157, 58,
+245,159, 62,125,122,223,104, 52,254, 72, 41, 61,247,111,120,119,252, 27, 52,255,105,252, 37,125,216,165, 82,105,244,185,115,231,
+142, 9,133,194,239, 46, 95,190,172,249, 55, 93,240, 51,103,206, 52,121,211,250,179,103,207, 54,249,183, 92,131,180,180,180, 56,
+ 0,238,175,175,207,138,217,127, 21,192,213,247,113,140, 91,183,110, 29,136,140,140, 60,113,249,242,229,111,228,114,121,135,127,
+220, 69, 28, 29,175,197, 10,175, 91, 16,137,190, 15,114,145, 77,253,182, 19, 37, 11,142, 95,113, 95,216,211,254,121, 85,230,170,
+ 10,205, 27,144,234,191,111,224, 38,155, 58,191, 27,200, 15, 71, 55,185,255,216,221,230,121, 85,230,202, 20,162,162,162, 46,135,
+132,132,116,220,185,115,231,102,181, 90, 61,180, 42,115,245, 70, 20, 76, 6, 74,245, 51,161,231, 5,129, 66, 84, 73,104, 94, 9,
+134,119, 31, 89,200,252,187,220,178,107, 25, 52, 9, 64,224,251,212,164,148,222, 6,224,255,119,204,162,148,210,108, 0,135,223,
+179,230, 37, 0,151,184, 87, 55, 7,103,176,222,194,197,139, 23, 67,184, 75,207,241,223,230,220,185,115, 26, 0,223,150, 47,255,
+ 60, 94, 50, 89, 33,181,164,163,255, 24, 33, 85,130,146, 20, 8,216,165,213, 54, 87,111, 48, 89,141,220,165,227,246, 14,151, 42,
+ 65,145, 1,138, 37,239, 98,174, 94, 54, 89, 0,106,215, 88,160,215, 3, 29,128, 4, 16,146,136, 89,120,123, 99,197, 89,120, 81,
+143,193,193,193,193,241,175, 49, 88, 28, 28, 28,239,209,100,237, 9,184,137, 28,222, 36, 48,168, 13, 24,146, 80,106,200,192,232,
+ 68,237, 59,106, 94, 71, 14, 25, 11, 30,234, 66,100,136, 71,137, 54, 3, 35,222, 65,243,125, 83,102,158,222,110,160,102,114, 89,
+131,131,131,131, 51, 88, 28, 28, 28,239, 66, 89, 84, 39,165,124,249,251,106,114,112,112,112,252,139, 32, 0,218,190,229, 3,209,
+228,198,107,132,144,182, 53,248, 0, 61,197,105,114,154,156, 38,167,201,105,114,154,156,230,191, 75,179, 42,237,127, 76,227,249,
+255,102, 23, 69,112, 93, 88, 57, 77, 78,147,211,228, 52, 57, 77, 78,147,211,252, 23, 46, 12, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+222, 43,127,105, 27, 44,153,109, 93, 39,240,153,250,132,165,126, 0, 64, 25, 18, 11, 3,123, 87,153, 19,151,254,174,218,196,161,
+158,204, 76,192,219, 94,162, 55,126, 76, 51,239, 41,223, 71,122, 9, 33,205, 80, 54,188, 64, 82,121,119, 97, 14, 14, 14, 14, 14,
+ 14, 14, 14,211, 13, 86,221, 38, 61, 46,154,201,228,222, 0, 96,100, 41,140, 44, 80,148,159,117, 53,233,238,201, 30, 0,224, 28,
+216,102,175, 88,110, 27, 97,100, 41, 88, 74, 97,100, 41,244, 26,213,147,236, 7,135, 77,154,121,222,204,222,183, 71,219,118,109,
+123,118,238,252,161,111,189,160,122, 94, 0,112,239,254,189,248, 67,135, 14, 63, 50,179,247,253,163, 36,235,209,222,119, 57, 49,
+ 51,129,224,219,176, 70,225,237,111,222,188,254, 13,128,175,223,211,245, 18,210, 75,157,182,144,102, 71,218,112, 89,135,131,131,
+131,131,131,131,163,218, 6,203, 76, 38,247, 62,189,111,189,253,222, 75,201, 0,128,182, 13, 29, 49,251,167,141,221, 9, 33,143,
+ 0,224,163, 47,127,170,251,237,248,193,184, 18,147, 5, 74, 41,130,189,109,208,237,227, 81, 38, 29, 84,234, 24, 16,214,183, 79,
+159,143, 39, 77,154,216,245,201,147, 39,137, 59,118,236,184, 8, 0,205, 91,180,240,158, 63,127,126,159, 69, 86,214, 98,169, 99,
+ 64,170, 42,227,193,205, 26,153, 43, 71, 47, 91,255,192,176, 33, 59,214,253,200,111,213,177,223,231,102,142, 94, 75, 74, 50,226,
+115,106,162, 37,118, 11,172,109, 33, 16,206, 38, 12,195,183,176,247,176, 7, 0,115, 39,255, 35,246, 94,205,140,102,150,246,119,
+ 74, 85,170,205, 89, 15,143,173,227, 38,236,228,224,224,224,224,224,224,168,210, 96, 1,128,153,148,143, 71,207, 50, 0, 0,150,
+ 82, 96,216,160, 94,200,204,204,168,171, 51,178, 24,216,183, 7,162, 99,211,241, 40, 33, 27,148, 82,212,117,149,153,124, 80, 30,
+216,208,207, 62,255,172,229,241, 19, 39,110,124, 59,253,219, 45,132,148,141,222,189,246,151, 95, 35,102,204,156, 49,244,147, 65,
+159,124,176,103,207,158, 24, 0, 53, 50, 88,140,192,114,233, 15,243,103,153,165,100,171,213,227, 38, 78,230, 77, 24, 63,102, 17,
+128, 65, 53, 49, 87,254,110,174,223, 93, 60,177, 71, 38,147,201,176,110,221, 58, 49,176, 31,253,187,182, 16,117,250,240, 67,248,
+248, 5, 53,249,113,229,142,250, 39, 68,162,207,109,235,126,208, 35, 39,238,100, 58,151,165, 56, 56, 56, 56, 56, 56, 56, 42,109,
+228,110, 52, 82, 60, 74, 72,199,163,132,116,220,136,205,134,142,229,225,167,121, 83,241,195,172,201,200, 85, 2,123,175, 36, 35,
+ 46, 33, 3,113, 9, 25,200,201, 47,249,211,254,175,119,181,252,233,123, 89,195,165, 75, 45,126,108,215, 66, 30,105,109,101,101,
+245, 56,102, 75,233,140, 9,153,254,179,199, 37, 11, 5, 18,135, 20, 43,135, 90, 77,118,239,217, 19,224, 96,103, 47, 55, 55,183,
+152,108,237,215,110,189,165, 71,164, 69,101,154,127, 50,133,142,129, 45,187,116,233,212,201,209,193,158, 29,177, 52, 42, 54,192,
+207,199,224, 83,215, 47,210,204,209,183,229,219,246,121,147,166,216, 45,176,182,151,147,195,119,231,143,237,145,169,213,106,220,
+191,127, 31,185,185,185,229,219, 3, 14, 14, 78,112,119,117,198,207, 11, 38,201,102, 77, 29, 21, 34,150,200,246, 19, 66,136,169,
+233,172, 9,156, 38,167,201,105,114,154,156, 38,167,249, 79,213,252, 87, 25,172,248,228, 60, 60,122,150,129, 16, 63, 23,120,121,
+ 56,225, 70, 92, 62,182,157, 73,198,250,227, 73, 56,115, 39, 27, 44, 95,129,140, 34,224,113, 98, 38, 30, 39,229,160,170, 74, 50,
+158, 88,208,119,220,184,194, 73,245, 2,138, 26,159, 59, 58, 26, 46,118,143, 3,166, 76, 41, 24,205, 19, 11,250,218, 59, 90,238,
+152, 52,118,196, 0,133, 76, 42,210,106,180,240,244,112,147,140, 28,250,217, 96,161,153,124,135,169, 39, 99,103, 23, 32, 23, 75,
+229, 91,190,251,118,162,100,201,222,199,207, 75,181, 40,253,227, 74,230,211, 73, 83,103, 20,241, 4,210, 95,236,236, 2,228,166,
+232,136,221, 2,107,187,219,216,124,119,233,248, 30,153, 78,167, 65,122,122, 58,180, 90, 45, 12, 6, 67,217,239, 18, 9,196, 18,
+ 9,138, 84, 6, 60,203, 80,162,101,243, 38,188,134,193,129,126,118,126, 29,135,115, 89,138,131,131,131,131,131,131,227,173, 6,
+171, 68, 89,250,100,208,136,137, 89, 94,102,233,218,110,145,254,160,160,200, 78, 79,194,131,155,199,240, 36,250, 56,138,114,158,
+ 3,160,240,240,116,135, 80,245, 76,187,102,245,170, 44,214,160,126,242, 54,189,110,221,156, 93,159,196,202,153, 31, 23,214,186,
+ 22,247, 40,221,118,212,240,141,136,123,148,110,251,227,194, 90,215,158,196,202, 25,153,216,216,100, 80,191,110,164, 91,231, 14,
+152, 50,101, 18,186,117,238,128, 73, 35,250, 16,137, 72,208,216,212,147,209,138, 36,223, 79,253,118,142, 34,163, 64,167,187, 17,
+ 87,162,145,201,165,210,203,143, 75,212, 90,200,244, 93,251,142,200,214, 8,249,115, 76, 49, 87, 78,230,230,223, 93, 57,245,187,
+140, 82,138,212,212, 84,104,181, 90,232,245,250, 23, 6,203,210,210, 18, 5,165, 58, 60,207, 82, 34, 49, 83,137,152,196, 34,116,
+236,208, 81,198, 23,136, 6,112, 89,138,131,131,131,131,131,131,227,173, 6, 43,238,202,222,230,183, 78,110,113,200,201,204, 40,
+ 52,147,240,193,103, 8, 50, 83,226,177,121,209, 88,236, 94, 49, 17, 5,233,241,160, 20,144, 10,121,208,148,230, 21,166,223,222,
+237,144, 83, 73, 15, 66, 66,244, 31,172, 92,155,224,153,144, 64,205,183,111, 47, 17, 0,192,246,237, 37,130,132, 4,106,190,114,
+109,130,167,136,228,128, 26,141,232,220,237, 35,108,217,180, 14, 17,173,187,225,247, 11,207,161, 84,233, 76,154,255, 76,226, 80,
+215,195,214,209,241,163,177,159,180, 81, 52,170,107, 37,247,113,183,224,137, 4, 2,131,128, 39, 52, 30,188, 89,152,214,190, 75,
+119,190, 76,110,222, 65,226, 80,215,163, 50, 29, 11,129,112,246,229, 19,191,203,120, 60, 30,158, 63,127, 14,173, 86, 11,173, 86,
+ 11,141, 70, 3,189, 94, 15, 0, 40, 86,233,145,158,171, 65,114,182, 10,201,217, 42, 60,120, 94, 12,145,220, 18,122,189, 62,136,
+203, 82, 28, 28, 28, 28, 28, 28, 28, 38, 13, 52,154,154,153, 7, 27, 51, 62,236,156, 61, 49, 96,236, 79, 0, 0,163, 81, 15, 74,
+ 1,131,145,133, 41,253,231, 40, 21,156,252, 98,164,103,130,135, 39, 41, 28,240,177, 76, 5, 0, 3, 62,150,169, 60, 60, 73,225,
+ 23, 35, 61, 19,148, 58, 43,157,193,104,196,229,152, 44,252,184,235, 33,102,108,186,135, 99,183, 76,111, 51,206, 23, 72,199,253,
+176, 96,190,140,207, 35, 36, 38,169,164, 36, 37,215, 80,194, 19, 8,116, 50,153,136,106, 41, 95,147,152,109,204,237,208,123,100,
+ 34,143, 39, 24, 85,117, 90, 89, 80, 74,161,209,104,160,213,106,161,211,233, 94, 68,177, 0,160,176, 84,143,244, 60, 53,146,179,
+ 85,120,158,173, 66, 74,182, 10,153,249,106,112, 29, 9, 57, 56, 56, 56, 56, 56, 56, 76, 50, 88, 44,128,199, 73, 57, 16,241, 89,
+184,122,120,129,190, 52,129, 61, 5, 96, 48, 86, 62,169,125, 5,251,247,167,165,212,241, 46,101, 39, 79,126, 30, 17, 84,207,230,
+238,200, 17,110,177, 65,245,108,238, 78,158,252, 60,162,142,119, 41,171, 55,138,140,148, 82,176, 20,229, 11,173,150, 97, 33,132,
+215, 56,216,207,157, 63,123,251,227,231,163, 86,197, 61, 18, 10,133,122, 87, 91, 25,113,119,144,241,106,217, 73, 69, 26, 61,163,
+241,173,215, 72, 71,128,134,149,233, 20,234,117, 51,155,181,239,173,212,233, 12,112,115,115,123,197, 92, 85, 84, 17, 22, 42,117,
+ 72,207, 87,227,121,182, 18,201,217, 74, 40, 53, 6,220,143, 75, 0, 97,120,247,185, 44,197,193,193,193,193,193,193, 97, 82, 4,
+203,221,213, 1,215,239, 39,193,221, 78, 2, 11,115, 5, 98,227, 83,192, 99, 4, 96, 8,160, 55,152,110,130,168, 78,191,107,241,
+ 98,139, 69, 73, 9,198,235,171, 86, 63,125,146,148, 96,188,190,120,177,197, 34,170,211,239, 2,202,122,231,149,153,172, 50,163,
+101,100, 77, 63, 17, 74, 89,123, 59, 75, 9,255,214,211,210, 92,134,225,105,108, 44, 36,172,141,133,152,113,178, 20, 11, 92,109,
+132, 66,145,136,129,163,157,173, 1,148, 58, 84,166,163, 73,142,121,150, 94, 84,244, 77,243,118, 31, 41, 5, 2, 1, 60, 61, 61,
+ 95, 84, 19, 86, 24,172,172,236,252, 23, 17,172,244, 60, 13,164, 34, 6,183, 47,159, 86, 26,141,250,205, 92,150,226,224,224,224,
+224,224,224,168,218, 96, 81,192, 76, 38, 1,229, 73,112, 49, 42, 30,190, 1,245,177,233,192, 13,120,215,107, 12,150, 53,192,192,
+ 26, 77, 62,216,196,169,202,232, 9, 19, 10,191, 74,207,164, 75,123,244,112, 57,156,158, 73,151, 78,152, 80,248,213,196,169,202,
+232,242, 67,129,101,105,153,209, 42, 31, 33,222, 84, 8,144,150,148, 89, 92,234,233, 40, 7, 79, 32,208,200,197, 66,131,149, 92,
+196,218, 89,136, 4,118,230, 98,145,189,185,136,159,155,151,165, 2, 72, 90, 85, 90,154,228,152,103,207,243,243,191,105,209,177,
+159,210,204, 76, 1, 47, 47, 47,104, 52,154, 23, 6,171,184,164, 20,121, 69, 42, 80, 10,212,117,149, 35, 54,250,146, 49, 55, 43,
+245, 65,126,220,177,117, 92,150,226,224,224,224,224,224,224, 48, 41,130,101,100, 41,108,109,172, 33,145,155, 35, 33, 83,135, 98,
+ 98,143,124, 37,133,209, 88,121, 4,139, 16,210,246, 77,235,247,239, 79, 75,217,183, 47,123,253,254,253,105, 41, 47, 59, 57,246,
+ 69, 21, 97,249, 95,150,154,172, 73,169,241,232,193,147, 87,242,186,134,219, 89, 49, 60,158, 74, 40, 96, 52,124, 33, 79, 39,228,
+ 51,122, 33,159,209, 58,152, 11,120,103, 14,108, 99, 8,161,103, 76,209,212, 36,199, 60, 75,200,202,250,166,117,231,254, 74,123,
+ 7, 7,124,242,201, 39,112,115,115, 3, 0,152, 73, 8,108, 69, 74,240,212,105, 56,127, 96, 67,105,108,212,217, 40, 24, 53, 61,
+ 94, 30,205,253,109,233,124, 23, 56, 77, 78,147,211,228, 52, 57, 77, 78,243,159,170,249, 79,195,132,201,158, 41,234, 56,201,225,
+237, 34,135, 90,103, 15,181,214,136, 82,181, 17, 69, 74, 29,138,148,122, 36,100, 40,241,248,236,187, 39,132, 2,160, 44, 64, 80,
+ 86, 85, 8, 82,102,236, 40, 49,109,255, 82, 65,209,162, 31,231,207,234,183,115,247, 31, 24,243,161,147,219,221, 4,109, 26, 33,
+140,138,225,241,245,214, 10,190,224,105,252,163,244,243, 39,246,132,150,138,148, 67, 76, 77,147, 38, 57,230,153,216, 45,240, 27,
+223,134,173,103,131,130,175, 85, 21,202,167, 54, 13,192,157, 59,119,213,177,241, 25, 6,158,196,242, 46,107,212,109,205,143,227,
+166,202,225,224,224,224,224,224,224,168,134,193, 82,170,148, 79, 62,232, 57,228,197,132,206, 70, 35, 5,203, 82, 24,203, 35, 76,
+ 44,165, 48,232, 84, 79,222, 53, 33, 70,150,189,177,122,211,206, 78, 13,130, 27,243, 2,106,153,161, 40, 63, 27, 55,175, 95, 53,
+ 80,150,189,106,146, 65, 75, 76,212,152, 57,248,245,233,243, 81,143,157,159,143, 24, 83,212,162, 69, 43,177,141,173,185, 46, 51,
+ 59,171,104,219,186, 29,198, 67,127,236, 12, 5,203, 14,164,137,137,154,234,164, 75,147, 28,243, 12,192,128,114,199,222, 26, 8,
+104,169,202,126,220, 89,153, 21,119,134,203, 62, 28, 28, 28, 28, 28, 28, 28, 53, 50, 88,143,175,238,109,254,191, 72, 72, 94, 94,
+230, 39, 91,119,252, 49,111,219,174, 3, 77, 53, 58,157, 11, 11, 94,178, 81,175, 63, 47, 46,206,157, 97,170, 70, 73,102,236, 3,
+226,225, 17,250,235,207,139,198,255,178,114,113, 27,176, 70, 95, 16,146, 64, 8, 61, 83, 34, 84, 14,171,174,185,122, 3, 57,164,
+217,145,118, 0,114,184,172,195,193,193,193,193,193,193, 81, 99,131,245,191, 34, 47,254,122, 49,128, 49,239,170, 83,110,162, 22,
+148, 47,239, 21, 74,233,125, 0,220, 80, 12, 28, 28, 28, 28, 28, 28, 28,149,194,112,151,128,131,131,131,131,131,131,131,227,253,
+ 66, 0,188,165, 87,158,233, 51,101,215,164, 55, 65, 85,250,156, 38,167,201,105,114,154,156, 38,167,201,105,254,243, 52,171,210,
+174,142,255,248, 91, 67,203, 71, 76,255,111, 44, 0,218,114,154,156, 38,167,201,105,114,154,156, 38,167,201,105,254,219, 22,174,
+138,144,131,131,131,131,227, 95,135,109,221,174,102,182,117,187,154,153,186,189, 93, 64,111, 7,187,128,222, 14,220,149,227, 48,
+ 21, 62,119, 9,222, 29, 66,136, 24, 0, 75, 41,213,253, 85,105,176,178,170,109,110, 80,216,238,101, 88,205, 15,133,201,119, 79,
+190,239,243, 11, 8, 8, 8, 6,128, 7, 15, 30,220,166,148,190,107,111, 76,200, 29,124,251, 91,153, 91, 14,215,177, 90,163,178,
+ 84,185,186, 36, 35,110,207,251, 76,179,157, 93,128, 92, 43,150, 46, 4,161, 29, 65,193, 80, 66,206,240,138,245,227, 11, 10,238,
+ 20, 86,182, 95,173,110, 11,252, 62,239,243,225,244,245,191, 29,158,247,124,255,180,216,215,127,183,238,184, 66, 49,122, 96,187,
+ 41, 43,119,238,255, 62,231,192,228, 18, 46,247, 87,159, 90,205, 62,182, 52,240, 29,121,105,231, 22,229, 86,103, 63, 87,223,136,
+ 24,129, 64, 96,167,211,233,178, 82,227,174, 5,153,178,143,155, 95,147,104, 30,143,113, 54, 26,216,148,228, 71, 87, 66,185,171,
+ 95, 53, 82,251, 58, 17, 48, 24,190,166, 0, 1,225,255,164,206,125,250, 78, 35, 29, 58, 59, 59, 75, 45, 44, 44, 90,152,155,155,
+187,201,100, 50, 73,126,126,190, 42, 63, 63,255,121, 82, 82,210, 25, 74,169,225,175, 56, 71,187,192,238,211,248, 34,102,102,249,
+191,103,103,199,236, 91, 80,249,246,221,230, 17,134, 76, 43,255,247,130,236,152,253,211,255, 14,247,202,161, 94,207,112, 80,118,
+ 60,195,240,154, 24,169, 97,126,214,189,253,171,170,179,127, 68, 68, 68,119,189, 94, 47,174,248,191, 64, 32,208, 92,189,122,117,
+ 31,247, 20,252, 69, 6,203, 53,160,183,149,158, 79,103,241,121,204, 71, 44,165,138,244,219,187,229,127,231, 19,116, 15, 31,120,
+139, 97, 24,215,151,215,177, 44,155,146,116,125,203,123, 41,108, 9, 33,174, 63,141, 11,153,146,153,171, 42, 34,132,204,125,155,
+249,112, 8,238,127,133, 48,164, 54, 33, 4, 12, 67,192, 43, 27, 64, 53,237,249,245,173, 13,223,160,233,100, 46,231,215, 45, 42,
+ 53,220,167,148, 86,249, 18,146,218,248, 56,203,108, 92,206, 71,118, 31,237,121,235,196, 70,127, 51, 7,191, 54, 37,153,177, 15,
+222,195,185,217,121,121,121,133,213,173, 91,215,102,244,232,209, 66, 0, 88,178,100,137,183,183,183,119,110,124,124,252, 77, 74,
+105,118,141,204,149,189,223, 39,203, 22,205,217,210,177, 99, 39,164,229,148, 98,225,226,149,145,102,142,117,123,191, 47,147, 69,
+156, 67,164,150,114,121,204,151,227,103,184,116,106, 21,198,207, 47,213,225,200,153, 27, 3,246,172,255,161,181,165,101,131,160,
+202, 76, 22,171, 44,156,238, 96, 70, 59,176,202, 66, 0,232,255,250,239, 46,102,250,182,118, 82, 99, 7, 39, 49,255, 54,128, 63,
+170,124,185,132, 13, 58, 46, 16, 10,221, 9, 97,192, 16,128,199, 35, 96, 8, 1, 67, 0,131, 94,155,244,228,226,134,246,127,139,
+130, 58,228,147, 12, 66,136, 13,195,148,165,143, 16,128, 97, 24,240,203, 70,254, 45,122,122,101,163,205,123,200, 79, 22, 65,222,
+150,129, 31, 54,109,182,225,252,179, 60,121,173,150,227, 15, 19,202,172, 74,186,240,211, 29, 83,246,151, 72, 36, 86, 7, 15, 30,
+180,235,208,161,131,133, 67, 80,247,243,166,236, 99, 38,146, 4, 28, 58,116, 64,216,161, 67,251,106,228, 79,223, 15,192, 48, 91,
+ 9, 32, 96, 89,186,132,199,210,223, 74,114,227,226,171, 59,152,176,125, 80,247, 57, 32,240, 55,121, 7,138,135, 89,247,247,205,
+168,225,181,229, 73,237,125, 63,149, 74, 36,147,124,124,253,235, 38, 60,139,143, 43, 42, 42, 92,172,202,138, 91, 79, 41,101,171,
+ 37,166, 55,124,117,234, 98, 84, 71,190, 64, 64, 58,180, 9,231, 1,120, 39,131,229,224,224,208,125,197,138, 21,117, 34, 34, 34,
+ 0, 0, 6,131,193,124,247,238,221,142,115,231,206,149,155,242, 12,189, 9, 23, 23, 23, 23, 11, 11,139, 90, 82,169,212, 5, 0,
+ 84, 42, 85,106, 97, 97,225,243,212,212,212,212,170,246,117, 12,238,109,203, 48,152,115,236,143, 95,248, 0,208,190,231,240,121,
+158,145, 95, 89, 17,158, 64,245,166,237,141, 6,173,156, 33,100,252,233,131, 27, 9, 0,180,233, 58,120,170, 93, 64,239,159,179,
+ 31,236,206,252, 75, 62,232,123,247,230,217, 62,214,117, 39,148, 76, 8, 9, 13,107,252, 81,183,142,240,247,114, 70,247,126, 35,
+ 39, 1,168,150,193,210,235,245,226, 61,123,246,184, 50, 12,195, 51, 24, 12,234, 62,125,250,100,189, 75,218,124,154, 13,186, 2,
+ 66,220,116, 6,195,175, 73,215,188,230, 81, 58,147,125, 61,237, 78, 9,252,111, 64,152,161,148,101,147,211,163,119, 52,225, 12,
+ 86, 57,182,117,187,154,241,196,194,251,173,154, 55,182,153, 58,178,135,104,205,111, 23,225, 28,220, 39, 53,237,246,111, 46,127,
+215, 19,100, 24,198,117,223,246, 21,246, 50, 17, 15, 0, 80,162, 54,160,231, 39, 85,143, 6,225, 18, 54,224, 28, 8,124, 43,234,
+ 80,141, 70,131,132,207, 23,168, 9, 0,144,178,222, 1, 82,169,232,218,250,111, 34, 10, 7,119,169, 61,112,202,207,209,155, 0,
+ 88, 2,200,120,227, 67,193, 48,174, 59, 55, 44,177,119,177,145,128,207, 35, 40, 81, 25,208, 99,224, 4,227,155, 12,219,250,111,
+ 34,230,124,210,209,163,175,125,135,223,123, 2, 56, 90,233, 11,196, 49,192, 79, 97,235,124,242,163,225,115,156,149, 48,199,183,
+243,150,216, 95, 62,177,251, 98,219,238, 67,116,207, 83, 82,148, 6,157,254, 81,110, 94,250,196,226,180,184,199,166, 22,212,102,
+102,102,117,204,204,204, 26,116,236,216, 81, 50,105,210, 36, 65,100,100,228,139,223,135, 13, 27, 38, 60,119,238,156,211,162, 69,
+139, 58, 57, 59, 59,171, 75, 74, 74,238,148,148,148, 60,165,148,154, 60, 41,165,163,163,221,151, 31,245,232,130,214, 61,191,128,
+145, 37, 24, 54,106, 60,142, 31,253, 99, 4,128,247, 98,176,204,120,204,236,161,163,191,118,105, 17,209,144,191, 96,247, 99, 88,
+202,132,104, 23,222,144, 47, 17,124,229,184,227,215, 69,139, 1,124,246,166,200, 21,171, 44,156, 30,100,171,237,215, 53,162, 54,
+ 14,236,208,246,115,109, 59, 5,140,204,226, 69, 36,203,171,227, 24,133,149, 84,186,194,217,146,103, 47, 54,102,175,240,234, 56,
+230, 84,252,209,229,197,149,165, 69, 32, 20,186,175, 95,241,157,143,149, 66, 8, 62, 67,192,227, 17,240,121, 12,212, 90, 35, 6,
+142,156,246,190, 34,140, 60,169,189, 79, 39, 6, 24, 12, 0, 44,176, 81,149,245,248, 72,117,238, 9, 97,120, 54,187, 55, 44,226,
+219, 91,136,193,227, 17,240, 24,128,199, 16, 36,102,170, 48,122,210, 44,139,119, 53,234, 29,155,218,135,157,251,185,101,251,198,
+ 65,214,245,119, 93, 37, 22,141, 59,246,181,201, 81,203, 62,221,185,255,108,191, 90, 45, 38, 92,167,148,253, 49,249,226,210, 19,
+149,233,104, 52,154,204,246, 29, 58,154, 19,190, 92,118,106,223,166, 22,124,134, 64,111,164, 48, 24,203, 6, 65,102, 41, 69,217,
+119, 75,217, 71, 12,101, 41,134, 14,253, 28,237, 59,116, 84,178, 6, 54,165, 26,133,198,214, 99,167, 46,219,105,244, 44, 22,173,
+ 88, 63,167,180, 48,123,206,179, 88,155, 68,153, 67,221,241,202,204,184, 3,166,159, 56,252,227,174,236,238,177,253,208, 53, 4,
+ 5,248,151, 13,212,204, 82,248,186,202,177,253,240, 53,248,249,250,149,165,155,165,168,235,102,134,150, 31, 14,172,225,245,141,
+228,203, 29,252,118,116,237, 53,168, 87,207, 94,253, 97,109,101, 14,173, 78, 83,247,244,241, 35,191,172, 94,177,176, 41, 33,228,
+211,106,153, 67,106,124,241, 94,160, 44,251,206,181, 28,206,206,206,118, 97, 97, 97, 47,254,111, 48, 24,224,233,233,137,212,212,
+ 84,223, 26,152, 53,153,179,179,243,135, 11, 23, 46,180,111,213,170,149,192,206,206, 14, 0,144,157,157,237,114,254,252,249,134,
+ 13, 27, 54,204, 74, 75, 75, 59,156,153,153,169,124,171,169, 96,213, 66, 30,229,243,196, 98,105,185,175, 5, 51,105,244,199,245,
+237,236,236,222,248,113,156,155,155, 39,154, 57,115, 6,225,243, 5,101,219, 83,202, 80,214,248,214, 57, 70,154, 52,105,210, 85,
+167,211, 73,222,244, 91,142,193,174,147,154, 21,245, 45,123,139, 0,124, 30, 47, 63,237,246, 30, 59,147, 77,123,253,110,237,156,
+ 24,193,234, 46,221,186,121,116,239, 20, 9, 39, 59, 11,156,185, 22,135,177,223,252, 4,189,193,184,180, 38,247,135,199,227,241,
+179,178,178, 18,173,172,172, 28,223,195,251,182,246,254,237,203,237,207, 94,188, 53,245,103,241,206,145,117,154, 13,214,151,181,
+ 71, 42,155,153,197, 87, 98, 46,104,217,189,173,185,181,139,159,100,221,138, 5, 2, 46,130,245,242,141, 16,241,230, 54,107, 18,
+102, 51,117,220,231,162,185,235,207,227,234,241,195,170,180,219,187,223,139,185, 82,216,251, 70, 16, 30,127, 56,225,241,228,132,
+ 33, 34,214,200, 38, 27,180,218,121,202,156,184,244,119,213,102, 89,138,223,175, 84,211,152, 83,234,253,203,207,139,236, 29, 44,
+197, 80,235,140, 24,252,229,183, 88,187,116,142,194,206, 66, 4,141,206,136, 77, 7,110,229,212, 83, 46,161,131, 59,212, 30,248,
+221,250,152, 63,126,220, 26,251, 71,217,179,250,214,140, 7,123, 11, 49,190,219, 25, 7,115,169, 0, 86, 10, 33, 24,230,205,230,
+106,112,151, 50,205,130, 98,173,129, 16, 34,162,148,106,223,104, 36,156,130,154,155,219,185,238,233, 49,116,142, 93, 92, 38, 1,
+133, 14,241,230, 18,124,244,201, 72,203, 58,142, 82,200, 37, 60, 36, 38,167,123,126, 53,121,114,168,196,201, 47, 76,157, 30,251,
+188,170,211,246,240,240,232,217,185,115,103,217,196,137, 19, 5,110,110,110,216,186,251,184,251, 7,189,198,116, 73,205,200,117,
+ 99, 41,224, 96,111,157,252,121,223, 78, 7,143, 28, 57,146,148,156,156, 44, 88,184,112, 97,248,222,189,123, 3,170,243, 37,106,
+164, 20,106,141, 17,198,242, 23, 99,118,161,166, 6, 47, 21,194,188,253,203,156,118,107, 31, 25,198, 95,178,239, 41,138,149, 6,
+200, 68,124,196,167,151, 34, 34, 60,140,191,107, 29,105,245,166, 61, 62,239,243,225,116, 7, 51,218,161,107, 68,109,216, 91,201,
+176,225,231,239,112,224,234,179, 14,153, 37, 4,182, 93, 23, 14,119, 18,243, 63,176,147, 9, 87, 68,134,122, 57,182, 14,113,199,
+205, 80, 47,199, 11, 81,143,226,234,245, 89, 60, 58,181, 68,112, 42,239,232,232, 55, 26, 45,134, 48,176, 86, 8,177,254,120, 18,
+100, 18, 62,228, 18, 62,228,226,178,191, 12, 67,222, 41, 95, 75,157, 3,220,120,172,241,115,115,231,128,207,251,245,233,237,252,
+113,191,222, 20, 60, 6,187,127, 63,216,109,219,182,173,233,102,142,190,235,140, 12,111,189, 42,237, 65,114,213,215, 19,176,183,
+ 16,225,171,117,247, 97, 46, 21, 64, 33, 19,192, 92, 38, 64,235,250,118, 53, 78, 39, 33,196,106, 68,183, 58,157,238,110,105,219,
+202,183,150,153,207,157,248,194, 7,159,207,187,181,244, 92, 65,171,113, 63, 47, 9,176, 41, 41,208,242,103, 76, 26,202, 79, 73,
+ 75,107,181,251,224,249,214,206,141, 62,127,100,208,149,126,157,117,231,183,253,111,210, 75,142,189,210,208, 53,162,183, 68, 87,
+162,191,119,231, 81,138, 87,190, 70,140,152,196, 34,200, 37,124,152, 85, 92, 91, 9, 31,114,137, 0,102, 18, 62,210, 82, 18,144,
+ 87,202,187,148,106,195,180,162,231,174, 84,171, 42, 74,173, 51,226,246,179, 18,120,248, 6,195,201,201, 25,218, 78, 3, 60,174,
+159,249,125,191,220,201,127, 65,105,250,195,175, 77,213,217,126,232, 26,230, 46, 88,242, 24, 4, 15,203,223,230,254, 19, 39,140,
+246,249,105,241,138, 87,214,141,252, 98,148, 79, 77,205,181,204,193,119, 91,203, 15, 63,233, 85,175,113, 59, 60, 77, 72,192,209,
+131,183,208,230,131,142,232,212,165, 39,180, 90,205,192,245,107,151,223, 4,176,242, 79,101,174,147,127,179,122, 65,254,219, 92,
+156,157,221, 88,182,108, 14, 88, 74,129,102, 45, 91, 99,242,184,161, 96, 41, 69,131,134,141, 90,119,234, 55,154, 82, 90,102, 4,
+115,114,115, 74, 31,197, 62,104,171,202,140,189,110,242,181, 84,171,245,217,217,217,184,125,251, 54,226,226,226, 16, 19, 19,131,
+220,220, 92, 88, 88, 88, 84,171,138,221,202,202,202, 60, 52, 52,244,227,223,126,251, 77, 98, 97,241, 31,207,175,213,106, 33,147,
+201,208,181,107, 87, 65,179,102,205, 92, 6, 13, 26, 52,200,202,202,106,123,126,126,126,209, 27, 13,211,221, 67,105,142,245,186,
+175,233,212,107,216, 72, 0, 16,138,205,158, 45,251,245,143,152,202,142, 45,148,152,187,183,237,254,153, 23, 40, 5, 33,100, 89,
+ 78,236, 31, 25,111,219, 86,167,211, 73,119,237,218,229, 66, 8,121,229,253, 58,123,217,206,166,247,159,100,180, 89, 61,107, 10,
+223,220, 76,130,236, 2, 13,134,143, 28,109,107,178,185,170,215,109, 84, 88,195,134, 43,191,157, 52, 20,114,153, 20, 39,174, 63,
+197,248,105,223, 27,242,114, 50,183,128,144, 37,217, 49,123,223,181,214,226,189, 76,247,230,227, 98, 6, 69,251, 8,201,208, 62,
+145, 18,173,222,136,130, 82, 61, 52, 58, 35,140, 44, 69, 97,169, 30, 15,158, 23,195,214, 92,132,117,248,231, 83, 45,131,197, 23,
+136, 58,143,249,180,147,104,209,246,235,184,122,124,187, 42, 45,122,183,172,226, 55,183,208,126,207,146,111,237,172,253,170, 71,
+169,186,171,165,212, 57,192,141, 79,120,139, 91, 70,182,104, 55,114,212, 40,248,214,113, 21, 26,141, 70,122, 63,238,153,126,211,
+250, 13,159, 90,184,213, 91, 90,148,114,127,122,197,203,180,186,221, 55, 89,150, 77,121, 61, 98,197,178,175,126,205,190, 73,147,
+ 16,192,210, 76,132, 53, 71, 19, 64, 41, 64, 64, 97, 33, 23, 96,231,185, 20, 20,230,166,229,212, 87, 46,185,252,121, 7,219,174,
+243,214, 63,216,191,234, 96,102, 20,128, 24, 74,105,230,219, 52, 9, 33,224,243, 8,204,101, 2, 88,200,132,176,148, 11,193, 16,
+242, 86,115,245,237, 47,119, 55, 1,120,244,178,185,122, 89, 83,238,224, 27,104,110,235,190,175,231,136, 5, 86,119,159,235,192,
+231, 17,212,118,148,194, 90, 33,132,214, 64,144,152,173, 43,223,199, 28, 95, 76,156,109, 55,101,194,200, 35,132, 68,214,167,244,
+156,161,178,115, 87, 42,149,162, 79, 62,249, 68,160,215,235,117,131,199,206,107,151,145,149,219,109,233,252,201, 98, 59, 91, 27,
+148,170,245,136,126,152,228,255,253,162,159,107, 31, 62,125,109,223,215, 95,244,216,223,161, 67, 7,139, 93,187,118,177,213,185,
+239,217,153, 57, 63,111,216,182,103,203,146, 69,243,241, 40, 41, 31,235,215,174, 4, 53, 26,214, 84,238,119, 95,213, 92,177, 98,
+133, 67,120,120, 56,115,227,198,141,156,215, 13, 40, 33,144,231, 22,105, 96, 41, 23, 66, 38,230,195,193, 74, 2, 27, 51, 17, 68,
+ 2, 6, 12,243,159, 66,228,101,205,245,191, 29,158,199, 42, 11,113, 96,135,182,223,134,159,191,195,103, 95,126,131,251, 57,162,
+ 99,140,204, 98,222, 23,253,122, 78,181,147, 26, 59, 56, 91, 50,246,173, 67, 60, 32,151, 8, 49,109,204, 39,104, 20,149,104,159,
+ 90,192,126,147,173,226, 5, 3,248,230, 77,233,100,202, 35, 86, 10,153, 0,231, 14,237,200, 42, 45, 46, 40, 36,188,178, 42, 66,
+189, 86,151,100,154,215,255,243,245,148, 59,248, 78, 13, 9,174,255,221,200, 97,159, 51, 77, 35, 26, 81,134, 17, 32,167, 88, 75,
+ 40, 5,198,141, 30,129, 47, 70, 12,117, 76, 78,203,154,177,114,229,154,233,102,246,254,115, 75,178, 30,206,170, 76,147, 71, 24,
+ 48, 12,129,153,132, 15, 51,105,153, 97, 49,147,240,161,214, 26, 65, 8,120,174, 33,253, 10, 65, 0, 66, 72, 90,242,205, 29,254,
+166,164,211,185, 94,199,211,231,179,132,126,202, 35,234,171, 79, 30, 71,207,187,113,247,249, 13, 74,105, 94,173,150, 19, 6,233,
+ 12, 20, 37,106, 3, 18, 50,149, 48,232, 40,249,172,163, 59, 60,123, 17,223,249, 27,162,183, 16, 66,204, 43, 34, 46,175,107,166,
+ 92,221,173,182,173,215,179,239,146,229,107,111, 46,250,238, 27, 94, 78,161, 22, 44,165,144,136,120,144,138,248,229, 11, 15,170,
+210, 66,172, 92,253,107,134, 1,164, 39, 61, 87,121,158,255,115,161, 65, 7,244,232,212, 98, 39, 1, 68,132, 17,166, 56,187,123,
+184,183,233,242,169,164, 77,215, 79, 96, 52,104,167,202, 29,252,206,150,102,198,158, 54, 69, 51, 40,192, 31, 32,120,152,117,111,
+ 95,207,178,151,100,247, 63,252,124,253,124, 94, 95,231,237,237,235, 99,202,125,175,248,184,144,218,249, 12,243,246,171, 55,121,
+228,183,107, 61, 18,210,149,176,118,243, 65,204,189,219, 56,186,235,231,104, 85,113,254,162,163, 7,254,152, 60,247,135,101, 13,
+186,116,239,131,253,123,119, 77, 36,132,172,162,101,156,122, 41, 58, 53, 96,211,186, 95,220, 4, 34, 49,244, 6, 22,122, 35, 45,
+251,107, 48, 34, 47, 47, 31,122, 3, 11,137, 76, 1, 3, 75,160, 55,178,208, 27, 88,104,180, 6,249,136, 79, 62, 28, 5,224,250,
+155,210,233, 25,254,201, 45, 48,196,181,108,125,217, 58, 17, 99,161,116,114,114,218, 2, 0, 98,177, 24, 98,177, 24, 44,203,226,
+ 94, 26, 25,231, 28, 54, 96, 26,104,249,155,157,101, 83,210,163,119,132,190,237,220,221,220,220,186,188,110,174,212,106, 53, 74,
+ 74, 74,112,249,230, 93,139,205,187, 79,117, 72, 76,206,168,195, 26,237, 53, 82,199, 6,237, 1,116,121,219,245,204,184,183,111,
+ 84,173,200,113,204,196,145,159,120, 47,251,117,207,141,199,199,230, 86, 26, 78,174,221,118,170,118,242,168,254,161, 63, 44,219,
+240, 56,229,252,210,241, 85,221, 35,161, 80, 40,200,206,206,126,241,124,207, 89,241,123,199,231,153, 69,109, 22,125, 55, 93, 24,
+253,172, 4,247, 18, 50, 48,168,109, 45,147,159,119,167,192, 30,190,238,158,110, 75,151,206, 29,139,184, 52, 21, 86,252,126, 3,
+231, 15,111,137,210,169,139, 63,204,138, 57,144, 85,147, 50,228, 93, 13, 86,101,154,103,239,230,160, 68,109,128, 70,107,128,158,
+165, 40, 82,234,145, 85,160, 69,145, 82,135, 18,149, 1,131, 62,168,133,127, 3,213, 50, 88, 70,131,222,213,217,217, 9, 44, 77,
+169,136,112,150, 69, 61,194,251, 41,199, 15,235, 45,117, 14,238, 85,154,118,123,143,201,109,178, 20,246,117,155, 72,165,178,195,
+ 63,253,244, 19,250,117,105, 46,125,158,163, 47,185,251, 92,149, 89,170,133,193,222,174,174,104,222,252,239,205,190, 95,248,227,
+ 23,135, 14,176, 5, 0,126,124, 99,248, 57,172,255, 45, 30,121,169,141, 21, 33,160, 44,155,146,114,115,123, 40, 0,188, 75, 91,
+171, 18,181, 30, 60,166,172,237, 12, 33,128, 82,109, 64,105,126, 70,238,203,230,234,122,170,227, 83, 30, 47, 91, 71, 41,173,180,
+ 10,130, 33, 64,145, 82, 15, 11,153, 0,150,102, 2, 88,200,255, 19,193,122,139,185,138,169, 76, 83,168,211, 37, 27, 13, 90, 53,
+ 53, 26,209, 57,204, 14,246,150, 34, 56, 89,137, 33, 22,241,161, 55, 0, 42, 45, 11,181,214,136,196, 44, 21,138, 85, 34,212,143,
+236,235,157,230,116, 77,105,235, 17,182, 41, 39,241,230,240, 74,239,179,209,136,109,123,142,123,167,101,100,119,219,191,101,177,
+ 56,171, 72,135, 59,137, 37,200, 42,208, 0,196, 2, 83,191,153, 46,158, 49, 99,102,247,109,191,159, 72,106, 25,238,159, 84,221,
+235, 90,154, 21,187,181,126,211, 15,127,238,220,185,187, 34,230,250, 17, 60,190,125,250,219,146,204,234,181,191,242,246,246, 54,
+252,252,243,207,118,107,215,174,245,182,183,183,127,158,149,149,245,172,162, 58,202, 51, 32, 34,237,212,233,139, 54, 45,154, 54,
+231,167,228,168, 97,163, 16,194,195, 65,142,168,171,103,181, 12, 33,199,222,164, 87, 94, 13,216,223,181,237, 20, 28,184,250,172,
+ 67, 76,174,228,220,208,207, 7, 37,157,184,240, 40,119,197,150, 19, 63,184,152,233,111, 75,216,236, 21,183, 66,189, 28,167,142,
+254, 4, 11,150,111,197,249,168, 71, 89,165,140,211,119,233, 26,195,201, 89,125, 39,191, 57,234,203, 0,124, 30,129, 66, 42, 64,
+105,105, 65,225,253, 83,171,234,190,167,103,119,208,137,125, 91,153,188, 98, 61,146,115,212, 36, 45,175, 24, 70,150,194, 82, 38,
+132,129,165, 40,200,203, 33,219,182,110,193,205,155, 87, 25,240,152, 33, 0,102, 85, 17, 9, 1,143, 33, 48,147, 8,202, 34, 64,
+210,178,191,122, 35, 11,159,218,110, 88, 54,103,140,185,173,189, 3,218,245, 28,110,122,132, 77,110,213, 96,243,234,121, 56,119,
+245,118,228,217, 39, 59,194,236,131, 26, 44,119, 13,232,189,136,177,118, 81,107,116, 70, 20, 22,228, 67,164, 77, 70, 35,151,108,
+ 88,203,140, 72, 44,114,194,253,140,199,102, 85, 85,103,229,220,251,227,182, 93, 80,143,233,123, 14,158, 89,208,254,131, 72,220,
+ 79, 44,130, 84,196,135, 68,196,131, 68,196,131,128, 24,177,120,245, 26,125,126, 97,113,231,156,251,251,114,106,144, 63, 79, 1,
+120,209,230,204,204,161,142,221,214,229,211, 55, 15,157,188,176,125,135, 30,159,146,251, 55,207,126, 13,224,180, 73,101, 38, 75,
+ 77, 90,199,178,166,189,219, 8, 33,140,189, 87,232,246,141,155,118,244, 13,240,113, 67,102,129, 30,105,249, 58, 92,140,142,199,
+230,117,211, 11,242, 51,159, 14,128,174,164,132, 37,134,194,227,199, 14, 30,251,114,236,100, 4, 6, 53,240, 40, 74, 41, 50, 7,
+ 80,248,202, 49,121,100,237,192,207,135,247,117,112,112, 80,252, 39,130, 69, 81,215, 55, 0,157,186,126,132,227,251,247,226, 65,
+204, 93,176,180,108, 56, 31,150,165, 40,200,207,205, 48,232,181,155,222,154, 62, 30,207,117,227,154, 69,246, 12, 67,160,211,179,
+208, 26, 88, 76,157, 58, 93, 59,118,198,138,102,237,155,214,143,225,129, 45,122,158, 94, 96, 25,245, 40,163, 30, 17, 40,156, 6,
+140,152, 34, 84,107,140, 40, 84,234,113,106,247,178,183, 87, 51,214,105, 16,225,233,223,236,243, 97,223,172, 17,139,121,140, 46,
+176,174,219,179,150,141, 3,147,107, 57,219, 22,207, 95,182,173,209,149,232, 71,157,122,246,236, 41,233, 91,199,159, 56,219, 72,
+ 20, 35, 70,141,174,239,232,211,108, 96,198,227, 75, 91,222,250,242,227,139, 11,220, 92,221, 94, 84, 37,218, 7,117,191, 11,192,
+253,181,205,146,178,238,239,171, 15, 0,246, 14,142,106, 34, 16, 23, 87,195,128, 80, 0,152,189,124, 79,167,148,236,146, 94, 21,
+230,234,246,211, 66,136,133, 12,116,122,211,155,198, 25, 9, 29, 55,101,244,103,130,188, 82, 3,206,221,205, 70,204,173,179,212,
+160, 43,250,148, 18,254, 96,187,160,238, 3, 9,224, 73,129, 4,134,224, 23, 45,131, 77, 5,119,246, 21, 86,191,166,167, 44, 61,
+246, 1, 61,155, 16, 30, 58,241,248,194, 48,128,245, 51,232,245,246, 12,143,151,147,113,103, 79,149, 61, 40, 95, 62,163,210,204,
+ 56, 44,156, 63, 3,203,214,237, 69, 90,174, 26, 22,198,100,236, 95, 63, 15, 19, 23,108,135, 74, 99,196,191, 1,147, 13,150, 67,
+189,110,141, 0,134,231,104,109, 6,239,218,110, 48,235, 61, 88,234, 26,210,183,148,199, 99,152, 77, 75,191,150,228,170,248,224,
+243,120,165, 38, 23,190, 14,126,225, 10,133,226,200, 31,191,239, 69,157, 90,246,194,109, 23,243, 18,162,159,169, 94,132,116,139,
+178,147, 68,158,230, 74,126,207, 30, 61,100,167,207,156, 29,247, 54,131,197, 35,140,235,178,197, 63,216, 43,164, 2, 16, 2, 20,
+171, 12, 24, 59, 97,202, 59, 95, 24, 10,202,251,114,194, 76,144,114,115, 85, 92,152,135,239,150,109, 42,233,233,114,230, 82,133,
+185, 58,241, 80,250,164, 71,143,214,133,137,137,137,249, 85, 22,140,212,152,210,107,208, 88, 33,195,148, 85, 27, 49,132,128,194,
+152, 89, 19,115, 5, 0,249,249,207,138,164,142,245,123,108, 93, 50,122, 93, 45, 23, 23, 43,133, 76, 66,204,228, 98,226,239,235,
+ 37,105,220, 56, 66, 82,203, 43, 80,116,225, 65, 9,158,103,171,240, 44,173, 16, 34,219, 64, 65,223,150,109,177,117,217,148, 78,
+166,156,255,153,171,247,187,172, 90, 52, 93,156, 81,160, 69,236,243, 18,100,228,171,145,158,175, 65, 70,158, 26,102, 82, 1, 34,
+218,246, 20, 31, 61,185,187, 75,203,112,255,229, 53,185,190, 79,227,159,237, 77, 76, 77,255,180,126,195, 70,216,182,121, 99, 99,
+226,234, 42,161, 41, 41,106, 83,247, 95,183,110, 93, 94, 88, 88,152,221,247,223,127, 95,234,235,235, 27,236,235,235, 91, 59, 46,
+ 46,238,156,183,183,119,215, 85,203,230,158, 31,251,205, 34,119, 30,209, 91, 52,105,218,140, 39, 17, 18, 92,189,112, 92,179,105,
+221,154, 52, 93, 65,201,228, 74,141,176,204, 98, 94,102, 9,129,157,139, 75,140,153,200,248, 1,159, 41,136,203, 59, 58,122, 11,
+128, 63,188, 58,142, 57,117,246,214,163,184,208,168, 68,251, 51, 81, 79,178,242,148,186,186,241, 71, 39, 84, 90,224,242, 8,129,
+128,199, 64, 33,229,191,136, 88, 58, 52,232,253,132, 18, 98, 87, 17, 41, 37, 40,139,104,145,178,207,150,180,148,168, 93, 38, 52,
+140, 38,148,165,192,163,148, 82,148,168,203, 66,240,174,182, 50,100,103,166, 96,213,242, 77,136,190,117, 19,237, 58,118,197,202,
+ 95,183, 97,232,192,222, 85, 94, 87,134, 65, 89, 4,235,165,232,149,153,148, 15,128,160,160, 84,143,223, 47, 37,195,171, 54, 3,
+ 82,141,218, 66,133,153, 20,133,197, 42, 48, 2, 51,196, 94,220, 34, 59,122,246,198,180, 89, 63,174,255,170,168, 36,227,121,252,
+131,171,240,181,202, 69,109, 23, 29, 98, 50,204,113, 43,215, 19,190,222,117,192, 8,111,154,164,157, 19, 83,111,225,126,230,247,
+206,161,193, 1, 17,238,246,150, 80,105,141,229, 81, 44, 30, 54,110,216,130,196,132,148,207,115, 98,246, 69,191,143, 66,178, 36,
+243,105,182,196,193,231,139,123,215, 79, 63,235,241,241, 23,112,114,169,213,160, 58,205, 19, 76, 89,103, 52,193, 96, 17, 66, 24,
+107,143,224,205,155,183,238,238, 91,187,150, 35, 78, 94, 79,192,141,184, 92,216,218,218,128, 39,115,132, 79,203,193,150,247,142,
+ 45,251, 72,149, 83,178, 89, 32,148, 13, 9,111,220, 20,148, 82, 60,122, 24,147, 87, 88,104,241,167,178, 89,153, 22,123, 27,128,
+249,203,235,100,118,254, 13,204, 44,172,111,107,116, 70,164,166,166,224,242,149,115, 13,203,183, 51, 25,177,144,135, 19,209, 89,
+208,233, 89,232, 12, 44,194, 67, 2,181, 2,145,180,249, 15,235, 14, 55,206,204,204,102,164,102,230,172,133,125, 29,161,181, 62,
+ 67,115,231,105,161, 80,167,103, 81,199,185,242,239,114,153,117,157,249, 19, 38,142,245,231, 9,165, 40, 46,213,104,211,211, 82,
+ 29,127,217,113,182,228,225,163, 7, 46,158, 30,181,204,231,205,157, 37, 44, 84, 1, 89,133, 26,228, 21,235, 72,159,143, 63,119,
+222,178,126,229, 0, 0, 91,170,145,244,122,187,182,172,209, 91,153, 9, 73,177, 74, 79,179, 11, 53,198, 81, 95,140,173,247, 46,
+121,167,194, 92,253,248,221, 55,194,232,103, 37,184,243,180, 16, 18, 33, 15, 34, 33, 3,173,137, 6,203, 46,160,183,220,206,206,
+114, 64,120, 3, 31, 28,143,206, 6,143,199, 64, 89, 90,168,149,136,205,238,251,249,249, 48,193, 13,130, 16,217,172, 9,226,159,
+ 37,250, 30, 63,121,102,201,141,155,209,223,217, 5,245,152,156,125,127,239,202,234,164, 53, 57, 61, 87,150,105,112, 27,107,239,
+104, 27,212,181, 91, 23,113, 45, 23, 7, 98,103,109, 9, 35, 17, 98,196,200, 47,237, 77,206,243,180, 44,122,249,253,220,105,208,
+104,180,176,179, 20,129, 82, 96,195,242, 89,208,106,181,112,182, 17,163,176, 84,207, 25,172, 23, 55,184,126,143,166, 82,177,252,
+196,202, 5,227,152,130, 82, 61, 36, 66, 30,234,212,169,141,209, 99,199,201,218, 52,176,131,138,152,227,247, 29,155,138, 12, 70,
+253, 33, 83,244,100,142, 62,161, 10,185,249,241,205, 91,119,177,182, 54, 54,204,170, 19,217, 79,115,139, 13, 47,134, 56,136,187,
+126,128,189,117,252, 23, 39, 10,114, 76, 34,145,120,107,181, 90,171,170,110,232,134, 19, 73,229,141,115,201,123,185, 48, 12,195,
+ 24,127, 89, 62, 23,182,230, 34,104,244, 44,230, 44,217, 82,220,217,238,216,153,151,205, 85, 72, 72, 72, 97,131, 6, 13, 10, 24,
+166,234,225,196,158,223,216,214,228, 13, 5,102,141,204, 85, 5,170,140,187, 55, 1, 4,189,170, 25, 34,176,245,220, 61,177,223,
+128,129,211, 28, 3, 63, 84, 36,164, 23, 66, 72,116, 8,243,119,194,185,227,127,176,201,207, 30,142, 48, 69, 59, 43,183,208,205,
+214,214, 6,209, 79,139,145,154,171, 66, 70,185,185, 74,207,215,160, 88, 85,140, 6, 30,118, 40, 40, 44,113,171,177,129, 37,116,
+223,241,227,199, 63,237,212,173, 47, 70,127, 53,187,227,186, 85,139,238, 74, 29,252, 7,170, 50, 31,222, 48,101,255,221,187,119,
+ 27, 61, 60, 60,158,102,103,103, 55,154, 52,105, 82, 81,157, 58,117, 28,231,206,157, 59,172, 78,157, 58,206,173, 91,181, 42,188,
+113,182,241,230,177, 95,205,106, 53,117,204,186,218, 12,195,100, 82,150, 30, 72, 43,213,207,164,217, 15, 84,149,222,167,253,211,
+ 98, 73,192,236, 79, 63,104,110,119,192, 90,198, 4,138,169,182, 31, 9,152,189,139, 62,152,169,139, 63,186,188,184, 94,159,197,
+163,211, 10,216,111,212,140,253,119, 85,153,171,178, 8, 22,129,214, 96,132, 66, 42,248, 79,222,164,112, 90,181, 98,177,204,206,
+ 66, 4, 1,143, 1,159, 71, 80,164,212, 35,167, 72,135,175, 38,127,101,234, 21,100, 13, 70, 10,149,214, 0,101,249,215, 96,113,
+ 81, 14,166,125, 53, 1, 29,187,244,192,144, 17, 19,144,175, 2,110, 61, 43,134, 78,175,175,242,161,224, 17, 2,165,198,128,207,
+218,185, 35,175, 68,135, 82,149, 1, 90, 3, 11,153,136, 15, 62,159,129, 92,194,135,185, 76, 0, 66,168,208,201,201,105, 24, 0,
+ 8, 4, 2,245,243,231,207,183, 86,242, 5, 15, 79, 55, 7,168,244, 12, 26,245, 93,132,182, 17,117,113,231,212,122,254,249,107,
+247,106,127, 53,107, 9, 70,245,143,192,158, 88, 47, 88,219,187,195, 76, 46,133,158, 50, 0, 76, 27, 2,132,210,153,172,147, 95,
+207,254,107,126,221,240,104,206,140,169,146,130, 82, 2,177,144,135, 51,167, 79,225,234,245, 91,203,178, 99,246,109,125,159, 5,
+165,128, 50, 14,230,230,230,144,136,120,208,234, 52, 90,147, 35, 15, 44, 5, 40,252,237,235,117,255,163,252,222,251, 27, 89,188,
+ 97, 29,173,202, 92, 17, 11,231,160,141,107,214,109, 27,224,236,104,143,189,167,239, 98,227,175, 43, 80, 59,184, 51, 46, 29,222,
+ 8, 11,207,198,144,215,106, 6,145, 98,247, 48,134,199,175,247,229,184,175,123,134,132, 69,224,242,197, 51,200,202, 72, 95, 67,
+105,172, 73,109,208,120, 2, 50,166,245, 7, 93,160,214, 26,209,188, 77,103, 28, 59,184,119, 52,202, 59, 79,152,202,235, 38,156,
+101, 97,248,114, 72, 63, 65, 86,129, 86,144, 93,164, 69, 74,182, 18, 9,153, 74,236,223,185,158,154,250,214,102,248,188,176, 22,
+245, 93, 5,195, 22,158, 73,118,115,117,210, 8, 52, 42,105, 92,252, 83,191, 33,159, 14, 16,212,246,246, 99,178, 10, 53,200, 46,
+212, 32,167, 80,131, 18,181, 1,222, 78,181, 24,141,129, 31, 81,221,251,108,103, 41, 17,172, 60,248, 12,230,114, 1,154,248,217,
+212,184, 17, 54,203,178,175,152,171,219,207, 74,113,247, 89, 33,196, 66, 30,196, 66, 6, 98, 33, 15, 6, 35, 53,241, 93,100,232,
+ 55,124,112, 95,169, 86, 79,145, 91,168, 5,159, 71,224,104,107, 35,118,115,170,139, 13,139,190, 4, 0, 12,157,178, 10, 67, 62,
+251, 4,190,117,189, 81, 88, 88, 44, 29, 50,114,236, 98,188,161,221,221,219,210,186,109,255,133,128, 91,247,147, 38,126, 58,120,
+144,160, 79,151,230,204,237,167, 69, 72,207,211,224,105,188, 18, 58,125,245, 70,163, 49, 24, 89, 80, 80,108,218,117, 8, 82, 17,
+ 31,217,133, 58, 80, 74, 49,111,197,111, 80, 72, 5, 72,207, 47,171,214,231, 12, 86,133,185, 18, 73, 78,108, 89,241,181,244, 76,
+ 28,176,236,228, 45,124, 24,238, 4, 33,159,129,216,204, 17,119,158,229,227,212,233,253,197,151,174, 94, 87,131,209, 87,217, 45,
+ 74,230,228,219, 80, 46, 53, 63,181,242,151,205, 6, 91,123,123,108,189,152,151,146, 95,106,208,255,167,122, 74, 79,110, 29,255,
+165,182,129,213,119, 80,101, 60,174,242,115,150,165, 84,184, 96,245,126, 0, 20, 44,203,130,178, 44,120, 66,177,220,189,241, 39,
+153,101,122,172,132,207, 99,212, 47, 63,249,148, 53,166, 36, 93,223, 94,105,213, 33, 1, 96, 33, 19, 96,215,249, 84, 20,230,165,
+229,116,182, 59,246,162, 90,240, 88,140,248, 73, 72, 72,112, 97, 88, 88, 88,129, 84, 42, 5,143,199,171,246,133,127, 87,115,245,
+246, 23, 79,148, 30,192,247,206,126, 45,187,118,148, 5,134,139, 24, 62, 66,124,157,112,238,196, 94,246,234,209,245, 61,148,153,
+113,135, 77, 12,111,163, 68,165, 71, 90,174, 26,169,185,106,100,228,171,145,145,167, 65, 70,190, 26,132, 16,168,181,239, 54,124,
+141, 50, 51,238,160,153, 75,224, 26,141, 14, 35, 90,180,235,129,137,179, 86,122,111, 93,243,195, 69,185,189, 79, 88,105,214,227,
+123,166,104, 36, 38, 38,106, 28, 28, 28,162, 10, 10, 10,218, 45, 89,178,164,196,223,223, 95,100,102,102,150, 11, 64,250, 36, 46,
+ 78,120,230,200,238,132,236,180,180,225, 58,157,238,166,169,233,242,136, 28, 44,246, 51,207, 27, 86, 75,222,164,125, 29, 71, 25,
+106,201,139,219,251,153,221,249,209,190,205,184,249, 89,167,151,102,165,107, 12, 39,179, 85,188,224,212, 18,129, 73,109, 1, 13,
+ 58,109,210,199,195,167,129, 71, 8,116, 26,109, 82, 69,230,178,183, 16, 97,214,182, 88,152, 73, 4, 80, 72,249, 48,147, 10,208,
+ 44,192, 26,213,248, 60,160,122, 35, 11,165,198, 8,149,198, 0,181,214, 0, 91, 55, 43,252,186,117, 55,158,103,169,176,255,102,
+ 14, 30, 37, 21,195,199, 85, 14, 74,171,142, 59,177,212, 80,218,103,216, 55, 10, 30,195,128, 71,192,248,121,123, 32,175, 68, 11,
+ 33,159,129, 72, 36,130, 92,204,135,185, 84, 0, 1, 95,128, 27,119,239, 66,163,209, 32, 60, 60, 92, 82,185, 5, 44,139, 98,249,
+212,118,134, 78,111,192,145, 11, 15,240,221,248,158,248,160, 69, 40,190,226,137, 16,171,105, 8,133,181, 2, 44,195, 64,103, 96,
+161,213, 25, 1, 48,111,141,182,213,170, 85,171,181, 92, 46,151, 43,149,202,226,164,164,164,115,233,177,127, 60,183, 15,236, 62,
+236,216,137, 51, 91, 59,119,252, 0,209,119, 99,176,103,239,129,139, 57, 54,133,147, 42,246, 9, 10, 10,106,108,107,107,107,150,
+155,155, 91,116,239,222,189, 27, 53,201,171,132, 16, 34,119,240, 27, 23,209, 44, 18, 37, 5, 89,200, 76, 78, 56,100,234,190,254,
+238, 10, 76, 24, 63,218,199,183,174,175,143,177,188, 39, 85, 64, 45, 5, 70,140, 28,229,227,229, 83,215,167,162,163,135,127,173,
+202,199,187,148, 59,248,142,250,110,241,234,129,181,220,220,112,244,114, 44, 22,124, 51, 34, 90, 46, 83,120,186, 58, 88, 89, 10,
+ 3, 67,113,251,246, 21,216, 67, 4,115, 7, 31,215,126, 93,135,187,182,239,216, 21,247,238,220,194,210,133,115,175,150,242,164,
+243, 77, 73,171,153, 67, 29,187,224,176, 22, 31, 43,172, 29, 80, 80, 88, 12,133,149, 61,252,235,135,125,108,230, 80,103, 74, 73,
+230,211,236,154, 62,235, 44,165,208,232, 40,242, 75,116, 72,206, 86, 33, 49,163,204, 96,177,108, 53,218,252, 80, 16, 51, 9,159,
+111,173,127, 82,235,222,169, 51,212,221,205,129, 44,156,251, 21, 79,135,178,198,226,217,133, 26,100, 23,105,145, 93,168, 69,137,
+ 90, 15,107, 57, 31, 44,101,171,253,181,157, 95,162,131,162,188,157,172,145,173,185, 9,152,181,100, 71,147,148,108,101,155, 31,
+231,125, 35,188,147,240,146,185, 18,148, 69,175,196, 66, 30,140,172,105, 17, 44, 30,159, 25,253, 97,155, 70, 72,206, 81,149,245,
+ 66,102, 8,188, 3, 27,194, 86,202,162, 77,223,169, 0,128, 46,157,202,134, 33,121,150, 94,138,131,215,210, 1, 64,104,106, 90,
+115,115,139,197,123, 79, 70,143,221,241,235,143, 34, 13, 43,192,218,163, 73, 80,106, 12,144, 8,121, 16, 11,121,144, 10,171,247,
+126, 51, 24,203, 58, 75, 60,207,209, 67,169, 86,163, 72,165, 7, 5,112,227, 73, 9, 84, 90, 3, 10, 75,245,104,236,103,197, 25,
+172, 10,115,181,121,249,215,210,211,113, 20,103,239,228,162, 87,115, 87,228,102,165,224,215, 85,203, 88, 74, 1,177, 68,148, 97,
+ 52,176, 71, 85,172, 97,114,193,157,131,133,149, 22, 18,118, 1,245,165, 50,217,153, 31,150,174,213,217, 59,184,176,127, 92, 43,
+200, 42, 84, 26, 95,137, 21, 26, 53, 26,134,178, 84,104,138,185, 42,143, 52,233,102,142,238, 1,150, 82,204, 90,186, 27,243, 39,
+245,133,153,148, 47, 35,132,200, 74,213, 6,140,159,189, 14, 63,125,251,185, 66, 38,230,131, 16, 64,173, 53, 98,196,104,211,162,
+ 4, 74,141, 17,165, 5, 25,185,245, 74, 22,191,102,174, 66, 10,195,195,195, 11,172,172,172, 80, 19,131,245, 38,115,229,232,232,
+232, 44,147,201,172,125,124,202,218,186,242,120, 60, 24,141,198,210,199,143, 31,215,104,208,183,162,130,236,125,233, 9,247,194,
+155, 68,126,136,243, 39,246,177, 87,143,172,235, 81,157, 46,230,150, 22,230,201,209, 15,146,252, 9,204,202, 34, 88,229,230, 74,
+171,103,225,238, 32, 67, 74,242,115, 88, 90,152, 37,155,170, 39,115,244,233,192, 80,222,112,150,224, 87,101, 70,236, 17, 0, 40,
+ 73,141, 25, 41,179,175,123, 47, 38,230,206,210,206,253, 71,139,218,245, 26, 41, 92,179,224,139,169, 0,250,153,170,155,153,153,
+169,180,179,179,187,234,228,228,212,121,246,236,217, 26, 0, 98,141, 70,195, 12, 30, 60, 88,150,148,148, 52,158, 82,106, 82, 26,
+155,127,182,199,150,136,139, 59,122,249,132,245,119, 87, 20,127,208,170,121, 4, 34, 2,221,144,220, 60, 2, 0,198, 36,149,152,
+249, 54, 27,185,126, 87,109, 59,215, 35,107, 54, 30,156, 63,180,111,219,241,206, 93,102, 47, 78, 59, 56,179,210,136,216,163, 11,
+235,219,191,201,190,243,121, 12, 20, 82, 1,204,164,124, 40,164, 2, 40, 36, 2,232, 13,180, 58, 85,112, 84,111, 96,203, 34, 88,
+ 90, 3, 74, 84, 6,156,185,157,137,140, 66, 45, 10,138,117, 80,233,140,160,160,208,233,217,138, 81, 69, 42, 55,171, 87, 54, 89,
+ 86,252,219, 53,164, 95,225,178, 57,163,205,127,191,148,242,162,135,158,133, 76, 4,133, 76, 0,128,226,194,133, 11,176,177,169,
+122, 88, 44,150,101,177,231,216, 13, 44,222,116, 6,199, 54, 76,134, 68,200, 67,253,110,179,241,105,247,112,176, 44, 69,252,163,
+152, 76,159,128, 6, 14, 12, 35, 5, 67, 8, 52,122, 22, 0,125,235,245,212,106,181, 54,207,159, 63, 47,242,246,246,118,116,113,
+113,233,197,227,241,168, 24,208,236,219,153,167, 60,125,104,187,172, 84,165, 49,202, 12,133, 27,188,211, 85, 31,250,248,248,128,
+ 16, 66,109,109,109,133,103,206,156, 41,169, 87,175,158, 93, 77,158, 35, 66, 8, 35,181,175,187,108,200,200,113,189,188,234,212,
+193,238,237, 27, 64, 41,249,221,212,253,183, 29,188,138,197, 75, 94,237, 49, 56, 98,228, 40,159, 53,171, 87,189,178,110,224,231,
+195,124, 42, 51,120,174, 65,173, 39,251,249, 5,224,106, 76, 10, 22, 78, 31, 25,173,206,122,214, 95,107,102, 51, 92, 87,146, 62,
+ 33,184, 97, 40, 28,109,204,145,150,167, 65,215, 1,221,209,180, 89,115,220,187,115, 11,115,191,253,234, 42,148,218,118, 85, 69,
+109,255, 99,132, 4, 35, 90,181,239, 46, 80,105,116, 88,190,112, 6,134, 79,250, 14,141, 91,119, 17,220,191,125,109, 4,128, 57,
+166,158,179, 70,103, 68,171,122,182,101,166, 89,207,226,192, 51, 30,255, 77, 57,144,207, 35, 76,112, 29, 75,168,180, 6, 20, 41,
+245, 85, 68,176, 72, 70, 65,113,169,199,207,243,199,241, 74,213, 6,100, 23,106,145, 85,168, 65, 78,193,127,140, 85, 78,161, 6,
+217,133, 90, 8,248, 4,113, 9,105,224,241, 72,181,219,223,229,151,232,209,168,174, 85,217, 51, 90,195,218,144, 28,131, 93,199,
+ 59,113,105,109, 22,206,157, 38,188,147, 88,138,187,207,138,202, 35, 87, 60,136, 5, 12, 68,229,255, 54,154,224,175,236, 3,186,
+ 54, 25,216,175, 91,160,185, 92,130,180,184, 98,240,121,101, 67,189, 88,216,187,193, 66,172,198,151, 35,135,193,214,198, 18,207,
+115, 52, 88,182, 55, 14,119, 31, 60, 1,171,170,222,105,255,188,253, 88,143, 65,159,244, 21,243,132, 98,108, 57,148, 0,177,144,
+ 7, 62,213, 34,230,218, 5, 77,102, 74,130,174,184,168, 64,206,231, 11, 76, 18, 37, 0,173,136,204,205,159, 53, 21, 59, 55,173,
+194,241,168,172, 23,205,231, 47,253,254, 19,198, 77,155,135,156, 34, 45, 0,242,143, 15, 99,241, 43, 51, 87, 18,145,232,196,166,
+101,211,164,167,227,128,115,119,203,204,149,170, 36, 7, 91,214,175, 45,161, 96,219,102,222,223,111,242, 23,161,220,190,110,144,
+ 88, 46, 63, 63,125,222, 50,141,131,139,135,225,200,237,162,220, 98,181,241, 79, 97, 16,161, 76,110,148, 91,216,169, 45,221, 27,
+ 46, 22,168,180, 51,178,179, 31,148, 86, 21,105, 98, 41,197,161,235, 25,160,180,236,147,232,183, 11,169,224, 49,101,213,133, 70,
+182,172,250,228,228,237, 44,240, 25, 98,114,151,115, 66,128,223, 78,220,206, 9,122,131,185, 10, 11, 11, 43, 48, 55, 55,135,165,
+165, 37,204,204,204,170, 91, 96,191, 49,114, 37,147,201,172,143, 31, 63, 46, 49, 55, 55, 7,143,199,131, 70,163,193, 7, 31,124,
+ 80,163,155, 42,119,240,237,215,184, 77,207, 5, 77, 91,125,136,179,199,255, 96,175, 30,217,216, 83,153, 85,141,241,123, 0,116,
+108, 81,255,224, 15, 63,173,168,253,213,212,233, 98,133,132,143,135, 37, 90, 48,132,192,221, 65, 6, 27, 51, 30,174,158, 57,164,
+238,245, 65,189,131,166,234,213,114,245,216,178,104,249, 26,155,197,223,207,110,103,101, 85,219, 33, 63,255, 89, 17, 0, 40,179,
+226,214,152, 57,250, 62,114,173,117,226,124,131,150, 61,224,224,226,221,169,186,231,155,157,157,157, 25, 24, 24,248, 48, 32, 32,
+ 32,180, 87,175, 94,116,193,130, 5, 86, 41, 41, 41,187, 77, 53, 87,192,255,177,119,214,225, 81, 92,251, 27,127,207,250,102,227,
+196, 29, 72, 8, 9, 17,220, 10, 65,131, 59,148, 2, 69, 74,105,145,150, 10, 82,161,180, 72,169, 64, 75,129, 42,180,208,226,238,
+165,184,187, 75,132, 4,136,187,103, 37,155,213,217, 57,191, 63, 32,185,129, 27,217, 0,253,221,123,233,249, 60,207, 60,217, 36,
+179,239,156, 51,115,102,206, 59,223, 99, 64,207, 94,225, 51,236,164,150, 14, 13, 20,130,240, 64, 79, 5, 58,134, 63,108,253, 28,
+ 53,160, 51,252,252,253,145,156, 87,222,178,164,156, 23,151, 25,133,129, 63,255,122,231, 90, 35, 87,225,155,156,206, 24, 15, 96,
+ 95,189, 43,109,252,171,227,123, 69,244,202,222, 70, 12,254, 97,249,168,151,193, 50,152, 44,208, 25, 44,208, 25, 57,104,141, 22,
+148, 27, 45,224,233,195,123,130, 16, 2, 19,199, 87, 28,178, 94, 9,116,104,224,138,192, 70, 15, 71,189,218,219, 60,156,178,225,
+ 97, 19, 33,224,226,226, 2,119,247,186, 27,119, 40,165, 48,154, 30,222,226, 70, 51, 95,217, 68,106, 52,113,160,148,226,222,189,
+196, 15,211, 82, 82,134, 52, 9,110,210, 37,172,121,139, 6, 10,153, 0, 0,106, 52, 3,229,229,229, 22,123,123,123,247, 6, 13,
+ 26, 8,178,179,179, 43,251, 61, 54,105,217,157,219,179,123, 23,134, 15, 31, 86,118,247,234,237,202, 17, 85, 58,157,142,116,234,
+212,201,193,207,207, 79, 96, 48, 24,212,245,142, 90,185, 53, 29,234, 23,250,210,151,227, 39, 78,105,218, 61,186, 47, 78,157, 56,
+138,125,187,183,172,215, 22, 36, 30,181, 86, 39, 36, 36,244,223, 70, 17, 6, 5, 55,253,183, 81,132, 13, 27, 7,215,104,176, 28,
+ 29,155, 59, 52,111,219,205, 47,173,200,132, 67,135, 14, 66,171,202,251,204,104, 44, 43,135,152,174, 57,176,229,231, 73,111,188,
+191,208,161, 91,215, 40, 56, 59, 40, 32, 18, 9,113,227,218, 37, 44,254,252,147, 75, 40, 55,246,174,235,249, 89,153,223,176, 48,
+ 73, 19,255,134,239,249, 7, 69,224,198,229,115, 72,186, 23, 27,119,251,218,165,240, 38,145, 29,224,230, 29,240, 30, 9, 11, 91,
+ 76,227,227,235, 92,169,130, 90, 44, 89, 19, 38,207,124,116,253, 31,254,173, 99,203,198, 82,242,228, 13, 0,192,204,153, 44, 27,
+ 86, 45, 46,168, 58,138,176, 38, 93,189, 70,185,243,236,229, 59,179, 7,245,142, 18, 20,169,141, 15, 35, 86, 42,227,163,205,128,
+162,138,207,106, 3,130,189,237,144, 20,123,151, 55,107, 85,187,234,119,103,210,252,105,111,189, 99,243, 48,237, 60, 40, 79,107,
+ 53,252, 53,166,213, 34,121,117,213,231, 31,147, 59,105, 90,220, 73, 85, 63,108, 18, 20, 11, 31, 26, 43,177,160,210,108, 89,213,
+ 74, 38, 16,124, 51,126,100, 31, 20,169, 77,224,121, 64, 36, 20, 60,218, 36,200,208, 16,100,106,202, 81, 84, 90,136,148,180,116,
+ 40,243,146, 32, 16, 8,224,234,221, 20,229, 25,214,165, 85, 99,177,107,106,182, 32,104,228,128, 40,225,158, 75,121, 80,200, 68,
+ 80, 23,103,226,194,145,109, 58,158,179,172, 50,154,141, 91,221,169, 52, 54, 62,102,135,201,202, 71, 71,161, 90,107,240,144,137,
+133,216,177,238, 39,140,124,109, 90, 69, 4, 18, 0,240,225,220, 69,128,128,160, 84,169, 5, 64,158, 58, 42,250, 63,111,176,196,
+ 2,225,177,181, 43, 62,145,199, 23,202,113, 53, 49, 23, 47, 71,249,162, 92, 83,132, 95,127,250,190, 76,111, 54,244, 43,140,217,
+ 87,191,112,187, 64,208,103,212,235,179,227, 2,155,134, 25, 78,197,150,165, 42,181,230, 26,251, 49,116,124,249,211,184,235,127,
+253,216, 95,101, 78,126,203,206, 59,220,194,115,220, 55,229, 5,137, 11,171,127, 75,166,210,133,223,239,168,108, 30,252,104,241,
+134,135,159, 45, 22, 88, 40, 15,202, 3,211, 63, 91, 9,142,183,128,183, 88,192, 91, 40,136,217,162,168, 51, 92, 46,151, 28,141,
+ 40, 91,230, 88,157,185,114,114,114,130,139,139, 11, 92, 92, 92, 80, 97,136,158,181, 89, 48, 56, 56, 24,118,118,118, 56,119,238,
+ 28,108,108,108, 96,107,251,116, 19,228,219,121,132,190,210,190,199,176, 77,221, 7,189, 46, 56,190,231, 87,203,149,211, 7, 94,
+214, 21, 36, 88,109, 2, 44, 22, 11, 49,155,205,232,211,173,117,250,173,196,140,195,159, 47, 92,208,183,109,143, 17,178,151, 66,
+220,161, 51,114,200,206,202,194,165,147,251,244, 77,252, 93,142,116,109,223, 44,221,108, 54,195, 98,177,212, 89,129,235, 13,198,
+ 98,161,216,198,101,212,232, 87,101,215,174, 94,221,100,235, 17,178, 69, 32,228,111, 83,139,176, 57, 64, 95,105,222,188, 25, 76,
+102, 30,229,229,154,146,167,201,119,124,124,252,213,229,203,151, 55, 21,139,197,126,219,183,111, 47, 42, 45, 45,173,215,114, 65,
+ 71,207, 38,174, 16,145,210,251, 82,222, 52, 38,192, 94,211, 43,163,115, 71,140, 30,216, 25, 91,255, 58,143,211,231, 46, 33,189,
+204,238, 86, 25, 39,218,155,153,158, 99, 8,111,160,222, 53,184, 99, 67,225,142,117,165,187,220,187,207,121,133, 82,217,209,194,
+211,243,181,214, 87,222,128, 70,103,134,131,226,225,124, 77, 21,145, 44, 33, 33, 86, 59, 33, 2,164,156,187,116, 35,162, 77,112,
+ 24,110,166,168, 80,160, 52, 64,103,224,192,243, 20, 60, 40, 92,236,165,144, 75, 4,200, 72, 75, 1, 79, 77,169,245,171,103, 80,
+216,111,196, 20,209,195,227,240, 34,177, 88, 4,250,168, 94,180,145, 75,203,220,221,221,173,138, 96,153, 56, 14,195,251,182, 71,
+135,182,205, 49,100,202, 82, 0,192,137,245, 31,195,217, 78,140,157, 59,119, 34,227,252,242,141,129, 47, 77, 59, 26, 27, 19, 55,
+ 34,238,230,197, 87,251,181,182,105,233, 41,202,169,177,105,163,172,172,108, 23, 33, 68, 42,145, 72,250,118,233,210,165,193,174,
+ 93,187,148,174,174,174,188, 84, 34, 41, 28, 60,104, 32, 47,150, 72, 42,203,206,133, 11, 23,196, 83,166, 76,177, 47, 45, 45,205,
+200,207,207,191, 68, 41, 53,215,254, 2, 24, 26, 13, 1,182,128, 16,185,157,141, 34,189, 99,244,104,239,182, 29,218, 59, 14, 29,
+ 62, 18, 50,169, 12,199,142, 30,198, 15,203, 23,111, 47,203,189,251,122,125, 78,229,243, 24, 69,168, 82, 57,106,239,199,223, 46,
+ 77, 45, 48, 58,139,157,130, 33,150,217, 79, 33,142,222,223, 11,101,118,243,221, 90, 12,117,216,185,255, 32, 98, 98, 99,209,192,
+198,140,228,164,251,229,177,183,110,254, 82, 78,196, 11,105, 97,124,185,213, 17,230, 98,203,136,142,227,250, 58, 27, 76, 22,156,
+ 61,249,151,158,231,248,190,151,206, 28, 76,242,109,218, 86, 30,209,182,167,115,209,190, 53,195, 1,108,173, 75, 39,245,202,198,
+127,235,122, 17,216,254,149,156,131, 71,207,216,121, 5, 52, 17, 18, 8,161,215,149,163, 48, 61,134,211,171,242,202,243, 99,246,
+122, 91,147,190,116, 46,251,179,207,190, 94,249, 86,155, 22,225,182,148, 74, 30,139, 88, 85, 24,171, 34,181, 17,174,246, 82, 24,
+180,165, 72,186,115, 78, 95, 40,206,255,164,246,103,157, 89, 81, 92, 92, 34,173,248,221,166,204,169,161,202, 81, 37,171, 52,129,
+ 66,192, 81,229,100,248, 87, 83, 90,137,212, 98, 49, 43,172,185, 61, 29,237,228,136, 73,205,173,236,208, 46, 19, 63,236,123, 37,
+ 21, 11, 43,251, 97, 89,121,159,183, 22, 73,237,144, 93,172, 7, 1, 5,111,225,192,153,141,208,168,213,200,206,201, 67,126, 94,
+ 62, 52, 26, 37, 20,118,206,136,104,217, 14,246,118,182, 72,184,113, 26, 0,177,234,229, 87,207, 75,130,219,182,105, 35,142, 75,
+ 47,131,201,204, 67, 12, 19,206, 31,218,170, 55,155,141,131,242, 99,246,158,172,239,115,152,227,233,241,216,196,244,112, 95, 55,
+ 47,114, 43, 73,133,141,171,127,132,241, 81, 36,211,108,182, 32, 54, 67,139,220,146,114,100,101,166, 83,240,150,227,120,193,169,
+209, 96,113, 28, 39,247, 15,104,132,209, 83,198,226,151, 95, 86,226, 94,114, 6,126,251,249,145,185,186,179,231,130,149,134, 34,
+186, 98,174, 12,109, 94,194, 55,175,255,146,154,181,255,102,137, 64,103,172,125,253, 41,185, 91, 0,162, 94,255,238,136, 78, 83,
+ 34,181, 24,202, 69,127,110,124,125, 75,117,154, 15,125, 27, 49,126, 57,107, 20,236,108, 68, 32,132,160,162, 89,240,231, 69,147,
+161,144, 9, 65, 8,129,206,192, 97,236,140,101,216,184,108, 38, 40,128, 55,222,154, 85, 94, 83, 58,171, 24, 33, 50,177,111,227,
+193, 95,252, 30,191,239,124,154, 75,242,128, 1, 93, 85,173, 91,183, 86,218,216,216,192,198,198, 6, 14, 14, 14,112,118,118,134,
+147,147, 83,157,121,127,244,187, 71, 93,125,174, 4, 2, 1,108,109,109, 97,103,103, 7, 91, 91,219,127, 51,110, 79,106,254,155,
+185,242,108, 58,178, 93,247, 97, 91,122, 12,158, 36, 56,190,231, 55,254,250,233, 63, 71,234, 10, 18,247, 90,123,141, 30, 53,235,
+220, 30, 62,124,120,228,148, 41, 83, 36,159,188, 53,252,200,145,211, 55,238,237, 62,182,107, 80,137, 82,227, 71, 41,133,147,163,
+ 93,230,203,189, 34,255,140,106, 27,146,126,226,196, 9,126,203,150, 45, 6, 66, 72, 76, 93,233, 44, 42, 42, 88,123,226,248,201,
+ 37, 81, 93,187, 97,245,186, 45, 3,226,226,239, 14, 72, 74,186, 15,191,128, 64, 52,106, 28,140,114,226,140,147,103,206, 65, 83,
+146,183,214,154,116, 86, 37, 50, 50,210,167, 69,139, 22,190, 74,165, 82, 63,111,222,188, 16, 74,233,222,136,136,136, 54,173, 91,
+183,206,187,121,243,102, 86, 77,195,254,171,106, 94, 92, 57,180, 16,192,250,134,221, 38,110,207, 54, 41,223, 3,176,216, 63,192,
+ 31,167,207, 93,194,165,243, 87, 86, 22, 41,252, 23,190, 62,118,226,228,134,131,133,111, 12,238,216, 80,232,238,172,192,230,223,
+190, 19,238,191,148,182, 44,173,216,178, 6,192, 34,107,174, 81,229,195, 90, 99, 66,167,102, 13, 96,182, 80,240,244,161,233,178,
+151,139,171,109, 34,172, 78, 83,100,148,189, 62,117,202,148,164,136,230, 45,223, 31, 59,113,170,164,101,160, 31,174, 62, 80, 2,
+132,160,129,167, 45,114,115,115,113,118,231,111, 92,105,118,194, 74,161,144,255,188, 62,231, 51,235,198,214, 38, 21,159,189,188,
+188, 38,223,138,141,197,233,211,167, 81, 97,172,220,220,220,170, 53, 88, 79,106,150,150,106, 46, 44, 90,186,186,211,155,227,134,
+ 96, 96,183,112,156,185,150, 4,227,163,249,150, 42,134,132,167, 92, 90, 37,125,111, 84,160,241,173,225, 77,213, 58,179, 52,237,
+179, 84,213,217,170,147,200, 62,169, 73, 41, 53, 18, 66,246, 39, 38, 38,118,110,209,162, 69,195,131, 7, 15,150,196, 93, 57,242,
+216, 68,119,179,102,205,178,251,229,151, 95, 20,148,210, 11, 6,131, 33,217,170,188, 11,176,249,198,245,235, 46, 38, 51,143,115,
+ 87,110, 55,235,217,169, 37,120, 10, 92,187,118, 13,107,126, 95,163,143,185,115,107,169, 54,223,243,243,154, 38,183,173,233,124,
+ 90,158, 97, 20, 97,133, 38,165,167, 57, 59,143,208,149, 23,206,157,153, 43,243,110,131,208,254,159, 12,206,190,189,127,176,103,
+ 88, 31,184, 6,190,132,156, 59,251,113,225,200,166,131, 60,199,125, 44,231, 5,233,218,194, 4,173,181,247,123, 5, 50, 27,197,
+ 59, 97,173,187, 34, 35, 61, 13,169,247, 99,215,235,138,239,231,216,121,134,174,207,201, 74,159,218, 56,188, 19,206, 31,217,250,
+110, 77, 6,171,174, 50,239, 46,215,172, 60,117,254,226,232,236, 29,251, 61, 52,101, 58, 27,145, 72, 80, 46, 19,145,124, 73,121,
+210, 54,107,211, 73,227,227, 77,238, 65, 47, 13, 31, 51,229,211,191,150,125, 61, 87,236,225, 36, 67, 94,169, 30,106,157, 9,154,
+114, 19, 4,132,160,137,183, 45,116, 90, 53, 46, 29,220, 96,182,232,139, 71,209, 7,143, 71,220,170,106,186,133, 15,249,130, 16,
+ 76,255,244,211, 57, 16, 74, 29,188, 27,247,252,196, 36,104,236, 9,103, 60, 49,153,121, 3,160,113,207, 79, 96,208,228, 15,250,
+244,211, 57, 33,148,210,158,110,225, 67, 52, 21,107, 17,214,148,247, 98,141, 9,175,118,247,131,137,123, 56,127, 24,199, 3, 22,
+254,225, 11, 63,165, 0,173,165,221,190,170, 38, 5, 36,219,254,186,128,156,124, 37,116, 70, 51, 12, 70, 14, 38,179, 5, 2,161,
+ 16, 78,206, 78, 8,110,212, 10, 78, 78,142, 40, 40, 42,194,181, 75,231,113, 57,241, 86, 10, 5,190, 40,106,160,218,100,205, 53,
+ 34, 34,219, 38, 30,238,174, 36, 95,109,132,141, 84,136,203, 55, 78,155, 41,176,214, 26,115, 85,157,166,170, 92,185,236,227, 69,
+223,143,249,229,187,249,158,145,141, 29,144, 85,164, 67, 86,161, 30, 26,253,195,247, 27,206,194,195,168, 83, 33,241,218,161, 60,
+ 14,229,203,254,185, 17, 44,177,216,112,237, 78,162,236,227,133,223,226,238,131, 20,172, 89,249,163,214, 96, 54, 89,109,174,170,
+227,143,183, 26,109,173,223, 55, 30,205, 91,250,121, 90, 29, 47,220, 79, 52, 11, 82, 30, 60,165,248,243, 74, 94,101,179, 32,255,
+168, 71,229,205, 36,101, 93,133, 70,252,237, 59, 45, 63,172, 48, 66, 63,236,201,190, 44,147, 21,241, 25, 25, 25,165,155, 54,109,
+170, 52, 61, 66,161, 16, 21,163, 7,141, 70, 99,157,163,138,156, 29,164,225,227,250, 53, 28, 85,147,185, 18, 10,133,224,121, 30,
+ 14, 14, 14,176,177,177,169,119,211,163,173,123, 72,175,118, 61,134,109,237, 49,228, 13,193,137,189,171,249,235,167,247,191, 92,
+ 86,144,184,167,190,215,168,180,180, 52,142, 16,114,127,233,210,165, 45,215,172, 89,211,120,246,236,217,201,171,191,158,250,195,
+195, 55,184,135,203, 34,222,188,121,147, 78,155, 54,205,160,215,235, 83, 74, 75, 75,111, 88,179,200,117,121,126,226,210, 63,126,
+ 89, 18,146,153,157,251, 90, 96, 68, 59,184, 53,110, 7,207, 38,237, 81,170, 49,225,234,131, 28, 36,223, 61,129,248, 11, 59,183,
+233, 10, 61,190,170, 79,122, 91,182,108,233, 47, 22,139, 7, 1, 8,177,177,177,105, 72, 8,145,138,197,226, 87, 8, 33,247, 9,
+ 33,119, 67, 66, 66, 78,160,134,229,139,170, 35,237,244, 90, 67,195,110, 19,191, 79,215,216,119, 79,206, 43,111,149,174,177,191,
+ 89, 46,115,156, 89,112, 98,133,193,163,247,210,101,212, 84, 20,183, 99,157,122,215,230,223,190, 19,142,157, 60,203, 18,171,114,
+126, 79,100, 35, 61,246,245,107,214,143,230, 22, 16,146, 59,123,246, 7,255,154,166,225, 81,228,234,209,148, 13, 57,214,104, 60,
+ 90, 79,241, 35, 27,239,240,159, 98,223,155,178,168,121,219, 78,227,186,244, 27, 37,224, 36,118, 56,178,103, 21, 77,185,115,114,
+135,136, 90,230,150, 23, 36,165, 60,235, 67,194,104, 52,214,105,174,170,109,186,117, 81,117,251,235,232,233,215, 14, 28, 62,243,
+117,191, 94,157, 93,126,254,236, 21,124,251,235, 94,216,218,200, 64,121, 11, 70,245,240,127,249,238,150, 62,131,252, 60,228, 62,
+187, 78,101,157,157,190, 60,246,163,242,114,211,189,186,214,206,123,100,152,207,217,219,219, 23,118,238,220,185,131, 76, 38, 35,
+ 69, 69, 69, 34,119,119,119,206,209,209,209,152,149,149, 85,110, 48, 24,118, 81, 74,181,245,201,167,201,204, 35, 53, 95,143,125,
+187,119,225,246,149, 19,184,123, 55, 81,115, 55,254,238,143, 68, 68,151,151,229,221,123,170,200, 42, 95,237, 40, 66, 90,239, 81,
+132, 90,161,205, 87, 55, 15,124,219, 45,184,199,187, 29, 93,130, 58,193, 57,224, 97,160, 72,149, 21,139,204,107, 59,246,105,114,
+ 36, 35, 41,141,125,234,177,239,222,190,141,131,169, 80,138,139,167,255, 2,229,249,149, 0, 64,121,126,229,205,243, 7,167,182,
+239,255, 6, 26,184, 55,108, 65, 8, 33,245, 93,143, 17, 0,100, 2,147,234,175,117, 95,237, 72, 77, 77, 69, 66, 66, 2, 30, 60,
+120,128,146,146, 18,108, 78, 61,171,170,143, 78, 65,210,197, 99, 30, 77,187,244, 25,243,250,140, 63,135,141, 24, 38,247,111,212,
+ 68, 16,226,235, 0, 87, 59, 17, 18, 83,178,145, 20,123,159,127,112,231,172,158,234, 10,134, 22, 61,184, 80,163,225,115, 11, 27,
+233, 33, 16,146,143, 79,236,127,184,182, 96,244,144,215, 67, 62,156, 62,187, 67, 3, 23,231,106,159,227, 37,197,165,210, 5, 11,
+230,133, 84,236, 95,215, 90,132, 2,161, 80, 51,121,234, 59,182, 2, 34, 64,197,233,162, 21,109,100,149, 63, 30,126,144,136, 69,
+117,150,209,137,195,162,192,241, 60,180, 58, 51, 52, 58, 35, 84, 26, 3,114,139,148,136,187,251, 0, 87,206, 29, 70,106,210,125,
+ 13,199,113,167, 64,177,187,208, 69,181,237,201,137,117,107, 45,159, 16,250, 55,112,118, 64,154, 82, 15,185, 84,132,156,140, 36,
+206,196,233,159,122,146,245,162, 91,251,115, 61, 34,134,244,158,248,214, 39,135,187,116,137,114,108,222,170,141,194,213,193, 1,
+ 18, 17,144,148, 81,128, 59, 55,174,106,211,239,221, 82, 91,204,186,190, 69,177,251,159,121,149,150,255, 89,131,101,178,112,209,
+179, 62, 89,124,212, 98,177,216,136,132, 66,157,153,242,125,159,197, 92,253, 93, 80,202,103,189,245,238, 7,149, 81, 93, 0, 48,
+ 91,120,155, 55,222,154,173,171,250,134, 64,204, 22, 69, 69,228,170,142,145,122,194, 66,165, 65, 51,231,151,219,235,151,172,143,
+223, 9, 32,254, 89, 71,246, 1, 64,169,218,120,219,165,215,246, 33,154,114,142, 0,184, 91,141,166,182, 71,143, 30,149,102,235,
+ 81,115,157,213, 21,132, 84,174,152,218,125,208,235,130, 19,251,214,240,215, 78,237, 27,249, 52,230,170, 74, 5,102, 2,112,133,
+ 16, 18, 59,119,238,220,182, 30, 30, 30, 30,243,230,205,147,171,213,106,241,207, 63,255,172, 47, 42, 42,202, 83,171,213,151, 40,
+181,190,127,194,163, 74,115,162,141, 71,179, 85,100,231,154,222,206,238, 62,125,156, 92,253,154,150, 22,102, 37,169,139,179, 14,
+ 19, 30,199, 52, 5,137,151,234,155,214, 91,183,110,101, 68, 70, 70,238, 21, 10,133, 55, 0,184, 2,176,167,148,150,112, 28, 87,
+ 42, 22,139,243, 18, 19, 19,235,189, 32,107,218,233,181,134, 46,111,253,190,165,164,156,151, 24, 5,146, 45,105,167,215, 26, 0,
+ 32,255,232,236,114, 0,251, 60,186,127, 60,124,255,165,180, 31,226, 74, 29,223, 45, 56,245,213,254,250,234,103,223,220,214,228,
+121,149,127, 93, 78, 92, 22,128,215,108, 61, 66,190,139,185,121,105, 62,161, 16, 91,192,125, 81,158,127,255,250,243,208, 23,139,
+197,250, 54,109,218, 84, 59, 90, 80, 38,147,213, 58,191,214,163, 7,253, 26,210,173,219,186,195, 39,206,189,118,232,216,249,175,
+ 59,116,236,236, 34,247,245, 65,128,179, 9,235, 62,104,253,238,137,155,133, 87, 7,127,112,246,151,228, 28,253, 29, 74,169,190,
+ 62,105,211,104, 52,247, 8, 33,165,101,101,101, 67, 40,165,153,132, 16,191,210,210,210, 91,102,179, 57,166,222, 70,128,199,171,
+ 29, 59,182,219, 76, 8, 17, 81,142,255,230,146, 88,184, 69,159,123, 55,235,105, 12,197, 99,209,213, 70, 14,152, 60,117, 90,112,
+ 80,147,166,193, 21,107, 17,134, 55,180,199,216,137,111, 6, 55,108, 28, 28,252,175,245, 9,107,127,161,162, 57, 55,116,196, 35,
+178, 87,226,209,165,159,185, 36, 93,120,203,166,129,175,157,182, 40,173,164, 52,237,250,210,242, 2,143,165, 79,174,208, 80, 95,
+ 82, 31,196, 45, 95,179,244,163,217,185,217, 41,107,180, 5,247, 98, 1, 64, 91,112, 47, 86,225,209,244,179,162,188,172,217,197,
+ 5,201, 75,159,246, 92,104,181,218,156, 77,155, 54, 57,117,234,212, 73,224,225,225,129,194,194, 66,156, 58,117,138,231,121, 62,
+187,190, 90,249,247,206,158, 34, 65, 65, 13,182,172, 83,125, 35,178,177,239,207, 89,224, 77, 41, 32, 18, 32,215,100, 80, 29, 46,
+116,210,125, 64,239, 92,170,189, 92,242, 22, 66, 5, 84, 80,177,182, 32,207,243,228,219,159, 54,164, 9,197,210,106,155, 84, 45,
+102,163,130,231,121,171,215, 34,204, 23,166,187, 68,152, 67,173, 26,197, 23, 75, 18,234,120, 57,165, 71, 94,234, 55,190, 15,199,
+ 89,204, 0,244, 85,182, 2, 74,201, 73, 16,203,209,162, 6,154, 75,245, 49, 85,143,213,243, 38,147, 19,132, 18,216,219,152, 65,
+ 64,160, 86, 41,101,110, 22,233,221,103, 41, 75,249,177,251,226, 72,183,110, 1,198,227, 39, 39,156, 57,119,113, 36,229, 45,141,
+ 44, 20, 0, 37,169, 70,147,126, 71,129, 67,209,250,167, 77,239,255, 26,132,254,141,243, 81, 88,219, 92,242,223,166, 73, 8,145,
+ 60,170,172, 45, 85,151,191,121, 30,233,172,109,109,193,103,201,187,189, 87,179,206, 50,185,226,131,242,114,205,154,242,252,123,
+127, 62,207,243, 73, 8,113,148,201,100,173,236,236,236,196, 69, 69, 69, 87, 40,165,170, 23,241,186, 87, 37,234,245,157,174, 61,
+123,133,207, 56,122, 54,113,197,163,230,195, 74,124, 71, 46,151,143,235,223,125,214,250,221,251,254,109, 20,225,139,144,247,191,
+ 75,147,116,235, 38,114, 47,117,120,205, 98,225,191,232, 17,172, 41,207, 75, 73,156,118, 46,166,240, 10,165, 84,243, 44,233,148,
+ 74,165, 99, 77, 38,147,141, 68, 34,209, 25,141,198, 77,255, 45,121,119,143, 24,250, 57, 8,154, 89, 45, 66,113,183, 32,118,239,
+188, 58,159, 33, 97, 97, 18, 69, 33,156,203,139, 92,139,235,107,172,254, 35,215,157, 16, 97,100,100,100,148, 68, 34,241,183, 88,
+ 44, 10,163,209, 88,174,211,233, 82,211,210,210, 46,214,180, 32,249,223,157, 78,143,200,161,203,197, 98,241,123, 0, 96, 54,155,
+191,207,143,217, 59,163,182,239,214,180,255,255, 75,125, 52,114,164,144,238,216, 97,249, 59,174,145, 79,171,151,149,102, 51,231,
+ 88,241,187, 68, 44, 82,101,221,220,233,244,159, 42, 75, 47, 28,244,209,242, 8,127,199, 6, 32,154,105, 50, 77,166,201, 52,171,
+217, 87,192,206, 39,211,252, 79,106,122, 53, 27,232,231,213,108,160,159,181,223,175,110,127,118, 62, 41,216, 86,243, 38, 98, 22,
+147,193, 96,252, 7, 94,236,120,118, 22, 24,255, 73,114,226,255,204,252, 59,247,103, 48, 8,128,232, 26, 30,128, 86,135,254, 8,
+ 33,209, 79,241,128, 61,206, 52,153, 38,211,100,154, 76,147,105, 50,205,127,150,102, 93,218, 47, 76,211, 35,107, 34,100,154, 76,
+147,105, 50, 77,166,201, 52,153, 38,107, 34,124,190,155, 0, 12, 6,131,193, 96, 48, 24,140,231, 10, 51, 88, 12, 6,131,193, 96,
+ 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,227,233,
+249, 91,103,114,103, 48, 24, 12, 6,131,193,248, 39,194, 34, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96,
+ 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24, 12,102,176, 24,
+ 12, 6,131,193, 96, 48,152,193, 98, 48, 24, 12, 6,131,193, 96,252,231, 13, 22, 33, 36,154,105, 50, 77,166,201, 52,153, 38,211,
+100,154, 76,147, 25, 44, 6,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96,
+ 48,131,197, 96, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,227, 63, 4, 1, 80,237, 72, 0, 74,233,113,171, 69,
+158, 98, 52, 65, 93,250, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52,235,210,174,143,255,248,175,134, 82,250,183,109,
+ 0,162,153, 38,211,100,154, 76,147,105, 50, 77,166,201, 52,255,105, 27,107, 34,100, 48, 24, 12, 6,131,193,120,206, 48,131,197,
+ 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,
+193, 96, 48,158, 30,242,104, 52, 0,131,193, 96, 48, 24, 12, 6,227, 57,193, 34, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24,
+ 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48,
+ 24, 12,102,176, 24, 12, 6,131,193, 96, 48,152,193, 98, 48, 24, 12, 6,131,193, 96,252,231, 13, 22, 33, 36,154,105, 50, 77,166,
+201, 52,153, 38,211,100,154, 76,147, 25, 44, 6,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24,
+ 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,227, 63, 4, 1, 80,237, 72, 0,
+ 74,233,113,171, 69,158, 98, 52, 65, 93,250, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52,235,210,174,143,255,248,175,
+134, 82,250,183,109, 0,162,153, 38,211,100,154, 76,147,105, 50, 77,166,201, 52,255,105, 27,107, 34,100, 48, 24, 12, 6,131,193,
+120,206, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96,
+ 49, 24, 12, 6,131,193, 96, 48,158, 30,242,104, 52, 0,131,193, 96, 48, 24, 12, 6,227, 57,193, 34, 88, 12, 6,131,193, 96, 48,
+ 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,131, 25, 44,
+ 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48,152,193, 98, 48, 24, 12, 6,131,193, 96,252,231, 13, 22, 33, 36,
+154,105, 50, 77,166,201, 52,153, 38,211,100,154, 76,147, 25, 44, 6,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48,
+ 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,227, 63, 4,
+ 1, 80,237, 72, 0, 74,233,113,171, 69,158, 98, 52, 65, 93,250, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52,235,210,
+174,143,255,248,175,134, 82,250,183,109, 0,162,153, 38,211,100,154, 76,147,105, 50, 77,166,201, 52,255,105, 27,107, 34,100, 48,
+ 24, 12, 6,131,193,120,206, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193,
+ 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,158, 30,242,104, 52, 0,131,193, 96, 48, 24, 12, 6,227, 57,193, 34, 88, 12,
+ 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24,
+ 12, 6,131, 25, 44, 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48,152,193, 98, 48, 24, 12, 6,131,193, 96,252,
+231, 13, 22, 33, 36,154,105, 50, 77,166,201, 52,153, 38,211,100,154, 76,147, 25, 44, 6,131,193, 96, 48, 24, 12, 6, 51, 88, 12,
+ 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24,
+ 12, 6,227, 63, 4, 1, 80,237, 72, 0, 74,233,113,171, 69,158, 98, 52, 65, 93,250, 76,147,105, 50, 77,166,201, 52,153, 38,211,
+124,241, 52,235,210,174,143,255,248,175,134, 82,250,183,109, 0,162,153, 38,211,100,154, 76,147,105, 50, 77,166,201, 52,255,105,
+ 27,107, 34,100, 48, 24, 12, 6,131,193,120,206,136,170,251,163,184,253,151,249, 28,199,185, 3,128, 72, 36, 42, 48, 95,253,212,
+171, 54, 17, 63, 47,175,158, 22, 96, 53, 0, 8,129, 55, 51,115,114,142, 85,163,121,140,227, 56,231, 71,154,165,230,171,159,246,
+169, 77, 83,220,238,139, 35,143,237,127,101,110,175,106,226,139, 66,113,187, 47,114,158, 72,171,119, 61,194,119,150,255,143,116,
+254,175,104,254,147,145,116,248, 50,223,108,126, 88,142,196, 98, 81,129,233, 74,237,229, 72,210,254,139,156,199,246,191, 60,215,
+163, 54, 77,133,141,172, 56,200,199,109, 89,109,154,201, 57, 69, 51,181,229,122,151,218, 52,255,103,238, 77, 43,241,244,244,108,
+ 35, 16, 8, 62, 37,132, 56, 84,249,243,157,236,236,236,247, 89,169,100, 48, 24, 47,156,193,226, 56,206,253,198,158,249,208, 26,
+128,158,227,191,112, 15, 28,250,235,230,127,219, 71, 95, 42,213,221,223, 27, 41,133,214,217, 70,204, 57,220,191,127,159, 0,128,
+183,183,247,106, 0,254,213,104, 58,223,216, 51, 31,229, 70,160,203,232,133,206,157,253,252, 28,242,132,194, 89, 50, 27,155,238,
+122,189, 62, 28, 0,228,114,121,156, 65,167, 59,229,105,177,124,247,228,254, 53,101,160,106, 90,123,140,251,194, 61,116,232,175,
+239, 90,120, 94,170, 75,222,209,133,215,164,139, 36, 22,227,207,175,229,230, 30,154, 15, 88,172, 57, 33, 85,143,219,117,212, 39,
+ 46,254, 94, 94, 61,164,114,121, 11,123, 7,135, 40,158,210,102, 60,207, 19, 11,199,197,107,203,202,206,241, 28,119,219, 98, 46,
+119,185,177,247, 43,190,182,116, 62,153,151,145,128,232,178,167,231,203, 10, 91,219,238, 2,145,232, 37, 0,224, 57,238, 98,185,
+ 86,123,170, 67, 94,222, 78,107,242,110,237,249,121,218,253,255,105,152,205,156,123,202,145,249, 48,152,129, 86, 35,190,118,111,
+254,234,250,205, 0, 96, 44,184,237, 81,118,127,127,123, 0,176, 13, 26,120, 69,230,217, 42, 31, 0, 68,233,185,238,247, 14,204,
+133,193, 12, 52, 27,184,208,189, 46,205,137,243,182,187,124, 56,121,184, 12, 0,142,238,250,169,233,201,221, 43,251, 1, 64,143,
+225,211, 14,245, 30, 49,253, 30, 0,124,243,219,110,151,173, 95,191, 82,171,166,117,247,166, 74,162,186,127,160,137, 81,157,235,
+228,103, 43,242,188,127,255,190,160, 62,247,166, 47,224,152, 11,188, 45, 16, 10,163,130,154, 52,105, 5,128, 38, 39, 37,221,180,
+112,220,121, 47,224,231,231, 89,150,132, 66,225,187,217,217,217,131,170,254,205,199,199,135, 21, 72, 6,131,241, 98, 26, 44, 0,
+208, 26,128, 51, 15,128,174, 29,154, 99,242,171,253,237,170,254,111,247,239,139,252,179, 98,143,133,126,181,246, 27, 65,120,120,
+ 56,146,147,147,173, 58, 88,185, 17, 56,125, 31,144,233, 83,237, 11,164,210,164,121,159,126,234, 16, 21, 21, 37,242,242,122,248,
+ 18, 94, 80, 80,208,225,252,249,243,109, 22, 44, 88, 48, 85,166, 79, 45, 45, 55, 66,115,250,126,221,186, 21,105, 13,111,218, 16,
+159, 78,127,197, 17, 0,150,207,222,217,230,224,197,219, 13, 82, 83, 83,123,126,245,213, 87,197, 62,151, 46,173,108, 96,177,172,
+141, 41, 40,200,180, 38,157,219,142,220,146, 7, 25,143, 5,190, 60,113,226,174,128,128, 0, 59,111,111,111,162, 80, 40, 32, 20,
+ 10,161, 86,171,253, 19, 19, 19,251,221,190,125, 91,123,238,242, 62,105,204,237, 17,201, 89,194,150,122,107,242, 46,225,138,228,
+177,193,193,113, 47,247,235,231, 59,112,224, 64,121,163, 70,141, 0, 0,169,169,169,193,127,253,245,215,232,131, 7, 15,206,147,
+112, 69, 92,185, 17,250,186,242, 94,161, 9, 0,114,224, 37, 39,119,247,177, 66,177, 56,156,227, 56,159, 71,209,133,108,139,217,
+ 28,167, 44, 40,216,244,228,254,140,127,199, 96, 6,238,230, 2,209, 81,173, 48,110,120,180, 45, 0,124, 52,234,203, 14,233,169,
+ 15, 36, 70,163, 17, 77, 67,154,117, 90,244,245,178, 35, 16, 8,176,113,247,241,202,253,173,209,188,115, 55, 5,243, 23, 45, 71,
+ 78,204,206, 14, 22,213,131,238, 26,181, 74, 8, 0, 14,142,142,195,119,110,219,114,202, 59,242,229,203, 15,138, 76, 86,105,214,
+118,111, 30,222,246,163, 87, 86,236,169,176, 95,142,254, 33,246,247,247, 71, 76, 76, 76,189,238, 77,168, 18,237,121, 47,175,248,
+239, 62,248,192,179, 75,151, 46,176,179,179,131, 72, 36, 2,199,113,209,231,207,159,143,158, 63,127,254, 52,168, 18,181,214,222,
+155, 86,240,157,183,183,119,247, 33, 35,198,122,117,239, 51, 16,195,251,118, 98, 5,145,193, 96,188,184, 6, 75, 36, 18, 21,244,
+154,240,149,123, 84,251, 8, 92,187,125, 79,149,150,145, 91, 86,241, 63,229,221,221, 77, 71, 71, 7,133,173, 58,248, 23, 12, 6,
+ 3, 46, 92,184,128,219,183,111, 35, 53, 53, 21,115,231,206, 53, 8,129, 55,107,208, 44,237, 50,122,161,179,204,144,105,215,218,
+ 37,179,209,214,205,167,132, 58,157, 14,167, 79,159, 70,105,105, 41,164, 82, 41,124,125,125,209,185,115,103,209,233,211,167, 27,
+140, 26, 51,214,177,247,208, 73, 41, 6,153, 95,153, 72, 36, 42,173, 49, 3, 34, 81, 65,207,241, 95,184,135, 5, 55, 68, 82, 90,
+142,234,211,175,127, 47,227,121, 42, 42, 79,207, 50,157, 57,115, 6,173, 90,181,194,182,109,219, 92, 74, 75, 75, 63, 91,183,110,
+221,167, 94, 63,174,253, 62, 55, 43,113,118, 45,122,165, 93, 70, 47,116,110,106, 57, 25,176,115,203, 31,146,219,183,111, 75, 86,
+173, 90,133,226,226, 98, 72,165, 82, 56, 57, 57,193,211,211, 19, 77,155, 54, 37,111,191,253,182, 93,247,238,137,248,108,230,164,
+128, 92,167, 33,137, 53,165,179, 66, 83, 98,204, 85, 4, 11,175, 7,173, 94,191, 94,208,174, 93, 59, 82,117, 31,127,127,127,116,
+235,214, 77, 62,108,216,176,160,105,111,191,195, 71, 15,155,146,100,146,122,149,215,165, 9,109,166,141, 75,249, 37,239,232,209,
+163,247, 47, 92,184,208,201,211,211, 19,182,182,182, 0, 0,149, 74,229,155,150,150,214, 97,222,188,121, 35,174,220,217, 38,234,
+ 50, 48, 51, 7,182,126,186,218,206,231, 63, 21,177, 88, 84, 80, 17, 53,178,183,181, 41,205,204,202,215, 2,128,209,104,132,209,
+104,132,193, 96,192, 91,211,166, 8,223, 28,209,174, 73, 64,212,187,183, 82,179,243, 75,154, 29,191,220,160,226,187,117,105,138,
+202, 83,149,202,140, 19,111,206,255,224, 3, 79, 15,143,127,181,252,109,220,176, 65, 88, 82, 82, 18, 61,127,254,252, 48,170,232,
+166,108, 54,112,161, 83,109,154,181,222,155,247,254,106,180,104,122,159, 22,191,126,125, 0, 22,139, 5,151, 46, 93,194,217,179,
+103,177,108,217, 50,122,232,208, 33,149,131,173,109,173,247, 38, 84,137,246,157,189,242, 2,151, 44,217, 69,100, 50, 25,246,237,
+219,135,132,132, 4, 8, 4, 2, 52,111,222, 28,227,198,141, 67,116,116,180,231,228,201, 83,104,151,190,163,146,225, 24,162,121,
+150,178, 68, 8, 17,120,121,121,189,251,214,251,159,120, 13, 31,253, 26,126,252,246,115,102,176, 24, 12,198,139, 67,181,189,223,
+ 1, 65,227,161,191,110,221,113,157,255,171,241,208, 95,183, 82, 64, 64, 1,129, 3,208, 48, 42, 42,202,172, 84, 42,233,213,171,
+ 87,233, 91,111,189,165,253,254,251,239, 79,253,245,215, 95, 59, 57,147,105, 77,171, 22, 45,150, 82, 64, 80,147,102,115, 71, 71,
+199,192,192,192,194,204,204, 76,122,240,224, 65,186, 96,193, 2,186,105,211, 38,122,232,208, 33,122,252,248,113,122,232,208, 33,
+186,117,235, 86,122,231,206, 29,250,224,193, 3, 26, 20, 20, 84,216,220,209,209,177, 22, 77, 33, 5,132, 77,135,174,154,189,235,
+154,121, 97,200,208, 95,103, 80, 64,216,204,195, 35,180, 87,175, 94,150,157, 59,119,210,141, 27, 55,210,245,235,215,211, 59,119,
+238,208,162,162, 34,234, 19, 16, 88, 88,241,189,154,210, 73, 1, 65,171, 86,173, 10,149, 74, 37,245,243,243,163, 82,169,148,122,
+120,120,208,166, 77,155,210, 14, 29, 58,208,126,253,250,209, 87, 95,125,149,126,246,217,103, 84,169, 84,210,128,128,128,252,138,
+239,213,164, 57,208,203,203, 38, 40, 40, 40, 35, 38, 38,134,214,132, 78,167,163, 69, 69, 69,244,228,201,147, 52, 40, 40, 40, 99,
+160,151,151, 77,109,154, 54, 64,235,200,200,200,194,162,162, 34,106, 50,153,104, 70, 70, 6,141,141,141,165, 9, 9, 9, 52, 35,
+ 35,131,234,116,186, 74,237,123,247,238,209,192,192,192, 66, 27,160,117,141,154,255,228,173,162, 76, 60,177,249,123,120,244,243,
+244,244,212,237,218,181,139,102,103,103,211,117,235,214, 81, 1,240,229,191,237, 91,139,166, 20,232,221,185,115,103,203,165, 75,
+151,232,173, 91,183,232,199, 31,127, 76,251,244,233, 67,251,246,237, 75,231,207,159, 79,179,178,178,104, 86, 86, 22,237,215,175,
+159, 69, 10,244,174,171,124, 86,119,111, 58, 2,254, 3, 7, 14,212,153, 76, 38,154,156,156, 76,195,195,195,179,132,192, 88, 91,
+ 32,172, 43, 32,171,171,124,250, 0,206, 94, 94, 94,185,151, 46, 93,162,187,119,239,166, 1, 1, 1,133, 66, 96,162, 3,208,216,
+ 1,104, 44, 4, 38, 54,110,220,184,240,210,165, 75,180,184,184,152,250,251,251,231,250, 0,206, 79, 91,150, 0, 8,188,188,188,
+254,248,226,155,159,104, 98,150,150,126,241,205, 79,212,203,203, 43,131, 82, 74,189,188,188,142,177, 50,201, 54,182,177,237,127,
+125, 19,213,203,140,217,218,126,181,104,209, 34,145, 94,175,199,239,191,255,174, 25, 51,106,212,110, 39, 39, 39, 78, 44, 22,131,
+ 8,234, 30,144,168,113,116,124,111,238,156, 57, 78, 6,131, 1,215,175, 95, 71,155, 54,109, 32,147,201, 32,145, 72, 32, 22,139,
+ 33, 22,139,225,229,229,133,130,130, 2,132,135,135, 99,234,212,169,142, 63,255,248,227,123, 80,169, 22,213,166,203,243, 84, 4,
+ 0, 22,158,151, 54,244,246,158, 28, 26, 25,185,116,218,180,105, 2, 91, 91, 91,232,245,122, 24, 12, 6, 36, 36, 36,192,197,197,
+ 5, 10, 27, 27,171,242, 44, 16, 8, 4,118,118,118, 56,121,242, 36,126,251,237, 55,164,166,166, 34, 55, 55, 23,246,246,246, 8,
+ 15, 15, 71,179,102,205,208,181,107, 87, 36, 39, 39,131, 16, 66,234,210,139, 23,139,223, 30, 55,122,180,123, 68, 68, 68,181,255,
+215,235,245, 80, 42,149, 80,169, 84,240,240,240, 64,191,126,253,220,255,220,183,239,109, 0,223, 85,183,191, 11,224,233, 27, 28,
+188,255,234,213,171,174,148, 82,108,220,184, 17,101,101,101, 48, 26,141, 16, 8, 4,144,203,229,112,118,118, 70,143, 30, 61,224,
+230,230,134,224,224, 96,108,223,190,221,181, 95,191,126, 7, 92, 10, 10, 90, 23, 3, 57,236,245,162,110,210,243,243,143,246, 6,
+ 92,199,190,250,234,161,219,119,238, 68,141, 29, 59, 22,249,249,249,159,136, 63,254, 88,105, 6,150,215,245,253, 16,192,177,129,
+151,215,218, 37, 75,150, 8,242,242,242, 48,107,214,172,162,156,244,244,143, 29,129,115, 0,112,226,240,225,168, 77,155, 54, 45,
+222,184,113,163,235,134, 13, 27, 4,173, 90,181, 90, 27,146,145, 17,158, 8,168,234,147, 78, 13,240,238,138, 21, 43,228,122,189,
+ 30,189,122,245, 74,150,167,166,182,224, 0,157,181,223,207, 5,222, 94,246,225,135,158, 50,153, 12,179,102,205, 42, 42, 79, 79,
+143,224,128,194, 42,187,164,185,165,164, 28, 30, 63,126,124,236,157, 59,119, 92,151, 47, 95,238, 57, 98,216,176,183, 1,124,105,
+237, 49,170,118,104,247,242,242, 10, 30, 50, 98,172, 71,211,176, 72,236,222,186, 14,191,172,248,106,173,197, 98,249,213,199,199,
+103,186, 64, 32,248,150,149, 60, 6,131,241, 66, 54, 17,214,132,139,155, 91,155,208,208, 80,156, 57,115, 6,145,145,145, 87,157,
+156,156, 56,137, 76, 6,177, 88, 12,202,243,117,126,223,198,214,182,103,151, 46, 93, 68, 23, 47, 94, 68, 96, 96, 32,108,108,108,
+ 42,141, 85,197, 38,145, 72,224,229,229, 5,181, 90,141,168,168, 40,241,218,181,107,123, 2, 88, 84,151,118, 78, 90,162, 29, 82,
+214,190,186,248,187,165,141,219,181,107, 7,149, 74, 13,158,231,161, 80, 40, 96, 52, 26, 33, 18,137, 96, 52, 26,161, 55, 82,181,
+ 53,121,181, 88, 44, 22,161, 80,136,192,192, 64,124,245,213, 87,208,235,245,144, 72, 36, 0, 0,181, 90, 13,165, 82,137,216,216,
+ 88,164,165,165,129, 62,122, 37,175, 13, 91, 59,187,254,131, 7, 15,150, 86,247, 63,131,193, 0,149, 74, 5,149, 74, 5,165, 82,
+ 9,189, 94,143,230,205,155, 75, 79,157, 60,217,191, 38,131,101,144,203, 71,108,216,176,193, 93, 42,149, 66,167,211, 65,163,209,
+ 32, 51, 51, 19,233,233,233,250,130,130, 2,206,222,222, 94, 16, 16, 16, 32,144,201,100,178,161, 67,135, 18,181, 90, 13, 66, 8,
+ 6, 14, 28,232,178,121,227,198, 87, 0, 44, 99,197,223, 58,142, 2,134,214, 70,227,160,246,237,218,157,188,122,237, 90,171,247,
+222,123, 15,119,238,220, 89,162,216,182,237, 76, 57,112,187,182,239, 38, 3,111, 47,173, 98, 92,104,122,122,164,233, 9,227, 18,
+240,208,184,196, 84, 24,151,145,245, 52, 46, 0, 96,239,232,216,214,203,203, 11,135, 14, 29, 66, 70,106,234, 71,245, 49, 87, 0,
+ 32, 16, 10, 59,119,233,210, 5,251,246,237, 67, 86,122,250, 71, 79,152, 43, 0, 64, 33, 80, 40, 74, 78,254,104,237,218,181,127,
+188,254,250,235, 16,138, 68,157,193,113, 86, 31,163,186, 14,237,111,191,247, 17,246,237,218,180, 54, 55, 55,247, 13, 74, 41, 15,
+224, 42, 43,113, 12, 6,227, 69,160, 94,243, 96,121,122,122,250,216,218,218, 34, 39, 39, 7,205, 66, 67, 11,100, 50, 25,164, 98,
+ 49,228, 82,169, 85,223,215,235,245,145,158,158,158, 80,169, 84,112,117,117,133, 68, 34,169,220,164, 82,105,229,103,123,123,123,
+ 8, 4, 2,248,248,248, 64,175,215, 71,214,165,203, 41,239,187, 31, 94,247,241, 91,127,238,218,208,184, 95,191,254,112,118,110,
+ 0, 63, 63, 95,184,187,187,195,198,198, 6,126,126,126,104,210,164, 9, 93,189,122, 53, 4, 14, 77,172,122,128, 87, 53, 77, 34,
+145, 8, 22,139, 5,249,249,249, 72, 76, 76,196,157, 59,119,112,233,210, 37,220,186,117, 11, 26,141, 6, 86,248, 43,104,203,203,
+ 91, 84, 23,232, 50, 24, 12, 80, 42,149,149,209, 43,165, 82,137,194,194, 66, 36, 39, 39, 67,173,209,180,172, 73,207,217,197,101,
+120, 68, 68,132, 16, 0,108,108,108,208,178,101, 75,252,250,235,175,220,159,123,247,142, 10,187,116,169,129,223,145, 35, 78,171,
+ 87,173, 26,245,242,203, 47, 91, 46, 95,190, 12,181, 90,141,187,119,239,194,205,205, 77, 36,149,203, 95, 97, 69,191,126,220, 0,
+180,174, 26, 77,223,151, 94,122, 41, 69,165, 82,225,219,111,191, 21,136,237,237,127, 91, 8, 8,235,112, 21,157,186,116,233,130,
+253,251,247, 35, 39, 61,253,227,244,106,140, 75, 58, 80,152,145,156,252,241,218,181,107,209,187,119,111, 16,145,168,222, 29,145,
+ 58,116,232, 16,193,243, 60, 98, 98, 98,224, 4, 92,169,239,247,131,154, 52,105,101,103,103,135,132,132, 4,216, 62,138,174, 85,
+251,162, 0,156,187,121,243, 38,108,108,108,208, 44, 44,172,117, 61, 15,243,157,183,183,119,238,219,239,125,132,221,135, 47, 0,
+ 0,246,237,218,148, 95,197, 92, 49, 24, 12,198, 63,211, 96, 85, 32, 22,139, 33,149,201, 32,149, 74, 31, 26, 35,153,204,234,239,
+ 18, 66, 32,151,203, 43, 13, 85, 85, 99, 85,245,179, 66,161,176,202,184, 0,128, 57,239, 66,212, 43, 35, 95,150, 74, 36, 18, 24,
+141, 6, 80, 74, 33,147,201,225,228,228,132,192,192, 64,148,151,107, 49,120,200,112, 67,166, 82,114, 64,226,219,243,206,211,228,
+153,227, 56,104,181, 90,148,150,150,162,164,164, 4,106,181, 26, 58,157, 14, 86,180, 14, 86, 86,181, 25, 25, 25,216,178,101, 11,
+138,139,139, 1, 60,236, 64, 93, 97,170, 42,126,166,164,164, 96,227,198,141, 72, 77, 77,133, 80, 40,180,250,250, 68, 69, 69,225,
+192,129, 3,194,110, 61,123,174, 57, 22, 16,144,115, 44, 32, 32,167, 91,207,158,107,246,239,223, 47,244,241,241, 65, 90, 90, 26,
+174, 95,191,142,210,210, 82, 80, 74, 9, 43,250,245, 39, 9, 40, 45, 47, 41,121,253,147, 79, 62,161,118,118,118,248,118,233,210,
+ 22, 95, 2, 99,172, 53, 46,142,181, 24, 23,199,103, 51, 46,160,148,130,231,121, 88, 44,150,167,202, 27, 33,132,136,197,226,250,
+148,103,224,225, 82, 91,214,234, 11, 40,165,239,190,245,254, 39, 94,239,124, 48, 15,167,142, 28,168,248,251,125,102,174, 24, 12,
+198,139, 72,189,154, 8,115,114,114,178,181, 90,109,227,128,128, 0,100,101,101,185,251,251,251,167, 75,197, 98, 72,164, 82,171,
+250, 96,201,229,242,152,252,252,252, 78, 62, 62, 62,224, 56,174,210, 76, 61,217, 68, 88, 17,149,185,123,247, 46,228,114,121,157,
+227,204, 5,150,178,134,225,225,225,149,145, 32, 39, 39, 39, 56, 57, 57, 66, 38,147, 99,241,226,197,252,154,223,126,251, 89, 30,
+254,182,234,253, 73, 31,210, 27, 95,174,121,174, 39,208,218, 10, 73,161, 80,196, 52,106,212,168,163, 66,161,192,238,221,187,145,
+150,150,134,210,210, 82,148,151,151,195, 96, 48,160,188,188, 28, 70,163, 17,114,185, 28, 97, 97, 97,104,208,160, 1,226,226,226,
+106,204,123,105,113,241,238,152,152,152,142,237,218,181,171,140,160,116,239,222,157,116,239,222,221,181,226,247,242,242,114, 20,
+ 21, 21,225,234,213,171, 56,126,252, 56, 8, 33,184,127,255,190,197,160,211,109,101, 69,255,233,208, 3, 23,133,107,215,254, 49,
+117,234,212, 73,157, 58,117,130, 5,232, 7, 96,227,127,202,184, 84,112,233,210,165, 88,139,197,210,169,105,211,166, 80, 2,237,
+ 1,236,171,151,121,124,240,224, 38,199,113, 61, 91,180,104,129,221, 59,118, 68, 1, 72,171,110, 63, 45, 16,213,170, 85, 43,232,
+116, 58,220,141,143,191, 97,173,185,242,242,242, 90,243,214,251,159, 76, 28, 62,250, 53,236,222,186, 14,251,118,109,202,252,249,
+251, 37,126,148, 82, 19, 43, 85, 12, 6,227, 31,111,176, 74,139,139,111,196,198,198, 54,110,221,186, 53,214,172, 89,211,238,165,
+142, 29,179, 37, 82, 41, 39,149, 72, 32,176,162, 2,209,105,181, 39,206,159, 63,223,190,119,239,222,162,203,151, 47,195,211,211,
+179,210, 96, 85,252, 20,137, 68,160,148, 66,161, 80,224,208,161, 67, 38,157, 86,123,162, 46, 93, 11,103,177, 8, 30, 25, 60, 74,
+ 41,148, 74, 37, 36, 18, 9, 86,175, 94,131,117,191,253,246,106, 86,110,238,206,224, 54,206, 31, 0,144,255,199, 42,230,242,242,
+147, 39, 78,156,104, 51,115,230, 76,177,175,175, 47,148, 74, 37, 74, 75, 75, 81, 92, 92, 12,181, 90, 13,181, 90,141,210,210, 82,
+ 40,149, 74,200,229,114, 60,120,240,192,172, 47, 47, 63, 89,147,158, 76,175,223, 53, 97,194,132, 15,111,222,188,233, 37, 18,137,
+ 96, 54,155,193,243, 60,120,158,135,201,100,194,131, 7, 15, 16, 23, 23,135,132,132, 4,148,148,148, 64, 44, 22, 67, 40, 20,226,
+214,173, 91,165,182,102,243, 14, 86,244,159, 30, 49,176,251,252,249,243,147,198,141, 27, 7,111, 95,223,174,200,202,178,202,184,
+236,173,197,184,168,158,194,184, 60,102,124, 52,154,107, 41, 41, 41,157,186,117,235, 6, 47, 95,223, 37, 97, 89, 89,199,226,235,
+209, 15,203,194,113,231,206,159, 63,223,115,252,248,241, 88,179,102,205, 18,183,148,148,195,133, 79, 52,103,186, 1,110,141,130,
+130,150, 76,156, 56, 17, 71,143, 30,133,133,227,106,140,200, 61,209,161,189,225,144, 17, 99,253, 88,135,118, 6,131,241, 79,162,
+ 94, 77,132, 68,171,157, 51,119,238, 92,179, 80, 40,196,240,225,195,237,247,237,223,255,242,173,219,183, 3, 11, 10, 10,156, 44,
+ 22, 75,157, 90,246, 42,213,247,139, 22, 45, 82,154,205,102,132,132,132,160,164,164, 4, 22,139, 5, 34,145, 8, 34,145, 8,132,
+ 16, 8, 4, 2,216,217,217, 33, 46, 46, 14,219,182,109, 83,219,171, 84,223,215,165,203,243,124,204,158, 61,123, 32, 18,137,168,
+ 92, 46, 7, 33, 4, 34,145, 8,171, 87,175, 46,152,147,155,187, 27, 0,132, 2,129, 17, 0, 4, 2, 98, 85,175, 92, 66, 72,157,
+237,147, 82,169, 20,252,195,206,253,117,238,235,102, 54,175, 88,181,106,149,230,254,253,251,208,106,181,149,209,182,178,178,178,
+202, 78,243, 74,165, 18,132, 16,232,245,122,156, 61,123, 86,227,102, 54,175,168, 73,175, 24,200,203,186,127,127,112,187,118,237,
+138, 83, 82, 82,160, 82,169, 16, 19, 19,131,227,199,143, 99,251,246,237, 56,122,244, 40, 30, 60,120, 0,142,227,224,227,227, 3,
+ 74, 41,246,238,221,171,226, 52,154,126,197, 64, 30, 43,250, 53,211,208,211,179,167,135,187,123,134,155,171,107, 86, 67, 79,207,
+158, 79,254,223, 17,184,119,239,222, 61,112, 28,135,192,192,192, 6,181,245,195,162, 28,119,254,252,249,243, 24, 63,126, 60,252,
+ 26, 55, 94, 28, 0,184, 61,185, 79, 0,224, 22, 16, 20,180,184,194,184, 80,142, 59, 95,223, 52,219, 3, 63,124,240,193, 7, 58,
+137, 68,130,109,219,182, 5,154,155, 52, 73, 16, 1, 99,236,128,208,110,128,164,174,239,123, 1, 63,127,246,217,103,121,132, 16,
+108,218,180,201,213, 49, 40, 40, 86, 4, 76,112, 4, 26, 58, 2, 13, 69,192, 4,199,160,160,216,109,219,182,185,114, 28,135, 25,
+ 51,102,228,121, 1, 63,215,164, 39, 20, 10,223,205,201,201, 25,148,157,157,221, 37, 39, 39,199,239,231,239,151,224,212,145, 3,
+248,101,197, 87,107,115,115,115,223,200,207,207,191,154,157,157, 61, 46, 43, 43, 43,150,149, 56, 6,131,241, 34, 66,170,235,231,
+ 36,110,255,101, 62, 64,221,187,118,104,142,107,183, 19, 85,174,206, 14, 71, 42,254,167,188,187,187,233,192, 14,158,205,191,253,
+246, 91,136, 68, 34,100,102,102, 34, 62, 62, 30, 14, 14, 14,120,239,189,247, 12,102,131, 97,112,197,122,103,132,144,104, 74,233,
+241, 71,154,199, 56,142,115,150, 25, 50,237, 90, 57,167, 52,222,184,126,173,208,222,222, 30,101,101,101,149,211, 10, 40, 20, 10,
+216,216,216,224,206,157, 59, 24,255,218,235,150, 36,174, 69,229, 68,163, 21,235,157, 85,213, 4, 33, 66, 0,232,231,236,172,184,
+ 43,147,205,114,241,240,152,253,206, 59,239,216,116,237,218, 21, 18,137, 4,109,218, 71,229,217,182,156,253,131, 64, 64,184,172,
+ 98,245,220,160,134,222,142,241,247,211, 0,144,135,107, 22, 62, 90,139,176,186,116, 70,202,239, 4,110,252,229,115,135,240,240,
+240,135,249, 86, 42,145,159,159,143,130,130, 2, 40,149, 74,104,181, 90, 0,192,241,227,199,113,242,106,138, 58,215,174, 87,114,
+ 77,233,252, 87,222,211,236,155,217,220,107,244,195,138,101, 66, 39, 39, 39,228,231,231,163,176,176, 16, 74,165, 18, 58,157, 14,
+ 22,139, 5,106,181, 26,251, 15, 28,180, 36, 91, 34, 83, 13,178,134,154,186, 52,161,205,180,105, 80,118,193,167, 85, 88, 0,157,
+ 52,105,146,189,131,131, 3,120,158, 71,105,105, 41, 50, 50, 50,144,146,146,130,179,103,207,106, 11,148, 70,104, 93,123,101, 85,
+ 76, 52, 90,237,249,124, 94,133,234,127, 81,243, 81, 89, 2, 0,111, 47,175,156,244,244,116,119,139,197, 2, 31, 31, 31, 78, 89,
+ 82,178, 88, 10, 28,181, 7,114, 1,208, 34,224,211, 21, 63,252,240,250,144, 33, 67,208,182,109,219,204,188,252,252, 70,213,149,
+ 37, 16, 34, 12, 1, 28,203,125,125,227,174, 94,189,234,153,145,145,129,241,227,199, 23,165, 39, 37, 85, 78,211,160, 2,162, 2,
+130,130, 22,111,219,182,205,181,113,227,198,136,140,140,204,147, 87, 76,211, 80,125,249,172,249,222,188,247, 87,163,105,195, 34,
+218,190,245,214, 91,224, 56, 14,103,207,158,197,149, 43, 87,144,158,158,142, 11, 23, 46, 40, 29,108,109, 71,213,118,111, 66,149,
+104,223, 47, 88, 27,184,105,211, 70, 34,145, 72,176,118,237, 90,220,188,121, 19, 0,208,170, 85, 43, 76,156, 56, 17, 28,199, 97,
+236,216,113,244,175, 68,155,202,137, 70,171, 43, 75,190,190,190, 17, 60,207, 47, 37,132, 72, 40,165,109,115,114,114,228, 62, 62,
+ 62, 57, 57, 57, 57,126,245,233,115,197,202, 39,211,100,154,255, 28,205, 23,141, 58,215, 34,252, 98, 37, 28, 31, 95,142,227,205,
+156, 61,191,127, 41,234,211,183, 95,232,220, 79,230, 8, 90,181,106, 5, 63, 63, 63,180,106,213, 10, 55,111,222,148, 53,107,214,
+172,174,245,206,202,122, 15,157,148,210,187,119,111,167,183,223,126,219,177,107,215,174, 98,111,239,135,235,234,198,197,197,225,
+208,161, 67,166, 45, 91,182,168,179,165, 81,202, 11,135,126, 47,179,102,189,179, 67,165,165,229, 0, 62,111,110, 52,254,246,217,
+220,185,243,195, 35, 35, 39,189,255,254,251, 2, 59, 91,133,248,203,185,111,200, 1,224,139,159,182, 59, 14,121,249, 85,172,104,
+ 2,116, 29, 83,253, 58,111, 85,211,153,149, 91,144, 62,102,226,203, 77,222,126, 99,140,101,208,160, 65,182,118,118,118,240,243,
+243,131,179,179, 51, 82, 83, 83, 17, 19, 19, 67,143, 29, 59, 86,118, 35, 46, 85,188,110,251,209,116,169,157,187, 53,235, 6,106,
+122, 15,153,144, 58, 97,194, 4,231, 97,195,134,217,135,135,135,139,197, 98, 49,228,114, 57,138,139,139,145,153,153,105, 58,125,
+250,116, 89,182,164, 99,233,133,195,235, 52, 86,174, 69,168,235, 50,122,225,131,115,199, 22,204,136,139,137, 25,199, 3, 45, 76,
+ 38,147,143,197, 98, 33, 2,129, 32,151,231,249, 24,147, 70,243,135,161,213,130,229,108, 45, 66,235,176, 88, 44, 18,139,197, 2,
+165, 82,137, 99,199,142,137,146,146,146, 62,189,125,251,246,167, 57, 57, 57, 48,155,205, 24, 49, 98, 4, 90,181,106,133, 83,167,
+ 78,161, 48, 63,255,207,218,180, 18, 1,149, 44, 43,107,226,155,111,190,121,104,227,198,141,130,219,183,111,187,174, 93,187,246,
+247,234,140,203,184,113,227,248,252,140,140,137,134, 90,230,192,170,227,222, 44, 58,188,237,199,219, 67,135,191, 28,182, 96,222,
+167,226,151, 94,122, 9,174,174,174,136,138,138,130,201,100,114,178,226,222,212,116,233, 59, 42,185, 69,139, 22,182,203,151, 47,
+247,124,253,245,215, 49,125,250,116, 0,128, 78,167,195,209,163, 71, 49, 99,198,140,188, 12, 81,123,237,141, 83,219,106, 45,159,
+143, 34, 83,189, 0,192,199,199,231, 12,128, 46, 0,146, 89,135,118, 6,131,241,143, 54, 88,192,191,214, 59, 59,119, 37, 22, 85,
+151,227,120,136, 91, 60,231, 58, 34,105,234,236, 37,145, 82,104,157,197,196,224,112,235,230, 77,146,146,146, 82,235,193, 42,214,
+ 59, 51,200,252,202, 20, 57, 69,237,126, 88,177,226,189, 53,107,214,244,172,152,138, 65, 46,151,199,232,180,218, 19,246, 42,213,
+247,134,198,126, 39,234,187,118,222,157,146,146,124, 0,211, 66, 45,150, 31, 94,155, 52,229, 27,129,157,175,248,147, 47,215,232,
+133, 2,129,241, 65, 78, 33, 86, 52, 1,108,173, 24,240, 88,110, 4, 98,138,221,185,120,116, 75, 92,178,112,225,172, 21,223,125,
+215, 78, 97,103,215,213,204,113,193, 60,207,131, 90, 44,247,117, 58,221, 25,152, 76, 87,179,188, 39,127, 39,181,115,167,214,174,
+ 27,104,144, 55,210,120,104,207,180,219,181, 99,199,187,135, 14, 29,250,183,188,123,241,252, 15,201, 14,141,142, 91,147,247,170,
+251,232,129,139, 40, 40,184, 88,227,219, 6,216, 90,132, 86,223, 20, 60, 63,217,217,217,121, 67,207,158, 61,229,209,209,209, 24,
+ 48, 96, 0, 94,122,233, 37,240, 60, 15, 74, 41, 52, 26, 13,182,111,223,142,111,190,249,230,126, 35,224,243,186,244, 12,192, 9,
+217,193,131,253, 90,180,104,177,182, 54,227,242,200, 92,213,217,231,176,246,123, 83,118,159,115, 28,156, 54,250,237,175,154, 24,
+213,185, 78, 46, 10,206, 51, 46, 54, 70, 96,237,189, 9,199, 16,141,229,230,246,246, 35,134, 13,123, 91, 40, 18, 69, 61, 26,209,
+ 72,239,198,199,223,168, 88,236, 25,173, 38, 30,171, 79, 89,162,244,225,220,115,172, 67, 59,131,193,248,199, 27, 44,145, 72, 84,
+ 80, 17,229, 17,137, 68, 5,201,123,167,188, 90,155,136,159,151, 87,207, 71,111,199,168,107, 45,194,138,207,183, 85, 42,205,163,
+ 25,218,171,157, 68, 84,252,196,254,245,201, 84, 66, 65, 65, 34,128,129, 64, 58,144,248,176, 59,139,184,221, 23, 31, 85,205, 83,
+141, 39,228,177,227, 74, 74,210,242,243,207,225, 97,115, 78,181,157,113,197,254,146,146,186,210,249,100,222,207,103,102,170, 31,
+229,187,250,188,123,214,157,119, 81, 61,207,143,232, 25,206,231, 63,141,236,162,162,189, 0,236,124, 15, 28,240, 56,124,224,192,
+ 43,179,102,206, 28,225,229,237, 29,228,234,234,234,108,111,111, 47,184,124,249,114, 10,167,215,255,208, 18, 88,119, 5, 40,183,
+ 70,211, 0,156, 8,201,200, 8, 31, 57,108,216,219, 68, 36,234, 92,213,184, 80,142,187, 16, 8,252,108,176, 98,246,246,122,223,
+155,178,250,223,155, 89, 15,211,241, 37, 56,238, 75,220,185,243,204,247, 38,207,243, 95,248,248,248,104, 88,135,118, 6,131,241,
+143,226,239, 92,135, 7, 64, 52,211,100,154, 47,138,230, 67,143, 2, 7,118, 62,153, 38,211,100,154, 76,243,249,107,254,163,215,
+ 34,100, 48,254,225, 47, 35, 22, 0,106,118, 38, 24, 12, 6,131, 81, 23, 4, 64,116, 13,149,137,213,163, 3, 8, 33,209, 79, 81,
+ 89, 29,103,154, 76,147,105, 50, 77,166,201, 52,153,230, 63, 75,179, 46,237, 23,102,116, 34,107, 34,100,154, 76,147,105, 50, 77,
+166,201, 52,153, 38,107, 34,124,190,155, 0, 12, 6,131,193,192,194,133, 68, 0, 16, 2, 44, 20, 0, 59,133,192, 72,225,195,223,
+159,158,145, 35, 73,181,147,208,190,251, 46,177,103,103,156,193,120,177, 97,125,176,254,131,120,121,121,249,123,120,120,252, 74,
+ 41, 37, 5, 5, 5,147,115,115,115, 51,216, 89,249,239,195,197,197,165, 39,199,113, 80,169, 84, 39, 94,196,252,133, 55, 33,195,
+168, 0,205,254, 21,214, 70, 70,252,125,186,161,186,125,195,130,201,120,144,127,205,165, 69,120,220,141,123, 64,247, 88,123, 44,
+ 66,136, 96,104, 63,183,165, 0,176,247, 80,225,236,191, 99, 94, 44,111,111,239,166, 46, 46, 46, 71,132, 66,161,200, 98,177, 76,
+139,137,137, 57, 80,179, 1, 26, 41, 4, 0, 55,155,221,115,156, 26,184,126,252,217, 44, 34, 54, 26,190, 85, 26,244,122,149, 64,
+ 36, 74,149, 74, 20,231, 57,129,237,161,172,252,126,241,213,125,127,199,142, 29, 53,174,174, 29, 17, 76,250,133,134,133, 13,106,
+ 29,105,147,188,244,251,118, 43,186, 6,186,138, 83, 50,111,217,173,220,144,241,171,155,179,207,160,247,222, 16, 29,144, 81,203,
+184, 37,191,211, 50,118,151, 89,207,215,132, 52, 48, 1,145, 98,153,204,207,194,113, 30, 4,160, 66,145, 40,223,108, 48,100, 74,
+128, 59, 31, 83,170,124,209, 53, 37, 50,153,175,133,227, 60, 0,224,191, 49,157,140, 58, 12, 86, 80, 80,208,117,129, 64,224, 91,
+177,198, 95,213,197,106, 43, 62, 63,249,211, 98,177,100, 37, 36, 36,180,177,246,224,141, 27, 55,118,208,235,245,175, 16, 66, 94,
+ 5, 0, 74,233,102,185, 92,190, 61, 37, 37,229,169, 58, 18, 55,110,220,216,129, 82, 58,219,198,198,166,135, 94,175, 15, 7, 0,
+185, 92, 30,167,211,233, 78, 18, 66,150, 62,141, 46, 33, 68,228,229,229, 53,210,214,214,182, 59,199,113,221, 41,165, 68, 36, 18,
+157, 42, 47, 47, 63,153,155,155,187,131, 82,202,213, 87,211,219,219,219,198,197,197,229,203, 38, 77,154,140,121,251,237,183,139,
+ 27, 52,104, 16,178,112,225,194,107, 17, 17, 17, 91, 74, 74, 74,230,230,228,228,232,254, 27, 10, 7, 33, 36,200,211,211,115,179,
+ 88, 44, 22,102,102,102,118, 7, 0, 63, 63,191, 83, 70,163,209, 82, 80, 80,240, 42,165, 52,169, 62,122,110,110,110,182, 98,177,
+184,131,173,173,109, 27, 91, 91,219, 46, 22,139,165,217,163,245, 19,239,106,181,218,179,102,179,249,186,217,108,190, 92, 88, 88,
+168,253,111,185, 65, 8, 33,246,238,238,238, 27, 9, 33, 32,132, 4, 83, 74, 53, 47,218, 67,128, 10,208, 44, 62, 46, 33,164,210,
+ 68,133,135,214,114, 66,224, 95,205,190, 86, 27,172,254, 61,157,250, 14, 26,212, 66, 0, 0, 38,211,181,190, 0, 14, 62,111,115,
+213,191,127,255,139, 63,252,240,131,179, 94,175,199, 7, 31,124,176, 57, 56, 56,248,231,251,247,239,207,169,237,123,246,246,246,
+ 51, 62, 95,244,147,226,209,179,204,157,231,121,247,220,220,204,224,196,132,152,190,137,137,177, 95,153,180,123, 46,155,168,112,
+138,178,124,112,130, 53,233, 8, 11, 34, 3,135,140, 28, 54,224,243,207, 23, 96,204,168, 49, 13,227,226,244, 54, 62, 14,201, 82,
+181,201,182,137,171,171,239,224,143, 62, 89, 66, 46, 95, 58, 61,120,199,246, 53, 39, 63,154, 68,122, 48,147,101,213,189, 72,190,
+ 16,137, 58, 56,135,134,118, 25,181,119, 47,236,252,252, 68, 34,153, 76, 0, 0,156,193,224, 87,150,153,233,181,109,240,224,246,
+ 11, 9, 57, 61,159,210, 43, 76,243,255, 95,147, 97,165,193, 18, 8, 4,190, 55,111,222,116,183,181,181,197, 35,243, 3,139,197,
+ 2,139,197, 82,185,168, 48,165,180,242, 39,199,113,232,214,173,155, 85,111,176, 94, 94, 94, 61, 0,188, 22, 17, 17, 49, 98,246,
+236,217,146, 78,157, 58,193, 98,177,224,228,201,147, 81, 43, 86,172,248,209,219,219,123, 55,128,117,185,185,185, 39,172,125,195,
+245,242,242,234, 99,107,107,187,233,211, 79, 63,117,136,138,138, 18,121,121,121, 1, 0, 10, 10, 10, 58,156, 63,127,190,205,130,
+ 5, 11,166,121,121,121,141,205,205,205, 61, 98,237,201,241,245,245,141, 8, 14, 14,222,217,175, 95, 63,223, 54,109,218,200,155,
+ 54,109, 10, 74, 41,110,221,186,245,122, 98, 98,226,232,131, 7, 15,206,247,245,245,125,217,218,245,212, 8, 33, 36, 40, 40,104,
+130,167,167,231,151, 51,103,206,108, 48,116,232, 80,105,108,108,108,105, 96, 96, 32,217,189,123,183,219,159,127,254, 57,237,151,
+ 95,126, 25,217,164, 73,147,185, 73, 73, 73,235,105,117,235, 24, 61, 65,112,112,240,117,129, 64,224,107,141, 1, 38,132,128,227,
+ 56,171, 76, 48, 33,164,101,163, 70,141,182,159, 59,119,174, 81, 90, 90,154,101,232,208,161, 27, 0,224,228,201,147,145,102,179,
+153,244,238,221,251, 16, 33,228, 21, 74,233, 45,107,242,238,227,227,211,220,205,205,109,223,208,161, 67, 27,248,251,251, 43,124,
+125,125,137, 92, 46,135, 80, 40, 68, 89, 89,153,119, 98, 98, 98,244,173, 91,183,116, 23, 46, 92, 40,241,241,241, 25,156,157,157,
+125,167, 30, 15,222,151,220,221,221,199,137,197,226, 8,142,227,124, 0, 64, 36, 18,101,155,205,230,216,130,130,130,141,148,210,
+139, 79,123,131,120,120,120,252,248,229,151, 95,186, 22, 20, 20,208,197,139, 23,255, 8, 96,194,139,250, 48,216,188,101, 7,174,
+ 95,187, 2, 0, 18, 66, 8,121,178,252, 17, 66, 72,179, 96, 72,222,127,127, 38,218,180,109,143, 87,199,140,172, 83,115,232, 0,
+215,207,165, 66,145, 75,185,209,112,165, 72, 37,216,231,239, 46, 29, 54,118,100,155,100, 0, 56,124, 40,102, 88,251,246, 13,206,
+187, 58,242, 67, 20, 82, 89,123,163,133, 43,222,251, 87,209,188,250,152, 41, 79, 79,207, 35,246,246,246,138,210,210,210,188,226,
+226,226,149,253,251,247,255, 98,249,242,229,206,201,201,201,200,204,204,196,107,175,189,102,151,157,157,253,182,191,191,255,165,
+140,140,140, 26, 35, 89, 26,141,230,251, 47, 23,205,156,103,239,224, 44, 84,216,216,194,206,222, 1,141, 26, 5,163,109,187, 40,
+ 68,247, 26,140,228,228,196, 14,219,183,174,185, 41,204,221,249,181, 69,218,234, 11,165,178, 81,141,207,165,240, 16,210,181,194,
+ 92,205,155,183, 0,247, 18, 18, 52,105,169,130,119,254,218, 43, 82,244,235, 25, 42, 51,154,202,210, 46, 95, 58,221,168, 67,199,
+110, 0,208,102,199,246, 53, 39, 23,142, 37, 61,231,111,122,241,204,251,243, 52, 87,159,139,197, 19,250, 44, 95,238,222,106,218,
+ 52, 73, 89,106,170, 41,121,213,170,242,252,179,103, 45, 34,153,140,250,245,237, 75,220,186,119,151, 79,187,123, 87,114, 97,241,
+226, 46, 95, 73,165,129,159, 24,141,155,152,230,255,159, 38,163,126, 6, 11,182,182,182,216,182,109, 27,196, 98, 49, 68, 34, 17,
+196, 98,113,141,159,253,253,253,173, 49, 65,195,195,195,195,127,154, 57,115,166,199,160, 65,131,224,236,252,248, 42, 27, 3, 7,
+ 14, 68,255,254,253, 37, 41, 41, 41,163,119,236,216, 49,122,195,134, 13,121, 94, 94, 94,239,228, 62, 90,176,185,150,202,187,123,
+ 96, 96,224,238, 45, 91,182,216,232,116, 58,156, 62,125, 26,165,165,165,144, 74,165,240,245,245, 69,231,206,157, 69,167, 79,159,
+110, 48,122,244,232,221, 62, 62, 62, 3,179,179,179, 79,213,149, 86, 79, 79,207, 54,110,110,110,103,126,251,237, 55,121,104,104,
+ 40,121,240,224, 1, 90,180,104, 1, 0, 40, 46, 46,198,192,129, 3,229,195,134, 13, 11,122,235,173,183, 46,123,122,122,118,205,
+203,203,187, 94, 71,222, 91,183,104,209, 98,125,223,190,125,189, 63,254,248, 99, 7, 59, 59, 59,164,165,165,229,122,122,122, 6,
+ 87,152,159, 33, 67,134, 72,123,245,234,229,181,114,229,202,239, 15, 30, 60,248,129,151,151,215,132,220,220,220, 27,181,233, 10,
+ 4, 2,223, 27, 55,110,184, 43, 20, 10,228,231,231, 99,243,230,205,120,251,237,183, 33, 20, 10, 81, 80, 80,128,237,219,183,227,
+157,119,222,129, 80, 40,132, 74,165,178,202, 4,219,218,218, 70,183,104,209,226,247,147, 39, 79,250, 58, 57, 57,193,219,219, 91,
+240,217,103,159, 69, 4, 6, 6,218, 52,108,216, 80,152,155,155,139,221,187,119, 7,142, 27, 55,110,159, 92, 46,127, 93,175,215,
+215,217,116,230,226,226,242,199,250,245,235,253,111,223,190,141, 85,171, 86,161,164,164, 4, 82,169, 20, 78, 78, 78,240,244,244,
+ 68,112,112, 48,153, 54,109,154,162, 71,143, 30,138, 5, 11, 22,252, 1,160,165, 21, 15,221, 22,238,238,238,191,142, 30, 61, 58,
+112,225,194,133, 78,158,158,158,168,120, 33, 80,169, 84,190,105,105,105, 29,230,205,155,247,178,135,135, 71, 74, 65, 65,193, 20,
+ 74,233,237,122, 62,212, 91,246,236,217,115,224,208,161, 67,133,185,185,185,216,184,113,227, 64, 66, 72, 75,107, 77,229,255, 26,
+215,175, 93,193,228,183,222, 43,243,246,243,147,252,185,127,235,144,178,178,223,206,219, 9,156, 68, 0, 80,198, 43,185, 78, 29,
+236, 58, 15, 26, 60, 90,210,127,192,208,178,223,126,249,222,206, 26,131, 37, 21,138, 92,182,109,154,154,121,246,194,253,102, 71,
+142,167, 69, 15, 29, 28, 45, 16, 73, 66,130, 0, 96,214,204, 55,165,123,247, 31,255,185, 79,116,195,220, 46,157,130, 51, 71,141,
+ 93,229, 87, 31,115, 21, 24, 24,120,250,200,145, 35, 30, 82,169, 20,165,165,165, 46,107,215,174, 93,214,190,125,123, 65, 82, 82,
+ 18, 18, 18, 18,144,154,154, 10,149, 74,133,118,237,218,217,197,199,199,175, 4, 80,163,193, 42,212, 13,255, 50,208,189,232, 7,
+ 31, 23,231, 70,122,147,202,221,194, 21,135,157, 60,126,187,249,174, 29,229,173,220, 61,125,131, 71,143,158,140,143,230, 44, 17,
+239,217,181,126,222,153,179, 71, 1, 52,170,121, 6,127,138,151, 62,153, 59, 7,106,141, 1, 99,199,188,137,113, 99,222,116,161,
+ 48,122, 81,139,222,214,168, 43,117,114,148,196, 29, 88,191,117,199, 48, 0,190, 85, 76,214, 9,102,178,106,230,115,145,168,253,
+192,159,126,114,139,120,227, 13,217,237,133, 11,181, 69,103,207,234,154,244,239, 95,218,106,234, 84, 3, 0,104, 82, 83, 37,247,
+230,207, 87,184,117,233, 98,211,113,246,108,103,139,209,232,185,136,144,118,159, 81,122,181,190,154,141,198,140,177, 44,221,189,
+187,237,229,197,139,187, 97,209, 34, 97,247, 86,173,110,205,253,229,151,236,103,209,124,158,233,204, 57,115,198,160,109,214, 12,
+145, 35, 70, 20,251,184,184, 24,158,103,222,159, 37,157,140,106,234,144,154,130, 36, 33, 33, 33,249,137,137,137,238,187,119,239,
+174,211, 92,137,197, 98,120,121,121, 33, 42, 42,170, 32, 38, 38,198,163,150,135, 98,102,102,102,166, 47,199,113,144, 74,165,181,
+ 38, 76,163,209, 32, 38, 38, 6,163, 70,141,202,202,201,201,169,241,193,219,160, 65, 3,123,103,103,231,228, 83,167, 78,185,198,
+197,197,225,250,245,235, 8, 12, 12,132,179,179, 51,196, 98, 49,204,102, 51,212,106, 53, 66, 66, 66, 96, 99, 99,131,254,253,251,
+ 23,149,148,148, 4,150,148,148,212,248, 32,107,216,176,161, 76, 44, 22,223,223,181,107,151, 95, 68, 68, 4,174, 94,189, 10, 63,
+ 63, 63,120,122,122, 2, 0, 82, 83, 83,113,254,252,121,244,239,223, 31,177,177,177,152, 58,117,106,166,217,108, 14, 78, 75, 75,
+ 51,212,216,100, 16, 22,150,187, 99,199,142,172,208,208, 80,189, 86,171, 21,228,231,231,139,207,158, 61,203,105, 52, 26, 59,149,
+ 74, 37, 86, 42,149, 98,181, 90, 45,210,106,181, 98,129, 64, 32, 49, 24, 12,226,203,151, 47, 11,139,139,139, 29,106, 59, 79,161,
+161,161,249, 9, 9, 9,238,251,247,239, 71,100,100, 36,118,239,222,141, 89,179,102,225,194,133, 11,240,243,243,195,142, 29, 59,
+ 48,123,246,108, 36, 38, 38,194,213,213, 21, 61,122,244,168,245, 26, 1, 64,147, 38, 77, 30,196,196,196, 4, 73, 36, 18, 36, 39,
+ 39, 35, 43, 43,171, 98, 61, 59, 20, 22, 22, 34, 41, 41, 9,217,217,217,104,210,164, 9,198,140, 25,147,148,149,149,213,164,174,
+130,214,186,117,235,194, 19, 39, 78,184, 54,111,222, 28,249,249,249,112,114,114,130,163,163, 35,156,156,156, 42, 63, 7, 6, 6,
+ 98,230,204,153,104,222,188,121, 65, 90, 90,154, 71, 93,230, 39, 50, 50,242,200,137, 19, 39, 92, 29, 28, 28,144,151,151, 7,181,
+ 90, 13,145, 72, 4,133, 66, 1, 87, 87, 87,200,229,114, 0,192,253,251,247, 49, 96,192,128,162,228,228,228, 62,214,154, 35, 66,
+136,192,195,195, 35,225,206,157, 59,193,148, 82,100,100,100, 32, 49, 49, 17,111,189,245,214,125,189, 94, 31,250, 34,173,169, 87,
+165, 95,149,100,194,196,201,146,161,131,135,148,223,186,126,152,183,193, 25,180,107,105,163, 4,128,171,183,116, 78, 58,116, 69,
+203, 54,125, 5,123,247,239, 83,172, 95,247,155, 24, 60, 60, 64,144, 24,127,143, 46,170, 73,123, 96, 31,167,241,179,223,235,219,
+172, 75,167, 46, 34,181,154,122,254,190, 97,117,187,244,148,100, 15, 0, 8,104, 28,152, 63,105,252,155, 87, 29, 28, 72,222,217,
+ 11,103,185,165,223, 31,190,123,224,136,114,131, 21,145,229, 64,127,127,255, 75,127,252,241,135,171,155,155, 27, 28, 29, 29,161,
+213,106, 97, 50,153, 16, 31, 31,175,223,182,109,155,217,193,193,193, 62, 47, 47, 15, 74,165, 18, 34,145, 8,151, 46, 93,202,200,
+203,203, 11,120, 82,171,162, 15, 22, 0,188,213,175,153, 56,172, 71,176,179, 68,198,217,216,136,239,121,129, 88,100,132,218,121,
+156, 60,121,169,249,169, 51,231, 94,237, 63,112,148, 91,199,142,221,177,228,171,143,204, 25,121,249,173,148,229,131, 19,170,235,
+131,213, 44,152,244, 24, 58, 98,216,200,207, 63, 95,128, 5,243, 22,226,192,254,189, 42, 59, 91,129,193,193, 73,236,216,165, 67,
+ 39,253,204,183,135,100,150,151,101,249, 45,251,121,245,152, 94,125, 70,250,118,232,216, 13,151, 47,157,198,142,237,107,174, 75,
+ 44,102,214, 92,248, 4, 11, 9,113,118, 10, 12,156,242,238,253,251,146,219, 11, 22,148,113, 57, 57,165,109,102,204, 40,170,110,
+223,172, 99,199,108,165,222,222, 14,206,131, 7, 55,248, 62, 32,128,154, 11, 10,126,173,174, 15, 81,117,154, 87,189,188,156,246,
+156, 58,213,147, 23,137,186,190, 61,125,186, 77,116,116, 52,212,106, 53, 14, 28, 56,128, 45,155, 55, 27, 60, 61, 60, 98,156,174,
+ 93,187, 25,152,155,251,169,181,154,109,102,204, 40,178, 88, 44,100,234, 87, 95,245,186,151,153,217,163,160,184,184, 33, 0,184,
+ 59, 58,102, 70,248,250, 94, 95,190,105, 83,226,143,141, 26,241,214,166,115,219,133, 11, 30,135, 10, 11,223,112,114,114,178, 41,
+ 44, 42, 18,201,164,210,226, 86, 77,154,236,248,122,250,244,211,198,155, 55, 37,114, 95, 95, 7,199,129, 3,235,157,247, 54, 51,
+102, 20,169,202,203, 69,115,127,248,161, 83, 78,113,113, 67,173,209,216, 68, 85, 86,230,201,153, 76, 2,123, 27,155,226,128, 38,
+ 77, 10, 52, 39, 78,228, 6,148,149,189,183, 66,171, 45, 96,165,242, 25, 35, 88,132, 16, 80, 74,173,138, 94,137,197,226,199,250,
+104,213,130, 68, 40, 20,226,234,213,171, 40, 40, 40, 64,100,100, 36, 26, 53,106,244,216, 14,201,201,201, 56,120,240, 32,148, 74,
+ 37, 90,183,110, 13, 0,146,218, 4,237,237,237,223,159, 51,103,142,147,193, 96,192,245,235,215,209,166, 77, 27,200,100, 50, 72,
+ 36,146,199,204, 95, 65, 65, 1,194,195,195, 49,117,234, 84,199, 31,127,252,241,125,212,178,134, 28,165,116,250,232,209,163,221,
+ 35, 34, 34, 0, 0,153,153,153, 21,105, 1, 0,184,185,185,225,214,173, 91,104,211,166, 13, 60, 60, 60,208,175, 95, 63,247,125,
+251,246, 77, 7,176,180,198,140, 75, 36,130,208,208,208,182,143, 34, 68, 16, 8, 4,247, 28, 28, 28,220, 60, 60, 60,108, 29, 28,
+ 28,254, 45,143,107,215,174, 85, 74,165, 82,179, 53, 39, 53, 47, 47, 15, 17, 17, 17, 80,169, 84, 0, 0,173, 86,139, 38, 77,154,
+ 64,173,126,216,229,204, 96, 48,192,219,219, 27, 58, 93,237, 93,187, 90,180,104,177, 32, 52, 52,180,119,183,110,221,100, 98,177,
+ 24,183,111,223, 70,171, 86,173,176,109,219, 54,248,251,251, 67,161, 80,224,254,253,251,136,140,140,196,153, 51,103,224,230,230,
+134,240,240,112, 89,235,214,173,207,149,148,148,156, 74, 75, 75, 91, 80, 75,164, 77, 96,103,103,135, 51,103,206,224,143, 63,254,
+ 64,106,106, 42,114,114,114, 96,111,111,143,150, 45, 91, 34, 44, 44, 12, 47,189,244, 18,238,223,191, 15, 82, 71, 97, 34,132,120,
+ 6, 7, 7, 31,184,122,245,170, 43,165, 20, 27, 55,110, 68, 89, 89, 25,140, 70, 35, 4, 2, 1,228,114, 57,156,157,157,209,163,
+ 71, 15,184,185,185, 33, 56, 56, 24,219,183,111,119,237,215,175,223,193, 71, 17,168,188,186,206,169,179,179,243,123,243,231,207,
+247,115,119,119, 71, 90, 90, 26, 84, 42, 21, 60, 60, 60,208,173, 91, 55,159,227,199,143,191, 7, 96,249,139,242, 16,168,232,208,
+ 78, 8, 33,127,238,223, 58,196,223, 75,218,172, 93, 43, 77, 64,204, 13, 81,208,193,227, 15,154, 63, 60, 31, 1,119,218,181,214,
+ 36, 93,189,126, 56,253,207,253, 91,175,220,189,135,125,214, 52, 97, 23,169, 4,251,142, 28, 79,139,110, 30, 30, 37,252,225,231,
+249, 67, 38, 79,234, 35,107,224, 28, 69,212, 5,219,113,225, 74, 76,192,103, 11, 62,118, 95,180, 96,241,159, 71,142,167, 89,138,
+ 84,130, 47,173, 73,111, 80, 96,131, 31,119,173, 22,185,106,140, 63,227,214, 21, 71, 64,220, 17,141, 3,155, 66,173, 86, 67, 46,
+151,203,199,140, 25, 99,153, 51,103, 78,185,131,131,131, 66, 36, 18,225,214,173, 91, 5, 2,129,160, 79, 93,186,122,119,103,106,
+ 49,153, 57, 42, 21,242,148,216,235,136,165, 68, 26, 27,159,130,174, 93,251,229,183,109,211,234,171,197,223, 46,255, 36, 48, 48,
+196,109,204,216, 41,226,165, 75, 63, 93, 5, 32,170, 58,157,187,247,233,201,176, 32, 98, 3, 96,192,231,139, 22, 32, 57,249,190,
+243,228,215,148, 11, 69, 50, 27,239,208,128, 78,246,171,254, 56,213,183, 73,147, 70, 13, 39, 79,124,253,175,223,214,254, 49,160,
+106, 36,107,235,150,223,246, 17, 66,122, 90,115,110,255, 65, 52, 31,119,224, 0,202, 50, 50,204, 37,231,206,233,123,254,244, 83,
+ 81,235,241,227,151,155, 57,206,181,162,174,170,248, 73, 8, 1,120,158,136,150, 46, 21, 80,111,111,152,157,156, 94,251, 24,104,
+ 90,151,230, 98,179,121,248,208,150, 45, 7,252,190,105, 19, 2, 2, 2, 42, 53, 29, 29, 29, 49,125,250,116, 76,155, 54, 77,118,
+231,206,157,118, 7, 15, 30,108,183,225,231,159, 61, 62, 6,134, 91,147,206,179,183,111, 59,127,248,253,247,115,155, 69, 68,248,
+175,248,233, 39, 89, 69,125,151,150,150, 22,252,211,143, 63, 6,244,136,142,206,255,232,195, 15,215,221,156, 53, 43, 28, 15,151,
+100,171, 81, 51,239,236, 89,227,161,146,146, 55,118,236,220,233, 20, 18,242,176, 27,100, 82, 82,146,251,239,191,255,254,102,143,
+183,223, 30, 59,107,244,232, 79,123, 60,120,160,116, 40, 44,148, 13,252,241, 71,209,214,145, 35,235,212,172, 72, 39, 0,140,152,
+ 61,251,253,246,157, 58,133,245, 27, 51,166,129,183,183, 55,177,177,177,129,201,100, 66,126,126,190,115, 98, 98, 98,208,113,165,
+ 82,125,244,214,173,141,120,180,136, 59,227, 25, 12, 22, 0, 88, 44, 22,171,204,149, 72, 36,250, 87,225,182,230,160, 34, 17,188,
+189,189, 81, 84, 84,132,216,216, 88, 4, 4, 4,192,108, 54,227,200,145, 35, 80,169, 84, 16,139,197,144, 72, 36, 48,153,234, 94,
+ 27,214,214,214, 54,186, 75,151, 46,162,139, 23, 47, 34, 48, 48, 16, 54, 54, 54,149,233,170,216, 36, 18, 9,188,188,188,160, 86,
+171, 17, 21, 21, 37, 94,187,118,109,116,109, 6,203,206,206,174,255,144, 33, 67, 42, 67,108,101,101,101, 16, 10,133,149,102,165,
+172,172, 12, 37, 37, 37, 80, 42,149,208,235,245,104,222,188,185,244,228,201,147,253,107, 51, 88, 85, 41, 47, 47, 47, 43, 40, 40,
+112,138,138,138,114, 94,183,110, 93, 98,199,142, 29, 67,170,254,255,244,233,211,122,189, 94, 47,150, 74,165,117,174,115, 71, 8,
+193,166, 77,155, 42,207,125,118,118, 54, 86,173, 90, 85,249,255,251,247,239,227,135, 31,126,168,156,151,163,182,107, 20, 26, 26,
+218,111,227,198,141,109, 54,108,216, 80, 42, 20, 10,145,152,152,136,205,155, 55,131, 82, 10, 55, 55, 55,148,151,151, 35, 63, 63,
+ 31,167, 78,157, 2,199,113,176,179,179,131,143,143,143,124,250,244,233,157, 23, 46, 92, 40, 6,176,160,150,178,100, 17, 10,133,
+ 8, 8, 8,192,188,121,243,160,215,235, 33,145, 60,244,149,106,181, 26, 74,165, 18, 55,111,222, 68, 90, 90, 26,234,170, 92,228,
+114,249,203, 27, 54,108,112,151, 74,165,208,233,116,208,104, 52,200,204,204, 68,122,122,186,190,160,160,128,179,183,183, 23, 4,
+ 4, 4, 8,100, 50,153,108,232,208,161,164,194,104, 14, 28, 56,208,101,227,198,141,163,234, 50, 71,132, 16,183,102,205,154,125,
+242,230,155,111,202,171,152,110,228,229,229, 97,248,240,225,138,139, 23, 47,206, 33,132,108,166,148, 22,190, 72, 15, 3, 74, 41,
+ 45, 43,251,237,252,217,125, 63, 53,139,185, 33, 10, 50, 26, 75, 59,246,234,255,158, 8, 0, 46,158, 89,219, 49,230, 70, 44,108,
+ 8,151,126,232,232,210,243,118,118,147,105, 93, 17,192,254, 61,157,250,250,187, 75,135, 13, 29, 28, 45,248,125,195,234,118,147,
+ 39,245,145,185, 55, 94, 77, 0,192, 89,226,139,151, 44,179, 4,122,131, 86,254,251,134,213,237,134, 14,238,127, 37, 53, 37,125,
+249,128,104,231, 61, 7, 79, 40, 15,215, 22, 33,244,114, 23,249, 56,219, 23,193,217,190, 21, 2, 2,237,113,243,214, 29,236,219,
+125, 14,193,161,157, 97, 48, 24,192,113,156,237,160, 65,131,202,119,236,216,161, 47, 46, 46,214,152, 76,166,174, 57, 57, 57,247,
+234,202,127, 86, 86, 60, 31,226,217,193, 36,177,145,113, 26,149,164,252,227, 79,119,142,108,221,190,119, 27,103, 47, 31,177,155,
+ 45,255,103,247,174, 81,155,183,108,250,117,198,172, 15, 22,161,101,203,142, 29,239, 62, 56, 20, 6, 32,166, 90,211,154, 68, 15,
+ 68, 4, 19, 46,249,193,131, 1,233,105,105, 89, 77, 61, 60,141, 73, 74,106,126,239,227,213,189,162,186,190,220, 60,168, 89, 23,
+105, 92,252, 25, 50,243,237, 55,183, 44,251,121,245,152, 10,147,117,246,236,145,174, 11, 22,164, 73, 1, 24, 88,245,244,232,229,
+ 84, 38,243,181, 11, 8, 16,165,174, 91,167, 11, 28, 52,168, 20, 0,204, 28,231,122,233,242,101, 71,133, 66, 1, 74, 41,204,102,
+243, 99,125,132, 43,250, 5, 71,119,235,230, 97,141,102,230, 47,191, 52,127,251,237,183,145,151,151, 7,142,227, 32, 22,139,159,
+124,102, 67,163,209, 96,196,136, 17, 88,187,114,101, 7,107, 52, 45, 22, 11,249,240,251,239,231, 78,127,239,189,160,177, 99,199,
+ 10,170, 62,123,157,156,156,240,219,234,213,210,117,235,214,249, 46,249,227,143,215,122,201,100,201,117,105,106,194,195,225, 20,
+ 19, 99, 83, 97,174, 0, 32, 40, 40, 8,139, 23, 47,150,141, 30, 61, 90, 58, 97,194,132,239,226, 66, 66,190, 95,144,158,254,192,
+165,105, 83, 7,169, 76,230,107,237,249, 4,128, 50,163, 49, 98,254,231,159, 59, 95,185,114, 5, 57, 57, 57, 21,115, 93,129, 16,
+130,200,200, 72, 50,114,228, 72,199, 14,109,218,180, 99, 37,242, 57, 69,176, 44, 22,203, 99, 70,165, 46,131, 85,239,246, 73, 66,
+224,229,229, 5,147,201,132, 53,107,214, 64, 34,145, 84, 86,186, 0, 96, 52, 26,235,212,208,235,245,145,158,158,158, 80,169, 84,
+104,218,180,233, 99,145, 43,137, 68, 2,145, 72, 4,137, 68, 2,153, 76, 6,131,193, 0, 31, 31, 31,232,245,250,200, 58, 12, 80,
+ 75, 7, 7,135,202,138,213, 96, 48, 84,154, 43,165, 82, 9,165, 82, 9,163,209,136,210,210, 82,148,149,149, 65,169, 84, 66,163,
+209,180,178, 38,207, 60,207, 35, 54, 54, 54, 41, 36, 36,164,165, 80, 40,132,157,157,157,173, 86,171,173,236, 59, 84, 82, 82,130,
+245,235,215,107,199,143, 31,239,122,229,202, 21,171, 22, 18,126,231,157,119, 32,147,201, 80, 94, 94,142,149, 43, 87,226,221,119,
+223,133, 68, 34,129, 70,163,193,170, 85,171, 48,115,230, 76,136, 68, 34, 24,141, 70,108,219,182,173,230, 72, 70,124,124,234,229,
+203,151, 91,181,110,221,218,121,207,158, 61,133,189,122,245,114,235,211,167, 15,108,108,108,160,211,233, 96, 54,155,209,161, 67,
+ 7,132,134,134,162,160,160, 0,135, 14, 29, 42, 10, 14, 14,118,189,114,229, 10,159,151,151,151, 94, 87,229, 93,213, 96, 91, 44,
+ 22,228,231,231, 67,169, 84,162,176,176, 16, 57, 57, 57,200,202,202,130, 72, 36, 66, 93, 47,239, 46, 46, 46, 35, 34, 34, 34,132,
+ 0, 96, 99, 99,131,150, 45, 91, 98,238,220,185,156, 78,167,123, 5,192,161, 71,187,245, 91,189,122,245,158,243,231,207,139,188,
+189,189,145,144,144, 0, 55, 55, 55,145, 92, 46,175,211, 96,121,122,122,174,253,243,207, 63, 27, 84,152,234,138,178, 90, 94,254,
+240,114, 12, 31, 62,188,193,134, 13, 27,214, 2,232,255,162, 61, 16,236, 4, 78,162,118, 45,109,148, 7,143, 63,104,222,171,255,
+123, 34,175,160,249, 0,128,151, 0,209,177,131,223, 55,239, 31,221,100, 71, 69,191,172,218, 24,218,207,109,233,160, 65, 45, 4,
+ 99, 71,182, 73, 22, 73, 66,130, 54,109,248,222,163,129,115,212,191, 30, 18,194, 6,176,181, 1, 66,131, 44,130, 75, 91,147, 61,
+102,190, 23, 98,220,188,238,141,228, 77, 59,174, 71, 75, 36,183,123, 0,152, 89,147,118, 92,162,121,191, 74,219,160,153,163,228,
+ 52,129,124, 48, 90,181, 12,134,155,155, 18, 43,127,219, 0, 31,255, 78, 48, 24, 12,112,112,112, 80, 0, 48,153, 76,166, 77,214,
+152, 43, 0, 56,113, 66,201,135,135, 43,141, 66, 13,207,189,253,238,210, 97,189,250, 13, 14,235,209, 35,154, 63,122,236,168,169,
+ 83, 43, 83,110,143, 30, 29,243, 79,157, 62,123, 63, 47, 47, 59, 56, 52,180, 57,238, 37,222,234, 11,144, 88,160,250, 2, 27,123,
+159, 30, 14, 10, 34,167,182,109,155,204,235,248,155, 54, 95,124, 25,211,111,192,128, 9, 17, 93,162,186,240,199,142,159, 52, 74,
+ 81,116,215,174,243, 75,217, 19, 70,191,178,103,219,238, 61,189, 79,157, 60,208, 68,165,206, 63,240,237,207,148,153,171,170, 47,
+103, 28,231, 33,146,201, 4,133,167, 78,113,145,147, 38, 85,158, 27,133, 66,129,125,251,246, 65, 42,149, 86,110, 18,137,164,242,
+179,135,135, 7, 8,165,130,250,104,230,230,230, 34, 47, 47, 15,142,142,142,112,115,115, 67, 94, 94, 30, 46, 94,188,136,123,247,
+238, 65, 44, 22,163,111,223,190, 16,212, 80,111, 62,169, 57,245,171,175,122, 53,109,214,204,255, 73,115,133,135, 5, 19, 37, 37,
+ 37,136,142,142, 22,156, 56,113,194,243,210,131, 7,131, 1,108,170, 85,115,240,224,226,194, 19, 39,170, 61,118, 68, 68, 4,217,
+183,111,159,108,204,232,209, 51, 22,254,248,227,207, 95,254,244, 83,166,133,227, 60,235,147,119, 66,136,128, 16, 2, 63, 63, 63,
+148,148,148,160,172,172,172, 34,224, 0,103,103,103,152,205,102,240, 60, 47,102, 37,210,122, 4,117,153, 1,107,204,149, 88, 44,
+134, 64, 32,120, 42,147, 85, 53, 66,240, 36,214, 24,172,138,202, 79, 46,151, 63,118,131, 85,152,181,170,159, 43,222,118,172, 64,
+168, 86,171,177,107,215,174,202,130,102, 52, 26,161, 82,169,160, 84, 42,161, 82,169,160,215,235,145,154,154,138,173, 91,183, 34,
+ 39, 39, 7, 66,161,208,170, 73, 91,147,147,147,175, 55,106,212,168,101, 69,229,221,189,123,119,223,179,103,207,230, 84,156,131,
+ 79, 63,253,180,168, 67,135, 14,174, 85, 43,247, 58, 19, 43, 20,226,226,197,139,208,233,116,160,148, 66, 34,145, 32, 49, 49, 17,
+ 28,199,129,231,121,136, 68, 34, 20, 22, 22,214, 25,193,138,141,141,157,248,250,235,175,175,152, 52,105,210,169, 15, 63,252,240,
+ 88,247,238,221, 51, 9, 33, 48,153, 76,112,112,112,128,167,167, 39, 18, 19, 19,161,215,235,241,254,251,239,103,108,216,176,225,
+248,202,149, 43, 79,173, 89,179,102, 69, 86, 86,214,235,245,185,222, 28,199, 65,171,213,162,180,180, 20, 37, 37, 37, 80,171,213,
+208,235,245, 79, 85,134,162,162,162,112,224,192, 1, 97,207,158, 61,127, 15, 8, 8,200, 11, 8, 8,200,235,217,179,231,239,251,
+247,239, 23,250,248,248, 32, 45, 45, 13,215,175, 95, 71,105,105, 41, 40,165,181, 30, 64, 44, 22,119, 31, 63,126,124,103,127,127,
+127, 98, 50,153, 96, 48, 24, 96, 48, 24, 96, 50,153,192,243, 60,210,210,210,208,172, 89, 51, 65, 64, 64, 64, 71, 66, 72,119,246,
+ 8,177, 30,117,193,118,208,242,159, 64, 13, 91,193,171,127,134,246, 41, 39, 35, 41, 45, 45,253,242,173,143, 85, 5, 22,195, 45,
+196,199,156,134,166,220, 7,190,141, 39,226,205,215,187,227,234,229,163, 40, 41, 41, 65,124,124, 60,186,118,237, 42, 33,132,212,
+171, 92, 30, 59,118,217,242,202,184,119, 95,238,222,123,112,155,232,232,254,220,145, 35,199,141, 55,174, 29,185,222, 36,200,185,
+128,242,101,249, 78, 78,138,155, 15, 30,220, 69,112,211, 48,152,204,230, 40, 96, 65,173,229, 41, 41,137, 26,255,250,203,203,242,
+202,164,216,113,125,250,190,214,162,103,207, 62,230, 35,199,254,180,156, 59,181,243,102,159, 62, 65,103,190,254,126,187, 95,137,
+ 49, 52, 92,238,224,121,176, 99,103, 69,212,212, 87,253, 39,179,146, 82, 67, 52, 64, 46,231,241,232,185, 88,209,133,165,170,185,
+122,114,179,166, 78,170,170, 89,181, 46, 82, 42,149,184,127,255, 62,190,253,246, 91,220,186,117, 11, 22,203,195,174,118,117,117,
+179,168,170,153,152,145,209,227,221,119,223,149, 85,103,174,138,139,139, 81, 84, 84,132,236,236,108, 12, 28, 56, 80, 82,226,236,
+220,186, 46, 77, 31,119,119,131, 66, 46,207,191,119,239,222,191,165, 87,173, 86, 67, 42,149,226,199,159,126,146, 28, 73, 72,120,
+235,200,201,147,174,245, 57,159, 85,235, 82,119,119,119, 4, 5, 5,161, 85,171, 86,136,140,140,132, 92, 46, 71, 92, 92, 28,126,
+253,245, 87, 8, 9,225, 88, 73,124, 78, 17,172,250, 24,172,250, 24, 2,107,177,166,137, 80, 46,151,199,228,231,231,119,242,241,
+241, 1,199,113,149,102,234,201, 38,194,138,104,199,221,187,119, 33,151,203, 99,106,211, 84, 40, 20, 49, 66,161,176, 99,187,118,
+237,176,123,247,110,156, 58,117, 10, 41, 41, 41, 40, 47, 47,135,193, 96,128, 78,167, 67, 92, 92, 28,120,158, 71, 68, 68, 4, 28,
+ 29, 29,161, 80, 40, 98,234, 74,171, 86,171,205, 21,139,197, 33, 54, 54, 54,255,106,238,240,242, 66,113,113, 49,111, 54,155,177,
+126,253,122,181,167,167,167,173,141,141, 13, 42,230, 31,179,198, 92, 22, 20, 20,192,215,215,183,178, 15,150, 70,163,129,187,187,
+ 59, 76, 38, 83,101, 4,206,222,222,190, 78,115, 73, 41,213, 3,152, 85, 69,187,237,200,145, 35,183,108,219,182,173,241,241,227,
+199,113,229,202, 21,184,185,185,225,171,175,190, 74, 73, 75, 75, 27, 67, 41,189,246,188,175,185, 53, 6,171,184,184,120, 87, 76,
+ 76, 76,199,118,237,218, 85, 22,186,238,221,187,147,238,221,187,187, 86, 13,233, 23, 22, 22,226,234,213,171, 56,126,252, 56, 8,
+ 33,184,127,255,190, 69,167,211,109,169,229,216,146,128,128,128,117,115,231,206,181,227, 56,174,178,108,219,216,216, 64, 46,151,
+ 67, 34,145, 64, 40, 20, 34, 45, 45, 13, 67,134, 12,113,252,233,167,159,214, 18, 66,130, 40,165,166, 23,229,129, 80,198, 43,185,
+171,183,116, 78,206,206, 1,119, 46,158, 89,219,241,165, 71,207,136,139,103,214,114,206,206, 1,119,174,222,210, 57,117,241, 83,
+114,118,117,232,236, 61, 84, 56,219,100,186,214,247,240,161,152, 97,179,102,190, 41, 13,104, 28,152,127,225, 74, 76,192, 75,150,
+ 89, 2, 91, 27, 64,171, 3, 74,148, 64, 66,146,144, 15,104, 28,152,127,237, 70,162,244,187,101,107, 2,203,117,198, 61, 7, 79,
+ 40, 15,215,166,157,149,149,165,247,241,241, 25, 58,107,161,226,204,232, 49,238, 82,137,220, 15,154,210, 27,104, 24,224,130, 87,
+ 70,132,224,231,223,110,192,193,161,193,195, 8, 6, 33,182,214,230,189,168,168,136,236,218,122,110,210,248,215,222,236,208,167,
+247, 0,238,240,145,191, 68,167,142,238,191,184,246,183, 79,246, 80,161, 86, 65,168,198,198,207,223,247, 78,106,202,189, 49, 93,
+186,244,134,141, 84,209, 4, 8,173,182,192, 86, 14, 28,160,200, 16, 8, 32, 31,255,218,228,151,250,244, 25,204, 29, 57,178, 23,
+ 71, 14,110,184, 60,127,126,195,131, 41,217,155, 37,151,174,101,201,135,190, 60,173,244,192,161,187,198, 17,131, 26,221,243,182,
+109,169, 99,213,210, 19, 47,144, 34, 81, 62,103, 48,248,249,246,233, 35, 44, 79, 79, 23,219,121,120,112, 0, 96, 54,155,255,205,
+ 84, 85,141, 96, 9, 4, 2, 64, 32,224,173,209,180, 54, 45,229,229,229,224, 1,206, 26,205,194,146,146,134, 79,246, 49, 54,155,
+205, 40, 46, 46,174,220,148, 74, 37,228,114, 57, 74, 31, 77, 26, 90,151,102,151,230,205,215, 47,251,238,187,217,191,173, 94, 45,
+169,106,174, 42, 54,129, 64,128, 57,159,124, 34,153,247,245,215,211,134,139, 68,239,213,231,124, 86,188,172, 11,133, 66,136, 68,
+ 34,164,167,167, 35, 35, 35, 3,233,233,233, 72, 79, 79,135,141,141, 13, 40, 33, 60, 43,145,207,193, 96, 85, 92, 60,107, 59,185,
+ 91,107, 8, 42,222, 4,158,151,193,210,106,181,199,207,159, 63,223,190,119,239,222,162,203,151, 47,195,211,211,179,210, 96, 85,
+252,172,104,118, 82, 40, 20, 56,116,232,144, 73,171,213,214,186,144,164, 78,167, 59,113,226,196,137, 54, 51,103,206, 20, 79,156,
+ 56, 17,241,241,241,152, 50,101, 10,148, 74, 37,212,106, 53,138,139,139, 81, 94, 94,142,246,237,219, 67, 46,151,227,193,131, 7,
+102,157, 78, 87,215, 84, 5,180,160,160,160,204,205,205,205,235,201,127,188,252,242,203, 30,191,252,242, 75,121, 66, 66,130,185,
+ 83,167, 78, 14,214, 26,141, 10,182,110,221, 90,105,158,238,221,187,135, 95,126,249,165,178,207,213,141, 27, 55,176,116,233,210,
+202,185,203,234, 25, 85,188, 22, 30, 30,206,153,205,102, 52,105,210,164,162,121, 21, 43, 86,172,224,254, 14,115,101, 45,122,189,
+126,231,132, 9, 19, 62,186,121,243,166,151, 72, 36,170, 8, 93,131,231,121,152, 76, 38, 60,120,240, 0,113,113,113, 72, 72, 72,
+ 64, 73, 73, 73,229, 11,192,173, 91,183, 74,205,102,243,246,154,116,221,220,220, 62,253,227,143, 63, 60, 21, 10,197, 99,229, 89,
+ 32, 16, 84, 62,116, 36, 18, 9, 10, 11, 11,225,228,228,132,158, 61,123,186,159, 56,113,226, 83, 0,243, 94,132,135, 1, 33,132,
+116,234, 96,215,249,157,105,175,161, 93,107, 77, 82,204,141, 88, 28, 59,248,125,115,224, 97, 39,247,200,214, 17, 73, 87,111,218,
+163, 95,239,217,157, 47, 92,158, 82,107, 39,247, 71,125,168, 14,182,111,223,224,252,222,253,199,127,254,120,230,155, 87, 63, 91,
+240,177,187,222,160,149,135, 6, 89, 4,192, 67,115,117,233,166,173,126,209,130, 55,175, 46, 94,182,158,207, 40, 48,205,184,114,
+165,180,198,209,189, 85, 77,139,179, 29,228,158,126, 51,114, 26, 6,246,104, 20,115, 99, 13, 92, 29, 75, 97,223,164, 19,250,245,
+105,143,227, 39, 98,144,158,173, 71, 65, 65, 1, 0,212, 58,237, 65,194,157, 61,227, 40,161,254,132,146, 12, 34,160,242,113, 19,
+222,136, 26, 48, 96, 48, 61,112, 96, 63,183,119,207,166,243,219, 55,254,176, 83, 32, 17,139,116, 70, 71, 35, 33,122, 21, 47,176,
+143,215,106,139, 31, 62, 60, 37,146,154,151,187,121, 52, 33,107, 88,120,168,231,184, 9, 83, 28,251,247, 27, 66, 15, 30,220,203,
+111,223,182,254,212,246, 53,145,155,120,129, 90,146,155, 89, 46, 83,169,205, 42, 74,164, 78,101,106,190, 60, 63, 57, 72,239, 61,
+224,101, 19,171,150,158,168, 7, 12,134,172,178,204, 76,175, 6, 93,187,202, 30, 44, 88,160,240,104,223, 94, 95,209,133,165, 54,
+131, 37, 20, 10, 65, 1,222, 26, 77,107,211,162,211,233, 64, 9, 49, 63,141, 38,199,113,143,153,171, 10,131,245,232, 89,111, 85,
+ 58,191,125,255,253,203,109, 95,123,173,228,210,165, 75, 30, 29, 59,118, 36, 26,141, 6, 26,141,230, 49,147,229,230,230, 70, 26,
+ 7, 6, 42,142,228,230, 6,206,179,242,124, 90,147,119,129, 64, 80,227,249,100, 60,133,193,170,136, 96, 89, 99,176,132, 66,161,
+ 53,166,192,108, 54,155,225,238,238,142,162,162,162, 26, 43,124,129, 64, 0, 27, 27, 27,104,181, 90, 0,168,117, 36,157, 70,163,
+ 89,177,104,209,162,233,221,187,119,119, 13, 9, 9, 65, 97, 97, 33, 60, 60, 60, 32,151,203, 43,251,134, 85,232,197,198,198, 98,
+219,182,109,106,141, 70,179,162,142,124, 47, 95,181,106,213,219,253,251,247,111,224,234,234, 10,103,103,103,220,185,115, 7,206,
+206,206, 80,171,213, 72, 76, 76,132,189,189, 61, 8, 33,208,235,245, 56,123,246,172,134,231,249,229,117,220,152,244,194,133, 11,
+ 38,133, 66,113,167,176,176, 80, 88, 82, 82, 34, 42, 45, 45, 21,169,213,106,177, 74,165, 18, 31, 62,124,216,213,209,209,177,252,
+228,201,147,133,254,254,254,194,212,212, 84,161,209,104, 20, 88, 81, 41,226,189,247,222,131, 68, 34,129,193, 96,192,138, 21, 43,
+ 48,123,246,236,202, 62, 87,223,124,243, 13,230,206,157, 91, 25, 82,255,243,207, 63,235,107,178, 96, 50,153, 96, 54,155, 97, 54,
+155,173, 50,189,207,130, 53, 70,157, 82,154, 71, 8, 25,216,174, 93,187,163, 59,118,236,112,177,183,183, 71, 90, 90, 26,242,243,
+243,145,159,159,143,194,194, 66,148,149,149,129,227, 56,248,248,248, 32, 63, 63, 31,123,247,238, 85,105, 52,154, 62,181,141, 32,
+ 20, 10,133, 19,162,162,162, 68, 79,166,161,226,173,174,194,180,203,100, 50,228,228,228,160,123,247,238,210,211,167, 79, 79,248,
+ 95, 55, 88, 21,198,165, 89, 48, 36,131, 6,143,150,180,108,211,183,252,234,245,195,233, 54,132, 75,239, 31,221,100, 7,240,112,
+154,134,171, 55,237,209,178, 77, 95,193,160, 92, 99,123,101,233,111, 45,195,154, 18, 83,109,203,234, 0,128,171, 35, 63,164, 79,
+116,195, 92, 7, 7, 34, 90,180, 96,241,159,191,111, 88,221,238,210,214,127, 77,211,176,104,193,195,105, 26,250, 68, 55,228,226,
+ 19,238, 13, 1,176,193, 90,211, 50,112, 96,159,155,127,172,221,134,236,212, 63,189,151,127,110, 35,133,190, 20, 16,135, 32,170,
+131, 3,174,253,156,133,236,236,236, 60,158,231,107,109,198,165,132,250,199,197,199, 54,141, 12, 15,243, 28, 55, 97,178,195,192,
+129, 67,112,224,192, 62,108, 92,191,230,236,136,209,195,127,207, 46, 85, 11,221,197, 10,137,130,242, 82,161,196, 81, 36, 87, 40,
+ 10, 76, 57, 57, 15, 31,158, 34,177, 3, 48,146, 7,106,142, 12, 79,157, 60,214,177, 71,244, 16,252,117,112, 31, 54,174,255,237,
+204,103,225, 47,175,105,212,170, 25,105,223,250,219,105,141, 26, 55, 10,208,150,229,171, 5, 68,106,210,235,121,251,111,215,167,
+ 45, 75,158, 59, 33,249,102,236,200,239,216, 40,194,199,184,179,177,127,255,118,239, 38, 37, 73,220, 58,119,182,201, 57,117, 74,
+ 97,141,193, 18,137, 68,128, 64,192, 89,163, 73,142, 29, 19, 0,168,117,112,149, 68, 34, 65,121,121, 57, 56, 66, 76,214,104,186,
+223,186,149,153,150,150, 22,236,228,228,244,152,185, 42, 41, 41,169,252,172,215,235, 97, 52, 26, 97, 35,151,199, 89,163,153,127,
+246,172,126,238,196,137,243,222,126,235,173, 31,182,110,219, 38,119,116,116,132, 74,165,122,204, 96, 25,141, 70,180,107,223, 94,
+178, 54, 33, 97, 28,128,249,214,156, 79,143,238,221,235,236,239,251,200,176,178, 38,194,250,212,103,117, 53,213, 88, 59,138,176,
+186,138,145, 16, 18,253,196,239,115,251,245,235,167, 79, 73, 73,129,191,191,127,165, 73,169,122, 76, 7, 7, 7, 56, 57, 57, 33,
+ 33, 33, 1,107,214,172,209, 17, 66,230,214,166, 89, 82, 82,162,209,235,245,163, 70,143, 30,173,147, 72, 36, 8, 13, 13,173,156,
+255,138,231,121, 72,165, 82,216,218,218, 34, 54, 54, 22, 19, 38, 76, 40,215,235,245,163,158,156, 3,235, 73,205,180,180, 52,149,
+ 86,171,125,245,213, 87, 95, 45,191,119,239, 30,162,162,162,112,251,246,109,148,149,149,161,172,172, 12,169,169,169, 8, 11, 11,
+131,209,104,196,206,157, 59,117, 90,173,246,213,180,180, 52, 85,109,154, 26,141,102,208,146, 37, 75,132, 7, 15, 30,108,228,235,
+235, 27,222,182,109,219,144,158, 61,123, 6, 13, 27, 54, 44,160,127,255,254, 94,193,193,193,250, 62,125,250,184,245,235,215,207,
+ 77, 40, 20,138,147,146,146,114, 41,165,253,106,211,172,106, 74,238,221,187, 87,217, 36, 40, 18,137, 80, 84, 84, 84, 57,211,126,
+197,195,168, 58, 3, 92,147,102, 85,147, 93, 97,172, 42,140, 86, 93,207,254,234, 52, 9, 33,117, 86, 24, 82,169,180, 34,194, 73,
+235,210,164,148,222,186,123,247,110,175,174, 93,187,222,154, 52,105,146, 38, 47, 47, 15,246,246,246, 8, 12, 12, 68,211,166, 77,
+225,234,234, 10,147,201,132, 61,123,246,104,247,238,221, 27,163, 82,169,186, 63, 57, 7,214,147,154, 2,129, 32,181,186,135,107,
+ 69,244,170,194, 96,201,229,114,248,248,248, 84,156,219,212,250,156,207,167,140, 44,253,189,154,143,140, 75,207, 30,125, 26,247,
+ 31, 48,212,113,239,254,125,138, 31, 87,174,187,219,101,200,244, 85,174, 1,179,118,187, 6,204,218,221,101,200,244, 85, 63,174,
+ 92,119,119,239,254,125,138,254, 3,134, 58,246,236,209,167,113,124, 92, 66,200, 99,235, 18, 86,147, 78,133, 84,214,190, 75,167,
+ 96,229,217, 11,103,185,197,203,214, 91, 58,189,212,255,202, 15, 63,172,218,254,195, 15,171,182,119,122,169,255,149,197,203,214,
+ 91,206, 94, 56,203,117,233, 20,172, 84, 72,101,237,173,201,251,212,201, 99, 29, 7,244, 31,130, 3, 7,246,112, 91, 54,174,248,
+102,223, 17, 99,215,151, 39,235,243,211, 83,111, 80,148,175,131,155, 67, 12, 50, 50, 50, 84, 28,199,117,175,174,131,123,117,154,
+ 83,222, 28, 91,213, 92,157,115,241,140, 90,125,247, 46, 44,199,142,253,105, 62,113,226,166,238,220,173, 2,213,245,248,162,146,
+ 98,181, 62, 69,171, 81, 27,121,158, 7,229, 45,194,133, 11, 65,106,187, 70,157, 58,117,195,201,227,155,177,126,221,175, 42,158,
+135,254,229, 29, 59, 44, 35, 71, 46,160, 1, 13, 27, 6,108,218,186,153, 12, 28, 60,212,145, 2,252,160,225, 67,156,182,108,219,
+ 66, 26, 55,105,220, 48, 48,240,225,212, 52,255,147,101,233,111,208,156, 79,105,169, 58, 61,253,204,141,159,126, 50,120,140, 26,
+213, 64,234,225,225, 0,158, 39, 21,207,247,154, 54,145, 72,244, 88,196,165, 54, 77,143, 6, 13,178,143, 28, 57,130,144,144, 16,
+248,248,248, 60,214,229,165, 98, 34,109, 87, 87, 87, 28, 59,118, 12, 20,184,110,141,102,152,183,247,141,159,127,250,201,200,243,
+ 60, 74, 75, 75,255, 45,122, 85, 90, 90, 10,158,231,113,246,204, 25,163,170,172,108,189,181,121,111,111, 52,150, 13,109,211,230,
+235,241,227,199,155, 82, 83, 83,193,243, 60,170, 70,178, 10, 10, 10,160, 80, 40, 80,174,211,249,121,120,120, 40,172,209, 44, 56,
+124,216, 22,117, 60,215, 5, 2,193, 99, 77,132,127,199,117,255, 71, 69,176, 56,142,131,159,159,223, 99,243,140, 8, 4,130,199,
+182,250,140, 32,204,206,206,222,224,225,225,113,100,220,184,113,243, 90,182,108, 57,117,198,140, 25,194,198,141, 27, 67,165, 82,
+193,217,217, 25,238,238,238, 72, 77, 77,197,153, 51,103, 44, 74,165,114,149,197, 98,249, 60, 63, 63,191,208, 10,221, 83, 62, 62,
+ 62, 3,123,247,238,189,237,237,183,223,118,236,218,181,171,216,219,219, 27, 0, 16, 23, 23,135, 67,135, 14,153,182,108,217,162,
+214,235,245,163,172,153,197, 29, 0,114,115,115,143,122,121,121,141,152, 48, 97,194,166, 97,195,134,217,235,245,122,113,106,106,
+ 42,140, 70, 35, 56,142, 67, 73, 73,137,233,204,153, 51,101,229,229,229, 99,115,115,115,143, 90,161,119,131, 16, 18,102, 50,153,
+ 38,220,188,121,243,203, 17, 35, 70,184,188,244,210, 75, 18,142,227,112,254,252,249,194, 86,173, 90,185,171,213,106,211,133, 11,
+ 23,138,245,122,253,220,156,156, 28,171,150,202, 33,132, 64,173, 86,195,213,213, 21, 6,131, 1, 60,207,195,104, 52,194,206,206,
+174,114,121, 35, 74,233, 83,247,145,227, 56, 78,104, 50,153, 48,122,244,104,240, 60,143, 21, 43, 86,128,227,184,122,139,217,217,
+217, 93,143,139,139, 27, 24, 30, 30, 94,105, 90, 42,202,144, 76, 38,131,171,171, 43, 92, 92, 92,112,252,248,113, 8,133,194,235,
+ 86, 70,215,110, 3,104, 69, 8,121, 41, 38, 38,102, 60,128,150, 38,147,201,199, 98,177, 16,129, 64,144, 75, 41,189,163, 86,171,
+127,183,118,169,156,130,130,130, 47, 95,123,237,181, 86,155, 55,111,182, 19,137,254,117,107,136, 68, 34,200,100, 50,184,187,187,
+195,209,209, 17,148, 82, 24,141, 70,124,250,233,167,106,173, 86,251,229,139,242, 48,104,211,182, 61,126,251,229,123,187, 19, 39,
+143, 20,222,189,143,125, 85,167, 98,176, 3,112,225,242,148,125,202,210,223, 90,230,100,102,218,181,105,219,222, 42, 77,163,133,
+ 43, 30, 53,118,149,223,163,165,114,190, 76, 77, 73, 95,190,121,221, 27,201, 0,240,221,178, 53,129, 25, 5,166, 25,241, 9,247,
+134,172, 92,117,186,189,209,194, 21, 91,163,249, 47,211,178, 73, 5, 10,125,118,118,246, 21, 95, 95,223, 70, 81, 67, 76,115, 67,
+130,200,224,252, 34, 62,155, 16,242, 78,118,118,118,178,181,121,239,220,169, 43, 78, 30,221,130,141,235, 55,169, 41, 47,212,187,
+186,186, 82, 0,184,123,215,149,222,189,171,164, 64,197,124,141, 78, 90, 55, 69,225,231,115,231, 76,157,169,209,104,150,255,252,
+109,237, 19,206, 54,111,209, 1,205, 91,116,192,244,119, 62,113, 12, 11, 15,245, 7,128, 29, 59,168, 37, 34,152,252, 57,239,179,
+ 5,131, 63,255,124, 1,212, 26, 3, 62,255,252,225,178, 58,137,177,241,127, 37, 37, 81, 35,171,154, 30,103, 30,199, 93,193,204,
+153,193,229, 37, 37,110,157, 63,250,200, 85,244,237,183,130,234, 58,185, 87, 68,176,170,222,191,214,104, 30, 62,113,226,175, 15,
+102,206,204, 94,250,237,183,125, 22, 47, 89, 98,211,172, 89, 51,228,229,229, 33, 52, 52, 20, 62, 62, 62,184,112,225, 2,142, 28,
+ 60,168, 45,211,233,230,122,122,122,174,180, 70,243,199, 45, 91, 18,187,244,232, 81,180, 97,195, 6,239, 30, 61,122, 16,173, 86,
+ 11,149, 74, 5,149, 74, 5,131,193, 0,137, 68,130,236,236,108,154,145,153,121, 55, 43, 43,107,149,181,121,183, 20, 22,202,103,
+101,100,100,137,214,173, 91, 50,101,242,228,217, 51,103,205,146,249,250,250, 18,131,193, 80, 25,197, 50,153, 76, 80, 40, 20, 38,
+141, 70,227, 2,160,220, 26, 77,217,159,127,114,197,197,197,112,113,113,169,156,118,169,234,188,130, 90,173, 22,148,178, 73,112,
+235,245,162, 80, 83, 29, 30, 26, 26,122, 93, 36, 18,249, 86,141,102,213,244,179, 74,101,156, 21, 27, 27,219,166,170,195,165,148,
+ 86,219,223,201,215,215, 55,144,231,249,175, 94,122,233,165, 17,111,190,249, 38, 57,115,230, 12, 78,158, 60, 73,179,178,178,118,
+ 10, 4,130,185, 89, 89, 89,201, 53,189,217,212,164,217,160, 65, 3,123,123,123,251,247,109,109,109,163, 43,166, 98,144,203,229,
+ 49, 90,173,246,184, 70,163, 89, 81,211,236,237,181,105, 54,110,220,216,129,231,249,247,108,109,109,123, 21, 21, 21,181, 4, 0,
+ 87, 87,215, 91, 90,173,246,152, 64, 32,248,190,166, 5,164,107,211,244,246,246,182,177,179,179,251,178, 65,131, 6,175,190,249,
+230,155, 46,103,206,156,201,189,117,235,150, 68,173, 86,111,230, 56,174,198,197,158,171,211, 12, 11, 11,123,108, 45,194,231,121,
+141, 0,160, 69,139, 22, 7, 6, 13, 26, 52, 96,236,216,177, 48,155,205, 88,185,114, 37,142, 29, 59,246,215,253,251,247, 7,214,
+246,246,249,164,166,167,167,167,171,143,143,207,233,113,227,198, 5, 12, 29, 58, 84,225,224,224, 0,161, 80, 8,173, 86,139,148,
+148, 20,220,185,115,135, 30, 59,118,172, 44, 46, 46, 46, 75,167,211,117,203,203,203, 43,178,246,124, 62,203, 91,242,147,154, 98,
+177,184,171,159,159,223,214,249,243,231,219,247,234,213,203,198,197,197, 5, 66,161, 16,102,179, 25,185,185,185,136,141,141,197,
+145, 35, 71,180, 59,119,238,212, 22, 23, 23,143,166,148,158,249, 79,164,243,121,106,134, 53, 37,159, 61,177,128,115,141,179,179,
+215,182,175, 53,233, 28, 16,237,220,127,196,136,182,209, 0,176,107,215,181,227,127, 29, 47, 61,248,180,233,172, 43,173,214,104,
+ 54, 11, 22,206,143,139,143,125,108, 34,202,240,176,136,123,205, 34,135,127, 97,141, 86,197, 76,238, 79,230,189,202,236,248, 85,
+222, 8, 30,111, 78,173, 88, 16,250,147,185,115,240,213,151, 95, 99,223,142, 61,127,197, 39,209, 3,255,203,101,233,239,212,172,
+ 88,156, 88,225,229,213,101,139,171,235,156,163,199,143,219, 85,125, 81,171,136, 52, 87,125,153,108,217,178,101,193,173, 91,183,
+ 60,172,209, 28,248,227,143, 38,189,189,189,108,241,170, 85, 93,203,141,198,174,179,102,205, 18,221,184,113, 3, 91, 54,109,226,
+116,153,153,155,242, 44,150,247,170,107,253,168, 77, 51,232,131, 15,228, 95,109,222, 60,177, 97,227,198,238, 67,134, 12, 17, 11,
+133, 66,104, 52, 26,228,228,228,224,226,133, 11,198,148,212,212,248,242,242,242,193, 89, 89, 89, 57,214,106, 14,252,241, 71,147,
+ 83, 96, 32, 20,110,110,244,194,165, 75,142, 31,206,159, 63,213,211,203,203,177,115, 84,148, 88,161, 80,160,180,180, 20, 25, 25,
+ 25, 56,119,238, 92, 65,114,114,178, 55,165,212, 98,141,230,254,152,152,230, 39,175, 92,121,249,195, 15, 63,148,134,132,132,192,
+222,222, 30, 26,141, 6,241,241,241,184,120,241,162, 97,235,214,173, 42,173, 86, 59, 53, 51, 51,115,255,223,117,221,255, 49, 6,
+235,255,235,198,243,244,244,108, 35, 16, 8, 62,123,212, 28,181,168,174, 53,253, 94,164,135,142,151,151,151,191,179,179,243,111,
+ 58,157,142, 26, 12,134, 41,185,185,185, 25,255,109,233, 36,132,136,218,180,105,243, 75, 65, 65,193, 75,148, 82, 56, 58, 58, 94,
+140,139,139,123,139, 82,202,213, 87,147, 16, 34,244,244,244,124,201,214,214,182,189,173,173,109, 87,147,201,212,236, 81, 63,188,
+187,229,229,229,103,204,102,243,149,188,188,188,139,148, 82,203,127, 50,239,132, 16, 33,128, 94,222,222,222,111,240, 60,223,132,
+ 16,226,100,177, 88, 96, 54,155,149, 60,207, 63, 80,169, 84,107, 0, 28,251, 79,167,243,121,105,134, 55, 33,195,168, 0,205,106,
+ 50, 2,143, 25,154, 39,140, 3,225,113, 55,238, 1,221, 99,109, 58, 9, 33,130,161,253,220,150, 2, 15, 71, 26,214,181,228,208,
+ 99, 6,203, 10,211, 82,111,115,217, 68,244, 26, 37,212,255,241,135, 34,201, 8,109, 62,108,227,179, 24, 44,107, 9, 15, 33, 93,
+ 65,241, 18, 79,113,229,238,125,122,242, 69,125,214, 61, 79,205,175, 9,105,176,163,105,211,139, 2,145,200,147, 16, 34, 0, 0,
+ 34, 16,240, 60, 96,129, 64,192, 85,109, 22,172,250, 66, 89,151,166, 9,136, 20,203,100,126, 22,142,243, 40,145, 72,236, 46,216,
+218,182, 54, 0,101,158, 22,203,103,199,139,139, 19,159, 38,157, 38, 32, 82, 40,147,249, 95,176,183, 31,162,116,118,110, 94,106,
+ 50,185, 1,160, 54, 54, 54,119,203,202,203,215,167,165,165,253, 92,205,162,234,117,106, 74,100, 50, 95,203,163,145,135, 2,145,
+168,224,136, 76,230, 87,232,230, 54,190, 92,167, 11,144,203,229,102, 74,169,218,100, 50,141,205,200,200, 56, 81,159,188,103, 8,
+133, 97,119,236,237,163, 44, 14, 14, 46,102, 66,108,141, 22,139,201,100, 54,103, 26, 12,134, 24,161, 80,184, 44, 43, 43, 43,233,
+239,188,238, 47, 28, 21,163,205,254,142, 13, 64, 52,211,100,154, 76,147,105, 50, 77,166,201, 52,255,126, 77,119,119,119,133,167,
+167,167, 63, 0,225,255, 98,222, 95,180, 77,196, 44, 38,131,193, 96, 48, 24,255,251,228,231,231,151,163,154, 62, 87,140,255, 80,
+ 19, 33,128,232, 26, 34, 91, 86,135,254,158,102, 52,129, 21, 77, 9, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,193, 52,235,
+210,126, 97,154, 30, 89, 19, 33,211,100,154, 76,147,105, 50, 77,166,201, 52, 89, 19,225,243,221, 4, 96,212,228,172, 61, 8, 33,
+ 30,207,123, 95,198,139, 93, 22,170,249,174, 15, 33,196,167,158,251,123,177,179,206, 96, 48, 24,255,219,252,191,247,193,170,168,
+168, 40,165,249,207, 99,191,231,253,221, 71,223,255,154, 16,124,248,232,243, 55,148,210, 57,207, 99,223,186,240,246,246,246,107,
+208,160,193,107,174,174,174,157,138,139,139,207,230,230,230,174, 45, 42, 42,202,173,199,247,131,229,114,249, 91, 2,129, 32, 2,
+ 0,120,158,143,213,235,245,191,228,228,228,220,127, 14,215,141, 0,152, 44,147,201, 94,113,118,118,110, 82, 82, 82,242,192,104,
+ 52,238, 0,240,235,211,204, 58,237,229,229,213,218, 98,177,188,139,135, 35, 89,127, 45, 44, 44,188, 96,237,119, 61, 34,134,110,
+167, 64, 48, 0, 1, 79,248,151, 5, 84,176, 19, 0, 79,128,251,249,177,123, 95,121,206,229,245,169,175,111,125,191, 75, 8, 89,
+ 70,128,247, 65, 64,159,181, 44, 49, 24, 12, 6,227,127,200, 96,249,248,248, 76, 0, 48, 27, 15,103,218,254, 46, 59, 59,123,253,
+223, 81, 89, 61,199, 74,109, 5,165,116, 86,253,163, 21,248,144,231,169, 0, 0, 4, 2,242,145,135,135, 71,132, 72, 36, 50, 60,
+185, 47,199,113, 50, 66,208,151,231, 41,121,180,239,135,132,144,239,159,198,216,185,184,184,120,143, 25, 51,102,211,231,159,127,
+110,163, 80, 40,144,145,145, 49,116,206,156, 57,209,222,222,222,227,115,114,114, 50,235,250,126,227,198,141,199, 68, 54,111, 57,
+115,206, 39,159,217,185,185,187,219,114,156,197,148,153,157,165,248,246,235, 69,237, 27, 55,110,252,125, 74, 74,202,150,250, 24,
+ 41,145, 72,244,138, 92, 46, 15,210,235,245, 73, 28,199,237, 20, 10,133,125,190,252,242,203,136,254,253,251,203,213,106,181,148,
+227,184, 38, 27, 55,110,156,249,199, 31,127,244, 35,132, 12,169,109,184,125, 69, 4,135, 82,154, 93,229,220,189,117,227,198,141,
+ 30, 98,177,152, 60, 90,180,249, 66,109,251, 87,133, 2,193,113,231,119, 68, 2, 64,120,231,145,247,226,206,239,192,163,207,207,
+253,101,224,201,178,224,236,236,188,185,180,180, 52,190, 46, 35, 95,221,119, 9, 33, 63, 80, 74,243,188,189,189, 59, 1,120,235,
+209,174,191,228,228,228, 92, 32,132,120,202,101,178,247,117,122, 61, 1, 64,158,165, 44, 49, 24, 12, 6,227,127, 47,130, 53,231,
+222,189,123,246,148, 82,132,132,132,124, 12,192,106,131,245,100,133, 35, 20, 10, 62,238,213,171,215, 68,153, 76,246, 88,197,108,
+ 48, 24, 4, 2, 1,113,183, 88, 30,254,185, 62, 21, 77,197, 49,140, 70,131, 64, 44,150, 66, 40, 20,204,108,217,178,101,191,252,
+252,252, 67, 50,153,236,155,212,212,212,130,167,137,220,172, 95,191,190,149,139,139,203,191, 25,136,226,226, 98, 65,191,126,125,
+ 73,125,244, 38, 18, 34, 51,200,100,237, 37,132,120, 89, 56,206, 9, 0, 68, 34, 81,105, 19, 15,143,174,159,206,153, 99,243, 72,
+ 23,101,101,101,120,237,181,215, 20, 15, 30, 60, 24, 11,224,171, 58, 34, 87, 77, 91,180,106, 51, 99,203,230, 77,205,212, 37,165,
+250,213,203,127,189,161, 19, 73,202, 27,133,133, 74, 22,125,189,204,249,211,143,102,190,227,237,237,125,171,186,101, 67,158,200,
+171, 0,192,158,247,223,127, 63,124,224,192,129, 82,141, 70, 35,215,233,116, 13, 55,109,218,244,105,155, 54,109,236, 90,182,108,
+ 41,221,186,117, 43, 81,169, 84,160,148, 42, 66, 67, 67,233, 43,175,188,162,223,182,109,219,116, 0, 63,212,199, 44,243, 60, 47,
+172,174, 28, 90, 99,174, 9,112, 63,188,243, 72,128,160, 73,220,249, 29,242,240,168,145,122, 80, 60, 32,192,253, 71, 47, 2,159,
+ 3, 85,230,117,122,156,187,217,217,217, 79,181,118,224,128, 1, 3, 9,165,116,143,183,183,247,137,162,162, 34,123, 66, 48,186,
+ 30,209, 41,226,230,230,246, 14,128, 79, 40,165,239,159, 58,117,170, 35, 0,116,239,222, 93, 2,224,130,163,163, 99, 79,163,193,
+ 64,216, 35,137,193, 96, 48,254,129, 6,139, 82, 42, 3,128,115,231,206,129, 82, 42,127,154,160, 64,213, 95,102,205,154, 5, 23,
+ 23,151, 39, 77, 11, 78,158, 60, 81,227,119,234,123,140,175,191,254,218,169,160,160, 96,244,239,191,255, 62,212,211,211,243,237,
+188,188,188,195,117,228, 49,159, 16,242,205,163,136, 3,145,203,109, 74, 39, 77,154,116,241,209,255,154,253,249,231,159,246,131,
+ 6, 13,210, 16, 66,238, 2,128, 92,110,211, 85, 40, 20, 56, 83, 74, 41,165,248,166, 54, 35, 56,146,144, 64,169, 84,218, 99,202,
+143, 63,114,173, 7, 13, 18,217,186,185, 17, 0, 72, 79, 72,112,253,225,167,159,186, 40, 51, 51,101, 34,123,251,178,252,210, 82,
+227,189,123,247, 32,151,203,137, 64, 32,232, 84, 87,134, 21, 10,197,187,179,102,127,108,171, 46, 81,234,244,106,141, 81,200,153,
+ 13,246, 54, 10, 75,126, 94, 65,177,157,141,109,249,228,183,223,149,206,255,100,246,187, 85,162, 38, 53, 49,125,230,204,153,205,
+218,181,107,231,179,125,251,118,162, 82,169, 32, 18,137,236, 90,182,108,137, 54,109,218, 88, 78,158, 60, 73, 26, 53,106,132,136,
+136, 8,156, 63,127, 30, 23, 47, 94, 36,173, 90,181, 82,236,222,189,123, 92,117, 6,171, 58, 83, 61,102,204,152,137, 82,169,148,
+239,218,181, 43,222,120,227, 13, 80, 74,209,170, 85,171, 78,227,198,141,203,213,233,116, 86,153,235,138,102, 64,247,136,161,119,
+ 0, 68,130,226, 65, 65,236,222,230, 85,118,105,150,152,152,216,161,180,180,180,178,179, 97,197,194,226, 93,186,116,169, 79,121,
+207, 39,132,124, 51,104,208,192,143, 1,130,232,232,232,178,233,211,167,211,196,196,196,222, 67,135, 14,105,116,255,254,131, 26,
+211,249,100, 57,154, 58,117,154, 86, 44, 22,191,230,237,237, 29, 79, 8, 17,139,197,226,138,115, 36,106,216,176,161, 71,100,100,
+228, 28, 47, 47,175,114,161, 64,160,160,168,187, 44, 49, 24, 12, 6,227, 5, 50, 88,132,144,156,219,183,111, 55, 44, 47, 47, 7,
+ 33, 36,199,138, 10,234,120,213, 10, 71, 36, 18,253, 38, 20, 10,166, 0, 64,219,182,237,180, 75,150, 44,169,174, 89,137,111,219,
+182,157, 86, 40, 20,216, 62,172,188,132,191,114, 28,151, 95,157,102, 13, 21,226,183, 82,169,236, 3, 0,196,215,215,175,108,223,
+190,125,252,136, 17, 35,240,237,183,223,202, 62,254,248,227,159, 27, 54,108,216, 61, 45, 45, 45,189,166,116, 62,250,125,142,135,
+135, 71,196,250,245,235, 91, 77,154, 52,233, 98,118,118,246,240, 71,145,145,221, 0, 58, 16, 66,238, 86,253,219,238,221,187, 95,
+154, 48, 97,194,205,252,252,252, 57, 53,105,142, 32, 36, 40, 32, 52,180,199,231,103,207, 82,129,193, 64,138,206,157, 83,151, 20,
+ 22,154,146,138,138,108, 55,199,196,140,254,112,225, 66,137,167,143, 15, 46, 28, 61,106,159,167, 84,106,148,229,229,198,212,212,
+ 84,222, 98,177,156,176, 34,239,225,110,174,174,138, 95,151,173,188,102, 47, 22,242,238,190, 62, 68,220,160,129, 72,160,112,144,
+ 10, 69, 2, 67,163,134,129, 82, 0,225,117, 93, 35,137, 68, 50,174,119,239,222,138,109,219,182,145,136,136, 8, 56, 57, 57,225,
+220,185,115,184,117,235, 22, 74, 75, 75, 5,102,179, 25,109,219,182,197,146, 37, 75,224,239,239, 15,165, 82,137,140,140, 12, 87,
+169, 84,234, 86,203,249, 36, 85,202, 15, 62,250,232, 35,184,185,185,193,108, 54,163,164,164, 4, 22,139, 5,182,182,182, 0,128,
+188,188, 60,236,219,183,183,206,178,100,165, 57, 66,199,142, 29, 43,141,112,213, 8, 86,125, 52,125,124,124,206, 21, 22, 22,141,
+236,209,163, 7, 74, 74, 74,184, 5, 11, 22,160, 69,139, 22,104,218,180,169, 53,101,126,142, 76, 38,251, 35, 32, 32, 96,221,212,
+169, 83, 27, 58, 59, 59,195, 96, 48, 44, 45, 46, 46,198,135, 31,126, 8, 0,104,215,174, 93, 91, 74,233,173, 73,147, 38,161, 97,
+195,134,154,188,188,188,162, 59,119,238, 12, 85, 42,149,119,158, 54,239, 86,158, 31,166,201, 52,153, 38,211,252,175,210,252, 71,
+ 27, 44, 0,249, 62, 62, 62, 13,109,108,108, 0,160,222,111,215, 28,199, 77,117,119,119, 23,124,250,233,167,131, 26, 55,110,204,
+ 79,159, 62,253, 66,106,106,234, 99, 29,103, 26, 53,106,180,227,167,159,126,234,148,146,146, 82,254,197, 23, 95,252, 89, 80, 80,
+ 48,173,158, 23,253, 35, 66,200,114, 0,200,204,204, 44,222,187,119,111,212,217,179,103,191, 94,190,124,185,239,244,233,211,101,
+211,167, 79,255, 8, 64,157,154, 34,145,200, 80, 93,179, 96,117,184,184,184,240,213,245,209,170, 96, 16, 33, 54, 14, 82,105,247,
+207,207,158,165,198,180,180,242,109, 63,255,108,179,234,218,181,121,102, 74,189, 60, 60, 60,132, 93, 59,119, 54,216, 75,165,154,
+252,156, 28,222,217,215,151,164, 36, 37,217,153,133, 66,211,225,195,135,203, 10, 11, 11, 55, 89,145, 4, 53, 79,169,209,206,215,
+223,252,242,208, 94, 17,215,174,220, 74,176,119,119, 21,180,106, 25,209, 60,225, 94,218, 13,240, 22, 19, 0,117, 93, 34,142,142,
+142, 77,139,139,139,161, 86,171,225,230,230,134, 21, 43, 86,192,211,211, 19,229,229,229,136,139,139,163,190,190,190,228,236,217,
+179,240,245,245, 69, 97, 97, 33,140, 70, 35, 52, 26, 77,129,193, 96,208,213,100,120, 69, 34,209, 31, 2, 1,153, 68, 8, 65, 72,
+ 72,168,118,249,242,229, 60,165, 20,205,154, 53,195,240,225,195,177,107,215, 46,196,197,197, 85, 68,154,248,160,160, 38, 90,129,
+128,216, 2,224,159, 37,138,195,243, 60,170, 26,225,250,226,237,237,109, 3,224,195,224,224,224, 81,175,190,250, 42, 39,145, 72,
+160,213,106,161,211,233, 16, 27, 27,203, 13, 24, 48,176,108,208,160,129,118,127,253,245, 87,173,233, 52, 24, 12, 73, 1, 1, 1,
+ 35,102,204,152,113,244,215, 95,127,117,153, 59,119, 46,120,158,175,220, 56,142,171, 92,148,123,239,222,189,120,240,224,193,156,
+170,230,138,193, 96, 48, 24,255, 12,131,245,204,136,197,226,207,255,250,235,175,222, 95,125,245,149,184,103,207,158,157,188,189,
+189, 95,202,201,201,185,248,168, 82,123,169,127,255,254,157,220,221,221,241,253,247,223, 27,197, 98,241,231, 79,233,172,171, 86,
+118,167, 60, 61, 61,167,239,222,189,123,255,148, 41, 83,224,229,229,213,254,255, 59,207, 14, 50, 89,171, 73, 43, 86,112, 98,179,
+ 89,176,245,215, 95,101, 95,157, 56,177, 98,219,246,237,226,118,109,219,130, 2,136,143,139,147,125,243,227,143,178,145, 3, 7,
+ 22,196, 61,120,128,195,199,143, 27,149, 37, 37, 57,133,106,245,236,252,252,252, 66, 43,140,235,165,148,212, 20,239,168,174, 29,
+125,206, 92,141,189,245,242,208,254, 61,196, 34, 1,121,144,150,117,221,203,211,213,241,226,249,243, 58,142,227, 46,213,165,163,
+213,106, 83, 57,142,107, 64, 41,117, 59,125,250, 52,220,220,220, 80, 90, 90, 10,179,217, 12,163,209,104, 44, 47, 47,151, 23, 23,
+ 23, 67,175,215,195, 96, 48,192,193,193, 1, 49, 49, 49,249, 28,199,157,172, 37,109,111, 16, 66, 22, 80, 74, 17, 31, 31,159, 13,
+ 0,126,126,126, 97, 78, 78, 78,199, 42, 22, 80, 62,123,246,108,239,172,172,172,184, 42,145,174, 90, 59,185, 91, 27,193,122, 90,
+188,188,188, 90,203,229,242,111, 62,254,248, 35,239, 22, 45, 90,160,176,176, 8, 60,207,195,206,206, 14, 58,157, 14,246,246,246,
+232,212,169, 83,222,130, 5, 11, 82, 40, 69, 63, 74,105, 94,109,122,233,233,233,121,254,254,254,163,167, 76,153,242, 99,112,112,
+112, 83, 74, 41,130,131,131,209,187,119,111, 28, 58,116, 8,247,238,221, 67, 89, 89, 25,119,245,234,213,213, 57, 57, 57,219,216,
+ 99,137,193, 96, 48,152,193,170, 55,217,217,217,217, 62, 62, 62, 27,110,222,188, 57,233,149, 87, 94,193,169, 83,167,230, 2,232,
+ 7, 0,114,185,124,238, 43,175,188,130,155, 55,111,226,238,221,187, 27,178,179,179,179,159,199, 49,165, 82,169,214,104, 52,226,
+209, 49, 20,245,172,168,155, 61,106, 26, 4,165,180, 89, 77,127,171, 13,129, 72,228, 21,217,183,175,168,244,214, 45,245,242,243,
+231, 23,109,217,186, 85,220,190, 93, 59,152,204,102,240, 22, 11,252,252,253,209, 35, 58, 90,182, 97,251,118, 91, 78,171,189,240,
+217,123,239, 29, 90,249,218,107,101,151,203,202, 30, 88,147, 70,173, 86,251,195,103,159,124, 20,189,109,251, 46,159,176,208,160,
+ 6,135,143,158,186,233,226,226,168,104,218,164,137,173, 82,169,178, 44, 91,250,149,168,172,172,236,199,186,116,116, 58,221,158,
+227,199,143, 15,245,243,243,115,139,141,141,133,209,104,132,197, 98, 65,207,158, 61, 43,250,223,241, 34,145, 8, 9, 9, 9, 48,
+153, 76, 5,247,239,223,207,121,240,224,129, 12,192,226, 58,206,225,147,215,113,210,128, 1, 3, 96, 54,155,209,187,119,111,236,
+221,187,247,117, 0, 51,106,217,255,169, 12, 86,213,235, 4, 43, 59,183,123,123,123,247,106,210,164,201,247, 75,150, 44, 17,248,
+250,250,130,231,121, 56, 59, 59,163,188,188, 28, 69, 69,197, 8, 11, 11,131,159,159, 31, 22, 47, 94, 12, 0, 91,235, 50, 87, 21,
+100,100,100,220, 5,208, 61, 40, 40, 72,170,215,235, 59, 69, 71, 71,111,236,217,179, 39,110,222,188,137,139, 23, 47,246, 32,132,
+228,233,245,122,179,143,143,207, 44, 0, 78,148,210,223,172, 25, 61,202, 96, 48, 24,140,255,113,131, 21, 20, 20,100, 47, 22,139,
+186, 77,155, 54,213,206, 98,225, 33, 22,139,186, 55,108,216,208, 49, 45, 45, 77,245, 20,149,223,247,155, 54,109,122,117,217,178,
+101,178, 1, 3, 6, 52,247,242,242,234, 13, 0, 35, 71,142,108,238,224,224,128, 77,155, 54, 25, 40,165,223, 63,175, 76,114, 28,
+ 55,180, 77,155, 54, 40, 41, 41, 65, 90, 90,218,197,250,124,247,207, 63,255,180, 7,208,161,174,191,213,122,124,163,209,217,201,
+199, 71,144,125,234,148,169, 68,173,246,174, 48, 87, 2,129, 0, 37, 37, 37, 72, 79, 75,131,131,189, 61,226, 19, 19,101, 43,223,
+125,119, 91, 64, 68,132,216, 98, 52,186, 88,171, 95, 88, 88,168,245,244,244,156, 56,239,179, 79,247,252,248,211, 79,110, 74,181,
+ 58,201,198, 70, 97,144,201, 36,158,243,230,205,181,168, 84,170, 9, 69, 69, 69,101, 86, 72, 45,222,188,121,115,223,190,125,251,
+222,241,247,247,119, 47, 44, 44,244, 84,169, 84,180,164,164,132,224, 97, 95, 42, 2, 0,119,238,220, 65, 90, 90, 26,103,177, 88,
+206, 2,248,156, 82,106,180, 54,173,222,222,222, 46, 29, 59,118, 28,230,238,238, 94,217, 20,217,178,101,203, 97,222,222,222, 95,
+230,228,228, 20, 63,207,194,125,236,216, 49,123, 74,105, 7, 74, 41,250,246,237,107,237,215,222, 26, 56,112,160,128, 16, 2,157,
+ 78, 7,153, 76, 6, 91, 91, 59,216,219, 59,160,105,211, 16,100,103,103,163,119,239,222,150,164,164,164, 45, 18,137,228,135,250,
+166, 73,167,211,141,233,212,169,211,194,105,211,166,129,231,121, 12, 25, 50, 4,153,153,153,235, 82, 82, 82,214,248,250,250, 78,
+155, 52,105,146,135,139,139, 11,102,205,154,165,168,106, 58, 25, 12, 6,131,241, 2, 26, 44,111,111,239,104,103,103,231,165, 78,
+ 78, 30,118, 71,142, 28, 21, 1, 64,215,174, 93,108,205,102,238,146,183,183,247,199, 57, 57, 57,127,214,231,160, 57, 57, 57,197,
+222,222,222,191, 94,188,120,241,189,225,195,135,227,216,177, 99,159, 0,192,240,225,195,113,241,226, 69,164,164,164,252,250,188,
+ 42, 91, 31, 31,159, 9, 93,187,118,125,187, 93,187,118, 56,112,224, 0, 44, 22,203,193,250,124,191,234,136,193,234, 70, 17, 86,
+252,205, 42, 49,161, 16,132, 16, 88, 44, 22, 80,158, 71, 81,113, 49, 18, 18, 19, 81, 90, 90, 10,139,197, 2, 93,121,185, 57,184,
+113, 99,173,202,104,116, 32, 15,231, 26,179,154,188,188,188,244,160,160,160,140,114,189,206,221,197,185,129, 78,161,144, 65,163,
+ 41,147,196,220,185, 85,150,149,149,149,100,165,241, 53, 18, 66,186, 30, 58,116,104,158, 80, 40,124,197,199,199, 7, 35, 71,142,
+ 36, 61,123,246,132, 84, 42,133, 94,175, 71,105,105, 41,254,252,243, 79,112, 28,215, 24, 0,220,220,220, 60, 26, 54,108,184, 75,
+ 32, 16,228,167,164,164, 76,170,235, 24,132,144,241,131, 6, 13, 18, 27,141, 70, 44, 90,180, 8,243,231,207, 71,191,126,253,196,
+ 55,110,220, 24, 15, 96,217,243, 42,216, 60,207,163, 87,175, 94, 85, 59,185,223,173,235, 59,221,186,117, 19, 9,133,194,144,160,
+160, 32, 20, 22, 22,162,176,176, 16,110,110,110,240,246,246,134,187,187, 59,150, 45, 91,134, 21, 43, 86, 92,165,148, 46,206,203,
+203, 75,168,111,154,252,252,252,102,189,246,218,107,179, 70,141, 26, 5,141, 70,131,139, 23, 47,162, 83,167, 78, 88,178,100,137,
+239,185,115,231, 22,182,105,211, 6, 18,137, 4,167, 79,159, 6,199,113,169,236,241,196, 96, 48, 24, 47,168,193,242,241,241,105,
+192,243,252,151, 3, 7, 14, 28, 52,108,216, 48, 44, 89,178,184,138, 87, 16, 97,237,218,117,142,187,119,239, 94,229,231,231, 55,
+ 76, 40, 20,126,156,150,150,102,117,135,100, 27, 27,155,149,155, 55,111,158,216,177, 99, 71,251,232,232,232, 96, 0,144,201,100,
+252,230,205,155, 53, 54, 54, 54, 43,235,155,145, 39, 39,125,244,242,242,234, 44,149, 74,167, 15, 26, 52,168,243,196,137, 19, 17,
+ 23, 23,135,141, 27, 55,222,246,246,246,222, 95, 79,221,187,117,141, 34,172, 43,154, 37,148, 74,139,149,121,121, 78,118,254,254,
+ 98, 23, 71,199,156, 83,167, 78, 5,180,111,223, 30,233, 25, 25, 80,150,150, 66,167,211, 33, 46, 46,142, 74, 68,162, 20,145,179,
+ 51, 73,191,116,137, 8,165,210,122, 27, 76, 91, 57, 9,254,236,195,201, 13,245,122,125,184, 74,165,226,196, 18,137,216, 70, 74,
+235,213,204, 68, 41, 53,248,251,251, 15,177, 88, 44,174, 70,163,209,236,225,225, 33, 62,126,252, 56,164, 82, 41, 8, 33,136,140,
+140,132, 84, 42, 53,250,250,250,106, 0,192,197,197, 69,176,120,241, 98,241,251,239,191, 31, 87,151,118,235,214,173,197, 1, 1,
+ 1,147, 66, 66, 66,112,241,226, 69,196,199,199, 39, 94,190,124, 57,164, 85,171, 86,240,241,241,153,212,186,117,235, 31,111,220,
+184, 97,126, 30, 5,155, 82, 90,239, 78,238,103,206,156,161,222,222,222, 16, 8, 4, 16, 8, 4,224,121, 30,133,133,133,104,220,
+184, 49, 86,174, 92,137, 21, 43, 86,252,146,155,155,251, 84,145,213,160,160, 32,105,139, 22, 45,222, 30, 53,106, 20,146,146,146,
+240,213, 87, 95, 21,228,231,231, 31, 60,122,244,232,248,105,211,166,137, 58,117,234,132,226,226, 98,172, 93,187,214,124,243,230,
+205, 31,114,115,115, 87,178,199, 19,131,193, 96,188,128, 6,203,207,207,111,162, 92, 46, 95, 56,106,212, 40, 81, 72, 72, 8,242,
+243,243,161,209,148, 89, 34, 35, 35, 44, 0,161,118,118,182, 68,161, 80, 96,202,148, 41,104,222,188,121,175,143, 62,250,168,167,
+183,183,247,215, 57, 57, 57, 63, 91,115,224,164,164, 36,141,183,183,247, 15, 51,103,206, 92,114,233,210, 69, 91, 0,184,117,235,
+150, 54, 39, 39,231,139,156,156, 28, 77, 61, 77, 80,197,228,148,196,214,214,246,126,147, 38, 77,204, 3, 6, 12,112, 25, 54,108,
+ 24, 92, 93, 93,113,243,230, 77, 44, 94,188,248,166, 86,171, 29,147,150,150,102,254,255, 62,201,156,193,144,119,125,239, 94,251,
+110,175,190,234,240,225,208,161, 95,189,249,230,155, 63,207, 95,176, 64, 28, 20, 24, 8,163,201,132,248,248,120,186,117,203, 22,
+211,150, 37, 75,190,131,173,173,248,210,174, 93, 82,163,209,152, 94,159, 99,248,250,250,118,237,223,183,107,200,210,101, 63, 64,
+175, 43,195,149,139,127,161,180,180, 16,191,254,182, 59,196,215,215,183,107, 86, 86,214, 25,171,211,203,113,129, 59,119,238, 4,
+ 0, 72,165, 82,124,254,249,231,240,246,246,134,131,131, 3, 52, 26, 13, 38, 79,158, 44,125,255,253,247, 1, 0,113,113,113,176,
+179,179,179, 54,202,214,127,242,228,201, 78,102,179, 25,135, 14, 29,210, 75, 36,146, 87,143, 30, 61,122,177,121,243,230,242, 46,
+ 93,186, 56,109,220,184,113, 0,128,189,207,203, 96, 61,197,119, 44, 62, 62, 62, 41, 71,143, 30,109, 60,114,228, 72, 72, 36, 18,
+148,150,150,194,193,193, 1, 63,253,244, 19,175, 80, 40,214, 62, 67,146,164, 10,133, 66,102,177, 88,176,125,251,118,228,231,231,
+ 15,172,232,143, 56,123,246,236, 47, 66, 67, 67,131, 18, 18, 18,146,245,122,253,220,236,236,236, 7,236,209,196, 96, 48, 24, 47,
+168,193,226,121,254,195, 35, 71,142,136, 44, 22, 11, 86,175, 94,141,107,215,174,209,252,252,252,239, 76, 38,211,215, 10,133,130,
+ 43, 41, 41,153,253,230,155,111, 78,157, 63,127,190, 32, 42, 42, 10,151, 46, 93, 18, 52,110,220,120, 58,128,159,171, 24,159,232,
+218,230,202, 40, 45, 45, 61,152,151,151,251, 51,207, 63,172, 12, 5, 2, 98, 43,149,202, 14,214, 97,166, 30,211,172,102, 50,203,
+166, 95,127,253,117,129,139,139, 11, 31, 23, 23,135,149, 43, 87, 90,174, 95,191,190,139,231,249, 79,139,138,138,202,173,209,124,
+ 30, 84,213,148,114,220,141,141,179,103, 55,107, 61,100, 8, 63,252,141, 55, 12, 2,145,232,173,175,150, 47,255,164, 84,169,244,
+ 6, 33,212,213,217, 57,125,205,151, 95, 46,122,169,123,119,125,220,153, 51,242, 91,199,142,137,221,204,230,219,245, 73,103, 86,
+ 86,214,153,224, 32,127,172, 91,189, 12, 38,147, 1,185,217, 15,253, 89, 81,177, 10,181,153,171,234, 52, 5, 2,129,242,181,215,
+ 94, 83, 24,141, 70, 50,122,244,104,113, 65, 65, 1,130,130,130, 0, 0,106,181, 26,127,253,245, 23, 66, 67, 67, 1, 0, 49, 49,
+ 49,149,159,235, 74,167,141,141,205,164, 78,157, 58, 33, 61, 61, 29,241,241,241, 59,115,114,114,242,189,189,189,119,166,167,167,
+143,111,219,182, 45,118,237,218,245,122, 77, 6,171,190,215,200, 26,131, 85, 67,222,223,216,189,123,247, 7,151, 46, 93,234, 59,
+107,214, 44,210,189,123,119, 0, 64, 89, 89, 25,159,155,155,171,121, 26,205,170,105,226, 56, 14, 0, 32,151,203, 53, 0,240,200,
+ 76,141,124, 90,205,231, 81, 62,153, 38,211,100,154, 76,243,191, 65,243, 31, 99,176, 0,152, 44, 22, 11,206,156, 57,131,221,187,
+119,115,122,189,126,120, 94, 94,222,245, 42,255,255,194,215,215,119,255,136, 17, 35, 14, 38, 38, 38,138,226,227,227, 1,128,171,
+207,193, 13, 6,131,145, 16, 80,252,107, 50, 74,106, 48, 24,140, 79,115,173,171,254,242,251,239,191, 35, 55, 55,215,144,158,158,
+190,149, 82,186, 42, 55, 55, 55,235, 25, 34, 33,207, 60,138,112, 45,165,134, 87, 9, 57, 62,191,115,231, 94,243,142, 29,147,189,
+ 50, 99,134,105,248,168, 81,179, 45, 70,163, 89, 40,145,240, 82, 91, 91,129, 69, 38, 19,199,157, 57, 35,255,126,218,180, 6, 58,
+131,225,240,198,122,116, 28,175, 18,193,194,107,111,204,128,174, 74, 4,235,210,181,123,168,111, 4, 75, 36, 18,249,155,205,102,
+ 25,199,113,217, 60,207, 99,252,248,241,224,121, 30, 58,157, 14, 26,141, 6, 37, 37, 37,250,119,222,121, 71, 0, 0, 10,133, 2,
+189,123,247,150, 90,163, 27, 24, 24,216, 72, 44, 22,227,240,225,195, 16,139,197,235, 1, 64, 44, 22,175, 63,118,236,216,248, 49,
+ 99,198,192,223,223, 63,140, 16, 66,234, 90, 60,186,114,177,103,130, 38,143,174,126, 19,247,136,161,119,170, 44,246,124,183, 85,
+171, 86,128, 21,253,174,158, 36, 51, 51, 51, 23,192, 12, 95, 95,223,181, 31,124,240,193,135,237,219,183,111,179, 96,193, 2, 16,
+ 66,132,207,122,179,241, 60, 15,179,217,252, 76, 83, 72, 48, 24, 12, 6,227,127,223, 96, 45,235,222,189,251, 76, 74,169,136, 16,
+242,237, 19,230,170, 34,106, 18,231,227,227,243, 89,227,198,141, 43, 23,128,174,167,121,201, 39,132, 44, 17, 8,200,135, 15,127,
+175,255,196,146, 85, 52, 62,122,104, 14,196,219,174, 95,191,254, 73,122,122,122, 54,165,148,123,214, 19,244, 60, 70, 17, 2,192,
+102, 74, 83, 71, 19,114,100, 86, 68, 68,116,223,105,211,208,188,111, 95, 7,239,128, 0,139,206,100,226, 99,206,159, 39, 23,119,
+238,148,220, 58,118, 76,172, 51, 24, 14,239,166, 52,163,190,233,204,202,202, 58, 19, 20,232,123,244,229,225,253,123, 7, 54,242,
+ 6, 0, 36,167,230,160,168, 68,117,180, 62,230, 10, 0,210,210,210, 12, 0, 12, 94, 94, 94,195,183,111,223,190,243,145,233,169,
+ 92,118, 6,128, 65, 36, 18, 5, 3,128, 70,163, 9,216,179,103,207,102,145, 72, 84,167,137,189,123,247,238,154,249,243,231, 79,
+ 73, 78, 78,222,154,149,149,149, 8, 0,233,233,233,137, 62, 62, 62,223,228,230,230, 78,205,204,204, 92, 73,173,112, 31, 79, 44,
+246,140,184,243, 59,228, 0, 34, 43, 22,123,126,218,181, 6,159, 56,159,177, 0,198,250,248,248,116,239,211,167,207,116, 0,121,
+207,162,103, 48, 24,204, 6,131,193,204,243,188,216,100, 50, 81,131,193, 96,102,143, 31, 6,131,193,248, 7, 26,172,236,236,236,
+245,176, 98, 49,103,107,247,171,197, 32,205, 33,132,124, 95, 97,150,158, 85,195,100, 50, 61,175,245,219,238, 14, 30, 60,184, 94,
+251,215,181,195, 86, 74,211,223, 37,100,195,129, 31,127,108,121,120,213, 42, 31, 11,199,185, 16,128, 10,165,210, 98,163,209,152,
+230,102, 54,223,174,111,228,170, 42, 73,201, 89,125, 0, 32, 56, 56,152, 62,120,240, 0,148,210,103, 90, 60, 56, 55, 55,247,168,
+175,175,175,187, 72, 36,146, 18,242,152,148,225,145, 9, 3,128, 59,132,144, 48, 0,117, 70,120, 50, 51, 51,151, 3, 88, 94, 77,
+ 25, 90, 1, 96,133,181,233,170, 92,236, 25, 16,240,132,127, 57,188,243,200,157, 0,248,138,197,158,159, 39,217,217,217,167, 0,
+156,122, 14,134, 77,223,176, 97,195, 85, 75,150, 44,153,122,251,246,237,223,179,178,178,244,236,241,195, 96, 48, 24,255, 64,131,
+245,255,201,243, 88,212,246,121, 47,140,251, 60,162, 32,213,241,195, 67, 3,117,249,239, 60,159,247,239,223, 39,207, 75,235,145,
+ 17,208,215,113,238, 41,234,217, 60,252, 44, 84, 44,246, 92,133,136,255,133,155, 45, 45, 45,237,235,214,173, 91, 47,205,202,202,
+ 98,209, 43, 6,131,193,120,193, 17,176, 83,192, 96,252,255,241,188,166,161, 96, 48, 24, 12,198,127, 55, 4, 64,116,117,255,168,
+207,232, 0, 66, 72,116,125, 15, 92,151, 62,211,100,154, 76,147,105, 50, 77,166,201, 52, 95, 60,205,186,180, 95,152,209,137, 85,
+ 59, 47, 63,239, 13, 64, 52,211,100,154, 76,147,105, 50, 77,166,201, 52,153,230, 63,109, 99, 77,132, 12, 6,131,193, 96, 48, 24,
+207, 25, 17, 59, 5,213,211,210, 75,184,200,223,215,189, 77,101,148,143,231, 1, 0,252,163, 89, 4, 42,167, 19,224,121, 80, 74,
+145, 83,160,188,113, 39,159,126,246,180,199, 11,241, 33, 13,220,229,242, 21, 60,165,157, 31,253,233,140,170,216, 48, 35, 86, 69,
+149,214,106, 52,243, 36,205,228, 2,124,192, 83, 52, 7, 0, 1,193, 29, 61,143,111,239,230,209,187,207,122, 62, 8, 33, 36,220,
+ 13,147,165, 54,138, 81,142, 78,206, 77, 74, 75,139,238,155,244,134, 29,241,133,248,149, 62,197,196, 78, 65, 13, 72, 7,158,226,
+ 19, 0, 2,177, 0,223,221, 43,166,167, 88,169, 99, 48, 24,255, 79, 60,235,188,118,150,234, 30,147,207,168,201, 38,200,251, 39,
+ 27,172,112,119, 50, 13, 4, 11, 0, 80, 80, 44,140, 43,160,245, 90, 47, 45,220,155, 68,203,133,194, 53, 0,132,122,147,101, 22,
+229,113,182,218,202, 92,128, 46,114,137,240, 59, 0,188,222, 98,153, 20,151, 99,125,123,108,132, 47,233, 43,226, 5, 27,121, 74,
+197, 22,158,174, 7,197, 1, 59, 9, 46, 92,202,162,245, 26, 22,239,239,235,222,102,239,213,220,222,167, 86,190,135,246,205,131,
+ 64, 45, 28,192,155,161,136,250, 0, 39,150,143, 71,251,102,254,160,188, 25,224, 57,216,245, 91,138,126, 17,142, 79,125,115,132,
+248,144, 6, 1,174,238,177,171, 87,175,241,244, 14, 12, 35, 60,103, 66,226,213,163, 99,223,255,112, 94,143, 8, 71, 18, 97,141,
+201,106,225, 77,222, 8,106, 28,242,193,140, 5,203,132, 94,222,126,182,188,217,192,229,165,222,109,245,195, 55,243,118,181,240,
+ 38,223,221,206,161,107,172, 53, 82, 97,110,152, 34,146, 73, 71,218,200,109,155,148,151,107, 30, 88, 76,230, 29, 17,222,162,190,
+223, 46, 93,209,178, 91,175,254,118, 22, 77,158,192,204, 35,108,251,182,173, 1, 63,254,252, 75,127, 66,200, 96, 74, 41, 95,159,
+ 60,243, 20, 31,222,219, 48,185,191, 88, 36, 36,205, 94, 95, 45,196, 83, 78,133, 16,230, 65,198, 16,138,168, 58,159, 92, 4,231,
+226,243,233,150,167, 57, 70, 51, 15,242, 59,161,104, 10,130,157,132, 98,107, 92, 1, 45, 96,143, 14, 6,227,197,194,215,215,247,
+ 84, 86, 86, 86,247,231,169,233,237,237,221, 33, 39, 39,231, 50, 59,187,204, 96, 89, 81,251,226,139,184,164, 76,103, 88, 76, 8,
+111, 26,184, 8, 64,189, 12,150, 92, 40, 92,127,237,126,190, 39, 56, 19, 86,127,249,214, 54,163, 25,224,204, 38, 88, 56, 51, 44,
+156, 25, 28,103,130,197,108, 6, 53, 27, 48,239,143, 83,128, 81,131, 54, 17,193,235, 1,120, 89,123, 12, 49, 21,108,188,113,254,
+104, 3, 98, 84, 97,203,202,175,223,201, 44, 44,123,231,248,157,156,162,112, 15, 50, 39,190, 0,107,235, 99, 4, 78,173,122, 15,
+155,246,252,149,245,253,239,218, 4,158, 82, 52,112,176, 9, 25, 59, 48,206,111,195,190, 83,153, 43,214,235, 19, 0,192,209, 86,
+ 26, 50,225,206,125,255,103,185, 8,238,114,249,138, 95,127,249,209,211,203,197,134,112, 23, 23,131,179, 88,224, 23, 48, 64, 56,
+103,250, 88,175, 47,150,175, 89, 14,224,181,218,190, 31,234, 65,194,154, 6, 53,155,181,254,175,139,254, 90,117,129,241,232,230,
+ 79,146, 96,128,217,211,167,153,120,209,215,203,132,115, 63,122,111,102,168, 7,185,146,144, 79,227,235, 48, 87,130,102,238,216,
+247,245,226,165,205,123,244, 27,104,199,151, 21, 10,245,218,178,166,171,255, 88,179, 32,180,121, 59, 69, 84,132,175,164, 96,199,
+ 84,162,211,148,192, 36,144,203,122,132, 71, 59,232,198,141, 54,175, 94,183,105, 58,128, 31,234,245,250, 71,255, 85,246,120,254,
+233,223, 38, 9, 69,212,173,203,167,166, 88,114,174,129, 90,204,128,197, 84,249, 19, 22, 51, 40,255,240,103,251,169,127, 0,192,
+ 83, 25, 44, 1, 69,239,227,231,175,121,229,231,229,182, 93,190,244,171, 57, 97,238,228, 16, 44,216,120,183, 4,103,234,107, 44,
+ 25, 12,198,127, 47,222,222,222, 92, 78, 78,206,115,109,217,241,241,241,233,159,157,157,125,240, 25,211,245, 1,128, 55, 30,253,
+186, 38, 39, 39,231,219,103, 77, 87,219,182,109,125, 41,165,158,143,158,253,121,215,174, 93,203, 98, 37,224, 63,105,176, 0, 57,
+ 40, 15,236, 28, 10, 0, 54,245, 61, 24, 5,228, 32, 66,192,172,197,144,126,189,224,234,238, 9,152,203, 1, 83, 57, 96,214, 1,
+102, 45, 96,214,161, 40, 55, 29, 48,105,129,228, 67,224, 40,149,213, 59, 87, 6, 21,112,111, 7,122,182,242,135,155,163, 28,239,
+ 13, 9,115,253,237,240,189, 53,107,142, 38, 70, 3, 24,101, 85, 90, 41, 69,251,200, 38,248,126,141, 54, 97,255,141,130, 62, 0,
+ 48,160,165,235,225,246, 97, 1,126, 43,214,235, 19,254,186, 83,210, 23, 0,250, 69, 56, 30,106, 23,226,229,207, 63, 67,116,151,
+167, 52,202,187, 97, 19, 98,185,245, 43,120,117, 22,212,106, 29,178, 82, 55,192,217,167,181,192,194,163,107, 93,223,183, 17,226,
+227,119,231, 46, 17,151,171,243,141,188,169,208,226, 38, 44, 21,138,164, 60, 65,246, 25, 67, 25,175,180,204,152, 60,158,155,245,
+217,151, 31, 3, 24, 91,107, 52,200, 29,211,191,251,110, 69,100,167, 54,161,238,121,187,222, 35,101,165,249,224,132, 10,217,144,
+142,157,224, 20, 28,198,231,159,254,142, 72, 3,163,225,228, 18,136,236,139,155,145,118,121, 55,233,220,106,184,108,237, 22,201,
+184,154, 12, 86,176, 27,233,220,167, 75,187,109,129,254,222, 94,148,242,224,121, 10,202, 91,240,250,203,189, 49,103,123, 50, 44,
+ 22, 11, 70,244,233,220,115,201,148, 30,148,231,121, 80,202, 35, 51,175,184,252,228,149,132,158, 73, 37,244,138, 53,145,169, 22,
+ 29,186,119,190,115,227,114,168,249,222,159,104, 51,246,235, 4, 2,156,175, 82,230, 58,223, 60,178, 54, 20,248,227,233, 12, 28,
+ 33,164,153, 59, 44,105,135, 23,195,191,203,100,225,175, 91, 14,187,169, 10,179, 39,236,218,240,203,203, 43,127,253,117, 19,128,
+169,236, 49,194, 96,188, 24,228,228,228, 60,119,147,117,241,226,197,156,103, 49, 89,109,219,182,237, 2,224,155,156,156,156, 10,
+179,245, 77,251,246,237,231, 85,173,171,170,160,162,148,142,189,118,237,218,217,218, 52,103,206,156,233, 13,160,209,245,235,215,
+ 43,142,209,168,109,219,182,141,170,219, 87,161, 80, 88, 90,180,104,145,182,108,217,178, 28, 86, 66,254, 94,131,149,144,177,227,
+189, 86,134,220, 50, 0, 72,176,194,164, 60,214,180,167, 55, 91, 22,175, 91, 48,126,113,120,195, 6,208,104,141, 56,122, 61, 13,
+ 22,139, 25, 22,142,123, 20,201,226, 96,225,204,232,211,194, 21, 47,233,167,226,135, 3,137,224, 44,252,215,181,105, 62,137,137,
+242, 99, 90, 70,191,178,157,231,169, 84, 38, 22,168,154,250,185,184,207, 26,209, 66,240,222,144,112,232, 76,220, 43, 97, 30,228,
+100,124, 62, 93,109,149, 38,255,239,115,103,210,234,254,102,225,234,204,123, 45,209,167,246,163, 7,246,114,160, 6, 21,204, 69,
+201,208,148,155,145, 92,108, 70,158, 94, 9, 25,201,181, 74,147,167,104,238,235,227,165,184,176,237,163, 84, 23,161, 90,228, 46,
+228, 36, 82, 1, 7, 11, 79,133, 84, 25,111,104, 16,218, 75, 92,209, 47,171,182,116,218, 40,236,199,119,233, 61,192, 49, 99,243,
+100, 98,211,180, 15,220, 91,249, 33,245,236, 58, 20, 92, 63,128,226,156, 52,226,160, 87,194,195, 37, 8,253,198,142,194,183,163,
+218, 66,163,214, 64,152,155,228, 40, 21,203,156,106,210,164, 22,140,253,110,201,151, 94, 34,161,224,225,249,172,216, 44,102,232,
+ 12, 6,192,194, 65, 46,226, 65,104,197,255,204,176,152, 77,138,230,195, 63,122, 11,192,149,186,242, 30,159, 79,183,132,187,147,
+ 40,240,230, 80,106,214,129, 0,231,227, 10,104,165,233, 9,243, 32, 99, 90,247,153, 24, 69, 9,206, 61,205, 53,138,112,193,192,
+ 54,141,236,108,109,213, 9,200,218,249, 14,146, 32,167, 30,157,222,192,152,215,167, 43,126,251,237,183, 65,132,144,105, 85,251,
+160,253, 29,195,139,153, 38,211,252, 95,213,116,116,116,108,220,176, 97,195,121,102,179,185,139, 68, 34,241, 48,153, 76,224,121,
+ 62, 79, 42,149,158, 75, 75, 75,251, 92,165, 82,165,252,183,229,253,208,161, 67, 86,155, 44,107, 52,197, 98, 49, 78,156, 56,241,
+192, 90,147, 85,205, 2,244, 27,119,238,220,137,237,219,183, 3, 0, 78,157, 58,133,224,224, 96,219,234,190,155,153,153,105, 59,
+ 98,196,136,141, 0,252,106,211,188,127,255,126,227, 47,191,252, 18, 59,119,238, 4, 0,108,216,176, 1, 77,155, 54,173, 54, 61,
+183,111,223, 22,126,250,233,167,141, 1,228,252,221,215,232,159,110,176,146,253,157,165,173,160,183, 0, 64,114,125, 15, 22,159,
+ 71,151,180,240, 18,247, 61,177,243,231, 46,114,137, 0,243, 87,207,202, 44, 44,209,116, 16, 17,240, 0,192, 81, 8,156,237,164,
+151,190,158,208,194,191,180, 76,143,253, 87,179,207,198,229,211,122,133, 66,227,114,232, 49, 0, 78,255,170, 32, 73,211, 9,223,
+ 30,219,186,245,227,190,205,103, 12,105,142,125, 23,211,102, 0, 88, 93,103, 33,231,121, 80,158,171,236,212,254,208,201,240, 0,
+207, 61,246,198,192,131, 62,252, 27, 95,191, 8, 86, 55, 66, 68,165,238,232,215, 64, 33,253,105,202,148, 55, 29,204,133,247, 81,
+ 98,148, 32,179, 84,143, 60,157, 24,101, 34,119,100, 39,196, 88, 4, 4,199,234,142,178, 64, 77, 57,189,147,179,212, 78, 16,209,
+235, 45, 31,245,225, 79, 74,165,132, 19, 58, 12,251,194,169,232,196,178, 52, 78, 91,168, 37, 4,117, 78,112,233,232,232, 20,172,
+ 47, 78, 19,170, 74,139,224,228, 25,142,190,175, 12,196,194, 1, 97,208,168,181, 40, 44,185, 68,155,120, 57,144,244,115,155, 48,
+183, 95, 51, 20,231,231,194, 96, 6,136,214, 80,162, 55,234,203,106, 60,143, 2,252,250,254,236, 15,199, 4,120,185,217, 86, 12,
+ 22,160,188, 5, 45,154, 5,162, 87,151,246, 56,118,254, 2,174,197,220, 3,255,104,176, 0,229,121,100, 21,148,230,235, 77,150,
+117,245, 58,161, 22, 14,212,172,175,214,128,225, 41,154, 6, 35, 61,136,194, 2,124,214,161,137,253,164,143, 7, 6,216,219,202,
+ 8,244,102, 11,244, 70, 51, 52, 23,126,130, 75,195, 72, 40,228,114,210, 10, 58, 17, 0, 54,121, 40,131, 81,133,145, 35, 71,202,
+243,243,243, 79, 15, 24, 48, 32,172, 87,175, 94,138,168,168, 40,104,181, 90, 28, 61,122, 20, 90,173, 54,192,207,207, 47,224,232,
+209,163,195, 59,116,232, 16,239,235,235,219,109,199,142, 29,245,233, 35, 43,194,191, 58,169,243, 0,184, 71, 75,121, 9,241,176,
+163, 57, 79, 41,181, 60,109,218,165, 82, 41, 46, 93,186,244,220, 35, 89, 87,175, 94,125,240, 52,145, 44,173, 86, 43,241,242,242,
+130,139,139, 11, 44, 22, 11,180, 90, 45,246,238,221, 11,149, 74, 5,158,231, 97, 99, 99,131, 47,190, 91,141,132,155,167,113,229,
+202, 21,168, 84, 42, 73, 93,154, 69, 69, 69, 36, 36, 36, 4, 6,131, 1, 28,199, 65,175,215,227,248,241,227,149,191,139, 68, 34,
+124,184,104, 57,238, 93, 63,141, 91,183,110,161,168,168,136,176, 82,253,247, 27,172,103,198, 98,225,230,252,182,126,235,165, 57,
+ 83, 71, 97,250,232,104,191,207,127,222, 29, 29, 95, 72,215, 3, 64,152, 27,153, 48,174,123, 19,127, 39,133, 24, 11, 55, 95, 7,
+ 40,157,243,172,199,139, 45,166,247,194, 61,201,140, 61, 87,210, 79,127, 50,170, 21, 2,189, 28,130,131,130,136, 52, 41,201,138,
+ 53,255,120, 14,206,118,178,144, 1, 45, 93, 15,131,231,225,100, 47, 11,133,133,131,147,157, 44,164, 95,132,227, 33, 0,112, 82,
+ 72, 66,171,139,116,213, 24,238,245,151, 76, 86,200, 68,147,109, 91,123,249,191, 54,168,151, 77,255, 65,195,109,236,196, 28,138,
+175, 28,133, 90,236, 11,115,131, 0, 24,204, 37,200, 74, 73,178,156,184,124, 55,187, 72, 99,152, 85,103, 50, 41,206,102,167, 36,
+186, 53,110,222,203,185,232,192,220,130,198, 19, 55, 55, 18,128, 23,104, 54, 13,203,183,117,111,103,115, 53, 57,165,140,167,255,
+ 30,193,121, 18,181, 74,149,102,182,192, 75,103, 17,217, 39,157, 90,139,143,251, 69,162,180,164, 0,122, 19, 7,149,142, 51,121,
+ 58,201,101,134,148, 88, 24, 76, 28,140,102, 30, 98, 39, 31, 28,189, 20, 83,196,155,205,135,106,210, 76, 42,162,183, 0,216, 85,
+253, 91,144, 27,105,241,145,131,205, 45,152,117, 72,207,202,193,250,191, 46,181,122,180,223,211,191,157,242,220,195,102,230, 42,
+145, 43, 66, 17,245, 52,157,219,155,121,144,118, 54,114,201,143,223,204,120, 53,172, 99,211, 6, 50, 62,235, 18, 8,111,130,173,
+ 69, 4,157,212, 2, 71,191, 64,240, 70, 13, 45,215,235,149,113,255,143, 75, 4, 49, 24,255, 11,132,134,134,122, 58, 58, 58,198,
+205,158, 61,187,193,176, 97,195,176,103,207, 30,168,213,106,172, 91,183, 14, 43, 86,172,192,130, 5, 11, 96, 54,155,241,219,111,
+191, 41,118,237,218,213,238,151, 95,126,201, 10, 8, 8, 8, 79, 79, 79,175,107, 65,117, 2, 64, 6, 64,252,168,238, 34, 0,248,
+131, 7, 15,162,127,255,254, 56,120,240, 32,255,232,111, 22, 66,136,153, 82,106,120, 90,131, 37,149, 74,145,144,144,240, 92, 76,
+150, 88, 44,134,157,157, 29,164, 82, 41, 18, 19, 19,235,109,178, 56,142, 19,102,101,101, 65,165, 82,161,215,160, 65, 88,254,245,
+215,232,222,189, 59,122,245,234, 5, 74, 41,142, 31, 63,142,232, 78, 17, 24, 53,184, 27,238,222,189, 11,179,217,108, 85,122,243,
+242,242,144,159,159,143,190,131, 6, 97,245, 47,191,160,125,251,246, 8, 9, 9, 1,199,113, 56,125,250, 52, 94,238,211, 9,242,
+161,209,184,119,239, 30, 43,212,255, 43, 6, 43,182,128, 94, 14,115, 35, 7, 70,247,105, 55,112, 80,231, 48,172,222,118,226,203,
+176, 48,178, 21, 0, 92,236,101, 95,140,239, 30,136,248,140, 82,156,184,149,115, 32,190,144, 62,151,209, 23,188, 5,174, 46, 14,
+ 10, 64, 40,133,206,196,115, 14,201,168,179, 99, 50, 79, 41, 20, 93, 62,194,184, 65,241,126,237,195,252,252, 42, 70, 17,218,245,
+ 95,134, 9, 49, 15,252,219,134,120,250,195, 98, 6, 44,102, 56,140,218, 12, 44,178,173, 51, 29,157, 27,203,142,125, 52,107,198,
+ 75,253,134,190, 98, 35, 85, 56,194,162,206,132, 57, 47, 6,197,247,207, 66,171, 8, 70, 94,122, 50,182, 31,185,162,186,159, 85,
+172, 22, 8,112, 52, 95,101,248, 32,169,132,150,213,165,171, 55,227,235,121,115,103, 13,216,190,117,155,189, 44,176, 51, 73,250,
+169,191, 74, 42,226,100,110,141, 90, 11,202,229,174,244,171,117,219, 28,180, 70, 44,174, 75,167, 92,171,222,125,252,232,225, 81,
+ 77, 26,119,182, 79,189,246, 23,116,122, 3, 12,102, 32,188, 93, 55, 88, 44, 84, 74, 4,132,119, 16, 10, 73, 65,113, 41,136,217,
+146,127,238,118,106,238,249,219,201, 66,131,125,221,218,143, 21, 58, 34,124,119, 80,183,150,128, 89,135,193, 93, 34,177,124,211,
+137,119, 0, 76,124,182,139,252, 48,130, 69,129,206,225,238,100, 21,128,206,215,247,174, 8,109, 51,244,125,212, 39,130, 21,225,
+ 70,250, 69, 4,121,175, 93,254,197, 71, 13, 92,124,131,133,132, 55,131,122, 54, 7,212, 89,148,100, 93,130,163, 79,123, 88,188,
+ 59,225,183, 31,150,150,241, 60,221,250, 52, 83, 84, 48, 24, 47, 50,122,189,126,247,146, 37, 75, 26, 12, 28, 56, 16, 0, 80, 86,
+ 86,134, 75,151, 46, 97,205,154, 53,176,181,125,252, 57,217,191,127,127, 80, 74, 27,204,159, 63,127, 55,128,142, 53,105,118,234,
+212,105,208, 15, 63,252,144,211,178,101,203,228, 71, 38, 75, 2, 64, 16, 27, 27, 43,200,204,204, 36,206,206,206,212,219,219,219,
+156,147,147,195, 3,176,188,254,250,235, 66, 59, 59,187, 38,101,101,101,103,158,214, 96, 73,165,210,231,210, 39, 75, 44, 22,131,
+ 16, 2,169, 84, 10,137, 68,130,236,236,236,122,153, 44,142,227, 68, 7, 15, 30,196,245,235,215,177,160,101, 75,204,240,241, 65,
+131, 6, 13,112,250,244,105, 80, 74, 97,107,107,139,146,146, 18,108,221,186, 21, 61,122,244, 0,199,113, 18,107,116,119,238,220,
+137, 27, 55,110, 96, 81,155, 54,152,225,232, 8, 59, 59, 59, 28, 63,254,176,213, 79, 38,147, 33, 61, 61, 29,199,143, 31, 71,183,
+110,221, 88,161,254,187, 13, 86, 55, 66, 68,196, 3,158, 38,163, 14,148,163, 0,129,119, 88, 24,145,196,199, 83, 83,125, 15, 42,
+ 16, 96,238, 15,235, 15, 12, 88,246,254, 32, 50,121, 72, 43,239,207,215,158,154, 6, 0,147, 70, 52,245, 81,200, 68,248,126, 95,
+ 60, 21, 8, 48,247,121,100, 48, 44,140, 72, 4, 2, 76,235,213, 62, 4, 57, 74, 35,146,114,148, 39,227, 41,181,170, 73,231,196,
+178,113,216,176,255,116,230,138, 13,250, 4, 74, 41,156,236,100, 33, 19,238, 36,249,175, 61,120, 35,227,187,237,250, 4,202, 83,
+ 56, 41,196,161, 19,239,118,170,115, 20, 97, 91,127,201,228, 57, 31,125,208,105,200,196,217,114, 46, 97, 7,140, 73, 71,192,155,
+116, 80,155, 36, 80, 10, 61,145,149,145,129,175,126, 59,144,169,214, 26, 71,197, 22,212,207, 88,222, 43,162,101, 97,110,100,216,
+ 87, 11, 63, 57,246,245, 23,243,237,116,201,167,203,132,132,211, 9, 27,118, 21,125,177, 96, 25,209, 24,140,175, 36,149, 80, 77,
+ 93, 58, 6,123, 44, 94,242,221, 15, 3,222, 28, 59, 60,161,105,112, 87, 23, 75, 78,138,139, 94,173, 46,216,124,248,134,231,163,
+ 55, 67, 2, 0, 73, 89,197, 40, 84,105, 57, 11,103, 62, 99, 47,198,231,113,214, 68, 3, 31, 17,232, 65,220,134, 69, 53,127,213,
+205, 94, 2, 93,153, 18,238,246, 98,244,105, 31,244,106,160, 7,249, 40, 57,159, 22, 62,189,193, 50,131,154,117,184,188,184, 71,
+ 40,181,152, 67, 97, 49,195,116,103, 99,253, 35, 97, 4, 51,166,119,177,115,112, 54,166, 10,160,181, 5,108, 92, 65, 28, 2, 0,
+199, 70, 68,220,236, 21,228, 36,199,113,239,188, 58,182, 56, 37, 45,235,119, 87, 27,124,203, 30, 33, 12,198,227,164,167,167,143,
+159, 51,103,206,249,246,237,219,123,184,186,186, 34, 50, 50, 18,251,247,239,199,236,217,179, 43,247,105,217,178, 37, 40,165, 40,
+ 41, 41,193,146, 37, 75,242,114,114,114,198,215,166, 25, 23, 23,151,176, 97,195,134, 46, 97, 97, 97, 38,137, 68,162, 4, 32, 83,
+ 42,149,242,146,146, 18,162,215,235,193,243, 60,239,232,232,104,201,201,201, 49,143, 26, 53,202,112,241,226,197, 32,173, 86,155,
+254, 44, 17,172,182,109,219,198, 42,149, 74,149, 64, 32,120,230, 41, 28, 42,204, 85, 68, 68,132,155, 86,171,229, 1,148, 62,205,
+ 20, 14, 28,199,161, 77,155, 54, 56,114,246, 38, 14,158,184, 8,117, 78, 34,166,189, 57, 30,145,145,145, 56,114,228,200, 83, 95,
+179, 22, 45, 90,224,240,241,243, 56,127,253, 54,210,239,221,193, 59,211,222, 68,120,120, 56, 14, 31, 62,204, 10,244,223,109,176,
+154,185,145, 22,222, 77,164, 27,231,247, 11,106, 38,238, 53, 31, 68,108,131, 29,193,135, 59,205,253,234,167,132, 72, 15, 50, 54,
+ 38,191,238,209, 94,143, 69,177,242,105, 92,184, 59,217,114,251,110,232,171,131,219,251, 97,245,126,197,103, 0,240, 74, 84, 99,
+ 92,189, 95,136, 43,247, 10,182,196, 21,208,184,103,205, 92,164, 7, 81,128, 98,203,146,119,135,116, 11,240,245,196,154, 61,231,
+ 65, 8,118, 91, 85,209, 82, 74,219,135, 5, 96,197,134, 39, 71, 12,122,250,127,183, 93,159,112, 36, 86,221, 15, 0,122, 55,179,
+ 61,212, 54,200,217,191,174, 72,134,141, 84, 52,165,223,240,113,114,238,222,126, 32,237, 56, 8,103,128,206,196, 35,183, 72,131,
+114, 71, 63,156,190,116, 91,167,210, 27,223,143, 43,120,186,168, 93,124, 33, 77,110,233, 69, 50,202,180, 58, 47,133, 91,144, 94,
+ 40,224,249, 50, 3,197,213,248, 52,117, 92, 46, 77,180, 70, 35, 41,137, 26, 59,250,146,168, 85,235,183,207, 19, 75,164,175, 8,
+ 9,136,187,147,173,219,170,101,139, 96,111,111, 7,222, 88,246,127,236,157,117,120, 84, 71,219,198,239, 57,235,217,221,184,111,
+ 18,136,224, 1, 2, 73,112, 40,161, 4, 45,148, 66,161, 20,104,145,182,120,129, 66,145, 82, 40, 82,156, 22, 43, 69,107, 80,220,
+139,123,112, 77, 32, 33, 9,132, 32,113,119, 91, 61,123,230,251, 35,242, 6,136,108, 2,253,222,190,244,252,174,107,175,100,237,
+222, 57,115,100,238,243,204,204, 51, 64, 97, 58,250, 79, 88,146, 30,150,168,247, 4,128,134,118, 68,249,142,151,120,155,144, 33,
+ 9, 23,162,117,115,170,251, 13, 98,192,216, 97, 61, 90,138, 56, 93, 33, 38, 45,223,131,205, 51,251,225,147,174, 77, 68,199,175,
+ 69,141, 5,176,176,182,251,154, 26, 89, 80,131, 26,237,102, 95,126, 72,128,171, 20,232,120,119,239,162,198, 64,136,201, 26,126,
+132,136,132,206,164,137, 79, 29,133,152, 75,184, 6, 46,225, 26, 21,184,117, 0,169,243, 14, 33, 78,254,244,167, 21,243, 11,183,
+110,253,229, 12,199, 96, 65,117, 41, 47,120,120,254,173, 80, 74,159, 90, 89, 89,245,236,221,187,247,249,211,167, 79,219, 52,107,
+214, 12, 0, 80, 58, 99,205,223,223, 31, 13, 27, 54, 68,106,106, 42, 62,254,248,227,140,228,228,228,158,148,210, 42,199,244,230,
+231,231, 63,219,191,127,191, 99, 97, 97, 97,203, 57,115,230,164,213,173, 91, 55, 79,163,209,144,156,156, 28,142,101, 89, 88, 91,
+ 91, 75, 90,182,108,137,246,237,219, 23,220,184,113,195, 61, 62, 62, 62, 31, 64, 76,109,202,255,249,231,159,227,224,193,226,102,
+226, 77,228,197, 18,139,197, 8, 12, 12,116,185,126,253,122, 34, 0,212, 38, 47, 86,249,230,229,254,253,251,184, 20,146, 0,161,
+ 78, 13, 73,122, 18,110, 30,218,143,190, 99,198,131,101,107, 63, 90,225,254,253,251, 56,124,238, 38, 20, 82, 33, 30, 61, 10,199,
+254,253,251, 49,110,220,184,215,210,228,169,198, 96,213,171, 71, 36,210, 2,204,235,225,239, 50,227,163,142,245, 4,134,188, 36,
+112, 70, 14, 2, 17,224, 96,103,129, 63,255,220,229,185,107,207,158, 27, 45, 92, 68,235, 56,150,253, 54, 44,149, 22,213,224,183,
+231,173,218,115,245,163, 63,167, 5, 8,199,245,106,108, 3, 0, 98, 33,131,181,127,133,179, 0,230,189,206, 70,181,115, 37,178,
+ 2, 3, 70, 59,217, 90,206,253,230,243,247,108, 2,252, 27,226,210,173, 7, 88,183,255,198,101, 73, 26,182,155,124, 80,115,134,
+151,167,192, 86, 56,139, 16, 92,245,227, 41,141, 70,234, 36, 86, 88, 67, 31,115, 17,208,107,160,209,234, 17,159,105, 68,124,150,
+ 6, 66,185, 24,119,163, 18,212,182, 41, 56, 86,219,109, 38,132,144,142, 94, 50,213,119,139,127,116,213,168, 11,216,188,236, 12,
+ 86, 44,185, 41,146,155, 73,147,107,162,115, 35,129,106, 58,123,138,253, 0, 78, 32,145,209,162,217, 83, 71, 40, 18, 35, 78,163,
+ 62,147, 4, 66, 41,204,154,188, 7,115, 51,129,184,147,135, 56, 14, 0, 60,156, 44, 37,203, 23,124,109, 57,101,230,130,106,199,
+120,121, 19, 34,110,222,202,105, 74,179,186,214,184, 28,252, 16,151,195, 98,195, 47,223,125,212,180, 75,115, 21, 26,186, 90, 77,
+246, 38,100, 89, 4,173,121, 68,180,120,199,176,128, 65, 83, 54,139,208,219,145, 12,105,245,209,156, 10,103, 15, 86,134, 7,192,
+ 69, 25, 41,136, 64, 0, 16,166,120, 70, 99,252, 53, 8,173,188,232,174,189,135,139,126,249,101,251,247, 17,233,148,143, 90,241,
+240, 84, 67, 78, 78, 78,168, 92, 46,239,225,227,227,243,199,164, 73,147,204,135, 13, 27,166,250,226,139, 47, 24, 0, 72, 77, 77,
+229,214,172, 89,147,244,211, 79, 63,229,102,100,100,140,212,235,245, 97,166,220,240, 18, 66,174,255,250,235,175,233, 87,174, 92,
+105,218,186,117,107,169,159,159, 31,103,109,109, 45,148, 74,165, 70,157, 78,167,137,138,138, 50, 62,125,250,212, 57, 39, 39, 39,
+ 26,192,147,218,116,223,171, 84, 42, 48, 12,179,208,213,213,245,187,164,164,164,102,111, 98, 12, 86,253,250,245, 85, 0,162, 93,
+ 92, 92,234,215,180,123,240,149, 6, 91, 40, 68,118,118, 54,138, 82,194, 33, 75,120, 12, 31, 5, 3,111,107, 37, 44, 44, 44, 94,
+203, 12,229,230,230, 2,133,137,184,122,245, 62,192,178,176,180,180,132,165,165, 37,111,176,254, 46,131,213,212,129,140,179,150,
+ 96,205,152,247,234,137, 61,234,184, 66,155,112, 23,247,227, 11,240,109,219,214, 17, 2,169,185,102,204,167,253,252, 7, 12,116,
+ 71, 64,251, 86,196,195,217,114,242,178, 85, 27, 39, 52,117, 36, 95,135,167,210,181,166,252,112,120, 26,125,214,196,129,252,114,
+ 49, 52, 97,172,171, 92, 13,142,163,184, 24,150,140,176,152,236, 95, 34,211,232,179,154,108, 68, 83, 21, 9, 20,130,217, 67, 41,
+149, 89, 42, 20,249, 45, 91, 52,182, 11,108,215,130,233,217,217, 31, 98, 1,112,245,246,125,124,181,234,224, 77,142,163,239, 5,
+155,216, 61, 88, 60, 99,240, 69,227, 84, 60, 99,208,240,194,140, 65, 74, 41, 45,158, 69, 88,245,176, 46,129,128,164, 20,197,222,
+113, 18,217, 54,128,250,201, 69,196,100,115,136, 77,203, 71,158,208, 9,218,196, 68,128,114,113, 65,148,214,250,104,182,179,179,
+115,240,244,110, 88,111,253,182,253,208, 23,229,226, 89,208, 31, 40,200, 78,198,162, 77,127,213,115,117,117,237,156,144,144,112,
+169, 6,102,173,225,249, 99,187, 28, 64, 1,129, 72,138,227, 27,246, 34,195,214, 12,118,114, 49, 56,117, 58,198, 76, 25,102,217,
+171,219, 48, 75, 0,136,125,116, 15,117,229,106,147,116,245,182, 24,240, 81,151, 70, 86, 48,168,177,237,212, 61, 13, 3,244,220,
+126, 38,252, 73,151,198, 86,178,143, 58,214,181, 94,152,148,243, 33,106,153, 12,180, 52,130, 85, 22,209,171,197,236,193,125,148,
+ 26,155,216,147, 39,123,174,167, 41, 6,118,243,147,139,133,132,208,130, 68, 80, 51, 59,108,220,182,175, 64, 98,192, 22,254,146,
+193,195, 99, 26, 69, 69, 69,193,132,144,230,211,167, 79, 31, 50,123,246,236,119, 20, 10,133, 39, 0, 20, 22, 22, 62, 51, 24, 12,
+151, 1,236,170,201,108,191, 18,195, 20, 77, 8,121,246,228,201, 19,199, 29, 59,118, 88, 1,144,149,188,173, 1,144, 3, 32,245,
+117,102, 16,150,154, 41,149, 74,245,221,155,170,135, 82, 51,229,226,226, 82,191, 54,223, 23, 8, 4, 70, 66, 8, 8, 33,144, 74,
+165,184,114,229, 10, 6,189,215, 13,145,199,115,208,204, 74,137,214, 35,199, 96,207,217,179, 16, 8, 4, 32,132, 64, 32, 16,212,
+168, 29, 17, 10,133,184,122,245, 42, 62,249,120, 32,164, 66,192,210,210, 18,211,167, 79,199,145, 35, 71, 32, 20,242,171,233,253,
+ 61, 17, 44,130,133,103,255, 88, 34,134,209,128,163,127,252,128, 99, 15, 10,116,143,210,241,109,163,116,172,217,143,124, 46,125,
+213,246,177,103,175, 62, 88, 57,106,112, 31,249,187, 93,186,225,221,128, 46,194,166,173, 58,207, 5,176,182, 92, 67, 29, 88, 85,
+174, 12, 35,135,239,183,156,122, 56,102, 79, 80, 20,129, 62, 31,131,187,183,162, 70, 14,223, 87,211,248,191,162,105,105,166,220,
+115,245,198, 13,107,232, 11, 16,115,239,130,204,221,179, 30, 96,212, 35, 58,250, 49,126,218,118,136, 11,186,253,232, 79, 29,139,
+ 73, 79,178,104,161,169,154,197,142,138,133,165, 66,210,168, 87, 51,203,147, 28, 40,172,228,226,198,148, 51,194, 74, 46,106,220,
+189,137,226, 36,165,148,154,155,137, 26, 83,163,161, 90, 77,181,142,221,188,237,183, 95,126,252,236,179,207, 20, 25, 9, 41, 72,
+202,123,128, 2,137, 11, 12,114, 55, 60,185,119, 89, 93,164,101,171,109,188,171,170,207,140,140,140,180,224, 91, 89,216,179,105,
+ 41, 12, 58, 45,210, 18,138, 61,106, 82, 70, 30, 44,236, 92,110,212, 68, 83,207,114,185, 3,134,141, 22,155,153,195,236,147, 1,
+125, 36, 79, 50,181,240, 85,153, 23, 95,228, 10,210, 17,121,238, 42, 2, 10,139,253,218,211,120, 6,117, 91,168, 76, 42,167,185,
+ 76, 60,169,151,159, 11,158,197, 37,227, 74,120,226,182,167,153, 52,201,203,150,108,123,146,148, 51,182, 95,219, 58, 88,125, 36,
+226,203,202, 76, 81,101,154,222,142,100, 8,128,142,197,131,220,213,160, 64, 71,111, 71, 50,196,148,153,131, 21,105, 10,197, 24,
+250,227,201,216, 57,251,238,100,244,155, 49,180,147, 69,251,246,189, 37, 96,117,200, 87,107, 13, 17,217, 52,239,117,246,209,107,
+ 68, 39,121, 77, 94,243,127, 82,179,196,236,252, 89,242,120,147,154, 73,120, 41, 47,211,235,110,123,249,238,192,164,164, 36, 97,
+ 73,244,170,202, 65,238,213,105,150,239, 14, 76, 76, 76, 60, 81, 18,189,170, 50,138, 85,129,102, 82,155, 54,109,108,250,246,237,
+ 11,163,209,136,199,143, 31, 35, 54, 62, 30,129, 99,191,132,149,149, 21, 46,135,134,226,209,163, 71,248,238,187,239,192,113, 28,
+110,222,188,153, 80,157,166, 72, 36,210,183,104,209, 66,252,193, 7, 31,128,101, 89, 60,125,250, 20,137,137,137,248,234,171,175,
+ 96,105,105,137,224,224,224, 50, 77,173, 86,139,103,207,158,233,255, 63,142,165,127,143,193, 2,140, 48, 26,144,123,118, 30,214,
+ 94,129, 94,111, 64,227,240, 52,250,188,220,251, 27,125,108,201,209,208, 7, 15,159, 5, 95,123, 87,130,180,176,226,239,212,128,
+168, 12,154,220,202, 77,152, 15,125,190, 5,158,158,196,243,212,252,130,168, 12,154, 92,211,141,160,156,145, 64, 95, 4, 36,223,
+197,245,203,151, 16,116,243, 62,238,132, 61, 52, 94, 15,142,218,195,112,248, 62, 34,131, 62,174,177, 38,165, 80,190,183, 26, 35,
+194,162,235,180,106,232, 88, 7, 70, 22,148, 51,192,114,240, 46,140,140,104, 95,167,149,151, 85,157,226,200,149, 1,214,159, 95,
+ 0,126,148, 85,169,119, 39, 78,191,165,163,167,244,195,252,156,204,182, 93, 59,183, 83, 88, 54,233,133,140,232, 40, 60,190,127,
+ 85, 29,252,224,201,245, 59,113,250,215,138,142,184,184,184,188,211,181,115, 35, 12, 30,243, 13,244, 69,185,120, 26,244, 27, 10,
+178, 82,112,229,134, 18, 15,243,242,218, 1, 48, 57,130,117, 61,214,208, 20, 0, 58,122,136,227,204,161,117,250,180, 79, 95, 72,
+137, 6,156, 54, 15,164, 40, 3, 79, 18,117,185, 31,110,138, 55, 2,128, 92, 74,132, 10,154,107, 97,138,174,119, 93,219, 6,114,
+129, 1,219,207,134,131,227,138,151, 89,226, 56,108,220,126,225,201,216,239, 63,241,133,119, 29,235, 22,132, 16, 82,147,208, 62,
+161,232,116,103,207,130,198,154,243,115, 1, 78,143,171,147,109, 26,119, 90,155,213,169,182,145,176,176, 68,154, 8, 96,108, 19,
+ 21,217, 60,121,237,169,185,254,103, 35, 58, 78,251,188,159, 5, 40,191, 48, 58, 15, 15,207,127, 37, 18, 56,102,230,204,153,155,
+ 5, 2,129, 61, 0, 66, 41,133, 86,171, 21,110,218,180, 73,196,178, 44, 35, 16, 8,140, 50,153,140, 13, 14, 14, 54,112, 28,151,
+174,215,235,199, 84,167,169,211,233,158,172, 95,191,190,158,193, 96, 40,155,113,168,213,106,241,219,111,191, 65,171,213, 66, 42,
+149, 66,169, 84,226,233,211,167, 32,132,232,141, 70,227, 19,126, 79,188, 73,131, 69,177,160,195, 39,243,230, 1, 32,160,152,255,
+146,185, 2, 0,132,102,210,164,166, 14,228,171,166,173, 58,207, 43,253, 78, 77, 11,160, 49, 26, 7,182,106,222,112, 55, 0,104,
+169,241,147,218,108, 68,158, 86,253, 81,203, 86,237,246,112,148, 10, 89, 74,127, 97, 56, 28,208,176,136, 52,101,230, 92,165,119,
+ 30,105, 57,193,165, 11, 56,115,160,255,233, 22, 44, 73,199, 64, 41,165,101,221,130, 63,200,144,145,171,173, 54,143,211,213,103,
+218,110,173,234,136, 71,159,185,118,111,140,209, 72,157, 4, 2,146,162,214,177,155, 95,215, 92,149,220,125, 93,242,118, 32,103,
+ 66, 91, 56,118,183,147,151, 68,181,138,128,140, 34,156, 73, 72,203,191, 84, 27,205,236, 66, 67,191,217,107,142,252, 37, 17, 9,
+132,160,180, 56, 17, 40,165,208,232,141, 89,165, 38,204,199,150,168,166, 31,102,119, 11, 4, 36,182, 58,189, 91,143,146, 87, 15,
+ 94,118,238,235,240,152,236, 95,158,103,211, 7, 0,240, 60,155, 62,168,111, 75,230, 62, 73,201,255,250, 65,108,246, 15, 53, 29,
+ 55, 65, 9,174,180, 26, 60,239,149,215, 94,183, 62, 35,147,232,125, 0,253,155, 58,144,110,131,167,253, 52,141, 16,240,203, 68,
+240,240,252,139, 40,141, 98, 49, 12,179,240, 77,105,150, 70,177, 0, 68,215,224, 59,183, 0, 52,127,147,219, 22, 28, 28,156, 9,
+ 32,147,223,203,255, 37,131, 21,158, 70, 55,194,132,197,156, 77,253, 92,165,223, 79,162,231, 0,216,190,206, 70,148,104,216,188,
+201,138, 9, 77,165,115,255,142, 10, 47, 49, 83,127,203, 88,158,136, 52,218, 3, 0, 26, 52,104, 64,163,163,163, 65, 41,125,173,
+236,187,145,233,244, 62, 94, 90,114,161, 34,147, 13,160,147, 41,122, 81, 25,244,123,224,213, 46,224,232, 76,186, 8,192,162, 90,
+109,115, 45, 51,181,155,124,108,165,209,179, 64,245,217,244,121,120,120,222, 78,147,245,166, 53, 95,119,225,103,158,183,192, 96,
+241,252,239,242,248,241, 99,126, 89, 3, 30, 30, 30,158,202, 49,254, 13,154,124,210, 97,158, 23, 96,248, 42,224,225,225,225,225,
+225,225,225,121,179, 16, 0,129, 21, 90,241, 26,204, 14, 32,132, 4,214,216,234, 87,163,207,107,242,154,188, 38,175,201,107,242,
+154,188,230,219,167, 89,157,246, 91, 51, 59,145,150, 27,188,252,166, 31, 0, 2,121, 77, 94,147,215,228, 53,121, 77, 94,147,215,
+228, 53,255,109, 15,190,139,144,135,135,135,135,135,135,135,231, 13,195, 27, 44, 30, 30, 30, 30, 30, 30, 30, 30,222, 96,241,240,
+240,240,240,240,240,240,240, 6,139,135,135,135,135,135,135,135,135, 55, 88, 60, 60, 60, 60, 60, 60, 60, 60, 60,181,135,212,112,
+101, 18, 30, 30, 30, 30, 30, 30, 30, 30,158,106,224, 35, 88, 60, 60, 60, 60, 60, 60, 60, 60,188,193,226,225,225,225,225,225,225,
+225,225, 13, 22, 15, 15, 15, 15, 15, 15, 15, 15,111,176,120,120,120,120,120,120,120,120,120,120,131,197,195,195,195,195,195,195,
+195,195, 27, 44, 30, 30, 30, 30, 30, 30, 30, 30,222, 96,241,240,240,240,240,240,240,240,240,252,247, 13, 22, 33, 36,144,215,228,
+ 53,121, 77, 94,147,215,228, 53,121, 77, 94,147, 55, 88, 60, 60, 60, 60, 60, 60, 60, 60, 60,188,193,226,225,225,225,225,225,225,
+225,225, 13, 22, 15, 15, 15, 15, 15, 15, 15, 15,111,176,120,120,120,120,120,120,120,120,120,120,131,197,195,195,195,195,195,195,
+195,243, 95,130, 0,168,112, 38, 0,165,244,156,201, 34,181,152, 77, 80,157, 62,175,201,107,242,154,188, 38,175,201,107,242,154,
+111,159,102,117,218, 53,241, 31,255,104, 40,165,127,219, 3, 64, 32,175,201,107,242,154,188, 38,175,201,107,242,154,188,230,191,
+237,193,119, 17,242,152, 26,165,116, 36,132, 56,242, 53,193,195,195,195,195,195, 83, 61,194, 55, 41,214,152,144, 54, 43,223,169,
+ 51,175,247,165,216,158, 38, 52,216, 12,254, 51, 6,140, 43, 14,166, 21,219,226,215, 48, 1,111, 92,147, 7, 32,132, 44, 37, 4,
+ 51, 74,254, 95, 65, 41,253,230,109,220,206, 25, 51,102, 12,244,245,109, 5,107, 89, 42, 90,121, 61, 6,178,119, 1,214, 31, 97,
+206,233, 46,104,229,219, 1,151, 67,226,113,249,102, 56,110,108,232,139,207,167,204,131, 70,163, 71, 70, 70, 18,238, 95, 61,181,
+255, 45,218,215,109, 69, 34,209, 71,214,214,214,230,105,105,105,231, 1,252, 5,224,125, 7, 7,135,174,217,217,217,249, 6,131,
+ 97, 47,165,244,102,109,180,223,105, 73,102, 74,196,162, 81, 26,189, 97,249,213,123,244,183, 0, 63, 98,203,114, 88, 38, 19, 11,
+ 59,105,117,236,138, 43,247,233, 47, 53, 44, 43,121, 41, 26,207,159,235,175,201,187,239,190, 59, 66, 32, 16, 44, 6, 0,163,209,
+248,237,133, 11, 23,254,120, 19,186, 42,149,106, 8,165, 84, 81,178,223, 10,147,146,146,118,153,250, 93, 63, 63,191, 88, 0,117,
+ 74,158,198, 5, 7, 7,215, 53,229, 61,158,154,113,247,238, 93, 90,183,110, 93, 52,111,222,252, 81, 74, 74,202, 79,148,210,141,
+124,173,252, 67, 12, 86, 35, 66,234,143,237,221,254,108,247, 15,123, 40, 76, 49, 66, 46, 46, 46,203,236,237,237,199, 21, 21, 21,
+105, 0, 80,129, 64, 64,155, 52,105, 2, 66, 8, 74,175,155, 70,163, 49,253,225,195,135,205, 76, 53, 87,111, 74,179, 97,195,134,
+119, 25,134,113, 45,127,253,174,238,127,142,227, 18, 34, 34, 34,252,171, 43,167,179,179,115, 15,134, 97,102, 85,247, 57,142,227,
+150, 37, 39, 39,159,174,234, 51,205,155, 55, 15, 81, 40, 20,142, 12,195,144,202, 62, 83,190,205, 97, 89,150, 22, 21, 21,165,134,
+135,135,251,214,160, 17,115, 36, 4, 51, 56,142, 50, 0,192, 48,100,166,181,181,245,206,236,236,236,136,210,247, 75,126, 39,181,
+ 38,199,139,139,139,203,112, 0, 95, 3,160, 0,126, 76, 76, 76,220, 86,147,239, 55,104,208,224,174, 88, 44,118, 21, 8, 4,228,
+229,125, 82,209,115,142,227,168, 78,167, 75,120,244,232, 81,165,251, 40, 40,232,210,190, 21, 43, 86,132,108,249,245, 23,223, 22,
+ 45, 7,130,145,119,129,158, 90, 32, 36, 70,139, 86, 45, 8, 40,199, 65,147,151, 6,142,227, 80,164,209,226,252,161,223, 66,234,
+120,212,243, 69,241, 88,198,183,193, 92,245, 28, 62,124,248,146,229,203,151,219, 73, 36, 18,102,239,222,189,237,190,250,234,171,
+ 81,171, 87,175,118,249,232,163,143,204,117, 58, 29, 55,115,230,204,119, 8, 33, 11, 40,165, 71,106,162,221,190, 37,105,219,200,
+195,249,187,137,195,222,197,215, 75,119, 79,236,216,156,100,152, 41,196, 27, 63,236, 84,207,170,169,167, 53, 22,108,190, 62, 9,
+192, 47, 53, 40, 43,113,115,115,107,233,232,232,232,161, 86,171,141, 0,208,180,105, 83, 42, 16, 8, 94,248,156, 94,175,215, 63,
+124,248,240, 4,127,169, 55, 13,129, 64,176,248,212,169, 83,206,148, 82,244,232,209, 99, 49,128, 55, 98,176, 40,165,138,228,228,
+228,210,107,160,162,134, 95,175, 19, 28, 28, 92,106,168,234,212,224, 61,147,105,215,174,157,140,213,235,199, 11, 24,166, 59, 5,
+154,163,248,164, 14, 51, 2,103,133, 66,225,207, 55,110,220,208,188,237,251,254,236,217,179, 24, 61,122, 52,194,194,194, 26,157,
+ 56,113, 98,131, 74,165,154,144,156,156,220,133, 82,154,206,159, 25,255, 69,131,213,148, 16,135, 62,126,141,174,140,255,100,160,
+156,219,191,134, 96,196,156, 42,141,144,179,179,243,242, 78,157, 58,141,218,177, 99,135,226,240,225,195, 10,119,119,119,136,197,
+ 98, 8, 4, 2, 8, 4, 2, 48, 12, 3,161, 80,136,247,223,127,223,164,134,235,101,205,243,231,207, 43, 26, 54,108,248, 74, 35,
+203, 48, 12,122,245,234, 85,173, 38,195, 48,174, 33, 33, 33, 14, 50,153,172,204,164,112, 28,247,194,163, 92, 63, 52, 88,150, 69,
+167, 78,157, 76,170, 43,134, 97,102, 69, 70, 70,190, 83, 88, 88, 88,101,223,109,137,222,233,106,180, 84,215,174,156,119, 32,250,
+103, 0,155, 5, 42,176, 1, 36,158, 0, 35,173,240,243, 89, 89, 89,232,210,165,139,224,117,246,245,123,239,245, 33,148,210, 67,
+ 42,149,234,124, 70, 70,134, 57, 33,248,184,150,145,173,111,162,162,162,204, 41,165,104,212,168,209, 44, 0, 53, 50, 88, 2,129,
+192,245,204,153, 51, 14, 82,169,180,108, 63, 87,246,215,104, 52, 66,175,215,163,103,207,158,108, 53,166, 22, 63,111,254,205, 87,
+163, 53, 64, 67,221, 17, 30, 89,136,147, 39, 15,193,163,208,128, 39, 15, 52,224, 56, 21, 52,249,105,160,148, 66,173,209,161, 69,
+192,135,190, 28,247,246, 4, 77, 44, 45, 45, 7,174, 94,189,218,254,151, 95,126,201,123,244,232,145,126,211,166, 77,246, 99,198,
+140,105,172,215,235, 49,118,236,216,244, 70,141, 26,137, 87,175, 94,109,127,232,208,161, 30, 0,106,100,176,132, 4,223,127,220,
+175, 59, 52, 6, 6, 6, 3,107,239,108,111,254,231,228,225, 1, 34, 74,117,216,126, 36, 24, 6,150,251,173,166,230,170, 87,175,
+ 94,117, 55,110,220, 40,140,140,140, 20, 54,105,210, 4, 70,163,177,236,193,113, 28,140, 70,163,201,231, 37,207, 11,231, 22,226,
+227,227, 97,105,105,105, 22, 16, 16,144, 76, 8,153,127,241,226,197, 45,127,199,111,189, 78,100,235, 77,225,231,231,215, 90,200,
+ 48, 7,230,206,158,232,228,211,178,165,192,193,209, 30, 81,143,227, 32, 22,112,129,209, 15,163, 2,150,252,176,113,178,159,159,
+223,135,193,193,193,183,223,182,125, 93,119,192, 47, 27, 56, 86, 63,174,248,153, 21,128, 45,200,207,207,199,231,159,127,142, 35,
+ 71,142, 52,105,219,182,237, 50, 0,163,248,179,226,191,100,176,188, 9, 81,180,112,119, 10,250,254,235, 49,214,244,228,239, 76,
+ 81,102, 26,196, 85, 24, 33, 39, 39,167, 69,157, 58,117,250,100,199,142, 29,214,132, 16,156,157, 56, 10,214,122, 13, 84,223,173,
+128,181,157, 61,116,179, 70,195,220,200,194,231, 98,168,169, 23,219, 87, 52, 31, 61,122,132,236,236,108,216,217,217, 65, 46,151,
+ 67, 38,147, 65, 44, 22, 67, 34,145,152,170, 9,153, 76,134,115,231,206, 65, 40, 20, 66, 32, 16, 64, 40, 20,150, 61,202, 63, 23,
+ 8, 4,112,116, 52,125,104, 18,199,113,203, 26, 55,110,236, 19, 21, 21,101,145,147,147,131,182,109,219,230, 17, 66, 66,203,221,
+233,249,132,134,134, 90,152,220,216,232,159,161, 32,110, 19,104,246, 1,192,106, 0,140, 22,131,161,129,103, 89, 3, 83,254, 47,
+199,113,181,185,243, 76, 37,132,172,232,219,183,207, 44,128, 32, 48, 48,176, 96,226,196,137,244,209,163, 71,221, 63,248,160,159,
+199,227,199,209, 37,102,143,204, 32,132,172, 53, 53,146, 69, 41,149, 2,192,149, 43, 87, 64, 41,149,213,230,216,147, 74,165,184,
+113,227, 70, 89,132,146, 97, 24, 48, 12, 3,129, 64,128,163,209,118, 40,212, 49, 40, 74,125,128, 47,251,212,129,167,167,231, 43,
+134,251,149,125, 67, 41, 38,140, 25, 21,178,112,249, 26, 95,163,209,136,147, 39, 79, 98,213,170, 85,208,106,181, 8,232,218, 29,
+207,105, 11, 52,243,180, 3,199,113, 80,107,116, 8,189,116, 32, 68, 85,199,211,247,109,185, 24,228,230,230,254,217,176, 97, 67,
+ 65,122,122,250, 5, 0,207, 12, 6,195,250, 63,255,252,211,225,179,207, 62, 75,219,177, 99,199, 68, 0,110, 43, 87,174,236, 81,
+ 80, 80,176,167, 38,186,157, 90,144,222,254, 45,155,181,173,227,230,134, 75,215,111, 67, 44, 17, 89,141, 31,209, 7, 74,165, 16,
+ 63,252,114,156,139, 77,200,154,120,229, 62,221,102,226,185, 73,156,157,157,125,186,119,239,238,182,113,227, 70, 49, 0, 60,120,
+240, 0,105,105,105,176,181,181,133, 76, 38,131, 72, 36, 42,187, 97,227,169,145,209,104,216,165, 75, 23,153,209,104, 68, 97, 97,
+ 33, 54,110,220,104,105,102,102,102,217,171, 87,175,121, 0, 76, 54, 88,237,219,183, 79,213,233,116, 14, 0, 32,145, 72,210,174,
+ 95,191,238, 8,160,200,195,195,195,172,228, 35,234, 26, 70,182,226,202, 69,167,226,106,240, 94,181,248,251,251,183,106,210,208,
+227,220,210,165,243,149, 57,121, 41,176,180, 76, 5,131, 28,108,217,242, 51,204,204, 44, 48,111,222,108,161,127,155, 54, 46,147,
+191,154,125,206,207,207, 47,240,109, 51, 89, 28,171, 31,215,194,191,125,217,243,109,103,215, 65,107,233,139,196,249,243,177,102,
+205, 26, 52,104,208,160, 53,127,102,252,151, 12, 86, 0, 33, 66, 87, 27,229,209, 13,243, 38,123, 48, 55,142,137,212,113,209, 72,
+210, 24, 97,245,159,147,231, 92,249, 11, 35, 0,198,209,209,113,252,174, 93,187, 44, 74, 27,187, 70,196, 8, 43,232,225,209,180,
+ 41,228,150, 86, 72, 97,245,160, 6, 61,196, 34, 81,133, 13,162, 41,154,165, 17, 48,177, 88, 12,177, 88, 92,118,193, 21,139,197,
+213,106,190, 80, 57, 66, 33, 24,134,193,217,179,103,193,178, 44, 6, 14, 28,248,138,185, 18, 10,133, 47,116, 65, 86,167,153,156,
+156,124,218,197,197, 37,148, 82,250,142,209,104, 4, 33, 36, 52, 49, 49,177,115,233,251,206,206,206, 61, 90,180,104, 49,139,227,
+184,101, 38,149,147,205, 4,205,218, 5,243,118, 25,200,187, 97, 7,162, 8, 4, 71,220, 17,246, 56, 25, 23,238,196, 32, 61,187,
+ 16,126, 13,237,209,163,125, 61, 24,141, 70,147,183,189, 60, 46, 46, 46, 87,210,211, 51, 6,189,251,238,187,200,202,202, 98,231,
+207,159,143, 22, 45, 90,160, 97,195,134,149,153,167,106, 53, 9, 33, 73,161,161,161,238,106,181, 26,132,144, 36, 19, 12,217,185,
+138,140,240,159,127,254, 9,141,230,213,232,189,117,231, 37,248,122, 64, 93,140,252,114, 27, 86, 60,218,139, 13, 27, 54,224,229,
+ 33, 58, 47,107,114, 28,135,133,203,214,248,170,181,186,178,186,210,106,181,184,113,227, 6,180, 69,249,184,184,227,139,178,232,
+165, 90,163,131,171, 79, 55,223,234, 52,223, 4,255, 95,154,148,210, 32, 0, 65,229,234,119,206,142, 29, 59, 6, 1, 56, 72, 41,
+189, 14,224, 58,128,221, 53, 46, 39,193,200,143, 6,124, 0,161,216, 28, 15,163, 19,208,185,157, 47, 28, 29, 28, 16, 26,249, 4,
+177,137, 89,169,132, 96, 68,207, 14,210,101,106,181,110,206,229,123,244,215,234, 52,157,157,157, 61,183,108,217, 34, 42, 31,113,
+ 17, 8, 4, 47,156,235,165,175, 85,100,178,254,151,247,209,223,165,233,231,231,215, 48, 32, 32,224,250,162, 69,139,172,226,227,
+227,113,237,218, 53,184,187,187,163,168,168, 8,213, 13,109,123, 89, 83,167,211, 57,148,235,182,115, 0,128,148,148,148,221,248,
+ 79, 87, 58,173, 73, 57,171, 26, 87, 85,147, 49, 87, 47,151,179, 94,189,122, 18, 59,107,235,125,203,150, 47, 84, 70, 68, 94, 70,
+203, 22,109,161,180,244, 6,103, 76, 65,102, 86, 1,178,163,147,176,104,209, 10,204,155,255, 45, 86, 44, 95,164, 28, 60,100,228,
+129,118,237,218,213, 47,223, 93,248,191,190,223, 25,161,120,227,253,187,215,199, 1, 64, 94,228, 65, 76, 30,210, 30,249,249,209,
+ 24, 59,118, 46, 18, 19, 19,241,248,241,227,224,255,207,114,242, 6,171,156,185,241,151,138,118,238,158, 55,177,181, 52, 38, 76,
+162,125,112, 3, 73, 90,142,254, 17,207, 38,254, 80,197,247,138,138,138,116, 71,142, 28,193,153, 9,163, 80,159,176,176,249,110,
+ 37, 28, 93, 92,144, 51,242,125,228, 27,244,168,119,242, 54,164, 74, 37, 36, 10,101,181, 17,135,242,154, 23, 47, 94, 68,120,120,
+ 56,132, 66, 33,148, 74, 37,148, 74, 37,164, 82, 41, 36, 18, 73,153,185,170,204, 96, 85,114,240, 64, 32, 16,224,193,131, 7,136,
+141,141,133,149,149, 21,174, 93,187,134,174, 93,187,190, 18,197,170,229, 1, 95, 97, 68,169,100,220,213,105, 83, 53, 32,178, 3,
+108, 62, 65,254, 77, 21, 96, 61, 12, 6, 88,193,104, 52,226, 94,116, 38, 70,127,242, 30, 0, 96,252,156, 77, 8,108,227, 81,102,
+ 14, 76, 69,165, 82,153, 1,152,209,160, 65,131,193, 67,135, 14,101,197, 98, 49, 10, 11, 11,161, 86,171,241,224,193, 3,246,189,
+247,250, 20,244,237,219, 71,121,252,248,113,142, 82,172,168,225, 56,172, 84,149, 74,229, 94,210, 13,155, 90,139,227, 15,132, 16,
+236,221,187,183,194,247, 71,172,138,128,176,120,120, 22, 54,110,220, 8,163,209, 8, 74, 41,169,174, 62,191,155, 53, 37,100,242,
+204,133,190, 28,199,161,107,215,174,152, 54,109, 26,158, 62,125,138, 65,131, 6,149, 69, 3, 41,165, 80,107,181, 72, 12, 59, 23,
+226,236,230,225,251,182, 94, 28, 40,165, 39, 0,188,254,248, 37, 10, 23, 7, 39, 55, 48,212,128,164,180, 76,124,240, 94,119, 8,
+196, 74, 60,143,207, 64, 11,111, 47,231,161,239,119,112, 22, 16, 22, 51,150,237, 26, 15,224, 87, 19,206,119, 99,100,100,164,232,
+254,253,251, 16, 8, 4,176,176,176,128, 92, 46, 47, 59,199,203, 27, 46,158,202,233,214,173,219, 24, 0,243, 40,165, 57, 1, 1,
+ 1,142,139, 23, 47,182, 78, 76, 76, 68, 68, 68, 4,246,238,221,155,206,178, 44, 11,128, 80, 74, 23,188,129, 99,137, 43, 31,217,
+106,223,190,125,218,245,235,215, 29, 9, 33,133,165,145, 43, 66, 72, 97, 45,162,110,162,188,156,228, 47,173, 21,180,159,144, 49,
+247, 96,243, 10,158,103,179,204, 17, 11,123,199,159,130,131,131, 13, 85,125,215,210,210,242,243,197, 11,167,170,236,236, 56, 4,
+116,126, 23,201,169,122, 44,153, 58, 28,153,153,249,248,117,235, 82, 0, 18,232, 89, 1,222, 9,248, 16, 14, 14, 46,232,212,177,
+147,211,165,171, 87, 38, 0,248,225,109, 57, 6, 98, 15,126, 62,158, 16,242,125,157, 58,117, 46,109, 90,186,180,126,215,174, 93,
+ 1, 0,231,207,159,199,111, 67,134, 96, 62,240,233, 58, 66,146, 39,189,165, 19,155,254,177, 6,203, 67,170,188,180,229,171, 65,
+109,109,141, 69, 34,221,213,163, 72,212,114,236, 15,209,250,162, 59, 57,116,200, 15, 21,159, 96,148, 16,194, 17, 66, 56, 79, 79,
+ 79, 88, 24, 52,176,162, 58, 56,170, 84, 48,183,177, 69,150,161, 56,114, 37, 81, 40, 32, 81, 40, 77,186, 56,150,215,244,246,246,
+ 70,106,106, 42, 36, 18, 9,148, 74, 37,204,205,205, 95, 49, 87,166, 94,112, 9, 33,224, 56, 14, 66,161, 16,161,161,161,232,216,
+177, 35,220,220,220,176,119,239, 94,244,232,209,227,149, 46, 67, 83, 77,219,203,141,121,249,136, 82,233,224,119, 83, 6,183,191,
+128,164, 30, 88,243,143,192,200,187,194, 0, 75,104, 56,167,226,238, 64, 74,113,226,118, 42, 30,197,102,130, 51,114, 53,238, 34,
+116,118,118,246,147,201,100, 43,102,205,154,169,106,209,162, 5,210,211, 51,192,113, 28,148, 74, 37,212,106, 53,204,205,205,209,
+161, 67,135,148,249,243,231, 63,163, 20,189, 40,165, 41,255,141, 3,248,204,153, 51, 47,116, 15,150, 62, 10,147, 19, 48,114,210,
+ 14, 72,132, 64,104,104, 40, 26, 55,110, 92,125,184,156,163,152, 52,115,129,175, 70,171,131, 68, 34, 65,251,246,237,209,182,109,
+219,178,113,113,165, 6, 85,175,215,195,104,228,224,228,253,174, 47,121, 11, 47, 10,132,144, 86, 0, 62,179,180,180,116, 47, 42,
+ 42, 74, 49, 24, 12,123, 75, 76,127, 15,145, 72,244,145, 92, 46,119,202,205,205,141, 1,240, 43,165,244, 78,117,122,102, 50,153,
+173, 84,102, 1,142,213, 66, 40, 20,194,205,205, 3,212,168, 67,118,158, 26, 35, 6,247, 69, 72,104, 36, 78, 93,188,201, 26, 12,
+220, 58, 83,203,216,176, 97, 67,100,102,102, 66, 32, 16, 64, 46,151, 67,161, 80,160, 81,163, 70,136,143,143, 47, 51, 87,124, 23,
+ 97,181, 44, 56,121,242,164,131, 80, 40,116, 50, 26,141,136,139,139, 67,120,120, 56,214,174, 93,155,154,159,159, 31, 16, 28, 28,
+ 28, 85, 27, 81,137, 68,146, 86, 26,185,146, 72, 36,105, 85, 69,182, 94,103,204,149,171,171,171,151,139,131,244,236, 31,107, 39,
+214,241,105,217,154, 49, 19, 40,179, 11,159,166,118,188,125,243,102,251, 57,191,238,159,224,234,234,218, 61, 33, 33,225,105,165,
+141, 31,195,244,106,225,219, 82, 8,154, 2,161,164, 35, 86, 44, 31,140,244,140, 60,100,103,229, 67, 44, 86, 64,103, 16,192,200,
+ 17,180,239,216, 9,191,111,219,131,166, 77,155, 9, 4, 64,183,183,201, 96,149, 68,128,151, 29, 62,124,184,190, 76, 38,195,226,
+197,139, 97,110,110,142,155,223,127,143,223,196, 98,152, 1,216,168,215,207, 2,192, 27,172,255, 47,131,165,112,108, 52,100,247,
+ 39,221, 58,120,123,186, 48,134,189,107,145, 80,196,106,230, 61,210,107, 30,230,211,247, 35, 40,189, 86,149,175, 32,132, 80,177,
+ 88, 12,199,153,223,163,110,179,230, 40, 28, 61, 0, 89, 6, 61,188,142,223,132, 84,169,196,195,110,190,160, 58, 29,222,121,152,
+102,170,113,161,132, 16, 10, 0,246,246,246, 16,139,197,144,201,100,144, 74,165,144, 74,165,101,198, 74, 34,145, 64, 34,145,152,
+108,134, 56,142, 67,126,126, 62,158, 63,127,142,209,163, 71, 67, 46,151,163, 36,212,141,186,117,235, 66, 40, 20, 34, 49, 49, 17,
+ 23, 46, 92,128,167,167, 39, 36, 18, 73,141,218,218,114, 13,182,143,139,139,203, 37, 66,136,207,221,187,119, 45,252,253,253, 97,
+106, 4,171,184, 53, 20, 67,139,186,224,136,219, 11, 99,173, 12, 6,246,133,109, 41,141,190,152, 24,185,234, 86,191,126,253,181,
+203,151, 47,103, 92, 93, 93,193,113, 28,172,173,173, 81, 84, 84,132,140,140, 76,120,123,123,195,205,205, 13,203,151, 47, 7,128,
+221,255, 45,115, 5, 20,119, 7,151, 26,172,242, 70,107,210,251,117,144,149,165,132, 64,192,148, 25,230,106,247, 57,165, 88,183,
+124, 94,200,208,209,211,124,167,204, 89, 1,141, 86, 15,181, 86, 7,141, 86, 7,141, 86, 95,242, 87,135,210,129,237, 41, 17, 23,
+222,186, 8, 22, 33,164, 79, 96, 96,224,250, 85,171, 86, 57, 57, 57, 57,137,210,211,211,217,159,127,254,185,199,207, 63,255, 28,
+ 49, 97,194, 4,239, 9, 19, 38, 88,219,219,219, 11, 83, 82, 82, 12, 83,167, 78,237, 65, 8,153, 69, 41,221, 93,229,245, 66, 97,
+110, 35, 16, 43, 64,136, 16, 86,150,214, 16, 74, 20,224, 88, 33,140, 28, 96, 97,105,143,235, 33,251,113, 45, 44,127, 76, 90, 38,
+246,153,114, 83,213,172, 89, 51, 42, 16, 8, 96,107,107,251, 66,215, 32, 0, 56, 58, 58, 34, 47, 47, 15, 2,129,160,236, 53,158,
+202,175, 65,148, 82, 60,123,246, 12, 69, 69, 69,184,126,253, 58, 14, 28, 56,144,254,178,185, 10, 12, 12,252, 66,169, 84,206, 87,
+171,213, 43, 78,159, 62,189,182, 58,221,146, 49, 87,111,140,138, 82, 49,248,249,249,137,156,108, 5,167,207, 28, 92, 93,215,156,
+187, 71, 16,243, 57,240, 56, 47, 92,121,203,225,157,174,173,222, 99,154,127, 63,217,189,215,236, 31, 79,251,249,249, 53,170, 44,
+146, 69, 41,245, 53, 83, 40, 1,164, 34,248,110, 80,153,185,202,204,202,133, 86, 47,128, 86, 71,160,209, 51,120, 55,176, 39,214,
+111,250, 19,137,169,153, 40,157, 97,248, 54,209,160, 65, 3, 63, 23, 23, 23, 76,153, 50, 5,154, 93,187, 80, 0,160, 15,128,195,
+122, 61, 0,192, 28,152,198,159, 45,255, 79, 6,203,202,169, 81,231, 57, 51, 39,175,233,248, 97, 79, 38,245,139,118,200, 41,208,
+106,103, 68,176, 92, 66, 81,181,230, 10,148, 82,218,184,113, 99, 48, 12, 3,165,165, 21,204, 44, 44,160, 41, 23,185,146, 42,205,
+ 65,117, 58,112,122, 29,196, 38, 94, 28, 75, 53, 41,165, 48, 51, 51,131, 88, 44,126,161,107,176,212, 88,213, 36,130, 5, 0, 57,
+ 57, 57,216,183,111, 31, 90,183,110, 13,185, 92, 14,161, 80, 8, 31, 31, 31, 68, 70, 70,194,203,203, 11,132, 16, 28, 62,124, 24,
+253,251,247,199,211,167, 79,225,237,237,173,172,141,193, 58,123,246,172, 5,165,244, 29, 74, 41, 50, 50, 50,106,181, 19, 57,142,
+ 67, 65, 65, 1,206,156, 57,131,228,228,100, 56, 58, 58, 34, 59, 71, 14, 75, 85,147,226,223, 42,103,178, 76,100,124,159, 62,125,
+ 24, 66, 8,212,106, 53,164, 82, 41, 20, 10, 37,204,205, 45,208,176, 97, 35, 36, 38, 38,162,123,247,238,198, 39, 79,158,236, 18,
+139,197,235,106, 90,222,122,245,234,153,231,228,228,188,231,225,225, 33, 6, 0, 51, 51,179, 62,238,238,238,150, 49, 49, 49,185,
+ 53, 52, 3,101,198,138, 16, 82, 54, 3,149, 97, 24, 8, 25, 6,206, 78, 14,101,207, 75,182,157, 84, 87,143, 67,190,152,230,203,
+ 25,117,216,190,234, 83, 16, 54, 19, 44, 44,161,133, 11, 88,163,160,204,192, 42, 20, 10, 52,237,252,209, 91, 25,193, 18,139,197,
+195,183,110,221,234,242,199, 31,127,228, 28, 57,114, 36,183, 77,155, 54,138, 53,107,214, 56,172, 95,191,190,139, 78,167,195,148,
+ 41, 83,210,110,221,186, 85,216,175, 95, 63,203, 45, 91,182,184,212,175, 95,255,125, 84, 48, 46,139, 16,162, 0, 48, 24,192, 39,
+ 1,173, 45,133, 57,249,106,112,172, 14,207, 98,158, 35,183, 64, 7,206,168, 71, 92, 66, 18, 10, 52, 70,100,102,229,195,199,183,
+251, 79, 65, 65, 65,223, 18, 66,102, 83, 74,143, 85, 87, 78,163,209,136,155, 55,111,226,218,181,107,184,124,249, 50, 98, 99, 99,
+203,222,179,176,176,192,217,179,103,209,165, 75, 23,254, 10, 95,245, 53,104, 94,247,238,221,231,217,218,218,202,214,173, 91,103,
+ 89,183,110, 93,176, 44,171,123, 57,114,229,239,239, 63,103,206,156, 57,206, 31,124,240,193, 68, 0,107,107,251,123,149, 69,182,
+ 76,224,149, 84, 12,233,233, 41, 95,252,180,117,184,157, 66, 28,155,132,199, 63,186,148,196, 98,128,162, 60, 32,104, 39, 72,135,
+185,207, 71, 4,142,183, 94,126,100,253, 23, 0, 54, 84, 38,252,228,105, 60, 54,110, 92,143,175,166,140,192,239,191,174, 0,199,
+ 9,161, 53, 8, 80,199,163, 45,180,122, 14,132, 17,162,133,175, 63, 46, 6, 93,129,136, 1, 38,143,185,245,214, 29, 7,143, 31,
+ 63,190, 29, 27, 27,219,120,238,220,185,248,221,197, 5,230,230,230,152, 58,111,222, 13,150,101,219,243,103,201,255,147,193,242,
+107,232,245,189,165,141,245,168,246,173,154,216, 78,157,248,133,232,105,138, 6, 23, 58,126,147,179,127,249, 76,101, 60, 85, 78,
+136,165, 57,215,106, 18,117, 96, 23, 78, 69,166, 81, 7,143,163,215, 33, 85, 42, 17,213,195, 31, 84,167, 67,135,144, 88, 72,149,
+ 74, 8,101,102,181, 57,129, 95,232, 14,124,249, 57,195,152,150,184, 94,175,215, 91,117,235,214, 13, 93,187,118,197,135, 31,126,
+ 88, 54,230,170,101,203,150,216,189,123, 55, 6, 12, 24,128,123,247,238,193,217,217, 25,141, 27, 55, 70,227,198,141,113,225,194,
+133, 26,223, 61, 26,141, 70,244,232,209, 35,143, 16, 18, 74, 41,245,185,125,251,182, 69, 77, 53, 74, 27,155, 51,103,206,224,189,
+247,222,131,151,151, 23,130,131,131,113,102,193, 15,144,219,212, 1, 96, 5,206,104,132, 78,167, 3,195, 48,213,142,193, 10, 8,
+ 8, 16, 10, 4,130, 70,245,234,213, 67,122,122, 58,210,211,211, 97,111,111, 15,149, 74, 5, 7, 7, 7,172, 90,181, 10,107,214,
+172,185, 77, 41, 93,150,146,146,242,176,166,251, 72,165, 82, 5, 90, 91, 91,255,160, 86,171,197,165,101, 33,132,136,156,157,157,
+111,168, 84,170, 89, 73, 73, 73, 71,107, 98,176,244,122, 61, 8, 33, 56,254, 76,133, 66, 29, 65, 94, 66, 48, 38,191, 95,247, 5,
+195, 37, 18,137, 94, 72,171, 81,185,193,162,216,181,245,199,144, 89,223,124,230,139,172, 29, 96, 51,119,128, 88, 15,193,129,240,
+158,248,243,150, 45, 0,160,161, 19,131, 31, 71, 41,223,218, 8,150, 94,175,223,210,160, 65, 3,232,116,186,243, 0,182,134,134,
+134,246, 79, 78, 78, 94,253,215, 95,127,169, 6, 13, 26,148,116,244,232,209,175, 0, 28, 10, 13, 13, 29,185,120,241,226,174, 6,
+131,161,194,217,101, 2,129,224,247,169, 83,167, 6, 12, 26, 52,136,136, 25,131,238,204,233,109, 66,150, 53,144,233,179,127, 49,
+ 6, 93,189,196,176,172,129,124,248,241, 84,238,196,133, 48,102,204,164,149,198,150,109,223,195,131, 7, 15,156,250,244,233,179,
+ 8,128, 73, 6, 75, 36, 18,149, 25,232, 10,126,159,239, 34,172,134,243,231,207,111, 6,176, 57, 32, 32, 32, 85,161, 80,160,160,
+160,224,149,115,164, 93,187,118, 50,149, 74, 37, 19,137, 68,104,221,186,181, 77,143, 30, 61,162, 24,134, 89,123,242,228,201, 26,
+ 39,161,172, 40,178, 85,219, 52, 13,230,214, 92,159,150,109,155,154, 63, 50,159,111, 46, 19,106,238,185, 71,201, 44, 8,128, 92,
+173,227,179,235,177,131,243, 72,154,180,101,179, 64,119,200, 25, 89,159,202, 12, 22, 33, 36, 36, 47, 39,183, 87, 94,190, 14, 87,
+175, 61,192,199,131,235, 67,171, 39,224, 56, 6, 5,133, 90, 64, 32, 2, 3, 96,200,208,225,160, 68,136,236,140, 20, 16, 32,236,
+109, 59, 14,140, 70,227,172,126,253,250,181, 90,188,120,113,147,169, 83,167,150,238,151,118, 42,149, 42,130,207,131,245,255, 96,
+176, 26,120,185,246,236,220,202,127,210,183,179,191, 53,127,124,251, 50,190, 93,244, 19, 87,223,191, 71,238,178, 93,135,243,115,
+149,117,186, 22, 37, 61,188, 87,211,168,131,136, 53,128,178,122, 72,149,202, 23, 34, 87, 18,133, 2, 34, 51,121,141, 54,130, 16,
+ 2, 74,233, 43,221,129,229,205, 85, 77, 46,182, 18,137, 36,231,202,149, 43, 14, 9, 9, 9, 47, 12,104,247,240,240, 0, 33, 4,
+183,110,221,194,205,155, 55,241,241,199, 31, 67, 40, 20, 66, 36, 18, 33, 52, 52, 52,191, 54, 17,172,210, 89,132,206,206,206, 61,
+218,180,105, 83,225,236, 65, 83, 34, 88,113,113,113,240,242,242,130, 86,171,133,181,181, 53,178, 82,158,225,233,227,135, 40,210,
+ 26,224,238, 32, 65, 70, 70, 6, 74,243,122, 85,197,165, 75,151,168, 74,165,122, 33,242,147,158,158, 14, 79, 79, 79,108,220,184,
+ 17,107,214,172,217,144,156,156, 92,227,187, 88, 23, 23, 23, 27,142,227, 22,247,233,211,167,111,255,254,253,209,163, 71,143, 23,
+222,223,177, 99,135,229,193,131, 7, 55,185,185,185,245, 23, 8, 4,179, 98, 98, 98, 82,171,219,231, 0,240,219,111,197,233,147,
+228,109,231, 97,214, 32,119,124, 50,126, 27,126,252,241, 32,164, 82,233, 11,141,237,194,133, 11,171,175, 71, 74,209,237,195,207,
+125,187,248,232, 96,204, 60, 12,139,246,217,200,187,110,141,220,124, 95,220, 90,213, 27, 0,208,252,179, 99,160,212, 29, 0,222,
+202, 8, 22,165,244, 44,128,179,229, 94,218, 79, 8, 49, 16, 66,134, 2,216, 67, 41, 61, 88,242,250, 47,168, 34, 49,104,219,182,
+109, 91,206,158, 61, 91, 84,154, 54, 67, 85,103, 49,171,215,235, 57, 0,104,228,243,206, 11,125,213,209,209,209,248,241,199, 31,
+ 81, 88, 88, 8,113, 13,194,204,129,129,129,101, 99, 34,197, 98, 49,236,236,236,160,215,235,193,178, 44,111,174,106,198,188,222,
+189,123,207,163,148, 82,142,227,230,150,187,217,146, 90, 91, 91, 95,249,233,167,159,108, 89,150,197,180,105,211,172, 50, 51, 51,
+173,198,142, 29, 59, 11, 64,165, 6,171,146, 52, 13,149, 29,111,181, 74,211,192,113,104,168, 84, 90, 32, 19, 9,208,218, 25, 90,
+230,216,178, 89,103,147,191,184,167,138,245,245, 86, 24, 13,158, 76,158, 14,150, 50,115, 80, 74, 27, 86,246,219, 44,199,157,124,
+ 24, 17,209,189,142, 91,125,193, 95,199, 46,163, 95,255, 65,208,106, 25,104, 12, 4, 68, 32, 2, 17,136,209,220,199, 23,141,155,
+250,128, 2,136, 10, 15,101,141, 47,158, 27,255,243,212, 29,240,203, 6,215,190, 63,143, 3,128,105,107,207,227,219,239, 87, 99,
+216,135, 61, 48,114,228, 72, 62, 15,214,255,135,193,170, 83,167,142,149,131, 82,254,219,132,207, 70,153,199,222,191,129,132,208,
+ 27,184,118, 53, 42,123,231,129, 35,137,121,185,233,159,213,196, 92,149,143, 96,121,237, 56, 14, 23,103,231,178,200, 85,251,224,
+ 24, 72,149, 74, 4, 53,119, 1,167,213,162,251,243,188, 26,111, 76, 69, 81, 43,177, 88, 92,171,153,126,165,166,234,229, 1,237,
+ 99,198,140,193,214,173, 91,209,161, 67, 7, 52,104,208,160,214,119,202, 47,143,137,170,201,236,193,138,180,234,212,169,131,176,
+176, 48, 88, 90, 90, 98,251,246,237,112,117,117,193,200,158, 94, 16, 8,138,187,182, 24,134, 49,105, 12, 22,165,212,232,226,226,
+242,236,204,153, 51,158,131, 6, 13,130, 88, 44, 70,118,118, 54, 44, 44, 44,176,126,253,122, 78, 46,151,255, 94,211,242,185,185,
+185,141,148,201,100, 11, 6, 15, 30, 44,108,212,168, 17, 82, 83, 83, 97,105,105,201,149, 44,109, 4, 27, 27,107, 78, 46,151, 99,
+204,152, 49,240,241,241,233, 54,115,230,204,174, 42,149,106,105, 82, 82,210,207,213,153,172,221,187,139,123,167, 62, 91,251, 16,
+ 58, 93,241, 80,139, 13, 27, 54,192,217,217,249,133,207, 62,121,242,164,250, 89,132, 28,135,179, 7,126, 9, 25, 63,113,176, 47,
+177, 30,130,188,235,214,160,150, 31, 35,181,192, 28, 59, 46,165,225, 82, 72,108, 89,162,209,183, 45,130, 69, 8,233,135,226,161,
+ 23, 39, 40,165,135, 8, 33, 3, 1,244, 40,125,142, 26, 38, 22,101, 89,150, 50, 12, 67,226,227,227,245,114,185,156,216,216,216,
+ 8,165, 82, 41,180, 90,109,153,209,138,142,142,198,177, 99,199,144,144,144, 0, 27, 27, 27,198,210,210, 18,122,189, 62,219,196,
+187,238, 87,210, 51,148,252, 46,111,174,106, 72, 80, 80,208,102, 0,155, 75,159,191,251,238,187, 35,133, 66,225,183, 0, 44,183,
+108,217, 98,101,101,101, 69,142, 30, 61,106,216,178,101, 75,142, 64, 32,200, 6,176,186, 42,189,138, 6,179,191, 14, 21,165, 98,
+160, 20, 17, 89,185,207,234,138,172, 84,220,125, 13,189, 62, 37,126, 86,227,108, 81,125,123,210,180, 25,250,167, 69, 94, 29,201,
+ 62,105,159,158,146,198, 80,208,136,202,116,115,115,115,127,249,125,219,190,233,123,247,252, 86, 71,170,148, 98,204,216,217, 56,
+126,234, 34, 8, 35,194,149,235,183,160,211, 27,145,145,149,139,193, 67,134,193,213,217, 14, 40, 72, 76, 23, 73, 36, 63,191, 77,
+251,254,133, 60, 88,254,237,113,237,224, 74,236,142,170,131,196,239,191,231,243, 96,253,157, 6,203,221,221, 93,170, 16, 97,180,
+141,153,120,198,132,161, 31,216,167, 61, 9, 71, 66,100, 8, 0, 64,171, 85, 27,146,163, 46,181, 48,225,162, 29,248,114,174,140,
+210,174, 27, 27,123,135,178,200, 85,249,217,131,156, 86, 11, 78,175, 3, 42,233,206,169, 76,147, 97,152, 87,140, 85,249, 11,111,
+ 77,202, 89, 26, 29,169, 40,193,168,155,155, 27,150, 46, 93,250, 74, 30, 44, 83,202, 89,114,151,214,131, 16,226, 83,106,140, 40,
+165, 62,206,206,206, 61, 76,153, 57, 88,153,102,105,198,234,147, 39, 79, 34, 34, 34, 2,148, 82,244,233,211, 7, 34,145, 8,230,
+230,230,101, 38,171,162, 49, 88, 21,105, 50, 12,243,249,193,131, 7,167,223,184,113,163,231,180,105,211, 72,233, 88,150,130,130,
+ 2, 46, 57, 57, 57,191,166,229,228, 56,110,198,233,211,167,133, 70,163, 17, 91,183,110,197,157, 59,119,168, 92, 46, 95, 38, 18,
+137,150,202,229,114,214, 96, 48,124,253,197, 23, 95,140,157, 63,127, 62,211,169, 83, 39,220,184,113,131,241,244,244,156, 8,224,
+231,234,182,253,214,173, 91,197, 93,206, 89,113, 24, 63,107, 15, 20,102, 66, 60,124,248, 16, 89, 89, 89,175, 36, 31,173,190,156,
+ 20,190, 93, 6,249,114, 84, 15,189,114, 16, 24,179,119,139,151,202,121,174, 69, 43,159,226,168,163, 58, 47,189,172, 30, 43,138,
+ 96, 85, 86,206,215, 52, 63,127,171, 38, 33,164,111,147, 38, 77,190,137,136,136,112,109,222,188,185, 55, 33, 36,160, 89,179,102,
+173,194,194,194, 74,159,139, 40,165,123,107,162,121,231,206,157,253,235,215,175, 31, 59, 98,196, 8, 49,199,113,198,216,216, 88,
+ 3, 0,226,228,228, 36,184,115,231, 14,247,215, 95,127, 65,173, 86,195,213,213,149,113,113,113, 33,103,207,158,229, 34, 35, 35,
+111, 81, 74,103,155,186,237,165,145,105,145, 72, 4,129, 64, 0,181, 90,109,146,185,250, 95,220, 71,255,159,154, 2,129, 96,225,
+129, 3, 7, 92,180, 90, 45,196, 98, 49,246,237,219,167,223,182,109, 91, 68,110,110,110,199,224,224, 96,117,109,203, 89,147, 4,
+164,213,105, 22,228, 8,142,159, 58,253,160,149,160,231, 47, 24,159,148,222,177,204,120, 17, 98,115,208,209,187,163,188,117,243,
+ 68,243,203, 43,153, 34,104,142, 87,166,249,228,201, 19,157,191,191,255,160,153, 51,230,157, 95,176,104,129,114,238,188,121,184,
+118, 43, 12,153, 57, 5,224,168, 0, 28, 33,248,246,219,185,112,178,179,129,141,196, 80,148, 89, 72,250,191,188,100,206,255,250,
+126,127,157, 60, 88,127, 71, 57,255, 53, 6,203, 92,136, 7, 29,189,189, 92, 58,249, 54,149, 9,141,106, 36, 68, 62, 65, 86,161,
+ 6,103,195, 99,115, 24,202,252,254, 58, 63, 42, 16, 8, 96,105,105, 9,177, 88,140,118, 97,137,144,136,197,144, 42,205, 1,160,
+ 56,114, 69, 41, 24,137,180,166, 7, 80,133, 6,171,182, 24,141, 70, 56, 58, 58,190,176,236, 74,249, 6,187,212, 40,214, 52, 69,
+ 3,195, 48,179,110,220,184, 97, 17, 23, 23, 7, 74, 41, 14, 29, 58,100, 49, 96,192,128, 89,181,137, 94, 81, 74,145,153,153, 9,
+142,227, 32,149, 74,209,179,103, 79,116,234,212, 9,250,146,217, 31,165, 13, 80, 77, 51,185,199,199,199, 39, 3,248,202,213,213,
+245,247,233,211,167,207,104,211,166,141,255,252,249,243, 65, 8,169,109,104, 64,111, 52, 26,113,233,210, 37, 28, 60,120,144,213,
+104, 52, 3, 82, 82, 82,238,150,123,127,145,171,171,235, 95, 3, 6, 12, 56,241,232,209, 35, 97, 68, 68, 4, 0,176,213,137,170,
+213,106, 52,104,208, 0, 44,203, 98,249,120, 55,228,231, 55, 7,203,178, 48, 26,141, 80, 40, 20, 47,228,253, 50,101, 63,113,148,
+ 67,200,197,125, 33,117, 91,246,240,173,110,169,156,183, 44,130,213, 51, 34, 34,194,117,232,208,161,105, 97, 97, 97,174,199,142,
+ 29,179,234,211,167,143, 98,200,144, 33,105, 97, 97, 97,174,132,144,119, 0,236,173,225,249,243, 13, 33,228,212,146, 37, 75,102,
+ 77,154, 52,169,205,136, 17, 35, 68, 34,145,136, 75, 76, 76,100,119,237,218, 69, 26, 52,104,192,136,197, 98,114,250,244,105,238,
+246,237,219, 55, 89,150, 93, 78, 41,189, 82,211,235, 72,169,185,226,199, 92,189, 81,246, 14, 26, 52,104,228,128, 1, 3,204, 90,
+183,110, 45,253,229,151, 95,114,139,138,138, 42, 52, 87, 21, 81,147, 52, 13, 53, 77, 64, 90, 74, 82, 82,210,175, 75, 23, 94,158,
+242, 73,227, 33, 94,159,219,185,227, 92, 97, 26,178,133, 2,198,194,138,129,111, 93, 1,212, 57,207,237,207,223, 58,240, 60, 57,
+ 41,169,202,188,106,119,239,222,189,227,231,231, 23,248,201, 39, 35, 15,140,249,236, 11,135,185,223,204, 20,237,255,235, 4,192,
+234,113,251,202, 21, 88,201, 9,101, 11,147, 83, 51,117,228,131,183,113,169,156,216,131,159,143, 7, 48,158, 16,242,241,188,121,
+243,118,141, 31, 63, 30, 28,199, 33, 40, 40, 8, 63,207,156,137,249, 70,227,167,235, 8, 41,154, 68,233,120,254,180,120,131, 6,
+ 11, 12,201,191,249, 56,182,224,214,227,216, 2,112,148,114,148,106, 25, 6,241,133,122,253,146,168,167, 9,167, 95,103,159,246,
+236,217,147,121,217,184, 84, 4,203,178,166, 14,174,139, 13, 12, 12,124, 99,154, 28,199, 37,116,236,216,241,149,134,185,178,255,
+ 75,116, 19, 76, 10,201,114,220,178,118,237,218,189,242, 90,173,194,187, 28,247,172,107,215,174,250,151, 77, 87, 85,207,141, 70,
+ 99,130,169,250, 9, 9, 9, 15, 0, 12,115,113,113,233,210,163, 71,143,137, 0,106,155,142, 97, 85,151, 46, 93,166, 82, 74,133,
+132,144,149, 47,153,171,210,223, 10,119,113,113,153,235,233,233, 89,182, 0,116,117,219, 30, 24, 24,168,175,110,145,231,242, 3,
+160, 57,142, 75,168, 90,147,162, 78,139,238,190,122, 67,177, 73,171,106,169,156,202, 34, 88,255,163,236, 33,132,136, 0,100, 71,
+ 68, 68,188, 83, 18,185, 74,120,240,224,193,185,221,187,119, 59, 2,213,167, 79,168,228, 6,224, 10,128, 43,132,144, 78, 27, 54,
+108,248,102,204,152, 49,173, 63,254,248, 99, 97, 64, 64, 0,142, 31, 63,110, 12, 10, 10,186,165, 86,171,151,213,212, 88, 17, 66,
+ 10, 94, 62,135,170, 40,195, 91,191, 72,239,155,230,236,217,179, 95,183,107,215,110,238,190,125,251,146,188,188,188,164, 34,145,
+ 72,103,170,185, 2,106,150,166,129, 82,202,213,242,216, 98, 29, 29, 29,123,239, 24, 58,254, 72,139, 9, 35, 60,122,118,240,151,
+187,184, 59,184, 60,122,158,129,132,176,115,133, 79,131,214,199, 24, 53, 89,253, 40,165,213,222,168, 5, 7, 7,223,110,215,174,
+ 93,253, 13, 91, 54,141, 23, 48, 76,119,214,104,244,153, 58,126, 24, 37, 64, 24, 7,156, 21, 75, 37,111,253, 98,207, 82,177,248,
+211, 9, 19, 38,224,207, 63,255,196,161, 53,107,208, 35, 33, 1,187,197, 98,152,137,197,216,168,215,143, 3,192, 27,172, 55,105,
+176,194, 30, 63,247,251, 59,126, 48, 34, 34,162,221, 63, 93, 51, 34, 34,194,255,239,170,240,215, 25,107, 85, 65, 57,255, 95,166,
+209, 38, 38, 38, 94, 4,112,241, 53,190,191, 13, 38, 44,230,108,234,231, 0,224,225,195,135,111,124,219,169,212,114, 80,220,253,
+ 51, 57, 78, 77,222,181, 98, 89, 22,132, 16,104, 52, 26,220,188,121, 19,218,162,124, 4,237, 28, 93,150,201, 29, 20, 72,137,188,
+144,227,228,209,204,234,127,253, 34, 64, 41,189, 12,224,114,137,121,233, 79, 8,233, 13,224, 52,165,116,255, 27,210, 47, 51, 90,
+ 91,182,108,153, 66, 41, 69, 94, 94,222,154,154, 26,171,178,107, 83, 88,216, 5,240,252,173,220,184,113, 67,211,181,107,215,223,
+ 23, 47, 94,220,150,227,184, 63,222,132,230,107,164,105,168,144,212,212,212,231,132,144, 22,220,247,107, 71, 5, 91,153,191, 71,
+ 13, 76, 35, 98, 16, 30, 37,186,204,227, 41, 41, 41,191, 81, 74,141, 53,217,222,146,155,186, 31,255,141,251,251,126, 88, 88, 15,
+ 0,232,213,171, 23,212,211,138,211, 94,109,251, 79, 30,172,141,252, 25,241,166, 35, 88, 60, 60,255, 50, 18,163,130,247, 3, 64,
+ 74,100,113,251,253,211, 79, 63, 1, 0,122,244,232,241,202,172,199,210,207,164, 60,127,240, 86,213, 65,201,128,246, 67,127,147,
+246, 21, 0, 87,248, 35,237,127,131,243,231,207,191,209, 4,147,111, 58, 1,105,201, 49,101, 4,176,181,228,193, 83, 75, 26, 54,
+108, 72, 0,192,206,206, 14,115,106,176,156, 26, 79,213, 48,124, 21,240,240,240,240,240,240,240,240,188, 89, 8,128,192, 74,238,
+ 12, 76,158, 29, 64, 8, 9,172,197,157,199, 57, 94,147,215,228, 53,121, 77, 94,147,215,228, 53,255, 93,154,213,105,191, 53,179,
+ 19, 75, 51, 92,255, 29, 15, 0,129,188, 38,175,201,107,242,154,188, 38,175,201,107,242,154,255,182, 71, 21, 99,176,246, 11, 18,
+ 19, 97, 33,145,200,197, 0,160,211, 21,233, 93, 92,144, 7, 12, 52,130,135,167, 38, 97, 82, 66, 28, 75,204,124,234,155,252, 44,
+ 15, 15, 15, 15, 15,207, 63, 21, 97,101,230, 42, 35, 67,110, 39, 20,102, 55, 52, 26, 53,141, 1, 64, 40,100, 30,102,100, 88, 71,
+217,217,237,207,120,211, 38,171, 87,175, 94,179, 41,165,142, 34,145,232,184,147,147, 83,208,230,205,155, 13,255,102,163,241, 58,
+ 38,227,255,195,160,216,218,218,170, 28, 29, 29,135, 90, 89, 89, 5,228,230,230, 94, 73, 73, 73,217,158,153,153,153, 84, 73,121,
+150, 18,130, 25, 37,255,175,160,148,126, 83, 69,217, 77,254,236,203,168, 84,170, 6, 50,153,108, 60,195, 48,205, 0,128,227,184,
+ 7, 26,141,102, 67, 82, 82,210,227,127,219, 73,173, 82,169,204, 40,165, 31,136, 68,162,225, 54, 54, 54,173,211,211,211,231, 39,
+ 38, 38,174,174,229, 49, 43, 4, 48,205,202,202,234, 99, 43, 43, 43,207,172,172,172,167,121,121,121,123, 1,252, 72, 41,173,246,
+ 60, 93, 48, 89,213, 46,160, 71,192,156,160,211, 65,139,230,173, 77,186,241,202,251, 95,171,108,187,119,235, 48, 55,232,232,245,
+133,223,172, 79,204,170, 97,217, 24,252,103, 28, 41, 87,124,216,255,115, 71,232, 58, 56, 56,180, 45, 73,164,202, 48, 12,243, 99,
+106,106,234,197,127,242,113,100,111,111,175,112,114,114, 90, 78, 8,233, 43, 16, 8, 34, 82, 83, 83, 71, 39, 37, 37, 37,188,161,
+107, 33, 83,183,110, 93,243,216,216,216,252,218,166,106,248, 55,210,174, 93,187, 84,189, 94, 95,101,118,124,177, 88,156,118,227,
+198, 13, 71,190,182,254,161, 6, 43, 49, 17, 22, 66, 97,118,195,180,148,176,193, 73,201,161, 31, 1,128,202,217,103,175,131, 83,
+243, 61,137,137, 18,125,171,110, 3,148, 34,185,112,131, 64, 32,106,169,209,105,237, 68, 66, 81,134,158, 53,220, 99,116,116,124,
+242,195,131,113,166,252,112,223,190,125, 27, 2,176,244,245,245,189,163,211,233, 90,175, 94,189,218,249,192,129, 3, 62,193,193,
+193, 67,222,127,255,253,163,148,210,211, 71,143, 30, 85,215,232,164, 13, 8, 16, 58,228,216,124, 42, 16, 10,251, 2,240,161, 20,
+ 0, 17,132,114,122,221,137, 52,177,205, 31, 52,184,246,198,173, 93, 3,219,134,132,234,167,139, 8,237,100,160,228, 10, 37,226,
+149, 55, 30,103, 70,213,224,130, 98,146,121,120, 29,147,241,210,119,215, 80, 74,167,189,233, 3,198,201,201,201,110,224,192,129,
+ 59, 22, 45, 90,164, 48, 55, 55, 39, 49, 49, 49,253,191,249,230,155, 30, 42,149,234,147,164,164,164,248,151,205, 30, 33,152,193,
+113,148, 1, 0,134, 33, 51, 29, 29, 29,155, 9,133, 66,237,203,186, 44,203, 74, 9, 65, 79,142, 43, 94,206,134, 97,200, 12, 66,
+200, 90, 83,140,162,167,167,231,144,230, 62, 45,167,126, 51,123,174,210,222,193, 65,193,178, 70,125,124, 98,130,124,229,210,239,
+219,120,122,122,174,125,246,236,217,174,154,110, 39, 33,132,184,186,186, 14, 22,137, 68,125, 0, 52, 41,121, 57,210, 96, 48, 28,
+ 75, 72, 72,216, 99,106, 67,222,162, 69,139,203, 12,195,184,215,228,183,141, 70, 99, 92,104,104,104,199,218,236, 31, 23, 23,151,
+ 65, 46, 46, 46,191,181,109,219, 86,222,178,101, 75,136,197, 98,172, 88,177, 98, 26,170, 89,222,164,212, 72,201,229,242,193, 10,
+133,194,171,160,160,224,137, 90,173, 62, 32,145, 72, 2,215,174, 93,235,214,161, 67, 7,243,212,212, 84, 34, 16, 8, 28,143, 29,
+ 59,246,233,186,117,235,122, 16, 66,186, 86,151,103, 40,247, 9,157, 35,237,219,164, 83,238,147,139,115, 0,244,122,101,191,107,
+100,195,169,192,173,143,154,134,196,163, 6, 83,228, 9, 33,140,171,171,235, 90, 71, 71,199,145,106,181, 90, 67, 8,161,132, 16,
+218,188,121,243,210,247, 1, 0, 58,157, 46,251,209,163, 71,141,170,210,242,104,103,115, 87,192, 8, 92, 43,221, 31,156, 49,225,
+249,141,172,215, 78,221, 98, 52, 26,103, 68, 68, 68,244, 22,137, 68,164, 69,139, 22, 2,212, 32,245,137, 74,165,106, 72, 8,249,
+150, 82,122, 39, 57, 57,121, 67,201,146, 86, 93, 40,165,101,215,138,146,116, 42,112,113,113,217, 80,191,126,253,247,163,163,163,
+ 55, 38, 38, 38, 46,122, 13,163,190,121,201,146, 37, 31,245,232,209, 67,144,153,153,233,210,189,123,247,157, 0, 58,189, 78, 29,
+248,249,249,137, 82, 82, 82,166,181,104,209,226,203, 86,173, 90, 57,135,135,135,167,168, 84,170,117, 78, 78, 78, 63, 6, 7, 7,
+ 87,123,125,246,241,241, 81, 9,133,194,145, 0, 62, 5, 32,160,148,238, 6,240, 71, 72, 72,200,211,127, 67,131,173,215,235, 29,
+206, 45,154, 11, 34, 20, 66,214,177, 43, 56,142, 67,198,202,121, 96,179, 50, 96,183,104, 29, 88,150, 69, 96, 96,160, 3,120,254,
+185, 6, 75, 34,145,139,141, 70, 77,227,164,228,208,143,222,233,252,147, 37, 0, 92,190,244,229, 71, 14, 78, 77, 31, 72, 36,242,
+ 40,169,133,236,224,128,190,129, 45, 7,246,233, 76, 92,157, 29,144,144,156,230,248,235,238,211, 61,143,157,190,120, 16,128, 73,
+249,179,242,242,242, 22,215,173, 91,215,254,252,249,243, 49, 18,137,196, 76, 38,147,145, 65,131, 6,153, 13, 25, 50,196,251,194,
+133, 11, 94,167, 78,157, 26,216,175, 95,191, 83, 98,177,248,248,190,125,251,170, 93,159,204,177,121,127,111, 39,161,211,254,126,
+ 31,244,114,127,175,155,131,164,174,147, 61, 40, 39,195,195,103,250, 58,103,175,132,244, 60,126,242,244, 12, 7,239,254, 31,166,
+ 69, 28, 50,121, 53,244,102,205, 44,173,204,212,116,170,153,152,126,220,179,141,183, 71,223,110,237,137,167,167, 39,162, 30, 69,
+121, 93,188,118,103,100,151,198,230,207,213,122,178, 91,109, 70, 86, 61,120,144,155, 83, 85, 84,169,188,209, 16, 8,152, 89,221,
+186,117, 27, 41,149, 74, 95,184,115,211,106,181, 12,195, 16, 7,163,177,248,229,154,152,140,210,223,208,233,180,140, 72, 36,129,
+ 64,192, 76,109,217,178,101,175,212,212,212,147, 82,169,116,197,243,231,207,107,148,119,102, 18, 33,146,108,161,208,143,145, 74,
+157,141, 58,157, 45, 0, 16,137, 36,187,142,173,109,219,239,190,251, 78, 41, 16, 8,144,153,153, 9,141, 70, 67, 62,255,252,115,
+179, 39, 79,158,140, 0,176,176, 58,211,178,109,219, 54, 95, 91, 91,219, 87,238, 88, 51, 51, 51,153, 94,189,122,214, 56,111,167,
+ 74,165,106,216,194,215,255,171, 93, 59,119, 52,201,203,202,214,108, 93,189, 57,216, 32,147,107, 61,155, 52, 18,125,191,116,149,
+229,156,153, 83,191, 84,169, 84,247,146,146,146, 76, 54,195,206,206,206,117,220,221,221, 15,206,158, 61,187, 89,199,142, 29, 69,
+ 14, 14, 14, 72, 77, 77,197,163, 71,143,154, 93,187,118,237,131,195,135, 15, 79,115,118,118, 30,144,156,156, 92,237,205, 4,165,
+180,193,145,149, 75, 29,164, 54,182,224, 12, 6,216,248,248,150, 37,127, 77,190,120, 6, 70,189, 30,156,193, 0,183,247, 62, 64,
+ 73,228, 13,239,190,251,110,173, 82,146,187,186,186,170, 26, 54,108,248,231,172, 89,179,196, 58,157, 14, 33, 33, 33,184,113,227,
+ 6,151,150,150,182,172, 58,115, 69, 8, 57, 51,111,222, 60,215,142, 29, 59,154,103,100,100,192,104, 52,218, 29, 62,124,120,188,
+175,175,175,133,155,155,155,100,251,246,237, 40, 40, 40, 0,203,178, 54, 94, 94, 94, 54, 67,134, 12,209,109,223,190,125, 26,128,
+229,149, 69,174,242,158,208, 57, 41,196,171,103, 35,191,225, 72, 33,167,122, 78,237,229,124,210,162, 30, 41,139,100,245,170, 87,
+207,220,171,177, 98,166,210,162,185, 77, 94,226,185,153,189,234,213,219,122,242,201, 19, 83,150, 98, 98, 92, 92, 92,214,246,238,
+221,123,232,198,141, 27,229,145,145,145,242, 38, 77,154,128,227,184,178, 76,254,165, 43, 23,116,234, 84,189, 31, 16, 48, 2,215,
+107, 7,195, 29,204,204,204,202,214, 8, 45,253, 91, 88, 88,136, 30,195,219,254, 29,215,219,154,238,227, 5,215,175, 95, 31,116,
+242,228,201, 97,139, 22, 45,106, 0, 96, 34,199,113,115, 35, 35, 35, 59, 3, 64,147, 38, 77, 36, 0, 46,170, 84,170, 81,227,198,
+141, 27, 55,113,226, 68,124,250,233,167,115, 9, 33,139,107, 19,213, 35,132, 8,154, 54,109,218,187, 71,143, 30, 2,131,193, 0,
+ 51, 51, 51,232,245,250,122,175,179,241,222,222,222,226,162,162,162, 3, 11, 23, 46,236,211,175, 95, 63, 8,133, 66,112, 28,231,
+116,249,242,229,165,211,166, 77,107,239,231,231,215,191, 50,147,229,231,231,215, 18,192,194,250,245,235,247, 24, 62,124,184,160,
+ 67,135, 14, 40, 40, 40,192,153, 51,103,190, 61,120,240,224,183,126,126,126,215, 1,204, 13, 14, 14, 14,122,219, 27,109,129,210,
+ 28,143, 6,116,129, 87,100, 38, 0, 32,101,195, 74, 0,128,197,119, 63,240,142,230,127,193, 96, 85, 71, 81, 81,145,239, 55,147,
+ 62, 5,195, 20,183,135,245, 61,235, 96,233,236,209,228,200,177,211,190,213,132, 55, 87, 25,141,198, 6, 54, 54, 54,211, 53, 26,
+141,108,205,154, 53,178,164,164,164,198,251,247,239,167,247,239,223,135, 88, 44,134,165,165, 37,186,118,237, 42,237,217,179,103,
+189,235,215,175,215, 57,120,240, 96,191,247,222,123,239,143,227,199,143, 31,173,202, 92,217,217,219, 95,250, 97,209, 23, 54,205,
+ 60,189,160, 55, 24, 16,159,150, 8, 74, 36,112,118, 80,224,147,254, 45,197, 29,253, 37, 94, 63,252,124, 46,200,177, 89,191,119,
+ 82, 31, 28, 9,175,110, 27, 59,213, 87,220,238,239, 87,207,175,111, 96,123,166, 65, 35,111,136,101,242,178,247,154,183,244, 69,
+243,150,190,100,244,200,124,207,251,247,239,207, 57,117,233,214,236, 78,245, 21,193, 87,162, 11,171, 90, 24,243, 5,243, 48,109,
+218, 52,216,218,218,190,108, 50,112,225,194,249, 74,191, 99,202,117,177,252,147,165, 75,151, 90,165,165,165,125,252,235,175,191,
+126,224,228,228, 52, 33, 37, 37,229,148, 41, 34,159, 18,226, 14,169,180,235,200, 31,127,228, 90,190,255,190,192,202,201,137,225,
+140, 70,146,240,228,137,221,143,107,214, 4,230,199,199,203,213,230,230, 5,233,185,185,186,168,168, 40,152,153,153, 17,129, 64,
+208,161, 2,115,145, 74, 8, 89,193, 48,100, 38, 33,132,200,100,102,217,159,125,246,217,245,146,247,154, 28, 61,122,212,188,111,
+223,190,249,132,144, 72, 0,144,201,204, 58, 11, 4,140, 53, 45,238,232, 89, 97,138,177,148,203,229,147,166,125, 61, 75,145,151,
+149,163,214, 23, 22, 26,236, 45,148,132, 40,205, 5,121,185,249,249,137,201,233,218,113, 95, 78, 17,204,153, 53,117, 18, 76,204,
+ 68,236,236,236, 92,167,113,227,198,183,183,110,221,234, 96,107,107,139,156,156, 28,100,102,102,226,246,237,219,224, 56, 14,189,
+122,245,146,250,250,248,248,254,184,106,213, 13,103,103,231,118,166,152, 44,153,173, 29,246,191,211, 18, 0, 48,232,105,102, 89,
+132,229,228,224, 62,101,159, 25, 18,155, 91,252, 89,153,172,198,203, 47,149,171,239,118, 29, 58,116, 16, 3,192,212,169, 83,243,
+ 10, 11, 11,151, 18, 66,118, 38, 37, 37, 37, 86,243,213,105,115,230,204,113,241,244,244,172,187,115,231, 78, 20, 20, 20, 0,128,
+131,167,167, 39, 26, 53,106,100, 12, 10, 10, 66,195,134, 13, 97,110,110,142,203,151, 47,227,230,205,155,240,243,243, 51, 23,139,
+197, 31, 85,102,176, 2,122, 4,204,145,246,109,210,169,145,223,112, 40, 45,156,177,117,215, 30, 60, 10,222,214, 73,171,143,156,
+179,116,162,203, 39,106, 42, 29,225,218,192,124,150,187,127,103,219,250, 77,223, 71, 93,191, 16, 59,141,241,202,179,185, 19,188,
+150, 9,101,154,109,243,126, 72,202,172,204, 92, 57, 57, 57,173,236,213,171,215,160,141, 27, 55, 90, 1, 64, 88, 88, 24, 82, 83,
+ 83, 97,111,111, 15,153, 76, 6,145, 72, 84,182,126,168,169,152,153,153, 33, 57, 57,185,108,153, 41,163,209,136,252,252,124, 56,
+ 57, 57, 21,187,155, 5,132,153, 55,207,180,174, 44,103,103,231,142,190,190,190, 59, 92, 93, 93,221,202,191,222,163, 71, 15,140,
+ 30, 61, 26,148, 82,116,232,208,161,235,232,209,163, 41,165, 20, 28,199, 33, 53, 53,181, 32, 44, 44,172, 91, 98, 98,226,173, 74,
+182, 91,157,146,146,130,113,227,198, 33, 46, 46,110,130, 74,165,138,101, 24, 70, 86,186, 28, 24, 33, 68,162, 82,169, 26, 54,108,
+216,112,237,232,209,163, 17, 19, 19,131,168,168,168,219,181,237, 50,165,148, 26,219,182,109, 27,109, 48, 24,252, 89,150,133, 90,
+173, 70,207,158, 61,101,141, 27, 55, 78, 21,137, 68, 15,115,114,114,134,149, 44,169,101,138, 89, 19, 58, 59, 59, 59,137, 68,162,
+141, 95,124,241, 69,239,246,237,219,227,225,195,135, 56,121,242, 36,250,245,235,135,128,128, 0,204,153, 51,231,189, 57,115,230,
+ 76, 3, 80,217,205,192,254, 3, 7, 14,120,184,186,186,150, 45,137,100, 97, 97,129,207, 62,251, 12,159,126,250, 41, 78,156, 56,
+209,126,201,146, 37, 7, 2, 2, 2, 28,130,130,130,216,183,185,209,150,250,183,135, 87,100, 38,158, 54, 41,110, 63, 74,141, 86,
+233,115,184,248,130,231, 31,108,176,116,186, 34,189, 80,200, 60, 84, 57,251,236,189,124,233,203,178, 46, 66,128,121,168,211, 21,
+233,139,195,230, 20,121, 69, 44,204,164, 12, 98, 82,242, 17,254, 52,163,162,147,244,220, 75,198,236,171,117,235,214, 97,197,138,
+ 21,189,212,106,117,193,179,103,207,146, 11, 10, 10, 10, 63,249,228, 19, 34, 20, 10,113,237,218, 53, 60,127,254, 28,205,155, 55,
+135,181,181, 53, 58,118,236, 40,238,222,189,187,219,168, 81,163, 62, 1,112,180, 34, 77, 18, 16, 32,116,150,218, 31, 92,185,104,
+176, 13,152, 40, 68,197,229,160,158,107,107,216, 89,185, 33, 49,189, 0,119, 34, 78,224,241,147,227,168,231, 82, 23,163,135,214,
+183, 90,189,249,218, 49,226, 55,166, 94,249,238,194,138,166,132,202, 4,198, 86,243,119,221,135, 49,235, 9,104,110, 28,104,225,
+171,171,196,200,237,220,208,184,157, 35,228, 86,246, 76,216,195,213,173, 42,219,118, 74,105,170, 80, 40,220, 34, 16, 48, 99, 0,
+160, 85,171,214,133,203,151, 47,175,232, 98,205,181,106,213,186, 80, 32, 96, 20,197, 17, 44,193,102,150,101, 83,171, 42,231, 75,
+102,102,165, 68, 34,157, 14,128,184,186,186, 21, 28, 57,114,132,251,240,195, 15,177,114,229, 74,233,172, 89,179,126,118,119,119,
+239, 18, 19, 19, 19, 91,213, 62, 26, 64, 72, 29,151,122,245,186, 47,190,118,141,138, 12, 6,146,117,251,118, 94,126,106,170, 33,
+ 49, 63, 95,246, 71, 72,200,192, 9, 51,102,200,156,188,188,112,253,220, 57,243,148,236,236,252,156,162, 34,221,179,103,207,168,
+209,104,188, 82,201,182,127,227,232,232,216,108,219,182,109,190,159,125,246,217,245,196,196,196, 1, 37,221, 24, 7, 1,180, 37,
+132, 68,150,127,237,224,193,131,237,135, 15, 31, 30,146,154,154,250, 77, 85,229, 44, 71, 83,123, 59, 59,249,174,205,219, 67,109,
+204,205, 24,123, 87, 21, 35,178,178, 18,178, 18, 51, 49, 7,168,235,184,121, 40, 0, 52,173,164,206, 94, 94, 52,156,184,187,187,
+ 31,252,253,247,223, 29, 68, 34, 17,140, 70, 35,236,237,237,241,252,249,115,228,228,228, 32, 63, 63, 31,207, 30, 70,194,195,205,
+ 13,147, 71,127,238,188,224,135, 85, 7, 9, 33,254,229, 27,177, 10, 23,227,214,235, 95,110,112, 42, 91, 32, 28,166,148,179, 50,
+ 56,142,123,158,148,148, 4,185, 92,142, 38, 77,154, 40,239,220,185,115, 37, 49, 49, 49,177, 58, 77,153, 76,246, 81,135, 14, 29,
+204,119,237,218, 5, 63, 63, 63, 88, 90, 90, 34, 40, 40, 8, 97, 97, 97,208,235,245, 76, 65, 65, 1,204,205,205,177,108,217, 50,
+212,173, 91, 23,121,121,121,136,139,139,179, 21,137, 68,118,149,105, 6,157, 14, 90,148,251,228,226,156, 20,114,170,231,214, 93,
+123,240,197,144,193,112,162, 79,175, 88,214, 35,139,186,247,237,240, 29, 21,184,245, 81,152,251, 88, 55,104,214, 23, 98,137, 18,
+ 19,103, 44, 68,212,131,163,214, 69,249,161, 19,136, 49,222, 13,192,228,151, 53, 73,113, 5, 49, 42,149,234,243,205,155, 55,155,
+151,221,209,151,172, 73, 88,222, 88,149, 62, 42,170,211,202, 22, 76,215,235,245,208,235,245, 48, 26,141,200,200,200, 64,126,126,
+ 62,172,172, 74, 18,245,207, 3, 8, 8,161,149,172, 66, 95, 94,147, 97,152, 97,123,246,236,113,147,203,229, 47,127, 6, 37,209,
+ 65,200,229,114,112, 28, 7,189, 94, 15,150,101,161,213,106,149, 1, 1, 1,227, 1,220,170, 72, 83, 32, 16, 76, 29, 55,110, 92,
+135, 99,199,142,121, 45, 90,180, 8,122,189,126,101,122,122, 58, 70,143, 30, 13,142,227,208,177, 99,199,182,148,210, 71,147, 39,
+ 79, 6, 0,204,159, 63,223, 80, 80, 80, 48,182,182,199,146,163,163,163,119,223,190,125,189,206,159, 63,143, 78,157, 58, 65,171,
+213,226,187,239,190,179, 88,177, 98,133,197,222,189,123,237,151, 46, 93,250, 27,128, 30, 85,105,250,249,249,137, 82, 83, 83,103,
+ 14, 27, 54,108, 90, 96, 96,160,101, 92, 92, 28,204,204,204,112,228,200, 17,108,222,188,249,164, 94,175,159,115,224,192,129,197,
+ 91,182,108,233,217,175, 95, 63,108,222,188,121, 82,201,176, 8,174, 2, 77,149,155,155, 27, 66, 67, 67, 97,109,109, 13, 59, 59,
+ 59,228,230,230,226,230,205,155,184,125,251, 54, 26, 55,110, 12, 66,136,117, 73,155,198,190,206,121, 84, 67, 35,250,255,174, 89,
+ 58, 67,141, 43,119,236, 82, 74,139, 55,154,214,190,156,132, 16,161, 74,165,234,103,101,101, 53,129, 82, 42,204,206,206,222, 44,
+151,203,247, 63,121,242, 68,247,255,181,237,255, 10,131,229,226,130,188,140, 12,235, 40, 7,167,230,123, 28,156,154,150,164,170,
+102, 30, 10, 4,214, 81,142,142, 69,121, 0,160,103, 41,174, 63,204, 65,104,116, 10,194,162, 83,160,144, 86,127,215,109,107,107,
+139,246,237,219,227,200,145, 35,136,143,143, 87, 46, 91,182,172,129, 94,175,215,247,237,219, 55,201,221,221, 61,187, 99,199,142,
+ 16,137, 68,184,115,231, 14,242,242,242,192, 48, 12,164, 82, 41, 56,142,171,244, 86,212, 33,219,122,248,240,209,205, 61,237,172,
+ 24, 28,189,122, 10,109, 27,247,135, 92, 42, 66,122,142, 26, 4, 4, 79,159,159, 3,199, 42,113, 63, 50, 6,237,125,228,120,167,
+181,149,107,193,249,172,209, 0,126, 54,165,130,244,207,130, 32,241, 30, 0,112, 77, 65,179,159,128,203, 75, 4,149, 59,160,144,
+ 51, 67, 70, 82, 44, 30, 94,217, 7,170,175,126,168, 24,203,178, 99, 29, 28, 28,152, 57,115,230,244,245,244,244,228, 38, 78,156,
+120,237,249,243,231,131,202,127,198,195,195, 99,223,250,245,235, 59, 60,123,246,172,104,209,162, 69, 71,211,210,210,198,213,240,
+196,156, 73, 8, 89, 13, 0,241,241,241,153,135, 15, 31,238,116,249,242,229,165,171, 87,175,118,157, 56,113,162,116,226,196,137,
+ 51, 1,140,171,170, 91, 80, 33,149, 6, 46,190,124,153,178, 9, 9,218, 67,155, 55, 11,214,220,184, 49, 75,207,113,117,236, 29,
+ 28,132, 1,157, 58,105,236,172,172, 10, 83, 83, 82, 56, 43,149,138, 60,127,242, 68,201,137, 68,250, 83,167, 78,229,103,101,101,
+ 85,186,196,141, 80, 40,212, 86,212, 45, 88,201, 49,194, 85, 52, 70,171, 10,242, 56, 74,245, 86,158,158,180,123,215,118,245,163,
+ 31, 61,125, 42,179,178, 18, 52,168,239,209, 40,252,225,243,219,212,200,106, 0,228,153,216,197, 54,120,222,188,121,205, 45, 44,
+ 44,192,113, 28, 44, 45, 45,145,158,158, 14,157, 78,135,188,188, 60,232,242,115,161,203,205, 69, 88,236,115,116, 8, 8, 64,247,
+118,109,155, 28, 55, 24, 6, 3,216, 93,149,174,141,143,111, 89,228,106,159,215,127,162,150, 31,199,228,148,153,173, 19,173,235,
+ 65,162, 84,160,249,148,111,106,125, 50, 39, 39, 39,135,212,173, 91,247, 68,175, 94,189,122,143, 25, 51,134, 73, 73, 73, 57,229,
+232,232,216, 33, 53, 53, 53,162,170,239, 41,149,202,122,165,134,194,210,210, 18,107,214,172,129,163,163, 35,138,138,138,112,231,
+206, 29,234,234,234, 74, 46, 94,188, 8, 87, 87, 87,100,100,100, 64,175,215,163,176,176, 48, 69,167,211, 85,122,224,151,116, 3,
+246,154,218,203,249,228,163,224,109,157, 92,200,179, 59, 31, 77,235, 28,253, 40,236, 97,220,153,179,215,190,103, 53,178,248,156,
+132,115, 51, 61, 91,133,216, 77,152,190, 0,235, 87,206,195,163, 91,151,179, 28,235,228,253,108, 70,180,127,180,233, 86,101, 4,
+ 93,243,240,225, 67,243,251,247,239,131, 16, 2, 75, 75, 75,200,229,242, 10, 77,150,169, 24,141,198,178,191, 25, 25, 25, 72, 79,
+ 79,199,147,216, 40, 28,184,176, 13, 6,214, 96,247,123, 27,139, 20, 47,177, 56,212, 46,151,204,206,120, 64, 67,170, 57, 15, 55,
+127,252,241,199,131, 93, 92, 92,204,203,191,222,162, 69, 11, 12, 27, 54, 12,219,183,111,199,221,187,119,203,186, 49, 41,165, 72,
+ 79, 79, 79, 54, 26,141,127, 84,166, 25, 23, 23,151,227,234,234,218,243,243,207, 63, 15, 62,116,232,144,197, 15, 63,252, 0,163,
+209, 8,150,101,203,186, 69, 75,255,238,220,185, 19,193,193,193,115, 83, 82, 82, 30,214,230, 56,114,114,114,106,220,183,111,223,
+203, 63,255,252,179, 85, 90, 90, 26, 50, 50, 50, 80, 80, 80,128,194,194, 66, 24,141, 70,120,120,120, 16,150,101, 27, 85,215, 29,
+200, 48,204,145, 11, 23, 46,244,108,208,160, 1, 0,192, 96, 48,224,250,245,235, 24, 61,122,116,166, 92, 46,255, 40, 38, 38,166,
+ 80,165, 82,125,123,252,248,241,158, 45, 91,182,132,143,143,143, 83, 90, 90,154, 57,128,220, 74,110, 32, 96, 52, 26,145,158,158,
+142,244,244,116,252,250,235,127,214,113,214,106,181, 37,193, 1, 29,105,213,170,149,199,157, 59,119,158,191,173,141,118,204,159,
+ 91, 17, 51,251, 75,184, 95,121, 4, 0, 8,246, 46, 30,114, 85,247, 82,100,241,240,131,225,195,107,164,167, 82,169,108, 41,165,
+ 95, 4, 6, 6, 78,233,217,179,167,189, 74,165,130,141,141, 13,194,194,194, 58,156, 62,125,250, 39, 87, 87,215, 77, 70,163,113,
+147, 41,209,122, 30,147,186, 8, 7, 26,237,236,246,103, 36, 38, 74,244, 18,137, 60,170, 52,170, 85,108,174, 6, 26,129, 93, 96,
+245,134,146, 11, 4, 45,121,152,214,173,161, 73,254, 16,156,250, 47, 56,200,251, 97,203,150, 67, 72, 75, 75, 19,175, 89,179,198,
+253,208,161, 67,174,195,134, 13,139,171, 95,191,126,110, 64, 64, 0,182,109,219, 6, 39, 39, 39,104,181, 90,112, 85,136,155,219,
+ 24, 7,182,109, 94, 95,240, 56,246, 1,252, 27, 14,132,135,170, 35,158, 38,230, 34, 43, 95,139,204, 92, 53, 26, 53,156,142,212,
+204, 34,228, 22,106, 16,246,104, 39, 92,156, 60, 25,129,232, 73, 79, 83, 13,150,230,254, 14,104,195,246, 64,236,213, 5,146,166,
+131, 33,114,109,135,248,176, 32,220, 59,241, 35, 18,194,175,130,114, 70, 56,186, 55, 49,105,219, 69, 34,209,194,227,199,143,119,
+ 95,178,100,137,168,107,215,174, 29, 84, 42, 85,251,164,164,164,235, 37, 7,121,251,222,189,123,119,112,112,112,192,218,181,107,
+117, 34,145,104, 97, 45,239,126,202,119,171, 93,116,114,114,154,120,240,224,193,191,198,140, 25, 3,103,103,231, 54, 85,125, 55,
+ 93, 36,106, 49, 98,201, 18, 42, 18, 8,232,241,223,126, 35,179, 79,156, 88,183,253,207, 63, 37, 29, 58,116, 0, 1, 16, 26, 22,
+ 38, 91,182,102,141,217,224,126,253,210,162,158, 63,199,153, 11, 23,180,105, 41, 41, 25,233,133,133, 51,222,212,236,162,154,194,
+178,236,141,184,248, 56, 23,255, 54, 45,237, 67, 34,159,133,247,120,183,125,123,134, 97,152, 71, 79, 99,175,219,219, 91,200,175,
+ 92,185,172,103, 89,246,134,137,251,167, 79,199,142, 29,133,217,217,217, 80,169, 84, 72, 79, 79, 71, 98, 98, 34, 12, 6, 3, 52,
+185,217,208,231,230,194,144,151, 3, 99, 97, 1,158,221,185, 13,111, 55, 23,233,153,226, 65,240,187,171,187,227,172, 40, 66, 85,
+ 62,146, 37, 53, 87, 66,170, 84,190,176, 56,181,137, 23,199,126, 22, 22, 22, 51,243,243,243, 79, 36, 38, 38, 46,210,233,116, 19,
+151, 44, 89,210,106,225,194,133,118,179,102,205,178,152, 49, 99,198, 62,119,119,247,150, 49, 49, 49,149,154,214,130,130,130, 39,
+ 44,203,218, 1,112, 56,127,254, 60, 28, 28, 28,144,155,155, 91,188,221, 26,141,174,168,168, 72,150,153,153, 9,173, 86, 11,157,
+ 78, 7, 11, 11, 11,220,189,123, 55,155,101,217,191,170, 43,159, 69, 61,178, 72,171,143,156, 99,219, 68,145,164,103,173, 59,167,
+101,113,217,243,126, 72, 90, 8,224,199, 94,245,234,109,213,115,151,159, 61,126,112,212,250,249,157,160,172,164,199,133, 94, 91,
+143, 63,205,175,162, 30, 41, 33,132, 35,132,208,134, 13, 27, 34, 61, 61, 29, 2,129, 0,114,185, 28, 74,165, 18,141, 27, 55, 70,
+124,124,124,173, 13, 22,203,178,101,230,234,236,141, 99,200, 44, 72,198,214,149,187,224,226,228,198, 0,176, 79, 76,137,239, 54,
+106,218,160, 54,158, 29,173,151, 62,187,154, 93,233,184,182,164,164,164,123, 0, 44, 94,188,105,117,233, 98, 99, 99,115, 65,167,
+211, 33, 38, 38, 6,103,206,156, 9, 72, 72, 72,184, 84,147,125,157,144,144,240,212,197,197,165,231, 7, 31,124,176,173,121,243,
+230,245, 40,165,104,220,184, 49,250,245,235,135, 3, 7, 14, 32, 34, 34, 2,121,121,121,220,149, 43, 87,126, 79, 78, 78,174,209,
+128, 28, 66, 8,161,148, 82,103,103,231, 70,125,250,244,185,186,126,253,122,235,140,140, 12,168,213,106, 20, 22, 22, 98,255,254,
+253,232,212,169, 19,108,108,108,112,248,240, 97,182,180, 71,161, 50,115, 69, 41, 61,114,232,208,161,158, 94, 94, 94,120,248,240,
+ 33,206,158, 61, 11, 79, 79, 79,136, 68, 34,244,233,211,199,118,207,158, 61, 19,189,189,189, 87,137, 68,162,239,123,247,238, 13,
+163,209,136,187,119,239, 38,199,198,198,230, 87,103,130, 43, 66,173, 86,131, 82, 10,131,193,176,134, 97,152,143,252,252,252,186,
+ 7, 7, 7,223,126, 91, 26,106, 87, 87,215,166, 34,145,104,178,181,181, 53, 50, 51, 50,144,203, 1, 89, 89, 89,160,148, 34,151,
+ 43, 14, 92, 41, 50,255,211,171,222,160, 65,131,227,106,181,122,118, 66, 66, 66,165,107,121,185,184,184,248,200,229,242, 41,125,
+251,246, 29,246,222,123,239, 9, 12, 6, 3,142, 30, 61,138,245,235,215,163,103,207,158,168, 95,191, 62,102,204,152, 97,169,209,
+104,102,157, 58,117,106,102,147, 38, 77, 78,229,231,231,127, 83,149, 38,143, 73, 6,171,216,100,185,184, 32,187,228,142,198,206,
+198,198,102,189,209,104,236, 2,124, 7,115,161, 37, 30,134,220, 65, 86,166, 0, 90,181, 17, 28, 45, 54, 89, 38,117, 99,168,255,
+130, 69, 67,138,188, 40, 2,131,193, 0, 71, 71, 71, 44, 91,182, 12,185,185,185,194, 81,163, 70,121, 44, 88,176,224,158, 78,167,
+ 67, 97, 97, 33,212,106, 53,212,106, 53,140, 70, 99,165, 6, 75, 44,213, 54,175,227,216, 0,249,234,214,144, 75, 37,200,202,211,
+ 22,155,171, 28, 13, 14,252,245, 49,180, 69,106, 24,245,122,176, 58, 3,148,142,253, 81,207,187, 11,128,232,102, 38,154,149,226,
+191, 28, 11, 93,244, 89,232,162,207, 66,209,101, 14,142, 44, 25,246,210,137,111,218,228,196,196,196,196, 68, 23, 23,151,237, 33,
+ 33, 33,159,125,244,209, 71,184,120,241,226,183, 40,153, 89, 37,147,201,190,253,232,163,143, 16, 18, 18,130,200,200,200,237,149,
+117,237,212, 20,137, 68, 82,168,211,233, 74,187,130,228,213,124,214,165,213,128, 1, 76,110, 72, 72,222,146, 11, 23,230,253,241,
+199, 31,146,119, 58,117,130,193, 80,108,166, 61, 60, 60,208,189, 71, 15,233,142,189,123,149,234,156,156, 59,179, 39, 78,252,107,
+195,240,225,121,183, 11, 10, 30,152, 88,159, 77, 74,186, 6, 65, 41,109, 82,217,107, 53,161,176,176,112,221,236, 89,211, 2,247,
+ 31, 56,226, 86,199,205,197,226,244,217, 75,247,165,102, 18,198,203,163,158, 32, 63, 63, 71,184,126,205,143,102, 5, 5, 5, 63,
+153, 40,215,196,206,206, 14, 41, 41, 41,136,142,142,134, 86,171, 45,222,246,162, 66,232,178,115,160,203,205, 2,209,168, 33, 53,
+ 26,161,201, 72,133,187,151, 39,240,159, 25,134,213, 53, 96, 21, 26,172,210,191,102, 22, 22, 16, 43, 20, 16,136, 68, 38,143,193,
+114,118,118,246,243,245,245,221,187,101,203, 22,241,212,169, 83,219,184,187,187,175, 79, 73, 73,137,117,117,117,237,186,114,229,
+202,219,139, 23, 47,150, 14, 27, 54,172,209,230,205,155,135, 3,216, 92,233, 77,132, 70,179,247,248,241,227, 67,235,214,173,235,
+ 16, 22, 22, 6,141, 70, 83, 58,222, 12, 0,100,165,159,123,244,232,145, 90,163,209,164, 61,120,240, 32, 47, 54, 54, 86, 7, 19,
+102,253,205, 91,155,116, 99,234, 32,215, 1,142, 78, 46, 55,101,102,238, 30,180, 32,164,255,212, 65,174, 43, 87,237, 75,208,156,
+124,242, 36,127,238, 4,175,101,133,249,161, 19,172, 92, 11,126, 62,121,244,105,190, 41,135, 81,201,140, 65,216,218,218, 66, 40,
+ 20, 66, 36, 18,161,116, 44,146,163,163, 35,114,115,115,171,236, 34,172,172,241,206,203,203, 67,110,110, 46, 30, 63,127,136,204,
+130,100,156,217,117, 3, 70,163, 17, 26,141,166,216,204, 58,186,226,220,238,219,230, 1, 3, 91,205,182,245, 33, 23, 51, 67,233,
+ 29, 83,143, 83,134, 97,166, 12, 24, 48, 0,122,189, 30,253,250,245,195,174, 93,187,166, 0,184, 84,211,227, 61, 49, 49,241, 38,
+ 33,164, 65,116,116,180,133,193, 96,120,191,111,223,190,127,244,238,221, 27, 55,110,220,192,249,243,231, 3,116, 58, 93,148,209,
+104, 84, 59, 59, 59, 47,117,118,118,118, 32,132, 44,173,106,130, 71, 73, 42,134, 13, 77,155, 54,125,191, 75,151, 46,247,123,247,
+238,221,108,253,250,245, 86,105,105,105,165,147, 26,144,144,144,128, 19, 39, 78, 36, 31, 61,122, 52,143,227, 56, 91,134, 97,142,
+103,100,100,124, 83, 89,183,160, 94,175, 63,116,244,232,209,158, 94, 94, 94,184,116,233, 18,150, 44, 89,130,230,205,155,227,248,
+241,227,112,119,119, 71,227,198,141, 97, 99, 99, 51, 57, 47, 47,175,221,138, 21, 43,122,251,250,250,226,208,161, 67, 72, 77, 77,
+253,169,170,148, 13, 44,203, 86,107,176,222,125,247,221,209, 83,167, 78, 69,223,190,125,207,248,251,251,183,190,123,247,238,255,
+124,154, 22,149, 74,181, 44, 48, 48,112,102,139, 22, 45,240,231,159,127, 66,227,215, 1,138,223,143,226, 65,159, 14,160, 0, 84,
+191, 31, 1,165, 20,225,253,222, 1, 5,224,209,117, 32,102,206,156,217,187,127,255,254,117, 80,201,240, 8,149, 74,245,195, 39,
+159,124, 50,237,211, 79, 63, 69,112,112, 48, 54,111,222,140,123,247,238,149,181,121, 6,131, 1,145,145,145,136,140,140,132,179,
+179, 51,250,244,233, 67,198,140, 25,211,171, 87,175, 94,246, 0,252,193,243,186, 6,171, 44, 92,108,103,109,109, 29,254,243,207,
+ 63,219,182,110,221, 90,192,178, 44, 46, 6, 5, 97,254,119,211,208,171,199,103,208,115,150, 96,117, 98,112, 98,153,105,191, 40,
+237,131,188, 40, 2, 78,220, 27, 58,157, 14, 95,236, 20,193,138,164, 97,205, 8, 71, 0, 32, 26,141,166,204, 88,149,222, 61, 85,
+ 21,193,202,207, 85,232, 13, 6,138,164,180, 88, 36, 36,135,195, 66,233, 6, 42,112, 67, 90, 86, 17, 8, 28,193,106,163, 96, 52,
+ 20, 27, 32,173, 58, 1, 69, 58,242, 90, 21,102,204,122,117, 54,176,145, 53,125, 76, 37,165,116,237,142, 29, 59,134,174, 90,181,
+ 74,250,222,123,239,249, 56, 59, 59,119, 7,128, 65,131, 6,249, 88, 88, 88, 96,199,142, 29, 90, 74,233,218, 55, 24,225,249,192,
+223,223, 31, 89, 89, 89,136,137,137,185, 94,229,182,233,116,182, 74, 7, 7, 65,218,197,139,134,172,252,252, 58,157, 74,204, 21,
+195, 48,200,206,206,198,243,231,207,161, 84, 40,240, 32, 34, 66,250,227,184,113, 59, 26,251,248, 48,165, 51, 12, 77,225,232,209,
+163,230, 0,218, 86,247, 90, 77, 72, 79, 79, 47,116,114,114, 26,249,237,236,217,135,126,250,233, 39,203,212,180,212, 40,169, 68,
+194, 42,149, 50,213,228,201,227,133,121,121,121, 67, 51, 50, 50, 10, 76,213,203,206,206,198,179,103,207, 96,102,102, 6,177, 72,
+ 4, 78, 93, 4, 99, 97, 1, 52, 89,233, 16,232,117,144, 24,141,176,145, 75,225,230,232,136, 58,246,118,166,117,221, 93, 60, 83,
+ 54,160,189,124,183,224,169,246,141, 32, 85, 42, 32, 85, 42,209,225,112,241, 16, 54,177, 88, 12,172,217, 98, 74, 55,142,157, 74,
+165,250,107,253,250,245,226,204,204, 76,132,135,135,223,143,137,137,201,181,177,177, 49, 23,137, 68,220,227,199,143,207, 61,124,
+248,176,143,167,167, 39, 40,165,213,205,254,250,241,224,193,131,221, 58,118,236,200,122,120,120, 40,210,210,210,234,228,230,230,
+146,228,228, 23,199, 48,223,185,115, 71, 22, 23, 23, 87,200,113,220, 33, 20,231,193,170,246,192,159, 58,200, 85,118, 61, 4,147,
+ 58,247,112,111,110, 97,231,131, 44, 54,164,249,205,251,201,147,166, 14,114, 93,183,106, 95,130,198,140,104,255, 32,198,120, 55,
+161, 76,179,205,196,243,135,122,123,123,131, 82,138,219,183,111,227,234,213,171,184,124,249, 50, 98, 99, 99,203, 62, 99,105,105,
+137,179,103,207,162, 75,151, 46, 38, 31, 71, 69, 69, 69,112,118,118,134,181,181, 53, 14, 94,220,142,173, 43,119,149, 13,116, 47,
+ 37, 35, 35, 3,114,185, 28,139,191, 94,165, 28, 53, 99,224,247, 0,186,155,162,237,230,230,230,217,161, 67,135,247, 28, 29, 29,
+145,157,157, 13, 7, 7, 7,180,106,213,170,175,163,163,163, 71,106,106,106,173,186,178,116, 58,221,248, 46, 93,186, 44,250,250,
+235,175,193,178, 44, 62,254,248, 99, 60,123,246,108,239,211,167, 79,215,212,173, 91,119,210,132, 9, 19, 28,237,236,236, 48,126,
+252,120, 5,128, 1, 85, 24,172,165, 43, 86,172, 24, 26, 24, 24,200, 24, 12,134,119,206,159, 63,143,152,152, 24,232,116, 58,176,
+ 44,139,152,152, 24,204,155, 55, 47, 57, 47, 47,175,115, 66, 66,194,147,234,202,149,146,146, 50,237,240,225,195,189, 27, 54,108,
+136,211,167, 79, 99,236,216,177,199, 45, 44, 44,154,250,248,248,212,169, 83,167, 14,254,250,235, 47,152,153,153,193,217,217,217,
+113,214,172, 89,125,122,244,232,129,115,231,206, 97,225,194,133,199,156,156,156,126,172,206, 4, 11,133, 66, 24, 12, 47,222,208,
+ 10, 4, 2,220,187,119, 15,239,190,251, 46,102,206,156, 9, 0, 56,119,238,156, 69,247,238,221, 31, 4, 4, 4, 88, 4, 5, 5,
+105,241, 63,140, 66,161, 24,249,251,239,191, 35, 58, 58, 26, 87,174, 92, 65, 70, 70, 6,116, 58, 29,114, 74,172,168,180, 36,146,
+ 69, 93,234,162,253,180,217, 24,210,103, 0,146,147,147,193, 48,140, 93, 21, 55,124,195,102,207,158,141,147, 39, 79, 98,249,242,
+229,200,205,205,173,240,115,102,102,102,104,213,170, 21, 90,182,108,137,103,207,158, 1,128, 29,120,222,156,193,178,182,182, 94,
+179, 97,195, 6,219, 14, 29, 58, 8, 74,204, 14, 90,183,106,133,225, 35, 71,226,236,193, 99,112,104,216, 19, 68,167, 4, 43,151,
+152, 22,193,178,216,134, 76, 67, 38,100, 98, 25,164, 58, 29, 56,206, 12,161, 9,154, 50,215,172, 86,171, 81,106,178, 10, 11, 11,
+161, 80, 40,170, 54, 16, 58, 73,112,228, 51,214, 45, 55,255, 30,110,134,108,135, 65,103, 64,189,134,179,161, 54,216, 66, 97,255,
+ 25, 52,186,191, 96,204, 41,158,185, 43,177, 8, 64, 74, 74, 6, 0, 98,106,196,229,213,147, 60,255,213,193,238,156,209,244,188,
+171, 73, 73, 73,153, 42,149,106,243,245,235,215, 39, 15, 24, 48, 0,103,207,158,157, 13, 0, 3, 6, 12,192,245,235,215,241,236,
+217,179,205, 73, 73, 21,207,160,170, 41, 46, 46, 46,195, 59,119,238, 60,161,117,235,214, 56,118,236, 24,140, 70,227, 9, 83,190,
+ 39, 16,137, 40, 33, 4,165, 51,156,178,178,179,241,232,209, 35,100,101,102,194,104, 52,162, 72,173,102,155, 54,106,148, 71, 57,
+206,188, 38,229, 41, 63, 99,176,162, 89,132,165,175,213,116, 59, 83, 82, 82, 98,235,213,171, 23, 87, 84, 84,104,111,109,101,157,
+ 47,145, 72,140,121,249,249,185,209, 81, 15,117,166, 52, 10,229,136,140,136,136,104,150,144,144,128,184,184, 56,176,133,249, 16,
+104,117, 96,180, 69,232,218,190, 29,204, 64, 33, 3, 7, 17,103,128, 72, 32, 66,126,241,108,187,200,106,143,249,114, 13, 66,169,
+185, 34,132, 64,166, 84, 66,162, 84, 64,106,174,124, 33,162,101,202,196, 47, 51, 51,179,157,155, 55,111,118,118,114,114,194,170,
+ 85,171,224,236,236,220, 56, 48, 48,176,168,115,231,206,102,118,118,118,104,216,176, 33,252,253,253,113,241,226, 69, 16, 66,158,
+ 84,115,156,179,132,144,238, 87,174, 92,153,118,237,218,181, 65, 42,149,138,124,250,233,167,232,217,179, 39,100, 50, 25,138,138,
+138,144,157,157,141,227,199,143, 19,163,209,232, 91, 98,240,234,186,187,187,239, 34,132, 36, 60,127,254,252,163,151, 53,183,175,
+246, 81,165,101,113,159, 57, 58,185,244,239,220,195,189,249,187, 61, 2,225,217,224, 93,188,219, 35, 14, 0,150,217, 8, 99, 62,
+ 94, 57,167,217, 33, 59, 55,155,223,206,156, 58, 59,175, 99,231,119,191,157, 53,198,122,209,178,205,217,213,142,151, 35,132,148,
+ 53,182, 12,195, 84, 24,165, 18, 10,133,101,179,205,170,189,105,226,140, 9, 61, 71,180, 43,123,110, 96, 13,118, 46, 78,110, 76,
+105,228, 10, 0,114,115,115, 17, 31, 31, 15,131,193, 0, 91, 91, 91, 24, 12,122,159, 26,116, 63, 78, 26, 60,120, 48,209,104, 52,
+152, 54,109, 26,126,248,225, 7,244,235,215,143,220,186,117,107, 18,128, 41,181,136,104,172,156, 48, 97,194,180,145, 35, 71, 34,
+ 39, 39, 7, 23, 46, 92, 64,151, 46, 93,176,113,227, 70,251, 11, 23, 46, 44,105,223,190, 61, 4, 2, 1,206,158, 61, 11,189, 94,
+255,168,202, 6, 64, 40,124, 63, 48, 48,144,137,143,143,135, 88, 44,134,191,191, 63, 18, 18, 18, 80, 84, 84,132,180,180, 52, 44,
+ 88,176, 32, 37, 55, 55, 55, 32, 49, 49,241,137, 9,251,133,233,208,161,195,228,250,245,235,227,194,133, 11, 24, 55,110,220, 73,
+133, 66, 49, 32, 51, 51,115,140, 70,163, 89, 55,120,240, 96, 52,110,220, 24, 81, 81, 81,120,239,189,247,208,170, 85, 43, 92,184,
+112, 1, 51,102,204, 56, 46,151,203, 63,172, 38, 15,214,227,160,160,160,102,254,254,254, 40, 42, 42, 66, 94, 94, 30, 68, 34, 17,
+172,172,172, 16, 25, 25,137, 6, 13, 26, 96,230,204,153, 88,181,106, 21,166, 78,157,202,117,239,222,157,213,235,245, 98,137, 68,
+242, 63,223, 72, 23, 22, 22,210,228,228,100, 88, 88, 88, 96,223,190,125, 8, 59,119, 26, 39,190,252, 12,178, 57, 43, 65, 41, 69,
+252,162, 89,232, 58, 99, 14,218,222,127,138,228,228,100,108,219,182, 13, 12,195,148,205,136,173,172,109,203,205,205, 69,203,150,
+ 45,113,251,246,109,108,219,182, 13,171, 87,175, 46,139,214,138, 68, 34, 4, 4, 4,160, 91,183,110,120,252,248, 49, 54,111,222,
+ 12, 11, 11, 11,222, 49,189,105,131,197,113,220,187,173, 90,181, 18, 20, 20, 20, 64,163,209, 32, 37, 37, 5, 49, 49, 49, 48,147,
+155, 33, 62, 35, 17, 45,124,245, 72,225,242, 16,121, 63,220, 72, 4,162,123,213,221,129,232,116, 58,232,116, 58,132,134,134, 22,
+ 79,125,111,176,180,108,160,167,193, 96,128, 86,171,133, 90,173,198,133, 11, 23,168, 84, 42,133, 66,161, 32, 85,245,189,115,172,
+246,228,133,171,247,123, 15,235,223, 69,114, 54,104, 43, 12, 58, 14,121, 26, 11, 20,168,181, 40,208,136,160,149,246, 0, 33, 87,
+192, 8,164,104,223,178, 62, 46, 92,141,210, 24, 13,122,147,210, 21,128, 51, 66,232,236, 3, 54, 57,244, 63, 47,189, 52,155, 80,
+ 44, 87,130, 51,214,108, 86,176,153,153,217,198,157, 59,119,142,108,215,174,157,121, 96, 96, 96, 3, 0,144, 74,165,220,206,157,
+ 59,243,205,204,204, 54,214,116, 39,190,156,189,221,217,217,185,163, 68, 34,153,216,183,111,223,142, 35, 71,142, 68,120,120, 56,
+254,252,243,207,251, 42,149,170,202, 49, 51, 2,137, 36,179, 32, 45,205, 74,233,225, 33,180, 50, 55, 79, 58,125,250,180,251, 59,
+157, 59, 35, 54, 38, 6, 89, 89, 89, 80,171,213,136,136,140,164, 98,134,137, 35, 22, 22,204,163,144, 16, 70, 32,145,100,214,160,
+156,145,213,205, 34,172,109, 52, 75, 97, 70,234,205,153, 57,198, 83,163,209, 52,203,203,203, 99, 69, 34,145, 72, 46,161,177, 53,
+209, 48, 24, 12,199,174, 92,185,242, 65,135, 14, 29,164, 81,161,247,192,230,230, 66,151,155, 13, 49,103,132,141,111, 11, 8,244,
+ 90, 64,103,128, 75, 19, 10, 77,142, 28,215,238, 61, 53, 24, 12,134, 99,166, 26, 44, 70, 32,120,113,220,149,133, 18, 82,115,115,
+ 72,148,202, 23, 94, 39,213,244,107, 57, 58, 58,202,123,245,234,213,213,215,183, 56,167,214,202,149, 43,161,215,235, 37, 6,131,
+161,108, 38, 92, 65, 65, 1,246,239,223,143,237,219,183, 95,179,180,180,252,221,132,155, 9,214,213,213,117, 34,199,113, 14, 44,
+203,234,237,237,237,197,123,247,238,133, 76, 38, 3,195, 48,104,217,178, 37,100, 50,153, 86,165, 82,233, 75,202, 96, 88,181,106,
+149,240,179,207, 62, 19, 87,164,215,168,121,227,233,158,172,117,103,153,153,187,135,133,157, 15, 60, 27,188, 11, 0,232,214,103,
+ 20, 60,235,215, 65, 94, 70,168,135, 70, 29,211, 95, 44,204,182, 14, 95,151, 24, 97,246, 94,179,145,133,105, 65,143, 1,252, 98,
+210,169,201,113, 8, 12, 12, 68,143, 30, 61,202,186, 3, 29, 28, 28,160,211,233, 96, 52, 26,107, 52,150,173, 52,137,232,130, 5,
+132,193, 60,224,247, 54, 22, 41, 0,236,203,155,171,184,184, 56,196,197,197,149,221, 8,114,212,180, 20, 42, 42,149,202,204,211,
+211,115, 68,179,102,205,112,254,252,121,132,134,134, 38, 6, 5, 5,185,180,110,221, 26,174,174,174, 35, 85, 42,213,236,164,164,
+ 36,147, 19, 42,219,219,219, 43, 58,117,234,244,229,200,145, 35,241,240,225, 67,204,154, 53, 43, 51, 57, 57,249,208,209,163, 71,
+ 63,255,234,171,175,152,206,157, 59, 35, 45, 45, 13, 27, 55,110, 52,222,190,125,251, 7,107,107,235,133,213,236,247,135, 73, 73,
+ 73,174, 26,141, 6, 89, 89, 89, 96, 89, 22, 69, 69, 69, 56,117,234, 20, 78,159, 62,157,154,147,147, 19,144,148,148, 20,109, 74,
+217,234,214,173,107,238,239,239,239,248,248,241, 99,236,218,181, 11,122,189,126, 78, 76, 76,140,222,210,210,114,199,146, 37, 75,
+230, 89, 90, 90,218, 4, 6, 6,162,244,184,253,235,175,191, 48,127,254,252,227,102,102,102, 3, 34, 34, 34,244,213,200,247,255,
+254,251,239,191,183,179,179,251,104,232,208,161,140,191,191, 63,238,222,189, 11,163,209,136,174, 93,187,150,153,171, 83,167, 78,
+237, 60,117,234,212, 64, 0, 98,165, 82, 41,251, 95,143, 94,149,162,209,104, 16, 21, 21, 5, 71, 71, 71,212,111,221, 14, 51, 31,
+ 60,199,149,235, 55, 64, 41, 69,199,240,231, 40, 40, 40,196,239,191,255,142,224,224, 96, 8, 4, 2,120,121,121, 85,171,169,215,
+235, 17, 29, 29,141,244,244,116,244,235,215, 15,195,134, 13,195,138, 21, 43,160,215,235,241,237,183,223, 34, 43, 43, 11, 91,182,
+108, 65,116,116, 52,132, 66, 33,148, 74, 37,239,152,222,180,193, 42,233,102, 2,199,113, 72, 76, 76,196,221,187,119,241,252,249,
+115, 40, 20, 10,168, 89, 35,183,241,220, 85,142, 16,113, 2, 71,233, 53,202, 22,103, 17,175,202,137, 27, 12, 6, 34, 20, 10,113,
+253,250,117, 60,125,250, 20,230,245,105,153,185, 42,141, 96, 21, 21, 21, 65, 36, 18, 21,220,184,113, 35, 38, 56, 56,216, 83, 40,
+ 20,234, 42,211, 76,179,206,222,118,246,252,185,233,126, 45,189, 27,116,235, 60, 31,199,142,205, 67,118,110, 30,138,116, 34,228,
+171,245, 40, 84, 83,184, 88, 52, 64,107, 31, 31,164,103,233,240, 56, 60, 56, 33, 67,108, 83,109, 31,140,129, 50,185, 59,151,141,
+181,124,127,216, 56,152,185,191, 3,109,248, 62,112,249, 41,224,242,139,187, 77, 36, 10, 11,152,219,185,161,160, 72,131,171, 15,
+158,194, 64,153, 92, 83, 43,253,201,147, 39,249, 42,149,106,221,212,169, 83,151,223,184,113, 93, 1, 0,247,238,221, 43, 76, 74,
+ 74, 90,148,148,148,148, 95,147, 29, 88, 46,123, 59, 81, 40, 20,143,235,215,175,111,120,239,189,247,108,251,247,239, 15, 59, 59,
+ 59,132,132,132, 96,217,178,101, 33,133,133,133, 67, 98, 98, 98, 12,213,116, 59, 36, 6, 31, 62,108, 17,240,233,167, 86,179,250,
+245, 91, 54,126,252,248,159, 22, 46, 92, 40,174, 87,191, 62, 56,163, 17, 17, 17, 17,116,199,142, 29,236, 47,115,231,174,148, 40,
+ 20,194,219, 71,142,136, 88,173, 54,241,191,125, 16,187,186,186,118,238,221,179,115,147, 31, 86,173,131, 70, 93,128, 91,215,143,
+ 35, 59, 59, 29,155,183, 28,108,226,234,234,218,217,212,193,196, 9, 9, 9,123, 14, 28, 56, 48,205,199,187,137,175,151,155, 27,
+194, 98,159, 67,194, 25, 33,102, 89, 8,244, 90, 48,172, 6,110,205, 40, 8, 99,142,148,148,124,108, 60,125,225, 65, 66, 66,194,
+158,106, 35,137,189,222,199,144,216, 92, 16, 66,112,166,147, 55,100,230, 74, 72, 20, 10,180, 63,112,169,204, 84,197, 46,253, 26,
+ 34,133, 18,214,173,223,169,182,156,169,169,169, 69,245,235,215,191,251,240,225,195, 86,141, 26, 53,194,130, 5, 11, 16, 31, 31,
+ 15, 74, 41,210,210,210, 52,233,233,233,137,153,153,153, 49,132,144, 67, 73, 73, 73, 91, 77, 93,138,132,227, 56,135,163, 71,143,
+ 2,128, 24, 0,206,159, 63, 15,149, 74, 5, 75, 75, 75,228,229,229,225,211, 79, 63,149,126,247,221,119, 0,128,187,119,239,138,
+204,204,204, 42,213, 10, 11,142,252, 33, 39,159,102,211,130,144,254, 89,108, 72,243,119,123,196,163, 91,159,145, 56,123,236,119,
+ 92, 56,125, 14, 54,194,152,231, 80,228,159,204,120,158,145,151, 80,216, 96, 83, 19,191,207, 5,201,133,167, 55, 77,234,103, 45,
+112,118,230,246,205,218, 80,121,226,222,210, 59,112,129, 64, 80, 54, 6,171,116, 64,123, 77,205, 85,121,230,205,163, 28, 1, 33,
+ 94, 98,113,104, 98, 74,124, 55,149,163, 43, 82, 83, 83, 17, 31, 31,143,184,184, 56,196,199,199,163,126,253,250,120, 30,251, 20,
+ 18,137,248,158,137, 81,240,161,125,251,246, 53,215,233,116, 56,124,248, 48, 75, 8,233,115,244,232,209,187, 45, 90,180, 16,118,
+233,210,197,252,247,223,127, 31, 10, 96,107, 77,238, 37,148, 74,165, 88,175,215,227,143, 63,254, 64, 66, 66, 66,231,148,148,148,
+ 72,149, 74,181,105,236,216,177, 27,154, 52,105, 82, 63, 50, 50,242,177, 90,173, 30,159,148,148, 20, 90,157, 88, 78, 78,206,168,
+158, 61,123,238,227, 56,174,110,199,142, 29, 21,243,230,205,179,120,244,232, 17,220,221,221, 65, 41, 13,171,201, 82, 83,177,177,
+177,249, 87,175, 94, 77,109,218,180,169,163,179,179, 51,196, 98,241, 50,103,103,231, 69, 74,165,242,135, 46, 93,186,216,236,216,
+177, 3,167, 79,159,134, 72, 36,194,211,167, 79,147, 30, 62,124,184,198,201,201,105,173, 41, 25,220,131,131,131,159, 1, 24,210,
+186,117,235,249,171, 87,175,158,195, 48,204, 39,103,206,156,129, 72, 36, 2,128, 50,115,229,225,225, 49,124,223,190,125,195,222,
+178,118,218,160,211,233, 96,107,107,139,244,244,116,164,165,165,161, 78,157, 58,104,215,174, 29, 12, 6, 3,142, 28, 59,142, 43,
+ 87,174,128, 82, 10, 59, 59, 59, 88, 90, 90,226,254,253,251, 0, 80,213,236, 97,131, 94,175,135,141,141, 13,114,114,114,112,255,
+254,125, 56, 56, 56, 96,234,212,169,208,233,116,216,187,119, 47,238,221,187, 7,134, 97,224,224,224, 0,115,115,115, 83, 52,121,
+106,106,176, 4, 2,193,197,139, 23, 47, 14,244,241,241, 17, 70, 71, 71, 35, 58,186,248,102, 70,173, 86,179, 66, 1,246,167,134,
+ 30, 30, 82, 69,227, 31, 88, 62, 87,134, 68, 34,217, 56,112,224,192,241,163, 70,141,194,196,137, 19, 65, 8,193,111,247,116,136,
+139,227, 96, 48, 24,144,154,154,138,176,176, 48,218,170, 85, 43,194,113,156, 62, 32, 32,224,139,224,224,224,214, 2,129, 32,175,
+ 50, 77, 26, 20,196, 58, 54,239,255,225,207, 27,183, 94, 26, 49, 98,132, 77,223,126, 63,227, 94,100, 4,114,139,236, 1, 74,225,
+ 98,175, 68,235,134, 95, 35, 45, 83,131,211, 39,143,101,115,172,230, 67,250, 96,183,161,170,114, 2, 64,186, 80,237,176,105,251,
+129,149,187,247, 29,252, 98,244,200,161,178,128,192, 79, 33,206, 8, 3,155, 20, 12, 23,239,142,160, 66, 51,220, 14, 14, 65,104,
+116,188,166, 72, 47,216,154, 39, 86, 79,175, 78,179, 60,217,217,217, 39, 82, 82,146,127, 46,157, 28,192, 48, 68, 33,145, 72, 79,
+ 84, 99,166, 2, 95,202, 11,244,114,134,248,134, 75,151, 46, 77,179,181,181,229,194,195,195,177,113,227, 70,227,221,187,119, 15,
+112, 28, 55, 39, 35, 35,163,168, 58, 77,123,131,225,254,206, 89,179,188, 91, 15, 24, 64,251,127,241,133,134,145,201,198, 47, 91,
+181,106,118,102,110,174, 11, 0,216, 88, 89,197,111,158, 63,127, 97,175,222,189,243,195,175, 94, 53,187,126,248,176,153,132,101,
+131,171, 43,231,155,160, 42,205,132,132,132, 75, 13,234,213,193, 31, 91, 87, 65,175,215, 34, 57,177, 56,112,149,145,153,139,170,
+204,213, 43,199, 82,241, 44,170, 1,171,215,172,189, 57,238,211, 79,156,222,233, 26,136,184,251,247,160,207, 74, 7, 49,176, 16,
+ 17, 33, 10,211,228, 72, 75, 45,192,210, 19,231,210,212, 26,205,128,151, 19, 57, 86, 86,206,178,110, 65, 11,115, 72, 20,197,227,
+174,202, 71,173,196,230, 22, 16, 41,148, 16,136,197, 21, 13,134, 15,172, 32,167,220,135,163, 71,143, 14, 61,113,226,132,245,144,
+ 33, 67,240,254,251,239,135,228,228,228,116,201,202,202,202,175,109,125, 50, 12,147,214,187,119,111, 7,157, 78,199, 14, 30, 60,
+ 88,152,145,145,129,210, 41,246, 5, 5, 5, 56,121,242, 36, 26, 53, 42,158,157, 31, 30, 30,142,166, 77,155, 86,170,249,249,140,
+176, 68, 0, 11,167, 14,114, 93,121,243,126,242, 36, 0,203, 60,235,187,225,194,233,115,184,114,225,250,172,182,205,184,117,189,
+135,181,250, 94,222,229,163,233, 77,252, 62, 23, 40, 45,156,177,237,224, 1, 65,100,240, 47,139,139,138,194,234, 1,248,186,178,
+114,150,118, 95,191,156,146, 65,173, 86,155,100,174,170, 58,150, 40, 40,181,203, 37,179, 71, 77, 27,212,230,236,174, 91,230, 74,
+165, 18,122,189, 30,148, 82,212,171, 87, 15, 66,145, 16,191, 30,250,169, 48, 39, 39, 99,174, 41,154, 10,133, 98, 98, 64, 64, 0,
+158, 60,121,130,208,208,208, 3, 73, 73, 73,161, 42,149,234,192,179,103,207, 6,183,105,211, 6,123,246,236,153, 88,153,193,170,
+ 76,179, 52, 99, 61,165, 20, 70,163, 49, 11, 0,146,146,146,238,155, 18,253,125, 89,179, 36, 89,104, 7, 0,104,210,164, 73,188,
+163,163,163,197,253,251,247,225,236,236, 12,189, 94,223,166, 38,199, 18,165,148, 83,169, 84,107,111,223,190,189,180,101,203,150,
+248,248,227,143,187,221,189,123,183, 91,139, 22, 45,224,229,229,133,107,215,174,225,204,153, 51,127,114, 28, 55, 54, 57, 57, 89,
+ 83, 85, 18,212,202,182,253,246,237,219,209, 0, 62,245,243,243,251, 72, 40, 20,194,194,194, 66,144,152,152, 40, 56,115,230, 12,
+ 0,140,222,183,111,159,177, 54,251,253,239,184, 46,189, 41, 77, 66,200,183,195,135, 15,223, 52,102,204, 24, 89,155, 54,109, 94,
+136,168,158, 56,113, 2, 28,199,193,214,214, 22,182,182,182,136,142,142,198,161, 67,135,116,185,185,185,107,196, 98,241,178,170,
+ 52, 63,253,244,211, 77, 99,198,140,145,181,110,221, 26,185,185,185,101,230,237,216,177, 99, 32,132,192,206,206, 14,182,182,182,
+120,252,248, 49, 14, 29, 58,164,201,206,206, 94,165,211,233, 86,252,157,219,254,175, 51, 88, 89, 89, 89,147,191,249,230,155, 46,
+ 95,124,241,133,109, 97, 97,161,192,214,214, 22, 41, 41, 41,236,169, 83,167,178,242,243,243, 39,215,228,199,174, 95,191, 62,161,
+ 79,159, 62,107,126,251,237,183, 45, 91,183,110,237, 60,120,240, 96,124,250,222,123, 24,215, 86, 14,173, 86, 11, 66, 8, 78,159,
+ 62,253,232,226,197,139,158, 98,177, 88, 59,111,222, 60, 14,192,205,106,239,232,195, 14, 69, 56, 54,239,223,121,221, 79, 27,246,
+251,250,183,173,235,238,225, 46,109,239,106, 9,189,193,136,212,180, 76, 92,186, 30,174,141,138,184,151, 72,245,250, 15,211, 34,
+170,207,226, 14, 0, 17, 17, 84, 15, 96,178,183,183,197,130, 21,155,118,108,220,190,107,127,255,209,195, 6, 8,125, 91,116,197,
+179,235,135,112,249,230, 5, 54, 91, 67, 15,229,139, 4,227, 34,162,243,178,107, 90,241, 90,173, 86, 71, 8, 40,254,147,125,157,
+106,181, 90, 93,109,206,199,242, 79,126,253,245, 87, 36, 39, 39,107, 99, 99, 99,119, 83, 74, 55, 37, 39, 39,155,156, 62, 97, 29,
+165,186, 1,132,156,155,211,177, 99,207, 57,167, 79,203, 6,125,249,165,174,255,135, 31, 78,135, 86,171,135, 68, 66,133, 10, 5,
+ 3,169, 84, 20,126,245,170,217,218,113,227,108,136, 78,119,246,119, 74, 77, 14,193,255, 29,179, 8,203, 69,176, 48,226,243,175,
+160, 46, 23,193,186,113, 39, 10, 53,137, 96, 1, 64,114,114,114,156,179,179,115,219, 69,107,215, 29,236,213,182,117,147, 6, 42,
+103,169,173,135, 59,148, 78, 78,200,202,200,192,173,123, 79, 12, 63,157,187,244, 64,173,209, 12, 48, 53, 47, 12,199,113,101,179,
+220,188,191,156, 9, 70, 32, 40, 51, 2,165, 73, 3, 45,252, 59,130, 8,133, 48, 82, 10,189, 94, 95,237, 32,172,164,164,164, 4,
+ 23, 23,151, 15,191,252,242,203,243,127,252,241, 7, 19, 16, 16,208,242,175,191,254,122,173, 69,115, 19, 18, 18, 92, 75,186,181,
+242, 44, 44, 44,132, 35, 71,142,132,193, 96, 64, 81, 81, 17,114,115,115,145,153,153,169,157, 50,101,138, 20, 0,196, 98,177,161,
+103,207,158,213, 94, 63, 86,237, 75,208, 76, 29,228,186,206, 70, 24,243,113, 94, 70,168,135,141, 48,230,121,219,102,220,186, 85,
+251, 18, 52, 11,190,178, 90,148, 17,115, 41, 42,185,240,244,166,109, 7, 15, 8,134,247,255,208,232,170,124, 60, 75,230, 64,247,
+191,219,183,218, 70,232,149,164,162,181,141, 92,189, 76,198, 3, 26,226,217,209,122,105,151, 65,173,103, 47,154,182, 74,233,224,
+ 96, 15,214,200,226,121,220, 51,252,118,112,125, 97,190, 54,123,113,102, 4,189,107,138,150,167,167,167,135, 64, 32,192,145, 35,
+ 71, 0, 96,125,201,203,235, 79,157, 58, 53,120,200,144, 33,168, 91,183,174,183,187,187,187,180,170, 52, 26, 21, 69,239, 12, 6,
+ 3,222,244,186,214,132,144,167, 27, 55,110,116,177,177,177, 33, 87,174, 92, 97, 25,134, 57, 90, 83, 13, 39, 39,167, 31,143, 31,
+ 63,222,137, 82,218,211,215,215, 23,117,235,214, 45,185,158, 70,224,202,149, 43,187, 18, 19, 19, 71,188,161,197,157, 41, 33, 4,
+121,121,121,165, 3,237,244, 74,165,242,173, 92, 52, 58, 49, 49,113,187,163,163,227,233,249,243,231,127, 87,175, 94,189,177,163,
+ 71,143, 22, 52,108,216, 16,185,185,185,176,176,176,128, 74,165, 66, 98, 98, 34,182,111,223,110, 76, 75, 75,251,141, 97,152, 5,
+ 73, 73, 73, 73,181,213,180,182,182,134,179,179, 51, 18, 18, 18, 74, 53,183, 24, 12,134,133,233,233,233,169,224,121,179, 6, 43,
+ 37, 37, 37,195,201,201,169,233,175,191,254,186,182, 56, 77, 67,113, 84, 43, 63, 63,127,114, 74,241,136,241, 26,113,236,216,177,
+ 39, 0, 2,250,244,233, 83,111,255,254,253, 91,118,238,220,217,185, 95,191,126, 24, 60,120, 48, 88,150, 69,175, 94,189, 70,188,
+ 28,181, 50,133,212,176, 67, 17, 36, 32,160,233,221, 91,151, 63, 13,185,123,179, 15,165,212, 7, 0, 33, 12,243,159,197,158, 35,
+106,190,216,115, 68, 68, 94, 54,128,143,124, 93, 45,188, 22,175,223,177,213, 76,200,117, 84,179,204, 85,181,150,249, 34, 36, 33,
+175,214, 11,140,150,100, 94, 95,206, 48,100, 70,241,115,211,150,134,169, 68, 99, 38, 0, 8,133,162, 61,119,239,222,157, 29, 27,
+ 27,155,104,202, 12,175,138, 56, 72,105,220,167,132,156,153,238,227,211,181,207,148, 41, 34,191,238,221,205,109,220,220, 56, 74,
+169,241,249,173, 91,228,198,145, 35,162, 27, 71,142,200, 12, 90,237,249,125,148,214,104, 6,212,223, 49,139,176, 52,130, 85,207,
+203,245,204,192, 1,189,187,123,121,168, 0, 0, 79,159, 39, 33, 35, 43,247, 76, 77,115, 13,149,154, 44, 66,136,255, 95, 44, 59,
+ 88, 36, 18,245, 33, 37,169, 24,104, 45, 22,123, 54, 26,141, 9,109,219, 86,178,121,243,150, 85,102,200, 82, 77,188,240, 6,169,
+ 84,170, 79,218,183,111,191, 44, 41, 41,233, 96,122,122,122,225, 27,186, 46,244,218,185,115,231, 9,142,227,204, 94,138,112,229,
+ 37, 37, 37,153,151, 52,164,117, 79,157, 58,181,139, 16, 82,173,129, 95,181, 47, 65,179,114, 78,179, 67, 26,117, 76,127,162, 44,
+ 58,180,106,109,241,172,150,121,171,115,114, 1,252, 50,169,191, 13, 23, 25,252,203, 10, 23,139,199, 51,214, 30,202,250,173, 58,
+ 61,134, 97, 30,183,105,211,166,204,104, 85, 83,255, 73,181,169,128,103, 87,179,151,217,250,144,139,159,205, 28,248,189, 78,175,
+111,193, 16, 80,145, 88,124, 63, 39, 39, 99,174,169,230,170,196, 88,252, 60,109,218,180,201, 79,158, 60,217, 85,154,243, 46, 41,
+ 41,233,186, 74,165,250, 49, 46, 46,110, 66,124,124,252,250,248,248,120,147,205,149, 82,169,212,168,213,106,142,101, 89, 70,171,
+213, 66, 34,145,232,223, 84, 99, 80, 88, 88, 56,116,195,134, 13,191, 26, 12,134, 38,132,144,163, 57, 57, 57, 53,206,122, 27, 28,
+ 28,108,240,246,246,238,119,252,248,241,201, 15, 30, 60,152,234,232,232,232,152,154,154, 26, 27, 23, 23,183, 52, 37, 37,229,151,
+ 55,100,174, 16, 28, 28, 44,245,243,243,211,150,171, 23,139,183,101,188, 85,133,237, 91,106,106, 58,128,137,174,174,174,107,166,
+ 79,159,190,184, 69,139, 22, 3, 71,141, 26, 69,228,114, 57,246,238,221,139,152,152,152, 67,148,210,217, 53,233,210,173, 76,211,
+204,204, 12,123,247,238,165, 49, 49, 49,251, 24,134,153,147,148,148,244,175, 88, 72,251,239,128,188,233,187,160,154,134, 79,251,
+244,233, 83, 47, 35, 35, 99,139, 86,171,125, 7, 64, 97,104,104,168,249,127, 59, 36, 91, 21, 1,222,246,138,160,136,234, 27, 50,
+ 83, 53, 95, 30,160, 94, 27,205,154,104,152,170, 89,217, 98,207,156, 86,155,100,203,178,119,215, 81,170, 51, 85,211,197,197,101,
+ 33, 76,204, 23, 85, 66,100, 98, 98,226,119,181,169,207, 6, 13, 26,208,232,232,104, 80, 74,201,155,220,239,127,199,177,244,111,
+210,220,190,218, 71,213,168,121,227,233, 97,193,145, 63,148,116, 31,150,177, 96,146,141,121,199,119, 3,230, 94,189, 16,244,253,
+188,117, 47,118,113,190, 13,219, 78, 8, 97, 42, 50, 22,165,201, 61,107,170, 89,167, 78,157, 77,190,190,190, 95,132,132,132,252,
+ 26, 23, 23, 55,250,159,186,237,132, 16, 82,183,110, 93, 73, 77,162,115,252,121,100,154,166,147,147,147, 63,195, 48,115, 75,110,
+ 56, 22, 39, 36, 36,220,126,131,154, 70, 74,233,162,228,228,228,144,255,239,109,255,215, 69,176,254,110, 74, 35, 90,239,191,255,
+190,131, 64, 32,248,199, 47,210,105,138,185,170,105, 20,234,159,160,241, 50, 37, 6,234,250,155,208,122,217, 44,253,157, 60,126,
+252,152,240,167,245, 63,143, 79,191, 10, 77, 2, 48,197,191,130,212, 84, 37,166,106,122,151,247,223,206,109,175, 44,106, 83,219,
+133,152,227,226,226,198,170, 84,170,169, 53,153,125,248, 95,218,110, 10, 64,203, 31,253,111,158,148,148,148,187, 0,250,254,211,
+ 53,121,131,245, 15,225,175,191,254, 74,227,119, 7, 15, 15, 15, 79,245,252,211,205, 21, 15, 15, 79,241, 0,233,192, 74,238, 62,
+ 76, 14,253, 17, 66, 2,107,113,119,115,142,215,228, 53,121, 77, 94,147,215,228, 53,121,205,127,151,230,191,134,210, 89, 76,127,
+199, 3, 64, 32,175,201,107,242,154,188, 38,175,201,107,242,154,188,230,191,237,193,240, 22,147,231,239,230,167, 1,196,229,167,
+ 1,196,229,239,250, 60, 15, 15, 15, 15, 15,207, 63, 13,225,219,182, 65,254,254,254,222,148,210,161,132,144,129, 37, 17,186,253,
+132,144,157,119,239,222, 53, 41, 3,173,153,153, 89,170, 70,163,113, 0, 0,153, 76,150,166,209,104,156,202, 71, 75,129, 87,150,
+200,160,197, 63, 83,249,128, 85, 79, 79,207, 84,173, 86,235, 96, 66, 52,241, 18, 33,228, 50,195, 48,151,106,147, 94,224,221,119,
+223, 29, 33, 16, 8, 22, 3,128,209,104,252,246,194,133, 11,127,252, 93,245, 76, 8,105,227,166,114,250, 93,111,208,179,169,233,
+ 89,115, 41,165, 71, 42,250,220,134,190,100,169,144, 96,122,201,255, 43,199, 31,165, 85, 78,253,174,233,231,171, 40,159,191, 72,
+ 36,154,232,232,232,216, 43, 33, 33,225, 46,128, 25,148,210,106,143, 1, 43, 23,239, 79, 69, 34,209, 48,131,209,232, 37, 18, 8,
+158, 26, 12,134, 29, 57,137, 17,219,249, 75, 5, 15, 15, 15, 15,207,223,102,176,218, 53,176,109, 72,168,126,186,136,208, 78, 6,
+ 74,174, 80, 34, 94,121,227,113,102,212,235, 20, 64,165, 82,185, 17, 66, 2, 40,165, 77, 24,134, 9,227, 56,238, 76, 77, 23, 59,
+246,243,243,115, 3,240, 49,128, 33,109,219,182,109, 54,110,220, 56,212,175, 95, 31, 26,141, 6,183,111,223,158,181, 99,199,142,
+ 89,126,126,126, 15, 0,236, 2,176, 59, 56, 56, 56,190, 50, 45,141, 70,227, 80,234,149, 8, 33, 14, 3, 7, 14,188, 93,222, 84,
+149, 44, 46, 75, 40,165, 55, 8, 33,215,141, 70,227,205,125,251,246,197, 55, 38,164,205, 24, 15,241,254,201,207,116,174, 47,107,
+106,181, 90,135, 99, 83, 39,128, 82, 14,154,204, 12,116, 88,182,182,236,189,147, 61,219,130, 49, 26, 32,145,138, 47, 5, 28,189,
+113, 25,192,165,146, 71,141, 17, 8, 4,139, 79,157, 58,229, 76, 41, 69,143, 30, 61, 22, 3,248, 91, 12, 22, 33, 68,218,214,191,
+197,197,163, 7,118,201, 10,178, 82,209,179,223,224, 29,132,144, 17,148,210, 3, 47,152,165,222,196,145, 8, 49,125,220,146,157,
+ 2, 0,216, 48,123,232,140, 53, 61,200,186, 41,167,105,138,139,139, 75, 23, 74,233,140, 18,189, 21,137,137,137, 23, 55,244, 38,
+142, 16, 96,230,184, 37, 59, 9, 0,108,156, 61,116,250,134,222,100,237,248, 19, 53,155, 37, 73, 8, 25, 63, 98,196,136,117,139,
+ 23, 47, 22, 56, 59, 59, 35, 49, 49,177,167,183,183,119, 67, 66,136, 55,165,180,210,193,193, 54,117,124,246,244,236,217,203,243,
+227, 65, 3,228,246,118,214, 72, 72,206,176,248,115,199,206, 49, 54,117,124,122,101,197,133, 14,230, 47, 23, 60, 60, 60, 60, 60,
+111,204, 96, 53,107,102,105,101,166,166, 83,205,196,244,227,158,109,188, 61,250,118,107, 79, 60, 61, 61, 17,245, 40,202,235,226,
+181, 59, 35,187, 52, 54,127,174,214,147,221,106, 51,178,234,193,131,170,215, 15, 27,225, 75, 12, 6, 99,241,111,138,133, 48, 94,
+ 72,119, 61, 20, 24, 24,232, 49,106,212, 40,248,250,250,226,238,221,187, 93,246,237,219, 55,217,205,205,237,142,193, 96, 56, 33,
+149, 74,131,170,203,161,226,231,231,183,204,197,197,101,198,180,105,211,136,191,191, 63,164, 82,105,217,123, 74,165, 18, 93,187,
+118, 69,215,174, 93,145,154,154,218,236,226,197,139,205,118,238,220,185,212,207,207,111, 69,112,112,240, 44, 83, 42,104,238,220,
+185,254, 21,188,124,138, 16,242,132,101,217,123, 62, 62, 62,241,141, 8,169, 63,182,119,251,179,227, 59, 52, 80, 84, 17,157,194,
+157,197,197,171,107,148, 55, 88,180, 40, 31, 34, 11,243, 75, 34,165,242, 21,115,213,132,144, 22,109,173,153,223,127,201, 50,250,
+212,192,100, 33, 62, 62, 30,150,150,150,102, 1, 1, 1,201,132,144,249, 23, 47, 94,220,242,134,143,155, 54,243,167,143, 23,103,
+199,132, 34,229,225, 13, 76, 29,212, 81, 62,229,167,191,190, 7,112,160,106,227,195, 48,127, 60,181,155, 53, 5,152,204,113,220,
+220,200,200,200,206, 0,208,164, 73, 19, 9,128,139,219,162,173,123,143,104,146, 91,235, 52, 11,132, 16,177, 64, 32,248,121,219,
+182,109,159,127,250,233,167,136,141,141,197,213,171, 87,161, 84, 42,177,112,225, 66,247,105,211,166, 45, 5, 48,185,178,200, 85,
+143,158,189, 61, 55,254, 48,199, 59, 63, 43, 87,187,249,231,189,119, 84,205, 26, 49, 83, 38, 77, 48,215,177,122, 39, 43, 23,239,
+ 79,249, 72, 22, 15, 15, 15, 15,207, 27, 49, 88,157,234, 43,110,247,247,171,231,215, 55,176, 61,211,160,145, 55,196, 50,121,217,
+123,205, 91,250,162,121, 75, 95, 50,122,100,190,231,253,251,247,231,156,186,116,107,118,167,250,138,224, 43,209,133,173, 43,211,
+ 51, 24, 33,220,185,115, 39, 0,224,199,175,135, 10,126,190, 18,229, 81,126,193,216,206,157, 59,163,115,231,206,204,210,165, 75,
+219, 92,188,120,177,205,238,221,187,245, 46, 46, 46,107, 18, 19, 19,247, 85, 81,204, 25,251,246,237, 35, 2,129, 0, 2,129,160,
+210, 15, 57, 58, 58,162, 91,183,110,112,118,118, 38, 95,127,253,245, 12, 0, 21, 26, 44,153, 76,150, 70, 8,113, 0, 0, 27, 27,
+ 27,227,252,249,243,239, 81, 90,214, 3, 72, 41,165, 55, 24,134,185,201,113,220,173, 35, 71,142, 36, 52, 37,196,161,143, 95,163,
+ 43,227, 63, 25, 40,167,251,215, 84,106, 14,180, 57, 89, 21,190, 46, 81,200, 47, 73, 20,138,203, 82, 51,179, 23,204, 85, 83, 66,
+ 92,219, 54,242, 56,179,225,171,161,230, 38, 70,241, 26,118,233,210, 69,102, 52, 26, 81, 88, 88,136,141, 27, 55, 90,154,153,153,
+ 89,246,234,213,107, 30,128, 50,131,229, 77, 72,243, 15, 85,130,209,243, 19,217, 9,181, 48, 48, 86,157,218,249,199,252,180,108,
+158,133,127,219, 78,120,124,241, 79,100,101,229, 35, 55,167, 0, 47,103,253, 6,128,241, 39,104,234,134,190,100,229,134,111,134,
+206, 36, 12, 67, 90,244,159,129, 30, 13,233, 36,149, 74, 21, 78, 8, 17,149, 46, 31, 67, 8, 17,186,186,186,170, 26, 54,108,185,
+178, 65,143,198,216,248,237, 39,160,197,139, 52,174, 52, 53,122, 69, 8,113, 48, 55, 55, 63,114,230,204,153, 54,173, 90,181,194,
+205,155, 55,241,236,217, 51,140, 31, 63, 94, 55, 97,194, 4,241,240,225,195,201,212,169, 83,191, 36,132,236,167,148, 94,123,249,
+251, 34,145,104,216, 71, 3, 62,144, 20,228,228,105,116, 90,189,206,198,206,138,211, 22,106,138, 50,178,243, 52,159, 12, 29,166,
+187,119, 55,120, 24,128, 87, 12,214,235,212, 39, 15, 15, 15, 15,207,191,212, 96,201, 4,198, 86,243,119,221,135, 49,235, 9,104,
+110, 28,104, 97,202, 43,159,145,219,185,161,113, 59, 71,200,173,236,153,176,135,171, 91,189, 20,181,169,114,170,102,169,185,218,
+ 60, 84,213,180, 48, 59, 89, 12, 0, 10,107,103,253,232, 29,137,225,173, 90,181,130,189,189,189,248,250,245,235, 83, 1,236,171,
+ 66,147,232,194,130,241,176, 79,123,212,123,152, 5,185, 92, 14,137, 68,242,194, 7,162,162,162,112,249,242,101,196,197,197,193,
+203,203, 11,120,105, 28, 85,121, 77,181, 90,237,216,179,103,207,160, 21, 43, 86,116,254,241,199, 31, 31,108,219,182,173,115,101,
+221, 74,222,132, 40, 90,184, 59, 5,125,255,245, 24,107,122,242,119,166, 40, 51, 13,226, 74,202,217,126,241, 42,180, 95,188, 10,
+ 0,176,215,219, 25, 50, 11,115,200,148,202, 75,129,167,239,190, 18,185,242, 35,196,194,203,217,246,194,250,249,147, 21,184,176,
+ 71,130, 47, 22, 86, 89,159,126,126,126, 13, 3, 2, 2,174, 47, 90,180,200, 42, 62, 62, 30,215,174, 93,131,187,187, 59,138,138,
+138, 94, 88,175,204,155, 16,199,214,141,234,158,153, 61,109,164, 37,128, 9,166,236,163, 23, 76,136, 64,240,253, 15,243,103, 88,
+ 88, 74, 41,158, 92, 59,132,103, 79,158,227,118,196,115,195,246,179,161, 70,157,193, 56,170,162,250, 28,127,148,126, 51,173,171,
+244,247,187,249, 94, 71,251,116,153,208, 96,209, 16, 71,232,245,250,173,233,233,233, 24, 61,122, 52, 56,142, 67,199,142, 29, 59,
+ 80, 74, 19, 39, 77,154, 4, 47, 47, 47,108, 57, 29, 85, 36,204,186, 21,176,227,122,222, 93, 83,142, 37, 66, 72,179,186,117,235,
+158,185,120,241,162,163,139,139, 11,130,130,130,144,146,146, 2, 39, 39, 39, 76,152, 48, 65,178,108,217,178,109,121,121,121,131,
+ 22, 47, 94, 44,123,240,224,193,110, 66,136, 91,137,105, 46,211, 52,114, 70,149,167,187, 74,121, 96,247,233,251,214,230,114,212,
+241,114, 19, 11,148, 22, 70, 10, 82, 84,199,217, 94,108,228,140,170, 10,246,255,107,213,167,169,240,154,188, 38,175,201,107,254,
+ 27, 52,255, 85, 6,171, 20,253,179, 32, 72,188, 7, 0, 92, 83,208,236, 39,224,242, 18, 65,229, 14, 40,228,204,144,145, 20,139,
+135, 87,246,129,234,171,207,123, 39, 18,128,157, 51, 97,168,208, 74, 6, 72,204,237,245,249,249,249, 80, 40, 20, 40,204, 78, 22,
+ 79,251,161, 44,178, 37,190,120,241, 34,130,131,131,161, 82,169, 76, 42, 35,213, 21,247, 34,234,116, 58,232,116, 58,164,244,110,
+ 13, 69,219,119,144,253,201, 4,156, 63,127, 30,105,105,105, 16,139,197,144, 72, 36, 96,217,234,147,197, 51, 37,171,198,150, 70,
+173, 42,250, 76, 0, 33, 66, 87, 27,229,209, 13,243, 38,123, 48, 55,142,137,212,113,209, 72,210, 24, 97,101, 66,125, 74,149, 10,
+ 72,228,102,151, 36, 74, 69, 69,230, 74,164, 80,202,142,254,190,104,170,147, 32,228,188, 76, 29, 29, 90,102,218,202,211,173, 91,
+183, 49, 0,230, 81, 74,115, 2, 2, 2, 28, 23, 47, 94,108,157,152,152,136,136,136, 8,236,221,187, 55,157, 45,222, 80, 66, 41,
+ 93, 0, 0,237, 8,145,213,177,183, 58,189,254,187,201,230,184,184, 71,130,207,106,158, 92,221,178, 73,223,227, 31, 14, 31, 55,
+ 97,221,228,190, 40,204, 87, 99,231,217, 16,156, 10,126,242, 62,128,171,148,210, 74, 51,220,255,120, 94, 27,237,226,226,210,245,
+139, 47,190,184,119,240,224, 65,187, 31,126,248, 1, 70,163, 17, 44,203,130,101,217,178,255,141, 70, 35,118,237,218,133,171,119,
+ 35, 38, 37, 37,229,153,180,222, 27, 33, 68,229,225,225,113,238,214,173, 91,246,114,185, 28,103,207,158, 69, 78, 78, 78, 89,228,
+106,196,136, 17, 36, 39, 39,231,227,141, 27, 55,126, 24, 19, 19,243,195,149, 43, 87, 50, 1, 8, 0,176, 47,238,115,225, 19,150,
+ 53, 52,118,110, 82, 95, 56,168,111,167, 78, 5,153,161, 80,218,250,224,198,253, 39, 71,179,179,115,212, 12, 35,124, 82,254,243,
+111,162, 62,121,120,120,120,120,254,229, 6, 75,115,127, 7,180, 97,123, 32,246,234, 2, 73,211,193, 16,185,182, 67,124, 88, 16,
+238,157,248, 17, 9,225, 87, 65, 57, 35, 28,221,171, 95,106,238,143, 16, 42, 82,169, 84,193, 73, 73, 73, 8, 9, 9,193,147, 39,
+ 79, 32,147,201, 94,249,220,249,243,231, 1, 0, 78, 78, 78, 38,109,132,196,191, 61,220,238, 39, 35,190,133, 51, 0,192,237,126,
+ 50, 0, 96,233,236,217, 16,139,197, 16,139,197,101,139,194,154, 98,176, 72,201,135,185,226,110, 42, 90,209,251,254, 82,209,206,
+221,243, 38,182,150,198,132, 73,180, 15,110, 32, 73,203,209,163,169,198,227,222,166, 24, 44,185,252,146, 68,169,188, 44, 86, 40,
+ 94, 48, 87, 0, 64, 69,162,237,127, 46,152,232,163, 72,125,170,208,220, 57,143,100, 13,167,183,168, 88,102,193,201,147, 39, 29,
+132, 66,161,147,209,104, 68, 92, 92, 28,194,195,195,177,118,237,218,212,252,252,252,128,224,224,224,168,114,229,101, 90,153, 73,
+246,110, 95, 56,217, 83, 24,122, 73,166,125,242,160, 66,211, 86, 21,246,205,251,247,120, 63,160,197,241, 49,159,124,139, 15,122,
+119,199,240, 0,111,250, 60, 41, 75, 3,224, 44,165,212, 88,221,247, 19, 19, 19, 19, 93, 92, 92,186, 13, 24, 48, 96, 71,211,166,
+ 77,155, 80, 74,209,184,113, 99,244,235,215, 15, 7, 14, 28, 64, 68, 68, 4,242,243,243,245, 87,174, 92, 89,147,148,148,244,155,
+ 41,101, 34,132,200,173,173,173, 79, 93,184,112,193, 94, 46,151,227,204,153, 51, 80,171,213,112,118,118,126, 33,114,181,116,233,
+ 82,217,243,231,207,215,159, 62,125,218, 29, 0, 83,209, 66,216,122, 86,187,229,183,109,187,215, 77,253,242, 11,151, 11, 55, 35,
+206,107, 11,242, 45,235,214,141,207,179,183, 86,154, 47, 94,186,188,142,158,213,141,169,184, 62,131,106, 85,159, 60, 60, 60, 60,
+ 60,255,114,131, 85,218,197, 68, 57, 22,186,232,179,208, 69,159,133,162,203, 28, 28, 89, 50,236,133,207, 25,141,134, 90, 21, 64,
+163,209, 64,172,180,213,255,248,245, 80, 49, 0,112, 34, 69,217,234,240, 28,103,218,194,235, 53, 89,210,171, 38, 6,171, 68,247,
+ 21,243,224, 33, 85, 94,218,242,213,160,182,182,198, 34,145,238,234, 81, 36,106, 57,246,135,104,125,209,157, 28,186, 98,118, 37,
+154,199,186,181,134, 33, 59, 3, 50,115,197,165,158, 23, 31, 84, 56, 91,208, 67,102,113,126,239,212, 33, 29,157,196, 16,235,142,
+239, 67,146,150,211,110,138, 49,252,182,182,146,109,166,148,226,217,179,103, 40, 42, 42,194,245,235,215,113,224,192,129,244,151,
+205, 85, 73,121,131,126,157, 49,172,141, 69,126,138, 88,119,231, 28,146,180,156,182,161, 41,166,202,167,127, 7, 49, 67,206, 16,
+ 70, 96,214,187,147, 55,166,124,209, 31,171,127,253,139,213, 57,116,234,179,238,200,137,143, 10,180,250,217,166,152,171,114, 38,
+ 43, 20,128,183,187,187,187,148,101,217, 46,125,251,246, 61,209,187,119,111,220,184,113, 3,231,206,157,107,160,215,235,147, 1,
+ 64,165, 82, 45, 4,224,200, 48,204,138,132,132,132,167,149,236, 35, 70, 44, 22,239, 62,119,238, 92, 83,149, 74,133,115,231,206,
+ 65,173, 86, 99,220,184,113,186,137, 19, 39,138, 71,140, 24, 65,114,115,115,203, 34, 87,215,175, 95,207,172,204, 92, 1, 64, 94,
+194,195,147,214,110, 77,219,119,233,220,174,127,131, 6,245, 45,158,230,231,165,201,229, 50,179,139,151,174,136,111,221,188,181,
+ 62, 47, 33,242,118,197,245,121,222,228,250,228,225,225,225,225,225, 13, 86,149, 24,179, 94,109,243,140,108,237,215,105,110, 55,
+243,116,184,153,153, 25, 54,110,220, 8,185, 92, 94, 99,227, 84,116,242, 16,226,199, 15, 45,139, 92,149, 70,178,208,115,196,107,
+ 25, 44,142,227,174, 3,120,193,229, 41, 28, 27, 13,217,253, 73,183, 14,222,158, 46,140, 97,239, 90, 36, 20,177,154,121,143,244,
+154,135,249,244,253,136, 10, 6, 79,151, 97,208, 65,166, 40,142, 92, 85,100,174,148, 78, 13, 63,220, 54,164, 75, 64,139, 70,245,
+ 24,118,207, 42, 36, 22, 25, 10,102, 69,234,245, 79, 11,233,193, 74, 76,229,188,238,221,187,207,179,181,181,149,173, 91,183,206,
+178,110,221,186, 96, 89, 86,247,178,185, 82, 56, 54, 26,178,103, 68,207, 14, 13,157,172, 25,195,254,159, 16,175, 54, 22,173,125,
+106,216,182,201, 4,115,101,103,169, 60,189,105,201,120, 51,185, 84, 4,141, 70,131,101, 27,246,227,204,181, 7,125,210,195, 14,
+157, 6,112,186,182,251, 91,175,215,127, 30, 24, 24,184,122,250,244,233, 96, 89, 22, 31,127,252, 49, 98, 98, 98,206, 68, 71, 71,
+175,117,117,117,253,122,252,248,241, 42,123,123,123,140, 29, 59, 86, 12, 96, 68, 37, 50,203,119,238,220,217,167, 69,139, 22,184,
+116,233, 18,114,114,114,224,236,236,140,137, 19, 39, 74,150, 46, 93,186, 45, 47, 47,111,208,146, 37, 75,100,207,158, 61,171, 50,
+114, 85,158, 28,154,187,232,151,213, 99,191,110,221,182, 3, 19, 29, 29,197,198,181,238,204,156, 63,119,226,114,182,131,116,219,
+ 11,245, 57,178, 87,141,235,147,135,135,135,135,135, 55, 88,213, 70,135,140,249,175, 14,118,231,140, 38, 7, 50, 76, 54, 78, 70,
+ 19, 53, 57,173,166, 58,195, 84, 35,131, 85, 50, 6,235, 20,165,244, 5,131,101,229,212,168,243,156,153,147,215,116,252,176, 39,
+147,250, 69, 59,228, 20,104,181, 51, 34, 88, 46,161,168, 26,115, 5,128, 49,234, 47,137, 44, 44, 46,139, 95,154, 45, 8, 0,102,
+142,245, 91,207,250,234,203, 13,239, 14,233, 75,210,199,117, 68,118,142, 90,251,117, 56, 75, 18,213,116, 80, 4,165, 23, 43,210,
+ 59,127,254,252,102, 0,155, 3, 2, 2, 82, 21, 10, 5, 10, 10, 10, 94,169,215,210,242,118,248,176, 39,147,250,121, 27,100, 21,
+234,181, 51,194, 89, 36,169,185,221,213,153, 43,123, 43,243,211,155, 22,143,151, 39, 37,196, 64, 44, 22, 67,169, 84,226,236,213,
+ 48,164, 63, 56,124,250,117, 14, 56, 87, 87,215,249,147, 38, 77,154, 55, 98,196, 8,100,103,103,227,236,217,179,120,247,221,119,
+241,243,207, 63,215,189,112,225,194,234,246,237,219, 67, 32, 16,224,236,217,179, 48, 24, 12,143, 43,217,159,253, 71,143, 30,253,
+245,135, 31,126,136,219,183,111, 35, 57, 57,249,133,200, 85, 78, 78,206,199, 27, 54,108,248,240,249,243,231,213, 70,174,202,227,
+ 2,180,246,172,215, 82,252,205,220, 31,161, 45, 74, 19,166, 39,222,188,116,254, 44,189, 81, 55, 43, 75, 14, 32,183,182,245,201,
+195,195,195,195,195, 27,172, 10,220,139, 17, 66,103, 31,176,201,161,255,121,233,165,217,132, 98,185, 18,156,177,122,227, 50,194,
+151, 24, 70,214,131,112, 85, 47, 6, 98,165,173,190,221,204,211,225,149,125, 86,169, 84,154,218, 69,104, 20,247,254, 80, 80,175,
+199, 7,120,218,220, 9,212,160, 47,139,100, 97,246,236, 23, 76,150, 88, 44,134, 78,167, 3, 42,232,246,123,137, 91,132,144, 24,
+ 0, 55, 40,165,212,175,161,215,247, 50,133, 98,164,191, 79, 61,187, 41,227, 63, 23, 61, 79,211,226, 66,199,111,114,246, 47,159,
+169,140,167,202, 9,177, 52,231, 90, 53,134,242, 82,239, 43, 15, 95,137, 92,249, 54,244,250, 86, 38,151,125,209,182, 89, 67,167,
+ 89, 83,199,139,158,167,106,201,133,214, 51,242, 14,172,152, 33,127, 6,243,175,227,105,246, 69, 19,182,127, 94,239,222,189,231,
+ 81, 74, 41,199,113,115, 1,160,124,121,167, 78,252, 66,244, 52, 69,131,243, 29,191,205, 62,176,124,166,121, 60,170, 46,175,189,
+ 79,255, 14,142,214, 22,167, 55, 45,153, 32, 79, 78,140,133, 84, 42,133,185,185, 57,226, 83,115, 33, 18, 10,212,175,115,176,185,
+187,187, 75,219,180,105, 51,115,248,240,225,136,140,140,196,172, 89,179,146,147,146,146, 14, 30, 57,114,100,220,212,169, 83,133,
+157, 59,119, 70, 90, 90, 26, 54,110,220,104,184,125,251,246,146,148,148,148,149, 21, 30,180, 66,225,231,223,127,255, 61, 77, 74,
+ 74, 34,207,158, 61,131,179,179, 51,190,252,242, 75,201,146, 37, 75,202,198, 92,213, 36,114, 85, 74, 66, 66,194,165, 6,245,234,
+224,253,147,107,192, 26,180,151,114, 50,227, 46, 63,124,154,125,201, 70, 34,153,214,209,207,167, 86,245,201,195,195,195,195,195,
+ 27,172, 87, 48, 80, 38,119,231,178,177,150,239, 15, 27, 7, 51,247,119,160, 13,223, 7, 46, 63, 5, 92,126,177,129,145, 40, 44,
+ 96,110,231,134,130, 34, 13,174, 62,120, 10, 3,101,114,171,212, 51, 66,184,232,231,255,204, 22,180,178,178, 66,110,110,238, 11,
+145, 23,185, 92, 14,149, 74,133,188,188, 60,236,223,191, 31,180,154,200, 16,165,244,251,225,195,135,127, 55,126,252,120,166,222,
+144, 81, 40,184,121,229,229,104, 20,204,204,204, 32,147,201,144,144,144,128, 71,143, 30,113,148,210,239,171,137,120,221, 98, 89,
+246,254,238,221,187, 19, 26,120,185,246, 12,104,213,122,210,236,111,102,153, 71, 92, 57,131,185, 75,214,115,245,253,123,228, 46,
+219,117, 56, 63, 87, 89,167,107, 81,210,195,123,213, 85, 50, 33,228,213, 36,162,158,117,222,109,231,219,114,250,220,185,223, 90,
+132, 95, 57,139,239, 86,108,162, 13, 90, 4,230,174, 56,112, 36, 47, 67,238,222, 93,157,250,159, 49, 63, 85, 17, 20, 20,180, 25,
+192,230,210,231, 47,151,119,214,194,181, 92,195, 86, 61,179,151,237, 58, 80,152,103, 94, 39,176,170,242, 58,120, 15,104,239,230,
+108,115,250,167, 69, 99,229, 41,137,113,144, 74,165, 80, 42,149,136, 75,206,193,188, 53,123, 11,245, 28,215,243, 53,143, 55,169,
+ 66,161,144,234,245,122,252,241,199, 31, 72, 76, 76,108,151,156,156, 28,231,228,228,180,105,236,216,177,235,154, 52,105,210,248,
+209,163, 71,143, 11, 10, 10, 38,164,164,164, 60,172, 76,196,202,202,170,157,189,189, 61,185,113,227, 6,198,142, 29,171,251,242,
+203, 47,197,195,135, 15, 39,217,217,217,181,138, 92,149,139,174,117,238,247, 94,123,116,232, 54,238,146, 78,147,115,249,249,195,
+109,151, 24,122, 77,230,215,210,167, 86,245,201,195,195,195,195,195, 27,172, 10, 73, 23,170, 29, 54,109, 63,176,114,247,190,131,
+ 95,140, 30, 57, 84, 22, 16,248, 41,196, 25, 97, 96,147,130,225,226,221, 17, 84,104,134,219,119, 67, 16,250, 36, 94, 83,164, 23,
+108,205, 19,171,167,191,100, 44, 2,171,202,149,145,155,155, 11,119,119,119,236, 26,215,168,169, 54, 47, 77, 92, 7, 0,147,104,
+169,191, 16,213, 59,252,242,229,203, 5, 0,182, 54,104,208, 96, 95, 85,154, 33, 33, 33, 11, 90,182,108,121,228,155,111,190, 89,
+218,160, 65,131,158,163, 23,254, 12,241,148,225, 80, 71,132, 66, 30, 48, 8, 54, 54, 54,200,204,204,196,237,219,183,145,159,159,
+127,138, 82,250,205,189,123,247,194,170,210,164,148,222,244,241,241, 73,168, 83,167,142,149,131,210,236,183,113,159, 13, 55,143,
+ 13,189,137,212,168,251,184,118, 53, 42,123,231,129, 35,137,121,185,233,159, 85,213,184,150,215,100, 24,230, 5,115,213,176,161,
+157, 82, 33,181,222, 62, 97,244, 40,139,184,176,219, 72,139,186,135, 43,215, 30,103,239,218,125, 40, 61, 51, 51,117,100,101,230,
+170,186,250,172,168,188, 55,175, 60,202,222,189,239, 80, 66,126, 97,246,231, 21,149,183,188,166, 82, 33,154,126,228,143, 69,242,
+164,132,216, 50,115, 21,155,156,141,239,214,236, 46, 84,235, 12, 61,211, 67, 15,153, 20,169,169,170,156, 28,199,129,101, 89, 80,
+ 74, 33,145, 72,242, 0,160,196, 76,117, 53, 85, 51, 35, 35, 35, 40, 38, 38,166,159, 82,169, 44,139, 92,229,230,230, 14, 90,182,
+108, 89,141, 34, 87, 47,151, 51, 33, 33,225, 82, 61, 79,215,229,201,131, 7,105,157,157,237, 47, 29, 61,121, 39,204, 65,105,246,
+176,182,245,249,166,224, 53,121, 77, 94,147,215,252, 55,104,254,171, 12, 86, 68, 4,213, 3,152,236,237,109,177, 96,197,166, 29,
+ 27,183,239,218,223,127,244,176, 1, 66,223, 22, 93,241,236,250, 33, 92,190,121,129,205,214,208, 67,249, 34,193,184,136,232,188,
+236,234,126, 76, 36, 0, 59,116,232, 80, 33, 0, 72,132, 96, 87,245,233, 19,212,180,105,211,142,109, 13,105,226,121,235,138, 35,
+ 91, 11, 38, 13, 21, 7,221, 14,218, 39,149, 74, 55, 63,123,246, 44,207,148,141, 40, 49, 76,189, 90,181,106,245,206,215, 95,127,
+189,188,183,135,107,235,254,237,187, 64, 36, 18,225,246,237,219,200,204,204,188,205, 48,204,204,144,144,144,203,166,232,133,133,
+133,101, 52,173,239, 62,217,198, 76, 60,125,194,208,254,246,233, 79, 34,144, 16, 25, 2, 0,208,106,213,134,228,168, 75, 45,106,
+ 82,201,165, 11, 55,123,123,123,139,141,218,130, 17, 50,161,197,220,113, 31,247,115,200,124,254, 16,241,225,197,233,158,180,154,
+ 34,125,124,212,133,198,181,217,137,238,238,238, 82,133, 8, 99, 42, 44,175, 78, 99, 72,121, 28,217,210, 20,157, 34,173,110,201,
+130,213,219,187, 47,154, 62, 82,106, 97, 97,129,224, 7,209,152,187,106, 87,141,204, 85,117, 80, 74, 97, 48, 24,106, 52,243,179,
+ 2,102,182,104,209,162,209,226,197,139, 27,148,140,229,122,173,200, 85,121,158, 60, 75,152, 21, 16, 16,224, 29,253, 40,184,139,
+141,153,120,199,235,212, 39, 15, 15, 15, 15, 15,111,176, 80,181,209,202,203, 6,240,145,175,171,133,215,226,245, 59,182,154, 9,
+185,142,106,150,185,170,214, 50, 95,132, 36,228, 61, 53,245,199,254, 8,161,162,151, 95,243,246,246, 86, 68, 11, 81, 80,250, 60,
+ 58, 11, 72, 74, 74, 90, 81,155,141,185,115,231,206,101, 0,109,124,125,125,251,159, 32,100, 54,240, 20,148,210, 37, 33, 33, 33,
+135,106,162, 99, 46,196,131,142,222, 94, 46,157,124,155,202, 4, 70, 53, 18, 34,159, 32,171, 80,131,179,225,177, 57, 12,101,126,
+175,109,101, 51,250,162,251,157,188,235,213,121,199,175,169, 92, 68,116, 72,136, 8, 70,174, 90,135, 51,225,177,185, 32,164,214,
+ 3,165,223, 84,121, 83, 66, 15,223,177,247,233, 31, 72, 8, 57, 55,123,226, 16,233,188, 85,187,223,168,185,178,177,177, 41, 74,
+ 73, 73,201,212,104, 52,182,169,169,169, 58, 27, 27,155,162, 90,154,180,104, 66, 72,243, 41, 83,166, 44,252,250,235,175,167, 47,
+ 95,190, 92, 92,155, 49, 87,149,145,157, 24,123,232,157,166,111,126,255,243,240,240,240,240,240, 6,171, 66, 74,204, 84, 64,128,
+183,189,226,234,163,244,194, 55, 81,128,136,136,136,194, 17,190,164, 44,178, 37, 18,128,125, 93,205, 18, 67,117,168,214, 2, 12,
+201,191,249, 56,182,224,214,227,216, 2,112,148,114,148,106, 25, 6,241,133,122,253,146,168,167, 9,181,159, 69, 71,136,241, 78,
+116,156,250,238,147,120, 13,229, 56,202, 81,170, 35, 4, 41, 6, 3,183,228,193,211,152, 35,255,132,242,166,135, 30,186,230,228,
+ 61,160,211,181, 91, 15,166, 22, 22,234,215,167, 71, 28,186,254,166, 14,182,224,224, 96,131,179,179,243,176,190,125,251,142,226,
+ 56,110, 83, 98, 98,162,161,182, 90,148, 82, 29,128,153,132,144,131, 97, 97, 97,123,175, 95,191,158,252, 38,204,213,223,186,255,
+121,120,120,120,120,120,131, 85, 21, 65, 17,111,198, 92,149, 82, 81,100,235,191, 73,216,227,231,126,127,135,238,131,199,207,155,
+253, 47,148, 55, 37,226,224, 93, 0, 31,255, 29,101, 77, 78, 78, 62, 3,224,204,155,210,163,148,222, 33,132,120, 0, 16,188, 17,
+115,245, 55,238,127, 30, 30, 30, 30, 30,222, 96,241,240,252,207, 64,139, 7,116,177,124, 77,240,240,240,240,240,252, 83, 32, 0,
+ 2, 43,105,180, 76,158, 29, 64, 8, 9,172, 69,163,120,142,215,228, 53,121, 77, 94,243, 45,209, 76,171, 66,243, 65, 53,154,149,
+ 69,182, 29,254,135,234,179,101, 37,154,203,171,209,156, 89,197,219,247,248,227,243,237,212,252, 55,221,253,255,109, 15, 0,129,
+188, 38,175,201,107,242,154,255, 2,205,102,124,125,190, 81,205,153,124,125,254,251, 52,223,182, 7,195, 91, 76, 30, 30, 30, 30,
+158,191,173,155,132, 16, 41, 33, 68, 90,219,247,121,120,254, 87,169,241, 24,172,214,173, 91,215, 7,128,219,183,111, 71,255,141,
+ 39,228, 68,103,103,231,209, 62, 62, 62, 77,196, 98, 49,147,159,159,191,224,194,133, 11,243, 95,254,220, 59, 77, 69,119, 5, 12,
+ 92,203,125, 19, 32, 2,128, 97, 96,164, 72,184,124,191,200,159,223,197,255, 93,156,157,157, 79,203,100,178,186, 28,199,129,229,
+ 40,140,172,177,248,175,145,131,193, 72,161,215,105, 98,181,133,185, 61,106,165,221,114, 64, 29,214, 72,151, 1,220, 6, 2,102,
+ 28, 5,183,145, 80,102, 28,101,176,129,112, 24, 11,161, 97, 37, 88,209,215, 66,177,240,219,164,224,125,241,111, 67,125,238,223,
+191, 95,240, 58,223, 31, 56,112, 96,133,203, 68,249,250,250, 30,147,201,100,245, 42,251, 94, 81, 81, 81,242,253,251,247,187,188,
+205,199,170,147,147,211, 59, 12,195,252, 4,160,233, 75,111, 61, 4, 48, 57, 41, 41,233,252,235,254, 70,107,185, 92,104, 39, 16,
+140, 17, 17, 50, 3, 0, 12,148,174,200, 48, 26, 55,223, 46, 42,250,199,140, 33,116,112,112,184, 44, 16, 8, 27, 20, 22, 21, 22,
+230,231,229,121,153,155, 91, 60, 53,147,203, 21, 70,214,248, 56, 35, 35,237,157, 26, 94,203,199, 3, 88, 89,242,255,116, 74,233,
+134,154,188,207,195,243, 86, 27, 44, 63, 63,191,134, 0, 58, 19, 66, 58, 83, 74,223,105,220,184,177, 99, 81, 81, 17,252,252,252,
+ 82, 9, 33,151, 41,165,151, 0, 92, 10, 14, 14,142,122, 19, 5, 18, 8, 4, 63,172, 93,187,118,218,151, 95,126, 89,182, 72,115,
+104,104,104,197,159,101,224,122,241,232, 57,135, 59, 97, 81,104, 21, 56,176,196, 96, 49, 64, 97, 50,186,116,107, 93,171,223,183,
+177,177, 49,119,112,112, 88, 64, 8, 25,196, 48, 76,181,141, 25,199,113, 70, 74,233,190,180,180,180,121, 89, 89, 89,249, 53,249,
+173, 86,254, 62,134, 98, 71, 88, 17,212,120,231,110,104,149,179, 43, 27, 55,110,124, 87, 32, 16,184,150, 92,156, 94,190,176, 85,
+248,191,209,104, 76, 8, 15, 15,247, 55,181, 46,100,114,249,116,194, 8, 3, 65,185,226, 36,168,132,121, 72, 57,246,156,166,168,
+104,165, 41,219, 43,149, 74,235, 6,135,220,107, 16, 17,245, 20, 94, 30,117,160,211,179,208,233, 89, 28, 57,119, 27, 45, 26,123,
+160,111,239,110,181, 62, 86,140,148, 44,152, 59,121, 88,151,197,107,119,182,250,118,242, 80,197,226,181, 59, 91,125, 59,101,168,
+114,241,186,157,254,223, 78, 25,166, 92,180,110,135,255,156, 41,195, 44, 22,175,219,169, 7,240, 89,109,126,227,179,230,117, 11,
+ 25, 35, 91,225,221, 53, 39, 16,106,127, 13,139, 85,252, 55, 78,220, 81,163, 70, 53, 44, 44, 44,140, 24,213,167,245,247, 77,220,
+ 29, 43, 28,255,147,147,153,234,240,248,193,237,185, 66,153,194,251,131,233,191, 85,121,126,138,197, 98,207,203,151, 47, 55,224,
+ 56, 14, 70,163, 17, 44,203,150,253,213,233,116,248,240,195, 15,223,200,132, 24,127,127,255, 81,148,210,197,197,135, 37, 89,116,
+247,238,221,245,175,113, 35,166, 20, 10,133, 95, 73, 36,146,206, 44,203, 54, 1, 0,145, 72, 20,169,213,106, 47,177, 44,187,154,
+ 82, 90, 80, 19, 61,134, 97,214,220,185,115,199, 91,169, 84, 66,175,215,151, 45, 12, 47, 16, 8, 26,183,105,211,230,103, 0, 13,
+ 94,119,251,237, 4,130, 49,237, 59,118, 92, 59,106,202, 20, 65,246,157, 59,248,105,235,214, 53,200,206, 6,128,159,171,251,174,
+171,171,235, 93, 66,136,107, 77,126,143, 82,154,144,144,144,224, 95,179,107,176,176, 65,108,124,146, 67, 93, 55, 21, 0, 64, 46,
+151, 43,238, 60,120,238,224,215,212,163,198,145, 43, 0, 43, 41,165,102, 37,245,187,182,125,251,246,237, 8, 33, 44, 0,202,113,
+ 28, 67, 8, 25,194,113,156,176,228,243, 43, 9, 33,191, 81, 74,181,124,211,204,243, 86, 27, 44, 63, 63,191, 19, 0, 58, 55,110,
+220,216,172, 91,183,110,240,245,245, 69,221,186,117, 33,147,201, 0, 0, 89, 89, 89,142, 17, 17, 17, 31,221,187,119,239,163, 27,
+ 55,110,192,207,207, 79, 13,224,106,112,112,112,133,209,136,192,190,157,190,148, 41,165,235, 0, 32, 61, 33, 51, 57,225, 89,218,
+186,228,228,228,149,148, 82,174,220, 9,233, 53,124,248,240,169,147, 38, 77,194,177, 99,199,176,107,215, 46,104,181, 90,228,231,
+231,227,194,133, 11,149,220, 90,167, 33,251,194, 50, 64,241, 28,136,187, 4,200, 29, 0,133,227,235,220,189, 45, 24, 60,120,240,
+ 20,111,111,239,178,172,227, 6,131, 1, 44,203,194, 96, 48, 32, 59, 59, 27, 83,167, 78, 45,189,120,129,227, 56, 92,184,112,225,
+203, 25, 51,102, 0,192, 87, 21,105,118,235, 92,239,174,144, 16, 87,238, 63,166, 44,225,236,229,167,254, 0, 17,220,185,123,159,
+ 84,108,190, 90, 8,170,191, 16, 10, 92, 67, 66, 66, 28,196, 98,177, 73,219,198,113, 28,124,125,125, 77,250,172,139,139, 75, 23,
+133,210, 98,215,128, 33,159, 91,183,244,109, 41,114,113,118,134,129,101,241,236,121, 92,235,251,247,130, 91,158, 57,186,231, 11,
+ 23, 23,151, 33,137,137,137, 85, 46, 72,109, 52,114,184, 31,241, 24,231,174,222, 67, 95,145, 12,133, 26, 29, 10,213, 58,108,255,
+235, 58, 18,210,114,107,189,159,218,180,105,227, 34, 23,216,183,254,114,212, 7,138, 21, 63,109, 83,124, 57,234, 3,172, 92,191,
+189,228,239, 54,197,151,163,250, 97,229,250, 63,148, 95,142,234,135,181, 27,126,107,219,166, 77, 27,151, 91,183,110, 37, 86,166,
+ 87,217, 62, 98,140,172,116,107, 68,162, 0, 0,210, 55,109,130, 33, 45, 13,170,121,243, 0, 0, 95,120,187,152,220,173,209,172,
+ 89,179,187, 66,161,176,218,198,145,101,217,132, 7, 15, 30,248,155, 98,174, 88,150,165, 66,161,112,238,213, 29,223,239,239,208,
+178,225, 11,149, 25, 21, 21,101,249,221,119,115, 7,238, 13,206,167, 31,249,153, 71, 28, 94, 57,170, 74,147,197,113, 28,163,213,
+106,241,248,241,227, 10,179,236, 51, 12, 99,172,205,126, 10, 8, 8,144, 22, 22, 22,238, 84, 42,149, 62,133,133,133,163, 40,165,
+223, 5, 5, 5, 57, 50, 12,131,192,192,192,239,252,253,253,159,203,100,178, 13,106,181,250,158, 82,169, 28, 18, 20, 20,100, 82,
+227, 74, 8,121,199,194,194, 98,251,161, 67,135,172,125,125,125,153,140,140, 12,120,120,120, 32, 43, 43,171,245,229,203,151,253,
+ 62,251,236,179,207, 8, 33,159, 82, 74, 47,215,160,184,141,228,114, 57, 29, 62,124, 56, 49, 26,255,179,185,191,254,250, 43,252,
+156, 83,235,141,237,169, 40,210,232,104,238,249,199,150, 99,197, 98,241,213,152,152,152, 26, 31,192, 34, 66,102,140,154, 50, 69,
+ 32, 78, 78,134, 34, 42, 10,125, 8, 17,110, 41,142,102,253,108,194, 54,187,174, 90,183,210, 65, 34,145,128,101,217, 50, 19, 88,
+122,141, 50, 24, 12,208,235,245, 48, 24, 12, 48, 26,141, 48,232, 13,216,186,233,183, 90,159, 99,114,133, 92,238,228,236,156,106,
+ 38, 87,200,223, 68, 99, 35,149, 74,133,219,182,109, 27, 34,145, 72, 0, 0, 58,157, 14,205,154, 53, 35,124, 51,204,243,111,140,
+ 96,245, 10, 10, 10, 2,203,178, 48, 55, 55,135, 64, 32,120, 57,186,129,119,222,121, 7,109,218,180, 65, 96, 96, 32, 30, 61,122,
+100,182,124,249,242, 74,195, 17, 67,167,245,129, 91,131, 98,227, 99, 48,112,206,215,142,223, 91,246,235,247,251,237, 1, 76, 43,
+ 31, 48, 24, 51,102, 12,201,204,204,196,160, 65,131, 46,107,181,218,247, 41,165,149, 46,151, 99,228,144,208,229,227, 97,224, 40,
+ 49, 91,125,107, 43,209,105,212,148, 97, 24,117,105, 23, 97, 45,239,138, 7,169, 84, 42,236,222,189, 27, 58,157,238,149,247, 45,
+ 44, 44, 16, 30, 30, 94,222,228,160,101,203,150, 2, 66,200,160,202, 12, 22, 67,136,235,201,160,232,178, 25, 65,131,223,111, 41,
+238,222,185, 94,170,144,145, 80, 0,228,219,111,191, 45, 51,108, 0,176, 96,193, 2,147,203, 43, 22,139,241,232,209, 35, 8, 4,
+ 2, 60,233, 80,124,131,221, 44, 36, 30, 2,129, 0,247,125,138,239, 64,219, 71,231, 64, 32, 16, 64,169, 84,154,106,174, 2, 28,
+157, 93, 15,127, 51,111,169,185,198, 64,113,252,194,109,196, 37,157, 5,165, 20,206, 14, 54,104,239,231, 43,106,218,188,133,195,
+175, 63,175, 56,236,226,226,210, 47, 49, 49, 49,168, 50, 45, 3,107, 68,147, 6,158,216,118,232, 50, 22,109, 56,128,204, 60, 53,
+242,139,138,235,181,107, 91,111,252, 82,251, 72,231,202, 70,238,238,110,191,239, 61,133,118,109, 91,225,143,189,167,209,174, 77,
+ 43, 20, 63,111,131, 63,246,158, 66,251,118,197,127,155, 54,169, 87, 39, 43, 38,119, 37,170,200,237,245,202, 62,234, 87,188,143,
+ 60, 4,226,178, 6, 32,102,220, 56, 0, 40, 51, 88, 53, 58,209,132, 66,215,123,247,238, 57, 84,247,185,150, 45, 91,154, 20,185,
+ 98, 89, 22,105,105,105, 36, 39, 39,135, 90, 89, 89, 13, 44,111,178, 74,205,213,158,187,121, 80,223, 92, 79,118,252,117,137, 27,
+246,126,231,136,195, 43, 71,121, 15, 28, 56, 48,178, 34, 93,189, 94,255,188,123,247,238,180,164,225,115,145, 72, 36,226,151, 12,
+152,170, 67,135, 14,175, 24,180,234,186, 14, 11, 11, 11,119,110,217,178,165,127,189,122,245, 48, 96,192,128, 51,222,222,222, 18,
+185, 92,142, 83,167, 78,193,205,205,205,206,220,220,252,196,210,165, 75,177,106,213,170, 58,103,206,156,217, 5,160,191, 9,231,
+104, 96,151, 46, 93,118, 31, 59,118, 76, 38, 22,139,161, 86,171, 17, 30, 30, 14, 75, 75, 75, 72, 36, 18,244,235,215, 79,208,161,
+ 67, 7,219,128,128,128, 3,132,144, 33, 53,153,209,164,209,104,232,236,217,179, 33,151,203, 33,151,203,161, 80, 40,160, 80, 40,
+ 96, 38,230,200,166,201, 30,102,147,182,228,152,125, 53,111,211,178,237, 27,230, 95,172, 83,167,206,119,113,113,113, 57, 53, 61,
+ 22,178,239,220,129, 34, 42, 10,154,187,119,107,124, 28, 89, 42,108, 48,107,214,172,234,142, 53,136,197, 98,180,111,223,190, 90,
+189, 38, 77,154,108, 18, 8, 4,246, 47,154,105, 34,152,251,237, 55,236,131,240, 40,133,222, 72, 21, 26, 45,139, 69, 11,231,178,
+ 2,134, 17, 52,107,214,236, 16,165, 52, 61, 60, 60,124,172, 9,209, 51, 45, 33,100, 58,195, 48,107,165, 82,169,208,221,221, 61,
+118,238,220,185, 55,138,187, 26, 0, 74, 41,227,238,238,222,218,204,204,172,174, 86,171,101, 1, 76,231,163, 87, 60,255, 22,131,
+ 5,165, 82,137, 59,119,238,128, 16, 2,115,115,115, 88, 88, 88,192,210,210, 18,121,121,121,136,136,136,192,195,135, 15, 17, 19,
+ 19, 3, 66, 8,188,188,188, 80,122,226,148, 59,193,202, 46,108, 59,127, 60, 6,153, 82, 10, 66, 0,223,119,125,224,243, 78, 51,
+180,186,253,116,178, 74,165,218,146,148,148,244,152, 16, 34,108,214,172,217,103,109,219,182,197,170, 85,171,160,213,106, 87, 85,
+100,174,202,107, 94, 14, 55,248, 3,128, 74,165,250,250,207, 83, 79,228,159,244,172, 87,148,148,148,244, 67, 77, 43,225,229, 11,
+112, 70, 70, 6, 56,142, 51, 57, 42,148,147,147, 83,165,230,203, 17,129, 69,203, 86, 91,229,231,166,226,251,229,127,194, 96, 48,
+ 96,218,180,105,224, 56,174,236, 81,145, 94, 69,229, 44,237,250, 19, 8, 4, 47, 24,224,234,158, 87,165,105,111,111,175,144,202,
+228,187,190,254,246,123,243,208,168, 4, 28,187,112, 27,148, 82, 28,217,242, 29, 0,160,223,232,133, 72, 76,201, 64, 7,191,198,
+ 24, 49,118,170,249,234, 37,179,119,217,219,219,215, 75, 79,255, 79,242,217,242,154, 6,150,195,129, 83, 55,144,148, 89,128,225,
+ 3,186, 66,163,213, 35, 61, 45, 5,191,253,188, 2,227, 71, 28,128,181,210,204,201,203,203, 43,170,124, 29, 81, 74,137, 88, 44,
+190, 26, 21, 21,245,121,101,229, 52, 24, 12,189,190,153,250, 5,214,110, 61,128,102,245,157,112,244,236,117,248, 55,173,139,147,
+ 23,110,163,109,115, 15,156,190, 20,140,182, 62,158,184,116, 51, 28, 83,198,126,138,233,147,175,246,170,201, 62, 90,188,116,181,
+ 85,126, 94, 42,142, 45,222,134,180,159,127, 70,236,196,137,104, 93,242,153,219,132, 64,236,234, 10,152, 87, 95,159, 47, 19, 25,
+ 25, 9,173, 86, 91,209,221, 61,154, 52,105, 82,237, 62, 42,141, 92,165,166,166,146,212,212, 84, 40, 20, 10, 18, 25,254,192,216,
+164,105,179,129,244,225,254,173, 0, 80, 28,185,202, 67,209,245,117, 80,223,248, 9, 98,143, 80,102,235,194,177,186, 47,190,219,
+ 20, 81,174,113,123,161,156,247,239,223, 47,171,159,182,109,219, 62,188,122,245,106,163,210,227,171,164,171, 80,204,178,108,131,
+210,110, 67,150,101,161,213,106, 49,100,200, 16, 65, 85,219,110,102,102,230,227,229,229,133,224,224, 96,140, 29, 59, 86,210,165,
+ 75, 23, 68, 71, 71,131, 16,130,145, 35, 71,194,219,219, 27,233,233,233,104,213,170, 21,174, 92,185,210,210,132, 99,222, 92,161,
+ 80,252,118,244,232, 81, 25,195, 48,200,207,207, 7,199,113,232,208,161, 3, 24,134,193,131, 7, 15,240,237,183,223,226,224,193,
+131, 56,124,248,176,153,159,159,223,111,132,144, 38,148,210,124, 19,246, 17,213,104, 52, 84, 42,149, 66, 42,149, 66, 38,147, 65,
+ 38,147, 65, 34,145, 64,173,103, 48,122,117,172, 86, 32,179,227,154,182,236, 88,111,228,164, 37,204, 15,115, 71, 93, 0,112,164,
+ 68,243,129, 41,215, 11, 3,165, 43,214,255,242,203,186,247, 80, 60,193,104, 95,126, 62,103,160,116,133, 41,231, 38, 0, 20,104,
+114, 81,215,203, 21, 7,246, 28,198,135,131, 63,168,208, 92,137, 68, 98,136, 69, 34, 88,216, 40,170,213, 20,137, 68,118, 33, 33,
+ 33, 86,229,175, 15, 44,203, 70,126,249,229,151, 94, 31,244,123,207,113,239,193, 99,130, 79, 6,247, 51, 58, 57,218,103,196,199,
+199, 70, 3,176,242,243,243,163,166, 30,243,148,210, 13, 45, 91,182,244, 61,116,232,208,168, 89,179,102,221,253,250,235,175,191,
+ 47,255,254,202,149, 43, 23,158, 56,113,162,110,255,254,253,183,223,187,119,111, 67,185,239, 45,127,211,141,221,223,145, 58,128,
+215,228,169,181,193, 42,223,248,228,229,229, 33, 47, 47, 15,241,241,241,216,180,105, 83,201,137, 44,130, 80, 40,132, 80, 40, 44,
+ 27,175, 80, 25,231,142, 94,249, 9,192, 79,126,126,126,162,176, 27,251, 78,206,216, 50,169,171,127,160,175, 32,248,124,216, 64,
+ 0,139, 0,244, 26, 62,124,184, 29, 0,108,219,182, 45, 3,192,201,255, 70,133, 80, 74,247, 61,126,252,120,138,179,179,115,217,
+ 24,148,242,221,132, 44,203, 66, 38,147,161,116,172,138, 86,171,197,206,157, 59, 89, 74,233,190,170,234, 47, 42,252, 2, 30,135,
+ 95, 44,254, 30,199,129, 51, 22,127, 95,163,209, 96,254,252,249,229,167,190, 98,220,184,113, 64, 13,214, 66,174, 44,114,213,238,
+113, 54,132, 66, 33,174,120, 22, 59,129,222,233,244,149,177, 90,175,116, 97, 72,100,211,122, 15, 24,102,195, 82, 65,153,185, 42,
+222,134, 98,195, 41, 17, 11, 97, 38, 21, 35,234,105, 28,220, 93,252,208,181,247, 7,214,231,142, 29,152, 6,160,194,176,155,222,
+200,161, 87,128, 31,126,222, 19,132,188, 2, 53,114,179,179,144, 30, 23,137,200,208, 59, 16, 10,133,184,123,247,174,185,133,133,
+165,185,167,167, 7,140, 28,135,107, 55,238,130,130,224,232, 95,135,188,234,122,120,226,255,216,187,234,240, 40,174,246,123,238,
+204,250,110,220,179, 9, 16, 72,136, 2, 81, 8,238,197, 41,238, 20,183,162,133, 34, 69,138,182,184,148,226, 80,164,180,184,187,
+ 20,119,146,160, 33, 36, 36, 1, 34, 27,247,108,214,119,230,247, 71,164,129, 70, 54, 41,223, 87,190, 95,247, 60,207, 60,187, 59,
+ 51,123,230,206,189,119,238,156,251,222,247,190,247,253,219,216,209,229, 8, 91, 78,179, 32, 31,228,103, 36,128,166,105, 52,245,
+119, 3, 77,211,104, 17,228, 1,154,166,209,188,161, 39, 56, 28, 14, 90, 55,246, 65,221,186,117, 81,236,231, 81,113, 25,253,129,
+168,151, 55, 74,137, 93, 22, 44, 0, 77, 82,210, 95, 95,148, 73, 73, 96, 77,237,170, 90,183, 48,123,246,236,236,164,164, 36,205,
+199,130, 78, 42,149,242,142, 31, 63,110, 81,217, 34,216, 18,137,196,135,195,225,132,103,102,102, 50, 98,177,152, 98, 24, 61,227,
+ 93,175, 62,125,231,183,165, 71,139,207, 89,178,100,233,209,254,129,102,125,247, 31, 57,203,242, 92,154, 19,194, 21,232,198,124,
+191,141,207, 17, 74,124, 12,236, 52, 80, 42,149, 10,175, 95,191,174,116, 81,110,150,101, 43,172, 80,114,185,124,120,159, 62,125,
+ 46, 79,152, 48, 65, 72, 8,193,237,219,183, 75, 4, 63, 77,211,136,137,137, 1, 69, 81,216,177, 99, 7, 84, 42,213, 4, 3, 44,
+129,211,142, 29, 59,102,206,231,243,145,151,151, 87,242,220,208, 52,141,136,136, 8,172, 89,179, 6,195,134, 13, 67, 92, 92, 28,
+164, 82, 41,102,204,152, 97,178, 98,197,138,105, 0,150, 24,112,235,207,212,106,117,144, 88, 44,134, 80, 40, 68,177,208, 2,128,
+208, 36,251, 23,177,177,177, 13,108,108,108, 28,108,111,158, 61,221,180,205,151,126,214,182,142, 77,138, 5,150,161,136,211,106,
+119,200,228,242,249,253,118,239,182,187,117,250, 52,243,226,244,233, 4,142, 94,191,221,224, 58,164,165,240, 62, 38, 1,129,129,
+129, 8, 13, 13, 69, 96, 96,224, 7,214,108, 62,159, 15, 30,143, 7, 30,143, 7, 27, 75,131, 92, 37, 88,154,166,145,156,156,252,
+193,190,177, 99,199,190, 31, 50,100,136, 29, 0, 36,201, 18,216,111,166, 77, 78, 76, 79, 79,103,237,237, 43,230,244,243,243,187,
+ 69, 81,148,203, 71,162,216,114,220,184,113,200,206,206,238, 50, 97,194,132,230,133, 86, 50, 42,113,243,230,205, 67, 1,128,207,
+231, 87,123, 8,218, 8, 35,254,231, 5,150, 33,168, 76, 96, 21, 35, 52, 52, 84,235,228,228,180, 51,234,201,187,118,110,190,174,
+ 16, 73, 4, 29, 8, 33, 63, 11, 4,130,233, 95,125,245, 21, 30, 60,120,128, 23, 47, 94,252,242,119,151, 61,105,208,160,193, 37,
+129, 64, 80,171,172, 99, 42,149,234,253,243,231,207,203,244, 21, 75, 77, 77, 93,248,232,209, 35, 84,228,228,222,191,127,255,210,
+ 47,163, 18, 39,247,114, 91, 48,134,133, 86,163,133,188, 64,241,231,203,187, 72, 96,201,229,114, 12, 24, 48,224, 3, 11, 86,106,
+106,106,181,238,185, 42,150,171,242, 64,209,116, 71, 95,191, 0,238,181,123,207, 62,120,185,246, 28,183, 12, 2, 30, 7, 98, 1,
+ 15, 66, 1, 23, 34, 1, 15,241,137, 41,240,242,170,207,187,121,233,108,199,242, 4,150, 86,199, 96,213, 47,231, 0, 0, 71,206,
+ 92, 67, 80,109, 49, 22,207,159,141,126,253,250,129,207, 23,226,216,177, 35, 88,179,121, 31,198,215, 42, 44,170, 70, 13,253,177,
+122,235, 65, 44, 93,178,152, 58,114,248, 72,115, 3, 94,184,224,112, 56,160,105,250, 47,159,197,223, 13,177, 70,178, 12, 11,205,
+199,101,196,176, 0,203,194,249,135, 31,224,252,195, 15,120, 84, 36, 78,125,228,114, 40, 20, 10,160,181,111,149,196,149, 90,173,
+134, 76, 38,211, 60,125,250,212,190,140, 23, 83,138, 90,173,174, 84,208,236,222,189, 59,114,228,200,145, 62, 86, 86, 86,225,207,
+158, 62,213,250,250,249,113, 63,246,193,242,240,240,200, 89,178,100,233,209,161,253,186,245,221,246,221, 64,221,248, 37,191,114,
+ 12,113,116, 47, 17,197, 26,205,219,246,237,219, 27, 36,241, 21, 10, 69,114,121,199,130,130,130, 70, 18, 66,126,240,240,240, 16,
+180,105,211, 6,183,110,221,194, 15, 63,252,192,232,116,186,116, 0,104,218,180,169,237,210,165, 75, 73,120,120, 56, 44, 44, 44,
+144,154,154,186, 55, 40, 40,104,105, 69,142,239,124, 62,191,117,195,134, 13, 41,149, 74,245, 23,113,181, 98,197, 10, 12, 26, 52,
+ 8, 30, 30, 30, 96, 24, 6,249,249,249,104,211,166, 13,119,227,198,141,173, 13, 17, 88, 20, 69, 77,109,215,174,221, 26, 20,206,
+ 34, 44, 45, 28, 95, 1,152, 89,100,221, 78,238,214,103,216,203, 22,237,123, 7,185,212,173,239, 88, 25,167,189,189,253,119, 20,
+ 69,245, 7, 64, 3,136,167,172,172,234,218,218,218,218,183,236,214, 13,249,132,208,219, 47, 94, 36, 28,145,200, 4,128, 65, 67,
+141, 74,173, 28,181, 92, 11, 93,249,250, 12,232,137,208,208, 80,244, 29,216, 11, 60, 30, 15, 28, 14, 23, 60, 46, 23, 92, 94,161,
+ 5,203,194,198,172, 90,237, 72, 81,231,145,152,155,155, 3, 44, 96,102,110, 94,108,201, 36, 0, 88,138,162,216, 10,234,185,251,
+254, 73, 99,237,120,102,230, 96,116, 90,212,252,178,111, 73,157,142,218,189, 69, 4,134, 17,229,199,189,197,212,235,143,184, 48,
+194, 8,163,192, 50, 12,165,157, 66,203, 66,219,182,109, 39,155,154,154,110, 44,106,120, 17,255, 32, 17,241, 15, 18,225,237, 89,
+175, 89,128, 95, 80,206,160, 65,131, 96,109,109,141,111,191,253,150, 5,240, 75, 85,175, 31, 19,249,210, 4, 0, 43,149, 74,191,
+ 45,178, 8,248, 61,122,244,200,246,241,227,199,104,216,176, 97,233,151, 7,154, 55, 47,255,189, 93, 52, 51,238, 27,148,227, 79,
+ 85, 77,171, 24, 52, 26, 13, 10, 10, 20, 80,171, 53,208,105, 25,232,116, 58, 4,214, 51,197,175, 59,230, 20,238,211, 21, 91,203,
+ 10,173,100, 2,158, 10,173, 26,215,208,130, 80,138,155,247,223, 87,216, 82,150,101,185,162,105, 26,119, 92, 11,255,214, 33, 73,
+107,176,208, 98, 25,189,167,131,189, 61,226, 46, 62, 4, 0,152,136,133,184,180,111, 41, 36,226,194,201, 13, 93,134,205,133, 72,
+192,131, 72,192,133, 70,163,129,189, 93,109,232,244, 90,207,114,133,183, 86,173,174,101,111, 14,199, 46,141,241,244,241,125,124,
+ 51,121, 12, 70,142, 28, 5,158,208, 20, 55,111, 94, 71,156, 44, 21,111, 18,178, 48,121,225, 22,104,117, 12, 52, 58, 61, 52, 90,
+ 61, 54,236, 61, 7,141,158,173,244, 37,207,227,241, 48, 99,198, 12, 81,121,199, 15, 30, 60,168, 48,188,140,180,144,203, 21, 80,
+169, 84,208,168,117,208,104,117,208,215,225, 97,233,252,193,208,105,116, 40, 24,216, 4, 26,173, 14,204,180, 94,208,168,181,136,
+ 23,115,168,230, 13,165, 90,128, 82,220,121,156, 96, 86, 25,127,177, 40,168, 72,128, 25,130, 98,145,229,235,231, 23, 62,188,107,
+163, 21,119,239, 63, 78,187,123,255,241, 95,206,115,173,215, 40,118,252,242,131,115,170, 34,174,128, 15,135, 11,255,102,189,255,
+254,198,141, 27,246, 38, 38, 38,136,140,140, 4, 77,211, 32,132,100,132,134,134,218, 3,192,162, 69,139,210,185, 92,174, 53, 77,
+211,152, 54,109, 26, 56, 28,142,237,215, 95,127,189, 0,192,166, 10, 58,114,222,166,166,166, 31, 88,175,120, 60, 30,230,204,153,
+131,161, 67,135,150,136, 43, 30,143,135,189,123,247, 34, 40, 40, 8,106,181,218,219,144,244, 38, 36, 36, 60, 6,208,194, 0, 1,
+ 66,138, 68,121,165,245,147,162,168,225, 79, 39, 76,168,171,124,244, 8, 95, 51,140,143,167,167, 39,148, 74,101,201,113, 55, 55,
+183,154, 9, 9, 9,201, 82,169,244, 55, 0, 91,100, 50,217,147,138,248,180, 74, 6,239, 99, 18,138, 59,171,104,212,168, 81,137,
+197,170,180,245,138,199,227, 65,196, 55,169,114,153, 49, 12,131,220,220, 92,122,239,222,189,117,124,124,234, 17, 0,240,246,174,
+ 71,206,157, 59, 95,211,196,196, 36,214,202,202, 74, 83,233, 51,105,102,142,171,163, 6, 0, 0,250,181,237, 84,108,197, 66,200,
+210,185,224,112,185,240,155, 62, 23,192,163,146,243,213,106, 53, 24,134,161, 97,132, 17, 70,129, 85,206,131,175,213, 86,120,124,
+221,186,117,104,208,160, 65,133, 47,160,141, 27, 55, 98,255,254,253,235, 88,150,141,169,234,245,187,181, 11,168,135,245, 39, 94,
+186,122, 20, 54, 10, 75,166,117,167,228,114, 57,238,222,189, 11,115,115,115,188,121, 99, 88,216,174,255, 68,152, 6,150, 5, 52,
+ 90, 29,228, 5, 74,168,213,106, 76,155,101,208,204,116,162, 81,231,113,186,118,106, 89,174,120, 40, 30,238,163, 40,170, 82, 31,
+172,202,134, 6, 63,176, 96,104,181, 40,126,117,228, 23, 40,209,118,240,119,120,116,106, 3, 0, 20,138, 43, 33, 23, 34, 62, 15,
+ 34, 62, 7, 20, 1, 8,202,231,214, 42,114,191, 92,191,116,214,237,173,191,252,234,220,179,229, 24, 76,158, 52, 25, 28,190, 24,
+150,214,182,208, 49, 44,106, 74,237, 16,157,152,133, 99, 63,207, 42, 26, 21,101,209,114,200, 34,172,155, 63, 6,171, 23, 86,110,
+196,228,112, 56,216,180,105,147,226, 99,171, 85,233, 79,182,242,247,224,159, 2,171, 64, 1,133, 82,133,111,191,219, 98,120, 25,
+117,108, 33, 50,228,228,138, 4, 84,101, 2,172, 44,145,101,200,243,235,215, 19,243,255,201, 6,134, 97, 24,156, 59,119,174,164,
+ 60,202, 43, 67, 67,173,173, 12,195,224,253,251,247,120,249,242, 37, 26, 55,110,140,156,156, 28,112, 41, 10, 51,158, 63,135,207,
+ 87, 95, 65,205,227,129, 97, 24,240,249,124,140, 27, 55,206,224,252,172,162,114, 44,242, 99,211, 87, 72,238,232,232,184,214,203,
+203,171,110, 76, 86, 22, 66,159, 62, 69,163,177, 99, 1, 0,119,238,220, 41,109, 1,196,224,193,131,249,177,177,177,163, 34, 34,
+ 34, 70, 57, 58, 58,174, 75, 74, 74,154, 81,238,243,196,170, 74,124,176,250, 15,238,131,186, 94,117,176,127,207,129,146,227,211,
+103, 78, 5,151,203, 3,151,199,133,133,185, 69,149,111, 45, 55, 55,151,179,118,237, 58,223,224,224,198,162, 33, 95,141,160, 52,
+ 58, 22, 75, 87,110,160, 15, 31,248,213,122,223,175,251, 69, 66,161,240, 85,165,101,164,213,252,165,157, 34,132,128,195,229,130,
+195,231, 1, 12, 3,150,101, 37,171, 87,175, 94,242,242,229,203,134, 94, 94, 94, 80,169, 84, 95, 17, 66,194,140,113,176,140,248,
+ 87, 9, 44,154,166, 43,181, 78, 81, 20, 85,233, 16,225,244,233,211, 97,106,106, 90,222,139,135,125,254,252,121,120, 82, 82,210,
+ 14,150,101,171, 21, 23,231,236, 31, 97, 47, 23,127,211, 43, 15,128, 2, 0, 44, 44, 44,210,219,182,109,155, 15, 64,115,248,240,
+225, 15,206, 85,169, 84,239,203,227,177,179,179, 91,188,106,213,170, 41,157, 59,119,166, 40,138,250, 75,227,254,241,166,213,106,
+113,230,204,153, 41,203,151, 47, 71,121, 86,175,226,151,119,129, 92, 1, 69,145,131,115,244,139,163,134, 54,230,149,158,242,204,
+207,169, 76,203,213, 23, 50, 13,104,154,198, 5,187,194,251,232,146, 86, 57, 23,161,232,200,183,239,227, 27, 57,216, 88, 32, 43,
+ 39, 31, 2, 62, 23, 34,193,159,214,124,145,176,208,122, 37, 18,112, 97,105, 97,138,140,140, 20,112,185,220,200, 10,132,195,123,
+ 66, 72,139, 1,189,186, 92,166,104,142,176,244, 49,174,200, 76,124,229,238,115,203,148, 76, 57, 74, 27, 3, 24,134,197,148,165,
+123, 12,171,192, 28, 14, 38, 78,156, 88,174,192, 57,125,250,116,149, 45, 88, 10,101, 21,203,200, 64,254,138,134, 0, 43, 59, 94,
+ 25,138,103, 23, 74, 36, 18,159, 34,241,101, 48,252,252,252, 46,136,197, 98,131,131, 28, 25, 26,116,148, 16,178,164,109,219,182,
+ 63, 56, 59, 59,219, 77,152, 48,129,208, 52,141,160,160, 32,155,239,191,255, 62,167,208, 50,226,109, 90,220,198,172, 95,191, 30,
+175, 94,189, 74, 35,132, 44,173,136,147,207,231, 71,152,155,155, 7,181,105,211, 6, 57, 57, 57,136,143,143,135, 68, 34,129,207,
+218,181,120,254,245,215,240,219,182, 13, 84,219,182, 32,132,128,207,231,227,249,243,231, 16,137, 68, 17,229,241, 57, 57, 57, 5,
+179,133, 78,230,205,240,231,176, 32, 11,224, 46, 33,100, 86, 98, 98,226,195, 50,218, 59, 10, 0,244, 12,195, 86,114,255,131,191,
+251,238, 59, 80, 34, 17, 28,155, 52,129, 34, 38, 6, 26,141, 6,141, 27, 55, 46,177,170, 55,110,220, 24, 52, 77,163,110,221,186,
+176,178,178,194,241,227,199, 7,227,195,153,213, 31, 64,153,175,193,251,152, 4, 52,105,210,164,196, 82,213,181,107,215, 18, 11,
+ 22,151,203, 45,177,100, 17,125,229,130,149, 16,194,126,212, 22, 19, 62,159, 39, 24, 54, 98, 20, 53,235,219,111, 24,173, 78,203,
+208, 52,151,250,118,254,114,234,205,235, 23, 2,185, 92, 78,145, 74,122,107, 53,123,244, 67,191,118,133, 70,208, 99,117,109, 65,
+ 23, 9,171, 30, 47, 18, 74,202,197,236,236, 31,252, 21, 43, 86,244,245,242,242, 42, 28,110, 7, 56,198, 56, 88, 70,252,155, 4,
+ 86,212,211,167, 79,221,235,213,171,135,184,184,184,191,204,108, 43,126,198, 36, 18, 9, 68, 34, 81,177,133, 40,170, 60,178,107,
+215,174,253, 12,224,231,226,223, 82,169,180, 73,155,254,173,239, 53,234,212, 16,191, 47, 63,144,147,148,148,228, 91, 28, 19,139,
+ 16, 66,164, 82,233, 80, 46,159, 51,192,181,126,205, 86, 96,152, 85, 87, 79,223, 89, 84,209,141,184,122,212,203, 7,160, 40, 53,
+139,112, 77,117, 50,132, 16,210,175,115,231,206, 84,120,120, 56, 6, 12, 24,128,253,251,247,151,123,238,208,161, 67,113,240,224,
+ 65,116,236,216,145, 90,177, 98, 69,191,202, 4, 86,161,117, 68,253, 31, 43,204,178, 44, 87, 31,139,196, 74,133, 0,163,187,250,
+252, 73,168,191,111, 80, 83,238,187,132, 20, 8,249, 28, 8, 5,127,206,216, 23, 21,249, 95,137, 4, 92, 56,216, 90,226,209,189,
+ 27, 26,157, 78,123,181, 18,113,241, 30,101, 4,105, 20,152,218, 68,126,209,172,129,101, 89,255, 89,251,221, 87,104,112,104,109,
+165,233,229,114,185,216,189,123,183,162, 60,235,149,161,121, 80,104,101,212,162,160, 64,129, 2,133,242,147,149,137,189,189,189,
+173,157,157,221, 86, 11, 11, 11, 97, 89, 2,234,227,227,127, 71, 92, 21,197,197, 10, 31, 57,114,100,149, 68, 22,159,207,175,125,
+247,238,221,146, 32,163, 21,125,170,213,106,244,239,223,223, 32,203,119, 72, 72,200,238,128,128,128,104, 91, 91,219, 43, 62, 62,
+ 62,130,232,232,104, 44, 91,182,140,112,185, 92,179,226,246, 35, 47, 47, 15, 52, 77, 35, 43, 43, 11,132,144,225, 33, 33, 33, 23,
+ 43,226, 84,169, 84, 55,111,222,188,233,223,189,123,119, 58, 34, 34, 2, 52, 77, 23,166,171, 73, 19,248,109,219,134, 23,223,124,
+131, 86,239,222, 65,169,209, 64, 40, 20,226,210,165, 75,154,130,130,130,155, 21,220,251,142,251,247,239,215, 19, 10,133,208,104,
+ 52, 96, 24, 6, 20, 69, 17, 14,135,211,220,199,199,103, 35,128,134, 31,117,192,236,198, 77, 95,233,169,215,233,244, 73,113,209,
+105, 6, 88,132,176,127,255,126, 52,110,220, 24,173, 90,181, 66, 98, 98, 34, 98, 98, 98,208,165, 75,151,146,115,158, 62,125,138,
+176,176, 48,184,185,185, 85,110,193,163,180,112,243,172, 13, 30,143, 7, 46,151, 11, 30,183,240,179,112, 43,180, 92,241,184, 60,
+112, 57, 92, 8, 69, 66, 3,181,255,135,117,210,188,200,242, 37, 22,139,152,186,117,235,134,191,137,142,241, 1, 11,202,204,204,
+220, 32, 95,219, 98, 62, 66, 72,137,184,226,242,121, 37,150, 44, 0,200,201,201, 81,246,236,217,243, 55,149, 74, 53, 2,159,112,
+ 36,197, 8, 35,254, 87, 4, 86,151,209,163, 71,111,235,208,161, 67,187, 25, 51,102,192,196,196, 4, 73, 73, 73, 37, 15, 24,159,
+207, 71,141, 26, 53, 80, 80, 80,128, 91,183,110, 33, 59, 59,251, 26,128,113,134, 94, 56, 41, 41,233,193,155, 39, 81, 25,109,250,
+ 54,181,174,215,212,211, 34, 62, 42,161, 49,128,123, 69,226,234,151, 65,211,187,140,104,211,187, 17,120,124, 46,226,223, 36,255,
+215, 50,132,162, 40,154, 16,130, 1, 3, 6, 24,116,254,192,129, 3,113,243,230, 77, 84, 52,156, 88, 98,193, 42, 80, 66,174,248,
+116,157, 51, 66, 8,244,122, 61, 26, 71,102,126, 48, 51,171,216,114, 85, 44, 44, 12,177, 92,149,244,144, 11, 10, 86,223,190,122,
+106,172, 87,125, 63,219,198,254,238,120, 19,155,128, 85,115,199,148, 28,255,118,252, 32,236, 61,116, 26, 78, 14, 54, 80, 22,228,
+225,226,249, 51, 57,185,185,185,171,171,123, 15,251, 78, 22,198,129,108, 49,248,195, 57, 2, 3,190,249,201,160,255,115,185, 92,
+140, 24, 49,162, 92, 11,214,149, 43, 87, 20,134, 12,143,178, 44, 11,141, 90,139,124,185, 2,138,130, 79, 35,176,164, 82,169, 95,
+227,198,141,175,108,223,190,221,218,198,198, 6, 50,153,236, 3,129, 37,149, 74,253,130,131,131,175,108,223,190,221,218,214,214,
+ 22,241,241,241, 6,135, 7, 41, 67, 92, 33, 45, 45,141,100,101,101, 49,150,150,150, 85, 18, 89, 20, 69, 65,165, 82,225,213,171,
+ 87,134, 62, 35, 6,207,248, 50, 49, 49,217,179,124,249,114, 65,106,106, 42,104,154,198,171, 87,175, 62,168,171,197,219,119,223,
+125,135,185,115,231,110, 5, 80,171, 34, 62,157, 78,183,110,232,208,161,163, 18, 19, 19, 45,237,236,236,144,148,148, 4, 62,159,
+ 15,150,101, 65,218,180, 65,139,216, 88,104,244,122,136, 68, 34, 68, 70, 70, 98,199,142, 29,114,149, 74,181,174, 44, 46, 55, 55,
+ 55, 62, 69, 81,238, 60, 30, 15, 67,134, 12,249,176, 94,238,219,135, 38,181,178,130,198,126, 33,200,215, 65,168, 74, 17,117,190,
+ 64,211, 52, 25,247,237, 42,143,224,150, 93,235,191,126,241, 48, 58, 45, 37,225,110, 37,183,175, 85,171,213,240,242,242,194,227,
+199,143,113,245,234, 85,180,109,219, 22, 45, 91,182,196,141, 27, 55, 16, 18, 18,130,176,176, 48, 16, 66, 96,109,109, 93,236,102,
+ 81,161,175,133,186, 64,135, 84, 89,198, 95,172, 85, 31,255,230,241,120, 80, 41, 52, 6,149, 81,105,209, 68, 8,129,149,149,149,
+106,195,250,213, 2, 19, 19, 19, 61, 0,152, 72,196,250,195,251, 54,195,198,218, 74,197, 26,104, 98, 45, 25, 22, 44, 18, 87, 52,
+151,251,129,155, 2,203,178,121,207,158, 61, 27, 75, 8,121, 70, 8, 41,110, 63,140,113,176,140,248,119, 8,172,208,208,208, 88,
+ 0,237, 3, 2, 2, 6,223,186,117,107,221,244,233,211,109,155, 55,111,142,204,204, 76,212,170, 85, 11, 82,169, 20,143, 31, 63,
+198,211,167, 79,211, 89,150,157, 17, 18, 18,178,191,140,135,172,125,121,177, 50, 88,150,101,165, 82,233, 17, 85,126,254,215,129,
+173,188,113,237,240,237,229,142,142,142,227,156,156,156,166, 13,159,219, 99, 68,235,158, 13, 17, 25,246, 22, 15, 46, 63, 71, 74,
+ 92, 58,134,183,152, 85, 33,231,199, 78,238, 22, 22, 22,163,196, 98, 49, 31,128,166,140, 94,240, 7,179, 8, 75,115, 50, 12,163,
+ 87,171,213, 56,116,232,144, 65, 34,235,192,129, 3, 80, 42,149, 96, 24, 70, 95,222,189,235, 25,134,112,184, 2, 72,107,120, 65,
+163,145,131, 97, 12,159, 32,201, 86,146,159, 58,157, 14,139, 23, 47,198,204,153, 51,177,116,105,249,163, 43, 28, 14, 7,155, 55,
+111, 70,101,101,148,153,153,153, 39,149, 74,135, 30,220,245,211,209, 33, 99,166,152, 58, 55,245,197,158,195, 23,160,213,104, 32,
+ 16,112, 97,105, 38, 65,221,218,206, 80, 43,229,216,182,105,125,174, 82,161, 24,250,177,239, 89, 69,229,254, 49,134,245,108,137,
+ 21, 59, 78,225,246,239,127, 78, 66,108, 49,120, 33,126, 91, 61, 9, 1, 1,187, 43,228,212,235,245,224,112, 56, 56,120,240,160,
+162,172,217,131, 52, 77,131,203,229,150,107,193,250,176,140,244,132,203, 19,162, 70, 45, 31,168, 85,249,159,164,140,172,173,173,
+103,238,218,181,203, 90,169, 84,226,245,235,215,120,245,234, 21, 8, 33, 37, 42,166,248,120, 65, 65, 1, 94,188,120, 81, 44,112,
+ 94, 85,229, 57, 42,182, 92,165,165,165,145,164,164, 36,136,197, 98,234,217,179,103, 74, 95, 95,223,240,138,158,239,210,156, 42,
+149,234, 93,187,118,237,202,179, 24, 57, 9, 4,130, 15,102,124, 21, 7, 29,253,120,168,176,172,116, 22, 20, 20, 60, 95,183,110,
+ 93,157,134, 13, 27, 98,251,246,237,106, 83, 83, 83,254,244,233,211, 89,154,166,201,134, 13, 27,144,149,149,165,158, 51,103, 14,
+255,246,237,219,144,203,229, 79, 42,187,119,150,101,243, 8, 33, 99,155, 54,109,186,239,226,197,139, 98,119,119,119,228,230,230,
+130,101, 89,236,221,187, 23,147, 38, 77,130, 80, 40, 68,100,100, 36,190,252,242,203,130,130,130,130,177,165, 99, 96,149,230,212,
+233,116,132,203,229,178, 12,195, 96,193,130, 5, 37, 65, 69,139,131,140,138,120,122,236,152,238, 42,153,186, 51, 71, 50,248,251,
+157, 95, 1,128, 94,167,211,191,126,241, 48,122,239,166,239,175,243,120,188, 91,165, 56,235,127, 28, 11,139, 16, 50,239,199, 31,
+127,220,218,172, 89, 51,145,137,137, 9,220,221,221,113,247,238, 93,220,189,123, 23,183,111,223, 46,174, 3,176,178,178, 66,118,
+118, 54,226,227,227, 21,132,144,121, 21,229, 39, 95,204,133,171, 71,237,194,217,130, 69, 22, 43,110,169,217,131,165,173, 89, 60,
+ 46,183,210,231,253, 99,247, 14, 43, 43, 43, 93, 96, 96, 64,184, 66,161,160,139,181,148,141,141,205,139,162,115,217, 26, 53,106,
+168, 63,170,242,127,225,140,218,181, 25, 33,203,230, 21, 14, 11, 62,143, 47, 17, 91,215,191, 8, 0,135,199, 67,141,110,125, 74,
+191, 7,182, 16, 66,118, 23,125, 87,149,226,156,253,169, 99, 97, 85,165, 93, 50,114,254, 51,156,255, 38, 11, 22, 0, 32, 44, 44,
+236,247,250,245,235, 95, 88,177, 98,197,138, 19, 39, 78,140,153, 50,101, 10, 49, 51, 51,195,145, 35, 71,216,140,140,140, 61,124,
+ 62,127,230,253,251,247,179,170,115,113,150,101,247,220, 56,126,111,194,176, 57, 61,201,244, 13,195,155,135,252,241, 34,162, 65,
+ 83,119, 52,104,234,142,144,107,225,216, 52,247,192,126,189, 86,191, 32, 41, 41, 41,174, 18, 42, 85,251,102,158, 31, 59,185, 91,
+223,188,254,135,117, 85,103, 17,178, 44,123,228,196,137, 19, 83,186,116,233, 66, 61,122,244,232, 47, 62, 87,197,203,227, 48, 12,
+131, 43, 87,174, 64,163,209,224,200,145, 35, 76, 69,113,176, 24,176,167,182,109, 89, 61,108,219,174,227,124, 62,143,224,254,173,
+ 99,200,201,170,216, 42,199,227,113,241,219,129, 83, 26, 14,135,126, 93, 65, 90,223,135,133,133, 89,175, 90,181,138, 38,132, 96,
+203,150, 45,160, 40,170, 92,135,246, 23, 47, 94, 48, 90,173,182,210,178,146,201,100, 87, 28, 28, 28, 6,110, 89,183,120,111,155,
+142, 61, 44,188,189,124, 56,118,118, 53,193,161, 9,178, 50,210, 17,242,224,182,238,226,185, 83,217, 42,149,106,184, 76, 38,187,
+242,119, 42,224,242,237, 39,203,220,223,103,202,186,202,172, 40, 58,173, 86,203,145, 72, 36,208,233,116,101,134,106,104,219,182,
+173,232,238,221,187, 10,141, 70, 3,154,166, 43, 84, 76, 12,240,201,203, 72,175,215,123,103,101,101, 65, 46,151, 35, 52, 52,148,
+221,180,105, 83, 90,118,118,246,220,210,199, 51, 51, 51,145,151,151,135,144,144, 16,118,251,246,237,105,185,185,185,115,171,146,
+127,197,113,177,178,178,178, 24,177, 88, 76,105,181, 90,173,175,175,175, 80, 34, 49, 44,230, 21, 0, 60,121,242,164, 83,121,199,
+154, 53,107, 22,117,247,238,221,186,122,189,190,244, 26,133, 60,165, 82,233,222,163, 71, 15,142, 1,233, 27,124,249,242,229,223,
+111,223,190,221, 64,165, 82,141, 74, 77, 77,221, 7,160, 38,135,195,193,155, 55,111,210,212,106,117,159,121,243,230,237,145,203,
+229,207, 77, 76, 76, 6, 27,216,110, 92, 36,132, 12,241,246,246,222,189,120,241, 98,147, 86,173, 90,113,164, 82, 41, 26, 54,108,
+136,200,200, 72,156, 59,119, 78,187,101,203, 22,121, 65, 65,193, 72,150,101,175, 84,208,233, 96, 1, 16,157, 78, 7, 62,159, 95,
+178, 9, 4, 2,240,120, 60, 20,168, 41,140, 94, 27,163,208, 65,164, 88,183,104,236, 57, 22, 32,201,241, 49,233,169,201,241, 15,
+ 9, 33,183,100, 50, 89, 78,121,150, 49,165, 82,233,207,178, 44, 39, 55, 55,119,131, 74,165, 26, 62,125,250,116,199, 85,171, 86,
+193,215,215, 23,233,233,233,176,178,178,130,163,163, 35,242,243,243, 17, 27, 27,171,215,104, 52,219,244,122,253,146,148,148,148,
+ 10,135, 29,179,211,115,225,236, 80,243, 3, 75, 39,203,178, 96,245,128, 86,165,135, 94,195, 66, 77,180,224,114,181, 48,112, 9,
+ 45, 86,167,211,161, 91,183,110, 56,123,246, 44,122,246,236,201, 2, 40,215,138,116,246,236,217,202,135,220, 25, 6, 92, 1, 31,
+ 28,222,159,195,130,133,214,172,194,125, 20,249, 75,121, 26,173, 86, 70,252, 59, 5, 86,209,139, 57, 27,192,184,134, 13, 27,238,
+155, 60,121,242, 89,134, 97,184, 12,195,116,125,242,228,201,237,191,115,241,164,164,164, 80,169, 84,250,157,189,179,229,138,206,
+ 67,155,195,211,191, 22,244, 58, 61,238,158,127,130, 61, 63,158, 60,152, 24,159, 56,188,244, 90,133,229, 63,207,204,245,102, 65,
+158, 20, 0, 94,169,225, 23,166, 58,179, 8, 83, 83, 83, 23, 46, 91,182, 12, 63,252,240, 67,149,103, 17,150,119,206,189,199,137,
+227,154, 4, 57, 58, 15,236,211,182, 35, 69, 40, 86,165, 86, 85,208, 43, 0, 91,236, 21,193,225,208,175,111, 62,136,247, 45,239,
+220,228,228,228,118, 19, 38, 76,248,131,162,168, 90,165, 77,243,229, 65,175,215, 39,101,100,100,116, 48, 36, 31,146,147,147, 47,
+ 56, 59, 59,123,220,188,120,234,187, 59, 87,207,183,214,235, 53,110, 4, 4, 60, 30, 47, 90,171,215,221,208,170,213,203, 19, 18,
+ 18,178,254,110, 5,252,110, 92, 79,188,151,165,131,195,161, 11, 3,123, 22, 21,247,177,141,211, 17, 16,240, 91,185,255, 19, 8,
+ 4, 23,118,239,222,221,109,216,176, 97,164,216,239,140,101,217, 15, 26,244,135, 15, 31, 42,212,106, 53,246,236,217,195,138, 68,
+162, 10, 3,215,126, 88, 70,132, 85, 85,224, 15,101,104, 25,229,231,231,143,236,209,163,199, 94, 0, 2, 0,111,114,114,114,198,
+203,100,178,132,210,199,123,246,236,185, 23,128,128, 16,242,151,227,134,160, 56,100,131,165,165,101,120,145,229, 74, 88, 29, 71,
+247, 10,234, 55, 93,222,240,161, 33, 67,133, 69,107, 11,246, 46,254, 29, 20, 20,180,100,194,132, 9, 37,139, 61,135,133,133,221,
+ 1,224, 90,141,206,217, 21, 66, 72,189, 5, 11, 22,124, 35, 20, 10,219, 20, 20, 20,120, 20, 9,186, 72,149, 74,117, 93,161, 80,
+172,103, 89,182,194,216, 82,209,209,209,234, 58,117,234, 68,234,116,186,250,182,182,182,224,112, 56, 37, 34, 11, 0, 30,196, 89,
+133, 36, 38, 38, 54,172,106,218,206,159, 63,239, 98,105,105,217,129, 16,210,151,101, 89,207,188,188, 60,213,247,223,127,127,239,
+230,205,155,185, 17, 17, 17,157, 90,180,104, 65, 28, 28, 28,240,246,237, 91, 54, 63, 63,255, 40, 69, 81,243,100, 50, 89,140, 1,
+247,156,176,103,207,158,170,230, 83,133,245, 73,173, 86,167,221,191,127,223,234,234,213,171,180, 94,175,199,197,139, 23, 75, 58,
+146,101,141, 6,198,196,196, 64,173, 86, 87, 56,134,174,201,201,130,239,212,217, 96,139,102,115, 22,163,102,215, 62, 32, 96,193,
+170,141,122,202,136,127, 7,200,127,100, 26,115, 21, 77,136, 82,169,116,128, 80, 34,152, 88,203,195,209, 87, 22,147, 26,158,151,
+ 83,176, 63, 41, 41,105, 59,203,178,250,234,114, 86, 37,208,168,209,204,251,207,112,242,197,102,151, 8,205,171, 85,238,203, 65,
+175,121,175, 46,200,237, 88, 22,103,112,112,176, 19,143,199, 91,173, 82,169, 58, 87, 20,165,157,166,105,157, 72, 36,186,160, 84,
+ 42,103,126,188,216,243,255, 98,126, 30, 61,122,180, 76,209,111,232, 44,194,190,125,251,234,171,146, 78, 63, 63,191,235, 98,177,
+184,204,128,154, 5, 5, 5,113, 79,159, 62,237,240, 57,228,103,241,204, 54, 67,124,132, 74,115, 86,103, 22, 97, 57,156, 37, 67,
+132, 46, 46, 46, 2,141, 70, 19, 0,192, 3,128, 5,128, 76,173, 86,123, 49, 45, 45, 45,197,193,193, 33,136,162,168, 5, 69,226,
+117,105,114,114,114,200, 63,249,108, 58, 59, 59, 11,205,204,204, 86, 83, 20,229,104,200,255, 25,134, 81,167,166,166, 78, 79, 79,
+ 79, 79, 46,139,179, 94,189,122, 33, 52, 77, 87,186,168,185, 94,175, 79,120,249,242,101, 80, 5,233, 52, 14, 17,254, 11, 57,255,
+149, 22,172,255, 52,100, 50,217, 33, 0,135, 62, 37,103,121,145,218,141,248,124, 80, 44,158,170,131, 34,177, 52,240,223,150,103,
+197, 2,169,140,253,175, 0,144, 79,125, 61, 67,194, 49,124, 14, 96,171,217, 83, 44, 18, 80, 45, 62,101, 90,222,189,123,167, 2,
+112,175,104,251, 0, 69,130,170,251,231,146,111, 9, 9, 9, 74, 0,147, 62, 21, 95, 69,162,201, 8, 35,254,109,160,140, 89, 96,
+132, 17, 70, 24, 97,132, 17, 70, 24,241,105, 65, 0,180, 47,167, 71,104,176,233,143, 16,210,190, 26, 61,206,171, 70, 78, 35,167,
+145,211,200,249,255,132, 51,181, 2,206, 23,149,112,214, 47,231,144,221,255, 80,126,250,151,195,185,178, 18,206,217, 21, 28,126,
+ 98,172,159,255, 63, 57,255, 53, 40,118,102,252, 79,108, 0,218, 27, 57,141,156, 70, 78, 35,167,145,211,200,105,228, 52,114,254,
+219, 54,227, 16,161, 17, 70, 24, 97,132, 17, 70, 24, 97,196, 39,134,193, 2,203,196,193,219,219,214,197,111,175, 85, 13,223,103,
+ 86, 53,124,159,217,186,248,237, 53,113,240,246,254, 55,102,154, 84, 42, 21, 57, 58, 58, 14,174, 89,179,230, 21,127,127,255, 92,
+ 39, 39,167,111,140, 85,169,234,104, 77, 8,103, 32, 33, 19,135, 17, 18, 55,140,144,184,129,132, 76,108, 77,200,255,187,101, 51,
+ 22, 79,149, 54,185,125,113,200,133,197, 83,165, 77,202, 60,254,173,212,250,225,149,254, 63, 45,159,228,100,245, 41,174, 71, 8,
+ 49,181,183,183,223,225,224,224,240,206,222,222,254,189,189,189,253,110, 66,136,185,177,198, 25, 97,132, 17, 70,252,247, 96,208,
+203,204,170, 86,131,209,222, 94,158, 51,151, 45,154, 75, 28,236,108,196, 58, 61,163,121,251, 46,222,103,225,178, 21, 71,173,106,
+ 53, 88,151,249,254,249,174,106,188, 4,136,179,179,243, 0, 46,151,219, 13, 64,177, 80,123,165,213,106,207, 38, 36, 36, 28, 50,
+116, 86,144,175,175,239, 29,154,166,107, 86,229,218, 12,195,188,123,250,244,105,203,234,100,152,147,147, 83, 63, 39, 39,167,221,
+141, 27, 55, 22,251,251,251,131,199,227, 97,213,170, 85, 51, 0,172, 55,248,222, 91,183,230,216,101, 91,125, 69,115, 56,221, 1,
+248,178, 44, 0, 66, 63, 99, 52,234,243,169, 60,171,189,108,232,118,173, 33, 60,142,142,142,115, 9, 33,195, 81, 56,173,124,151,
+ 76, 38, 91,253,159,168, 36, 82,169,180, 6, 33,164, 13,203,178, 94, 20, 69, 61,103, 24,230,178, 76, 38,203,248,187,188,246,192,
+184,166,205,155,255, 52,108,198, 12, 90,113,235, 22,126,218,189,123, 3,114,115, 1, 96,115, 85,235, 82,112,176,127, 95, 83, 83,
+116, 35, 64, 0, 8, 8, 5,246, 73,102, 54,117,254,241,227,176, 67,134,196, 82, 43, 15,129,129,129,231, 0, 20, 47, 28,119, 62,
+ 52, 52,180,107, 85, 57,114,162,217,249,130,238,222, 45,114,162,175,207, 7,208,249,227,227, 58,165,112, 24, 75,215,232,166, 96,
+195,226, 1,172,253, 59,121, 74, 8, 17,219,218,218, 62, 59,117,234,148,115,163, 70,141, 56, 0, 16, 18, 18,242, 85,183,110,221,
+218, 22,133, 18,200,253, 39, 26,154, 38, 77,154, 88,234,116,186,125, 52, 33,141, 25,134,177, 0, 0,138,162,178,245, 44,251,128,
+195,225, 12,171,110,176, 98, 35,140, 48,194,136,255, 89,129,101, 98,239,229, 83,175,158,247,140,139, 39,246,213,200,206,204, 86,
+254,188,102, 95,168,156,195, 47,112,247,113,231,253,188,126,181,229,196,169,211,167,153,216,123, 61,204, 79,137, 8, 55,244,162,
+142,142,142, 53, 93, 92, 92,142,207,157, 59,183,126,243,230,205,185,118,118,118, 72, 73, 73,193,235,215,175,235,223,189,123,183,
+231,201,147, 39,103, 56, 58, 58,246, 54, 32,130, 59, 36,124, 94,157, 67,171,150, 59,240,205, 45,192,234,117,176,172,239, 95, 56,
+254,201, 48, 72,190,121, 21,122,141, 6, 44,163,135,115,167, 47,139,197, 21,130,131,131,121,213,201, 44,103,103,103,169,135,135,
+199,254, 57,115,230,240,212,106, 53,194,194,194,112,255,254,125, 38, 53, 53,117,133,193,162,162, 65, 47, 31, 7,142,195,209, 30,
+ 61, 59,187,116,253,194,142, 95,203,193, 22, 44, 35, 68, 68,172,166,230,149,219, 97,157,206, 93,184, 52,203,206,167, 87,159,212,
+240, 19,207, 43,226,169, 95,191,126, 99,138,162,126, 72, 76, 76, 44, 22, 65,171,130,131,131,191, 47,125,206,199, 26,149, 97, 24,
+112, 56,156,148,130,130,130, 1, 47, 94,188, 8, 43,139,119,120, 0,209,106,245,133,245,130,199,129,254, 90,154,243,137,246,237,
+219,215, 30, 57,114, 36, 2, 2, 2, 16, 18, 18,210,230,200,145, 35, 83,107,212,168,241, 88,171,213,158, 23, 8, 4, 55,138,166,
+165, 87, 25, 60, 96,214,176, 25, 51,104,147,119,239, 96,242,244, 41,134,228,230,114, 86, 2,179,170, 34,176, 2, 3, 3,235,116,
+104, 31,112,180,103,239, 86,222, 14, 14, 62, 60, 46,215, 6, 44,203, 66,171,205,244, 72, 75,123,213,215,220, 28,115, 26, 53,106,
+212,231,209,163, 71, 6, 69,154,109,216,176,161, 61,195, 48,219, 88,150,229, 17, 66, 38, 3,232,114,241,226, 69,232,245,122,116,
+237,218,181, 75, 96, 96, 96, 29,150,101,127, 54, 49, 49, 97, 21, 10,197,168,199,143, 31,167, 84,100,185,202,141,102,231, 39, 19,
+215, 78,158,129,195,144, 76, 46,118,154,222,217,241,130,153, 27, 89,182,240, 39,217,125, 0,232,236,230,102,234,234, 37,153,109,
+ 98,214,192, 42, 55,241,234,236,206,110,110, 59, 47, 68, 71,231, 85,167,195, 82, 84, 15, 86,255,250,235,175, 53,130,131,131, 75,
+226,101,249,251,251,211,171, 87,175,118,250,230,155,111, 54, 0, 24, 97,160,168,246,176,182,182,190,196, 48,140,234,229,203,151,
+ 30,197,251,237,252,122, 55,181, 54,149,180, 75,203,202,187,149,254,242,228, 77, 67,184,130,130,130, 70,242, 40,106,199,250, 5,
+147,104,175, 6,126, 16,219,218, 66,147, 32,131, 92,175,181,122,240,244,101,215,149,235,119,164, 5, 5, 5,141, 13, 9, 9,217,
+109,108,146,141, 48,194,136,127,141,192, 18, 8,248,115, 22,206,155, 77,178, 51,178, 21,202,220, 60,181, 86,169, 84, 82, 60, 86,
+249, 60, 60, 54,149,226,208,217,223, 76,157, 98, 58,231,187,121,115, 0, 12, 49, 84, 92,121,121,121, 61,218,185,115,167,157,149,
+149, 21,114,114,114,144,145,145,129, 71,143, 30,129,101, 89,116,238,220, 89,224,215,160,126,192,186,245, 27,238, 59, 58, 58, 54,
+169, 76,100,113,184, 28,194, 21,139,113,172, 85, 0, 40, 30, 15,125, 34,146, 10,197,133, 86,131, 11, 3,186, 1, 0,104, 62, 31,
+253,163, 10, 39,249, 8,133,194,106,103, 22,203,178, 77,154, 53,107,198, 3,128,233,211,167,231,202,229,242,229,132,144,223,101,
+ 50, 89,162,161,226,202,198,214,246,230,154,101, 99,172,234,215,113,133, 70,171, 69,124,106, 34, 88,194,135,163,157, 4, 67,123,
+249,243,154, 7,241, 93,215,108,190,122,195,190,126,143,150, 41, 47, 78,189, 44, 87, 88, 74, 36,251, 54,108,216,128,195,135, 15,
+ 3, 0,174, 95,191, 14,119,119,119, 73,101,105,120,253,250,181,235,240,225,195, 15, 2,168, 91,214,113,173, 30,156,223,127,255,
+ 29, 0,176,246,219,193,244,230,219,145,181, 69,162, 63,215, 82,110,213,170, 21, 90,181,106, 69, 45, 95,190, 60,248,250,245,235,
+193, 7, 15, 30,212, 56, 57, 57,109, 72, 76, 76, 60, 82,157, 60, 85,220,186, 5,147,167, 79,129,155, 55,171,252,223,192,192,192,
+ 58, 94, 94,214, 15,214,173,253,222,230,204,217,151, 88,179,102, 55,162,163,163, 1, 0,174,174,174, 24, 60,168, 31,247,247,223,
+182,213,155, 51,103,209,189,192,192,192,230,161,161,161,149, 70, 55,103, 24,102,219,183,223,126,251,165,147,147, 19,230,207,159,
+ 31, 89,167, 78, 29,152,153,153, 97,251,246,237,176,180,180,132, 86,171,141, 92,181,106, 21, 71, 38,147, 97,227,198,141,191,148,
+178,110,253, 5,173, 59,182,158, 47,232,238,221,194, 51,112, 24, 76,204, 28,177,243,192, 33,188, 14,221,215, 66,165,121, 53,127,
+249, 36,167,161, 10, 86, 48,220,217,221,116,142, 75, 80, 43,235,186,245,190, 68,173,192, 48, 27,165,254,118,236,130,137,174, 43,
+ 56, 66,229,190,133,107,254,106, 37, 36,253,142,210,245,115, 35,172, 94, 92, 65, 6,203, 46,100,138,132, 85, 73,252, 43, 61,139,
+ 47, 91,182,108, 89, 34,174,222,189,123, 7,149, 74, 5,111,111,111, 74,173, 86, 27, 20,211, 74, 42,149,122,180,108,217,242,206,
+254,253,251,173, 91,180,104,241,193,210, 45, 14,214, 22, 29,111, 30,223, 48,229,135,159,126,243,178,243,233,149, 93, 89, 71, 32,
+ 40, 40,104,100, 3, 79,183, 93, 27, 86,125, 79,232,188,120,112, 44,210, 0,125, 58,146, 14,253, 2, 34,182, 66,215,241,211,209,
+ 48, 56,152,158,242,205,220, 93, 13, 27, 54,100, 31, 63,126,188,199,216, 44, 27, 97,132, 17,255, 10,129,197,176,140,175,189,157,
+181,104,195,154,189,143,105,141, 90, 45,177, 48, 87,115,205,205, 24, 98,106, 78,107,212,218,252, 90,174,181,248, 12,203,248,150,
+ 35, 72,174,126,220,203,118,113,113, 57,190,103,207, 30, 59, 46,151, 11,134, 97, 96,107,107,139,183,111,223, 34, 59, 59, 27,121,
+121,121,136,126,245, 10,181,107,214,192,148,177, 99, 28,151,174, 89,123,156, 16, 18, 84,122,184,240, 99, 78,150, 97,193,232,116,
+ 31,247,230,129, 50,150,140, 41,111, 25, 25, 67,167,148, 50, 12,243, 86, 38,147, 65, 44, 22,195,219,219,219,228,241,227,199,183,
+ 19,139, 77, 72,149,221,123,235,214, 28, 71,129,237,241,213,203, 6, 88,129,138, 68,100, 92, 54,220,156, 27,193,198,162, 6, 18,
+211,242,241, 56,252, 60,162,162,207,193,205,169, 22,198, 14,174,107,177,126,251,221,179, 36,112,156, 91,233,225,194,210,156,121,
+121,121, 38,181,106,213,130,147,147, 19, 24,134,129, 94,175, 71,120,120, 56,244,122,125,201,239,210,159,123,143, 93,131, 46,247,
+ 61,134,125,245, 21, 50, 51, 51, 77, 12,189,247, 98,113,181,125,176,180,158, 60, 43,137, 7, 0, 18, 75, 71,205,216,223, 18, 95,
+ 54,108,216, 16,182,182,182,188,123,247,238, 77, 7,112,164,170,249,169, 1, 86,253,180,103,207,198, 33, 57, 57, 20, 0,236, 34,
+132,209, 20, 70,213, 54,168, 46,181,111,239,119,108,195,134, 5, 54,132, 13,135,149,249, 74, 60,122,244, 30, 26, 77, 97, 85,201,
+200, 72,197,228,137,185,224,112, 76,177,118,221, 34,235,254,253,199, 31, 43, 26, 34, 99, 42, 74, 39,203,178,188,107,215,174, 97,
+208,160, 65, 56,120,240, 32,135,166,105, 60,124,248, 16, 34,145, 8, 35, 70,140, 64,189,122,245, 56, 34,145, 8,119,238,220, 65,
+110,110, 46,169, 40,157, 55, 46,221, 88,150, 19,125,125,126, 50,185,216,105,231,129, 67, 24, 51,104, 0, 28,216,152,219,230,110,
+100, 89,135,238,205,190,103,233, 26,221, 36,166,190,150,238,245,187,131,199, 55,193,164, 89, 75, 16,249,226,140,101, 65,222,179,
+137, 68, 31, 95, 3,192,212,143, 57,217, 35,125,245, 27, 15,220, 11,188, 82,243,113, 45,105,224,184,135, 0,158,253, 41,176, 92,
+ 57,132,210,155, 23, 91, 47,223,188,121,131,232,232,104,112, 56, 28, 40, 20,138, 15, 22,245, 45,205, 25, 16, 16, 48, 78,175,215,
+127, 15, 0,106,181,122,175,189,189,253,200,159,127,254,217,186,120, 9,162,210,150,171,204,236,220,172,123,143, 95,190,158, 62,
+174,111,235, 91, 15, 94,196, 91,248,245,140,203,126,122, 50,167,172,252,108,210,164,137, 37,159,166,119,252,180,122, 33,209,199,
+ 92,131,192,187, 53, 56, 38,238,208,107, 19,161,204,146, 67, 25,155, 4,245,246, 77,112,157,240, 13, 86,175,252,129, 12, 26, 58,
+106,135,155,155,219,241,232, 82, 22,188,255,196,116,111, 35,167,145,211,200,249,121,114,254,235, 4, 22, 33, 84,174, 94,207, 8,
+120,182,118,202, 81,253,219, 53,184,124, 53,228,137,216,198,140,211,177,117, 64,171, 71,207, 99,239, 19,138,104, 9,161, 12,242,
+235,112,118,118, 30,176,112,225,194, 6,102,102,102, 96, 24, 6,230,230,230, 72, 75, 75,131, 90,173, 70, 78, 78, 14, 84,121,185,
+208,228,229,226,105,252, 59, 52,107,213, 26,237,155, 52,246,190,160,213, 14, 0,112,176, 60, 78, 61, 69,179,214, 1,141,208, 47,
+ 38, 3,140, 70,141, 35,174,214, 37, 86,171,129,239,178, 65, 8, 1,163, 81,227, 66,112, 93,240, 77, 36,240,155,185,176,218,153,
+149,148,148, 20, 86,171, 86,173, 11,157, 59,119,238, 60,110,220, 56, 42, 57, 57,249,162,189,189,125,179,148,148,148, 74,135, 71,
+237,178, 44,135, 13, 27,219,160,142,141, 5,133, 51,119, 46,162,177, 87, 47,136, 5, 92,164,101, 43, 64, 64, 16,243,246, 42, 24,
+157, 9,158,190,122,135,166,190, 98,180,108,100,225,156,255, 71,230, 88,148, 63, 92, 70,178,178,178,144,154,154, 10,173, 86, 11,
+173, 86,139,190,253,250,225,215,125,251, 32,151,203,161, 80, 40,160, 86,171,161,215,235, 65, 81, 20,174,156, 61,130,248,216, 87,
+104,218,164, 9, 80, 65,196,111, 46, 13,221,218,111, 7,115, 0,128,111,106,171,201,203,203,131, 68, 34,129, 60, 43,137, 55, 99,
+ 77,137,101,139,119,253,250,117,132,134,134, 66, 42,149, 26, 84,143,202, 66, 52,176,227,173, 94, 63,191,243,137, 19,118,119, 79,
+156, 96, 30,156, 57,147, 32,200,203,219,110,200,127,131,131,253,251, 78,153,220,213, 83, 36, 20, 33, 33,110, 3,188,188,120,152,
+241,141, 53,150,175, 76, 7, 0, 76,153,236,140,134, 65, 54,200,205, 62, 10, 27, 59, 55,204,152,222,211, 45, 63,159,253, 10,192,
+222,138,235, 59,153,252,236,217,179, 72,123,123,123, 78, 88, 88, 24,248,124, 62, 68, 34, 17, 68, 34, 17,132, 66, 33,146,147,147,
+161, 86,171,113,248,240, 97, 93,209, 16, 98,185, 40, 26, 6,236, 60,189,179,227,133,215,161,251, 90, 56,209,177, 79,251, 76,106,
+254,238,217,131,176,188,203, 87,238, 46,213, 41,133,241,217, 9, 87,103,215,105, 24,102, 51,113,230, 98,108, 90,189, 16,175, 31,
+222,202,180,175,153,187, 89, 68, 84,123,131,191, 40,195, 42,214,122, 49,103,226,130,254,186,113,195,251, 88,156,177,191, 55,238,
+ 60,135,164, 37,167,135,174,193,219, 48,133,160,110,192, 80, 15, 87, 74,125,237,218, 53, 81,203,150, 45,161, 84, 22, 46, 25, 71,
+211, 52,246,239,223,207,232,116,186,235,101, 90, 45,181,218,239, 67, 67, 67, 29, 21, 10, 5, 6, 14, 28, 56,101,209,162, 69, 18,
+ 46,151, 91,248,124,233,245, 31, 88,174,150,173,255,245,210,180,239, 55, 95,191,116,112,165,116,217,156,145,173,135, 76,250,225,
+ 58,128,139,101,241,234,116,186,125, 27, 86,126, 71, 11, 44,180, 32, 13, 59, 64,147,162,192,251,157, 99,160,206, 85,194, 99,233,
+ 98, 0,124,168,181, 20,206,245,232, 11,202, 74,138,209, 45,154,113,182,223,186,179, 15, 64, 79, 99,211,108,132, 17, 70,252,255,
+183, 96, 49,204,173, 55,177,239,186,116,104, 31,236,124,246,230,243,199,227, 70,116,237, 72, 81, 20,121, 18,254,254,166, 91, 45,
+ 7,155,235, 55,110,177, 12,195,220, 50,228, 98, 92, 46,183, 91,243,230,205, 57, 89, 89, 89,144, 74,165, 72, 75, 75, 67, 98, 98,
+ 34,180, 90, 45,148, 57,217, 80,231,229, 66,157,155, 3,189, 60, 15,209, 33,143,224, 85,211, 89,112,181,208, 9,254,160, 33,252,
+ 31, 91,168,138, 23,253, 5, 33, 16,152,154, 64, 96, 98, 82,249, 74,240, 31, 65, 42,149,246, 48, 51, 51,155,157,151,151,119, 62,
+ 49, 49,113,153, 90,173,158,248,227,143, 63, 62, 94,178,100,137,205,156, 57,115,204,102,205,154,117,196,197,197,197,191, 50, 63,
+ 36, 83, 43,125,223,198, 13,234,210, 81,239, 95, 32,200,163, 47,106, 75,155, 35, 38, 49, 7,153,121, 42,100,228, 40,224,233, 49,
+ 19, 41, 25, 5,200,145, 43,241,252,245,239,112,114,168, 67,209,220,232, 78, 21, 8, 44,164,164,164,124,112,207, 7, 15, 28, 64,
+ 65, 78, 14,220,220,220,224,237,237, 13, 91, 91, 91,188,127,255, 30,119,238,220,193,144,254, 95,130,203,237,131,212,212,212, 10,
+239,119,111, 24,203,149, 74,165,161, 50,153, 12, 97, 97, 97,136,142,142, 46,115, 88,245,143, 63,254, 40,124,241, 58, 56, 24,156,
+151,246,246,246,223, 81, 20,213, 31, 0, 13, 32,158,146, 74,235,218,218,218,218, 55,235,217, 19, 57, 92, 46,253,243,245,235,132,
+ 99,110,110, 2, 32,187, 50, 46, 51, 51,116, 13, 10,106,206,207,206,218, 13,160,208, 40, 53,114,132, 45, 58,119,178, 7,161, 4,
+144, 58,154,130, 80, 2, 16,194, 71,129,252, 26,124,234,249,242, 76, 77,143,119,171, 72, 96, 21, 59,180,215,171, 87, 15,227,199,
+143,199,201,147, 39,177,119,239,159,167,247,233,211, 7,189,123,247, 70,126,126, 62,236,237,237, 57, 50,153, 44, 38, 48, 48,176,
+ 82,199,119, 51, 55,178, 76,165,121, 53,223,194, 93,146,166,135, 77,211,124,173, 32, 99,225,154,152,133, 0,214,118,118,115,219,
+169, 97,110,197, 70,189, 56, 99,249,246,241,141, 76, 89,148,220,117,231,185,152,114,125,176,110,222, 4, 99,239,123, 83,243,101,
+167, 86,156,158,221,219, 20, 56, 57,219,123,252,188, 89,189, 63,211,201,122,153, 75, 77,231, 33, 11,127,156,173, 25,218,171,133,
+102,246,140,201,220,122, 62,222, 36, 55, 55, 23,135, 14, 29,210, 93,184,112, 33,137, 97,152,105,229,208,210, 69, 66, 11,253,251,
+247,151,136,197, 98,196,199,199,195,203,203, 11, 12, 83,152,183, 73,105, 25,207,239, 62,126, 17, 49,125,124,191, 86,191,159,190,
+254,234,210,141,144, 87, 61, 59, 53,243, 35,132,117, 41, 47,173, 52, 33,141,125,124,125,193,178,137,160,185, 30, 72,216, 63, 18,
+202,140, 60,168,228, 74, 80, 92, 9,212, 90, 26, 26,134, 64,224,219, 8,111, 78,158, 70,221,193,245,192, 33,164,153,177, 89, 54,
+194, 8, 35,254, 63,160, 82,181, 65, 43,213,203,191,157, 61, 31,150,230, 34,243, 70, 1,238, 14,167, 46,222, 12,185,117, 47,228,
+149, 75, 13, 27, 91, 86,171,182, 92,181,110,147, 51, 41, 80, 24,234,228,237,109, 99, 99, 3,141, 70,131, 55,111,222, 32, 33, 33,
+ 1, 26,141, 6, 58,185, 28,170,236,108, 40,179,178,160,151,231,129,167,215, 67,145,150, 10, 75, 33, 31,248,115,134, 97, 69,166,
+202, 63,197, 84, 25,130,139, 16, 2,145,153, 25, 4,166,166,160, 56,180,193,153,227,232,232, 24,232,239,239,127,248,218,181,107,
+193,205,155, 55, 95,234,226,226, 98,158,156,156,252, 62, 37, 37,165,221,234,213,171, 85,182,182,182, 24, 50,100,136,167, 86,171,
+ 29, 86, 25, 23, 79,160,106, 80,211,222, 29, 53,236,191,132,212,166, 49, 50,115, 85, 72,205, 86, 32, 37,163, 0,135,142, 15,192,
+229,243, 3,241,228,206, 87,120,243,112, 36,210,243,205, 32,180,106, 3,128,173, 95, 17,231,189,123,247,176,109,219, 54,108,219,
+182, 13, 91,183,110,197,166, 77,155,144,149,149,133,250,245,235, 35, 46, 46, 14, 23, 46, 92, 64, 82, 82, 18,108,108,108,240,228,
+201, 19,108,223,190, 29,143, 30, 61,170,114, 37, 81, 42,149,224,153, 88,107,214,126, 59, 24,107,191, 29, 12,134, 43,209,148, 18,
+224,134, 87, 54,138, 26,158,212,179,103,131, 36, 11, 11, 31, 95, 95,223,206,253,251,247,119, 13, 14, 14, 46, 57,238,230,230, 86,
+147,195,225, 36, 75,165,210, 93, 82,169,212,191, 98,229,207, 6, 88, 90,121, 67,173,138, 40, 42, 99, 46, 8, 17,162,237, 23,175,
+208,172, 69, 8, 52, 90, 30, 40, 34, 0, 69, 9,161,211,101,192,204,212, 30, 44, 75,234, 87,146,196, 46, 23, 47, 94,196,182,109,
+219,240,246,237,219, 18, 97,217,173, 91,183,201,131, 6, 13, 58,174,215,235,113,246,236, 89,156, 60,121, 18,181,107,215,134,159,
+159, 31, 52, 26, 77,151,202,238,123,225, 79,178,251,191,175,187, 48,144,171,181,244, 23,138, 92,106, 67,110,210, 99, 98,107, 91,
+ 9, 0, 92,136,142,206,179,171,153,187, 66,158,247, 44,206,194, 57,127,101,101, 14,238, 44,187,144, 9,141,138,120,240,251,137,
+139, 57,169, 41, 89,220,128, 6,245, 20,203,151,204,228,185,212,174,187,106,225,236,241, 14,137,185,194,236, 47,166, 92,136, 56,
+126,241, 81,254,208, 17, 99,116,163,198, 78, 82, 94,184,120,229, 4,195, 48, 13,202,155, 65,200, 48, 12,146,146,146,240,242,229,
+ 75,196,196,196, 32, 45, 45, 13,233,233,233,200,203,203, 43, 25, 86, 20,231,229,158,219,180,231,204, 83,137, 72, 36, 14,110,224,
+ 94,243, 97, 88,120,170, 68, 36, 18,187,215,174,233, 65,200, 98,170, 28, 94, 11,161, 72, 8,128, 32,239,197, 45, 40, 51,243,161,
+200,206,135, 50, 43, 31, 42, 13, 13,165,138,130, 66, 77,193,166, 69, 7,228,203,149, 80,102,100,129, 97, 89, 75, 99,179,108,132,
+ 17, 70,252, 43, 44, 88,233,233,145,249,102,182, 62,189,191,153,245,253,133, 3,191,252,108,167, 82, 21,196, 89, 91,154,232, 77,
+196,124,155, 81,227,126, 64, 94,126, 86,175,252, 76,195,103, 61,101,101,101, 33, 54, 54, 22, 34,145, 8, 60, 46, 23,122,133, 2,
+122,133, 28,138,172, 12, 80, 26, 21,120,122, 61,172,196, 34,212,146, 58,192,197,190,114,235, 8,205,232,137,236,202,121, 92, 26,
+218,235, 47,195,130, 23,155,122, 66, 96, 34,129,208,194, 18,205, 78,222, 46, 20, 58, 60, 30,176,176,242, 69,218, 29, 28, 28,108,
+164, 82,233,233, 77,155, 54,241, 50, 50, 50,240,242,229,203,167,239,222,189,203,177,178,178, 50,229,114,185, 76, 84, 84,212,213,
+136,136,136,110,117,234,212, 1,203,178,110,149,241,229,229, 72, 52, 90, 45, 11, 89,234,123, 36, 36,189,132,153, 73, 13,176,116,
+ 13,164,102, 22,128,192, 30, 58, 85, 36,244,218, 66,119, 43,149, 34, 1, 5,106,195,214,237,213,104, 52,208,104, 52,208,106,181,
+ 80,169, 84, 24, 58,116, 40,238,222,187,135,131, 39,255, 64,108,116, 36, 60,107, 59,224,171,175,134,194,223,223, 31,143, 31, 63,
+174,118, 69,105, 50,251,210, 75,145, 72,132,173, 91,183, 66, 44, 22,127, 32,110, 13, 20,171,107,219,181,107, 87, 55, 82, 46,199,
+203,136, 8, 52,234,215, 15, 0,112,231,206,157,146,115, 20, 10, 5, 6, 15, 30,204,143,141,141, 29, 21, 17, 17, 49,202,209,209,
+113, 93, 82, 82,210,140,242, 56,207,157,187,143,241,227,195,145,150, 86,232,135,125,232, 64,189,146, 99,111, 99, 53,232,212,181,
+112,228,202,194,194, 2,235,214,213, 55, 40,157,122,189, 30, 59,118,236, 40, 25, 22, 4, 0, 14,135,211,108,250,244,233,189,203,
+ 58,223,199,199,167, 82,206,233,253,156,133, 79,222,139, 38,154,215,117,169,103,102,227,139, 12,109, 88,253,176,196,164,201,211,
+251, 57,111, 88,119, 36, 65, 41, 34,170,189, 68, 31, 95,131, 35, 84,238, 51, 36,141,209, 23, 54,170, 45, 92, 70,236, 75, 78,203,
+157, 55,105,204, 96,107, 51, 11, 59,249,174, 77,203, 45, 41,154, 98, 79,135,104,178,235,185, 90, 91,244,104,252, 83,254,248,111,
+ 22,132,169,117,241,147, 16,127, 58,178,162, 80, 21, 12,195, 64, 38,147, 33, 45, 45, 13,113,113,113, 72, 79, 79, 47,122,246,211,
+ 75,134, 8,171, 3, 66, 8,212,113,113, 72, 57,185, 11, 14, 67,134,194, 99,201, 18,232, 25, 14,148, 5,122, 28,109,217, 14,185,
+217, 10,168, 25, 2,139,192,166,232,112,246, 54, 8,163, 7, 30,220, 51,182,202, 70, 24, 97,196,191, 67, 96, 1, 64,110, 90,120,
+140,117, 45, 95,153, 92, 33, 23,219,219,217,170,196, 66, 1,147,147,155, 71,135, 61,127,170,201, 79,122,243,186, 10,215,123, 21,
+ 30, 30, 94, 63, 33, 33, 1,113,239,223, 67,167,144,131, 82,169,193, 42, 11,208,190,121, 83, 8, 1, 8, 41, 2, 30,163, 1,135,
+230, 35, 47, 63, 23, 0, 94, 85, 70,202,104,181, 31, 52,234,132, 16, 16,138,130,208,196, 4,124, 83, 9, 4,102,166, 31, 88,180,
+ 12,129, 72, 36,250,125,251,246,237,142, 14, 14, 14, 88,183,110, 29, 28, 29, 29,189,218,183,111, 95,208,170, 85, 43,145,141,141,
+ 13, 60, 60, 60, 16, 20, 20,132,235,215,175,131, 16, 18, 93, 25,159, 78,205, 15,125, 21,171,171,145,147,247, 4, 15,194,126,133,
+ 86,173,133,155,199, 92, 40,180,214,144,216,142,130, 82,125, 26,250,236, 27, 0, 0,190, 89,107, 36, 39,167, 3, 32, 47,170, 82,
+152, 44,203,226,217,179,103, 56,112,234, 38, 28,107,121, 35, 46, 42, 2, 17,215,175,226,174,173, 53, 92,124,234, 65,171,213, 26,
+ 44,136, 12, 61,207,208, 23, 48, 33,100,240,152, 49, 99,144,205,225, 0, 93,187,130, 23, 19, 3,141, 70,131,198,141, 27,163, 97,
+195,134, 0,128,198,141, 27,131,166,105,212,173, 91, 23,214,214,214, 56,118,236,216, 96, 0,101, 10, 44,150,144, 39,140, 62,195,
+203,213,213,181, 68, 96,237,251, 53, 13, 97, 33, 95,128,128,143,141,155,254,140,202, 80,179,102, 77, 36, 39,199,130, 16,182,178,
+252, 60,223,181,107,215, 46,150,150,150, 24, 57,114, 36,132, 66, 33,122,245,234, 5,165, 82,217, 31, 0, 86,172, 88,129,239,190,
+251,174,208, 42,181,112, 33, 22, 45, 90,132,130,130,130,114,135,134,127, 93,239, 43, 77,205,100, 70,217, 59, 56,245,106, 99,227,
+210,160,109,199,246,168,227,222, 22,109, 59,198, 1,192,143, 86,156,119,253, 87,207,175,127,194,166,134,213,238,203, 23,175, 44,
+108,222,170,237,188, 57,227, 44,151,173,216,158, 85,169, 79, 99,206,251,189,121,175,249, 3,214,255,188,237,215,245,223,127, 55,
+ 85, 24,151,166,206, 74,204, 98,243, 77, 4, 28, 19, 55,123, 98, 50,121,214,210, 88,153, 44,102, 6,226, 47, 70, 26, 82,134, 49,
+ 49, 49, 37, 62,123, 74,165, 18,114,185, 28,241,241,241, 37,229,171,144,152,117,154, 52,162,187,159, 92,161, 40,120,248, 60, 42,
+110,254,148, 33, 77,228, 10, 69, 65,212,219,184, 72,150,253,137, 41,167,204,179, 11,228, 5, 86,170, 28, 37,114,158,190,134,117,
+219, 90,208,232, 8, 84,122, 61,178,210,243,160,214, 1, 90,154, 11,231,190, 95, 65, 11, 14,114,211,146, 65, 17, 98,140,135,101,
+132, 17, 70,252,123, 4, 22, 33,132,248, 53,168, 37, 93,189,112,136, 51,163,211,121,166,166,167,232, 56, 28, 1,183,134,185, 34,
+169, 42, 23,211,106,181,103,111,223,190,221,179,121,243,230,130,168,231, 79,161,206,201,129, 58, 39, 27, 92, 70, 7, 43, 81, 16,
+ 40,141, 10, 68,173,134,147, 23, 3,101,158, 8,247, 30,189,214,106,181,218,179, 21, 10, 1,176, 44,163, 43, 20, 88,132,162, 62,
+ 24, 42, 20,152,155, 66, 96, 98, 2,129,169,105,153, 67,136,229,193,222,222, 94,220,185,115,231,118, 1, 1, 1, 96, 89, 22,171,
+ 87,175,134, 70,163,225,107,181,218, 18,139, 81,126,126, 62,142, 30, 61,138, 95,127,253,245,174,185,185,121,165, 83,203, 25,157,
+234,194,181, 59, 79,187, 12,233,213,134,127,229,198, 78,104,213, 12,114,149,102,200, 87,168,144,175,228, 66, 37,232, 8, 66,110,
+131,162, 5,104,234, 95, 23,215,238, 68, 42,245, 90,205,197,170, 10, 33,165, 82,137,248,184,119, 72,136,142,132, 73,110, 50,108,
+205,196, 40,136,137,132,255, 87,195,160, 86,171, 43,189,247,225, 1, 68, 59,189, 62, 56,235, 58, 83,224,153, 88,107,154,204,190,
+ 84,110,168, 8, 19, 19,147, 42, 13, 17,166,167,167,227,204,153, 51,104,220,184, 49, 90,181,106,133,196,196, 68,196,196,196,160,
+ 75,151, 63, 71,217,158, 62,125,138,176,176, 48,184,185, 85,108, 20,204,205,101,207,103,102,190,233,215,163, 71, 15,222,131, 7,
+ 15,192,178, 44,220,221,205, 96,102, 42, 1,161, 4,240,246,182, 3, 80,168,253, 91,183,110, 13,181, 58, 81, 39,151,227,124, 69,
+156,161,161,161, 93, 3, 3, 3,235,104,181,218,200, 86,173, 90,113,222,188,121,131,190,125,251,226,208,161, 67, 0,128, 57,115,
+230, 96,206,156, 57, 31,252, 39, 63, 63, 95, 89, 30,159,103, 3,175,153,117,116,150,173,132, 34,151,218,102, 54,190,168,227,222,
+ 22, 0,240, 69,183,145,168, 83,183, 38,114,211,159,213, 86, 42,222,245,226,113,178, 44,159,109, 76, 12, 23,117,173, 63, 66,153,
+122, 35, 10,128, 33,129,123, 89, 69,212,161,148, 56,238,208,195, 39, 79, 95, 24,215,165,219,151, 92,173, 94,167,171, 95,139,107,
+113,228,196,185,212,196,247,113, 63, 33,238,226,139,146,199,164, 98,129,165,207,205,205,133, 68, 34, 65, 76, 76,140,170,123,247,
+238, 2,133, 66,129, 55,111,222,148, 8, 44, 59, 27, 43,159,102, 13,235,123, 45, 91,255,235, 37,137, 64, 32,232,216, 58,200, 59,
+ 60,234,125, 2,203,146,119,229,242,178,236,131, 55,175, 94,119,181,115,172, 11,217,205, 7, 16, 55,239, 2,149,138,130, 82,205,
+ 64,165, 3,116, 52, 15,230,126,193, 16,185,122,131, 5,240,234,249, 83,232, 88,246,174,177, 89, 54,194, 8, 35,254, 53, 2,203,
+198,198,198, 46, 32, 32,200,109,231, 47,135,193,178, 44, 94,135,173, 65, 86,106, 4, 22,252,120,223,205,217,217,185, 85, 66, 66,
+194, 77, 67,120, 18, 18, 18, 14, 29, 59,118,108,134,175,143, 79, 64,109,103,103, 60,125,247, 22, 60, 86, 15,158, 94, 15, 74,163,
+ 2, 71,175,134,115,125, 61, 40, 98,130,164,164, 92,108,191,120,245, 69, 66, 66,194,161, 10, 95, 14,132, 70,141,238,125, 48,232,
+139,174, 96,181, 26, 92,110,225, 3,161,169, 9, 4, 22, 22,104,122,244, 6, 8, 33, 96,117, 90,188, 95,254, 45,184, 18, 19, 88,
+ 53,169, 60, 20, 80, 74, 74, 74, 65,221,186,117, 67, 34, 34, 34, 26,122,122,122, 98,241,226,197,136,143,143, 7,203,178, 72, 77,
+ 77, 85,166,165,165, 37,102,100,100,188, 35,132,156,144,201,100, 59, 13,137, 20,158,106,153,181,239,202, 31, 87,103, 6,250,251,
+184,127,209,106, 17,206,158, 93,136,172,156, 92, 20,168,185,200, 83,104, 32, 87,176,112, 50,115, 71, 35, 95, 95,164,101,170, 17,
+245, 50, 52, 33,157,103,181,163, 42,214, 43,138,162,240,244,233, 83,184, 74, 77, 17,121,251, 38,108,196, 92,248, 73, 29, 32,109,
+214, 28, 49, 49, 49,134,137, 96, 61, 56,165,103, 11, 90, 88, 88, 32, 39, 39,231, 3, 33, 39, 22,139, 33,149, 74,145,155,155,139,
+163, 71,143,130, 53,236,165,168, 85,171,213,240,242,242,194,227,199,143,113,245,234, 85,180,109,219, 22,173, 90,181,194,179,103,
+207,112,249,242,101,132,133,133,129, 16, 2,107,107,235, 98,223,159,114, 35,218, 63,122,244,244,136,137, 9,153, 59, 98,196,132,
+122, 67,134, 12,193,177, 99, 7, 49,114,132,103,145, 99,187, 0, 95,118,247,196,146,165,143, 17, 28,220, 26,182, 54, 60, 92,185,
+250, 50,150,195, 49,255,213,128,124,252,249,231,159,127,230, 40, 20, 10,228,231,231,195,196,196, 4, 25, 25,133,225,168,202,177,
+ 96,149, 27, 88,237,121,232,171, 53,217,121,108, 22,155, 31,214, 43, 83, 23,214,160,109,199,120,124,209,109, 4,174,156,221,131,
+107,151,174,194,138,243,238, 45, 36,121, 23,210,223,166,231, 38,201,221,183,121, 7,142,166, 19,228,151,182, 77,233, 97, 73, 59,
+ 58, 50, 71,230,108,201,201,174, 32,157, 44, 33,132,100,134,239, 63,125,130,197,151, 77,155, 4,215,173, 95,211,145,159,149,158,
+202, 30, 61,117,225,133,230,237,177, 51,197,194,202,128, 85, 17,150,108,216,176,225,123, 0, 96, 24,102,239,250,245,235, 71,207,
+156, 57,211, 86, 38,147,149, 8,172,212,244,204,107, 77,187, 78,214,103,100,231,168,119,175,159,213, 87, 36, 20,240,231,175,216,
+125, 67, 75,227, 65,185,141, 11,135, 51,108,238,214,223,210,142, 29,217, 67,219, 8,121,184, 59,103, 33,162,175, 94,135,134,226,
+161,227,229,135, 80,107,244,200, 77,203,192,245, 81, 19, 97,225, 96,137,243,233, 81,250,156,188,220, 97,198,102,217, 8, 35,140,
+248,255, 0,131,166,212,165,167,167,167,222,186,245, 16, 55,206, 46,195,205,179,203,240, 50,236, 41,100,137,106, 36,166, 40, 97,
+102,102,118,191, 2,203, 87,251,143, 95, 10, 74,165,178,247,250, 13, 27,146,197, 18, 9, 90,182,107, 7, 7, 91, 59,136,121, 92,
+208, 58, 6, 52,225, 34, 63,205, 2, 81,207, 21, 88,126,226,108,170, 66,169,236,253,241,203,225, 99,206, 82,251, 1, 66, 32, 50,
+ 51, 5,223,196, 4,194,210, 86, 43, 66,192, 51, 53, 3,207,212, 12, 52,143, 95,105, 58, 1,160,160,160,160,207,216,177, 99,179,
+242,242,242, 48,104,208, 32, 60,120,240, 32,236,226,197,139,102, 87,175, 94, 21, 61,127,254,188,174, 76, 38,235,144,152,152,184,
+189, 60,113,245,151,123,191,113, 67,199,234, 52,125, 54,111,221,153,169,208,218,163,123,143,205, 48,227,103, 64,171,211, 3, 44,
+ 11, 39, 91, 19, 52,106,246, 45, 82, 85, 77,113,246,204,217, 44, 70,167,236,243,241,146, 57,165, 57, 89,150,101,173,173,173, 63,
+176,202, 81, 20,133, 27, 55,110,160, 95,223, 62,232,216,171, 39,108,107,187,194,174,125, 23,116, 28, 61, 30,219,183,111, 7, 69,
+ 81,176,178,178,250,192,162, 81, 94,126, 22, 35, 39, 39, 7, 46, 46, 46,120,184,186, 75,189, 11,211,189, 2,106, 70,255, 28, 32,
+126,178,182,222,181,107,215,176,118,237,218,252,200,200,200,117,238,238,238,223, 86,150,159,132,144,121, 63,254,248,163,226,253,
+251,247, 48, 49, 49,129, 78,167,195,221,187,119,177,101,203, 22,172, 93,187, 22, 97, 97, 97,176,182,182, 70,221,186,117, 65, 81,
+ 20,226,226,226, 20,132,144,121, 21,212, 37, 38, 47,143,211,231,242,229, 19, 25,221,187,183,196,238,221,155,224,224,208, 20, 92,
+142, 3, 56, 92, 91, 72, 76,188,176,107,231, 74,116,237, 18,136, 87, 17, 79, 50,243,243, 57,125,110,220,184,161, 51, 32,157,154,
+231,207,159,227,248,241,227, 88,178,100,137,110,241,226,197,200,201,201, 41,177, 96, 21,175,146,190,104,209, 34, 0,128, 74,165,
+ 18,148,199, 57,122,214,243,196,153,203, 94, 44, 73, 73, 78,108,124,243,250,253,193,215, 46, 93, 69,108,212, 53, 92,187,116, 21,
+183,175,221,155,147,146,156,216, 56,160,145, 7,175,247,232, 73, 51,247, 29, 63, 70,155,152, 57, 98,223,241, 99,244,160,201,211,
+126, 8,234,216,118,158, 1,101,196, 2, 96,243, 83, 83,190,251,113,205,207,249, 58,141,146, 90,253,211,102,153, 34, 45,105, 30,
+138,167, 86,150, 99,189, 42,205, 25, 19, 19,179,253,237,219,183,210,183,111,223, 74,223,191,127, 63, 47, 49, 49,177,229,242,229,
+203,211,138, 4, 87,161,192,122,121,234,254,171,219,123,126,180,179,177, 20, 53,109, 88,207,115,221,246,163, 55,226,226, 83,126,
+ 43,142,129, 85, 86, 58,239,223,191,159,165,210,234,198,126, 59,107, 17,155,157,173,134,231,212, 57,208, 9, 76,160,210, 1, 26,
+134,134, 6, 28,132, 45, 91, 7, 83,107, 83,220,101,179, 88, 21, 77,141,137,254,200,201,191,178,250, 89, 29, 24, 57,141,156, 70,
+206,207,147,243, 95,105,193,114,114,114,106,217,227,203,246,104,221,109, 62, 88,150, 69, 68,232, 42,100,165,189,134,147,131, 0,
+ 49,113,185, 77, 0,220, 52,244,130, 73, 73, 73,113,142,142,142,141,151,109,216,120,188, 99,112, 35,111,119, 39, 71,129,133, 75,
+ 45, 72,236,236,144,158,158,134, 7, 33,145,218,173,151,175,189, 80, 40,149, 6, 45,149,195, 48, 12,203, 48, 12,120, 60, 30, 88,
+154,134,207,148, 57, 32, 20, 5,138,203, 41,177,236,128, 16,152, 5, 54, 3,225,114,161, 53,208,103, 72, 38,147, 37, 56, 57, 57,
+245,153, 60,121,242, 31,123,247,238,165, 90,183,110,237,127,250,244,105,230,239,100,118,202,243, 19,225,246, 13,122,181,218,248,
+243,150,163, 1, 65,141,107,185,212,118, 17, 52,117, 54,135, 70,171, 71, 74,106, 6,110,222,123,169,138, 12,127,146,200,106, 52,
+125, 82,195,203,143,226, 14, 0, 90,173, 54,206,217,217,217,126,241,226,197,208,233,116,208,233,116,208,235,245, 72, 79, 79,199,
+253,251,247,209,160, 97, 48,188, 71,140, 66, 90, 90, 26, 54,110,220, 8,103,103,103,252,248,227,143,200,203,203,195,173, 91,183,
+202,205, 87, 46, 13,221,224,193, 69,113,176, 56,208,173,235,214,237, 70,189,122,245,154, 55,214,166,242, 22,110, 44,180,108, 77,
+ 29, 51,152,119, 35,238,198, 17,129, 64,176, 61, 54, 54,182, 66,127, 33, 55, 55, 55,190, 82,169,244,103, 89,150,206,205,205,221,
+160, 84, 42,135, 79,159, 62,221,113,197,138, 21,112,119,119, 71,122,122, 58, 36, 18, 9,220,221,221,145,151,151,135,216,216, 88,
+189, 70,163,217,166,215,235,151,164,164,164,164, 85,196,253,232,209,163, 55, 1, 1, 1,141, 83, 83,182, 30,159, 48,190,163,187,
+ 86, 23,196, 55, 51,107, 1,150,213, 34, 59, 43, 1,192, 51,205,137,147, 87,163,179,179,233,222, 33, 33, 33, 81, 6,245, 56, 40,
+106,252,250,245,235, 81,188, 84, 78, 98, 98, 98,137,233,175, 44, 11,150, 33, 88,119, 36, 65, 9,224,192,234,111,154,126,147,155,
+254,204,221,138,243,238,109,227,250,204,198,117, 71, 18,148,139,191,177, 88,150,254,238,102,100,146,252,210,182,125,199,143,209,
+195,122,245,209, 59,155, 68,205, 17,218,177, 71,219,118,175,212,218,198,250,251,251,215, 32, 36,179, 78,106,198,235,144,145,163,
+199,245, 55,231, 41,206,251, 57,103,184, 81, 53, 3,132, 97, 97, 97,111, 13, 93,211,243,163,186, 31, 41,149, 74, 91,174, 89,179,
+230, 18,128, 15,124,204, 82,211, 51,175, 53,233, 54,137,205,206,206,121,146, 26,126,234,121,101, 92, 33, 33, 33,187,131,130,130,
+240,213,208,145, 59,198,140, 26, 67,215,159, 50, 19,137, 55,174, 1,122, 45,146,111,223,132,200, 68,143,179,233,239,244, 5, 52,
+ 53, 54, 36, 36,196, 24,197,221, 8, 35,140,248,119, 9,172,132,132,132,155,110,174,206,151, 35, 35, 91,118,168,233,108, 91,216,
+235,125, 43, 67, 98,138,234,178,161,195,131, 31,139, 44, 66, 72,208, 57,157,110,192,101, 46,183, 27, 41, 10,197,192, 86, 99,177,
+231,130,130,130,148,198,141, 27,151, 19,123,225,199, 50,247,234,245,250, 4, 67,184, 19, 19, 19,111, 72,165,210,161, 77,155, 54,
+ 93, 33,147,201,142,167,165,165,201,255,110,134,167, 60, 63, 17, 78, 90,183,174, 23,242,240,214, 87, 97, 33, 15,186,177, 44,235,
+ 11,128, 16,138,250,115,177,231,240,202, 23,123, 86, 40, 20,227,230,207,159,191,157,195,225,212, 68, 81,224,208,226, 44,211,104,
+ 52,244,238,221,187,133,106,181,154, 6, 64,120, 60,158,206,196,196, 68,121,247,238, 93,157, 94,175,143,211,106,181,227,202,227,
+221, 27,198,114, 63,222,231,227,227, 35,121,195, 65,126,241,239, 12, 5, 32,147,201, 86, 25,114,191,231,207,159,119,177,180,180,
+236, 64, 8,233,203,178,172, 87, 94, 94,158,234,251,239,191,191,119,253,250,245,220,215,175, 95,119,106,209,162, 5,113,112,112,
+ 64,108,108, 44,155,159,159,127,148,162,168,121, 50,153, 44,198,208,252, 12, 11, 11,139, 33,132,248,201, 11,216,129,166, 38, 23,
+187, 50, 44,252, 0,150, 16, 66,158,231,231,147,243,142,142,174,191, 93,185,114,196,224,169,112, 69,107, 11,246, 40,254, 29, 24,
+ 24,120,254,245,235,215, 93,138, 45, 88, 31,251, 96, 85, 9,226,252,211, 74,197,187, 62,196,164,224,196,186,159, 18,148, 0,176,
+112,125,118, 14,128, 93, 83,122, 89, 49,175, 66,119,173,114, 50,139,154,245,211,137, 76,131,214,228, 11, 8, 8,112,165, 40,106,
+ 0,128,250,118,130,236,186,182,252, 28, 61, 33,108, 27, 66, 40, 27, 0,207,124,124,124,206, 2, 72,168, 78, 82,101, 50, 89, 36,
+128, 90, 31,239, 79,125,121,234, 62,128,251, 85,225, 10, 9, 9,217,221,164, 73,147, 83,155,119,108,219, 71, 19,210,152,232,245,
+ 22,250,241,131,254, 92,236, 89,192, 31, 22, 98, 92,236,217, 8, 35,140,248, 55, 10, 44, 0,136,142, 73,232, 8, 0,238,238,238,
+236,155, 55,111,192,178, 44,249, 59, 23, 46, 18, 80, 7, 97, 96, 16,209,242,240,226,197,139,128,255,100, 6,201,100,178, 3, 0,
+ 14,124, 74, 78,182,112,168,106,119,209, 86, 45, 36, 38, 38, 62, 7, 16,252,223,168, 36,225,225,225,242,225, 1,164,196,178,197,
+165,161, 51,244,191, 29, 58,116,120,175,209,104,174, 2,136, 39,132, 88, 0,200,212,104, 52,151,210,210,210, 82, 28, 28, 28,130,
+222,191,127,191,160,200, 18,185, 52, 57, 57, 57,164,154,117,137, 1,240,123,209,246, 73, 17, 26, 26,218, 85, 42,149,134, 89, 91,
+ 91,187, 41,149, 74,190, 82,169,228,149,214,254, 34,145, 40,205, 80, 46, 11, 83,178,151,199,201,178,182, 48, 37,127, 41,119, 43,
+ 39, 28, 83,200, 95,120, 90, 57,225, 88, 85,196,165,191,191,255,126,138,162,106,179, 44,107, 15,176,230, 44,139, 52,150,101,211,
+ 57, 28, 78, 98,120,120,120,226,231,210,208,220, 47, 20, 80,221,140, 77,174, 17, 70, 24, 97, 20, 88,229, 32, 42, 42,138, 24,179,
+237,223,135,178, 44, 91,134,160, 40,194,253,189,162,237, 3, 20, 9,170,238,159,251,189,203,100,178, 79, 34,226, 71,207,122,158,
+ 8, 96, 90, 80, 25,243, 44, 22,110,204,204, 3, 48,179,205,151, 85,227,124,242,228, 73, 28,128, 56, 99, 13, 53,194, 8, 35,140,
+248,188, 64, 25,179,192, 8, 35,140, 48,194, 8, 35,140, 48,226,211,130, 0, 40,115, 38, 64, 85, 86,202,174,206,108,130,202,248,
+141,156, 70, 78, 35,167,145,211,200,105,228, 52,114,254,255,227,252,215,160,120,218,249,127, 98, 3,208,222,200,105,228, 52,114,
+ 26, 57,141,156, 70, 78, 35,167,145,243,223,182, 25,135, 8,141, 48,194, 8, 35,140, 48,194, 8, 35, 62, 49,202,117,114,119,117,
+173,225, 67,233,153,102, 44, 75,209, 44,197,106, 73,174,226, 80,116,102,230, 7, 65, 0,107,214,172,105,193,165,208,157,176,172,
+132, 16, 70,207,208,212,221,152,152,248,112, 67, 46,236,227,227,195, 3, 48,156,203,229, 54,215,106,181,142, 28, 14, 39, 73,169,
+ 84,222,225,114,185,123,195,195,195, 53,159, 83, 38, 53,111,222,124,208,209,163, 71, 45,186,117,235,166,210,104, 52, 58,129, 64,
+192,249,253,247,223, 5, 35, 70,140,200,190,115,231, 78,181,102, 24,250,251,251,183, 93,189,122,117,157,182,109,219,162,121,243,
+230,242, 46, 93,186,240,130,130,130,120, 51,103,206,140,125,242,228,201,181,170,112,217,219,219,251,112, 56,156, 95, 9, 33, 52,
+203,178, 95, 21,205, 48,252,143,128, 16, 50, 8, 64, 63, 0,142, 0,146, 1, 28,102, 89,246, 64, 53,185, 58,161,208,201,221,183,
+104,215, 51, 0,103, 88,150,189,248, 55,210,215, 9, 64,119,154,166,253, 1, 64,175,215, 63,249, 84,156, 92, 46,215, 15, 0,180,
+ 90,237,211, 79,197, 73, 8,241, 43,178, 36, 87,139, 51, 48, 48,240,123, 62,159, 63, 6, 0,212,106,245,110, 19, 19,147,229,101,
+157,119,243,230, 77,117,121,161, 79,124,234, 16, 54,124,150, 87,225,247, 85, 17, 0,128, 74,127,199, 86,115, 22,241,118,111,182,
+ 44, 94,140,123, 85,237,201, 51, 82,169,244,235, 46, 93,186,204,190,120,241,226, 15, 9, 9, 9, 59, 96,132, 17, 70, 24,241,185,
+ 10, 44, 87,215, 26, 62,125,123,246,254,113,252,184, 9,132,166, 41,188,138,136,224, 76,156,242, 77, 7,111,111,111, 39,137, 82,
+233,205, 2,140, 66, 36,122, 65,211, 84,226,214,205, 63,155,122,122,120,232,245,122, 6,219,182,111,237,236,234, 90, 99,110,101,
+ 34,203,206,206,174,142,163,163,227,134, 41, 83,166,216,117,232,208,129,178,183,183, 71, 66, 66,130,217,137, 19, 39,234,254,242,
+203, 47,221,236,236,236,166,165,166,166,198, 86,231,134, 28, 29, 29, 91,216, 89,160,131,137,144,109,135, 92,130,124, 61,254, 72,
+ 85,225,114, 82, 82,210,237,234,102,146, 90,173,158, 92, 80, 80, 16,236,237,237,205,110,219,182,141,140, 25, 51,134, 37,132, 16,
+133, 66,177, 23,213, 12,225, 32, 22,139, 55,183,109,219,214,189, 89,179,102, 49,247,238,221,235,194,178,236,249,190,125,251,186,
+138,197,226, 40, 0, 30, 85,225,162,105,122, 79,120,120,184,159, 82,169, 68, 96, 96,224, 47, 0, 2,255, 67,226,234, 23,107,107,
+107,102,235,214,173,219, 27, 52,104,224, 38,151,203, 11, 70,143, 30,221,145, 16,210,150,101,217, 81, 85,224,145, 0,216,104,110,
+110,206, 91,182,108,217,131,214,173, 91,199,241,249,124,113,100,100, 36, 59,101,202,148,145,132,144,190, 0,166,176, 44, 43,175,
+ 42,167, 84, 42, 53, 91,185,114,229,235,128,128,128,123,124, 62,159,247,246,237, 91, 76,157, 58,117,252,223,225,244,242,242, 18,
+175, 92,185,242,169,183,183,119,134, 80, 40,228,189,127,255, 30,211,167, 79, 31, 77,211,116, 95,134, 97,170,197,105,103,103, 39,
+ 89,190,124,249,243,160,160,160,108,161, 80,200,139,142,142,102,191,249,230,155, 49, 85, 73,103,171, 86,173, 6, 82, 20,181,248,
+214,173, 91, 0,128, 38, 77,154,124,175, 86,171,231,127,124, 30,203,178,104,222,188,185,178, 85,171, 86, 99,110,222,188, 89,102,
+ 88,148,125,130, 89,131, 0, 96,230,247, 69,191,139,246,151,245,123,152,106, 85,149,235,188, 79, 29,194, 2,192,196,111,183, 12,
+ 45,252, 44,220,191,181, 40,116,239,230, 58,132,173,138,104,115,114,114, 26,215,168, 81,163,239, 30, 62,124,184, 47, 40, 40,104,
+234,142, 29, 59,184,221,186,117, 91, 38,149, 74,221, 58,117,234,212,247,254,253,251,171, 35, 34, 34, 54, 27,155,120, 35,140, 48,
+226,179, 18, 88,148,158,105, 54,126,220, 4, 50, 96,208,192,228,164,148, 84,198,196,212,124,208,225, 35, 71,196, 30, 30, 30,148,
+242,231,159,161, 75, 75,131,126,198,140,166, 55,111,222,212, 78,154, 54, 67,161, 82, 22,236,113,180,183, 19, 31, 58,112,208,225,
+248,177,163,205, 0,132, 87,100,185,114,116,116,220,112,236,216, 49,135, 58,117,234, 64,173, 86, 35, 35, 35, 3, 90,173, 22,189,
+122,245,162, 27, 55,110,236, 48,114,228,200, 13, 62, 62, 62,189,171, 98,201,178,181,181,181,119,175,201, 61,187,112, 90,103,143,
+182,173, 2, 37, 14, 78,181,129, 4, 6,137,177,111, 26, 94,125, 24, 58,165,185,155,115,100, 84,174,186, 91, 90, 90, 90, 74, 85,
+ 51, 41, 35, 35, 99,214,184,113,227,142,249,250,250,218, 10, 4, 2, 56, 56, 56,144,209,163, 71,167, 38, 37, 37, 45,254, 27, 98,
+165, 48,175, 41, 74, 95,250,211,208, 5,169, 63,130,179,185,185, 57,204,205,205, 1,192,233,239, 84,136,126,253,250,209,113,113,
+113, 99, 24,134,241, 46,189, 63, 41, 41,201,213,214,214, 54,229,237,219,119,126, 10,181, 38,104,194,164,185,139, 6,244,109,111,
+113,239,222, 61,116,237,218,149, 34,132, 12,170,130, 37,107, 99,112,112,112,212,138, 21, 43,120, 81, 49,111,235, 61,120,252, 4,
+ 18, 33, 79,239,236,236, 36,120,246,236, 25,127,229,202,149, 41, 63,252,240,195, 70, 0, 35,171,144,244,141,253,250,245,203,154,
+ 54,109, 90, 65,100,244,219,218, 15,195,158,179, 38, 2,158,214,222,222,150,190,119,239, 30,119,243,230,205,100,222,188,121, 85,
+230, 28, 61,122,116,210,180,105,211, 56,105, 25,217,117,147, 83,210, 89, 62,143,214, 88, 88, 88,112,174, 92,185, 66,237,217,179,
+ 71, 51,101,202,148, 42,115,118,237,218, 53,101,206,156, 57,220,136,168, 24,215, 7,161,207, 97, 34,224,106, 29, 28,236,232, 7,
+ 15, 30,208, 27, 55,110,212, 45, 92,184,208, 32, 78,150,101,183,173, 89,179, 6,167, 78,157, 2, 0, 28, 56,112, 0,174,174,174,
+ 31, 12,251, 43,148, 42, 80, 4,120,251,246,173,120,252,248,241,219, 80, 70,220,185,240, 89, 94,216, 7, 96,216,176, 97,201,134,
+ 89,161, 86, 85,173, 82,109,247,102,139,133,213,132, 9, 19,202,139,205, 53,212,167, 10, 34,171, 89,179,102,179, 15, 29, 58,100,
+115,228,200,145,111, 79,156, 56, 81,220,105, 17,111,218,180,233,235, 30, 61,122, 96,212,168, 81,179, 1, 24, 5,150, 17, 70, 24,
+241,121, 9, 44,150,165,104,154,166,144,154,146,174,253,162,125,135,145,155,182,108, 17,240,249,124,168,213,106,200,175, 93, 3,
+171, 84,194, 66, 44, 70,151, 46, 93,184,245,235,215, 55, 27, 55,122,244,232,148,100,217,118,154,166, 28, 88,150,162, 43,185,230,
+240, 41, 83,166,216,213,169, 83,231,131,157,122,189, 30,153,153,153, 48, 53, 53, 69,255,254,253,109,246,239,223, 63, 28,128, 65,
+230,126,123,123,123, 23, 15, 87,251,187, 71,119,205,112,180,179,160,128,180,163,192,251, 55,192,239, 66,184,219,213,132,123,155,
+214,146, 30,141, 26, 4,244, 95,189, 59,204,222,222,190, 89, 74, 74,202,187,170,100,210,219,183,111,239, 72,165,210,209, 10,133,
+226, 20, 0,234,238,221,187,108, 92, 92,220,184,228,228,228,247,213,205,120,134, 97,144,157,157, 13,134, 97,232,162,223,197,159,
+255, 88,101,232,215,175, 31, 29, 31, 31, 63,206,219,219,187,238,206,157, 59,145,154,154, 10,145, 72, 4,189, 94,143,166, 77,155,
+214,108,215,174, 93,116, 90, 70,182,165, 86,167, 85, 39, 37, 68, 55, 58,184,227, 93,129,159,187,251,189,195,135, 15, 55,176,182,
+182,238,111,136, 53,143, 16,210,201,212,212,148,243,227,143, 63, 82,166, 22, 14, 93, 27, 5, 75,185,207,195, 95,191,227, 9, 56,
+ 76, 78, 78,110,198,211,167, 79, 35, 22, 46, 92,216,226,244,233,211,201,132,144, 78,134, 12,153, 17, 66, 58, 57, 56, 56,152, 78,
+157, 58, 85, 46, 50,181,105,222, 48,216,142,243, 34,252, 77, 34,151, 71,105,155, 53,107,214,230,254,253,251,123,102,204,152,225,
+123,238,220,185,156,170,112,214,173, 91, 87, 52,109,218, 52,218,220,194,166,189,173,131,148,182,181,178,112, 3,128,152,152,152,
+253, 41, 41, 41, 81, 19, 38, 76,104,120,238,220,185,188,170,112,218,216,216,136,231,204,153,195,169,237,234,217,199,213,221,147,
+186,122,227,225,115, 62,159,210, 42, 20,138,204, 87,175, 94,189,153, 61,123,118,208,185,115,231,114, 13,225, 44, 40, 40, 48,117,
+114,114,130,189,189, 61, 24,133, 2, 57, 57, 57, 56,126,252, 56,242,242,242,160,215,235, 33, 18,137,240,195,186,237,136,126,241,
+ 0,183,111,223,134, 66,161, 48,253, 20,245,196,103, 85, 4,194,199, 25, 46,174,182, 50,147,134, 86, 32,172, 80, 74,120, 13,197,
+118,111,182,162,225,194, 82,150,171,132, 35, 71,142,216,185,185,185,161,117,235,214, 0,128,145, 35, 71,162,125,251,246, 56,117,
+234, 20, 46, 95,190, 28,215,164, 73,147, 55,241,241,241,107, 19, 19, 19,183, 27,155,122, 35,140, 48,226,191,141, 50,157,220, 89,
+ 66,228, 47, 95,189,226,154, 88, 88, 12,221,180,101,139,128,203,229,226,253,251,247, 8, 15, 15, 71,193, 31,127, 64,113,239, 30,
+ 82, 82, 82,144,159,159, 15, 91, 91, 91, 44, 95,181, 74,194, 19, 73, 70, 70,189,121, 67,179, 20,171, 45,213,195,254,203, 84, 77,
+ 62,159,223,188, 75,151, 46,229, 58,215, 39, 39, 39,163, 67,135, 14, 28, 14,135,211,188,156, 94,251,213,143, 94, 90, 68,106, 75,
+206, 28,217, 49,213,209,142,243, 28,120, 51, 29,200, 11, 3, 88, 21,160, 83, 3,113, 17,192,201,117,112,202,136, 34, 7, 38,247,
+119,112, 18,241,206,144,143,204, 68,149, 77, 41,117,118,118,118,117,117,117,221,213,183,111, 95, 10, 0,154, 55,111, 78, 92, 93,
+ 93,119, 56, 59, 59,187, 86, 96, 93,168,144, 83,169, 84, 62,200,202,202, 66,183,110,221,172,155, 54,109,122,181, 91,183,110,214,
+197,251,171,203, 89, 4,235,182,109,219,102,184,186,186, 30,112,113,113, 17, 24, 96, 5, 41,225,140,139,139, 27,227,229,229, 85,
+119,231,206,157, 52, 77,211,216,185,115, 39, 14, 29, 58,132, 59,119,238, 32, 53, 53, 85, 60,125,250,116,139,179, 87, 31, 92,188,
+123,231,209,233, 53,243,191,181,238,213,174,181,171,101, 78, 90,174,149,149, 85, 23, 0, 14, 6,166,179,251,252,249,243,111, 62,
+121, 21, 99, 71,113,184, 60, 1,143, 43,178,181,177,168,229, 96,107, 89,215,201,218,178,174, 41,159,107,145,155,155, 27,123,242,
+228, 73, 29, 74, 5, 33,173,140,115,245,234,213,175, 34, 98,226,173, 41,154,195,229,210, 92,190,133,185,137,245,151,221, 58,180,
+ 1, 0, 17, 77, 4,185,185,185,241,251,247,239,175, 18,231,138, 21, 43, 66,147,210,178,236,184, 60, 62, 71,192,227, 10,139, 15,
+ 88,154,153,216, 75, 4, 2, 81, 65, 65,193,251, 93,187,118,169,171,200,249,244,101,212,123, 27, 66,129,166, 64,184,150,150,166,
+118,182, 22,166, 14,118,102, 38, 14, 66, 10,194,220,220,220,119, 7, 14, 28,208, 24,202,153,154,154,138,136,136, 8,212,104,216,
+ 16, 87,175, 94, 69,205,154, 53,209,191,127,127, 12, 28, 56, 16, 34,145, 8,109,155, 52,192,220,185,115, 17, 29, 29, 93,110,185,
+ 23,251, 67, 85, 4,169, 84,122,163, 42,117, 9, 40, 28, 22,172, 72, 92,125,204, 89,214,121, 31,115, 54,107,214,108,246,241,227,
+199,109,214,175, 95,239,255,205, 55,223,196, 28, 63,126, 28,190,190,190,120,245,234, 21,156,156,156,112,240,224, 65, 76,154, 52,
+ 41,102,209,162, 69,254, 87,174, 92,145, 74,165,210, 89,213,124,142,170, 4, 35,167,145,211,200,105,132, 65, 22, 44, 45,131, 51,
+147,167, 78,239,126,236,248,113, 49,159,207,199,219,183,111,145,154,154,138,115,103,206,232,207, 55,104, 80, 64,211, 52,219,251,
+216, 49,211,254, 3, 7, 18, 46,151,139,186,117,235,162, 75,151, 46,162,209, 99, 39,164,114,228,138, 67,149, 20,138,157,173,173,
+ 45,190,251,238, 59, 44, 95,254,161, 63,238,240,225,195,177, 97,195, 6,152,154,154,130, 16, 98,103,200, 13, 56, 58, 58,246, 27,
+ 57,179,141,179, 89, 45,179, 20, 54,108, 31,151,208, 98, 43,208, 98,128,226, 1, 34, 17,160, 85, 3,106, 10,170,199,119, 50,217,
+ 54,155,115, 59, 6,228, 57, 37,171, 15,246, 3,112,216,208, 76,178,177,177, 89,112,244,232, 81,219,153, 51,103,178,121,121,121,
+ 36, 37, 37,133,157, 61,123,182,237,252,249,243, 23, 0, 24, 86,157,140,151,201,100, 75, 71,142, 28,217,113,247,238,221,246,125,
+250,244, 49, 47,234,129,167,200,100,178,165,127,167, 64,185, 92, 46,125,237,218, 53,171,109,219,182, 13, 92,182,108, 89,189,118,
+237,218, 57,100,103,103,191, 75, 74, 74,234, 91,153,197,141, 97, 24,239,157, 59,119,130,166, 11,141,144, 20, 69,129,207,231,131,
+207,231,195,220,220, 60, 59, 38, 38, 70,239, 98, 47,226,203, 83,146,114, 44, 57,150, 92,226,232, 96,109,225,224,216, 90, 46,151,
+223, 1, 32, 49, 48,137,190,173, 91,183, 14,191,118,255,133,126,194,240,182,117,197, 60,138,107, 42, 18,210, 34, 62,151, 16,150,
+213,107,180,234, 38,155,247, 93,223, 93,187,118,237, 96, 0, 6, 13, 17, 19, 66,252,124,125,125,111,221, 15,139,196,211,151, 49,
+ 9,182, 86, 98,235, 78,109,155,121,150, 92,176, 81,227,129,165, 78, 55,104,105, 27, 14,135,227,215,160, 65,131,228,184,164, 76,
+216,217,152,127, 32,164, 45,109,236,218, 3,128, 60, 39,103,179,163,163,163, 71,209,122,144, 6,165, 51, 40, 40, 40,237, 78, 72,
+ 36, 28,108,173,172,138,118,155,149, 62, 39, 61, 41,105,155,139,139,139, 7, 33,196,217, 16,206,147, 39, 79, 34, 52, 52, 20, 75,
+235,213,195, 76, 23, 23,216,218,218,226,143, 63,254, 0,203,178, 48, 49, 49, 65,118,118, 54, 14, 31, 62,140,118,237,218,253,237,
+198, 66, 42,149,222,144,201,100,173, 75, 28,211, 63, 1,138, 57, 13,181,142,221,185,115,231,248,145, 35, 71,190,118,115,115,195,
+136, 17, 35, 92,247,236,217, 19,227,233,233,233,218,188,121,115,220,185,115, 7,179,102,205,138, 89,180,104,145,235,240,225,195,
+177,119,239, 94, 36, 38, 38,254,102,108,230,141, 48,194,136,207, 70, 96,197,197,197,101,123,123,123, 59,185,185,185, 81,106,181,
+ 26, 57, 57, 57,184,116,225,130,254,224,225,195,231,212,106,245, 20,138,162,120,123,127,253,117,155,131,163, 99,155,222,125,250,
+ 16,173, 86,139,246,237,219,243,175, 93,187,102,253, 44, 46, 46,175,162, 11,210, 52, 93, 98, 61,250,250,235,175,177,126,253,122,
+ 0,192, 87, 95,125,245,167,192,211,106, 13,246, 69, 18,153, 48, 93, 90,181,175,111, 22, 47,249,217, 76,211, 84,155,239, 18,109,
+250, 64,146, 47, 10, 2,197,231, 64, 36, 4,163, 22,234,162,178,219,135, 68,191,173,237, 35, 82,166,214,110,230, 25,140, 67, 15,
+ 78,116,169,138,192, 18,137, 68,141,196, 98, 49, 34, 34, 34, 50, 3, 3, 3,179,205,204,204,204,221,221,221,109, 68, 34, 81,163,
+234,102,124, 74, 74,202, 91, 39, 39,167,150,189,123,247,158, 68, 81, 84,123,134, 97,174,102,100,100,108, 74, 73, 73,121,107,200,
+255,157,156,156, 38,176, 44,187, 16,192,209,226,125,106,181, 26, 20, 69,129,101, 89,116,239,222, 29, 43, 86,172,240,185,122,245,
+ 42,110,221,186,101, 53,120,240,224, 7, 82,169, 52,155, 16, 50, 42, 49, 49,177, 92, 43, 89, 70, 70, 6,182,109,219, 6, 14,135,
+ 3, 11, 11, 11,152,154,154, 66, 40, 20,162,117,235,214, 41,107,214,172,113, 63,112,224,128, 54, 59, 53,149,136,242,114, 84,196,
+218, 90, 8,105,205, 78, 67,251, 15,120, 0,224,136,161,247,110, 98, 98, 34,226, 67,149, 71,233,149,212,234, 69,155, 57, 98, 30,
+143, 8,121, 28, 8,152, 2,122,238,138,101,172,144,176,220,226, 33, 83, 67, 33, 20, 10,249, 18, 62,171,226, 10, 40,173,152, 98,
+ 63,201, 56, 43,135,195, 17, 8,184, 80,148,119,156, 71, 17,154, 16, 34, 2,160,170, 74, 58, 77,248,250,114,207, 23, 82,160, 41,
+138, 18,150,199,217,175, 30, 97,143, 76, 42, 22, 56, 37, 70, 53,232,116, 58, 52,106,212, 8, 7, 79, 93,199,249, 63,238, 33,253,
+253, 51, 76,153, 48, 18,238,238,238,184,116,233, 82,133,105, 42,246,193, 50,160, 83, 80, 40,136,190, 55,175,252,228, 34,191,171,
+202,134, 6, 75,115,250,172,138,168,112,118,162,179,179,243, 88,127,127,255, 97, 39, 78,156, 64,155, 54,109,208,173, 91, 55,120,
+122,122,186, 14, 30, 60, 24, 0,208,178,101, 75, 44, 88,176,192,117,224,192,129, 56,121,242, 36,206,159, 63,143,160,160,160,169,
+ 82,169, 52, 85, 38,147,109, 49, 54,247, 70, 24, 97,196, 63, 46,176, 0, 64,160,209,120,170,182,109,131,252,234, 85,240, 47, 95,
+198, 89, 63,191,124,157, 78, 55, 67, 38,147,197, 3,128,189,189,253,180,195, 71,142,220,109,255,199, 31,102,234,136, 8, 56, 63,
+127, 14,142,135,135,191,161, 23, 46,182, 94,169,213,106, 0,192,175,191,254,138,156,156, 28,228,228,228, 64,167, 51,120, 45, 97,
+112,249,104,110,103, 93, 19, 73,136, 2,195,161, 76,222,121, 22, 52, 54, 81,154,202,156,226,236,229, 57, 60, 15, 68, 36,212,147,
+ 40,178, 85,141, 9,173,134, 50,189, 0,206,205,221,193, 65,217,195,143,229,129,162,168,226,151, 99,102,104,104,104,247,230,205,
+155,159, 1, 96, 83,188,191,186, 72, 76, 76,124, 3, 96, 74,117,254, 75,211,244,194,219,183,111,219, 29, 62,124,120,210, 79, 63,
+253,196,150, 22, 88,197,223, 57, 28, 14, 88,150,133, 68, 34, 1,135,195,177, 63,121,242,164,253,151, 95,126,185, 25, 64,185,229,
+ 36, 22,139, 97,103,103, 7, 62,159, 15, 83, 83, 83,200,115,179, 36, 91,127,156,223, 90,108,105,111, 53,101,234, 12,106,236,216,
+177,225, 27, 54,108,168,225,224,233,233,253,226,197,139,183,189, 6, 12,188,119,234,212, 41, 69, 21, 28,220,159, 69, 68, 68,208,
+238,110, 46, 60, 70,171, 96, 36, 60, 64,248,244, 39,134,111,234, 0, 33, 77,131, 67,192,138,196, 18,187,248,164,164, 56, 0, 73,
+134, 16,178, 44,251,244,221,187,119,196, 89,106,207,201,147, 43,179, 37, 28,134, 31,251,248,209,171, 58, 13, 27,121, 3,128,242,
+241,189, 19, 2,207,122,166,178,220, 60,145,147,147, 83,140, 33,156, 58,157,238,105, 66, 66, 2,177,178,178,226, 70, 69,189,249,
+205,218,204, 84,106,101,111,223, 26, 0,212,153,105,183,136, 66, 41,227,114,185, 78,105, 25, 25, 73, 58,157, 46,206,208,116,198,
+198,198, 18,103,169, 61,231,204,185,243, 7, 29, 36, 98, 71, 11,145,192, 92, 72,129, 8, 89, 38,135,175,211, 37,139,196, 18,105,
+ 66, 98, 98, 10,203,178,229,250, 9,110,101, 38, 13, 45,252,246,203,254,143,172, 59,184, 30, 18, 11,115, 90, 15,174, 86,142, 7,
+199, 15,163,247,228,111, 12,122,158, 86, 47, 25,126, 96,245,146,225,229,134,103,248, 72, 16, 65, 54,238,111,182, 60,219,189,111,
+252,133, 83, 86,177,131,123,167, 78,157,230,237,216,177, 67, 92,252,251,213,171, 87,104,222,188,240, 81, 94,188,120, 49, 58,118,
+236, 8, 63, 63, 63,188,122,245, 10,181,106,213,194,241,227,199, 65,211, 52,119,236,216,177,179, 1, 24, 5,150, 17, 70, 24,241,
+ 95, 69,185, 10,129, 97, 89, 70,151,153, 9, 86, 85,216,145,230,241,120, 44,203,178, 37,141, 27,151,203, 21,155,155,155, 19,174,
+179, 51,136,160,200,213,135, 16,253, 39,176, 26, 64,175, 55,156, 70,175, 7, 13,162, 1,139, 63, 67,252,200,133, 4, 63,216,180,
+195, 20,201, 55, 72,230,155,151,126,195,129,213, 49,208,163,106,214, 17, 66, 8, 43,151,203,161, 82,169, 44,221,220,220,206, 41,
+149, 74,203,162, 23, 38,251, 79, 21,156, 78,167,139,225,112, 56, 24, 62,124, 56, 80,184,228, 17,212,106, 53,158, 60,121, 2,149,
+ 74, 5,181, 90,141,187,119,239, 34, 39, 39, 7,106,181, 26, 87,174, 92, 65,173, 90,181,192,225,112, 28, 43,226,101, 24, 6,182,
+182,182,176,183,183,135, 74,158, 43, 57,182, 99, 67,215, 85,139,190,179, 25,228,198, 82,191,108, 92,203,184,185,185,101,213,175,
+ 95,223, 74, 36, 18,101, 5, 6, 6,102,159, 60,121,242,116, 85, 66, 52, 0, 56, 51,103,206, 28,223,224,224, 96, 23, 11, 19,137,
+ 70,192,167, 33,208,201, 89,129, 42,131,229, 40,210,217, 90,206, 46, 26, 72, 76, 26,245,233,211, 71, 15,224,140,161,156, 83,166,
+ 76,169,233,237,237,109, 99, 97, 38,201,229, 80, 72,228,233,245,137, 89, 33,247,174, 0, 0,207,198, 78, 1,137, 73,163,193,131,
+ 7,107,171,194, 57, 99,198, 12, 55, 39, 39, 39,107,138, 34,217, 58,141,230,125, 73,125, 80, 42, 82,104,129, 80, 14,129,176,197,
+168, 81,163,116, 85, 76,167,171,175,175,175,181,165,185, 89, 54,151, 34,113, 60,189, 46, 94,196,234, 19,248, 90, 77,154,192,206,
+ 62, 31, 18,147,102,131, 6, 13, 42, 55,157,197,214,171,143, 45, 67, 28, 14, 7,137,137,137, 40,144, 61, 3, 47, 49, 2,126, 38,
+ 92, 52,118,176,129, 68, 34,169, 92, 96,141,123, 69,194, 99, 89, 18, 30,203, 18,140,123, 69,202,250, 93,134,200,170,176,238, 87,
+232,215,181,221,251, 70,117, 56,207,159, 63,191,178, 71,143, 30,218, 1, 3, 6,224,202,149, 43, 32,132,224,206,157, 59, 72, 76,
+ 76, 68,199,142, 29,193,178, 44,158, 60,121, 82, 34,190,250,246,237,139,110,221,186, 21, 92,188,120,241, 7, 99, 83,111,132, 17,
+ 70,124, 54, 2, 75, 43, 16,188,100, 38, 79,134,197,233,211,224, 70, 69,161,111,239,222,102, 2,129, 96,163,163,163, 99,160, 84,
+ 42,109, 38, 18,137, 54,207,152, 62,221,212,102,249,114, 72,111,221, 66,242,213,171,208,114,185,143,171,114,113,133, 66, 81, 44,
+ 96,160, 42, 18,114, 22, 22, 22, 85, 18, 88,140, 14,247,147,210,162,192,135, 11, 24,176,249, 23,115, 91, 62, 28, 20, 51,223,238,
+108,110, 29,247, 55,114,158,251, 18,219,198,118, 27,107, 53,127, 40, 39,156,124,190,133, 16,178, 68, 25,244, 96,238, 87, 37,157,
+ 74,165, 50, 71, 46,151,163,110,221,186,214,161,161,161,110,238,238,238, 86, 69,130,230,209,223,201,124,169, 84,218, 36, 32, 32,
+224, 72, 96, 96,224,219,128,128,128, 35, 82,169,180, 73, 21,254,254,203,227,199,143, 65,211, 52,198,142, 29,139,188,188, 60,104,
+ 52, 26,100,100,100, 32, 46, 46, 14,106,181, 26, 9, 9, 9,120,253,250, 53,212,106, 53,222,189,123, 87,146,199, 21, 65,171,213,
+194,212,212, 20,217, 25,169,146, 67, 91,215,118, 93,182,104,158, 40, 39, 58, 20, 9,178, 20, 48,122,133,108,193,130, 5, 49,110,
+110,110,119, 84, 42,149,151, 78,167,235,194,178,236,161, 42, 8, 85, 10,192, 19,119,119,247, 14,107,214,172,105,190, 96,197, 46,
+129, 41,157,199,242, 77, 5, 12,223,148,207,242,189, 26, 99,244,194, 77,194,117,235, 86,223, 15, 9, 9,201, 49,112,102, 30, 5,
+224, 73, 96, 96, 96,147,228,228,228,230,126,126,126,254, 14,117, 61,132, 2, 39,105, 58, 95, 90, 43,131, 85, 20, 92,165,106,214,
+238,190,103,207,158,219,183,110,221, 74,169, 10,167,189,189,125,243,109,219,182, 5,212,172, 89,179,161,208,220, 92,148,159,157,
+189, 67,149,157,185,139,107,227, 32,162,172,109,250, 29, 59,118,236,143,115,231,206,101, 84,133,211,211,211,179,217,242,229,203,
+253, 2, 2, 2, 2, 29, 61, 60,133, 34, 39,231, 52,158, 83,173, 84,145,111,144,144,170,229,218,119,215,174, 93,215,239,222,189,
+155,110,104,192, 81,138,162,192,229,114, 33,145, 72,112,243,230, 77, 12,234,221, 9, 14,118,102,240,240,244, 68,235,113,147,113,
+238,220, 57,240,249,124,252, 93,107,235,199, 48, 68, 16, 85, 85,124, 85,198, 41,147,201,182,132,132,132,252,212,191,127,127,180,
+111,223, 30, 79,159, 62,197,172, 89,179, 98,206,157, 59, 7, 0,120,250,244, 41,150, 45, 91, 22,115,255,254,125,140, 24, 49, 2,
+205,155, 55,199,147, 39, 79,246, 25,131,143, 26, 97,132, 17,159,141,192,114,179,178, 50, 85, 42, 11, 18,110,221,186,165,161, 40,
+ 10, 98,177, 24,253, 6, 12,160,126,252,241,199, 22, 61,253,252,174, 13,110,210,228,194,225, 67,135, 2,252, 3, 2, 10,215,219,
+161, 40,156, 58,117, 74,145,147,147,157, 81,179,102, 77, 11, 67, 47,158,150,150, 86,210,251, 86, 40, 20, 96, 89, 22,166,166,166,
+ 85, 18, 88,138,124,234,234,237,155,225, 89,172,254,235,184, 46,111,214,107, 86, 36,247, 12,206,102,244,156, 28,189, 22, 57, 10,
+ 22,121, 74,112, 30, 82, 86,193,195,221,123,105, 98,219, 7,191,126,248, 54, 44, 67,205,170,171, 52,251, 33, 43, 43,107,222,132,
+ 9, 19, 50,236,237,237,137,169,169, 41,236,237,237,169,209,163, 71,167,199,199,199, 47,169,110,198,251,248,248, 12,108,210,164,
+201,153,176,176,176,190,135, 15, 31,118, 57,114,228, 72,223, 38, 77,154,156,241,241,241, 25,104, 32,197,225,149, 43, 87,202,249,
+124, 62, 26, 55,110,140,188,188, 60,168,213,234, 74,183, 74, 5, 43,195, 64, 40, 20,226,200,174, 13, 29,150, 45,154, 39,202,140,
+120,136,103,119,174,224,226, 91, 85,193,194, 21, 63, 61, 16, 10,133,213,186, 95,119, 59, 73,131, 6, 82,211, 87,223,140, 28, 32,
+155, 51,123,182,249,243,231,207,197,211,191,153,198,202,210,178, 89, 97,215,117, 52,213,122, 1,245, 82,105, 67,122,116,107,139,
+ 31, 22,207,234, 0, 3,134, 78,125,236, 36, 13,234, 75, 77,195,191, 29, 59, 40,102,202,148, 41,226,149, 43, 87, 22, 52,111,222,
+ 60, 59, 39, 39, 71,100,110,239, 24, 32,176,179, 15,150,101,101, 75,154, 54,107,246,100,228,200,145,242,170,114, 46, 88,176, 64,
+114,251,246,109, 65,167, 78,157,242,114,115,115, 37, 66, 19,147, 96,158,153, 69,203,180,156, 28,179,206,157, 59,135,245,239,223,
+ 95, 91, 29,206,215,175, 95, 11,154, 54,109,154,151,147,147, 35, 49,179,119,108, 36,180,115,104,145,152,153,101,218,184, 73,147,
+176, 49, 99,198,168, 43,226,236,183,233, 79,113, 34, 22,139, 51,189,189,189, 49,127,254,124, 44, 94,188, 24,253,250,245, 67,236,
+219, 88,180, 26, 49, 22,117,134,143,199,153,251, 15,145,152,152,136,185,115,231,194,221,221, 29, 20, 69, 37,125,202,198,163, 34,
+ 65, 84,158, 35,188, 79, 29,114,163, 34, 63,171,202, 68, 86,135, 14, 29, 70,244,232,209, 3,167, 78,157, 42,113,104, 31, 50,100,
+ 8, 0,192,223,223, 31, 51,102,204,112, 93,179,102, 77,204,186,117,235,208,164, 73, 19, 56, 59, 59,127,105,108,230,141, 48,194,
+136,127, 2,101,199,193, 50, 19, 13,216,177,101,179,249,164,105, 51,228,222,222,222,150, 14, 14, 14, 32,132,160, 83,167, 78,164,
+201,197,139,166, 92,169, 20,214, 13, 26,148, 44,104,120,251,214, 45, 92,187,118, 77,190,127,247, 47, 78, 35, 71,143,238, 14,148,
+239, 51, 91,122, 88, 45, 35, 35, 3, 14, 14, 14, 37,179,213,100, 50, 25, 28, 28, 28,192,227,241, 64,211, 52,167,104,233,151, 10,
+213,150,131,131,195,175, 43,150,189,156,147,224, 59,163, 78,176,152, 34, 23,228,201,208,179, 44,184, 68, 15, 40, 88,104,245,128,
+ 74,203, 34,168, 54,109,245,135, 26,150, 15, 95, 94,142,117,112,112,248,181, 42,153, 20, 19, 19,115,221,209,209,113, 92, 65, 65,
+193, 81, 0,212,131, 7, 15,152,183,111,223, 78, 52,212, 33,189, 44,136, 68,162, 89, 71,143, 30,181, 90,178,100, 73,214,181,107,
+215,114,218,182,109,107,190, 98,197, 10,171,129, 3, 7,206, 66, 25,193, 32,203,120, 17, 41,164, 82,233,190,164,164,164,137, 13,
+ 27, 54, 68,102,102, 38, 52, 26, 13, 66, 67, 67,225,238,238,142,144,144, 16,120,120,120,224,241,227,199,240,244,244,132, 94,175,
+135, 82,169,132,222, 0,245, 42,139,127,111, 34, 86,101,153,201, 30, 94, 64,228,243, 80,156,143, 81, 21,172,222,125,232,124, 3,
+255, 32,121,241, 12,195,170,192,211, 94, 82,207,201,206,250,242,138,197,223,219,189,187,126, 8,199,119,111, 98,174,159, 63, 95,
+ 95,100,134, 97,205, 6, 76, 29,168,209,194, 5, 4,130,150,205,154,162,187, 85,164,158, 87, 3, 41,127,188,172, 56,146,185,167,
+189,164,158,212,214,250,210,234,229, 75, 76,163, 47,238,197,225,237,235,216,163,191, 30, 8, 80, 2,245,220,220,220,186,211, 52,
+109, 15, 64,161,215,235,163, 97,224, 18, 52,101,113,254,113,246,108,160, 18,168,231,236,236,220,157,203,229,214, 0,160,210,106,
+181,239, 63, 5,103,221,186,117,187, 19, 66,156, 0, 40,139,124,174,170,180, 84, 78,251,246,237, 87,239,218,181,107,186, 74,165,
+178, 42,101,109, 37,167, 78,157,130, 70,163, 33, 60, 30,143,145, 72, 36,136,139,139, 99, 1, 36,177, 44, 59,254, 83, 53, 28,125,
+250,244,193,131, 7, 15, 22, 3, 88, 88,209,121,153,153,153, 28, 43, 43, 43, 93,101,194,203, 80,206,135, 15, 31,174, 28, 51,102,
+204,204,139, 23, 47, 38, 44, 90,180,200,127,248,240,225, 56,121,242, 36,106,214,172,137,215,175, 95, 99,250,244,233, 32,132,184,
+174, 89,179,230,201,193,131, 7, 29,147,147,147,215, 26,155,121, 35,140, 48,226,179,177, 96, 17,134,112,221,235,214,213,171, 11,
+242,247,140, 30, 49,162,224,229,203,151,208,235,245,208,233,116, 80, 62,122, 4,249,197,139,208,235,245, 96, 89, 22, 15, 31, 60,
+192,148,201,147,243,149, 5,249,187,106,215,118, 97, 9,203,150, 76,215, 39,132,180,255,152, 91, 93,202,140,162, 80, 40,160, 80,
+ 40,192,225,112, 96,106,106,138,212,212, 84,240,249,124,136, 68, 34,248,249,249, 81,206,206,206,221,254,146,182,143, 56, 67, 67,
+ 67,181,200, 85,245, 61, 53,124,106,146,115,129,142, 29,103, 81, 27,181,120,162,146, 89,136, 14,102, 4, 95,250,113, 97,207, 75,
+103,159,237, 29, 36, 35,186,156,190,161,161,161,218,138, 56, 63,134, 84, 42,245,240,241,241,217,210,167, 79, 31, 10, 0, 90,180,
+104, 65,213,171, 87,239,103,169, 84, 90,238,146, 54,149,113, 10,133, 66, 1, 0, 92,189,122, 53,243,246,237,219,157,174, 94,189,
+154, 89,122,191, 33,156, 20, 69,237,216,186,117, 43,196, 98, 49,116, 58, 29,212,106,117,137,255, 85,233, 79,141, 70, 3, 27, 27,
+ 27,252,241,199, 31, 96, 24,230, 92,101,233,244,174,239,155,159,195,177, 72,217,119,230, 26, 46,188,211,228, 87, 85, 92,149,230,
+172,235,104,226,233, 96, 99,125,101,245,143, 75,109,179,222,132, 34, 33, 33,129,189,116,241,220,125, 5,203, 38,102,228,176, 63,
+100,230,177, 62,249, 74, 86, 28, 84, 27,241,231,126,158,206,126,219, 4, 58, 16,176, 21,113,214,115, 52,241,116,178,181,190,180,
+118,245,143,166,217,111, 66,145,148,156,140,243,231,206, 60, 81,176,108, 34,203,178, 23, 89,150,157,160,211,233, 26,233,116,186,
+ 70, 44,203, 78, 40, 79,180, 84,149, 83,163,209, 4,107, 52,154,224, 79,201,201, 48, 76, 48,195, 48, 6,115,254, 57,131, 16,152,
+ 63,127,254,163, 91,183,110,245,127,244,232, 81,187,226,237,197,139, 23,109, 99, 99, 99,219, 38, 36, 36,180,137,157, 37,160,159,
+ 63,127,206,121,252,248, 49,247,241,227,199, 53, 67, 66, 66, 46, 26, 90, 63, 43,120, 22, 74,139,252, 69, 50,153,140,148,201, 57,
+238, 21,217,188,230,235,253, 71,142, 28,177,255,100,156, 0, 34, 34, 34, 54,239,218,181,171,150,147,147,147,227,192,129, 3,177,
+119,239, 94,236,218,181, 11, 64, 97, 36,251, 82,150, 43,187,144,144,144, 58,101, 5, 25,173,238,189, 27, 90,231,141,156, 70, 78,
+ 35,167, 17,229, 11, 44,194,232,245,122, 6,118,246,118,166,105,169,169,155, 38, 76, 24,159,177,100,201, 18,229,205,155, 55,161,
+142,136,128, 50, 44, 12, 87,174, 92,193,212,169, 83, 11,198,142, 27,151,164, 44,200,223,224, 96,111,103,163,215, 51, 32,132,169,
+208, 66, 66, 81, 84, 76, 84, 84, 84,113,111, 27,155, 54,109,210,105, 52, 26,152,154, 22, 6,153,222,185,115, 39,195,178, 44,218,
+181,107, 39,225,114,185, 6, 45, 65,146,152,152,248, 44, 55, 78,214,241,216,128,241,209,175, 14,157,206,242,205,208, 96,136, 72,
+138, 1,129,128,143,105, 28, 18, 31,254,146,117,111, 75,207,232,130,204,248, 78,137,137,137,207,170,154, 73,246,246,246, 11,127,
+255,253,119,187,208,208, 80, 86,165, 82, 33, 49, 49,145,157, 53,107,150,157,189,189,253,194,234,102, 60,203,178, 36, 59, 59, 27,
+132, 16,166,168,178, 50,197,251, 13,229, 72, 72, 72,120,113,228,200,145, 83,215,175, 95,135,179,179,115,137,200,250, 88, 96,113,
+ 56, 28, 16, 66,176,117,235,214,108, 66,200,119,149,241, 10, 4, 2,236, 60,122,241,194,183, 91,143, 31, 62,124,245,209,241,234,
+ 90,174, 0,128, 79, 81,139, 86, 46,253,222, 46,253,213, 3,242,226,254, 53,230,208,211,164, 20,157,158,157, 84,230,201,121, 50,
+182,168, 82, 86,236,219, 67,209,139, 86,254,184,196,188,120,248,242,247, 80, 89, 46,209,179,147,255,222,147,240, 63,194,249, 15,
+162,112,166,159,140, 72,165, 82, 28, 59,118,172,202, 62, 88, 62,117,200, 95,156,219,171,203, 41,147,201, 86,125,241,197, 23,178,
+ 69,139, 22,109, 81, 42,149,242,162,206,155,102,237,218,181,107, 38, 77,154,148,146,152,152,104,180, 92, 25, 97,132, 17,255, 40,
+202, 28, 34,100,104,234,238,182,237, 91, 59, 31, 58,112,208,129,166, 41,135,216,216,183,143,191, 26, 53, 42,241,214,173, 91, 86,
+220,186,117, 27, 81, 20,197,168,231,204,185,159,159,155,147,249,235,158,221,181,106,215,118,241, 43, 90,236,153,101,104,234,110,
+ 69, 23,204,204,204,220, 59,109,218,180, 70,251,246,237,227,173, 90,181, 74,158,152,152,120,249,193,131, 7,157,183,108,217, 34,
+220,185,115,103, 65, 94, 94,222,233,243,231,207,247,104,211,166,141, 78,173, 86, 23, 24,122, 35, 41, 41, 41,225,132, 16,111,106,
+237,174,193,175,183,254,254, 5, 75,147,102, 80,241, 64, 88,221, 93, 74, 39,191,146, 34,147,253,206,178,172,174, 58,153, 36, 18,
+137,252, 68, 34, 17,222,188,121,147,213,168, 81, 35, 53,159,207,231,185,184,184, 88,139, 68, 34,191,191, 33,176,216,172,172, 44,
+176, 44,203, 1, 64, 24,134,225, 20,237,175, 82, 12, 39, 30,143, 55,112,228,200,145,167,182,108,217,210,161,125,251,246,112,117,
+117,133, 86,171,133,135,135, 7,212,106, 53,220,221,221,161, 82,169,176, 97,195, 6,228,231,231, 79, 79, 76, 76,204,170,140, 83,
+ 40, 20,130,207,231,195,211,187,126,129, 80, 40, 68,117,197, 21, 0, 72,184,148,235,235,179,187,145,154,145,206, 28,126,154,146,
+ 82,160,209,119,140, 74,149,191,252,248,188, 2, 61,228,109, 70, 76, 73, 4, 0, 21,131,252, 10, 57,249,112,141, 60,183, 19, 41,
+169,233, 56, 20,150,148, 45,215, 48,157, 94,151,193, 89,165,116,254,143,112,246,219, 20,129,214, 95, 27,126,238,145,113,159,166,
+161, 40,109, 85, 50, 20,225,177, 44,193,118,111, 22,219, 55,149, 25,227,170, 58,156,165, 58, 85,219, 1,108, 7, 0,103,103,231,
+232, 41, 83,166,204, 76, 76, 76, 92, 95, 20,239,106,161,177,105, 55,194, 8, 35, 62, 75,129, 21, 19, 19, 31,238,234, 90, 99,238,
+241, 99, 71,155,177, 44, 69,179,132,200, 1,234,204,203,151, 47,179, 75,159,231,102,101,101, 58,114,204,200, 1,132, 33, 92, 66,
+ 24, 61, 67, 83,119, 99, 98,226,195, 43,105, 24,159, 15, 27, 54,108, 83,155, 54,109, 70,233,245,250, 85, 81, 81, 81,151, 61, 61,
+ 61,159,116,234,212,233, 91,157, 78,183, 38, 58, 58,250,178,151,151,215,149, 67,135, 14,205,210,235,245,223, 87, 81,180,232, 80,
+232,255,181,239, 83,102, 18, 69, 81, 75, 88,150, 53, 23,137, 68, 57, 33, 33, 33, 7, 90,182,108, 57,136,101, 89,115,138,162,114,
+170,203,169, 86,171, 39,231,229,229,217, 12, 28, 56, 80, 75, 8,241,236,213,171,215,156,168,168, 40,174, 92, 46,143,169, 10,207,
+187,119,239, 84, 46, 46, 46, 61,190,254,250,235, 93, 60, 30,175, 29, 10, 67, 54,176,165,242, 4, 44,203, 66,175,215,159,150,201,
+100, 21,230, 11,151,203,205,239,220,185,179, 73,165, 86, 41, 62, 63,223,208,244,229,169,245,211,182, 94,123,185, 92,169,101, 89,
+ 29,195,142,123,157, 34, 47,115, 10,217,163,215,108, 61,131, 57,149,204,180,141,151,194,151,171,180, 12,163, 99,216,241,229,113,
+ 86, 5,255, 43,156, 0, 48,129,218,180, 31,219, 55,149, 56,188, 23, 15, 27,126,252,251, 63,133, 34,139, 19, 11,160,242,197,206,
+139, 44, 86,149,173, 93, 88, 37,206,143, 80, 52, 75,208, 56, 83,208, 8, 35,140,248,188, 80,252, 2,254, 79,108, 0,218, 27, 57,
+141,156, 70, 78, 35,167,145,211,200,105,228, 52,114,254,219, 54,202, 40, 49,141, 48,194, 8, 35,140, 48,194, 8, 35, 62, 45, 8,
+128,246,229, 88,182, 12,142, 21, 85,157,217, 4,149,241, 27, 57,141,156, 70, 78, 35,167,145,211,200,105,228,252,255,199,249,175,
+129,113,136,208,200,105,228, 52,114, 26, 57,141,156, 70, 78, 35,167,113,136,208, 56, 68,104,132, 17, 70, 24, 97,132, 17, 70, 24,
+241, 89,195, 40,176,170, 1, 66,200, 87,132,144,139,132,144, 23,132,144, 75,132,144,175,254, 6,151,136, 16, 50,167, 20,223, 5,
+ 66,200, 44, 66,136,192,152,211,159,117, 29,160,141,185, 96, 68,117, 81, 20,188, 56,180,162, 96,197, 70, 24, 97,196,255, 54, 56,
+229, 29,112,115,115,187, 71, 81, 84,157,226, 69, 98,139, 35,163, 23,127,255,248, 55, 0,176, 44, 27, 27, 30, 30,222,180, 60,206,
+ 58,117,234,148,112, 22,111,132, 16,104,181, 90, 83,154,166,243,202,226,212,235,245, 9,175, 95,191, 14,250,140, 94,172,251,173,
+172,172,152,109,219,182,109,246,245,245,173,155,151,151, 87, 48,102,204,152, 46,132,144,246, 44,203, 14,173, 34, 87,125, 66,200,
+175, 13, 27, 54, 60, 62,105,210,164, 35, 62, 62, 62,102, 10,133,130,127,224,192, 1,135,109,219,182,221, 38,132,140,100, 89, 54,
+220, 88, 77, 63, 31, 56, 58, 58, 6, 16, 66, 54,185,187,187, 7, 73,165,210,199, 0, 38,202,100,178,167,198,156,249,175, 62,131,
+163,249,124,126, 39,119,119,247, 70, 42,149, 42, 43, 54, 54,246,145, 94,175,255,158,101,217,228, 79,196,111, 14,224,123,129, 64,
+ 16,236,230,230, 86, 35, 42, 42, 42, 94,163,209, 60, 4,176,132,101,217,156, 79, 33,174,130,131,131,239,252,248,227,143,214,223,
+125,247,221, 29,169, 84,218, 92, 38,147, 69, 26, 75,214,136,127, 2, 53,107,214,180,144,203,229,187, 56, 28, 78,128, 64, 32,112,
+ 48, 49, 49,129,137,137, 73,178, 64, 32,120, 34, 22,139, 71,157, 59,119, 46,219,152, 75,159, 88, 96,209, 52,237,252,232,209, 35,
+187,226,197,151, 25,134, 1,195, 48, 96, 89,182,228,179, 24, 69,113,150,208,166, 77, 27, 77,133, 23,227,112,106,132,134,134,218,
+153,152,252, 25,106, 73,163,209,192,215,215,151, 9, 11, 11,179,251,120, 33, 97,181, 90,141,192,192, 64,246,115,201, 44, 66,200,
+ 16,107,107,107,249,251,247,113, 45,149, 42, 77,240,152,201,223,205, 29,210,247, 11,203,187,119,239,162,123,247,238, 52, 33,228,
+ 43,150,101,127, 53,144, 75, 68, 8,249,101,238,220,185, 43,185,124,177,221,177,115,119,232, 13, 59,246,191,247,247,168, 77,166,
+ 76,153,104, 50,105,210,164,199, 62, 62, 62,187, 9, 33, 45, 88,150, 85, 25,171,234,103, 81,254,156, 26, 53,106,156, 90,190,124,
+185, 83,114, 82, 18,214,173, 95,223, 24,192, 22, 0,141,141,185,243, 95, 43,131, 57,139, 23, 47, 94, 62,120,240, 96,232,245,122,
+ 40, 20, 10,233,155, 55,111,234,205,159, 63,191, 23, 33,164, 17,203,178, 49,127,147,223,214,221,221, 61, 98,218,180,105, 86,141,
+ 26, 53, 2, 69, 81,200,201,201,145,222,190,125,187,241, 47,191,252,242, 21, 33,196,139,101,217,180,191,115, 13, 75, 75,203,223,
+214,172, 89, 99, 45, 16, 8,176,103,207, 30,235,254,253,251,223,150, 74,165, 45,170, 43,178, 8, 33,148,181,181,245, 20, 0,109,
+ 25,134,225, 3,120,152,149,149,181,140,101, 89,141,177,198, 24, 81, 17,108,108,108, 70,231,229,229,109, 22,139,197, 60, 51, 51,
+ 51,136,197, 98,112,185, 92,240,249,252,154,150,150,150, 53, 77, 76, 76,186, 12, 26, 52,104,226,129, 3, 7,118, 25,115,235, 19,
+ 10, 44,138,162, 32, 18,137,112,248,240, 97,208, 52, 13, 46,151, 11, 46,151, 11, 30,143, 87,230,247,154, 53,107, 26,210, 16, 0,
+ 0,206,156, 57, 3, 51, 51, 51,152,155,155,195,203,203, 11,132, 16, 8, 4, 2,252,241,199, 31,224,114,185,224,112, 56,224,114,
+185, 8, 10, 10,250,192, 82,246,223, 64,191,122,132, 5,202, 14,222,216,181,158, 9,186, 79,254,177, 79,129, 82,211, 14,128, 60,
+ 59, 43, 43,235,241,241,227, 50,127, 15, 15,222,225,195,135,253,172,172,172, 6, 1, 48,116, 33,233,169,141, 27, 55, 62,205,242,
+ 36,246,195,134,143, 24, 54,138, 67,105,190, 26,247,237, 15,241, 73,233,242,177, 99,199, 30, 63,125,250,244,176,141, 27, 55, 70,
+ 77,156, 56,113, 10,128, 85,134,166,223,197,197,229, 30, 77,211,197,150, 71,217,155, 55,111, 2, 62,147, 23,163, 20,192,106, 0,
+ 90, 0, 43, 89,150,141, 40,117,204,131,199,227,173,210,104, 52,153, 0, 22,178, 44, 27,255, 57, 62, 44, 78, 78, 78, 94, 67,135,
+ 14,181,201, 76, 79,199,186,245,235,139,119, 7, 25,178, 40,249,167, 70, 96, 96, 96, 29,161, 80,184, 26, 64,128, 74,165,114, 2,
+ 0,145, 72,148,200,178,236, 9,133, 66, 49, 47, 52, 52, 84, 81,205,114,170, 1,160, 30, 10,103, 24,151, 5,118,249,242,229, 81,
+115,230,204,137,249,111,115, 18, 66, 92,236,237,237,127,236,215,175, 31,206,157, 59,135,243,231,207,107, 69, 34, 17,103,248,240,
+225,100,226,196,137,150,211,166, 77,235, 2,224,167,191,153,181, 93, 22, 47, 94,108,229,237,237,141,163, 71,143,226,217,179,103,
+ 10,119,119,119, 81,235,214,173,193,225,112,172,230,206,157,219, 25,192,222,191,115,129,172,172,172,101, 75,151, 46,221,183,105,
+211, 38,211,216,216, 88, 44, 89,178,196,102,210,164, 73, 55,165, 82,105, 43, 67, 69, 86,145, 11,193, 20, 0,109,104,154,110, 49,
+124,248,112,221,228,201,147,185, 20, 69,105,215,175, 95,111,251,203, 47,191, 12,176,177,177, 9, 72, 79, 79,207,135, 17,168,192,
+144,160, 97, 24,134, 11, 64,200,178,172,170,178,223,255,159,238,221,218,218,122, 66, 86, 86,214, 22,169, 84, 10, 91, 91,219,146,
+119, 45,195, 48,144,203,229, 80, 40, 20,168, 83,167, 14,207,219,219,123,231,164, 73,147,184,155, 54,109,218,106,172, 49,159, 72,
+ 96, 17, 66,192, 48, 12,184, 92,238, 7, 2,171, 88,252,124,252,189,204, 86,243,163,169,154, 20, 69,145,252,252,252, 18,113,101,
+102,102, 86, 98, 9,211,106,181,127,225,213,235,245,160, 40,138,173,136,179,156,180, 79, 0,240, 7,203,178,209,134,100, 66,105,
+206, 35,147,188,176, 79, 48,107, 80,113,200,243, 46,223, 22,126,238, 3,112,245,205,184, 85,171,154, 53,171, 49,101,193,198, 69,
+138, 12, 89,250,220,161,221, 93,220, 29,172, 69,146,236,212, 28, 75, 79,207,238, 0, 82,170,144,206,230, 99,199,142, 61,122,252,
+234, 75,161, 80,200,227,113,104,154,219,188,129,135,117, 13,115,218,220, 20, 48,143,143,137,186,247,213, 87, 95,141,153, 56,113,
+162, 85,177,192, 50,228,222,185, 92,174,243,195,135, 15,237, 56, 28, 14,154, 53,107,166,175,202,189,127, 42,148,195, 57, 63, 37,
+ 37,101,160, 82,169, 68, 80, 80,208,151,132,144, 54, 44,203, 62, 33,132, 52,232,209,163,199,237, 35, 71,142,152,134,133,133,161,
+113,227,198, 34, 0,253,255,193,116,254, 5, 82,169,244, 50,128, 47,104,154,134, 90,169, 84,175, 94,251,193, 50,119, 33,165,197,
+213,127, 35,157,254,254,254, 94, 98,177,248,222,218,181,107,205,124,124,124, 8,151,203,133, 78,167, 67, 84, 84, 84,141,253,251,
+247,143,123,252,248,113,231,192,192, 64,159,143, 23, 53, 55,240,222,235,221,190,125, 91,238,234,234, 90,102,221,201,205,205,229,
+120,120,120,180, 2, 16,243, 15,112, 38,164,164,164,244,252,226,139, 47,198, 39, 39, 39, 71,232,116,186,217, 0,234,219,216,216,
+132,245,238,221, 27, 34,145,168,141, 33, 2,171,162, 50,178,179,179,235,209,180,105, 83,108,218,180, 9, 43, 87,174,108,207,178,
+236, 31,132,144,118,185,185,185, 87,191,252,242, 75, 88, 88, 88,244, 44, 75, 96, 85,161, 46,121, 52,106,212,104,231,244,233,211,
+ 77,207,157, 59, 7,119,119,119,228,228,228, 96,196,136, 17,118, 27, 55,110,188, 33,149, 74, 91, 23,139,172,242, 56, 9, 33, 62,
+ 2,129, 96,239,129, 3, 7, 76, 92, 93, 93, 93,121, 60, 30,229,234,234,138,204,204, 76, 40,149, 74,193, 15, 63,252,208, 64, 36,
+ 18, 61,253,233,167,159,246, 2,232,253, 79, 62, 71,132,144, 28, 0,102, 0, 44,170, 50,188, 90,193,189,231, 0, 16,148,106,239,
+ 32, 20, 10, 33, 20, 10, 33, 16, 8, 16, 27, 27,123,140,166,233, 17, 69, 29,185, 74, 57,201,159, 61,120, 63, 66,200, 35,154,166,
+ 43,252,253,241, 82,102,255, 68,187, 68, 8,113, 38,132,108, 0,208, 6,133,126,212, 55,237,236,236,166, 38, 39, 39,191, 55,148,
+ 83, 42,149, 90,231,231,231,255, 36,149, 74, 97,103,103, 87, 44, 54, 17, 20, 20, 4,165, 82,137,151, 47, 95,130, 97, 24, 68, 71,
+ 71,195,204,204, 12, 13, 26, 52,248,105,241,226,197, 71, 23, 46, 92,152,241,159,188,247,127,141,192, 42, 86,178, 28, 14,231, 3,
+129,245,241, 86, 44,134, 8, 33,149, 46, 84, 76, 8,161,212,106,117,137,184, 50, 55, 55, 47,249,175, 78,167, 43, 83, 96, 85, 83,
+153,251, 50, 12, 83,135, 16,178,221, 80,145,245, 49,134, 13, 27,246, 23,127,142, 57,115,230, 36,164,167,167, 51,125, 58,250, 73,
+ 34, 46,200,146,220, 44, 77, 68,182,166,166,181,133,150, 86, 22,249,249,249,183, 0,152, 84,225, 18, 78,222,222,222,230,155,247,
+ 93,144,141,249,102,249,210, 32, 87,107, 51, 95,103, 27, 75, 7,115, 17,223,132, 34,114,161, 78,155, 32,145, 72,124, 0,100, 84,
+ 37,221, 20, 69,193,204,204, 12,167, 79,159, 70,177,255,220,103, 2, 75,133, 66,129,172,172, 44,108,219,182,205,108,252,248,241,
+215, 9, 33, 83,123,246,236,185,233,200,145, 35,146,236,236,108,104, 52, 26, 0, 80,124,134,207,201, 82, 75, 75,203,150,109,218,
+180,225, 31, 60,124,152,207,178,172, 28,133,203, 17,229,179,108, 57, 11, 87,255, 7, 33, 20, 10,191, 93,182,108,153,153,143,143,
+ 15,201,200,200, 0,195, 48,160, 40, 10, 54, 54, 54,152, 57,115,166,112,254,252,249, 78,175, 95,191,158,139,106, 44, 59, 3,128,
+148, 39,132, 0,192,204,204, 76,135,170, 79,142, 41,147, 83,167,211,145,102,205,154,205, 76, 79, 79,111,160, 80, 40,126, 48,224,
+197,163, 3,112,186,104, 43,110, 83,158, 70, 68, 68, 40,250,247,239, 47,170, 93,187,118,240,223,205, 91, 15, 15,143, 38, 92, 46,
+ 23, 15, 31, 62, 84, 1,184, 89,180,251,230,179,103,207, 84,189,123,247, 22,212,168, 81,163,137,161, 92, 82,169,212,195,205,205,
+237,138,141,141,141,168,120,218,118,215,174, 93,185,171, 87,175, 54, 77, 72, 72,128, 70,163,193,156, 57,115,208,173, 91, 55, 88,
+ 90, 90, 98,228,200,145,246, 59,118,236,248, 13, 64, 96, 5,109,168,144,207,231,255,250,230,205, 27,119, 71, 71, 71,209,131, 7,
+ 15,224,235,235,139,244,244,116, 36, 39, 39, 35, 63, 63, 31,201,201,201, 24, 53,106,148,221,186,117,235,164,159,209, 51,148,205,
+227,241, 32, 22,139, 45,178,179,179,115,254, 6,143, 0, 0,191,180,184, 18, 8, 4, 16, 8, 4,248,216,197,228,255, 35, 8, 33,
+ 78,132,144,112, 30,143, 39, 16,139,197, 60,138,162, 32,145, 72, 58,214,168, 81,227,229, 87, 95,125, 85,255,215, 95,127,125,103,
+ 8,143, 82,169,252, 85, 36, 18,113,109,109,109, 1, 0, 29, 58,116,192,240,225,195,145,150,150,198,200,100, 50,120,121,121, 81,
+ 55,110,220, 64, 74, 74, 10,158, 62,125,138, 70,141, 26,113,173,172,172,126, 5,208,217, 40,155, 62,161, 5,139,195,225,148,108,
+101, 89,174,138,183,143, 29,223,203,227,212,235,245,176,183,183,135, 88, 44,134, 88, 44, 46,237,204,254, 23,126,150,101,171, 53,
+ 68, 40,145, 72, 48,120,240, 96,118,235,214,173,227,139, 68,214, 27, 67,255,219,111, 83, 68,137,213,234, 99,248,250,250,222,157,
+ 55,111, 94,167, 75,151, 46,101, 5,185,214,230, 72,100,239,243,133,102, 22, 22,112,174,217,245,171,126, 3,238, 1, 56, 80,133,
+100,202, 84, 42, 21,207,205, 89,172,166, 40, 37,169, 41,224,152, 58, 74,120, 2, 7, 75, 75, 39,158, 90,149,106,102,105,201, 47,
+ 26, 50,147, 85, 70, 84, 60,121,128, 16, 2, 11, 11, 11,110,209, 39,236,236,236, 4,245,235,215, 79,161, 40, 10, 44,203,202,158,
+ 63,127,110,240,112,161,171,171,107, 8, 69, 81,206,132,144, 15, 38, 36,148,222, 24,134, 73,120,249,242,165,161, 19, 16,230,249,
+249,249,181,218,178,101,139,173,187,187, 59,182,109,219,102,118,244,232,209,189,191,253,246, 27,178,179,179,241,238,221, 59,140,
+ 26, 53, 42, 23,133,195,136,159, 21,172,172,172,238,244,235,215, 15, 59,119,238,100,139, 58, 17, 18, 66,136,175,185,185,249,235,
+240,240,240,255,186,159, 11, 69, 81, 29,189,188,188, 72, 78, 78, 14, 24,134, 1, 77,211, 37, 29, 33,154,166,241,237,183,223,138,
+ 70,141, 26, 53,191, 73,147, 38, 51,185, 92,110,174, 78,167, 59,152,159,159,255,195,139, 23, 47, 62, 43,103,213, 22, 45, 90,124,
+ 19, 31, 31,223,173, 86,173, 90,103,254, 70,111,159,109,216,176,161, 26,128,136,166,105,238, 39,120,129,209, 69,237,145,178,120,
+113,120,150,101,117,129,129,129,202,162,151, 59, 93,133,122,243,219,254,253,251,157,157,157,157,161,213,106,161,211,233,144,159,
+159,143, 27, 55,110, 64,165, 82, 65,167,211,193,203,203, 11, 43, 87,174, 84, 78,156, 56, 81,120,232,208,161, 84,133, 66, 49,164,
+ 18,218,169, 71,143, 30,149, 56, 58, 58,138, 20, 10, 5, 98, 98, 98, 16, 24, 24,136,188,188, 60,200,229,114, 20, 20, 20, 64,163,
+209, 32, 55, 55,215, 66,175,215,171, 63,155, 23, 13,135, 3,129, 64, 0, 30,143,151, 93,171, 86, 45, 16, 66,132,239,222,189,171,
+206,144,155, 25,128, 92, 46,151,203, 47, 45,172, 4, 2, 1,158, 63,127,126,168, 60,235, 85, 69,245,167, 42,191, 63, 3,129,181,
+129,199,227, 9,172,172,172,120,197,251, 52, 26, 13,207,210,210, 18,181,107,215,222, 4,160,139,129,109,136,191,165,165, 37, 8,
+ 33,224,241,120, 24, 51,102, 12, 30, 61,122,116, 34, 33, 33,225,171,212,212, 84, 20, 20, 20,252,106,110,110,222, 43, 53, 53, 21,
+122,189, 30,111,223,190,133,191,191,191,191, 81, 50,125, 98, 11, 86,121,130,234, 99,193,101,136,181, 68,163,209,152,116,237,218,
+149, 41,253,146, 46,250, 31,169, 64, 96, 85,171,130,115,185, 92,211, 9, 19, 38,228,109,221,186,117, 28, 33,100, 7,203,178, 81,
+213,205,164, 51,199, 14,216,175,252,126,206,247, 86,210,218,110,179,103,207,230,244,238,221,251,218,158, 61,123, 26, 90,121,123,
+127,113,253,242,126,251, 77,179,231,158, 60,117,234, 84,129,161, 14,238, 69,184,123,226,196, 9,199,233, 83, 38,242,190,255,118,
+234, 69, 51,119, 27,190, 9,177,146, 8, 85,242, 52, 19,176, 10, 65, 93,175,110,103, 47, 93,138, 7,112,199,128,198,203,249,225,
+195,135,118, 22, 22, 22, 0, 10, 39, 7, 88, 88, 88, 96,235,214,173,150,197,150, 66, 67,134, 11, 63,122, 0,157,195,194,194,236,
+ 76, 76, 76, 32,151,203, 75, 94, 8, 44,203,150, 52,150, 45, 91,182,172,202,139, 48,134, 16,210,242,235,175,191,190,181,101,203,
+ 22, 91, 55, 55, 55, 44, 93,186, 20, 25, 25, 25,136,139,139,195,144, 33, 67,114, 99, 98, 98,218,148,246,205,250, 28,208,160, 65,
+ 3,246,238,221,187,184,120,241, 34,190,252,242, 75,114,234,212, 41,141, 94,175,231, 37, 38, 38, 62,255,167,210,164,211,233, 76,
+121, 60, 94,201,176,122,177,176, 42,222,156,157,157,113,245,234, 85, 78, 65, 65, 1, 39, 61, 61, 93,252,203, 47,191, 76, 14, 9,
+ 9,113, 4, 48,232,159,204,203,173, 91,183,214, 26, 51,102, 76, 28,135,195, 97, 59,117,234, 52,244,253,251,247, 61, 29, 29, 29,
+255,184,126,253,250, 90, 0, 85, 14, 87, 80,191,126,253, 16, 14,135,227,204,178, 44,239,228,201,147, 90,189, 94,207,107,208,160,
+ 65,202, 71,193, 16,161,211,233, 18, 34, 35, 35,131, 12,225, 19, 10,133,188, 29, 59,118,104,149, 74, 37,207,215,215, 55,165, 20,
+ 15,239,212,169, 83, 90,173, 86,203,243,244,244, 12, 49,100,102,115,102,102,230,144,105,211,166,221, 62,124,248,176, 13, 77,211,
+120,255,254, 61, 50, 50, 50, 96, 97, 97,129, 95,127,253, 21,181,107,215,198,149, 43, 87, 50,117, 58,221,232,157, 59,119,206, 87,
+ 40, 20, 67, 12,240,193,106, 25, 28, 28, 92, 43, 59, 59, 27, 22, 22, 22,144,203,229, 8, 9, 9,129,143,143, 15,100, 50, 25, 40,
+138,130,133,133, 5,182,108,217, 82, 64, 8,201,252, 28,158, 33,154,166, 75,172, 76,165, 68,145,178, 73,147, 38,184,115,231,206,
+239, 85, 17, 69, 44,203,170,185, 92,238, 7,194,170,248, 59, 77,211, 85, 30,242,208,235,245, 60, 66,136, 63,138,252, 3, 43,251,
+253, 25,160,149, 88, 44,230,149, 81,215,120, 30, 30, 30, 45, 12, 37,225,243,249,214, 34,145,168,144,176, 85, 43,164,166,166,234,
+ 93, 93, 93, 7,244,239,223, 95, 11, 0,227,198,141, 27,144,154,154,170,212,233,116, 52, 77,211, 72, 75, 75, 67,237,218,181,173,
+141,146,233, 63, 96,193,170,200,114, 85,218,130, 85, 89, 37,164, 40, 42, 59, 52, 52, 84, 34,145, 72, 74,246,105,181, 90,248,251,
+251, 51, 12,195,144,143,175, 83,156,142,234,130,203,229,154,126,247,221,119,217, 91,182,108,249, 10,192, 60, 67,254,115,100,146,
+ 23,246,125, 36,174,182,173, 92,178,233,231,149,203,172,162, 47,238,193,174,141,107,244, 92,190, 73,136,191,191,127,203,156,156,
+ 28,149,133, 68,133,228, 12,156, 96, 89,246,183, 42,244, 66, 40, 0,135,238,223,191,255,164, 67,135, 14, 15,118, 31, 58,110, 37,
+139,137,185, 47,200, 77, 79, 50,171,235,206,225, 57,213,234, 37, 87,171,185,189,122,245, 50, 1,176,209, 0, 62,196,197,197,225,
+222,189,123, 48, 51, 51,131,153,153, 25, 44, 44, 44, 74,190, 87, 39, 15,139,135,109,207,158, 61, 11,137, 68,130,162,169,187,144,
+ 72, 36,224,243,249, 40, 93,134, 85, 16, 89,145,132,144,169,199,143, 31, 63,184,124,249,114,100,102,102, 66, 46,151, 99,225,194,
+133,136,137,137,153,198,178,236,147,207,233,225,240,245,245,101,239,223,191,143,187,119,239, 66, 46,151,227,231,159,127,134,163,
+163, 99, 91, 0, 11,254,201,116, 49, 12,195, 43,182, 40,150, 22, 86,165,173, 88, 52, 77, 67, 40, 20,194,198,198, 6,115,231,206,
+229,125,249,229,151,221,254,201, 52,175, 90,181,170,238,134, 13, 27,126,217,183,111,223,133, 33, 67,134, 28,126,241,226,197, 8,
+115,115,243,231,215,174, 93, 91, 38, 16, 8,152,106, 90, 69,156,159, 60,121, 98, 87,250,145,103, 24, 70,172,211,233,160,211,233,
+160,213,106, 81, 80, 80,128,246,237,219, 27,204,247,232,209, 35, 49, 0, 44, 88,176,128, 11, 64,204, 48, 12,244,122, 61,138, 57,
+ 11, 10, 10,184,237,218,181,115, 54,200, 68, 45,147, 69, 74,165,210, 22,253,251,247,191,119,240,224, 65,203, 90,181,106, 33, 49,
+ 49, 17,137,137,137,168, 91,183, 46, 54,110,220, 40,103, 89,182, 89,145,168, 58,101,224,109, 75, 45, 45, 45,185,113,113,113,208,
+233,116,240,247,247,199,150, 45, 91, 48, 96,192, 0,212,175, 95, 31,185,185,185, 8, 15, 15,199,222,189,123, 45,121, 60, 94,159,
+127,250, 25,162, 40,234, 47,226,170,244, 86,205, 14,134,153, 80, 40,204, 21, 8, 4,252, 98,255,171, 71,143, 30, 85,217,122, 85,
+170, 93,122, 82,149,223,255, 36, 76, 77, 77, 97, 98, 98, 2,173,246,195,219,148, 72, 36,168, 91,183,174,193, 60, 38, 38, 38,164,
+216,136,161,213,106,145,148,148,164,127,241,226,133, 62, 32,160,112,144,195,209,209, 81,255,240,225, 67,189, 82,169,164, 77, 77,
+ 77, 81, 52, 42, 66, 96,196,167,179, 96, 21, 91, 43, 42,178, 92, 21,127, 47,182, 68, 85,246,176,209, 52,141,139, 23, 47,150, 84,
+ 20, 47, 47,175,146,107,125,106,129,101,109,109, 45, 15, 14, 14, 54,139,143,143, 63, 80,157,255, 23,139,171,229, 75, 23, 90,101,
+190,122,128, 4, 89, 18, 50, 83,181,161,119,158,191,189, 12,224, 50, 0, 96,187,247, 13,140,123,101,176,184,242,182, 21,251, 53,
+144,154,158,248,162, 75,183, 26,253,199,126, 67, 77,156, 56,177,241,136, 17, 35, 50,134, 12, 25, 50, 81, 36, 18,121,235,116,186,
+140,179,151, 46, 69,247,234,213,203, 65,167,211, 13,103, 89,214, 16,159,164,132,193,131, 7,243, 8, 33,176,179,179,227,238,219,
+183,207,210,204,204, 12, 35, 70,140,200,122,251,246,173,182,168, 39,150, 82,197,219, 79,104,214,172,217, 95,134, 5,139, 95,236,
+197,150,129, 42,138, 54,255,110,221,186,237, 60,124,248, 48,210,211,211, 33,151,203,193,229,114,177,122,245,106,196,197,197,253,
+ 68, 8,121,241,185, 52,102,126,126,126,236,195,135, 15,241,252,249,115,168, 84, 42,140, 30, 61,186,180,143, 97,135,127,122,164,
+ 32, 49, 49, 17,251,247,239, 7,195, 48, 24, 50,100, 8,106,213,170, 85, 34,172,146,147,147,177,123,247,110,232,245,122,140, 25,
+ 51, 6, 53,107,214,132, 86,171, 21,182,110,221,154,115,227,198, 13,221, 63,145,224,233,211,167, 71,159, 56,113,226, 66,124,124,
+124,231,149, 43, 87,182, 34,132, 48, 51,103,206, 92, 97,102,102,246,183,102, 95,102,229,228,225,245,155,247, 37, 2,232,227,205,
+214,198,170,202,124, 81, 49,241, 37,255,215,235, 75,243,233, 97,109,101, 89, 37,190,164,164,164,130,140,140, 12,249,232,209,163,
+ 45,118,238,220, 73,234,214,173,139,216,216, 88,112,185, 92,152,154,154, 22, 68, 68, 68, 84, 53, 52, 67, 98,102,102,166, 59, 77,
+211,188, 55,111,222,192,197,197, 5,193,193,193,248,225,135, 31,144,158,158, 14,157, 78, 7, 59, 59, 59, 70,171,213,134,169,213,
+234, 91,255,244,115, 84,218,202, 84,122,187,123,247,238,239, 52, 77, 83, 0,206, 0,168,146,192,102, 89, 86, 93,179,102,205, 15,
+184,171, 99,189,250, 15, 90,236,254, 99, 51, 19, 61, 60, 60,110, 74, 36,146,110,175, 95,191,254,192,138, 53,120,240, 96,141,155,
+155,219,109, 67,121,204,204,204,178,120, 60,158,181, 82,169,196,253,251,247,225,237,237,205,203,201,201, 89, 78, 8,153, 83,212,
+185, 92,158,146,146,194,147, 74, 11,221,248, 60, 61, 61,145,151,151,151,101,148, 76,159, 88, 96,149,101,185, 42, 75,100,209,116,
+229,174, 9,132, 16, 40, 20, 10, 72, 36,146,146,173,216,207,170, 44,129, 85,228,251, 83,173, 33,194, 34,113, 37, 58,120,240,224,
+239, 27, 55,110,188,107,232,255, 74,251, 96,109, 95,187,116,101,177,184,122,118,247, 10, 78, 69,228,164,207, 90,190,126, 67,117,
+ 51,219,199, 86,226,235, 96,111,115, 99,245,143, 75,204,162, 47,238,197,225,237,235,216,103,143, 30, 53, 28,255,232, 81,159,241,
+227,199, 91, 1, 72, 2,144, 8,224, 62,128,159, 12, 20, 87,136,140,140, 44, 9,238, 26, 16, 16, 16,111,105,105,105, 41, 18,137,
+ 32,147,201, 84, 79,158, 60,169,150,163,107, 84, 84,212, 39, 13,238, 74, 8,241,232,222,189,251,173, 99,199,142, 73,178,179,179,
+241,254,253,123,204,156, 57, 19,155, 55,111,134,153,153, 25,206,157, 59,103,218,173, 91,183, 27,132,144,166,255,116,112, 85,127,
+127,127,246,241,227,199,120,247,238, 29,116, 58, 29,122,244,232, 81,233, 4,142,255,178, 5,139,157, 54,109, 26,118,238,220, 9,
+154,166,241,213, 87, 95, 33, 55, 55,183,228,184,149,149, 85, 89,199,232,162,231,253, 31, 17, 88, 28, 14,135,189,121,243,230,202,
+ 86,173, 90, 33, 62, 62,190,115, 96, 96,224,207, 35, 70,140, 72,252,187,188,150,230,166,240,243,113,133, 74,165,130, 74,165,130,
+ 84, 42, 69, 94, 94, 30,162,163,163,161, 82,169, 96,111,103, 81,101,190,128,250,117, 75,248,236,236,236, 32,151,203,241,246,237,
+ 91,168,213,106,216,216, 88, 86,165,206,215,232,216,177,227,245,223,127,255,221,250,247,223,127, 87,247,238,221,155,191,100,201,
+ 18, 98,102,102,134,212,212, 84, 84,211,189,231,230,157, 59,119,106,181,111,223,222,243,213,171, 87,184,121,243, 38,212,106, 53,
+ 2, 2, 2, 16, 21, 21,133, 38, 77,154, 32, 63, 63,255,225,227,199,143, 79,127, 14,117,181,120,248,174,120, 11, 9, 9, 57,196,
+227,241, 88, 0,213,178, 54, 21, 35, 46, 46, 78,224,235,235,171, 18, 10,133,252, 34,177,246,183,248, 62,113, 91,247,183,102, 38,
+ 86, 4, 87, 87,215,105,206,206,206,237, 3, 2, 2,240,234,213, 43,158, 64, 32,192,208,161, 67, 53, 93,186,116,209,112, 56, 28,
+131, 39,220,136, 68,162, 87, 38, 38, 38, 45, 85, 42, 21,212,106, 53,174, 92,185, 2,107,107,235, 89,221,187,119,159,154,148,148,
+ 4,153, 76,198,231,243,249, 37,254,183,173, 91,183, 70, 70, 70,198, 43,163,100,250, 68, 2,171,184,142, 24, 50, 60,104,168, 15,
+ 22, 69, 81, 80,171,213,144, 72, 36, 16,139,197,144, 72, 36, 37,215, 33,132,148, 41,176,170,131, 26, 53,106, 32, 56, 56, 88,116,
+248,240,225,223,214,172, 89,115,175, 58, 28, 71,127,223,239,104,206, 20,212,144, 61, 60,143,200,231,161, 56, 17,158,157, 62,107,
+249,250, 41,221,251, 12, 74,249, 88,144, 29, 25,103, 64,207,195, 78, 82,223,201,222,250,198,218, 85,203,205, 50, 95, 61, 64, 82,
+114, 50,206, 63,124, 28,170, 42,244, 13,251,225, 19, 62,220, 40, 30, 91,255,156, 32, 16, 8,166, 29, 61,122, 84,146,157,157,141,
+152,152, 24, 12, 25, 50, 36,251,221,187,119, 95,247,236,217,115,243,229,203,151, 45, 45, 44, 44,112,249,242,101,211, 26, 53,106,
+ 44, 7,208,237, 31,108, 28, 89,189, 94,143,204,204, 66,247,149,102,205,154,125, 86,226, 10, 0, 66, 66, 66,120,221,187,119,255,
+ 3, 64,219, 87,175, 94,129, 97,152,123,161,161,161,205,138,143, 87,116,204, 16,253,150,151,151,199, 53, 53, 53, 45,243,101,197,
+227,241,120, 85,181, 56,148,230,188,123,247,238,138,181,107,215,158,152, 49, 99,198,155,191,201, 89,166, 5,171, 91,183,110, 80,
+168, 52, 72, 72,201,129, 94,175,131, 66,147,250,183, 44, 88,221,186,117, 67,129, 82,141,184,164, 76,232,116,122,228, 41,116,134,
+214, 35,241, 23, 95,124,113,233,224,193,131, 14,247,239,223,135, 74,165, 98, 66, 66, 66,222,142, 29, 59,214,108,212,168, 81,214,
+229,133,182, 49, 0, 27, 7, 13, 26,212,247,238,221,187,153,158,158,158, 86, 15, 31, 62, 68,106,106, 42,116, 58, 29,218,182,109,
+ 11, 62,159, 31,183,124,249,114, 30, 12,112, 45,248,111, 9, 44,129, 64,128,240,240,240, 98, 97, 53,236, 83, 9, 33, 62,159, 95,
+237, 97,198,255, 85,252,246,219,111,137,123,246,236,241,113,114,114,218, 48,108,216,176, 54, 82,169,148, 18, 8, 4, 55, 57, 28,
+206, 84, 0,239, 13,229,225,241,120, 35, 44, 44, 44,162, 41,138,162, 19, 19, 19,241,230,205, 27,196,198,198, 2, 0,191,160,160,
+ 0,118,118,118, 37, 70,147, 65,131, 6,161, 70,141, 26,250,168,168,168, 17, 70,201,244,137, 45, 88, 75,150, 44,193,246,237,219,
+ 49,110, 92,197, 42,226,204,153, 51,192, 71, 67,132, 69,203,199, 92, 45,253,242,215,235,245, 88,184,112,225, 7,255, 43, 30,126,
+250,250,235,175, 63,224, 60,121,242,228, 95,134, 8, 63,230, 44, 11,169,169,169,175,142, 28, 57,242,120,213,170, 85, 15, 13,108,
+ 12, 75, 56,139,125,176,250, 14, 30,154,180,105,197,247, 47,246,157,185, 86, 63, 73,193, 38,205, 90,190,126,198,199,226,202, 80,
+ 78,111, 7, 19,111,103, 59,235,155,107, 86, 45, 55, 47,182,134, 29, 12, 75,206,129,142, 29, 87,149,194, 50,228,222,117, 58, 93,
+130,191,191, 63, 15, 48,108, 88,208, 16,206,106,136,148,191,112,170, 84, 42, 60,120,240, 0, 0, 48,114,228,200,236,119,239,222,
+181,100, 89,246, 37, 33,228, 85,199,142, 29,111, 94,186,116,201,146, 97, 24,160,156,176, 20,255,173,116, 22,229, 27, 56, 28, 14,
+220,221,221,171, 44,174,254, 91,233, 76, 74, 74, 26, 55,126,252,248,237, 42,149,138, 35,151,203,199, 25,122,172,178,116, 30, 57,
+114,228,141,187,187,123, 43,148, 31,138,129, 41,178,176, 86,155,115,195,134, 13, 0,224,249,119, 56,203,179, 96, 29, 58,116, 8,
+ 12,195,160,134,131, 5, 84, 42, 21,196, 98,113,149, 56, 63,182, 96, 29, 62,124, 24, 12,195,160,166,163, 21,212,106,117,185,157,
+151,143, 57,173,173,173,215,237,219,183,207, 57, 34, 34, 2, 9, 9, 9, 88,191,126,253,251,180,180,180, 46, 28, 14, 71,240,243,
+207, 63,223,232,218,181,171,189, 78,167, 83, 85,181,220, 89,150, 85, 17, 66, 70, 52,109,218,244,215,101,203,150,197,122,121,121,
+213,108,214,172,153, 69, 70, 70, 70,218,147, 39, 79,222,110,223,190,221, 68,167,211,141, 40,111,232,233,191,249, 28, 1, 64, 98,
+ 98,226,105, 0,220,170, 10, 43, 67,210,249,232,209,163,195, 69,220,231, 13,225,254,111,221,251,223,157,153, 88, 89, 58, 71,140,
+ 24,145,128,143,226,155, 85, 53,157,151, 47, 95,126, 55,120,240,224,165,245,235,215, 95,100, 98, 98,130,200,200,200,146,176, 72,
+197,117,156, 16,130,126,253,250,225,235,175,191,198,165, 75,151,150,246,237,219,247,221,127, 58, 63,255, 53, 2, 75,175,215,199,
+191,123,247,206,113,223,190,125, 52, 33, 4,191,253,246, 27, 74, 79,217,167,105, 26, 20, 69,129,195, 41,164,120,240,224,129,174,
+178,152, 83,122,189, 62, 62, 36, 36,196,126,239,222,189,220, 98,147,113, 98, 98, 34, 24,134, 97, 82, 82, 82,168,223,127,255,189,
+196, 26,198,225,112,240,224,193, 3,157, 70,163,137,171,234, 77, 69, 70, 70,126,146,222,219,173,151,239,166, 94, 58,127,210,166,
+113,112,139,108, 51, 43,171, 50,187,174,197, 17,223, 43,172,220, 28,234,135,149, 63, 46,177, 40, 22, 87,135,194,146,179,149, 42,
+125,155, 87,105, 5,207, 62,117,129, 62,123,246,172,233,103, 90,215, 22,182,106,213,138, 1, 96, 3, 96,126,241,172,206, 34,145,
+213,184,110,221,186, 51, 0,136, 0, 44,252, 39,173, 87,165, 67,131,124,110,150,171,210, 8, 13, 13,141, 5,208,174,170,199, 42,
+ 67,223,190,125, 99, 80, 70,192,207,191,131,255, 4,103, 49, 50,179,115, 17,243, 46, 17,133,206,232, 12,244,239, 83, 74,252,166,
+180, 90, 29, 50,115,171, 20, 70, 14, 89, 57,121,136,126,155, 88,180, 52,152, 30,122,189,172,136,175,208,209,157,205, 42,168,148,
+131,203,229, 54,223,176, 97, 67, 23,138,162,168, 7, 15, 30,168, 86,173, 90, 21,159,150,150,214,131,101,217, 56, 0,144, 74,165,
+173, 79,158, 60,249,155, 1, 33, 25,202,235,248,134, 19, 66,154,204,158, 61,123, 10,128,230, 0,106, 2,136, 67,225,140,227,141,
+159, 89,196,241, 97,255,163,220,213,198,255,202,204,196,223,127,255,125,241,215, 95,127,205, 9, 14, 14,158,219,176, 97, 67,234,
+237,219,183, 72, 77, 77, 5,135,195,129,135,135, 7, 58,116,232, 0, 23, 23, 23,230,220,185,115, 63,246,234,213,107, 49,140,248,
+116, 2, 43, 61, 61,189,227,176, 97,195,174, 80, 20, 85,187,244, 48, 94, 89,159, 0,192, 48,204,187,148,148,148, 10,131,144,165,
+167,167,119, 92,184,112,225, 21, 14,135, 83,187, 84,252, 43, 85, 70, 70,198,215,253,250,245,219,194,229,114, 5,165,173, 93, 12,
+195,188, 79, 74, 74,250,175, 58, 20,127, 28, 7,171, 99,151,158,233,127,151,211,132, 71,185, 69,158,219,137,148,212,116, 28, 10,
+ 75,206,202, 83,235, 91, 71,166,201, 95,252,155, 42, 26,203,178,169, 0,190, 46,231,216, 27, 0,227, 62,131, 52,146, 34,145,101,
+156, 45,243, 63, 0,157, 78,151,208,190,109,107,124, 28,150,225,227,223,122,189, 62,193, 80,190,118,109, 90,149,203, 83,252,189,
+ 50, 62,154,166,103, 4, 7, 7,211, 51,102,204, 72,185,112,225,194, 31, 89, 89, 89,211, 89,150, 45, 81,102, 69,179, 6, 3,255,
+102, 93, 85,161,112,133,135, 85,198,154,240, 89,182,119,255, 19, 51, 19,183,108,217,178, 96,214,172, 89,123,157,157,157,247, 55,
+111,222,220,211,205,205,205,204,212,212, 20,185,185,185,121, 89, 89, 89,175,207,158, 61, 59,100,216,176, 97,177,198, 18,253,196,
+ 2, 43, 45, 45, 77, 14,160,201,167,188, 88, 37,156,181, 62,155, 46,151,106,213, 1,108, 95,245,193, 58,132,197,226,171,204,223,
+149, 72,131, 28,133,110,226,198, 75, 47,215,168,116, 44,163,209, 49, 35, 35, 83,229,225,198,170,247,217, 54,140, 70,113,245, 63,
+130, 23, 47, 94, 4,125,142,124,106,181,122,106,211,166, 77,127,210,235,245,107,181, 90,237, 29, 99, 73, 25,241, 57, 99,213,170,
+ 85,177,197,239,229,126,253,250,209, 0,112,228,200, 17,189, 49,103,254,131, 2,235,223,138, 35, 47,255,124,193,126, 44,156, 42,
+251, 93, 30, 94, 39,231,223,252,187, 61, 86, 35,140, 48,226,127, 70,164,199, 1,232, 97,204, 9, 35,254,231,222,127, 70, 97,245,
+ 73, 65, 25,179,192, 8, 35,140, 48,194, 8, 35,140, 48,226,211,130, 0,104, 95, 78, 47,204,224,217, 1,132,144,246, 85,189,176,
+ 1, 43,134, 27, 57,141,156, 70, 78, 35,167,145,211,200,105,228,252,127,198,249,175, 65,105, 71,206, 79,189, 1,104,111,228, 52,
+114, 26, 57,141,156, 70, 78, 35,167,145,211,200,249,111,219,140, 67,132, 70, 24, 97,132, 17, 70, 24, 97,132, 17,159, 24, 70, 39,
+119, 35,140, 48,194,136, 82,144, 74,165,221, 1, 44, 70,161, 11,197,114,153, 76,118,216,152, 43, 70,252,127,130,173,173,173,196,
+218,218,250, 15,138,162,106, 1, 31,134, 92, 42, 35,184, 55,244,122,125, 82,102,102,102,135,228,228,228,244,255, 38,231,191, 78,
+ 96,181,173,107,209,194,181,142,203,239,105,169,233, 97,249,202,220, 81,127,188,206,203,172,206,133, 9, 33,214,124, 62,127,128,
+ 68, 34,105,207,178,172, 43, 77,211, 17, 57, 57, 57, 87,181, 90,237, 65,150,101,243,141,143,128, 17,255, 52,252,253,253, 27,240,
+249,252, 89,132,144,198, 58,157,206,153,203,229,202, 0, 60, 84,169, 84,171,195,194,194,194,140, 57,244,255, 3,132, 16,202,209,
+209,241, 39, 11, 11,139,224,236,236,236, 33, 0,230, 70, 70, 70,250, 82, 20, 5, 31, 31,159,185, 82,169, 52,218,204,204,108, 87,
+110,110,238,189,164,164,164,169, 85, 89, 59,206,136,207, 23,110,110,110, 33, 20, 69, 57, 23, 47,201,246,177, 32, 40, 75, 32,176,
+ 44, 27, 27, 30, 30, 94,110, 48,103,103,103,103, 87, 51, 51,179, 45, 0, 26,126, 44, 42, 62, 70,209, 48,219,227,220,220,220,175,
+ 19, 18, 18,202, 12,196,107,101,101,101,106,103,103,183,152, 16,210,143,162,168, 74, 23,252,101, 24, 70,207,178,236,145,212,212,
+212,133,153,153,153,121,229,157,103,109,109,125,245,214,173, 91, 13,109,108,108, 42, 13, 75,163,211,233,144,152,152,104,219,181,
+107,215, 91, 0,188,254,155,156,255, 58,129, 5,150, 26,186,122,222, 24,167,180,248,104,167,185, 27,142,123,180,240,178,105,125,
+ 59, 34, 61,185, 42, 20, 34,145,104,128,175,175,239,198,159,126,250,201,218,197,197,133,136,197, 98, 36, 37, 37,121, 61,121,242,
+164,215,162, 69,139, 22,114,185,220, 17, 90,173,246,202,223,108, 52, 45,172,196,156, 89, 25,114,237,119,198,166,196,136,170,160,
+ 95,191,126,116,124,124,252, 34, 27, 27,155,111,231,204,153, 35,168, 93,187, 54, 76, 76, 76,144,154,154, 90,243,205,155, 55, 53,
+ 54,111,222,220,189,105,211,166, 63,171,213,234,249,161,161,161, 90, 99,142,253,111,195,209,209,241,167, 83,167, 78, 77,242,244,
+244, 68,203,150, 45,239,249,251,251,155,137,197, 98, 92,188,120, 17,110,110,110,245,204,204,204, 30,110,219,182,141,187,120,241,
+ 98,191,227,199,143, 3,192,100, 99,174,253,239,131,162, 40,231,176,176, 48, 59,177, 88, 12,189, 94, 95, 20,189,159, 1,203,178,
+ 37,159,165,197,144, 94,175, 71,155, 54,109, 52, 21,113, 10,133,194,205,207,159, 63,111, 95,188,142, 95, 41, 33, 85, 38,100, 50,
+ 89,251, 54,109,218,108, 6, 80,102, 64,109, 59, 59,187,197,253,251,247,159, 86,191,126,125, 0, 40, 73,103,241,103,122,122, 58,
+ 38, 78,156, 88,114, 13,134, 97,112,235,214,173, 41,223,124,243, 13, 0,124, 83,193,189,215,178,177,177, 33,149, 45,129,183,104,
+209, 34, 44, 90,180, 8, 27, 55,110, 36, 28, 14,199,162,146,252,252,228,156,255, 58,129, 69, 40,114,126,211,182,189,163,166,247,
+111, 76, 86,141,109,225, 62,111,215,141,251,237,235, 88,182,188, 26,155, 21,111,160,184,154, 50,126,252,248, 21, 75,150, 44, 17,
+190,126,253, 26,225,225,225,208,233,116, 48, 53, 53,133,175,175, 47,117,254,252,121,199,169, 83,167, 30,229,243,249, 35,213,106,
+245,241,234,222,152,131, 25,119,181, 68, 64, 13,230,115, 56, 15,213, 58,221,233,207, 49,243, 93, 92, 92, 46,107,181,218,149,137,
+137,137,215,255, 87, 42,140, 84, 42,109,198,231,243, 23,190,123,247,174, 19,203,178,186,255,143, 15, 69, 92, 92,220,146,230,205,
+155, 79, 95,180,104,145,224,237,219,183,136,138,138,130, 76, 38, 67,237,218,181,225,226,226, 66, 54,110,220, 40,252,249,231,159,
+ 39, 63,125,250,148, 11, 96,122, 85, 44, 37, 14, 14, 14,163,219,181,107,215,199,198,198,198, 60, 49, 49, 49,231,238,221,187,167,
+146,146,146,118, 84, 55, 47, 9, 33,148,141,141,205,240,110,221,186,245,177,178,178,178, 74, 78, 78,206,186,122,245,234,201,212,
+212,212, 93,127,199,210, 66, 8,113, 4,224, 11,192,186,104, 87,146,139,139,203,203,183,111,223,166,126, 66, 78,153,139,139, 75,
+120,117, 56,109,109,109, 37, 28, 14,231, 48, 33, 68, 90,129,133, 64,166,211,233,250, 23, 5, 56, 46, 23,102,102,102,141,221,221,
+221, 17, 26, 26,138,249,243,231, 91,181,105,211, 6,111,222,188, 1, 33, 4, 51,102,204, 32, 62, 62, 62,220,164,164, 36, 4, 5,
+ 5,225,234,213,171, 77, 97, 68, 85,202,252, 8, 0, 11, 0,131, 88,150, 77, 47,181,223, 6,192, 73, 0,169, 44,203,246,254,167,
+210, 39, 18,137,112,240,224, 65,112,185, 92,112,185, 92,100,101,101,193,217,217,185,228, 55,143,199, 43,249, 94,179,102,205, 74,
+249, 24,134,105, 68,211, 52,242,243,243,161,215,235, 75,182,236,236,108,176, 44, 11,129, 64, 0,189,190,112,217,165,226, 99, 12,
+195, 52,170, 32,255,250, 73,165, 82, 28, 56,112, 0,106,181,186,172,186,139, 23, 47,254, 92, 20,132,166,105,248,249,249, 81,132,
+144,126, 21, 9, 44, 66, 8, 11, 0, 99,199,142, 5, 77,211, 37, 75,223, 21,127, 47,222,244,122, 61, 22, 45, 90, 84,232,176, 77,
+ 81,149,149,245, 39,231,252,159,175,255, 21,169,235, 54,110,150, 95,183,110,209,120,181, 80,192, 17, 49, 58, 45,244, 58, 45, 24,
+157, 26, 52, 97,208,194,219, 14, 1, 53,133,200,204,202,195,252,253, 79,115,101, 25,202,224,203, 81, 25,145,149, 20,128, 75,112,
+112,112,216,181,107,215, 44,254,248,227, 15, 68, 70, 70,226,135, 31,126, 0, 0, 72, 36, 18, 92,188,120, 17, 52, 77,131, 97, 24,
+116,234,212, 41, 77, 38,147,121,177, 44,155, 89,141,135,186, 86,203,250,206,161,199,191,107,105, 85,111,194,209,247,201, 57,106,
+ 87,150,101, 63,187, 0,106, 82,169,148,229,114,185, 5, 58,157,174,251,255,130,200,146, 74,165,205,184, 92,238, 69,157, 78, 39,
+230,114,185,162,119,239,222,169,254,191, 61, 16,254,254,254, 13,172,172,172, 30,156, 56,113, 66,248,232,209, 35,100,101,101, 33,
+ 53, 53, 21, 83,166, 76,193,214,173, 91, 81,175, 94, 61, 72, 36, 18,240,249,124, 76,156, 56, 81,145,151,151,215, 58, 36, 36,228,
+177, 1,117,146,110,217,178,229,129,223,126,251,205, 69,167,211, 81, 0,160, 86,171, 17, 31, 31,175,159, 55,111, 94, 92, 72, 72,
+200,160,170,138, 44, 66, 8,213,180,105,211,253,191,253,246,155, 27,159,207,167, 24,134,129, 86,171,197,155, 55,111,244,243,230,
+205,123, 23, 26, 26, 58,184, 58,245,158, 16,226, 47, 22,139,125,190,254,250,235,180, 30, 61,122,104, 0,224,241,227,199,212,179,
+103,207,204,234,212,169,243,126,193,130, 5, 97,213,224, 12, 52, 53, 53,245, 28, 55,110, 92,122,183,110,221,180, 60, 30,143,185,
+123,247, 46, 39, 50, 50,210,204,197,197, 37,102,238,220,185,207,170, 88, 23,207,157, 56,113,162,181, 84, 42,213, 3, 96,139, 27,
+120,138,162,216,162, 79,196,196,196,112,250,246,237,123, 67, 38,147,125, 89, 97,103,204,193,193,219,209,209,241,214,130, 5, 11,
+172,138, 95, 82,165,183,226,178, 90,180,104,145, 38, 41, 41,169,177, 76, 38,123, 2, 35, 12, 45,247,135, 0, 26, 1,120, 9,160,
+ 45,203,178,233, 69,226,234, 58, 0, 31, 0,119, 89,150,109,254, 79,164,205,211,211, 51,229,197,139, 23,118,167, 78,157, 2,151,
+203,197,149, 43, 87,176,117,235, 86, 28, 60,120,176, 76,145,229,232,232,136, 22, 45, 90, 36, 60,121,242,164, 70,121,156,110,110,
+110, 57,209,209,209,102, 57, 57, 57,208,235,245,120,248,240, 33,118,237,218, 5, 59, 59, 59,216,216,216,192,214,214, 22,141, 26,
+ 53,130, 68, 34, 41, 17, 89,253,250,245,203,141,142,142, 54, 47,139,207,219,219, 91, 54,100,200, 16,199,208,208, 80,104,181,218,
+ 50, 5,214,180,105,211, 74, 91,145, 32,145, 72,208,163, 71,143,164, 87,175, 94,149,219,249,168, 87,175, 94,210,203,151, 47, 29,
+158, 61,123,246, 65, 93, 47, 75, 16,209, 52, 13, 83, 83, 83, 52,105,210, 36,229,201,147, 39, 14,255, 77,206,255,215, 22, 44,247,
+ 90, 14,243,190, 27,223, 83, 4,189, 6,172, 86, 1,104, 10, 0, 77, 62, 24,117, 1, 8, 79, 4,104, 21,176,226,103, 98,227,176,
+ 58,102,203, 79,189,123,213,214,213,182,235,181,152,180,139,229,241, 89, 88, 88, 44,218,182,109,155,197,139, 23, 47, 16, 25, 25,
+137,117,235,214, 97,233,210,165,224,241,120,200,204,204, 68,247,238,221,113,239,222, 61,104, 52, 26,204,159, 63,223,106,246,236,
+217,147, 80,232,108, 90, 69,235, 21,103,235,225,221, 27,173,172,232, 12,140,108, 27, 98,189,249,242,219,175, 1,252,252, 57, 22,
+192,234,213,171,197,179,102,205, 58,227,228,228,244, 89,139, 44,169, 84,218, 76, 36, 18, 93,156, 54,109,154,100,197,138, 21,159,
+ 68,172, 58, 59, 59,215,227,112, 56,135,212,106,245,140,164,164,164, 75,213,104,188,107, 7, 7, 7,175, 8, 15, 15, 63,150,159,
+159,127,164,172,115, 76, 76, 76,250,121,122,122,246, 12, 9, 9,153,199,178,236,219,202, 56, 5, 2,193,148,153, 51,103, 10, 19,
+ 19, 19,145,157,157, 13, 62,159, 95,178,202, 60, 33, 4, 2,129, 0, 20, 69,129,207,231,227,171,175,190, 18,254,242,203, 47,223,
+ 0, 24, 88,105,157,116,112, 24,181,127,255,126, 23,141, 70, 67,201,229,114,240,120, 60,240,120, 60, 52,104,208,128,158, 57,115,
+102,141, 41, 83,166,140, 7,176,169, 42,247,111,105,105, 57,108,255,254,253,110,124, 62,159, 74, 74, 74, 66,179,102,205,240,240,
+225, 67, 4, 7, 7,211,179,102,205,170, 57,105,210,164,177, 0,182, 86,213,202, 36, 22,139,235, 95,191,126, 61,190, 70,141, 26,
+ 37,189,175,218,181,107,235,187,118,237,154, 25, 17, 17,225,121,255,254,253,140, 38, 77,154,196, 85,129,211, 73, 44, 22,123,157,
+ 63,127, 62,105,201,146, 37,237,182,111,223,222, 3, 0, 26, 53,106,116,122,233,210,165,215, 50, 51, 51,235,221,190,125, 59,179,
+ 69,139, 22, 9, 85, 72,170,181,189,189,189,238,235,175,191, 54, 45,239,132,189,123,247,102, 0,176,171,164, 94,119,167, 40,106,
+113,189,122,245,204,218,180,105,131, 91,183,110, 97,242,228,201, 42,173, 86, 27, 5, 0,237,219,183,247, 88,180,104, 17, 63, 52,
+ 52, 20, 22, 22, 22,220,164,164,164,221, 82,169,212,232,248,110, 56,122, 0,184, 1,160, 30,128,107,132,144,254, 0,142, 2,240,
+ 6, 16, 9,160,239, 63,153, 56,189, 94, 15, 14,135,131,132,132, 4,252,242,203, 47,248,241,199, 31,225,238,238, 14,173, 86, 91,
+ 34,176, 56, 28, 14,184, 92, 46, 8, 33, 6, 47,165,165,211,233,240,248,241, 99,236,255,245, 87,204,159, 55, 15,166,166,133,213,
+ 84,163,209, 32, 51, 43, 11, 66,161,176,196,130, 85, 17, 88,150, 61,242,230,205,155,105,206,206,206, 31, 12, 13, 22,127, 22,181,
+113, 96, 24, 6, 58,157, 14, 42,149, 10, 59,119,238,212,177, 44,123,164,146,103,178,196,226, 53,109,218, 52,168, 84,127,246,149,
+125,125,125, 1, 0, 46, 46, 46,240,243,243, 43,249, 93,108,161, 50,132,115,103,211,250, 80,148, 58,219,115,209,154,226, 54, 31,
+158,158,158,112,116,116, 52,136,243,255,181,192,138,138, 75, 93, 57,107,241, 79,107, 36,124,154, 59,162,179, 55,164,102, 92, 64,
+100, 5, 94,203,217, 32, 22,181, 10, 43, 64,102, 44,112,121, 54,230,119,200,160,230, 40, 52, 39, 59,187, 89,217, 94,136, 46,215,
+185,174, 81,141, 26, 53,112,251,246,109,212,169, 83, 7, 11, 22, 44,128,151,151, 23, 36, 18, 9, 82, 82, 82, 32,151,203, 33,145,
+ 72,144,155,155,139,128,128, 0,218,212,212,180, 77, 85, 5, 22, 33, 36, 96,116,247,224, 70, 28,123,111, 52,107,215, 24,151, 23,
+182,150,236,189,153,248, 29, 33,100,119,233, 5, 87, 63, 23,244,237,219, 23,201,201,201,226, 13, 27, 54, 84, 91,100,185,184,184,
+ 92,214,104, 52, 95, 24, 96, 14,191, 30, 29, 29,221,182,186,226,234,204,153, 51, 18, 83, 83, 83,172, 88,177,226, 83,137,171, 59,
+ 29, 59,118, 52,187,116,233,210, 9, 71, 71,199, 94, 85, 17, 89,132,144,218,253,250,245, 59,187,107,215, 46,143,182,109,219,234,
+ 1,148,217,160,248,248,248,244,185,124,249,114,239,209,163, 71,215, 39,132,116,171, 76,100, 17, 66,154,214,174, 93, 27,241,241,
+241, 72, 73, 73,129, 82,169, 68, 74, 74, 10, 0, 32, 33, 33, 1,206,206,206,176,176,176,128,179,179, 51, 60, 60, 60, 8, 69, 81,
+193,134,164,183, 77,155, 54, 61, 0, 80, 49, 49, 49, 72, 75, 75,131,185,185, 57, 36, 18, 9,156,157,157,209,186,117,107,142,155,
+155, 91,151,170, 10,172,206,157, 59,247, 17,139,197, 84,124,124, 60,222,190,125, 11,149, 74,133,168,168, 40,152,155,155,163, 93,
+187,118, 92, 55, 55,183,110, 85, 21, 88, 0,234,143, 29, 59, 54,165,180,184, 42,134, 68, 34, 33, 30, 30, 30,153,214,214,214,129,
+ 0,226,170,194, 57,105,210,164,212,229,203,151,183,188,122,245,234,236,226,157, 87,175, 94,157, 5, 0, 63,253,244,211,109, 91,
+ 91,219, 64, 0, 85, 17, 88, 96, 89,150, 25, 61,122,244, 27, 30,143, 7, 62,159, 95,178, 9, 4, 2,112,185, 92,208, 52,109,110,
+ 0,205,220,200,200, 72, 95, 19, 19, 19, 68, 70, 70,130,166,105, 16, 66,222,200,100, 50, 95, 0,152, 61,123,118,180, 66,161,112,
+ 85, 42,149,232,219,183, 47,233,222,189,123,131,117,235,214,205, 3,240, 89, 8, 44, 66, 72, 67, 0,235, 0,168, 1,204, 99, 89,
+246,225,231,212,190,177, 44,155, 66, 8,105, 93, 74,100, 61, 1, 32, 40, 18, 87,173, 89,150, 77,249, 7,243, 14, 12,195,128,203,
+229, 98,205,154, 53,208,104, 52,248,237,183,223,112,244,232, 81, 80, 20, 85,226,232,110,102,102,134,141, 27, 55,254,197,241,189,
+ 50,225,182,119,239, 94,204,158, 53,171, 68, 92, 1, 0,143,199,131,131,189, 61,172,109,108, 16, 19, 19, 83,169,192, 74, 77, 77,
+ 93,248,232,209, 35, 84,228,228,222,187,247,159, 35,172,165,157,220, 13, 73, 39, 77,211, 80,169, 84,248,226,139, 63, 95, 31,147,
+ 38, 77, 42,249,158,153,153, 89,252, 76,128, 24,120,243, 52, 77, 67,193, 2, 61,133,127,238,235, 50, 99, 70,201,247,244,244,244,
+ 42,115,254,191, 20, 88, 45,163, 51, 55,221, 35,240,155, 53,178,221,112,169,141, 25,216,252, 20,240,218, 46,196,243, 76, 49, 54,
+108, 43,124, 23, 78,235, 27,128,250,237,151, 65,189,167, 3, 70,249,235,249,223, 36, 97, 38,128, 5,101,241,217,216,216, 88,235,
+116, 58, 16, 66, 32,145, 72,224,237,237, 13,161, 80,136,180,180, 52, 76,158, 60, 25, 23, 47, 94,132, 70,163, 1,143,199, 67,157,
+ 58,117,160,209,104, 92,171, 97,189,218,181,126,245,143, 22, 25, 97, 7, 16, 26,155, 13,177,117, 13,204, 27,212,200,114,209,111,
+143, 22, 2,152,245, 57, 22,130,159,159, 31,150, 44, 89, 34, 94,184,112, 97,181, 68,150, 70,163, 89,202,229,114,155,253,248,227,
+143,162, 65,131, 6,253,229,248,211,167, 79,209,183,111, 95,133, 82,169,252,161,186,226,234,244,233,211, 18, 43, 43, 43,196,199,
+199,227,239, 62, 19,197,226,234,247,223,127, 55,171, 85,171, 22,234,213,171, 39, 92,187,118,173,193, 34,139, 16,226,219,187,119,
+239,227,187,118,237,170, 53, 98,196,136,247, 33, 33, 33, 41,132,144,242,132,184,108,228,200,145,239,247,236,217,227, 65, 8, 57,
+ 91,153,200,210,233,116, 53,197, 98, 49,210,210,210, 48,117,234,212, 15, 28, 84,139,135,179, 1, 32, 50, 50, 18,206,206,206, 80,
+ 42,149, 78,134,220,179,149,149,149, 37, 0,140, 25, 51, 6,241,241,127,186, 43, 58, 57, 57, 33, 62, 62, 30, 58,157,206,170,170,
+249,104,101,101,101,165,213,106,209,162, 69, 11, 40,149, 74, 0, 64,255,254,253,193,229,114,145,154,154, 10,141, 70, 99, 93,141,
+226,177,233,218,181,171,172,188,131,102,102,102, 26, 75, 75, 75,239, 42,114, 90,119,239,222, 61,113,199,142, 29,127, 25,170,123,
+244,232,209,151, 86, 86, 86, 87,173,172,172, 60,170,145, 86,166,180,160, 42,254,206,231,243,139, 45, 14, 6,245,142, 25,134,193,
+185,115,231, 64,211, 52, 56,156, 63,155,196, 5, 11, 22,140,179,176,176,176,191,117,235, 22,146,147,147, 33,151,203,145,159,159,
+143,186,117,235,214,105,223,190,253,211,228,228,228,119,225,225,225,189,254,105, 35, 56,128, 98,191,176,173, 0,252, 62,183,246,
+173, 72,100,245, 3, 16, 82, 36,174,212, 0,250,252,147,226,170,116,217,115, 56,156,146,231, 92, 40, 20, 34, 32, 32,160, 68, 76,
+ 17, 66, 80, 80, 80, 0, 14,135, 83,236, 47,100, 80,227,151,157,157, 13, 71, 7, 7,152,154,154,162,174,187, 59,222, 68, 69, 1,
+ 64,201,119,129, 64, 0, 66, 8,116,186,138,189, 2,138,102, 2,126,131, 10,252,169,170, 41, 46,217, 98, 49, 84, 73,251, 15,134,
+ 97,138,219,124,246, 83,112,218,216,216, 32, 63, 63,223, 32,206,255,183, 2,107, 49, 33,212,189,186, 86,191,204, 26,222,122,120,
+ 11, 15, 75, 40,211,222, 66, 96,106, 3, 98,225,130, 13,219, 46,225,213,187, 66,215,168, 13, 71,195,176,247,187,142,128,200, 10,
+174, 38,145,176,145,136,123,149, 39,176, 50, 51, 51,229, 90,173,214, 74, 36, 18,129,195,225,128,207,231, 35, 35, 35, 3, 11, 22,
+ 44,192,225,195,135,225,226,226, 2,189, 94, 15,129, 64,128,212,212, 84,240,120,188, 42,205, 78,228,112, 72,215, 69, 99, 58,215,
+150, 56,184, 35,227,202,210,194,157,246,254, 24,219,157,226,175, 61,254,124, 24, 33,100, 45,203,178,169,159, 91, 33,152,152,152,
+160, 81,163, 70,152, 48, 97,130,120,219,182,109,251, 0, 56, 87,229,255, 50,153,236,174, 84, 42,237, 48,111,222,188,203,137,137,
+137,162,198,141, 27,195,196,196, 4, 38, 38, 38,136,136,136,192,255,177,119,237, 81, 81, 92,121,250,171,170,126, 3,205, 75,161,
+ 21, 80, 48, 1,154,230, 49,108, 0, 17,118,112,243, 24, 53,146, 77,102,141,102, 98, 98,226,104, 52,179,192,100, 93,204, 26, 95,
+135,205,104,194, 14,171, 39,103,116, 18, 71,196,179, 74,102,207, 1, 93, 38,232,134, 56,113, 9,230,140,154,241, 57,193, 30, 26,
+ 21,232,238,129, 70, 4,177, 5, 58, 60,187,171,155,174,187,127,208,221,211,102,120,116, 35,137,168,245,157,115, 79, 83,221,156,
+175,234,222,170,186,247,171,239,254,238,175,242,243,243,205, 44,203, 62, 63, 25,119, 76, 40, 20,150,102,103,103,251, 74, 36, 18,
+232,116, 58, 4, 7, 7,223, 83, 93,157,226,234,200,145, 35,254, 74,165, 18, 13, 13, 13,200,204,204,196,236,217,179,165,155, 54,
+109,154, 80,100, 57,158,120,126,125,244,232,209, 40,129, 64, 64,125,242,201, 39,243, 0,228,123,178,239,178,178,178,184,138,138,
+138, 95, 81, 20,181,140,140, 17,124, 40, 18,137,218,140, 70, 99,244,156, 57,115,112,232,208, 33,208, 52,141,142,142, 14,108,223,
+190, 29, 69, 69, 69, 88,176, 96, 1,228,114, 57,230,204,153, 3,157, 78, 7,169, 84,218,225,201,190,111,222,188,217,205,113, 92,
+232,201,147, 39, 97, 52, 26, 93,223, 71, 70, 70,162,167,167, 7, 22,139,165,203,219,182,108,107,107,235, 2,160, 80,171,213,104,
+105,105,193,210,165, 75,113,252,248,113,164,165,165,193, 17,143,213, 53,137, 83,100,103, 24,134, 76,208,254, 65, 83,201,233, 24,
+180,188,229, 4, 33,132,184, 11, 42,231,223,206, 34, 16, 8, 60, 9,242,255,165, 74,165,218,249,216, 99,143,197, 23, 20, 20, 8,
+ 25,134, 65, 86, 86,150,242,157,119,222, 49, 72,165,210, 25, 91,183,110,245, 25,205, 12, 6,144, 28, 31, 31,239, 59, 13,186, 15,
+119,151,110, 90, 46, 58,161, 40, 42,212,225,248,137, 1, 88, 29,159, 71, 40,138,122,198, 61,240,253,126, 58, 88, 59,119,238, 68,
+ 78, 78, 14, 20, 10, 5,182,108,217, 2,129, 64,224, 42, 20, 69,185, 28, 45,111, 16,170, 80,140,251,187, 51, 6,107,130,135,168,
+239, 36, 77,131,167, 98,104,100, 92, 21,120,228,222,125, 23,156, 15,165,192,114,138,171, 45, 63, 93,184, 38, 75,233,143,154, 51,
+127,194,211,143,211, 0, 43, 30,167, 11,181,129, 18,249, 66, 33,167, 35,198,177, 14,213, 6,131, 97,110, 96, 96, 32,172, 86, 43,
+196, 98, 49, 18, 19, 19,113,254,252,121,176, 44, 11,139,197,226,234, 28,175, 94,189, 10,171,213,122,198,139,155,133, 81,200,133,
+ 31,110, 46,120, 95, 14,205, 97, 4,250,138,241,116,106, 52, 48, 67, 5,166,187, 17,191,218,248, 66,240, 63,239, 58,182, 23, 30,
+196,203,220, 15,129,165,213,106, 81, 82, 82, 50,104,177, 88,126, 58, 25, 14,167,200, 42, 46, 46,174, 14, 12, 12,148, 61,249,228,
+147,208,104, 52,216,180,105,147,153,101,217,127,156,108,124,151,205,102, 91,251,217,103,159,157,140,142,142,246, 93,184,112,225,
+ 93,118,247,100,196, 21,195, 48, 95,173, 91,183, 78, 30, 21, 21, 5,189, 94,143,128,128, 0,248,249,249, 97,222,188,121, 40, 47,
+ 47,151,174, 90,181,106, 92,145, 69, 8, 33, 20, 69,229,173, 92,185,178,170,180,180, 52,114,237,218,181,134,202,202,202, 42, 0,
+ 99,117, 38,242,229,203,151,191, 80, 90, 90, 26,185,126,253,250, 70, 0,111,147,113, 86,118,112, 28,119, 78,167,211, 61,174, 82,
+169, 40,165, 82, 9,177, 88,140,240,240, 17,147, 42, 57, 57, 25,241,241,241, 16, 10,133, 0, 0,173, 86, 11, 0,151, 60,169,251,
+217,179,103, 63,109,106,106, 90,151,150,150,198,204,154, 53,203, 21, 60, 43, 18,137, 80, 88, 88,104, 53, 24, 12, 39,188,109,207,
+ 47,191,252,242,184, 70,163,121, 51, 43, 43, 75, 16, 20, 20, 4,137, 68,130,164,164, 36,132,133,133,161,176,176,208,218,220,220,
+124, 98, 18,167,169, 85,163,209, 72, 99, 99, 99, 71,237,249,101, 50,153, 63, 0,111,157,135, 27,151, 47, 95, 22,103,100,100,124,
+250,249,231,159, 39,186,255,144,158,158,254,169,159,159, 95, 0,128,142, 73, 28, 43,231, 46,168,156,197, 57,101,232,137,192,106,
+111,111,175,154, 53,107,214, 95, 20, 10,197, 31, 19, 18, 18, 2, 52, 26, 13, 10, 10, 10, 68, 22,139,101,110, 77, 77,141,107, 32,
+ 30,229, 58,196,192,192,128,108, 26,116, 31,249, 0,246, 0,240, 1,176,101, 26,138, 43, 5, 70, 2,218,227, 48, 50, 45,248,178,
+ 67,108, 57, 99,178,238,171,200, 34,132, 64, 40, 20, 34, 46, 46, 14, 27, 55,110,196,174, 93,187,144,151,151,135,216,216, 88,215,
+185,119, 6,185,123,227, 96,137, 68, 34, 40, 20,138,145, 69, 39, 14,247, 10, 0,180, 77, 77, 16, 8, 4,224, 56, 14, 44,203, 78,
+232, 96,133,134,134,238,220,189,123,247,134,236,236,108,250,219, 43,238,156,105, 37,220,139,205,102, 67, 85, 85,213,134,162,162,
+ 34,120,226,122, 49, 12,131,228,228,228,187,166, 5,247,237,251,107,164, 66, 74, 74, 10, 22, 47, 94,236,145,104,114,231,140,219,
+241,193, 93,211,130,191, 15,249,107,179,205, 89,253, 51,196,254,242, 35,175, 56, 31, 84,140,186, 70,242, 92, 76, 96,225,150,215,
+126,184, 38, 43, 70,142, 47,206, 92,193,222,223, 55, 55, 24, 58,186,192,117,106,192, 25,175, 35,255,165, 20,196, 71, 5, 35, 62,
+ 42, 24,249, 47,165,128,187, 93, 15,210,163, 7,145, 4,226,134, 9,237,227,216,166,187,222,127,255,125, 83,112,112, 48,100, 50,
+ 25,196, 98, 49,218,218,218,144,144,144, 0,137, 68,226,122, 2,165,105, 26, 5, 5, 5, 70,163,209,120,192,211,138,248,138,233,
+159,237,250,183,151, 21, 34,169, 31,112,227, 12,252,229,126, 56,244,155, 15,128,254,118,128, 17,225,133, 39,255,142,153, 61, 51,
+240, 25,138,162,148,211,237, 36,232,245,122,108,216,176, 97,208,108, 54,223, 83,160,123,123,123,251, 31,173, 86,235,146,162,162,
+162,161,178,178,178,123, 22, 87, 78, 78,150,101,151,238,217,179,103, 64,167,211,221,147,192, 18, 8, 4, 91,109, 54,155,127, 73,
+ 73, 9,151,154,154,106, 95,182,108,153,125,201,146, 37,246,204,204, 76,123, 66, 66,130,125,197,138, 21,118,179,217, 44,241,241,
+241,217, 61, 65,167,120,173,178,178,114,209,250,245,235, 27, 75, 75, 75, 35, 23, 44, 88, 16, 70, 8,249,197,104, 37, 45, 45, 77,
+225, 20, 87, 21, 21, 21, 19,198, 96, 89, 44,150,125,197,197,197,102,231, 42, 23,177, 88,140,144,144, 16,151, 16, 22,137, 68,144,
+ 72, 36,176, 90,173,216,191,127,255,208,208,208,208, 94, 79,234,222,213,213,117,120,243,230,205,173,213,213,213,182,222,222, 94,
+ 80, 20,133,155, 55,111,162,176,176,208,122,240,224,193,155, 38,147,233,160,183,237,217,219,219, 91,186,121,243,230,150, 19, 39,
+ 78,216,104,154, 70, 79, 79, 15,252,253,253, 93,156,125,125,125, 94,115,102,102,102,234, 12, 6,131,255,224,224,224,104,110, 38,
+229,235,235, 59, 31,192,151,222,112,166,164,164,232, 91, 91, 91,229,133,133,133,167, 23, 45, 90,180, 75, 46,151, 55,201,229,242,
+166, 69,139, 22,237,254,232,163,143,254, 32,149, 74,211, 1,120,253,114, 88,154,166, 57,247,126,195, 61, 6, 75, 34,145, 64, 36,
+ 18,121,148,166, 34, 32, 32,224,227,226,226,226,128,142,142, 14, 88, 44, 22,168,213,106,168,213,106,180,181,181,185, 6,225, 81,
+222,195,134,193,193, 65,233,253,238, 59, 8, 33,127, 32,132, 36, 19, 66,162, 9, 33,211,113,145,204,239,220,196,213, 83,132, 16,
+ 13,128,167, 28,219,137, 0,254,247,126, 58, 88, 78,129, 37, 16, 8,240,234,171,175,226,212,169, 83,136,137,137,113, 5,182,187,
+ 7,185,123, 35, 8,134,135,135,145,148,148, 4, 11,203,222, 37,208, 5, 2, 1, 66, 66, 67,161,211,233, 60,114,176, 40,138,250,
+ 73,118,118, 54,125,245,234, 85,168, 84, 42,212,214,214,186,138, 90,173, 70, 93, 93, 29,234,235,235,113,237,218, 53,164,166,166,
+194, 96, 48,224,217,103,159,117,166,105, 24,247,210,241,212,109,114,174, 4,244,192,109,250, 46, 56, 31, 62, 7, 43, 34,196,103,
+237, 15,231, 81,248,226,236, 21,124, 88,221,254, 49, 33,164,242,164,166,247,179,156,212, 97, 88, 43, 86, 33,233,165,255, 30,153,
+ 22, 4,192,221,174,135,181,226,117, 80, 62, 51,113,169, 83,140, 94,179,109,204,167,102,171,213,122, 49, 40, 40,232,200,225,195,
+135,215,189,241,198, 27, 98, 0,240,241,241,193,219,111,191, 13, 66, 8,196, 98, 49, 24,134, 65,110,110,110,255,237,219,183,247,
+ 16, 66,116, 30,222, 40,178,240, 32,113,193,107, 63,255,119, 41,212, 7, 1, 90,132, 59,126, 41, 72,126,118, 29,110, 55,158, 7,
+186,174, 3,140, 8, 7,118,188, 57,243,199,111,125,112, 16,192,194,233,114, 2,234,235,235,241,214, 91,111,221,179,184,250,182,
+147, 85, 94, 94,254, 91,150,101,223,156, 66,206,165, 91,182,108, 57,169, 80, 40, 38, 61, 45, 98, 48, 24, 86, 71, 70, 70,174,155,
+232,198,211,235,245, 19, 78,117, 16, 66,154, 41,138,122,190,165,165,229, 63, 26, 26, 26,142,143,245,127, 13, 13, 13,199, 23, 47,
+ 94,204, 92,188,120,113,171, 39,171, 8,107,107,107,107, 51, 50, 50,138,247,238,221,155,155,159,159, 47,147, 72, 36,240,247,247,
+ 71, 99, 99,163, 43, 15, 14,203,178,216,182,109,219,144,205,102,251,248,242,229,203,231, 61, 28, 8,135, 41,138,122, 37, 39, 39,
+103,189, 82,169,252, 49,199,113, 51, 88,150,237, 50, 24, 12, 39,250,250,250, 38,149, 7,139, 16,194, 81, 20,181, 42, 55, 55,119,
+ 77,108,108,236, 10,171,213, 58,195,110,183,119,181,182,182,126,218,219,219,123,104, 50,156,231,206,157, 51,238,223,191,255, 47,
+ 70,163, 81, 21, 17, 17,241,141,159,159, 31,203,178, 44, 35,147,201,252,125,125,125, 83, 0,156, 7,112,205, 27,206,175,191,254,
+250,214,129, 3, 7, 90, 44, 22, 75,220,129, 3, 7,206,250,251,251,159,162, 40,138, 18,137, 68, 65, 50,153,236,105, 0,167, 1,
+104,189, 61, 86,134, 97,198,117,176,224, 97,124, 71, 95, 95,223,197, 29, 59,118,164, 62,241,196, 19, 40, 46, 46,238,246,243,243,
+147,175, 88,177, 66, 96, 50,153,168,241, 28,172,233, 32,176, 30, 0,116, 57, 92,222,127,114,198, 92,185, 5,190,255, 14,128,233,
+ 62, 11,212,187,132,212,220,185,115, 93,219,238,197, 45, 6,203, 35,216,237,118,136, 68, 34, 8, 4, 2,204, 14, 11,115,137, 57,
+ 66, 8,116, 58, 29,186,187,187, 61, 18, 88, 52, 77, 51, 20, 69, 97,229,202,149, 30,237,247,149, 87, 94,193,233,211,167, 49,209,
+116,162,251,138,191,168,168,168, 9,197,144,227, 88, 60, 94, 69, 24, 17, 17, 49, 37,156, 15,165,192,106, 53,154, 11, 55, 30,188,
+188, 77,127,219, 82,249,247,218,158,141, 59, 0, 2, 4, 85,171,130,169, 37, 11,233, 54, 88, 14,102,129,242, 31, 25,108, 72,127,
+ 7, 40, 95, 5, 58, 16,129, 95, 87,235,111,217,136,117, 92,247,193,100, 50,229,239,219,183,143,169,174,174,126,185,168,168, 40,
+ 64,165, 82,225,245,215, 95, 7,203,178,168,171,171, 67, 78, 78, 78,183,209,104, 44, 49,153, 76,187, 60,173,196, 76, 63,193,187,
+123,255,101,201, 12,218,214, 15,220,170, 5, 36, 1,152, 25,228,135, 63, 95, 58, 3,220,250, 26, 96, 68, 0, 35, 70,218, 15, 84,
+ 72,142,143, 86, 81, 20,149, 69, 8,249,106, 58,156,128, 23, 95,124,113,202,196,149,187, 32, 2,240,216, 84, 30,167, 83,100,173,
+ 89,179,230, 36,199,113, 62,147,177,119, 29, 57,153,236, 83,216, 57, 54, 99,130, 41, 95, 71,250,134, 10,111,120,109, 54,219, 54,
+141, 70,131,220,220,220,220,213,171, 87,203,148, 74, 37,162,162,162,208,212,212,132,198,198, 70,148,148,148, 12, 13, 15, 15, 31,
+ 50,153, 76,155, 38, 81,255, 18, 71,153,170, 54,224, 0, 28,118,148, 41, 65, 94, 94,222,159,245,122,125, 87, 72, 72,200, 2,145,
+ 72,244, 3,140,196,249,220,114,236, 67, 59, 25,206,156,156, 28,181, 94,175,191, 19, 30, 30,158,225,224, 12, 4,112, 19,192,127,
+ 77,146,179, 75,173, 86, 71,167,167,167,115, 2,129,128, 56, 28, 6, 34, 20, 10,137, 80, 40, 36, 0, 80, 93, 93, 45, 1, 48, 97,
+204,101, 71, 71,199,191, 30, 59,118, 12, 53, 53, 53, 11,250,251,251, 95, 3,240,219,193,193,193,244,111,190,249,198, 53, 8,143,
+225,118, 74,120,253, 52,225,245,185,108,140,239, 59, 1,100, 77,131,227,195,123,239,189,135,146,146, 18, 76,148,129,188,170,170,
+ 10,152, 96,138,208,121,173, 56,197,147,213,106, 69,125,125,189,243,221,123,174,105, 65,103,138,134,225,225,225,113, 51,189,115,
+ 28,103,103, 89, 22, 71,143, 30,245, 72,100,149,151,151,195,108, 54,131,227, 56,143,250, 89, 71, 98, 82,116,119,119, 35, 44, 44,
+204,233, 56,187,155, 34, 94,183, 41,195, 48,136,139,139,195,157, 59,119, 48,115,230, 76, 0, 35,211,130, 46,119,111, 96,224,145,
+185,254,199, 77, 52,234,142,167,162, 2, 3,104, 17,117,236, 71, 49,162,167,158, 79,146, 99, 78,136, 31, 4, 98, 9,110,247,218,
+241,149,190, 31,255,115,222,120,131,181,219,159, 63,213,216,163,241,208,117,202,152, 61,123,246,118,187,221,158, 72,211,180, 15,
+ 33,164,159, 97,152, 43,237,237,237, 59, 9, 33,245,222, 84, 34, 80,198,104,131,124,153, 0,161, 80, 76,236, 28, 7,128, 6, 40,
+103, 97, 70, 62,233,145,237, 33,179, 85,100, 39, 84,101,167,241,206,250,251,221,248, 74,165,178,122, 96, 96,224,129,203,228,238,
+235,235,251, 11,173, 86,251,208,102,114,119, 98,254,252,249,105, 50,153,108, 59,199,113,243,205,102,243, 44,153, 76,214, 73, 81,
+212,159,250,250,250,254,243,202,149, 43, 23,248,225,243,254, 97, 42, 51,185,143,114,141,191, 0, 96,231,140, 25, 51,148,117,117,
+117, 18,119, 7,203,189,191,244, 38, 47, 18,143,233,135,248,248,248,139,101,101,101,105,115,231,206,165,221, 3,217,105,154,118,
+ 37,199,164,105,218,181,178,244,194,133, 11,195,121,121,121,231,213,106,245, 63,140,197, 25, 19, 19, 83, 93, 83, 83,179,216,100,
+ 50,253,141,144,114,207,236,238,220, 30, 26, 26,194,187,239,190,251,133, 86,171, 29,245, 85, 57, 42,149,106, 79, 65, 65,193,134,
+231,158,123,142,166,105,250,111, 98,174,156,175,245,113, 22,171,213,138,202,202, 74,174,180,180,244,195,235,215,175,143, 25,131,
+149,146,146,114,163,182,182, 54,194,153, 50, 97,172,226,142,140,140,140,142, 11, 23, 46,132,125,159,156,143,140,192,114,116, 40,
+212, 51, 49,129, 47, 19, 66,253,132, 2,149, 68, 83, 68, 60, 76,208, 72, 1,213, 62,131,146,253, 85,237,237, 67,252,109,203,227,
+161,188, 81, 40,138,230, 95,242,251,104, 33, 38, 38, 70,171,213,106,163,199,185, 38,120,129,245,128,139,244,144,144,144, 83, 52,
+ 77, 71, 58, 69,244, 88,159, 14, 55,169,165,179,179,243, 71,157,157,157, 99,230, 83,140,136,136,120, 92, 42,149,254,134,227,184,
+116, 79, 94,246, 76,211,244, 37,179,217,252,243,239,251,101,207,137,137,137,186, 75,151, 46, 61, 46,147,201,238,138, 43,116,214,
+249,219,199,222,220,220,140,229,203,151, 27,212,106,117,212,247,201,249, 72, 9, 44, 30, 60,120,240,120, 84, 16, 30, 30,126,209,
+106,181,170,204,102,179,208, 98,177, 8,135,135,135,239, 26,224,100, 50,153,113,112,112, 48,148,111, 41, 30, 15, 26,194,194,194,
+148,129,129,129,255, 39, 20, 10, 37,163, 61, 56,124, 27,118,187,221,220,213,213,181,180,189,189,189,241,251,228,124,224, 49,218,
+ 10,153,169, 42, 0, 22,241,156, 60, 39,207,201,115,242,156, 60, 39,207,201,115, 62,106,133,230,181, 60, 15, 30, 60,120,240,224,
+193,131,199,212,130, 23, 88, 60,120,240,224,193,131, 7, 15, 30,188,192,226,193,131, 7, 15, 30, 60,120,240,224, 5, 22, 15, 30,
+ 60,120,240,224,193,131,199, 35,133,255, 31, 0, 6,160,247, 56,137, 5,159,139, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
0};
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 735f1ffddb9..81ee2378717 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -67,279 +67,12 @@
#include "ED_sequencer.h"
#include "ED_util.h"
-#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "gpencil_intern.h"
/* ************************************************** */
-/* GREASE PENCIL PANEL-UI DRAWING */
-
-/* Every space which implements Grease-Pencil functionality should have a panel
- * for the settings. All of the space-dependent parts should be coded in the panel
- * code for that space, but the rest is all handled by generic panel here.
- */
-
-/* ------- Callbacks ----------- */
-/* These are just 'dummy wrappers' around gpencil api calls */
-
-#if 0
-// XXX
-/* make layer active one after being clicked on */
-void gp_ui_activelayer_cb (void *gpd, void *gpl)
-{
- gpencil_layer_setactive(gpd, gpl);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* rename layer and set active */
-void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg)
-{
- bGPdata *gpd= (bGPdata *)gpd_arg;
- bGPDlayer *gpl= (bGPDlayer *)gpl_arg;
-
- BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), 128);
- gpencil_layer_setactive(gpd, gpl);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* add a new layer */
-void gp_ui_addlayer_cb (void *gpd, void *dummy)
-{
- gpencil_layer_addnew(gpd);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* delete active layer */
-void gp_ui_dellayer_cb (void *gpd, void *dummy)
-{
- gpencil_layer_delactive(gpd);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* delete last stroke of active layer */
-void gp_ui_delstroke_cb (void *gpd, void *gpl)
-{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
-
- if (gpf) {
- if (gpf->framenum != CFRA) return;
-
- gpencil_layer_setactive(gpd, gpl);
- gpencil_frame_delete_laststroke(gpl, gpf);
-
- scrarea_queue_winredraw(curarea);
- }
-}
-
-/* delete active frame of active layer */
-void gp_ui_delframe_cb (void *gpd, void *gpl)
-{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
-
- gpencil_layer_setactive(gpd, gpl);
- gpencil_layer_delframe(gpl, gpf);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* convert the active layer to geometry */
-void gp_ui_convertlayer_cb (void *gpd, void *gpl)
-{
- gpencil_layer_setactive(gpd, gpl);
- gpencil_convert_menu();
-
- scrarea_queue_winredraw(curarea);
-}
-#endif
-
-/* ------- Drawing Code ------- */
-
-#if 0
-/* XXX */
-/* draw the controls for a given layer */
-static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco)
-{
- uiBut *but;
- short active= (gpl->flag & GP_LAYER_ACTIVE);
- short width= 314;
- short height;
- int rb_col;
-
- /* unless button has own callback, it adds this callback to button */
- uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl);
-
- /* draw header */
- {
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- /* rounded header */
- if (active) uiBlockSetCol(block, TH_BUT_ACTION);
- rb_col= (active)?-20:20;
- uiDefBut(block, ROUNDBOX, B_REDR, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), "");
- if (active) uiBlockSetCol(block, TH_AUTO);
-
- /* lock toggle */
- uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified");
- }
-
- /* when layer is locked or hidden, only draw header */
- if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
- char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */
-
- height= 0;
-
- /* visibility button (only if hidden but not locked!) */
- if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
- uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer");
-
- /* name */
- if (gpl->flag & GP_LAYER_HIDE)
- sprintf(name, "%s (Hidden)", gpl->info);
- else
- sprintf(name, "%s (Locked)", gpl->info);
- uiDefBut(block, LABEL, 1, name, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)");
-
- /* delete button (only if hidden but not locked!) */
- if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) {
- but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
- uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL);
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
- else {
- height= 97;
-
- /* draw rest of header */
- {
- /* visibility button */
- uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer");
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- /* name */
- but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+36, *yco, 240, 19, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)");
- uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl);
-
- /* delete 'button' */
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
- uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
-
- /* draw backdrop */
- if (active) uiBlockSetCol(block, TH_BUT_ACTION);
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, "");
- if (active) uiBlockSetCol(block, TH_AUTO);
-
- /* draw settings */
- {
- /* color */
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_REDR, "", *xco, *yco-26, 150, 19, gpl->color, 0, 0, 0, 0, "Color to use for all strokes on this Grease Pencil Layer");
- uiDefButF(block, NUMSLI, B_REDR, "Opacity: ", *xco,*yco-45,150,19, &gpl->color[3], 0.3f, 1.0f, 0, 0, "Visibility of stroke (0.3 to 1.0)");
- uiBlockEndAlign(block);
-
- /* stroke thickness */
- uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)");
-
- /* debugging options */
- if (G.f & G_DEBUG) {
- uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco, *yco-95, 150, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes");
- }
-
- /* onion-skinning */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame");
- uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Max number of frames on either side of active frame to show (0 = just 'first' available sketch on either side)");
- uiBlockEndAlign(block);
-
- /* options */
- uiBlockBeginAlign(block);
- if (curarea->spacetype == SPACE_VIEW3D) {
- but= uiDefBut(block, BUT, B_REDR, "Convert to...", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Converts this layer's strokes to geometry (Hotkey = Alt-Shift-C)");
- uiButSetFunc(but, gp_ui_convertlayer_cb, gpd, gpl);
- }
- else {
- but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer (Hotkey = Alt-XKEY/DEL)");
- uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl);
- }
-
- but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame (Hotkey = Alt-XKEY/DEL)");
- uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl);
- uiBlockEndAlign(block);
- }
- }
-
- /* adjust height for new to start */
- (*yco) -= (height + 27);
-}
-#endif
-/* Draw the contents for a grease-pencil panel. This assumes several things:
- * - that panel has been created, is 318 x 204. max yco is 225
- * - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225)
- * which is basically the top left-hand corner
- * It will return the amount of extra space to extend the panel by
- */
-short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa)
-{
-#if 0
- uiBut *but;
- bGPDlayer *gpl;
- short xco= 10, yco= 170;
-
- /* draw gpd settings first */
- {
- /* add new layer buttons */
- but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,205,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer");
- uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL);
-
-
- /* show override lmb-clicks button + painting lock */
- uiBlockBeginAlign(block);
- if ((gpd->flag & GP_DATA_EDITPAINT)==0) {
- uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 130, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes");
-
- uiBlockSetCol(block, TH_BUT_SETTING);
- uiDefIconButBitI(block, ICONTOG, GP_DATA_LMBPLOCK, B_REDR, ICON_UNLOCKED, 300, 225, 20, 20, &gpd->flag, 0.0, 0.0, 0, 0, "Painting cannot occur with Shift-LMB (when making selections)");
- uiBlockSetCol(block, TH_AUTO);
- }
- else
- uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes");
- uiBlockEndAlign(block);
-
- /* 'view align' button (naming depends on context) */
- if (sa->spacetype == SPACE_VIEW3D)
- uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space");
- else
- uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas");
- }
-
- /* draw for each layer */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- gp_drawui_layer(block, gpd, gpl, &xco, &yco);
- }
-
- /* return new height if necessary */
- return (yco < 0) ? (204 - yco) : 204;
-#endif
- return 0;
-}
-
-/* ************************************************** */
/* GREASE PENCIL DRAWING */
/* ----- General Defines ------ */
@@ -350,6 +83,7 @@ enum {
GP_DRAWDATA_ONLY3D = (1<<1), /* only draw 3d-strokes */
GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */
GP_DRAWDATA_ONLYI2D = (1<<3), /* only draw 'image' strokes */
+ GP_DRAWDATA_IEDITHACK = (1<<4), /* special hack for drawing strokes in Image Editor (weird coordinates) */
};
/* thickness above which we should use special drawing */
@@ -389,11 +123,21 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
glBegin(GL_LINE_STRIP);
for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
+ /* if there was a significant pressure change, stop the curve, change the thickness of the stroke,
+ * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP)
+ */
if (fabs(pt->pressure - oldpressure) > 0.2f) {
glEnd();
glLineWidth(pt->pressure * thickness);
glBegin(GL_LINE_STRIP);
+ /* need to roll-back one point to ensure that there are no gaps in the stroke */
+ if (i != 0) {
+ pt--;
+ glVertex2f(pt->x, pt->y);
+ pt++;
+ }
+ /* now the point we want... */
glVertex2f(pt->x, pt->y);
oldpressure = pt->pressure;
@@ -432,8 +176,8 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sfl
co[1]= (points->y * winy) + offsy;
}
else {
- co[0]= (points->x / 1000 * winx);
- co[1]= (points->y / 1000 * winy);
+ co[0]= (points->x / 100 * winx);
+ co[1]= (points->y / 100 * winy);
}
/* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple dot looks ok
@@ -473,11 +217,21 @@ static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thicknes
/* draw stroke curve */
glBegin(GL_LINE_STRIP);
for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
+ /* if there was a significant pressure change, stop the curve, change the thickness of the stroke,
+ * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP)
+ */
if (fabs(pt->pressure - oldpressure) > 0.2f) {
glEnd();
glLineWidth(pt->pressure * thickness);
glBegin(GL_LINE_STRIP);
+ /* need to roll-back one point to ensure that there are no gaps in the stroke */
+ if (i != 0) {
+ pt--;
+ glVertex3f(pt->x, pt->y, pt->z);
+ pt++;
+ }
+ /* now the point we want... */
glVertex3f(pt->x, pt->y, pt->z);
oldpressure = pt->pressure;
@@ -501,14 +255,12 @@ static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thicknes
/* draw a given stroke in 2d */
static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag,
short debug, int offsx, int offsy, int winx, int winy)
-{
- int spacetype= 0; // XXX make local gpencil state var?
-
+{
/* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, 'smooth' opengl lines look better
* - 'smooth' opengl lines are also required if Image Editor 'image-based' stroke
*/
if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) ||
- ((spacetype==SPACE_IMAGE) && (dflag & GP_DRAWDATA_ONLYV2D)) )
+ ((dflag & GP_DRAWDATA_IEDITHACK) && (dflag & GP_DRAWDATA_ONLYV2D)) )
{
bGPDspoint *pt;
int i;
@@ -525,8 +277,8 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness,
glVertex2f(x, y);
}
else {
- const float x= (pt->x / 1000 * winx);
- const float y= (pt->y / 1000 * winy);
+ const float x= (pt->x / 100 * winx);
+ const float y= (pt->y / 100 * winy);
glVertex2f(x, y);
}
@@ -565,10 +317,10 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness,
s1[1]= (pt2->y * winy) + offsy;
}
else {
- s0[0]= (pt1->x / 1000 * winx);
- s0[1]= (pt1->y / 1000 * winy);
- s1[0]= (pt2->x / 1000 * winx);
- s1[1]= (pt2->y / 1000 * winy);
+ s0[0]= (pt1->x / 100 * winx);
+ s0[1]= (pt1->y / 100 * winy);
+ s1[0]= (pt2->x / 100 * winx);
+ s1[1]= (pt2->y / 100 * winy);
}
/* calculate gradient and normal - 'angle'=(ny/nx) */
@@ -713,8 +465,8 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness,
glVertex2f(x, y);
}
else {
- const float x= (float)(pt->x / 1000 * winx);
- const float y= (float)(pt->y / 1000 * winy);
+ const float x= (float)(pt->x / 100 * winx);
+ const float y= (float)(pt->y / 100 * winy);
glVertex2f(x, y);
}
@@ -766,6 +518,9 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
{
bGPDlayer *gpl, *actlay=NULL;
+ /* reset line drawing style (in case previous user didn't reset) */
+ setlinestyle(0);
+
/* turn on smooth lines (i.e. anti-aliasing) */
glEnable(GL_LINE_SMOOTH);
@@ -872,47 +627,7 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
/* turn off alpha blending, then smooth lines */
glDisable(GL_BLEND); // alpha blending
glDisable(GL_LINE_SMOOTH); // smooth lines
-
- /* show info for debugging the status of gpencil */
-#if 0
- if ( ((dflag & GP_DRAWDATA_NOSTATUS)==0) && (gpd->flag & GP_DATA_DISPINFO) ) {
- char printable[256];
- short xmax;
-
- /* get text to display */
- if (actlay) {
- if (gpd->flag & GP_DATA_EDITPAINT)
- UI_ThemeColor(TH_BONE_POSE); // should be blue-ish
- else if (actlay->actframe == NULL)
- UI_ThemeColor(TH_REDALERT);
- else if (actlay->actframe->framenum == cfra)
- UI_ThemeColor(TH_VERTEX_SELECT); // should be yellow
- else
- UI_ThemeColor(TH_TEXT_HI);
-
- if (actlay->actframe) {
- sprintf(printable, "GPencil: Layer ('%s'), Frame (%d)%s",
- actlay->info, actlay->actframe->framenum,
- ((gpd->flag & GP_DATA_EDITPAINT)?" , Draw Mode On":"") );
- }
- else {
- sprintf(printable, "GPencil: Layer ('%s'), Frame <None>%s",
- actlay->info, ((gpd->flag & GP_DATA_EDITPAINT)?" , Draw Mode On":"") );
- }
- }
- else {
- UI_ThemeColor(TH_REDALERT);
- sprintf(printable, "GPencil: Layer <None>");
- }
- xmax= GetButStringLength(printable);
- /* only draw it if view is wide enough (assume padding of 20 is enough for now) */
- if (winx > (xmax + 20)) {
- BLF_draw_default(winx-xmax, winy-20, 0.0f, printable);
- }
- }
-#endif
-
/* restore initial gl conditions */
glLineWidth(1.0);
glPointSize(1.0);
@@ -921,6 +636,12 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
/* ----- Grease Pencil Sketches Drawing API ------ */
+// ............................
+// XXX
+// We need to review the calls below, since they may be/are not that suitable for
+// the new ways that we intend to be drawing data...
+// ............................
+
/* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */
void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf)
{
@@ -933,7 +654,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf)
/* check that we have grease-pencil stuff to draw */
if (ELEM(NULL, sa, ibuf)) return;
- gpd= gpencil_data_getactive(sa);
+ gpd= gpencil_data_get_active(C); // XXX
if (gpd == NULL) return;
/* calculate rect */
@@ -950,7 +671,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf)
wmOrtho2(ar->v2d.cur.xmin, ar->v2d.cur.xmax, ar->v2d.cur.ymin, ar->v2d.cur.ymax);
- dflag |= GP_DRAWDATA_ONLYV2D;
+ dflag |= GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_IEDITHACK;
}
break;
@@ -1007,9 +728,14 @@ void draw_gpencil_2dview (bContext *C, short onlyv2d)
/* check that we have grease-pencil stuff to draw */
if (sa == NULL) return;
- gpd= gpencil_data_getactive(sa);
+ gpd= gpencil_data_get_active(C); // XXX
if (gpd == NULL) return;
+ /* special hack for Image Editor */
+ // FIXME: the opengl poly-strokes don't draw at right thickness when done this way, so disabled
+ if (sa->spacetype == SPACE_IMAGE)
+ dflag |= GP_DRAWDATA_IEDITHACK;
+
/* draw it! */
if (onlyv2d) dflag |= (GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_NOSTATUS);
gp_draw_data(gpd, 0, 0, ar->winx, ar->winy, CFRA, dflag);
@@ -1020,14 +746,13 @@ void draw_gpencil_2dview (bContext *C, short onlyv2d)
*/
void draw_gpencil_3dview (bContext *C, short only3d)
{
- ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
Scene *scene= CTX_data_scene(C);
bGPdata *gpd;
int dflag = 0;
/* check that we have grease-pencil stuff to draw */
- gpd= gpencil_data_getactive(sa);
+ gpd= gpencil_data_get_active(C); // XXX
if (gpd == NULL) return;
/* draw it! */
@@ -1047,7 +772,7 @@ void draw_gpencil_oglrender (bContext *C)
/* assume gpencil data comes from v3d */
if (v3d == NULL) return;
- gpd= v3d->gpd;
+ gpd= gpencil_data_get_active(C);
if (gpd == NULL) return;
/* pass 1: draw 3d-strokes ------------ > */
@@ -1055,7 +780,7 @@ void draw_gpencil_oglrender (bContext *C)
/* pass 2: draw 2d-strokes ------------ > */
/* adjust view matrices */
- wmOrtho2(-0.375f, (float)(ar->winx)-0.375f, -0.375f, (float)(ar->winy)-0.375f);
+ wmOrtho2(-0.375f, (float)(ar->winx)-0.375f, -0.375f, (float)(ar->winy)-0.375f); // XXX may not be correct anymore
glLoadIdentity();
/* draw it! */
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
new file mode 100644
index 00000000000..0d7cd263245
--- /dev/null
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -0,0 +1,281 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008, Blender Foundation, Joshua Leung
+ * This is a new part of Blender
+ *
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stddef.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+
+#include "DNA_gpencil_types.h"
+#include "DNA_listBase.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_gpencil.h"
+#include "BKE_utildefines.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "RNA_access.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "ED_gpencil.h"
+#include "ED_sequencer.h"
+#include "ED_util.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "gpencil_intern.h"
+
+/* ************************************************** */
+/* GREASE PENCIL PANEL-UI DRAWING */
+
+/* Every space which implements Grease-Pencil functionality should have a panel
+ * for the settings. All of the space-dependent parts should be coded in the panel
+ * code for that space, but the rest is all handled by generic panel here.
+ */
+
+/* ------- Callbacks ----------- */
+/* These are just 'dummy wrappers' around gpencil api calls */
+
+/* make layer active one after being clicked on */
+void gp_ui_activelayer_cb (bContext *C, void *gpd, void *gpl)
+{
+ gpencil_layer_setactive(gpd, gpl);
+
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
+}
+
+/* delete 'active' layer */
+void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl)
+{
+ /* make sure the layer we want to remove is the active one */
+ gpencil_layer_setactive(gpd, gpl);
+ gpencil_layer_delactive(gpd);
+
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
+}
+
+/* ------- Drawing Code ------- */
+
+/* draw the controls for a given layer */
+static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl)
+{
+ uiLayout *box=NULL, *split=NULL;
+ uiLayout *col=NULL, *subcol=NULL;
+ uiLayout *row=NULL, *subrow=NULL;
+ uiBlock *block;
+ uiBut *but;
+ PointerRNA ptr;
+ int icon;
+
+ /* make pointer to layer data */
+ RNA_pointer_create((ID *)gpd, &RNA_GPencilLayer, gpl, &ptr);
+
+ /* unless button has own callback, it adds this callback to button */
+ block= uiLayoutGetBlock(layout);
+ uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl);
+
+ /* draw header ---------------------------------- */
+ /* get layout-row + UI-block for header */
+ box= uiLayoutBox(layout);
+
+ row= uiLayoutRow(box, 0);
+ block= uiLayoutGetBlock(row); // err...
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+
+ /* left-align ............................... */
+ subrow= uiLayoutRow(row, 1);
+ uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT);
+
+ /* active */
+ icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
+ uiItemR(subrow, "", icon, &ptr, "active", 0);
+
+ /* locked */
+ icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
+ uiItemR(subrow, "", icon, &ptr, "locked", 0);
+
+ /* when layer is locked or hidden, only draw header */
+ if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
+ char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */
+
+ /* visibility button (only if hidden but not locked!) */
+ if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
+ uiItemR(subrow, "", ICON_RESTRICT_VIEW_ON, &ptr, "hide", 0);
+
+
+ /* name */
+ if (gpl->flag & GP_LAYER_HIDE)
+ sprintf(name, "%s (Hidden)", gpl->info);
+ else
+ sprintf(name, "%s (Locked)", gpl->info);
+ uiItemL(subrow, name, 0);
+
+ /* delete button (only if hidden but not locked!) */
+ if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) {
+ /* right-align ............................... */
+ subrow= uiLayoutRow(row, 1);
+ uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);
+ block= uiLayoutGetBlock(subrow); // XXX... err...
+
+ but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
+ uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
+ }
+ uiBlockSetEmboss(block, UI_EMBOSS);
+ }
+ else {
+ /* draw rest of header -------------------------------- */
+ /* visibility button */
+ uiItemR(subrow, "", ICON_RESTRICT_VIEW_OFF, &ptr, "hide", 0);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* name */
+ uiItemR(subrow, "", 0, &ptr, "info", 0);
+
+ /* delete 'button' */
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ /* right-align ............................... */
+ subrow= uiLayoutRow(row, 1);
+ uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);
+ block= uiLayoutGetBlock(subrow); // XXX... err...
+
+ but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
+ uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+
+ /* new backdrop ----------------------------------- */
+ box= uiLayoutBox(layout);
+ split= uiLayoutSplit(box, 0.5f);
+
+
+ /* draw settings ---------------------------------- */
+ /* left column ..................... */
+ col= uiLayoutColumn(split, 0);
+
+ /* color */
+ subcol= uiLayoutColumn(col, 1);
+ uiItemR(subcol, "", 0, &ptr, "color", 0);
+ uiItemR(subcol, NULL, 0, &ptr, "opacity", UI_ITEM_R_SLIDER);
+
+ /* stroke thickness */
+ subcol= uiLayoutColumn(col, 1);
+ uiItemR(subcol, NULL, 0, &ptr, "line_thickness", UI_ITEM_R_SLIDER);
+
+ /* debugging options */
+ if (G.f & G_DEBUG) {
+ subcol= uiLayoutColumn(col, 1);
+ uiItemR(subcol, NULL, 0, &ptr, "show_points", 0);
+ }
+
+ /* right column ................... */
+ col= uiLayoutColumn(split, 0);
+
+ /* onion-skinning */
+ subcol= uiLayoutColumn(col, 1);
+ uiItemR(subcol, "Onion Skinning", 0, &ptr, "use_onion_skinning", 0);
+ uiItemR(subcol, "GStep", 0, &ptr, "max_ghost_range", 0); // XXX shorter name here? (i.e. GStep)
+
+ /* additional options... */
+ subcol= uiLayoutColumn(col, 1);
+ uiItemO(subcol, "Delete Frame", 0, "GPENCIL_OT_active_frame_delete");
+ uiItemO(subcol, "Convert...", 0, "GPENCIL_OT_convert");
+ }
+}
+
+/* Draw the contents for a grease-pencil panel*/
+static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr)
+{
+ PointerRNA gpd_ptr;
+ bGPDlayer *gpl;
+ uiLayout *col;
+
+ /* make new PointerRNA for Grease Pencil block */
+ RNA_id_pointer_create((ID *)gpd, &gpd_ptr);
+
+ /* draw gpd settings first ------------------------------------- */
+ col= uiLayoutColumn(layout, 0);
+ /* current Grease Pencil block */
+ // TODO: show some info about who owns this?
+ uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", "GPENCIL_OT_data_unlink");
+
+ /* add new layer button - can be used even when no data, since it can add a new block too */
+ uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add");
+
+ /* sanity checks... */
+ if (gpd == NULL)
+ return;
+
+ /* draw each layer --------------------------------------------- */
+ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
+ col= uiLayoutColumn(layout, 1);
+ gp_drawui_layer(col, gpd, gpl);
+ }
+
+ /* draw gpd drawing settings first ------------------------------------- */
+ col= uiLayoutColumn(layout, 0);
+ /* label */
+ uiItemL(col, "Drawing Settings:", 0);
+
+ /* 'stick to view' option */
+ uiItemR(col, NULL, 0, &gpd_ptr, "view_space_draw", 0);
+}
+
+
+/* Standard panel to be included whereever Grease Pencil is used... */
+void gpencil_panel_standard(const bContext *C, Panel *pa)
+{
+ bGPdata **gpd_ptr = NULL;
+ PointerRNA ptr;
+
+ //if (v3d->flag2 & V3D_DISPGP)... etc.
+
+ /* get pointer to Grease Pencil Data */
+ gpd_ptr= gpencil_data_get_pointers((bContext *)C, &ptr);
+
+ if (gpd_ptr)
+ draw_gpencil_panel((bContext *)C, pa->layout, *gpd_ptr, &ptr);
+}
+
+/* ************************************************** */
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index ef4e09274f2..8cf1affa8c6 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2008, Blender Foundation
+ * The Original Code is Copyright (C) 2008, Blender Foundation, Joshua Leung
* This is a new part of Blender
*
* Contributor(s): Joshua Leung
@@ -25,6 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -59,6 +60,8 @@
#include "BKE_gpencil.h"
#include "BKE_image.h"
#include "BKE_library.h"
+#include "BKE_object.h"
+#include "BKE_report.h"
#include "BKE_utildefines.h"
#include "BIF_gl.h"
@@ -67,6 +70,9 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "RNA_access.h"
+#include "RNA_define.h"
+
#include "UI_view2d.h"
#include "ED_armature.h"
@@ -74,275 +80,312 @@
#include "ED_sequencer.h"
#include "ED_view3d.h"
-#include "PIL_time.h" /* sleep */
-
#include "gpencil_intern.h"
-/* XXX */
-static void BIF_undo_push() {}
-static void error() {}
-static int pupmenu() {return 0;}
-static void add_object_draw() {}
-static int get_activedevice() {return 0;}
-#define L_MOUSE 0
-#define R_MOUSE 0
-
-/* ************************************************** */
-/* XXX - OLD DEPRECEATED CODE... */
+/* ************************************************ */
+/* Context Wrangling... */
-/* ----------- GP-Datablock API ------------- */
-
-/* get the appropriate bGPdata from the active/given context */
-// XXX region or region data?
-bGPdata *gpencil_data_getactive (ScrArea *sa)
+/* Get pointer to active Grease Pencil datablock, and an RNA-pointer to trace back to whatever owns it */
+bGPdata **gpencil_data_get_pointers (bContext *C, PointerRNA *ptr)
{
- ScrArea *curarea= NULL; // XXX
+ Scene *scene= CTX_data_scene(C);
+ ScrArea *sa= CTX_wm_area(C);
- /* error checking */
- if ((sa == NULL) && (curarea == NULL))
- return NULL;
- if (sa == NULL)
- sa= curarea;
-
- /* handle depending on spacetype */
- switch (sa->spacetype) {
- case SPACE_VIEW3D:
- {
- View3D *v3d= sa->spacedata.first;
- return v3d->gpd;
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= sa->spacedata.first;
- return snode->gpd;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= sa->spacedata.first;
+ /* if there's an active area, check if the particular editor may
+ * have defined any special Grease Pencil context for editing...
+ */
+ if (sa) {
+ switch (sa->spacetype) {
+ case SPACE_VIEW3D: /* 3D-View */
+ {
+ Object *ob= CTX_data_active_object(C);
+
+ // TODO: we can include other data-types such as bones later if need be...
+
+ /* just in case no active object */
+ if (ob) {
+ /* for now, as long as there's an object, default to using that in 3D-View */
+ if (ptr) RNA_id_pointer_create(&ob->id, ptr);
+ return &ob->gpd;
+ }
+ }
+ break;
- /* only applicable for image modes */
- if (sseq->mainb != SEQ_DRAW_SEQUENCE)
- return sseq->gpd;
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= sa->spacedata.first;
- return sima->gpd;
+ case SPACE_NODE: /* Nodes Editor */
+ {
+ //SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C);
+
+ /* return the GP data for the active node block/node */
+ }
+ break;
+
+ case SPACE_SEQ: /* Sequencer */
+ {
+ //SpaceSeq *sseq= (SpaceSeq *)CTX_wm_space_data(C);
+
+ /* return the GP data for the active strips/image/etc. */
+ }
+ break;
+
+ case SPACE_IMAGE: /* Image/UV Editor */
+ {
+ SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C);
+
+ /* for now, Grease Pencil data is associated with the space... */
+ // XXX our convention for everything else is to link to data though...
+ if (ptr) RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_SpaceImageEditor, sima, ptr);
+ return &sima->gpd;
+ }
+ break;
+
+ default: /* unsupported space */
+ return NULL;
}
- break;
}
- /* nothing found */
- return NULL;
+ /* just fall back on the scene's GP data */
+ if (ptr) RNA_id_pointer_create((ID *)scene, ptr);
+ return (scene) ? &scene->gpd : NULL;
}
-/* set bGPdata for the active/given context, and return success/fail */
-short gpencil_data_setactive (ScrArea *sa, bGPdata *gpd)
+/* Get the active Grease Pencil datablock */
+bGPdata *gpencil_data_get_active (bContext *C)
{
- ScrArea *curarea= NULL; // XXX
-
- /* error checking */
- if ((sa == NULL) && (curarea == NULL))
- return 0;
- if (gpd == NULL)
- return 0;
- if (sa == NULL)
- sa= curarea;
-
- /* handle depending on spacetype */
- // TODO: someday we should have multi-user data, so no need to loose old data
- switch (sa->spacetype) {
- case SPACE_VIEW3D:
- {
- View3D *v3d= sa->spacedata.first;
-
- /* free the existing block */
- if (v3d->gpd)
- free_gpencil_data(v3d->gpd);
- v3d->gpd= gpd;
-
- return 1;
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= sa->spacedata.first;
-
- /* free the existing block */
- if (snode->gpd)
- free_gpencil_data(snode->gpd);
- snode->gpd= gpd;
-
- /* set special settings */
- gpd->flag |= GP_DATA_VIEWALIGN;
-
- return 1;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= sa->spacedata.first;
-
- /* only applicable if right mode */
- if (sseq->mainb != SEQ_DRAW_SEQUENCE) {
- /* free the existing block */
- if (sseq->gpd)
- free_gpencil_data(sseq->gpd);
- sseq->gpd= gpd;
-
- return 1;
- }
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= sa->spacedata.first;
-
- if (sima->gpd)
- free_gpencil_data(sima->gpd);
- sima->gpd= gpd;
-
- return 1;
- }
- break;
- }
-
- /* failed to add */
- return 0;
+ bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL);
+ return (gpd_ptr) ? *(gpd_ptr) : NULL;
}
-/* return the ScrArea that has the given GP-datablock
- * - assumes that only searching in current screen
- * - is based on GP-datablocks only being able to
- * exist for one area at a time (i.e. not multiuser)
- */
-ScrArea *gpencil_data_findowner (bGPdata *gpd)
+/* ************************************************ */
+/* Panel Operators */
+
+/* poll callback for adding data/layers - special */
+static int gp_add_poll (bContext *C)
+{
+ /* the base line we have is that we have somewhere to add Grease Pencil data */
+ return gpencil_data_get_pointers(C, NULL) != NULL;
+}
+
+/* ******************* Add New Data ************************ */
+
+/* add new datablock - wrapper around API */
+static int gp_data_add_exec (bContext *C, wmOperator *op)
{
- bScreen *curscreen= NULL; // XXX
- ScrArea *sa;
+ bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL);
- /* error checking */
- if (gpd == NULL)
- return NULL;
-
- /* loop over all scrareas for current screen, and check if that area has this gpd */
- for (sa= curscreen->areabase.first; sa; sa= sa->next) {
- /* use get-active func to see if match */
- if (gpencil_data_getactive(sa) == gpd)
- return sa;
+ if (gpd_ptr == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go");
+ return OPERATOR_CANCELLED;
+ }
+ else {
+ /* just add new datablock now */
+ *gpd_ptr= gpencil_data_addnew("GPencil");
}
- /* not found */
- return NULL;
+ /* notifiers */
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work
+
+ return OPERATOR_FINISHED;
}
-/* ************************************************** */
-/* GREASE-PENCIL EDITING - Tools */
+void GPENCIL_OT_data_add (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Grease Pencil Add New";
+ ot->idname= "GPENCIL_OT_data_add";
+ ot->description= "Add new Grease Pencil datablock.";
+
+ /* callbacks */
+ ot->exec= gp_data_add_exec;
+ ot->poll= gp_add_poll;
+}
-/* --------- Data Deletion ---------- */
+/* ******************* Unlink Data ************************ */
-/* delete the last stroke on the active layer */
-void gpencil_delete_laststroke (bGPdata *gpd, int cfra)
+/* poll callback for adding data/layers - special */
+static int gp_data_unlink_poll (bContext *C)
{
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- bGPDframe *gpf= gpencil_layer_getframe(gpl, cfra, 0);
+ bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL);
- gpencil_frame_delete_laststroke(gpl, gpf);
+ /* if we have access to some active data, make sure there's a datablock before enabling this */
+ return (gpd_ptr && *gpd_ptr);
}
-/* delete the active frame */
-void gpencil_delete_actframe (bGPdata *gpd, int cfra)
+
+/* unlink datablock - wrapper around API */
+static int gp_data_unlink_exec (bContext *C, wmOperator *op)
{
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- bGPDframe *gpf= gpencil_layer_getframe(gpl, cfra, 0);
+ bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL);
- gpencil_layer_delframe(gpl, gpf);
+ if (gpd_ptr == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go");
+ return OPERATOR_CANCELLED;
+ }
+ else {
+ /* just unlink datablock now, decreasing its user count */
+ bGPdata *gpd= (*gpd_ptr);
+
+ gpd->id.us--;
+ *gpd_ptr= NULL;
+ }
+
+ /* notifiers */
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work
+
+ return OPERATOR_FINISHED;
}
+void GPENCIL_OT_data_unlink (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Grease Pencil Unlink";
+ ot->idname= "GPENCIL_OT_data_unlink";
+ ot->description= "Unlink active Grease Pencil datablock.";
+
+ /* callbacks */
+ ot->exec= gp_data_unlink_exec;
+ ot->poll= gp_data_unlink_poll;
+}
+/* ******************* Add New Layer ************************ */
-/* delete various grase-pencil elements
- * mode: 1 - last stroke
- * 2 - active frame
- * 3 - active layer
- */
-void gpencil_delete_operation (int cfra, short mode)
+/* add new layer - wrapper around API */
+static int gp_layer_add_exec (bContext *C, wmOperator *op)
{
- bGPdata *gpd;
-
- /* get datablock to work on */
- gpd= gpencil_data_getactive(NULL);
- if (gpd == NULL) return;
+ bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL);
- switch (mode) {
- case 1: /* last stroke */
- gpencil_delete_laststroke(gpd, cfra);
- break;
- case 2: /* active frame */
- gpencil_delete_actframe(gpd, cfra);
- break;
- case 3: /* active layer */
- gpencil_layer_delactive(gpd);
- break;
+ /* if there's no existing Grease-Pencil data there, add some */
+ if (gpd_ptr == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go");
+ return OPERATOR_CANCELLED;
}
+ if (*gpd_ptr == NULL)
+ *gpd_ptr= gpencil_data_addnew("GPencil");
+
+ /* add new layer now */
+ gpencil_layer_addnew(*gpd_ptr);
+
+ /* notifiers */
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
- /* redraw and undo-push */
- BIF_undo_push("GPencil Delete");
+ return OPERATOR_FINISHED;
}
-/* display a menu for deleting different grease-pencil elements */
-void gpencil_delete_menu (void)
+void GPENCIL_OT_layer_add (wmOperatorType *ot)
{
- bGPdata *gpd= gpencil_data_getactive(NULL);
- int cfra= 0; // XXX
- short mode;
+ /* identifiers */
+ ot->name= "Add New Layer";
+ ot->idname= "GPENCIL_OT_layer_add";
+ ot->description= "Add new Grease Pencil layer for the active Grease Pencil datablock.";
+
+ /* callbacks */
+ ot->exec= gp_layer_add_exec;
+ ot->poll= gp_add_poll;
+}
+
+/* ******************* Delete Active Frame ************************ */
+
+static int gp_actframe_delete_poll (bContext *C)
+{
+ bGPdata *gpd= gpencil_data_get_active(C);
+ bGPDlayer *gpl= gpencil_layer_getactive(gpd);
+
+ /* only if there's an active layer with an active frame */
+ return (gpl && gpl->actframe);
+}
+
+/* delete active frame - wrapper around API calls */
+static int gp_actframe_delete_exec (bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ bGPdata *gpd= gpencil_data_get_active(C);
+ bGPDlayer *gpl= gpencil_layer_getactive(gpd);
+ bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
- /* only show menu if it will be relevant */
- if (gpd == NULL) return;
+ /* if there's no existing Grease-Pencil data there, add some */
+ if (gpd == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data");
+ return OPERATOR_CANCELLED;
+ }
+ if ELEM(NULL, gpl, gpf) {
+ BKE_report(op->reports, RPT_ERROR, "No active frame to delete");
+ return OPERATOR_CANCELLED;
+ }
+
+ /* delete it... */
+ gpencil_layer_delframe(gpl, gpf);
- mode= pupmenu("Grease Pencil Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3");
- if (mode <= 0) return;
+ /* notifiers */
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
- gpencil_delete_operation(cfra, mode);
+ return OPERATOR_FINISHED;
}
-/* --------- Data Conversion ---------- */
+void GPENCIL_OT_active_frame_delete (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Delete Active Frame";
+ ot->idname= "GPENCIL_OT_active_frame_delete";
+ ot->description= "Delete the active frame for the active Grease Pencil datablock.";
+
+ /* callbacks */
+ ot->exec= gp_actframe_delete_exec;
+ ot->poll= gp_actframe_delete_poll;
+}
-/* convert the coordinates from the given stroke point into 3d-coordinates */
-static void gp_strokepoint_convertcoords (bGPDstroke *gps, bGPDspoint *pt, float p3d[3])
+/* ************************************************ */
+/* Grease Pencil to Data Operator */
+
+/* defines for possible modes */
+enum {
+ GP_STROKECONVERT_PATH = 1,
+ GP_STROKECONVERT_CURVE,
+};
+
+/* RNA enum define */
+static EnumPropertyItem prop_gpencil_convertmodes[] = {
+ {GP_STROKECONVERT_PATH, "PATH", 0, "Path", ""},
+ {GP_STROKECONVERT_CURVE, "CURVE", 0, "Bezier Curve", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+/* --- */
+
+/* convert the coordinates from the given stroke point into 3d-coordinates
+ * - assumes that the active space is the 3D-View
+ */
+static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoint *pt, float p3d[3])
{
- ARegion *ar= NULL; // XXX
+ Scene *scene= CTX_data_scene(C);
+ View3D *v3d= CTX_wm_view3d(C);
+ ARegion *ar= CTX_wm_region(C);
if (gps->flag & GP_STROKE_3DSPACE) {
/* directly use 3d-coordinates */
VecCopyf(p3d, &pt->x);
}
else {
- short mval[2];
- int mx=0, my=0;
- float *fp= give_cursor(NULL, NULL); // XXX should be scene, v3d
+ float *fp= give_cursor(scene, v3d);
float dvec[3];
+ short mval[2];
+ int mx, my;
/* get screen coordinate */
if (gps->flag & GP_STROKE_2DSPACE) {
- // XXX
- // View2D *v2d= spacelink_get_view2d(curarea->spacedata.first);
- // UI_view2d_view_to_region(v2d, pt->x, pt->y, &mx, &my);
+ View2D *v2d= &ar->v2d;
+ UI_view2d_view_to_region(v2d, pt->x, pt->y, &mx, &my);
}
else {
- // XXX
- // mx= (short)(pt->x / 1000 * curarea->winx);
- // my= (short)(pt->y / 1000 * curarea->winy);
+ mx= (int)(pt->x / 100 * ar->winx);
+ my= (int)(pt->y / 100 * ar->winy);
}
+ mval[0]= (short)mx;
+ mval[1]= (short)my;
/* convert screen coordinate to 3d coordinates
* - method taken from editview.c - mouse_cursor()
*/
project_short_noclip(ar, fp, mval);
- window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my);
+ window_to_3d(ar, dvec, mval[0]-mx, mval[1]-my);
VecSubf(p3d, fp, dvec);
}
}
@@ -350,7 +393,7 @@ static void gp_strokepoint_convertcoords (bGPDstroke *gps, bGPDspoint *pt, float
/* --- */
/* convert stroke to 3d path */
-static void gp_stroke_to_path (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
+static void gp_stroke_to_path (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
{
bGPDspoint *pt;
Nurb *nu;
@@ -373,7 +416,7 @@ static void gp_stroke_to_path (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
float p3d[3];
/* get coordinates to add at */
- gp_strokepoint_convertcoords(gps, pt, p3d);
+ gp_strokepoint_convertcoords(C, gps, pt, p3d);
VecCopyf(bp->vec, p3d);
/* set settings */
@@ -386,7 +429,7 @@ static void gp_stroke_to_path (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
}
/* convert stroke to 3d bezier */
-static void gp_stroke_to_bezier (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
+static void gp_stroke_to_bezier (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
{
bGPDspoint *pt;
Nurb *nu;
@@ -407,7 +450,7 @@ static void gp_stroke_to_bezier (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
float p3d[3];
/* get coordinates to add at */
- gp_strokepoint_convertcoords(gps, pt, p3d);
+ gp_strokepoint_convertcoords(C, gps, pt, p3d);
/* TODO: maybe in future the handles shouldn't be in same place */
VecCopyf(bezt->vec[0], p3d);
@@ -428,10 +471,12 @@ static void gp_stroke_to_bezier (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
}
/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */
-static void gp_layer_to_curve (bGPdata *gpd, bGPDlayer *gpl, Scene *scene, short mode)
+static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short mode)
{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, scene->r.cfra, 0);
+ Scene *scene= CTX_data_scene(C);
+ bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
bGPDstroke *gps;
+ Base *base= BASACT;
Object *ob;
Curve *cu;
@@ -446,8 +491,7 @@ static void gp_layer_to_curve (bGPdata *gpd, bGPDlayer *gpl, Scene *scene, short
/* init the curve object (remove rotation and get curve data from it)
* - must clear transforms set on object, as those skew our results
*/
- add_object_draw(OB_CURVE);
- ob= OBACT;
+ ob= add_object(scene, OB_CURVE);
ob->loc[0]= ob->loc[1]= ob->loc[2]= 0;
ob->rot[0]= ob->rot[1]= ob->rot[2]= 0;
cu= ob->data;
@@ -460,1240 +504,84 @@ static void gp_layer_to_curve (bGPdata *gpd, bGPDlayer *gpl, Scene *scene, short
/* add points to curve */
for (gps= gpf->strokes.first; gps; gps= gps->next) {
switch (mode) {
- case 1:
- gp_stroke_to_path(gpl, gps, cu);
+ case GP_STROKECONVERT_PATH:
+ gp_stroke_to_path(C, gpl, gps, cu);
break;
- case 2:
- gp_stroke_to_bezier(gpl, gps, cu);
+ case GP_STROKECONVERT_CURVE:
+ gp_stroke_to_bezier(C, gpl, gps, cu);
break;
}
}
+
+ /* restore old active object */
+ BASACT= base;
}
/* --- */
-/* convert a stroke to a bone chain */
-static void gp_stroke_to_bonechain (bGPDlayer *gpl, bGPDstroke *gps, bArmature *arm, ListBase *bones)
+static int gp_convert_poll (bContext *C)
{
- EditBone *ebo, *prev=NULL;
- bGPDspoint *pt, *ptn;
- int i;
-
- /* add each segment separately */
- for (i=0, pt=gps->points, ptn=gps->points+1; i < (gps->totpoints-1); prev=ebo, i++, pt++, ptn++) {
- float p3da[3], p3db[3];
-
- /* get coordinates to add at */
- gp_strokepoint_convertcoords(gps, pt, p3da);
- gp_strokepoint_convertcoords(gps, ptn, p3db);
-
- /* allocate new bone */
- ebo= MEM_callocN(sizeof(EditBone), "eBone");
-
- VecCopyf(ebo->head, p3da);
- VecCopyf(ebo->tail, p3db);
-
- /* add new bone - note: sync with editarmature.c::add_editbone() */
- {
- BLI_strncpy(ebo->name, "Stroke", 32);
- unique_editbone_name(bones, ebo->name, NULL);
-
- BLI_addtail(bones, ebo);
-
- if (i > 0)
- {
- ebo->flag |= BONE_CONNECTED;
- }
- ebo->weight= 1.0f;
- ebo->dist= 0.25f;
- ebo->xwidth= 0.1f;
- ebo->zwidth= 0.1f;
- ebo->ease1= 1.0f;
- ebo->ease2= 1.0f;
- ebo->rad_head= pt->pressure * gpl->thickness * 0.1f;
- ebo->rad_tail= ptn->pressure * gpl->thickness * 0.1f;
- ebo->segments= 1;
- ebo->layer= arm->layer;
- }
-
- /* set parenting */
- ebo->parent= prev;
- }
-}
-
-/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */
-// XXX depreceated... we now have etch-a-ton for this...
-static void gp_layer_to_armature (bGPdata *gpd, bGPDlayer *gpl, Scene *scene, View3D *v3d, short mode)
-{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, scene->r.cfra, 0);
- bGPDstroke *gps;
- Object *ob;
- bArmature *arm;
-
- /* error checking */
- if (ELEM3(NULL, gpd, gpl, gpf))
- return;
-
- /* only convert if there are any strokes on this layer's frame to convert */
- if (gpf->strokes.first == NULL)
- return;
-
- /* init the armature object (remove rotation and assign armature data to it)
- * - must clear transforms set on object, as those skew our results
- */
- add_object_draw(OB_ARMATURE);
- ob= OBACT;
- ob->loc[0]= ob->loc[1]= ob->loc[2]= 0;
- ob->rot[0]= ob->rot[1]= ob->rot[2]= 0;
- arm= ob->data;
-
- /* rename object and armature to layer name */
- rename_id((ID *)ob, gpl->info);
- rename_id((ID *)arm, gpl->info);
-
- /* this is editmode armature */
- arm->edbo= MEM_callocN(sizeof(ListBase), "arm edbo");
-
- /* convert segments to bones, strokes to bone chains */
- for (gps= gpf->strokes.first; gps; gps= gps->next) {
- gp_stroke_to_bonechain(gpl, gps, arm, arm->edbo);
- }
-
- /* adjust roll of bones
- * - set object as EditMode object, but need to clear afterwards!
- * - use 'align to world z-up' option
- */
- {
- /* set our data as if we're in editmode to fool auto_align_armature() */
- scene->obedit= ob;
-
- /* WARNING: need to make sure this magic number doesn't change */
- auto_align_armature(scene, v3d, 2);
-
- scene->obedit= NULL;
- }
+ bGPdata *gpd= gpencil_data_get_active(C);
+ ScrArea *sa= CTX_wm_area(C);
- /* flush editbones to armature */
- ED_armature_from_edit(scene, ob);
- ED_armature_edit_free(ob);
+ /* only if there's valid data, and the current view is 3D View */
+ return ((sa->spacetype == SPACE_VIEW3D) && gpencil_layer_getactive(gpd));
}
-/* --- */
-
-/* convert grease-pencil strokes to another representation
- * mode: 1 - Active layer to path
- * 2 - Active layer to bezier
- * 3 - Active layer to armature
- */
-void gpencil_convert_operation (short mode)
+static int gp_convert_layer_exec (bContext *C, wmOperator *op)
{
- Scene *scene= NULL; // XXX
- View3D *v3d= NULL; // XXX
- RegionView3D *rv3d= NULL; // XXX
- bGPdata *gpd;
+ bGPdata *gpd= gpencil_data_get_active(C);
+ bGPDlayer *gpl= gpencil_layer_getactive(gpd);
+ Scene *scene= CTX_data_scene(C);
+ View3D *v3d= CTX_wm_view3d(C);
float *fp= give_cursor(scene, v3d);
+ int mode= RNA_enum_get(op->ptr, "type");
- /* get datablock to work on */
- gpd= gpencil_data_getactive(NULL);
- if (gpd == NULL) return;
+ /* check if there's data to work with */
+ if (gpd == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data to work on.");
+ return OPERATOR_CANCELLED;
+ }
/* initialise 3d-cursor correction globals */
- initgrabz(rv3d, fp[0], fp[1], fp[2]);
+ initgrabz(CTX_wm_region_view3d(C), fp[0], fp[1], fp[2]);
- /* handle selection modes */
+ /* handle conversion modes */
switch (mode) {
- case 1: /* active layer only (to path) */
- case 2: /* active layer only (to bezier) */
- {
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- gp_layer_to_curve(gpd, gpl, scene, mode);
- }
- break;
- case 3: /* active layer only (to armature) */
- {
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- gp_layer_to_armature(gpd, gpl, scene, v3d, mode);
- }
- break;
- }
-
- /* redraw and undo-push */
- BIF_undo_push("GPencil Convert");
-}
-
-/* ************************************************** */
-/* GREASE-PENCIL EDITING MODE - Painting */
-
-/* ---------- 'Globals' and Defines ----------------- */
-
-/* maximum sizes of gp-session buffer */
-#define GP_STROKE_BUFFER_MAX 5000
-
-/* Macros for accessing sensitivity thresholds... */
- /* minimum number of pixels mouse should move before new point created */
-#define MIN_MANHATTEN_PX (U.gp_manhattendist)
- /* minimum length of new segment before new point can be added */
-#define MIN_EUCLIDEAN_PX (U.gp_euclideandist)
-
-/* macro to test if only converting endpoints - only for use when converting! */
-#define GP_BUFFER2STROKE_ENDPOINTS ((gpd->flag & GP_DATA_EDITPAINT) && (ctrl))
-
-/* ------ */
-
-/* Temporary 'Stroke' Operation data */
-typedef struct tGPsdata {
- Scene *scene; /* current scene from context */
- ScrArea *sa; /* area where painting originated */
- ARegion *ar; /* region where painting originated */
- View2D *v2d; /* needed for GP_STROKE_2DSPACE */
-
- ImBuf *ibuf; /* needed for GP_STROKE_2DIMAGE */
- struct IBufViewSettings {
- int offsx, offsy; /* offsets */
- int sizex, sizey; /* dimensions to use as scale-factor */
- } im2d_settings; /* needed for GP_STROKE_2DIMAGE */
-
- bGPdata *gpd; /* gp-datablock layer comes from */
- bGPDlayer *gpl; /* layer we're working on */
- bGPDframe *gpf; /* frame we're working on */
-
- short status; /* current status of painting */
- short paintmode; /* mode for painting */
-
- short mval[2]; /* current mouse-position */
- short mvalo[2]; /* previous recorded mouse-position */
-
- float pressure; /* current stylus pressure */
- float opressure; /* previous stylus pressure */
-
- short radius; /* radius of influence for eraser */
-} tGPsdata;
-
-/* values for tGPsdata->status */
-enum {
- GP_STATUS_NORMAL = 0, /* running normally */
- GP_STATUS_ERROR, /* something wasn't correctly set up */
- GP_STATUS_DONE /* painting done */
-};
-
-/* values for tGPsdata->paintmode */
-enum {
- GP_PAINTMODE_DRAW = 0,
- GP_PAINTMODE_ERASER
-};
-
-/* Return flags for adding points to stroke buffer */
-enum {
- GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */
- GP_STROKEADD_OVERFLOW = -1, /* error occurred - cannot fit any more points */
- GP_STROKEADD_NORMAL, /* point was successfully added */
- GP_STROKEADD_FULL /* cannot add any more points to buffer */
-};
-
-/* ---------- Stroke Editing ------------ */
-
-/* clear the session buffers (call this before AND after a paint operation) */
-static void gp_session_validatebuffer (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
-
- /* clear memory of buffer (or allocate it if starting a new session) */
- if (gpd->sbuffer)
- memset(gpd->sbuffer, 0, sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX);
- else
- gpd->sbuffer= MEM_callocN(sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer");
-
- /* reset indices */
- gpd->sbuffer_size = 0;
-
- /* reset flags */
- gpd->sbuffer_sflag= 0;
-}
-
-/* check if the current mouse position is suitable for adding a new point */
-static short gp_stroke_filtermval (tGPsdata *p, short mval[2], short pmval[2])
-{
- short dx= abs(mval[0] - pmval[0]);
- short dy= abs(mval[1] - pmval[1]);
-
- /* check if mouse moved at least certain distance on both axes (best case) */
- if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX))
- return 1;
-
- /* check if the distance since the last point is significant enough */
- // future optimisation: sqrt here may be too slow?
- else if (sqrt(dx*dx + dy*dy) > MIN_EUCLIDEAN_PX)
- return 1;
-
- /* mouse 'didn't move' */
- else
- return 0;
-}
-
-/* convert screen-coordinates to buffer-coordinates */
-static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[])
-{
- bGPdata *gpd= p->gpd;
-
- /* in 3d-space - pt->x/y/z are 3 side-by-side floats */
- if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) {
- const short mx=mval[0], my=mval[1];
- float *fp= give_cursor(p->scene, NULL); // XXX NULL could be v3d
- float dvec[3];
-
- /* Current method just converts each point in screen-coordinates to
- * 3D-coordinates using the 3D-cursor as reference. In general, this
- * works OK, but it could of course be improved.
- *
- * TODO:
- * - investigate using nearest point(s) on a previous stroke as
- * reference point instead or as offset, for easier stroke matching
- * - investigate projection onto geometry (ala retopo)
- */
-
- /* method taken from editview.c - mouse_cursor() */
- project_short_noclip(p->ar, fp, mval);
- window_to_3d_delta(p->ar, dvec, mval[0]-mx, mval[1]-my);
- VecSubf(out, fp, dvec);
- }
-
- /* 2d - on 'canvas' (assume that p->v2d is set) */
- else if ((gpd->sbuffer_sflag & GP_STROKE_2DSPACE) && (p->v2d)) {
- float x, y;
-
- UI_view2d_region_to_view(p->v2d, mval[0], mval[1], &x, &y);
-
- out[0]= x;
- out[1]= y;
- }
-
- /* 2d - on image 'canvas' (assume that p->v2d is set) */
- else if (gpd->sbuffer_sflag & GP_STROKE_2DIMAGE) {
- int sizex, sizey, offsx, offsy;
-
- /* get stored settings
- * - assume that these have been set already (there are checks that set sane 'defaults' just in case)
- */
- sizex= p->im2d_settings.sizex;
- sizey= p->im2d_settings.sizey;
- offsx= p->im2d_settings.offsx;
- offsy= p->im2d_settings.offsy;
-
- /* calculate new points */
- out[0]= (float)(mval[0] - offsx) / (float)sizex;
- out[1]= (float)(mval[1] - offsy) / (float)sizey;
- }
-
- /* 2d - relative to screen (viewport area) */
- else {
- out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 1000;
- out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 1000;
- }
-}
-
-/* add current stroke-point to buffer (returns whether point was successfully added) */
-static short gp_stroke_addpoint (tGPsdata *p, short mval[2], float pressure)
-{
- bGPdata *gpd= p->gpd;
- tGPspoint *pt;
-
- /* check if still room in buffer */
- if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX)
- return GP_STROKEADD_OVERFLOW;
-
- /* get pointer to destination point */
- pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size);
-
- /* store settings */
- pt->x= mval[0];
- pt->y= mval[1];
- pt->pressure= pressure;
-
- /* increment counters */
- gpd->sbuffer_size++;
-
- /* check if another operation can still occur */
- if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX)
- return GP_STROKEADD_FULL;
- else
- return GP_STROKEADD_NORMAL;
-}
-
-/* smooth a stroke (in buffer) before storing it */
-static void gp_stroke_smooth (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
- int i=0, cmx=gpd->sbuffer_size;
- int ctrl= 0; // XXX
-
- /* only smooth if smoothing is enabled, and we're not doing a straight line */
- if (!(U.gp_settings & GP_PAINT_DOSMOOTH) || GP_BUFFER2STROKE_ENDPOINTS)
- return;
-
- /* don't try if less than 2 points in buffer */
- if ((cmx <= 2) || (gpd->sbuffer == NULL))
- return;
-
- /* apply weighting-average (note doing this along path sequentially does introduce slight error) */
- for (i=0; i < gpd->sbuffer_size; i++) {
- tGPspoint *pc= (((tGPspoint *)gpd->sbuffer) + i);
- tGPspoint *pb= (i-1 > 0)?(pc-1):(pc);
- tGPspoint *pa= (i-2 > 0)?(pc-2):(pb);
- tGPspoint *pd= (i+1 < cmx)?(pc+1):(pc);
- tGPspoint *pe= (i+2 < cmx)?(pc+2):(pd);
-
- pc->x= (short)(0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x);
- pc->y= (short)(0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y);
- }
-}
-
-/* simplify a stroke (in buffer) before storing it
- * - applies a reverse Chaikin filter
- * - code adapted from etch-a-ton branch (editarmature_sketch.c)
- */
-static void gp_stroke_simplify (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
- tGPspoint *old_points= (tGPspoint *)gpd->sbuffer;
- short num_points= gpd->sbuffer_size;
- short flag= gpd->sbuffer_sflag;
- short i, j;
- int ctrl= 0; // XXX
-
- /* only simplify if simlification is enabled, and we're not doing a straight line */
- if (!(U.gp_settings & GP_PAINT_DOSIMPLIFY) || GP_BUFFER2STROKE_ENDPOINTS)
- return;
-
- /* don't simplify if less than 4 points in buffer */
- if ((num_points <= 2) || (old_points == NULL))
- return;
-
- /* clear buffer (but don't free mem yet) so that we can write to it
- * - firstly set sbuffer to NULL, so a new one is allocated
- * - secondly, reset flag after, as it gets cleared auto
- */
- gpd->sbuffer= NULL;
- gp_session_validatebuffer(p);
- gpd->sbuffer_sflag = flag;
-
-/* macro used in loop to get position of new point
- * - used due to the mixture of datatypes in use here
- */
-#define GP_SIMPLIFY_AVPOINT(offs, sfac) \
- { \
- co[0] += (float)(old_points[offs].x * sfac); \
- co[1] += (float)(old_points[offs].y * sfac); \
- pressure += old_points[offs].pressure * sfac; \
- }
-
- for (i = 0, j = 0; i < num_points; i++)
- {
- if (i - j == 3)
- {
- float co[2], pressure;
- short mco[2];
-
- /* initialise values */
- co[0]= 0;
- co[1]= 0;
- pressure = 0;
-
- /* using macro, calculate new point */
- GP_SIMPLIFY_AVPOINT(j, -0.25f);
- GP_SIMPLIFY_AVPOINT(j+1, 0.75f);
- GP_SIMPLIFY_AVPOINT(j+2, 0.75f);
- GP_SIMPLIFY_AVPOINT(j+3, -0.25f);
-
- /* set values for adding */
- mco[0]= (short)co[0];
- mco[1]= (short)co[1];
-
- /* ignore return values on this... assume to be ok for now */
- gp_stroke_addpoint(p, mco, pressure);
-
- j += 2;
- }
- }
-
- /* free old buffer */
- MEM_freeN(old_points);
-}
-
-
-/* make a new stroke from the buffer data */
-static void gp_stroke_newfrombuffer (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
- bGPDstroke *gps;
- bGPDspoint *pt;
- tGPspoint *ptc;
- int i, totelem;
- int ctrl= 0; // XXX
-
- /* get total number of points to allocate space for:
- * - in 'Draw Mode', holding the Ctrl-Modifier will only take endpoints
- * - otherwise, do whole stroke
- */
- if (GP_BUFFER2STROKE_ENDPOINTS)
- totelem = (gpd->sbuffer_size >= 2) ? 2: gpd->sbuffer_size;
- else
- totelem = gpd->sbuffer_size;
-
- /* exit with error if no valid points from this stroke */
- if (totelem == 0) {
- if (G.f & G_DEBUG)
- printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size);
- return;
- }
-
- /* allocate memory for a new stroke */
- gps= MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
-
- /* allocate enough memory for a continuous array for storage points */
- pt= gps->points= MEM_callocN(sizeof(bGPDspoint)*totelem, "gp_stroke_points");
-
- /* copy appropriate settings for stroke */
- gps->totpoints= totelem;
- gps->thickness= p->gpl->thickness;
- gps->flag= gpd->sbuffer_sflag;
-
- /* copy points from the buffer to the stroke */
- if (GP_BUFFER2STROKE_ENDPOINTS) {
- /* 'Draw Mode' + Ctrl-Modifier - only endpoints */
- {
- /* first point */
- ptc= gpd->sbuffer;
-
- /* convert screen-coordinates to appropriate coordinates (and store them) */
- gp_stroke_convertcoords(p, &ptc->x, &pt->x);
-
- /* copy pressure */
- pt->pressure= ptc->pressure;
-
- pt++;
- }
-
- if (totelem == 2) {
- /* last point if applicable */
- ptc= ((tGPspoint *)gpd->sbuffer) + (gpd->sbuffer_size - 1);
-
- /* convert screen-coordinates to appropriate coordinates (and store them) */
- gp_stroke_convertcoords(p, &ptc->x, &pt->x);
-
- /* copy pressure */
- pt->pressure= ptc->pressure;
- }
- }
- else {
- /* convert all points (normal behaviour) */
- for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) {
- /* convert screen-coordinates to appropriate coordinates (and store them) */
- gp_stroke_convertcoords(p, &ptc->x, &pt->x);
-
- /* copy pressure */
- pt->pressure= ptc->pressure;
-
- pt++;
- }
- }
-
- /* add stroke to frame */
- BLI_addtail(&p->gpf->strokes, gps);
-}
-
-/* --- 'Eraser' for 'Paint' Tool ------ */
-
-/* eraser tool - remove segment from stroke/split stroke (after lasso inside) */
-static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i)
-{
- bGPDspoint *pt_tmp= gps->points;
- bGPDstroke *gsn = NULL;
-
- /* if stroke only had two points, get rid of stroke */
- if (gps->totpoints == 2) {
- /* free stroke points, then stroke */
- MEM_freeN(pt_tmp);
- BLI_freelinkN(&gpf->strokes, gps);
-
- /* nothing left in stroke, so stop */
- return 1;
- }
-
- /* if last segment, just remove segment from the stroke */
- else if (i == gps->totpoints - 2) {
- /* allocate new points array, and assign most of the old stroke there */
- gps->totpoints--;
- gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
- memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*gps->totpoints);
-
- /* free temp buffer */
- MEM_freeN(pt_tmp);
-
- /* nothing left in stroke, so stop */
- return 1;
- }
-
- /* if first segment, just remove segment from the stroke */
- else if (i == 0) {
- /* allocate new points array, and assign most of the old stroke there */
- gps->totpoints--;
- gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
- memcpy(gps->points, pt_tmp + 1, sizeof(bGPDspoint)*gps->totpoints);
-
- /* free temp buffer */
- MEM_freeN(pt_tmp);
-
- /* no break here, as there might still be stuff to remove in this stroke */
- return 0;
- }
-
- /* segment occurs in 'middle' of stroke, so split */
- else {
- /* duplicate stroke, and assign 'later' data to that stroke */
- gsn= MEM_dupallocN(gps);
- gsn->prev= gsn->next= NULL;
- BLI_insertlinkafter(&gpf->strokes, gps, gsn);
-
- gsn->totpoints= gps->totpoints - i;
- gsn->points= MEM_callocN(sizeof(bGPDspoint)*gsn->totpoints, "gp_stroke_points");
- memcpy(gsn->points, pt_tmp + i, sizeof(bGPDspoint)*gsn->totpoints);
-
- /* adjust existing stroke */
- gps->totpoints= i;
- gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
- memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*i);
-
- /* free temp buffer */
- MEM_freeN(pt_tmp);
-
- /* nothing left in stroke, so stop */
- return 1;
- }
-}
-
-/* eraser tool - check if part of stroke occurs within last segment drawn by eraser */
-static short gp_stroke_eraser_strokeinside (short mval[], short mvalo[], short rad, short x0, short y0, short x1, short y1)
-{
- /* simple within-radius check for now */
- if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1))
- return 1;
-
- /* not inside */
- return 0;
-}
-
-/* eraser tool - evaluation per stroke */
-static void gp_stroke_eraser_dostroke (tGPsdata *p, short mval[], short mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps)
-{
- bGPDspoint *pt1, *pt2;
- int x0=0, y0=0, x1=0, y1=0;
- short xyval[2];
- int i;
-
- if (gps->totpoints == 0) {
- /* just free stroke */
- if (gps->points)
- MEM_freeN(gps->points);
- BLI_freelinkN(&gpf->strokes, gps);
- }
- else if (gps->totpoints == 1) {
- /* get coordinates */
- if (gps->flag & GP_STROKE_3DSPACE) {
- project_short(p->ar, &gps->points->x, xyval);
- x0= xyval[0];
- y0= xyval[1];
- }
- else if (gps->flag & GP_STROKE_2DSPACE) {
- UI_view2d_view_to_region(p->v2d, gps->points->x, gps->points->y, &x0, &y0);
- }
- else if (gps->flag & GP_STROKE_2DIMAGE) {
- int offsx, offsy, sizex, sizey;
-
- /* get stored settings */
- sizex= p->im2d_settings.sizex;
- sizey= p->im2d_settings.sizey;
- offsx= p->im2d_settings.offsx;
- offsy= p->im2d_settings.offsy;
-
- /* calculate new points */
- x0= (short)((gps->points->x * sizex) + offsx);
- y0= (short)((gps->points->y * sizey) + offsy);
- }
- else {
- x0= (short)(gps->points->x / 1000 * p->sa->winx);
- y0= (short)(gps->points->y / 1000 * p->sa->winy);
- }
-
- /* do boundbox check first */
- if (BLI_in_rcti(rect, x0, y0)) {
- /* only check if point is inside */
- if ( ((x0-mval[0])*(x0-mval[0]) + (y0-mval[1])*(y0-mval[1])) <= rad*rad ) {
- /* free stroke */
- MEM_freeN(gps->points);
- BLI_freelinkN(&gpf->strokes, gps);
- }
- }
- }
- else {
- /* loop over the points in the stroke, checking for intersections
- * - an intersection will require the stroke to be split
- */
- for (i=0; (i+1) < gps->totpoints; i++) {
- /* get points to work with */
- pt1= gps->points + i;
- pt2= gps->points + i + 1;
-
- /* get coordinates */
- if (gps->flag & GP_STROKE_3DSPACE) {
- project_short(p->ar, &pt1->x, xyval);
- x0= xyval[0];
- y0= xyval[1];
-
- project_short(p->ar, &pt2->x, xyval);
- x1= xyval[0];
- y1= xyval[1];
- }
- else if (gps->flag & GP_STROKE_2DSPACE) {
- UI_view2d_view_to_region(p->v2d, pt1->x, pt1->y, &x0, &y0);
-
- UI_view2d_view_to_region(p->v2d, pt2->x, pt2->y, &x1, &y1);
- }
- else if (gps->flag & GP_STROKE_2DIMAGE) {
- int offsx, offsy, sizex, sizey;
-
- /* get stored settings */
- sizex= p->im2d_settings.sizex;
- sizey= p->im2d_settings.sizey;
- offsx= p->im2d_settings.offsx;
- offsy= p->im2d_settings.offsy;
-
- /* calculate new points */
- x0= (short)((pt1->x * sizex) + offsx);
- y0= (short)((pt1->y * sizey) + offsy);
-
- x1= (short)((pt2->x * sizex) + offsx);
- y1= (short)((pt2->y * sizey) + offsy);
- }
- else {
- x0= (short)(pt1->x / 1000 * p->sa->winx);
- y0= (short)(pt1->y / 1000 * p->sa->winy);
- x1= (short)(pt2->x / 1000 * p->sa->winx);
- y1= (short)(pt2->y / 1000 * p->sa->winy);
- }
-
- /* check that point segment of the boundbox of the eraser stroke */
- if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) {
- /* check if point segment of stroke had anything to do with
- * eraser region (either within stroke painted, or on its lines)
- * - this assumes that linewidth is irrelevant
- */
- if (gp_stroke_eraser_strokeinside(mval, mvalo, rad, x0, y0, x1, y1)) {
- /* if function returns true, break this loop (as no more point to check) */
- if (gp_stroke_eraser_splitdel(gpf, gps, i))
- break;
- }
- }
- }
- }
-}
-
-/* erase strokes which fall under the eraser strokes */
-static void gp_stroke_doeraser (tGPsdata *p)
-{
- bGPDframe *gpf= p->gpf;
- bGPDstroke *gps, *gpn;
- rcti rect;
-
- /* rect is rectangle of eraser */
- rect.xmin= p->mval[0] - p->radius;
- rect.ymin= p->mval[1] - p->radius;
- rect.xmax= p->mval[0] + p->radius;
- rect.ymax= p->mval[1] + p->radius;
-
- /* loop over strokes, checking segments for intersections */
- for (gps= gpf->strokes.first; gps; gps= gpn) {
- gpn= gps->next;
- gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps);
- }
-}
-
-/* ---------- 'Paint' Tool ------------ */
-
-/* init new painting session */
-static void gp_session_initpaint (bContext *C, tGPsdata *p)
-{
- ScrArea *curarea= CTX_wm_area(C);
- ARegion *ar= CTX_wm_region(C);
-
- /* clear previous data (note: is on stack) */
- memset(p, 0, sizeof(tGPsdata));
-
- /* make sure the active view (at the starting time) is a 3d-view */
- if (curarea == NULL) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: No active view for painting \n");
- return;
- }
-
- /* pass on current scene */
- p->scene= CTX_data_scene(C);
-
- switch (curarea->spacetype) {
- /* supported views first */
- case SPACE_VIEW3D:
- {
- View3D *v3d= curarea->spacedata.first;
-
- /* set current area */
- p->sa= curarea;
- p->ar= ar;
-
- /* check that gpencil data is allowed to be drawn */
- if ((v3d->flag2 & V3D_DISPGP)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= curarea->spacedata.first;
-
- /* set current area */
- p->sa= curarea;
- p->ar= ar;
- p->v2d= &ar->v2d;
-
- /* check that gpencil data is allowed to be drawn */
- if ((snode->flag & SNODE_DISPGP)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
+ case GP_STROKECONVERT_PATH:
+ case GP_STROKECONVERT_CURVE:
+ gp_layer_to_curve(C, gpd, gpl, mode);
break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= curarea->spacedata.first;
-
- /* set current area */
- p->sa= curarea;
- p->ar= ar;
- p->v2d= &ar->v2d;
-
- /* check that gpencil data is allowed to be drawn */
- if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n");
- return;
- }
- if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= curarea->spacedata.first;
-
- /* set the current area */
- p->sa= curarea;
- p->ar= ar;
- p->v2d= &ar->v2d;
- p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
- /* check that gpencil data is allowed to be drawn */
- if ((sima->flag & SI_DISPGP)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
- break;
- /* unsupported views */
- default:
- {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Active view not appropriate for Grease Pencil drawing \n");
- return;
- }
- break;
+ default: /* unsupoorted */
+ BKE_report(op->reports, RPT_ERROR, "Unknown conversion option.");
+ return OPERATOR_CANCELLED;
}
-
- /* get gp-data */
- p->gpd= gpencil_data_getactive(p->sa);
- if (p->gpd == NULL) {
- short ok;
- p->gpd= gpencil_data_addnew("GPencil");
- ok= gpencil_data_setactive(p->sa, p->gpd);
-
- /* most of the time, the following check isn't needed */
- if (ok == 0) {
- /* free gpencil data as it can't be used */
- free_gpencil_data(p->gpd);
- p->gpd= NULL;
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Could not assign newly created Grease Pencil data to active area \n");
- return;
- }
- }
-
- /* set edit flags */
- G.f |= G_GREASEPENCIL;
+ /* notifiers */
+ WM_event_add_notifier(C, NC_OBJECT|NA_ADDED, NULL);
- /* clear out buffer (stored in gp-data) in case something contaminated it */
- gp_session_validatebuffer(p);
-
- /* set 'default' im2d_settings just in case something that uses this doesn't set it */
- p->im2d_settings.sizex= 1;
- p->im2d_settings.sizey= 1;
+ /* done */
+ return OPERATOR_FINISHED;
}
-/* cleanup after a painting session */
-static void gp_session_cleanup (tGPsdata *p)
+void GPENCIL_OT_convert (wmOperatorType *ot)
{
- bGPdata *gpd= p->gpd;
-
- /* error checking */
- if (gpd == NULL)
- return;
+ /* identifiers */
+ ot->name= "Convert Grease Pencil";
+ ot->idname= "GPENCIL_OT_convert";
+ ot->description= "Convert the active Grease Pencil layer to a new Object.";
- /* free stroke buffer */
- if (gpd->sbuffer) {
- MEM_freeN(gpd->sbuffer);
- gpd->sbuffer= NULL;
- }
+ /* callbacks */
+ ot->invoke= WM_menu_invoke;
+ ot->exec= gp_convert_layer_exec;
+ ot->poll= gp_convert_poll;
- /* clear flags */
- gpd->sbuffer_size= 0;
- gpd->sbuffer_sflag= 0;
-}
-
-/* init new stroke */
-static void gp_paint_initstroke (tGPsdata *p, short paintmode)
-{
- /* get active layer (or add a new one if non-existent) */
- p->gpl= gpencil_layer_getactive(p->gpd);
- if (p->gpl == NULL)
- p->gpl= gpencil_layer_addnew(p->gpd);
- if (p->gpl->flag & GP_LAYER_LOCKED) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Cannot paint on locked layer \n");
- return;
- }
-
- /* get active frame (add a new one if not matching frame) */
- p->gpf= gpencil_layer_getframe(p->gpl, p->scene->r.cfra, 1);
- if (p->gpf == NULL) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: No frame created (gpencil_paint_init) \n");
- return;
- }
- else
- p->gpf->flag |= GP_FRAME_PAINT;
-
- /* set 'eraser' for this stroke if using eraser */
- p->paintmode= paintmode;
- if (p->paintmode == GP_PAINTMODE_ERASER)
- p->gpd->sbuffer_sflag |= GP_STROKE_ERASER;
-
- /* check if points will need to be made in view-aligned space */
- if (p->gpd->flag & GP_DATA_VIEWALIGN) {
- switch (p->sa->spacetype) {
- case SPACE_VIEW3D:
- {
- View3D *v3d= (View3D *)p->sa->spacedata.first;
- RegionView3D *rv3d= NULL; // XXX
- float *fp= give_cursor(p->scene, v3d);
-
- initgrabz(rv3d, fp[0], fp[1], fp[2]);
-
- p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE;
- }
- break;
- case SPACE_NODE:
- {
- p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= (SpaceSeq *)p->sa->spacedata.first;
- int rectx, recty;
- float zoom, zoomx, zoomy;
-
- /* set draw 2d-stroke flag */
- p->gpd->sbuffer_sflag |= GP_STROKE_2DIMAGE;
-
- /* calculate zoom factor */
- zoom= (float)(SEQ_ZOOM_FAC(sseq->zoom));
- if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
- zoomx = zoom * ((float)p->scene->r.xasp / (float)p->scene->r.yasp);
- zoomy = zoom;
- }
- else
- zoomx = zoomy = zoom;
-
- /* calculate rect size to use to calculate the size of the drawing area
- * - We use the size of the output image not the size of the ibuf being shown
- * as it is too messy getting the ibuf (and could be too slow). This should be
- * a reasonable for most cases anyway.
- */
- rectx= (p->scene->r.size * p->scene->r.xsch) / 100;
- recty= (p->scene->r.size * p->scene->r.ysch) / 100;
-
- /* set offset and scale values for opertations to use */
- p->im2d_settings.sizex= (int)(zoomx * rectx);
- p->im2d_settings.sizey= (int)(zoomy * recty);
- p->im2d_settings.offsx= (int)((p->sa->winx-p->im2d_settings.sizex)/2 + sseq->xof);
- p->im2d_settings.offsy= (int)((p->sa->winy-p->im2d_settings.sizey)/2 + sseq->yof);
- }
- break;
- case SPACE_IMAGE:
- {
- /* check if any ibuf available */
- if (p->ibuf)
- p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
- }
- break;
- }
- }
-}
-
-/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */
-static void gp_paint_strokeend (tGPsdata *p)
-{
- /* check if doing eraser or not */
- if ((p->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) {
- /* smooth stroke before transferring? */
- gp_stroke_smooth(p);
-
- /* simplify stroke before transferring? */
- gp_stroke_simplify(p);
-
- /* transfer stroke to frame */
- gp_stroke_newfrombuffer(p);
- }
-
- /* clean up buffer now */
- gp_session_validatebuffer(p);
-}
-
-/* finish off stroke painting operation */
-static void gp_paint_cleanup (tGPsdata *p)
-{
- /* finish off a stroke */
- gp_paint_strokeend(p);
-
- /* "unlock" frame */
- p->gpf->flag &= ~GP_FRAME_PAINT;
-
- /* add undo-push so stroke can be undone */
- /* FIXME: currently disabled, as it's impossible to get this working nice
- * as gpenci data is on currently screen-level (which isn't saved to undo files)
- */
- //BIF_undo_push("GPencil Stroke");
-
- /* force redraw after drawing action */
- // XXX force_draw_plus(SPACE_ACTION, 0);
-}
-
-/* -------- */
-
-/* main call to paint a new stroke */
-// XXX will become modal(), gets event, includes all info!
-short gpencil_paint (bContext *C, short paintmode)
-{
- tGPsdata p;
- short ok = GP_STROKEADD_NORMAL;
-
- /* init paint-data */
- gp_session_initpaint(C, &p);
- if (p.status == GP_STATUS_ERROR) {
- gp_session_cleanup(&p);
- return 0;
- }
- gp_paint_initstroke(&p, paintmode);
- if (p.status == GP_STATUS_ERROR) {
- gp_session_cleanup(&p);
- return 0;
- }
-
- /* set cursor to indicate drawing */
- // XXX (cursor callbacks in regiontype) setcursor_space(p.sa->spacetype, CURSOR_VPAINT);
-
- /* init drawing-device settings */
- // XXX getmouseco_areawin(p.mval);
- // XXX p.pressure = get_pressure();
-
- p.mvalo[0]= p.mval[0];
- p.mvalo[1]= p.mval[1];
- p.opressure= p.pressure;
-
- /* radius for eraser circle is defined in userprefs now */
- // TODO: make this more easily tweaked...
- p.radius= U.gp_eraser;
-
- /* start drawing eraser-circle (if applicable) */
- //if (paintmode == GP_PAINTMODE_ERASER)
- // XXX draw_sel_circle(p.mval, NULL, p.radius, p.radius, 0); // draws frontbuffer, but sets backbuf again
-
- /* only allow painting of single 'dots' if:
- * - pressure is not excessive (as it can be on some windows tablets)
- * - draw-mode for active datablock is turned on
- * - not erasing
- */
- if (paintmode != GP_PAINTMODE_ERASER) {
- if (!(p.pressure >= 0.99f) || (p.gpd->flag & GP_DATA_EDITPAINT)) {
- gp_stroke_addpoint(&p, p.mval, p.pressure);
- }
- }
-
- /* XXX paint loop */
- if(0) {
- /* get current user input */
- // XXX getmouseco_areawin(p.mval);
- // XXX p.pressure = get_pressure();
-
- /* only add current point to buffer if mouse moved (otherwise wait until it does) */
- if (paintmode == GP_PAINTMODE_ERASER) {
- /* do 'live' erasing now */
- gp_stroke_doeraser(&p);
-
- // XXX draw_sel_circle(p.mval, p.mvalo, p.radius, p.radius, 0);
- // XXX force_draw(0);
-
- p.mvalo[0]= p.mval[0];
- p.mvalo[1]= p.mval[1];
- p.opressure= p.pressure;
- }
- else if (gp_stroke_filtermval(&p, p.mval, p.mvalo)) {
- /* try to add point */
- ok= gp_stroke_addpoint(&p, p.mval, p.pressure);
-
- /* handle errors while adding point */
- if ((ok == GP_STROKEADD_FULL) || (ok == GP_STROKEADD_OVERFLOW)) {
- /* finish off old stroke */
- gp_paint_strokeend(&p);
-
- /* start a new stroke, starting from previous point */
- gp_stroke_addpoint(&p, p.mvalo, p.opressure);
- ok= gp_stroke_addpoint(&p, p.mval, p.pressure);
- }
- else if (ok == GP_STROKEADD_INVALID) {
- /* the painting operation cannot continue... */
- error("Cannot paint stroke");
- p.status = GP_STATUS_ERROR;
-
- if (G.f & G_DEBUG)
- printf("Error: Grease-Pencil Paint - Add Point Invalid \n");
- // XXX break;
- }
- // XXX force_draw(0);
-
- p.mvalo[0]= p.mval[0];
- p.mvalo[1]= p.mval[1];
- p.opressure= p.pressure;
- }
-
- /* do mouse checking at the end, so don't check twice, and potentially
- * miss a short tap
- */
- }
-
- /* clear edit flags */
- G.f &= ~G_GREASEPENCIL;
-
- /* restore cursor to indicate end of drawing */
- // XXX (cursor callbacks in regiontype) setcursor_space(p.sa->spacetype, CURSOR_STD);
-
- /* check size of buffer before cleanup, to determine if anything happened here */
- if (paintmode == GP_PAINTMODE_ERASER) {
- ok= 1; /* assume that we did something... */
- // XXX draw_sel_circle(NULL, p.mvalo, 0, p.radius, 0);
- }
- else
- ok= p.gpd->sbuffer_size;
-
- /* cleanup */
- gp_paint_cleanup(&p);
- gp_session_cleanup(&p);
-
- /* done! return if a stroke was successfully added */
- return ok;
-}
-
-
-/* All event (loops) handling checking if stroke drawing should be initiated
- * should call this function.
- */
-short gpencil_do_paint (bContext *C)
-{
- ScrArea *sa= CTX_wm_area(C);
- bGPdata *gpd = gpencil_data_getactive(sa);
- short retval= 0;
- int alt= 0, shift= 0, mbut= 0; // XXX
-
- /* check if possible to do painting */
- if (gpd == NULL)
- return 0;
-
- /* currently, we will only 'paint' if:
- * 1. draw-mode on gpd is set (for accessibility reasons)
- * a) single dots are only available by this method if a single click is made
- * b) a straight line is drawn if ctrl-modifier is held (check is done when stroke is converted!)
- * 2. if shift-modifier is held + lmb -> 'quick paint'
- *
- * OR
- *
- * draw eraser stroke if:
- * 1. using the eraser on a tablet
- * 2. draw-mode on gpd is set (for accessiblity reasons)
- * (eraser is mapped to right-mouse)
- * 3. Alt + 'select' mouse-button
- * i.e. if LMB = select: Alt-LMB
- * if RMB = select: Alt-RMB
- */
- if (get_activedevice() == 2) {
- /* eraser on a tablet - always try to erase strokes */
- retval = gpencil_paint(C, GP_PAINTMODE_ERASER);
- }
- else if (gpd->flag & GP_DATA_EDITPAINT) {
- /* try to paint/erase */
- if (mbut == L_MOUSE)
- retval = gpencil_paint(C, GP_PAINTMODE_DRAW);
- else if (mbut == R_MOUSE)
- retval = gpencil_paint(C, GP_PAINTMODE_ERASER);
- }
- else if (!(gpd->flag & GP_DATA_LMBPLOCK)) {
- /* try to paint/erase as not locked */
- if (shift && (mbut == L_MOUSE)) {
- retval = gpencil_paint(C, GP_PAINTMODE_DRAW);
- }
- else if (alt) {
- if ((U.flag & USER_LMOUSESELECT) && (mbut == L_MOUSE))
- retval = gpencil_paint(C, GP_PAINTMODE_ERASER);
- else if (!(U.flag & USER_LMOUSESELECT) && (mbut == R_MOUSE))
- retval = gpencil_paint(C, GP_PAINTMODE_ERASER);
- }
- }
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- /* return result of trying to paint */
- return retval;
+ /* properties */
+ RNA_def_enum(ot->srna, "type", prop_gpencil_convertmodes, 0, "Type", "");
}
-/* ************************************************** */
+/* ************************************************ */
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 721d8544225..57e8c882d20 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -29,8 +29,38 @@
#define ED_GPENCIL_INTERN_H
/* internal exports only */
+
+
+/* ***************************************************** */
+/* Operator Defines */
+
+struct wmOperatorType;
+
+/* drawing ---------- */
+
+void GPENCIL_OT_draw(struct wmOperatorType *ot);
+
+/* Paint Modes for operator*/
+typedef enum eGPencil_PaintModes {
+ GP_PAINTMODE_DRAW = 0,
+ GP_PAINTMODE_ERASER,
+ GP_PAINTMODE_DRAW_STRAIGHT,
+} eGPencil_PaintModes;
+
+/* buttons editing --- */
+
+void GPENCIL_OT_data_add(struct wmOperatorType *ot);
+void GPENCIL_OT_data_unlink(struct wmOperatorType *ot);
+
+void GPENCIL_OT_layer_add(struct wmOperatorType *ot);
+
+void GPENCIL_OT_active_frame_delete(struct wmOperatorType *ot);
+
+void GPENCIL_OT_convert(struct wmOperatorType *ot);
+
+
/******************************************************* */
-/* FILTERED ACTION DATA - TYPES */
+/* FILTERED ACTION DATA - TYPES ---> XXX DEPRECEATED OLD ANIM SYSTEM CODE! */
/* XXX - TODO: replace this with the modern bAnimListElem... */
/* This struct defines a structure used for quick access */
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
new file mode 100644
index 00000000000..d33ad16dfb1
--- /dev/null
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -0,0 +1,86 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009, Blender Foundation, Joshua Leung
+ * This is a new part of Blender
+ *
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdio.h>
+
+#include "BLI_blenlib.h"
+
+#include "DNA_windowmanager_types.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "gpencil_intern.h"
+
+/* ****************************************** */
+/* Generic Editing Keymap */
+
+void ED_keymap_gpencil(wmWindowManager *wm)
+{
+ ListBase *keymap= WM_keymap_listbase(wm, "Grease Pencil", 0, 0);
+ wmKeymapItem *kmi;
+
+ /* Draw */
+ /* draw */
+ WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY);
+ /* draw - straight lines */
+ kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL, DKEY);
+ RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW_STRAIGHT);
+ /* erase */
+ kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", RIGHTMOUSE, KM_PRESS, 0, DKEY);
+ RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_ERASER);
+}
+
+/* ****************************************** */
+
+void ED_operatortypes_gpencil (void)
+{
+ /* Drawing ----------------------- */
+
+ WM_operatortype_append(GPENCIL_OT_draw);
+
+ /* Editing (Buttons) ------------ */
+
+ WM_operatortype_append(GPENCIL_OT_data_add);
+ WM_operatortype_append(GPENCIL_OT_data_unlink);
+
+ WM_operatortype_append(GPENCIL_OT_layer_add);
+
+ WM_operatortype_append(GPENCIL_OT_active_frame_delete);
+
+ WM_operatortype_append(GPENCIL_OT_convert);
+
+ /* Editing (Time) --------------- */
+}
+
+/* ****************************************** */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
new file mode 100644
index 00000000000..99b85d62026
--- /dev/null
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -0,0 +1,1434 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008, Blender Foundation, Joshua Leung
+ * This is a new part of Blender
+ *
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "BKE_gpencil.h"
+#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_report.h"
+#include "BKE_utildefines.h"
+
+#include "DNA_gpencil_types.h"
+#include "DNA_action_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_view2d_types.h"
+#include "DNA_view3d_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "UI_view2d.h"
+
+#include "ED_armature.h"
+#include "ED_gpencil.h"
+#include "ED_sequencer.h"
+#include "ED_screen.h"
+#include "ED_view3d.h"
+
+#include "RNA_access.h"
+
+#include "RNA_define.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "gpencil_intern.h"
+
+/* ******************************************* */
+/* 'Globals' and Defines */
+
+/* Temporary 'Stroke' Operation data */
+typedef struct tGPsdata {
+ Scene *scene; /* current scene from context */
+ ScrArea *sa; /* area where painting originated */
+ ARegion *ar; /* region where painting originated */
+ View2D *v2d; /* needed for GP_STROKE_2DSPACE */
+
+#if 0 // XXX review this 2d image stuff...
+ ImBuf *ibuf; /* needed for GP_STROKE_2DIMAGE */
+ struct IBufViewSettings {
+ int offsx, offsy; /* offsets */
+ int sizex, sizey; /* dimensions to use as scale-factor */
+ } im2d_settings; /* needed for GP_STROKE_2DIMAGE */
+#endif
+
+ PointerRNA ownerPtr;/* pointer to owner of gp-datablock */
+ bGPdata *gpd; /* gp-datablock layer comes from */
+ bGPDlayer *gpl; /* layer we're working on */
+ bGPDframe *gpf; /* frame we're working on */
+
+ short status; /* current status of painting */
+ short paintmode; /* mode for painting */
+
+ int mval[2]; /* current mouse-position */
+ int mvalo[2]; /* previous recorded mouse-position */
+
+ float pressure; /* current stylus pressure */
+ float opressure; /* previous stylus pressure */
+
+ short radius; /* radius of influence for eraser */
+ short flags; /* flags that can get set during runtime */
+} tGPsdata;
+
+/* values for tGPsdata->status */
+enum {
+ GP_STATUS_IDLING = 0, /* stroke isn't in progress yet */
+ GP_STATUS_PAINTING, /* a stroke is in progress */
+ GP_STATUS_ERROR, /* something wasn't correctly set up */
+ GP_STATUS_DONE /* painting done */
+};
+
+/* Return flags for adding points to stroke buffer */
+enum {
+ GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */
+ GP_STROKEADD_OVERFLOW = -1, /* error occurred - cannot fit any more points */
+ GP_STROKEADD_NORMAL, /* point was successfully added */
+ GP_STROKEADD_FULL /* cannot add any more points to buffer */
+};
+
+/* Runtime flags */
+enum {
+ GP_PAINTFLAG_FIRSTRUN = (1<<0), /* operator just started */
+};
+
+/* ------ */
+
+/* maximum sizes of gp-session buffer */
+#define GP_STROKE_BUFFER_MAX 5000
+
+/* Macros for accessing sensitivity thresholds... */
+ /* minimum number of pixels mouse should move before new point created */
+#define MIN_MANHATTEN_PX (U.gp_manhattendist)
+ /* minimum length of new segment before new point can be added */
+#define MIN_EUCLIDEAN_PX (U.gp_euclideandist)
+
+/* ------ */
+/* Forward defines for some functions... */
+
+static void gp_session_validatebuffer(tGPsdata *p);
+
+/* ******************************************* */
+/* Context Wrangling... */
+
+/* check if context is suitable for drawing */
+static int gpencil_draw_poll (bContext *C)
+{
+ /* check if current context can support GPencil data */
+ return (gpencil_data_get_pointers(C, NULL) != NULL);
+}
+
+/* ******************************************* */
+/* Calculations/Conversions */
+
+/* Utilities --------------------------------- */
+
+/* get the reference point for stroke-point conversions */
+static void gp_get_3d_reference (tGPsdata *p, float *vec)
+{
+ View3D *v3d= p->sa->spacedata.first;
+ float *fp= give_cursor(p->scene, v3d);
+
+ /* the reference point used depends on the owner... */
+ if (p->ownerPtr.type == &RNA_Object) {
+ Object *ob= (Object *)p->ownerPtr.data;
+
+ /* active Object
+ * - use relative distance of 3D-cursor from object center
+ */
+ VecSubf(vec, fp, ob->loc);
+ }
+ else {
+ /* use 3D-cursor */
+ VecCopyf(vec, fp);
+ }
+}
+
+/* Stroke Editing ---------------------------- */
+
+/* check if the current mouse position is suitable for adding a new point */
+static short gp_stroke_filtermval (tGPsdata *p, int mval[2], int pmval[2])
+{
+ int dx= abs(mval[0] - pmval[0]);
+ int dy= abs(mval[1] - pmval[1]);
+
+ /* if buffer is empty, just let this go through (i.e. so that dots will work) */
+ if (p->gpd->sbuffer_size == 0)
+ return 1;
+
+ /* check if mouse moved at least certain distance on both axes (best case) */
+ else if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX))
+ return 1;
+
+ /* check if the distance since the last point is significant enough */
+ // future optimisation: sqrt here may be too slow?
+ else if (sqrt(dx*dx + dy*dy) > MIN_EUCLIDEAN_PX)
+ return 1;
+
+ /* mouse 'didn't move' */
+ else
+ return 0;
+}
+
+/* convert screen-coordinates to buffer-coordinates */
+// XXX this method needs a total overhaul!
+static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[])
+{
+ bGPdata *gpd= p->gpd;
+
+ /* in 3d-space - pt->x/y/z are 3 side-by-side floats */
+ if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) {
+ const short mx=mval[0], my=mval[1];
+ float rvec[3], dvec[3];
+
+ /* Current method just converts each point in screen-coordinates to
+ * 3D-coordinates using the 3D-cursor as reference. In general, this
+ * works OK, but it could of course be improved.
+ *
+ * TODO:
+ * - investigate using nearest point(s) on a previous stroke as
+ * reference point instead or as offset, for easier stroke matching
+ * - investigate projection onto geometry (ala retopo)
+ */
+ gp_get_3d_reference(p, rvec);
+
+ /* method taken from editview.c - mouse_cursor() */
+ project_short_noclip(p->ar, rvec, mval);
+ window_to_3d_delta(p->ar, dvec, mval[0]-mx, mval[1]-my);
+ VecSubf(out, rvec, dvec);
+ }
+
+ /* 2d - on 'canvas' (assume that p->v2d is set) */
+ else if ((gpd->sbuffer_sflag & GP_STROKE_2DSPACE) && (p->v2d)) {
+ float x, y;
+
+ UI_view2d_region_to_view(p->v2d, mval[0], mval[1], &x, &y);
+
+ out[0]= x;
+ out[1]= y;
+ }
+
+#if 0
+ /* 2d - on image 'canvas' (assume that p->v2d is set) */
+ else if (gpd->sbuffer_sflag & GP_STROKE_2DIMAGE) {
+ int sizex, sizey, offsx, offsy;
+
+ /* get stored settings
+ * - assume that these have been set already (there are checks that set sane 'defaults' just in case)
+ */
+ sizex= p->im2d_settings.sizex;
+ sizey= p->im2d_settings.sizey;
+ offsx= p->im2d_settings.offsx;
+ offsy= p->im2d_settings.offsy;
+
+ /* calculate new points */
+ out[0]= (float)(mval[0] - offsx) / (float)sizex;
+ out[1]= (float)(mval[1] - offsy) / (float)sizey;
+ }
+#endif
+
+ /* 2d - relative to screen (viewport area) */
+ else {
+ out[0] = (float)(mval[0]) / (float)(p->ar->winx) * 100;
+ out[1] = (float)(mval[1]) / (float)(p->ar->winy) * 100;
+ }
+}
+
+/* add current stroke-point to buffer (returns whether point was successfully added) */
+static short gp_stroke_addpoint (tGPsdata *p, int mval[2], float pressure)
+{
+ bGPdata *gpd= p->gpd;
+ tGPspoint *pt;
+
+ /* check painting mode */
+ if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) {
+ /* straight lines only - i.e. only store start and end point in buffer */
+ if (gpd->sbuffer_size == 0) {
+ /* first point in buffer (start point) */
+ pt= (tGPspoint *)(gpd->sbuffer);
+
+ /* store settings */
+ pt->x= mval[0];
+ pt->y= mval[1];
+ pt->pressure= pressure;
+
+ /* increment buffer size */
+ gpd->sbuffer_size++;
+ }
+ else {
+ /* normally, we just reset the endpoint to the latest value
+ * - assume that pointers for this are always valid...
+ */
+ pt= ((tGPspoint *)(gpd->sbuffer) + 1);
+
+ /* store settings */
+ pt->x= mval[0];
+ pt->y= mval[1];
+ pt->pressure= pressure;
+
+ /* if this is just the second point we've added, increment the buffer size
+ * so that it will be drawn properly...
+ * otherwise, just leave it alone, otherwise we get problems
+ */
+ if (gpd->sbuffer_size != 2)
+ gpd->sbuffer_size= 2;
+ }
+
+ /* can keep carrying on this way :) */
+ return GP_STROKEADD_NORMAL;
+ }
+ else if (p->paintmode == GP_PAINTMODE_DRAW) { /* normal drawing */
+ /* check if still room in buffer */
+ if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX)
+ return GP_STROKEADD_OVERFLOW;
+
+ /* get pointer to destination point */
+ pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size);
+
+ /* store settings */
+ pt->x= mval[0];
+ pt->y= mval[1];
+ pt->pressure= pressure;
+
+ /* increment counters */
+ gpd->sbuffer_size++;
+
+ /* check if another operation can still occur */
+ if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX)
+ return GP_STROKEADD_FULL;
+ else
+ return GP_STROKEADD_NORMAL;
+ }
+
+ /* return invalid state for now... */
+ return GP_STROKEADD_INVALID;
+}
+
+/* smooth a stroke (in buffer) before storing it */
+static void gp_stroke_smooth (tGPsdata *p)
+{
+ bGPdata *gpd= p->gpd;
+ int i=0, cmx=gpd->sbuffer_size;
+
+ /* only smooth if smoothing is enabled, and we're not doing a straight line */
+ if (!(U.gp_settings & GP_PAINT_DOSMOOTH) || (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT))
+ return;
+
+ /* don't try if less than 2 points in buffer */
+ if ((cmx <= 2) || (gpd->sbuffer == NULL))
+ return;
+
+ /* apply weighting-average (note doing this along path sequentially does introduce slight error) */
+ for (i=0; i < gpd->sbuffer_size; i++) {
+ tGPspoint *pc= (((tGPspoint *)gpd->sbuffer) + i);
+ tGPspoint *pb= (i-1 > 0)?(pc-1):(pc);
+ tGPspoint *pa= (i-2 > 0)?(pc-2):(pb);
+ tGPspoint *pd= (i+1 < cmx)?(pc+1):(pc);
+ tGPspoint *pe= (i+2 < cmx)?(pc+2):(pd);
+
+ pc->x= (short)(0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x);
+ pc->y= (short)(0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y);
+ }
+}
+
+/* simplify a stroke (in buffer) before storing it
+ * - applies a reverse Chaikin filter
+ * - code adapted from etch-a-ton branch (editarmature_sketch.c)
+ */
+static void gp_stroke_simplify (tGPsdata *p)
+{
+ bGPdata *gpd= p->gpd;
+ tGPspoint *old_points= (tGPspoint *)gpd->sbuffer;
+ short num_points= gpd->sbuffer_size;
+ short flag= gpd->sbuffer_sflag;
+ short i, j;
+
+ /* only simplify if simlification is enabled, and we're not doing a straight line */
+ if (!(U.gp_settings & GP_PAINT_DOSIMPLIFY) || (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT))
+ return;
+
+ /* don't simplify if less than 4 points in buffer */
+ if ((num_points <= 2) || (old_points == NULL))
+ return;
+
+ /* clear buffer (but don't free mem yet) so that we can write to it
+ * - firstly set sbuffer to NULL, so a new one is allocated
+ * - secondly, reset flag after, as it gets cleared auto
+ */
+ gpd->sbuffer= NULL;
+ gp_session_validatebuffer(p);
+ gpd->sbuffer_sflag = flag;
+
+/* macro used in loop to get position of new point
+ * - used due to the mixture of datatypes in use here
+ */
+#define GP_SIMPLIFY_AVPOINT(offs, sfac) \
+ { \
+ co[0] += (float)(old_points[offs].x * sfac); \
+ co[1] += (float)(old_points[offs].y * sfac); \
+ pressure += old_points[offs].pressure * sfac; \
+ }
+
+ for (i = 0, j = 0; i < num_points; i++)
+ {
+ if (i - j == 3)
+ {
+ float co[2], pressure;
+ int mco[2];
+
+ /* initialise values */
+ co[0]= 0;
+ co[1]= 0;
+ pressure = 0;
+
+ /* using macro, calculate new point */
+ GP_SIMPLIFY_AVPOINT(j, -0.25f);
+ GP_SIMPLIFY_AVPOINT(j+1, 0.75f);
+ GP_SIMPLIFY_AVPOINT(j+2, 0.75f);
+ GP_SIMPLIFY_AVPOINT(j+3, -0.25f);
+
+ /* set values for adding */
+ mco[0]= (int)co[0];
+ mco[1]= (int)co[1];
+
+ /* ignore return values on this... assume to be ok for now */
+ gp_stroke_addpoint(p, mco, pressure);
+
+ j += 2;
+ }
+ }
+
+ /* free old buffer */
+ MEM_freeN(old_points);
+}
+
+
+/* make a new stroke from the buffer data */
+static void gp_stroke_newfrombuffer (tGPsdata *p)
+{
+ bGPdata *gpd= p->gpd;
+ bGPDstroke *gps;
+ bGPDspoint *pt;
+ tGPspoint *ptc;
+ int i, totelem;
+
+ /* get total number of points to allocate space for
+ * - drawing straight-lines only requires the endpoints
+ */
+ if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT)
+ totelem = (gpd->sbuffer_size >= 2) ? 2: gpd->sbuffer_size;
+ else
+ totelem = gpd->sbuffer_size;
+
+ /* exit with error if no valid points from this stroke */
+ if (totelem == 0) {
+ if (G.f & G_DEBUG)
+ printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size);
+ return;
+ }
+
+ /* allocate memory for a new stroke */
+ gps= MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
+
+ /* allocate enough memory for a continuous array for storage points */
+ pt= gps->points= MEM_callocN(sizeof(bGPDspoint)*totelem, "gp_stroke_points");
+
+ /* copy appropriate settings for stroke */
+ gps->totpoints= totelem;
+ gps->thickness= p->gpl->thickness;
+ gps->flag= gpd->sbuffer_sflag;
+
+ /* copy points from the buffer to the stroke */
+ if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) {
+ /* straight lines only -> only endpoints */
+ {
+ /* first point */
+ ptc= gpd->sbuffer;
+
+ /* convert screen-coordinates to appropriate coordinates (and store them) */
+ gp_stroke_convertcoords(p, &ptc->x, &pt->x);
+
+ /* copy pressure */
+ pt->pressure= ptc->pressure;
+
+ pt++;
+ }
+
+ if (totelem == 2) {
+ /* last point if applicable */
+ ptc= ((tGPspoint *)gpd->sbuffer) + (gpd->sbuffer_size - 1);
+
+ /* convert screen-coordinates to appropriate coordinates (and store them) */
+ gp_stroke_convertcoords(p, &ptc->x, &pt->x);
+
+ /* copy pressure */
+ pt->pressure= ptc->pressure;
+ }
+ }
+ else {
+ /* convert all points (normal behaviour) */
+ for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) {
+ /* convert screen-coordinates to appropriate coordinates (and store them) */
+ gp_stroke_convertcoords(p, &ptc->x, &pt->x);
+
+ /* copy pressure */
+ pt->pressure= ptc->pressure;
+
+ pt++;
+ }
+ }
+
+ /* add stroke to frame */
+ BLI_addtail(&p->gpf->strokes, gps);
+}
+
+/* --- 'Eraser' for 'Paint' Tool ------ */
+
+/* eraser tool - remove segment from stroke/split stroke (after lasso inside) */
+static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i)
+{
+ bGPDspoint *pt_tmp= gps->points;
+ bGPDstroke *gsn = NULL;
+
+ /* if stroke only had two points, get rid of stroke */
+ if (gps->totpoints == 2) {
+ /* free stroke points, then stroke */
+ MEM_freeN(pt_tmp);
+ BLI_freelinkN(&gpf->strokes, gps);
+
+ /* nothing left in stroke, so stop */
+ return 1;
+ }
+
+ /* if last segment, just remove segment from the stroke */
+ else if (i == gps->totpoints - 2) {
+ /* allocate new points array, and assign most of the old stroke there */
+ gps->totpoints--;
+ gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
+ memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*gps->totpoints);
+
+ /* free temp buffer */
+ MEM_freeN(pt_tmp);
+
+ /* nothing left in stroke, so stop */
+ return 1;
+ }
+
+ /* if first segment, just remove segment from the stroke */
+ else if (i == 0) {
+ /* allocate new points array, and assign most of the old stroke there */
+ gps->totpoints--;
+ gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
+ memcpy(gps->points, pt_tmp + 1, sizeof(bGPDspoint)*gps->totpoints);
+
+ /* free temp buffer */
+ MEM_freeN(pt_tmp);
+
+ /* no break here, as there might still be stuff to remove in this stroke */
+ return 0;
+ }
+
+ /* segment occurs in 'middle' of stroke, so split */
+ else {
+ /* duplicate stroke, and assign 'later' data to that stroke */
+ gsn= MEM_dupallocN(gps);
+ gsn->prev= gsn->next= NULL;
+ BLI_insertlinkafter(&gpf->strokes, gps, gsn);
+
+ gsn->totpoints= gps->totpoints - i;
+ gsn->points= MEM_callocN(sizeof(bGPDspoint)*gsn->totpoints, "gp_stroke_points");
+ memcpy(gsn->points, pt_tmp + i, sizeof(bGPDspoint)*gsn->totpoints);
+
+ /* adjust existing stroke */
+ gps->totpoints= i;
+ gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
+ memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*i);
+
+ /* free temp buffer */
+ MEM_freeN(pt_tmp);
+
+ /* nothing left in stroke, so stop */
+ return 1;
+ }
+}
+
+/* eraser tool - check if part of stroke occurs within last segment drawn by eraser */
+static short gp_stroke_eraser_strokeinside (int mval[], int mvalo[], short rad, short x0, short y0, short x1, short y1)
+{
+ /* simple within-radius check for now */
+ if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1))
+ return 1;
+
+ /* not inside */
+ return 0;
+}
+
+/* eraser tool - evaluation per stroke */
+// TODO: this could really do with some optimisation (KD-Tree/BVH?)
+static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps)
+{
+ bGPDspoint *pt1, *pt2;
+ int x0=0, y0=0, x1=0, y1=0;
+ short xyval[2];
+ int i;
+
+ if (gps->totpoints == 0) {
+ /* just free stroke */
+ if (gps->points)
+ MEM_freeN(gps->points);
+ BLI_freelinkN(&gpf->strokes, gps);
+ }
+ else if (gps->totpoints == 1) {
+ /* get coordinates */
+ if (gps->flag & GP_STROKE_3DSPACE) {
+ project_short(p->ar, &gps->points->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DSPACE) {
+ UI_view2d_view_to_region(p->v2d, gps->points->x, gps->points->y, &x0, &y0);
+ }
+#if 0
+ else if (gps->flag & GP_STROKE_2DIMAGE) {
+ int offsx, offsy, sizex, sizey;
+
+ /* get stored settings */
+ sizex= p->im2d_settings.sizex;
+ sizey= p->im2d_settings.sizey;
+ offsx= p->im2d_settings.offsx;
+ offsy= p->im2d_settings.offsy;
+
+ /* calculate new points */
+ x0= (int)((gps->points->x * sizex) + offsx);
+ y0= (int)((gps->points->y * sizey) + offsy);
+ }
+#endif
+ else {
+ x0= (int)(gps->points->x / 100 * p->ar->winx);
+ y0= (int)(gps->points->y / 100 * p->ar->winy);
+ }
+
+ /* do boundbox check first */
+ if (BLI_in_rcti(rect, x0, y0)) {
+ /* only check if point is inside */
+ if ( ((x0-mval[0])*(x0-mval[0]) + (y0-mval[1])*(y0-mval[1])) <= rad*rad ) {
+ /* free stroke */
+ MEM_freeN(gps->points);
+ BLI_freelinkN(&gpf->strokes, gps);
+ }
+ }
+ }
+ else {
+ /* loop over the points in the stroke, checking for intersections
+ * - an intersection will require the stroke to be split
+ */
+ for (i=0; (i+1) < gps->totpoints; i++) {
+ /* get points to work with */
+ pt1= gps->points + i;
+ pt2= gps->points + i + 1;
+
+ /* get coordinates */
+ if (gps->flag & GP_STROKE_3DSPACE) {
+ project_short(p->ar, &pt1->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+
+ project_short(p->ar, &pt2->x, xyval);
+ x1= xyval[0];
+ y1= xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DSPACE) {
+ UI_view2d_view_to_region(p->v2d, pt1->x, pt1->y, &x0, &y0);
+
+ UI_view2d_view_to_region(p->v2d, pt2->x, pt2->y, &x1, &y1);
+ }
+#if 0
+ else if (gps->flag & GP_STROKE_2DIMAGE) {
+ int offsx, offsy, sizex, sizey;
+
+ /* get stored settings */
+ sizex= p->im2d_settings.sizex;
+ sizey= p->im2d_settings.sizey;
+ offsx= p->im2d_settings.offsx;
+ offsy= p->im2d_settings.offsy;
+
+ /* calculate new points */
+ x0= (int)((pt1->x * sizex) + offsx);
+ y0= (int)((pt1->y * sizey) + offsy);
+
+ x1= (int)((pt2->x * sizex) + offsx);
+ y1= (int)((pt2->y * sizey) + offsy);
+ }
+#endif
+ else {
+ x0= (int)(pt1->x / 100 * p->ar->winx);
+ y0= (int)(pt1->y / 100 * p->ar->winy);
+ x1= (int)(pt2->x / 100 * p->ar->winx);
+ y1= (int)(pt2->y / 100 * p->ar->winy);
+ }
+
+ /* check that point segment of the boundbox of the eraser stroke */
+ if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) {
+ /* check if point segment of stroke had anything to do with
+ * eraser region (either within stroke painted, or on its lines)
+ * - this assumes that linewidth is irrelevant
+ */
+ if (gp_stroke_eraser_strokeinside(mval, mvalo, rad, x0, y0, x1, y1)) {
+ /* if function returns true, break this loop (as no more point to check) */
+ if (gp_stroke_eraser_splitdel(gpf, gps, i))
+ break;
+ }
+ }
+ }
+ }
+}
+
+/* erase strokes which fall under the eraser strokes */
+static void gp_stroke_doeraser (tGPsdata *p)
+{
+ bGPDframe *gpf= p->gpf;
+ bGPDstroke *gps, *gpn;
+ rcti rect;
+
+ /* rect is rectangle of eraser */
+ rect.xmin= p->mval[0] - p->radius;
+ rect.ymin= p->mval[1] - p->radius;
+ rect.xmax= p->mval[0] + p->radius;
+ rect.ymax= p->mval[1] + p->radius;
+
+ /* loop over strokes, checking segments for intersections */
+ for (gps= gpf->strokes.first; gps; gps= gpn) {
+ gpn= gps->next;
+ gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps);
+ }
+}
+
+/* ******************************************* */
+/* Sketching Operator */
+
+/* clear the session buffers (call this before AND after a paint operation) */
+static void gp_session_validatebuffer (tGPsdata *p)
+{
+ bGPdata *gpd= p->gpd;
+
+ /* clear memory of buffer (or allocate it if starting a new session) */
+ if (gpd->sbuffer)
+ memset(gpd->sbuffer, 0, sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX);
+ else
+ gpd->sbuffer= MEM_callocN(sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer");
+
+ /* reset indices */
+ gpd->sbuffer_size = 0;
+
+ /* reset flags */
+ gpd->sbuffer_sflag= 0;
+}
+
+/* init new painting session */
+static tGPsdata *gp_session_initpaint (bContext *C)
+{
+ tGPsdata *p = NULL;
+ bGPdata **gpd_ptr = NULL;
+ ScrArea *curarea= CTX_wm_area(C);
+ ARegion *ar= CTX_wm_region(C);
+
+ /* make sure the active view (at the starting time) is a 3d-view */
+ if (curarea == NULL) {
+ if (G.f & G_DEBUG)
+ printf("Error: No active view for painting \n");
+ return NULL;
+ }
+
+ /* create new context data */
+ p= MEM_callocN(sizeof(tGPsdata), "GPencil Drawing Data");
+
+ /* pass on current scene */
+ p->scene= CTX_data_scene(C);
+
+ switch (curarea->spacetype) {
+ /* supported views first */
+ case SPACE_VIEW3D:
+ {
+ //View3D *v3d= curarea->spacedata.first;
+
+ /* set current area
+ * - must verify that region data is 3D-view (and not something else)
+ */
+ p->sa= curarea;
+ p->ar= ar;
+
+ if (ar->regiondata == NULL) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable \n");
+ return p;
+ }
+
+#if 0 // XXX will this sort of antiquated stuff be restored?
+ /* check that gpencil data is allowed to be drawn */
+ if ((v3d->flag2 & V3D_DISPGP)==0) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown \n");
+ return p;
+ }
+#endif
+ }
+ break;
+#if 0 // XXX these other spaces will come over time...
+ case SPACE_NODE:
+ {
+ SpaceNode *snode= curarea->spacedata.first;
+
+ /* set current area */
+ p->sa= curarea;
+ p->ar= ar;
+ p->v2d= &ar->v2d;
+
+ /* check that gpencil data is allowed to be drawn */
+ if ((snode->flag & SNODE_DISPGP)==0) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown \n");
+ return;
+ }
+ }
+ break;
+ case SPACE_SEQ:
+ {
+ SpaceSeq *sseq= curarea->spacedata.first;
+
+ /* set current area */
+ p->sa= curarea;
+ p->ar= ar;
+ p->v2d= &ar->v2d;
+
+ /* check that gpencil data is allowed to be drawn */
+ if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n");
+ return;
+ }
+ if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown \n");
+ return;
+ }
+ }
+ break;
+#endif
+ case SPACE_IMAGE:
+ {
+ //SpaceImage *sima= curarea->spacedata.first;
+
+ /* set the current area */
+ p->sa= curarea;
+ p->ar= ar;
+ p->v2d= &ar->v2d;
+ //p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
+
+#if 0 // XXX disabled for now
+ /* check that gpencil data is allowed to be drawn */
+ if ((sima->flag & SI_DISPGP)==0) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: In active view, Grease Pencil not shown \n");
+ return p;
+ }
+#endif
+ }
+ break;
+
+ /* unsupported views */
+ default:
+ {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: Active view not appropriate for Grease Pencil drawing \n");
+ return p;
+ }
+ break;
+ }
+
+ /* get gp-data */
+ gpd_ptr= gpencil_data_get_pointers(C, &p->ownerPtr);
+ if (gpd_ptr == NULL) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: Current context doesn't allow for any Grease Pencil data \n");
+ return p;
+ }
+ else {
+ /* if no existing GPencil block exists, add one */
+ if (*gpd_ptr == NULL)
+ *gpd_ptr= gpencil_data_addnew("GPencil");
+ p->gpd= *gpd_ptr;
+ }
+
+ /* set edit flags - so that buffer will get drawn */
+ G.f |= G_GREASEPENCIL;
+
+ /* set initial run flag */
+ p->flags |= GP_PAINTFLAG_FIRSTRUN;
+
+ /* clear out buffer (stored in gp-data), in case something contaminated it */
+ gp_session_validatebuffer(p);
+
+#if 0
+ /* set 'default' im2d_settings just in case something that uses this doesn't set it */
+ p->im2d_settings.sizex= 1;
+ p->im2d_settings.sizey= 1;
+#endif
+
+ /* return context data for running paint operator */
+ return p;
+}
+
+/* cleanup after a painting session */
+static void gp_session_cleanup (tGPsdata *p)
+{
+ bGPdata *gpd= (p) ? p->gpd : NULL;
+
+ /* error checking */
+ if (gpd == NULL)
+ return;
+
+ /* free stroke buffer */
+ if (gpd->sbuffer) {
+ MEM_freeN(gpd->sbuffer);
+ gpd->sbuffer= NULL;
+ }
+
+ /* clear flags */
+ gpd->sbuffer_size= 0;
+ gpd->sbuffer_sflag= 0;
+}
+
+/* init new stroke */
+static void gp_paint_initstroke (tGPsdata *p, short paintmode)
+{
+ /* get active layer (or add a new one if non-existent) */
+ p->gpl= gpencil_layer_getactive(p->gpd);
+ if (p->gpl == NULL)
+ p->gpl= gpencil_layer_addnew(p->gpd);
+ if (p->gpl->flag & GP_LAYER_LOCKED) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: Cannot paint on locked layer \n");
+ return;
+ }
+
+ /* get active frame (add a new one if not matching frame) */
+ p->gpf= gpencil_layer_getframe(p->gpl, p->scene->r.cfra, 1);
+ if (p->gpf == NULL) {
+ p->status= GP_STATUS_ERROR;
+ if (G.f & G_DEBUG)
+ printf("Error: No frame created (gpencil_paint_init) \n");
+ return;
+ }
+ else
+ p->gpf->flag |= GP_FRAME_PAINT;
+
+ /* set 'eraser' for this stroke if using eraser */
+ p->paintmode= paintmode;
+ if (p->paintmode == GP_PAINTMODE_ERASER)
+ p->gpd->sbuffer_sflag |= GP_STROKE_ERASER;
+
+ /* check if points will need to be made in view-aligned space */
+ if (p->gpd->flag & GP_DATA_VIEWALIGN) {
+ switch (p->sa->spacetype) {
+ case SPACE_VIEW3D:
+ {
+ RegionView3D *rv3d= p->ar->regiondata;
+ float rvec[3];
+
+ gp_get_3d_reference(p, rvec);
+ initgrabz(rv3d, rvec[0], rvec[1], rvec[2]);
+
+ p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE;
+ }
+ break;
+#if 0 // XXX other spacetypes to be restored in due course
+ case SPACE_NODE:
+ {
+ p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
+ }
+ break;
+ case SPACE_SEQ:
+ {
+ SpaceSeq *sseq= (SpaceSeq *)p->sa->spacedata.first;
+ int rectx, recty;
+ float zoom, zoomx, zoomy;
+
+ /* set draw 2d-stroke flag */
+ p->gpd->sbuffer_sflag |= GP_STROKE_2DIMAGE;
+
+ /* calculate zoom factor */
+ zoom= (float)(SEQ_ZOOM_FAC(sseq->zoom));
+ if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ zoomx = zoom * ((float)p->scene->r.xasp / (float)p->scene->r.yasp);
+ zoomy = zoom;
+ }
+ else
+ zoomx = zoomy = zoom;
+
+ /* calculate rect size to use to calculate the size of the drawing area
+ * - We use the size of the output image not the size of the ibuf being shown
+ * as it is too messy getting the ibuf (and could be too slow). This should be
+ * a reasonable for most cases anyway.
+ */
+ rectx= (p->scene->r.size * p->scene->r.xsch) / 100;
+ recty= (p->scene->r.size * p->scene->r.ysch) / 100;
+
+ /* set offset and scale values for opertations to use */
+ p->im2d_settings.sizex= (int)(zoomx * rectx);
+ p->im2d_settings.sizey= (int)(zoomy * recty);
+ p->im2d_settings.offsx= (int)((p->sa->winx-p->im2d_settings.sizex)/2 + sseq->xof);
+ p->im2d_settings.offsy= (int)((p->sa->winy-p->im2d_settings.sizey)/2 + sseq->yof);
+ }
+ break;
+#endif
+ case SPACE_IMAGE:
+ {
+ p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
+ }
+ break;
+ }
+ }
+}
+
+/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */
+static void gp_paint_strokeend (tGPsdata *p)
+{
+ /* check if doing eraser or not */
+ if ((p->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) {
+ /* smooth stroke before transferring? */
+ gp_stroke_smooth(p);
+
+ /* simplify stroke before transferring? */
+ gp_stroke_simplify(p);
+
+ /* transfer stroke to frame */
+ gp_stroke_newfrombuffer(p);
+ }
+
+ /* clean up buffer now */
+ gp_session_validatebuffer(p);
+}
+
+/* finish off stroke painting operation */
+static void gp_paint_cleanup (tGPsdata *p)
+{
+ /* finish off a stroke */
+ gp_paint_strokeend(p);
+
+ /* "unlock" frame */
+ p->gpf->flag &= ~GP_FRAME_PAINT;
+}
+
+/* ------------------------------- */
+
+
+static int gpencil_draw_init (bContext *C, wmOperator *op)
+{
+ tGPsdata *p;
+ int paintmode= RNA_enum_get(op->ptr, "mode");
+
+ /* check context */
+ p= op->customdata= gp_session_initpaint(C);
+ if ((p == NULL) || (p->status == GP_STATUS_ERROR)) {
+ /* something wasn't set correctly in context */
+ gp_session_cleanup(p);
+ return 0;
+ }
+
+ /* init painting data */
+ gp_paint_initstroke(p, paintmode);
+ if (p->status == GP_STATUS_ERROR) {
+ gp_session_cleanup(p);
+ return 0;
+ }
+
+ /* radius for eraser circle is defined in userprefs now */
+ p->radius= U.gp_eraser;
+
+ /* everything is now setup ok */
+ return 1;
+}
+
+/* ------------------------------- */
+
+static void gpencil_draw_exit (bContext *C, wmOperator *op)
+{
+ tGPsdata *p= op->customdata;
+
+ /* clear edit flags */
+ G.f &= ~G_GREASEPENCIL;
+
+ /* restore cursor to indicate end of drawing */
+ WM_cursor_restore(CTX_wm_window(C));
+
+ /* check size of buffer before cleanup, to determine if anything happened here */
+ if (p->paintmode == GP_PAINTMODE_ERASER) {
+ // TODO clear radial cursor thing
+ // XXX draw_sel_circle(NULL, p.mvalo, 0, p.radius, 0);
+ }
+
+ /* cleanup */
+ gp_paint_cleanup(p);
+ gp_session_cleanup(p);
+
+ /* finally, free the temp data */
+ MEM_freeN(p);
+ op->customdata= NULL;
+}
+
+static int gpencil_draw_cancel (bContext *C, wmOperator *op)
+{
+ /* this is just a wrapper around exit() */
+ gpencil_draw_exit(C, op);
+ return OPERATOR_CANCELLED;
+}
+
+/* ------------------------------- */
+
+/* create a new stroke point at the point indicated by the painting context */
+static void gpencil_draw_apply (bContext *C, wmOperator *op, tGPsdata *p)
+{
+ /* handle drawing/erasing -> test for erasing first */
+ if (p->paintmode == GP_PAINTMODE_ERASER) {
+ /* do 'live' erasing now */
+ gp_stroke_doeraser(p);
+
+ /* store used values */
+ p->mvalo[0]= p->mval[0];
+ p->mvalo[1]= p->mval[1];
+ p->opressure= p->pressure;
+ }
+ /* only add current point to buffer if mouse moved (even though we got an event, it might be just noise) */
+ else if (gp_stroke_filtermval(p, p->mval, p->mvalo)) {
+ /* try to add point */
+ short ok= gp_stroke_addpoint(p, p->mval, p->pressure);
+
+ /* handle errors while adding point */
+ if ((ok == GP_STROKEADD_FULL) || (ok == GP_STROKEADD_OVERFLOW)) {
+ /* finish off old stroke */
+ gp_paint_strokeend(p);
+
+ /* start a new stroke, starting from previous point */
+ gp_stroke_addpoint(p, p->mvalo, p->opressure);
+ ok= gp_stroke_addpoint(p, p->mval, p->pressure);
+ }
+ else if (ok == GP_STROKEADD_INVALID) {
+ /* the painting operation cannot continue... */
+ BKE_report(op->reports, RPT_ERROR, "Cannot paint stroke");
+ p->status = GP_STATUS_ERROR;
+
+ if (G.f & G_DEBUG)
+ printf("Error: Grease-Pencil Paint - Add Point Invalid \n");
+ return;
+ }
+
+ /* store used values */
+ p->mvalo[0]= p->mval[0];
+ p->mvalo[1]= p->mval[1];
+ p->opressure= p->pressure;
+ }
+}
+
+/* handle draw event */
+static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *event)
+{
+ tGPsdata *p= op->customdata;
+ ARegion *ar= p->ar;
+ //PointerRNA itemptr;
+ //float mousef[2];
+ int tablet=0;
+
+ /* convert from window-space to area-space mouse coordintes */
+ // NOTE: float to ints conversions, +1 factor is probably used to ensure a bit more accurate rounding...
+ p->mval[0]= event->x - ar->winrct.xmin + 1;
+ p->mval[1]= event->y - ar->winrct.ymin + 1;
+
+ /* handle pressure sensitivity (which is supplied by tablets) */
+ if (event->custom == EVT_DATA_TABLET) {
+ wmTabletData *wmtab= event->customdata;
+
+ tablet= (wmtab->Active != EVT_TABLET_NONE);
+ p->pressure= wmtab->Pressure;
+ //if (wmtab->Active == EVT_TABLET_ERASER)
+ // TODO... this should get caught by the keymaps which call drawing in the first place
+ }
+ else
+ p->pressure= 1.0f;
+
+ /* special exception for start of strokes (i.e. maybe for just a dot) */
+ if (p->flags & GP_PAINTFLAG_FIRSTRUN) {
+ p->flags &= ~GP_PAINTFLAG_FIRSTRUN;
+
+ p->mvalo[0]= p->mval[0];
+ p->mvalo[1]= p->mval[1];
+ p->opressure= p->pressure;
+
+ /* special exception here for too high pressure values on first touch in
+ * windows for some tablets, then we just skip first touch ..
+ */
+ if (tablet && (p->pressure >= 0.99f))
+ return;
+ }
+
+#if 0 // NOTE: disabled for now, since creating this data is currently useless anyways (and slows things down)
+ /* fill in stroke data (not actually used directly by gpencil_draw_apply) */
+ RNA_collection_add(op->ptr, "stroke", &itemptr);
+
+ mousef[0]= p->mval[0];
+ mousef[1]= p->mval[1];
+ RNA_float_set_array(&itemptr, "mouse", mousef);
+ RNA_float_set(&itemptr, "pressure", p->pressure);
+#endif
+
+ /* apply the current latest drawing point */
+ gpencil_draw_apply(C, op, p);
+
+ /* force refresh */
+ ED_region_tag_redraw(p->ar); /* just active area for now, since doing whole screen is too slow */
+}
+
+/* ------------------------------- */
+
+/* operator 'redo' (i.e. after changing some properties) */
+static int gpencil_draw_exec (bContext *C, wmOperator *op)
+{
+ tGPsdata *p = NULL;
+
+ //printf("GPencil - Starting Re-Drawing \n");
+
+ /* try to initialise context data needed while drawing */
+ if (!gpencil_draw_init(C, op)) {
+ if (op->customdata) MEM_freeN(op->customdata);
+ //printf("\tGP - no valid data \n");
+ return OPERATOR_CANCELLED;
+ }
+ else
+ p= op->customdata;
+
+ //printf("\tGP - Start redrawing stroke \n");
+
+ /* loop over the stroke RNA elements recorded (i.e. progress of mouse movement),
+ * setting the relevant values in context at each step, then applying
+ */
+ RNA_BEGIN(op->ptr, itemptr, "stroke")
+ {
+ float mousef[2];
+
+ //printf("\t\tGP - stroke elem \n");
+
+ /* get relevant data for this point from stroke */
+ RNA_float_get_array(&itemptr, "mouse", mousef);
+ p->mval[0] = (short)mousef[0];
+ p->mval[1] = (short)mousef[1];
+ p->pressure= RNA_float_get(&itemptr, "pressure");
+
+ /* if first run, set previous data too */
+ if (p->flags & GP_PAINTFLAG_FIRSTRUN) {
+ p->flags &= ~GP_PAINTFLAG_FIRSTRUN;
+
+ p->mvalo[0]= p->mval[0];
+ p->mvalo[1]= p->mval[1];
+ p->opressure= p->pressure;
+ }
+
+ /* apply this data as necessary now (as per usual) */
+ gpencil_draw_apply(C, op, p);
+ }
+ RNA_END;
+
+ //printf("\tGP - done \n");
+
+ /* cleanup */
+ gpencil_draw_exit(C, op);
+
+ /* refreshes */
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work
+
+ /* done */
+ return OPERATOR_FINISHED;
+}
+
+/* ------------------------------- */
+
+/* start of interactive drawing part of operator */
+static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event)
+{
+ tGPsdata *p = NULL;
+ wmWindow *win= CTX_wm_window(C);
+
+ //printf("GPencil - Starting Drawing \n");
+
+ /* try to initialise context data needed while drawing */
+ if (!gpencil_draw_init(C, op)) {
+ if (op->customdata) MEM_freeN(op->customdata);
+ printf("\tGP - no valid data \n");
+ return OPERATOR_CANCELLED;
+ }
+ else
+ p= op->customdata;
+
+ // TODO: set any additional settings that we can take from the events?
+ // TODO? if tablet is erasing, force eraser to be on?
+
+ /* if eraser is on, draw radial aid */
+ if (p->paintmode == GP_PAINTMODE_ERASER) {
+ // TODO: this involves mucking around with radial control, so we leave this for now..
+ }
+
+ /* set cursor */
+ if (p->paintmode == GP_PAINTMODE_ERASER)
+ WM_cursor_modal(win, BC_CROSSCURSOR); // XXX need a better cursor
+ else
+ WM_cursor_modal(win, BC_PAINTBRUSHCURSOR);
+
+ /* special hack: if there was an initial event, then we were invoked via a hotkey, and
+ * painting should start immediately. Otherwise, this was called from a toolbar, in which
+ * case we should wait for the mouse to be clicked.
+ */
+ if (event->type) {
+ /* hotkey invoked - start drawing */
+ //printf("\tGP - set first spot\n");
+ p->status= GP_STATUS_PAINTING;
+
+ /* handle the initial drawing - i.e. for just doing a simple dot */
+ gpencil_draw_apply_event(C, op, event);
+ }
+ else {
+ /* toolbar invoked - don't start drawing yet... */
+ //printf("\tGP - hotkey invoked... waiting for click-drag\n");
+ }
+
+ /* add a modal handler for this operator, so that we can then draw continuous strokes */
+ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op);
+ return OPERATOR_RUNNING_MODAL;
+}
+
+/* events handling during interactive drawing part of operator */
+static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
+{
+ tGPsdata *p= op->customdata;
+
+ //printf("\tGP - handle modal event...\n");
+
+ switch (event->type) {
+ /* end of stroke -> ONLY when a mouse-button release occurs
+ * otherwise, carry on to mouse-move...
+ */
+ case LEFTMOUSE:
+ case RIGHTMOUSE:
+ /* if painting, end stroke */
+ if (p->status == GP_STATUS_PAINTING) {
+ /* basically, this should be mouse-button up */
+ //printf("\t\tGP - end of stroke \n");
+ gpencil_draw_exit(C, op);
+
+ /* one last flush before we're done */
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work
+
+ return OPERATOR_FINISHED;
+ }
+ else {
+ /* not painting, so start stroke (this should be mouse-button down) */
+ //printf("\t\tGP - start stroke \n");
+ p->status= GP_STATUS_PAINTING;
+ /* no break now, since we should immediately start painting */
+ }
+
+ /* moving mouse - assumed that mouse button is down if in painting status */
+ case MOUSEMOVE:
+ /* check if we're currently painting */
+ if (p->status == GP_STATUS_PAINTING) {
+ /* handle drawing event */
+ //printf("\t\tGP - add point\n");
+ gpencil_draw_apply_event(C, op, event);
+
+ /* finish painting operation if anything went wrong just now */
+ if (p->status == GP_STATUS_ERROR) {
+ //printf("\t\t\tGP - error done! \n");
+ gpencil_draw_exit(C, op);
+ return OPERATOR_CANCELLED;
+ }
+ }
+ break;
+
+ default:
+ //printf("\t\tGP unknown event - %d \n", event->type);
+ break;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+/* ------------------------------- */
+
+static EnumPropertyItem prop_gpencil_drawmodes[] = {
+ {GP_PAINTMODE_DRAW, "DRAW", 0, "Draw Freehand", ""},
+ {GP_PAINTMODE_DRAW_STRAIGHT, "DRAW_STRAIGHT", 0, "Draw Straight Lines", ""},
+ {GP_PAINTMODE_ERASER, "ERASER", 0, "Eraser", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+void GPENCIL_OT_draw (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Grease Pencil Draw";
+ ot->idname= "GPENCIL_OT_draw";
+ ot->description= "Make annotations on the active data.";
+
+ /* api callbacks */
+ ot->exec= gpencil_draw_exec;
+ ot->invoke= gpencil_draw_invoke;
+ ot->modal= gpencil_draw_modal;
+ ot->cancel= gpencil_draw_cancel;
+ ot->poll= gpencil_draw_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+
+ /* settings for drawing */
+ RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements.");
+ // xxx the stuff below is used only for redo operator, but is not really working
+ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
+}
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 8f7c0ceeab6..af37cd87254 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -46,6 +46,8 @@ struct bActionGroup;
struct FCurve;
struct FModifier;
+struct uiBlock;
+
/* ************************************************ */
/* ANIMATION CHANNEL FILTERING */
/* anim_filter.c */
@@ -107,7 +109,10 @@ typedef struct bAnimListElem {
} bAnimListElem;
-/* Some types for easier type-testing */
+/* Some types for easier type-testing
+ * NOTE: need to keep the order of these synchronised with the channels define code
+ * which is used for drawing and handling channel lists for
+ */
// XXX was ACTTYPE_*
typedef enum eAnim_ChannelType {
ANIMTYPE_NONE= 0,
@@ -131,6 +136,7 @@ typedef enum eAnim_ChannelType {
ANIMTYPE_DSSKEY,
ANIMTYPE_DSWOR,
ANIMTYPE_DSPART,
+ ANIMTYPE_DSMBALL,
ANIMTYPE_SHAPEKEY, // XXX probably can become depreceated???
@@ -139,6 +145,9 @@ typedef enum eAnim_ChannelType {
ANIMTYPE_NLATRACK,
ANIMTYPE_NLAACTION,
+
+ /* always as last item, the total number of channel types... */
+ ANIMTYPE_NUM_TYPES,
} eAnim_ChannelType;
/* types of keyframe data in bAnimListElem */
@@ -196,6 +205,7 @@ typedef enum eAnimFilter_Flags {
#define FILTER_CAM_OBJD(ca) ((ca->flag & CAM_DS_EXPAND))
#define FILTER_CUR_OBJD(cu) ((cu->flag & CU_DS_EXPAND))
#define FILTER_PART_OBJD(part) ((part->flag & PART_DS_EXPAND))
+#define FILTER_MBALL_OBJD(mb) ((mb->flag2 & MB_DS_EXPAND))
/* 'Sub-object/Action' channels (flags stored in Action) */
#define SEL_ACTC(actc) ((actc->flag & ACT_SELECTED))
#define EXPANDED_ACTC(actc) ((actc->flag & ACT_COLLAPSED)==0)
@@ -273,25 +283,89 @@ short ANIM_animdata_context_getdata(bAnimContext *ac);
/* ************************************************ */
/* ANIMATION CHANNELS LIST */
-/* anim_channels.c */
-
-/* ------------------------ API -------------------------- */
-
-/* Deselect all animation channels */
-void ANIM_deselect_anim_channels(void *data, short datatype, short test, short sel);
-
-/* Set the 'active' channel of type channel_type, in the given action */
-void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int filter, void *channel_data, short channel_type);
+/* anim_channels_*.c */
-/* --------------- Settings and/or Defines -------------- */
+/* ------------------------ Drawing TypeInfo -------------------------- */
/* flag-setting behaviour */
-enum {
+typedef enum eAnimChannels_SetFlag {
ACHANNEL_SETFLAG_CLEAR = 0,
ACHANNEL_SETFLAG_ADD,
ACHANNEL_SETFLAG_TOGGLE
} eAnimChannels_SetFlag;
+/* types of settings for AnimChanels */
+typedef enum eAnimChannel_Settings {
+ ACHANNEL_SETTING_SELECT = 0,
+ ACHANNEL_SETTING_PROTECT, // warning: for drawing UI's, need to check if this is off (maybe inverse this later)
+ ACHANNEL_SETTING_MUTE,
+ ACHANNEL_SETTING_EXPAND,
+ ACHANNEL_SETTING_VISIBLE, /* only for Graph Editor */
+ ACHANNEL_SETTING_SOLO, /* only for NLA Tracks */
+} eAnimChannel_Settings;
+
+
+/* Drawing, mouse handling, and flag setting behaviour... */
+typedef struct bAnimChannelType {
+ /* drawing */
+ /* draw backdrop strip for channel */
+ void (*draw_backdrop)(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc);
+ /* get depth of indention (relative to the depth channel is nested at) */
+ short (*get_indent_level)(bAnimContext *ac, bAnimListElem *ale);
+ /* get offset in pixels for the start of the channel (in addition to the indent depth) */
+ short (*get_offset)(bAnimContext *ac, bAnimListElem *ale);
+
+
+ /* get name (for channel lists) */
+ void (*name)(bAnimListElem *ale, char *name);
+ /* get icon (for channel lists) */
+ int (*icon)(bAnimListElem *ale);
+
+ /* settings */
+ /* check if the given setting is valid in the current context */
+ short (*has_setting)(bAnimContext *ac, bAnimListElem *ale, int setting);
+ /* get the flag used for this setting */
+ int (*setting_flag)(int setting, short *neg);
+ /* get the pointer to int/short where data is stored,
+ * with type being sizeof(ptr_data) which should be fine for runtime use...
+ * - assume that setting has been checked to be valid for current context
+ */
+ void *(*setting_ptr)(bAnimListElem *ale, int setting, short *type);
+} bAnimChannelType;
+
+/* ------------------------ Drawing API -------------------------- */
+
+/* Get typeinfo for the given channel */
+bAnimChannelType *ANIM_channel_get_typeinfo(bAnimListElem *ale);
+
+/* Draw the given channel */
+void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc);
+/* Draw the widgets for the given channel */
+void ANIM_channel_draw_widgets(bAnimContext *ac, bAnimListElem *ale, struct uiBlock *block, float yminc, float ymaxc);
+
+
+/* ------------------------ Editing API -------------------------- */
+
+/* Check if some setting for a channel is enabled
+ * Returns: 1 = On, 0 = Off, -1 = Invalid
+ *
+ * - setting: eAnimChannel_Settings
+ */
+short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting);
+
+/* Change value of some setting for a channel
+ * - setting: eAnimChannel_Settings
+ * - mode: eAnimChannels_SetFlag
+ */
+void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting, short mode);
+
+
+/* Deselect all animation channels */
+void ANIM_deselect_anim_channels(void *data, short datatype, short test, short sel);
+
+/* Set the 'active' channel of type channel_type, in the given action */
+void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int filter, void *channel_data, short channel_type);
+
/* ************************************************ */
/* DRAWING API */
/* anim_draw.c */
@@ -332,14 +406,16 @@ void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, struct ID *id, List
/* ------------ Animation F-Curves <-> Icons/Names Mapping ------------ */
/* anim_ipo_utils.c */
+/* Get icon for type of setting F-Curve is for */
+// XXX include this in the getname() method via RNA?
int geticon_anim_blocktype(short blocktype);
+/* Get name for channel-list displays for F-Curve */
void getname_anim_fcurve(char *name, struct ID *id, struct FCurve *fcu);
-
+/* Automatically determine a color for the nth F-Curve */
void ipo_rainbow(int cur, int tot, float *out);
-
/* ------------- NLA-Mapping ----------------------- */
/* anim_draw.c */
@@ -358,7 +434,12 @@ void ED_nla_postop_refresh(bAnimContext *ac);
/* ------------- Utility macros ----------------------- */
/* checks if the given BezTriple is selected */
-#define BEZSELECTED(bezt) ((bezt->f2 & SELECT) || (bezt->f1 & SELECT) || (bezt->f3 & SELECT))
+#define BEZSELECTED(bezt) (((bezt)->f2 & SELECT) || ((bezt)->f1 & SELECT) || ((bezt)->f3 & SELECT))
+
+/* provide access to Keyframe Type info in BezTriple
+ * NOTE: this is so that we can change it from being stored in 'hide'
+ */
+#define BEZKEYTYPE(bezt) ((bezt)->hide)
/* set/clear/toggle macro
* - channel - channel with a 'flag' member that we're setting
diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h
index c56807ad09a..57ab6a5f8f6 100644
--- a/source/blender/editors/include/ED_fileselect.h
+++ b/source/blender/editors/include/ED_fileselect.h
@@ -65,6 +65,7 @@ typedef struct FileLayout
short height;
short flag;
short dirty;
+ short textheight;
float column_widths[MAX_FILE_COLUMN];
} FileLayout;
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index ad8124c89d7..388da9a2acc 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -38,38 +38,32 @@ struct SpaceSeq;
struct bGPdata;
struct bGPDlayer;
struct bGPDframe;
-struct bGPdata;
-struct uiBlock;
+struct PointerRNA;
+struct Panel;
struct ImBuf;
+struct wmWindowManager;
+/* ------------- Grease-Pencil Helpers ---------------- */
-/* ------------- Grease-Pencil Helpers -------------- */
-
-/* Temporary 'Stroke Point' data */
+/* Temporary 'Stroke Point' data
+ *
+ * Used as part of the 'stroke cache' used during drawing of new strokes
+ */
typedef struct tGPspoint {
short x, y; /* x and y coordinates of cursor (in relative to area) */
float pressure; /* pressure of tablet at this point */
} tGPspoint;
-/* ------------ Grease-Pencil Depreceated Stuff ------------------ */
+/* ----------- Grease Pencil Tools/Context ------------- */
-struct bGPdata *gpencil_data_getactive(struct ScrArea *sa);
-short gpencil_data_setactive(struct ScrArea *sa, struct bGPdata *gpd);
-struct ScrArea *gpencil_data_findowner(struct bGPdata *gpd);
+struct bGPdata **gpencil_data_get_pointers(struct bContext *C, struct PointerRNA *ptr);
+struct bGPdata *gpencil_data_get_active(struct bContext *C);
-/* ------------ Grease-Pencil Editing API ------------------ */
+/* ----------- Grease Pencil Operators ----------------- */
-void gpencil_delete_actframe(struct bGPdata *gpd, int cfra);
-void gpencil_delete_laststroke(struct bGPdata *gpd, int cfra);
-
-void gpencil_delete_operation(int cfra, short mode);
-void gpencil_delete_menu(void);
-
-void gpencil_convert_operation(short mode);
-void gpencil_convert_menu(void);
-
-short gpencil_do_paint(struct bContext *C);
+void ED_keymap_gpencil(struct wmWindowManager *wm);
+void ED_operatortypes_gpencil(void);
/* ------------ Grease-Pencil Drawing API ------------------ */
/* drawgpencil.c */
@@ -79,5 +73,7 @@ void draw_gpencil_2dview(struct bContext *C, short onlyv2d);
void draw_gpencil_3dview(struct bContext *C, short only3d);
void draw_gpencil_oglrender(struct bContext *C);
+void gpencil_panel_standard(const struct bContext *C, struct Panel *pa);
+
#endif /* ED_GPENCIL_H */
diff --git a/source/gameengine/Expressions/KX_Python_static.h b/source/blender/editors/include/ED_info.h
index f4f31f9b058..d09e174d71d 100644
--- a/source/gameengine/Expressions/KX_Python_static.h
+++ b/source/blender/editors/include/ED_info.h
@@ -1,5 +1,5 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -17,20 +17,16 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ * The Original Code is Copyright (C) 2009, Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef KX_PYTHON_H
-#define KX_PYTHON_H
-#define USE_DL_EXPORT
-#include "Python.h"
+#ifndef ED_INFO_H
+#define ED_INFO_H
-#endif // KX_PYTHON_H
+/* info_stats.c */
+void ED_info_stats_clear(struct Scene *scene);
+char *ED_info_stats_string(struct Scene *scene);
+#endif /* ED_INFO_H */
diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h
index e940aaed36e..0969398f1e2 100644
--- a/source/blender/editors/include/ED_keyframes_draw.h
+++ b/source/blender/editors/include/ED_keyframes_draw.h
@@ -56,8 +56,8 @@ typedef struct ActKeyColumn {
char tree_col; /* DLRB_BLACK or DLRB_RED */
/* keyframe info */
- char sel;
- short handle_type;
+ char key_type; /* eBezTripe_KeyframeType */
+ short sel;
float cfra;
/* only while drawing - used to determine if long-keyframe needs to be drawn */
@@ -99,7 +99,7 @@ typedef enum eKeyframeShapeDrawOpts {
} eKeyframeShapeDrawOpts;
/* draw simple diamond-shape keyframe (with OpenGL) */
-void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short mode);
+void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel, short key_type, short mode);
/* ******************************* Methods ****************************** */
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index 77e95dc77de..b2bf05ea5ea 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -40,8 +40,6 @@ struct Scene;
/* --------- BezTriple Selection ------------- */
-#define BEZSELECTED(bezt) ((bezt->f2 & SELECT) || (bezt->f1 & SELECT) || (bezt->f3 & SELECT))
-
#define BEZ_SEL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; }
#define BEZ_DESEL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; }
#define BEZ_INVSEL(bezt) { (bezt)->f1 ^= SELECT; (bezt)->f2 ^= SELECT; (bezt)->f3 ^= SELECT; }
@@ -133,6 +131,7 @@ BeztEditFunc ANIM_editkeyframes_mirror(short mode);
BeztEditFunc ANIM_editkeyframes_select(short mode);
BeztEditFunc ANIM_editkeyframes_handles(short mode);
BeztEditFunc ANIM_editkeyframes_ipo(short mode);
+BeztEditFunc ANIM_editkeyframes_keytype(short mode);
/* ----------- BezTriple Callback (Assorted Utilities) ---------- */
@@ -148,6 +147,7 @@ void duplicate_fcurve_keys(struct FCurve *fcu);
void clean_fcurve(struct FCurve *fcu, float thresh);
void smooth_fcurve(struct FCurve *fcu);
+void sample_fcurve(struct FCurve *fcu);
/* ----------- */
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index c4d5934b180..1b8d1f63fb4 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -65,13 +65,14 @@ struct FCurve *verify_fcurve(struct bAction *act, const char group[], const char
* Use this when validation of necessary animation data isn't necessary as it already
* exists, and there is a beztriple that can be directly copied into the array.
*/
-int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt);
+int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt, short flag);
/* Main Keyframing API call:
* Use this when validation of necessary animation data isn't necessary as it
* already exists. It will insert a keyframe using the current value being keyframed.
+ * Returns the index at which a keyframe was added (or -1 if failed)
*/
-void insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag);
+int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag);
/* -------- */
@@ -156,12 +157,9 @@ void init_builtin_keyingsets(void);
/* -------- */
-/* KeyingSet Editing Operators:
- * These can add a new KeyingSet and/or add 'destinations' to the KeyingSets,
- * acting as a means by which they can be added outside the Outliner.
- */
-void ANIM_OT_keyingset_add_new(struct wmOperatorType *ot);
-void ANIM_OT_keyingset_add_destination(struct wmOperatorType *ot);
+/* KeyingSet managment operators for UI buttons. */
+void ANIM_OT_add_keyingset_button(struct wmOperatorType *ot);
+void ANIM_OT_remove_keyingset_button(struct wmOperatorType *ot);
/* ************ Drivers ********************** */
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h
index 0cd5551f17f..bf4632dc3da 100644
--- a/source/blender/editors/include/ED_node.h
+++ b/source/blender/editors/include/ED_node.h
@@ -28,8 +28,17 @@
#ifndef ED_NODE_H
#define ED_NODE_H
+struct Material;
+struct Scene;
+struct Tex;
+
/* drawnode.c */
void ED_init_node_butfuncs(void);
+/* node_edit.c */
+void ED_node_shader_default(struct Material *ma);
+void ED_node_composit_default(struct Scene *sce);
+void ED_node_texture_default(struct Tex *tex);;
+
#endif /* ED_NODE_H */
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 5a43f5d4578..cfe9ff09921 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -60,6 +60,8 @@ struct Base *ED_object_add_duplicate(struct Scene *scene, struct Base *base, int
void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr);
+void ED_object_toggle_modes(struct bContext *C, int mode);
+
/* bitflags for enter/exit editmode */
#define EM_FREEDATA 1
#define EM_FREEUNDO 2
@@ -70,6 +72,8 @@ void ED_object_enter_editmode(struct bContext *C, int flag);
void ED_object_base_init_from_view(struct bContext *C, struct Base *base);
+void ED_object_single_users(struct Scene *scene, int full);
+
/* cleanup */
int object_is_libdata(struct Object *ob);
int object_data_is_libdata(struct Object *ob);
@@ -90,6 +94,9 @@ void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con)
void mouse_lattice(struct bContext *C, short mval[2], int extend);
void undo_push_lattice(struct bContext *C, char *name);
+/* editmball.c */
+void undo_push_mball(struct bContext *C, char *name);
+
/* editkey.c */
void insert_shapekey(struct Scene *scene, struct Object *ob);
void delete_key(struct Scene *scene, struct Object *ob);
diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h
index 43cb5053f48..28807caa255 100644
--- a/source/blender/editors/include/ED_particle.h
+++ b/source/blender/editors/include/ED_particle.h
@@ -37,20 +37,19 @@ struct ParticleSystem;
struct RadialControl;
struct rcti;
struct wmWindowManager;
+struct PTCacheEdit;
/* particle edit mode */
-void PE_change_act(void *ob_v, void *act_v);
-void PE_change_act_psys(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys);
-int PE_can_edit(struct ParticleSystem *psys);
+void PE_free_ptcache_edit(struct PTCacheEdit *edit);
+int PE_start_edit(struct PTCacheEdit *edit);
/* access */
-struct ParticleSystem *PE_get_current(struct Scene *scene, struct Object *ob);
-short PE_get_current_num(struct Object *ob);
+struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob);
int PE_minmax(struct Scene *scene, float *min, float *max);
struct ParticleEditSettings *PE_settings(Scene *scene);
/* update calls */
-void PE_hide_keys_time(struct Scene *scene, struct ParticleSystem *psys, float cfra);
+void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra);
void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
/* selection tools */
diff --git a/source/blender/editors/include/ED_previewrender.h b/source/blender/editors/include/ED_previewrender.h
index 0e50ea896d6..7e0d71db7e1 100644
--- a/source/blender/editors/include/ED_previewrender.h
+++ b/source/blender/editors/include/ED_previewrender.h
@@ -34,6 +34,7 @@ struct Image;
struct Render;
struct bContext;
struct ID;
+struct MTex;
#define PREVIEW_RENDERSIZE 140
@@ -70,9 +71,9 @@ pr_method:
void ED_preview_init_dbase(void);
void ED_preview_free_dbase(void);
-void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, int sizex, int sizey);
-void ED_preview_iconrender(struct Scene *scene, struct ID *id, int *rect, int sizex, int sizey);
+void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, struct MTex *slot, int sizex, int sizey);
+void ED_preview_iconrender(struct Scene *scene, struct ID *id, unsigned int *rect, int sizex, int sizey);
-void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, rcti *rect);
+void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect);
#endif
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index fc29d64eb37..0153b3c9bdb 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -58,6 +58,7 @@ void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *ar);
void ED_region_panels(const struct bContext *C, struct ARegion *ar, int vertical, char *context, int contextnr);
void ED_region_header_init(struct ARegion *ar);
void ED_region_header(const struct bContext *C, struct ARegion *ar);
+void region_scissor_winrct(struct ARegion *ar, struct rcti *winrct);
/* spaces */
void ED_spacetypes_init(void);
@@ -89,10 +90,13 @@ void ED_screen_do_listen(struct wmWindow *win, struct wmNotifier *note);
bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc);
bScreen *ED_screen_add(struct wmWindow *win, struct Scene *scene, char *name);
void ED_screen_set(struct bContext *C, struct bScreen *sc);
+void ED_screen_delete(struct bContext *C, struct bScreen *sc);
void ED_screen_set_scene(struct bContext *C, struct Scene *scene);
+void ED_screen_delete_scene(struct bContext *C, struct Scene *scene);
void ED_screen_set_subwinactive(struct wmWindow *win, struct wmEvent *event);
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
-void ED_screen_animation_timer(struct bContext *C, int redraws, int enable);
+void ED_screen_animation_timer(struct bContext *C, int redraws, int sync, int enable);
+void ED_screen_animation_timer_update(struct bContext *C, int redraws);
int ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
void ED_screen_full_prevspace(struct bContext *C);
@@ -146,7 +150,7 @@ int ED_operator_posemode(struct bContext *C);
#define ED_KEYMAP_MARKERS 4
#define ED_KEYMAP_ANIMATION 8
#define ED_KEYMAP_FRAMES 16
-
+#define ED_KEYMAP_GPENCIL 32
#endif /* ED_SCREEN_H */
diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h
index 3ea5dfba65c..72afe7704b4 100644
--- a/source/blender/editors/include/ED_screen_types.h
+++ b/source/blender/editors/include/ED_screen_types.h
@@ -31,11 +31,24 @@
/* for animplayer */
typedef struct ScreenAnimData {
- ARegion *ar; /* do not read from this, only for comparing if region exists */
+ ARegion *ar; /* do not read from this, only for comparing if region exists */
int redraws;
- int reverse;
+ int flag; /* flags for playback */
} ScreenAnimData;
+/* for animplayer */
+enum {
+ /* user-setting - frame range is played backwards */
+ ANIMPLAY_FLAG_REVERSE = (1<<0),
+ /* temporary - playback just jumped to the start/end */
+ ANIMPLAY_FLAG_JUMPED = (1<<1),
+ /* drop frames as needed to maintain framerate */
+ ANIMPLAY_FLAG_SYNC = (1<<2),
+ /* don't drop frames (and ignore AUDIO_SYNC flag) */
+ ANIMPLAY_FLAG_NO_SYNC = (1<<3),
+};
+
+
typedef struct AZone {
struct AZone *next, *prev;
diff --git a/source/blender/editors/include/ED_sound.h b/source/blender/editors/include/ED_sound.h
new file mode 100644
index 00000000000..afb2752fa6b
--- /dev/null
+++ b/source/blender/editors/include/ED_sound.h
@@ -0,0 +1,35 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef ED_SOUND_H
+#define ED_SOUND_H
+
+void ED_operatortypes_sound(void);
+
+#endif /* ED_SOUND_H */
+
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h
index efaf0f56f92..04b6be3bcaa 100644
--- a/source/blender/editors/include/ED_space_api.h
+++ b/source/blender/editors/include/ED_space_api.h
@@ -52,6 +52,7 @@ void ED_spacetype_text(void);
void ED_spacetype_sequencer(void);
void ED_spacetype_logic(void);
void ED_spacetype_console(void);
+void ED_spacetype_userpref(void);
/* calls for instancing and freeing spacetype static data
called in WM_init_exit */
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index b576299c1d0..fd1b7e1351d 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -70,6 +70,7 @@ float *give_cursor(struct Scene *scene, struct View3D *v3d);
void initgrabz(struct RegionView3D *rv3d, float x, float y, float z);
void window_to_3d(struct ARegion *ar, float *vec, short mx, short my);
void window_to_3d_delta(struct ARegion *ar, float *vec, short mx, short my);
+void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z);
/* Depth buffer */
float read_cached_depth(struct ViewContext *vc, int x, int y);
@@ -130,8 +131,6 @@ int edge_inside_circle(short centx, short centy, short rad, short x1, short y1,
int lasso_inside(short mcords[][2], short moves, short sx, short sy);
int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1);
-/* modes */
-void ED_view3d_exit_paint_modes(struct bContext *C);
/* get 3d region from context, also if mouse is in header or toolbar */
struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C);
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index b43b50dcfd7..010101a1a80 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -161,7 +161,7 @@ DEF_ICON(ICON_NODE)
DEF_ICON(ICON_LOGIC)
DEF_ICON(ICON_CONSOLE)
DEF_ICON(ICON_PREFERENCES)
-DEF_ICON(ICON_BLANK056)
+DEF_ICON(ICON_ASSET_MANAGER)
DEF_ICON(ICON_BLANK057)
DEF_ICON(ICON_BLANK058)
DEF_ICON(ICON_BLANK059)
@@ -179,7 +179,7 @@ DEF_ICON(ICON_WPAINT_HLT)
DEF_ICON(ICON_SCULPTMODE_HLT)
DEF_ICON(ICON_POSE_HLT)
DEF_ICON(ICON_PARTICLEMODE)
-DEF_ICON(ICON_BLANK062)
+DEF_ICON(ICON_LIGHTPAINT)
DEF_ICON(ICON_BLANK063)
DEF_ICON(ICON_BLANK064)
DEF_ICON(ICON_BLANK065)
@@ -235,10 +235,10 @@ DEF_ICON(ICON_RENDER_RESULT)
DEF_ICON(ICON_SURFACE_DATA)
DEF_ICON(ICON_EMPTY_DATA)
DEF_ICON(ICON_SETTINGS)
-DEF_ICON(ICON_BLANK080D)
+DEF_ICON(ICON_RENDER_ANIMATION)
DEF_ICON(ICON_BLANK080E)
DEF_ICON(ICON_BLANK080F)
-DEF_ICON(ICON_BLANK080)
+DEF_ICON(ICON_BOIDS)
DEF_ICON(ICON_STRANDS)
DEF_ICON(ICON_LIBRARY_DATA_INDIRECT)
DEF_ICON(ICON_BLANK082)
@@ -819,9 +819,9 @@ DEF_ICON(ICON_MATSPHERE)
DEF_ICON(ICON_MATCUBE)
DEF_ICON(ICON_MONKEY)
DEF_ICON(ICON_HAIR)
-DEF_ICON(ICON_RING)
-DEF_ICON(ICON_BLANK317)
-DEF_ICON(ICON_BLANK318)
+DEF_ICON(ICON_ALIASED)
+DEF_ICON(ICON_ANTIALIASED)
+DEF_ICON(ICON_MAT_SPHERE_SKY)
DEF_ICON(ICON_BLANK319)
DEF_ICON(ICON_BLANK320)
DEF_ICON(ICON_BLANK321)
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 70fbad3216d..0cb6964b39e 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -60,6 +60,7 @@ struct Image;
struct ImageUser;
struct uiWidgetColors;
struct Tex;
+struct MTex;
typedef struct uiBut uiBut;
typedef struct uiBlock uiBlock;
@@ -99,6 +100,8 @@ typedef struct uiLayout uiLayout;
#define UI_BLOCK_KEEP_OPEN 256
#define UI_BLOCK_POPUP 512
#define UI_BLOCK_OUT_1 1024
+#define UI_BLOCK_NO_FLIP 2048
+#define UI_BLOCK_POPUP_MEMORY 4096
/* uiPopupBlockHandle->menuretval */
#define UI_RETURN_CANCEL 1 /* cancel all menus cascading */
@@ -253,8 +256,6 @@ void uiPupMenuNotice(struct bContext *C, char *str, ...);
void uiPupMenuError(struct bContext *C, char *str, ...);
void uiPupMenuReports(struct bContext *C, struct ReportList *reports);
-void uiPupMenuSetActive(int val);
-
/* Popup Blocks
*
* Functions used to create popup blocks. These are like popup menus
@@ -490,7 +491,7 @@ void uiButSetNFunc (uiBut *but, uiButHandleNFunc func, void *argN, void *arg2)
void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg);
-void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, struct rcti *rect), void *arg);
+void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2);
/* Autocomplete
*
@@ -545,6 +546,7 @@ void autocomplete_vgroup(struct bContext *C, char *str, void *arg_v);
struct rctf;
void curvemap_buttons(uiBlock *block, struct CurveMapping *cumap, char labeltype, short event, short redraw, struct rctf *rect);
+void curvemap_layout(uiLayout *layout, struct CurveMapping *cumap, char labeltype, short event, short redraw, struct rctf *rect);
void colorband_buttons(uiBlock *block, struct ColorBand *coba, struct rctf *rect, int small);
@@ -583,16 +585,21 @@ void UI_exit(void);
#define UI_LAYOUT_ALIGN_CENTER 2
#define UI_LAYOUT_ALIGN_RIGHT 3
+#define UI_ITEM_O_RETURN_PROPS 1
+#define UI_ITEM_R_EXPAND 2
+#define UI_ITEM_R_SLIDER 4
+#define UI_ITEM_R_TOGGLE 8
+
uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, struct uiStyle *style);
void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout);
void uiBlockLayoutResolve(const struct bContext *C, uiBlock *block, int *x, int *y);
uiBlock *uiLayoutGetBlock(uiLayout *layout);
-void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext);
void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv);
void uiLayoutSetContextPointer(uiLayout *layout, char *name, struct PointerRNA *ptr);
+void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext);
void uiLayoutSetActive(uiLayout *layout, int active);
void uiLayoutSetEnabled(uiLayout *layout, int enabled);
void uiLayoutSetRedAlert(uiLayout *layout, int redalert);
@@ -607,6 +614,7 @@ int uiLayoutGetEnabled(uiLayout *layout);
int uiLayoutGetRedAlert(uiLayout *layout);
int uiLayoutGetAlignment(uiLayout *layout);
int uiLayoutGetKeepAspect(uiLayout *layout);
+int uiLayoutGetWidth(uiLayout *layout);
float uiLayoutGetScaleX(uiLayout *layout);
float uiLayoutGetScaleY(uiLayout *layout);
ListBase *uiLayoutBoxGetList(uiLayout *layout);
@@ -623,20 +631,21 @@ uiLayout *uiLayoutSplit(uiLayout *layout, float percentage);
uiBlock *uiLayoutFreeBlock(uiLayout *layout);
/* templates */
-void uiTemplateHeader(uiLayout *layout, struct bContext *C);
+void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus);
void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname,
char *newop, char *unlinkop);
uiLayout *uiTemplateModifier(uiLayout *layout, struct PointerRNA *ptr);
uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr);
-void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent);
+void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot);
void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand);
-void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type);
+void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type, int compact);
void uiTemplateTriColorSet(uiLayout *layout, struct PointerRNA *ptr, char *propname);
void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname);
void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser);
void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
void uiTemplateOperatorSearch(uiLayout *layout);
void uiTemplateHeader3D(uiLayout *layout, struct bContext *C);
+void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, struct bContext *C);
void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);
typedef struct uiListItem {
@@ -657,10 +666,10 @@ void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *
void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value);
void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value);
void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value);
-void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context);
+PointerRNA uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context, int flag);
-void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int expand, int slider, int toggle);
-void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int expand, int slider, int toggle);
+void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int flag);
+void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag);
void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value);
void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value);
void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname);
@@ -671,7 +680,7 @@ void uiItemM(uiLayout *layout, struct bContext *C, char *name, int icon, char *m
void uiItemV(uiLayout *layout, char *name, int icon, int argval); /* value */
void uiItemS(uiLayout *layout); /* separator */
-void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func);
+void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg);
void uiItemMenuEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname);
void uiItemMenuEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname);
diff --git a/source/blender/editors/interface/Makefile b/source/blender/editors/interface/Makefile
index a3d0692f1e1..5968660eb91 100644
--- a/source/blender/editors/interface/Makefile
+++ b/source/blender/editors/interface/Makefile
@@ -48,6 +48,7 @@ CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../blenfont
+CPPFLAGS += -I../../python
# own include
diff --git a/source/blender/editors/interface/SConscript b/source/blender/editors/interface/SConscript
index bac3742c12f..e44de5410f1 100644
--- a/source/blender/editors/interface/SConscript
+++ b/source/blender/editors/interface/SConscript
@@ -9,6 +9,7 @@ for source in env.Glob('*_api.c'):
incs = '../include ../../blenlib ../../blenfont ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../makesrna ../../windowmanager #/intern/guardedalloc'
incs += ' #/extern/glew/include'
+incs += ' ../../python/' # python button eval
defs = []
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 9e9b6165a73..3c6e12905d6 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -48,6 +48,7 @@
#include "BKE_screen.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
+#include "BKE_unit.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -66,6 +67,8 @@
#include "RNA_access.h"
#include "RNA_types.h"
+#include "BPY_extern.h"
+
#include "interface_intern.h"
#define MENU_WIDTH 120
@@ -222,6 +225,7 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
uiStyle *style= U.uistyles.first; // XXX pass on as arg
uiBut *bt;
int i = 0, j, x1addval= offset, nextcol;
+ int lastcol= 0, col= 0;
uiStyleFontSet(&style->widget);
@@ -234,18 +238,26 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
if(j > i) i = j;
}
+
+ if(bt->next && bt->x1 < bt->next->x1)
+ lastcol++;
}
/* cope with multi collumns */
bt= block->buttons.first;
while(bt) {
- if(bt->next && bt->x1 < bt->next->x1)
+ if(bt->next && bt->x1 < bt->next->x1) {
nextcol= 1;
+ col++;
+ }
else nextcol= 0;
bt->x1 = x1addval;
bt->x2 = bt->x1 + i + block->bounds;
+ if(col == lastcol)
+ bt->x2= MAX2(bt->x2, offset + block->minbounds);
+
ui_check_but(bt); // clips text again
if(nextcol)
@@ -278,7 +290,7 @@ void ui_bounds_block(uiBlock *block)
if(bt->x2 > block->maxx) block->maxx= bt->x2;
if(bt->y2 > block->maxy) block->maxy= bt->y2;
-
+
bt= bt->next;
}
@@ -288,6 +300,8 @@ void ui_bounds_block(uiBlock *block)
block->maxy += block->bounds;
}
+ block->maxx= block->minx + MAX2(block->maxx - block->minx, block->minbounds);
+
/* hardcoded exception... but that one is annoying with larger safety */
bt= block->buttons.first;
if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10;
@@ -1075,7 +1089,7 @@ void ui_get_but_vectorf(uiBut *but, float *vec)
vec[0]= vec[1]= vec[2]= 0.0f;
if(RNA_property_type(prop) == PROP_FLOAT) {
- tot= RNA_property_array_length(prop);
+ tot= RNA_property_array_length(&but->rnapoin, prop);
tot= MIN2(tot, 3);
for(a=0; a<tot; a++)
@@ -1109,7 +1123,7 @@ void ui_set_but_vectorf(uiBut *but, float *vec)
prop= but->rnaprop;
if(RNA_property_type(prop) == PROP_FLOAT) {
- tot= RNA_property_array_length(prop);
+ tot= RNA_property_array_length(&but->rnapoin, prop);
tot= MIN2(tot, 3);
for(a=0; a<tot; a++)
@@ -1139,6 +1153,21 @@ int ui_is_but_float(uiBut *but)
return 0;
}
+int ui_is_but_unit(uiBut *but)
+{
+ Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
+ if(scene->unit.system == USER_UNIT_NONE)
+ return 0;
+
+ if(but->rnaprop==NULL)
+ return 0;
+
+ if(RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop))==0)
+ return 0;
+
+ return 1;
+}
+
double ui_get_but_val(uiBut *but)
{
PropertyRNA *prop;
@@ -1152,19 +1181,19 @@ double ui_get_but_val(uiBut *but)
switch(RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_length(prop))
+ if(RNA_property_array_length(&but->rnapoin, prop))
value= RNA_property_boolean_get_index(&but->rnapoin, prop, but->rnaindex);
else
value= RNA_property_boolean_get(&but->rnapoin, prop);
break;
case PROP_INT:
- if(RNA_property_array_length(prop))
+ if(RNA_property_array_length(&but->rnapoin, prop))
value= RNA_property_int_get_index(&but->rnapoin, prop, but->rnaindex);
else
value= RNA_property_int_get(&but->rnapoin, prop);
break;
case PROP_FLOAT:
- if(RNA_property_array_length(prop))
+ if(RNA_property_array_length(&but->rnapoin, prop))
value= RNA_property_float_get_index(&but->rnapoin, prop, but->rnaindex);
else
value= RNA_property_float_get(&but->rnapoin, prop);
@@ -1216,19 +1245,19 @@ void ui_set_but_val(uiBut *but, double value)
if(RNA_property_editable(&but->rnapoin, prop)) {
switch(RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_length(prop))
+ if(RNA_property_array_length(&but->rnapoin, prop))
RNA_property_boolean_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_boolean_set(&but->rnapoin, prop, value);
break;
case PROP_INT:
- if(RNA_property_array_length(prop))
+ if(RNA_property_array_length(&but->rnapoin, prop))
RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_int_set(&but->rnapoin, prop, value);
break;
case PROP_FLOAT:
- if(RNA_property_array_length(prop))
+ if(RNA_property_array_length(&but->rnapoin, prop))
RNA_property_float_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_float_set(&but->rnapoin, prop, value);
@@ -1305,6 +1334,55 @@ int ui_get_but_string_max_length(uiBut *but)
return UI_MAX_DRAW_STR;
}
+static double ui_get_but_scale_unit(uiBut *but, double value)
+{
+ Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
+ int subtype= RNA_property_subtype(but->rnaprop);
+
+ if(subtype & PROP_UNIT_LENGTH) {
+ return value * scene->unit.scale_length;
+ }
+ else if(subtype & PROP_UNIT_TIME) { /* WARNING - using evil_C :| */
+ return FRA2TIME(value);
+ }
+ else {
+ return value;
+ }
+}
+
+static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double value, int pad)
+{
+ Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
+ int do_split= scene->unit.flag & USER_UNIT_OPT_SPLIT;
+ int unit_type= RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop));
+ int precission= but->a2;
+
+ if(scene->unit.scale_length<0.0001) scene->unit.scale_length= 1.0; // XXX do_versions
+
+ /* Sanity checks */
+ if(precission>4) precission= 4;
+ else if(precission==0) precission= 2;
+
+ bUnit_AsString(str, len_max, ui_get_but_scale_unit(but, value), precission, scene->unit.system, unit_type, do_split, pad);
+}
+
+static float ui_get_but_step_unit(uiBut *but, double value, float step_default)
+{
+ Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
+ int unit_type= RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop));
+ float step;
+
+ step = bUnit_ClosestScalar(ui_get_but_scale_unit(but, value), scene->unit.system, unit_type);
+
+ if(step > 0.0) { /* -1 is an error value */
+ return (step/ui_get_but_scale_unit(but, 1.0))*100;
+ }
+ else {
+ return step_default;
+ }
+}
+
+
void ui_get_but_string(uiBut *but, char *str, int maxlen)
{
if(but->rnaprop && ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
@@ -1360,7 +1438,10 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen)
value= ui_get_but_val(but);
if(ui_is_but_float(but)) {
- if(but->a2) { /* amount of digits defined */
+ if(ui_is_but_unit(but)) {
+ ui_get_but_string_unit(but, str, maxlen, value, 0);
+ }
+ else if(but->a2) { /* amount of digits defined */
if(but->a2==1) BLI_snprintf(str, maxlen, "%.1f", value);
else if(but->a2==2) BLI_snprintf(str, maxlen, "%.2f", value);
else if(but->a2==3) BLI_snprintf(str, maxlen, "%.3f", value);
@@ -1433,14 +1514,30 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
/* number editing */
double value;
- /* XXX 2.50 missing python api */
-#if 0
- if(BPY_button_eval(str, &value)) {
- BKE_report(CTX_reports(C), RPT_WARNING, "Invalid Python expression, check console");
- value = 0.0f; /* Zero out value on error */
-
- if(str[0])
- return 0;
+#ifndef DISABLE_PYTHON
+ {
+ char str_unit_convert[256];
+ int unit_type;
+ Scene *scene= CTX_data_scene((bContext *)but->block->evil_C);
+
+ if(but->rnaprop)
+ unit_type= RNA_SUBTYPE_UNIT_VALUE(RNA_property_subtype(but->rnaprop));
+ else
+ unit_type= 0;
+
+ BLI_strncpy(str_unit_convert, str, sizeof(str_unit_convert));
+
+ if(scene->unit.system != USER_UNIT_NONE && unit_type) {
+ /* ugly, use the draw string to get the value, this could cause problems if it includes some text which resolves to a unit */
+ bUnit_ReplaceString(str_unit_convert, sizeof(str_unit_convert), but->drawstr, ui_get_but_scale_unit(but, 1.0), scene->unit.system, unit_type);
+ }
+
+ if(BPY_button_eval(C, str_unit_convert, &value)) {
+ value = ui_get_but_val(but); /* use its original value */
+
+ if(str[0])
+ return 0;
+ }
}
#else
value= atof(str);
@@ -1786,6 +1883,12 @@ void ui_check_but(uiBut *but)
if(ui_is_but_float(but)) {
if(value == FLT_MAX) sprintf(but->drawstr, "%sinf", but->str);
else if(value == -FLT_MAX) sprintf(but->drawstr, "%s-inf", but->str);
+ /* support length type buttons */
+ else if(ui_is_but_unit(but)) {
+ char new_str[sizeof(but->drawstr)];
+ ui_get_but_string_unit(but, new_str, sizeof(new_str), value, TRUE);
+ BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%s", but->str, new_str);
+ }
else if(but->a2) { /* amount of digits defined */
if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value);
else if(but->a2==2) sprintf(but->drawstr, "%s%.2f", but->str, value);
@@ -2194,8 +2297,12 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
dynstr= BLI_dynstr_new();
BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop));
for(i=0; i<totitem; i++) {
- if(!item[i].identifier[0])
- BLI_dynstr_append(dynstr, "|%l");
+ if(!item[i].identifier[0]) {
+ if(item[i].name)
+ BLI_dynstr_appendf(dynstr, "|%s%%l", item[i].name);
+ else
+ BLI_dynstr_append(dynstr, "|%l");
+ }
else if(item[i].icon)
BLI_dynstr_appendf(dynstr, "|%s %%i%d %%x%d", item[i].name, item[i].icon, item[i].value);
else
@@ -2307,7 +2414,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
but->rnapoin= *ptr;
but->rnaprop= prop;
- if(RNA_property_array_length(but->rnaprop))
+ if(RNA_property_array_length(&but->rnapoin, but->rnaprop))
but->rnaindex= index;
else
but->rnaindex= 0;
@@ -2325,6 +2432,10 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
but->lockstr = "";
}
+ /* If this button uses units, calculate the step from this */
+ if(ui_is_but_unit(but))
+ but->a1= ui_get_but_step_unit(but, ui_get_but_val(but), but->a1);
+
if(freestr)
MEM_freeN(str);
@@ -2743,6 +2854,8 @@ void uiBlockFlipOrder(uiBlock *block)
if(U.uiflag & USER_MENUFIXEDORDER)
return;
+ else if(block->flag & UI_BLOCK_NO_FLIP)
+ return;
for(but= block->buttons.first; but; but= but->next) {
if(but->flag & UI_BUT_ALIGN) return;
@@ -2835,10 +2948,11 @@ void uiButSetRenameFunc(uiBut *but, uiButHandleRenameFunc func, void *arg1)
but->rename_arg1= arg1;
}
-void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const bContext *C, void *idv, void *argv, rcti *rect), void *arg)
+void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const bContext *C, void *idv, void *arg1, void *arg2, rcti *rect), void *arg1, void *arg2)
{
block->drawextra= func;
- block->drawextra_arg= arg;
+ block->drawextra_arg1= arg1;
+ block->drawextra_arg2= arg2;
}
void uiButSetFunc(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
@@ -2952,7 +3066,6 @@ uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int
but->flag|= UI_HAS_ICON;
but->flag|= UI_ICON_LEFT;
- but->flag|= UI_ICON_SUBMENU;
but->block_create_func= func;
ui_check_but(but);
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index d2e9236fcff..8c41726b81b 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -144,7 +144,7 @@ void ui_but_anim_autokey(uiBut *but, Scene *scene, float cfra)
if(fcu && !driven) {
id= but->rnapoin.id.data;
-
+
if(autokeyframe_cfra_can_key(scene, id)) {
short flag = 0;
@@ -152,6 +152,8 @@ void ui_but_anim_autokey(uiBut *but, Scene *scene, float cfra)
flag |= INSERTKEY_NEEDED;
if (IS_AUTOKEY_FLAG(AUTOMATKEY))
flag |= INSERTKEY_MATRIX;
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS))
+ flag |= INSERTKEY_REPLACE;
fcu->flag &= ~FCURVE_SELECTED;
insert_keyframe(id, action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
@@ -207,6 +209,18 @@ void ui_but_anim_remove_driver(bContext *C)
WM_operator_name_call(C, "ANIM_OT_remove_driver_button", WM_OP_INVOKE_DEFAULT, NULL);
}
+void ui_but_anim_add_keyingset(bContext *C)
+{
+ /* this operator calls uiAnimContextProperty above */
+ WM_operator_name_call(C, "ANIM_OT_add_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL);
+}
+
+void ui_but_anim_remove_keyingset(bContext *C)
+{
+ /* this operator calls uiAnimContextProperty above */
+ WM_operator_name_call(C, "ANIM_OT_remove_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL);
+}
+
void ui_but_anim_menu(bContext *C, uiBut *but)
{
uiPopupMenu *pup;
@@ -217,7 +231,7 @@ void ui_but_anim_menu(bContext *C, uiBut *but)
pup= uiPupMenuBegin(C, RNA_property_ui_name(but->rnaprop), 0);
layout= uiPupMenuLayout(pup);
- length= RNA_property_array_length(but->rnaprop);
+ length= RNA_property_array_length(&but->rnapoin, but->rnaprop);
if(but->flag & UI_BUT_ANIMATED_KEY) {
if(length) {
@@ -262,6 +276,20 @@ void ui_but_anim_menu(bContext *C, uiBut *but)
else
uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0);
}
+
+ if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) {
+ uiItemS(layout);
+
+ if(length) {
+ uiItemBooleanO(layout, "Add All to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 1);
+ uiItemBooleanO(layout, "Add Single to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0);
+ uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button");
+ }
+ else {
+ uiItemBooleanO(layout, "Add to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0);
+ uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button");
+ }
+ }
uiPupMenuEnd(C, pup);
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 30cfafb24f8..259ccba6b89 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -315,6 +315,7 @@ static void ui_apply_autokey_undo(bContext *C, uiBut *but)
static void ui_apply_but_funcs_after(bContext *C)
{
uiAfterFunc *afterf, after;
+ PointerRNA opptr;
ListBase funcs;
/* copy to avoid recursive calls */
@@ -328,13 +329,18 @@ static void ui_apply_but_funcs_after(bContext *C)
if(after.context)
CTX_store_set(C, after.context);
- if(after.optype)
- WM_operator_name_call(C, after.optype->idname, after.opcontext, after.opptr);
if(after.opptr) {
- WM_operator_properties_free(after.opptr);
+ /* free in advance to avoid leak on exit */
+ opptr= *after.opptr,
MEM_freeN(after.opptr);
}
+ if(after.optype)
+ WM_operator_name_call(C, after.optype->idname, after.opcontext, (after.opptr)? &opptr: NULL);
+
+ if(after.opptr)
+ WM_operator_properties_free(&opptr);
+
if(after.rnapoin.data)
RNA_property_update(C, &after.rnapoin, after.rnaprop);
@@ -672,7 +678,11 @@ static void ui_add_link(uiBut *from, uiBut *to)
return;
}
- if (from->type==LINK && to->type==INLINK) {
+ if (from->type==INLINK && to->type==INLINK) {
+ printf("cannot link\n");
+ return;
+ }
+ else if (from->type==LINK && to->type==INLINK) {
if( from->link->tocode != (int)to->hardmin ) {
printf("cannot link\n");
return;
@@ -968,7 +978,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
char *str;
opptr= uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
- str= WM_operator_pystring(but->optype, opptr, 0);
+ str= WM_operator_pystring(C, but->optype, opptr, 0);
WM_clipboard_text_set(str, 0);
@@ -1714,6 +1724,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
uiBlockCreateFunc func= NULL;
uiBlockHandleCreateFunc handlefunc= NULL;
uiMenuCreateFunc menufunc= NULL;
+ char *menustr= NULL;
void *arg= NULL;
switch(but->type) {
@@ -1738,16 +1749,15 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
data->value= data->origvalue;
but->editval= &data->value;
- handlefunc= ui_block_func_MENU;
- arg= but;
+ menustr= but->str;
}
break;
case ICONROW:
- handlefunc= ui_block_func_ICONROW;
+ menufunc= ui_block_func_ICONROW;
arg= but;
break;
case ICONTEXTROW:
- handlefunc= ui_block_func_ICONTEXTROW;
+ menufunc= ui_block_func_ICONTEXTROW;
arg= but;
break;
case COL:
@@ -1765,8 +1775,8 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
if(but->block->handle)
data->menu->popup= but->block->handle->popup;
}
- else if(menufunc) {
- data->menu= ui_popup_menu_create(C, data->region, but, menufunc, arg);
+ else if(menufunc || menustr) {
+ data->menu= ui_popup_menu_create(C, data->region, but, menufunc, arg, menustr);
if(but->block->handle)
data->menu->popup= but->block->handle->popup;
}
@@ -3255,18 +3265,18 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
ui_but_copy_paste(C, but, data, (event->type == CKEY)? 'c': 'v');
return WM_UI_HANDLER_BREAK;
}
- /* handle keyframeing */
+ /* handle keyframing */
else if(event->type == IKEY && event->val == KM_PRESS) {
if(event->alt)
ui_but_anim_delete_keyframe(C);
else
ui_but_anim_insert_keyframe(C);
-
+
ED_region_tag_redraw(CTX_wm_region(C));
-
+
return WM_UI_HANDLER_BREAK;
}
- /* handle driver adding */
+ /* handle drivers */
else if(event->type == DKEY && event->val == KM_PRESS) {
if(event->alt)
ui_but_anim_remove_driver(C);
@@ -3277,6 +3287,17 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
return WM_UI_HANDLER_BREAK;
}
+ /* handle keyingsets */
+ else if(event->type == KKEY && event->val == KM_PRESS) {
+ if(event->alt)
+ ui_but_anim_remove_keyingset(C);
+ else
+ ui_but_anim_remove_keyingset(C);
+
+ ED_region_tag_redraw(CTX_wm_region(C));
+
+ return WM_UI_HANDLER_BREAK;
+ }
/* handle menu */
else if(event->type == RIGHTMOUSE && event->val == KM_PRESS) {
/* RMB has two options now */
@@ -3723,10 +3744,15 @@ static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *b
}
}
- /* autokey & undo push */
- if(!data->cancel)
+ if(!data->cancel) {
+ /* autokey & undo push */
ui_apply_autokey_undo(C, but);
+ /* popup menu memory */
+ if(block->flag & UI_BLOCK_POPUP_MEMORY)
+ ui_popup_menu_memory(block, but);
+ }
+
/* disable tooltips until mousemove + last active flag */
for(block=data->region->uiblocks.first; block; block=block->next) {
for(bt=block->buttons.first; bt; bt=bt->next)
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 04c0c417fdb..2e623114fe9 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -273,8 +273,9 @@ struct uiBlock {
int (*block_event_func)(const struct bContext *C, struct uiBlock *, struct wmEvent *);
/* extra draw function for custom blocks */
- void (*drawextra)(const struct bContext *C, void *idv, void *argv, rcti *rect);
- void *drawextra_arg;
+ void (*drawextra)(const struct bContext *C, void *idv, void *arg1, void *arg2, rcti *rect);
+ void *drawextra_arg1;
+ void *drawextra_arg2;
int afterval, flag;
@@ -286,7 +287,8 @@ struct uiBlock {
char *lockstr;
float xofs, yofs; // offset to parent button
- int bounds, dobounds, mx, my; // for doing delayed
+ int dobounds, mx, my; // for doing delayed
+ int bounds, minbounds; // for doing delayed
int endblock; // uiEndBlock done?
rctf safety; // pulldowns, to detect outside, can differ per case how it is created
@@ -296,6 +298,7 @@ struct uiBlock {
int tooltipdisabled; // to avoid tooltip after click
int active; // to keep blocks while drawing and free them afterwards
+ int puphash; // popup menu hash for memory
void *evil_C; // XXX hack for dynamic operator enums
};
@@ -337,6 +340,7 @@ extern void ui_set_but_soft_range(uiBut *but, double value);
extern void ui_check_but(uiBut *but);
extern int ui_is_but_float(uiBut *but);
+extern int ui_is_but_unit(uiBut *but);
extern void ui_update_block_buts_hsv(uiBlock *block, float *hsv);
extern void ui_bounds_block(uiBlock *block);
@@ -370,14 +374,15 @@ struct uiPopupBlockHandle {
float retvec[3];
};
-uiBlock *ui_block_func_MENU(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
-uiBlock *ui_block_func_ICONROW(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
-uiBlock *ui_block_func_ICONTEXTROW(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
uiBlock *ui_block_func_COL(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
+void ui_block_func_ICONROW(struct bContext *C, uiLayout *layout, void *arg_but);
+void ui_block_func_ICONTEXTROW(struct bContext *C, uiLayout *layout, void *arg_but);
struct ARegion *ui_tooltip_create(struct bContext *C, struct ARegion *butregion, uiBut *but);
void ui_tooltip_free(struct bContext *C, struct ARegion *ar);
+uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but);
+
/* searchbox for string button */
ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBut *but);
int ui_searchbox_inside(struct ARegion *ar, int x, int y);
@@ -392,7 +397,8 @@ typedef uiBlock* (*uiBlockHandleCreateFunc)(struct bContext *C, struct uiPopupBl
uiPopupBlockHandle *ui_popup_block_create(struct bContext *C, struct ARegion *butregion, uiBut *but,
uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg);
uiPopupBlockHandle *ui_popup_menu_create(struct bContext *C, struct ARegion *butregion, uiBut *but,
- uiMenuCreateFunc create_func, void *arg);
+ uiMenuCreateFunc create_func, void *arg, char *str);
+
void ui_popup_block_free(struct bContext *C, uiPopupBlockHandle *handle);
void ui_set_name_menu(uiBut *but, int value);
@@ -461,6 +467,8 @@ void ui_but_anim_insert_keyframe(struct bContext *C);
void ui_but_anim_delete_keyframe(struct bContext *C);
void ui_but_anim_add_driver(struct bContext *C);
void ui_but_anim_remove_driver(struct bContext *C);
+void ui_but_anim_add_keyingset(struct bContext *C);
+void ui_but_anim_remove_keyingset(struct bContext *C);
void ui_but_anim_menu(struct bContext *C, uiBut *but);
int ui_but_anim_expression_get(uiBut *but, char *str, int maxlen);
int ui_but_anim_expression_set(uiBut *but, const char *str);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 6932ad350b0..a52afcb1a92 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -215,16 +215,16 @@ static int ui_layout_vary_direction(uiLayout *layout)
}
/* estimated size of text + icon */
-static int ui_text_icon_width(uiLayout *layout, char *name, int icon)
+static int ui_text_icon_width(uiLayout *layout, char *name, int icon, int compact)
{
int variable = ui_layout_vary_direction(layout) == UI_ITEM_VARY_X;
if(icon && !name[0])
return UI_UNIT_X; /* icon only */
else if(icon)
- return (variable)? UI_GetStringWidth(name) + 4 + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */
+ return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */
else
- return (variable)? UI_GetStringWidth(name) + 4 + UI_UNIT_X: 10*UI_UNIT_X; /* text only */
+ return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* text only */
}
static void ui_item_size(uiItem *item, int *r_w, int *r_h)
@@ -379,31 +379,25 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon
but->type= NUMSLI;
}
}
- else if(len <= 4 && ELEM3(subtype, PROP_ROTATION, PROP_VECTOR, PROP_COLOR)) {
- if(subtype == PROP_COLOR)
+ else {
+ if(ELEM(subtype, PROP_COLOR, PROP_RGB))
uiDefAutoButR(block, ptr, prop, -1, "", 0, 0, 0, w, UI_UNIT_Y);
- if(subtype != PROP_COLOR || expand) {
+ if(!ELEM(subtype, PROP_COLOR, PROP_RGB) || expand) {
/* layout for known array subtypes */
- static char vectoritem[4]= {'X', 'Y', 'Z', 'W'};
- static char quatitem[4]= {'W', 'X', 'Y', 'Z'};
- static char coloritem[4]= {'R', 'G', 'B', 'A'};
char str[3];
for(a=0; a<len; a++) {
- if(len == 4 && subtype == PROP_ROTATION)
- str[0]= quatitem[a];
- else if(subtype == PROP_VECTOR || subtype == PROP_ROTATION)
- str[0]= vectoritem[a];
- else
- str[0]= coloritem[a];
-
- if(type == PROP_BOOLEAN) {
- str[1]= '\0';
- }
- else {
- str[1]= ':';
- str[2]= '\0';
+ str[0]= RNA_property_array_item_char(prop, a);
+
+ if(str[0]) {
+ if(type == PROP_BOOLEAN) {
+ str[1]= '\0';
+ }
+ else {
+ str[1]= ':';
+ str[2]= '\0';
+ }
}
but= uiDefAutoButR(block, ptr, prop, a, str, 0, 0, 0, w, UI_UNIT_Y);
@@ -411,19 +405,12 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon
but->type= NUMSLI;
}
}
- else if(subtype == PROP_COLOR && len == 4) {
+ else if(ELEM(subtype, PROP_COLOR, PROP_RGB) && len == 4) {
but= uiDefAutoButR(block, ptr, prop, 3, "A:", 0, 0, 0, w, UI_UNIT_Y);
if(slider && but->type==NUM)
but->type= NUMSLI;
}
}
- else {
- for(a=0; a<len; a++) {
- but= uiDefAutoButR(block, ptr, prop, a, "", 0, 0, 0, w, UI_UNIT_Y);
- if(slider && but->type==NUM)
- but->type= NUMSLI;
- }
- }
uiBlockSetCurLayout(block, layout);
}
@@ -446,7 +433,7 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr,
name= (!uiname || uiname[0])? (char*)item[a].name: "";
icon= item[a].icon;
value= item[a].value;
- itemw= ui_text_icon_width(block->curlayout, name, icon);
+ itemw= ui_text_icon_width(block->curlayout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL);
@@ -539,7 +526,7 @@ static void ui_item_disabled(uiLayout *layout, char *name)
if(!name)
name= "";
- w= ui_text_icon_width(layout, name, 0);
+ w= ui_text_icon_width(layout, name, 0, 0);
but= uiDefBut(block, LABEL, 0, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
but->flag |= UI_BUT_DISABLED;
@@ -548,7 +535,7 @@ static void ui_item_disabled(uiLayout *layout, char *name)
}
/* operator items */
-void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context)
+PointerRNA uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context, int flag)
{
uiBlock *block= layout->root->block;
wmOperatorType *ot= WM_operatortype_find(idname, 0);
@@ -557,7 +544,7 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert
if(!ot) {
ui_item_disabled(layout, idname);
- return;
+ return PointerRNA_NULL;
}
if(!name)
@@ -568,7 +555,7 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert
/* create button */
uiBlockSetCurLayout(block, layout);
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
but= uiDefIconTextButO(block, BUT, ot->idname, context, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL);
@@ -578,10 +565,21 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert
but= uiDefButO(block, BUT, ot->idname, context, (char*)name, 0, 0, w, UI_UNIT_Y, NULL);
/* assign properties */
- if(properties) {
+ if(properties || (flag & UI_ITEM_O_RETURN_PROPS)) {
PointerRNA *opptr= uiButGetOperatorPtrRNA(but);
- opptr->data= properties;
+
+ if(properties) {
+ opptr->data= properties;
+ }
+ else {
+ IDPropertyTemplate val = {0};
+ opptr->data= IDP_New(IDP_GROUP, val, "wmOperatorProperties");
+ }
+
+ return *opptr;
}
+
+ return PointerRNA_NULL;
}
static char *ui_menu_enumpropname(uiLayout *layout, char *opname, char *propname, int retval)
@@ -624,7 +622,7 @@ void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *pro
if(!name)
name= ui_menu_enumpropname(layout, opname, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext);
+ uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
}
void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
@@ -632,6 +630,8 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
wmOperatorType *ot= WM_operatortype_find(opname, 0);
PointerRNA ptr;
PropertyRNA *prop;
+ uiBut *bt;
+ uiBlock *block= layout->root->block;
if(!ot || !ot->srna) {
ui_item_disabled(layout, opname);
@@ -644,14 +644,31 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
if(prop && RNA_property_type(prop) == PROP_ENUM) {
EnumPropertyItem *item;
int totitem, i, free;
+ uiLayout *split= uiLayoutSplit(layout, 0);
+ uiLayout *column= uiLayoutColumn(split, 0);
- RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items(block->evil_C, &ptr, prop, &item, &totitem, &free);
- for(i=0; i<totitem; i++)
- if(item[i].identifier[0])
- uiItemEnumO(layout, (char*)item[i].name, item[i].icon, opname, propname, item[i].value);
- else
- uiItemS(layout);
+ for(i=0; i<totitem; i++) {
+ if(item[i].identifier[0]) {
+ uiItemEnumO(column, (char*)item[i].name, item[i].icon, opname, propname, item[i].value);
+ }
+ else {
+ if(item[i].name) {
+ if(i != 0) {
+ column= uiLayoutColumn(split, 0);
+ /* inconsistent, but menus with labels do not look good flipped */
+ block->flag |= UI_BLOCK_NO_FLIP;
+ }
+
+ uiItemL(column, (char*)item[i].name, 0);
+ bt= block->buttons.last;
+ bt->flag= UI_TEXT_LEFT;
+ }
+ else
+ uiItemS(column);
+ }
+ }
if(free)
MEM_freeN(item);
@@ -693,7 +710,7 @@ void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, ch
if(!name)
name= ui_menu_enumpropname(layout, opname, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext);
+ uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
}
void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value)
@@ -703,7 +720,7 @@ void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *
WM_operator_properties_create(&ptr, opname);
RNA_boolean_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext);
+ uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
}
void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value)
@@ -713,7 +730,7 @@ void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *prop
WM_operator_properties_create(&ptr, opname);
RNA_int_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext);
+ uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
}
void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value)
@@ -723,7 +740,7 @@ void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *pr
WM_operator_properties_create(&ptr, opname);
RNA_float_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext);
+ uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
}
void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value)
@@ -733,17 +750,17 @@ void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *p
WM_operator_properties_create(&ptr, opname);
RNA_string_set(&ptr, propname, value);
- uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext);
+ uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0);
}
void uiItemO(uiLayout *layout, char *name, int icon, char *opname)
{
- uiItemFullO(layout, name, icon, opname, NULL, layout->root->opcontext);
+ uiItemFullO(layout, name, icon, opname, NULL, layout->root->opcontext, 0);
}
/* RNA property items */
-static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA *prop, int index, int *r_w, int *r_h)
+static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int *r_w, int *r_h)
{
PropertyType type;
PropertySubType subtype;
@@ -752,14 +769,14 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA
/* arbitrary extended width by type */
type= RNA_property_type(prop);
subtype= RNA_property_subtype(prop);
- len= RNA_property_array_length(prop);
+ len= RNA_property_array_length(ptr, prop);
if(ELEM3(type, PROP_STRING, PROP_POINTER, PROP_ENUM) && !name[0])
name= "non-empty text";
else if(type == PROP_BOOLEAN && !name[0])
icon= ICON_DOT;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
h= UI_UNIT_Y;
/* increase height for arrays */
@@ -776,22 +793,24 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA
}
else if(ui_layout_vary_direction(layout) == UI_ITEM_VARY_X) {
if(type == PROP_BOOLEAN && strcmp(name, "") != 0)
- w += UI_UNIT_X;
+ w += UI_UNIT_X/5;
else if(type == PROP_ENUM)
w += UI_UNIT_X/2;
+ else if(type == PROP_FLOAT || type == PROP_INT)
+ w += UI_UNIT_X*3;
}
*r_w= w;
*r_h= h;
}
-void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int expand, int slider, int toggle)
+void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag)
{
uiBlock *block= layout->root->block;
uiBut *but;
PropertyType type;
char namestr[UI_MAX_NAME_STR];
- int len, w, h;
+ int len, w, h, slider, toggle, expand;
if(!ptr->data || !prop)
return;
@@ -800,7 +819,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
/* retrieve info */
type= RNA_property_type(prop);
- len= RNA_property_array_length(prop);
+ len= RNA_property_array_length(ptr, prop);
/* set name and icon */
if(!name)
@@ -822,8 +841,12 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
icon= (RNA_property_enum_get(ptr, prop) == value)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
}
+ slider= (flag & UI_ITEM_R_SLIDER);
+ toggle= (flag & UI_ITEM_R_TOGGLE);
+ expand= (flag & UI_ITEM_R_EXPAND);
+
/* get size */
- ui_item_rna_size(layout, name, icon, prop, index, &w, &h);
+ ui_item_rna_size(layout, name, icon, ptr, prop, index, &w, &h);
/* array property */
if(index == RNA_NO_INDEX && len > 0)
@@ -859,7 +882,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
}
}
-void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle)
+void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int flag)
{
PropertyRNA *prop;
@@ -874,7 +897,7 @@ void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *prop
return;
}
- uiItemFullR(layout, name, icon, ptr, prop, RNA_NO_INDEX, 0, expand, slider, toggle);
+ uiItemFullR(layout, name, icon, ptr, prop, RNA_NO_INDEX, 0, flag);
}
void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value)
@@ -892,7 +915,7 @@ void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr,
return;
}
- uiItemFullR(layout, name, icon, ptr, prop, RNA_ENUM_VALUE, value, 0, 0, 0);
+ uiItemFullR(layout, name, icon, ptr, prop, RNA_ENUM_VALUE, value, 0);
}
void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value)
@@ -923,7 +946,7 @@ void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRN
for(a=0; item[a].identifier; a++) {
if(item[a].value == ivalue) {
- uiItemFullR(layout, (char*)item[a].name, item[a].icon, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, 0, 0);
+ uiItemFullR(layout, (char*)item[a].name, item[a].icon, ptr, prop, RNA_ENUM_VALUE, ivalue, 0);
break;
}
}
@@ -935,6 +958,8 @@ void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRN
void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname)
{
PropertyRNA *prop;
+ uiBlock *block= layout->root->block;
+ uiBut *bt;
prop= RNA_struct_find_property(ptr, propname);
@@ -946,14 +971,31 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname)
if(RNA_property_type(prop) == PROP_ENUM) {
EnumPropertyItem *item;
int totitem, i, free;
+ uiLayout *split= uiLayoutSplit(layout, 0);
+ uiLayout *column= uiLayoutColumn(split, 0);
- RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
- for(i=0; i<totitem; i++)
- if(item[i].identifier[0])
- uiItemEnumR(layout, (char*)item[i].name, 0, ptr, propname, item[i].value);
- else
- uiItemS(layout);
+ for(i=0; i<totitem; i++) {
+ if(item[i].identifier[0]) {
+ uiItemEnumR(column, (char*)item[i].name, 0, ptr, propname, item[i].value);
+ }
+ else {
+ if(item[i].name) {
+ if(i != 0) {
+ column= uiLayoutColumn(split, 0);
+ /* inconsistent, but menus with labels do not look good flipped */
+ block->flag |= UI_BLOCK_NO_FLIP;
+ }
+
+ uiItemL(column, (char*)item[i].name, 0);
+ bt= block->buttons.last;
+ bt->flag= UI_TEXT_LEFT;
+ }
+ else
+ uiItemS(column);
+ }
+ }
if(free)
MEM_freeN(item);
@@ -1090,7 +1132,7 @@ void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *p
/* create button */
block= uiLayoutGetBlock(layout);
- ui_item_rna_size(layout, name, icon, prop, 0, &w, &h);
+ ui_item_rna_size(layout, name, icon, ptr, prop, 0, &w, &h);
but= ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h);
ui_but_add_search(but, ptr, prop, searchptr, searchprop);
@@ -1123,7 +1165,7 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 1);
h= UI_UNIT_Y;
if(layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */
@@ -1181,7 +1223,7 @@ void uiItemL(uiLayout *layout, char *name, int icon)
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
but= uiDefIconTextBut(block, LABEL, 0, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
@@ -1206,7 +1248,7 @@ void uiItemV(uiLayout *layout, char *name, int icon, int argval)
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
uiDefIconTextButF(block, BUTM, 0, icon, (char*)name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, argval, "");
@@ -1226,12 +1268,12 @@ void uiItemS(uiLayout *layout)
}
/* level items */
-void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func)
+void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg)
{
if(!func)
return;
- ui_item_menu(layout, name, icon, func, NULL, NULL);
+ ui_item_menu(layout, name, icon, func, arg, NULL);
}
typedef struct MenuItemLevel {
@@ -1984,6 +2026,11 @@ int uiLayoutGetAlignment(uiLayout *layout)
return layout->alignment;
}
+int uiLayoutGetWidth(uiLayout *layout)
+{
+ return layout->w;
+}
+
float uiLayoutGetScaleX(uiLayout *layout)
{
return layout->scale[0];
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 846fbe75072..05001109b53 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -104,7 +104,7 @@ static int panel_aligned(ScrArea *sa, ARegion *ar)
SpaceButs *sbuts= sa->spacedata.first;
return sbuts->align;
}
- else if(sa->spacetype==SPACE_INFO && ar->regiontype == RGN_TYPE_WINDOW)
+ else if(sa->spacetype==SPACE_USERPREF && ar->regiontype == RGN_TYPE_WINDOW)
return BUT_VERTICAL;
else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS)
return BUT_VERTICAL;
@@ -1247,7 +1247,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
if(!pa || pa->paneltab!=NULL)
continue;
- if(pa->type && pa->type->flag & PNL_NO_HEADER)
+ if(pa->type && pa->type->flag & PNL_NO_HEADER) // XXX - accessed freed panels when scripts reload, need to fix.
continue;
if(block->minx <= mx && block->maxx >= mx)
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index b59db055647..1d911fef418 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -38,6 +38,7 @@
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
+#include "BLI_ghash.h"
#include "BKE_context.h"
#include "BKE_icons.h"
@@ -75,13 +76,14 @@
/*********************** Menu Data Parsing ********************* */
-typedef struct {
+typedef struct MenuEntry {
char *str;
int retval;
int icon;
+ int sepr;
} MenuEntry;
-typedef struct {
+typedef struct MenuData {
char *instr;
char *title;
int titleicon;
@@ -111,7 +113,7 @@ static void menudata_set_title(MenuData *md, char *title, int titleicon)
md->titleicon= titleicon;
}
-static void menudata_add_item(MenuData *md, char *str, int retval, int icon)
+static void menudata_add_item(MenuData *md, char *str, int retval, int icon, int sepr)
{
if (md->nitems==md->itemssize) {
int nsize= md->itemssize?(md->itemssize<<1):1;
@@ -129,6 +131,7 @@ static void menudata_add_item(MenuData *md, char *str, int retval, int icon)
md->items[md->nitems].str= str;
md->items[md->nitems].retval= retval;
md->items[md->nitems].icon= icon;
+ md->items[md->nitems].sepr= sepr;
md->nitems++;
}
@@ -142,12 +145,13 @@ void menudata_free(MenuData *md)
/**
* Parse menu description strings, string is of the
- * form "[sss%t|]{(sss[%xNN]|), (%l|)}", ssss%t indicates the
+ * form "[sss%t|]{(sss[%xNN]|), (%l|), (sss%l|)}", ssss%t indicates the
* menu title, sss or sss%xNN indicates an option,
* if %xNN is given then NN is the return value if
* that option is selected otherwise the return value
* is the index of the option (starting with 1). %l
- * indicates a seperator.
+ * indicates a seperator, sss%l indicates a label and
+ * new column.
*
* @param str String to be parsed.
* @retval new menudata structure, free with menudata_free()
@@ -157,7 +161,7 @@ MenuData *decompose_menu_string(char *str)
char *instr= BLI_strdup(str);
MenuData *md= menudata_new(instr);
char *nitem= NULL, *s= instr;
- int nicon=0, nretval= 1, nitem_is_title= 0;
+ int nicon=0, nretval= 1, nitem_is_title= 0, nitem_is_sepr= 0;
while (1) {
char c= *s;
@@ -174,7 +178,10 @@ MenuData *decompose_menu_string(char *str)
*s= '\0';
s++;
} else if (s[1]=='l') {
- nitem= "%l";
+ nitem_is_sepr= 1;
+ if(!nitem) nitem= "";
+
+ *s= '\0';
s++;
} else if (s[1]=='i') {
nicon= atoi(s+2);
@@ -186,15 +193,18 @@ MenuData *decompose_menu_string(char *str)
if (nitem) {
*s= '\0';
- if (nitem_is_title) {
+ if(nitem_is_title) {
menudata_set_title(md, nitem, nicon);
nitem_is_title= 0;
- } else {
+ }
+ else if(nitem_is_sepr) {
/* prevent separator to get a value */
- if(nitem[0]=='%' && nitem[1]=='l')
- menudata_add_item(md, nitem, -1, nicon);
- else
- menudata_add_item(md, nitem, nretval, nicon);
+ menudata_add_item(md, nitem, -1, nicon, 1);
+ nretval= md->nitems+1;
+ nitem_is_sepr= 0;
+ }
+ else {
+ menudata_add_item(md, nitem, nretval, nicon, 0);
nretval= md->nitems+1;
}
@@ -396,7 +406,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
char *str;
opptr= uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
- str= WM_operator_pystring(but->optype, opptr, 0);
+ str= WM_operator_pystring(C, but->optype, opptr, 0);
/* operator info */
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", str);
@@ -827,6 +837,8 @@ static void ui_searchbox_region_free(ARegion *ar)
ar->regiondata= NULL;
}
+static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, uiBlock *block);
+
ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
{
uiStyle *style= U.uistyles.first; // XXX pass on as arg
@@ -847,7 +859,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
/* create searchbox data */
data= MEM_callocN(sizeof(uiSearchboxData), "uiSearchboxData");
-
+
/* set font, get bb */
data->fstyle= style->widget; /* copy struct */
data->fstyle.align= UI_STYLE_TEXT_CENTER;
@@ -929,10 +941,14 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
}
}
if(y1 < 0) {
- y1 += 36;
- y2 += 36;
+ int newy1;
+ UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->y2 + ofsy, 0, &newy1);
+ newy1 += butregion->winrct.ymin;
+
+ y2= y2-y1 + newy1;
+ y1= newy1;
}
-
+
/* widget rect, in region coords */
data->bbox.xmin= MENU_SHADOW_SIDE;
data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE;
@@ -1310,24 +1326,21 @@ void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle)
/***************************** Menu Button ***************************/
-uiBlock *ui_block_func_MENU(bContext *C, uiPopupBlockHandle *handle, void *arg_but)
+static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str)
{
- uiBut *but= arg_but;
- uiBlock *block;
+ uiBlock *block= uiLayoutGetBlock(layout);
+ uiPopupBlockHandle *handle= block->handle;
+ uiLayout *split, *column=NULL;
uiBut *bt;
MenuData *md;
- ListBase lb;
- float aspect;
- int width, height, boxh, columns, rows, startx, starty, x1, y1, xmax, a;
-
- /* create the block */
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
+ MenuEntry *entry;
+ char *instr= arg_str;
+ int columns, rows, a, b;
/* compute menu data */
- md= decompose_menu_string(but->str);
+ md= decompose_menu_string(instr);
- /* columns and row calculation */
+ /* columns and row estimation */
columns= (md->nitems+20)/20;
if(columns<1)
columns= 1;
@@ -1339,180 +1352,114 @@ uiBlock *ui_block_func_MENU(bContext *C, uiPopupBlockHandle *handle, void *arg_b
rows= 1;
while(rows*columns<md->nitems)
rows++;
-
- /* prevent scaling up of pupmenu */
- aspect= but->block->aspect;
- if(aspect < 1.0f)
- aspect = 1.0f;
-
- /* size and location */
- if(md->title)
- width= 1.5*aspect*strlen(md->title)+UI_GetStringWidth(md->title);
- else
- width= 0;
- for(a=0; a<md->nitems; a++) {
- xmax= aspect*UI_GetStringWidth(md->items[a].str);
- if(md->items[a].icon)
- xmax += 20*aspect;
- if(xmax>width)
- width= xmax;
- }
-
- width+= 10;
- if(width < (but->x2 - but->x1))
- width = (but->x2 - but->x1);
- if(width<50)
- width=50;
-
- boxh= MENU_BUTTON_HEIGHT;
-
- height= rows*boxh;
- if(md->title)
- height+= boxh;
-
- /* here we go! */
- startx= but->x1;
- starty= but->y1;
-
+ /* create title */
if(md->title) {
- uiBut *bt;
-
- if (md->titleicon) {
- bt= uiDefIconTextBut(block, LABEL, 0, md->titleicon, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, "");
- } else {
- bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, "");
+ if(md->titleicon) {
+ uiItemL(layout, md->title, md->titleicon);
+ }
+ else {
+ uiItemL(layout, md->title, 0);
+ bt= block->buttons.last;
bt->flag= UI_TEXT_LEFT;
}
}
- for(a=0; a<md->nitems; a++) {
+ /* inconsistent, but menus with labels do not look good flipped */
+ for(a=0, b=0; a<md->nitems; a++, b++) {
+ entry= &md->items[a];
+
+ if(entry->sepr && entry->str[0])
+ block->flag |= UI_BLOCK_NO_FLIP;
+ }
+
+ /* create items */
+ split= uiLayoutSplit(layout, 0);
+
+ for(a=0, b=0; a<md->nitems; a++, b++) {
+ if(block->flag & UI_BLOCK_NO_FLIP)
+ entry= &md->items[a];
+ else
+ entry= &md->items[md->nitems-a-1];
- x1= startx + width*((int)(md->nitems-a-1)/rows);
- y1= starty - boxh*(rows - ((md->nitems - a - 1)%rows)) + (rows*boxh);
+ /* new column on N rows or on separation label */
+ if((b % rows == 0) || (entry->sepr && entry->str[0])) {
+ column= uiLayoutColumn(split, 0);
+ b= 0;
+ }
- if (strcmp(md->items[md->nitems-a-1].str, "%l")==0) {
- bt= uiDefBut(block, SEPR, B_NOP, "", x1, y1,(short)(width-(rows>1)), (short)(boxh-1), NULL, 0.0, 0.0, 0, 0, "");
+ if(entry->sepr) {
+ uiItemL(column, entry->str, entry->icon);
+ bt= block->buttons.last;
+ bt->flag= UI_TEXT_LEFT;
}
- else if(md->items[md->nitems-a-1].icon) {
- bt= uiDefIconTextButF(block, BUTM|FLO, B_NOP, md->items[md->nitems-a-1].icon ,md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), &handle->retvalue, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, "");
+ else if(entry->icon) {
+ uiDefIconTextButF(block, BUTM|FLO, B_NOP, entry->icon, entry->str, 0, 0,
+ UI_UNIT_X*5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
}
else {
- bt= uiDefButF(block, BUTM|FLO, B_NOP, md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), &handle->retvalue, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, "");
+ uiDefButF(block, BUTM|FLO, B_NOP, entry->str, 0, 0,
+ UI_UNIT_X*5, UI_UNIT_X, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
}
}
menudata_free(md);
-
- /* the code up here has flipped locations, because of change of preferred order */
- /* thats why we have to switch list order too, to make arrowkeys work */
-
- lb.first= lb.last= NULL;
- bt= block->buttons.first;
- while(bt) {
- uiBut *next= bt->next;
- BLI_remlink(&block->buttons, bt);
- BLI_addhead(&lb, bt);
- bt= next;
- }
- block->buttons= lb;
-
- block->direction= UI_TOP;
- uiEndBlock(C, block);
-
- return block;
}
-uiBlock *ui_block_func_ICONROW(bContext *C, uiPopupBlockHandle *handle, void *arg_but)
+void ui_block_func_ICONROW(bContext *C, uiLayout *layout, void *arg_but)
{
+ uiBlock *block= uiLayoutGetBlock(layout);
+ uiPopupBlockHandle *handle= block->handle;
uiBut *but= arg_but;
- uiBlock *block;
int a;
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
-
- for(a=(int)but->hardmin; a<=(int)but->hardmax; a++) {
- uiDefIconButF(block, BUTM|FLO, B_NOP, but->icon+(a-but->hardmin), 0, (short)(18*a), (short)(but->x2-but->x1-4), 18, &handle->retvalue, (float)a, 0.0, 0, 0, "");
- }
-
- block->direction= UI_TOP;
-
- uiEndBlock(C, block);
-
- return block;
+ for(a=(int)but->hardmin; a<=(int)but->hardmax; a++)
+ uiDefIconButF(block, BUTM|FLO, B_NOP, but->icon+(a-but->hardmin), 0, 0, UI_UNIT_X*5, UI_UNIT_Y,
+ &handle->retvalue, (float)a, 0.0, 0, 0, "");
}
-uiBlock *ui_block_func_ICONTEXTROW(bContext *C, uiPopupBlockHandle *handle, void *arg_but)
+void ui_block_func_ICONTEXTROW(bContext *C, uiLayout *layout, void *arg_but)
{
- uiBut *but= arg_but;
- uiBlock *block;
+ uiBlock *block= uiLayoutGetBlock(layout);
+ uiPopupBlockHandle *handle= block->handle;
+ uiBut *but= arg_but, *bt;
MenuData *md;
- int width, xmax, ypos, a;
-
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
+ MenuEntry *entry;
+ int a;
md= decompose_menu_string(but->str);
- /* size and location */
- /* expand menu width to fit labels */
- if(md->title)
- width= 2*strlen(md->title)+UI_GetStringWidth(md->title);
- else
- width= 0;
-
- for(a=0; a<md->nitems; a++) {
- xmax= UI_GetStringWidth(md->items[a].str);
- if(xmax>width) width= xmax;
+ /* title */
+ if(md->title) {
+ bt= uiDefBut(block, LABEL, 0, md->title, 0, 0, UI_UNIT_X*5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ bt->flag= UI_TEXT_LEFT;
}
- width+= 30;
- if (width<50) width=50;
-
- ypos = 1;
-
/* loop through the menu options and draw them out with icons & text labels */
for(a=0; a<md->nitems; a++) {
+ entry= &md->items[md->nitems-a-1];
- /* add a space if there's a separator (%l) */
- if (strcmp(md->items[a].str, "%l")==0) {
- ypos +=3;
- }
- else {
- uiDefIconTextButF(block, BUTM|FLO, B_NOP, (short)((but->icon)+(md->items[a].retval-but->hardmin)), md->items[a].str, 0, ypos,(short)width, 19, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
- ypos += 20;
- }
+ if(entry->sepr)
+ uiItemS(layout);
+ else
+ uiDefIconTextButF(block, BUTM|FLO, B_NOP, (short)((but->icon)+(entry->retval-but->hardmin)), entry->str,
+ 0, 0, UI_UNIT_X*5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
}
-
- if(md->title) {
- uiBut *bt;
- bt= uiDefBut(block, LABEL, 0, md->title, 0, ypos, (short)width, 19, NULL, 0.0, 0.0, 0, 0, "");
- bt->flag= UI_TEXT_LEFT;
- }
-
menudata_free(md);
-
- block->direction= UI_TOP;
-
- uiBoundsBlock(block, 3);
- uiEndBlock(C, block);
-
- return block;
}
+#if 0
static void ui_warp_pointer(short x, short y)
{
/* XXX 2.50 which function to use for this? */
-#if 0
/* OSX has very poor mousewarp support, it sends events;
this causes a menu being pressed immediately ... */
#ifndef __APPLE__
warp_pointer(x, y);
#endif
-#endif
}
+#endif
/********************* Color Button ****************/
@@ -2158,406 +2105,115 @@ void uiBlockColorbandButtons(uiBlock *block, ColorBand *coba, rctf *butr, int ev
}
-/* ******************** PUPmenu ****************** */
-
-static int pupmenu_set= 0;
+/************************ Popup Menu Memory ****************************/
-void uiPupMenuSetActive(int val)
+static int ui_popup_menu_hash(char *str)
{
- pupmenu_set= val;
+ return BLI_ghashutil_strhash(str);
}
-/* value== -1 read, otherwise set */
-static int pupmenu_memory(char *str, int value)
+/* but == NULL read, otherwise set */
+uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but)
{
static char mem[256], first=1;
- int val=0, nr=0;
+ int hash= block->puphash;
if(first) {
- memset(mem, 0, 256);
+ /* init */
+ memset(mem, -1, sizeof(mem));
first= 0;
}
- while(str[nr]) {
- val+= str[nr];
- nr++;
- }
-
- if(value >= 0) mem[ val & 255 ]= value;
- else return mem[ val & 255 ];
-
- return 0;
-}
-
-#define PUP_LABELH 6
-
-typedef struct uiPupMenuInfo {
- char *instr;
- int mx, my;
- int startx, starty;
- int maxrow;
-} uiPupMenuInfo;
-
-uiBlock *ui_block_func_PUPMENU(bContext *C, uiPopupBlockHandle *handle, void *arg_info)
-{
- uiBlock *block;
- uiPupMenuInfo *info;
- int columns, rows, mousemove[2]= {0, 0}, mousewarp= 0;
- int width, height, xmax, ymax, maxrow;
- int a, startx, starty, endx, endy, x1, y1;
- int lastselected;
- MenuData *md;
-
- info= arg_info;
- maxrow= info->maxrow;
- height= 0;
-
- /* block stuff first, need to know the font */
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
- block->direction= UI_DOWN;
-
- md= decompose_menu_string(info->instr);
-
- rows= md->nitems;
- if(rows<1)
- rows= 1;
-
- columns= 1;
-
- /* size and location, title slightly bigger for bold */
- if(md->title) {
- width= 2*strlen(md->title)+UI_GetStringWidth(md->title);
- width /= columns;
- }
- else width= 0;
-
- for(a=0; a<md->nitems; a++) {
- xmax= UI_GetStringWidth(md->items[a].str);
- if(xmax>width) width= xmax;
-
- if(strcmp(md->items[a].str, "%l")==0) height+= PUP_LABELH;
- else height+= MENU_BUTTON_HEIGHT;
- }
-
- width+= 10;
- if (width<50) width=50;
-
- wm_window_get_size(CTX_wm_window(C), &xmax, &ymax);
-
- /* set first item */
- lastselected= 0;
- if(pupmenu_set) {
- lastselected= pupmenu_set-1;
- pupmenu_set= 0;
- }
- else if(md->nitems>1) {
- lastselected= pupmenu_memory(info->instr, -1);
- }
-
- startx= info->mx-(0.8*(width));
- starty= info->my-height+MENU_BUTTON_HEIGHT/2;
- if(lastselected>=0 && lastselected<md->nitems) {
- for(a=0; a<md->nitems; a++) {
- if(a==lastselected) break;
- if( strcmp(md->items[a].str, "%l")==0) starty+= PUP_LABELH;
- else starty+=MENU_BUTTON_HEIGHT;
- }
-
- //starty= info->my-height+MENU_BUTTON_HEIGHT/2+lastselected*MENU_BUTTON_HEIGHT;
- }
-
- if(startx<10) {
- startx= 10;
- }
- if(starty<10) {
- mousemove[1]= 10-starty;
- starty= 10;
- }
-
- endx= startx+width*columns;
- endy= starty+height;
- if(endx>xmax) {
- endx= xmax-10;
- startx= endx-width*columns;
- }
- if(endy>ymax-20) {
- mousemove[1]= ymax-endy-20;
- endy= ymax-20;
- starty= endy-height;
- }
-
- if(mousemove[0] || mousemove[1]) {
- ui_warp_pointer(info->mx+mousemove[0], info->my+mousemove[1]);
- mousemove[0]= info->mx;
- mousemove[1]= info->my;
- mousewarp= 1;
+ if(but) {
+ /* set */
+ mem[hash & 255 ]= BLI_findindex(&block->buttons, but);
+ return NULL;
}
-
- /* here we go! */
- if(md->title) {
- uiBut *bt;
- char titlestr[256];
-
- if(md->titleicon) {
- width+= 20;
- sprintf(titlestr, " %s", md->title);
- uiDefIconTextBut(block, LABEL, 0, md->titleicon, titlestr, startx, (short)(starty+height), width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
- }
- else {
- bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+height), columns*width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
- bt->flag= UI_TEXT_LEFT;
- }
-
- //uiDefBut(block, SEPR, 0, "", startx, (short)(starty+height)-MENU_SEPR_HEIGHT, width, MENU_SEPR_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
+ else {
+ /* get */
+ return BLI_findlink(&block->buttons, mem[hash & 255]);
}
+}
- x1= startx + width*((int)a/rows);
- y1= starty + height - MENU_BUTTON_HEIGHT; // - MENU_SEPR_HEIGHT;
-
- for(a=0; a<md->nitems; a++) {
- char *name= md->items[a].str;
- int icon = md->items[a].icon;
+/******************** Popup Menu with callback or string **********************/
- if(strcmp(name, "%l")==0) {
- uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, "");
- y1 -= PUP_LABELH;
- }
- else if (icon) {
- uiDefIconButF(block, BUTM, B_NOP, icon, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
- y1 -= MENU_BUTTON_HEIGHT;
- }
- else {
- uiDefButF(block, BUTM, B_NOP, name, x1, y1, width, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
- y1 -= MENU_BUTTON_HEIGHT;
- }
- }
-
- uiBoundsBlock(block, 1);
- uiEndBlock(C, block);
-
- menudata_free(md);
+struct uiPopupMenu {
+ uiBlock *block;
+ uiLayout *layout;
+ uiBut *but;
- /* XXX 2.5 need to store last selected */
-#if 0
- /* calculate last selected */
- if(event & ui_return_ok) {
- lastselected= 0;
- for(a=0; a<md->nitems; a++) {
- if(val==md->items[a].retval) lastselected= a;
- }
-
- pupmenu_memory(info->instr, lastselected);
- }
-#endif
-
- /* XXX 2.5 need to warp back */
-#if 0
- if(mousemove[1] && (event & ui_return_out)==0)
- ui_warp_pointer(mousemove[0], mousemove[1]);
- return val;
-#endif
+ int mx, my, popup, slideout;
+ int startx, starty, maxrow;
- return block;
-}
+ uiMenuCreateFunc menu_func;
+ void *menu_arg;
+};
-uiBlock *ui_block_func_PUPMENUCOL(bContext *C, uiPopupBlockHandle *handle, void *arg_info)
+static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, void *arg_pup)
{
uiBlock *block;
- uiPupMenuInfo *info;
- int columns, rows, mousemove[2]= {0, 0}, mousewarp;
- int width, height, xmax, ymax, maxrow;
- int a, startx, starty, endx, endy, x1, y1;
- float fvalue;
- MenuData *md;
-
- info= arg_info;
- maxrow= info->maxrow;
- height= 0;
-
- /* block stuff first, need to know the font */
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
- block->direction= UI_DOWN;
-
- md= decompose_menu_string(info->instr);
-
- /* columns and row calculation */
- columns= (md->nitems+maxrow)/maxrow;
- if (columns<1) columns= 1;
-
- if(columns > 8) {
- maxrow += 5;
- columns= (md->nitems+maxrow)/maxrow;
- }
-
- rows= (int) md->nitems/columns;
- if (rows<1) rows= 1;
-
- while (rows*columns<(md->nitems+columns) ) rows++;
-
- /* size and location, title slightly bigger for bold */
- if(md->title) {
- width= 2*strlen(md->title)+UI_GetStringWidth(md->title);
- width /= columns;
- }
- else width= 0;
-
- for(a=0; a<md->nitems; a++) {
- xmax= UI_GetStringWidth(md->items[a].str);
- if(xmax>width) width= xmax;
- }
-
- width+= 10;
- if (width<50) width=50;
-
- height= rows*MENU_BUTTON_HEIGHT;
- if (md->title) height+= MENU_BUTTON_HEIGHT;
-
- wm_window_get_size(CTX_wm_window(C), &xmax, &ymax);
-
- /* find active item */
- fvalue= handle->retvalue;
- for(a=0; a<md->nitems; a++) {
- if( md->items[a].retval== (int)fvalue ) break;
- }
-
- /* no active item? */
- if(a==md->nitems) {
- if(md->title) a= -1;
- else a= 0;
- }
-
- if(a>0)
- startx = info->mx-width/2 - ((int)(a)/rows)*width;
- else
- startx= info->mx-width/2;
- starty = info->my-height + MENU_BUTTON_HEIGHT/2 + ((a)%rows)*MENU_BUTTON_HEIGHT;
-
- if (md->title) starty+= MENU_BUTTON_HEIGHT;
-
- if(startx<10) {
- mousemove[0]= 10-startx;
- startx= 10;
- }
- if(starty<10) {
- mousemove[1]= 10-starty;
- starty= 10;
- }
-
- endx= startx+width*columns;
- endy= starty+height;
-
- if(endx>xmax) {
- mousemove[0]= xmax-endx-10;
- endx= xmax-10;
- startx= endx-width*columns;
- }
- if(endy>ymax) {
- mousemove[1]= ymax-endy-10;
- endy= ymax-10;
- starty= endy-height;
- }
+ uiBut *bt;
+ ScrArea *sa;
+ ARegion *ar;
+ uiPopupMenu *pup= arg_pup;
+ int offset, direction, minwidth, flip;
- if(mousemove[0] || mousemove[1]) {
- ui_warp_pointer(info->mx+mousemove[0], info->my+mousemove[1]);
- mousemove[0]= info->mx;
- mousemove[1]= info->my;
- mousewarp= 1;
+ if(pup->menu_func) {
+ pup->block->handle= handle;
+ pup->menu_func(C, pup->layout, pup->menu_arg);
+ pup->block->handle= NULL;
}
- /* here we go! */
- if(md->title) {
- uiBut *bt;
+ if(pup->but) {
+ /* minimum width to enforece */
+ minwidth= pup->but->x2 - pup->but->x1;
- if(md->titleicon) {
+ if(pup->but->type == PULLDOWN || pup->but->menu_create_func) {
+ direction= UI_DOWN;
+ flip= 1;
}
else {
- bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*MENU_BUTTON_HEIGHT), columns*width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
- bt->flag= UI_TEXT_LEFT;
+ direction= UI_TOP;
+ flip= 0;
}
}
-
- for(a=0; a<md->nitems; a++) {
- char *name= md->items[a].str;
- int icon = md->items[a].icon;
-
- x1= startx + width*((int)a/rows);
- y1= starty - MENU_BUTTON_HEIGHT*(a%rows) + (rows-1)*MENU_BUTTON_HEIGHT;
-
- if(strcmp(name, "%l")==0) {
- uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, "");
- y1 -= PUP_LABELH;
- }
- else if (icon) {
- uiDefIconButF(block, BUTM, B_NOP, icon, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
- y1 -= MENU_BUTTON_HEIGHT;
- }
- else {
- uiDefButF(block, BUTM, B_NOP, name, x1, y1, width, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
- y1 -= MENU_BUTTON_HEIGHT;
- }
+ else {
+ minwidth= 50;
+ direction= UI_DOWN;
+ flip= 1;
}
-
- uiBoundsBlock(block, 1);
- uiEndBlock(C, block);
-
- menudata_free(md);
-
- /* XXX 2.5 need to warp back */
-#if 0
- if((event & UI_RETURN_OUT)==0)
- ui_warp_pointer(mousemove[0], mousemove[1]);
-#endif
-
- return block;
-}
-/************************** Menu Definitions ***************************/
-
-/* prototype */
-static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle, void *arg_info);
-
-struct uiPopupMenu {
- uiBlock *block;
- uiLayout *layout;
-};
-
-typedef struct uiMenuInfo {
- uiPopupMenu *pup;
- int mx, my, popup, slideout;
- int startx, starty;
-} uiMenuInfo;
-
-/************************ Menu Definitions to uiBlocks ***********************/
-
-static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle, void *arg_info)
-{
- uiBlock *block;
- uiMenuInfo *info= arg_info;
- uiPopupMenu *pup;
- ScrArea *sa;
- ARegion *ar;
-
- pup= info->pup;
block= pup->block;
- /* block stuff first, need to know the font */
- uiBlockSetRegion(block, handle->region);
- block->direction= UI_DOWN;
+ /* in some cases we create the block before the region,
+ so we set it delayed here if necessary */
+ if(BLI_findindex(&handle->region->uiblocks, block) == -1)
+ uiBlockSetRegion(block, handle->region);
+
+ block->direction= direction;
uiBlockLayoutResolve(C, block, NULL, NULL);
- if(info->popup) {
+ if(pup->popup) {
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_RET_1);
- uiBlockSetDirection(block, UI_DOWN);
+ uiBlockSetDirection(block, direction);
+
+ /* offset the mouse position, possibly based on earlier selection */
+ offset= 1.5*MENU_BUTTON_HEIGHT;
- /* here we set an offset for the mouse position */
- uiMenuPopupBoundsBlock(block, 1, 0, 1.5*MENU_BUTTON_HEIGHT);
+ if(block->flag & UI_BLOCK_POPUP_MEMORY) {
+ bt= ui_popup_menu_memory(block, NULL);
+
+ if(bt)
+ offset= -bt->y1 - 0.5f*MENU_BUTTON_HEIGHT;
+ }
+
+ block->minbounds= minwidth;
+ uiMenuPopupBoundsBlock(block, 1, 20, offset);
}
else {
/* for a header menu we set the direction automatic */
- if(!info->slideout) {
+ if(!pup->slideout && flip) {
sa= CTX_wm_area(C);
ar= CTX_wm_region(C);
@@ -2569,59 +2225,77 @@ static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle,
}
}
- uiTextBoundsBlock(block, 50);
+ block->minbounds= minwidth;
+ uiTextBoundsBlock(block, 40);
}
/* if menu slides out of other menu, override direction */
- if(info->slideout)
+ if(pup->slideout)
uiBlockSetDirection(block, UI_RIGHT);
uiEndBlock(C, block);
-
- return block;
+
+ return pup->block;
}
-uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg)
+uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg, char *str)
{
+ wmWindow *window= CTX_wm_window(C);
uiStyle *style= U.uistyles.first;
uiPopupBlockHandle *handle;
uiPopupMenu *pup;
- uiMenuInfo info;
pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy");
- pup->block= uiBeginBlock(C, NULL, "ui_popup_menu_create", UI_EMBOSSP);
+ pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP);
pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
+ pup->slideout= (but && (but->block->flag & UI_BLOCK_LOOP));
+ pup->but= but;
uiLayoutSetOperatorContext(pup->layout, WM_OP_INVOKE_REGION_WIN);
- /* create in advance so we can let buttons point to retval already */
- pup->block->handle= MEM_callocN(sizeof(uiPopupBlockHandle), "uiPopupBlockHandle");
+ if(!but) {
+ /* no button to start from, means we are a popup */
+ pup->mx= window->eventstate->x;
+ pup->my= window->eventstate->y;
+ pup->popup= 1;
+ }
- menu_func(C, pup->layout, arg);
-
- memset(&info, 0, sizeof(info));
- info.pup= pup;
- info.slideout= (but && (but->block->flag & UI_BLOCK_LOOP));
+ if(str) {
+ /* menu is created from a string */
+ pup->menu_func= ui_block_func_MENUSTR;
+ pup->menu_arg= str;
+ }
+ else {
+ /* menu is created from a callback */
+ pup->menu_func= menu_func;
+ pup->menu_arg= arg;
+ }
- handle= ui_popup_block_create(C, butregion, but, NULL, ui_block_func_MENU_ITEM, &info);
+ handle= ui_popup_block_create(C, butregion, but, NULL, ui_block_func_POPUP, pup);
+
+ if(!but) {
+ handle->popup= 1;
+
+ UI_add_popup_handlers(C, &window->handlers, handle);
+ WM_event_add_mousemove(C);
+ }
MEM_freeN(pup);
return handle;
}
-/*************************** Menu Creating API **************************/
-
-
-/*************************** Popup Menu API **************************/
+/******************** Popup Menu API with begin and end ***********************/
/* only return handler, and set optional title */
uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
{
uiStyle *style= U.uistyles.first;
- uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "menu start");
+ uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu");
uiBut *but;
pup->block= uiBeginBlock(C, NULL, "uiPupMenuBegin", UI_EMBOSSP);
+ pup->block->flag |= UI_BLOCK_POPUP_MEMORY;
+ pup->block->puphash= ui_popup_menu_hash((char*)title);
pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
uiLayoutSetOperatorContext(pup->layout, WM_OP_EXEC_REGION_WIN);
@@ -2640,8 +2314,6 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
but= uiDefBut(pup->block, LABEL, 0, (char*)title, 0, 0, 200, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
but->flag= UI_TEXT_LEFT;
}
-
- //uiDefBut(block, SEPR, 0, "", startx, (short)(starty+height)-MENU_SEPR_HEIGHT, width, MENU_SEPR_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
}
return pup;
@@ -2651,16 +2323,13 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
void uiPupMenuEnd(bContext *C, uiPopupMenu *pup)
{
wmWindow *window= CTX_wm_window(C);
- uiMenuInfo info;
uiPopupBlockHandle *menu;
- memset(&info, 0, sizeof(info));
- info.popup= 1;
- info.mx= window->eventstate->x;
- info.my= window->eventstate->y;
- info.pup= pup;
+ pup->popup= 1;
+ pup->mx= window->eventstate->x;
+ pup->my= window->eventstate->y;
- menu= ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_MENU_ITEM, &info);
+ menu= ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_POPUP, pup);
menu->popup= 1;
UI_add_popup_handlers(C, &window->handlers, menu);
@@ -2674,32 +2343,7 @@ uiLayout *uiPupMenuLayout(uiPopupMenu *pup)
return pup->layout;
}
-/* ************** standard pupmenus *************** */
-
-/* this one can called with operatortype name and operators */
-static uiPopupBlockHandle *ui_pup_menu(bContext *C, int maxrow, uiMenuHandleFunc func, void *arg, char *str, ...)
-{
- wmWindow *window= CTX_wm_window(C);
- uiPupMenuInfo info;
- uiPopupBlockHandle *menu;
-
- memset(&info, 0, sizeof(info));
- info.mx= window->eventstate->x;
- info.my= window->eventstate->y;
- info.maxrow= maxrow;
- info.instr= str;
-
- menu= ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_PUPMENU, &info);
- menu->popup= 1;
-
- UI_add_popup_handlers(C, &window->handlers, menu);
- WM_event_add_mousemove(C);
-
- menu->popup_func= func;
- menu->popup_arg= arg;
-
- return menu;
-}
+/*************************** Standard Popup Menus ****************************/
static void operator_name_cb(bContext *C, void *arg, int retval)
{
@@ -2709,17 +2353,6 @@ static void operator_name_cb(bContext *C, void *arg, int retval)
WM_operator_name_call(C, opname, WM_OP_EXEC_DEFAULT, NULL);
}
-static void vconfirm_opname(bContext *C, char *opname, char *title, char *itemfmt, va_list ap)
-{
- char *s, buf[512];
-
- s= buf;
- if (title) s+= sprintf(s, "%s%%t|", title);
- vsprintf(s, itemfmt, ap);
-
- ui_pup_menu(C, 0, operator_name_cb, opname, buf);
-}
-
static void operator_cb(bContext *C, void *arg, int retval)
{
wmOperator *op= arg;
@@ -2735,6 +2368,21 @@ static void confirm_cancel_operator(void *opv)
WM_operator_free(opv);
}
+static void vconfirm_opname(bContext *C, char *opname, char *title, char *itemfmt, va_list ap)
+{
+ uiPopupBlockHandle *handle;
+ char *s, buf[512];
+
+ s= buf;
+ if (title) s+= sprintf(s, "%s%%t|", title);
+ vsprintf(s, itemfmt, ap);
+
+ handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
+
+ handle->popup_func= operator_name_cb;
+ handle->popup_arg= opname;
+}
+
static void confirm_operator(bContext *C, wmOperator *op, char *title, char *item)
{
uiPopupBlockHandle *handle;
@@ -2743,11 +2391,13 @@ static void confirm_operator(bContext *C, wmOperator *op, char *title, char *ite
s= buf;
if (title) s+= sprintf(s, "%s%%t|%s", title, item);
- handle= ui_pup_menu(C, 0, operator_cb, op, buf);
+ handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
+
+ handle->popup_func= operator_cb;
+ handle->popup_arg= op;
handle->cancel_func= confirm_cancel_operator;
}
-
void uiPupMenuOkee(bContext *C, char *opname, char *str, ...)
{
va_list ap;
@@ -2760,7 +2410,6 @@ void uiPupMenuOkee(bContext *C, char *opname, char *str, ...)
va_end(ap);
}
-
void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename)
{
size_t len= strlen(filename);
@@ -2776,7 +2425,7 @@ void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename)
if(BLI_exists(filename)==0)
operator_cb(C, op, 1);
else
- confirm_operator(C, op, "Save over", filename);
+ confirm_operator(C, op, "Save Over", filename);
}
void uiPupMenuNotice(bContext *C, char *str, ...)
@@ -2826,7 +2475,7 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
}
str= BLI_dynstr_get_cstring(ds);
- ui_pup_menu(C, 0, NULL, NULL, str);
+ ui_popup_menu_create(C, NULL, NULL, NULL, NULL, str);
MEM_freeN(str);
BLI_dynstr_free(ds);
@@ -2870,3 +2519,4 @@ void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int
UI_add_popup_handlers(C, &window->handlers, handle);
WM_event_add_mousemove(C);
}
+
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 9ac839e1283..cb9216ec1c5 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -94,17 +94,17 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->paneltitle.uifont_id= UIFONT_DEFAULT;
style->paneltitle.points= 12;
style->paneltitle.kerning= 1;
- style->paneltitle.shadow= 5;
- style->paneltitle.shadx= 2;
- style->paneltitle.shady= -2;
- style->paneltitle.shadowalpha= 0.25f;
- style->paneltitle.shadowcolor= 0.0f;
+ style->paneltitle.shadow= 1;
+ style->paneltitle.shadx= 0;
+ style->paneltitle.shady= -1;
+ style->paneltitle.shadowalpha= 0.15f;
+ style->paneltitle.shadowcolor= 1.0f;
style->grouplabel.uifont_id= UIFONT_DEFAULT;
style->grouplabel.points= 12;
style->grouplabel.kerning= 1;
style->grouplabel.shadow= 3;
- style->grouplabel.shadx= 1;
+ style->grouplabel.shadx= 0;
style->grouplabel.shady= -1;
style->grouplabel.shadowalpha= 0.25f;
@@ -112,9 +112,9 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->widgetlabel.points= 11;
style->widgetlabel.kerning= 1;
style->widgetlabel.shadow= 3;
- style->widgetlabel.shadx= 1;
+ style->widgetlabel.shadx= 0;
style->widgetlabel.shady= -1;
- style->widgetlabel.shadowalpha= 0.3f;
+ style->widgetlabel.shadowalpha= 0.15f;
style->widgetlabel.shadowcolor= 1.0f;
style->widget.uifont_id= UIFONT_DEFAULT;
@@ -248,9 +248,6 @@ void uiStyleInit(void)
BLF_size(11, U.dpi);
BLF_size(12, U.dpi);
BLF_size(14, U.dpi);
-
- if (!(U.transopts & USER_USETEXTUREFONT))
- BLF_mode(BLF_MODE_BITMAP);
}
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4383ba8858b..6aa5f5efc41 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -56,12 +56,13 @@ void ui_template_fix_linking()
/********************** Header Template *************************/
-void uiTemplateHeader(uiLayout *layout, bContext *C)
+void uiTemplateHeader(uiLayout *layout, bContext *C, int menus)
{
uiBlock *block;
block= uiLayoutFreeBlock(layout);
- ED_area_header_standardbuttons(C, block, 0);
+ if(menus) ED_area_header_standardbuttons(C, block, 0);
+ else ED_area_header_switchbutton(C, block, 0);
}
/********************** Search Callbacks *************************/
@@ -236,11 +237,11 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc
int w= idptr.data?UI_UNIT_X:UI_UNIT_X*6;
if(newop) {
- but= uiDefIconTextButO(block, BUT, newop, WM_OP_EXEC_REGION_WIN, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL);
+ but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_REGION_WIN, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
else {
- but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
}
@@ -248,7 +249,7 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc
/* delete button */
if(idptr.data && (flag & UI_ID_DELETE)) {
if(unlinkop) {
- but= uiDefIconButO(block, BUT, unlinkop, WM_OP_EXEC_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
+ but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
}
else {
but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
@@ -427,36 +428,26 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i
else {
/* real modifier */
uiBlockBeginAlign(block);
- uiItemR(row, "", 0, &ptr, "name", 0, 0, 0);
+ uiItemR(row, "", 0, &ptr, "name", 0);
/* Softbody not allowed in this situation, enforce! */
if(((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) && (md->type!=eModifierType_Surface)) {
- uiItemR(row, "", ICON_SCENE, &ptr, "render", 0, 0, 0);
- uiItemR(row, "", ICON_VIEW3D, &ptr, "realtime", 0, 0, 0);
+ uiItemR(row, "", ICON_SCENE, &ptr, "render", 0);
+ uiItemR(row, "", ICON_RESTRICT_VIEW_OFF, &ptr, "realtime", 0);
if(mti->flags & eModifierTypeFlag_SupportsEditmode)
- uiItemR(row, "", ICON_VIEW3D, &ptr, "editmode", 0, 0, 0);
+ uiItemR(row, "", ICON_EDITMODE_HLT, &ptr, "editmode", 0);
}
- uiBlockEndAlign(block);
+
/* XXX uiBlockSetEmboss(block, UI_EMBOSSR); */
if(ob->type==OB_MESH && modifier_couldBeCage(md) && index<=lastCageIndex) {
- int icon; //, color;
-
- if(index==cageIndex) {
- // XXX color = TH_BUT_SETTING;
- icon = VICON_EDITMODE_HLT;
- } else if(index<cageIndex) {
- // XXX color = TH_BUT_NEUTRAL;
- icon = VICON_EDITMODE_DEHLT;
- } else {
- // XXX color = TH_BUT_NEUTRAL;
- icon = ICON_BLANK1;
- }
+
/* XXX uiBlockSetCol(block, color); */
- but = uiDefIconBut(block, BUT, 0, icon, 0, 0, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
+ but = uiDefIconBut(block, BUT, 0, ICON_MESH_DATA, 0, 0, 16, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
uiButSetFunc(but, modifiers_setOnCage, ob, md);
+ uiBlockEndAlign(block);
/* XXX uiBlockSetCol(block, TH_AUTO); */
}
}
@@ -464,8 +455,10 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i
/* up/down/delete */
if(!isVirtual) {
/* XXX uiBlockSetCol(block, TH_BUT_ACTION); */
+ uiBlockBeginAlign(block);
uiItemO(row, "", VICON_MOVE_UP, "OBJECT_OT_modifier_move_up");
uiItemO(row, "", VICON_MOVE_DOWN, "OBJECT_OT_modifier_move_down");
+ uiBlockEndAlign(block);
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -491,7 +484,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i
if(md->type==eModifierType_ParticleSystem) {
ParticleSystem *psys= ((ParticleSystemModifierData *)md)->psys;
- if(!(G.f & G_PARTICLEEDIT))
+ if(!(ob->mode & OB_MODE_PARTICLE_EDIT))
if(ELEM3(psys->part->ren_as, PART_DRAW_PATH, PART_DRAW_GR, PART_DRAW_OB) && psys->pathcache)
uiItemO(row, "Convert", 0, "OBJECT_OT_modifier_convert");
}
@@ -636,7 +629,7 @@ static void verify_constraint_name_func (bContext *C, void *con_v, void *name_v)
/* some commonly used macros in the constraints drawing code */
#define is_armature_target(target) (target && target->type==OB_ARMATURE)
-#define is_armature_owner(ob) ((ob->type == OB_ARMATURE) && (ob->flag & OB_POSEMODE))
+#define is_armature_owner(ob) ((ob->type == OB_ARMATURE) && (ob->mode & OB_MODE_POSE))
#define is_geom_target(target) (target && (ELEM(target->type, OB_MESH, OB_LATTICE)) )
/* Helper function for draw constraint - draws constraint space stuff
@@ -919,82 +912,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
draw_constraint_spaceselect(block, con, xco, yco-(73+theight), is_armature_owner(ob), -1);
}
break;
-#endif /* DISABLE_PYTHON */
-
- /*case CONSTRAINT_TYPE_RIGIDBODYJOINT:
- {
- if (data->type==CONSTRAINT_RB_GENERIC6DOF) {
- // Draw Pairs of LimitToggle+LimitValue
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 1, B_CONSTRAINT_TEST, "LinMinX", xco, yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+togButWidth, yco-offsetY, (textButWidth-5), 18, &(data->minLimit[0]), -extremeLin, extremeLin, 0.1,0.5,"min x limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 1, B_CONSTRAINT_TEST, "LinMaxX", xco+(width-(textButWidth-5)-togButWidth), yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+(width-textButWidth-5), yco-offsetY, (textButWidth), 18, &(data->maxLimit[0]), -extremeLin, extremeLin, 0.1,0.5,"max x limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 2, B_CONSTRAINT_TEST, "LinMinY", xco, yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+togButWidth, yco-offsetY, (textButWidth-5), 18, &(data->minLimit[1]), -extremeLin, extremeLin, 0.1,0.5,"min y limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 2, B_CONSTRAINT_TEST, "LinMaxY", xco+(width-(textButWidth-5)-togButWidth), yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+(width-textButWidth-5), yco-offsetY, (textButWidth), 18, &(data->maxLimit[1]), -extremeLin, extremeLin, 0.1,0.5,"max y limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 4, B_CONSTRAINT_TEST, "LinMinZ", xco, yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+togButWidth, yco-offsetY, (textButWidth-5), 18, &(data->minLimit[2]), -extremeLin, extremeLin, 0.1,0.5,"min z limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 4, B_CONSTRAINT_TEST, "LinMaxZ", xco+(width-(textButWidth-5)-togButWidth), yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+(width-textButWidth-5), yco-offsetY, (textButWidth), 18, &(data->maxLimit[2]), -extremeLin, extremeLin, 0.1,0.5,"max z limit");
- uiBlockEndAlign(block);
- offsetY += 20;
- }
- if ((data->type==CONSTRAINT_RB_GENERIC6DOF) || (data->type==CONSTRAINT_RB_CONETWIST)) {
- // Draw Pairs of LimitToggle+LimitValue /
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 8, B_CONSTRAINT_TEST, "AngMinX", xco, yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+togButWidth, yco-offsetY, (textButWidth-5), 18, &(data->minLimit[3]), -extremeAngX, extremeAngX, 0.1,0.5,"min x limit");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 8, B_CONSTRAINT_TEST, "AngMaxX", xco+(width-(textButWidth-5)-togButWidth), yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+(width-textButWidth-5), yco-offsetY, (textButWidth), 18, &(data->maxLimit[3]), -extremeAngX, extremeAngX, 0.1,0.5,"max x limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 16, B_CONSTRAINT_TEST, "AngMinY", xco, yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+togButWidth, yco-offsetY, (textButWidth-5), 18, &(data->minLimit[4]), -extremeAngY, extremeAngY, 0.1,0.5,"min y limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 16, B_CONSTRAINT_TEST, "AngMaxY", xco+(width-(textButWidth-5)-togButWidth), yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+(width-textButWidth-5), yco-offsetY, (textButWidth), 18, &(data->maxLimit[4]), -extremeAngY, extremeAngY, 0.1,0.5,"max y limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 32, B_CONSTRAINT_TEST, "AngMinZ", xco, yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+togButWidth, yco-offsetY, (textButWidth-5), 18, &(data->minLimit[5]), -extremeAngZ, extremeAngZ, 0.1,0.5,"min z limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 32, B_CONSTRAINT_TEST, "AngMaxZ", xco+(width-(textButWidth-5)-togButWidth), yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", xco+(width-textButWidth-5), yco-offsetY, (textButWidth), 18, &(data->maxLimit[5]), -extremeAngZ, extremeAngZ, 0.1,0.5,"max z limit");
- uiBlockEndAlign(block);
- }
-
- }
- break;
- */
+#endif
case CONSTRAINT_TYPE_NULL:
{
@@ -1170,7 +1088,7 @@ static void do_preview_buttons(bContext *C, void *arg, int event)
}
}
-void uiTemplatePreview(uiLayout *layout, ID *id, ID *parent)
+void uiTemplatePreview(uiLayout *layout, ID *id, ID *parent, MTex *slot)
{
uiLayout *row, *col;
uiBlock *block;
@@ -1211,7 +1129,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, ID *parent)
/* add preview */
uiDefBut(block, BUT_EXTRA, 0, "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, pid, 0.0, 0.0, 0, 0, "");
- uiBlockSetDrawExtraFunc(block, ED_preview_draw, pparent);
+ uiBlockSetDrawExtraFunc(block, ED_preview_draw, pparent, slot);
uiBlockSetHandleFunc(block, do_preview_buttons, NULL);
/* add buttons */
@@ -1227,7 +1145,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, ID *parent)
uiDefIconButC(block, ROW, B_MATPRV, ICON_MATCUBE, 0, 0,UI_UNIT_X*1.5,UI_UNIT_Y, &(ma->pr_type), 10, MA_CUBE, 0, 0, "Preview type: Cube");
uiDefIconButC(block, ROW, B_MATPRV, ICON_MONKEY, 0, 0,UI_UNIT_X*1.5,UI_UNIT_Y, &(ma->pr_type), 10, MA_MONKEY, 0, 0, "Preview type: Monkey");
uiDefIconButC(block, ROW, B_MATPRV, ICON_HAIR, 0, 0,UI_UNIT_X*1.5,UI_UNIT_Y, &(ma->pr_type), 10, MA_HAIR, 0, 0, "Preview type: Hair strands");
- uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 0, 0,UI_UNIT_X*1.5,UI_UNIT_Y, &(ma->pr_type), 10, MA_SPHERE_A, 0, 0, "Preview type: Large sphere with sky");
+ uiDefIconButC(block, ROW, B_MATPRV, ICON_MAT_SPHERE_SKY, 0, 0,UI_UNIT_X*1.5,UI_UNIT_Y, &(ma->pr_type), 10, MA_SPHERE_A, 0, 0, "Preview type: Large sphere with sky");
}
if(pr_texture) {
@@ -1265,17 +1183,21 @@ void uiTemplateColorRamp(uiLayout *layout, ColorBand *coba, int expand)
#include "DNA_color_types.h"
-void uiTemplateCurveMapping(uiLayout *layout, CurveMapping *cumap, int type)
+void uiTemplateCurveMapping(uiLayout *layout, CurveMapping *cumap, int type, int compact)
{
- uiBlock *block;
rctf rect;
if(cumap) {
- rect.xmin= 0; rect.xmax= 200;
- rect.ymin= 0; rect.ymax= 190;
+ if(compact) {
+ rect.xmin= 0; rect.xmax= 150;
+ rect.ymin= 0; rect.ymax= 140;
+ }
+ else {
+ rect.xmin= 0; rect.xmax= 200;
+ rect.ymin= 0; rect.ymax= 190;
+ }
- block= uiLayoutFreeBlock(layout);
- curvemap_buttons(block, cumap, type, 0, 0, &rect);
+ curvemap_layout(layout, cumap, type, 0, 0, &rect);
}
}
@@ -1302,9 +1224,9 @@ void uiTemplateTriColorSet(uiLayout *layout, PointerRNA *ptr, char *propname)
/* nselected, selected, active color swatches */
csPtr= RNA_property_pointer_get(ptr, prop);
- uiItemR(row, "", 0, &csPtr, "normal", 0, 0, 0);
- uiItemR(row, "", 0, &csPtr, "selected", 0, 0, 0);
- uiItemR(row, "", 0, &csPtr, "active", 0, 0, 0);
+ uiItemR(row, "", 0, &csPtr, "normal", 0);
+ uiItemR(row, "", 0, &csPtr, "selected", 0);
+ uiItemR(row, "", 0, &csPtr, "active", 0);
}
/********************* Layer Buttons Template ************************/
@@ -1336,7 +1258,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname)
* the 'remainder' is added to this, as it will be ok to have first row slightly wider if need be
* - for now, only split into groups if if group will have at least 5 items
*/
- layers= RNA_property_array_length(prop);
+ layers= RNA_property_array_length(ptr, prop);
cols= (layers / 2) + (layers % 2);
groups= ((cols / 2) < 5) ? (1) : (cols / 2);
@@ -1356,7 +1278,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname)
/* add layers as toggle buts */
for (col= 0; (col < cols) && (layer < layers); col++, layer++) {
int icon=0; // XXX - add some way of setting this...
- uiItemFullR(uRow, "", icon, ptr, prop, layer, 0, 0, 0, 1);
+ uiItemFullR(uRow, "", icon, ptr, prop, layer, 0, UI_ITEM_R_TOGGLE);
}
}
}
@@ -1396,7 +1318,7 @@ ListBase uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, char *pr
Panel *pa;
ListBase lb, *itemlb;
char *name, str[32];
- int icon=0, i= 0, activei= 0, len, items, found, min, max;
+ int icon=0, i= 0, activei= 0, len= 0, items, found, min, max;
lb.first= lb.last= NULL;
@@ -1532,7 +1454,8 @@ ListBase uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, char *pr
/* init numbers */
RNA_property_int_range(activeptr, activeprop, &min, &max);
- len= max - min + 1;
+ if(prop)
+ len= RNA_property_collection_length(ptr, prop);
items= CLAMPIS(len, rows, 5);
pa->list_scroll= MIN2(pa->list_scroll, len-items);
@@ -1658,7 +1581,7 @@ static void do_running_jobs(bContext *C, void *arg, int event)
WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C));
break;
case B_STOPANIM:
- ED_screen_animation_timer(C, 0, 0);
+ WM_operator_name_call(C, "SCREEN_OT_animation_play", WM_OP_INVOKE_SCREEN, NULL);
break;
}
}
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 8ff9e857407..5b44f6544d1 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -72,7 +72,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
{
uiBut *but=NULL;
const char *propname= RNA_property_identifier(prop);
- int arraylen= RNA_property_array_length(prop);
+ int arraylen= RNA_property_array_length(ptr, prop);
switch(RNA_property_type(prop)) {
case PROP_BOOLEAN: {
@@ -81,7 +81,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
if(arraylen && index == -1)
return NULL;
- length= RNA_property_array_length(prop);
+ length= RNA_property_array_length(ptr, prop);
if(length)
value= RNA_property_boolean_get_index(ptr, prop, index);
@@ -152,8 +152,6 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int
uiLayout *split, *col;
char *name;
- uiItemL(layout, (char*)RNA_struct_ui_name(ptr->type), 0);
-
RNA_STRUCT_BEGIN(ptr, prop) {
if(strcmp(RNA_property_identifier(prop), "rna_type") == 0)
continue;
@@ -177,7 +175,7 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int
if(strcmp(name, "Axis")==0) {
uiDefButR(uiLayoutGetBlock(col), BUT_NORMAL, 0, name, 0, 0, 100, 100, ptr, "axis", -1, 0, 0, -1, -1, NULL);
}
- else uiItemFullR(col, "", 0, ptr, prop, -1, 0, 0, 0, 0);
+ else uiItemFullR(col, "", 0, ptr, prop, -1, 0, 0);
}
RNA_STRUCT_END;
}
@@ -446,6 +444,20 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code,
uiBlockClearButLock(block);
}
+ /* add button */
+ if(events & UI_ID_ADD_NEW) {
+ uiBlockSetButLock(block, (events & UI_ID_PIN) && *pin_p, "Can't unlink pinned data");
+ if(parid && parid->lib);
+ else {
+ dup_params= MEM_dupallocN(params);
+ but= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, x,y,DEF_ICON_BUT_WIDTH,DEF_BUT_HEIGHT, &dup_params->browsenr, params->browsenr, 32767.0, 0, 0, "Add new data block");
+ uiButSetNFunc(but, idpoin_cb, MEM_dupallocN(params), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
+ x+= DEF_ICON_BUT_WIDTH;
+ }
+
+ uiBlockClearButLock(block);
+ }
+
/* delete button */
if(events & UI_ID_DELETE) {
uiBlockSetButLock(block, (events & UI_ID_PIN) && *pin_p, "Can't unlink pinned data");
@@ -945,6 +957,72 @@ void curvemap_buttons(uiBlock *block, CurveMapping *cumap, char labeltype, short
cumap, 0.0f, 1.0f, 0, 0, "");
}
+/* still unsure how this call evolves... we use labeltype for defining what curve-channels to show */
+void curvemap_layout(uiLayout *layout, CurveMapping *cumap, char labeltype, short event, short redraw, rctf *rect)
+{
+ uiLayout *row;
+ uiBlock *block;
+ uiBut *bt;
+ float dx, fy= rect->ymax-18.0f;
+ int icon;
+
+ block= uiLayoutGetBlock(layout);
+
+ /* curve choice options + tools/settings, 8 icons + spacer */
+ dx= UI_UNIT_X;
+
+ row= uiLayoutRow(layout, 0);
+ uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_RIGHT);
+
+ if(labeltype=='v') { /* vector */
+ row= uiLayoutRow(layout, 1);
+
+ if(cumap->cm[0].curve)
+ uiDefButI(block, ROW, redraw, "X", 0, 0, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+ if(cumap->cm[1].curve)
+ uiDefButI(block, ROW, redraw, "Y", 0, 0, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+ if(cumap->cm[2].curve)
+ uiDefButI(block, ROW, redraw, "Z", 0, 0, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+ }
+ else if(labeltype=='c') { /* color */
+ row= uiLayoutRow(layout, 1);
+
+ if(cumap->cm[3].curve)
+ uiDefButI(block, ROW, redraw, "C", 0, 0, dx, 16, &cumap->cur, 0.0, 3.0, 0.0, 0.0, "");
+ if(cumap->cm[0].curve)
+ uiDefButI(block, ROW, redraw, "R", 0, 0, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
+ if(cumap->cm[1].curve)
+ uiDefButI(block, ROW, redraw, "G", 0, 0, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
+ if(cumap->cm[2].curve)
+ uiDefButI(block, ROW, redraw, "B", 0, 0, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
+ }
+
+ row= uiLayoutRow(row, 1);
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ bt= uiDefIconBut(block, BUT, redraw, ICON_ZOOMIN, 0, 0, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom in");
+ uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL);
+
+ bt= uiDefIconBut(block, BUT, redraw, ICON_ZOOMOUT, 0, 0, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom out");
+ uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL);
+
+ bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, event, ICON_MODIFIER, 0, 0, dx, 18, "Tools");
+
+ if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT;
+ bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, event, icon, 0, 0, dx, 18, "Clipping Options");
+
+ bt= uiDefIconBut(block, BUT, event, ICON_X, 0, 0, dx, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points");
+ uiButSetFunc(bt, curvemap_buttons_delete, cumap, NULL);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ row= uiLayoutRow(layout, 0);
+ uiDefBut(block, BUT_CURVE, event, "",
+ rect->xmin, rect->ymin, rect->xmax-rect->xmin, fy-rect->ymin,
+ cumap, 0.0f, 1.0f, 0, 0, "");
+}
+
+
#define B_BANDCOL 1
static int vergcband(const void *a1, const void *a2)
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 596ae1b7276..f0085f71373 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -835,9 +835,11 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
// else transopts= ui_translate_buttons();
/* cut string in 2 parts - only for menu entries */
- if(ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS)==0) {
- cpoin= strchr(but->drawstr, '|');
- if(cpoin) *cpoin= 0;
+ if((but->block->flag & UI_BLOCK_LOOP)) {
+ if(ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS)==0) {
+ cpoin= strchr(but->drawstr, '|');
+ if(cpoin) *cpoin= 0;
+ }
}
glColor3ubv((unsigned char*)wcol->text);
@@ -889,10 +891,10 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
rect->xmin += UI_icon_get_width(but->icon+but->iconadd);
if(but->editstr || (but->flag & UI_TEXT_LEFT))
- rect->xmin += 10;
+ rect->xmin += 5;
}
else if((but->flag & UI_TEXT_LEFT))
- rect->xmin += 10;
+ rect->xmin += 5;
/* always draw text for textbutton cursor */
widget_draw_text(fstyle, wcol, but, rect);
@@ -1083,7 +1085,7 @@ static struct uiWidgetColors wcol_tool= {
{255, 255, 255, 255},
1,
- 25, -25
+ 15, -15
};
static struct uiWidgetColors wcol_box= {
@@ -1895,7 +1897,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
widget_init(&wtb);
/* half rounded */
- round_box_edges(&wtb, roundboxalign, rect, 4.0f);
+ round_box_edges(&wtb, roundboxalign, rect, 5.0f);
ui_get_but_vectorf(but, col);
wcol->inner[0]= FTOCHAR(col[0]);
@@ -1914,7 +1916,7 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun
widget_init(&wtb);
/* half rounded */
- round_box_edges(&wtb, roundboxalign, rect, 5.0f);
+ round_box_edges(&wtb, roundboxalign, rect, 4.0f);
widgetbase_draw(&wtb, wcol);
@@ -1944,12 +1946,12 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int
{
if(state & UI_ACTIVE) {
uiWidgetBase wtb;
- float rad= 0.5f*(rect->ymax - rect->ymin);
+ float rad= 0.5f*(rect->ymax - rect->ymin); // 4.0f
widget_init(&wtb);
- /* fully rounded */
- round_box_edges(&wtb, roundboxalign, rect, rad);
+ /* half rounded */
+ round_box_edges(&wtb, 15, rect, rad);
widgetbase_draw(&wtb, wcol);
}
@@ -2043,11 +2045,11 @@ static void widget_but(uiWidgetColors *wcol, rcti *rect, int state, int roundbox
static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
{
uiWidgetBase wtb;
- float rad= 0.5f*(rect->ymax - rect->ymin);
+ float rad= 5.0f; //0.5f*(rect->ymax - rect->ymin);
widget_init(&wtb);
- /* fully rounded */
+ /* half rounded */
round_box_edges(&wtb, roundboxalign, rect, rad);
widgetbase_draw(&wtb, wcol);
@@ -2065,7 +2067,7 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType *
if(but->block->drawextra) {
/* note: drawextra can change rect +1 or -1, to match round errors of existing previews */
- but->block->drawextra(C, but->poin, but->block->drawextra_arg, rect);
+ but->block->drawextra(C, but->poin, but->block->drawextra_arg1, but->block->drawextra_arg2, rect);
/* make mask to draw over image */
UI_GetThemeColor3ubv(TH_BACK, col);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 297e22610a6..8aaede7515a 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -150,6 +150,9 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case SPACE_INFO:
ts= &btheme->tinfo;
break;
+ case SPACE_USERPREF:
+ ts= &btheme->tuserpref;
+ break;
case SPACE_TIME:
ts= &btheme->ttime;
break;
@@ -402,6 +405,7 @@ static void ui_theme_init_new(bTheme *btheme)
ui_theme_init_new_do(&btheme->ttime);
ui_theme_init_new_do(&btheme->tnode);
ui_theme_init_new_do(&btheme->tlogic);
+ ui_theme_init_new_do(&btheme->tuserpref);
}
@@ -441,6 +445,7 @@ void ui_theme_init_userdef(void)
SETCOL(btheme->tv3d.text_hi, 255, 255, 255, 255);
SETCOLF(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0);
+ SETCOLF(btheme->tv3d.button, 0.45, 0.45, 0.45, 1.0);
SETCOL(btheme->tv3d.panel, 165, 165, 165, 127);
SETCOL(btheme->tv3d.shade1, 160, 160, 160, 100);
@@ -583,6 +588,10 @@ void ui_theme_init_userdef(void)
btheme->tinfo= btheme->tv3d;
SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
+ /* space user preferences */
+ btheme->tuserpref= btheme->tv3d;
+ SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
+
/* space sound */
btheme->tsnd= btheme->tv3d;
SETCOLF(btheme->tsnd.back, 0.45, 0.45, 0.45, 1.0);
@@ -1233,6 +1242,7 @@ void init_userdef_do_versions(void)
}
SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
+ SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
}
}
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 1e8cda68e6d..f3610769d17 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -235,6 +235,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
}
break;
+ case LEFTMOUSE:
case MIDDLEMOUSE:
if (event->val==0) {
/* calculate overall delta mouse-movement for redo */
@@ -826,6 +827,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
}
break;
+ case LEFTMOUSE:
case MIDDLEMOUSE:
if (event->val==0) {
/* for redo, store the overall deltas - need to respect zoom-locks here... */
diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c
index 6c66ae468fa..c3f1637d3af 100644
--- a/source/blender/editors/mesh/editmesh.c
+++ b/source/blender/editors/mesh/editmesh.c
@@ -67,6 +67,7 @@
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_pointcache.h"
#include "BKE_softbody.h"
#include "BKE_texture.h"
@@ -742,78 +743,6 @@ static void edge_drawflags(Mesh *me, EditMesh *em)
}
}
-static int editmesh_pointcache_edit(Scene *scene, Object *ob, int totvert, PTCacheID *pid_p, float mat[][4], int load)
-{
- Cloth *cloth;
- SoftBody *sb;
- ClothModifierData *clmd;
- PTCacheID pid, tmpid;
- int cfra= (int)scene->r.cfra, found= 0;
-
- pid.cache= NULL;
-
- /* check for cloth */
- if(modifiers_isClothEnabled(ob)) {
- clmd= (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth);
- cloth= clmd->clothObject;
-
- BKE_ptcache_id_from_cloth(&tmpid, ob, clmd);
-
- /* verify vertex count and baked status */
- if(cloth && (totvert == cloth->numverts)) {
- if((tmpid.cache->flag & PTCACHE_BAKED) && (tmpid.cache->flag & PTCACHE_BAKE_EDIT)) {
- pid= tmpid;
-
- if(load && (pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE))
- found= 1;
- }
- }
- }
-
- /* check for softbody */
- if(!found && ob->soft) {
- sb= ob->soft;
-
- BKE_ptcache_id_from_softbody(&tmpid, ob, sb);
-
- /* verify vertex count and baked status */
- if(sb->bpoint && (totvert == sb->totpoint)) {
- if((tmpid.cache->flag & PTCACHE_BAKED) && (tmpid.cache->flag & PTCACHE_BAKE_EDIT)) {
- pid= tmpid;
-
- if(load && (pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE))
- found= 1;
- }
- }
- }
-
- /* if not making editmesh verify editing was active for this point cache */
- if(load) {
- if(found)
- pid.cache->flag &= ~PTCACHE_BAKE_EDIT_ACTIVE;
- else
- return 0;
- }
-
- /* check if we have cache for this frame */
- if(pid.cache && BKE_ptcache_id_exist(&pid, cfra)) {
- *pid_p = pid;
-
- if(load) {
- Mat4CpyMat4(mat, ob->obmat);
- }
- else {
- pid.cache->editframe= cfra;
- pid.cache->flag |= PTCACHE_BAKE_EDIT_ACTIVE;
- Mat4Invert(mat, ob->obmat); /* ob->imat is not up to date */
- }
-
- return 1;
- }
-
- return 0;
-}
-
/* turns Mesh into editmesh */
void make_editMesh(Scene *scene, Object *ob)
{
@@ -827,11 +756,8 @@ void make_editMesh(Scene *scene, Object *ob)
EditFace *efa;
EditEdge *eed;
EditSelection *ese;
- PTCacheID pid;
- Cloth *cloth;
- SoftBody *sb;
- float cacheco[3], cachemat[4][4], *co;
- int tot, a, cacheedit= 0, eekadoodle= 0;
+ float *co;
+ int tot, a, eekadoodle= 0;
if(me->edit_mesh==NULL)
me->edit_mesh= MEM_callocN(sizeof(EditMesh), "editmesh");
@@ -866,32 +792,16 @@ void make_editMesh(Scene *scene, Object *ob)
CustomData_copy(&me->vdata, &em->vdata, CD_MASK_EDITMESH, CD_CALLOC, 0);
mvert= me->mvert;
- cacheedit= editmesh_pointcache_edit(scene, ob, tot, &pid, cachemat, 0);
-
evlist= (EditVert **)MEM_mallocN(tot*sizeof(void *),"evlist");
for(a=0; a<tot; a++, mvert++) {
- if(cacheedit) {
- if(pid.type == PTCACHE_TYPE_CLOTH) {
- cloth= ((ClothModifierData*)pid.data)->clothObject;
- VECCOPY(cacheco, cloth->verts[a].x)
- }
- else if(pid.type == PTCACHE_TYPE_SOFTBODY) {
- sb= (SoftBody*)pid.data;
- VECCOPY(cacheco, sb->bpoint[a].pos)
- }
-
- Mat4MulVecfl(cachemat, cacheco);
- co= cacheco;
- }
- else
- co= mvert->co;
+ co= mvert->co;
eve= addvertlist(em, co, NULL);
evlist[a]= eve;
// face select sets selection in next loop
- if( (FACESEL_PAINT_TEST)==0 )
+ if(!paint_facesel_test(ob))
eve->f |= (mvert->flag & 1);
if (mvert->flag & ME_HIDE) eve->h= 1;
@@ -966,7 +876,7 @@ void make_editMesh(Scene *scene, Object *ob)
if(mface->flag & ME_FACE_SEL) {
efa->f |= SELECT;
- if(FACESEL_PAINT_TEST) {
+ if(paint_facesel_test(ob)) {
EM_select_face(efa, 1); /* flush down */
}
}
@@ -1010,11 +920,6 @@ void make_editMesh(Scene *scene, Object *ob)
if (EM_get_actFace(em, 0)==NULL) {
EM_set_actFace(em, em->faces.first ); /* will use the first face, this is so we alwats have an active face */
}
-
- /* vertex coordinates change with cache edit, need to recalc */
- if(cacheedit)
- recalc_editnormals(em);
-
}
/* makes Mesh out of editmesh */
@@ -1030,12 +935,8 @@ void load_editMesh(Scene *scene, Object *ob)
EditFace *efa, *efa_act;
EditEdge *eed;
EditSelection *ese;
- SoftBody *sb;
- Cloth *cloth;
- ClothModifierData *clmd;
- PTCacheID pid;
- float *fp, *newkey, *oldkey, nor[3], cacheco[3], cachemat[4][4];
- int i, a, ototvert, cacheedit= 0;
+ float *fp, *newkey, *oldkey, nor[3];
+ int i, a, ototvert;
/* this one also tests of edges are not in faces: */
/* eed->f2==0: not in face, f2==1: draw it */
@@ -1089,48 +990,8 @@ void load_editMesh(Scene *scene, Object *ob)
eve= em->verts.first;
a= 0;
- /* check for point cache editing */
- cacheedit= editmesh_pointcache_edit(scene, ob, em->totvert, &pid, cachemat, 1);
-
while(eve) {
- if(cacheedit) {
- if(pid.type == PTCACHE_TYPE_CLOTH) {
- clmd= (ClothModifierData*)pid.data;
- cloth= clmd->clothObject;
-
- /* assign position */
- VECCOPY(cacheco, cloth->verts[a].x)
- VECCOPY(cloth->verts[a].x, eve->co);
- Mat4MulVecfl(cachemat, cloth->verts[a].x);
-
- /* find plausible velocity, not physical correct but gives
- * nicer results when commented */
- VECSUB(cacheco, cloth->verts[a].x, cacheco);
- VecMulf(cacheco, clmd->sim_parms->stepsPerFrame*10.0f);
- VECADD(cloth->verts[a].v, cloth->verts[a].v, cacheco);
- }
- else if(pid.type == PTCACHE_TYPE_SOFTBODY) {
- sb= (SoftBody*)pid.data;
-
- /* assign position */
- VECCOPY(cacheco, sb->bpoint[a].pos)
- VECCOPY(sb->bpoint[a].pos, eve->co);
- Mat4MulVecfl(cachemat, sb->bpoint[a].pos);
-
- /* changing velocity for softbody doesn't seem to give
- * good results? */
-#if 0
- VECSUB(cacheco, sb->bpoint[a].pos, cacheco);
- VecMulf(cacheco, sb->minloops*10.0f);
- VECADD(sb->bpoint[a].vec, sb->bpoint[a].pos, cacheco);
-#endif
- }
-
- if(oldverts)
- VECCOPY(mvert->co, oldverts[a].co)
- }
- else
- VECCOPY(mvert->co, eve->co);
+ VECCOPY(mvert->co, eve->co);
mvert->mat_nr= 32767; /* what was this for, halos? */
@@ -1154,14 +1015,6 @@ void load_editMesh(Scene *scene, Object *ob)
eve= eve->next;
mvert++;
}
-
- /* write changes to cache */
- if(cacheedit) {
- if(pid.type == PTCACHE_TYPE_CLOTH)
- cloth_write_cache(ob, pid.data, pid.cache->editframe);
- else if(pid.type == PTCACHE_TYPE_SOFTBODY)
- sbWriteCache(ob, pid.cache->editframe);
- }
/* the edges */
a= 0;
@@ -1626,6 +1479,7 @@ void MESH_OT_separate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Separate";
+ ot->description= "Separate selected geometry into a new mesh.";
ot->idname= "MESH_OT_separate";
/* api callbacks */
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index 34eca8748bc..19078d2f6ff 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -227,6 +227,7 @@ void MESH_OT_dupli_extrude_cursor(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Duplicate or Extrude at 3D Cursor";
+ ot->description= "Duplicate and extrude selected vertices, edges or faces towards 3D Cursor.";
ot->idname= "MESH_OT_dupli_extrude_cursor";
/* api callbacks */
@@ -358,6 +359,7 @@ void MESH_OT_fgon_make(struct wmOperatorType *ot)
{
/* identifiers */
ot->name= "Make F-gon";
+ ot->description= "Make fgon from selected faces.";
ot->idname= "MESH_OT_fgon_make";
/* api callbacks */
@@ -390,6 +392,7 @@ void MESH_OT_fgon_clear(struct wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear F-gon";
+ ot->description= "Clear fgon from selected face.";
ot->idname= "MESH_OT_fgon_clear";
/* api callbacks */
@@ -801,6 +804,7 @@ void MESH_OT_edge_face_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Make Edge/Face";
+ ot->description= "Add an edge or face to selected.";
ot->idname= "MESH_OT_edge_face_add";
/* api callbacks */
@@ -1327,6 +1331,7 @@ void MESH_OT_primitive_plane_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Plane";
+ ot->description= "Construct a filled planar mesh with 4 vertices.";
ot->idname= "MESH_OT_primitive_plane_add";
/* api callbacks */
@@ -1359,6 +1364,7 @@ void MESH_OT_primitive_cube_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Cube";
+ ot->description= "Construct a cube mesh.";
ot->idname= "MESH_OT_primitive_cube_add";
/* api callbacks */
@@ -1391,6 +1397,7 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Circle";
+ ot->description= "Construct a circle mesh.";
ot->idname= "MESH_OT_primitive_circle_add";
/* api callbacks */
@@ -1428,6 +1435,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Cylinder";
+ ot->description= "Construct a cylindrical mesh (ends filled).";
ot->idname= "MESH_OT_primitive_cylinder_add";
/* api callbacks */
@@ -1465,6 +1473,7 @@ void MESH_OT_primitive_tube_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Tube";
+ ot->description= "Construct a cylindrical mesh (ends not filled).";
ot->idname= "MESH_OT_primitive_tube_add";
/* api callbacks */
@@ -1502,6 +1511,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Cone";
+ ot->description= "Construct a conic mesh (ends filled).";
ot->idname= "MESH_OT_primitive_cone_add";
/* api callbacks */
@@ -1541,6 +1551,7 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Grid";
+ ot->description= "Construct a grid mesh.";
ot->idname= "MESH_OT_primitive_grid_add";
/* api callbacks */
@@ -1576,6 +1587,7 @@ void MESH_OT_primitive_monkey_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Monkey";
+ ot->description= "Construct a Suzanne mesh.";
ot->idname= "MESH_OT_primitive_monkey_add";
/* api callbacks */
@@ -1608,6 +1620,7 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add UV Sphere";
+ ot->description= "Construct a UV sphere mesh.";
ot->idname= "MESH_OT_primitive_uv_sphere_add";
/* api callbacks */
@@ -1645,6 +1658,7 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Ico Sphere";
+ ot->description= "Construct an Icosphere mesh.";
ot->idname= "MESH_OT_primitive_ico_sphere_add";
/* api callbacks */
@@ -1690,6 +1704,7 @@ void MESH_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Duplicate";
+ ot->description= "Duplicate selected vertices, edges or faces.";
ot->idname= "MESH_OT_duplicate";
/* api callbacks */
diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c
index 20fd33fc731..b46f745e8f5 100644
--- a/source/blender/editors/mesh/editmesh_loop.c
+++ b/source/blender/editors/mesh/editmesh_loop.c
@@ -717,6 +717,7 @@ void MESH_OT_knife_cut(wmOperatorType *ot)
PropertyRNA *prop;
ot->name= "Knife Cut";
+ ot->description= "Cut selected edges and faces into parts.";
ot->idname= "MESH_OT_knife_cut";
ot->invoke= WM_gesture_lines_invoke;
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 5fc2ce46792..f2c5b7fb727 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -65,6 +65,7 @@ editmesh_mods.c, UI level access, no geometry changes
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_material.h"
+#include "BKE_paint.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
#include "BKE_report.h"
@@ -92,7 +93,7 @@ editmesh_mods.c, UI level access, no geometry changes
#include "BLO_sys_types.h" // for intptr_t support
/* XXX */
-static void waitcursor() {}
+static void waitcursor(int val) {}
static int pupmenu() {return 0;}
/* ****************************** MIRROR **************** */
@@ -242,7 +243,7 @@ int EM_mask_init_backbuf_border(ViewContext *vc, short mcords[][2], short tot, s
/* method in use for face selecting too */
if(vc->obedit==NULL) {
- if(FACESEL_PAINT_TEST);
+ if(paint_facesel_test(vc->obact));
else return 0;
}
else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;
@@ -297,7 +298,7 @@ int EM_init_backbuf_circle(ViewContext *vc, short xs, short ys, short rads)
/* method in use for face selecting too */
if(vc->obedit==NULL) {
- if(FACESEL_PAINT_TEST);
+ if(paint_facesel_test(vc->obact));
else return 0;
}
else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;
@@ -1271,6 +1272,7 @@ void MESH_OT_select_similar(wmOperatorType *ot)
/* identifiers */
ot->name= "Select Similar";
+ ot->description= "Select similar vertices, edges or faces by property types.";
ot->idname= "MESH_OT_select_similar";
/* api callbacks */
@@ -1999,6 +2001,7 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Multi Select Loops";
+ ot->description= "Select a loop of connected edges by connection type.";
ot->idname= "MESH_OT_loop_multi_select";
/* api callbacks */
@@ -2077,6 +2080,7 @@ void MESH_OT_loop_select(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Loop Select";
+ ot->description= "Select a loop of connected edges.";
ot->idname= "MESH_OT_loop_select";
/* api callbacks */
@@ -2176,6 +2180,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Shortest Path Select";
+ ot->description= "Select shortest path between two selections.";
ot->idname= "MESH_OT_select_shortest_path";
/* api callbacks */
@@ -2467,6 +2472,7 @@ void MESH_OT_select_linked_pick(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Linked";
+ ot->description= "(un)select all vertices linked to the active mesh.";
ot->idname= "MESH_OT_select_linked_pick";
/* api callbacks */
@@ -2549,6 +2555,7 @@ void MESH_OT_select_linked(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Linked All";
+ ot->description= "Select all vertices linked to the active mesh.";
ot->idname= "MESH_OT_select_linked";
/* api callbacks */
@@ -2684,6 +2691,7 @@ void MESH_OT_hide(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Hide Selection";
+ ot->description= "Hide (un)selected vertices, edges or faces.";
ot->idname= "MESH_OT_hide";
/* api callbacks */
@@ -2750,6 +2758,7 @@ void MESH_OT_reveal(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Reveal Hidden";
+ ot->description= "Reveal all hidden vertices, edges and faces.";
ot->idname= "MESH_OT_reveal";
/* api callbacks */
@@ -2804,6 +2813,7 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
/* identifiers */
ot->name= "Select by Number of Vertices";
+ ot->description= "Select vertices or faces by vertex count.";
ot->idname= "MESH_OT_select_by_number_vertices";
/* api callbacks */
@@ -2924,6 +2934,7 @@ void MESH_OT_edges_select_sharp(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Sharp Edges";
+ ot->description= "Marked selected edges as sharp.";
ot->idname= "MESH_OT_edges_select_sharp";
/* api callbacks */
@@ -3091,6 +3102,7 @@ void MESH_OT_faces_select_linked_flat(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Linked Flat Faces";
+ ot->description= "Select linked faces by angle.";
ot->idname= "MESH_OT_faces_select_linked_flat";
/* api callbacks */
@@ -3191,6 +3203,7 @@ void MESH_OT_select_non_manifold(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Non Manifold";
+ ot->description= "Select all non-manifold vertices or edges.";
ot->idname= "MESH_OT_select_non_manifold";
/* api callbacks */
@@ -3254,6 +3267,7 @@ void MESH_OT_select_inverse(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Inverse";
+ ot->description= "Select inverse of (un)selected vertices, edges or faces.";
ot->idname= "MESH_OT_select_inverse";
/* api callbacks */
@@ -3291,6 +3305,7 @@ void MESH_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select/Deselect All";
+ ot->description= "(de)select all vertices, edges or faces.";
ot->idname= "MESH_OT_select_all_toggle";
/* api callbacks */
@@ -3361,6 +3376,7 @@ void MESH_OT_select_more(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select More";
+ ot->description= "Select more vertices, edges or faces connected to initial selection.";
ot->idname= "MESH_OT_select_more";
/* api callbacks */
@@ -3450,6 +3466,7 @@ void MESH_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Less";
+ ot->description= "Select less vertices, edges or faces connected to initial selection.";
ot->idname= "MESH_OT_select_less";
/* api callbacks */
@@ -3519,6 +3536,7 @@ void MESH_OT_select_random(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Random";
+ ot->description= "Randomly select vertices.";
ot->idname= "MESH_OT_select_random";
/* api callbacks */
@@ -3610,6 +3628,7 @@ void MESH_OT_selection_type(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Selection Mode";
+ ot->description= "Set the selection mode type.";
ot->idname= "MESH_OT_selection_type";
/* api callbacks */
@@ -3672,6 +3691,7 @@ void MESH_OT_mark_seam(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mark Seam";
+ ot->description= "(un)mark selected edges as a seam.";
ot->idname= "MESH_OT_mark_seam";
/* api callbacks */
@@ -3724,6 +3744,7 @@ void MESH_OT_mark_sharp(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mark Sharp";
+ ot->description= "(un)mark selected edges as sharp.";
ot->idname= "MESH_OT_mark_sharp";
/* api callbacks */
@@ -3973,6 +3994,7 @@ void MESH_OT_normals_make_consistent(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Make Normals Consistent";
+ ot->description= "Flip all selected vertex and face normals in a consistent direction.";
ot->idname= "MESH_OT_normals_make_consistent";
/* api callbacks */
@@ -4299,18 +4321,35 @@ static int smooth_vertex(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+static int smooth_vertex_exec(bContext *C, wmOperator *op)
+{
+ int repeat = RNA_int_get(op->ptr, "repeat");
+ int i;
+
+ if (!repeat) repeat = 1;
+
+ for (i=0; i<repeat; i++) {
+ smooth_vertex(C, op);
+ }
+
+ return OPERATOR_FINISHED;
+}
+
void MESH_OT_vertices_smooth(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Smooth Vertex";
+ ot->description= "Flatten angles of selected vertices.";
ot->idname= "MESH_OT_vertices_smooth";
/* api callbacks */
- ot->exec= smooth_vertex;
+ ot->exec= smooth_vertex_exec;
ot->poll= ED_operator_editmesh;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Smooth Iterations", "", 1, INT_MAX);
}
void vertexnoise(Object *obedit, EditMesh *em)
@@ -4436,6 +4475,8 @@ void MESH_OT_vertices_transform_to_sphere(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Vertices to Sphere";
+ //added "around cursor" to differentiate between "TFM_OT_tosphere()"
+ ot->description= "Move selected vertices outward in a spherical shape around cursor.";
ot->idname= "MESH_OT_vertices_transform_to_sphere";
/* api callbacks */
@@ -4499,6 +4540,7 @@ void MESH_OT_flip_normals(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Flip Normals";
+ ot->description= "Toggle the direction of selected face's vertex and face normals.";
ot->idname= "MESH_OT_flip_normals";
/* api callbacks */
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 93e91732b2b..ac65820bfea 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -94,7 +94,7 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise
/* XXX */
static int extern_qread() {return 0;}
-static void waitcursor() {}
+static void waitcursor(int val) {}
static int pupmenu() {return 0;}
static int qtest() {return 0;}
#define add_numbut(a, b, c, d, e, f, g) {}
@@ -507,6 +507,7 @@ void MESH_OT_remove_doubles(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Remove Doubles";
+ ot->description= "Remove duplicate vertices.";
ot->idname= "MESH_OT_remove_doubles";
/* api callbacks */
@@ -747,6 +748,7 @@ void MESH_OT_extrude(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Extrude";
+ ot->description= "Extrude selected vertices, edges or faces.";
ot->idname= "MESH_OT_extrude";
/* api callbacks */
@@ -756,11 +758,6 @@ void MESH_OT_extrude(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* to give to transform */
- Properties_Proportional(ot);
- Properties_Constraints(ot);
- RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}
static int split_mesh(bContext *C, wmOperator *op)
@@ -790,6 +787,7 @@ void MESH_OT_split(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Split";
+ ot->description= "Split selected geometry into separate disconnected mesh.";
ot->idname= "MESH_OT_split";
/* api callbacks */
@@ -850,6 +848,7 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Extrude Repeat Mesh";
+ ot->description= "Extrude selected vertices, edges or faces repeatedly.";
ot->idname= "MESH_OT_extrude_repeat";
/* api callbacks */
@@ -984,6 +983,7 @@ void MESH_OT_spin(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Spin";
+ ot->description= "Extrude selected vertices in a circle around the cursor in indicated viewport.";
ot->idname= "MESH_OT_spin";
/* api callbacks */
@@ -1092,6 +1092,7 @@ void MESH_OT_screw(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Screw";
+ ot->description= "Extrude selected vertices in screw-shaped rotation around the cursor in indicated viewport.";
ot->idname= "MESH_OT_screw";
/* api callbacks */
@@ -1324,6 +1325,7 @@ void MESH_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
+ ot->description= "Delete selected vertices, edges or faces.";
ot->idname= "MESH_OT_delete";
/* api callbacks */
@@ -3768,6 +3770,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Rotate Selected Edge";
+ ot->description= "Rotate selected edge or adjoining faces.";
ot->idname= "MESH_OT_edge_rotate";
/* api callbacks */
@@ -5002,6 +5005,7 @@ void MESH_OT_rip(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Rip";
+ ot->description= "Rip selection from mesh (quads only).";
ot->idname= "MESH_OT_rip";
/* api callbacks */
@@ -5848,6 +5852,7 @@ void MESH_OT_merge(wmOperatorType *ot)
/* identifiers */
ot->name= "Merge";
+ ot->description= "Merge selected vertices.";
ot->idname= "MESH_OT_merge";
/* api callbacks */
@@ -6050,6 +6055,7 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot)
/* identifiers */
ot->name= "Select Vertex Path";
+ ot->description= "Select shortest path between two vertices by distance type.";
ot->idname= "MESH_OT_select_vertex_path";
/* api callbacks */
@@ -6111,6 +6117,7 @@ void MESH_OT_region_to_loop(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Region to Loop";
+ ot->description= "Select a region as a loop of connected edges.";
ot->idname= "MESH_OT_region_to_loop";
/* api callbacks */
@@ -6286,6 +6293,7 @@ void MESH_OT_loop_to_region(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Loop to Region";
+ ot->description= "Select a loop of connected edges as a region.";
ot->idname= "MESH_OT_loop_to_region";
/* api callbacks */
@@ -6584,6 +6592,7 @@ void MESH_OT_uvs_rotate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Rotate UVs";
+ ot->description= "Rotate selected UVs.";
ot->idname= "MESH_OT_uvs_rotate";
/* api callbacks */
@@ -6601,6 +6610,7 @@ void MESH_OT_uvs_mirror(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mirror UVs";
+ ot->description= "Mirror selected UVs.";
ot->idname= "MESH_OT_uvs_mirror";
/* api callbacks */
@@ -6618,6 +6628,7 @@ void MESH_OT_colors_rotate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Rotate Colors";
+ ot->description= "Rotate UV/image color layer.";
ot->idname= "MESH_OT_colors_rotate";
/* api callbacks */
@@ -6635,6 +6646,7 @@ void MESH_OT_colors_mirror(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mirror Colors";
+ ot->description= "Mirror UV/image color layer.";
ot->idname= "MESH_OT_colors_mirror";
/* api callbacks */
@@ -6668,7 +6680,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
esubdivideflag(obedit, em, 1, smooth, fractal, scene->toolsettings->editbutflag|flag, cuts, 0);
DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
+ WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
return OPERATOR_FINISHED;
}
@@ -6677,6 +6689,7 @@ void MESH_OT_subdivide(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Subdivide";
+ ot->description= "Subdivide selected edges.";
ot->idname= "MESH_OT_subdivide";
/* api callbacks */
@@ -6959,6 +6972,7 @@ void MESH_OT_fill(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Fill";
+ ot->description= "Create a segment, edge or face.";
ot->idname= "MESH_OT_fill";
/* api callbacks */
@@ -6989,6 +7003,7 @@ void MESH_OT_beauty_fill(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Beauty Fill";
+ ot->description= "Arrange geometry on a selected surface to avoid skinny faces.";
ot->idname= "MESH_OT_beauty_fill";
/* api callbacks */
@@ -7020,6 +7035,7 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Quads to Tris";
+ ot->description= "Convert selected quads to triangles.";
ot->idname= "MESH_OT_quads_convert_to_tris";
/* api callbacks */
@@ -7049,6 +7065,7 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Tris to Quads";
+ ot->description= "Convert selected triangles to quads.";
ot->idname= "MESH_OT_tris_convert_to_quads";
/* api callbacks */
@@ -7078,6 +7095,7 @@ void MESH_OT_edge_flip(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Edge Flip";
+ ot->description= "Flip selected edge or adjoining faces.";
ot->idname= "MESH_OT_edge_flip";
/* api callbacks */
@@ -7124,6 +7142,7 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Shade Smooth";
+ ot->description= "Display faces 'smooth' (using vertex normals).";
ot->idname= "MESH_OT_faces_shade_smooth";
/* api callbacks */
@@ -7152,6 +7171,7 @@ void MESH_OT_faces_shade_flat(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Shade Flat";
+ ot->description= "Display faces 'flat'.";
ot->idname= "MESH_OT_faces_shade_flat";
/* api callbacks */
diff --git a/source/blender/editors/mesh/mesh_layers.c b/source/blender/editors/mesh/mesh_layers.c
index 99d50d1a9b0..17a448ecf90 100644
--- a/source/blender/editors/mesh/mesh_layers.c
+++ b/source/blender/editors/mesh/mesh_layers.c
@@ -54,12 +54,14 @@
#include "WM_types.h"
#include "ED_mesh.h"
+#include "ED_object.h"
#include "ED_view3d.h"
#include "mesh_intern.h"
-static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer)
+static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *layer)
{
+ Mesh *me = ob->data;
CustomData *data= (me->edit_mesh)? &me->edit_mesh->fdata: &me->fdata;
void *actlayerdata, *rndlayerdata, *clonelayerdata, *masklayerdata, *layerdata=layer->data;
int type= layer->type;
@@ -87,9 +89,8 @@ static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer)
mesh_update_customdata_pointers(me);
}
- if(!CustomData_has_layer(data, type))
- if(type == CD_MCOL && (G.f & G_VERTEXPAINT))
- G.f &= ~G_VERTEXPAINT; /* get out of vertexpaint mode */
+ if(!CustomData_has_layer(data, type) && (type == CD_MCOL && (ob->mode & OB_MODE_VERTEX_PAINT)))
+ ED_object_toggle_modes(C, OB_MODE_VERTEX_PAINT);
/* reconstruct active layer */
if (actlayerdata != layerdata) {
@@ -198,6 +199,7 @@ void MESH_OT_uv_texture_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add UV Texture";
+ ot->description= "Add UV texture layer.";
ot->idname= "MESH_OT_uv_texture_add";
/* api callbacks */
@@ -225,7 +227,7 @@ static int uv_texture_remove_exec(bContext *C, wmOperator *op)
if(!cdl)
return OPERATOR_CANCELLED;
- delete_customdata_layer(me, cdl);
+ delete_customdata_layer(C, ob, cdl);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
@@ -237,6 +239,7 @@ void MESH_OT_uv_texture_remove(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Remove UV Texture";
+ ot->description= "Remove UV texture layer.";
ot->idname= "MESH_OT_uv_texture_remove";
/* api callbacks */
@@ -301,6 +304,7 @@ void MESH_OT_vertex_color_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Vertex Color";
+ ot->description= "Add vertex color layer.";
ot->idname= "MESH_OT_vertex_color_add";
/* api callbacks */
@@ -328,7 +332,7 @@ static int vertex_color_remove_exec(bContext *C, wmOperator *op)
if(!cdl)
return OPERATOR_CANCELLED;
- delete_customdata_layer(me, cdl);
+ delete_customdata_layer(C, ob, cdl);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
@@ -340,6 +344,7 @@ void MESH_OT_vertex_color_remove(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Remove Vertex Color";
+ ot->description= "Remove vertex color layer.";
ot->idname= "MESH_OT_vertex_color_remove";
/* api callbacks */
@@ -377,6 +382,7 @@ void MESH_OT_sticky_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Sticky";
+ ot->description= "Add sticky UV texture layer.";
ot->idname= "MESH_OT_sticky_add";
/* api callbacks */
@@ -413,6 +419,7 @@ void MESH_OT_sticky_remove(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Remove Sticky";
+ ot->description= "Remove sticky UV texture layer.";
ot->idname= "MESH_OT_sticky_remove";
/* api callbacks */
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index edb131d7da2..c545f7d70d6 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -90,6 +90,7 @@ static void MESH_OT_vertex_specials(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Vertex Specials";
+ //ot->description= "Perform special vertex operations.";
ot->idname= "MESH_OT_vertex_specials";
/* api callbacks */
@@ -128,6 +129,7 @@ static void MESH_OT_edge_specials(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Edge Specials";
+ //ot->description= "Perform special edge operations.";
ot->idname= "MESH_OT_edge_specials";
/* api callbacks */
@@ -178,6 +180,7 @@ static void MESH_OT_face_specials(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Face Specials";
+ //ot->description= "Perform special face operations.";
ot->idname= "MESH_OT_face_specials";
/* api callbacks */
@@ -219,6 +222,7 @@ static void MESH_OT_specials(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Specials";
+ //ot->description= "Perform special vertice, edge or face operations.";
ot->idname= "MESH_OT_specials";
/* api callbacks */
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index c10fdbcfd8f..5d4be254593 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -96,7 +96,7 @@
#include "mesh_intern.h"
/* XXX */
-static void waitcursor() {}
+static void waitcursor(int val) {}
static void error() {}
static int pupmenu() {return 0;}
/* XXX */
diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c
index 9e8205e58ab..dc0442a5af9 100644
--- a/source/blender/editors/object/editconstraint.c
+++ b/source/blender/editors/object/editconstraint.c
@@ -87,7 +87,7 @@ ListBase *get_active_constraints (Object *ob)
if (ob == NULL)
return NULL;
- if (ob->flag & OB_POSEMODE) {
+ if (ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
pchan = get_active_posechannel(ob);
@@ -465,6 +465,12 @@ void object_test_constraints (Object *owner)
/* ---------- Distance-Dependent Constraints ---------- */
/* StretchTo, Limit Distance */
+static int stretchto_poll(bContext *C)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_StretchToConstraint);
+ return (ptr.id.data && ptr.data);
+}
+
static int stretchto_reset_exec (bContext *C, wmOperator *op)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_StretchToConstraint);
@@ -484,6 +490,7 @@ void CONSTRAINT_OT_stretchto_reset (wmOperatorType *ot)
ot->description= "Reset original length of bone for Stretch To Constraint.";
ot->exec= stretchto_reset_exec;
+ ot->poll= stretchto_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -501,6 +508,12 @@ static int limitdistance_reset_exec (bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+static int limitdistance_poll(bContext *C)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_LimitDistanceConstraint);
+ return (ptr.id.data && ptr.data);
+}
+
void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot)
{
/* identifiers */
@@ -509,6 +522,7 @@ void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot)
ot->description= "Reset limiting distance for Limit Distance Constraint.";
ot->exec= limitdistance_reset_exec;
+ ot->poll= limitdistance_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -516,6 +530,12 @@ void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot)
/* ------------- Child-Of Constraint ------------------ */
+static int childof_poll(bContext *C)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_ChildOfConstraint);
+ return (ptr.id.data && ptr.data);
+}
+
/* ChildOf Constraint - set inverse callback */
static int childof_set_inverse_exec (bContext *C, wmOperator *op)
{
@@ -582,12 +602,12 @@ void CONSTRAINT_OT_childof_set_inverse (wmOperatorType *ot)
ot->description= "Set inverse correction for ChildOf constraint.";
ot->exec= childof_set_inverse_exec;
+ ot->poll= childof_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-
/* ChildOf Constraint - clear inverse callback */
static int childof_clear_inverse_exec (bContext *C, wmOperator *op)
{
@@ -612,6 +632,7 @@ void CONSTRAINT_OT_childof_clear_inverse (wmOperatorType *ot)
ot->description= "Clear inverse correction for ChildOf constraint.";
ot->exec= childof_clear_inverse_exec;
+ ot->poll= childof_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -684,6 +705,12 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con)
}
}
+static int constraint_poll(bContext *C)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint);
+ return (ptr.id.data && ptr.data);
+}
+
static int constraint_delete_exec (bContext *C, wmOperator *op)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint);
@@ -711,6 +738,7 @@ void CONSTRAINT_OT_delete (wmOperatorType *ot)
/* callbacks */
ot->exec= constraint_delete_exec;
+ ot->poll= constraint_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -747,6 +775,7 @@ void CONSTRAINT_OT_move_down (wmOperatorType *ot)
/* callbacks */
ot->exec= constraint_move_down_exec;
+ ot->poll= constraint_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -784,6 +813,7 @@ void CONSTRAINT_OT_move_up (wmOperatorType *ot)
/* callbacks */
ot->exec= constraint_move_up_exec;
+ ot->poll= constraint_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1065,7 +1095,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
{
/* if this constraint is being added to a posechannel, make sure
* the constraint gets evaluated in pose-space */
- if (ob->flag & OB_POSEMODE) {
+ if (ob->mode & OB_MODE_POSE) {
con->ownspace = CONSTRAINT_SPACE_POSE;
con->flag |= CONSTRAINT_SPACEONCE;
}
diff --git a/source/blender/editors/object/editkey.c b/source/blender/editors/object/editkey.c
index f38c03fb284..82194a4c3b4 100644
--- a/source/blender/editors/object/editkey.c
+++ b/source/blender/editors/object/editkey.c
@@ -164,14 +164,20 @@ static KeyBlock *add_keyblock(Scene *scene, Key *key)
kb= MEM_callocN(sizeof(KeyBlock), "Keyblock");
BLI_addtail(&key->block, kb);
kb->type= KEY_CARDINAL;
+
tot= BLI_countlist(&key->block);
if(tot==1) strcpy(kb->name, "Basis");
else sprintf(kb->name, "Key %d", tot-1);
+
+ // XXX this is old anim system stuff? (i.e. the 'index' of the shapekey)
kb->adrcode= tot-1;
key->totkey++;
if(key->totkey==1) key->refkey= kb;
+ kb->slidermin= 0.0f;
+ kb->slidermax= 1.0f;
+
// XXX kb->pos is the confusing old horizontal-line RVK crap in old IPO Editor...
if(key->type == KEY_RELATIVE)
kb->pos= curpos+0.1;
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 54ab1b14a33..9438a2629c9 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -28,6 +28,8 @@
#include <string.h>
#include <math.h>
#include <time.h>
+#include <float.h>
+#include <ctype.h>
#include "MEM_guardedalloc.h"
@@ -98,6 +100,7 @@
#include "BKE_mesh.h"
#include "BKE_nla.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_property.h"
#include "BKE_report.h"
@@ -126,6 +129,7 @@
#include "RNA_access.h"
#include "RNA_define.h"
+#include "RNA_enum_types.h"
/* for menu/popup icons etc etc*/
#include "UI_interface.h"
@@ -138,10 +142,10 @@
/* ************* XXX **************** */
static void error() {}
-static void waitcursor() {}
-static int pupmenu() {return 0;}
-static int pupmenu_col() {return 0;}
-static int okee() {return 0;}
+static void waitcursor(int val) {}
+static int pupmenu(const char *msg) {return 0;}
+static int pupmenu_col(const char *msg, int val) {return 0;}
+static int okee(const char *msg) {return 0;}
/* port over here */
static bContext *C;
@@ -177,10 +181,6 @@ void ED_base_object_activate(bContext *C, Base *base)
Scene *scene= CTX_data_scene(C);
Base *tbase;
- /* activating a non-mesh, should end a couple of modes... */
- if(base && base->object->type!=OB_MESH)
- ED_view3d_exit_paint_modes(C);
-
/* sets scene->basact */
BASACT= base;
@@ -272,9 +272,6 @@ static Object *object_add_type(bContext *C, int type)
Scene *scene= CTX_data_scene(C);
Object *ob;
- /* XXX hrms, this is editor level operator, remove? */
- ED_view3d_exit_paint_modes(C);
-
/* for as long scene has editmode... */
if (CTX_data_edit_object(C))
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* freedata, and undo */
@@ -757,8 +754,6 @@ static int object_delete_exec(bContext *C, wmOperator *op)
if(CTX_data_edit_object(C))
return OPERATOR_CANCELLED;
- ED_view3d_exit_paint_modes(C);
-
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
if(base->object->type==OB_LAMP) islamp= 1;
@@ -992,6 +987,9 @@ static void select_editmesh_hook(Object *ob, HookModifierData *hmd)
EditVert *eve;
int index=0, nr=0;
+ if (hmd->indexar == NULL)
+ return;
+
for(eve= em->verts.first; eve; eve= eve->next, nr++) {
if(nr==hmd->indexar[index]) {
eve->f |= SELECT;
@@ -1163,7 +1161,7 @@ void ED_object_apply_obmat(Object *ob)
}
-int hook_getIndexArray(Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
+int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
{
*indexar= NULL;
*tot= 0;
@@ -1245,9 +1243,8 @@ static void select_editcurve_hook(Object *obedit, HookModifierData *hmd)
}
}
-void obedit_hook_select(Object *ob, HookModifierData *hmd)
+void object_hook_select(Object *ob, HookModifierData *hmd)
{
-
if(ob->type==OB_MESH) select_editmesh_hook(ob, hmd);
else if(ob->type==OB_LATTICE) select_editlattice_hook(ob, hmd);
else if(ob->type==OB_CURVE) select_editcurve_hook(ob, hmd);
@@ -1331,7 +1328,7 @@ void add_hook(Scene *scene, View3D *v3d, int mode)
int tot, ok, *indexar;
char name[32];
- ok = hook_getIndexArray(obedit, &tot, &indexar, name, cent);
+ ok = object_hook_index_array(obedit, &tot, &indexar, name, cent);
if(ok==0) {
error("Requires selected vertices or active Vertex Group");
@@ -1375,6 +1372,7 @@ void add_hook(Scene *scene, View3D *v3d, int mode)
hmd->totindex= tot;
BLI_strncpy(hmd->name, name, 32);
+ // TODO: need to take into account bone targets here too now...
if(mode==1 || mode==2) {
/* matrix calculus */
/* vert x (obmat x hook->imat) x hook->obmat x ob->imat */
@@ -1394,9 +1392,11 @@ void add_hook(Scene *scene, View3D *v3d, int mode)
modifier_free(md);
}
else if(mode==5) { /* select */
- obedit_hook_select(obedit, hmd);
+ // FIXME: this is now OBJECT_OT_hook_select
+ object_hook_select(obedit, hmd);
}
else if(mode==6) { /* clear offset */
+ // FIXME: this is now OBJECT_OT_hook_reset operator
where_is_object(scene, ob); /* ob is hook->parent */
Mat4Invert(ob->imat, ob->obmat);
@@ -1408,25 +1408,6 @@ void add_hook(Scene *scene, View3D *v3d, int mode)
DAG_scene_sort(scene);
}
-
-/* use this when the loc/size/rot of the parent has changed but the children should stay in the same place
- * apply-size-rot or object center for eg */
-static void ignore_parent_tx(Scene *scene, Object *ob )
-{
- Object workob;
- Object *ob_child;
-
- /* a change was made, adjust the children to compensate */
- for (ob_child=G.main->object.first; ob_child; ob_child=ob_child->id.next) {
- if (ob_child->parent == ob) {
- ED_object_apply_obmat(ob_child);
- what_does_parent(scene, ob_child, &workob);
- Mat4Invert(ob_child->parentinv, workob.obmat);
- }
- }
-}
-
-
void add_hook_menu(Scene *scene, View3D *v3d)
{
Object *obedit= scene->obedit; // XXX get from context
@@ -1445,6 +1426,25 @@ void add_hook_menu(Scene *scene, View3D *v3d)
add_hook(scene, v3d, mode);
}
+
+
+/* use this when the loc/size/rot of the parent has changed but the children should stay in the same place
+ * apply-size-rot or object center for eg */
+static void ignore_parent_tx(Scene *scene, Object *ob )
+{
+ Object workob;
+ Object *ob_child;
+
+ /* a change was made, adjust the children to compensate */
+ for (ob_child=G.main->object.first; ob_child; ob_child=ob_child->id.next) {
+ if (ob_child->parent == ob) {
+ ED_object_apply_obmat(ob_child);
+ what_does_parent(scene, ob_child, &workob);
+ Mat4Invert(ob_child->parentinv, workob.obmat);
+ }
+ }
+}
+
/* ******************** clear parent operator ******************* */
static EnumPropertyItem prop_clear_parent_types[] = {
@@ -2197,6 +2197,165 @@ void OBJECT_OT_select_all_toggle(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
+/* ****** select mirror *******/
+/* finds the best possible flipped name. For renaming; check for unique names afterwards */
+/* if strip_number: removes number extensions */
+void object_flip_name (char *name)
+{
+ int len;
+ char prefix[128]={""}; /* The part before the facing */
+ char suffix[128]={""}; /* The part after the facing */
+ char replace[128]={""}; /* The replacement string */
+ char number[128]={""}; /* The number extension string */
+ char *index=NULL;
+
+ len= strlen(name);
+ if(len<3) return; // we don't do names like .R or .L
+
+ /* We first check the case with a .### extension, let's find the last period */
+ if(isdigit(name[len-1])) {
+ index= strrchr(name, '.'); // last occurrance
+ if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever!
+ strcpy(number, index);
+ *index= 0;
+ len= strlen(name);
+ }
+ }
+
+ strcpy (prefix, name);
+
+#define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_')
+
+ /* first case; separator . - _ with extensions r R l L */
+ if( IS_SEPARATOR(name[len-2]) ) {
+ switch(name[len-1]) {
+ case 'l':
+ prefix[len-1]= 0;
+ strcpy(replace, "r");
+ break;
+ case 'r':
+ prefix[len-1]= 0;
+ strcpy(replace, "l");
+ break;
+ case 'L':
+ prefix[len-1]= 0;
+ strcpy(replace, "R");
+ break;
+ case 'R':
+ prefix[len-1]= 0;
+ strcpy(replace, "L");
+ break;
+ }
+ }
+ /* case; beginning with r R l L , with separator after it */
+ else if( IS_SEPARATOR(name[1]) ) {
+ switch(name[0]) {
+ case 'l':
+ strcpy(replace, "r");
+ strcpy(suffix, name+1);
+ prefix[0]= 0;
+ break;
+ case 'r':
+ strcpy(replace, "l");
+ strcpy(suffix, name+1);
+ prefix[0]= 0;
+ break;
+ case 'L':
+ strcpy(replace, "R");
+ strcpy(suffix, name+1);
+ prefix[0]= 0;
+ break;
+ case 'R':
+ strcpy(replace, "L");
+ strcpy(suffix, name+1);
+ prefix[0]= 0;
+ break;
+ }
+ }
+ else if(len > 5) {
+ /* hrms, why test for a separator? lets do the rule 'ultimate left or right' */
+ index = BLI_strcasestr(prefix, "right");
+ if (index==prefix || index==prefix+len-5) {
+ if(index[0]=='r')
+ strcpy (replace, "left");
+ else {
+ if(index[1]=='I')
+ strcpy (replace, "LEFT");
+ else
+ strcpy (replace, "Left");
+ }
+ *index= 0;
+ strcpy (suffix, index+5);
+ }
+ else {
+ index = BLI_strcasestr(prefix, "left");
+ if (index==prefix || index==prefix+len-4) {
+ if(index[0]=='l')
+ strcpy (replace, "right");
+ else {
+ if(index[1]=='E')
+ strcpy (replace, "RIGHT");
+ else
+ strcpy (replace, "Right");
+ }
+ *index= 0;
+ strcpy (suffix, index+4);
+ }
+ }
+ }
+
+#undef IS_SEPARATOR
+
+ sprintf (name, "%s%s%s%s", prefix, replace, suffix, number);
+}
+
+static int object_select_mirror_exec(bContext *C, wmOperator *op)
+{
+ char tmpname[32];
+ short seltype;
+
+ seltype = RNA_enum_get(op->ptr, "seltype");
+
+ CTX_DATA_BEGIN(C, Base*, primbase, selected_bases) {
+
+ strcpy(tmpname, primbase->object->id.name+2);
+ object_flip_name(tmpname);
+
+ CTX_DATA_BEGIN(C, Base*, secbase, visible_bases) {
+ if(!strcmp(secbase->object->id.name+2, tmpname)) {
+ ED_base_object_select(secbase, BA_SELECT);
+ }
+ }
+ CTX_DATA_END;
+
+ if (seltype == 0) ED_base_object_select(primbase, BA_DESELECT);
+
+ }
+ CTX_DATA_END;
+
+ /* undo? */
+ WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_select_mirror(wmOperatorType *ot)
+{
+
+ /* identifiers */
+ ot->name= "Select Mirror";
+ ot->description = "Select the Mirror objects of the selected object eg. L.sword -> R.sword";
+ ot->idname= "OBJECT_OT_select_mirror";
+
+ /* api callbacks */
+ ot->exec= object_select_mirror_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_enum(ot->srna, "seltype", prop_select_types, 1, "Selection", "Extend selection or clear selection then select");
+}
/* ****** random selection *******/
static int object_select_random_exec(bContext *C, wmOperator *op)
@@ -2252,7 +2411,7 @@ static int object_location_clear_exec(bContext *C, wmOperator *op)
int armature_clear= 0;
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if((G.f & G_WEIGHTPAINT)==0) {
+ if(!(ob->mode & OB_MODE_WEIGHT_PAINT)) {
if ((ob->protectflag & OB_LOCK_LOCX)==0)
ob->loc[0]= ob->dloc[0]= 0.0f;
if ((ob->protectflag & OB_LOCK_LOCY)==0)
@@ -2295,7 +2454,7 @@ static int object_rotation_clear_exec(bContext *C, wmOperator *op)
int armature_clear= 0;
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if((G.f & G_WEIGHTPAINT)==0) {
+ if(!(ob->mode & OB_MODE_WEIGHT_PAINT)) {
/* eulers can only get cleared if they are not protected */
if ((ob->protectflag & OB_LOCK_ROTX)==0)
ob->rot[0]= ob->drot[0]= 0.0f;
@@ -2339,7 +2498,7 @@ static int object_scale_clear_exec(bContext *C, wmOperator *op)
int armature_clear= 0;
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
- if((G.f & G_WEIGHTPAINT)==0) {
+ if(!(ob->mode & OB_MODE_WEIGHT_PAINT)) {
if ((ob->protectflag & OB_LOCK_SCALEX)==0) {
ob->dsize[0]= 0.0f;
ob->size[0]= 1.0f;
@@ -2750,7 +2909,6 @@ void make_vertex_parent(Scene *scene, Object *obedit, View3D *v3d)
/* present menu listing the possible objects within the group to proxify */
static void proxy_group_objects_menu (bContext *C, wmOperator *op, Object *ob, Group *group)
{
- PointerRNA gob_ptr;
uiPopupMenu *pup;
uiLayout *layout;
GroupObject *go;
@@ -2766,23 +2924,14 @@ static void proxy_group_objects_menu (bContext *C, wmOperator *op, Object *ob, G
pup= uiPupMenuBegin(C, "Make Proxy For:", 0);
layout= uiPupMenuLayout(pup);
- /* make RNA pointer for object that group belongs to */
- RNA_id_pointer_create((ID *)ob, &gob_ptr);
-
for (go= group->gobject.first; go; go= go->next) {
if (go->ob) {
- PointerRNA props_ptr, ob_ptr;
+ PointerRNA props_ptr;
- /* create pointer for this object */
- RNA_id_pointer_create((ID *)go->ob, &ob_ptr);
-
- /* create operator properties, and assign the relevant pointers to that,
- * and add a menu entry which uses these props
- */
- WM_operator_properties_create(&props_ptr, op->idname);
- RNA_pointer_set(&props_ptr, "object", ob_ptr);
- RNA_pointer_set(&props_ptr, "group_object", gob_ptr);
- uiItemFullO(layout, go->ob->id.name+2, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN);
+ /* create operator menu item with relevant properties filled in */
+ props_ptr= uiItemFullO(layout, go->ob->id.name+2, 0, op->idname, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+ RNA_string_set(&props_ptr, "object", go->ob->id.name+2);
+ RNA_string_set(&props_ptr, "group_object", go->ob->id.name+2);
}
}
@@ -2808,17 +2957,11 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt)
else if (ob->id.lib) {
uiPopupMenu *pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION);
uiLayout *layout= uiPupMenuLayout(pup);
- PointerRNA ob_ptr, props_ptr;
+ PointerRNA props_ptr = {0};
- /* create pointer for this object */
- RNA_id_pointer_create((ID *)ob, &ob_ptr);
-
- /* create operator properties, and assign the relevant pointers to that,
- * and add a menu entry which uses these props
- */
- WM_operator_properties_create(&props_ptr, op->idname);
- RNA_pointer_set(&props_ptr, "object", ob_ptr);
- uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN);
+ /* create operator menu item with relevant properties filled in */
+ props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+ RNA_string_set(&props_ptr, "object", ob->id.name+2);
/* present the menu and be done... */
uiPupMenuEnd(C, pup);
@@ -2834,11 +2977,39 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt)
static int make_proxy_exec (bContext *C, wmOperator *op)
{
- PointerRNA ob_ptr= RNA_pointer_get(op->ptr, "object");
- PointerRNA gob_ptr= RNA_pointer_get(op->ptr, "group_object");
- Object *ob= ob_ptr.data;
- Object *gob= gob_ptr.data;
+ Object *ob=NULL, *gob=NULL;
Scene *scene= CTX_data_scene(C);
+ char ob_name[21], gob_name[21];
+
+ /* get object and group object
+ * - firstly names
+ * - then pointers from context
+ */
+ RNA_string_get(op->ptr, "object", ob_name);
+ RNA_string_get(op->ptr, "group_object", gob_name);
+
+ if (gob_name[0]) {
+ Group *group;
+ GroupObject *go;
+
+ /* active object is group object... */
+ // FIXME: we should get the nominated name instead
+ gob= CTX_data_active_object(C);
+ group= gob->dup_group;
+
+ /* find the object to affect */
+ for (go= group->gobject.first; go; go= go->next) {
+ if ((go->ob) && strcmp(go->ob->id.name+2, gob_name)==0) {
+ ob= go->ob;
+ break;
+ }
+ }
+ }
+ else {
+ /* just use the active object for now */
+ // FIXME: we should get the nominated name instead
+ ob= CTX_data_active_object(C);
+ }
if (ob) {
Object *newob;
@@ -2870,6 +3041,8 @@ static int make_proxy_exec (bContext *C, wmOperator *op)
/* depsgraph flushes are needed for the new data */
DAG_scene_sort(scene);
DAG_object_flush_update(scene, newob, OB_RECALC);
+
+ WM_event_add_notifier(C, NC_OBJECT, NULL);
}
else {
BKE_report(op->reports, RPT_ERROR, "No object to make proxy for");
@@ -2895,8 +3068,8 @@ void OBJECT_OT_proxy_make (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_pointer(ot->srna, "object", "Object", "Proxy Object", "Lib-linked/grouped object to make a proxy for.");
- RNA_def_pointer(ot->srna, "group_object", "Object", "Group Object", "Group instancer (if applicable).");
+ RNA_def_string(ot->srna, "object", "", 19, "Proxy Object", "Name of lib-linked/grouped object to make a proxy for.");
+ RNA_def_string(ot->srna, "group_object", "", 19, "Group Object", "Name of group instancer (if applicable).");
}
/* ******************** make parent operator *********************** */
@@ -3686,7 +3859,7 @@ void ED_object_exit_editmode(bContext *C, int flag)
me->edit_mesh= NULL;
}
- if(G.f & G_WEIGHTPAINT)
+ if(obedit->restore_mode & OB_MODE_WEIGHT_PAINT)
mesh_octree_table(obedit, NULL, NULL, 'e');
}
else if (obedit->type==OB_ARMATURE) {
@@ -3710,7 +3883,7 @@ void ED_object_exit_editmode(bContext *C, int flag)
load_editMball(obedit);
if(freedata) free_editMball(obedit);
}
-
+
/* freedata only 0 now on file saves */
if(freedata) {
/* for example; displist make is different in editmode */
@@ -3725,6 +3898,9 @@ void ED_object_exit_editmode(bContext *C, int flag)
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene);
}
+
+ obedit->mode &= ~OB_MODE_EDIT;
+ ED_object_toggle_modes(C, obedit->restore_mode);
}
@@ -3758,7 +3934,10 @@ void ED_object_enter_editmode(bContext *C, int flag)
if(flag & EM_WAITCURSOR) waitcursor(1);
- ED_view3d_exit_paint_modes(C);
+ ob->restore_mode = ob->mode;
+ ED_object_toggle_modes(C, ob->mode);
+
+ ob->mode |= OB_MODE_EDIT;
if(ob->type==OB_MESH) {
Mesh *me= ob->data;
@@ -3846,6 +4025,16 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+static int editmode_toggle_poll(bContext *C)
+{
+ Object *ob = CTX_data_active_object(C);
+
+ return ob && (ob->type == OB_MESH || ob->type == OB_ARMATURE ||
+ ob->type == OB_FONT || ob->type == OB_MBALL ||
+ ob->type == OB_LATTICE || ob->type == OB_SURF ||
+ ob->type == OB_CURVE);
+}
+
void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
{
@@ -3857,7 +4046,7 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
/* api callbacks */
ot->exec= editmode_toggle_exec;
- ot->poll= ED_operator_object_active;
+ ot->poll= editmode_toggle_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -3874,7 +4063,7 @@ static int posemode_exec(bContext *C, wmOperator *op)
ED_object_exit_editmode(C, EM_FREEDATA);
ED_armature_enter_posemode(C, base);
}
- else if(base->object->flag & OB_POSEMODE)
+ else if(base->object->mode & OB_MODE_POSE)
ED_armature_exit_posemode(C, base);
else
ED_armature_enter_posemode(C, base);
@@ -4097,10 +4286,10 @@ void special_editmenu(Scene *scene, View3D *v3d)
if(obedit==NULL) {
- if(ob->flag & OB_POSEMODE) {
+ if(ob->mode & OB_MODE_POSE) {
// XXX pose_special_editmenu();
}
- else if(FACESEL_PAINT_TEST) {
+ else if(paint_facesel_test(ob)) {
Mesh *me= get_mesh(ob);
MTFace *tface;
MFace *mface;
@@ -4146,7 +4335,7 @@ void special_editmenu(Scene *scene, View3D *v3d)
}
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
}
- else if(G.f & G_VERTEXPAINT) {
+ else if(ob->mode & OB_MODE_VERTEX_PAINT) {
Mesh *me= get_mesh(ob);
if(me==0 || (me->mcol==NULL && me->mtface==NULL) ) return;
@@ -4159,17 +4348,17 @@ void special_editmenu(Scene *scene, View3D *v3d)
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
}
}
- else if(G.f & G_WEIGHTPAINT) {
+ else if(ob->mode & OB_MODE_WEIGHT_PAINT) {
Object *par= modifiers_isDeformedByArmature(ob);
- if(par && (par->flag & OB_POSEMODE)) {
+ if(par && (par->mode & OB_MODE_POSE)) {
nr= pupmenu("Specials%t|Apply Bone Envelopes to Vertex Groups %x1|Apply Bone Heat Weights to Vertex Groups %x2");
// XXX if(nr==1 || nr==2)
// XXX pose_adds_vgroups(ob, (nr == 2));
}
}
- else if(G.f & G_PARTICLEEDIT) {
+ else if(ob->mode & OB_MODE_PARTICLE_EDIT) {
#if 0
// XXX
ParticleSystem *psys = PE_get_current(ob);
@@ -5711,7 +5900,7 @@ void new_id_matar(Material **matar, int totcol)
}
}
-void single_obdata_users(Scene *scene, View3D *v3d, int flag)
+void single_obdata_users(Scene *scene, int flag)
{
Object *ob;
Lamp *la;
@@ -5834,7 +6023,7 @@ void single_obdata_users(Scene *scene, View3D *v3d, int flag)
}
}
-void single_ipo_users(Scene *scene, View3D *v3d, int flag)
+void single_ipo_users(Scene *scene, int flag)
{
#if 0 // XXX old animation system
Object *ob;
@@ -5857,7 +6046,7 @@ void single_ipo_users(Scene *scene, View3D *v3d, int flag)
#endif // XXX old animation system
}
-void single_mat_users(Scene *scene, View3D *v3d, int flag)
+void single_mat_users(Scene *scene, int flag)
{
Object *ob;
Base *base;
@@ -6043,19 +6232,19 @@ void single_user(Scene *scene, View3D *v3d)
else if(nr==2) {
single_object_users(scene, v3d, 1);
- single_obdata_users(scene, v3d, 1);
+ single_obdata_users(scene, 1);
}
else if(nr==3) {
single_object_users(scene, v3d, 1);
- single_obdata_users(scene, v3d, 1);
- single_mat_users(scene, v3d, 1); /* also tex */
+ single_obdata_users(scene, 1);
+ single_mat_users(scene, 1); /* also tex */
}
else if(nr==4) {
- single_mat_users(scene, v3d, 1);
+ single_mat_users(scene, 1);
}
else if(nr==5) {
- single_ipo_users(scene, v3d, 1);
+ single_ipo_users(scene, 1);
}
@@ -6064,6 +6253,20 @@ void single_user(Scene *scene, View3D *v3d)
}
}
+/* used for copying scenes */
+void ED_object_single_users(Scene *scene, int full)
+{
+ single_object_users(scene, NULL, 0);
+
+ if(full) {
+ single_obdata_users(scene, 0);
+ single_mat_users_expand();
+ single_tex_users_expand();
+ }
+
+ clear_id_newpoins();
+}
+
/* ************************************************************* */
/* helper for below, ma was checked to be not NULL */
@@ -6268,7 +6471,7 @@ static Base *object_add_duplicate_internal(Scene *scene, Base *base, int dupflag
int a, didit;
ob= base->object;
- if(ob->flag & OB_POSEMODE) {
+ if(ob->mode & OB_MODE_POSE) {
; /* nothing? */
}
else {
@@ -6331,6 +6534,17 @@ static Base *object_add_duplicate_internal(Scene *scene, Base *base, int dupflag
}
}
}
+ if(dupflag & USER_DUP_PSYS) {
+ ParticleSystem *psys;
+ for(psys=obn->particlesystem.first; psys; psys=psys->next) {
+ id= (ID*) psys->part;
+ if(id) {
+ ID_NEW_US(psys->part)
+ else psys->part= psys_copy_settings(psys->part);
+ id->us--;
+ }
+ }
+ }
id= obn->data;
didit= 0;
@@ -7004,3 +7218,193 @@ void hookmenu(Scene *scene, View3D *v3d)
if (changed) {
}
}
+
+static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *ptr, int *free)
+{
+ EnumPropertyItem *input = object_mode_items;
+ EnumPropertyItem *item= NULL;
+ Object *ob;
+ int totitem= 0;
+
+ if(!C) /* needed for docs */
+ return object_mode_items;
+
+ ob = CTX_data_active_object(C);
+ while(ob && input->identifier) {
+ if((input->value == OB_MODE_EDIT && ((ob->type == OB_MESH) || (ob->type == OB_ARMATURE) ||
+ (ob->type == OB_CURVE) || (ob->type == OB_SURF) ||
+ (ob->type == OB_FONT) || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) ||
+ (input->value == OB_MODE_POSE && (ob->type == OB_ARMATURE)) ||
+ (input->value == OB_MODE_PARTICLE_EDIT && ob->particlesystem.first) ||
+ ((input->value == OB_MODE_SCULPT || input->value == OB_MODE_VERTEX_PAINT ||
+ input->value == OB_MODE_WEIGHT_PAINT || input->value == OB_MODE_TEXTURE_PAINT) && (ob->type == OB_MESH)) ||
+ (input->value == OB_MODE_OBJECT))
+ RNA_enum_item_add(&item, &totitem, input);
+ ++input;
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+
+ *free= 1;
+
+ return item;
+}
+
+static const char *object_mode_op_string(int mode)
+{
+ if(mode == OB_MODE_EDIT)
+ return "OBJECT_OT_editmode_toggle";
+ if(mode == OB_MODE_SCULPT)
+ return "SCULPT_OT_sculptmode_toggle";
+ if(mode == OB_MODE_VERTEX_PAINT)
+ return "PAINT_OT_vertex_paint_toggle";
+ if(mode == OB_MODE_WEIGHT_PAINT)
+ return "PAINT_OT_weight_paint_toggle";
+ if(mode == OB_MODE_TEXTURE_PAINT)
+ return "PAINT_OT_texture_paint_toggle";
+ if(mode == OB_MODE_PARTICLE_EDIT)
+ return "PARTICLE_OT_particle_edit_toggle";
+ if(mode == OB_MODE_POSE)
+ return "OBJECT_OT_posemode_toggle";
+ return NULL;
+}
+
+static int object_mode_set_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_active_object(C);
+ ObjectMode mode = RNA_enum_get(op->ptr, "mode");
+ ObjectMode restore_mode = ob->mode;
+ int toggle = RNA_boolean_get(op->ptr, "toggle");
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ /* Exit current mode if it's not the mode we're setting */
+ if(ob->mode != OB_MODE_OBJECT && ob->mode != mode)
+ WM_operator_name_call(C, object_mode_op_string(ob->mode), WM_OP_EXEC_REGION_WIN, NULL);
+
+ if(mode != OB_MODE_OBJECT) {
+ /* Enter new mode */
+ if(ob->mode != mode || toggle)
+ WM_operator_name_call(C, object_mode_op_string(mode), WM_OP_EXEC_REGION_WIN, NULL);
+
+ if(toggle) {
+ if(ob->mode == mode)
+ /* For toggling, store old mode so we know what to go back to */
+ ob->restore_mode = restore_mode;
+ else if(ob->restore_mode != OB_MODE_OBJECT && ob->restore_mode != mode) {
+ WM_operator_name_call(C, object_mode_op_string(ob->restore_mode), WM_OP_EXEC_REGION_WIN, NULL);
+ }
+ }
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_mode_set(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Set Object Mode";
+ ot->description = "Sets the object interaction mode.";
+ ot->idname= "OBJECT_OT_mode_set";
+
+ /* api callbacks */
+ ot->exec= object_mode_set_exec;
+
+ ot->poll= ED_operator_object_active;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ prop= RNA_def_enum(ot->srna, "mode", object_mode_items, 0, "Mode", "");
+ RNA_def_enum_funcs(prop, object_mode_set_itemsf);
+
+ RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", "");
+}
+
+
+
+void ED_object_toggle_modes(bContext *C, int mode)
+{
+ if(mode & OB_MODE_SCULPT)
+ WM_operator_name_call(C, "SCULPT_OT_sculptmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+ if(mode & OB_MODE_VERTEX_PAINT)
+ WM_operator_name_call(C, "PAINT_OT_vertex_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+ if(mode & OB_MODE_WEIGHT_PAINT)
+ WM_operator_name_call(C, "PAINT_OT_weight_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+ if(mode & OB_MODE_TEXTURE_PAINT)
+ WM_operator_name_call(C, "PAINT_OT_texture_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+ if(mode & OB_MODE_PARTICLE_EDIT)
+ WM_operator_name_call(C, "PARTICLE_OT_particle_edit_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+}
+
+/* game property ops */
+
+static int game_property_new(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_active_object(C);
+ bProperty *prop;
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ prop= new_property(PROP_FLOAT);
+ BLI_addtail(&ob->prop, prop);
+ unique_property(NULL, prop, 0); // make_unique_prop_names(prop->name);
+
+ return OPERATOR_FINISHED;
+}
+
+
+void OBJECT_OT_game_property_new(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "New Game Property";
+ ot->idname= "OBJECT_OT_game_property_new";
+
+ /* api callbacks */
+ ot->exec= game_property_new;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int game_property_remove(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_active_object(C);
+ bProperty *prop;
+ int index;
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ index = RNA_int_get(op->ptr, "index");
+
+ prop= BLI_findlink(&ob->prop, index);
+
+ if(prop) {
+ BLI_remlink(&ob->prop, prop);
+ free_property(prop);
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
+}
+
+void OBJECT_OT_game_property_remove(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Remove Game Property";
+ ot->idname= "OBJECT_OT_game_property_remove";
+
+ /* api callbacks */
+ ot->exec= game_property_remove;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Property index to remove ", 0, INT_MAX);
+}
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 17d4f5deaae..8eaa388cdf0 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -34,11 +34,13 @@ struct Lattice;
struct Curve;
struct Object;
struct Mesh;
+struct HookModifierData;
/* internal exports only */
/* object_edit.c */
+void OBJECT_OT_mode_set(struct wmOperatorType *ot);
void OBJECT_OT_editmode_toggle(struct wmOperatorType *ot);
void OBJECT_OT_posemode_toggle(struct wmOperatorType *ot);
void OBJECT_OT_parent_set(struct wmOperatorType *ot);
@@ -52,6 +54,7 @@ void OBJECT_OT_select_by_type(struct wmOperatorType *ot);
void OBJECT_OT_select_by_layer(struct wmOperatorType *ot);
void OBJECT_OT_select_linked(struct wmOperatorType *ot);
void OBJECT_OT_select_grouped(struct wmOperatorType *ot);
+void OBJECT_OT_select_mirror(struct wmOperatorType *ot);
void OBJECT_OT_location_clear(struct wmOperatorType *ot);
void OBJECT_OT_rotation_clear(struct wmOperatorType *ot);
void OBJECT_OT_scale_clear(struct wmOperatorType *ot);
@@ -79,6 +82,9 @@ void OBJECT_OT_armature_add(struct wmOperatorType *ot);
/* only used as menu */
void OBJECT_OT_primitive_add(struct wmOperatorType *ot);
+int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r);
+void object_hook_select(Object *obedit, struct HookModifierData *hmd);
+
/* editlattice.c */
void free_editLatt(Object *ob);
void make_editLatt(Object *obedit);
@@ -103,7 +109,13 @@ void OBJECT_OT_modifier_apply(struct wmOperatorType *ot);
void OBJECT_OT_modifier_convert(struct wmOperatorType *ot);
void OBJECT_OT_modifier_copy(struct wmOperatorType *ot);
void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot);
-void OBJECT_OT_modifier_mdef_bind(struct wmOperatorType *ot);
+void OBJECT_OT_multires_higher_levels_delete(struct wmOperatorType *ot);
+void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot);
+void OBJECT_OT_hook_reset(struct wmOperatorType *ot);
+void OBJECT_OT_hook_recenter(struct wmOperatorType *ot);
+void OBJECT_OT_hook_select(struct wmOperatorType *ot);
+void OBJECT_OT_hook_assign(struct wmOperatorType *ot);
+void OBJECT_OT_explode_refresh(struct wmOperatorType *ot);
/* editconstraint.c */
void OBJECT_OT_constraint_add(struct wmOperatorType *ot);
@@ -137,6 +149,9 @@ void OBJECT_OT_vertex_group_deselect(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_copy_to_linked(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot);
+void OBJECT_OT_game_property_new(struct wmOperatorType *ot);
+void OBJECT_OT_game_property_remove(struct wmOperatorType *ot);
+
/* editkey.c */
void OBJECT_OT_shape_key_add(struct wmOperatorType *ot);
void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 6b9f2db0d96..96e485e5462 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -31,6 +31,7 @@
#include "MEM_guardedalloc.h"
+#include "DNA_action_types.h"
#include "DNA_curve_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -39,8 +40,10 @@
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
+#include "BLI_arithb.h"
#include "BLI_listbase.h"
+#include "BKE_action.h"
#include "BKE_curve.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
@@ -226,7 +229,7 @@ int ED_object_modifier_convert(ReportList *reports, Scene *scene, Object *ob, Mo
int totpart=0, totchild=0;
if(md->type != eModifierType_ParticleSystem) return 0;
- if(G.f & G_PARTICLEEDIT) return 0;
+ if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) return 0;
psys=((ParticleSystemModifierData *)md)->psys;
part= psys->part;
@@ -403,6 +406,11 @@ int ED_object_modifier_copy(ReportList *reports, Object *ob, ModifierData *md)
/***************************** OPERATORS ****************************/
+static int modifier_poll(bContext *C)
+{
+ return (CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier).data != NULL);
+}
+
/************************ add modifier operator *********************/
static int modifier_add_exec(bContext *C, wmOperator *op)
@@ -419,8 +427,44 @@ static int modifier_add_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ EnumPropertyItem *item= NULL, *md_item;
+ ModifierTypeInfo *mti;
+ Object *ob;
+ int totitem= 0, a;
+
+ if(!C || !(ob= CTX_data_active_object(C))) /* needed for docs */
+ return modifier_type_items;
+
+ for(a=0; modifier_type_items[a].identifier; a++) {
+ md_item= &modifier_type_items[a];
+
+ if(md_item->identifier[0]) {
+ mti= modifierType_getInfo(md_item->value);
+
+ if(mti->flags & eModifierTypeFlag_NoUserAdd)
+ continue;
+
+ if(!((mti->flags & eModifierTypeFlag_AcceptsCVs) ||
+ (ob->type==OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh))))
+ continue;
+ }
+
+ RNA_enum_item_add(&item, &totitem, md_item);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+
+ *free= 1;
+
+ return item;
+}
+
void OBJECT_OT_modifier_add(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Add Modifier";
ot->description = "Add a modifier to the active object.";
@@ -429,14 +473,14 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot)
/* api callbacks */
ot->invoke= WM_menu_invoke;
ot->exec= modifier_add_exec;
-
ot->poll= ED_operator_object_active;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- /* XXX only some types should be here */
- RNA_def_enum(ot->srna, "type", modifier_type_items, 0, "Type", "");
+ /* properties */
+ prop= RNA_def_enum(ot->srna, "type", modifier_type_items, eModifierType_Subsurf, "Type", "");
+ RNA_def_enum_funcs(prop, modifier_add_itemf);
}
/************************ remove modifier operator *********************/
@@ -448,7 +492,7 @@ static int modifier_remove_exec(bContext *C, wmOperator *op)
Object *ob= ptr.id.data;
ModifierData *md= ptr.data;
- if(!ob || !md || !ED_object_modifier_remove(op->reports, scene, ob, md))
+ if(!ED_object_modifier_remove(op->reports, scene, ob, md))
return OPERATOR_CANCELLED;
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
@@ -464,6 +508,7 @@ void OBJECT_OT_modifier_remove(wmOperatorType *ot)
ot->poll= ED_operator_object_active;
ot->exec= modifier_remove_exec;
+ ot->poll= modifier_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -478,7 +523,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op)
Object *ob= ptr.id.data;
ModifierData *md= ptr.data;
- if(!ob || !md || !ED_object_modifier_move_up(op->reports, ob, md))
+ if(!ED_object_modifier_move_up(op->reports, ob, md))
return OPERATOR_CANCELLED;
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
@@ -495,6 +540,7 @@ void OBJECT_OT_modifier_move_up(wmOperatorType *ot)
ot->poll= ED_operator_object_active;
ot->exec= modifier_move_up_exec;
+ ot->poll= modifier_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -526,6 +572,7 @@ void OBJECT_OT_modifier_move_down(wmOperatorType *ot)
ot->poll= ED_operator_object_active;
ot->exec= modifier_move_down_exec;
+ ot->poll= modifier_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -557,6 +604,7 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot)
ot->poll= ED_operator_object_active;
ot->exec= modifier_apply_exec;
+ ot->poll= modifier_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -588,6 +636,7 @@ void OBJECT_OT_modifier_convert(wmOperatorType *ot)
ot->poll= ED_operator_object_active;
ot->exec= modifier_convert_exec;
+ ot->poll= modifier_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -619,35 +668,68 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot)
ot->poll= ED_operator_object_active;
ot->exec= modifier_copy_exec;
+ ot->poll= modifier_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-/****************** multires subdivide operator *********************/
+/************* multires delete higher levels operator ****************/
-static int multires_subdivide_exec(bContext *C, wmOperator *op)
+static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier);
Object *ob= ptr.id.data;
MultiresModifierData *mmd= ptr.data;
if(mmd) {
- multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple);
+ multiresModifier_del_levels(mmd, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
}
return OPERATOR_FINISHED;
}
+void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot)
+{
+ ot->name= "Delete Higher Levels";
+ ot->idname= "OBJECT_OT_multires_higher_levels_delete";
+ ot->poll= ED_operator_object_active;
+
+ ot->exec= multires_higher_levels_delete_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/****************** multires subdivide operator *********************/
+
+static int multires_subdivide_exec(bContext *C, wmOperator *op)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier);
+ Object *ob= ptr.id.data;
+ MultiresModifierData *mmd= ptr.data;
+
+ multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+static int multires_subdivide_poll(bContext *C)
+{
+ return (CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier).data != NULL) &&
+ CTX_data_edit_object(C) == NULL;
+}
+
void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
{
ot->name= "Multires Subdivide";
ot->description= "Add a new level of subdivision.";
ot->idname= "OBJECT_OT_multires_subdivide";
- ot->poll= ED_operator_object_active;
ot->exec= multires_subdivide_exec;
+ ot->poll= multires_subdivide_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -655,12 +737,12 @@ void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
/************************ mdef bind operator *********************/
-static int modifier_mdef_bind_poll(bContext *C)
+static int meshdeform_poll(bContext *C)
{
return CTX_data_pointer_get_type(C, "modifier", &RNA_MeshDeformModifier).data != NULL;
}
-static int modifier_mdef_bind_exec(bContext *C, wmOperator *op)
+static int meshdeform_bind_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
PointerRNA ptr= CTX_data_pointer_get(C, "modifier");
@@ -711,41 +793,22 @@ static int modifier_mdef_bind_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void OBJECT_OT_modifier_mdef_bind(wmOperatorType *ot)
+void OBJECT_OT_meshdeform_bind(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mesh Deform Bind";
ot->description = "Bind mesh to cage in mesh deform modifier.";
- ot->idname= "OBJECT_OT_modifier_mdef_bind";
+ ot->idname= "OBJECT_OT_meshdeform_bind";
/* api callbacks */
- ot->poll= modifier_mdef_bind_poll;
- ot->exec= modifier_mdef_bind_exec;
+ ot->poll= meshdeform_poll;
+ ot->exec= meshdeform_bind_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
#if 0
-static void modifiers_add(void *ob_v, int type)
-{
- Object *ob = ob_v;
- ModifierTypeInfo *mti = modifierType_getInfo(type);
-
- if (mti->flags&eModifierTypeFlag_RequiresOriginalData) {
- ModifierData *md = ob->modifiers.first;
-
- while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) {
- md = md->next;
- }
-
- BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type));
- } else {
- BLI_addtail(&ob->modifiers, modifier_new(type));
- }
- ED_undo_push("Add modifier");
-}
-
typedef struct MenuEntry {
char *name;
int ID;
@@ -797,89 +860,189 @@ static uiBlock *modifiers_add_menu(void *ob_v)
}
#endif
-#if 0
-static void modifiers_clearHookOffset(bContext *C, void *ob_v, void *md_v)
+/******************** hook operators ************************/
+
+static int hook_poll(bContext *C)
{
- Object *ob = ob_v;
- ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
-
- if (hmd->object) {
- Mat4Invert(hmd->object->imat, hmd->object->obmat);
- Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL);
- ED_undo_push(C, "Clear hook offset");
+ return CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier).data != NULL;
+}
+
+static int hook_reset_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier);
+ Object *ob= ptr.id.data;
+ HookModifierData *hmd= ptr.data;
+
+ if(hmd->object) {
+ bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget);
+
+ if(hmd->subtarget[0] && pchan) {
+ float imat[4][4], mat[4][4];
+
+ /* calculate the world-space matrix for the pose-channel target first, then carry on as usual */
+ Mat4MulMat4(mat, pchan->pose_mat, hmd->object->obmat);
+
+ Mat4Invert(imat, mat);
+ Mat4MulSerie(hmd->parentinv, imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL);
+ }
+ else {
+ Mat4Invert(hmd->object->imat, hmd->object->obmat);
+ Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL);
+ }
}
+
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+
+ return OPERATOR_FINISHED;
}
-static void modifiers_cursorHookCenter(bContext *C, void *ob_v, void *md_v)
+void OBJECT_OT_hook_reset(wmOperatorType *ot)
{
- /* XXX
- Object *ob = ob_v;
- ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
+ ot->name= "Hook Reset";
+ ot->description= "Recalculate and and clear offset transformation.";
+ ot->idname= "OBJECT_OT_hook_reset";
+
+ ot->exec= hook_reset_exec;
+ ot->poll= hook_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int hook_recenter_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier);
+ Object *ob= ptr.id.data;
+ HookModifierData *hmd= ptr.data;
+ float bmat[3][3], imat[3][3];
+
+ Mat3CpyMat4(bmat, ob->obmat);
+ Mat3Inv(imat, bmat);
+
+ VECSUB(hmd->cent, scene->cursor, ob->obmat[3]);
+ Mat3MulVecfl(imat, hmd->cent);
+
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+
+ return OPERATOR_FINISHED;
+}
- if(G.vd) {
- float *curs = give_cursor();
- float bmat[3][3], imat[3][3];
+void OBJECT_OT_hook_recenter(wmOperatorType *ot)
+{
+ ot->name= "Hook Recenter";
+ ot->description= "Set hook center to cursor position.";
+ ot->idname= "OBJECT_OT_hook_recenter";
- where_is_object(ob);
+ ot->exec= hook_recenter_exec;
+ ot->poll= hook_poll;
- Mat3CpyMat4(bmat, ob->obmat);
- Mat3Inv(imat, bmat);
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
- curs= give_cursor();
- hmd->cent[0]= curs[0]-ob->obmat[3][0];
- hmd->cent[1]= curs[1]-ob->obmat[3][1];
- hmd->cent[2]= curs[2]-ob->obmat[3][2];
- Mat3MulVecfl(imat, hmd->cent);
+static int hook_select_exec(bContext *C, wmOperator *op)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier);
+ Object *ob= ptr.id.data;
+ HookModifierData *hmd= ptr.data;
- ED_undo_push(C, "Hook cursor center");
- }*/
+ object_hook_select(ob, hmd);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob);
+
+ return OPERATOR_FINISHED;
}
-static void modifiers_selectHook(bContext *C, void *ob_v, void *md_v)
+void OBJECT_OT_hook_select(wmOperatorType *ot)
{
- /* XXX ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
+ ot->name= "Hook Select";
+ ot->description= "Selects effected vertices on mesh.";
+ ot->idname= "OBJECT_OT_hook_select";
- hook_select(hmd);*/
+ ot->exec= hook_select_exec;
+ ot->poll= hook_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static void modifiers_reassignHook(bContext *C, void *ob_v, void *md_v)
+static int hook_assign_exec(bContext *C, wmOperator *op)
{
- /* XXX ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
+ Scene *scene= CTX_data_scene(C);
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier);
+ Object *ob= ptr.id.data;
+ HookModifierData *hmd= ptr.data;
float cent[3];
- int *indexar, tot, ok;
char name[32];
+ int *indexar, tot;
- ok= hook_getIndexArray(&tot, &indexar, name, cent);
+ if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) {
+ BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group");
+ return OPERATOR_CANCELLED;
+ }
- if (!ok) {
- uiPupMenuError(C, "Requires selected vertices or active Vertex Group");
- } else {
- if (hmd->indexar) {
- MEM_freeN(hmd->indexar);
- }
+ if(hmd->indexar)
+ MEM_freeN(hmd->indexar);
- VECCOPY(hmd->cent, cent);
- hmd->indexar = indexar;
- hmd->totindex = tot;
- }*/
+ VECCOPY(hmd->cent, cent);
+ hmd->indexar= indexar;
+ hmd->totindex= tot;
+
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+
+ return OPERATOR_FINISHED;
}
-void modifiers_explodeFacepa(bContext *C, void *arg1, void *arg2)
+void OBJECT_OT_hook_assign(wmOperatorType *ot)
{
- ExplodeModifierData *emd=arg1;
+ ot->name= "Hook Assign";
+ ot->description= "Reassigns selected vertices to hook.";
+ ot->idname= "OBJECT_OT_hook_assign";
- emd->flag |= eExplodeFlag_CalcFaces;
+ ot->exec= hook_assign_exec;
+ ot->poll= hook_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-void modifiers_explodeDelVg(bContext *C, void *arg1, void *arg2)
+/****************** explode refresh operator *********************/
+
+static int explode_refresh_poll(bContext *C)
{
- ExplodeModifierData *emd=arg1;
- emd->vgroup = 0;
+ return CTX_data_pointer_get_type(C, "modifier", &RNA_ExplodeModifier).data != NULL;
}
-#endif
+static int explode_refresh_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_ExplodeModifier);
+ Object *ob= ptr.id.data;
+ ExplodeModifierData *emd= ptr.data;
+
+ emd->flag |= eExplodeFlag_CalcFaces;
+
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_explode_refresh(wmOperatorType *ot)
+{
+ ot->name= "Explode Refresh";
+ ot->description= "Refresh data in the Explode modifier.";
+ ot->idname= "OBJECT_OT_explode_refresh";
+
+ ot->exec= explode_refresh_exec;
+ ot->poll= explode_refresh_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index c1509e78502..09a27e9e613 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -65,6 +65,7 @@ void ED_operatortypes_object(void)
{
wmOperatorType *ot;
+ WM_operatortype_append(OBJECT_OT_mode_set);
WM_operatortype_append(OBJECT_OT_editmode_toggle);
WM_operatortype_append(OBJECT_OT_posemode_toggle);
WM_operatortype_append(OBJECT_OT_parent_set);
@@ -78,6 +79,7 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_select_by_layer);
WM_operatortype_append(OBJECT_OT_select_linked);
WM_operatortype_append(OBJECT_OT_select_grouped);
+ WM_operatortype_append(OBJECT_OT_select_mirror);
WM_operatortype_append(OBJECT_OT_location_clear);
WM_operatortype_append(OBJECT_OT_rotation_clear);
WM_operatortype_append(OBJECT_OT_scale_clear);
@@ -117,7 +119,13 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_modifier_convert);
WM_operatortype_append(OBJECT_OT_modifier_copy);
WM_operatortype_append(OBJECT_OT_multires_subdivide);
- WM_operatortype_append(OBJECT_OT_modifier_mdef_bind);
+ WM_operatortype_append(OBJECT_OT_multires_higher_levels_delete);
+ WM_operatortype_append(OBJECT_OT_meshdeform_bind);
+ WM_operatortype_append(OBJECT_OT_hook_reset);
+ WM_operatortype_append(OBJECT_OT_hook_recenter);
+ WM_operatortype_append(OBJECT_OT_hook_select);
+ WM_operatortype_append(OBJECT_OT_hook_assign);
+ WM_operatortype_append(OBJECT_OT_explode_refresh);
WM_operatortype_append(OBJECT_OT_constraint_add);
WM_operatortype_append(OBJECT_OT_constraint_add_with_targets);
@@ -144,6 +152,9 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_linked);
WM_operatortype_append(OBJECT_OT_vertex_group_copy);
+ WM_operatortype_append(OBJECT_OT_game_property_new);
+ WM_operatortype_append(OBJECT_OT_game_property_remove);
+
WM_operatortype_append(OBJECT_OT_shape_key_add);
WM_operatortype_append(OBJECT_OT_shape_key_remove);
@@ -161,10 +172,19 @@ void ED_operatortypes_object(void)
void ED_keymap_object(wmWindowManager *wm)
{
ListBase *keymap= WM_keymap_listbase(wm, "Object Non-modal", 0, 0);
+ wmKeymapItem *kmi;
/* Note: this keymap works disregarding mode */
WM_keymap_add_item(keymap, "OBJECT_OT_editmode_toggle", TABKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "OBJECT_OT_posemode_toggle", TABKEY, KM_PRESS, KM_CTRL, 0);
+
+ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0);
+ RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
+ RNA_boolean_set(kmi->ptr, "toggle", 1);
+ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
+ RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
+ RNA_boolean_set(kmi->ptr, "toggle", 1);
+
WM_keymap_add_item(keymap, "OBJECT_OT_center_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
/* Note: this keymap gets disabled in non-objectmode, */
@@ -174,6 +194,7 @@ void ED_keymap_object(wmWindowManager *wm)
WM_keymap_add_item(keymap, "OBJECT_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_verify_item(keymap, "OBJECT_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0);
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 3d3e29bcc22..767a04d9170 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -57,6 +57,7 @@
#include "BKE_global.h"
#include "BKE_lattice.h"
#include "BKE_mesh.h"
+#include "BKE_paint.h"
#include "BKE_utildefines.h"
#include "RNA_access.h"
@@ -1028,11 +1029,11 @@ void vgroup_assign_with_menu(Scene *scene, Object *ob)
switch (mode) {
case 1: /* add to new group */
add_defgroup(ob);
- assign_verts_defgroup(ob, wp->brush->alpha);
+ assign_verts_defgroup(ob, paint_brush(&wp->paint)->alpha);
BIF_undo_push("Assign to vertex group");
break;
case 2: /* add to current group */
- assign_verts_defgroup(ob, wp->brush->alpha);
+ assign_verts_defgroup(ob, paint_brush(&wp->paint)->alpha);
BIF_undo_push("Assign to vertex group");
break;
case 3: /* remove from current group */
@@ -1075,7 +1076,7 @@ void vgroup_operation_with_menu(Object *ob)
short nr;
if (menustr) {
-// XXX nr= pupmenu(menustr);
+ nr= 1; // pupmenu(menustr); // XXX
if ((nr >= 1) && (nr <= defCount))
ob->actdef= nr;
diff --git a/source/blender/editors/physics/ed_fluidsim.c b/source/blender/editors/physics/ed_fluidsim.c
index a8862eb17de..907d3f99f77 100644
--- a/source/blender/editors/physics/ed_fluidsim.c
+++ b/source/blender/editors/physics/ed_fluidsim.c
@@ -100,7 +100,7 @@
/* from header info.c */
static int start_progress_bar(void) {return 0;};
static void end_progress_bar(void) {};
-static void waitcursor() {};
+static void waitcursor(int val) {};
static int progress_bar(float done, char *busy_info) {return 0;}
static int pupmenu() {return 0;}
/* XXX */
diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c
index 4bf6612df67..22316290c7b 100644
--- a/source/blender/editors/physics/ed_pointcache.c
+++ b/source/blender/editors/physics/ed_pointcache.c
@@ -46,6 +46,7 @@
#include "ED_screen.h"
#include "ED_physics.h"
+#include "ED_particle.h"
#include "UI_interface.h"
#include "UI_resources.h"
@@ -61,7 +62,6 @@
static int cache_break_test(void *cbd) {
return G.afbreek==1;
}
-/**************************** general **********************************/
static int ptcache_bake_all_poll(bContext *C)
{
Scene *scene= CTX_data_scene(C);
@@ -72,6 +72,12 @@ static int ptcache_bake_all_poll(bContext *C)
return 1;
}
+static int ptcache_poll(bContext *C)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
+ return (ptr.data && ptr.id.data);
+}
+
static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
@@ -130,7 +136,7 @@ void PTCACHE_OT_bake_all(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "bake", 0, "Bake", "");
+ RNA_def_boolean(ot->srna, "bake", 1, "Bake", "");
}
void PTCACHE_OT_free_bake_all(wmOperatorType *ot)
{
@@ -145,32 +151,25 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-
-/**************************** cloth **********************************/
-static int ptcache_bake_cloth_poll(bContext *C)
-{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
-
- if(!scene || !ob || ob->id.lib || !clmd)
- return 0;
-
- return 1;
-}
-
-static int ptcache_bake_cloth_exec(bContext *C, wmOperator *op)
+static int ptcache_bake_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
- PTCacheID pid;
+ Scene *scene = CTX_data_scene(C);
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
+ Object *ob= ptr.id.data;
+ PointCache *cache= ptr.data;
PTCacheBaker baker;
+ PTCacheID *pid;
+ ListBase pidlist;
- BKE_ptcache_id_from_cloth(&pid, ob, clmd);
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache)
+ break;
+ }
baker.scene = scene;
- baker.pid = &pid;
+ baker.pid = pid;
baker.bake = RNA_boolean_get(op->ptr, "bake");
baker.render = 0;
baker.anim_init = 0;
@@ -182,195 +181,168 @@ static int ptcache_bake_cloth_exec(bContext *C, wmOperator *op)
BKE_ptcache_make_cache(&baker);
+ BLI_freelistN(&pidlist);
+
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
return OPERATOR_FINISHED;
}
-static int ptcache_free_bake_cloth_exec(bContext *C, wmOperator *op)
+static int ptcache_free_bake_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
- PTCacheID pid;
-
- BKE_ptcache_id_from_cloth(&pid, ob, clmd);
- pid.cache->flag &= ~PTCACHE_BAKED;
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
+ PointCache *cache= ptr.data;
+
+ if(cache->edit) {
+ if(!cache->edit->edited || 1) {// XXX okee("Lose changes done in particle mode?")) {
+ PE_free_ptcache_edit(cache->edit);
+ cache->edit = NULL;
+ cache->flag &= ~PTCACHE_BAKED;
+ }
+ }
+ else
+ cache->flag &= ~PTCACHE_BAKED;
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+ return OPERATOR_FINISHED;
+}
+static int ptcache_bake_from_cache_exec(bContext *C, wmOperator *op)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
+ PointCache *cache= ptr.data;
+
+ cache->flag |= PTCACHE_BAKED;
return OPERATOR_FINISHED;
}
-void PTCACHE_OT_cache_cloth(wmOperatorType *ot)
+void PTCACHE_OT_bake(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake Cloth";
- ot->idname= "PTCACHE_OT_cache_cloth";
+ ot->name= "Bake Physics";
+ ot->idname= "PTCACHE_OT_bake";
/* api callbacks */
- ot->exec= ptcache_bake_cloth_exec;
- ot->poll= ptcache_bake_cloth_poll;
+ ot->exec= ptcache_bake_exec;
+ ot->poll= ptcache_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "bake", 0, "Bake", "");
+ RNA_def_boolean(ot->srna, "bake", 1, "Bake", "");
}
-void PTCACHE_OT_free_bake_cloth(wmOperatorType *ot)
+void PTCACHE_OT_free_bake(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Free Cloth Bake";
- ot->idname= "PTCACHE_OT_free_bake_cloth";
+ ot->name= "Free Physics Bake";
+ ot->idname= "PTCACHE_OT_free_bake";
/* api callbacks */
- ot->exec= ptcache_free_bake_cloth_exec;
- ot->poll= ptcache_bake_cloth_poll;
+ ot->exec= ptcache_free_bake_exec;
+ ot->poll= ptcache_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static int ptcache_bake_from_cloth_cache_exec(bContext *C, wmOperator *op)
-{
- Object *ob= CTX_data_active_object(C);
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
- PTCacheID pid;
-
- BKE_ptcache_id_from_cloth(&pid, ob, clmd);
- pid.cache->flag |= PTCACHE_BAKED;
-
- return OPERATOR_FINISHED;
-}
-void PTCACHE_OT_bake_from_cloth_cache(wmOperatorType *ot)
+void PTCACHE_OT_bake_from_cache(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Bake From Cache";
- ot->idname= "PTCACHE_OT_bake_from_cloth_cache";
+ ot->idname= "PTCACHE_OT_bake_from_cache";
/* api callbacks */
- ot->exec= ptcache_bake_from_cloth_cache_exec;
- ot->poll= ptcache_bake_cloth_poll;
+ ot->exec= ptcache_bake_from_cache_exec;
+ ot->poll= ptcache_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-/**************************** particles **********************************/
-static int ptcache_bake_particle_system_poll(bContext *C)
+static int ptcache_add_new_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
+ Scene *scene = CTX_data_scene(C);
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
+ Object *ob= ptr.id.data;
+ PointCache *cache= ptr.data;
+ PTCacheID *pid;
+ ListBase pidlist;
- if(!scene || !ob || ob->id.lib)
- return 0;
+ BKE_ptcache_ids_from_object(&pidlist, ob);
- return (ob->particlesystem.first != NULL);
-}
-
-static int ptcache_bake_particle_system_exec(bContext *C, wmOperator *op)
-{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys =psys_get_current(ob);
- PTCacheID pid;
- PTCacheBaker baker;
-
- BKE_ptcache_id_from_particles(&pid, ob, psys);
-
- baker.scene = scene;
- baker.pid = &pid;
- baker.bake = RNA_boolean_get(op->ptr, "bake");
- baker.render = 0;
- baker.anim_init = 0;
- baker.quick_step = 1;
- baker.break_test = cache_break_test;
- baker.break_data = NULL;
- baker.progressbar = (void (*)(void *, int))WM_timecursor;
- baker.progresscontext = CTX_wm_window(C);
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache) {
+ *(pid->cache_ptr) = BKE_ptcache_add(pid->ptcaches);
+ break;
+ }
+ }
- BKE_ptcache_make_cache(&baker);
+ BLI_freelistN(&pidlist);
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
return OPERATOR_FINISHED;
}
-static int ptcache_free_bake_particle_system_exec(bContext *C, wmOperator *op)
+static int ptcache_remove_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= psys_get_current(ob);
- PTCacheID pid;
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
+ Object *ob= ptr.id.data;
+ PointCache *cache= ptr.data;
+ PTCacheID *pid;
+ ListBase pidlist;
- BKE_ptcache_id_from_particles(&pid, ob, psys);
- psys->pointcache->flag &= ~PTCACHE_BAKED;
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache) {
+ if(pid->ptcaches->first == pid->ptcaches->last)
+ continue; /* don't delete last cache */
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+ BLI_remlink(pid->ptcaches, pid->cache);
+ BKE_ptcache_free(pid->cache);
+ *(pid->cache_ptr) = pid->ptcaches->first;
- return OPERATOR_FINISHED;
-}
-void PTCACHE_OT_cache_particle_system(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Bake Particles";
- ot->idname= "PTCACHE_OT_cache_particle_system";
-
- /* api callbacks */
- ot->exec= ptcache_bake_particle_system_exec;
- ot->poll= ptcache_bake_particle_system_poll;
+ break;
+ }
+ }
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ BLI_freelistN(&pidlist);
- RNA_def_boolean(ot->srna, "bake", 0, "Bake", "");
+ return OPERATOR_FINISHED;
}
-void PTCACHE_OT_free_bake_particle_system(wmOperatorType *ot)
+void PTCACHE_OT_add_new(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Free Particles Bake";
- ot->idname= "PTCACHE_OT_free_bake_particle_system";
+ ot->name= "Add new cache";
+ ot->idname= "PTCACHE_OT_add_new";
/* api callbacks */
- ot->exec= ptcache_free_bake_particle_system_exec;
- ot->poll= ptcache_bake_particle_system_poll;
+ ot->exec= ptcache_add_new_exec;
+ ot->poll= ptcache_poll; // ptcache_bake_all_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static int ptcache_bake_from_particles_cache_exec(bContext *C, wmOperator *op)
-{
- Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= psys_get_current(ob);
- PTCacheID pid;
-
- BKE_ptcache_id_from_particles(&pid, ob, psys);
- psys->pointcache->flag |= PTCACHE_BAKED;
-
- return OPERATOR_FINISHED;
-}
-void PTCACHE_OT_bake_from_particles_cache(wmOperatorType *ot)
+void PTCACHE_OT_remove(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Bake From Cache";
- ot->idname= "PTCACHE_OT_bake_from_particles_cache";
+ ot->name= "Delete current cache";
+ ot->idname= "PTCACHE_OT_remove";
/* api callbacks */
- ot->exec= ptcache_bake_from_particles_cache_exec;
- ot->poll= ptcache_bake_particle_system_poll;
+ ot->exec= ptcache_remove_exec;
+ ot->poll= ptcache_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-
/**************************** registration **********************************/
void ED_operatortypes_pointcache(void)
{
WM_operatortype_append(PTCACHE_OT_bake_all);
WM_operatortype_append(PTCACHE_OT_free_bake_all);
- WM_operatortype_append(PTCACHE_OT_cache_particle_system);
- WM_operatortype_append(PTCACHE_OT_free_bake_particle_system);
- WM_operatortype_append(PTCACHE_OT_bake_from_particles_cache);
- WM_operatortype_append(PTCACHE_OT_cache_cloth);
- WM_operatortype_append(PTCACHE_OT_free_bake_cloth);
- WM_operatortype_append(PTCACHE_OT_bake_from_cloth_cache);
+ WM_operatortype_append(PTCACHE_OT_bake);
+ WM_operatortype_append(PTCACHE_OT_free_bake);
+ WM_operatortype_append(PTCACHE_OT_bake_from_cache);
+ WM_operatortype_append(PTCACHE_OT_add_new);
+ WM_operatortype_append(PTCACHE_OT_remove);
}
//void ED_keymap_pointcache(wmWindowManager *wm)
diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c
index 20033c747f9..220928cb79c 100644
--- a/source/blender/editors/physics/editparticle.c
+++ b/source/blender/editors/physics/editparticle.c
@@ -57,7 +57,8 @@
#include "BKE_particle.h"
#include "BKE_report.h"
#include "BKE_scene.h"
-#include "BKE_utildefines.h"
+#include "BKE_utildefines.h"
+#include "BKE_pointcache.h"
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
@@ -85,11 +86,25 @@
#include "physics_intern.h"
-static void PE_create_particle_edit(Scene *scene, Object *ob, ParticleSystem *psys);
-static void ParticleUndo_clear(ParticleSystem *psys);
+static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys);
+static void PTCacheUndo_clear(PTCacheEdit *edit);
-#define LOOP_PARTICLES(i, pa) for(i=0, pa=psys->particles; i<totpart; i++, pa++)
-#define LOOP_KEYS(k, key) if(psys->edit)for(k=0, key=psys->edit->keys[i]; k<pa->totkey; k++, key++)
+#define KEY_K PTCacheEditKey *key; int k
+#define POINT_P PTCacheEditPoint *point; int p
+#define LOOP_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++)
+#define LOOP_VISIBLE_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!(point->flag & PEP_HIDE))
+#define LOOP_SELECTED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point_is_selected(point))
+#define LOOP_UNSELECTED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!point_is_selected(point))
+#define LOOP_EDITED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_EDIT_RECALC)
+#define LOOP_TAGGED_POINTS for(p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_TAG)
+#define LOOP_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++)
+#define LOOP_VISIBLE_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++) if(!(key->flag & PEK_HIDE))
+#define LOOP_SELECTED_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++) if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
+#define LOOP_TAGGED_KEYS for(k=0, key=point->keys; k<point->totkey; k++, key++) if(key->flag & PEK_TAG)
+
+#define LOOP_PARTICLES(i, pa) for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++)
+
+#define KEY_WCO (key->flag & PEK_USE_WCO ? key->world_co : key->co)
/**************************** utilities *******************************/
@@ -97,46 +112,37 @@ static int PE_poll(bContext *C)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys;
+ PTCacheEdit *edit;
if(!scene || !ob)
return 0;
- psys= PE_get_current(scene, ob);
+ edit= PE_get_current(scene, ob);
- return (psys && psys->edit && (G.f & G_PARTICLEEDIT));
+ return (edit && (ob->mode & OB_MODE_PARTICLE_EDIT));
}
static int PE_poll_3dview(bContext *C)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys;
-
- if(!scene || !ob || !CTX_wm_region_view3d(C))
- return 0;
-
- psys= PE_get_current(scene, ob);
-
- return (psys && psys->edit && (G.f & G_PARTICLEEDIT));
+ return PE_poll(C) && CTX_wm_area(C)->spacetype == SPACE_VIEW3D &&
+ CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW;
}
-static void PE_free_particle_edit(ParticleSystem *psys)
+void PE_free_ptcache_edit(PTCacheEdit *edit)
{
- ParticleEdit *edit= psys->edit;
- int i, totpart= psys->totpart;
+ POINT_P;
if(edit==0) return;
- ParticleUndo_clear(psys);
+ PTCacheUndo_clear(edit);
- if(edit->keys) {
- for(i=0; i<totpart; i++) {
- if(edit->keys[i])
- MEM_freeN(edit->keys[i]);
+ if(edit->points) {
+ LOOP_POINTS {
+ if(point->keys)
+ MEM_freeN(point->keys);
}
- MEM_freeN(edit->keys);
+ MEM_freeN(edit->points);
}
if(edit->mirror_cache)
@@ -152,19 +158,23 @@ static void PE_free_particle_edit(ParticleSystem *psys)
edit->emitter_field= 0;
}
- MEM_freeN(edit);
+ psys_free_path_cache(NULL, edit);
- psys->edit= NULL;
- psys->free_edit= NULL;
+ MEM_freeN(edit);
}
/************************************************/
/* Edit Mode Helpers */
/************************************************/
-int PE_can_edit(ParticleSystem *psys)
+int PE_start_edit(PTCacheEdit *edit)
{
- return (psys && psys->edit && (G.f & G_PARTICLEEDIT));
+ if(edit) {
+ edit->edited = 1;
+ return 1;
+ }
+
+ return 0;
}
ParticleEditSettings *PE_settings(Scene *scene)
@@ -173,73 +183,99 @@ ParticleEditSettings *PE_settings(Scene *scene)
}
/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set */
-ParticleSystem *PE_get_current(Scene *scene, Object *ob)
+PTCacheEdit *PE_get_current(Scene *scene, Object *ob)
{
- ParticleSystem *psys;
+ ParticleEditSettings *pset= PE_settings(scene);
+ PTCacheEdit *edit = NULL;
+ ListBase pidlist;
+ PTCacheID *pid;
+
+ pset->scene = scene;
+ pset->object = ob;
if(ob==NULL)
return NULL;
- psys= ob->particlesystem.first;
- while(psys) {
- if(psys->flag & PSYS_CURRENT)
- break;
- psys=psys->next;
- }
+ BKE_ptcache_ids_from_object(&pidlist, ob);
- if(psys==NULL && ob->particlesystem.first) {
- psys=ob->particlesystem.first;
- psys->flag |= PSYS_CURRENT;
+ /* in the case of only one editable thing, set pset->edittype accordingly */
+ if(pidlist.first && pidlist.first == pidlist.last) {
+ pid = pidlist.first;
+ switch(pid->type) {
+ case PTCACHE_TYPE_PARTICLES:
+ pset->edittype = PE_TYPE_PARTICLES;
+ break;
+ case PTCACHE_TYPE_SOFTBODY:
+ pset->edittype = PE_TYPE_SOFTBODY;
+ break;
+ case PTCACHE_TYPE_CLOTH:
+ pset->edittype = PE_TYPE_CLOTH;
+ break;
+ }
}
- /* this happens when Blender is started with particle
- * edit mode enabled XXX there's a draw error then? */
- if(psys && psys_check_enabled(ob, psys) && (ob == OBACT) && (G.f & G_PARTICLEEDIT))
- if(psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED)
- if(psys->edit == NULL)
- PE_create_particle_edit(scene, ob, psys);
-
- return psys;
-}
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pset->edittype == PE_TYPE_PARTICLES && pid->type == PTCACHE_TYPE_PARTICLES) {
+ ParticleSystem *psys = pid->calldata;
-/* returns -1 if no system has PSYS_CURRENT flag */
-short PE_get_current_num(Object *ob)
-{
- short num=0;
- ParticleSystem *psys= ob->particlesystem.first;
+ if(psys->flag & PSYS_CURRENT) {
+ if(psys->part && psys->part->type == PART_HAIR) {
+ if(!psys->edit && psys->flag & PSYS_HAIR_DONE)
+ PE_create_particle_edit(scene, ob, NULL, psys);
+ edit = psys->edit;
+ }
+ else {
+ if(pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
+ PE_create_particle_edit(scene, ob, pid->cache, psys);
+ edit = pid->cache->edit;
+ }
- while(psys) {
- if(psys->flag & PSYS_CURRENT)
- return num;
- num++;
- psys=psys->next;
+ break;
+ }
+ }
+ else if(pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) {
+ if(pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
+ PE_create_particle_edit(scene, ob, pid->cache, NULL);
+ edit = pid->cache->edit;
+ break;
+ }
+ else if(pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) {
+ if(pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
+ PE_create_particle_edit(scene, ob, pid->cache, NULL);
+ edit = pid->cache->edit;
+ break;
+ }
}
- return -1;
+ if(edit)
+ edit->pid = *pid;
+
+ BLI_freelistN(&pidlist);
+
+ return edit;
}
-void PE_hide_keys_time(Scene *scene, ParticleSystem *psys, float cfra)
+void PE_hide_keys_time(Scene *scene, PTCacheEdit *edit, float cfra)
{
- ParticleData *pa;
- ParticleEditKey *key;
ParticleEditSettings *pset=PE_settings(scene);
- int i, k, totpart= psys->totpart;
+ POINT_P; KEY_K;
+
- if(pset->draw_timed && pset->selectmode==SCE_SELECT_POINT) {
- LOOP_PARTICLES(i, pa) {
- LOOP_KEYS(k, key) {
- if(fabs(cfra-*key->time) < pset->draw_timed)
+ if(pset->flag & PE_FADE_TIME && pset->selectmode==SCE_SELECT_POINT) {
+ LOOP_POINTS {
+ LOOP_KEYS {
+ if(fabs(cfra-*key->time) < pset->fade_frames)
key->flag &= ~PEK_HIDE;
else {
key->flag |= PEK_HIDE;
- key->flag &= ~PEK_SELECT;
+ //key->flag &= ~PEK_SELECT;
}
}
}
}
else {
- LOOP_PARTICLES(i, pa) {
- LOOP_KEYS(k, key) {
+ LOOP_POINTS {
+ LOOP_KEYS {
key->flag &= ~PEK_HIDE;
}
}
@@ -255,7 +291,7 @@ typedef struct PEData {
Scene *scene;
Object *ob;
DerivedMesh *dm;
- ParticleSystem *psys;
+ PTCacheEdit *edit;
short *mval;
rcti *rect;
@@ -284,7 +320,7 @@ static void PE_set_data(bContext *C, PEData *data)
data->scene= CTX_data_scene(C);
data->ob= CTX_data_active_object(C);
- data->psys= PE_get_current(data->scene, data->ob);
+ data->edit= PE_get_current(data->scene, data->ob);
}
static void PE_set_view3d_data(bContext *C, PEData *data)
@@ -396,121 +432,103 @@ static int key_inside_test(PEData *data, float co[3])
return key_inside_rect(data, co);
}
-static int particle_is_selected(ParticleSystem *psys, ParticleData *pa)
+static int point_is_selected(PTCacheEditPoint *point)
{
- ParticleEditKey *key;
- int sel, i, k;
+ KEY_K;
+ int sel;
- if(pa->flag & PARS_HIDE)
+ if(point->flag & PEP_HIDE)
return 0;
sel= 0;
- i= pa - psys->particles;
- LOOP_KEYS(k, key)
- if(key->flag & PEK_SELECT)
- return 1;
+ LOOP_SELECTED_KEYS {
+ return 1;
+ }
return 0;
}
/*************************** iterators *******************************/
-typedef void (*ForParticleFunc)(PEData *data, int pa_index);
-typedef void (*ForKeyFunc)(PEData *data, int pa_index, int key_index);
-typedef void (*ForKeyMatFunc)(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index);
+typedef void (*ForPointFunc)(PEData *data, int point_index);
+typedef void (*ForKeyFunc)(PEData *data, int point_index, int key_index);
+typedef void (*ForKeyMatFunc)(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key);
static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, int nearest)
{
- ParticleSystem *psys= data->psys;
- ParticleEdit *edit= psys->edit;
- ParticleData *pa;
- ParticleEditKey *key;
ParticleEditSettings *pset= PE_settings(data->scene);
- int i, k, totpart, nearest_pa, nearest_key;
+ PTCacheEdit *edit= data->edit;
+ POINT_P; KEY_K;
+ int nearest_point, nearest_key;
float dist= data->rad;
/* in path select mode we have no keys */
if(pset->selectmode==SCE_SELECT_PATH)
return;
- totpart= psys->totpart;
- nearest_pa= -1;
+ nearest_point= -1;
nearest_key= -1;
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
-
+ LOOP_VISIBLE_POINTS {
if(pset->selectmode == SCE_SELECT_END) {
/* only do end keys */
- key= edit->keys[i] + pa->totkey-1;
+ key= point->keys + point->totkey-1;
if(nearest) {
- if(key_inside_circle(data, dist, key->world_co, &dist)) {
- nearest_pa= i;
- nearest_key= pa->totkey-1;
+ if(key_inside_circle(data, dist, KEY_WCO, &dist)) {
+ nearest_point= p;
+ nearest_key= point->totkey-1;
}
}
- else if(key_inside_test(data, key->world_co))
- func(data, i, pa->totkey-1);
+ else if(key_inside_test(data, KEY_WCO))
+ func(data, p, point->totkey-1);
}
else {
/* do all keys */
- key= edit->keys[i];
-
- LOOP_KEYS(k, key) {
- if(key->flag & PEK_HIDE) continue;
-
+ LOOP_VISIBLE_KEYS {
if(nearest) {
- if(key_inside_circle(data, dist, key->world_co, &dist)) {
- nearest_pa= i;
+ if(key_inside_circle(data, dist, KEY_WCO, &dist)) {
+ nearest_point= p;
nearest_key= k;
}
}
- else if(key_inside_test(data, key->world_co))
- func(data, i, k);
+ else if(key_inside_test(data, KEY_WCO))
+ func(data, p, k);
}
}
}
/* do nearest only */
- if(nearest && nearest_pa > -1)
- func(data, nearest_pa, nearest_key);
+ if(nearest && nearest_point > -1)
+ func(data, nearest_point, nearest_key);
}
-static void foreach_mouse_hit_particle(PEData *data, ForParticleFunc func, int selected)
+static void foreach_mouse_hit_point(PEData *data, ForPointFunc func, int selected)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa;
- ParticleEditKey *key;
ParticleEditSettings *pset= PE_settings(data->scene);
- int i, k, totpart;
-
- totpart= psys->totpart;
+ PTCacheEdit *edit= data->edit;
+ POINT_P; KEY_K;
/* all is selected in path mode */
if(pset->selectmode==SCE_SELECT_PATH)
selected=0;
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
-
+ LOOP_VISIBLE_POINTS {
if(pset->selectmode==SCE_SELECT_END) {
/* only do end keys */
- key= psys->edit->keys[i] + pa->totkey-1;
+ key= point->keys + point->totkey - 1;
if(selected==0 || key->flag & PEK_SELECT)
- if(key_inside_circle(data, data->rad, key->world_co, &data->dist))
- func(data, i);
+ if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist))
+ func(data, p);
}
else {
/* do all keys */
- LOOP_KEYS(k, key) {
- if(key->flag & PEK_HIDE) continue;
-
+ LOOP_VISIBLE_KEYS {
if(selected==0 || key->flag & PEK_SELECT) {
- if(key_inside_circle(data, data->rad, key->world_co, &data->dist)) {
- func(data, i);
+ if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) {
+ func(data, p);
break;
}
}
@@ -521,16 +539,15 @@ static void foreach_mouse_hit_particle(PEData *data, ForParticleFunc func, int s
static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa;
- ParticleEditKey *key;
- ParticleSystemModifierData *psmd=0;
+ PTCacheEdit *edit = data->edit;
+ ParticleSystem *psys = edit->psys;
+ ParticleSystemModifierData *psmd = NULL;
ParticleEditSettings *pset= PE_settings(data->scene);
- int i, k, totpart;
+ POINT_P; KEY_K;
float mat[4][4], imat[4][4];
- psmd= psys_get_modifier(data->ob,psys);
- totpart= psys->totpart;
+ if(edit->psys)
+ psmd= psys_get_modifier(data->ob, edit->psys);
/* all is selected in path mode */
if(pset->selectmode==SCE_SELECT_PATH)
@@ -539,99 +556,77 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
Mat4One(imat);
Mat4One(mat);
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
-
- psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, pa, mat);
- Mat4Invert(imat,mat);
+ LOOP_VISIBLE_POINTS {
+ if(edit->psys) {
+ psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat);
+ Mat4Invert(imat,mat);
+ }
if(pset->selectmode==SCE_SELECT_END) {
/* only do end keys */
- key= psys->edit->keys[i] + pa->totkey-1;
+ key= point->keys + point->totkey-1;
if(selected==0 || key->flag & PEK_SELECT)
- if(key_inside_circle(data, data->rad, key->world_co, &data->dist))
- func(data, mat, imat, i, pa->totkey-1);
+ if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist))
+ func(data, mat, imat, p, point->totkey-1, key);
}
else {
/* do all keys */
- LOOP_KEYS(k, key) {
- if(key->flag&PEK_HIDE) continue;
-
+ LOOP_VISIBLE_KEYS {
if(selected==0 || key->flag & PEK_SELECT)
- if(key_inside_circle(data, data->rad, key->world_co, &data->dist))
- func(data, mat, imat, i, k);
+ if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist))
+ func(data, mat, imat, p, k, key);
}
}
}
}
-static void foreach_selected_particle(PEData *data, ForParticleFunc func)
+static void foreach_selected_point(PEData *data, ForPointFunc func)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa;
- int i, totpart;
-
- totpart= psys->totpart;
+ PTCacheEdit *edit = data->edit;
+ POINT_P;
- LOOP_PARTICLES(i, pa)
- if(particle_is_selected(psys, pa))
- func(data, i);
+ LOOP_SELECTED_POINTS {
+ func(data, p);
+ }
}
static void foreach_selected_key(PEData *data, ForKeyFunc func)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa;
- ParticleEditKey *key;
- int i, k, totpart;
-
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
-
- key= psys->edit->keys[i];
+ PTCacheEdit *edit = data->edit;
+ POINT_P; KEY_K;
- LOOP_KEYS(k, key)
- if(key->flag & PEK_SELECT)
- func(data, i, k);
+ LOOP_VISIBLE_POINTS {
+ LOOP_SELECTED_KEYS {
+ func(data, p, k);
+ }
}
}
-void PE_foreach_particle(PEData *data, ForParticleFunc func)
+static void foreach_point(PEData *data, ForPointFunc func)
{
- ParticleSystem *psys= data->psys;
- int i, totpart;
-
- totpart= psys->totpart;
+ PTCacheEdit *edit = data->edit;
+ POINT_P;
- for(i=0; i<totpart; i++)
- func(data, i);
+ LOOP_POINTS {
+ func(data, p);
+ }
}
-static int count_selected_keys(Scene *scene, ParticleSystem *psys)
+static int count_selected_keys(Scene *scene, PTCacheEdit *edit)
{
- ParticleData *pa;
- ParticleEditKey *key;
ParticleEditSettings *pset= PE_settings(scene);
- int i, k, totpart, sel= 0;
-
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
-
- key= psys->edit->keys[i];
+ POINT_P; KEY_K;
+ int sel= 0;
+ LOOP_VISIBLE_POINTS {
if(pset->selectmode==SCE_SELECT_POINT) {
- for(k=0; k<pa->totkey; k++,key++)
- if(key->flag & PEK_SELECT)
- sel++;
+ LOOP_SELECTED_KEYS {
+ sel++;
+ }
}
else if(pset->selectmode==SCE_SELECT_END) {
- key += pa->totkey-1;
-
+ key = point->keys + point->totkey - 1;
if(key->flag & PEK_SELECT)
sel++;
}
@@ -646,7 +641,7 @@ static int count_selected_keys(Scene *scene, ParticleSystem *psys)
static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
{
- ParticleEdit *edit;
+ PTCacheEdit *edit;
ParticleData *pa;
ParticleSystemModifierData *psmd;
KDTree *tree;
@@ -704,8 +699,9 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys, ParticleData *pa, ParticleData *mpa)
{
HairKey *hkey, *mhkey;
- ParticleEditKey *key, *mkey;
- ParticleEdit *edit;
+ PTCacheEditPoint *point, *mpoint;
+ PTCacheEditKey *key, *mkey;
+ PTCacheEdit *edit;
float mat[4][4], mmat[4][4], immat[4][4];
int i, mi, k;
@@ -725,17 +721,20 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
else
mi= mpa - psys->particles;
+ point = edit->points + i;
+ mpoint = edit->points + mi;
+
/* make sure they have the same amount of keys */
if(pa->totkey != mpa->totkey) {
if(mpa->hair) MEM_freeN(mpa->hair);
- if(edit->keys[mi]) MEM_freeN(edit->keys[mi]);
+ if(mpoint->keys) MEM_freeN(mpoint->keys);
mpa->hair= MEM_dupallocN(pa->hair);
- edit->keys[mi]= MEM_dupallocN(edit->keys[i]);
- mpa->totkey= pa->totkey;
+ mpoint->keys= MEM_dupallocN(point->keys);
+ mpoint->totkey= point->totkey;
mhkey= mpa->hair;
- mkey= edit->keys[mi];
+ mkey= mpoint->keys;
for(k=0; k<mpa->totkey; k++, mkey++, mhkey++) {
mkey->co= mhkey->co;
mkey->time= &mhkey->time;
@@ -750,8 +749,8 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
hkey=pa->hair;
mhkey=mpa->hair;
- key= edit->keys[i];
- mkey= edit->keys[mi];
+ key= point->keys;
+ mkey= mpoint->keys;
for(k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) {
VECCOPY(mhkey->co, hkey->co);
Mat4MulVecfl(mat, mhkey->co);
@@ -762,199 +761,172 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
mkey->flag |= PEK_TAG;
}
- if(pa->flag & PARS_TAG)
- mpa->flag |= PARS_TAG;
- if(pa->flag & PARS_EDIT_RECALC)
- mpa->flag |= PARS_EDIT_RECALC;
+ if(point->flag & PEP_TAG)
+ mpoint->flag |= PEP_TAG;
+ if(point->flag & PEP_EDIT_RECALC)
+ mpoint->flag |= PEP_EDIT_RECALC;
}
static void PE_apply_mirror(Object *ob, ParticleSystem *psys)
{
- ParticleEdit *edit;
- ParticleData *pa;
+ PTCacheEdit *edit;
ParticleSystemModifierData *psmd;
- int i, totpart;
+ POINT_P;
+
+ if(!psys)
+ return;
edit= psys->edit;
psmd= psys_get_modifier(ob, psys);
- totpart= psys->totpart;
/* we delay settings the PARS_EDIT_RECALC for mirrored particles
* to avoid doing mirror twice */
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_EDIT_RECALC) {
- PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
+ LOOP_POINTS {
+ if(point->flag & PEP_EDIT_RECALC) {
+ PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL);
- if(edit->mirror_cache[i] != -1)
- psys->particles[edit->mirror_cache[i]].flag &= ~PARS_EDIT_RECALC;
+ if(edit->mirror_cache[p] != -1)
+ edit->points[edit->mirror_cache[p]].flag &= ~PEP_EDIT_RECALC;
}
}
- LOOP_PARTICLES(i, pa)
- if(pa->flag & PARS_EDIT_RECALC)
- if(edit->mirror_cache[i] != -1)
- psys->particles[edit->mirror_cache[i]].flag |= PARS_EDIT_RECALC;
-
- edit->totkeys= psys_count_keys(psys);
+ LOOP_POINTS {
+ if(point->flag & PEP_EDIT_RECALC)
+ if(edit->mirror_cache[p] != -1)
+ edit->points[edit->mirror_cache[p]].flag |= PEP_EDIT_RECALC;
+ }
}
/************************************************/
/* Edit Calculation */
/************************************************/
/* tries to stop edited particles from going through the emitter's surface */
-static void pe_deflect_emitter(Scene *scene, Object *ob, ParticleSystem *psys)
+static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
ParticleEditSettings *pset= PE_settings(scene);
- ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys);
- int i, k, totpart,index;
+ ParticleSystem *psys;
+ ParticleSystemModifierData *psmd;
+ POINT_P; KEY_K;
+ int index;
float *vec, *nor, dvec[3], dot, dist_1st;
float hairimat[4][4], hairmat[4][4];
- if(psys==0)
- return;
-
- if((pset->flag & PE_DEFLECT_EMITTER)==0)
+ if(edit==NULL || edit->psys==NULL || (pset->flag & PE_DEFLECT_EMITTER)==0)
return;
- edit= psys->edit;
- totpart= psys->totpart;
+ psys = edit->psys;
+ psmd = psys_get_modifier(ob,psys);
- LOOP_PARTICLES(i, pa) {
- if(!(pa->flag & PARS_EDIT_RECALC))
- continue;
-
- psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, hairmat);
-
- LOOP_KEYS(k, key) {
+ LOOP_EDITED_POINTS {
+ psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles + p, hairmat);
+
+ LOOP_KEYS {
Mat4MulVecfl(hairmat, key->co);
}
- //}
-
- //LOOP_PARTICLES(i, pa) {
- key=psys->edit->keys[i]+1;
- dist_1st=VecLenf((key-1)->co,key->co);
- dist_1st*=0.75f*pset->emitterdist;
-
- for(k=1; k<pa->totkey; k++, key++) {
- index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL);
-
- vec=edit->emitter_cosnos +index*6;
- nor=vec+3;
+ LOOP_KEYS {
+ if(k==0) {
+ dist_1st = VecLenf((key+1)->co, key->co);
+ dist_1st *= 0.75f * pset->emitterdist;
+ }
+ else {
+ index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL);
+
+ vec=edit->emitter_cosnos +index*6;
+ nor=vec+3;
- VecSubf(dvec, key->co, vec);
+ VecSubf(dvec, key->co, vec);
- dot=Inpf(dvec,nor);
- VECCOPY(dvec,nor);
+ dot=Inpf(dvec,nor);
+ VECCOPY(dvec,nor);
- if(dot>0.0f) {
- if(dot<dist_1st) {
+ if(dot>0.0f) {
+ if(dot<dist_1st) {
+ Normalize(dvec);
+ VecMulf(dvec,dist_1st-dot);
+ VecAddf(key->co,key->co,dvec);
+ }
+ }
+ else {
Normalize(dvec);
VecMulf(dvec,dist_1st-dot);
VecAddf(key->co,key->co,dvec);
}
+ if(k==1)
+ dist_1st*=1.3333f;
}
- else {
- Normalize(dvec);
- VecMulf(dvec,dist_1st-dot);
- VecAddf(key->co,key->co,dvec);
- }
- if(k==1)
- dist_1st*=1.3333f;
}
- //}
-
- //LOOP_PARTICLES(i, pa) {
Mat4Invert(hairimat,hairmat);
- LOOP_KEYS(k, key) {
+ LOOP_KEYS {
Mat4MulVecfl(hairimat, key->co);
}
}
}
/* force set distances between neighbouring keys */
-void PE_apply_lengths(Scene *scene, ParticleSystem *psys)
+void PE_apply_lengths(Scene *scene, PTCacheEdit *edit)
{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
+
ParticleEditSettings *pset=PE_settings(scene);
- int i, k, totpart;
+ POINT_P; KEY_K;
float dv1[3];
- if(psys==0)
- return;
-
- if((pset->flag & PE_KEEP_LENGTHS)==0)
+ if(edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0)
return;
- edit= psys->edit;
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(!(pa->flag & PARS_EDIT_RECALC))
- continue;
-
- for(k=1, key=edit->keys[i] + 1; k<pa->totkey; k++, key++) {
- VecSubf(dv1, key->co, (key - 1)->co);
- Normalize(dv1);
- VecMulf(dv1, (key - 1)->length);
- VecAddf(key->co, (key - 1)->co, dv1);
+ LOOP_EDITED_POINTS {
+ LOOP_KEYS {
+ if(k) {
+ VecSubf(dv1, key->co, (key - 1)->co);
+ Normalize(dv1);
+ VecMulf(dv1, (key - 1)->length);
+ VecAddf(key->co, (key - 1)->co, dv1);
+ }
}
}
}
/* try to find a nice solution to keep distances between neighbouring keys */
-static void pe_iterate_lengths(Scene *scene, ParticleSystem *psys)
+static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit)
{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
ParticleEditSettings *pset=PE_settings(scene);
- int i, j, k, totpart;
+ POINT_P;
+ PTCacheEditKey *key;
+ int j, k;
float tlen;
float dv0[3]= {0.0f, 0.0f, 0.0f};
float dv1[3]= {0.0f, 0.0f, 0.0f};
float dv2[3]= {0.0f, 0.0f, 0.0f};
- if(psys==0)
+ if(edit==0)
return;
if((pset->flag & PE_KEEP_LENGTHS)==0)
return;
- edit= psys->edit;
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(!(pa->flag & PARS_EDIT_RECALC))
- continue;
-
- for(j=1; j<pa->totkey; j++) {
- float mul= 1.0f / (float)pa->totkey;
+ LOOP_EDITED_POINTS {
+ for(j=1; j<point->totkey; j++) {
+ float mul= 1.0f / (float)point->totkey;
if(pset->flag & PE_LOCK_FIRST) {
- key= edit->keys[i] + 1;
+ key= point->keys + 1;
k= 1;
dv1[0]= dv1[1]= dv1[2]= 0.0;
}
else {
- key= edit->keys[i];
+ key= point->keys;
k= 0;
dv0[0]= dv0[1]= dv0[2]= 0.0;
}
- for(; k<pa->totkey; k++, key++) {
+ for(; k<point->totkey; k++, key++) {
if(k) {
VecSubf(dv0, (key - 1)->co, key->co);
tlen= Normalize(dv0);
VecMulf(dv0, (mul * (tlen - (key - 1)->length)));
}
- if(k < pa->totkey - 1) {
+ if(k < point->totkey - 1) {
VecSubf(dv2, (key + 1)->co, key->co);
tlen= Normalize(dv2);
VecMulf(dv2, mul * (tlen - key->length));
@@ -970,20 +942,16 @@ static void pe_iterate_lengths(Scene *scene, ParticleSystem *psys)
}
}
/* set current distances to be kept between neighbouting keys */
-static void recalc_lengths(ParticleSystem *psys)
+static void recalc_lengths(PTCacheEdit *edit)
{
- ParticleData *pa;
- ParticleEditKey *key;
- int i, k, totpart;
+ POINT_P; KEY_K;
- if(psys==0)
+ if(edit==0)
return;
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- key= psys->edit->keys[i];
- for(k=0; k<pa->totkey-1; k++, key++) {
+ LOOP_EDITED_POINTS {
+ key= point->keys;
+ for(k=0; k<point->totkey-1; k++, key++) {
key->length= VecLenf(key->co, (key + 1)->co);
}
}
@@ -993,7 +961,7 @@ static void recalc_lengths(ParticleSystem *psys)
static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
{
DerivedMesh *dm=psys_get_modifier(ob,psys)->dm;
- ParticleEdit *edit= psys->edit;
+ PTCacheEdit *edit= psys->edit;
MFace *mface;
MVert *mvert;
float *vec, *nor;
@@ -1050,74 +1018,145 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
static void PE_update_selection(Scene *scene, Object *ob, int useflag)
{
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit= psys->edit;
ParticleEditSettings *pset= PE_settings(scene);
- ParticleSettings *part= psys->part;
- ParticleData *pa;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
HairKey *hkey;
- ParticleEditKey *key;
- float cfra= CFRA;
- int i, k, totpart;
-
- totpart= psys->totpart;
+ POINT_P; KEY_K;
/* flag all particles to be updated if not using flag */
if(!useflag)
- LOOP_PARTICLES(i, pa)
- pa->flag |= PARS_EDIT_RECALC;
+ LOOP_POINTS
+ point->flag |= PEP_EDIT_RECALC;
/* flush edit key flag to hair key flag to preserve selection
* on save */
- LOOP_PARTICLES(i, pa) {
- key= edit->keys[i];
-
- for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++)
+ if(edit->psys) LOOP_POINTS {
+ hkey = edit->psys->particles[p].hair;
+ LOOP_KEYS {
hkey->editflag= key->flag;
+ hkey++;
+ }
}
- psys_cache_paths(scene, ob, psys, CFRA, 1);
+ psys_cache_edit_paths(scene, ob, edit, CFRA);
- if(part->childtype && (pset->flag & PE_SHOW_CHILD))
- psys_cache_child_paths(scene, ob, psys, cfra, 1);
/* disable update flag */
- LOOP_PARTICLES(i, pa)
- pa->flag &= ~PARS_EDIT_RECALC;
+ LOOP_POINTS
+ point->flag &= ~PEP_EDIT_RECALC;
+}
+
+static void update_world_cos(Object *ob, PTCacheEdit *edit)
+{
+ ParticleSystem *psys = edit->psys;
+ ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
+ POINT_P; KEY_K;
+ float hairmat[4][4];
+
+ if(psys==0 || psys->edit==0)
+ return;
+
+ LOOP_POINTS {
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat);
+
+ LOOP_KEYS {
+ VECCOPY(key->world_co,key->co);
+ Mat4MulVecfl(hairmat, key->world_co);
+ }
+ }
}
+static void update_velocities(Object *ob, PTCacheEdit *edit)
+{
+ /*TODO: get frs_sec properly */
+ float vec1[3], vec2[3], frs_sec, dfra;
+ POINT_P; KEY_K;
+
+ /* hair doesn't use velocities */
+ if(edit->psys || !edit->points || !edit->points->keys->vel)
+ return;
+
+ frs_sec = edit->pid.flag & PTCACHE_VEL_PER_SEC ? 25.0f : 1.0f;
+
+ LOOP_EDITED_POINTS {
+ LOOP_KEYS {
+ if(k==0) {
+ dfra = *(key+1)->time - *key->time;
+
+ if(dfra <= 0.0f)
+ continue;
+
+ VECSUB(key->vel, (key+1)->co, key->co);
+ if(point->totkey>2) {
+ VECSUB(vec1, (key+1)->co, (key+2)->co);
+ Projf(vec2, vec1, key->vel);
+ VECSUB(vec2, vec1, vec2);
+ VECADDFAC(key->vel, key->vel, vec2, 0.5f);
+ }
+ }
+ else if(k==point->totkey-1) {
+ dfra = *key->time - *(key-1)->time;
+
+ if(dfra <= 0.0f)
+ continue;
+
+ VECSUB(key->vel, key->co, (key-1)->co);
+
+ if(point->totkey>2) {
+ VECSUB(vec1, (key-2)->co, (key-1)->co);
+ Projf(vec2, vec1, key->vel);
+ VECSUB(vec2, vec1, vec2);
+ VECADDFAC(key->vel, key->vel, vec2, 0.5f);
+ }
+ }
+ else {
+ dfra = *(key+1)->time - *(key-1)->time;
+
+ if(dfra <= 0.0f)
+ continue;
+
+ VECSUB(key->vel, (key+1)->co, (key-1)->co);
+ }
+ VecMulf(key->vel, frs_sec/dfra);
+ }
+ }
+}
void PE_update_object(Scene *scene, Object *ob, int useflag)
{
- ParticleSystem *psys= PE_get_current(scene, ob);
ParticleEditSettings *pset= PE_settings(scene);
- ParticleSettings *part= psys->part;
- ParticleData *pa;
- float cfra= CFRA;
- int i, totpart= psys->totpart;
+ PTCacheEdit *edit = PE_get_current(scene, ob);
+ POINT_P;
+
+ if(!edit)
+ return;
/* flag all particles to be updated if not using flag */
if(!useflag)
- LOOP_PARTICLES(i, pa)
- pa->flag |= PARS_EDIT_RECALC;
+ LOOP_POINTS {
+ point->flag |= PEP_EDIT_RECALC;
+ }
/* do post process on particle edit keys */
- pe_iterate_lengths(scene, psys);
- pe_deflect_emitter(scene, ob, psys);
- PE_apply_lengths(scene, psys);
+ pe_iterate_lengths(scene, edit);
+ pe_deflect_emitter(scene, ob, edit);
+ PE_apply_lengths(scene, edit);
if(pset->flag & PE_X_MIRROR)
- PE_apply_mirror(ob,psys);
- psys_update_world_cos(ob,psys);
- PE_hide_keys_time(scene, psys, cfra);
+ PE_apply_mirror(ob,edit->psys);
+ if(edit->psys)
+ update_world_cos(ob, edit);
+ if(pset->flag & PE_AUTO_VELOCITY)
+ update_velocities(ob, edit);
+ PE_hide_keys_time(scene, edit, CFRA);
/* regenerate path caches */
- psys_cache_paths(scene, ob, psys, cfra, 1);
-
- if(part->childtype && (pset->flag & PE_SHOW_CHILD))
- psys_cache_child_paths(scene, ob, psys, cfra, 1);
+ psys_cache_edit_paths(scene, ob, edit, CFRA);
/* disable update flag */
- LOOP_PARTICLES(i, pa)
- pa->flag &= ~PARS_EDIT_RECALC;
+ LOOP_POINTS {
+ point->flag &= ~PEP_EDIT_RECALC;
+ }
+
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
}
/************************************************/
@@ -1126,48 +1165,44 @@ void PE_update_object(Scene *scene, Object *ob, int useflag)
/*-----selection callbacks-----*/
-static void select_key(PEData *data, int pa_index, int key_index)
+static void select_key(PEData *data, int point_index, int key_index)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= psys->particles + pa_index;
- ParticleEditKey *key= psys->edit->keys[pa_index] + key_index;
+ PTCacheEdit *edit = data->edit;
+ PTCacheEditPoint *point = edit->points + point_index;
+ PTCacheEditKey *key = point->keys + key_index;
if(data->select)
key->flag |= PEK_SELECT;
else
key->flag &= ~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
-static void select_keys(PEData *data, int pa_index, int key_index)
+static void select_keys(PEData *data, int point_index, int key_index)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= psys->particles + pa_index;
- ParticleEditKey *key= psys->edit->keys[pa_index];
- int k;
+ PTCacheEdit *edit = data->edit;
+ PTCacheEditPoint *point = edit->points + point_index;
+ KEY_K;
- for(k=0; k<pa->totkey; k++,key++) {
+ LOOP_KEYS {
if(data->select)
key->flag |= PEK_SELECT;
else
key->flag &= ~PEK_SELECT;
}
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
-static void toggle_key_select(PEData *data, int pa_index, int key_index)
+static void toggle_key_select(PEData *data, int point_index, int key_index)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= psys->particles + pa_index;
+ PTCacheEdit *edit = data->edit;
+ PTCacheEditPoint *point = edit->points + point_index;
+ PTCacheEditKey *key = point->keys + key_index;
- if(psys->edit->keys[pa_index][key_index].flag&PEK_SELECT)
- psys->edit->keys[pa_index][key_index].flag &= ~PEK_SELECT;
- else
- psys->edit->keys[pa_index][key_index].flag |= PEK_SELECT;
-
- pa->flag |= PARS_EDIT_RECALC;
+ key->flag ^= PEK_SELECT;
+ point->flag |= PEP_EDIT_RECALC;
}
/************************ de select all operator ************************/
@@ -1176,33 +1211,24 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit= 0;
- ParticleData *pa;
- ParticleEditKey *key;
- int i, k, totpart, sel= 0;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ POINT_P; KEY_K;
+ int sel= 0;
- edit= psys->edit;
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
- LOOP_KEYS(k, key) {
- if(key->flag & PEK_SELECT) {
- sel= 1;
- key->flag &= ~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
+ LOOP_VISIBLE_POINTS {
+ LOOP_SELECTED_KEYS {
+ sel= 1;
+ key->flag &= ~PEK_SELECT;
+ point->flag |= PEP_EDIT_RECALC;
}
}
if(sel==0) {
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
- LOOP_KEYS(k, key) {
+ LOOP_VISIBLE_POINTS {
+ LOOP_KEYS {
if(!(key->flag & PEK_SELECT)) {
key->flag |= PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
}
}
@@ -1235,26 +1261,17 @@ int PE_mouse_particles(bContext *C, short *mval, int extend)
PEData data;
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit= 0;
- ParticleData *pa;
- ParticleEditKey *key;
- int i, k, totpart;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ POINT_P; KEY_K;
- if(!PE_can_edit(psys))
+ if(!PE_start_edit(edit))
return OPERATOR_CANCELLED;
- edit= psys->edit;
- totpart= psys->totpart;
-
if(!extend) {
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
- LOOP_KEYS(k, key) {
- if(key->flag & PEK_SELECT) {
- key->flag &= ~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
+ LOOP_VISIBLE_POINTS {
+ LOOP_SELECTED_KEYS {
+ key->flag &= ~PEK_SELECT;
+ point->flag |= PEP_EDIT_RECALC;
}
}
}
@@ -1273,11 +1290,9 @@ int PE_mouse_particles(bContext *C, short *mval, int extend)
/************************ select first operator ************************/
-static void select_root(PEData *data, int pa_index)
+static void select_root(PEData *data, int point_index)
{
- ParticleSystem *psys= data->psys;
-
- psys->edit->keys[pa_index]->flag |= PEK_SELECT;
+ data->edit->points[point_index].keys->flag |= PEK_SELECT;
}
static int select_first_exec(bContext *C, wmOperator *op)
@@ -1285,7 +1300,7 @@ static int select_first_exec(bContext *C, wmOperator *op)
PEData data;
PE_set_data(C, &data);
- PE_foreach_particle(&data, select_root);
+ foreach_point(&data, select_root);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob);
return OPERATOR_FINISHED;
@@ -1307,13 +1322,10 @@ void PARTICLE_OT_select_first(wmOperatorType *ot)
/************************ select last operator ************************/
-static void select_tip(PEData *data, int pa_index)
+static void select_tip(PEData *data, int point_index)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= psys->particles + pa_index;
- ParticleEditKey *key= psys->edit->keys[pa_index] + pa->totkey-1;
-
- key->flag |= PEK_SELECT;
+ PTCacheEditPoint *point = data->edit->points + point_index;
+ point->keys[point->totkey - 1].flag |= PEK_SELECT;
}
static int select_last_exec(bContext *C, wmOperator *op)
@@ -1321,7 +1333,7 @@ static int select_last_exec(bContext *C, wmOperator *op)
PEData data;
PE_set_data(C, &data);
- PE_foreach_particle(&data, select_tip);
+ foreach_point(&data, select_tip);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob);
return OPERATOR_FINISHED;
@@ -1404,10 +1416,10 @@ int PE_border_select(bContext *C, rcti *rect, int select)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
+ PTCacheEdit *edit= PE_get_current(scene, ob);
PEData data;
- if(!PE_can_edit(psys))
+ if(!PE_start_edit(edit))
return OPERATOR_CANCELLED;
PE_set_view3d_data(C, &data);
@@ -1428,10 +1440,10 @@ int PE_circle_select(bContext *C, int selecting, short *mval, float rad)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
+ PTCacheEdit *edit= PE_get_current(scene, ob);
PEData data;
- if(!PE_can_edit(psys))
+ if(!PE_start_edit(edit))
return OPERATOR_FINISHED;
PE_set_view3d_data(C, &data);
@@ -1454,47 +1466,42 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select)
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
ARegion *ar= CTX_wm_region(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleSystemModifierData *psmd;
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
ParticleEditSettings *pset= PE_settings(scene);
+ PTCacheEdit *edit = PE_get_current(scene, ob);
+ ParticleSystem *psys = edit->psys;
+ ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
+ POINT_P; KEY_K;
float co[3], mat[4][4];
short vertco[2];
- int i, k, totpart;
- if(!PE_can_edit(psys))
+ if(!PE_start_edit(edit))
return OPERATOR_CANCELLED;
- psmd= psys_get_modifier(ob, psys);
- edit= psys->edit;
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
+ Mat4One(mat);
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
+ LOOP_VISIBLE_POINTS {
+ if(edit->psys)
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + p, mat);
if(pset->selectmode==SCE_SELECT_POINT) {
- LOOP_KEYS(k, key) {
+ LOOP_KEYS {
VECCOPY(co, key->co);
Mat4MulVecfl(mat, co);
project_short(ar, co, vertco);
if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1])) {
if(select && !(key->flag & PEK_SELECT)) {
key->flag |= PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
else if(key->flag & PEK_SELECT) {
key->flag &= ~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
}
}
}
else if(pset->selectmode==SCE_SELECT_END) {
- key= edit->keys[i] + pa->totkey - 1;
+ key= point->keys + point->totkey - 1;
VECCOPY(co, key->co);
Mat4MulVecfl(mat, co);
@@ -1502,11 +1509,11 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select)
if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1])) {
if(select && !(key->flag & PEK_SELECT)) {
key->flag |= PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
else if(key->flag & PEK_SELECT) {
key->flag &= ~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
}
}
@@ -1524,35 +1531,25 @@ static int hide_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
Scene *scene= CTX_data_scene(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit;
- ParticleEditKey *key;
- ParticleData *pa;
- int i, k, totpart;
-
- edit= psys->edit;
- totpart= psys->totpart;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ POINT_P; KEY_K;
if(RNA_enum_get(op->ptr, "unselected")) {
- LOOP_PARTICLES(i, pa) {
- if(!particle_is_selected(psys, pa)) {
- pa->flag |= PARS_HIDE;
- pa->flag |= PARS_EDIT_RECALC;
+ LOOP_UNSELECTED_POINTS {
+ point->flag |= PEP_HIDE;
+ point->flag |= PEP_EDIT_RECALC;
- LOOP_KEYS(k, key)
- key->flag &= ~PEK_SELECT;
- }
+ LOOP_KEYS
+ key->flag &= ~PEK_SELECT;
}
}
else {
- LOOP_PARTICLES(i, pa) {
- if(particle_is_selected(psys, pa)) {
- pa->flag |= PARS_HIDE;
- pa->flag |= PARS_EDIT_RECALC;
+ LOOP_SELECTED_POINTS {
+ point->flag |= PEP_HIDE;
+ point->flag |= PEP_EDIT_RECALC;
- LOOP_KEYS(k, key)
- key->flag &= ~PEK_SELECT;
- }
+ LOOP_KEYS
+ key->flag &= ~PEK_SELECT;
}
}
@@ -1585,21 +1582,15 @@ static int reveal_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
Scene *scene= CTX_data_scene(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit;
- ParticleEditKey *key;
- ParticleData *pa;
- int i, k, totpart;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ POINT_P; KEY_K;
- edit= psys->edit;
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) {
- pa->flag &= ~PARS_HIDE;
- pa->flag |= PARS_EDIT_RECALC;
+ LOOP_POINTS {
+ if(point->flag & PEP_HIDE) {
+ point->flag &= ~PEP_HIDE;
+ point->flag |= PEP_EDIT_RECALC;
- LOOP_KEYS(k, key)
+ LOOP_KEYS
key->flag |= PEK_SELECT;
}
}
@@ -1626,34 +1617,30 @@ void PARTICLE_OT_reveal(wmOperatorType *ot)
/************************ select less operator ************************/
-static void select_less_keys(PEData *data, int pa_index)
+static void select_less_keys(PEData *data, int point_index)
{
- ParticleSystem *psys= data->psys;
- ParticleEdit *edit= psys->edit;
- ParticleData *pa= &psys->particles[pa_index];
- ParticleEditKey *key;
- int k;
-
- for(k=0,key=edit->keys[pa_index]; k<pa->totkey; k++,key++) {
- if((key->flag & PEK_SELECT)==0) continue;
+ PTCacheEdit *edit= data->edit;
+ PTCacheEditPoint *point = edit->points + point_index;
+ KEY_K;
+ LOOP_SELECTED_KEYS {
if(k==0) {
if(((key+1)->flag&PEK_SELECT)==0)
- key->flag |= PEK_TO_SELECT;
+ key->flag |= PEK_TAG;
}
- else if(k==pa->totkey-1) {
+ else if(k==point->totkey-1) {
if(((key-1)->flag&PEK_SELECT)==0)
- key->flag |= PEK_TO_SELECT;
+ key->flag |= PEK_TAG;
}
else {
if((((key-1)->flag & (key+1)->flag) & PEK_SELECT)==0)
- key->flag |= PEK_TO_SELECT;
+ key->flag |= PEK_TAG;
}
}
- for(k=0,key=edit->keys[pa_index]; k<pa->totkey; k++,key++) {
- if(key->flag&PEK_TO_SELECT)
- key->flag &= ~(PEK_TO_SELECT|PEK_SELECT);
+ LOOP_KEYS {
+ if(key->flag&PEK_TAG)
+ key->flag &= ~(PEK_TAG|PEK_SELECT);
}
}
@@ -1662,7 +1649,7 @@ static int select_less_exec(bContext *C, wmOperator *op)
PEData data;
PE_set_data(C, &data);
- PE_foreach_particle(&data, select_less_keys);
+ foreach_point(&data, select_less_keys);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob);
return OPERATOR_FINISHED;
@@ -1684,34 +1671,32 @@ void PARTICLE_OT_select_less(wmOperatorType *ot)
/************************ select more operator ************************/
-static void select_more_keys(PEData *data, int pa_index)
+static void select_more_keys(PEData *data, int point_index)
{
- ParticleSystem *psys= data->psys;
- ParticleEdit *edit= psys->edit;
- ParticleData *pa= &psys->particles[pa_index];
- ParticleEditKey *key;
- int k;
+ PTCacheEdit *edit= data->edit;
+ PTCacheEditPoint *point = edit->points + point_index;
+ KEY_K;
- for(k=0,key=edit->keys[pa_index]; k<pa->totkey; k++,key++) {
+ LOOP_KEYS {
if(key->flag & PEK_SELECT) continue;
if(k==0) {
if((key+1)->flag&PEK_SELECT)
- key->flag |= PEK_TO_SELECT;
+ key->flag |= PEK_TAG;
}
- else if(k==pa->totkey-1) {
+ else if(k==point->totkey-1) {
if((key-1)->flag&PEK_SELECT)
- key->flag |= PEK_TO_SELECT;
+ key->flag |= PEK_TAG;
}
else {
if(((key-1)->flag | (key+1)->flag) & PEK_SELECT)
- key->flag |= PEK_TO_SELECT;
+ key->flag |= PEK_TAG;
}
}
- for(k=0,key=edit->keys[pa_index]; k<pa->totkey; k++,key++) {
- if(key->flag&PEK_TO_SELECT) {
- key->flag &= ~PEK_TO_SELECT;
+ LOOP_KEYS {
+ if(key->flag&PEK_TAG) {
+ key->flag &= ~PEK_TAG;
key->flag |= PEK_SELECT;
}
}
@@ -1722,7 +1707,7 @@ static int select_more_exec(bContext *C, wmOperator *op)
PEData data;
PE_set_data(C, &data);
- PE_foreach_particle(&data, select_more_keys);
+ foreach_point(&data, select_more_keys);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob);
return OPERATOR_FINISHED;
@@ -1746,12 +1731,13 @@ void PARTICLE_OT_select_more(wmOperatorType *ot)
static void rekey_particle(PEData *data, int pa_index)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= &psys->particles[pa_index];
- ParticleEdit *edit= psys->edit;
+ PTCacheEdit *edit= data->edit;
+ ParticleSystem *psys= edit->psys;
+ ParticleData *pa= psys->particles + pa_index;
+ PTCacheEditPoint *point = edit->points + pa_index;
ParticleKey state;
HairKey *key, *new_keys;
- ParticleEditKey *ekey;
+ PTCacheEditKey *ekey;
float dval, sta, end;
int k;
@@ -1780,19 +1766,21 @@ static void rekey_particle(PEData *data, int pa_index)
MEM_freeN(pa->hair);
pa->hair= new_keys;
- pa->totkey=data->totrekey;
+ point->totkey=pa->totkey=data->totrekey;
- if(edit->keys[pa_index])
- MEM_freeN(edit->keys[pa_index]);
- ekey= edit->keys[pa_index]= MEM_callocN(pa->totkey * sizeof(ParticleEditKey),"Hair re-key edit keys");
+
+ if(point->keys)
+ MEM_freeN(point->keys);
+ ekey= point->keys= MEM_callocN(pa->totkey * sizeof(PTCacheEditKey),"Hair re-key edit keys");
for(k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) {
ekey->co= key->co;
ekey->time= &key->time;
+ ekey->flag |= PEK_USE_WCO;
}
pa->flag &= ~PARS_REKEY;
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
static int rekey_exec(bContext *C, wmOperator *op)
@@ -1804,11 +1792,9 @@ static int rekey_exec(bContext *C, wmOperator *op)
data.dval= 1.0f / (float)(data.totrekey-1);
data.totrekey= RNA_int_get(op->ptr, "keys");
- foreach_selected_particle(&data, rekey_particle);
-
- data.psys->edit->totkeys= psys_count_keys(data.psys);
- recalc_lengths(data.psys);
+ foreach_selected_point(&data, rekey_particle);
+ recalc_lengths(data.edit);
PE_update_object(data.scene, data.ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob);
@@ -1835,19 +1821,19 @@ void PARTICLE_OT_rekey(wmOperatorType *ot)
static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float path_time)
{
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit=0;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ ParticleSystem *psys;
ParticleData *pa;
ParticleKey state;
HairKey *new_keys, *key;
- ParticleEditKey *ekey;
+ PTCacheEditKey *ekey;
int k;
- if(psys==0) return;
+ if(!edit || !edit->psys) return;
- edit= psys->edit;
+ psys = edit->psys;
- pa= &psys->particles[pa_index];
+ pa= psys->particles + pa_index;
pa->flag |= PARS_REKEY;
@@ -1866,7 +1852,7 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float
pa->hair= new_keys;
/* update edit pointers */
- for(k=0, key=pa->hair, ekey=edit->keys[pa_index]; k<pa->totkey; k++, key++, ekey++) {
+ for(k=0, key=pa->hair, ekey=edit->points[pa_index].keys; k<pa->totkey; k++, key++, ekey++) {
ekey->co= key->co;
ekey->time= &key->time;
}
@@ -1878,10 +1864,11 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float
static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psys)
{
- ParticleEdit *edit= psys->edit;
+ PTCacheEdit *edit = psys->edit;
ParticleEditSettings *pset= PE_settings(scene);
ParticleData *pa, *npa=0, *new_pars=0;
- ParticleEditKey **key, **nkey=0, **new_keys=0;
+ POINT_P;
+ PTCacheEditPoint *npoint=0, *new_points=0;
ParticleSystemModifierData *psmd;
int i, totpart, new_totpart= psys->totpart, removed= 0;
@@ -1890,55 +1877,51 @@ static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psy
psmd= psys_get_modifier(ob, psys);
totpart= psys->totpart;
- LOOP_PARTICLES(i, pa)
- if(pa->flag & PARS_TAG)
- PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
+ LOOP_TAGGED_POINTS {
+ PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL);
+ }
}
- for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
- if(pa->flag & PARS_TAG) {
- new_totpart--;
- removed++;
- }
+ LOOP_TAGGED_POINTS {
+ new_totpart--;
+ removed++;
}
if(new_totpart != psys->totpart) {
if(new_totpart) {
npa= new_pars= MEM_callocN(new_totpart * sizeof(ParticleData), "ParticleData array");
- nkey= new_keys= MEM_callocN(new_totpart * sizeof(ParticleEditKey *), "ParticleEditKey array");
+ npoint= new_points= MEM_callocN(new_totpart * sizeof(PTCacheEditPoint), "PTCacheEditKey array");
}
pa= psys->particles;
- key= edit->keys;
- for(i=0; i<psys->totpart; i++, pa++, key++) {
- if(pa->flag & PARS_TAG) {
- if(*key)
- MEM_freeN(*key);
+ point= edit->points;
+ for(i=0; i<psys->totpart; i++, pa++, point++) {
+ if(point->flag & PEP_TAG) {
+ if(point->keys)
+ MEM_freeN(point->keys);
if(pa->hair)
MEM_freeN(pa->hair);
}
else {
memcpy(npa, pa, sizeof(ParticleData));
- memcpy(nkey, key, sizeof(ParticleEditKey*));
+ memcpy(npoint, point, sizeof(PTCacheEditPoint));
npa++;
- nkey++;
+ npoint++;
}
}
if(psys->particles) MEM_freeN(psys->particles);
psys->particles= new_pars;
- if(edit->keys) MEM_freeN(edit->keys);
- edit->keys= new_keys;
+ if(edit->points) MEM_freeN(edit->points);
+ edit->points= new_points;
if(edit->mirror_cache) {
MEM_freeN(edit->mirror_cache);
edit->mirror_cache= NULL;
}
- psys->totpart= new_totpart;
-
- edit->totkeys= psys_count_keys(psys);
+ edit->totpoint= psys->totpart= new_totpart;
}
return removed;
@@ -1946,84 +1929,82 @@ static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psy
static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys)
{
- ParticleEdit *edit= psys->edit;
+ PTCacheEdit *edit= psys->edit;
ParticleEditSettings *pset= PE_settings(scene);
ParticleData *pa;
- HairKey *key, *nkey, *new_keys=0;
- ParticleEditKey *ekey;
+ HairKey *hkey, *nhkey, *new_hkeys=0;
+ POINT_P; KEY_K;
ParticleSystemModifierData *psmd;
- int i, k, totpart= psys->totpart;
short new_totkey;
if(pset->flag & PE_X_MIRROR) {
/* mirror key tags */
psmd= psys_get_modifier(ob, psys);
- LOOP_PARTICLES(i, pa) {
- LOOP_KEYS(k,ekey) {
- if(ekey->flag & PEK_TAG) {
- PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
- break;
- }
+ LOOP_POINTS {
+ LOOP_TAGGED_KEYS {
+ PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL);
+ break;
}
}
}
- LOOP_PARTICLES(i, pa) {
- new_totkey= pa->totkey;
- LOOP_KEYS(k,ekey) {
- if(ekey->flag & PEK_TAG)
- new_totkey--;
+ LOOP_POINTS {
+ new_totkey= point->totkey;
+ LOOP_TAGGED_KEYS {
+ new_totkey--;
}
/* we can't have elements with less than two keys*/
if(new_totkey < 2)
- pa->flag |= PARS_TAG;
+ point->flag |= PEP_TAG;
}
remove_tagged_particles(scene, ob, psys);
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
+ LOOP_POINTS {
+ pa = psys->particles + p;
new_totkey= pa->totkey;
- LOOP_KEYS(k,ekey) {
- if(ekey->flag & PEK_TAG)
- new_totkey--;
+
+ LOOP_TAGGED_KEYS {
+ new_totkey--;
}
+
if(new_totkey != pa->totkey) {
- key= pa->hair;
- nkey= new_keys= MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys");
+ hkey= pa->hair;
+ nhkey= new_hkeys= MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys");
- for(k=0, ekey=edit->keys[i]; k<new_totkey; k++, key++, nkey++, ekey++) {
- while(ekey->flag & PEK_TAG && key < pa->hair + pa->totkey) {
+ LOOP_KEYS {
+ while(key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) {
key++;
- ekey++;
+ hkey++;
}
- if(key < pa->hair + pa->totkey) {
- VECCOPY(nkey->co, key->co);
- nkey->time= key->time;
- nkey->weight= key->weight;
+ if(hkey < pa->hair + pa->totkey) {
+ VECCOPY(nhkey->co, hkey->co);
+ nhkey->time= hkey->time;
+ nhkey->weight= hkey->weight;
}
+ hkey++;
+ nhkey++;
}
if(pa->hair)
MEM_freeN(pa->hair);
- pa->hair= new_keys;
+ pa->hair= new_hkeys;
- pa->totkey=new_totkey;
+ point->totkey= pa->totkey= new_totkey;
- if(edit->keys[i])
- MEM_freeN(edit->keys[i]);
- ekey= edit->keys[i]= MEM_callocN(new_totkey*sizeof(ParticleEditKey), "particle edit keys");
+ if(point->keys)
+ MEM_freeN(point->keys);
+ key= point->keys= MEM_callocN(new_totkey*sizeof(PTCacheEditKey), "particle edit keys");
- for(k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) {
- ekey->co= key->co;
- ekey->time= &key->time;
+ hkey = pa->hair;
+ LOOP_KEYS {
+ key->co= hkey->co;
+ key->time= &hkey->time;
+ hkey++;
}
}
}
-
- edit->totkeys= psys_count_keys(psys);
}
/************************ subdivide opertor *********************/
@@ -2031,19 +2012,19 @@ static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys)
/* works like normal edit mode subdivide, inserts keys between neighbouring selected keys */
static void subdivide_particle(PEData *data, int pa_index)
{
- ParticleSystem *psys= data->psys;
- ParticleEdit *edit= psys->edit;
- ParticleData *pa= &psys->particles[pa_index];
-
+ PTCacheEdit *edit= data->edit;
+ ParticleSystem *psys= edit->psys;
+ ParticleData *pa= psys->particles + pa_index;
+ PTCacheEditPoint *point = edit->points + pa_index;
ParticleKey state;
HairKey *key, *nkey, *new_keys;
- ParticleEditKey *ekey, *nekey, *new_ekeys;
+ PTCacheEditKey *ekey, *nekey, *new_ekeys;
int k;
short totnewkey=0;
float endtime;
- for(k=0, ekey=edit->keys[pa_index]; k<pa->totkey-1; k++,ekey++) {
+ for(k=0, ekey=point->keys; k<pa->totkey-1; k++,ekey++) {
if(ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT)
totnewkey++;
}
@@ -2053,13 +2034,13 @@ static void subdivide_particle(PEData *data, int pa_index)
pa->flag |= PARS_REKEY;
nkey= new_keys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)),"Hair subdivide keys");
- nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(ParticleEditKey)),"Hair subdivide edit keys");
+ nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(PTCacheEditKey)),"Hair subdivide edit keys");
endtime= pa->hair[pa->totkey-1].time;
- for(k=0, key=pa->hair, ekey=edit->keys[pa_index]; k<pa->totkey-1; k++, key++, ekey++) {
+ for(k=0, key=pa->hair, ekey=point->keys; k<pa->totkey-1; k++, key++, ekey++) {
memcpy(nkey,key,sizeof(HairKey));
- memcpy(nekey,ekey,sizeof(ParticleEditKey));
+ memcpy(nekey,ekey,sizeof(PTCacheEditKey));
nekey->co= nkey->co;
nekey->time= &nkey->time;
@@ -2075,7 +2056,7 @@ static void subdivide_particle(PEData *data, int pa_index)
nekey->co= nkey->co;
nekey->time= &nkey->time;
- nekey->flag |= PEK_SELECT;
+ nekey->flag |= (PEK_SELECT|PEK_USE_WCO);
nekey++;
nkey++;
@@ -2083,7 +2064,7 @@ static void subdivide_particle(PEData *data, int pa_index)
}
/*tip still not copied*/
memcpy(nkey,key,sizeof(HairKey));
- memcpy(nekey,ekey,sizeof(ParticleEditKey));
+ memcpy(nekey,ekey,sizeof(PTCacheEditKey));
nekey->co= nkey->co;
nekey->time= &nkey->time;
@@ -2092,13 +2073,12 @@ static void subdivide_particle(PEData *data, int pa_index)
MEM_freeN(pa->hair);
pa->hair= new_keys;
- if(edit->keys[pa_index])
- MEM_freeN(edit->keys[pa_index]);
-
- edit->keys[pa_index]= new_ekeys;
+ if(point->keys)
+ MEM_freeN(point->keys);
+ point->keys= new_ekeys;
- pa->totkey += totnewkey;
- pa->flag |= PARS_EDIT_RECALC;
+ point->totkey = pa->totkey = pa->totkey + totnewkey;
+ point->flag |= PEP_EDIT_RECALC;
pa->flag &= ~PARS_REKEY;
}
@@ -2107,13 +2087,9 @@ static int subdivide_exec(bContext *C, wmOperator *op)
PEData data;
PE_set_data(C, &data);
- PE_foreach_particle(&data, subdivide_particle);
+ foreach_point(&data, subdivide_particle);
- data.psys->edit->totkeys= psys_count_keys(data.psys);
-
- recalc_lengths(data.psys);
- psys_update_world_cos(data.ob, data.psys);
-
+ recalc_lengths(data.edit);
PE_update_object(data.scene, data.ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob);
@@ -2140,15 +2116,15 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
ParticleEditSettings *pset=PE_settings(scene);
- ParticleData *pa;
- ParticleEdit *edit;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ ParticleSystem *psys = edit->psys;
ParticleSystemModifierData *psmd;
KDTree *tree;
KDTreeNearest nearest[10];
+ POINT_P;
float mat[4][4], co[3], threshold= RNA_float_get(op->ptr, "threshold");
- int i, n, totn, removed, totpart, flag, totremoved;
+ int n, totn, removed, flag, totremoved;
edit= psys->edit;
psmd= psys_get_modifier(ob, psys);
@@ -2157,37 +2133,32 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
do {
removed= 0;
- totpart= psys->totpart;
- tree=BLI_kdtree_new(totpart);
+ tree=BLI_kdtree_new(psys->totpart);
/* insert particles into kd tree */
- LOOP_PARTICLES(i, pa) {
- if(particle_is_selected(psys, pa)) {
- psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat);
- VECCOPY(co, pa->hair[0].co);
- Mat4MulVecfl(mat, co);
- BLI_kdtree_insert(tree, i, co, NULL);
- }
+ LOOP_SELECTED_POINTS {
+ psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles+p, mat);
+ VECCOPY(co, point->keys->co);
+ Mat4MulVecfl(mat, co);
+ BLI_kdtree_insert(tree, p, co, NULL);
}
BLI_kdtree_balance(tree);
/* tag particles to be removed */
- LOOP_PARTICLES(i, pa) {
- if(particle_is_selected(psys, pa)) {
- psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat);
- VECCOPY(co, pa->hair[0].co);
- Mat4MulVecfl(mat, co);
+ LOOP_SELECTED_POINTS {
+ psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles+p, mat);
+ VECCOPY(co, point->keys->co);
+ Mat4MulVecfl(mat, co);
- totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest);
+ totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest);
- for(n=0; n<totn; n++) {
- /* this needs a custom threshold still */
- if(nearest[n].index > i && nearest[n].dist < threshold) {
- if(!(pa->flag & PARS_TAG)) {
- pa->flag |= PARS_TAG;
- removed++;
- }
+ for(n=0; n<totn; n++) {
+ /* this needs a custom threshold still */
+ if(nearest[n].index > p && nearest[n].dist < threshold) {
+ if(!(point->flag & PEP_TAG)) {
+ point->flag |= PEP_TAG;
+ removed++;
}
}
}
@@ -2208,7 +2179,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved);
- psys_update_world_cos(ob, psys);
+ PE_update_object(scene, ob, 0);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
@@ -2269,7 +2240,7 @@ static void toggle_particle_cursor(bContext *C, int enable)
pset->paintcursor = NULL;
}
else if(enable)
- pset->paintcursor= WM_paint_cursor_activate(CTX_wm_manager(C), PE_poll, brush_drawcursor, NULL);
+ pset->paintcursor= WM_paint_cursor_activate(CTX_wm_manager(C), PE_poll_3dview, brush_drawcursor, NULL);
}
/********************* radial control operator *********************/
@@ -2355,16 +2326,16 @@ static EnumPropertyItem delete_type_items[]= {
static void set_delete_particle(PEData *data, int pa_index)
{
- ParticleSystem *psys= data->psys;
+ PTCacheEdit *edit= data->edit;
- psys->particles[pa_index].flag |= PARS_TAG;
+ edit->points[pa_index].flag |= PEP_TAG;
}
static void set_delete_particle_key(PEData *data, int pa_index, int key_index)
{
- ParticleSystem *psys= data->psys;
+ PTCacheEdit *edit= data->edit;
- psys->edit->keys[pa_index][key_index].flag |= PEK_TAG;
+ edit->points[pa_index].keys[key_index].flag |= PEK_TAG;
}
static int delete_exec(bContext *C, wmOperator *op)
@@ -2376,15 +2347,17 @@ static int delete_exec(bContext *C, wmOperator *op)
if(type == DEL_KEY) {
foreach_selected_key(&data, set_delete_particle_key);
- remove_tagged_keys(data.scene, data.ob, data.psys);
- recalc_lengths(data.psys);
+ remove_tagged_keys(data.scene, data.ob, data.edit->psys);
+ recalc_lengths(data.edit);
}
else if(type == DEL_PARTICLE) {
- foreach_selected_particle(&data, set_delete_particle);
- remove_tagged_particles(data.scene, data.ob, data.psys);
- recalc_lengths(data.psys);
+ foreach_selected_point(&data, set_delete_particle);
+ remove_tagged_particles(data.scene, data.ob, data.edit->psys);
+ recalc_lengths(data.edit);
}
+ PE_update_object(data.scene, data.ob, 0);
+
DAG_object_flush_update(data.scene, data.ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob);
@@ -2415,15 +2388,15 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
{
Mesh *me= (Mesh*)(ob->data);
ParticleSystemModifierData *psmd;
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ ParticleSystem *psys = edit->psys;
ParticleData *pa, *newpa, *new_pars;
- ParticleEditKey *ekey, **newkey, **key, **new_keys;
+ PTCacheEditPoint *newpoint, *new_points;
+ POINT_P; KEY_K;
HairKey *hkey;
int *mirrorfaces;
- int i, k, rotation, totpart, newtotpart;
+ int rotation, totpart, newtotpart;
- edit= psys->edit;
psmd= psys_get_modifier(ob, psys);
mirrorfaces= mesh_get_x_mirror_faces(ob, NULL);
@@ -2433,29 +2406,28 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
totpart= psys->totpart;
newtotpart= psys->totpart;
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
-
+ LOOP_VISIBLE_POINTS {
+ pa = psys->particles + p;
if(!tagged) {
- if(particle_is_selected(psys, pa)) {
- if(edit->mirror_cache[i] != -1) {
+ if(point_is_selected(point)) {
+ if(edit->mirror_cache[p] != -1) {
/* already has a mirror, don't need to duplicate */
PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
continue;
}
else
- pa->flag |= PARS_TAG;
+ point->flag |= PEP_TAG;
}
}
- if((pa->flag & PARS_TAG) && mirrorfaces[pa->num*2] != -1)
+ if((point->flag & PEP_TAG) && mirrorfaces[pa->num*2] != -1)
newtotpart++;
}
if(newtotpart != psys->totpart) {
/* allocate new arrays and copy existing */
new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new");
- new_keys= MEM_callocN(newtotpart*sizeof(ParticleEditKey*), "ParticleEditKey new");
+ new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint), "PTCacheEditPoint new");
if(psys->particles) {
memcpy(new_pars, psys->particles, totpart*sizeof(ParticleData));
@@ -2463,36 +2435,35 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
}
psys->particles= new_pars;
- if(edit->keys) {
- memcpy(new_keys, edit->keys, totpart*sizeof(ParticleEditKey*));
- MEM_freeN(edit->keys);
+ if(edit->points) {
+ memcpy(new_points, edit->points, totpart*sizeof(PTCacheEditPoint));
+ MEM_freeN(edit->points);
}
- edit->keys= new_keys;
+ edit->points= new_points;
if(edit->mirror_cache) {
MEM_freeN(edit->mirror_cache);
edit->mirror_cache= NULL;
}
- psys->totpart= newtotpart;
+ edit->totpoint= psys->totpart= newtotpart;
/* create new elements */
- pa= psys->particles;
newpa= psys->particles + totpart;
- key= edit->keys;
- newkey= edit->keys + totpart;
+ newpoint= edit->points + totpart;
- for(i=0; i<totpart; i++, pa++, key++) {
- if(pa->flag & PARS_HIDE) continue;
+ LOOP_VISIBLE_POINTS {
+ pa = psys->particles + p;
- if(!(pa->flag & PARS_TAG) || mirrorfaces[pa->num*2] == -1)
+ if(!(point->flag & PEP_TAG) || mirrorfaces[pa->num*2] == -1)
continue;
/* duplicate */
*newpa= *pa;
+ *newpoint= *point;
if(pa->hair) newpa->hair= MEM_dupallocN(pa->hair);
if(pa->keys) newpa->keys= MEM_dupallocN(pa->keys);
- if(*key) *newkey= MEM_dupallocN(*key);
+ if(point->keys) newpoint->keys= MEM_dupallocN(point->keys);
/* rotate weights according to vertex index rotation */
rotation= mirrorfaces[pa->num*2+1];
@@ -2511,24 +2482,23 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL);
/* update edit key pointers */
- ekey= *newkey;
- for(k=0, hkey=newpa->hair; k<newpa->totkey; k++, hkey++, ekey++) {
- ekey->co= hkey->co;
- ekey->time= &hkey->time;
+ key= newpoint->keys;
+ for(k=0, hkey=newpa->hair; k<newpa->totkey; k++, hkey++, key++) {
+ key->co= hkey->co;
+ key->time= &hkey->time;
}
/* map key positions as mirror over x axis */
PE_mirror_particle(ob, psmd->dm, psys, pa, newpa);
newpa++;
- newkey++;
+ newpoint++;
}
-
- edit->totkeys= psys_count_keys(psys);
}
- for(pa=psys->particles, i=0; i<psys->totpart; i++, pa++)
- pa->flag &= ~PARS_TAG;
+ LOOP_POINTS {
+ point->flag &= ~PEP_TAG;
+ }
MEM_freeN(mirrorfaces);
}
@@ -2537,11 +2507,11 @@ static int mirror_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
+ PTCacheEdit *edit= PE_get_current(scene, ob);
PE_mirror_x(scene, ob, 0);
- psys_update_world_cos(ob, psys);
+ update_world_cos(ob, edit);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
@@ -2568,7 +2538,6 @@ static EnumPropertyItem brush_type_items[]= {
{PE_BRUSH_NONE, "NONE", 0, "None", ""},
{PE_BRUSH_COMB, "COMB", 0, "Comb", ""},
{PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", ""},
- {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", ""},
{PE_BRUSH_ADD, "ADD", 0, "Add", ""},
{PE_BRUSH_LENGTH, "LENGTH", 0, "Length", ""},
{PE_BRUSH_PUFF, "PUFF", 0, "Puff", ""},
@@ -2601,14 +2570,46 @@ void PARTICLE_OT_brush_set(wmOperatorType *ot)
RNA_def_enum(ot->srna, "type", brush_type_items, PE_BRUSH_NONE, "Type", "Brush type to select for editing.");
}
+
+/*********************** set mode operator **********************/
+
+static EnumPropertyItem edit_type_items[]= {
+ {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
+ {PE_TYPE_SOFTBODY, "SOFTBODY", 0, "Soft body", ""},
+ {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static int set_edit_mode_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ ParticleEditSettings *pset= PE_settings(scene);
+
+ pset->edittype= RNA_enum_get(op->ptr, "type");
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_edit_type_set(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Set Brush";
+ ot->idname= "PARTICLE_OT_edit_type_set";
+
+ /* api callbacks */
+ ot->exec= set_brush_exec;
+ ot->invoke= WM_menu_invoke;
+ ot->poll= PE_poll;
+
+ /* properties */
+ RNA_def_enum(ot->srna, "type", edit_type_items, PE_TYPE_PARTICLES, "Type", "Edit type to select for editing.");
+}
+
/************************* brush edit callbacks ********************/
-static void brush_comb(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index)
+static void brush_comb(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= &psys->particles[pa_index];
ParticleEditSettings *pset= PE_settings(data->scene);
- HairKey *key= pa->hair + key_index;
float cvec[3], fac;
if(pset->flag & PE_LOCK_FIRST && key_index == 0) return;
@@ -2620,19 +2621,21 @@ static void brush_comb(PEData *data, float mat[][4], float imat[][4], int pa_ind
VecMulf(cvec, fac);
VECADD(key->co, key->co, cvec);
- pa->flag |= PARS_EDIT_RECALC;
+ (data->edit->points + point_index)->flag |= PEP_EDIT_RECALC;
}
static void brush_cut(PEData *data, int pa_index)
{
- ParticleSystem *psys= data->psys;
+ PTCacheEdit *edit = data->edit;
+ ParticleSystem *psys= edit->psys;
ARegion *ar= data->vc.ar;
Object *ob= data->ob;
+ ParticleEditSettings *pset= PE_settings(data->scene);
ParticleData *pa= &psys->particles[pa_index];
- ParticleCacheKey *key= psys->pathcache[pa_index];
+ ParticleCacheKey *key= edit->pathcache[pa_index];
float rad2, cut_time= 1.0;
float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv;
- int k, cut, keys= (int)pow(2.0, (double)psys->part->draw_step);
+ int k, cut, keys= (int)pow(2.0, (double)pset->draw_step);
short vertco[2];
/* blunt scissors */
@@ -2707,93 +2710,97 @@ static void brush_cut(PEData *data, int pa_index)
if(cut) {
if(cut_time < 0.0f) {
- pa->flag |= PARS_TAG;
+ edit->points[pa_index].flag |= PEP_TAG;
}
else {
rekey_particle_to_time(data->scene, ob, pa_index, cut_time);
- pa->flag |= PARS_EDIT_RECALC;
+ edit->points[pa_index].flag |= PEP_EDIT_RECALC;
}
}
}
-static void brush_length(PEData *data, int pa_index)
+static void brush_length(PEData *data, int point_index)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= &psys->particles[pa_index];
- HairKey *key;
+ PTCacheEdit *edit= data->edit;
+ PTCacheEditPoint *point = edit->points + point_index;
+ KEY_K;
float dvec[3],pvec[3];
- int k;
- key= pa->hair;
- VECCOPY(pvec,key->co);
-
- for(k=1, key++; k<pa->totkey; k++,key++) {
- VECSUB(dvec,key->co,pvec);
- VECCOPY(pvec,key->co);
- VecMulf(dvec,data->growfac);
- VECADD(key->co,(key-1)->co,dvec);
+ LOOP_KEYS {
+ if(k==0) {
+ VECCOPY(pvec,key->co);
+ }
+ else {
+ VECSUB(dvec,key->co,pvec);
+ VECCOPY(pvec,key->co);
+ VecMulf(dvec,data->growfac);
+ VECADD(key->co,(key-1)->co,dvec);
+ }
}
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
-static void brush_puff(PEData *data, int pa_index)
+static void brush_puff(PEData *data, int point_index)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= &psys->particles[pa_index];
- ParticleEdit *edit= psys->edit;
- HairKey *key;
+ PTCacheEdit *edit = data->edit;
+ ParticleSystem *psys = edit->psys;
+ PTCacheEditPoint *point = edit->points + point_index;
+ KEY_K;
float mat[4][4], imat[4][4];
float lastco[3], rootco[3], co[3], nor[3], kco[3], dco[3], fac, length;
- int k;
-
- psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, pa, mat);
- Mat4Invert(imat,mat);
- /* find root coordinate and normal on emitter */
- key= pa->hair;
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
+ if(psys) {
+ psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, psys->particles + point_index, mat);
+ Mat4Invert(imat,mat);
+ }
+ else {
+ Mat4One(mat);
+ Mat4One(imat);
+ }
- pa_index= BLI_kdtree_find_nearest(edit->emitter_field, co, NULL, NULL);
- if(pa_index == -1) return;
+ LOOP_KEYS {
+ if(k==0) {
+ /* find root coordinate and normal on emitter */
+ VECCOPY(co, key->co);
+ Mat4MulVecfl(mat, co);
- VECCOPY(rootco, co);
- VecCopyf(nor, &psys->edit->emitter_cosnos[pa_index*6+3]);
- Normalize(nor);
- length= 0.0f;
+ point_index= BLI_kdtree_find_nearest(edit->emitter_field, co, NULL, NULL);
+ if(point_index == -1) return;
- fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->pufffac);
- fac *= 0.025f;
- if(data->invert)
- fac= -fac;
+ VECCOPY(rootco, co);
+ VecCopyf(nor, &edit->emitter_cosnos[point_index*6+3]);
+ Normalize(nor);
+ length= 0.0f;
- for(k=1, key++; k<pa->totkey; k++, key++) {
- /* compute position as if hair was standing up straight */
- VECCOPY(lastco, co);
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
- length += VecLenf(lastco, co);
+ fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->pufffac);
+ fac *= 0.025f;
+ if(data->invert)
+ fac= -fac;
+ }
+ else {
+ /* compute position as if hair was standing up straight */
+ VECCOPY(lastco, co);
+ VECCOPY(co, key->co);
+ Mat4MulVecfl(mat, co);
+ length += VecLenf(lastco, co);
- VECADDFAC(kco, rootco, nor, length);
+ VECADDFAC(kco, rootco, nor, length);
- /* blend between the current and straight position */
- VECSUB(dco, kco, co);
- VECADDFAC(co, co, dco, fac);
+ /* blend between the current and straight position */
+ VECSUB(dco, kco, co);
+ VECADDFAC(co, co, dco, fac);
- VECCOPY(key->co, co);
- Mat4MulVecfl(imat, key->co);
+ VECCOPY(key->co, co);
+ Mat4MulVecfl(imat, key->co);
+ }
}
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
}
-static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index)
-{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= &psys->particles[pa_index];
- HairKey *key= pa->hair + key_index;
-
+static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key)
+{
if(key_index) {
float dvec[3];
@@ -2804,11 +2811,8 @@ static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int
}
}
-static void brush_smooth_do(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index)
+static void brush_smooth_do(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key)
{
- ParticleSystem *psys= data->psys;
- ParticleData *pa= &psys->particles[pa_index];
- HairKey *key= pa->hair + key_index;
float vec[3], dvec[3];
if(key_index) {
@@ -2823,18 +2827,18 @@ static void brush_smooth_do(PEData *data, float mat[][4], float imat[][4], int p
VECADD(key->co,key->co,dvec);
}
- pa->flag |= PARS_EDIT_RECALC;
+ (data->edit->points + point_index)->flag |= PEP_EDIT_RECALC;
}
static void brush_add(PEData *data, short number)
{
Scene *scene= data->scene;
Object *ob= data->ob;
- ParticleSystem *psys= data->psys;
+ PTCacheEdit *edit = data->edit;
+ ParticleSystem *psys= edit->psys;
ParticleData *add_pars= MEM_callocN(number*sizeof(ParticleData),"ParticleData add");
ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys);
ParticleEditSettings *pset= PE_settings(scene);
- ParticleEdit *edit= psys->edit;
int i, k, n= 0, totpart= psys->totpart;
short mco[2];
short dmx= 0, dmy= 0;
@@ -2881,19 +2885,20 @@ static void brush_add(PEData *data, short number)
float hairmat[4][4], cur_co[3];
KDTree *tree=0;
ParticleData *pa, *new_pars= MEM_callocN(newtotpart*sizeof(ParticleData),"ParticleData new");
- ParticleEditKey *ekey, **key, **new_keys= MEM_callocN(newtotpart*sizeof(ParticleEditKey *),"ParticleEditKey array new");
+ PTCacheEditPoint *point, *new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint),"PTCacheEditPoint array new");
+ PTCacheEditKey *key;
HairKey *hkey;
/* save existing elements */
memcpy(new_pars, psys->particles, totpart * sizeof(ParticleData));
- memcpy(new_keys, edit->keys, totpart * sizeof(ParticleEditKey*));
+ memcpy(new_points, edit->points, totpart * sizeof(PTCacheEditPoint));
/* change old arrays to new ones */
if(psys->particles) MEM_freeN(psys->particles);
psys->particles= new_pars;
- if(edit->keys) MEM_freeN(edit->keys);
- edit->keys= new_keys;
+ if(edit->points) MEM_freeN(edit->points);
+ edit->points= new_points;
if(edit->mirror_cache) {
MEM_freeN(edit->mirror_cache);
@@ -2912,29 +2917,29 @@ static void brush_add(PEData *data, short number)
BLI_kdtree_balance(tree);
}
- psys->totpart= newtotpart;
+ edit->totpoint= psys->totpart= newtotpart;
/* create new elements */
pa= psys->particles + totpart;
- key= edit->keys + totpart;
+ point= edit->points + totpart;
- for(i=totpart; i<newtotpart; i++, pa++, key++) {
+ for(i=totpart; i<newtotpart; i++, pa++, point++) {
memcpy(pa, add_pars + i - totpart, sizeof(ParticleData));
pa->hair= MEM_callocN(pset->totaddkey * sizeof(HairKey), "BakeKey key add");
- ekey= *key= MEM_callocN(pset->totaddkey * sizeof(ParticleEditKey), "ParticleEditKey add");
- pa->totkey= pset->totaddkey;
+ key= point->keys= MEM_callocN(pset->totaddkey * sizeof(PTCacheEditKey), "PTCacheEditKey add");
+ point->totkey= pa->totkey= pset->totaddkey;
- for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, ekey++) {
- ekey->co= hkey->co;
- ekey->time= &hkey->time;
+ for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++) {
+ key->co= hkey->co;
+ key->time= &hkey->time;
}
pa->size= 1.0f;
initialize_particle(pa,i,ob,psys,psmd);
reset_particle(scene, pa,psys,psmd,ob,0.0,1.0,0,0,0);
- pa->flag |= PARS_EDIT_RECALC;
+ point->flag |= PEP_EDIT_RECALC;
if(pset->flag & PE_X_MIRROR)
- pa->flag |= PARS_TAG; /* signal for duplicate */
+ point->flag |= PEP_TAG; /* signal for duplicate */
framestep= pa->lifetime/(float)(pset->totaddkey-1);
@@ -3005,7 +3010,6 @@ static void brush_add(PEData *data, short number)
Mat4MulVecfl(imat, hkey->co);
}
}
- edit->totkeys= psys_count_keys(psys);
if(tree)
BLI_kdtree_free(tree);
@@ -3017,25 +3021,12 @@ static void brush_add(PEData *data, short number)
dm->release(dm);
}
-static void brush_weight(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index)
-{
- ParticleSystem *psys= data->psys;
- ParticleData *pa;
-
- /* roots have full weight allways */
- if(key_index) {
- pa= &psys->particles[pa_index];
- pa->hair[key_index].weight= data->weightfac;
- pa->flag |= PARS_EDIT_RECALC;
- }
-}
-
/************************* brush edit operator ********************/
typedef struct BrushEdit {
Scene *scene;
Object *ob;
- ParticleSystem *psys;
+ PTCacheEdit *edit;
int first;
int lastmouse[2];
@@ -3045,8 +3036,8 @@ static int brush_edit_init(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
ParticleEditSettings *pset= PE_settings(scene);
+ PTCacheEdit *edit= PE_get_current(scene, ob);
ARegion *ar= CTX_wm_region(C);
BrushEdit *bedit;
@@ -3061,7 +3052,7 @@ static int brush_edit_init(bContext *C, wmOperator *op)
bedit->scene= scene;
bedit->ob= ob;
- bedit->psys= psys;
+ bedit->edit= edit;
return 1;
}
@@ -3071,16 +3062,21 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
BrushEdit *bedit= op->customdata;
Scene *scene= bedit->scene;
Object *ob= bedit->ob;
- ParticleSystem *psys= bedit->psys;
+ PTCacheEdit *edit= bedit->edit;
ParticleEditSettings *pset= PE_settings(scene);
- ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
+ ParticleSystemModifierData *psmd= edit->psys ? psys_get_modifier(ob, edit->psys) : NULL;
ParticleBrushData *brush= &pset->brush[pset->brushtype];
ARegion *ar= CTX_wm_region(C);
- float vec1[3], vec2[3];
+ float vec[3], mousef[2];
short mval[2], mvalo[2];
int flip, mouse[2], dx, dy, removed= 0, selected= 0;
- RNA_int_get_array(itemptr, "mouse", mouse);
+ if(!PE_start_edit(edit))
+ return;
+
+ RNA_float_get_array(itemptr, "mouse", mousef);
+ mouse[0] = mousef[0];
+ mouse[1] = mousef[1];
flip= RNA_boolean_get(itemptr, "flip");
if(bedit->first) {
@@ -3102,7 +3098,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
|| bedit->first) {
view3d_operator_needs_opengl(C);
- selected= (short)count_selected_keys(scene, psys);
+ selected= (short)count_selected_keys(scene, edit);
switch(pset->brushtype) {
case PE_BRUSH_COMB:
@@ -3121,10 +3117,8 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
Mat4Invert(ob->imat, ob->obmat);
- window_to_3d(ar, vec1, mvalo[0], mvalo[1]);
- window_to_3d(ar, vec2, mval[0], mval[1]);
- VECSUB(vec1, vec2, vec1);
- data.dvec= vec1;
+ window_to_3d_delta(ar, vec, dx, dy);
+ data.dvec= vec;
foreach_mouse_hit_key(&data, brush_comb, selected);
break;
@@ -3132,20 +3126,22 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
case PE_BRUSH_CUT:
{
PEData data;
+
+ if(edit->psys && edit->pathcache) {
+ PE_set_view3d_data(C, &data);
+ data.mval= mval;
+ data.rad= (float)brush->size;
+ data.cutfac= (float)(brush->strength / 100.0f);
- PE_set_view3d_data(C, &data);
- data.mval= mval;
- data.rad= (float)brush->size;
- data.cutfac= (float)(brush->strength / 100.0f);
-
- if(selected)
- foreach_selected_particle(&data, brush_cut);
- else
- PE_foreach_particle(&data, brush_cut);
+ if(selected)
+ foreach_selected_point(&data, brush_cut);
+ else
+ foreach_point(&data, brush_cut);
- removed= remove_tagged_particles(scene, ob, psys);
- if(pset->flag & PE_KEEP_LENGTHS)
- recalc_lengths(psys);
+ removed= remove_tagged_particles(scene, ob, edit->psys);
+ if(pset->flag & PE_KEEP_LENGTHS)
+ recalc_lengths(edit);
+ }
break;
}
case PE_BRUSH_LENGTH:
@@ -3163,61 +3159,50 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
else
data.growfac= 1.0f + data.growfac;
- foreach_mouse_hit_particle(&data, brush_length, selected);
+ foreach_mouse_hit_point(&data, brush_length, selected);
if(pset->flag & PE_KEEP_LENGTHS)
- recalc_lengths(psys);
+ recalc_lengths(edit);
break;
}
case PE_BRUSH_PUFF:
{
PEData data;
- PE_set_view3d_data(C, &data);
- data.dm= psmd->dm;
- data.mval= mval;
- data.rad= (float)brush->size;
+ if(edit->psys) {
+ PE_set_view3d_data(C, &data);
+ data.dm= psmd->dm;
+ data.mval= mval;
+ data.rad= (float)brush->size;
- data.pufffac= (float)(brush->strength - 50) / 50.0f;
- if(data.pufffac < 0.0f)
- data.pufffac= 1.0f - 9.0f * data.pufffac;
- else
- data.pufffac= 1.0f - data.pufffac;
+ data.pufffac= (float)(brush->strength - 50) / 50.0f;
+ if(data.pufffac < 0.0f)
+ data.pufffac= 1.0f - 9.0f * data.pufffac;
+ else
+ data.pufffac= 1.0f - data.pufffac;
- data.invert= (brush->invert ^ flip);
- Mat4Invert(ob->imat, ob->obmat);
+ data.invert= (brush->invert ^ flip);
+ Mat4Invert(ob->imat, ob->obmat);
- foreach_mouse_hit_particle(&data, brush_puff, selected);
+ foreach_mouse_hit_point(&data, brush_puff, selected);
+ }
break;
}
case PE_BRUSH_ADD:
{
PEData data;
- if(psys->part->from==PART_FROM_FACE) {
+ if(edit->psys && edit->psys->part->from==PART_FROM_FACE) {
PE_set_view3d_data(C, &data);
data.mval= mval;
brush_add(&data, brush->strength);
if(pset->flag & PE_KEEP_LENGTHS)
- recalc_lengths(psys);
+ recalc_lengths(edit);
}
break;
}
- case PE_BRUSH_WEIGHT:
- {
- PEData data;
-
- PE_set_view3d_data(C, &data);
- data.mval= mval;
- data.rad= (float)brush->size;
-
- data.weightfac= (float)(brush->strength / 100.0f);
-
- foreach_mouse_hit_key(&data, brush_weight, selected);
- break;
- }
case PE_BRUSH_SMOOTH:
{
PEData data;
@@ -3244,14 +3229,14 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
}
}
if((pset->flag & PE_KEEP_LENGTHS)==0)
- recalc_lengths(psys);
+ recalc_lengths(edit);
if(pset->brushtype == PE_BRUSH_ADD || removed) {
if(pset->brushtype == PE_BRUSH_ADD && (pset->flag & PE_X_MIRROR))
PE_mirror_x(scene, ob, 1);
- psys_update_world_cos(ob,psys);
- psys_free_path_cache(psys);
+ update_world_cos(ob,edit);
+ psys_free_path_cache(NULL, edit);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
}
else
@@ -3291,7 +3276,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event)
{
ARegion *ar= CTX_wm_region(C);
PointerRNA itemptr;
- int mouse[2];
+ float mouse[2];
mouse[0]= event->x - ar->winrct.xmin;
mouse[1]= event->y - ar->winrct.ymin;
@@ -3299,7 +3284,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event)
/* fill in stroke */
RNA_collection_add(op->ptr, "stroke", &itemptr);
- RNA_int_set_array(&itemptr, "mouse", mouse);
+ RNA_float_set_array(&itemptr, "mouse", mouse);
RNA_boolean_set(&itemptr, "flip", event->shift != 0); // XXX hardcoded
/* apply */
@@ -3363,104 +3348,157 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot)
/*********************** undo ***************************/
-static void free_ParticleUndo(ParticleUndo *undo)
+static void free_PTCacheUndo(PTCacheUndo *undo)
{
- ParticleData *pa;
+ PTCacheEditPoint *point;
int i;
- for(i=0, pa=undo->particles; i<undo->totpart; i++, pa++) {
- if(pa->hair)
- MEM_freeN(pa->hair);
- if(undo->keys[i])
- MEM_freeN(undo->keys[i]);
+ for(i=0, point=undo->points; i<undo->totpoint; i++, point++) {
+ if(undo->particles && (undo->particles + i)->hair)
+ MEM_freeN((undo->particles + i)->hair);
+ if(point->keys)
+ MEM_freeN(point->keys);
}
- if(undo->keys)
- MEM_freeN(undo->keys);
+ if(undo->points)
+ MEM_freeN(undo->points);
if(undo->particles)
MEM_freeN(undo->particles);
- //if(undo->emitter_cosnos)
- // MEM_freeN(undo->emitter_cosnos);
+ BKE_ptcache_free_mem(&undo->mem_cache);
}
-static void make_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo)
+static void make_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
{
- ParticleData *pa,*upa;
+ PTCacheEditPoint *point;
int i;
- undo->totpart= psys->totpart;
- undo->totkeys= psys->edit->totkeys;
+ undo->totpoint= edit->totpoint;
- upa= undo->particles= MEM_dupallocN(psys->particles);
- undo->keys= MEM_dupallocN(psys->edit->keys);
-
- for(i=0, pa=psys->particles; i<undo->totpart; i++, pa++, upa++) {
- upa->hair= MEM_dupallocN(pa->hair);
- undo->keys[i]= MEM_dupallocN(psys->edit->keys[i]);
+ if(edit->psys) {
+ ParticleData *pa;
+
+ pa= undo->particles= MEM_dupallocN(edit->psys->particles);
+
+ for(i=0; i<edit->totpoint; i++, pa++)
+ pa->hair= MEM_dupallocN(pa->hair);
+ }
+ else {
+ PTCacheMem *pm;
+
+ BLI_duplicatelist(&undo->mem_cache, &edit->pid.cache->mem_cache);
+ pm = undo->mem_cache.first;
+
+ for(; pm; pm=pm->next) {
+ for(i=0; i<BPHYS_TOT_DATA; i++)
+ pm->data[i] = MEM_dupallocN(pm->data[i]);
+ }
+ }
+
+ point= undo->points = MEM_dupallocN(edit->points);
+ undo->totpoint = edit->totpoint;
+
+ for(i=0; i<edit->totpoint; i++, point++) {
+ point->keys= MEM_dupallocN(point->keys);
/* no need to update edit key->co & key->time pointers here */
}
}
-static void get_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo)
+static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
{
- ParticleData *pa, *upa;
- ParticleEditKey *key;
+ ParticleSystem *psys = edit->psys;
+ ParticleData *pa;
HairKey *hkey;
- int i, k, totpart= psys->totpart;
+ POINT_P; KEY_K;
- LOOP_PARTICLES(i, pa) {
- if(pa->hair)
- MEM_freeN(pa->hair);
+ LOOP_POINTS {
+ if(psys && psys->particles[p].hair)
+ MEM_freeN(psys->particles[p].hair);
- if(psys->edit->keys[i])
- MEM_freeN(psys->edit->keys[i]);
+ if(point->keys)
+ MEM_freeN(point->keys);
}
- if(psys->particles)
+ if(psys && psys->particles)
MEM_freeN(psys->particles);
- if(psys->edit->keys)
- MEM_freeN(psys->edit->keys);
- if(psys->edit->mirror_cache) {
- MEM_freeN(psys->edit->mirror_cache);
- psys->edit->mirror_cache= NULL;
+ if(edit->points)
+ MEM_freeN(edit->points);
+ if(edit->mirror_cache) {
+ MEM_freeN(edit->mirror_cache);
+ edit->mirror_cache= NULL;
+ }
+
+ edit->points= MEM_dupallocN(undo->points);
+ edit->totpoint = undo->totpoint;
+
+ LOOP_POINTS {
+ point->keys= MEM_dupallocN(point->keys);
}
- pa= psys->particles= MEM_dupallocN(undo->particles);
- psys->edit->keys= MEM_dupallocN(undo->keys);
+ if(psys) {
+ psys->particles= MEM_dupallocN(undo->particles);
+
+ psys->totpart= undo->totpoint;
- for(i=0,upa=undo->particles; i<undo->totpart; i++, upa++, pa++) {
- hkey= pa->hair= MEM_dupallocN(upa->hair);
- key= psys->edit->keys[i]= MEM_dupallocN(undo->keys[i]);
- for(k=0; k<pa->totkey; k++, hkey++, key++) {
- key->co= hkey->co;
- key->time= &hkey->time;
+ LOOP_POINTS {
+ pa = psys->particles + p;
+ hkey= pa->hair = MEM_dupallocN(pa->hair);
+
+ LOOP_KEYS {
+ key->co= hkey->co;
+ key->time= &hkey->time;
+ hkey++;
+ }
}
}
+ else {
+ PTCacheMem *pm;
+ int i;
+
+ BKE_ptcache_free_mem(&edit->pid.cache->mem_cache);
+
+ BLI_duplicatelist(&edit->pid.cache->mem_cache, &undo->mem_cache);
+
+ pm = edit->pid.cache->mem_cache.first;
+
+ for(; pm; pm=pm->next) {
+ for(i=0; i<BPHYS_TOT_DATA; i++)
+ pm->data[i] = MEM_dupallocN(pm->data[i]);
+
+ BKE_ptcache_mem_init_pointers(pm);
- psys->totpart= undo->totpart;
- psys->edit->totkeys= undo->totkeys;
+ LOOP_POINTS {
+ LOOP_KEYS {
+ if((int)key->ftime == pm->frame) {
+ key->co = pm->cur[BPHYS_DATA_LOCATION];
+ key->vel = pm->cur[BPHYS_DATA_VELOCITY];
+ key->rot = pm->cur[BPHYS_DATA_ROTATION];
+ key->time = &key->ftime;
+ }
+ }
+ BKE_ptcache_mem_incr_pointers(pm);
+ }
+ }
+ }
}
void PE_undo_push(Scene *scene, char *str)
{
- ParticleSystem *psys= PE_get_current(scene, OBACT);
- ParticleEdit *edit= 0;
- ParticleUndo *undo;
+ PTCacheEdit *edit= PE_get_current(scene, OBACT);
+ PTCacheUndo *undo;
int nr;
- if(!PE_can_edit(psys)) return;
- edit= psys->edit;
+ if(!edit) return;
/* remove all undos after (also when curundo==NULL) */
while(edit->undo.last != edit->curundo) {
undo= edit->undo.last;
BLI_remlink(&edit->undo, undo);
- free_ParticleUndo(undo);
+ free_PTCacheUndo(undo);
MEM_freeN(undo);
}
/* make new */
- edit->curundo= undo= MEM_callocN(sizeof(ParticleUndo), "particle undo file");
+ edit->curundo= undo= MEM_callocN(sizeof(PTCacheUndo), "particle undo file");
strncpy(undo->name, str, 64-1);
BLI_addtail(&edit->undo, undo);
@@ -3474,27 +3512,25 @@ void PE_undo_push(Scene *scene, char *str)
}
if(undo) {
while(edit->undo.first!=undo) {
- ParticleUndo *first= edit->undo.first;
+ PTCacheUndo *first= edit->undo.first;
BLI_remlink(&edit->undo, first);
- free_ParticleUndo(first);
+ free_PTCacheUndo(first);
MEM_freeN(first);
}
}
/* copy */
- make_ParticleUndo(psys,edit->curundo);
+ make_PTCacheUndo(edit,edit->curundo);
}
void PE_undo_step(Scene *scene, int step)
{
- ParticleSystem *psys= PE_get_current(scene, OBACT);
- ParticleEdit *edit= 0;
+ PTCacheEdit *edit= PE_get_current(scene, OBACT);
- if(!PE_can_edit(psys)) return;
- edit= psys->edit;
+ if(!edit) return;
if(step==0) {
- get_ParticleUndo(psys,edit->curundo);
+ get_PTCacheUndo(edit,edit->curundo);
}
else if(step==1) {
@@ -3502,7 +3538,7 @@ void PE_undo_step(Scene *scene, int step)
else {
if(G.f & G_DEBUG) printf("undo %s\n", edit->curundo->name);
edit->curundo= edit->curundo->prev;
- get_ParticleUndo(psys, edit->curundo);
+ get_PTCacheUndo(edit, edit->curundo);
}
}
else {
@@ -3510,18 +3546,19 @@ void PE_undo_step(Scene *scene, int step)
if(edit->curundo==NULL || edit->curundo->next==NULL);
else {
- get_ParticleUndo(psys, edit->curundo->next);
+ get_PTCacheUndo(edit, edit->curundo->next);
edit->curundo= edit->curundo->next;
if(G.f & G_DEBUG) printf("redo %s\n", edit->curundo->name);
}
}
+ PE_update_object(scene, OBACT, 0);
DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA);
}
-static void ParticleUndo_number(Scene *scene, ParticleEdit *edit, int nr)
+static void PTCacheUndo_number(Scene *scene, PTCacheEdit *edit, int nr)
{
- ParticleUndo *undo;
+ PTCacheUndo *undo;
int a=1;
for(undo= edit->undo.first; undo; undo= undo->next, a++) {
@@ -3531,20 +3568,15 @@ static void ParticleUndo_number(Scene *scene, ParticleEdit *edit, int nr)
PE_undo_step(scene, 0);
}
-static void ParticleUndo_clear(ParticleSystem *psys)
+static void PTCacheUndo_clear(PTCacheEdit *edit)
{
- ParticleUndo *undo;
- ParticleEdit *edit;
-
- if(psys==0) return;
-
- edit= psys->edit;
+ PTCacheUndo *undo;
if(edit==0) return;
undo= edit->undo.first;
while(undo) {
- free_ParticleUndo(undo);
+ free_PTCacheUndo(undo);
undo= undo->next;
}
BLI_freelistN(&edit->undo);
@@ -3563,15 +3595,13 @@ void PE_redo(Scene *scene)
void PE_undo_menu(Scene *scene, Object *ob)
{
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleEdit *edit= 0;
- ParticleUndo *undo;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ PTCacheUndo *undo;
DynStr *ds;
short event=0;
char *menu;
- if(!PE_can_edit(psys)) return;
- edit= psys->edit;
+ if(!edit) return;
ds= BLI_dynstr_new();
@@ -3588,7 +3618,7 @@ void PE_undo_menu(Scene *scene, Object *ob)
// XXX event= pupmenu_col(menu, 20);
MEM_freeN(menu);
- if(event>0) ParticleUndo_number(scene, edit,event);
+ if(event>0) PTCacheUndo_number(scene, edit, event);
}
/************************ utilities ******************************/
@@ -3596,30 +3626,29 @@ void PE_undo_menu(Scene *scene, Object *ob)
int PE_minmax(Scene *scene, float *min, float *max)
{
Object *ob= OBACT;
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleSystemModifierData *psmd;
- ParticleData *pa;
- ParticleEditKey *key;
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ ParticleSystem *psys = edit->psys;
+ ParticleSystemModifierData *psmd = NULL;
+ POINT_P; KEY_K;
float co[3], mat[4][4];
- int i, k, totpart, ok= 0;
+ int ok= 0;
- if(!PE_can_edit(psys)) return ok;
+ if(!edit) return ok;
- psmd= psys_get_modifier(ob, psys);
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i, pa) {
- if(pa->flag & PARS_HIDE) continue;
+ if(psys)
+ psmd= psys_get_modifier(ob, psys);
+ else
+ Mat4One(mat);
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
+ LOOP_VISIBLE_POINTS {
+ if(psys)
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, mat);
- LOOP_KEYS(k, key) {
- if(key->flag & PEK_SELECT) {
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
- DO_MINMAX(co, min, max);
- ok= 1;
- }
+ LOOP_SELECTED_KEYS {
+ VECCOPY(co, key->co);
+ Mat4MulVecfl(mat, co);
+ DO_MINMAX(co, min, max);
+ ok= 1;
}
}
@@ -3634,56 +3663,106 @@ int PE_minmax(Scene *scene, float *min, float *max)
/************************ particle edit toggle operator ************************/
/* initialize needed data for bake edit */
-static void PE_create_particle_edit(Scene *scene, Object *ob, ParticleSystem *psys)
+static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys)
{
- ParticleEdit *edit= psys->edit;
- ParticleData *pa;
- ParticleEditKey *key;
+ PTCacheEdit *edit= psys ? psys->edit : cache->edit;
+ POINT_P; KEY_K;
+ ParticleData *pa = NULL;
HairKey *hkey;
- int i, k, totpart= psys->totpart, alloc=1;
+ int totpoint;
- if((psys->flag & PSYS_EDITED)==0)
+ if(!psys && !cache)
return;
- if(edit) {
- int newtotkeys= psys_count_keys(psys);
+ if(cache && cache->flag & PTCACHE_DISK_CACHE)
+ return;
- if(newtotkeys == edit->totkeys)
- alloc=0;
- }
+ if(!edit) {
+ totpoint = psys ? psys->totpart : ((PTCacheMem*)cache->mem_cache.first)->totpoint;
- if(alloc) {
- if(edit) {
- printf("ParticleEdit exists already! Poke jahka!");
- PE_free_particle_edit(psys);
- }
+ edit= MEM_callocN(sizeof(PTCacheEdit), "PE_create_particle_edit");
+ edit->points=MEM_callocN(totpoint*sizeof(PTCacheEditPoint),"PTCacheEditPoints");
+ edit->totpoint = totpoint;
- edit= psys->edit=MEM_callocN(sizeof(ParticleEdit), "PE_create_particle_edit");
- psys->free_edit= PE_free_particle_edit;
+ if(psys && !cache) {
+ psys->edit= edit;
+ edit->psys = psys;
- edit->keys=MEM_callocN(totpart*sizeof(ParticleEditKey*),"ParticleEditKey array");
+ psys->free_edit= PE_free_ptcache_edit;
- LOOP_PARTICLES(i, pa) {
- key= edit->keys[i]= MEM_callocN(pa->totkey*sizeof(ParticleEditKey),"ParticleEditKeys");
- for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++) {
- key->co= hkey->co;
- key->time= &hkey->time;
- key->flag= hkey->editflag;
+ edit->pathcache = NULL;
+ edit->pathcachebufs.first = edit->pathcachebufs.last = NULL;
+
+ pa = psys->particles;
+ LOOP_POINTS {
+ point->totkey = pa->totkey;
+ point->keys= MEM_callocN(point->totkey*sizeof(PTCacheEditKey),"ParticleEditKeys");
+ point->flag |= PEP_EDIT_RECALC;
+
+ hkey = pa->hair;
+ LOOP_KEYS {
+ key->co= hkey->co;
+ key->time= &hkey->time;
+ key->flag= hkey->editflag;
+ key->flag |= PEK_USE_WCO;
+ hkey++;
+ }
+ pa++;
}
}
+ else {
+ PTCacheMem *pm;
+ int totframe=0;
+
+ cache->edit= edit;
+ cache->free_edit= PE_free_ptcache_edit;
+ edit->psys = NULL;
+
+ for(pm=cache->mem_cache.first; pm; pm=pm->next)
+ totframe++;
+
+ for(pm=cache->mem_cache.first; pm; pm=pm->next) {
+ BKE_ptcache_mem_init_pointers(pm);
+
+ LOOP_POINTS {
+ if(psys) {
+ pa = psys->particles + p;
+ if((pm->next && pm->next->frame < pa->time)
+ || (pm->prev && pm->prev->frame >= pa->dietime)) {
+ BKE_ptcache_mem_incr_pointers(pm);
+ continue;
+ }
+ }
+
+ if(!point->totkey) {
+ key = point->keys = MEM_callocN(totframe*sizeof(PTCacheEditKey),"ParticleEditKeys");
+ point->flag |= PEP_EDIT_RECALC;
+ }
+ else
+ key = point->keys + point->totkey;
- edit->totkeys= psys_count_keys(psys);
+ key->co = pm->cur[BPHYS_DATA_LOCATION];
+ key->vel = pm->cur[BPHYS_DATA_VELOCITY];
+ key->rot = pm->cur[BPHYS_DATA_ROTATION];
+ key->ftime = (float)pm->frame;
+ key->time = &key->ftime;
+ BKE_ptcache_mem_incr_pointers(pm);
+
+ point->totkey++;
+ }
+ }
+ psys = NULL;
+ }
UI_GetThemeColor3ubv(TH_EDGE_SELECT, edit->sel_col);
UI_GetThemeColor3ubv(TH_WIRE, edit->nosel_col);
- }
- recalc_lengths(psys);
- recalc_emitter_field(ob, psys);
- psys_update_world_cos(ob, psys);
+ recalc_lengths(edit);
+ if(psys && !cache)
+ recalc_emitter_field(ob, psys);
+ PE_update_object(scene, ob, 1);
- if(alloc) {
- ParticleUndo_clear(psys);
+ PTCacheUndo_clear(edit);
PE_undo_push(scene, "Original");
}
}
@@ -3696,36 +3775,22 @@ static int particle_edit_toggle_poll(bContext *C)
if(!scene || !ob || ob->id.lib)
return 0;
- return (ob->particlesystem.first != NULL);
+ return (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody));
}
static int particle_edit_toggle_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
-
- if(psys==NULL) {
- psys= ob->particlesystem.first;
- psys->flag |= PSYS_CURRENT;
- }
+ PTCacheEdit *edit= PE_get_current(scene, ob);
- if(!(G.f & G_PARTICLEEDIT)) {
- if(psys && psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED) {
- if(psys_check_enabled(ob, psys)) {
- if(psys->edit==NULL)
- PE_create_particle_edit(scene, ob, psys);
-
- psys_update_world_cos(ob, psys);
- }
- }
-
- G.f |= G_PARTICLEEDIT;
+ if(!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
+ ob->mode |= OB_MODE_PARTICLE_EDIT;
toggle_particle_cursor(C, 1);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_PARTICLE, NULL);
}
else {
- G.f &= ~G_PARTICLEEDIT;
+ ob->mode &= ~OB_MODE_PARTICLE_EDIT;
toggle_particle_cursor(C, 0);
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
}
@@ -3752,112 +3817,65 @@ void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot)
/************************ set editable operator ************************/
-static int set_editable_exec(bContext *C, wmOperator *op)
+static int clear_edited_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
- ParticleSystem *psys= PE_get_current(scene, ob);
+ ParticleSystem *psys = psys_get_current(ob);
- if(psys->flag & PSYS_EDITED) {
- if(1) { // XXX okee("Lose changes done in particle mode?")) {
- if(psys->edit)
- PE_free_particle_edit(psys);
+ if(psys->edit) {
+ if(psys->edit->edited || 1) { // XXX okee("Lose changes done in particle mode?"))
+ PE_free_ptcache_edit(psys->edit);
+
+ psys->edit = NULL;
+ psys->free_edit = NULL;
- psys->flag &= ~PSYS_EDITED;
psys->recalc |= PSYS_RECALC_RESET;
+ psys_reset(psys, PSYS_RESET_DEPSGRAPH);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
}
}
- else {
- if(psys_check_enabled(ob, psys)) {
- psys->flag |= PSYS_EDITED;
-
- if(G.f & G_PARTICLEEDIT)
- PE_create_particle_edit(scene, ob, psys);
- }
- else
- BKE_report(op->reports, RPT_ERROR, "Particle system not enabled, skipping set editable");
- }
return OPERATOR_FINISHED;
}
-void PARTICLE_OT_editable_set(wmOperatorType *ot)
+void PARTICLE_OT_edited_clear(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Set Editable";
- ot->idname= "PARTICLE_OT_editable_set";
+ ot->name= "Clear Edited";
+ ot->idname= "PARTICLE_OT_edited_clear";
/* api callbacks */
- ot->exec= set_editable_exec;
+ ot->exec= clear_edited_exec;
ot->poll= particle_edit_toggle_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-/*********************** change active **************************/
-
-void PE_change_act(void *ob_v, void *act_v)
-{
- Scene *scene= NULL; // XXX
- Object *ob= ob_v;
- ParticleSystem *psys;
- short act= *((short*)act_v) - 1;
-
- if((psys=psys_get_current(ob)))
- psys->flag &= ~PSYS_CURRENT;
-
- if(act>=0) {
- if((psys=BLI_findlink(&ob->particlesystem,act))) {
- psys->flag |= PSYS_CURRENT;
-
- if(psys_check_enabled(ob, psys)) {
- if(G.f & G_PARTICLEEDIT && !psys->edit)
- PE_create_particle_edit(scene, ob, psys);
- psys_update_world_cos(ob, psys);
- }
- }
- }
-}
-
-void PE_change_act_psys(Scene *scene, Object *ob, ParticleSystem *psys)
-{
- ParticleSystem *p;
-
- if((p=psys_get_current(ob)))
- p->flag &= ~PSYS_CURRENT;
-
- psys->flag |= PSYS_CURRENT;
-
- if(psys_check_enabled(ob, psys)) {
- if(G.f & G_PARTICLEEDIT && !psys->edit)
- PE_create_particle_edit(scene, ob, psys);
-
- psys_update_world_cos(ob, psys);
- }
-}
-
/*********************** specials menu **************************/
static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Scene *scene= CTX_data_scene(C);
ParticleEditSettings *pset=PE_settings(scene);
+ PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C));
uiPopupMenu *pup;
uiLayout *layout;
pup= uiPupMenuBegin(C, "Specials", 0);
layout= uiPupMenuLayout(pup);
- uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey");
- if(pset->selectmode & SCE_SELECT_POINT) {
- uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide");
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first");
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last");
+ if(edit->psys) {
+ uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey");
+ if(pset->selectmode & SCE_SELECT_POINT) {
+ uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide");
+ uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first");
+ uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last");
+ }
+ uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles");
}
- uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles");
uiPupMenuEnd(C, pup);
@@ -3902,7 +3920,7 @@ void ED_operatortypes_particle(void)
WM_operatortype_append(PARTICLE_OT_specials_menu);
WM_operatortype_append(PARTICLE_OT_particle_edit_toggle);
- WM_operatortype_append(PARTICLE_OT_editable_set);
+ WM_operatortype_append(PARTICLE_OT_edited_clear);
}
void ED_keymap_particle(wmWindowManager *wm)
diff --git a/source/blender/editors/physics/physics_boids.c b/source/blender/editors/physics/physics_boids.c
index 2d3b11080e7..148359068ad 100644
--- a/source/blender/editors/physics/physics_boids.c
+++ b/source/blender/editors/physics/physics_boids.c
@@ -249,7 +249,6 @@ void BOID_OT_boidrule_move_down(wmOperatorType *ot)
/************************ add/del boid state operators *********************/
static int boidstate_add_exec(bContext *C, wmOperator *op)
{
- Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= ptr.data;
Object *ob= ptr.id.data;
@@ -344,7 +343,6 @@ void BOID_OT_boidstate_del(wmOperatorType *ot)
/************************ move up/down boid state operators *********************/
static int boidstate_move_up_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= ptr.data;
Object *ob = ptr.id.data;
@@ -385,7 +383,6 @@ static int boidstate_move_down_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= ptr.data;
- Object *ob = ptr.id.data;
BoidSettings *boids;
BoidState *state;
@@ -430,4 +427,4 @@ void ED_operatortypes_boids(void)
WM_operatortype_append(BOID_OT_boidstate_del);
WM_operatortype_append(BOID_OT_boidstate_move_up);
WM_operatortype_append(BOID_OT_boidstate_move_down);
-} \ No newline at end of file
+}
diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c
index b542b362ae0..d17391811bb 100644
--- a/source/blender/editors/preview/previewrender.c
+++ b/source/blender/editors/preview/previewrender.c
@@ -113,6 +113,7 @@ typedef struct ShaderPreview {
Scene *scene;
ID *id;
ID *parent;
+ MTex *slot;
int sizex, sizey;
int *pr_rect;
@@ -304,7 +305,11 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
end_render_material(mat);
/* turn on raytracing if needed */
- if(mat->mode_l & (MA_RAYTRANSP|MA_RAYMIRROR))
+ if(mat->mode_l & MA_RAYMIRROR)
+ sce->r.mode |= R_RAYTRACE;
+ if(mat->material_type == MA_TYPE_VOLUME)
+ sce->r.mode |= R_RAYTRACE;
+ if((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
sce->r.mode |= R_RAYTRACE;
if(mat->sss_flag & MA_DIFF_SSS)
sce->r.mode |= R_SSS;
@@ -362,6 +367,10 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
Material *mat= give_current_material(base->object, base->object->actcol);
if(mat && mat->mtex[0]) {
mat->mtex[0]->tex= tex;
+
+ if(sp && sp->slot)
+ mat->mtex[0]->which_output = sp->slot->which_output;
+
/* show alpha in this case */
if(tex==NULL || (tex->flag & TEX_PRV_ALPHA)) {
mat->mtex[0]->mapto |= MAP_ALPHA;
@@ -455,13 +464,14 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int
return 0;
}
-void ED_preview_draw(const bContext *C, void *idp, void *parentp, rcti *rect)
+void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, rcti *rect)
{
if(idp) {
ScrArea *sa= CTX_wm_area(C);
Scene *sce = CTX_data_scene(C);
ID *id = (ID *)idp;
ID *parent= (ID *)parentp;
+ MTex *slot= (MTex *)slotp;
SpaceButs *sbuts= sa->spacedata.first;
rcti newrect;
int ok;
@@ -489,7 +499,7 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, rcti *rect)
}
if(ok==0) {
- ED_preview_shader_job(C, sa, id, parent, newx, newy);
+ ED_preview_shader_job(C, sa, id, parent, slot, newx, newy);
}
}
}
@@ -892,7 +902,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
/* handle results */
if(sp->pr_method==PR_ICON_RENDER) {
if(sp->pr_rect)
- RE_ResultGet32(re, sp->pr_rect);
+ RE_ResultGet32(re, (unsigned int *)sp->pr_rect);
}
else {
/* validate owner */
@@ -930,7 +940,7 @@ static void shader_preview_free(void *customdata)
MEM_freeN(sp);
}
-void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, int sizex, int sizey)
+void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey)
{
wmJob *steve;
ShaderPreview *sp;
@@ -938,7 +948,11 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, i
/* XXX ugly global still, but we can't do preview while rendering */
if(G.rendering)
return;
-
+
+ if(GS(id->name) == ID_TE) {
+ ntreeTexSetPreviewFlag(1);
+ }
+
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner);
sp= MEM_callocN(sizeof(ShaderPreview), "shader preview");
@@ -950,6 +964,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, i
sp->pr_method= PR_DO_RENDER;
sp->id = id;
sp->parent= parent;
+ sp->slot= slot;
/* setup job */
WM_jobs_customdata(steve, sp, shader_preview_free);
@@ -963,7 +978,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, i
}
/* rect should be allocated, sizex/sizy pixels, 32 bits */
-void ED_preview_iconrender(Scene *scene, ID *id, int *rect, int sizex, int sizey)
+void ED_preview_iconrender(Scene *scene, ID *id, unsigned int *rect, int sizex, int sizey)
{
ShaderPreview *sp;
short stop=0, do_update=0;
@@ -975,7 +990,7 @@ void ED_preview_iconrender(Scene *scene, ID *id, int *rect, int sizex, int sizey
sp->sizex= sizex;
sp->sizey= sizey;
sp->pr_method= PR_ICON_RENDER;
- sp->pr_rect= rect;
+ sp->pr_rect= (int *)rect; /* shouldnt pr_rect be unsigned int also? - Campbell */
sp->id = id;
shader_preview_startjob(sp, &stop, &do_update);
diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt
index 4ed1e59a87f..7429f45c00f 100644
--- a/source/blender/editors/screen/CMakeLists.txt
+++ b/source/blender/editors/screen/CMakeLists.txt
@@ -35,13 +35,11 @@ SET(INC ../../windowmanager
../../blenlib ../../makesdna ../../makesrna ../../blenkernel
../../include ../../imbuf
../../render/extern/include ../../../../intern/bsp/extern
- ../../radiosity/extern/include
../../../intern/decimation/extern ../../blenloader
- ../../../kernel/gen_system ../../../../intern/SoundSystem ../../readstreamglue
- ../../quicktime ../../../../intern/elbeem/extern
+ ../../../kernel/gen_system ../../readstreamglue
+ ../../../../intern/elbeem/extern
../../../../intern/ghost ../../../../intern/opennl/extern
../../nodes
- ${SDL_INC}
)
IF(WITH_INTERNATIONAL)
@@ -53,7 +51,7 @@ IF(WITH_OPENEXR)
ENDIF(WITH_OPENEXR)
IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
+ SET(INC ${INC} ../../quicktime ${QUICKTIME_INC})
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
diff --git a/source/blender/editors/screen/Makefile b/source/blender/editors/screen/Makefile
index 923a020afcf..00698917be5 100644
--- a/source/blender/editors/screen/Makefile
+++ b/source/blender/editors/screen/Makefile
@@ -54,3 +54,8 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# own include
CPPFLAGS += -I../include
+
+ifeq ($(WITH_OPENEXR), true)
+ CPPFLAGS += -DWITH_OPENEXR
+endif
+
diff --git a/source/blender/editors/screen/SConscript b/source/blender/editors/screen/SConscript
index 3972efd8eed..a4f73cfea7e 100644
--- a/source/blender/editors/screen/SConscript
+++ b/source/blender/editors/screen/SConscript
@@ -12,5 +12,7 @@ defs = ''
if not env['WITH_BF_PYTHON']:
defs += 'DISABLE_PYTHON'
+if env['WITH_BF_OPENEXR']:
+ defs += ' WITH_OPENEXR'
env.BlenderLib ( 'bf_editors_screen', sources, Split(incs), Split(defs), libtype=['core'], priority=[105] )
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 79ba11a5c55..9a116bf95c0 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -249,7 +249,7 @@ void ED_area_overdraw(bContext *C)
}
/* get scissor rect, checking overlapping regions */
-static void region_scissor_winrct(ARegion *ar, rcti *winrct)
+void region_scissor_winrct(ARegion *ar, rcti *winrct)
{
*winrct= ar->winrct;
@@ -499,7 +499,7 @@ static void region_azone_initialize(ScrArea *sa, ARegion *ar, char edge)
/* if more azones on 1 spot, set offset */
for(azt= sa->actionzones.first; azt; azt= azt->next) {
if(az!=azt) {
- if(az->x1==azt->x1 && az->y1==azt->y1) {
+ if( ABS(az->x1-azt->x1) < 2 && ABS(az->y1-azt->y1) < 2) {
if(edge=='t' || edge=='b') {
az->x1+= AZONESPOT;
az->x2+= AZONESPOT;
@@ -797,6 +797,10 @@ static void ed_default_handlers(wmWindowManager *wm, ListBase *handlers, int fla
ListBase *keymap= WM_keymap_listbase(wm, "Frames", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
+ if(flag & ED_KEYMAP_GPENCIL) {
+ ListBase *keymap= WM_keymap_listbase(wm, "Grease Pencil", 0, 0);
+ WM_event_add_keymap_handler(handlers, keymap);
+ }
}
@@ -1041,39 +1045,38 @@ void ED_area_prevspace(bContext *C)
static char *windowtype_pup(void)
{
return(
- "Window type:%t" //14
- "|3D View %x1" //30
-
- "|%l" // 33
-
- "|Graph Editor %x2" //54
- "|DopeSheet %x12" //73
- "|NLA Editor %x13" //94
-
- "|%l" //97
-
- "|UV/Image Editor %x6" //117
+ "Window type:%t"
+ "|3D View %x1"
+
+ "|%l"
- "|Video Sequence Editor %x8" //143
- "|Timeline %x15" //163
- // "|Audio Window %x11" //163
- "|Text Editor %x9" //179
+ "|Timeline %x15"
+ "|Graph Editor %x2"
+ "|DopeSheet %x12"
+ "|NLA Editor %x13"
- "|%l" //192
+ "|%l"
+ "|UV/Image Editor %x6"
- "|User Preferences %x7" //213
- "|Outliner %x3" //232
- "|Buttons Window %x4" //251
+ "|Video Sequence Editor %x8"
+ "|Text Editor %x9"
"|Node Editor %x16"
"|Logic Editor %x17"
- "|%l" //254
- "|File Browser %x5" //290
+ "|%l"
+
+ "|Properties %x4"
+ "|Outliner %x3"
+ "|User Preferences %x19"
+ "|Info%x7"
+
+ "|%l"
+
+ "|File Browser %x5"
- "|%l" //293
+ "|%l"
- // "|Scripts Window %x14"//313
"|Console %x18"
);
}
@@ -1245,6 +1248,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex
/* before setting the view */
if(vertical) {
+ /* only allow scrolling in vertical direction */
v2d->keepofs |= V2D_LOCKOFS_X|V2D_KEEPOFS_Y;
v2d->keepofs &= ~(V2D_LOCKOFS_Y|V2D_KEEPOFS_X);
@@ -1255,8 +1259,12 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex
y= -y;
}
else {
- v2d->keepofs |= V2D_LOCKOFS_Y|V2D_KEEPOFS_X;
- v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_KEEPOFS_Y);
+ /* for now, allow scrolling in both directions (since layouts are optimised for vertical,
+ * they often don't fit in horizontal layout)
+ */
+ v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_LOCKOFS_Y|V2D_KEEPOFS_X|V2D_KEEPOFS_Y);
+ //v2d->keepofs |= V2D_LOCKOFS_Y|V2D_KEEPOFS_X;
+ //v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_KEEPOFS_Y);
// don't jump back when panels close or hide
if(!newcontext)
@@ -1309,7 +1317,7 @@ void ED_region_header(const bContext *C, ARegion *ar)
HeaderType *ht;
Header header = {0};
float col[3];
- int xco, yco;
+ int maxco, xco, yco;
/* clear */
if(ED_screen_area_active(C))
@@ -1323,7 +1331,7 @@ void ED_region_header(const bContext *C, ARegion *ar)
/* set view2d view matrix for scrolling (without scrollers) */
UI_view2d_view_ortho(C, &ar->v2d);
- xco= 8;
+ xco= maxco= 8;
yco= HEADERY-3;
/* draw all headers types */
@@ -1335,15 +1343,25 @@ void ED_region_header(const bContext *C, ARegion *ar)
header.type= ht;
header.layout= layout;
ht->draw(C, &header);
+
+ /* for view2d */
+ xco= uiLayoutGetWidth(layout);
+ if(xco > maxco)
+ maxco= xco;
}
uiBlockLayoutResolve(C, block, &xco, &yco);
+
+ /* for view2d */
+ if(xco > maxco)
+ maxco= xco;
+
uiEndBlock(C, block);
uiDrawBlock(C, block);
}
/* always as last */
- UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
+ UI_view2d_totRect_set(&ar->v2d, maxco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
/* restore view matrix? */
UI_view2d_view_restore(C);
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index 3842dd3d62f..1e36a32b9e1 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -44,6 +44,10 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
bScreen *sc= CTX_wm_screen(C);
Scene *scene= sc->scene;
Base *base;
+ Object *ob = NULL;
+
+ if(scene && scene->basact)
+ ob = scene->basact->object;
if(CTX_data_dir(member)) {
static const char *dir[] = {
@@ -112,32 +116,32 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
else if(CTX_data_equals(member, "sculpt_object")) {
- if(G.f & G_SCULPTMODE && scene->basact)
- CTX_data_id_pointer_set(result, &scene->basact->object->id);
+ if(ob && (ob->mode & OB_MODE_SCULPT))
+ CTX_data_id_pointer_set(result, &ob->id);
return 1;
}
else if(CTX_data_equals(member, "vertex_paint_object")) {
- if(G.f & G_VERTEXPAINT && scene->basact)
- CTX_data_id_pointer_set(result, &scene->basact->object->id);
+ if(ob && (ob->mode & OB_MODE_VERTEX_PAINT))
+ CTX_data_id_pointer_set(result, &ob->id);
return 1;
}
else if(CTX_data_equals(member, "weight_paint_object")) {
- if(G.f & G_WEIGHTPAINT && scene->basact)
- CTX_data_id_pointer_set(result, &scene->basact->object->id);
+ if(ob && (ob->mode & OB_MODE_WEIGHT_PAINT))
+ CTX_data_id_pointer_set(result, &ob->id);
return 1;
}
else if(CTX_data_equals(member, "texture_paint_object")) {
- if(G.f & G_TEXTUREPAINT && scene->basact)
- CTX_data_id_pointer_set(result, &scene->basact->object->id);
+ if(ob && (ob->mode & OB_MODE_TEXTURE_PAINT))
+ CTX_data_id_pointer_set(result, &ob->id);
return 1;
}
else if(CTX_data_equals(member, "particle_edit_object")) {
- if(G.f & G_PARTICLEEDIT && scene->basact)
- CTX_data_id_pointer_set(result, &scene->basact->object->id);
+ if(ob && (ob->mode & OB_MODE_PARTICLE_EDIT))
+ CTX_data_id_pointer_set(result, &ob->id);
return 1;
}
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 817959aef13..aa36675fb90 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -923,12 +923,6 @@ bScreen *ED_screen_duplicate(wmWindow *win, bScreen *sc)
newsc= ED_screen_add(win, sc->scene, sc->id.name+2);
/* copy all data */
screen_copy(newsc, sc);
- /* set in window */
- win->screen= newsc;
-
- /* store identifier */
- win->screen->winid= win->winid;
- BLI_strncpy(win->screenname, win->screen->id.name+2, 21);
return newsc;
}
@@ -1289,6 +1283,49 @@ void ED_screen_set(bContext *C, bScreen *sc)
}
}
+static int ed_screen_used(wmWindowManager *wm, bScreen *sc)
+{
+ wmWindow *win;
+
+ for(win=wm->windows.first; win; win=win->next)
+ if(win->screen == sc)
+ return 1;
+
+ return 0;
+}
+
+/* only call outside of area/region loops */
+void ED_screen_delete(bContext *C, bScreen *sc)
+{
+ Main *bmain= CTX_data_main(C);
+ wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindow *win= CTX_wm_window(C);
+ bScreen *newsc;
+ int delete= 1;
+
+ /* screen can only be in use by one window at a time, so as
+ long as we are able to find a screen that is unused, we
+ can safely assume ours is not in use anywhere an delete it */
+
+ for(newsc= sc->id.prev; newsc; newsc=newsc->id.prev)
+ if(!ed_screen_used(wm, newsc))
+ break;
+
+ if(!newsc) {
+ for(newsc= sc->id.next; newsc; newsc=newsc->id.next)
+ if(!ed_screen_used(wm, newsc))
+ break;
+ }
+
+ if(!newsc)
+ return;
+
+ ED_screen_set(C, newsc);
+
+ if(delete && win->screen != sc)
+ free_libblock(&bmain->screen, sc);
+}
+
/* only call outside of area/region loops */
void ED_screen_set_scene(bContext *C, Scene *scene)
{
@@ -1346,6 +1383,24 @@ void ED_screen_set_scene(bContext *C, Scene *scene)
}
+/* only call outside of area/region loops */
+void ED_screen_delete_scene(bContext *C, Scene *scene)
+{
+ Main *bmain= CTX_data_main(C);
+ Scene *newscene;
+
+ if(scene->id.prev)
+ newscene= scene->id.prev;
+ else if(scene->id.next)
+ newscene= scene->id.next;
+ else
+ return;
+
+ ED_screen_set_scene(C, newscene);
+
+ unlink_scene(bmain, scene, newscene);
+}
+
/* this function toggles: if area is full then the parent will be restored */
void ed_screen_fullarea(bContext *C, ScrArea *sa)
{
@@ -1461,7 +1516,7 @@ void ED_screen_full_prevspace(bContext *C)
/* redraws: uses defines from stime->redraws
* enable: 1 - forward on, -1 - backwards on, 0 - off
*/
-void ED_screen_animation_timer(bContext *C, int redraws, int enable)
+void ED_screen_animation_timer(bContext *C, int redraws, int sync, int enable)
{
bScreen *screen= CTX_wm_screen(C);
wmWindow *win= CTX_wm_window(C);
@@ -1472,12 +1527,13 @@ void ED_screen_animation_timer(bContext *C, int redraws, int enable)
screen->animtimer= NULL;
if(enable) {
- struct ScreenAnimData *sad= MEM_mallocN(sizeof(ScreenAnimData), "ScreenAnimData");
+ struct ScreenAnimData *sad= MEM_callocN(sizeof(ScreenAnimData), "ScreenAnimData");
screen->animtimer= WM_event_add_window_timer(win, TIMER0, (1.0/FPS));
sad->ar= CTX_wm_region(C);
sad->redraws= redraws;
- sad->reverse= (enable < 0);
+ sad->flag |= (enable < 0)? ANIMPLAY_FLAG_REVERSE: 0;
+ sad->flag |= (sync == 0)? ANIMPLAY_FLAG_NO_SYNC: (sync == 1)? ANIMPLAY_FLAG_SYNC: 0;
screen->animtimer->customdata= sad;
}
@@ -1485,6 +1541,45 @@ void ED_screen_animation_timer(bContext *C, int redraws, int enable)
WM_event_add_notifier(C, NC_SCREEN|ND_ANIMPLAY, screen);
}
+/* helper for screen_animation_play() - only to be used for TimeLine */
+static ARegion *time_top_left_3dwindow(bScreen *screen)
+{
+ ARegion *aret= NULL;
+ ScrArea *sa;
+ int min= 10000;
+
+ for(sa= screen->areabase.first; sa; sa= sa->next) {
+ if(sa->spacetype==SPACE_VIEW3D) {
+ ARegion *ar;
+ for(ar= sa->regionbase.first; ar; ar= ar->next) {
+ if(ar->regiontype==RGN_TYPE_WINDOW) {
+ if(ar->winrct.xmin - ar->winrct.ymin < min) {
+ aret= ar;
+ min= ar->winrct.xmin - ar->winrct.ymin;
+ }
+ }
+ }
+ }
+ }
+
+ return aret;
+}
+
+void ED_screen_animation_timer_update(bContext *C, int redraws)
+{
+ bScreen *screen= CTX_wm_screen(C);
+
+ if(screen && screen->animtimer) {
+ wmTimer *wt= screen->animtimer;
+ ScreenAnimData *sad= wt->customdata;
+
+ sad->redraws= redraws;
+ sad->ar= NULL;
+ if(redraws & TIME_REGION)
+ sad->ar= time_top_left_3dwindow(screen);
+ }
+}
+
unsigned int ED_screen_view3d_layers(bScreen *screen)
{
if(screen) {
@@ -1503,7 +1598,6 @@ unsigned int ED_screen_view3d_layers(bScreen *screen)
/* results in fully updated anim system */
-/* in future sound should be on WM level, only 1 sound can play! */
void ED_update_for_newframe(const bContext *C, int mute)
{
bScreen *screen= CTX_wm_screen(C);
@@ -1515,7 +1609,7 @@ void ED_update_for_newframe(const bContext *C, int mute)
/* XXX future: do all windows */
scene_update_for_newframe(scene, ED_screen_view3d_layers(screen)); /* BKE_scene.h */
- //if ( (CFRA>1) && (!mute) && (scene->audio.flag & AUDIO_SCRUB))
+ //if ( (CFRA>1) && (!mute) && (scene->r.audio.flag & AUDIO_SCRUB))
// audiostream_scrub( CFRA );
/* 3d window, preview */
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 07454088604..cb874ec1447 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -54,8 +54,10 @@
#include "BKE_mesh.h"
#include "BKE_multires.h"
#include "BKE_report.h"
+#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_utildefines.h"
+#include "BKE_sound.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -230,7 +232,7 @@ int ED_operator_posemode(bContext *C)
Object *obedit= CTX_data_edit_object(C);
if ((obact != obedit) && (obact) && (obact->type==OB_ARMATURE))
- return (obact->flag & OB_POSEMODE)!=0;
+ return (obact->mode & OB_MODE_POSE)!=0;
return 0;
}
@@ -1411,6 +1413,37 @@ static void SCREEN_OT_frame_offset(wmOperatorType *ot)
RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
}
+
+/* function to be called outside UI context, or for redo */
+static int frame_jump_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+
+ if (RNA_boolean_get(op->ptr, "end"))
+ CFRA= PEFRA;
+ else
+ CFRA= PSFRA;
+
+ WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+static void SCREEN_OT_frame_jump(wmOperatorType *ot)
+{
+ ot->name = "Jump to Endpoint";
+ ot->idname = "SCREEN_OT_frame_jump";
+
+ ot->exec= frame_jump_exec;
+
+ ot->poll= ED_operator_screenactive;
+ ot->flag= 0;
+
+ /* rna */
+ RNA_def_boolean(ot->srna, "end", 0, "Last Frame", "Jump to the last frame of the frame range.");
+}
+
+
/* ************** jump to keyframe operator ***************************** */
/* helper function - find actkeycolumn that occurs on cframe, or the nearest one if not found */
@@ -1549,7 +1582,6 @@ static void SCREEN_OT_screen_set(wmOperatorType *ot)
ot->poll= ED_operator_screenactive;
/* rna */
- RNA_def_pointer_runtime(ot->srna, "screen", &RNA_Screen, "Screen", "");
RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
}
@@ -2194,48 +2226,69 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event)
wmTimer *wt= screen->animtimer;
ScreenAnimData *sad= wt->customdata;
ScrArea *sa;
+ int sync;
+
+ /* sync, don't sync, or follow scene setting */
+ if(sad->flag & ANIMPLAY_FLAG_SYNC) sync= 1;
+ else if(sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0;
+ else sync= (scene->r.audio.flag & AUDIO_SYNC);
- if(scene->audio.flag & AUDIO_SYNC) {
+ if(sync) {
+ /* skip frames */
int step = floor(wt->duration * FPS);
- if (sad->reverse) // XXX does this option work with audio?
+ if(sad->flag & ANIMPLAY_FLAG_REVERSE) // XXX does this option work with audio?
scene->r.cfra -= step;
else
scene->r.cfra += step;
wt->duration -= ((float)step)/FPS;
}
else {
- if (sad->reverse)
+ /* one frame +/- */
+ if(sad->flag & ANIMPLAY_FLAG_REVERSE)
scene->r.cfra--;
else
scene->r.cfra++;
}
- if (sad->reverse) {
- /* jump back to end */
+ /* reset 'jumped' flag before checking if we need to jump... */
+ sad->flag &= ~ANIMPLAY_FLAG_JUMPED;
+
+ if (sad->flag & ANIMPLAY_FLAG_REVERSE) {
+ /* jump back to end? */
if (scene->r.psfra) {
- if(scene->r.cfra < scene->r.psfra)
+ if (scene->r.cfra < scene->r.psfra) {
scene->r.cfra= scene->r.pefra;
+ sad->flag |= ANIMPLAY_FLAG_JUMPED;
+ }
}
else {
- if(scene->r.cfra < scene->r.sfra)
+ if (scene->r.cfra < scene->r.sfra) {
scene->r.cfra= scene->r.efra;
+ sad->flag |= ANIMPLAY_FLAG_JUMPED;
+ }
}
}
else {
- /* jump back to start */
+ /* jump back to start? */
if (scene->r.psfra) {
- if(scene->r.cfra > scene->r.pefra)
+ if (scene->r.cfra > scene->r.pefra) {
scene->r.cfra= scene->r.psfra;
+ sad->flag |= ANIMPLAY_FLAG_JUMPED;
+ }
}
else {
- if(scene->r.cfra > scene->r.efra)
+ if (scene->r.cfra > scene->r.efra) {
scene->r.cfra= scene->r.sfra;
+ sad->flag |= ANIMPLAY_FLAG_JUMPED;
+ }
}
}
/* since we follow drawflags, we can't send notifier but tag regions ourselves */
ED_update_for_newframe(C, 1);
-
+
+ sound_update_playing(C);
+
for(sa= screen->areabase.first; sa; sa= sa->next) {
ARegion *ar;
for(ar= sa->regionbase.first; ar; ar= ar->next) {
@@ -2275,18 +2328,35 @@ static int screen_animation_play(bContext *C, wmOperator *op, wmEvent *event)
bScreen *screen= CTX_wm_screen(C);
if(screen->animtimer) {
- ED_screen_animation_timer(C, 0, 0);
+ ED_screen_animation_timer(C, 0, 0, 0);
+ sound_stop_all(C);
}
else {
+ ScrArea *sa= CTX_wm_area(C);
int mode= (RNA_boolean_get(op->ptr, "reverse")) ? -1 : 1;
+ int sync= -1;
+
+ if(RNA_property_is_set(op->ptr, "sync"))
+ sync= (RNA_boolean_get(op->ptr, "sync"));
- ED_screen_animation_timer(C, TIME_REGION|TIME_ALL_3D_WIN, mode);
-
- if(screen->animtimer) {
- wmTimer *wt= screen->animtimer;
- ScreenAnimData *sad= wt->customdata;
+ /* timeline gets special treatment since it has it's own menu for determining redraws */
+ if ((sa) && (sa->spacetype == SPACE_TIME)) {
+ SpaceTime *stime= (SpaceTime *)sa->spacedata.first;
+
+ ED_screen_animation_timer(C, stime->redraws, sync, mode);
- sad->ar= CTX_wm_region(C);
+ /* update region if TIME_REGION was set, to leftmost 3d window */
+ ED_screen_animation_timer_update(C, stime->redraws);
+ }
+ else {
+ ED_screen_animation_timer(C, TIME_REGION|TIME_ALL_3D_WIN, sync, mode);
+
+ if(screen->animtimer) {
+ wmTimer *wt= screen->animtimer;
+ ScreenAnimData *sad= wt->customdata;
+
+ sad->ar= CTX_wm_region(C);
+ }
}
}
@@ -2305,6 +2375,7 @@ static void SCREEN_OT_animation_play(wmOperatorType *ot)
ot->poll= ED_operator_screenactive;
RNA_def_boolean(ot->srna, "reverse", 0, "Play in Reverse", "Animation is played backwards");
+ RNA_def_boolean(ot->srna, "sync", 0, "Sync", "Drop frames to maintain framerate and stay in sync with audio.");
}
/* ************** border select operator (template) ***************************** */
@@ -2813,10 +2884,13 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
RenderJob *rj;
Image *ima;
- /* only one job at a time */
+ /* only one render job at a time */
if(WM_jobs_test(CTX_wm_manager(C), scene))
return OPERATOR_CANCELLED;
+ /* stop all running jobs, currently previews frustrate Render */
+ WM_jobs_stop_all(CTX_wm_manager(C));
+
/* handle UI stuff */
WM_cursor_wait(1);
@@ -3020,7 +3094,124 @@ static void SCREEN_OT_userpref_show(struct wmOperatorType *ot)
ot->poll= ED_operator_screenactive;
}
+/********************* new screen operator *********************/
+static int screen_new_exec(bContext *C, wmOperator *op)
+{
+ wmWindow *win= CTX_wm_window(C);
+ bScreen *sc= CTX_wm_screen(C);
+
+ sc= ED_screen_duplicate(win, sc);
+ WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, sc);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCREEN_OT_new(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "New Screen";
+ ot->idname= "SCREEN_OT_new";
+
+ /* api callbacks */
+ ot->exec= screen_new_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************* delete screen operator *********************/
+
+static int screen_delete_exec(bContext *C, wmOperator *op)
+{
+ bScreen *sc= CTX_wm_screen(C);
+
+ WM_event_add_notifier(C, NC_SCREEN|ND_SCREENDELETE, sc);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCREEN_OT_delete(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Delete Scene";
+ ot->idname= "SCREEN_OT_delete";
+
+ /* api callbacks */
+ ot->exec= screen_delete_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************* new scene operator *********************/
+
+static int scene_new_exec(bContext *C, wmOperator *op)
+{
+ Scene *newscene, *scene= CTX_data_scene(C);
+ Main *bmain= CTX_data_main(C);
+ int type= RNA_enum_get(op->ptr, "type");
+
+ newscene= copy_scene(bmain, scene, type);
+
+ /* these can't be handled in blenkernel curently, so do them here */
+ if(type == SCE_COPY_LINK_DATA)
+ ED_object_single_users(newscene, 0);
+ else if(type == SCE_COPY_FULL)
+ ED_object_single_users(newscene, 1);
+
+ WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, newscene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCENE_OT_new(wmOperatorType *ot)
+{
+ static EnumPropertyItem type_items[]= {
+ {SCE_COPY_EMPTY, "EMPTY", 0, "Empty", "Add empty scene."},
+ {SCE_COPY_LINK_OB, "LINK_OBJECTS", 0, "Link Objects", "Link to the objects from the current scene."},
+ {SCE_COPY_LINK_DATA, "LINK_OBJECT_DATA", 0, "Link Object Data", "Copy objects linked to data from the current scene."},
+ {SCE_COPY_FULL, "FULL_COPY", 0, "Full Copy", "Make a full copy of the current scene."},
+ {0, NULL, 0, NULL, NULL}};
+
+ /* identifiers */
+ ot->name= "New Scene";
+ ot->idname= "SCENE_OT_new";
+
+ /* api callbacks */
+ ot->exec= scene_new_exec;
+ ot->invoke= WM_menu_invoke;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
+}
+
+/********************* delete scene operator *********************/
+
+static int scene_delete_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+
+ WM_event_add_notifier(C, NC_SCENE|ND_SCENEDELETE, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCENE_OT_delete(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Delete Scene";
+ ot->idname= "SCENE_OT_delete";
+
+ /* api callbacks */
+ ot->exec= scene_delete_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
/* **************** Assigning operatortypes to global list, adding handlers **************** */
@@ -3051,6 +3242,7 @@ void ED_operatortypes_screen(void)
/*frame changes*/
WM_operatortype_append(SCREEN_OT_frame_offset);
+ WM_operatortype_append(SCREEN_OT_frame_jump);
WM_operatortype_append(SCREEN_OT_keyframe_jump);
WM_operatortype_append(SCREEN_OT_animation_step);
@@ -3061,6 +3253,12 @@ void ED_operatortypes_screen(void)
WM_operatortype_append(SCREEN_OT_render_view_cancel);
WM_operatortype_append(SCREEN_OT_render_view_show);
+ /* new/delete */
+ WM_operatortype_append(SCREEN_OT_new);
+ WM_operatortype_append(SCREEN_OT_delete);
+ WM_operatortype_append(SCENE_OT_new);
+ WM_operatortype_append(SCENE_OT_delete);
+
/* tools shared by more space types */
WM_operatortype_append(ED_OT_undo);
WM_operatortype_append(ED_OT_redo);
@@ -3100,6 +3298,7 @@ void ED_keymap_screen(wmWindowManager *wm)
/* Screen General ------------------------------------------------ */
keymap= WM_keymap_listbase(wm, "Screen", 0, 0);
+
/* standard timers */
WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0);
@@ -3128,7 +3327,8 @@ void ED_keymap_screen(wmWindowManager *wm)
WM_keymap_add_item(keymap, "SCREEN_OT_region_foursplit", SKEY, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0);
WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", F3KEY, KM_PRESS, 0, 0);
- WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_last", F4KEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0);
@@ -3136,7 +3336,7 @@ void ED_keymap_screen(wmWindowManager *wm)
WM_keymap_verify_item(keymap, "SCRIPT_OT_python_run_ui_scripts", F8KEY, KM_PRESS, 0, 0);
/* files */
- WM_keymap_add_item(keymap, "FILE_OT_exec", RETKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "FILE_OT_execute", RETKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_cancel", ESCKEY, KM_PRESS, 0, 0);
/* undo */
@@ -3147,12 +3347,17 @@ void ED_keymap_screen(wmWindowManager *wm)
/* render */
WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0);
+// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0);
+// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, KM_CTRL, 0)->ptr, "animation", 1);
+// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1);
+// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1);
WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0);
/* user prefs */
- WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", UKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_OSKEY, 0);
/* Anim Playback ------------------------------------------------ */
keymap= WM_keymap_listbase(wm, "Frames", 0, 0);
@@ -3163,11 +3368,16 @@ void ED_keymap_screen(wmWindowManager *wm)
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "delta", -1);
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "delta", 1);
+ WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 0);
+
WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", PAGEUPKEY, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", PAGEDOWNKEY, KM_PRESS, KM_CTRL, 0)->ptr, "next", 0);
/* play (forward and backwards) */
WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", AKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", KKEY, KM_PRESS, 0, LKEY);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", AKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "reverse", 1);
keymap_modal_set(wm);
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index d69c6dfcdba..5ae1bdf84aa 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -228,7 +228,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update)
rd.frs_sec_base= 1.0f;
if(BKE_imtype_is_movie(rd.imtype))
- mh->start_movie(&rd, sj->dumpsx, sj->dumpsy);
+ mh->start_movie(sj->scene, &rd, sj->dumpsx, sj->dumpsy);
else
mh= NULL;
@@ -242,7 +242,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update)
if(sj->dumprect) {
if(mh) {
- mh->append_movie(&rd, cfra, sj->dumprect, sj->dumpsx, sj->dumpsy);
+ mh->append_movie(&rd, cfra, (int *)sj->dumprect, sj->dumpsx, sj->dumpsy);
printf("Append frame %d\n", cfra);
}
else {
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 48e07b7a489..d082e17cda3 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -71,6 +71,7 @@
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_node.h"
+#include "BKE_paint.h"
#include "BKE_utildefines.h"
#include "BKE_DerivedMesh.h"
#include "BKE_report.h"
@@ -3706,7 +3707,7 @@ static void *do_projectpaint_thread(void *ph_v)
ProjPaintImage *last_projIma= NULL;
ImagePaintPartialRedraw *last_partial_redraw_cell;
- float rgba[4], alpha, dist_nosqrt;
+ float rgba[4], alpha, dist_nosqrt, dist;
float brush_size_sqared;
float falloff;
@@ -3720,6 +3721,7 @@ static void *do_projectpaint_thread(void *ph_v)
float co[2];
float mask = 1.0f; /* airbrush wont use mask */
unsigned short mask_short;
+ float size_half = ((float)ps->brush->size) * 0.5f;
LinkNode *smearPixels = NULL;
LinkNode *smearPixels_f = NULL;
@@ -3754,8 +3756,8 @@ static void *do_projectpaint_thread(void *ph_v)
dist_nosqrt = Vec2Lenf_nosqrt(projPixel->projCoSS, pos);
/*if (dist < s->brush->size) {*/ /* correct but uses a sqrtf */
- if (dist_nosqrt < brush_size_sqared) {
- falloff = brush_sample_falloff_noalpha(ps->brush, sqrtf(dist_nosqrt));
+ if (dist_nosqrt < brush_size_sqared && (dist=sqrtf(dist_nosqrt)) < size_half) {
+ falloff = brush_curve_strength(ps->brush, dist, size_half);
if (falloff > 0.0f) {
if (ps->is_texbrush) {
brush_sample_tex(ps->brush, projPixel->projCoSS, rgba);
@@ -4023,7 +4025,7 @@ static void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, s
if(texpaint || (sima && sima->lock)) {
int w = imapaintpartial.x2 - imapaintpartial.x1;
int h = imapaintpartial.y2 - imapaintpartial.y1;
- GPU_paint_update_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h);
+ GPU_paint_update_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h, !texpaint);
}
}
@@ -4375,15 +4377,17 @@ static Brush *image_paint_brush(bContext *C)
Scene *scene= CTX_data_scene(C);
ToolSettings *settings= scene->toolsettings;
- return settings->imapaint.brush;
+ return paint_brush(&settings->imapaint.paint);
}
static int image_paint_poll(bContext *C)
{
+ Object *obact = CTX_data_active_object(C);
+
if(!image_paint_brush(C))
return 0;
- if((G.f & G_TEXTUREPAINT) && CTX_wm_region_view3d(C)) {
+ if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) {
return 1;
}
else {
@@ -4484,11 +4488,12 @@ static void paint_redraw(bContext *C, ImagePaintState *s, int final)
}
}
-static int paint_init(bContext *C, wmOperator *op)
+static int texture_paint_init(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
ToolSettings *settings= scene->toolsettings;
PaintOperation *pop;
+ Brush *brush;
pop= MEM_callocN(sizeof(PaintOperation), "PaintOperation");
pop->first= 1;
@@ -4516,10 +4521,11 @@ static int paint_init(bContext *C, wmOperator *op)
pop->ps.ar= CTX_wm_region(C);
/* intialize brush */
- if(!settings->imapaint.brush)
+ brush= paint_brush(&settings->imapaint.paint);
+ if(!brush)
return 0;
- pop->s.brush = settings->imapaint.brush;
+ pop->s.brush = brush;
pop->s.tool = settings->imapaint.tool;
if(pop->mode == PAINT_MODE_3D && (pop->s.tool == PAINT_TOOL_CLONE))
pop->s.tool = PAINT_TOOL_DRAW;
@@ -4607,11 +4613,13 @@ static int paint_init(bContext *C, wmOperator *op)
static void paint_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
{
PaintOperation *pop= op->customdata;
- float time;
+ float time, mousef[2];
float pressure;
int mouse[2], redraw;
- RNA_int_get_array(itemptr, "mouse", mouse);
+ RNA_float_get_array(itemptr, "mouse", mousef);
+ mouse[0] = mousef[0];
+ mouse[1] = mousef[1];
time= RNA_float_get(itemptr, "time");
pressure= RNA_float_get(itemptr, "pressure");
@@ -4670,7 +4678,7 @@ static void paint_exit(bContext *C, wmOperator *op)
static int paint_exec(bContext *C, wmOperator *op)
{
- if(!paint_init(C, op)) {
+ if(!texture_paint_init(C, op)) {
MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
}
@@ -4691,7 +4699,7 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
PaintOperation *pop= op->customdata;
wmTabletData *wmtab;
PointerRNA itemptr;
- float pressure;
+ float pressure, mousef[2];
double time;
int tablet, mouse[2];
@@ -4712,7 +4720,7 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
tablet= (wmtab->Active != EVT_TABLET_NONE);
pressure= wmtab->Pressure;
if(wmtab->Active == EVT_TABLET_ERASER)
- pop->s.blend= BRUSH_BLEND_ERASE_ALPHA;
+ pop->s.blend= IMB_BLEND_ERASE_ALPHA;
}
else
pressure= 1.0f;
@@ -4732,7 +4740,9 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
/* fill in stroke */
RNA_collection_add(op->ptr, "stroke", &itemptr);
- RNA_int_set_array(&itemptr, "mouse", mouse);
+ mousef[0] = mouse[0];
+ mousef[1] = mouse[1];
+ RNA_float_set_array(&itemptr, "mouse", mousef);
RNA_float_set(&itemptr, "time", (float)(time - pop->starttime));
RNA_float_set(&itemptr, "pressure", pressure);
@@ -4744,7 +4754,7 @@ static int paint_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
PaintOperation *pop;
- if(!paint_init(C, op)) {
+ if(!texture_paint_init(C, op)) {
MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
}
@@ -4872,7 +4882,7 @@ static int paint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *eve
ToolSettings *ts = CTX_data_scene(C)->toolsettings;
get_imapaint_zoom(C, &zoom, &zoom);
toggle_paint_cursor(C, !ts->imapaint.paintcursor);
- brush_radial_control_invoke(op, ts->imapaint.brush, 0.5 * zoom);
+ brush_radial_control_invoke(op, paint_brush(&ts->imapaint.paint), 0.5 * zoom);
return WM_radial_control_invoke(C, op, event);
}
@@ -4891,7 +4901,7 @@ static int paint_radial_control_exec(bContext *C, wmOperator *op)
int ret;
char str[256];
get_imapaint_zoom(C, &zoom, &zoom);
- ret = brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->imapaint.brush, 2.0 / zoom);
+ ret = brush_radial_control_exec(op, paint_brush(&CTX_data_scene(C)->toolsettings->imapaint.paint), 2.0 / zoom);
WM_radial_control_string(op, str, 256);
return ret;
@@ -5144,13 +5154,13 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
me= get_mesh(ob);
- if(!(G.f & G_TEXTUREPAINT) && !me) {
+ if(!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) {
BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects.");
return OPERATOR_CANCELLED;
}
- if(G.f & G_TEXTUREPAINT) {
- G.f &= ~G_TEXTUREPAINT;
+ if(ob->mode & OB_MODE_TEXTURE_PAINT) {
+ ob->mode &= ~OB_MODE_TEXTURE_PAINT;
if(U.glreslimit != 0)
GPU_free_images();
@@ -5159,13 +5169,13 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
toggle_paint_cursor(C, 0);
}
else {
- G.f |= G_TEXTUREPAINT;
+ ob->mode |= OB_MODE_TEXTURE_PAINT;
if(me->mtface==NULL)
me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
NULL, me->totface);
- brush_check_exists(&scene->toolsettings->imapaint.brush);
+ paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
if(U.glreslimit != 0)
GPU_free_images();
@@ -5200,13 +5210,13 @@ static int texture_paint_radial_control_invoke(bContext *C, wmOperator *op, wmEv
{
ToolSettings *ts = CTX_data_scene(C)->toolsettings;
toggle_paint_cursor(C, !ts->imapaint.paintcursor);
- brush_radial_control_invoke(op, ts->imapaint.brush, 0.5);
+ brush_radial_control_invoke(op, paint_brush(&ts->imapaint.paint), 0.5);
return WM_radial_control_invoke(C, op, event);
}
static int texture_paint_radial_control_exec(bContext *C, wmOperator *op)
{
- int ret = brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->imapaint.brush, 2);
+ int ret = brush_radial_control_exec(op, paint_brush(&CTX_data_scene(C)->toolsettings->imapaint.paint), 2);
char str[256];
WM_radial_control_string(op, str, 256);
@@ -5216,7 +5226,7 @@ static int texture_paint_radial_control_exec(bContext *C, wmOperator *op)
static int texture_paint_poll(bContext *C)
{
if(texture_paint_toggle_poll(C))
- if(G.f & G_TEXTUREPAINT)
+ if(CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT)
return 1;
return 0;
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index b630975c934..ba1b57a1bef 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -29,14 +29,37 @@
#ifndef ED_PAINT_INTERN_H
#define ED_PAINT_INTERN_H
+struct bContext;
struct Scene;
struct Object;
struct Mesh;
+struct PaintStroke;
+struct PointerRNA;
struct ViewContext;
+struct wmEvent;
+struct wmOperator;
struct wmOperatorType;
struct ARegion;
+/* paint_stroke.c */
+typedef int (*StrokeTestStart)(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
+typedef void (*StrokeUpdateStep)(struct bContext *C, struct PaintStroke *stroke, struct PointerRNA *itemptr);
+typedef void (*StrokeDone)(struct bContext *C, struct PaintStroke *stroke);
+
+struct PaintStroke *paint_stroke_new(bContext *C, StrokeTestStart test_start,
+ StrokeUpdateStep update_step, StrokeDone done);
+int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
+int paint_stroke_exec(struct bContext *C, struct wmOperator *op);
+struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke);
+void *paint_stroke_mode_data(struct PaintStroke *stroke);
+void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data);
+int paint_poll(bContext *C);
+void paint_cursor_start(struct bContext *C, int (*poll)(struct bContext *C));
+
/* paint_vertex.c */
+int vertex_paint_mode_poll(bContext *C);
+void clear_vpaint(Scene *scene, int selected);
+
void PAINT_OT_weight_paint_toggle(struct wmOperatorType *ot);
void PAINT_OT_weight_paint_radial_control(struct wmOperatorType *ot);
void PAINT_OT_weight_paint(struct wmOperatorType *ot);
@@ -59,6 +82,7 @@ int imapaint_pick_face(struct ViewContext *vc, struct Mesh *me, int *mval, unsig
void imapaint_pick_uv(struct Scene *scene, struct Object *ob, struct Mesh *mesh, unsigned int faceindex, int *xy, float *uv);
void paint_sample_color(struct Scene *scene, struct ARegion *ar, int x, int y);
+void BRUSH_OT_curve_preset(struct wmOperatorType *ot);
#endif /* ED_PAINT_INTERN_H */
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index e9263ddabf0..c38b36007e9 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -1,15 +1,116 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "DNA_brush_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_brush.h"
+#include "BKE_context.h"
+#include "BKE_paint.h"
#include "ED_sculpt.h"
+#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
#include "paint_intern.h"
+#include <string.h>
+
+/* Brush operators */
+static int brush_add_exec(bContext *C, wmOperator *op)
+{
+ /*int type = RNA_enum_get(op->ptr, "type");*/
+ Brush *br = NULL;
+
+ br = add_brush("Brush");
+
+ if(br)
+ paint_brush_set(paint_get_active(CTX_data_scene(C)), br);
+
+ return OPERATOR_FINISHED;
+}
+
+static EnumPropertyItem brush_type_items[] = {
+ {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt", ""},
+ {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""},
+ {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""},
+ {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+void BRUSH_OT_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Brush";
+ ot->idname= "BRUSH_OT_add";
+
+ /* api callbacks */
+ ot->exec= brush_add_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_enum(ot->srna, "type", brush_type_items, OB_MODE_VERTEX_PAINT, "Type", "Which paint mode to create the brush for.");
+}
+
+static int vertex_color_set_exec(bContext *C, wmOperator *op)
+{
+ int selected = RNA_boolean_get(op->ptr, "selected");
+ Scene *scene = CTX_data_scene(C);
+
+ clear_vpaint(scene, selected);
+
+ return OPERATOR_FINISHED;
+}
+
+void PAINT_OT_vertex_color_set(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Set Vertex Colors";
+ ot->idname= "PAINT_OT_vertex_color_set";
+
+ /* api callbacks */
+ ot->exec= vertex_color_set_exec;
+ ot->poll= vertex_paint_mode_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "selected", 0, "Type", "Only color selected faces.");
+}
+
/**************************** registration **********************************/
void ED_operatortypes_paint(void)
{
+ /* brush */
+ WM_operatortype_append(BRUSH_OT_add);
+ WM_operatortype_append(BRUSH_OT_curve_preset);
+
/* image */
WM_operatortype_append(PAINT_OT_texture_paint_toggle);
WM_operatortype_append(PAINT_OT_texture_paint_radial_control);
@@ -28,5 +129,6 @@ void ED_operatortypes_paint(void)
WM_operatortype_append(PAINT_OT_vertex_paint_radial_control);
WM_operatortype_append(PAINT_OT_vertex_paint_toggle);
WM_operatortype_append(PAINT_OT_vertex_paint);
+ WM_operatortype_append(PAINT_OT_vertex_color_set);
}
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
new file mode 100644
index 00000000000..bd9ea50e0f8
--- /dev/null
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -0,0 +1,330 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 by Nicholas Bishop
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_brush_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "RNA_access.h"
+
+#include "BKE_context.h"
+#include "BKE_paint.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BLI_arithb.h"
+
+#include "PIL_time.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "ED_screen.h"
+#include "ED_view3d.h"
+
+#include "paint_intern.h"
+
+#include <float.h>
+#include <math.h>
+
+typedef struct PaintStroke {
+ void *mode_data;
+ void *smooth_stroke_cursor;
+ wmTimer *timer;
+
+ /* Cached values */
+ ViewContext vc;
+ bglMats mats;
+ Brush *brush;
+
+ float last_mouse_position[2];
+
+ /* Set whether any stroke step has yet occured
+ e.g. in sculpt mode, stroke doesn't start until cursor
+ passes over the mesh */
+ int stroke_started;
+
+ StrokeTestStart test_start;
+ StrokeUpdateStep update_step;
+ StrokeDone done;
+} PaintStroke;
+
+/*** Cursor ***/
+static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata)
+{
+ Brush *brush = paint_brush(paint_get_active(CTX_data_scene(C)));
+ PaintStroke *stroke = customdata;
+
+ glColor4ubv(paint_get_active(CTX_data_scene(C))->paint_cursor_col);
+ glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_BLEND);
+
+ if(stroke && brush && (brush->flag & BRUSH_SMOOTH_STROKE)) {
+ ARegion *ar = CTX_wm_region(C);
+ sdrawline(x, y, (int)stroke->last_mouse_position[0] - ar->winrct.xmin,
+ (int)stroke->last_mouse_position[1] - ar->winrct.ymin);
+ }
+
+ glDisable(GL_BLEND);
+ glDisable(GL_LINE_SMOOTH);
+}
+
+static void paint_draw_cursor(bContext *C, int x, int y, void *customdata)
+{
+ Brush *brush = paint_brush(paint_get_active(CTX_data_scene(C)));
+
+ glColor4ubv(paint_get_active(CTX_data_scene(C))->paint_cursor_col);
+ glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_BLEND);
+
+ glTranslatef((float)x, (float)y, 0.0f);
+ glutil_draw_lined_arc(0.0, M_PI*2.0, brush->size, 40);
+ glTranslatef((float)-x, (float)-y, 0.0f);
+
+ glDisable(GL_BLEND);
+ glDisable(GL_LINE_SMOOTH);
+}
+
+/* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */
+static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, float mouse[2])
+{
+ PointerRNA itemptr;
+ float cur_depth, pressure = 1;
+ float center[3];
+ PaintStroke *stroke = op->customdata;
+
+ cur_depth = read_cached_depth(&stroke->vc, mouse[0], mouse[1]);
+ view3d_unproject(&stroke->mats, center, mouse[0], mouse[1], cur_depth);
+
+ /* Tablet */
+ if(event->custom == EVT_DATA_TABLET) {
+ wmTabletData *wmtab= event->customdata;
+ if(wmtab->Active != EVT_TABLET_NONE)
+ pressure= wmtab->Pressure;
+ }
+
+ /* Add to stroke */
+ RNA_collection_add(op->ptr, "stroke", &itemptr);
+ RNA_float_set_array(&itemptr, "location", center);
+ RNA_float_set_array(&itemptr, "mouse", mouse);
+ RNA_boolean_set(&itemptr, "flip", event->shift);
+ RNA_float_set(&itemptr, "pressure", pressure);
+
+ stroke->last_mouse_position[0] = mouse[0];
+ stroke->last_mouse_position[1] = mouse[1];
+
+ stroke->update_step(C, stroke, &itemptr);
+}
+
+/* Returns zero if no sculpt changes should be made, non-zero otherwise */
+static int paint_smooth_stroke(PaintStroke *stroke, float output[2], wmEvent *event)
+{
+ output[0] = event->x;
+ output[1] = event->y;
+
+ if(stroke->brush->flag & BRUSH_SMOOTH_STROKE && stroke->brush->sculpt_tool != SCULPT_TOOL_GRAB) {
+ float u = stroke->brush->smooth_stroke_factor, v = 1.0 - u;
+ float dx = stroke->last_mouse_position[0] - event->x, dy = stroke->last_mouse_position[1] - event->y;
+
+ /* If the mouse is moving within the radius of the last move,
+ don't update the mouse position. This allows sharp turns. */
+ if(dx*dx + dy*dy < stroke->brush->smooth_stroke_radius * stroke->brush->smooth_stroke_radius)
+ return 0;
+
+ output[0] = event->x * v + stroke->last_mouse_position[0] * u;
+ output[1] = event->y * v + stroke->last_mouse_position[1] * u;
+ }
+
+ return 1;
+}
+
+/* Returns zero if the stroke dots should not be spaced, non-zero otherwise */
+static int paint_space_stroke_enabled(Brush *br)
+{
+ return (br->flag & BRUSH_SPACE) && !(br->flag & BRUSH_ANCHORED) && (br->sculpt_tool != SCULPT_TOOL_GRAB);
+}
+
+/* For brushes with stroke spacing enabled, moves mouse in steps
+ towards the final mouse location. */
+static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const float final_mouse[2])
+{
+ PaintStroke *stroke = op->customdata;
+ int cnt = 0;
+
+ if(paint_space_stroke_enabled(stroke->brush)) {
+ float mouse[2] = {stroke->last_mouse_position[0], stroke->last_mouse_position[1]};
+ float vec[2] = {final_mouse[0] - mouse[0], final_mouse[1] - mouse[1]};
+ float length, scale;
+ int steps = 0, i;
+
+ /* Normalize the vector between the last stroke dot and the goal */
+ length = sqrt(vec[0]*vec[0] + vec[1]*vec[1]);
+
+ if(length > FLT_EPSILON) {
+ scale = stroke->brush->spacing / length;
+ vec[0] *= scale;
+ vec[1] *= scale;
+
+ steps = (int)(length / stroke->brush->spacing);
+ for(i = 0; i < steps; ++i, ++cnt) {
+ mouse[0] += vec[0];
+ mouse[1] += vec[1];
+ paint_brush_stroke_add_step(C, op, event, mouse);
+ }
+ }
+ }
+
+ return cnt;
+}
+
+/**** Public API ****/
+
+PaintStroke *paint_stroke_new(bContext *C, StrokeTestStart test_start,
+ StrokeUpdateStep update_step, StrokeDone done)
+{
+ PaintStroke *stroke = MEM_callocN(sizeof(PaintStroke), "PaintStroke");
+
+ stroke->brush = paint_brush(paint_get_active(CTX_data_scene(C)));
+ view3d_set_viewcontext(C, &stroke->vc);
+ view3d_get_transformation(&stroke->vc, stroke->vc.obact, &stroke->mats);
+
+ stroke->test_start = test_start;
+ stroke->update_step = update_step;
+ stroke->done = done;
+
+ return stroke;
+}
+
+int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ ARegion *ar = CTX_wm_region(C);
+ PaintStroke *stroke = op->customdata;
+ float mouse[2];
+
+ if(event->type == TIMER && (event->customdata != stroke->timer))
+ return OPERATOR_RUNNING_MODAL;
+
+ if(!stroke->stroke_started) {
+ stroke->last_mouse_position[0] = event->x;
+ stroke->last_mouse_position[1] = event->y;
+ stroke->stroke_started = stroke->test_start(C, op, event);
+
+ if(stroke->stroke_started) {
+ stroke->smooth_stroke_cursor =
+ WM_paint_cursor_activate(CTX_wm_manager(C), paint_poll, paint_draw_smooth_stroke, stroke);
+
+ if(stroke->brush->flag & BRUSH_AIRBRUSH)
+ stroke->timer = WM_event_add_window_timer(CTX_wm_window(C), TIMER, stroke->brush->rate);
+ }
+
+ ED_region_tag_redraw(ar);
+ }
+
+ if(stroke->stroke_started) {
+ if(paint_smooth_stroke(stroke, mouse, event)) {
+ if(paint_space_stroke_enabled(stroke->brush)) {
+ if(!paint_space_stroke(C, op, event, mouse))
+ ED_region_tag_redraw(ar);
+ }
+ else
+ paint_brush_stroke_add_step(C, op, event, mouse);
+ }
+ else
+ ED_region_tag_redraw(ar);
+ }
+
+ /* TODO: fix hardcoded event here */
+ if(event->type == LEFTMOUSE && event->val == 0) {
+ /* Exit stroke, free data */
+
+ if(stroke->smooth_stroke_cursor)
+ WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor);
+
+ if(stroke->timer)
+ WM_event_remove_window_timer(CTX_wm_window(C), stroke->timer);
+
+ stroke->done(C, stroke);
+ MEM_freeN(stroke);
+ return OPERATOR_FINISHED;
+ }
+ else
+ return OPERATOR_RUNNING_MODAL;
+}
+
+int paint_stroke_exec(bContext *C, wmOperator *op)
+{
+ PaintStroke *stroke = op->customdata;
+
+ RNA_BEGIN(op->ptr, itemptr, "stroke") {
+ stroke->update_step(C, stroke, &itemptr);
+ }
+ RNA_END;
+
+ MEM_freeN(stroke);
+ op->customdata = NULL;
+
+ return OPERATOR_FINISHED;
+}
+
+ViewContext *paint_stroke_view_context(PaintStroke *stroke)
+{
+ return &stroke->vc;
+}
+
+void *paint_stroke_mode_data(struct PaintStroke *stroke)
+{
+ return stroke->mode_data;
+}
+
+void paint_stroke_set_mode_data(PaintStroke *stroke, void *mode_data)
+{
+ stroke->mode_data = mode_data;
+}
+
+int paint_poll(bContext *C)
+{
+ Paint *p = paint_get_active(CTX_data_scene(C));
+ Object *ob = CTX_data_active_object(C);
+
+ return p && ob && paint_brush(p) &&
+ CTX_wm_area(C)->spacetype == SPACE_VIEW3D &&
+ CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW;
+}
+
+void paint_cursor_start(bContext *C, int (*poll)(bContext *C))
+{
+ Paint *p = paint_get_active(CTX_data_scene(C));
+
+ if(p && !p->paint_cursor)
+ p->paint_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), poll, paint_draw_cursor, NULL);
+}
+
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 85ea55331dc..23bc119afb4 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -5,21 +5,31 @@
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
+
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_view3d_types.h"
+#include "RNA_access.h"
+#include "RNA_define.h"
+
#include "BLI_arithb.h"
#include "BKE_brush.h"
+#include "BKE_context.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
+#include "BKE_paint.h"
+
#include "BKE_utildefines.h"
#include "BIF_gl.h"
#include "ED_view3d.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
#include "paint_intern.h"
/* 3D Paint */
@@ -160,7 +170,7 @@ int imapaint_pick_face(ViewContext *vc, Mesh *me, int *mval, unsigned int *index
/* used for both 3d view and image window */
void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
{
- Brush **br = current_brush_source(scene);
+ Brush *br = paint_brush(paint_get_active(scene));
unsigned int col;
char *cp;
@@ -173,10 +183,43 @@ void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
cp = (char *)&col;
- if(br && *br) {
- (*br)->rgb[0]= cp[0]/255.0f;
- (*br)->rgb[1]= cp[1]/255.0f;
- (*br)->rgb[2]= cp[2]/255.0f;
+ if(br) {
+ br->rgb[0]= cp[0]/255.0f;
+ br->rgb[1]= cp[1]/255.0f;
+ br->rgb[2]= cp[2]/255.0f;
}
}
+static int brush_curve_preset_exec(bContext *C, wmOperator *op)
+{
+ Brush *br = paint_brush(paint_get_active(CTX_data_scene(C)));
+ brush_curve_preset(br, RNA_enum_get(op->ptr, "shape"));
+
+ return OPERATOR_FINISHED;
+}
+
+static int brush_curve_preset_poll(bContext *C)
+{
+ Brush *br = paint_brush(paint_get_active(CTX_data_scene(C)));
+
+ return br && br->curve;
+}
+
+void BRUSH_OT_curve_preset(wmOperatorType *ot)
+{
+ static EnumPropertyItem prop_shape_items[] = {
+ {BRUSH_PRESET_SHARP, "SHARP", 0, "Sharp", ""},
+ {BRUSH_PRESET_SMOOTH, "SMOOTH", 0, "Smooth", ""},
+ {BRUSH_PRESET_MAX, "MAX", 0, "Max", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ ot->name= "Preset";
+ ot->idname= "BRUSH_OT_curve_preset";
+
+ ot->exec= brush_curve_preset_exec;
+ ot->poll= brush_curve_preset_poll;
+
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_enum(ot->srna, "shape", prop_shape_items, BRUSH_PRESET_SHARP, "Mode", "");
+}
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 812c41f430e..f66a9fbc1ed 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -62,6 +62,7 @@
#include "DNA_userdef_types.h"
#include "RNA_access.h"
+#include "RNA_define.h"
#include "BKE_armature.h"
#include "BKE_brush.h"
@@ -76,6 +77,7 @@
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_utildefines.h"
#include "WM_api.h"
@@ -90,6 +92,8 @@
#include "ED_util.h"
#include "ED_view3d.h"
+#include "paint_intern.h"
+
/* vp->mode */
#define VP_MIX 0
#define VP_ADD 1
@@ -106,9 +110,19 @@ static void error() {}
/* polling - retrieve whether cursor should be set or operator should be done */
+
+/* Returns true if vertex paint mode is active */
+int vertex_paint_mode_poll(bContext *C)
+{
+ Object *ob = CTX_data_active_object(C);
+
+ return ob && ob->mode == OB_MODE_VERTEX_PAINT;
+}
+
static int vp_poll(bContext *C)
{
- if(G.f & G_VERTEXPAINT) {
+ if(vertex_paint_mode_poll(C) &&
+ paint_brush(&CTX_data_tool_settings(C)->vpaint->paint)) {
ScrArea *sa= CTX_wm_area(C);
if(sa->spacetype==SPACE_VIEW3D) {
ARegion *ar= CTX_wm_region(C);
@@ -121,7 +135,10 @@ static int vp_poll(bContext *C)
static int wp_poll(bContext *C)
{
- if(G.f & G_WEIGHTPAINT) {
+ Object *ob = CTX_data_active_object(C);
+
+ if(ob && ob->mode & OB_MODE_WEIGHT_PAINT &&
+ paint_brush(&CTX_data_tool_settings(C)->wpaint->paint)) {
ScrArea *sa= CTX_wm_area(C);
if(sa->spacetype==SPACE_VIEW3D) {
ARegion *ar= CTX_wm_region(C);
@@ -132,56 +149,6 @@ static int wp_poll(bContext *C)
return 0;
}
-
-/* Cursors */
-static void vp_drawcursor(bContext *C, int x, int y, void *customdata)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
-
- glTranslatef((float)x, (float)y, 0.0f);
-
- glColor4ub(255, 255, 255, 128);
- glEnable( GL_LINE_SMOOTH );
- glEnable(GL_BLEND);
- glutil_draw_lined_arc(0.0, M_PI*2.0, ts->vpaint->brush->size, 40);
- glDisable(GL_BLEND);
- glDisable( GL_LINE_SMOOTH );
-
- glTranslatef((float)-x, (float)-y, 0.0f);
-}
-
-static void wp_drawcursor(bContext *C, int x, int y, void *customdata)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
-
- glTranslatef((float)x, (float)y, 0.0f);
-
- glColor4ub(200, 200, 255, 128);
- glEnable( GL_LINE_SMOOTH );
- glEnable(GL_BLEND);
- glutil_draw_lined_arc(0.0, M_PI*2.0, ts->wpaint->brush->size, 40);
- glDisable(GL_BLEND);
- glDisable( GL_LINE_SMOOTH );
-
- glTranslatef((float)-x, (float)-y, 0.0f);
-}
-
-static void toggle_paint_cursor(bContext *C, int wpaint)
-{
- ToolSettings *ts = CTX_data_scene(C)->toolsettings;
- VPaint *vp = wpaint ? ts->wpaint : ts->vpaint;
-
- if(vp->paintcursor) {
- WM_paint_cursor_end(CTX_wm_manager(C), vp->paintcursor);
- vp->paintcursor = NULL;
- }
- else {
- vp->paintcursor = wpaint ?
- WM_paint_cursor_activate(CTX_wm_manager(C), wp_poll, wp_drawcursor, NULL) :
- WM_paint_cursor_activate(CTX_wm_manager(C), vp_poll, vp_drawcursor, NULL);
- }
-}
-
static VPaint *new_vpaint(int wpaint)
{
VPaint *vp= MEM_callocN(sizeof(VPaint), "VPaint");
@@ -232,7 +199,8 @@ unsigned int rgba_to_mcol(float r, float g, float b, float a)
static unsigned int vpaint_get_current_col(VPaint *vp)
{
- return rgba_to_mcol(vp->brush->rgb[0], vp->brush->rgb[1], vp->brush->rgb[2], 1.0f);
+ Brush *brush = paint_brush(&vp->paint);
+ return rgba_to_mcol(brush->rgb[0], brush->rgb[1], brush->rgb[2], 1.0f);
}
void do_shared_vertexcol(Mesh *me)
@@ -362,34 +330,7 @@ static void copy_wpaint_prev (VPaint *wp, MDeformVert *dverts, int dcount)
}
-void clear_vpaint(Scene *scene)
-{
- Mesh *me;
- Object *ob;
- unsigned int *to, paintcol;
- int a;
-
- if((G.f & G_VERTEXPAINT)==0) return;
-
- ob= OBACT;
- me= get_mesh(ob);
- if(!ob || ob->id.lib) return;
-
- if(me==0 || me->mcol==0 || me->totface==0) return;
-
- paintcol= vpaint_get_current_col(scene->toolsettings->vpaint);
-
- to= (unsigned int *)me->mcol;
- a= 4*me->totface;
- while(a--) {
- *to= paintcol;
- to++;
- }
- DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
-
-}
-
-void clear_vpaint_selectedfaces(Scene *scene)
+void clear_vpaint(Scene *scene, int selected)
{
Mesh *me;
MFace *mf;
@@ -409,7 +350,7 @@ void clear_vpaint_selectedfaces(Scene *scene)
mf = me->mface;
mcol = (unsigned int*)me->mcol;
for (i = 0; i < me->totface; i++, mf++, mcol+=4) {
- if (mf->flag & ME_FACE_SEL) {
+ if (!selected || mf->flag & ME_FACE_SEL) {
mcol[0] = paintcol;
mcol[1] = paintcol;
mcol[2] = paintcol;
@@ -540,10 +481,10 @@ void vpaint_dogamma(Scene *scene)
int a, temp;
unsigned char *cp, gamtab[256];
- if((G.f & G_VERTEXPAINT)==0) return;
-
ob= OBACT;
me= get_mesh(ob);
+
+ if(!(ob->mode & OB_MODE_VERTEX_PAINT)) return;
if(me==0 || me->mcol==0 || me->totface==0) return;
igam= 1.0/vp->gamma;
@@ -721,6 +662,7 @@ static unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac)
static void vpaint_blend(VPaint *vp, unsigned int *col, unsigned int *colorig, unsigned int paintcol, int alpha)
{
+ Brush *brush = paint_brush(&vp->paint);
if(vp->mode==VP_MIX || vp->mode==VP_BLUR) *col= mcol_blend( *col, paintcol, alpha);
else if(vp->mode==VP_ADD) *col= mcol_add( *col, paintcol, alpha);
@@ -734,7 +676,7 @@ static void vpaint_blend(VPaint *vp, unsigned int *col, unsigned int *colorig, u
unsigned int testcol=0, a;
char *cp, *ct, *co;
- alpha= (int)(255.0*vp->brush->alpha);
+ alpha= (int)(255.0*brush->alpha);
if(vp->mode==VP_MIX || vp->mode==VP_BLUR) testcol= mcol_blend( *colorig, paintcol, alpha);
else if(vp->mode==VP_ADD) testcol= mcol_add( *colorig, paintcol, alpha);
@@ -798,8 +740,9 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x
return tot;
}
-static int calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], float *vert_nor, short *mval)
+static int calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], float *vert_nor, float *mval)
{
+ Brush *brush = paint_brush(&vp->paint);
float fac, dx, dy;
int alpha;
short vertco[2];
@@ -810,14 +753,14 @@ static int calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], floa
dy= mval[1]-vertco[1];
fac= sqrt(dx*dx + dy*dy);
- if(fac > vp->brush->size) return 0;
+ if(fac > brush->size) return 0;
if(vp->flag & VP_HARD)
alpha= 255;
else
- alpha= 255.0*vp->brush->alpha*(1.0-fac/vp->brush->size);
+ alpha= 255.0*brush->alpha*(1.0-fac/brush->size);
}
else {
- alpha= 255.0*vp->brush->alpha;
+ alpha= 255.0*brush->alpha;
}
if(vp->flag & VP_NORMALS) {
@@ -839,6 +782,7 @@ static int calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], floa
static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval)
{
+ Brush *brush = paint_brush(&wp->paint);
if(dw==NULL || uw==NULL) return;
@@ -864,7 +808,7 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float
if((wp->flag & VP_SPRAY)==0) {
float testw=0.0f;
- alpha= wp->brush->alpha;
+ alpha= brush->alpha;
if(wp->mode==VP_MIX || wp->mode==VP_BLUR)
testw = paintval*alpha + uw->weight*(1.0-alpha);
else if(wp->mode==VP_ADD)
@@ -1092,12 +1036,12 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */
if(me && me->totface>=MAXINDEX) {
error("Maximum number of faces: %d", MAXINDEX-1);
- G.f &= ~G_WEIGHTPAINT;
+ ob->mode &= ~OB_MODE_WEIGHT_PAINT;
return OPERATOR_CANCELLED;
}
- if(G.f & G_WEIGHTPAINT) G.f &= ~G_WEIGHTPAINT;
- else G.f |= G_WEIGHTPAINT;
+ if(ob->mode & OB_MODE_WEIGHT_PAINT) ob->mode &= ~OB_MODE_WEIGHT_PAINT;
+ else ob->mode |= OB_MODE_WEIGHT_PAINT;
/* Weightpaint works by overriding colors in mesh,
@@ -1107,21 +1051,20 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */
*/
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
- if(G.f & G_WEIGHTPAINT) {
+ if(ob->mode & OB_MODE_WEIGHT_PAINT) {
Object *par;
if(wp==NULL)
wp= scene->toolsettings->wpaint= new_vpaint(1);
- brush_check_exists(&wp->brush);
-
- toggle_paint_cursor(C, 1);
+ paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT);
+ paint_cursor_start(C, wp_poll);
mesh_octree_table(ob, NULL, NULL, 's');
/* verify if active weight group is also active bone */
par= modifiers_isDeformedByArmature(ob);
- if(par && (par->flag & OB_POSEMODE)) {
+ if(par && (par->mode & OB_MODE_POSE)) {
bPoseChannel *pchan;
for(pchan= par->pose->chanbase.first; pchan; pchan= pchan->next)
if(pchan->bone->flag & BONE_ACTIVE)
@@ -1131,9 +1074,6 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */
}
}
else {
- if(wp)
- toggle_paint_cursor(C, 1);
-
mesh_octree_table(ob, NULL, NULL, 'e');
}
@@ -1174,8 +1114,12 @@ void PAINT_OT_weight_paint_toggle(wmOperatorType *ot)
static int vpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- toggle_paint_cursor(C, 0);
- brush_radial_control_invoke(op, CTX_data_scene(C)->toolsettings->vpaint->brush, 1);
+ Paint *p = paint_get_active(CTX_data_scene(C));
+ Brush *brush = paint_brush(p);
+
+ WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor);
+ p->paint_cursor = NULL;
+ brush_radial_control_invoke(op, brush, 1);
return WM_radial_control_invoke(C, op, event);
}
@@ -1183,19 +1127,24 @@ static int vpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
{
int ret = WM_radial_control_modal(C, op, event);
if(ret != OPERATOR_RUNNING_MODAL)
- toggle_paint_cursor(C, 0);
+ paint_cursor_start(C, vp_poll);
return ret;
}
static int vpaint_radial_control_exec(bContext *C, wmOperator *op)
{
- return brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->vpaint->brush, 1);
+ Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->vpaint->paint);
+ return brush_radial_control_exec(op, brush, 1);
}
static int wpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- toggle_paint_cursor(C, 1);
- brush_radial_control_invoke(op, CTX_data_scene(C)->toolsettings->wpaint->brush, 1);
+ Paint *p = paint_get_active(CTX_data_scene(C));
+ Brush *brush = paint_brush(p);
+
+ WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor);
+ p->paint_cursor = NULL;
+ brush_radial_control_invoke(op, brush, 1);
return WM_radial_control_invoke(C, op, event);
}
@@ -1203,13 +1152,14 @@ static int wpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
{
int ret = WM_radial_control_modal(C, op, event);
if(ret != OPERATOR_RUNNING_MODAL)
- toggle_paint_cursor(C, 1);
+ paint_cursor_start(C, wp_poll);
return ret;
}
static int wpaint_radial_control_exec(bContext *C, wmOperator *op)
{
- return brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->wpaint->brush, 1);
+ Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->wpaint->paint);
+ return brush_radial_control_exec(op, brush, 1);
}
void PAINT_OT_weight_paint_radial_control(wmOperatorType *ot)
@@ -1254,206 +1204,10 @@ struct WPaintData {
float wpimat[3][3];
};
-static void wpaint_exit(bContext *C, wmOperator *op)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
- Object *ob= CTX_data_active_object(C);
- struct WPaintData *wpd= op->customdata;
-
- if(wpd->vertexcosnos)
- MEM_freeN(wpd->vertexcosnos);
- MEM_freeN(wpd->indexar);
-
- /* frees prev buffer */
- copy_wpaint_prev(ts->wpaint, NULL, 0);
-
- /* and particles too */
- if(ob->particlesystem.first) {
- ParticleSystem *psys;
- int i;
-
- for(psys= ob->particlesystem.first; psys; psys= psys->next) {
- for(i=0; i<PSYS_TOT_VG; i++) {
- if(psys->vgroup[i]==ob->actdef) {
- psys->recalc |= PSYS_RECALC_RESET;
- break;
- }
- }
- }
- }
-
- DAG_object_flush_update(CTX_data_scene(C), ob, OB_RECALC_DATA);
-
- MEM_freeN(wpd);
- op->customdata= NULL;
-}
-
-
-static int wpaint_modal(bContext *C, wmOperator *op, wmEvent *event)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
- VPaint *wp= ts->wpaint;
-
- switch(event->type) {
- case LEFTMOUSE:
- if(event->val==0) { /* release */
- wpaint_exit(C, op);
- return OPERATOR_FINISHED;
- }
- /* pass on, first press gets painted too */
-
- case MOUSEMOVE:
- {
- struct WPaintData *wpd= op->customdata;
- ViewContext *vc= &wpd->vc;
- Object *ob= vc->obact;
- Mesh *me= ob->data;
- float mat[4][4];
- float paintweight= ts->vgroup_weight;
- int *indexar= wpd->indexar;
- int totindex, index, alpha, totw;
- short mval[2];
-
- view3d_operator_needs_opengl(C);
-
- /* load projection matrix */
- wmMultMatrix(ob->obmat);
- wmGetSingleMatrix(mat);
- wmLoadMatrix(wpd->vc.rv3d->viewmat);
-
- MTC_Mat4SwapMat4(wpd->vc.rv3d->persmat, mat);
-
- mval[0]= event->x - vc->ar->winrct.xmin;
- mval[1]= event->y - vc->ar->winrct.ymin;
-
- /* which faces are involved */
- if(wp->flag & VP_AREA) {
- totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], wp->brush->size);
- }
- else {
- indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
- if(indexar[0]) totindex= 1;
- else totindex= 0;
- }
-
- if(wp->flag & VP_COLINDEX) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if(mface->mat_nr!=ob->actcol-1) {
- indexar[index]= 0;
- }
- }
- }
- }
-
- if((G.f & G_FACESELECT) && me->mface) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if((mface->flag & ME_FACE_SEL)==0) {
- indexar[index]= 0;
- }
- }
- }
- }
-
- /* make sure each vertex gets treated only once */
- /* and calculate filter weight */
- totw= 0;
- if(wp->mode==VP_BLUR)
- paintweight= 0.0f;
- else
- paintweight= ts->vgroup_weight;
-
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= me->mface + (indexar[index]-1);
-
- (me->dvert+mface->v1)->flag= 1;
- (me->dvert+mface->v2)->flag= 1;
- (me->dvert+mface->v3)->flag= 1;
- if(mface->v4) (me->dvert+mface->v4)->flag= 1;
-
- if(wp->mode==VP_BLUR) {
- MDeformWeight *dw, *(*dw_func)(MDeformVert *, int) = verify_defweight;
-
- if(wp->flag & VP_ONLYVGROUP)
- dw_func= get_defweight;
-
- dw= dw_func(me->dvert+mface->v1, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- dw= dw_func(me->dvert+mface->v2, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- dw= dw_func(me->dvert+mface->v3, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- if(mface->v4) {
- dw= dw_func(me->dvert+mface->v4, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- }
- }
- }
- }
-
- if(wp->mode==VP_BLUR)
- paintweight/= (float)totw;
-
- for(index=0; index<totindex; index++) {
-
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= me->mface + (indexar[index]-1);
-
- if((me->dvert+mface->v1)->flag) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v1, mval);
- if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v1, alpha, paintweight, wpd->vgroup_mirror);
- }
- (me->dvert+mface->v1)->flag= 0;
- }
-
- if((me->dvert+mface->v2)->flag) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v2, mval);
- if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v2, alpha, paintweight, wpd->vgroup_mirror);
- }
- (me->dvert+mface->v2)->flag= 0;
- }
-
- if((me->dvert+mface->v3)->flag) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v3, mval);
- if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v3, alpha, paintweight, wpd->vgroup_mirror);
- }
- (me->dvert+mface->v3)->flag= 0;
- }
-
- if((me->dvert+mface->v4)->flag) {
- if(mface->v4) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v4, mval);
- if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v4, alpha, paintweight, wpd->vgroup_mirror);
- }
- (me->dvert+mface->v4)->flag= 0;
- }
- }
- }
- }
-
- MTC_Mat4SwapMat4(vc->rv3d->persmat, mat);
-
- DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA);
- ED_region_tag_redraw(vc->ar);
- }
- }
-
- return OPERATOR_RUNNING_MODAL;
-}
-
-static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *event)
{
Scene *scene= CTX_data_scene(C);
+ struct PaintStroke *stroke = op->customdata;
ToolSettings *ts= CTX_data_tool_settings(C);
VPaint *wp= ts->wpaint;
Object *ob= CTX_data_active_object(C);
@@ -1462,7 +1216,6 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
float mat[4][4], imat[4][4];
if(scene->obedit) return OPERATOR_CANCELLED;
- // XXX if(multires_level1_test()) return;
me= get_mesh(ob);
if(me==NULL || me->totface==0) return OPERATOR_PASS_THROUGH;
@@ -1471,8 +1224,9 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (!me->dvert)
create_dverts(&me->id);
- /* make customdata storage */
- op->customdata= wpd= MEM_callocN(sizeof(struct WPaintData), "WPaintData");
+ /* make mode data storage */
+ wpd= MEM_callocN(sizeof(struct WPaintData), "WPaintData");
+ paint_stroke_set_mode_data(stroke, wpd);
view3d_set_viewcontext(C, &wpd->vc);
wpd->vgroup_mirror= -1;
@@ -1544,11 +1298,203 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
}
- /* do paint once for click only paint */
- wpaint_modal(C, op, event);
+ return 1;
+}
+
+static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr)
+{
+ ToolSettings *ts= CTX_data_tool_settings(C);
+ VPaint *wp= ts->wpaint;
+ Brush *brush = paint_brush(&wp->paint);
+ struct WPaintData *wpd= paint_stroke_mode_data(stroke);
+ ViewContext *vc= &wpd->vc;
+ Object *ob= vc->obact;
+ Mesh *me= ob->data;
+ float mat[4][4];
+ float paintweight= ts->vgroup_weight;
+ int *indexar= wpd->indexar;
+ int totindex, index, alpha, totw;
+ float mval[2];
+
+ view3d_operator_needs_opengl(C);
+
+ /* load projection matrix */
+ wmMultMatrix(ob->obmat);
+ wmGetSingleMatrix(mat);
+ wmLoadMatrix(wpd->vc.rv3d->viewmat);
+
+ RNA_float_get_array(itemptr, "mouse", mval);
+ mval[0]-= vc->ar->winrct.xmin;
+ mval[1]-= vc->ar->winrct.ymin;
+
+ MTC_Mat4SwapMat4(wpd->vc.rv3d->persmat, mat);
+
+ /* which faces are involved */
+ if(wp->flag & VP_AREA) {
+ totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush->size);
+ }
+ else {
+ indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
+ if(indexar[0]) totindex= 1;
+ else totindex= 0;
+ }
+
+ if(wp->flag & VP_COLINDEX) {
+ for(index=0; index<totindex; index++) {
+ if(indexar[index] && indexar[index]<=me->totface) {
+ MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
+
+ if(mface->mat_nr!=ob->actcol-1) {
+ indexar[index]= 0;
+ }
+ }
+ }
+ }
+
+ if((G.f & G_FACESELECT) && me->mface) {
+ for(index=0; index<totindex; index++) {
+ if(indexar[index] && indexar[index]<=me->totface) {
+ MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
+
+ if((mface->flag & ME_FACE_SEL)==0) {
+ indexar[index]= 0;
+ }
+ }
+ }
+ }
+
+ /* make sure each vertex gets treated only once */
+ /* and calculate filter weight */
+ totw= 0;
+ if(wp->mode==VP_BLUR)
+ paintweight= 0.0f;
+ else
+ paintweight= ts->vgroup_weight;
+
+ for(index=0; index<totindex; index++) {
+ if(indexar[index] && indexar[index]<=me->totface) {
+ MFace *mface= me->mface + (indexar[index]-1);
+
+ (me->dvert+mface->v1)->flag= 1;
+ (me->dvert+mface->v2)->flag= 1;
+ (me->dvert+mface->v3)->flag= 1;
+ if(mface->v4) (me->dvert+mface->v4)->flag= 1;
+
+ if(wp->mode==VP_BLUR) {
+ MDeformWeight *dw, *(*dw_func)(MDeformVert *, int) = verify_defweight;
+
+ if(wp->flag & VP_ONLYVGROUP)
+ dw_func= get_defweight;
+
+ dw= dw_func(me->dvert+mface->v1, ob->actdef-1);
+ if(dw) {paintweight+= dw->weight; totw++;}
+ dw= dw_func(me->dvert+mface->v2, ob->actdef-1);
+ if(dw) {paintweight+= dw->weight; totw++;}
+ dw= dw_func(me->dvert+mface->v3, ob->actdef-1);
+ if(dw) {paintweight+= dw->weight; totw++;}
+ if(mface->v4) {
+ dw= dw_func(me->dvert+mface->v4, ob->actdef-1);
+ if(dw) {paintweight+= dw->weight; totw++;}
+ }
+ }
+ }
+ }
+
+ if(wp->mode==VP_BLUR)
+ paintweight/= (float)totw;
+
+ for(index=0; index<totindex; index++) {
+
+ if(indexar[index] && indexar[index]<=me->totface) {
+ MFace *mface= me->mface + (indexar[index]-1);
+
+ if((me->dvert+mface->v1)->flag) {
+ alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v1, mval);
+ if(alpha) {
+ do_weight_paint_vertex(wp, ob, mface->v1, alpha, paintweight, wpd->vgroup_mirror);
+ }
+ (me->dvert+mface->v1)->flag= 0;
+ }
+
+ if((me->dvert+mface->v2)->flag) {
+ alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v2, mval);
+ if(alpha) {
+ do_weight_paint_vertex(wp, ob, mface->v2, alpha, paintweight, wpd->vgroup_mirror);
+ }
+ (me->dvert+mface->v2)->flag= 0;
+ }
+
+ if((me->dvert+mface->v3)->flag) {
+ alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v3, mval);
+ if(alpha) {
+ do_weight_paint_vertex(wp, ob, mface->v3, alpha, paintweight, wpd->vgroup_mirror);
+ }
+ (me->dvert+mface->v3)->flag= 0;
+ }
+
+ if((me->dvert+mface->v4)->flag) {
+ if(mface->v4) {
+ alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v4, mval);
+ if(alpha) {
+ do_weight_paint_vertex(wp, ob, mface->v4, alpha, paintweight, wpd->vgroup_mirror);
+ }
+ (me->dvert+mface->v4)->flag= 0;
+ }
+ }
+ }
+ }
+
+ MTC_Mat4SwapMat4(vc->rv3d->persmat, mat);
+
+ DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA);
+ ED_region_tag_redraw(vc->ar);
+}
+
+static void wpaint_stroke_done(bContext *C, struct PaintStroke *stroke)
+{
+ ToolSettings *ts= CTX_data_tool_settings(C);
+ Object *ob= CTX_data_active_object(C);
+ struct WPaintData *wpd= paint_stroke_mode_data(stroke);
+
+ if(wpd->vertexcosnos)
+ MEM_freeN(wpd->vertexcosnos);
+ MEM_freeN(wpd->indexar);
+
+ /* frees prev buffer */
+ copy_wpaint_prev(ts->wpaint, NULL, 0);
+
+ /* and particles too */
+ if(ob->particlesystem.first) {
+ ParticleSystem *psys;
+ int i;
+
+ for(psys= ob->particlesystem.first; psys; psys= psys->next) {
+ for(i=0; i<PSYS_TOT_VG; i++) {
+ if(psys->vgroup[i]==ob->actdef) {
+ psys->recalc |= PSYS_RECALC_RESET;
+ break;
+ }
+ }
+ }
+ }
+
+ DAG_object_flush_update(CTX_data_scene(C), ob, OB_RECALC_DATA);
+
+ MEM_freeN(wpd);
+}
+
+
+static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+
+ op->customdata = paint_stroke_new(C, wpaint_stroke_test_start,
+ wpaint_stroke_update_step,
+ wpaint_stroke_done);
/* add modal handler */
WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op);
+
+ op->type->modal(C, op, event);
return OPERATOR_RUNNING_MODAL;
}
@@ -1562,13 +1508,14 @@ void PAINT_OT_weight_paint(wmOperatorType *ot)
/* api callbacks */
ot->invoke= wpaint_invoke;
- ot->modal= wpaint_modal;
+ ot->modal= paint_stroke_modal;
/* ot->exec= vpaint_exec; <-- needs stroke property */
ot->poll= wp_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
-
+
+ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}
/* ************ set / clear vertex paint mode ********** */
@@ -1584,40 +1531,35 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */
me= get_mesh(ob);
if(me==NULL || object_data_is_libdata(ob)) {
- G.f &= ~G_VERTEXPAINT;
+ ob->mode &= ~OB_MODE_VERTEX_PAINT;
return OPERATOR_PASS_THROUGH;
}
if(me && me->totface>=MAXINDEX) {
error("Maximum number of faces: %d", MAXINDEX-1);
- G.f &= ~G_VERTEXPAINT;
+ ob->mode &= ~OB_MODE_VERTEX_PAINT;
return OPERATOR_FINISHED;
}
if(me && me->mcol==NULL) make_vertexcol(scene, 0);
/* toggle: end vpaint */
- if(G.f & G_VERTEXPAINT) {
-
- G.f &= ~G_VERTEXPAINT;
+ if(ob->mode & OB_MODE_VERTEX_PAINT) {
- if(vp) {
- toggle_paint_cursor(C, 0);
- vp->paintcursor= NULL;
- }
+ ob->mode &= ~OB_MODE_VERTEX_PAINT;
}
else {
-
- G.f |= G_VERTEXPAINT;
+ ob->mode |= OB_MODE_VERTEX_PAINT;
/* Turn off weight painting */
- if (G.f & G_WEIGHTPAINT)
+ if (ob->mode & OB_MODE_WEIGHT_PAINT)
set_wpaint(C, op);
if(vp==NULL)
vp= scene->toolsettings->vpaint= new_vpaint(0);
- toggle_paint_cursor(C, 0);
- brush_check_exists(&scene->toolsettings->vpaint->brush);
+ paint_cursor_start(C, vp_poll);
+
+ paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT);
}
if (me)
@@ -1668,157 +1610,24 @@ For future:
*/
-struct VPaintData {
+typedef struct VPaintData {
ViewContext vc;
unsigned int paintcol;
int *indexar;
float *vertexcosnos;
float vpimat[3][3];
-};
-
-static void vpaint_exit(bContext *C, wmOperator *op)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
- struct VPaintData *vpd= op->customdata;
-
- if(vpd->vertexcosnos)
- MEM_freeN(vpd->vertexcosnos);
- MEM_freeN(vpd->indexar);
-
- /* frees prev buffer */
- copy_vpaint_prev(ts->vpaint, NULL, 0);
-
- MEM_freeN(vpd);
- op->customdata= NULL;
-}
-
-static int vpaint_modal(bContext *C, wmOperator *op, wmEvent *event)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
- VPaint *vp= ts->vpaint;
-
- switch(event->type) {
- case LEFTMOUSE:
- if(event->val==0) { /* release */
- vpaint_exit(C, op);
- return OPERATOR_FINISHED;
- }
- /* pass on, first press gets painted too */
-
- case MOUSEMOVE:
- {
- struct VPaintData *vpd= op->customdata;
- ViewContext *vc= &vpd->vc;
- Object *ob= vc->obact;
- Mesh *me= ob->data;
- float mat[4][4];
- int *indexar= vpd->indexar;
- int totindex, index;
- short mval[2];
-
- view3d_operator_needs_opengl(C);
-
- /* load projection matrix */
- wmMultMatrix(ob->obmat);
- wmGetSingleMatrix(mat);
- wmLoadMatrix(vc->rv3d->viewmat);
-
- mval[0]= event->x - vc->ar->winrct.xmin;
- mval[1]= event->y - vc->ar->winrct.ymin;
-
- /* which faces are involved */
- if(vp->flag & VP_AREA) {
- totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], vp->brush->size);
- }
- else {
- indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
- if(indexar[0]) totindex= 1;
- else totindex= 0;
- }
-
- MTC_Mat4SwapMat4(vc->rv3d->persmat, mat);
-
- if(vp->flag & VP_COLINDEX) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if(mface->mat_nr!=ob->actcol-1) {
- indexar[index]= 0;
- }
- }
- }
- }
- if((G.f & G_FACESELECT) && me->mface) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if((mface->flag & ME_FACE_SEL)==0)
- indexar[index]= 0;
- }
- }
- }
-
- for(index=0; index<totindex; index++) {
-
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
- unsigned int *mcol= ( (unsigned int *)me->mcol) + 4*(indexar[index]-1);
- unsigned int *mcolorig= ( (unsigned int *)vp->vpaint_prev) + 4*(indexar[index]-1);
- int alpha;
-
- if(vp->mode==VP_BLUR) {
- unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128);
- if(mface->v4) {
- unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128);
- vpd->paintcol= mcol_blend( fcol1, fcol2, 128);
- }
- else {
- vpd->paintcol= mcol_blend( mcol[2], fcol1, 170);
- }
-
- }
-
- alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v1, mval);
- if(alpha) vpaint_blend(vp, mcol, mcolorig, vpd->paintcol, alpha);
-
- alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v2, mval);
- if(alpha) vpaint_blend(vp, mcol+1, mcolorig+1, vpd->paintcol, alpha);
-
- alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v3, mval);
- if(alpha) vpaint_blend(vp, mcol+2, mcolorig+2, vpd->paintcol, alpha);
-
- if(mface->v4) {
- alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v4, mval);
- if(alpha) vpaint_blend(vp, mcol+3, mcolorig+3, vpd->paintcol, alpha);
- }
- }
- }
-
- MTC_Mat4SwapMat4(vc->rv3d->persmat, mat);
-
- do_shared_vertexcol(me);
-
- ED_region_tag_redraw(vc->ar);
-
- DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA);
- }
- break;
- }
-
- return OPERATOR_RUNNING_MODAL;
-}
+} VPaintData;
-static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *event)
{
ToolSettings *ts= CTX_data_tool_settings(C);
+ struct PaintStroke *stroke = op->customdata;
VPaint *vp= ts->vpaint;
struct VPaintData *vpd;
Object *ob= CTX_data_active_object(C);
Mesh *me;
float mat[4][4], imat[4][4];
-
+
/* context checks could be a poll() */
me= get_mesh(ob);
if(me==NULL || me->totface==0) return OPERATOR_PASS_THROUGH;
@@ -1826,8 +1635,9 @@ static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(me->mcol==NULL) make_vertexcol(CTX_data_scene(C), 0);
if(me->mcol==NULL) return OPERATOR_CANCELLED;
- /* make customdata storage */
- op->customdata= vpd= MEM_callocN(sizeof(struct VPaintData), "VPaintData");
+ /* make mode data storage */
+ vpd= MEM_callocN(sizeof(struct VPaintData), "VPaintData");
+ paint_stroke_set_mode_data(stroke, vpd);
view3d_set_viewcontext(C, &vpd->vc);
vpd->vertexcosnos= mesh_get_mapped_verts_nors(vpd->vc.scene, ob);
@@ -1841,12 +1651,119 @@ static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
Mat4MulMat4(mat, ob->obmat, vpd->vc.rv3d->viewmat);
Mat4Invert(imat, mat);
Mat3CpyMat4(vpd->vpimat, imat);
+
+ return 1;
+}
+
+static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, int index, float mval[2])
+{
+ ViewContext *vc = &vpd->vc;
+ Mesh *me = get_mesh(ob);
+ MFace *mface= ((MFace*)me->mface) + index;
+ unsigned int *mcol= ((unsigned int*)me->mcol) + 4*index;
+ unsigned int *mcolorig= ((unsigned int*)vp->vpaint_prev) + 4*index;
+ int alpha, i;
+
+ if((vp->flag & VP_COLINDEX && mface->mat_nr!=ob->actcol-1) ||
+ (G.f & G_FACESELECT && !(mface->flag & ME_FACE_SEL)))
+ return;
+
+ if(vp->mode==VP_BLUR) {
+ unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128);
+ if(mface->v4) {
+ unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128);
+ vpd->paintcol= mcol_blend( fcol1, fcol2, 128);
+ }
+ else {
+ vpd->paintcol= mcol_blend( mcol[2], fcol1, 170);
+ }
+
+ }
+
+ for(i = 0; i < (mface->v4 ? 4 : 3); ++i) {
+ alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*(&mface->v1)[i], mval);
+ if(alpha)
+ vpaint_blend(vp, mcol+i, mcolorig+i, vpd->paintcol, alpha);
+ }
+}
+
+static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr)
+{
+ ToolSettings *ts= CTX_data_tool_settings(C);
+ struct VPaintData *vpd = paint_stroke_mode_data(stroke);
+ VPaint *vp= ts->vpaint;
+ Brush *brush = paint_brush(&vp->paint);
+ ViewContext *vc= &vpd->vc;
+ Object *ob= vc->obact;
+ Mesh *me= ob->data;
+ float mat[4][4];
+ int *indexar= vpd->indexar;
+ int totindex, index;
+ float mval[2];
+
+ RNA_float_get_array(itemptr, "mouse", mval);
+
+ view3d_operator_needs_opengl(C);
+
+ /* load projection matrix */
+ wmMultMatrix(ob->obmat);
+ wmGetSingleMatrix(mat);
+ wmLoadMatrix(vc->rv3d->viewmat);
+
+ mval[0]-= vc->ar->winrct.xmin;
+ mval[1]-= vc->ar->winrct.ymin;
+
+
+ /* which faces are involved */
+ if(vp->flag & VP_AREA) {
+ totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush->size);
+ }
+ else {
+ indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
+ if(indexar[0]) totindex= 1;
+ else totindex= 0;
+ }
+
+ MTC_Mat4SwapMat4(vc->rv3d->persmat, mat);
+
+ for(index=0; index<totindex; index++) {
+ if(indexar[index] && indexar[index]<=me->totface)
+ vpaint_paint_face(vp, vpd, ob, indexar[index]-1, mval);
+ }
+
+ MTC_Mat4SwapMat4(vc->rv3d->persmat, mat);
+
+ ED_region_tag_redraw(vc->ar);
+
+ DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA);
+}
+
+static void vpaint_stroke_done(bContext *C, struct PaintStroke *stroke)
+{
+ ToolSettings *ts= CTX_data_tool_settings(C);
+ struct VPaintData *vpd= paint_stroke_mode_data(stroke);
- /* do paint once for click only paint */
- vpaint_modal(C, op, event);
+ if(vpd->vertexcosnos)
+ MEM_freeN(vpd->vertexcosnos);
+ MEM_freeN(vpd->indexar);
+
+ /* frees prev buffer */
+ copy_vpaint_prev(ts->vpaint, NULL, 0);
+
+ MEM_freeN(vpd);
+}
+
+static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+
+ op->customdata = paint_stroke_new(C, vpaint_stroke_test_start,
+ vpaint_stroke_update_step,
+ vpaint_stroke_done);
/* add modal handler */
WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op);
+
+ op->type->modal(C, op, event);
return OPERATOR_RUNNING_MODAL;
}
@@ -1859,11 +1776,13 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot)
/* api callbacks */
ot->invoke= vpaint_invoke;
- ot->modal= vpaint_modal;
+ ot->modal= paint_stroke_modal;
/* ot->exec= vpaint_exec; <-- needs stroke property */
ot->poll= vp_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+
+ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b1dcef39eee..b08e8ab5c2b 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -64,7 +64,7 @@
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
-#include "BKE_sculpt.h"
+#include "BKE_paint.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
#include "BKE_colortools.h"
@@ -79,6 +79,7 @@
#include "ED_space_api.h"
#include "ED_util.h"
#include "ED_view3d.h"
+#include "paint_intern.h"
#include "sculpt_intern.h"
#include "RNA_access.h"
@@ -124,29 +125,27 @@ typedef enum StrokeFlags {
*/
typedef struct StrokeCache {
/* Invariants */
- float radius;
+ float initial_radius;
float scale[3];
int flag;
float clip_tolerance[3];
- int initial_mouse[2];
+ float initial_mouse[2];
float depth;
/* Variants */
+ float radius;
float true_location[3];
float location[3];
float flip;
float pressure;
- int mouse[2];
+ float mouse[2];
/* The rest is temporary storage that isn't saved as a property */
int first_time; /* Beginning of stroke may do some things special */
- ViewContext vc;
bglMats *mats;
- float *layer_disps; /* Displacements for each vertex */
- float (*mesh_store)[3]; /* Copy of the mesh vertices' locations */
short (*orig_norms)[3]; /* Copy of the mesh vertices' normals */
float (*face_norms)[3]; /* Copy of the mesh faces' normals */
float rotation; /* Texture rotation (radians) for anchored and rake modes */
@@ -178,19 +177,6 @@ typedef struct ProjVert {
* Simple functions to get data from the GL
*/
-/* Uses window coordinates (x,y) and depth component z to find a point in
- modelspace */
-static void unproject(bglMats *mats, float out[3], const short x, const short y, const float z)
-{
- double ux, uy, uz;
-
- gluUnProject(x,y,z, mats->modelview, mats->projection,
- (GLint *)mats->viewport, &ux, &uy, &uz );
- out[0] = ux;
- out[1] = uy;
- out[2] = uz;
-}
-
/* Convert a point in model coordinates to 2D screen coordinates. */
static void projectf(bglMats *mats, const float v[3], float p[2])
{
@@ -215,36 +201,23 @@ static void project(bglMats *mats, const float v[3], short p[2])
*
*/
-/* Return modified brush size. Uses current tablet pressure (if available) to
- shrink the brush. Skipped for grab brush because only the first mouse down
- size is used, which is small if the user has just touched the pen to the
- tablet */
-static char brush_size(Sculpt *sd)
-{
- float size= sd->brush->size;
-
- if((sd->brush->sculpt_tool != SCULPT_TOOL_GRAB) && (sd->brush->flag & BRUSH_SIZE_PRESSURE))
- size *= sd->session->cache->pressure;
-
- return size;
-}
-
/* Return modified brush strength. Includes the direction of the brush, positive
values pull vertices, negative values push. Uses tablet pressure and a
special multiplier found experimentally to scale the strength factor. */
static float brush_strength(Sculpt *sd, StrokeCache *cache)
{
+ Brush *brush = paint_brush(&sd->paint);
/* Primary strength input; square it to make lower values more sensitive */
- float alpha = sd->brush->alpha * sd->brush->alpha;
+ float alpha = brush->alpha * brush->alpha;
- float dir= sd->brush->flag & BRUSH_DIR_IN ? -1 : 1;
+ float dir= brush->flag & BRUSH_DIR_IN ? -1 : 1;
float pressure= 1;
float flip= cache->flip ? -1:1;
- if(sd->brush->flag & BRUSH_ALPHA_PRESSURE)
+ if(brush->flag & BRUSH_ALPHA_PRESSURE)
pressure *= cache->pressure;
- switch(sd->brush->sculpt_tool){
+ switch(brush->sculpt_tool){
case SCULPT_TOOL_DRAW:
case SCULPT_TOOL_INFLATE:
case SCULPT_TOOL_CLAY:
@@ -263,7 +236,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache)
}
/* Handles clipping against a mirror modifier and SCULPT_LOCK axis flags */
-static void sculpt_clip(Sculpt *sd, float *co, const float val[3])
+static void sculpt_clip(Sculpt *sd, SculptSession *ss, float *co, const float val[3])
{
int i;
@@ -271,7 +244,7 @@ static void sculpt_clip(Sculpt *sd, float *co, const float val[3])
if(sd->flags & (SCULPT_LOCK_X << i))
continue;
- if((sd->session->cache->flag & (CLIP_X << i)) && (fabs(co[i]) <= sd->session->cache->clip_tolerance[i]))
+ if((ss->cache->flag & (CLIP_X << i)) && (fabs(co[i]) <= ss->cache->clip_tolerance[i]))
co[i]= 0.0f;
else
co[i]= val[i];
@@ -293,23 +266,24 @@ static void add_norm_if(float view_vec[3], float out[3], float out_flip[3], cons
/* Currently only for the draw brush; finds average normal for all active
vertices */
-static void calc_area_normal(Sculpt *sd, float out[3], const ListBase* active_verts)
+static void calc_area_normal(Sculpt *sd, SculptSession *ss, float out[3], const ListBase* active_verts)
{
- StrokeCache *cache = sd->session->cache;
+ Brush *brush = paint_brush(&sd->paint);
+ StrokeCache *cache = ss->cache;
ActiveData *node = active_verts->first;
- const int view = 0; /* XXX: should probably be a flag, not number: sd->brush_type==SCULPT_TOOL_DRAW ? sculptmode_brush()->view : 0; */
+ const int view = 0; /* XXX: should probably be a flag, not number: brush_type==SCULPT_TOOL_DRAW ? sculptmode_brush()->view : 0; */
float out_flip[3];
float *out_dir = cache->view_normal_symmetry;
out[0]=out[1]=out[2] = out_flip[0]=out_flip[1]=out_flip[2] = 0;
- if(sd->brush->flag & BRUSH_ANCHORED) {
+ if(brush->flag & BRUSH_ANCHORED) {
for(; node; node = node->next)
add_norm_if(out_dir, out, out_flip, cache->orig_norms[node->Index]);
}
else {
for(; node; node = node->next)
- add_norm_if(out_dir, out, out_flip, sd->session->mvert[node->Index].no);
+ add_norm_if(out_dir, out, out_flip, ss->mvert[node->Index].no);
}
if (out[0]==0.0 && out[1]==0.0 && out[2]==0.0) {
@@ -332,7 +306,7 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, const ListBase* active_
float area_normal[3];
ActiveData *node= active_verts->first;
- calc_area_normal(sd, area_normal, active_verts);
+ calc_area_normal(sd, ss, area_normal, active_verts);
while(node){
float *co= ss->mvert[node->Index].co;
@@ -341,7 +315,7 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, const ListBase* active_
co[1]+area_normal[1]*ss->cache->radius*node->Fade*ss->cache->scale[1],
co[2]+area_normal[2]*ss->cache->radius*node->Fade*ss->cache->scale[2]};
- sculpt_clip(sd, co, val);
+ sculpt_clip(sd, ss, co, val);
node= node->next;
}
@@ -391,37 +365,37 @@ static void neighbor_average(SculptSession *ss, float avg[3], const int vert)
VecCopyf(avg, ss->mvert[vert].co);
}
-static void do_smooth_brush(Sculpt *s, const ListBase* active_verts)
+static void do_smooth_brush(Sculpt *s, SculptSession *ss, const ListBase* active_verts)
{
ActiveData *node= active_verts->first;
int i;
for(i = 0; i < 2; ++i) {
while(node){
- float *co= s->session->mvert[node->Index].co;
+ float *co= ss->mvert[node->Index].co;
float avg[3], val[3];
- neighbor_average(s->session, avg, node->Index);
+ neighbor_average(ss, avg, node->Index);
val[0] = co[0]+(avg[0]-co[0])*node->Fade;
val[1] = co[1]+(avg[1]-co[1])*node->Fade;
val[2] = co[2]+(avg[2]-co[2])*node->Fade;
- sculpt_clip(s, co, val);
+ sculpt_clip(s, ss, co, val);
node= node->next;
}
}
}
-static void do_pinch_brush(Sculpt *s, const ListBase* active_verts)
+static void do_pinch_brush(Sculpt *s, SculptSession *ss, const ListBase* active_verts)
{
ActiveData *node= active_verts->first;
while(node) {
- float *co= s->session->mvert[node->Index].co;
- const float val[3]= {co[0]+(s->session->cache->location[0]-co[0])*node->Fade,
- co[1]+(s->session->cache->location[1]-co[1])*node->Fade,
- co[2]+(s->session->cache->location[2]-co[2])*node->Fade};
- sculpt_clip(s, co, val);
+ float *co= ss->mvert[node->Index].co;
+ const float val[3]= {co[0]+(ss->cache->location[0]-co[0])*node->Fade,
+ co[1]+(ss->cache->location[1]-co[1])*node->Fade,
+ co[2]+(ss->cache->location[2]-co[2])*node->Fade};
+ sculpt_clip(s, ss, co, val);
node= node->next;
}
}
@@ -440,7 +414,7 @@ static void do_grab_brush(Sculpt *sd, SculptSession *ss)
VecCopyf(add, grab_delta);
VecMulf(add, node->Fade);
VecAddf(add, add, co);
- sculpt_clip(sd, co, add);
+ sculpt_clip(sd, ss, co, add);
node= node->next;
}
@@ -456,10 +430,10 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, const ListBase *active
if(ss->cache->flip)
lim = -lim;
- calc_area_normal(sd, area_normal, active_verts);
+ calc_area_normal(sd, ss, area_normal, active_verts);
while(node){
- float *disp= &ss->cache->layer_disps[node->Index];
+ float *disp= &ss->layer_disps[node->Index];
float *co= ss->mvert[node->Index].co;
float val[3];
@@ -469,20 +443,19 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, const ListBase *active
if((lim < 0 && *disp < lim) || (lim > 0 && *disp > lim))
*disp = lim;
- val[0] = ss->cache->mesh_store[node->Index][0]+area_normal[0] * *disp*ss->cache->scale[0];
- val[1] = ss->cache->mesh_store[node->Index][1]+area_normal[1] * *disp*ss->cache->scale[1];
- val[2] = ss->cache->mesh_store[node->Index][2]+area_normal[2] * *disp*ss->cache->scale[2];
+ val[0] = ss->mesh_co_orig[node->Index][0]+area_normal[0] * *disp*ss->cache->scale[0];
+ val[1] = ss->mesh_co_orig[node->Index][1]+area_normal[1] * *disp*ss->cache->scale[1];
+ val[2] = ss->mesh_co_orig[node->Index][2]+area_normal[2] * *disp*ss->cache->scale[2];
- sculpt_clip(sd, co, val);
+ sculpt_clip(sd, ss, co, val);
node= node->next;
}
}
-static void do_inflate_brush(Sculpt *s, const ListBase *active_verts)
+static void do_inflate_brush(Sculpt *s, SculptSession *ss, const ListBase *active_verts)
{
ActiveData *node= active_verts->first;
- SculptSession *ss = s->session;
float add[3];
while(node) {
@@ -498,7 +471,7 @@ static void do_inflate_brush(Sculpt *s, const ListBase *active_verts)
add[2]*= ss->cache->scale[2];
VecAddf(add, add, co);
- sculpt_clip(s, co, add);
+ sculpt_clip(s, ss, co, add);
node= node->next;
}
@@ -527,46 +500,86 @@ static void calc_flatten_center(SculptSession *ss, ActiveData *node, float co[3]
VecMulf(co, 1.0f / FLATTEN_SAMPLE_SIZE);
}
+/* Projects a point onto a plane along the plane's normal */
+static void point_plane_project(float intr[3], float co[3], float plane_normal[3], float plane_center[3])
+{
+ float p1[3], sub1[3], sub2[3];
+
+ /* Find the intersection between squash-plane and vertex (along the area normal) */
+ VecSubf(p1, co, plane_normal);
+ VecSubf(sub1, plane_center, p1);
+ VecSubf(sub2, co, p1);
+ VecSubf(intr, co, p1);
+ VecMulf(intr, Inpf(plane_normal, sub1) / Inpf(plane_normal, sub2));
+ VecAddf(intr, intr, p1);
+}
+
+static int plane_point_side(float co[3], float plane_normal[3], float plane_center[3], int flip)
+{
+ float delta[3];
+ float d;
+
+ VecSubf(delta, co, plane_center);
+ d = Inpf(plane_normal, delta);
+
+ if(flip)
+ d = -d;
+
+ return d <= 0.0f;
+}
+
static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, const ListBase *active_verts, int clay)
{
ActiveData *node= active_verts->first;
/* area_normal and cntr define the plane towards which vertices are squashed */
float area_normal[3];
- float cntr[3];
+ float cntr[3], cntr2[3], bstr = 0;
+ int flip = 0;
- calc_area_normal(sd, area_normal, active_verts);
+ calc_area_normal(sd, ss, area_normal, active_verts);
calc_flatten_center(ss, node, cntr);
+ if(clay) {
+ bstr= brush_strength(sd, ss->cache);
+ /* Limit clay application to here */
+ cntr2[0]=cntr[0]+area_normal[0]*bstr*ss->cache->scale[0];
+ cntr2[1]=cntr[1]+area_normal[1]*bstr*ss->cache->scale[1];
+ cntr2[2]=cntr[2]+area_normal[2]*bstr*ss->cache->scale[2];
+ flip = bstr < 0;
+ }
+
while(node){
float *co= ss->mvert[node->Index].co;
- float p1[3], sub1[3], sub2[3], intr[3], val[3];
-
- /* Find the intersection between squash-plane and vertex (along the area normal) */
- VecSubf(p1, co, area_normal);
- VecSubf(sub1, cntr, p1);
- VecSubf(sub2, co, p1);
- VecSubf(intr, co, p1);
- VecMulf(intr, Inpf(area_normal, sub1) / Inpf(area_normal, sub2));
- VecAddf(intr, intr, p1);
-
- VecSubf(val, intr, co);
- VecMulf(val, fabs(node->Fade));
- VecAddf(val, val, co);
+ float intr[3], val[3];
- if(clay) {
- /* Clay brush displaces after flattening */
- float tmp[3];
- VecCopyf(tmp, area_normal);
- VecMulf(tmp, ss->cache->radius * node->Fade * 0.1);
- VecAddf(val, val, tmp);
- }
+ if(!clay || plane_point_side(co, area_normal, cntr2, flip)) {
+ /* Find the intersection between squash-plane and vertex (along the area normal) */
+ point_plane_project(intr, co, area_normal, cntr);
+
+ VecSubf(val, intr, co);
- sculpt_clip(sd, co, val);
+ if(clay) {
+ if(bstr > FLT_EPSILON)
+ VecMulf(val, node->Fade / bstr);
+ else
+ VecMulf(val, node->Fade);
+ /* Clay displacement */
+ val[0]+=area_normal[0] * ss->cache->scale[0]*node->Fade;
+ val[1]+=area_normal[1] * ss->cache->scale[1]*node->Fade;
+ val[2]+=area_normal[2] * ss->cache->scale[2]*node->Fade;
+ }
+ else
+ VecMulf(val, fabs(node->Fade));
+
+ VecAddf(val, val, co);
+
+ sculpt_clip(sd, ss, co, val);
+ }
node= node->next;
}
}
-
+
/* Uses symm to selectively flip any axis of a coordinate. */
static void flip_coord(float out[3], float in[3], const char symm)
{
@@ -622,35 +635,29 @@ static float get_texcache_pixel_bilinear(const SculptSession *ss, float u, float
}
/* Return a multiplier for brush strength on a particular vertex. */
-static float tex_strength(Sculpt *sd, float *point, const float len)
+static float tex_strength(Sculpt *sd, SculptSession *ss, float *point, const float len)
{
- SculptSession *ss= sd->session;
- Brush *br = sd->brush;
+ Brush *br = paint_brush(&sd->paint);
+ MTex *tex = NULL;
float avg= 1;
- if(br->texact==-1 || !br->mtex[br->texact])
+ if(br->texact >= 0)
+ tex = br->mtex[br->texact];
+
+ if(!tex) {
avg= 1;
- else if(br->tex_mode==BRUSH_TEX_3D) {
- /* Get strength by feeding the vertex location directly
- into a texture */
+ }
+ else if(tex->brush_map_mode == MTEX_MAP_MODE_3D) {
float jnk;
- const float factor= 0.01;
- MTex mtex;
- memset(&mtex,0,sizeof(MTex));
- mtex.tex= br->mtex[br->texact]->tex;
- mtex.projx= 1;
- mtex.projy= 2;
- mtex.projz= 3;
- VecCopyf(mtex.size, br->mtex[br->texact]->size);
- VecMulf(mtex.size, factor);
- if(!sd->texsep)
- mtex.size[1]= mtex.size[2]= mtex.size[0];
-
- externtex(&mtex,point,&avg,&jnk,&jnk,&jnk,&jnk);
+
+ /* Get strength by feeding the vertex
+ location directly into a texture */
+ externtex(tex, point, &avg,
+ &jnk, &jnk, &jnk, &jnk);
}
else if(ss->texcache) {
const float bsize= ss->cache->pixel_radius * 2;
- const float rot= sd->brush->rot + ss->cache->rotation;
+ const float rot= tex->rot + ss->cache->rotation;
int px, py;
float flip[3], point_2d[2];
@@ -663,9 +670,9 @@ static float tex_strength(Sculpt *sd, float *point, const float len)
/* For Tile and Drag modes, get the 2D screen coordinates of the
and scale them up or down to the texture size. */
- if(br->tex_mode==BRUSH_TEX_TILE) {
- const int sx= (const int)br->mtex[br->texact]->size[0];
- const int sy= (const int)sd->texsep ? br->mtex[br->texact]->size[1] : sx;
+ if(tex->brush_map_mode == MTEX_MAP_MODE_TILED) {
+ const int sx= (const int)tex->size[0];
+ const int sy= (const int)tex->size[1];
float fx= point_2d[0];
float fy= point_2d[1];
@@ -685,7 +692,8 @@ static float tex_strength(Sculpt *sd, float *point, const float len)
if(sy != 1)
py %= sy-1;
avg= get_texcache_pixel_bilinear(ss, ss->texcache_side*px/sx, ss->texcache_side*py/sy);
- } else {
+ }
+ else if(tex->brush_map_mode == MTEX_MAP_MODE_FIXED) {
float fx= (point_2d[0] - ss->cache->mouse[0]) / bsize;
float fy= (point_2d[1] - ss->cache->mouse[1]) / bsize;
@@ -699,7 +707,7 @@ static float tex_strength(Sculpt *sd, float *point, const float len)
}
}
- avg*= brush_curve_strength(sd->brush, len, ss->cache->radius); /* Falloff curve */
+ avg*= brush_curve_strength(br, len, ss->cache->radius); /* Falloff curve */
return avg;
}
@@ -737,9 +745,9 @@ static void sculpt_add_damaged_rect(SculptSession *ss)
}
}
-static void do_brush_action(Sculpt *sd, StrokeCache *cache)
+static void do_brush_action(Sculpt *sd, SculptSession *ss, StrokeCache *cache)
{
- SculptSession *ss = sd->session;
+ Brush *brush = paint_brush(&sd->paint);
float av_dist;
ListBase active_verts={0,0};
ListBase *grab_active_verts = &ss->cache->grab_active_verts[ss->cache->symmetry];
@@ -748,7 +756,7 @@ static void do_brush_action(Sculpt *sd, StrokeCache *cache)
Mesh *me= NULL; /*XXX: get_mesh(OBACT); */
const float bstrength= brush_strength(sd, cache);
KeyBlock *keyblock= NULL; /*XXX: ob_get_keyblock(OBACT); */
- Brush *b = sd->brush;
+ Brush *b = brush;
int i;
sculpt_add_damaged_rect(ss);
@@ -768,7 +776,7 @@ static void do_brush_action(Sculpt *sd, StrokeCache *cache)
adata->Index = i;
/* Fade is used to store the final strength at which the brush
should modify a particular vertex. */
- adata->Fade= tex_strength(sd, vert, av_dist) * bstrength;
+ adata->Fade= tex_strength(sd, ss, vert, av_dist) * bstrength;
adata->dist = av_dist;
if(b->sculpt_tool == SCULPT_TOOL_GRAB && cache->first_time)
@@ -788,13 +796,13 @@ static void do_brush_action(Sculpt *sd, StrokeCache *cache)
do_draw_brush(sd, ss, &active_verts);
break;
case SCULPT_TOOL_SMOOTH:
- do_smooth_brush(sd, &active_verts);
+ do_smooth_brush(sd, ss, &active_verts);
break;
case SCULPT_TOOL_PINCH:
- do_pinch_brush(sd, &active_verts);
+ do_pinch_brush(sd, ss, &active_verts);
break;
case SCULPT_TOOL_INFLATE:
- do_inflate_brush(sd, &active_verts);
+ do_inflate_brush(sd, ss, &active_verts);
break;
case SCULPT_TOOL_GRAB:
do_grab_brush(sd, ss);
@@ -843,20 +851,21 @@ static void calc_brushdata_symm(StrokeCache *cache, const char symm)
cache->symmetry= symm;
}
-static void do_symmetrical_brush_actions(Sculpt *sd, StrokeCache *cache)
+static void do_symmetrical_brush_actions(Sculpt *sd, SculptSession *ss)
{
+ StrokeCache *cache = ss->cache;
const char symm = sd->flags & 7;
int i;
VecCopyf(cache->location, cache->true_location);
VecCopyf(cache->grab_delta_symmetry, cache->grab_delta);
cache->symmetry = 0;
- do_brush_action(sd, cache);
+ do_brush_action(sd, ss, cache);
for(i = 1; i <= symm; ++i) {
if(symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5))) {
calc_brushdata_symm(cache, i);
- do_brush_action(sd, cache);
+ do_brush_action(sd, ss, cache);
}
}
@@ -929,9 +938,9 @@ static void projverts_clear_inside(SculptSession *ss)
}
#endif
-static void sculpt_update_tex(Sculpt *sd)
+static void sculpt_update_tex(Sculpt *sd, SculptSession *ss)
{
- SculptSession *ss= sd->session;
+ Brush *brush = paint_brush(&sd->paint);
if(ss->texcache) {
MEM_freeN(ss->texcache);
@@ -939,9 +948,9 @@ static void sculpt_update_tex(Sculpt *sd)
}
/* Need to allocate a bigger buffer for bigger brush size */
- ss->texcache_side = sd->brush->size * 2;
+ ss->texcache_side = brush->size * 2;
if(!ss->texcache || ss->texcache_side > ss->texcache_actual) {
- ss->texcache = brush_gen_texture_cache(sd->brush, sd->brush->size);
+ ss->texcache = brush_gen_texture_cache(brush, brush->size);
ss->texcache_actual = ss->texcache_side;
}
}
@@ -992,8 +1001,8 @@ static struct MultiresModifierData *sculpt_multires_active(Object *ob)
static void sculpt_update_mesh_elements(bContext *C)
{
- SculptSession *ss = CTX_data_tool_settings(C)->sculpt->session;
Object *ob = CTX_data_active_object(C);
+ SculptSession *ss = ob->sculpt;
int oldtotvert = ss->totvert;
if((ss->multires = sculpt_multires_active(ob))) {
@@ -1026,54 +1035,20 @@ static void sculpt_update_mesh_elements(bContext *C)
static int sculpt_mode_poll(bContext *C)
{
- return G.f & G_SCULPTMODE;
+ Object *ob = CTX_data_active_object(C);
+ return ob && ob->mode & OB_MODE_SCULPT;
}
static int sculpt_poll(bContext *C)
{
- return G.f & G_SCULPTMODE && CTX_wm_area(C)->spacetype == SPACE_VIEW3D &&
- CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW;
-}
-
-/*** Sculpt Cursor ***/
-static void draw_paint_cursor(bContext *C, int x, int y, void *customdata)
-{
- Sculpt *sd= CTX_data_tool_settings(C)->sculpt;
-
- glColor4ub(255, 100, 100, 128);
- glEnable( GL_LINE_SMOOTH );
- glEnable(GL_BLEND);
-
- glTranslatef((float)x, (float)y, 0.0f);
- glutil_draw_lined_arc(0.0, M_PI*2.0, sd->brush->size, 40);
- glTranslatef((float)-x, (float)-y, 0.0f);
-
- if(sd->session && sd->session->cache && sd->brush && (sd->brush->flag & BRUSH_SMOOTH_STROKE)) {
- ARegion *ar = CTX_wm_region(C);
- sdrawline(x, y, sd->session->cache->mouse[0] - ar->winrct.xmin, sd->session->cache->mouse[1] - ar->winrct.ymin);
- }
-
- glDisable(GL_BLEND);
- glDisable( GL_LINE_SMOOTH );
-}
-
-static void toggle_paint_cursor(bContext *C)
-{
- Sculpt *s = CTX_data_scene(C)->toolsettings->sculpt;
-
- if(s->session->cursor) {
- WM_paint_cursor_end(CTX_wm_manager(C), s->session->cursor);
- s->session->cursor = NULL;
- }
- else {
- s->session->cursor =
- WM_paint_cursor_activate(CTX_wm_manager(C), sculpt_poll, draw_paint_cursor, NULL);
- }
+ return sculpt_mode_poll(C) && paint_poll(C);
}
static void sculpt_undo_push(bContext *C, Sculpt *sd)
{
- switch(sd->brush->sculpt_tool) {
+ Brush *brush = paint_brush(&sd->paint);
+
+ switch(brush->sculpt_tool) {
case SCULPT_TOOL_DRAW:
ED_undo_push(C, "Draw Brush"); break;
case SCULPT_TOOL_SMOOTH:
@@ -1093,36 +1068,15 @@ static void sculpt_undo_push(bContext *C, Sculpt *sd)
}
}
-static int sculpt_brush_curve_preset_exec(bContext *C, wmOperator *op)
-{
- brush_curve_preset(CTX_data_scene(C)->toolsettings->sculpt->brush, RNA_enum_get(op->ptr, "mode"));
- return OPERATOR_FINISHED;
-}
-
-static void SCULPT_OT_brush_curve_preset(wmOperatorType *ot)
-{
- static EnumPropertyItem prop_mode_items[] = {
- {BRUSH_PRESET_SHARP, "SHARP", 0, "Sharp Curve", ""},
- {BRUSH_PRESET_SMOOTH, "SMOOTH", 0, "Smooth Curve", ""},
- {BRUSH_PRESET_MAX, "MAX", 0, "Max Curve", ""},
- {0, NULL, 0, NULL, NULL}};
-
- ot->name= "Preset";
- ot->idname= "SCULPT_OT_brush_curve_preset";
-
- ot->exec= sculpt_brush_curve_preset_exec;
- ot->poll= sculpt_mode_poll;
-
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- RNA_def_enum(ot->srna, "mode", prop_mode_items, BRUSH_PRESET_SHARP, "Mode", "");
-}
-
/**** Radial control ****/
static int sculpt_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- toggle_paint_cursor(C);
- brush_radial_control_invoke(op, CTX_data_scene(C)->toolsettings->sculpt->brush, 1);
+ Paint *p = paint_get_active(CTX_data_scene(C));
+ Brush *brush = paint_brush(p);
+
+ WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor);
+ p->paint_cursor = NULL;
+ brush_radial_control_invoke(op, brush, 1);
return WM_radial_control_invoke(C, op, event);
}
@@ -1130,13 +1084,15 @@ static int sculpt_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
{
int ret = WM_radial_control_modal(C, op, event);
if(ret != OPERATOR_RUNNING_MODAL)
- toggle_paint_cursor(C);
+ paint_cursor_start(C, sculpt_poll);
return ret;
}
static int sculpt_radial_control_exec(bContext *C, wmOperator *op)
{
- return brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->sculpt->brush, 1);
+ Brush *brush = paint_brush(&CTX_data_tool_settings(C)->sculpt->paint);
+
+ return brush_radial_control_exec(op, brush, 1);
}
static void SCULPT_OT_radial_control(wmOperatorType *ot)
@@ -1162,7 +1118,7 @@ static float unproject_brush_radius(SculptSession *ss, float offset)
float brush_edge[3];
/* In anchored mode, brush size changes with mouse loc, otherwise it's fixed using the brush radius */
- unproject(ss->cache->mats, brush_edge, ss->cache->initial_mouse[0] + offset,
+ view3d_unproject(ss->cache->mats, brush_edge, ss->cache->initial_mouse[0] + offset,
ss->cache->initial_mouse[1], ss->cache->depth);
return VecLenf(ss->cache->true_location, brush_edge);
@@ -1170,31 +1126,32 @@ static float unproject_brush_radius(SculptSession *ss, float offset)
static void sculpt_cache_free(StrokeCache *cache)
{
- if(cache->layer_disps)
- MEM_freeN(cache->layer_disps);
- if(cache->mesh_store)
- MEM_freeN(cache->mesh_store);
+ int i;
if(cache->orig_norms)
MEM_freeN(cache->orig_norms);
if(cache->face_norms)
MEM_freeN(cache->face_norms);
if(cache->mats)
MEM_freeN(cache->mats);
+ for(i = 0; i < 8; ++i)
+ BLI_freelistN(&cache->grab_active_verts[i]);
MEM_freeN(cache);
}
/* Initialize the stroke cache invariants from operator properties */
-static void sculpt_update_cache_invariants(Sculpt *sd, bContext *C, wmOperator *op)
+static void sculpt_update_cache_invariants(Sculpt *sd, SculptSession *ss, bContext *C, wmOperator *op)
{
StrokeCache *cache = MEM_callocN(sizeof(StrokeCache), "stroke cache");
+ Brush *brush = paint_brush(&sd->paint);
+ ViewContext *vc = paint_stroke_view_context(op->customdata);
int i;
- sd->session->cache = cache;
+ ss->cache = cache;
RNA_float_get_array(op->ptr, "scale", cache->scale);
cache->flag = RNA_int_get(op->ptr, "flag");
RNA_float_get_array(op->ptr, "clip_tolerance", cache->clip_tolerance);
- RNA_int_get_array(op->ptr, "initial_mouse", cache->initial_mouse);
+ RNA_float_get_array(op->ptr, "initial_mouse", cache->initial_mouse);
cache->depth = RNA_float_get(op->ptr, "depth");
cache->mouse[0] = cache->initial_mouse[0];
@@ -1202,70 +1159,88 @@ static void sculpt_update_cache_invariants(Sculpt *sd, bContext *C, wmOperator *
/* Truly temporary data that isn't stored in properties */
- view3d_set_viewcontext(C, &cache->vc);
-
cache->mats = MEM_callocN(sizeof(bglMats), "sculpt bglMats");
- view3d_get_transformation(&cache->vc, cache->vc.obact, cache->mats);
+ view3d_get_transformation(vc, vc->obact, cache->mats);
sculpt_update_mesh_elements(C);
- if(sd->brush->sculpt_tool == SCULPT_TOOL_LAYER)
- cache->layer_disps = MEM_callocN(sizeof(float) * sd->session->totvert, "layer brush displacements");
+ /* Initialize layer brush displacements */
+ if(brush->sculpt_tool == SCULPT_TOOL_LAYER &&
+ (!ss->layer_disps || !(brush->flag & BRUSH_PERSISTENT))) {
+ if(ss->layer_disps)
+ MEM_freeN(ss->layer_disps);
+ ss->layer_disps = MEM_callocN(sizeof(float) * ss->totvert, "layer brush displacements");
+ }
/* Make copies of the mesh vertex locations and normals for some tools */
- if(sd->brush->sculpt_tool == SCULPT_TOOL_LAYER || (sd->brush->flag & BRUSH_ANCHORED)) {
- cache->mesh_store= MEM_mallocN(sizeof(float) * 3 * sd->session->totvert, "sculpt mesh vertices copy");
- for(i = 0; i < sd->session->totvert; ++i)
- VecCopyf(cache->mesh_store[i], sd->session->mvert[i].co);
-
- if(sd->brush->flag & BRUSH_ANCHORED) {
- cache->orig_norms= MEM_mallocN(sizeof(short) * 3 * sd->session->totvert, "Sculpt orig norm");
- for(i = 0; i < sd->session->totvert; ++i) {
- cache->orig_norms[i][0] = sd->session->mvert[i].no[0];
- cache->orig_norms[i][1] = sd->session->mvert[i].no[1];
- cache->orig_norms[i][2] = sd->session->mvert[i].no[2];
+ if(brush->sculpt_tool == SCULPT_TOOL_LAYER || (brush->flag & BRUSH_ANCHORED)) {
+ if(brush->sculpt_tool != SCULPT_TOOL_LAYER ||
+ !ss->mesh_co_orig || !(brush->flag & BRUSH_PERSISTENT)) {
+ if(!ss->mesh_co_orig)
+ ss->mesh_co_orig= MEM_mallocN(sizeof(float) * 3 * ss->totvert,
+ "sculpt mesh vertices copy");
+ for(i = 0; i < ss->totvert; ++i)
+ VecCopyf(ss->mesh_co_orig[i], ss->mvert[i].co);
+ }
+
+ if(brush->flag & BRUSH_ANCHORED) {
+ cache->orig_norms= MEM_mallocN(sizeof(short) * 3 * ss->totvert, "Sculpt orig norm");
+ for(i = 0; i < ss->totvert; ++i) {
+ cache->orig_norms[i][0] = ss->mvert[i].no[0];
+ cache->orig_norms[i][1] = ss->mvert[i].no[1];
+ cache->orig_norms[i][2] = ss->mvert[i].no[2];
}
- if(sd->session->face_normals) {
- float *fn = sd->session->face_normals;
- cache->face_norms= MEM_mallocN(sizeof(float) * 3 * sd->session->totface, "Sculpt face norms");
- for(i = 0; i < sd->session->totface; ++i, fn += 3)
+ if(ss->face_normals) {
+ float *fn = ss->face_normals;
+ cache->face_norms= MEM_mallocN(sizeof(float) * 3 * ss->totface, "Sculpt face norms");
+ for(i = 0; i < ss->totface; ++i, fn += 3)
VecCopyf(cache->face_norms[i], fn);
}
}
}
- unproject(cache->mats, cache->true_location, cache->initial_mouse[0], cache->initial_mouse[1], cache->depth);
- cache->radius = unproject_brush_radius(sd->session, brush_size(sd));
+ view3d_unproject(cache->mats, cache->true_location, cache->initial_mouse[0], cache->initial_mouse[1], cache->depth);
+ cache->initial_radius = unproject_brush_radius(ss, brush->size);
cache->rotation = 0;
cache->first_time = 1;
}
/* Initialize the stroke cache variants from operator properties */
-static void sculpt_update_cache_variants(Sculpt *sd, PointerRNA *ptr)
+static void sculpt_update_cache_variants(Sculpt *sd, SculptSession *ss, PointerRNA *ptr)
{
- StrokeCache *cache = sd->session->cache;
+ StrokeCache *cache = ss->cache;
+ Brush *brush = paint_brush(&sd->paint);
float grab_location[3];
+
int dx, dy;
- if(!(sd->brush->flag & BRUSH_ANCHORED))
+ if(!(brush->flag & BRUSH_ANCHORED))
RNA_float_get_array(ptr, "location", cache->true_location);
cache->flip = RNA_boolean_get(ptr, "flip");
- RNA_int_get_array(ptr, "mouse", cache->mouse);
+ RNA_float_get_array(ptr, "mouse", cache->mouse);
+ cache->pressure = RNA_float_get(ptr, "pressure");
/* Truly temporary data that isn't stored in properties */
cache->previous_pixel_radius = cache->pixel_radius;
- cache->pixel_radius = brush_size(sd);
+ cache->pixel_radius = brush->size;
+
+ if(brush->flag & BRUSH_SIZE_PRESSURE) {
+ cache->pixel_radius *= cache->pressure;
+ cache->radius = cache->initial_radius * cache->pressure;
+ }
+ else
+ cache->radius = cache->initial_radius;
- if(sd->brush->flag & BRUSH_ANCHORED) {
+ if(brush->flag & BRUSH_ANCHORED) {
dx = cache->mouse[0] - cache->initial_mouse[0];
dy = cache->mouse[1] - cache->initial_mouse[1];
cache->pixel_radius = sqrt(dx*dx + dy*dy);
- cache->radius = unproject_brush_radius(sd->session, cache->pixel_radius);
+ cache->radius = unproject_brush_radius(ss, cache->pixel_radius);
cache->rotation = atan2(dy, dx);
}
- else if(sd->brush->flag & BRUSH_RAKE) {
+ else if(brush->flag & BRUSH_RAKE) {
int update;
dx = cache->last_rake[0] - cache->mouse[0];
@@ -1284,8 +1259,8 @@ static void sculpt_update_cache_variants(Sculpt *sd, PointerRNA *ptr)
}
/* Find the grab delta */
- if(sd->brush->sculpt_tool == SCULPT_TOOL_GRAB) {
- unproject(cache->mats, grab_location, cache->mouse[0], cache->mouse[1], cache->depth);
+ if(brush->sculpt_tool == SCULPT_TOOL_GRAB) {
+ view3d_unproject(cache->mats, grab_location, cache->mouse[0], cache->mouse[1], cache->depth);
if(!cache->first_time)
VecSubf(cache->grab_delta, grab_location, cache->old_grab_location);
VecCopyf(cache->old_grab_location, grab_location);
@@ -1298,9 +1273,9 @@ static void sculpt_brush_stroke_init_properties(bContext *C, wmOperator *op, wmE
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
Object *ob= CTX_data_active_object(C);
ModifierData *md;
- ViewContext vc;
float scale[3], clip_tolerance[3] = {0,0,0};
- int mouse[2], flag = 0;
+ float mouse[2];
+ int flag = 0;
/* Set scaling adjustment */
scale[0] = 1.0f / ob->size[0];
@@ -1327,42 +1302,39 @@ static void sculpt_brush_stroke_init_properties(bContext *C, wmOperator *op, wmE
/* Initial mouse location */
mouse[0] = event->x;
mouse[1] = event->y;
- RNA_int_set_array(op->ptr, "initial_mouse", mouse);
+ RNA_float_set_array(op->ptr, "initial_mouse", mouse);
/* Initial screen depth under the mouse */
- view3d_set_viewcontext(C, &vc);
- RNA_float_set(op->ptr, "depth", read_cached_depth(&vc, event->x, event->y));
+ RNA_float_set(op->ptr, "depth", read_cached_depth(paint_stroke_view_context(op->customdata), event->x, event->y));
- sculpt_update_cache_invariants(sd, C, op);
+ sculpt_update_cache_invariants(sd, ss, C, op);
}
-static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static void sculpt_brush_stroke_init(bContext *C)
{
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
+ SculptSession *ss = CTX_data_active_object(C)->sculpt;
view3d_operator_needs_opengl(C);
/* TODO: Shouldn't really have to do this at the start of every
stroke, but sculpt would need some sort of notification when
changes are made to the texture. */
- sculpt_update_tex(sd);
+ sculpt_update_tex(sd, ss);
- /* add modal handler */
- WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op);
-
- return OPERATOR_RUNNING_MODAL;
+ sculpt_update_mesh_elements(C);
}
-static void sculpt_restore_mesh(Sculpt *sd)
+static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
{
- SculptSession *ss = sd->session;
StrokeCache *cache = ss->cache;
+ Brush *brush = paint_brush(&sd->paint);
int i;
/* Restore the mesh before continuing with anchored stroke */
- if((sd->brush->flag & BRUSH_ANCHORED) && cache->mesh_store) {
+ if((brush->flag & BRUSH_ANCHORED) && ss->mesh_co_orig) {
for(i = 0; i < ss->totvert; ++i) {
- VecCopyf(ss->mvert[i].co, cache->mesh_store[i]);
+ VecCopyf(ss->mvert[i].co, ss->mesh_co_orig[i]);
ss->mvert[i].no[0] = cache->orig_norms[i][0];
ss->mvert[i].no[1] = cache->orig_norms[i][1];
ss->mvert[i].no[2] = cache->orig_norms[i][2];
@@ -1374,8 +1346,8 @@ static void sculpt_restore_mesh(Sculpt *sd)
VecCopyf(fn, cache->face_norms[i]);
}
- if(sd->brush->sculpt_tool == SCULPT_TOOL_LAYER)
- memset(cache->layer_disps, 0, sizeof(float) * ss->totvert);
+ if(brush->sculpt_tool == SCULPT_TOOL_LAYER)
+ memset(ss->layer_disps, 0, sizeof(float) * ss->totvert);
}
}
@@ -1387,187 +1359,107 @@ static void sculpt_post_stroke_free(SculptSession *ss)
static void sculpt_flush_update(bContext *C)
{
- Sculpt *s = CTX_data_tool_settings(C)->sculpt;
+ Object *ob = CTX_data_active_object(C);
+ SculptSession *ss = ob->sculpt;
ARegion *ar = CTX_wm_region(C);
- MultiresModifierData *mmd = s->session->multires;
+ MultiresModifierData *mmd = ss->multires;
- calc_damaged_verts(s->session);
+ calc_damaged_verts(ss);
if(mmd) {
- if(mmd->undo_verts && mmd->undo_verts != s->session->mvert)
+ if(mmd->undo_verts && mmd->undo_verts != ss->mvert)
MEM_freeN(mmd->undo_verts);
- mmd->undo_verts = s->session->mvert;
- mmd->undo_verts_tot = s->session->totvert;
- multires_mark_as_modified(CTX_data_active_object(C));
+ mmd->undo_verts = ss->mvert;
+ mmd->undo_verts_tot = ss->totvert;
+ multires_mark_as_modified(ob);
}
ED_region_tag_redraw(ar);
}
-/* Returns zero if no sculpt changes should be made, non-zero otherwise */
-static int sculpt_smooth_stroke(Sculpt *s, int output[2], wmEvent *event)
+static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *event)
{
- output[0] = event->x;
- output[1] = event->y;
-
- if(s->brush->flag & BRUSH_SMOOTH_STROKE && s->brush->sculpt_tool != SCULPT_TOOL_GRAB) {
- StrokeCache *cache = s->session->cache;
- float u = .9, v = 1.0 - u;
- int dx = cache->mouse[0] - event->x, dy = cache->mouse[1] - event->y;
- int radius = 50;
-
- /* If the mouse is moving within the radius of the last move,
- don't update the mouse position. This allows sharp turns. */
- if(dx*dx + dy*dy < radius*radius)
- return 0;
-
- output[0] = event->x * v + cache->mouse[0] * u;
- output[1] = event->y * v + cache->mouse[1] * u;
- }
+ ViewContext vc;
+ float cur_depth;
- return 1;
-}
+ view3d_set_viewcontext(C, &vc);
+ cur_depth = read_cached_depth(&vc, event->x, event->y);
+
+ /* Don't start the stroke until a valid depth is found */
+ if(cur_depth < 1.0 - FLT_EPSILON) {
+ SculptSession *ss = CTX_data_active_object(C)->sculpt;
-/* Returns zero if the stroke dots should not be spaced, non-zero otherwise */
-int sculpt_space_stroke_enabled(Sculpt *s)
-{
- Brush *br = s->brush;
- return (br->flag & BRUSH_SPACE) && !(br->flag & BRUSH_ANCHORED) && (br->sculpt_tool != SCULPT_TOOL_GRAB);
+ sculpt_brush_stroke_init_properties(C, op, event, ss);
+ sculptmode_update_all_projverts(ss);
+
+ return 1;
+ }
+ else
+ return 0;
}
-/* Put the location of the next sculpt stroke dot into the stroke RNA and apply it to the mesh */
-static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, int mouse[2])
+static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr)
{
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
- StrokeCache *cache = sd->session->cache;
- PointerRNA itemptr;
- float cur_depth;
- float center[3];
-
- cur_depth = read_cached_depth(&cache->vc, mouse[0], mouse[1]);
- unproject(sd->session->cache->mats, center, mouse[0], mouse[1], cur_depth);
-
- /* Add to stroke */
- RNA_collection_add(op->ptr, "stroke", &itemptr);
- RNA_float_set_array(&itemptr, "location", center);
- RNA_int_set_array(&itemptr, "mouse", mouse);
- RNA_boolean_set(&itemptr, "flip", event->shift);
- sculpt_update_cache_variants(sd, &itemptr);
-
- sculpt_restore_mesh(sd);
- do_symmetrical_brush_actions(sd, cache);
-}
+ SculptSession *ss = CTX_data_active_object(C)->sculpt;
-/* For brushes with stroke spacing enabled, moves mouse in steps
- towards the final mouse location. */
-static int sculpt_space_stroke(bContext *C, wmOperator *op, wmEvent *event, Sculpt *s, const int final_mouse[2])
-{
- StrokeCache *cache = s->session->cache;
- int cnt = 0;
-
- if(sculpt_space_stroke_enabled(s)) {
- float vec[2] = {final_mouse[0] - cache->mouse[0], final_mouse[1] - cache->mouse[1]};
- int mouse[2] = {cache->mouse[0], cache->mouse[1]};
- float length, scale;
- int steps = 0, i;
-
- /* Normalize the vector between the last stroke dot and the goal */
- length = sqrt(vec[0]*vec[0] + vec[1]*vec[1]);
-
- if(length > FLT_EPSILON) {
- scale = s->brush->spacing / length;
- vec[0] *= scale;
- vec[1] *= scale;
-
- steps = (int)(length / s->brush->spacing);
- for(i = 0; i < steps; ++i, ++cnt) {
- mouse[0] += vec[0];
- mouse[1] += vec[1];
- sculpt_brush_stroke_add_step(C, op, event, mouse);
- }
- }
- }
+ sculpt_update_cache_variants(sd, ss, itemptr);
+ sculpt_restore_mesh(sd, ss);
+ do_symmetrical_brush_actions(sd, ss);
- return cnt;
+ /* Cleanup */
+ sculpt_flush_update(C);
+ sculpt_post_stroke_free(ss);
}
-static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
+static void sculpt_stroke_done(bContext *C, struct PaintStroke *stroke)
{
- Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
- ARegion *ar = CTX_wm_region(C);
- float cur_depth;
-
- sculpt_update_mesh_elements(C);
+ SculptSession *ss = CTX_data_active_object(C)->sculpt;
- if(!sd->session->cache) {
- ViewContext vc;
- view3d_set_viewcontext(C, &vc);
- cur_depth = read_cached_depth(&vc, event->x, event->y);
-
- /* Don't start the stroke until a valid depth is found */
- if(cur_depth < 1.0 - FLT_EPSILON) {
- sculpt_brush_stroke_init_properties(C, op, event, sd->session);
- sculptmode_update_all_projverts(sd->session);
- }
+ /* Finished */
+ if(ss->cache) {
+ Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
- ED_region_tag_redraw(ar);
+ request_depth_update(paint_stroke_view_context(stroke)->rv3d);
+ sculpt_cache_free(ss->cache);
+ ss->cache = NULL;
+ sculpt_undo_push(C, sd);
}
+}
- if(sd->session->cache) {
- int mouse[2];
-
- if(sculpt_smooth_stroke(sd, mouse, event)) {
- if(sculpt_space_stroke_enabled(sd)) {
- if(!sculpt_space_stroke(C, op, event, sd, mouse))
- ED_region_tag_redraw(ar);
- }
- else
- sculpt_brush_stroke_add_step(C, op, event, mouse);
-
- sculpt_flush_update(C);
- sculpt_post_stroke_free(sd->session);
- }
- else
- ED_region_tag_redraw(ar);
- }
+static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ sculpt_brush_stroke_init(C);
- /* Finished */
- if(event->type == LEFTMOUSE && event->val == 0) {
- if(sd->session->cache) {
- request_depth_update(sd->session->cache->vc.rv3d);
- sculpt_cache_free(sd->session->cache);
- sd->session->cache = NULL;
- sculpt_undo_push(C, sd);
- }
+ op->customdata = paint_stroke_new(C, sculpt_stroke_test_start,
+ sculpt_stroke_update_step,
+ sculpt_stroke_done);
- return OPERATOR_FINISHED;
- }
+ /* add modal handler */
+ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op);
+ op->type->modal(C, op, event);
+
return OPERATOR_RUNNING_MODAL;
}
static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
{
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
+ SculptSession *ss = CTX_data_active_object(C)->sculpt;
- view3d_operator_needs_opengl(C);
- sculpt_update_cache_invariants(sd, C, op);
- sculptmode_update_all_projverts(sd->session);
- sculpt_update_tex(sd);
+ op->customdata = paint_stroke_new(C, sculpt_stroke_test_start, sculpt_stroke_update_step, sculpt_stroke_done);
- RNA_BEGIN(op->ptr, itemptr, "stroke") {
- sculpt_update_cache_variants(sd, &itemptr);
+ sculpt_brush_stroke_init(C);
- sculpt_restore_mesh(sd);
- do_symmetrical_brush_actions(sd, sd->session->cache);
+ sculpt_update_cache_invariants(sd, ss, C, op);
+ sculptmode_update_all_projverts(ss);
- sculpt_post_stroke_free(sd->session);
- }
- RNA_END;
+ paint_stroke_exec(C, op);
sculpt_flush_update(C);
- sculpt_cache_free(sd->session->cache);
+ sculpt_cache_free(ss->cache);
sculpt_undo_push(C, sd);
@@ -1584,7 +1476,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
/* api callbacks */
ot->invoke= sculpt_brush_stroke_invoke;
- ot->modal= sculpt_brush_stroke_modal;
+ ot->modal= paint_stroke_modal;
ot->exec= sculpt_brush_stroke_exec;
ot->poll= sculpt_poll;
@@ -1604,46 +1496,76 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
RNA_def_float_vector(ot->srna, "clip_tolerance", 3, NULL, 0.0f, FLT_MAX, "clip_tolerance", "", 0.0f, 1000.0f);
/* The initial 2D location of the mouse */
- RNA_def_int_vector(ot->srna, "initial_mouse", 2, NULL, INT_MIN, INT_MAX, "initial_mouse", "", INT_MIN, INT_MAX);
+ RNA_def_float_vector(ot->srna, "initial_mouse", 2, NULL, INT_MIN, INT_MAX, "initial_mouse", "", INT_MIN, INT_MAX);
/* The initial screen depth of the mouse */
RNA_def_float(ot->srna, "depth", 0.0f, 0.0f, FLT_MAX, "depth", "", 0.0f, FLT_MAX);
}
+/**** Reset the copy of the mesh that is being sculpted on (currently just for the layer brush) ****/
+
+static int sculpt_set_persistent_base(bContext *C, wmOperator *op)
+{
+ SculptSession *ss = CTX_data_active_object(C)->sculpt;
+
+ if(ss) {
+ if(ss->layer_disps)
+ MEM_freeN(ss->layer_disps);
+ ss->layer_disps = NULL;
+
+ if(ss->mesh_co_orig)
+ MEM_freeN(ss->mesh_co_orig);
+ ss->mesh_co_orig = NULL;
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+static void SCULPT_OT_set_persistent_base(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Set Persistent Base";
+ ot->idname= "SCULPT_OT_set_persistent_base";
+
+ /* api callbacks */
+ ot->exec= sculpt_set_persistent_base;
+ ot->poll= sculpt_mode_poll;
+
+ ot->flag= OPTYPE_REGISTER;
+}
+
/**** Toggle operator for turning sculpt mode on or off ****/
static int sculpt_toggle_mode(bContext *C, wmOperator *op)
{
ToolSettings *ts = CTX_data_tool_settings(C);
+ Object *ob = CTX_data_active_object(C);
- if(G.f & G_SCULPTMODE) {
- multires_force_update(CTX_data_active_object(C));
+ if(ob->mode & OB_MODE_SCULPT) {
+ multires_force_update(ob);
/* Leave sculptmode */
- G.f &= ~G_SCULPTMODE;
-
- toggle_paint_cursor(C);
+ ob->mode &= ~OB_MODE_SCULPT;
- sculptsession_free(ts->sculpt);
+ free_sculptsession(&ob->sculpt);
}
else {
/* Enter sculptmode */
- G.f |= G_SCULPTMODE;
+ ob->mode |= OB_MODE_SCULPT;
/* Create persistent sculpt mode data */
if(!ts->sculpt)
ts->sculpt = MEM_callocN(sizeof(Sculpt), "sculpt mode data");
/* Create sculpt mode session data */
- if(ts->sculpt->session)
- MEM_freeN(ts->sculpt->session);
- ts->sculpt->session = MEM_callocN(sizeof(SculptSession), "sculpt session");
+ if(ob->sculpt)
+ free_sculptsession(&ob->sculpt);
+ ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
- toggle_paint_cursor(C);
-
- /* If there's no brush, create one */
- brush_check_exists(&ts->sculpt->brush);
+ paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT);
+
+ paint_cursor_start(C, sculpt_poll);
WM_event_add_notifier(C, NC_SCENE|ND_MODE, CTX_data_scene(C));
}
@@ -1669,5 +1591,5 @@ void ED_operatortypes_sculpt()
WM_operatortype_append(SCULPT_OT_radial_control);
WM_operatortype_append(SCULPT_OT_brush_stroke);
WM_operatortype_append(SCULPT_OT_sculptmode_toggle);
- WM_operatortype_append(SCULPT_OT_brush_curve_preset);
+ WM_operatortype_append(SCULPT_OT_set_persistent_base);
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index febca301939..25f97b862e6 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -32,7 +32,6 @@
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
-#include "BKE_sculpt.h"
struct Brush;
struct Mesh;
diff --git a/source/blender/editors/sculpt_paint/sculpt_stroke.c b/source/blender/editors/sculpt_paint/sculpt_stroke.c
deleted file mode 100644
index 554ff580358..00000000000
--- a/source/blender/editors/sculpt_paint/sculpt_stroke.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Storage and manipulation of sculptmode brush strokes.
- *
- */
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_sculpt.h"
-#include "BLI_blenlib.h"
-#include "BIF_gl.h"
-
-#include "sculpt_intern.h"
-
-#include <math.h>
-
-/* Temporary storage of input stroke control points */
-typedef struct StrokePoint {
- struct StrokePoint *next, *prev;
- short x, y;
-} StrokePoint;
-typedef struct SculptStroke {
- short (*loc)[2];
- int max;
- int index;
- float length;
- ListBase final;
- StrokePoint *final_mem;
- float offset;
-} SculptStroke;
-
-SculptStroke *sculpt_stroke_new(const int max)
-{
- SculptStroke *stroke = MEM_callocN(sizeof(SculptStroke), "SculptStroke");
- stroke->loc = MEM_callocN(sizeof(short) * 4 * max, "SculptStroke.loc");
- stroke->max = max;
- stroke->index = -1;
- return stroke;
-}
-
-void sculpt_stroke_free(SculptStroke *stroke)
-{
- if(stroke) {
- if(stroke->loc) MEM_freeN(stroke->loc);
- if(stroke->final_mem) MEM_freeN(stroke->final_mem);
-
- MEM_freeN(stroke);
- }
-}
-
-void sculpt_stroke_add_point(SculptStroke *stroke, const short x, const short y)
-{
- const int next = stroke->index + 1;
-
- if(stroke->index == -1) {
- stroke->loc[0][0] = x;
- stroke->loc[0][1] = y;
- stroke->index = 0;
- }
- else if(next < stroke->max) {
- const int dx = x - stroke->loc[stroke->index][0];
- const int dy = y - stroke->loc[stroke->index][1];
- stroke->loc[next][0] = x;
- stroke->loc[next][1] = y;
- stroke->length += sqrt(dx*dx + dy*dy);
- stroke->index = next;
- }
-}
-
-static void sculpt_stroke_smooth(SculptStroke *stroke)
-{
- /* Apply smoothing (exclude the first and last points)*/
- StrokePoint *p = stroke->final.first;
- if(p && p->next && p->next->next) {
- for(p = p->next->next; p && p->next && p->next->next; p = p->next) {
- p->x = p->prev->prev->x*0.1 + p->prev->x*0.2 + p->x*0.4 + p->next->x*0.2 + p->next->next->x*0.1;
- p->y = p->prev->prev->y*0.1 + p->prev->y*0.2 + p->y*0.4 + p->next->y*0.2 + p->next->next->y*0.1;
- }
- }
-}
-
-static void sculpt_stroke_create_final(SculptStroke *stroke)
-{
- if(stroke) {
- StrokePoint *p, *pnext;
- int i;
-
- /* Copy loc into final */
- if(stroke->final_mem)
- MEM_freeN(stroke->final_mem);
- stroke->final_mem = MEM_callocN(sizeof(StrokePoint) * (stroke->index + 1) * 2, "SculptStroke.final");
- stroke->final.first = stroke->final.last = NULL;
- for(i = 0; i <= stroke->index; ++i) {
- p = &stroke->final_mem[i];
- p->x = stroke->loc[i][0];
- p->y = stroke->loc[i][1];
- BLI_addtail(&stroke->final, p);
- }
-
- /* Remove shortest edges */
- if(stroke->final.first) {
- for(p = ((StrokePoint*)stroke->final.first)->next; p && p->next; p = pnext) {
- const int dx = p->x - p->prev->x;
- const int dy = p->y - p->prev->y;
- const float len = sqrt(dx*dx + dy*dy);
- pnext = p->next;
- if(len < 10) {
- BLI_remlink(&stroke->final, p);
- }
- }
- }
-
- sculpt_stroke_smooth(stroke);
-
- /* Subdivide edges */
- for(p = stroke->final.first; p && p->next; p = pnext) {
- StrokePoint *np = &stroke->final_mem[i++];
-
- pnext = p->next;
- np->x = (p->x + p->next->x) / 2;
- np->y = (p->y + p->next->y) / 2;
- BLI_insertlink(&stroke->final, p, np);
- }
-
- sculpt_stroke_smooth(stroke);
- }
-}
-
-static float sculpt_stroke_seglen(StrokePoint *p1, StrokePoint *p2)
-{
- int dx = p2->x - p1->x;
- int dy = p2->y - p1->y;
- return sqrt(dx*dx + dy*dy);
-}
-
-static float sculpt_stroke_final_length(SculptStroke *stroke)
-{
- StrokePoint *p;
- float len = 0;
- for(p = stroke->final.first; p && p->next; ++p)
- len += sculpt_stroke_seglen(p, p->next);
- return len;
-}
-
-/* If partial is nonzero, cuts off apply after that length has been processed */
-static StrokePoint *sculpt_stroke_apply_generic(Sculpt *sd, SculptStroke *stroke, const int partial)
-{
- const int sdspace = 0; //XXX: sd->spacing;
- const short spacing = sdspace > 0 ? sdspace : 2;
- const int dots = sculpt_stroke_final_length(stroke) / spacing;
- int i;
- StrokePoint *p = stroke->final.first;
- float startloc = stroke->offset;
-
- for(i = 0; i < dots && p && p->next; ++i) {
- const float dotloc = spacing * i;
- short co[2];
- float len = sculpt_stroke_seglen(p, p->next);
- float u, v;
-
- /* Find edge containing dot */
- while(dotloc > startloc + len && p && p->next && p->next->next) {
- p = p->next;
- startloc += len;
- len = sculpt_stroke_seglen(p, p->next);
- }
-
- if(!p || !p->next || dotloc > startloc + len)
- break;
-
- if(partial && startloc > partial) {
- /* Calculate offset for next stroke segment */
- stroke->offset = startloc + len - dotloc;
- break;
- }
-
- u = (dotloc - startloc) / len;
- v = 1 - u;
-
- co[0] = p->x*v + p->next->x*u;
- co[1] = p->y*v + p->next->y*u;
-
- //do_symmetrical_brush_actions(sd, a, co, NULL);
- }
-
- return p ? p->next : NULL;
-}
-
-void sculpt_stroke_apply(Sculpt *sd, SculptStroke *stroke)
-{
- /* TODO: make these values user-modifiable? */
- const int partial_len = 100;
- const int min_len = 200;
-
- if(stroke) {
- sculpt_stroke_create_final(stroke);
-
- if(sculpt_stroke_final_length(stroke) > min_len) {
- StrokePoint *p = sculpt_stroke_apply_generic(sd, stroke, partial_len);
-
- /* Replace remaining values in stroke->loc with remaining stroke->final values */
- stroke->index = -1;
- stroke->length = 0;
- for(; p; p = p->next) {
- ++stroke->index;
- stroke->loc[stroke->index][0] = p->x;
- stroke->loc[stroke->index][1] = p->y;
- if(p->next) {
- stroke->length += sculpt_stroke_seglen(p, p->next);
- }
- }
- }
- }
-}
-
-void sculpt_stroke_apply_all(Sculpt *sd, SculptStroke *stroke)
-{
- sculpt_stroke_create_final(stroke);
-
- if(stroke) {
- sculpt_stroke_apply_generic(sd, stroke, 0);
- }
-}
-
-/* XXX: drawing goes elsewhere */
-void sculpt_stroke_draw(SculptStroke *stroke)
-{
- if(stroke) {
- StrokePoint *p;
-
- /* Draws the original stroke */
- /*glColor3f(1, 0, 0);
- glBegin(GL_LINE_STRIP);
- for(i = 0; i <= stroke->index; ++i)
- glVertex2s(stroke->loc[i][0], stroke->loc[i][1]);
- glEnd();*/
-
- /* Draws the smoothed stroke */
- glColor3f(0, 1, 0);
- glBegin(GL_LINE_STRIP);
- for(p = stroke->final.first; p; p = p->next)
- glVertex2s(p->x, p->y);
- glEnd();
- }
-}
diff --git a/source/blender/editors/sound/Makefile b/source/blender/editors/sound/Makefile
new file mode 100644
index 00000000000..10145035eb4
--- /dev/null
+++ b/source/blender/editors/sound/Makefile
@@ -0,0 +1,51 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_opsound
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I$(NAN_AUDASPACE)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/sound/SConscript b/source/blender/editors/sound/SConscript
new file mode 100644
index 00000000000..7968f4c53a9
--- /dev/null
+++ b/source/blender/editors/sound/SConscript
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc'
+incs += ' #/intern/guardedalloc'
+incs += ' ../../makesrna ../../python'
+incs += ' #/intern/audaspace/intern'
+
+defs = []
+
+env.BlenderLib ( 'bf_editors_sound', sources, Split(incs), defs, libtype=['core'], priority=[35] )
diff --git a/source/blender/editors/sound/sound_intern.h b/source/blender/editors/sound/sound_intern.h
new file mode 100644
index 00000000000..ec8b0688305
--- /dev/null
+++ b/source/blender/editors/sound/sound_intern.h
@@ -0,0 +1,37 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef ED_SOUND_INTERN_H
+#define ED_SOUND_INTERN_H
+
+struct wmOperatorType;
+
+void SOUND_OT_open(wmOperatorType *ot);
+
+#endif /* ED_SOUND_INTERN_H */
+
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
new file mode 100644
index 00000000000..303ca0eaefd
--- /dev/null
+++ b/source/blender/editors/sound/sound_ops.c
@@ -0,0 +1,293 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "DNA_packedFile_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_space_types.h"
+#include "DNA_sound_types.h"
+#include "DNA_sequence_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_report.h"
+#include "BKE_packedFile.h"
+#include "BKE_sound.h"
+#include "BKE_utildefines.h"
+
+#include "BLI_blenlib.h"
+
+#include "ED_sound.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "UI_interface.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "AUD_C-API.h"
+
+#include "sound_intern.h"
+
+/******************** open sound operator ********************/
+
+static int open_exec(bContext *C, wmOperator *op)
+{
+ char filename[FILE_MAX];
+ bSound *sound;
+ AUD_SoundInfo info;
+
+ RNA_string_get(op->ptr, "filename", filename);
+
+ sound = sound_new_file(CTX_data_main(C), filename);
+
+ if (sound==NULL || sound->handle == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
+ return OPERATOR_CANCELLED;
+ }
+
+ info = AUD_getInfo(sound->handle);
+
+ if (info.specs.format == AUD_FORMAT_INVALID) {
+ sound_delete(C, sound);
+ BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
+ return OPERATOR_CANCELLED;
+ }
+
+ if (RNA_boolean_get(op->ptr, "cache")) {
+ sound_cache(sound, 0);
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ return WM_operator_filesel(C, op, event);
+}
+
+void SOUND_OT_open(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Open Sound";
+ ot->idname= "SOUND_OT_open";
+ ot->description= "Load a sound file into blender";
+
+ /* api callbacks */
+ ot->exec= open_exec;
+ ot->invoke= open_invoke;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE);
+ RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
+}
+
+/* ******************************************************* */
+
+static int sound_poll(bContext *C)
+{
+ Editing* ed = CTX_data_scene(C)->ed;
+
+ if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+ return 0;
+
+ return 1;
+}
+/********************* pack operator *********************/
+
+static int pack_exec(bContext *C, wmOperator *op)
+{
+ Editing* ed = CTX_data_scene(C)->ed;
+ bSound* sound;
+
+ if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+ return OPERATOR_CANCELLED;
+
+ sound = ed->act_seq->sound;
+
+ if(!sound || sound->packedfile)
+ return OPERATOR_CANCELLED;
+
+ sound->packedfile= newPackedFile(op->reports, sound->name);
+ sound_load(CTX_data_main(C), sound);
+
+ return OPERATOR_FINISHED;
+}
+
+void SOUND_OT_pack(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Pack Sound";
+ ot->idname= "SOUND_OT_pack";
+
+ /* api callbacks */
+ ot->exec= pack_exec;
+ ot->poll= sound_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************* unpack operator *********************/
+
+// XXX this function is in image_ops.c too, exactly the same, should be moved to a generally accessible position
+static void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf)
+{
+ uiPopupMenu *pup;
+ uiLayout *layout;
+ char line[FILE_MAX + 100];
+ char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX];
+
+ strcpy(local_name, abs_name);
+ BLI_splitdirstring(local_name, fi);
+ sprintf(local_name, "//%s/%s", folder, fi);
+
+ pup= uiPupMenuBegin(C, "Unpack file", 0);
+ layout= uiPupMenuLayout(pup);
+
+ uiItemEnumO(layout, "Remove Pack", 0, opname, "method", PF_REMOVE);
+
+ if(strcmp(abs_name, local_name)) {
+ switch(checkPackedFile(local_name, pf)) {
+ case PF_NOFILE:
+ sprintf(line, "Create %s", local_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL);
+ break;
+ case PF_EQUAL:
+ sprintf(line, "Use %s (identical)", local_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL);
+ break;
+ case PF_DIFFERS:
+ sprintf(line, "Use %s (differs)", local_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL);
+ sprintf(line, "Overwrite %s", local_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL);
+ break;
+ }
+ }
+
+ switch(checkPackedFile(abs_name, pf)) {
+ case PF_NOFILE:
+ sprintf(line, "Create %s", abs_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL);
+ break;
+ case PF_EQUAL:
+ sprintf(line, "Use %s (identical)", abs_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL);
+ break;
+ case PF_DIFFERS:
+ sprintf(line, "Use %s (differs)", local_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL);
+ sprintf(line, "Overwrite %s", local_name);
+ uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL);
+ break;
+ }
+
+ uiPupMenuEnd(C, pup);
+}
+
+static int unpack_exec(bContext *C, wmOperator *op)
+{
+ int method= RNA_enum_get(op->ptr, "method");
+ Editing* ed = CTX_data_scene(C)->ed;
+ bSound* sound;
+
+ if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+ return OPERATOR_CANCELLED;
+
+ sound = ed->act_seq->sound;
+
+ if(!sound || !sound->packedfile)
+ return OPERATOR_CANCELLED;
+
+ if(G.fileflags & G_AUTOPACK)
+ BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
+
+ unpackSound(op->reports, sound, method);
+
+ return OPERATOR_FINISHED;
+}
+
+static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ Editing* ed = CTX_data_scene(C)->ed;
+ bSound* sound;
+
+ if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+ return OPERATOR_CANCELLED;
+
+ sound = ed->act_seq->sound;
+
+ if(!sound || !sound->packedfile)
+ return OPERATOR_CANCELLED;
+
+ if(G.fileflags & G_AUTOPACK)
+ BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
+
+ unpack_menu(C, "SOUND_OT_unpack", sound->name, "audio", sound->packedfile);
+
+ return OPERATOR_FINISHED;
+}
+
+void SOUND_OT_unpack(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Unpack Sound";
+ ot->idname= "SOUND_OT_unpack";
+
+ /* api callbacks */
+ ot->exec= unpack_exec;
+ ot->invoke= unpack_invoke;
+ ot->poll= sound_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack.");
+}
+
+/* ******************************************************* */
+
+void ED_operatortypes_sound(void)
+{
+ WM_operatortype_append(SOUND_OT_open);
+ WM_operatortype_append(SOUND_OT_pack);
+ WM_operatortype_append(SOUND_OT_unpack);
+}
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index 216ff3993dd..4288cc10a26 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -60,6 +60,7 @@
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
+#include "DNA_meta_types.h"
#include "DNA_userdef_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
@@ -91,319 +92,19 @@
#include "ED_screen.h"
#include "ED_space_api.h"
-#if 0 // XXX old includes for reference only
- #include "BIF_editaction.h"
- #include "BIF_editkey.h"
- #include "BIF_editnla.h"
- #include "BIF_drawgpencil.h"
- #include "BIF_keyframing.h"
- #include "BIF_language.h"
- #include "BIF_space.h"
-
- #include "BDR_editcurve.h"
- #include "BDR_gpencil.h"
-
- #include "BSE_drawnla.h"
- #include "BSE_drawipo.h"
- #include "BSE_drawview.h"
- #include "BSE_editaction_types.h"
- #include "BSE_editipo.h"
- #include "BSE_headerbuttons.h"
- #include "BSE_time.h"
- #include "BSE_view.h"
-#endif // XXX old defines for reference only
-
-/* XXX */
-extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
-
-/********************************** Slider Stuff **************************** */
-
-#if 0 // XXX all of this slider stuff will need a rethink!
-/* sliders for shapekeys */
-static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key)
-{
- int i;
- char str[64];
- float x, y;
- uiBlock *block;
- uiBut *but;
-
- /* lets make the shapekey sliders */
-
- /* reset the damn myortho2 or the sliders won't draw/redraw
- * correctly *grumble*
- */
- mywinset(curarea->win);
- myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- sprintf(str, "actionbuttonswin %d", curarea->win);
- block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS);
-
- x = ACHANNEL_NAMEWIDTH + 1;
- y = 0.0f;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- if (!(G.saction->flag & SACTION_SLIDERS)) {
- ACTWIDTH = ACHANNEL_NAMEWIDTH;
- but=uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR,
- ICON_DISCLOSURE_TRI_RIGHT,
- ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT,
- XIC,YIC-2,
- &(G.saction->flag), 0, 0, 0, 0,
- "Show action window sliders");
- /* no hilite, the winmatrix is not correct later on... */
- uiButSetFlag(but, UI_NO_HILITE);
- }
- else {
- but= uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR,
- ICON_DISCLOSURE_TRI_DOWN,
- ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT,
- XIC,YIC-2,
- &(G.saction->flag), 0, 0, 0, 0,
- "Hide action window sliders");
- /* no hilite, the winmatrix is not correct later on... */
- uiButSetFlag(but, UI_NO_HILITE);
-
- ACTWIDTH = ACHANNEL_NAMEWIDTH + SLIDERWIDTH;
-
- /* sliders are open so draw them */
- BIF_ThemeColor(TH_FACE);
-
- glRects(ACHANNEL_NAMEWIDTH, 0, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, curarea->winy);
- uiBlockSetEmboss(block, UI_EMBOSS);
- for (i=1; i < key->totkey; i++) {
- make_rvk_slider(block, ob, i,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys");
-
- y-=CHANNELHEIGHT+CHANNELSKIP;
-
- /* see sliderval array in editkey.c */
- if (i >= 255) break;
- }
- }
- uiDrawBlock(C, block);
-}
-
-static void icu_slider_func(void *voidicu, void *voidignore)
-{
- /* the callback for the icu sliders ... copies the
- * value from the icu->curval into a bezier at the
- * right frame on the right ipo curve (creating both the
- * ipo curve and the bezier if needed).
- */
- IpoCurve *icu= voidicu;
- BezTriple *bezt=NULL;
- float cfra, icuval;
-
- cfra = frame_to_float(CFRA);
- if (G.saction->pin==0 && OBACT)
- cfra= get_action_frame(OBACT, cfra);
-
- /* if the ipocurve exists, try to get a bezier
- * for this frame
- */
- bezt = get_bezt_icu_time(icu, &cfra, &icuval);
-
- /* create the bezier triple if one doesn't exist,
- * otherwise modify it's value
- */
- if (bezt == NULL) {
- insert_vert_icu(icu, cfra, icu->curval, 0);
- }
- else {
- bezt->vec[1][1] = icu->curval;
- }
-
- /* make sure the Ipo's are properly processed and
- * redraw as necessary
- */
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
-
- /* nla-update (in case this affects anything) */
- synchronize_action_strips();
-
- /* do redraw pushes, and also the depsgraph flushes */
- if (OBACT->pose || ob_get_key(OBACT))
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC);
- else
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWBUTSALL, 0);
-}
-
-static void make_icu_slider(uiBlock *block, IpoCurve *icu,
- int x, int y, int w, int h, char *tip)
-{
- /* create a slider for the ipo-curve*/
- uiBut *but;
-
- if(icu == NULL) return;
-
- if (IS_EQ(icu->slide_max, icu->slide_min)) {
- if (IS_EQ(icu->ymax, icu->ymin)) {
- if (ELEM(icu->blocktype, ID_CO, ID_KE)) {
- /* hack for constraints and shapekeys (and maybe a few others) */
- icu->slide_min= 0.0;
- icu->slide_max= 1.0;
- }
- else {
- icu->slide_min= -100;
- icu->slide_max= 100;
- }
- }
- else {
- icu->slide_min= icu->ymin;
- icu->slide_max= icu->ymax;
- }
- }
- if (icu->slide_min >= icu->slide_max) {
- SWAP(float, icu->slide_min, icu->slide_max);
- }
-
- but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "",
- x, y , w, h,
- &(icu->curval), icu->slide_min, icu->slide_max,
- 10, 2, tip);
-
- uiButSetFunc(but, icu_slider_func, icu, NULL);
-
- // no hilite, the winmatrix is not correct later on...
- uiButSetFlag(but, UI_NO_HILITE);
-}
-
-/* sliders for ipo-curves of active action-channel */
-static void action_icu_buts(SpaceAction *saction)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- char str[64];
- float x, y;
- uiBlock *block;
-
- /* lets make the action sliders */
-
- /* reset the damn myortho2 or the sliders won't draw/redraw
- * correctly *grumble*
- */
- mywinset(curarea->win);
- myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- sprintf(str, "actionbuttonswin %d", curarea->win);
- block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS);
-
- x = (float)ACHANNEL_NAMEWIDTH + 1;
- y = 0.0f;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- if (G.saction->flag & SACTION_SLIDERS) {
- /* sliders are open so draw them */
-
- /* get editor data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* build list of channels to draw */
- filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* draw backdrop first */
- BIF_ThemeColor(TH_FACE); // change this color... it's ugly
- glRects(ACHANNEL_NAMEWIDTH, (short)G.v2d->cur.ymin, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, (short)G.v2d->cur.ymax);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- for (ale= act_data.first; ale; ale= ale->next) {
- const float yminc= y-CHANNELHEIGHT/2;
- const float ymaxc= y+CHANNELHEIGHT/2;
-
- /* check if visible */
- if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) ||
- IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) )
- {
- /* determine what needs to be drawn */
- switch (ale->type) {
- case ACTTYPE_CONCHAN: /* constraint channel */
- {
- bActionChannel *achan = (bActionChannel *)ale->owner;
- IpoCurve *icu = (IpoCurve *)ale->key_data;
-
- /* only show if owner is selected */
- if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) {
- make_icu_slider(block, icu,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
- "Slider to control current value of Constraint Influence");
- }
- }
- break;
- case ACTTYPE_ICU: /* ipo-curve channel */
- {
- bActionChannel *achan = (bActionChannel *)ale->owner;
- IpoCurve *icu = (IpoCurve *)ale->key_data;
-
- /* only show if owner is selected */
- if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) {
- make_icu_slider(block, icu,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
- "Slider to control current value of IPO-Curve");
- }
- }
- break;
- case ACTTYPE_SHAPEKEY: /* shapekey channel */
- {
- Object *ob= (Object *)ale->id;
- IpoCurve *icu= (IpoCurve *)ale->key_data;
-
- // TODO: only show if object is active
- if (icu) {
- make_icu_slider(block, icu,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
- "Slider to control ShapeKey");
- }
- else if (ob && ale->index) {
- make_rvk_slider(block, ob, ale->index,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys");
- }
- }
- break;
- }
- }
-
- /* adjust y-position for next one */
- y-=CHANNELHEIGHT+CHANNELSKIP;
- }
-
- /* free tempolary channels */
- BLI_freelistN(&act_data);
- }
- uiDrawBlock(C, block);
-}
-
-#endif // XXX all of this slider stuff will need a rethink
-
/* ************************************************************************* */
/* Channel List */
/* left hand part */
-void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
+void draw_channel_names(bContext *C, bAnimContext *ac, SpaceAction *saction, ARegion *ar)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
View2D *v2d= &ar->v2d;
- float x= 0.0f, y= 0.0f;
+ float y= 0.0f;
int items, height;
/* build list of channels to draw */
@@ -427,566 +128,48 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL);
/* loop through channels, and set up drawing depending on their type */
- y= (float)ACHANNEL_FIRST;
-
- for (ale= anim_data.first; ale; ale= ale->next) {
- const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
- const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
+ { /* first pass: just the standard GL-drawing for backdrop + text */
+ y= (float)ACHANNEL_FIRST;
- /* check if visible */
- if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
- IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
- {
- bActionGroup *grp = NULL;
- short indent= 0, offset= 0, sel= 0, group= 0;
- int expand= -1, protect = -1, special= -1, mute = -1;
- char name[128];
-
- /* determine what needs to be drawn */
- switch (ale->type) {
- case ANIMTYPE_SCENE: /* scene */
- {
- Scene *sce= (Scene *)ale->data;
-
- group= 4;
- indent= 0;
-
- special= ICON_SCENE_DATA;
-
- /* only show expand if there are any channels */
- if (EXPANDED_SCEC(sce))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- sel = SEL_SCEC(sce);
- strcpy(name, sce->id.name+2);
- }
- break;
- case ANIMTYPE_OBJECT: /* object */
- {
- Base *base= (Base *)ale->data;
- Object *ob= base->object;
-
- group= 4;
- indent= 0;
-
- /* icon depends on object-type */
- if (ob->type == OB_ARMATURE)
- special= ICON_ARMATURE_DATA;
- else
- special= ICON_OBJECT_DATA;
-
- /* only show expand if there are any channels */
- if (EXPANDED_OBJC(ob))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- sel = SEL_OBJC(base);
- strcpy(name, ob->id.name+2);
- }
- break;
- case ANIMTYPE_FILLACTD: /* action widget */
- {
- bAction *act= (bAction *)ale->data;
-
- group = 4;
- indent= 1;
- special= ICON_ACTION;
-
- if (EXPANDED_ACTC(act))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- sel = SEL_ACTC(act);
- strcpy(name, act->id.name+2);
- }
- break;
- case ANIMTYPE_FILLMATD: /* object materials (dopesheet) expand widget */
- {
- Object *ob = (Object *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_MATERIAL_DATA;
-
- if (FILTER_MAT_OBJC(ob))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, "Materials");
- }
- break;
- case ANIMTYPE_FILLPARTD: /* object particles (dopesheet) expand widget */
- {
- Object *ob = (Object *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_PARTICLE_DATA;
-
- if (FILTER_PART_OBJC(ob))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, "Particles");
- }
- break;
-
-
- case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */
- {
- Material *ma = (Material *)ale->data;
-
- group = 0;
- indent = 0;
- special = ICON_MATERIAL_DATA;
- offset = 21;
-
- if (FILTER_MAT_OBJD(ma))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, ma->id.name+2);
- }
- break;
- case ANIMTYPE_DSLAM: /* lamp (dopesheet) expand widget */
- {
- Lamp *la = (Lamp *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_LAMP_DATA;
-
- if (FILTER_LAM_OBJD(la))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, la->id.name+2);
- }
- break;
- case ANIMTYPE_DSCAM: /* camera (dopesheet) expand widget */
- {
- Camera *ca = (Camera *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_CAMERA_DATA;
-
- if (FILTER_CAM_OBJD(ca))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, ca->id.name+2);
- }
- break;
- case ANIMTYPE_DSCUR: /* curve (dopesheet) expand widget */
- {
- Curve *cu = (Curve *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_CURVE_DATA;
-
- if (FILTER_CUR_OBJD(cu))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, cu->id.name+2);
- }
- break;
- case ANIMTYPE_DSSKEY: /* shapekeys (dopesheet) expand widget */
- {
- Key *key= (Key *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_SHAPEKEY_DATA; // XXX
-
- if (FILTER_SKE_OBJD(key))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- //sel = SEL_OBJC(base);
- strcpy(name, "Shape Keys");
- }
- break;
- case ANIMTYPE_DSWOR: /* world (dopesheet) expand widget */
- {
- World *wo= (World *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_WORLD_DATA;
-
- if (FILTER_WOR_SCED(wo))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, wo->id.name+2);
- }
- break;
- case ANIMTYPE_DSPART: /* particle (dopesheet) expand widget */
- {
- ParticleSettings *part= (ParticleSettings*)ale->data;
-
- group = 0;
- indent = 0;
- special = ICON_PARTICLE_DATA;
- offset = 21;
-
- if (FILTER_PART_OBJD(part))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, part->id.name+2);
- }
- break;
-
-
- case ANIMTYPE_GROUP: /* action group */
- {
- bActionGroup *agrp= (bActionGroup *)ale->data;
-
- group= 2;
- indent= 0;
- special= -1;
-
- if (ale->id) {
- /* special exception for materials */
- if (GS(ale->id->name) == ID_MA)
- offset= 25;
- else
- offset= 14;
- }
- else
- offset= 0;
-
- /* only show expand if there are any channels */
- if (agrp->channels.first) {
- if (EXPANDED_AGRP(agrp))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
- }
-
- if (agrp->flag & AGRP_MUTED)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
-
- if (EDITABLE_AGRP(agrp))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
-
- sel = SEL_AGRP(agrp);
- strcpy(name, agrp->name);
- }
- break;
- case ANIMTYPE_FCURVE: /* F-Curve channel */
- {
- FCurve *fcu = (FCurve *)ale->data;
-
- indent = 0;
-
- group= (fcu->grp) ? 1 : 0;
- grp= fcu->grp;
-
- if (ale->id) {
- /* special exception for materials and particles */
- if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) {
- offset= 21;
- indent= 1;
- }
- else
- offset= 14;
- }
- else
- offset= 0;
-
- if (fcu->flag & FCURVE_MUTED)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
-
- if (fcu->bezt) {
- if (EDITABLE_FCU(fcu))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
- }
- else
- protect = ICON_ZOOMOUT; // XXX editability is irrelevant here, but this icon is temp...
-
- sel = SEL_FCU(fcu);
-
- getname_anim_fcurve(name, ale->id, fcu);
- }
- break;
-
- case ANIMTYPE_SHAPEKEY: /* shapekey channel */
- {
- KeyBlock *kb = (KeyBlock *)ale->data;
-
- indent = 0;
- special = -1;
-
- offset= (ale->id) ? 21 : 0;
-
- if (kb->name[0] == '\0')
- sprintf(name, "Key %d", ale->index);
- else
- strcpy(name, kb->name);
- }
- break;
-
- case ANIMTYPE_GPDATABLOCK: /* gpencil datablock */
- {
- bGPdata *gpd = (bGPdata *)ale->data;
- ScrArea *sa = (ScrArea *)ale->owner;
-
- indent = 0;
- group= 3;
-
- /* only show expand if there are any channels */
- if (gpd->layers.first) {
- if (gpd->flag & GP_DATA_EXPAND)
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
- }
-
- switch (sa->spacetype) {
- case SPACE_VIEW3D:
- {
- /* this shouldn't cause any overflow... */
- //sprintf(name, "3DView:%s", view3d_get_name(sa->spacedata.first)); // XXX missing func..
- strcpy(name, "3dView");
- special= ICON_VIEW3D;
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= sa->spacedata.first;
- char treetype[12];
-
- if (snode->treetype == 1)
- strcpy(treetype, "Composite");
- else
- strcpy(treetype, "Material");
- sprintf(name, "Nodes:%s", treetype);
-
- special= ICON_NODE;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= sa->spacedata.first;
- char imgpreview[10];
-
- switch (sseq->mainb) {
- case 1: sprintf(imgpreview, "Image..."); break;
- case 2: sprintf(imgpreview, "Luma..."); break;
- case 3: sprintf(imgpreview, "Chroma..."); break;
- case 4: sprintf(imgpreview, "Histogram"); break;
-
- default: sprintf(imgpreview, "Sequence"); break;
- }
- sprintf(name, "Sequencer:%s", imgpreview);
-
- special= ICON_SEQUENCE;
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= sa->spacedata.first;
-
- if (sima->image)
- sprintf(name, "Image:%s", sima->image->id.name+2);
- else
- strcpy(name, "Image:<None>");
-
- special= ICON_IMAGE_COL;
- }
- break;
-
- default:
- {
- sprintf(name, "<Unknown GP-Data Source>");
- special= -1;
- }
- break;
- }
- }
- break;
- case ANIMTYPE_GPLAYER: /* gpencil layer */
- {
- bGPDlayer *gpl = (bGPDlayer *)ale->data;
-
- indent = 0;
- special = -1;
- expand = -1;
- group = 1;
-
- if (EDITABLE_GPL(gpl))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
-
- if (gpl->flag & GP_LAYER_HIDE)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
-
- sel = SEL_GPL(gpl);
- BLI_snprintf(name, 32, gpl->info);
- }
- break;
- }
-
- /* now, start drawing based on this information */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- /* draw backing strip behind channel name */
- if (group == 4) {
- /* only used in dopesheet... */
- if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) {
- /* object channel - darker */
- UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
- }
- else {
- /* sub-object folders - lighter */
- UI_ThemeColor(TH_DOPESHEET_CHANNELSUBOB);
-
- offset += 7 * indent;
- glBegin(GL_QUADS);
- glVertex2f(x+offset, yminc);
- glVertex2f(x+offset, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, yminc);
- glEnd();
-
- /* clear group value, otherwise we cause errors... */
- group = 0;
- }
- }
- else if (group == 3) {
- /* only for gp-data channels */
- UI_ThemeColorShade(TH_GROUP, 20);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
- }
- else if (group == 2) {
- /* only for action group channels */
- if (ale->flag & AGRP_ACTIVE)
- UI_ThemeColorShade(TH_GROUP_ACTIVE, 10);
- else
- UI_ThemeColorShade(TH_GROUP, 20);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
- }
- else {
- /* for normal channels
- * - use 3 shades of color group/standard color for 3 indention level
- * - only use group colors if allowed to, and if actually feasible
- */
- if ( !(saction->flag & SACTION_NODRAWGCOLORS) &&
- (grp) && (grp->customCol) )
- {
- char cp[3];
-
- if (indent == 2) {
- VECCOPY(cp, grp->cs.solid);
- }
- else if (indent == 1) {
- VECCOPY(cp, grp->cs.select);
- }
- else {
- VECCOPY(cp, grp->cs.active);
- }
-
- glColor3ub(cp[0], cp[1], cp[2]);
- }
- else
- UI_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
-
- indent += group;
- offset += 7 * indent;
- glBegin(GL_QUADS);
- glVertex2f(x+offset, yminc);
- glVertex2f(x+offset, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, yminc);
- glEnd();
- }
-
- /* draw expand/collapse triangle */
- if (expand > 0) {
- UI_icon_draw(x+offset, yminc, expand);
- offset += 17;
- }
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
- /* draw special icon indicating certain data-types */
- if (special > -1) {
- if (ELEM(group, 3, 4)) {
- /* for gpdatablock channels */
- UI_icon_draw(x+offset, yminc, special);
- offset += 17;
- }
- else {
- /* for normal channels */
- UI_icon_draw(x+offset, yminc, special);
- offset += 17;
- }
+ /* check if visible */
+ if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw(ac, ale, yminc, ymaxc);
}
- glDisable(GL_BLEND);
-
- /* draw name */
- if (sel)
- UI_ThemeColor(TH_TEXT_HI);
- else
- UI_ThemeColor(TH_TEXT);
- offset += 3;
- UI_DrawString(x+offset, y-4, name);
- /* reset offset - for RHS of panel */
- offset = 0;
-
- /* set blending again, as text drawing may clear it */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
+ /* adjust y-position for next one */
+ y -= ACHANNEL_STEP;
+ }
+ }
+ { /* second pass: widgets */
+ uiBlock *block= uiBeginBlock(C, ar, "dopesheet channel buttons", UI_EMBOSS);
+
+ y= (float)ACHANNEL_FIRST;
+
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
- /* draw protect 'lock' */
- if (protect > -1) {
- offset = 16;
- UI_icon_draw((float)ACHANNEL_NAMEWIDTH-offset, yminc, protect);
+ /* check if visible */
+ if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw_widgets(ac, ale, block, yminc, ymaxc);
}
- /* draw mute 'eye' */
- if (mute > -1) {
- offset += 16;
- UI_icon_draw((float)(ACHANNEL_NAMEWIDTH-offset), yminc, mute);
- }
- glDisable(GL_BLEND);
+ /* adjust y-position for next one */
+ y -= ACHANNEL_STEP;
}
- /* adjust y-position for next one */
- y -= ACHANNEL_STEP;
+ uiEndBlock(C, block);
+ uiDrawBlock(C, block);
}
/* free tempolary channels */
@@ -1035,7 +218,6 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
adt= ANIM_nla_mapping_get(ac, NULL);
/* start and end of action itself */
- // TODO: this has not had scaling applied
calc_action_range(ac->data, &act_start, &act_end, 0);
}
@@ -1067,43 +249,14 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
{
+ bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
int sel=0;
/* determine if any need to draw channel */
if (ale->datatype != ALE_NONE) {
/* determine if channel is selected */
- switch (ale->type) {
- case ANIMTYPE_SCENE:
- {
- Scene *sce= (Scene *)ale->data;
- sel = SEL_SCEC(sce);
- }
- break;
- case ANIMTYPE_OBJECT:
- {
- Base *base= (Base *)ale->data;
- sel = SEL_OBJC(base);
- }
- break;
- case ANIMTYPE_GROUP:
- {
- bActionGroup *agrp = (bActionGroup *)ale->data;
- sel = SEL_AGRP(agrp);
- }
- break;
- case ANIMTYPE_FCURVE:
- {
- FCurve *fcu = (FCurve *)ale->data;
- sel = SEL_FCU(fcu);
- }
- break;
- case ANIMTYPE_GPLAYER:
- {
- bGPDlayer *gpl = (bGPDlayer *)ale->data;
- sel = SEL_GPL(gpl);
- }
- break;
- }
+ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
+ sel= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) {
switch (ale->type) {
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index d4709e94e5e..89633d0cdfe 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -397,7 +397,7 @@ static void insert_action_keys(bAnimContext *ac, short mode)
/* init keyframing flag */
if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
- // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE;
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS)) flag |= INSERTKEY_REPLACE;
/* insert keyframes */
for (ale= anim_data.first; ale; ale= ale->next) {
@@ -679,11 +679,6 @@ void ACT_OT_clean (wmOperatorType *ot)
/* ******************** Sample Keyframes Operator *********************** */
-/* little cache for values... */
-typedef struct tempFrameValCache {
- float frame, val;
-} tempFrameValCache;
-
/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
static void sample_action_keys (bAnimContext *ac)
{
@@ -696,64 +691,8 @@ static void sample_action_keys (bAnimContext *ac)
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and add keys between selected keyframes on every frame */
- for (ale= anim_data.first; ale; ale= ale->next) {
- FCurve *fcu= (FCurve *)ale->key_data;
- BezTriple *bezt, *start=NULL, *end=NULL;
- tempFrameValCache *value_cache, *fp;
- int sfra, range;
- int i, n;
-
- /* find selected keyframes... once pair has been found, add keyframes */
- for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {
- /* check if selected, and which end this is */
- if (BEZSELECTED(bezt)) {
- if (start) {
- /* set end */
- end= bezt;
-
- /* cache values then add keyframes using these values, as adding
- * keyframes while sampling will affect the outcome...
- */
- range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) );
- sfra= (int)( floor(start->vec[1][0]) );
-
- if (range) {
- value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache");
-
- /* sample values */
- for (n=0, fp=value_cache; n<range && fp; n++, fp++) {
- fp->frame= (float)(sfra + n);
- fp->val= evaluate_fcurve(fcu, fp->frame);
- }
-
- /* add keyframes with these */
- for (n=0, fp=value_cache; n<range && fp; n++, fp++) {
- insert_vert_fcurve(fcu, fp->frame, fp->val, 1);
- }
-
- /* free temp cache */
- MEM_freeN(value_cache);
-
- /* as we added keyframes, we need to compensate so that bezt is at the right place */
- bezt = fcu->bezt + i + range - 1;
- i += (range - 1);
- }
-
- /* bezt was selected, so it now marks the start of a whole new chain to search */
- start= bezt;
- end= NULL;
- }
- else {
- /* just set start keyframe */
- start= bezt;
- end= NULL;
- }
- }
- }
-
- /* recalculate channel's handles? */
- calchandles_fcurve(fcu);
- }
+ for (ale= anim_data.first; ale; ale= ale->next)
+ sample_fcurve((FCurve *)ale->key_data);
/* admin and redraws */
BLI_freelistN(&anim_data);
@@ -1038,6 +977,77 @@ void ACT_OT_handle_type (wmOperatorType *ot)
RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", "");
}
+/* ******************** Set Keyframe-Type Operator *********************** */
+
+/* this function is responsible for setting interpolation mode for keyframes */
+static void setkeytype_action_keys(bAnimContext *ac, short mode)
+{
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+ BeztEditFunc set_cb= ANIM_editkeyframes_keytype(mode);
+
+ /* filter data */
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
+ ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
+
+ /* loop through setting BezTriple interpolation
+ * Note: we do not supply BeztEditData to the looper yet. Currently that's not necessary here...
+ */
+ for (ale= anim_data.first; ale; ale= ale->next)
+ ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, NULL);
+
+ /* cleanup */
+ BLI_freelistN(&anim_data);
+}
+
+/* ------------------- */
+
+static int actkeys_keytype_exec(bContext *C, wmOperator *op)
+{
+ bAnimContext ac;
+ short mode;
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+ if (ac.datatype == ANIMCONT_GPENCIL)
+ return OPERATOR_PASS_THROUGH;
+
+ /* get handle setting mode */
+ mode= RNA_enum_get(op->ptr, "type");
+
+ /* set handle type */
+ setkeytype_action_keys(&ac, mode);
+
+ /* validate keyframes after editing */
+ ANIM_editkeyframes_refresh(&ac);
+
+ /* set notifier that keyframe properties have changed */
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void ACT_OT_keyframe_type (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Set Keyframe Type";
+ ot->idname= "ACT_OT_keyframe_type";
+ ot->description= "Set type of keyframe for the seleced keyframes.";
+
+ /* api callbacks */
+ ot->invoke= WM_menu_invoke;
+ ot->exec= actkeys_keytype_exec;
+ ot->poll= ED_operator_action_active;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* id-props */
+ RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", "");
+}
+
/* ************************************************************************** */
/* TRANSFORM STUFF */
diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c
index 7f5e2851070..8674f481a18 100644
--- a/source/blender/editors/space_action/action_header.c
+++ b/source/blender/editors/space_action/action_header.c
@@ -43,6 +43,7 @@
#include "BLI_blenlib.h"
#include "BKE_animsys.h"
+#include "BKE_action.h"
#include "BKE_context.h"
#include "BKE_screen.h"
@@ -88,9 +89,9 @@ static void act_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
//uiItemS(layout);
- uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0);
- uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0, 0, 0);
- uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0, 0, 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0);
if (sact->flag & SACTION_DRAWTIME)
uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle");
@@ -153,7 +154,7 @@ static void act_channelmenu(bContext *C, uiLayout *layout, void *arg_unused)
static void act_gplayermenu(bContext *C, uiLayout *layout, void *arg_unused)
{
- //uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu);
+ //uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu, NULL, NULL);
//uiItemS(layout);
//uiItemO(layout, NULL, 0, "NLAEDIT_OT_duplicate");
}
@@ -167,6 +168,7 @@ static void act_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unus
static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_CFRA);
uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_FRAME);
uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_SECOND);
@@ -175,14 +177,23 @@ static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_CFRA);
uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_YAXIS);
uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_XAXIS);
uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_MARKER);
}
+static void act_edit_keytypesmenu(bContext *C, uiLayout *layout, void *arg_unused)
+{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
+ uiItemEnumO(layout, NULL, 0, "ACT_OT_keyframe_type", "type", BEZT_KEYTYPE_KEYFRAME);
+ uiItemEnumO(layout, NULL, 0, "ACT_OT_keyframe_type", "type", BEZT_KEYTYPE_BREAKDOWN);
+}
+
static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_FREE);
uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_AUTO);
uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_VECT);
@@ -192,6 +203,7 @@ static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused
static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_CONST);
uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_LIN);
uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_BEZ);
@@ -199,15 +211,16 @@ static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
static void act_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT);
uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR);
}
static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
- uiItemMenuF(layout, "Transform", 0, act_edit_transformmenu);
- uiItemMenuF(layout, "Snap", 0, act_edit_snapmenu);
- uiItemMenuF(layout, "Mirror", 0, act_edit_mirrormenu);
+ uiItemMenuF(layout, "Transform", 0, act_edit_transformmenu, NULL);
+ uiItemMenuF(layout, "Snap", 0, act_edit_snapmenu, NULL);
+ uiItemMenuF(layout, "Mirror", 0, act_edit_mirrormenu, NULL);
uiItemS(layout);
@@ -220,9 +233,10 @@ static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemS(layout);
- uiItemMenuF(layout, "Handle Type", 0, act_edit_handlesmenu);
- uiItemMenuF(layout, "Interpolation Mode", 0, act_edit_ipomenu);
- uiItemMenuF(layout, "Extrapolation Mode", 0, act_edit_expomenu);
+ uiItemMenuF(layout, "Keyframe Type", 0, act_edit_keytypesmenu, NULL);
+ uiItemMenuF(layout, "Handle Type", 0, act_edit_handlesmenu, NULL);
+ uiItemMenuF(layout, "Interpolation Mode", 0, act_edit_ipomenu, NULL);
+ uiItemMenuF(layout, "Extrapolation Mode", 0, act_edit_expomenu, NULL);
uiItemS(layout);
@@ -267,6 +281,7 @@ static void saction_idpoin_handle(bContext *C, ID *id, int event)
/* set action */
printf("\tset action \n");
adt->action= saction->action;
+ adt->action->id.us++;
}
ED_area_tag_redraw(CTX_wm_area(C));
@@ -277,7 +292,14 @@ static void saction_idpoin_handle(bContext *C, ID *id, int event)
break;
case UI_ID_ADD_NEW:
printf("actedit addnew \n");
- /* XXX not implemented */
+ if (saction->pin == 0) {
+ AnimData *adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
+
+ /* set new action */
+ // XXX need to restore behaviour to copy old actions...
+ printf("\tset new action \n");
+ adt->action= saction->action= add_empty_action("Action");
+ }
break;
case UI_ID_OPEN:
printf("actedit open \n");
@@ -381,6 +403,7 @@ void action_header_buttons(const bContext *C, ARegion *ar)
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Lamps");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Cameras");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Curves");
+ uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMBA, B_REDR, ICON_META_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display MetaBalls");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Particles");
uiBlockEndAlign(block);
xco += 30;
@@ -398,17 +421,17 @@ void action_header_buttons(const bContext *C, ARegion *ar)
if (saction->flag & SACTION_DRAWTIME) {
uiDefButC(block, MENU, B_REDR,
"Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3",
- xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0,
+ xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0,
"Auto-snapping mode for keyframes when transforming");
}
else {
uiDefButC(block, MENU, B_REDR,
"Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3",
- xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0,
+ xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0,
"Auto-snapping mode for keyframes when transforming");
}
- xco += (70 + 8);
+ xco += (90 + 8);
}
/* COPY PASTE */
diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h
index 26655892176..e5f0ab8994e 100644
--- a/source/blender/editors/space_action/action_intern.h
+++ b/source/blender/editors/space_action/action_intern.h
@@ -41,7 +41,7 @@ struct bAnimListElem;
/* ***************************************** */
/* action_draw.c */
-void draw_channel_names(struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar);
+void draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar);
void draw_channel_strips(struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar);
struct ActKeysInc *init_aki_data(struct bAnimContext *ac, struct bAnimListElem *ale);
@@ -89,6 +89,7 @@ void ACT_OT_delete(struct wmOperatorType *ot);
void ACT_OT_clean(struct wmOperatorType *ot);
void ACT_OT_sample(struct wmOperatorType *ot);
+void ACT_OT_keyframe_type(struct wmOperatorType *ot);
void ACT_OT_handle_type(struct wmOperatorType *ot);
void ACT_OT_interpolation_type(struct wmOperatorType *ot);
void ACT_OT_extrapolation_type(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index f18b6197eb3..42b033040b1 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -75,6 +75,7 @@ void action_operatortypes(void)
WM_operatortype_append(ACT_OT_handle_type);
WM_operatortype_append(ACT_OT_interpolation_type);
WM_operatortype_append(ACT_OT_extrapolation_type);
+ WM_operatortype_append(ACT_OT_keyframe_type);
WM_operatortype_append(ACT_OT_sample);
WM_operatortype_append(ACT_OT_clean);
WM_operatortype_append(ACT_OT_delete);
@@ -133,6 +134,7 @@ static void action_keymap_keyframes (wmWindowManager *wm, ListBase *keymap)
WM_keymap_add_item(keymap, "ACT_OT_handle_type", HKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "ACT_OT_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "ACT_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "ACT_OT_keyframe_type", RKEY, KM_PRESS, 0, 0);
/* destructive */
WM_keymap_add_item(keymap, "ACT_OT_clean", OKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 55e035cfced..2977d07d845 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -243,7 +243,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar)
/* data */
if (ANIM_animdata_get_context(C, &ac)) {
- draw_channel_names(&ac, saction, ar);
+ draw_channel_names((bContext *)C, &ac, saction, ar);
}
/* reset view matrix */
@@ -294,6 +294,7 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
case NC_SCENE:
switch(wmn->data) {
case ND_OB_ACTIVE:
+ case ND_FRAME:
ED_region_tag_redraw(ar);
break;
}
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 5c33b648947..edd5da44526 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -42,6 +42,7 @@
#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_curve.h"
+#include "ED_gpencil.h"
#include "ED_markers.h"
#include "ED_mesh.h"
#include "ED_object.h"
@@ -50,6 +51,7 @@
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_space_api.h"
+#include "ED_sound.h"
#include "ED_uvedit.h"
#include "ED_mball.h"
@@ -77,12 +79,14 @@ void ED_spacetypes_init(void)
ED_spacetype_sequencer();
ED_spacetype_logic();
ED_spacetype_console();
+ ED_spacetype_userpref();
// ...
/* register operator types for screen and all spaces */
ED_operatortypes_screen();
ED_operatortypes_anim();
- ED_operatortypes_animchannels(); // XXX have this as part of anim() ones instead?
+ ED_operatortypes_animchannels();
+ ED_operatortypes_gpencil();
ED_operatortypes_object();
ED_operatortypes_mesh();
ED_operatortypes_sculpt();
@@ -96,6 +100,7 @@ void ED_spacetypes_init(void)
ED_operatortypes_fluid();
ED_operatortypes_metaball();
ED_operatortypes_boids();
+ ED_operatortypes_sound();
ui_view2d_operatortypes();
@@ -116,6 +121,7 @@ void ED_spacetypes_keymap(wmWindowManager *wm)
ED_keymap_screen(wm);
ED_keymap_anim(wm);
ED_keymap_animchannels(wm);
+ ED_keymap_gpencil(wm);
ED_keymap_object(wm);
ED_keymap_mesh(wm);
ED_keymap_uvedit(wm);
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 614017cc4c6..635abd429f6 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -49,6 +49,7 @@
#include "BKE_global.h"
#include "BKE_material.h"
#include "BKE_modifier.h"
+#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_screen.h"
#include "BKE_utildefines.h"
@@ -199,7 +200,7 @@ static int buttons_context_path_modifier(ButsContextPath *path)
if(buttons_context_path_object(path)) {
ob= path->ptr[path->len-1].data;
- if(ob && ELEM4(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF))
+ if(ob && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE))
return 1;
}
@@ -304,7 +305,7 @@ static int buttons_context_path_particle(ButsContextPath *path)
return 0;
}
-static int buttons_context_path_brush(ButsContextPath *path)
+static int buttons_context_path_brush(const bContext *C, ButsContextPath *path)
{
Scene *scene;
ToolSettings *ts;
@@ -320,14 +321,8 @@ static int buttons_context_path_brush(ButsContextPath *path)
scene= path->ptr[path->len-1].data;
ts= scene->toolsettings;
- if(G.f & G_SCULPTMODE)
- br= ts->sculpt->brush;
- else if(G.f & G_VERTEXPAINT)
- br= ts->vpaint->brush;
- else if(G.f & G_WEIGHTPAINT)
- br= ts->wpaint->brush;
- else if(G.f & G_TEXTUREPAINT)
- br= ts->imapaint.brush;
+ if(scene)
+ br= paint_brush(paint_get_active(scene));
if(br) {
RNA_id_pointer_create(&br->id, &path->ptr[path->len]);
@@ -337,11 +332,11 @@ static int buttons_context_path_brush(ButsContextPath *path)
}
}
- /* no path to a world possible */
+ /* no path to a brush possible */
return 0;
}
-static int buttons_context_path_texture(ButsContextPath *path)
+static int buttons_context_path_texture(const bContext *C, ButsContextPath *path)
{
Material *ma;
Lamp *la;
@@ -356,7 +351,7 @@ static int buttons_context_path_texture(ButsContextPath *path)
return 1;
}
/* try brush */
- else if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(path)) {
+ else if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(C, path)) {
br= path->ptr[path->len-1].data;
if(br) {
@@ -465,7 +460,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
found= buttons_context_path_material(path);
break;
case BCONTEXT_TEXTURE:
- found= buttons_context_path_texture(path);
+ found= buttons_context_path_texture(C, path);
break;
case BCONTEXT_BONE:
found= buttons_context_path_bone(path);
@@ -558,7 +553,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
"world", "object", "mesh", "armature", "lattice", "curve",
"meta_ball", "lamp", "camera", "material", "material_slot",
"texture", "texture_slot", "bone", "edit_bone", "particle_system",
- "cloth", "soft_body", "fluid", "collision", "brush", NULL};
+ "cloth", "soft_body", "fluid", "smoke", "smoke_hr", "collision", "brush", NULL};
CTX_data_dir_set(result, dir);
return 1;
@@ -691,6 +686,17 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
return 1;
}
}
+
+ else if(CTX_data_equals(member, "smoke")) {
+ PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
+
+ if(ptr && ptr->data) {
+ Object *ob= ptr->data;
+ ModifierData *md= modifiers_findByType(ob, eModifierType_Smoke);
+ CTX_data_pointer_set(result, &ob->id, &RNA_SmokeModifier, md);
+ return 1;
+ }
+ }
else if(CTX_data_equals(member, "collision")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index e52efe8508d..954a52c54aa 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -613,6 +613,12 @@ void OBJECT_OT_particle_system_remove(wmOperatorType *ot)
/********************** new particle settings operator *********************/
+static int psys_poll(bContext *C)
+{
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ return (ptr.data != NULL);
+}
+
static int new_particle_settings_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
@@ -657,6 +663,7 @@ void PARTICLE_OT_new(wmOperatorType *ot)
/* api callbacks */
ot->exec= new_particle_settings_exec;
+ ot->poll= psys_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -916,7 +923,7 @@ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event)
uiPopupMenu *pup;
uiLayout *layout;
- RNA_pointer_create(&sc->id, &RNA_SpaceButtonsWindow, sbuts, &ptr);
+ RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr);
pup= uiPupMenuBegin(C, "Align", 0);
layout= uiPupMenuLayout(pup);
@@ -948,6 +955,9 @@ static int file_browse_exec(bContext *C, wmOperator *op)
FileBrowseOp *fbo= op->customdata;
char *str;
+ if (RNA_property_is_set(op->ptr, "filename")==0 || fbo==NULL)
+ return OPERATOR_CANCELLED;
+
str= RNA_string_get_alloc(op->ptr, "filename", 0, 0);
RNA_property_string_set(&fbo->ptr, fbo->prop, str);
RNA_property_update(C, &fbo->ptr, fbo->prop);
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index fa9055f2d8d..3d0d284b501 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -234,6 +234,11 @@ static int console_edit_poll(bContext *C)
return 1;
}
+static int console_poll(bContext *C)
+{
+ return (CTX_wm_space_console(C) != NULL);
+}
+
/* static funcs for text editing */
@@ -280,6 +285,7 @@ void CONSOLE_OT_move(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Cursor";
+ ot->description= "Move cursor position.";
ot->idname= "CONSOLE_OT_move";
/* api callbacks */
@@ -324,6 +330,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert";
+ ot->description= "Insert text at cursor position.";
ot->idname= "CONSOLE_OT_insert";
/* api callbacks */
@@ -391,6 +398,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
+ ot->description= "Delete text by cursor position.";
ot->idname= "CONSOLE_OT_delete";
/* api callbacks */
@@ -434,6 +442,7 @@ void CONSOLE_OT_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear";
+ ot->description= "Clear text by type.";
ot->idname= "CONSOLE_OT_clear";
/* api callbacks */
@@ -478,6 +487,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "History Cycle";
+ ot->description= "Cycle through history.";
ot->idname= "CONSOLE_OT_history_cycle";
/* api callbacks */
@@ -525,6 +535,7 @@ void CONSOLE_OT_history_append(wmOperatorType *ot)
{
/* identifiers */
ot->name= "History Append";
+ ot->description= "Append history at cursor position.";
ot->idname= "CONSOLE_OT_history_append";
/* api callbacks */
@@ -572,6 +583,7 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
/* identifiers */
ot->name= "Scrollback Append";
+ ot->description= "Append scrollback text by type.";
ot->idname= "CONSOLE_OT_scrollback_append";
/* api callbacks */
@@ -614,6 +626,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy to Clipboard";
+ ot->description= "Copy selected text to clipboard.";
ot->idname= "CONSOLE_OT_copy";
/* api callbacks */
@@ -648,6 +661,7 @@ void CONSOLE_OT_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste from Clipboard";
+ ot->description= "Paste text from clipboard.";
ot->idname= "CONSOLE_OT_paste";
/* api callbacks */
@@ -679,10 +693,14 @@ void CONSOLE_OT_zoom(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Console Zoom";
+ /*optionals -
+ "Zoom view font." */
+ ot->description= "Zoom screen area.";
ot->idname= "CONSOLE_OT_zoom";
/* api callbacks */
ot->exec= zoom_exec;
+ ot->poll= console_poll;
/* flags */
/* ot->flag= OPTYPE_REGISTER; */ /* super annoying */
diff --git a/source/blender/editors/space_console/console_report.c b/source/blender/editors/space_console/console_report.c
index 2e23c4039f1..b6920d148fd 100644
--- a/source/blender/editors/space_console/console_report.c
+++ b/source/blender/editors/space_console/console_report.c
@@ -97,7 +97,7 @@ static int report_replay_exec(bContext *C, wmOperator *op)
for(report=reports->list.last; report; report=report->prev) {
if((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL) && (report->flag & SELECT)) {
console_history_add_str(C, report->message, 0);
- WM_operator_name_call(C, "CONSOLE_OT_exec", WM_OP_EXEC_DEFAULT, NULL);
+ WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL);
ED_area_tag_redraw(CTX_wm_area(C));
}
@@ -114,6 +114,7 @@ void CONSOLE_OT_report_replay(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replay Operators";
+ ot->description= "Replay selected reports.";
ot->idname= "CONSOLE_OT_report_replay";
/* api callbacks */
@@ -160,6 +161,7 @@ void CONSOLE_OT_select_pick(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select report";
+ ot->description= "Select reports by index.";
ot->idname= "CONSOLE_OT_select_pick";
/* api callbacks */
@@ -213,6 +215,7 @@ void CONSOLE_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "(De)Select All";
+ ot->description= "(de)select all reports.";
ot->idname= "CONSOLE_OT_select_all_toggle";
/* api callbacks */
@@ -304,6 +307,7 @@ void CONSOLE_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Border Select";
+ ot->description= "Toggle border selection.";
ot->idname= "CONSOLE_OT_select_border";
/* api callbacks */
@@ -357,6 +361,7 @@ void CONSOLE_OT_report_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete Reports";
+ ot->description= "Delete selected reports.";
ot->idname= "CONSOLE_OT_report_delete";
/* api callbacks */
@@ -401,6 +406,7 @@ void CONSOLE_OT_report_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy Reports to Clipboard";
+ ot->description= "Copy selected reports to Clipboard.";
ot->idname= "CONSOLE_OT_report_copy";
/* api callbacks */
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index a763e7ce153..48890d6cac2 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -278,8 +278,8 @@ void console_keymap(struct wmWindowManager *wm)
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_PREV_CHAR);
#ifndef DISABLE_PYTHON
- WM_keymap_add_item(keymap, "CONSOLE_OT_exec", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
- WM_keymap_add_item(keymap, "CONSOLE_OT_exec", PADENTER, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "CONSOLE_OT_execute", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
+ WM_keymap_add_item(keymap, "CONSOLE_OT_execute", PADENTER, KM_PRESS, 0, 0);
//WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", TABKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */
diff --git a/source/blender/editors/space_file/Makefile b/source/blender/editors/space_file/Makefile
index 2f4180448e5..43b2f09ed2d 100644
--- a/source/blender/editors/space_file/Makefile
+++ b/source/blender/editors/space_file/Makefile
@@ -59,3 +59,7 @@ ifeq ($(WITH_OPENJPEG),true)
CPPFLAGS += -DWITH_OPENJPEG
endif
+ifeq ($(WITH_OPENEXR), true)
+ CPPFLAGS += -DWITH_OPENEXR
+endif
+
diff --git a/source/blender/editors/space_file/SConscript b/source/blender/editors/space_file/SConscript
index 36e042bdaa6..e6fba38fb8f 100644
--- a/source/blender/editors/space_file/SConscript
+++ b/source/blender/editors/space_file/SConscript
@@ -12,5 +12,7 @@ defs = []
if env['WITH_BF_OPENJPEG']:
defs.append('WITH_OPENJPEG')
+if env['WITH_BF_OPENEXR']:
+ defs.append('WITH_OPENEXR')
env.BlenderLib ( 'bf_editors_space_file', sources, Split(incs), defs, libtype=['core'], priority=[115] )
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 5a07c6a7550..00024ffa961 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -353,59 +353,9 @@ void file_calc_previews(const bContext *C, ARegion *ar)
UI_view2d_totRect_set(v2d, sfile->layout->width, sfile->layout->height);
}
-void file_draw_previews(const bContext *C, ARegion *ar)
+static void file_draw_preview(short sx, short sy, ImBuf *imb, FileLayout *layout, short dropshadow)
{
- SpaceFile *sfile= CTX_wm_space_file(C);
- FileSelectParams* params= ED_fileselect_get_params(sfile);
- FileLayout* layout= ED_fileselect_get_layout(sfile, ar);
- View2D *v2d= &ar->v2d;
- struct FileList* files = sfile->files;
- int numfiles;
- struct direntry *file;
- short sx, sy;
- ImBuf* imb=0;
- int i;
- int colorid = 0;
- int offset;
- int is_icon;
-
- if (!files) return;
-
- filelist_imgsize(files,sfile->layout->prv_w,sfile->layout->prv_h);
- numfiles = filelist_numfiles(files);
-
- sx = v2d->cur.xmin + layout->tile_border_x;
- sy = v2d->cur.ymax - layout->tile_border_y;
-
- offset = ED_fileselect_layout_offset(layout, 0, 0);
- if (offset<0) offset=0;
- for (i=offset; (i < numfiles) && (i < (offset+(layout->rows+2)*layout->columns)); ++i)
- {
- ED_fileselect_layout_tilepos(layout, i, &sx, &sy);
- sx += v2d->tot.xmin+2;
- sy = v2d->tot.ymax - sy;
- file = filelist_file(files, i);
-
- if (file->flags & ACTIVE) {
- colorid = TH_HILITE;
- draw_tile(sx - 1, sy, sfile->layout->tile_w + 1, sfile->layout->tile_h, colorid,0);
- } else if (params->active_file == i) {
- colorid = TH_ACTIVE;
- draw_tile(sx - 1, sy, sfile->layout->tile_w + 1, sfile->layout->tile_h, colorid,0);
- }
-
- if ( (file->flags & IMAGEFILE) /* || (file->flags & MOVIEFILE) */)
- {
- filelist_loadimage(files, i);
- }
- is_icon = 0;
- imb = filelist_getimage(files, i);
- if (!imb) {
- imb = filelist_geticon(files,i);
- is_icon = 1;
- }
-
- if (imb) {
+ if (imb) {
float fx, fy;
float dx, dy;
short xco, yco;
@@ -433,15 +383,15 @@ void file_draw_previews(const bContext *C, ARegion *ar)
ey = (short)scaledy;
fx = ((float)layout->prv_w - (float)ex)/2.0f;
fy = ((float)layout->prv_h - (float)ey)/2.0f;
- dx = (fx + 0.5f + sfile->layout->prv_border_x);
- dy = (fy + 0.5f - sfile->layout->prv_border_y);
+ dx = (fx + 0.5f + layout->prv_border_x);
+ dy = (fy + 0.5f - layout->prv_border_y);
xco = (float)sx + dx;
- yco = (float)sy - sfile->layout->prv_h + dy;
+ yco = (float)sy - layout->prv_h + dy;
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/* shadow */
- if (!is_icon && (file->flags & IMAGEFILE))
+ if (dropshadow)
uiDrawBoxShadow(220, xco, yco, xco + ex, yco + ey);
glEnable(GL_BLEND);
@@ -451,7 +401,7 @@ void file_draw_previews(const bContext *C, ARegion *ar)
glaDrawPixelsTexScaled(xco, yco, imb->x, imb->y, GL_UNSIGNED_BYTE, imb->rect, scale, scale);
/* border */
- if (!is_icon && (file->flags & IMAGEFILE)) {
+ if (dropshadow) {
glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
fdrawbox(xco, yco, xco + ex, yco + ey);
}
@@ -459,41 +409,6 @@ void file_draw_previews(const bContext *C, ARegion *ar)
glDisable(GL_BLEND);
imb = 0;
}
-
- /* shadow */
- UI_ThemeColorShade(TH_BACK, -20);
-
-
- if (S_ISDIR(file->type)) {
- glColor4f(1.0f, 1.0f, 0.9f, 1.0f);
- }
- else if (file->flags & IMAGEFILE) {
- UI_ThemeColor(TH_SEQ_IMAGE);
- }
- else if (file->flags & MOVIEFILE) {
- UI_ThemeColor(TH_SEQ_MOVIE);
- }
- else if (file->flags & BLENDERFILE) {
- UI_ThemeColor(TH_SEQ_SCENE);
- }
- else {
- if (params->active_file == i) {
- UI_ThemeColor(TH_GRID); /* grid used for active text */
- } else if (file->flags & ACTIVE) {
- UI_ThemeColor(TH_TEXT_HI);
- } else {
- UI_ThemeColor(TH_TEXT);
- }
- }
-
- file_draw_string(sx + layout->prv_border_x, sy+4, file->relname, layout->tile_w, layout->tile_h, FILE_SHORTEN_END);
-
- if (!sfile->loadimage_timer)
- sfile->loadimage_timer= WM_event_add_window_timer(CTX_wm_window(C), TIMER1, 1.0/30.0); /* max 30 frames/sec. */
-
- }
-
- uiSetRoundBox(0);
}
static void renamebutton_cb(bContext *C, void *arg1, char *oldname)
@@ -523,6 +438,39 @@ static void renamebutton_cb(bContext *C, void *arg1, char *oldname)
}
}
+
+static void draw_background(FileLayout *layout, View2D *v2d)
+{
+ int i;
+ short sy;
+
+ /* alternating flat shade background */
+ for (i=0; (i <= layout->rows); i+=2)
+ {
+ sy = v2d->cur.ymax - i*(layout->tile_h+2*layout->tile_border_y) - layout->tile_border_y;
+
+ UI_ThemeColorShade(TH_BACK, -7);
+ glRectf(v2d->cur.xmin, sy, v2d->cur.xmax, sy+layout->tile_h+2*layout->tile_border_y);
+
+ }
+}
+
+static void draw_dividers(FileLayout *layout, View2D *v2d)
+{
+ short sx;
+
+ /* vertical column dividers */
+ sx = v2d->tot.xmin;
+ while (sx < v2d->cur.xmax) {
+ sx += (layout->tile_w+2*layout->tile_border_x);
+
+ UI_ThemeColorShade(TH_BACK, 30);
+ sdrawline(sx+1, v2d->cur.ymax - layout->tile_border_y , sx+1, v2d->cur.ymin);
+ UI_ThemeColorShade(TH_BACK, -30);
+ sdrawline(sx, v2d->cur.ymax - layout->tile_border_y , sx, v2d->cur.ymin);
+ }
+}
+
void file_draw_list(const bContext *C, ARegion *ar)
{
SpaceFile *sfile= CTX_wm_space_file(C);
@@ -531,6 +479,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
View2D *v2d= &ar->v2d;
struct FileList* files = sfile->files;
struct direntry *file;
+ ImBuf *imb;
int numfiles;
int numfiles_layout;
int colorid = 0;
@@ -538,6 +487,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
int offset;
int i;
float sw, spos;
+ short is_icon;
numfiles = filelist_numfiles(files);
@@ -547,26 +497,11 @@ void file_draw_list(const bContext *C, ARegion *ar)
offset = ED_fileselect_layout_offset(layout, 0, 0);
if (offset<0) offset=0;
- /* alternating flat shade background */
- for (i=0; (i <= layout->rows); i+=2)
- {
- sx = v2d->cur.xmin;
- sy = v2d->cur.ymax - i*(layout->tile_h+2*layout->tile_border_y) - layout->tile_border_y;
+ if (params->display != FILE_IMGDISPLAY) {
- UI_ThemeColorShade(TH_BACK, -7);
- glRectf(v2d->cur.xmin, sy, v2d->cur.xmax, sy+layout->tile_h+2*layout->tile_border_y);
-
- }
+ draw_background(layout, v2d);
- /* vertical column dividers */
- sx = v2d->tot.xmin;
- while (sx < ar->v2d.cur.xmax) {
- sx += (sfile->layout->tile_w+2*sfile->layout->tile_border_x);
-
- UI_ThemeColorShade(TH_BACK, 30);
- sdrawline(sx+1, ar->v2d.cur.ymax - layout->tile_border_y , sx+1, ar->v2d.cur.ymin);
- UI_ThemeColorShade(TH_BACK, -30);
- sdrawline(sx, ar->v2d.cur.ymax - layout->tile_border_y , sx, ar->v2d.cur.ymin);
+ draw_dividers(layout, v2d);
}
sx = ar->v2d.cur.xmin + layout->tile_border_x;
@@ -594,16 +529,33 @@ void file_draw_list(const bContext *C, ARegion *ar)
}
spos = sx;
- file_draw_icon(spos, sy-3, get_file_icon(file), ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH);
- spos += ICON_DEFAULT_WIDTH + 4;
-
+
+ if ( FILE_IMGDISPLAY == params->display ) {
+ if ( (file->flags & IMAGEFILE) /* || (file->flags & MOVIEFILE) */) {
+ filelist_loadimage(files, i);
+ }
+ is_icon = 0;
+ imb = filelist_getimage(files, i);
+ if (!imb) {
+ imb = filelist_geticon(files,i);
+ is_icon = 1;
+ }
+
+ file_draw_preview(sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE));
+
+ } else {
+ file_draw_icon(spos, sy-3, get_file_icon(file), ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH);
+ spos += ICON_DEFAULT_WIDTH + 4;
+ }
+
UI_ThemeColor4(TH_TEXT);
-
+
sw = file_string_width(file->relname);
if (file->flags & EDITING) {
+ short but_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : layout->column_widths[COLUMN_NAME];
uiBlock *block = uiBeginBlock(C, ar, "FileName", UI_EMBOSS);
uiBut *but = uiDefBut(block, TEX, 1, "", spos, sy-layout->tile_h-3,
- layout->column_widths[COLUMN_NAME], layout->tile_h, file->relname, 1.0f, (float)FILE_MAX,0,0,"");
+ but_width, layout->textheight*2, file->relname, 1.0f, (float)FILE_MAX,0,0,"");
uiButSetRenameFunc(but, renamebutton_cb, file);
if ( 0 == uiButActiveOnly(C, block, but)) {
file->flags &= ~EDITING;
@@ -611,36 +563,42 @@ void file_draw_list(const bContext *C, ARegion *ar)
uiEndBlock(C, block);
uiDrawBlock(C, block);
} else {
- file_draw_string(spos, sy, file->relname, sw, layout->tile_h, FILE_SHORTEN_END);
+ float name_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : sw;
+ file_draw_string(spos, sy, file->relname, name_width, layout->tile_h, FILE_SHORTEN_END);
}
- spos += layout->column_widths[COLUMN_NAME] + 12;
- if (params->display == FILE_SHOWSHORT) {
+
+ uiSetRoundBox(0);
+
+ if (params->display == FILE_SHORTDISPLAY) {
+ spos += layout->column_widths[COLUMN_NAME] + 12;
if (!(file->type & S_IFDIR)) {
sw = file_string_width(file->size);
spos += layout->column_widths[COLUMN_SIZE] + 12 - sw;
file_draw_string(spos, sy, file->size, sw+1, layout->tile_h, FILE_SHORTEN_END);
}
- } else {
-#if 0 // XXX TODO: add this for non-windows systems
+ } else if (params->display == FILE_LONGDISPLAY) {
+ spos += layout->column_widths[COLUMN_NAME] + 12;
+
+#ifndef WIN32
/* rwx rwx rwx */
spos += 20;
- sw = UI_GetStringWidth(file->mode1);
- file_draw_string(spos, sy, file->mode1, sw, layout->tile_h);
-
- spos += 30;
- sw = UI_GetStringWidth(file->mode2);
- file_draw_string(spos, sy, file->mode2, sw, layout->tile_h);
+ sw = file_string_width(file->mode1);
+ file_draw_string(spos, sy, file->mode1, sw, layout->tile_h, FILE_SHORTEN_END);
+ spos += layout->column_widths[COLUMN_MODE1] + 12;
- spos += 30;
- sw = UI_GetStringWidth(file->mode3);
- file_draw_string(spos, sy, file->mode3, sw, layout->tile_h);
-
- spos += 30;
- sw = UI_GetStringWidth(file->owner);
- file_draw_string(spos, sy, file->owner, sw, layout->tile_h);
+ sw = file_string_width(file->mode2);
+ file_draw_string(spos, sy, file->mode2, sw, layout->tile_h, FILE_SHORTEN_END);
+ spos += layout->column_widths[COLUMN_MODE2] + 12;
+
+ sw = file_string_width(file->mode3);
+ file_draw_string(spos, sy, file->mode3, sw, layout->tile_h, FILE_SHORTEN_END);
+ spos += layout->column_widths[COLUMN_MODE3] + 12;
+
+ sw = file_string_width(file->owner);
+ file_draw_string(spos, sy, file->owner, sw, layout->tile_h, FILE_SHORTEN_END);
+ spos += layout->column_widths[COLUMN_OWNER] + 12;
#endif
-
sw = file_string_width(file->date);
file_draw_string(spos, sy, file->date, sw, layout->tile_h, FILE_SHORTEN_END);
spos += layout->column_widths[COLUMN_DATE] + 12;
@@ -656,6 +614,9 @@ void file_draw_list(const bContext *C, ARegion *ar)
}
}
}
+
+ if (!sfile->loadimage_timer)
+ sfile->loadimage_timer= WM_event_add_window_timer(CTX_wm_window(C), TIMER1, 1.0/30.0); /* max 30 frames/sec. */
}
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index 9f1e4ad0e25..a99594e9575 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -59,7 +59,7 @@ void FILE_OT_add_bookmark(struct wmOperatorType *ot);
void FILE_OT_delete_bookmark(struct wmOperatorType *ot);
void FILE_OT_hidedot(struct wmOperatorType *ot);
void FILE_OT_loadimages(struct wmOperatorType *ot);
-void FILE_OT_exec(struct wmOperatorType *ot);
+void FILE_OT_execute(struct wmOperatorType *ot);
void FILE_OT_cancel(struct wmOperatorType *ot);
void FILE_OT_parent(struct wmOperatorType *ot);
void FILE_OT_directory_new(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 9c73956d375..a06c1663d8e 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -566,11 +566,11 @@ int file_exec(bContext *C, wmOperator *unused)
return OPERATOR_FINISHED;
}
-void FILE_OT_exec(struct wmOperatorType *ot)
+void FILE_OT_execute(struct wmOperatorType *ot)
{
/* identifiers */
ot->name= "Execute File Window";
- ot->idname= "FILE_OT_exec";
+ ot->idname= "FILE_OT_execute";
/* api callbacks */
ot->exec= file_exec;
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index f3c18859fb0..24c3f9b4ca1 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -63,7 +63,7 @@ static void file_panel_cb(bContext *C, void *arg_entry, void *arg_unused)
WM_operator_properties_free(&ptr);
}
-static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, short *nr, int icon, int allow_delete)
+static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, short *nr, int icon, int allow_delete, int reverse)
{
SpaceFile *sfile= CTX_wm_space_file(C);
uiBlock *block;
@@ -71,7 +71,7 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
uiLayout *box, *col;
struct FSMenu* fsmenu = fsmenu_get();
char *curdir= (sfile->params)? sfile->params->dir: "";
- int i, nentries = fsmenu_get_nentries(fsmenu, category);
+ int i, i_iter, nentries = fsmenu_get_nentries(fsmenu, category);
/* reset each time */
*nr= -1;
@@ -86,12 +86,16 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
box= uiLayoutBox(pa->layout);
col= uiLayoutColumn(box, 1);
- for (i=0; i< nentries;++i) {
+ for (i_iter=0; i_iter< nentries;++i_iter) {
char dir[FILE_MAX];
char temp[FILE_MAX];
uiLayout* layout = uiLayoutRow(col, 0);
- char *entry = fsmenu_get_entry(fsmenu, category, i);
+ char *entry;
+ i= reverse ? nentries-(i_iter+1) : i_iter;
+
+ entry = fsmenu_get_entry(fsmenu, category, i);
+
/* set this list item as active if we have a match */
if(strcmp(curdir, entry) == 0)
*nr= i;
@@ -124,7 +128,7 @@ static void file_panel_system(const bContext *C, Panel *pa)
SpaceFile *sfile= CTX_wm_space_file(C);
if(sfile)
- file_panel_category(C, pa, FS_CATEGORY_SYSTEM, &sfile->systemnr, ICON_DISK_DRIVE, 0);
+ file_panel_category(C, pa, FS_CATEGORY_SYSTEM, &sfile->systemnr, ICON_DISK_DRIVE, 0, 0);
}
static void file_panel_bookmarks(const bContext *C, Panel *pa)
@@ -137,7 +141,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa)
uiItemO(row, "Add", ICON_ZOOMIN, "file.add_bookmark");
uiItemL(row, NULL, 0);
- file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1);
+ file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1, 0);
}
}
@@ -146,7 +150,7 @@ static void file_panel_recent(const bContext *C, Panel *pa)
SpaceFile *sfile= CTX_wm_space_file(C);
if(sfile)
- file_panel_category(C, pa, FS_CATEGORY_RECENT, &sfile->recentnr, ICON_FILE_FOLDER, 0);
+ file_panel_category(C, pa, FS_CATEGORY_RECENT, &sfile->recentnr, ICON_FILE_FOLDER, 0, 1);
}
@@ -170,23 +174,28 @@ static void file_panel_operator(const bContext *C, Panel *pa)
wmOperator *op= sfile->op;
int empty= 1;
- RNA_STRUCT_BEGIN(op->ptr, prop) {
- if(strcmp(RNA_property_identifier(prop), "rna_type") == 0)
- continue;
- if(strcmp(RNA_property_identifier(prop), "filename") == 0)
- continue;
- if(strcmp(RNA_property_identifier(prop), "display") == 0)
- continue;
- if(strncmp(RNA_property_identifier(prop), "filter", 6) == 0)
- continue;
-
- uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0, 0, 0);
- empty= 0;
+ if(op->type->ui) {
+ op->type->ui((bContext*)C, op->ptr, pa->layout);
}
- RNA_STRUCT_END;
+ else {
+ RNA_STRUCT_BEGIN(op->ptr, prop) {
+ if(strcmp(RNA_property_identifier(prop), "rna_type") == 0)
+ continue;
+ if(strcmp(RNA_property_identifier(prop), "filename") == 0)
+ continue;
+ if(strcmp(RNA_property_identifier(prop), "display") == 0)
+ continue;
+ if(strncmp(RNA_property_identifier(prop), "filter", 6) == 0)
+ continue;
+
+ uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0);
+ empty= 0;
+ }
+ RNA_STRUCT_END;
- if(empty)
- uiItemL(pa->layout, "No properties.", 0);
+ if(empty)
+ uiItemL(pa->layout, "No properties.", 0);
+ }
}
void file_panels_register(ARegionType *art)
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 7ebc8c4338f..538c1e4fce7 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -840,7 +840,16 @@ void filelist_setfiletypes(struct FileList* filelist, short has_quicktime)
|| BLI_testextensie(file->relname, ".mv")) {
file->flags |= MOVIEFILE;
}
- else if(BLI_testextensie(file->relname, ".wav")) {
+ else if(BLI_testextensie(file->relname, ".wav")
+ || BLI_testextensie(file->relname, ".ogg")
+ || BLI_testextensie(file->relname, ".oga")
+ || BLI_testextensie(file->relname, ".mp3")
+ || BLI_testextensie(file->relname, ".mp2")
+ || BLI_testextensie(file->relname, ".ac3")
+ || BLI_testextensie(file->relname, ".aac")
+ || BLI_testextensie(file->relname, ".flac")
+ || BLI_testextensie(file->relname, ".wma")
+ || BLI_testextensie(file->relname, ".eac3")) {
file->flags |= SOUNDFILE;
}
} else { // no quicktime
@@ -875,7 +884,16 @@ void filelist_setfiletypes(struct FileList* filelist, short has_quicktime)
|| BLI_testextensie(file->relname, ".mv")) {
file->flags |= MOVIEFILE;
}
- else if(BLI_testextensie(file->relname, ".wav")) {
+ else if(BLI_testextensie(file->relname, ".wav")
+ || BLI_testextensie(file->relname, ".ogg")
+ || BLI_testextensie(file->relname, ".oga")
+ || BLI_testextensie(file->relname, ".mp3")
+ || BLI_testextensie(file->relname, ".mp2")
+ || BLI_testextensie(file->relname, ".ac3")
+ || BLI_testextensie(file->relname, ".aac")
+ || BLI_testextensie(file->relname, ".flac")
+ || BLI_testextensie(file->relname, ".wma")
+ || BLI_testextensie(file->relname, ".eac3")) {
file->flags |= SOUNDFILE;
}
}
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 8ee7d3515b5..f300505933f 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -287,6 +287,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
numfiles = filelist_numfiles(sfile->files);
textheight = file_font_pointsize();
layout = sfile->layout;
+ layout->textheight = textheight;
if (params->display == FILE_IMGDISPLAY) {
layout->prv_w = 96;
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index ea640eab090..793f7cf8815 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -310,12 +310,7 @@ static void file_main_area_draw(const bContext *C, ARegion *ar)
file_hilight_set(sfile, ar, event->x, event->y);
}
- if (params->display == FILE_IMGDISPLAY) {
- file_draw_previews(C, ar);
- } else {
- file_draw_list(C, ar);
- }
-
+ file_draw_list(C, ar);
/* reset view matrix */
UI_view2d_view_restore(C);
@@ -335,7 +330,7 @@ void file_operatortypes(void)
WM_operatortype_append(FILE_OT_select_bookmark);
WM_operatortype_append(FILE_OT_loadimages);
WM_operatortype_append(FILE_OT_highlight);
- WM_operatortype_append(FILE_OT_exec);
+ WM_operatortype_append(FILE_OT_execute);
WM_operatortype_append(FILE_OT_cancel);
WM_operatortype_append(FILE_OT_parent);
WM_operatortype_append(FILE_OT_previous);
diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c
index ac15ed93ad0..994f38320f2 100644
--- a/source/blender/editors/space_file/writeimage.c
+++ b/source/blender/editors/space_file/writeimage.c
@@ -53,7 +53,7 @@
/* XXX */
static void error() {}
-static void waitcursor() {}
+static void waitcursor(int val) {}
static void activate_fileselect() {}
static int saveover() {return 0;}
/* XXX */
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 82babb70c53..fb995285ab7 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -160,7 +160,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
}
getname_anim_fcurve(name, ale->id, fcu);
- uiDefBut(block, LABEL, 1, name, 30, 180, 300, 19, NULL, 0.0, 0.0, 0, 0, "Name of Active F-Curve");
+ uiDefBut(block, LABEL, 1, name, 40, 180, 300, 19, NULL, 0.0, 0.0, 0, 0, "Name of Active F-Curve");
/* TODO: the following settings could be added here
* - F-Curve coloring mode - mode selector + color selector
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 105ecf23c3e..f3aa0fac42b 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -51,6 +51,7 @@
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
+#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
@@ -876,19 +877,15 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri
/* ************************************************************************* */
/* Channel List */
-// XXX quite a few of these need to be kept in sync with their counterparts in Action Editor
-// as they're the same. We have 2 separate copies of this for now to make it easier to develop
-// the diffences between the two editors, but one day these should be merged!
-
/* left hand part */
-void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
+void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
View2D *v2d= &ar->v2d;
- float x= 0.0f, y= 0.0f, height;
+ float y= 0.0f, height;
int items, i=0;
/* build list of channels to draw */
@@ -902,521 +899,57 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
* start of list offset, and the second is as a correction for the scrollers.
*/
height= (float)((items*ACHANNEL_STEP) + (ACHANNEL_HEIGHT*2));
-
-#if 0
- if (height > (v2d->mask.ymax - v2d->mask.ymin)) {
- /* don't use totrect set, as the width stays the same
- * (NOTE: this is ok here, the configuration is pretty straightforward)
- */
- v2d->tot.ymin= (float)(-height);
- }
-
- /* XXX I would call the below line! (ton) */
-#endif
UI_view2d_totRect_set(v2d, ar->winx, height);
/* loop through channels, and set up drawing depending on their type */
- y= (float)ACHANNEL_FIRST;
-
- for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) {
- const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
- const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
+ { /* first pass: just the standard GL-drawing for backdrop + text */
+ y= (float)ACHANNEL_FIRST;
- /* check if visible */
- if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
- IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
- {
- bActionGroup *grp = NULL;
- short indent= 0, offset= 0, sel= 0, group= 0;
- int expand= -1, protect = -1, special= -1, mute = -1;
- char name[128];
-
- /* determine what needs to be drawn */
- switch (ale->type) {
- case ANIMTYPE_SCENE: /* scene */
- {
- Scene *sce= (Scene *)ale->data;
-
- group= 4;
- indent= 0;
-
- special= ICON_SCENE_DATA;
-
- /* only show expand if there are any channels */
- if (EXPANDED_SCEC(sce))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- sel = SEL_SCEC(sce);
- strcpy(name, sce->id.name+2);
- }
- break;
- case ANIMTYPE_OBJECT: /* object */
- {
- Base *base= (Base *)ale->data;
- Object *ob= base->object;
-
- group= 4;
- indent= 0;
-
- /* icon depends on object-type */
- if (ob->type == OB_ARMATURE)
- special= ICON_ARMATURE_DATA;
- else
- special= ICON_OBJECT_DATA;
-
- /* only show expand if there are any channels */
- if (EXPANDED_OBJC(ob))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- sel = SEL_OBJC(base);
- strcpy(name, ob->id.name+2);
- }
- break;
- case ANIMTYPE_FILLACTD: /* action widget */
- {
- bAction *act= (bAction *)ale->data;
-
- group = 4;
- indent= 1;
- special= ICON_ACTION;
-
- if (EXPANDED_ACTC(act))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- sel = SEL_ACTC(act);
- strcpy(name, act->id.name+2);
- }
- break;
- case ANIMTYPE_FILLDRIVERS: /* drivers widget */
- {
- AnimData *adt= (AnimData *)ale->data;
-
- group = 4;
- indent= 1;
- special= ICON_ANIM_DATA;
-
- if (EXPANDED_DRVD(adt))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- strcpy(name, "Drivers");
- }
- break;
- case ANIMTYPE_FILLMATD: /* object materials (dopesheet) expand widget */
- {
- Object *ob = (Object *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_MATERIAL_DATA;
-
- if (FILTER_MAT_OBJC(ob))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, "Materials");
- }
- break;
- case ANIMTYPE_FILLPARTD: /* object particles (dopesheet) expand widget */
- {
- Object *ob = (Object *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_PARTICLE_DATA;
-
- if (FILTER_PART_OBJC(ob))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, "Particles");
- }
- break;
-
-
- case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */
- {
- Material *ma = (Material *)ale->data;
-
- group = 0;
- indent = 0;
- special = ICON_MATERIAL_DATA;
- offset = 21;
-
- if (FILTER_MAT_OBJD(ma))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, ma->id.name+2);
- }
- break;
- case ANIMTYPE_DSLAM: /* lamp (dopesheet) expand widget */
- {
- Lamp *la = (Lamp *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_LAMP_DATA;
-
- if (FILTER_LAM_OBJD(la))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, la->id.name+2);
- }
- break;
- case ANIMTYPE_DSCAM: /* camera (dopesheet) expand widget */
- {
- Camera *ca = (Camera *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_CAMERA_DATA;
-
- if (FILTER_CAM_OBJD(ca))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, ca->id.name+2);
- }
- break;
- case ANIMTYPE_DSCUR: /* curve (dopesheet) expand widget */
- {
- Curve *cu = (Curve *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_CURVE_DATA;
-
- if (FILTER_CUR_OBJD(cu))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, cu->id.name+2);
- }
- break;
- case ANIMTYPE_DSSKEY: /* shapekeys (dopesheet) expand widget */
- {
- Key *key= (Key *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_SHAPEKEY_DATA;
-
- if (FILTER_SKE_OBJD(key))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- //sel = SEL_OBJC(base);
- strcpy(name, "Shape Keys");
- }
- break;
- case ANIMTYPE_DSWOR: /* world (dopesheet) expand widget */
- {
- World *wo= (World *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_WORLD_DATA;
-
- if (FILTER_WOR_SCED(wo))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, wo->id.name+2);
- }
- break;
- case ANIMTYPE_DSPART: /* particle (dopesheet) expand widget */
- {
- ParticleSettings *part= (ParticleSettings*)ale->data;
-
- group = 0;
- indent = 0;
- special = ICON_PARTICLE_DATA;
- offset = 21;
-
- if (FILTER_PART_OBJD(part))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, part->id.name+2);
- }
- break;
-
-
- case ANIMTYPE_GROUP: /* action group */
- {
- bActionGroup *agrp= (bActionGroup *)ale->data;
-
- group= 2;
- indent= 0;
- special= -1;
-
- if (ale->id) {
- /* special exception for materials */
- if (GS(ale->id->name) == ID_MA)
- offset= 25;
- else
- offset= 14;
- }
- else
- offset= 0;
-
- /* only show expand if there are any channels */
- if (agrp->channels.first) {
- if (EXPANDED_AGRP(agrp))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
- }
-
- /* for now, 'special' (i.e. in front of name) is used to show visibility status */
- if (agrp->flag & AGRP_NOTVISIBLE)
- special= ICON_CHECKBOX_DEHLT;
- else
- special= ICON_CHECKBOX_HLT;
-
- if (agrp->flag & AGRP_MUTED)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
-
- if (EDITABLE_AGRP(agrp))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
-
- sel = SEL_AGRP(agrp);
- strcpy(name, agrp->name);
- }
- break;
- case ANIMTYPE_FCURVE: /* F-Curve channel */
- {
- FCurve *fcu = (FCurve *)ale->data;
-
- indent = 0;
-
- group= (fcu->grp) ? 1 : 0;
- grp= fcu->grp;
-
- if (ale->id) {
- /* special exception for materials and particles */
- if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) {
- offset= 21;
- indent= 1;
- }
- else
- offset= 14;
- }
- else
- offset= 0;
-
- /* for now, 'special' (i.e. in front of name) is used to show visibility status */
- if (fcu->flag & FCURVE_VISIBLE)
- special= ICON_CHECKBOX_HLT;
- else
- special= ICON_CHECKBOX_DEHLT;
-
- if (fcu->flag & FCURVE_MUTED)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
-
- if (fcu->bezt) {
- if (EDITABLE_FCU(fcu))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
- }
- else
- protect = ICON_ZOOMOUT; // XXX editability is irrelevant here, but this icon is temp...
-
- sel = SEL_FCU(fcu);
-
- getname_anim_fcurve(name, ale->id, fcu);
- }
- break;
-
- case ANIMTYPE_SHAPEKEY: /* shapekey channel */
- {
- KeyBlock *kb = (KeyBlock *)ale->data;
-
- indent = 0;
- special = -1;
-
- offset= (ale->id) ? 21 : 0;
-
- if (kb->name[0] == '\0')
- sprintf(name, "Key %d", ale->index);
- else
- strcpy(name, kb->name);
- }
- break;
- }
-
- /* now, start drawing based on this information */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- /* draw backing strip behind channel name */
- if (group == 4) {
- /* only used in dopesheet... */
- if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) {
- /* object channel - darker */
- UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
- }
- else {
- /* sub-object folders - lighter */
- UI_ThemeColor(TH_DOPESHEET_CHANNELSUBOB);
-
- offset += 7 * indent;
- glBegin(GL_QUADS);
- glVertex2f(x+offset, yminc);
- glVertex2f(x+offset, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, yminc);
- glEnd();
-
- /* clear group value, otherwise we cause errors... */
- group = 0;
- }
- }
- else if (group == 3) {
- /* only for gp-data channels */
- UI_ThemeColorShade(TH_GROUP, 20);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
- }
- else if (group == 2) {
- /* only for action group channels */
- if (ale->flag & AGRP_ACTIVE)
- UI_ThemeColorShade(TH_GROUP_ACTIVE, 10);
- else
- UI_ThemeColorShade(TH_GROUP, 20);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8);
- }
- else {
- short shadefac= ((indent==0)?20: (indent==1)?-20: -40);
-
- indent += group;
- offset += 7 * indent;
-
- /* draw channel backdrop */
- UI_ThemeColorShade(TH_HEADER, shadefac);
-
- glBegin(GL_QUADS);
- glVertex2f(x+offset, yminc);
- glVertex2f(x+offset, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, yminc);
- glEnd();
-
- /* most of the time, only F-Curves are going to be drawn here */
- if (ale->type == ANIMTYPE_FCURVE) {
- /* F-Curve channels need to have a special 'color code' box drawn, which is colored with whatever
- * color the curve has stored
- */
- FCurve *fcu= (FCurve *)ale->data;
- glColor3fv(fcu->color);
-
- // NOTE: only enable the following line for the fading-out gradient
- //glShadeModel(GL_SMOOTH);
-
- glBegin(GL_QUADS);
- /* solid color for the area around the checkbox */
- glVertex2f(x+offset, yminc);
- glVertex2f(x+offset, ymaxc);
- glVertex2f(x+offset+18, ymaxc);
- glVertex2f(x+offset+18, yminc);
-
-#if 0 // fading out gradient
- /* fading out gradient for the rest of the box */
- glVertex2f(x+offset+18, yminc);
- glVertex2f(x+offset+18, ymaxc);
-
- UI_ThemeColorShade(TH_HEADER, shadefac); // XXX does this cause any problems on some cards?
-
- glVertex2f(x+offset+20, ymaxc);
- glVertex2f(x+offset+20, yminc);
-#endif // fading out gradient
- glEnd();
-
- // NOTE: only enable the following line for the fading-out gradient
- //glShadeModel(GL_FLAT);
- }
- }
+ for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) {
+ const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
- /* draw expand/collapse triangle */
- if (expand > 0) {
- UI_icon_draw(x+offset, yminc, expand);
- offset += 17;
+ /* check if visible */
+ if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw(ac, ale, yminc, ymaxc);
}
- /* draw special icon indicating certain data-types */
- if (special > -1) {
- if (ELEM(group, 3, 4)) {
- /* for gpdatablock channels */
- UI_icon_draw(x+offset, yminc, special);
- offset += 17;
- }
- else {
- /* for normal channels */
- UI_icon_draw(x+offset, yminc, special);
- offset += 17;
- }
- }
- glDisable(GL_BLEND);
-
- /* draw name */
- if (sel)
- UI_ThemeColor(TH_TEXT_HI);
- else
- UI_ThemeColor(TH_TEXT);
- offset += 3;
- UI_DrawString(x+offset, y-4, name);
-
- /* reset offset - for RHS of panel */
- offset = 0;
-
- /* set blending again, as text drawing may clear it */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
+ /* adjust y-position for next one */
+ y -= ACHANNEL_STEP;
+ }
+ }
+ { /* second pass: widgets */
+ uiBlock *block= uiBeginBlock(C, ar, "graph channel buttons", UI_EMBOSS);
+
+ y= (float)ACHANNEL_FIRST;
+
+ /* set blending again, as may not be set in previous step */
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+
+ for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) {
+ const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF);
+ const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF);
- /* draw protect 'lock' */
- if (protect > -1) {
- offset = 16;
- UI_icon_draw((float)ACHANNEL_NAMEWIDTH-offset, yminc, protect);
+ /* check if visible */
+ if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw_widgets(ac, ale, block, yminc, ymaxc);
}
- /* draw mute 'eye' */
- if (mute > -1) {
- offset += 16;
- UI_icon_draw((float)(ACHANNEL_NAMEWIDTH-offset), yminc, mute);
- }
- glDisable(GL_BLEND);
+ /* adjust y-position for next one */
+ y -= ACHANNEL_STEP;
}
- /* adjust y-position for next one */
- y -= ACHANNEL_STEP;
+ uiEndBlock(C, block);
+ uiDrawBlock(C, block);
+
+ glDisable(GL_BLEND);
}
/* free tempolary channels */
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 37389b32b3a..d718ef28e99 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -430,7 +430,7 @@ static void insert_graph_keys(bAnimContext *ac, short mode)
/* init keyframing flag */
if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
- // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE;
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS)) flag |= INSERTKEY_REPLACE;
/* insert keyframes */
for (ale= anim_data.first; ale; ale= ale->next) {
@@ -989,13 +989,6 @@ void GRAPH_OT_bake (wmOperatorType *ot)
* of selected keyframes. It is useful for creating keyframes for tweaking overlap.
*/
-// XXX some of the common parts (with DopeSheet) should be unified in animation module...
-
-/* little cache for values... */
-typedef struct tempFrameValCache {
- float frame, val;
-} tempFrameValCache;
-
/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
static void sample_graph_keys (bAnimContext *ac)
{
@@ -1008,64 +1001,8 @@ static void sample_graph_keys (bAnimContext *ac)
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and add keys between selected keyframes on every frame */
- for (ale= anim_data.first; ale; ale= ale->next) {
- FCurve *fcu= (FCurve *)ale->key_data;
- BezTriple *bezt, *start=NULL, *end=NULL;
- tempFrameValCache *value_cache, *fp;
- int sfra, range;
- int i, n;
-
- /* find selected keyframes... once pair has been found, add keyframes */
- for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {
- /* check if selected, and which end this is */
- if (BEZSELECTED(bezt)) {
- if (start) {
- /* set end */
- end= bezt;
-
- /* cache values then add keyframes using these values, as adding
- * keyframes while sampling will affect the outcome...
- */
- range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) );
- sfra= (int)( floor(start->vec[1][0]) );
-
- if (range) {
- value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache");
-
- /* sample values */
- for (n=0, fp=value_cache; n<range && fp; n++, fp++) {
- fp->frame= (float)(sfra + n);
- fp->val= evaluate_fcurve(fcu, fp->frame);
- }
-
- /* add keyframes with these */
- for (n=0, fp=value_cache; n<range && fp; n++, fp++) {
- insert_vert_fcurve(fcu, fp->frame, fp->val, 1);
- }
-
- /* free temp cache */
- MEM_freeN(value_cache);
-
- /* as we added keyframes, we need to compensate so that bezt is at the right place */
- bezt = fcu->bezt + i + range - 1;
- i += (range - 1);
- }
-
- /* bezt was selected, so it now marks the start of a whole new chain to search */
- start= bezt;
- end= NULL;
- }
- else {
- /* just set start keyframe */
- start= bezt;
- end= NULL;
- }
- }
- }
-
- /* recalculate channel's handles? */
- calchandles_fcurve(fcu);
- }
+ for (ale= anim_data.first; ale; ale= ale->next)
+ sample_fcurve((FCurve *)ale->key_data);
/* admin and redraws */
BLI_freelistN(&anim_data);
diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c
index 4369c321c5e..dd304cd8cf3 100644
--- a/source/blender/editors/space_graph/graph_header.c
+++ b/source/blender/editors/space_graph/graph_header.c
@@ -80,15 +80,17 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemS(layout);
- uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0);
if (sipo->flag & SIPO_NOHANDLES)
uiItemO(layout, "Show Handles", ICON_CHECKBOX_DEHLT, "GRAPH_OT_handles_view_toggle");
else
uiItemO(layout, "Show Handles", ICON_CHECKBOX_HLT, "GRAPH_OT_handles_view_toggle");
- uiItemR(layout, NULL, 0, &spaceptr, "only_selected_curves_handles", 0, 0, 0);
- uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0, 0, 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "only_selected_curves_handles", 0);
+
if (sipo->flag & SIPO_DRAWTIME)
uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle");
@@ -158,6 +160,7 @@ static void graph_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_un
static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_CFRA);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_FRAME);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_SECOND);
@@ -166,6 +169,7 @@ static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_CFRA);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_YAXIS);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_XAXIS);
@@ -174,6 +178,7 @@ static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unuse
static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_FREE);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_AUTO);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_VECT);
@@ -183,6 +188,7 @@ static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unus
static void graph_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_CONST);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_LIN);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_BEZ);
@@ -190,15 +196,16 @@ static void graph_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
static void graph_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused)
{
+ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT);
uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR);
}
static void graph_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
- uiItemMenuF(layout, "Transform", 0, graph_edit_transformmenu);
- uiItemMenuF(layout, "Snap", 0, graph_edit_snapmenu);
- uiItemMenuF(layout, "Mirror", 0, graph_edit_mirrormenu);
+ uiItemMenuF(layout, "Transform", 0, graph_edit_transformmenu, NULL);
+ uiItemMenuF(layout, "Snap", 0, graph_edit_snapmenu, NULL);
+ uiItemMenuF(layout, "Mirror", 0, graph_edit_mirrormenu, NULL);
uiItemS(layout);
@@ -212,9 +219,9 @@ static void graph_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemS(layout);
- uiItemMenuF(layout, "Handle Type", 0, graph_edit_handlesmenu);
- uiItemMenuF(layout, "Interpolation Mode", 0, graph_edit_ipomenu);
- uiItemMenuF(layout, "Extrapolation Mode", 0, graph_edit_expomenu);
+ uiItemMenuF(layout, "Handle Type", 0, graph_edit_handlesmenu, NULL);
+ uiItemMenuF(layout, "Interpolation Mode", 0, graph_edit_ipomenu, NULL);
+ uiItemMenuF(layout, "Extrapolation Mode", 0, graph_edit_expomenu, NULL);
uiItemS(layout);
@@ -305,13 +312,14 @@ void graph_header_buttons(const bContext *C, ARegion *ar)
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Lamps");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Cameras");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Curves");
+ uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMBA, B_REDR, ICON_META_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display MetaBalls");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Particles");
uiBlockEndAlign(block);
- xco += 15;
+ xco += 30;
}
else {
// XXX this case shouldn't happen at all... for now, just pad out same amount of space
- xco += 6*XIC + 15;
+ xco += 10*XIC + 30;
}
/* auto-snap selector */
diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h
index 31f1c6d4301..2e8d0655d2d 100644
--- a/source/blender/editors/space_graph/graph_intern.h
+++ b/source/blender/editors/space_graph/graph_intern.h
@@ -48,7 +48,7 @@ struct ARegion *graph_has_buttons_region(struct ScrArea *sa);
/* ***************************************** */
/* graph_draw.c */
-void graph_draw_channel_names(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar);
+void graph_draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar);
void graph_draw_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid, short sel);
void graph_draw_ghost_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid);
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 222f2142c38..3717ccc8244 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -69,20 +69,20 @@ ARegion *graph_has_buttons_region(ScrArea *sa)
ARegion *ar, *arnew;
for (ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_UI)
+ if (ar->regiontype==RGN_TYPE_UI)
return ar;
}
- /* add subdiv level; after main window */
+ /* add subdiv level; after main */
for (ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_WINDOW)
+ if (ar->regiontype==RGN_TYPE_WINDOW)
break;
}
/* is error! */
- if(ar==NULL) return NULL;
+ if (ar==NULL) return NULL;
- arnew= MEM_callocN(sizeof(ARegion), "buttons for nla");
+ arnew= MEM_callocN(sizeof(ARegion), "buttons for graph");
BLI_insertlinkafter(&sa->regionbase, ar, arnew);
arnew->regiontype= RGN_TYPE_UI;
@@ -309,7 +309,7 @@ static void graph_channel_area_draw(const bContext *C, ARegion *ar)
/* draw channels */
if (ANIM_animdata_get_context(C, &ac)) {
- graph_draw_channel_names(&ac, sipo, ar);
+ graph_draw_channel_names((bContext*)C, &ac, sipo, ar);
}
/* reset view matrix */
diff --git a/source/blender/editors/space_image/Makefile b/source/blender/editors/space_image/Makefile
index e7e9a9b5665..af15b1d9724 100644
--- a/source/blender/editors/space_image/Makefile
+++ b/source/blender/editors/space_image/Makefile
@@ -53,3 +53,7 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../include
+ifeq ($(WITH_OPENEXR), true)
+ CPPFLAGS += -DWITH_OPENEXR
+endif
+
diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript
index e7041ef0458..874549e6949 100644
--- a/source/blender/editors/space_image/SConscript
+++ b/source/blender/editors/space_image/SConscript
@@ -11,5 +11,7 @@ defs = []
if env['WITH_BF_LCMS']:
defs.append('WITH_LCMS')
+if env['WITH_BF_OPENEXR']:
+ defs.append('WITH_OPENEXR')
env.BlenderLib ( 'bf_editors_space_image', sources, Split(incs), defs, libtype=['core'], priority=[40] )
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 4dcaa96caf7..2eb070e0e6d 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -58,6 +58,7 @@
#include "BKE_mesh.h"
#include "BKE_node.h"
#include "BKE_packedFile.h"
+#include "BKE_paint.h"
#include "BKE_screen.h"
#include "BKE_utildefines.h"
@@ -66,6 +67,7 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+#include "ED_gpencil.h"
#include "ED_image.h"
#include "ED_mesh.h"
#include "ED_space_api.h"
@@ -450,7 +452,7 @@ void brush_buttons(const bContext *C, uiBlock *block, short fromsima,
{
// SpaceImage *sima= CTX_wm_space_image(C);
ToolSettings *settings= CTX_data_tool_settings(C);
- Brush *brush= settings->imapaint.brush;
+ Brush *brush= paint_brush(&settings->imapaint.paint);
ID *id;
int yco, xco, butw, but_idx;
// short *menupoin = &(sima->menunr); // XXX : &(G.buts->menunr);
@@ -472,7 +474,7 @@ void brush_buttons(const bContext *C, uiBlock *block, short fromsima,
uiBlockEndAlign(block);
yco -= 30;
- id= (ID*)settings->imapaint.brush;
+ id= (ID*)brush;
xco= 200; // std_libbuttons(block, 0, yco, 0, NULL, evt_browse, ID_BR, 0, id, NULL, menupoin, 0, evt_local, evt_del, 0, evt_keepdata);
if(brush && !brush->id.lib) {
@@ -574,7 +576,7 @@ static void image_panel_paintcolor(const bContext *C, Panel *pa)
{
SpaceImage *sima= CTX_wm_space_image(C);
ToolSettings *settings= CTX_data_tool_settings(C);
- Brush *brush= settings->imapaint.brush;
+ Brush *brush= paint_brush(&settings->imapaint.paint);
uiBlock *block;
static float hsv[3], old[3]; // used as temp mem for picker
static char hexcol[128];
@@ -1318,7 +1320,7 @@ void ED_image_uiblock_panel(const bContext *C, uiBlock *block, Image **ima_pp, I
}
/* exception, let's do because we only use this panel 3 times in blender... but not real good code! */
- if( (FACESEL_PAINT_TEST) && sima && &sima->iuser==iuser)
+ if( (paint_facesel_test(CTX_data_active_object(C))) && sima && &sima->iuser==iuser)
return;
/* left side default per-image options, right half the additional options */
@@ -1437,6 +1439,12 @@ void image_buttons_register(ARegionType *art)
strcpy(pt->label, "Curves");
pt->draw= image_panel_curves;
BLI_addtail(&art->paneltypes, pt);
+
+ pt= MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil");
+ strcpy(pt->idname, "IMAGE_PT_gpencil");
+ strcpy(pt->label, "Grease Pencil");
+ pt->draw= gpencil_panel_standard;
+ BLI_addtail(&art->paneltypes, pt);
}
static int image_properties(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index ff25a2635d2..cf9bac1ebee 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -44,14 +44,17 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+#include "BKE_context.h"
#include "BKE_colortools.h"
#include "BKE_global.h"
#include "BKE_image.h"
+#include "BKE_paint.h"
#include "BKE_utildefines.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
+#include "ED_gpencil.h"
#include "ED_image.h"
#include "ED_screen.h"
@@ -524,22 +527,26 @@ static void draw_image_buffer_repeated(SpaceImage *sima, ARegion *ar, Scene *sce
/* draw uv edit */
/* draw grease pencil */
-
-static void draw_image_grease_pencil(SpaceImage *sima, ImBuf *ibuf)
+void draw_image_grease_pencil(bContext *C, short onlyv2d)
{
- /* XXX bring back */
- /* draw grease-pencil ('image' strokes) */
- if (sima->flag & SI_DISPGP)
- ; // XXX draw_gpencil_2dimage(sa, ibuf);
-
-#if 0
- mywinset(sa->win); /* restore scissor after gla call... */
- wmOrtho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-#endif
-
- /* draw grease-pencil (screen strokes) */
- if (sima->flag & SI_DISPGP)
- ; // XXX draw_gpencil_2dview(sa, NULL);
+ /* draw in View2D space? */
+ if (onlyv2d) {
+ /* assume that UI_view2d_ortho(C) has been called... */
+ SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C);
+ ImBuf *ibuf= ED_space_image_buffer(sima);
+
+ /* draw grease-pencil ('image' strokes) */
+ //if (sima->flag & SI_DISPGP)
+ draw_gpencil_2dimage(C, ibuf);
+ }
+ else {
+ /* assume that UI_view2d_restore(C) has been called... */
+ SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C);
+
+ /* draw grease-pencil ('screen' strokes) */
+ //if (sima->flag & SI_DISPGP)
+ draw_gpencil_2dview(C, 0);
+ }
}
/* XXX becomes WM paint cursor */
@@ -577,7 +584,7 @@ static void draw_image_view_tool(Scene *scene)
static unsigned char *get_alpha_clone_image(Scene *scene, int *width, int *height)
{
- Brush *brush = scene->toolsettings->imapaint.brush;
+ Brush *brush = paint_brush(&scene->toolsettings->imapaint.paint);
ImBuf *ibuf;
unsigned int size, alpha;
unsigned char *rect, *cp;
@@ -615,7 +622,7 @@ static void draw_image_paint_helpers(SpaceImage *sima, ARegion *ar, Scene *scene
int x, y, w, h;
unsigned char *clonerect;
- brush= scene->toolsettings->imapaint.brush;
+ brush= paint_brush(&scene->toolsettings->imapaint.paint);
if(brush && (scene->toolsettings->imapaint.tool == PAINT_TOOL_CLONE)) {
/* this is not very efficient, but glDrawPixels doesn't allow
@@ -688,9 +695,6 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
else
draw_image_buffer(sima, ar, scene, ima, ibuf, 0.0f, 0.0f, zoomx, zoomy);
- /* grease pencil */
- draw_image_grease_pencil(sima, ibuf);
-
/* paint helpers */
draw_image_paint_helpers(sima, ar, scene, zoomx, zoomy);
diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h
index aa97e339c68..a33475c1213 100644
--- a/source/blender/editors/space_image/image_intern.h
+++ b/source/blender/editors/space_image/image_intern.h
@@ -53,6 +53,7 @@ void IMAGE_OT_toolbox(struct wmOperatorType *ot);
/* image_draw.c */
void draw_image_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene);
void draw_image_info(struct ARegion *ar, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf);
+void draw_image_grease_pencil(struct bContext *C, short onlyv2d);
/* image_ops.c */
int space_image_main_area_poll(struct bContext *C);
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index d9f02a35142..bee06e6892f 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -61,6 +61,7 @@
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
#include "ED_image.h"
#include "ED_screen.h"
@@ -650,7 +651,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
void IMAGE_OT_open(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Open";
+ ot->name= "Open Image";
ot->idname= "IMAGE_OT_open";
/* api callbacks */
@@ -1166,15 +1167,6 @@ void IMAGE_OT_pack(wmOperatorType *ot)
/********************* unpack operator *********************/
-/* XXX move this to some place where it can be reused */
-
-const EnumPropertyItem unpack_method_items[] = {
- {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""},
- {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""},
- {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""},
- {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""},
- {0, NULL, 0, NULL, NULL}};
-
void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf)
{
uiPopupMenu *pup;
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 1506df89c45..bb647e68917 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -54,6 +54,7 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+#include "ED_gpencil.h"
#include "ED_image.h"
#include "ED_mesh.h"
#include "ED_space_api.h"
@@ -430,16 +431,22 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
/* we set view2d from own zoom and offset each time */
image_main_area_set_view2d(sima, ar, scene);
-
+
/* we draw image in pixelspace */
draw_image_main(sima, ar, scene);
/* and uvs in 0.0-1.0 space */
UI_view2d_view_ortho(C, v2d);
- draw_uvedit_main(sima, ar, scene, obedit);
- ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST);
+ draw_uvedit_main(sima, ar, scene, obedit);
+ ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST);
+
+ /* Grease Pencil too (in addition to UV's) */
+ draw_image_grease_pencil((bContext *)C, 1);
UI_view2d_view_restore(C);
+ /* draw Grease Pencil - screen space only */
+ draw_image_grease_pencil((bContext *)C, 0);
+
/* scrollers? */
/*scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
UI_view2d_scrollers_draw(C, v2d, scrollers);
@@ -558,11 +565,10 @@ void ED_spacetype_image(void)
/* regions: main window */
art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
art->regionid = RGN_TYPE_WINDOW;
- art->keymapflag= ED_KEYMAP_FRAMES;
+ art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_GPENCIL;
art->init= image_main_area_init;
art->draw= image_main_area_draw;
art->listener= image_main_area_listener;
- art->keymapflag= 0;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h
index 519364b58d9..070b627af07 100644
--- a/source/blender/editors/space_info/info_intern.h
+++ b/source/blender/editors/space_info/info_intern.h
@@ -32,9 +32,6 @@
struct wmOperatorType;
-/* info_header.c */
-void info_header_buttons(const bContext *C, ARegion *ar);
-
void FILE_OT_pack_all(struct wmOperatorType *ot);
void FILE_OT_unpack_all(struct wmOperatorType *ot);
void FILE_OT_make_paths_relative(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
new file mode 100644
index 00000000000..2d14fbc515e
--- /dev/null
+++ b/source/blender/editors/space_info/info_stats.c
@@ -0,0 +1,434 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_action_types.h"
+#include "DNA_armature_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_group_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meta_types.h"
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_anim.h"
+#include "BKE_context.h"
+#include "BKE_displist.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_key.h"
+#include "BKE_mesh.h"
+#include "BKE_particle.h"
+#include "BKE_utildefines.h"
+
+#include "ED_armature.h"
+#include "ED_mesh.h"
+
+#include "BLI_editVert.h"
+
+typedef struct SceneStats {
+ int totvert, totvertsel;
+ int totedge, totedgesel;
+ int totface, totfacesel;
+ int totbone, totbonesel;
+ int totobj, totobjsel;
+ int totmesh, totlamp, totcurve;
+
+ char infostr[512];
+} SceneStats;
+
+static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
+{
+ switch(ob->type) {
+ case OB_MESH: {
+ /* we assume derivedmesh is already built, this strictly does stats now. */
+ DerivedMesh *dm= ob->derivedFinal;
+ int totvert, totedge, totface;
+
+ stats->totmesh +=totob;
+
+ if(dm) {
+ totvert = dm->getNumVerts(dm);
+ totedge = dm->getNumEdges(dm);
+ totface = dm->getNumFaces(dm);
+
+ stats->totvert += totvert*totob;
+ stats->totedge += totedge*totob;
+ stats->totface += totface*totob;
+
+ if(sel) {
+ stats->totvertsel += totvert;
+ stats->totfacesel += totface;
+ }
+ }
+ break;
+ }
+ case OB_LAMP:
+ stats->totlamp += totob;
+ break;
+ case OB_SURF:
+ case OB_CURVE:
+ case OB_FONT: {
+ Curve *cu= ob->data;
+ int tot= 0, totf= 0;
+
+ stats->totcurve += totob;
+
+ if(cu->disp.first)
+ count_displist(&cu->disp, &tot, &totf);
+
+ tot *= totob;
+ totf *= totob;
+
+ stats->totvert+= tot;
+ stats->totface+= totf;
+
+ if(sel) {
+ stats->totvertsel += tot;
+ stats->totfacesel += totf;
+ }
+ break;
+ }
+ case OB_MBALL: {
+ int tot= 0, totf= 0;
+
+ count_displist(&ob->disp, &tot, &totf);
+
+ tot *= totob;
+ totf *= totob;
+
+ stats->totvert += tot;
+ stats->totface += totf;
+
+ if(sel) {
+ stats->totvertsel += tot;
+ stats->totfacesel += totf;
+ }
+ break;
+ }
+ }
+}
+
+static void stats_object_edit(Object *obedit, SceneStats *stats)
+{
+ if(obedit->type==OB_MESH) {
+ /* Mesh Edit */
+ EditMesh *em= BKE_mesh_get_editmesh(obedit->data);
+ EditVert *eve;
+ EditEdge *eed;
+ EditFace *efa;
+
+ for(eve= em->verts.first; eve; eve=eve->next) {
+ stats->totvert++;
+ if(eve->f & SELECT) stats->totvertsel++;
+ }
+ for(eed= em->edges.first; eed; eed=eed->next) {
+ stats->totedge++;
+ if(eed->f & SELECT) stats->totedgesel++;
+ }
+ for(efa= em->faces.first; efa; efa=efa->next) {
+ stats->totface++;
+ if(efa->f & SELECT) stats->totfacesel++;
+ }
+
+ EM_validate_selections(em);
+ }
+ else if(obedit->type==OB_ARMATURE){
+ /* Armature Edit */
+ bArmature *arm= obedit->data;
+ EditBone *ebo;
+
+ for(ebo=arm->edbo->first; ebo; ebo=ebo->next){
+ stats->totbone++;
+
+ if((ebo->flag & BONE_CONNECTED) && ebo->parent)
+ stats->totvert--;
+
+ if(ebo->flag & BONE_TIPSEL)
+ stats->totvertsel++;
+ if(ebo->flag & BONE_ROOTSEL)
+ stats->totvertsel++;
+
+ if(ebo->flag & BONE_SELECTED) stats->totbonesel++;
+
+ /* if this is a connected child and it's parent is being moved, remove our root */
+ if((ebo->flag & BONE_CONNECTED)&& (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL))
+ stats->totvertsel--;
+
+ stats->totvert+=2;
+ }
+ }
+ else if ELEM3(obedit->type, OB_CURVE, OB_SURF, OB_FONT) {
+ /* Curve Edit */
+ Curve *cu= obedit->data;
+ Nurb *nu;
+ BezTriple *bezt;
+ BPoint *bp;
+ int a;
+
+ for(nu=cu->editnurb->first; nu; nu=nu->next) {
+ if((nu->type & 7)==CU_BEZIER) {
+ bezt= nu->bezt;
+ a= nu->pntsu;
+ while(a--) {
+ stats->totvert+=3;
+ if(bezt->f1) stats->totvertsel++;
+ if(bezt->f2) stats->totvertsel++;
+ if(bezt->f3) stats->totvertsel++;
+ bezt++;
+ }
+ }
+ else {
+ bp= nu->bp;
+ a= nu->pntsu*nu->pntsv;
+ while(a--) {
+ stats->totvert++;
+ if(bp->f1 & SELECT) stats->totvertsel++;
+ bp++;
+ }
+ }
+ }
+ }
+ else if(obedit->type==OB_MBALL) {
+ /* MetaBall Edit */
+ MetaBall *mball= obedit->data;
+ MetaElem *ml;
+
+ for(ml= mball->editelems->first; ml; ml=ml->next) {
+ stats->totvert++;
+ if(ml->flag & SELECT) stats->totvertsel++;
+ }
+ }
+ else if(obedit->type==OB_LATTICE) {
+ /* Lattice Edit */
+ Lattice *lt= obedit->data;
+ Lattice *editlatt= lt->editlatt;
+ BPoint *bp;
+ int a;
+
+ bp= editlatt->def;
+
+ a= editlatt->pntsu*editlatt->pntsv*editlatt->pntsw;
+ while(a--) {
+ stats->totvert++;
+ if(bp->f1 & SELECT) stats->totvertsel++;
+ bp++;
+ }
+ }
+}
+
+static void stats_object_pose(Object *ob, SceneStats *stats)
+{
+ if(ob->pose) {
+ bArmature *arm= ob->data;
+ bPoseChannel *pchan;
+
+ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ stats->totbone++;
+ if(pchan->bone && (pchan->bone->flag & BONE_SELECTED))
+ if(pchan->bone->layer & arm->layer)
+ stats->totbonesel++;
+ }
+ }
+}
+
+static void stats_object_paint(Object *ob, SceneStats *stats)
+{
+ if(ob->type == OB_MESH) {
+ Mesh *me= ob->data;
+
+ stats->totface= me->totface;
+ stats->totvert= me->totvert;
+ }
+}
+
+static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
+{
+ if(base->flag & SELECT) stats->totobjsel++;
+
+ if(ob->transflag & OB_DUPLIPARTS) {
+ /* Dupli Particles */
+ ParticleSystem *psys;
+ ParticleSettings *part;
+
+ for(psys=ob->particlesystem.first; psys; psys=psys->next){
+ part=psys->part;
+
+ if(part->draw_as==PART_DRAW_OB && part->dup_ob){
+ int tot=count_particles(psys);
+ stats_object(part->dup_ob, 0, tot, stats);
+ }
+ else if(part->draw_as==PART_DRAW_GR && part->dup_group){
+ GroupObject *go;
+ int tot, totgroup=0, cur=0;
+
+ for(go= part->dup_group->gobject.first; go; go=go->next)
+ totgroup++;
+
+ for(go= part->dup_group->gobject.first; go; go=go->next) {
+ tot=count_particles_mod(psys,totgroup,cur);
+ stats_object(go->ob, 0, tot, stats);
+ cur++;
+ }
+ }
+ }
+
+ stats_object(ob, base->flag & SELECT, 1, stats);
+ stats->totobj++;
+ }
+ else if(ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS|OB_DUPLIFACES))) {
+ /* Dupli Verts/Faces */
+ int tot= count_duplilist(ob->parent);
+ stats->totobj+=tot;
+ stats_object(ob, base->flag & SELECT, tot, stats);
+ }
+ else if(ob->transflag & OB_DUPLIFRAMES) {
+ /* Dupli Frames */
+ int tot= count_duplilist(ob);
+ stats->totobj+=tot;
+ stats_object(ob, base->flag & SELECT, tot, stats);
+ }
+ else if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
+ /* Dupli Group */
+ int tot= count_duplilist(ob);
+ stats->totobj+=tot;
+ stats_object(ob, base->flag & SELECT, tot, stats);
+ }
+ else {
+ /* No Dupli */
+ stats_object(ob, base->flag & SELECT, 1, stats);
+ stats->totobj++;
+ }
+}
+
+/* Statistics displayed in info header. Called regularly on scene changes. */
+static void stats_update(Scene *scene)
+{
+ SceneStats stats;
+ Object *ob= (scene->basact)? scene->basact->object: NULL;
+ Base *base;
+
+ memset(&stats, 0, sizeof(stats));
+
+ if(scene->obedit) {
+ /* Edit Mode */
+ stats_object_edit(scene->obedit, &stats);
+ }
+ else if(ob && (ob->mode & OB_MODE_POSE)) {
+ /* Pose Mode */
+ stats_object_pose(ob, &stats);
+ }
+ else if(ob && (ob->flag & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
+ /* Sculpt and Paint Mode */
+ stats_object_paint(ob, &stats);
+ }
+ else {
+ /* Objects */
+ for(base= scene->base.first; base; base=base->next)
+ if(scene->lay & base->lay)
+ stats_dupli_object(base, base->object, &stats);
+ }
+
+ if(!scene->stats)
+ scene->stats= MEM_mallocN(sizeof(SceneStats), "SceneStats");
+
+ *(scene->stats)= stats;
+}
+
+static void stats_string(Scene *scene)
+{
+ SceneStats *stats= scene->stats;
+ Object *ob= (scene->basact)? scene->basact->object: NULL;
+ uintptr_t mem_in_use, mmap_in_use;
+ char memstr[64];
+ char *s;
+
+ mem_in_use= MEM_get_memory_in_use();
+ mmap_in_use= MEM_get_mapped_memory_in_use();
+
+ /* get memory statistics */
+ s= memstr + sprintf(memstr, " | Mem:%.2fM", ((mem_in_use-mmap_in_use)>>10)/1024.0);
+ if(mmap_in_use)
+ sprintf(s, " (%.2fM)", ((mmap_in_use)>>10)/1024.0);
+
+ s= stats->infostr;
+
+ if(scene->obedit) {
+ if(ob_get_keyblock(scene->obedit))
+ s+= sprintf(s, "(Key) ");
+
+ if(scene->obedit->type==OB_MESH) {
+ if(scene->toolsettings->selectmode & SCE_SELECT_VERTEX)
+ s+= sprintf(s, "Ve:%d-%d | Ed:%d-%d | Fa:%d-%d",
+ stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
+ else if(scene->toolsettings->selectmode & SCE_SELECT_EDGE)
+ s+= sprintf(s, "Ed:%d-%d | Fa:%d-%d",
+ stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
+ else
+ s+= sprintf(s, "Fa:%d-%d", stats->totfacesel, stats->totface);
+ }
+ else if(scene->obedit->type==OB_ARMATURE) {
+ s+= sprintf(s, "Ve:%d-%d | Bo:%d-%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
+ }
+ else {
+ s+= sprintf(s, "Ve:%d-%d", stats->totvertsel, stats->totvert);
+ }
+
+ strcat(s, memstr);
+ }
+ else if(ob && (ob->mode & OB_MODE_POSE)) {
+ s += sprintf(s, "Bo:%d-%d %s",
+ stats->totbonesel, stats->totbone, memstr);
+ }
+ else {
+ s += sprintf(s, "Ve:%d | Fa:%d | Ob:%d-%d | La:%d%s",
+ stats->totvert, stats->totface, stats->totobj, stats->totobjsel, stats->totlamp, memstr);
+ }
+
+ if(ob)
+ sprintf(s, " | %s", ob->id.name+2);
+}
+
+void ED_info_stats_clear(Scene *scene)
+{
+ if(scene->stats) {
+ MEM_freeN(scene->stats);
+ scene->stats= NULL;
+ }
+}
+
+char *ED_info_stats_string(Scene *scene)
+{
+ if(!scene->stats)
+ stats_update(scene);
+ stats_string(scene);
+
+ return scene->stats->infostr;
+}
+
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index fe5bbf04af1..b6f9cbeabb5 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -1,5 +1,5 @@
/**
- * $Id:
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -58,6 +58,7 @@
#include "UI_view2d.h"
#include "ED_markers.h"
+#include "ED_object.h"
#include "info_intern.h" // own include
@@ -166,6 +167,9 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn)
if(wmn->data==ND_RENDER_RESULT)
ED_region_tag_redraw(ar);
break;
+ case NC_INFO:
+ ED_region_tag_redraw(ar);
+ break;
}
}
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 03b4a2b84f4..47ba197daa0 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <stdio.h>
+#include <float.h>
#include "DNA_actuator_types.h"
#include "DNA_controller_types.h"
@@ -82,9 +83,6 @@ static int pupmenu() {return 1;}
#define B_REDR 1
#define B_IDNAME 2
-#define B_ADD_PROP 2701
-#define B_CHANGE_PROP 2702
-
#define B_ADD_SENS 2703
#define B_CHANGE_SENS 2704
#define B_DEL_SENS 2705
@@ -363,7 +361,6 @@ static void sca_move_actuator(bContext *C, void *datav, void *data2_unused)
void do_logic_buts(bContext *C, void *arg, int event)
{
- bProperty *prop;
bSensor *sens;
bController *cont;
bActuator *act;
@@ -385,25 +382,7 @@ void do_logic_buts(bContext *C, void *arg, int event)
case B_SETMAINACTOR:
ob->gameflag &= ~(OB_SECTOR|OB_PROP);
break;
-
-
- case B_ADD_PROP:
- prop= new_property(PROP_FLOAT);
- make_unique_prop_names(C, prop->name);
- BLI_addtail(&ob->prop, prop);
- ED_undo_push(C, "Add property");
- break;
-#if 0 // XXX Now done in python
- case B_CHANGE_PROP:
- prop= ob->prop.first;
- while(prop) {
- if(prop->type!=prop->otype) {
- init_property(prop);
- }
- prop= prop->next;
- }
- break;
-#endif
+
case B_ADD_SENS:
for(ob=G.main->object.first; ob; ob=ob->id.next) {
if(ob->scaflag & OB_ADDSENS) {
@@ -708,8 +687,6 @@ static char *actuator_name(int type)
return "Material";
case ACT_SOUND:
return "Sound";
- case ACT_CD:
- return "CD";
case ACT_PROPERTY:
return "Property";
case ACT_EDIT_OBJECT:
@@ -748,21 +725,21 @@ static char *actuator_pup(Object *owner)
case OB_ARMATURE:
return "Actuators %t|Action %x15|Motion %x0|Constraint %x9|Ipo %x1"
"|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
"|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
break;
case OB_MESH:
return "Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1"
"|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
"|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
break;
default:
return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1"
"|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
"|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
}
}
@@ -1316,10 +1293,16 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
* proper compatibility with older .blend files. */
str= "Type %t|Left button %x1|Middle button %x2|"
"Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32";
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19,
+ uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, (width*0.8f)-20, 19,
&ms->type, 0, 31, 0, 0,
"Specify the type of event this mouse sensor should trigger on");
+ if(ms->type==32) {
+ uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44),
+ (short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0,
+ "Moving the mouse over a different object generates a pulse");
+ }
+
yco-= ysize;
break;
}
@@ -1581,7 +1564,6 @@ static int get_col_actuator(int type)
case ACT_IPO: return TH_PANEL;
case ACT_PROPERTY: return TH_PANEL;
case ACT_SOUND: return TH_PANEL;
- case ACT_CD: return TH_PANEL;
case ACT_CAMERA: return TH_PANEL;
case ACT_EDIT_OBJECT: return TH_PANEL;
case ACT_GROUP: return TH_PANEL;
@@ -1662,7 +1644,8 @@ char *get_state_name(Object *ob, short bit)
static void check_state_mask(bContext *C, void *arg1_but, void *arg2_mask)
{
- int shift= 0; // XXX
+ wmWindow *win= CTX_wm_window(C);
+ int shift= win->eventstate->shift;
unsigned int *cont_mask = arg2_mask;
uiBut *but = arg1_but;
@@ -1674,7 +1657,6 @@ static void check_state_mask(bContext *C, void *arg1_but, void *arg2_mask)
static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, short xco, short yco, short width)
{
bSoundActuator *sa = NULL;
- bCDActuator *cda = NULL;
bObjectActuator *oa = NULL;
bIpoActuator *ia = NULL;
bPropertyActuator *pa = NULL;
@@ -1984,11 +1966,14 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
}
case ACT_SOUND:
{
- ysize = 70;
-
sa = act->data;
sa->sndnr = 0;
+ if(sa->flag & ACT_SND_3D_SOUND)
+ ysize = 180;
+ else
+ ysize = 92;
+
wval = (width-20)/2;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
@@ -1998,59 +1983,37 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
/* reset this value, it is for handling the event */
sa->sndnr = 0;
uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, "");
+ uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19, "Load a sound file. Remember to set caching on for small sounds that are played often.");
if(sa->sound) {
char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
- uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,width-40,19, sa->sound->id.name+2, 0.0, 21.0, 0, 0, "");
+ uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19, sa->sound->id.name+2, 0.0, 21.0, 0, 0, "");
uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->sound->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound");
- uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->sound->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound");
+ uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound");
+ uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound");
+ uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space.");
+ if(sa->flag & ACT_SND_3D_SOUND)
+ {
+ uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, "The minimum gain of the sound, no matter how far it is away.");
+ uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19, &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0, "The maximum gain of the sound, no matter how near it is..");
+ uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, &sa->sound3D.reference_distance, 0.0, FLT_MAX, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0.");
+ uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, &sa->sound3D.max_distance, 0.0, FLT_MAX, 0.0, 0.0, "The maximum distance at which you can hear the sound.");
+ uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance.");
+ uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19, &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0, "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value und the normal gain in the inner cone.");
+ uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval, 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the outer cone.");
+ uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval, 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the inner cone.");
+ }
}
MEM_freeN(str);
}
else {
- uiDefBut(block, LABEL, 0, "Use Sound window (F10) to load samples", xco, yco-24, width, 19, NULL, 0, 0, 0, 0, "");
+ uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file.");
}
yco-= ysize;
break;
}
- case ACT_CD:
- {
- char cd_type_str[] = "Sound mode %t|Play all tracks %x0|Play one track %x1|"
- "Volume %x3|Stop %x4|Pause %x5|Resume %x6";
- cda = act->data;
-
- if (cda) {
- if (cda->track == 0) {
- cda->track = 1;
- cda->volume = 1;
- cda->type = ACT_CD_PLAY_ALL;
- }
-
- if (cda->type == ACT_CD_PLAY_TRACK || cda->type == ACT_CD_LOOP_TRACK) {
- ysize = 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefButS(block, NUM, 0, "Track:", xco+10,yco-44,width-20, 19, &cda->track, 1, 99, 0, 0, "Select the track to be played");
- }
- else if (cda->type == ACT_CD_VOLUME) {
- ysize = 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-44,width-20, 19, &cda->volume, 0, 1, 0, 0, "Set the volume for CD playback");
- }
- else {
- ysize = 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
- uiDefButS(block, MENU, B_REDR, cd_type_str,xco+10,yco-22,width-20, 19, &cda->type, 0.0, 0.0, 0, 0, "");
- }
- yco-= ysize;
- break;
- }
case ACT_CAMERA:
ysize= 48;
@@ -2134,7 +2097,10 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, 1, "ME:", xco+40, yco-44, (width-80), 19, &(eoa->me), "replace the existing mesh with this one");
+ uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, 1, "ME:", xco+40, yco-44, (width-80)/2, 19, &(eoa->me), "replace the existing, when left blank 'Phys' will remake the existing physics mesh");
+
+ uiDefButBitS(block, TOGN, ACT_EDOB_REPLACE_MESH_NOGFX, 0, "Gfx", xco+40 + (width-80)/2, yco-44, (width-80)/4, 19, &eoa->flag, 0, 0, 0, 0, "Replace the display mesh");
+ uiDefButBitS(block, TOG, ACT_EDOB_REPLACE_MESH_PHYS, 0, "Phys", xco+40 + (width-80)/2 +(width-80)/4, yco-44, (width-80)/4, 19, &eoa->flag, 0, 0, 0, 0, "Replace the physics mesh (triangle bounds only. compound shapes not supported)");
}
else if(eoa->type==ACT_EDOB_TRACK_TO) {
ysize= 48;
diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c
index 703b408aae6..3c46522bba2 100644
--- a/source/blender/editors/space_logic/space_logic.c
+++ b/source/blender/editors/space_logic/space_logic.c
@@ -102,6 +102,13 @@ static SpaceLink *logic_new(const bContext *C)
slogic= MEM_callocN(sizeof(SpaceLogic), "initlogic");
slogic->spacetype= SPACE_LOGIC;
+ /* default options */
+ slogic->scaflag = (BUTS_SENS_SEL|BUTS_SENS_ACT|BUTS_SENS_LINK) |
+ (BUTS_CONT_SEL|BUTS_CONT_ACT|BUTS_CONT_LINK) |
+ (BUTS_ACT_SEL|BUTS_ACT_ACT|BUTS_ACT_LINK) |
+ (BUTS_SENS_STATE|BUTS_ACT_STATE);
+
+
/* header */
ar= MEM_callocN(sizeof(ARegion), "header for logic");
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index a74037d1ace..bbf1358a37c 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -100,7 +100,7 @@ static void do_nla_region_buttons(bContext *C, void *arg, int event)
WM_event_add_notifier(C, NC_SCENE|NC_OBJECT|ND_TRANSFORM, NULL);
}
-static int nla_panel_context(const bContext *C, PointerRNA *nlt_ptr, PointerRNA *strip_ptr)
+static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_ptr, PointerRNA *strip_ptr)
{
bAnimContext ac;
bAnimListElem *ale= NULL;
@@ -119,10 +119,16 @@ static int nla_panel_context(const bContext *C, PointerRNA *nlt_ptr, PointerRNA
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) {
+ // TODO: need some way to select active animdata too...
if (ale->type == ANIMTYPE_NLATRACK) {
NlaTrack *nlt= (NlaTrack *)ale->data;
+ AnimData *adt= ale->adt;
/* found it, now set the pointers */
+ if (adt_ptr) {
+ /* AnimData pointer */
+ RNA_pointer_create(ale->id, &RNA_AnimData, adt, adt_ptr);
+ }
if (nlt_ptr) {
/* NLA-Track pointer */
RNA_pointer_create(ale->id, &RNA_NlaTrack, nlt, nlt_ptr);
@@ -151,16 +157,22 @@ static int nla_panel_poll(const bContext *C, PanelType *pt)
}
#endif
+static int nla_animdata_panel_poll(const bContext *C, PanelType *pt)
+{
+ PointerRNA ptr;
+ return (nla_panel_context(C, &ptr, NULL, NULL) && (ptr.data != NULL));
+}
+
static int nla_track_panel_poll(const bContext *C, PanelType *pt)
{
PointerRNA ptr;
- return (nla_panel_context(C, &ptr, NULL) && (ptr.data != NULL));
+ return (nla_panel_context(C, NULL, &ptr, NULL) && (ptr.data != NULL));
}
static int nla_strip_panel_poll(const bContext *C, PanelType *pt)
{
PointerRNA ptr;
- return (nla_panel_context(C, NULL, &ptr) && (ptr.data != NULL));
+ return (nla_panel_context(C, NULL, NULL, &ptr) && (ptr.data != NULL));
}
static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *pt)
@@ -168,7 +180,7 @@ static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *pt)
PointerRNA ptr;
NlaStrip *strip;
- if (!nla_panel_context(C, NULL, &ptr))
+ if (!nla_panel_context(C, NULL, NULL, &ptr))
return 0;
if (ptr.data == NULL)
return 0;
@@ -179,6 +191,41 @@ static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *pt)
/* -------------- */
+/* active AnimData */
+static void nla_panel_animdata (const bContext *C, Panel *pa)
+{
+ PointerRNA adt_ptr;
+ AnimData *adt;
+ uiLayout *layout= pa->layout;
+ uiLayout *row;
+ uiBlock *block;
+
+ /* check context and also validity of pointer */
+ if (!nla_panel_context(C, &adt_ptr, NULL, NULL))
+ return;
+ adt= adt_ptr.data;
+
+ block= uiLayoutGetBlock(layout);
+ uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
+
+ /* Active Action Properties ------------------------------------- */
+ /* action */
+ row= uiLayoutRow(layout, 1);
+ uiTemplateID(row, (bContext *)C, &adt_ptr, "action", NULL, NULL/*"ACT_OT_new", "ACT_OT_unlink"*/); // XXX: need to make these operators
+
+ /* extrapolation */
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, NULL, 0, &adt_ptr, "action_extrapolation", 0);
+
+ /* blending */
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, NULL, 0, &adt_ptr, "action_blending", 0);
+
+ /* influence */
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, NULL, 0, &adt_ptr, "action_influence", 0);
+}
+
/* active NLA-Track */
static void nla_panel_track (const bContext *C, Panel *pa)
{
@@ -188,15 +235,15 @@ static void nla_panel_track (const bContext *C, Panel *pa)
uiBlock *block;
/* check context and also validity of pointer */
- if (!nla_panel_context(C, &nlt_ptr, NULL))
+ if (!nla_panel_context(C, NULL, &nlt_ptr, NULL))
return;
-
+
block= uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
/* Info - Active NLA-Context:Track ---------------------- */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, ICON_NLA, &nlt_ptr, "name", 0, 0, 0);
+ uiItemR(row, NULL, ICON_NLA, &nlt_ptr, "name", 0);
}
/* generic settings for active NLA-Strip */
@@ -207,7 +254,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
uiLayout *column, *row, *subcol;
uiBlock *block;
- if (!nla_panel_context(C, NULL, &strip_ptr))
+ if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
block= uiLayoutGetBlock(layout);
@@ -216,41 +263,41 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
/* Strip Properties ------------------------------------- */
/* strip type */
row= uiLayoutColumn(layout, 1);
- uiItemR(row, NULL, ICON_NLA, &strip_ptr, "name", 0, 0, 0); // XXX icon?
- uiItemR(row, NULL, 0, &strip_ptr, "type", 0, 0, 0);
+ uiItemR(row, NULL, ICON_NLA, &strip_ptr, "name", 0); // XXX icon?
+ uiItemR(row, NULL, 0, &strip_ptr, "type", 0);
/* strip extents */
column= uiLayoutColumn(layout, 1);
uiItemL(column, "Strip Extents:", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "start_frame", 0, 0, 0);
- uiItemR(column, NULL, 0, &strip_ptr, "end_frame", 0, 0, 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "start_frame", 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "end_frame", 0);
/* extrapolation */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, 0, &strip_ptr, "extrapolation", 0, 0, 0);
+ uiItemR(row, NULL, 0, &strip_ptr, "extrapolation", 0);
/* blending */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, 0, &strip_ptr, "blending", 0, 0, 0);
+ uiItemR(row, NULL, 0, &strip_ptr, "blending", 0);
/* blend in/out + autoblending
* - blend in/out can only be set when autoblending is off
*/
column= uiLayoutColumn(layout, 1);
uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_influence")==0);
- uiItemR(column, NULL, 0, &strip_ptr, "auto_blending", 0, 0, 0); // XXX as toggle?
+ uiItemR(column, NULL, 0, &strip_ptr, "auto_blending", 0); // XXX as toggle?
subcol= uiLayoutColumn(column, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "auto_blending")==0);
- uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0, 0, 0);
- uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0, 0, 0);
+ uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0);
+ uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0);
/* settings */
column= uiLayoutColumn(layout, 1);
uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "animated_influence") || RNA_boolean_get(&strip_ptr, "animated_time")));
uiItemL(column, "Playback Settings:", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "muted", 0, 0, 0);
- uiItemR(column, NULL, 0, &strip_ptr, "reversed", 0, 0, 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "muted", 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "reversed", 0);
}
@@ -263,7 +310,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa)
uiBlock *block;
/* check context and also validity of pointer */
- if (!nla_panel_context(C, NULL, &strip_ptr))
+ if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
block= uiLayoutGetBlock(layout);
@@ -272,21 +319,21 @@ static void nla_panel_actclip(const bContext *C, Panel *pa)
/* Strip Properties ------------------------------------- */
/* action pointer */
row= uiLayoutRow(layout, 1);
- uiItemR(row, NULL, ICON_ACTION, &strip_ptr, "action", 0, 0, 0);
+ uiItemR(row, NULL, ICON_ACTION, &strip_ptr, "action", 0);
/* action extents */
// XXX custom names were used here (to avoid the prefixes)... probably not necessary in future?
column= uiLayoutColumn(layout, 1);
uiItemL(column, "Action Extents:", 0);
- uiItemR(column, "Start Frame", 0, &strip_ptr, "action_start_frame", 0, 0, 0);
- uiItemR(column, "End Frame", 0, &strip_ptr, "action_end_frame", 0, 0, 0);
+ uiItemR(column, "Start Frame", 0, &strip_ptr, "action_start_frame", 0);
+ uiItemR(column, "End Frame", 0, &strip_ptr, "action_end_frame", 0);
/* action usage */
column= uiLayoutColumn(layout, 1);
uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_time")==0);
uiItemL(column, "Playback Settings:", 0);
- uiItemR(column, NULL, 0, &strip_ptr, "scale", 0, 0, 0);
- uiItemR(column, NULL, 0, &strip_ptr, "repeat", 0, 0, 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "scale", 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "repeat", 0);
}
/* evaluation settings for active NLA-Strip */
@@ -298,26 +345,26 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
uiBlock *block;
/* check context and also validity of pointer */
- if (!nla_panel_context(C, NULL, &strip_ptr))
+ if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
block= uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
column= uiLayoutColumn(layout, 1);
- uiItemR(column, NULL, 0, &strip_ptr, "animated_influence", 0, 0, 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "animated_influence", 0);
subcolumn= uiLayoutColumn(column, 1);
uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_influence"));
- uiItemR(subcolumn, NULL, 0, &strip_ptr, "influence", 0, 0, 0);
+ uiItemR(subcolumn, NULL, 0, &strip_ptr, "influence", 0);
column= uiLayoutColumn(layout, 1);
- uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0, 0, 0);
+ uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0);
subcolumn= uiLayoutColumn(column, 1);
uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_time"));
- uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0, 0, 0);
+ uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0);
}
/* F-Modifiers for active NLA-Strip */
@@ -330,7 +377,7 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa)
uiBlock *block;
/* check context and also validity of pointer */
- if (!nla_panel_context(C, NULL, &strip_ptr))
+ if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
strip= strip_ptr.data;
@@ -362,6 +409,14 @@ void nla_buttons_register(ARegionType *art)
{
PanelType *pt;
+ pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel animdata");
+ strcpy(pt->idname, "NLA_PT_animdata");
+ strcpy(pt->label, "Animation Data");
+ pt->draw= nla_panel_animdata;
+ pt->poll= nla_animdata_panel_poll;
+ pt->flag= PNL_DEFAULT_CLOSED;
+ BLI_addtail(&art->paneltypes, pt);
+
pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel track");
strcpy(pt->idname, "NLA_PT_track");
strcpy(pt->label, "Active Track");
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 98dacc8ef5b..ccf23266427 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -45,6 +45,7 @@
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
+#include "DNA_meta_types.h"
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
@@ -88,6 +89,7 @@
* part of the channel is relevant.
*
* NOTE: eventually, this should probably be phased out when many of these things are replaced with buttons
+ * --> Most channels are now selection only...
*/
static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, short selectmode)
@@ -95,6 +97,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
+ View2D *v2d= &ac->ar->v2d;
int notifierFlags = 0;
/* get the channel that was clicked on */
@@ -117,32 +120,17 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
case ANIMTYPE_SCENE:
{
Scene *sce= (Scene *)ale->data;
- AnimData *adt= ale->data;
- if (x < 16) {
- /* toggle expand */
- sce->flag ^= SCE_DS_COLLAPSED;
-
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- else if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
-
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ /* set selection status */
+ if (selectmode == SELECT_INVERT) {
+ /* swap select */
+ sce->flag ^= SCE_DS_SELECTED;
}
else {
- /* set selection status */
- if (selectmode == SELECT_INVERT) {
- /* swap select */
- sce->flag ^= SCE_DS_SELECTED;
- }
- else {
- sce->flag |= SCE_DS_SELECTED;
- }
-
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ sce->flag |= SCE_DS_SELECTED;
}
+
+ notifierFlags |= ND_ANIMCHAN_SELECT;
}
break;
case ANIMTYPE_OBJECT:
@@ -151,20 +139,8 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
Scene *sce= (Scene *)ads->source;
Base *base= (Base *)ale->data;
Object *ob= base->object;
- AnimData *adt= ale->adt;
- if (x < 16) {
- /* toggle expand */
- ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- else if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
-
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- else if (nlaedit_is_tweakmode_on(ac) == 0) {
+ if (nlaedit_is_tweakmode_on(ac) == 0) {
/* set selection status */
if (selectmode == SELECT_INVERT) {
/* swap select */
@@ -193,133 +169,6 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
}
}
break;
- case ANIMTYPE_FILLMATD:
- {
- Object *ob= (Object *)ale->data;
- ob->nlaflag ^= OB_ADS_SHOWMATS; // XXX
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_FILLPARTD:
- {
- Object *ob= (Object *)ale->data;
- ob->nlaflag ^= OB_ADS_SHOWPARTS; // XXX
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
-
- case ANIMTYPE_DSMAT:
- {
- Material *ma= (Material *)ale->data;
- AnimData *adt= ale->adt;
-
- if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
- }
- else {
- /* toggle expand */
- ma->flag ^= MA_DS_EXPAND;
- }
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSLAM:
- {
- Lamp *la= (Lamp *)ale->data;
- AnimData *adt= ale->adt;
-
- if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
- }
- else {
- /* toggle expand */
- la->flag ^= LA_DS_EXPAND;
- }
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSCAM:
- {
- Camera *ca= (Camera *)ale->data;
- AnimData *adt= ale->adt;
-
- if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
- }
- else {
- /* toggle expand */
- ca->flag ^= CAM_DS_EXPAND;
- }
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSCUR:
- {
- Curve *cu= (Curve *)ale->data;
- AnimData *adt= ale->adt;
-
- if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
- }
- else {
- /* toggle expand */
- cu->flag ^= CU_DS_EXPAND;
- }
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSSKEY:
- {
- Key *key= (Key *)ale->data;
- AnimData *adt= ale->adt;
-
- if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
- }
- else {
- /* toggle expand */
- key->flag ^= KEYBLOCK_DS_EXPAND;
- }
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSWOR:
- {
- World *wo= (World *)ale->data;
- AnimData *adt= ale->adt;
-
- if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
- }
- else {
- /* toggle expand */
- wo->flag ^= WO_DS_EXPAND;
- }
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
- case ANIMTYPE_DSPART:
- {
- ParticleSettings *part= (ParticleSettings *)ale->data;
- AnimData *adt= ale->adt;
-
- if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
- /* toggle mute */
- adt->flag ^= ADT_NLA_EVAL_OFF;
- }
- else {
- /* toggle expand */
- part->flag ^= PART_DS_EXPAND;
- }
- notifierFlags |= ND_ANIMCHAN_EDIT;
- }
- break;
case ANIMTYPE_NLATRACK:
{
@@ -338,14 +187,14 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
else
offset= 0;
- if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) {
+ if (x >= (v2d->cur.xmax-NLACHANNEL_BUTTON_WIDTH)) {
/* toggle protection (only if there's a toggle there) */
nlt->flag ^= NLATRACK_PROTECTED;
/* notifier flags - channel was edited */
notifierFlags |= ND_ANIMCHAN_EDIT;
}
- else if (x >= (NLACHANNEL_NAMEWIDTH-2*NLACHANNEL_BUTTON_WIDTH)) {
+ else if (x >= (v2d->cur.xmax-2*NLACHANNEL_BUTTON_WIDTH)) {
/* toggle mute */
nlt->flag ^= NLATRACK_MUTED;
@@ -384,7 +233,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
{
AnimData *adt= BKE_animdata_from_id(ale->owner); /* this won't crash, right? */
- if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) {
+ if (x >= (v2d->cur.xmax-NLACHANNEL_BUTTON_WIDTH)) {
if (nlaedit_is_tweakmode_on(ac) == 0) {
/* 'push-down' action - only usable when not in TweakMode */
// TODO: make this use the operator instead of calling the function directly
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 3feefcc11ab..b21f37ab678 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -46,6 +46,7 @@
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
+#include "DNA_meta_types.h"
#include "DNA_particle_types.h"
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
@@ -166,7 +167,7 @@ static void nla_action_draw_keyframes (AnimData *adt, bAction *act, View2D *v2d,
* - size is 3.0f which is smaller than the editable keyframes, so that there is a distinction
*/
for (ak= keys.first; ak; ak= ak->next)
- draw_keyframe_shape(ak->cfra, y, xscale, 3.0f, 0, KEYFRAME_SHAPE_FRAME);
+ draw_keyframe_shape(ak->cfra, y, xscale, 3.0f, 0, ak->key_type, KEYFRAME_SHAPE_FRAME);
/* free icons */
BLI_dlrbTree_free(&keys);
@@ -410,7 +411,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStr
/* don't draw if line would end up on or after the end of the strip */
if (repeatPos < strip->end)
- fdrawline(repeatPos, yminc, repeatPos, ymaxc);
+ fdrawline(repeatPos, yminc+4, repeatPos, ymaxc-4);
}
}
/* or if meta-strip, draw lines delimiting extents of sub-strips (in same color as outline, if more than 1 exists) */
@@ -591,36 +592,15 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
/* *********************************************** */
/* Channel List */
-void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
+/* old code for drawing NLA channels using GL only */
+// TODO: depreceate this code...
+static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, View2D *v2d, float y)
{
- ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
- int filter;
-
- View2D *v2d= &ar->v2d;
- float x= 0.0f, y= 0.0f;
- int items, height;
-
- /* build list of channels to draw */
- filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS);
- items= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
-
- /* Update max-extent of channels here (taking into account scrollers):
- * - this is done to allow the channel list to be scrollable, but must be done here
- * to avoid regenerating the list again and/or also because channels list is drawn first
- * - offset of NLACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for
- * start of list offset, and the second is as a correction for the scrollers.
- */
- height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2));
- /* don't use totrect set, as the width stays the same
- * (NOTE: this is ok here, the configuration is pretty straightforward)
- */
- v2d->tot.ymin= (float)(-height);
+ float x = 0.0f;
/* loop through channels, and set up drawing depending on their type */
- y= (float)(-NLACHANNEL_HEIGHT);
-
- for (ale= anim_data.first; ale; ale= ale->next) {
+ for (ale= anim_data->first; ale; ale= ale->next) {
const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF);
const float ymaxc= (float)(y + NLACHANNEL_HEIGHT_HALF);
const float ydatac= (float)(y - 7);
@@ -632,283 +612,10 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
short indent= 0, offset= 0, sel= 0, group= 0;
int expand= -1, protect = -1, special= -1, mute = -1;
char name[128];
+ short doDraw=0;
/* determine what needs to be drawn */
switch (ale->type) {
- case ANIMTYPE_SCENE: /* scene */
- {
- Scene *sce= (Scene *)ale->data;
- AnimData *adt= ale->adt;
-
- group= 4;
- indent= 0;
-
- special= ICON_SCENE_DATA;
-
- /* only show expand if there are any channels */
- if (EXPANDED_SCEC(sce))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- sel = SEL_SCEC(sce);
- strcpy(name, sce->id.name+2);
- }
- break;
- case ANIMTYPE_OBJECT: /* object */
- {
- Base *base= (Base *)ale->data;
- Object *ob= base->object;
- AnimData *adt= ale->adt;
-
- group= 4;
- indent= 0;
-
- /* icon depends on object-type */
- if (ob->type == OB_ARMATURE)
- special= ICON_ARMATURE_DATA;
- else
- special= ICON_OBJECT_DATA;
-
- /* only show expand if there are any channels */
- if (EXPANDED_OBJC(ob))
- expand= ICON_TRIA_DOWN;
- else
- expand= ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- sel = SEL_OBJC(base);
- strcpy(name, ob->id.name+2);
- }
- break;
- case ANIMTYPE_FILLMATD: /* object materials (dopesheet) expand widget */
- {
- Object *ob = (Object *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_MATERIAL_DATA;
-
- if (FILTER_MAT_OBJC(ob))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, "Materials");
- }
- break;
- case ANIMTYPE_FILLPARTD: /* object particles (dopesheet) expand widget */
- {
- Object *ob = (Object *)ale->data;
-
- group = 4;
- indent = 1;
- special = ICON_PARTICLE_DATA;
-
- if (FILTER_PART_OBJC(ob))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- strcpy(name, "Particles");
- }
- break;
-
-
- case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */
- {
- Material *ma = (Material *)ale->data;
- AnimData *adt= ale->adt;
-
- group = 0;
- indent = 0;
- special = ICON_MATERIAL_DATA;
- offset = 21;
-
- if (FILTER_MAT_OBJD(ma))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- strcpy(name, ma->id.name+2);
- }
- break;
- case ANIMTYPE_DSLAM: /* lamp (dopesheet) expand widget */
- {
- Lamp *la = (Lamp *)ale->data;
- AnimData *adt= ale->adt;
-
- group = 4;
- indent = 1;
- special = ICON_LAMP_DATA;
-
- if (FILTER_LAM_OBJD(la))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- strcpy(name, la->id.name+2);
- }
- break;
- case ANIMTYPE_DSCAM: /* camera (dopesheet) expand widget */
- {
- Camera *ca = (Camera *)ale->data;
- AnimData *adt= ale->adt;
-
- group = 4;
- indent = 1;
- special = ICON_CAMERA_DATA;
-
- if (FILTER_CAM_OBJD(ca))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- strcpy(name, ca->id.name+2);
- }
- break;
- case ANIMTYPE_DSCUR: /* curve (dopesheet) expand widget */
- {
- Curve *cu = (Curve *)ale->data;
- AnimData *adt= ale->adt;
-
- group = 4;
- indent = 1;
- special = ICON_CURVE_DATA;
-
- if (FILTER_CUR_OBJD(cu))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- strcpy(name, cu->id.name+2);
- }
- break;
- case ANIMTYPE_DSSKEY: /* shapekeys (dopesheet) expand widget */
- {
- Key *key= (Key *)ale->data;
- AnimData *adt= ale->adt;
-
- group = 4;
- indent = 1;
- special = ICON_SHAPEKEY_DATA;
-
- if (FILTER_SKE_OBJD(key))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- //sel = SEL_OBJC(base);
- strcpy(name, "Shape Keys");
- }
- break;
- case ANIMTYPE_DSWOR: /* world (dopesheet) expand widget */
- {
- World *wo= (World *)ale->data;
- AnimData *adt= ale->adt;
-
- group = 4;
- indent = 1;
- special = ICON_WORLD_DATA;
-
- if (FILTER_WOR_SCED(wo))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- strcpy(name, wo->id.name+2);
- }
- break;
- case ANIMTYPE_DSPART: /* particle (dopesheet) expand widget */
- {
- ParticleSettings *part= (ParticleSettings*)ale->data;
- AnimData *adt= ale->adt;
-
- group = 0;
- indent = 0;
- special = ICON_PARTICLE_DATA;
- offset = 21;
-
- if (FILTER_PART_OBJD(part))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- /* NLA evaluation on/off button */
- if (adt) {
- if (adt->flag & ADT_NLA_EVAL_OFF)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- strcpy(name, part->id.name+2);
- }
- break;
-
case ANIMTYPE_NLATRACK: /* NLA Track */
{
NlaTrack *nlt= (NlaTrack *)ale->data;
@@ -952,6 +659,9 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
sel = SEL_NLT(nlt);
strcpy(name, nlt->name);
+
+ // draw manually still
+ doDraw= 1;
}
break;
case ANIMTYPE_NLAACTION: /* NLA Action-Line */
@@ -978,167 +688,219 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
sprintf(name, "ActAction: <%s>", act->id.name+2);
else
sprintf(name, "<No Action>");
+
+ // draw manually still
+ doDraw= 1;
}
break;
+
+ default: /* handled by standard channel-drawing API */
+ // draw backdrops only...
+ ANIM_channel_draw(ac, ale, yminc, ymaxc);
+ break;
}
- /* now, start drawing based on this information */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- /* draw backing strip behind channel name */
- if (group == 4) {
- /* only used in dopesheet... */
- if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) {
- /* object channel - darker */
- UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (8):(1|8));
- gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 10);
+ /* if special types, draw manually for now... */
+ if (doDraw) {
+ /* now, start drawing based on this information */
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+
+ /* draw backing strip behind channel name */
+ if (group == 5) {
+ /* Action Line */
+ AnimData *adt= ale->adt;
+
+ // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now)
+ if (adt && (adt->flag & ADT_NLA_EDIT_ON)) {
+ // greenish color (same as tweaking strip) - hardcoded for now
+ glColor3f(0.3f, 0.95f, 0.1f);
+ }
+ else {
+ if (ale->data)
+ glColor3f(0.8f, 0.2f, 0.0f); // reddish color - hardcoded for now
+ else
+ glColor3f(0.6f, 0.5f, 0.5f); // greyish-red color - hardcoded for now
+ }
+
+ offset += 7 * indent;
+
+ /* only on top two corners, to show that this channel sits on top of the preceeding ones */
+ uiSetRoundBox((1|2));
+
+ /* draw slightly shifted up vertically to look like it has more separtion from other channels,
+ * but we then need to slightly shorten it so that it doesn't look like it overlaps
+ */
+ gl_round_box(GL_POLYGON, x+offset, yminc+NLACHANNEL_SKIP, (float)v2d->cur.xmax, ymaxc+NLACHANNEL_SKIP-1, 8);
+
+ /* clear group value, otherwise we cause errors... */
+ group = 0;
}
else {
- /* sub-object folders - lighter */
- UI_ThemeColor(TH_DOPESHEET_CHANNELSUBOB);
+ /* for normal channels
+ * - use 3 shades of color group/standard color for 3 indention level
+ */
+ UI_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
+ indent += group;
offset += 7 * indent;
glBegin(GL_QUADS);
glVertex2f(x+offset, yminc);
glVertex2f(x+offset, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, ymaxc);
- glVertex2f((float)ACHANNEL_NAMEWIDTH, yminc);
+ glVertex2f((float)v2d->cur.xmax, ymaxc);
+ glVertex2f((float)v2d->cur.xmax, yminc);
glEnd();
-
- /* clear group value, otherwise we cause errors... */
- group = 0;
}
- }
- else if (group == 5) {
- /* Action Line */
- AnimData *adt= ale->adt;
- // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now)
- if (adt && (adt->flag & ADT_NLA_EDIT_ON)) {
- // greenish color (same as tweaking strip) - hardcoded for now
- glColor3f(0.3f, 0.95f, 0.1f);
- }
- else {
- if (ale->data)
- glColor3f(0.8f, 0.2f, 0.0f); // reddish color - hardcoded for now
- else
- glColor3f(0.6f, 0.5f, 0.5f); // greyish-red color - hardcoded for now
+ /* draw expand/collapse triangle */
+ if (expand > 0) {
+ UI_icon_draw(x+offset, ydatac, expand);
+ offset += 17;
}
- offset += 7 * indent;
+ /* draw special icon indicating certain data-types */
+ if (special > -1) {
+ /* for normal channels */
+ UI_icon_draw(x+offset, ydatac, special);
+ offset += 17;
+ }
+ glDisable(GL_BLEND);
- /* only on top two corners, to show that this channel sits on top of the preceeding ones */
- uiSetRoundBox((1|2));
+ /* draw name */
+ if (sel)
+ UI_ThemeColor(TH_TEXT_HI);
+ else
+ UI_ThemeColor(TH_TEXT);
+ offset += 3;
+ UI_DrawString(x+offset, y-4, name);
- /* draw slightly shifted up vertically to look like it has more separtion from other channels,
- * but we then need to slightly shorten it so that it doesn't look like it overlaps
- */
- gl_round_box(GL_POLYGON, x+offset, yminc+NLACHANNEL_SKIP, (float)NLACHANNEL_NAMEWIDTH, ymaxc+NLACHANNEL_SKIP-1, 8);
+ /* reset offset - for RHS of panel */
+ offset = 0;
- /* clear group value, otherwise we cause errors... */
- group = 0;
- }
- else {
- /* for normal channels
- * - use 3 shades of color group/standard color for 3 indention level
- */
- UI_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
+ /* set blending again, as text drawing may clear it */
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
- indent += group;
- offset += 7 * indent;
- glBegin(GL_QUADS);
- glVertex2f(x+offset, yminc);
- glVertex2f(x+offset, ymaxc);
- glVertex2f((float)NLACHANNEL_NAMEWIDTH, ymaxc);
- glVertex2f((float)NLACHANNEL_NAMEWIDTH, yminc);
- glEnd();
- }
-
- /* draw expand/collapse triangle */
- if (expand > 0) {
- UI_icon_draw(x+offset, ydatac, expand);
- offset += 17;
- }
-
- /* draw special icon indicating certain data-types */
- if (special > -1) {
- /* for normal channels */
- UI_icon_draw(x+offset, ydatac, special);
- offset += 17;
- }
- glDisable(GL_BLEND);
-
- /* draw name */
- if (sel)
- UI_ThemeColor(TH_TEXT_HI);
- else
- UI_ThemeColor(TH_TEXT);
- offset += 3;
- UI_DrawString(x+offset, y-4, name);
-
- /* reset offset - for RHS of panel */
- offset = 0;
-
- /* set blending again, as text drawing may clear it */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- /* draw protect 'lock' */
- if (protect > -1) {
- offset = 16;
- UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, protect);
- }
-
- /* draw mute 'eye' */
- if (mute > -1) {
- offset += 16;
- UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, mute);
- }
-
- /* draw NLA-action line 'status-icons' - only when there's an action */
- if ((ale->type == ANIMTYPE_NLAACTION) && (ale->data)) {
- AnimData *adt= ale->adt;
+ /* draw protect 'lock' */
+ if (protect > -1) {
+ offset = 16;
+ UI_icon_draw((float)(v2d->cur.xmax-offset), ydatac, protect);
+ }
- offset += 16;
+ /* draw mute 'eye' */
+ if (mute > -1) {
+ offset += 16;
+ UI_icon_draw((float)(v2d->cur.xmax-offset), ydatac, mute);
+ }
- /* now draw some indicator icons */
- if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) {
- /* toggle for tweaking with mapping/no-mapping (i.e. 'in place editing' toggle) */
- // for now, use pin icon to symbolise this
- if (adt->flag & ADT_NLA_EDIT_NOMAP)
- UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_PINNED);
- else
- UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_UNPINNED);
-
- fdrawline((float)(NLACHANNEL_NAMEWIDTH-offset), yminc,
- (float)(NLACHANNEL_NAMEWIDTH-offset), ymaxc);
- offset += 16;;
+ /* draw NLA-action line 'status-icons' - only when there's an action */
+ if ((ale->type == ANIMTYPE_NLAACTION) && (ale->data)) {
+ AnimData *adt= ale->adt;
- /* 'tweaking action' indicator - not a button */
- UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_EDIT);
- }
- else {
- /* XXX firstly draw a little rect to help identify that it's different from the toggles */
- glBegin(GL_LINE_LOOP);
- glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-7);
- glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+9);
- glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+9);
- glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7);
- glEnd(); // GL_LINES
+ offset += 16;
- /* 'push down' icon for normal active-actions */
- UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_FREEZE);
+ /* now draw some indicator icons */
+ if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) {
+ /* toggle for tweaking with mapping/no-mapping (i.e. 'in place editing' toggle) */
+ // for now, use pin icon to symbolise this
+ if (adt->flag & ADT_NLA_EDIT_NOMAP)
+ UI_icon_draw((float)(v2d->cur.xmax-offset), ydatac, ICON_PINNED);
+ else
+ UI_icon_draw((float)(v2d->cur.xmax-offset), ydatac, ICON_UNPINNED);
+
+ fdrawline((float)(v2d->cur.xmax-offset), yminc,
+ (float)(v2d->cur.xmax-offset), ymaxc);
+ offset += 16;;
+
+ /* 'tweaking action' indicator - not a button */
+ UI_icon_draw((float)(v2d->cur.xmax-offset), ydatac, ICON_EDIT);
+ }
+ else {
+ /* XXX firstly draw a little rect to help identify that it's different from the toggles */
+ glBegin(GL_LINE_LOOP);
+ glVertex2f((float)v2d->cur.xmax-offset-1, y-7);
+ glVertex2f((float)v2d->cur.xmax-offset-1, y+9);
+ glVertex2f((float)v2d->cur.xmax-1, y+9);
+ glVertex2f((float)v2d->cur.xmax-1, y-7);
+ glEnd(); // GL_LINES
+
+ /* 'push down' icon for normal active-actions */
+ UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_FREEZE);
+ }
}
+
+ glDisable(GL_BLEND);
}
-
- glDisable(GL_BLEND);
}
/* adjust y-position for next one */
y -= NLACHANNEL_STEP;
}
+}
+
+void draw_nla_channel_list (bContext *C, bAnimContext *ac, SpaceNla *snla, ARegion *ar)
+{
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ View2D *v2d= &ar->v2d;
+ float y= 0.0f;
+ int items, height;
+
+ /* build list of channels to draw */
+ filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS);
+ items= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
+
+ /* Update max-extent of channels here (taking into account scrollers):
+ * - this is done to allow the channel list to be scrollable, but must be done here
+ * to avoid regenerating the list again and/or also because channels list is drawn first
+ * - offset of NLACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for
+ * start of list offset, and the second is as a correction for the scrollers.
+ */
+ height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2));
+ /* don't use totrect set, as the width stays the same
+ * (NOTE: this is ok here, the configuration is pretty straightforward)
+ */
+ v2d->tot.ymin= (float)(-height);
+
+ /* draw channels */
+ { /* first pass: backdrops + oldstyle drawing */
+ y= (float)(-NLACHANNEL_HEIGHT);
+
+ draw_nla_channel_list_gl(ac, &anim_data, v2d, y);
+ }
+ { /* second pass: UI widgets */
+ uiBlock *block= uiBeginBlock(C, ar, "NLA channel buttons", UI_EMBOSS);
+
+ y= (float)(-NLACHANNEL_HEIGHT);
+
+ /* set blending again, as may not be set in previous step */
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+
+ /* loop through channels, and set up drawing depending on their type */
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF);
+ const float ymaxc= (float)(y + NLACHANNEL_HEIGHT_HALF);
+
+ /* check if visible */
+ if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw_widgets(ac, ale, block, yminc, ymaxc);
+ }
+
+ /* adjust y-position for next one */
+ y -= NLACHANNEL_STEP;
+ }
+
+ uiEndBlock(C, block);
+ uiDrawBlock(C, block);
+
+ glDisable(GL_BLEND);
+ }
/* free tempolary channels */
BLI_freelistN(&anim_data);
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index d476852ef2d..e53ccd004db 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -919,6 +919,58 @@ void NLA_OT_split (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
+/* ******************** Bake Strips Operator ***************************** */
+/* Bakes the NLA Strips for the active AnimData blocks */
+
+static int nlaedit_bake_exec (bContext *C, wmOperator *op)
+{
+ bAnimContext ac;
+
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+
+ /* get a list of the editable tracks being shown in the NLA */
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA | ANIMFILTER_FOREDIT);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ /* for each AnimData block, bake strips to animdata... */
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ // FIXME
+ }
+
+ /* free temp data */
+ BLI_freelistN(&anim_data);
+
+ /* refresh auto strip properties */
+ ED_nla_postop_refresh(&ac);
+
+ /* set notifier that things have changed */
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+
+ /* done */
+ return OPERATOR_FINISHED;
+}
+
+void NLA_OT_bake (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Bake Strips";
+ ot->idname= "NLA_OT_bake";
+ ot->description= "Bake all strips of selected AnimData blocks.";
+
+ /* api callbacks */
+ ot->exec= nlaedit_bake_exec;
+ ot->poll= nlaop_poll_tweakmode_off;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
/* *********************************************** */
/* NLA Editing Operations (Modifying) */
@@ -1197,7 +1249,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op)
* but leave everything else alone
*/
strip->scale= 1.0f;
- calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
+ calc_action_range(strip->act, &strip->actstart, &strip->actend, 0);
}
}
}
diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c
index 20343adef03..0d3bf2cb6b1 100644
--- a/source/blender/editors/space_nla/nla_header.c
+++ b/source/blender/editors/space_nla/nla_header.c
@@ -94,14 +94,14 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemS(layout);
- uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0);
if (snla->flag & SNLA_DRAWTIME)
uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle");
else
uiItemO(layout, "Show Seconds", 0, "ANIM_OT_time_toggle");
- uiItemR(layout, NULL, 0, &spaceptr, "show_strip_curves", 0, 0, 0);
+ uiItemR(layout, NULL, 0, &spaceptr, "show_strip_curves", 0);
uiItemS(layout);
@@ -151,8 +151,8 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
Scene *scene= CTX_data_scene(C);
- uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu);
- uiItemMenuF(layout, "Snap", 0, nla_edit_snapmenu);
+ uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu, NULL);
+ uiItemMenuF(layout, "Snap", 0, nla_edit_snapmenu, NULL);
uiItemS(layout);
@@ -261,13 +261,14 @@ void nla_header_buttons(const bContext *C, ARegion *ar)
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Lamps");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Cameras");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Curves");
+ uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMBA, B_REDR, ICON_META_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display MetaBalls");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Particles");
uiBlockEndAlign(block);
xco += 15;
}
else {
// XXX this case shouldn't happen at all... for now, just pad out same amount of space
- xco += 7*XIC + 15;
+ xco += 10*XIC + 15;
}
xco += (XIC + 8);
diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h
index 7cc09707ba7..e4557ec878f 100644
--- a/source/blender/editors/space_nla/nla_intern.h
+++ b/source/blender/editors/space_nla/nla_intern.h
@@ -45,7 +45,7 @@ void NLA_OT_properties(wmOperatorType *ot);
/* nla_draw.c */
void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *ar);
-void draw_nla_channel_list(bAnimContext *ac, SpaceNla *snla, ARegion *ar);
+void draw_nla_channel_list(bContext *C, bAnimContext *ac, SpaceNla *snla, ARegion *ar);
/* **************************************** */
/* nla_header.c */
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 6f377aabd4e..c4f929274c7 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -238,7 +238,7 @@ static void nla_channel_area_draw(const bContext *C, ARegion *ar)
/* data */
if (ANIM_animdata_get_context(C, &ac)) {
- draw_nla_channel_list(&ac, snla, ar);
+ draw_nla_channel_list((bContext *)C, &ac, snla, ar);
}
/* reset view matrix */
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 50cf193f37b..1fb8cb3452b 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -253,7 +253,7 @@ static int node_buts_mix_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf
uiButSetFunc(bt, node_but_title_cb, node, bt);
/* Alpha option, composite */
if(a_but)
- uiDefButS(block, TOG, B_NODE_EXEC, "A",
+ uiDefIconButS(block, TOG, B_NODE_EXEC, ICON_IMAGE_RGB_ALPHA,
(short)butr->xmax-20, (short)butr->ymin, 20, 20,
&node->custom2, 0, 0, 0, 0, "Include Alpha of 2nd input in this operation");
}
@@ -1077,7 +1077,7 @@ static int node_composit_buts_renderlayers(uiBlock *block, bNodeTree *ntree, bNo
/* browse button layer */
strp= scene_layer_menu(node->id?(Scene *)node->id:scene);
if(node->id)
- bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC, ICON_SCENE_DATA, strp,
+ bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC, ICON_RENDERLAYERS, strp,
butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-40, 19,
&node->custom1, 0, 0, 0, 0, "Choose Render Layer");
else
@@ -1473,7 +1473,7 @@ static int node_composit_buts_vecblur(uiBlock *block, bNodeTree *ntree, bNode *n
uiDefButS(block, NUM, B_NODE_EXEC, "MaxSpeed:",
butr->xmin, dy+38, dx, 19,
&nbd->maxspeed, 0, 1024, 0, 0, "If not zero, maximum speed in pixels");
- uiDefButF(block, NUM, B_NODE_EXEC, "BlurFac:",
+ uiDefButF(block, NUM, B_NODE_EXEC, "Blur:",
butr->xmin, dy+19, dx, 19,
&nbd->fac, 0.0f, 2.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames");
uiDefButS(block, TOG, B_NODE_EXEC, "Curved",
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 70e2167c1e4..f3df7a29c2e 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -607,9 +607,9 @@ static void do_node_internal_buttons(bContext *C, void *node_v, int event)
}
WM_event_add_notifier(C, NC_SCENE|ND_NODES, CTX_data_scene(C));
}
-
- // else if(snode->treetype==NTREE_TEXTURE)
- // texture_node_event(snode, val);
+ else if(snode->treetype==NTREE_TEXTURE) {
+ WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id);
+ }
}
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index fe68a56dea5..bc81c25d106 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -56,6 +56,7 @@
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_material.h"
+#include "BKE_paint.h"
#include "BKE_texture.h"
#include "BKE_scene.h"
#include "BKE_utildefines.h"
@@ -212,10 +213,8 @@ void snode_handle_recalc(bContext *C, SpaceNode *snode)
WM_event_add_notifier(C, NC_MATERIAL|ND_NODES, snode->id);
else if(snode->treetype==NTREE_COMPOSIT)
WM_event_add_notifier(C, NC_SCENE|ND_NODES, snode->id);
- else if(snode->treetype==NTREE_TEXTURE) {
- // ntreeTexUpdatePreviews(snode->nodetree); /* XXX texture nodes should follow shader node methods (ton) */
- // XXX BIF_preview_changed(ID_TE);
- }
+ else if(snode->treetype==NTREE_TEXTURE)
+ WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id);
}
#if 0
@@ -486,7 +485,7 @@ static void texture_node_event(SpaceNode *snode, short event)
#endif /* 0 */
/* assumes nothing being done in ntree yet, sets the default in/out node */
/* called from shading buttons or header */
-void node_shader_default(Material *ma)
+void ED_node_shader_default(Material *ma)
{
bNode *in, *out;
bNodeSocket *fromsock, *tosock;
@@ -516,7 +515,7 @@ void node_shader_default(Material *ma)
/* assumes nothing being done in ntree yet, sets the default in/out node */
/* called from shading buttons or header */
-void node_composit_default(Scene *sce)
+void ED_node_composit_default(Scene *sce)
{
bNode *in, *out;
bNodeSocket *fromsock, *tosock;
@@ -550,7 +549,7 @@ void node_composit_default(Scene *sce)
/* assumes nothing being done in ntree yet, sets the default in/out node */
/* called from shading buttons or header */
-void node_texture_default(Tex *tx)
+void ED_node_texture_default(Tex *tx)
{
bNode *in, *out;
bNodeSocket *fromsock, *tosock;
@@ -575,7 +574,6 @@ void node_texture_default(Tex *tx)
nodeAddLink(tx->nodetree, in, fromsock, out, tosock);
ntreeSolveOrder(tx->nodetree); /* needed for pointers */
- ntreeTexUpdatePreviews(tx->nodetree); /* XXX texture nodes should follow shader node methods (ton) */
}
/* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */
@@ -592,7 +590,7 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
if(ob) {
Material *ma= give_current_material(ob, ob->actcol);
if(ma) {
- snode->from= material_from(ob, ob->actcol);
+ snode->from= &ob->id;
snode->id= &ma->id;
snode->nodetree= ma->nodetree;
}
@@ -614,7 +612,13 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
if(snode->texfrom==SNODE_TEX_OBJECT) {
if(ob) {
tx= give_current_texture(ob, ob->actcol);
- snode->from= (ID *)ob;
+
+ if(ob->type == OB_LAMP)
+ snode->from= (ID*)ob->data;
+ else
+ snode->from= (ID*)give_current_material(ob, ob->actcol);
+
+ /* from is not set fully for material nodes, should be ID + Node then */
}
}
else if(snode->texfrom==SNODE_TEX_WORLD) {
@@ -623,23 +627,20 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
}
else {
MTex *mtex= NULL;
+ Brush *brush= NULL;
- if(G.f & G_SCULPTMODE) {
- Sculpt *sd= scene->toolsettings->sculpt;
- if(sd && sd->brush)
- if(sd->brush->texact != -1)
- mtex= sd->brush->mtex[sd->brush->texact];
- }
- else {
- Brush *br= scene->toolsettings->imapaint.brush;
- if(br)
- mtex= br->mtex[br->texact];
- }
-
- if(mtex) {
- snode->from= (ID *)scene;
+ if(ob && (ob->mode & OB_MODE_SCULPT))
+ brush= paint_brush(&scene->toolsettings->sculpt->paint);
+ else
+ brush= paint_brush(&scene->toolsettings->imapaint.paint);
+
+ if(brush && brush->texact != -1)
+ mtex= brush->mtex[brush->texact];
+
+ snode->from= (ID *)brush;
+
+ if(mtex)
tx= mtex->tex;
- }
}
if(tx) {
@@ -1109,9 +1110,6 @@ static int node_resize_modal(bContext *C, wmOperator *op, wmEvent *event)
node->width= nsw->oldwidth + mx - nsw->mxstart;
CLAMP(node->width, node->typeinfo->minwidth, node->typeinfo->maxwidth);
}
- // XXX
- if(snode->nodetree->type == NTREE_TEXTURE)
- ntreeTexUpdatePreviews(snode->nodetree); /* XXX texture nodes should follow shader node methods (ton) */
ED_region_tag_redraw(ar);
@@ -1657,7 +1655,6 @@ bNode *node_add_node(SpaceNode *snode, Scene *scene, int type, float locx, float
if(snode->nodetree->type==NTREE_TEXTURE) {
ntreeTexCheckCyclics(snode->edittree);
- ntreeTexUpdatePreviews(snode->edittree); /* XXX texture nodes should follow shader node methods (ton) */
}
return node;
@@ -2270,34 +2267,6 @@ void node_read_fullsamplelayers(SpaceNode *snode)
WM_cursor_wait(0);
}
-/* called from header_info, when deleting a scene
- * goes over all scenes other than the input, checks if they have
- * render layer nodes referencing the to-be-deleted scene, and
- * resets them to NULL. */
-
-/* XXX needs to get current scene then! */
-void clear_scene_in_nodes(Scene *sce)
-{
- Scene *sce1;
- bNode *node;
-
- sce1= G.main->scene.first;
- while(sce1) {
- if(sce1!=sce) {
- if (sce1->nodetree) {
- for(node= sce1->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
- Scene *nodesce= (Scene *)node->id;
-
- if (nodesce==sce) node->id = NULL;
- }
- }
- }
- }
- sce1= sce1->id.next;
- }
-}
-
void imagepaint_composite_tags(bNodeTree *ntree, Image *image, ImageUser *iuser)
{
bNode *node;
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c
index 367242d1262..2abcd2f2135 100644
--- a/source/blender/editors/space_node/node_header.c
+++ b/source/blender/editors/space_node/node_header.c
@@ -45,6 +45,7 @@
#include "BKE_screen.h"
#include "BKE_node.h"
#include "BKE_main.h"
+#include "BKE_utildefines.h"
#include "ED_screen.h"
#include "ED_types.h"
@@ -62,67 +63,9 @@
#include "node_intern.h"
-/* ************************ header area region *********************** */
+/* ************************ add menu *********************** */
-static void do_node_selectmenu(bContext *C, void *arg, int event)
-{
- ScrArea *curarea= CTX_wm_area(C);
- SpaceNode *snode= CTX_wm_space_node(C);
-
- /* functions in editnode.c assume there's a tree */
- if(snode->nodetree==NULL)
- return;
-
- switch(event) {
- case 1: /* border select */
- WM_operator_name_call(C, "NODE_OT_select_border", WM_OP_INVOKE_REGION_WIN, NULL);
- break;
- case 2: /* select/deselect all */
- // XXX node_deselectall(snode, 1);
- break;
- case 3: /* select linked in */
- // XXX node_select_linked(snode, 0);
- break;
- case 4: /* select linked out */
- // XXX node_select_linked(snode, 1);
- break;
- }
-
- ED_area_tag_redraw(curarea);
-}
-
-static uiBlock *node_selectmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *curarea= CTX_wm_area(C);
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "node_selectmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked From|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked To|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- uiEndBlock(C, block);
-
- return block;
-}
-
-void do_node_addmenu(bContext *C, void *arg, int event)
+static void do_node_add(bContext *C, void *arg, int event)
{
SpaceNode *snode= CTX_wm_space_node(C);
bNode *node;
@@ -141,311 +84,125 @@ void do_node_addmenu(bContext *C, void *arg, int event)
snode_handle_recalc(C, snode);
}
-static void node_make_addmenu(bContext *C, int nodeclass, uiBlock *block)
+static void node_auto_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
{
Main *bmain= CTX_data_main(C);
SpaceNode *snode= CTX_wm_space_node(C);
bNodeTree *ntree;
+ int nodeclass= GET_INT_FROM_POINTER(arg_nodeclass);
int tot= 0, a;
- short yco= 0, menuwidth=120;
ntree = snode->nodetree;
- if(ntree) {
- /* mostly taken from toolbox.c, node_add_sublevel() */
- if(ntree) {
- if(nodeclass==NODE_CLASS_GROUP) {
- bNodeTree *ngroup= bmain->nodetree.first;
- for(; ngroup; ngroup= ngroup->id.next)
- if(ngroup->type==ntree->type)
- tot++;
- }
- else {
- bNodeType *type = ntree->alltypes.first;
- while(type) {
- if(type->nclass == nodeclass)
- tot++;
- type= type->next;
- }
- }
- }
-
- if(tot==0) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- return;
+
+ if(!ntree) {
+ uiItemS(layout);
+ return;
+ }
+
+ /* mostly taken from toolbox.c, node_add_sublevel() */
+ if(nodeclass==NODE_CLASS_GROUP) {
+ bNodeTree *ngroup= bmain->nodetree.first;
+ for(; ngroup; ngroup= ngroup->id.next)
+ if(ngroup->type==ntree->type)
+ tot++;
+ }
+ else {
+ bNodeType *type = ntree->alltypes.first;
+ while(type) {
+ if(type->nclass == nodeclass)
+ tot++;
+ type= type->next;
}
-
- if(nodeclass==NODE_CLASS_GROUP) {
- bNodeTree *ngroup= bmain->nodetree.first;
- for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) {
- if(ngroup->type==ntree->type) {
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, (ngroup->id.name+2), 0,
- yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1.0f, (float)(NODE_GROUP_MENU+tot), "");
- a++;
- }
+ }
+
+ if(tot==0) {
+ uiItemS(layout);
+ return;
+ }
+
+ uiLayoutSetFunc(layout, do_node_add, NULL);
+
+ if(nodeclass==NODE_CLASS_GROUP) {
+ bNodeTree *ngroup= bmain->nodetree.first;
+
+ for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) {
+ if(ngroup->type==ntree->type) {
+ uiItemV(layout, ngroup->id.name+2, 0, NODE_GROUP_MENU+tot);
+ a++;
}
}
- else {
- bNodeType *type;
- int script=0;
- for(a=0, type= ntree->alltypes.first; type; type=type->next) {
- if( type->nclass == nodeclass && type->name) {
- if(type->type == NODE_DYNAMIC) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0,
- yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1.0f, (float)(NODE_DYNAMIC_MENU+script), "");
- script++;
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0,
- yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1.0f, (float)(type->type), "");
- }
- a++;
+ }
+ else {
+ bNodeType *type;
+ int script=0;
+
+ for(a=0, type= ntree->alltypes.first; type; type=type->next) {
+ if(type->nclass == nodeclass && type->name) {
+ if(type->type == NODE_DYNAMIC) {
+ uiItemV(layout, type->name, 0, NODE_DYNAMIC_MENU+script);
+ script++;
}
+ else
+ uiItemV(layout, type->name, 0, type->type);
+
+ a++;
}
}
- } else {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- return;
}
}
-static uiBlock *node_add_inputmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_inputmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_INPUT, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_outputmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_outputmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_OUTPUT, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_colormenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_colormenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_OP_COLOR, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_vectormenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_vectormenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_OP_VECTOR, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_filtermenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_filtermenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_OP_FILTER, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_convertermenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_convertermenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_CONVERTOR, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_mattemenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_mattemenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_MATTE, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_distortmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_distortmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_DISTORT, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_patternmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_patternmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_PATTERN, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_texturemenu(bContext *C, ARegion *ar, void *arg_unused)
+static void node_menu_add(const bContext *C, Menu *menu)
{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_texturemenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_TEXTURE, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
-static uiBlock *node_add_groupmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_groupmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_GROUP, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
+ uiLayout *layout= menu->layout;
+ SpaceNode *snode= CTX_wm_space_node(C);
-static uiBlock *node_add_dynamicmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-
- block= uiBeginBlock(C, ar, "node_add_dynamicmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(C, NODE_CLASS_OP_DYNAMIC, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- uiEndBlock(C, block);
-
- return block;
-}
+ if(!snode->nodetree)
+ uiLayoutSetActive(layout, 0);
-static uiBlock *node_addmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *curarea= CTX_wm_area(C);
- SpaceNode *snode= CTX_wm_space_node(C);
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "node_addmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
if(snode->treetype==NTREE_SHADER) {
- uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_dynamicmenu, NULL, ICON_RIGHTARROW_THIN, "Dynamic", 0, yco-=20, 120, 19, "");
+ uiItemMenuF(layout, "Input", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+ uiItemMenuF(layout, "Output", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+ uiItemMenuF(layout, "Color", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+ uiItemMenuF(layout, "Vector", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
+ uiItemMenuF(layout, "Convertor", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+ uiItemMenuF(layout, "Group", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
+ uiItemMenuF(layout, "Dynamic", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
}
else if(snode->treetype==NTREE_COMPOSIT) {
- uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_filtermenu, NULL, ICON_RIGHTARROW_THIN, "Filter", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_mattemenu, NULL, ICON_RIGHTARROW_THIN, "Matte", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
-
- } else if(snode->treetype==NTREE_TEXTURE) {
- uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_patternmenu, NULL, ICON_RIGHTARROW_THIN, "Patterns", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_texturemenu, NULL, ICON_RIGHTARROW_THIN, "Textures", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
+ uiItemMenuF(layout, "Input", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+ uiItemMenuF(layout, "Output", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+ uiItemMenuF(layout, "Color", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+ uiItemMenuF(layout, "Vector", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
+ uiItemMenuF(layout, "Filter", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER));
+ uiItemMenuF(layout, "Convertor", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+ uiItemMenuF(layout, "Matte", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE));
+ uiItemMenuF(layout, "Distort", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
+ uiItemMenuF(layout, "Group", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
}
- else
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
+ else if(snode->treetype==NTREE_TEXTURE) {
+ uiItemMenuF(layout, "Input", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+ uiItemMenuF(layout, "Output", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+ uiItemMenuF(layout, "Color", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+ uiItemMenuF(layout, "Patterns", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN));
+ uiItemMenuF(layout, "Textures", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
+ uiItemMenuF(layout, "Convertor", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+ uiItemMenuF(layout, "Distort", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
+ uiItemMenuF(layout, "Group", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
}
-
- uiTextBoundsBlock(block, 50);
-
- return block;
}
+void node_menus_register(ARegionType *art)
+{
+ MenuType *mt;
+
+ mt= MEM_callocN(sizeof(MenuType), "spacetype node menu add");
+ strcpy(mt->idname, "NODE_MT_add");
+ strcpy(mt->label, "Add");
+ mt->draw= node_menu_add;
+ BLI_addtail(&art->menutypes, mt);
+}
+
+#if 0
static void do_node_nodemenu(bContext *C, void *arg, int event)
{
ScrArea *curarea= CTX_wm_area(C);
@@ -571,218 +328,5 @@ static uiBlock *node_nodemenu(bContext *C, ARegion *ar, void *arg_unused)
return block;
}
-
-static void do_node_viewmenu(bContext *C, void *arg, int event)
-{
-// SpaceNode *snode= CTX_wm_space_node(C);
-// ARegion *ar= CTX_wm_region(C);
- ScrArea *sa= CTX_wm_area(C);
-
- switch(event) {
- case 1: /* Zoom in */
- WM_operator_name_call(C, "VIEW2D_OT_zoom_in", WM_OP_EXEC_REGION_WIN, NULL);
- break;
- case 2: /* View all */
- WM_operator_name_call(C, "VIEW2D_OT_zoom_out", WM_OP_EXEC_REGION_WIN, NULL);
- break;
- case 3: /* View all */
- WM_operator_name_call(C, "NODE_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL);
- break;
- case 4: /* Grease Pencil */
- // XXX add_blockhandler(sa, NODES_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
- break;
- }
- ED_area_tag_redraw(sa);
-}
-
-static uiBlock *node_viewmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *curarea= CTX_wm_area(C);
- SpaceNode *snode= CTX_wm_space_node(C);
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "node_viewmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_node_viewmenu, NULL);
-
- if (snode->nodetree) {
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- /* XXX if (!curarea->full)
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- */
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- uiEndBlock(C, block);
-
- return block;
-}
-
-static void do_node_buttons(bContext *C, void *arg, int event)
-{
- // NODE_FIX_ME : instead of using "current material/texture/scene", node editor can also pin context?
- // note: scene context better not gets overridden, that'll clash too much (ton)
- SpaceNode *snode= CTX_wm_space_node(C);
- Scene *scene= CTX_data_scene(C);
- Material *ma;
- Tex *tx;
-
- switch(event) {
- case B_REDR:
- ED_area_tag_redraw(CTX_wm_area(C));
- break;
- case B_NODE_USEMAT:
- ma= (Material *)snode->id;
- if(ma) {
- if(ma->use_nodes && ma->nodetree==NULL) {
- node_shader_default(ma);
- snode_set_context(snode, scene);
- }
- }
- ED_area_tag_redraw(CTX_wm_area(C));
- break;
-
- case B_NODE_USESCENE:
- if(scene->use_nodes) {
- if(scene->nodetree==NULL)
- node_composit_default(scene);
- }
- snode_set_context(snode, scene);
- ED_area_tag_redraw(CTX_wm_area(C));
- break;
-
- case B_NODE_USETEX:
- tx = (Tex *)snode->id;
- if(tx) {
- tx->type = 0;
- if(tx->use_nodes && tx->nodetree==NULL) {
- node_texture_default(tx);
- snode_set_context(snode, scene);
- }
- }
- ED_area_tag_redraw(CTX_wm_area(C));
- break;
- }
-}
-
-void node_header_buttons(const bContext *C, ARegion *ar)
-{
- ScrArea *sa= CTX_wm_area(C);
- SpaceNode *snode= CTX_wm_space_node(C);
- Scene *scene= CTX_data_scene(C);
- uiBlock *block;
- short xco, yco= 3;
-
- block= uiBeginBlock(C, ar, "header node", UI_EMBOSS);
- uiBlockSetHandleFunc(block, do_node_buttons, NULL);
-
- xco= ED_area_header_standardbuttons(C, block, yco);
-
- if((sa->flag & HEADER_NO_PULLDOWN)==0) {
- int xmax;
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, node_viewmenu, NULL,
- "View", xco, yco, xmax-3, 20, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, node_selectmenu, NULL,
- "Select", xco, yco, xmax-3, 20, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Add");
- uiDefPulldownBut(block, node_addmenu, NULL,
- "Add", xco, yco, xmax-3, 20, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Node");
- uiDefPulldownBut(block, node_nodemenu, NULL,
- "Node", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- /* main type choosing */
- uiBlockBeginAlign(block);
- uiDefIconButI(block, ROW, B_REDR, ICON_MATERIAL_DATA, xco,yco,XIC,YIC-2,
- &(snode->treetype), 2.0f, 0.0f, 0.0f, 0.0f, "Material Nodes");
- xco+= XIC;
- uiDefIconButI(block, ROW, B_REDR, ICON_IMAGE_DATA, xco,yco,XIC,YIC-2,
- &(snode->treetype), 2.0f, 1.0f, 0.0f, 0.0f, "Composite Nodes");
- xco+= XIC;
- uiDefIconButI(block, ROW, B_REDR, ICON_TEXTURE_DATA, xco,yco,XIC,YIC-2,
- &(snode->treetype), 2.0f, 2.0f, 0.0f, 0.0f, "Texture Nodes");
- xco+= 2*XIC;
- uiBlockEndAlign(block);
-
- /* find and set the context */
- snode_set_context(snode, scene);
-
- if(snode->treetype==NTREE_SHADER) {
- if(snode->from) {
- /* 0, NULL -> pin */
- // XXX xco= std_libbuttons(block, xco, 0, 0, NULL, B_MATBROWSE, ID_MA, 1, snode->id, snode->from, &(snode->menunr),
- // B_MATALONE, B_MATLOCAL, B_MATDELETE, B_AUTOMATNAME, B_KEEPDATA);
-
- if(snode->id) {
- Material *ma= (Material *)snode->id;
- uiDefButC(block, TOG, B_NODE_USEMAT, "Use Nodes", xco+5,yco,90,19, &ma->use_nodes, 0.0f, 0.0f, 0, 0, "");
- xco+=80;
- }
- }
- }
- else if(snode->treetype==NTREE_COMPOSIT) {
- int icon;
-
- if(WM_jobs_test(CTX_wm_manager(C), sa)) icon= ICON_REC; else icon= ICON_BLANK1;
- uiDefIconTextButS(block, TOG, B_NODE_USESCENE, icon, "Use Nodes", xco+5,yco,100,19, &scene->use_nodes, 0.0f, 0.0f, 0, 0, "Indicate this Scene will use Nodes and execute them while editing");
- xco+= 100;
- uiDefButBitI(block, TOG, R_COMP_FREE, B_NOP, "Free Unused", xco+5,yco,100,19, &scene->r.scemode, 0.0f, 0.0f, 0, 0, "Free Nodes that are not used while composite");
- xco+= 100;
- uiDefButBitS(block, TOG, SNODE_BACKDRAW, B_REDR, "Backdrop", xco+5,yco,90,19, &snode->flag, 0.0f, 0.0f, 0, 0, "Use active Viewer Node output as backdrop");
- xco+= 90;
- }
- else if(snode->treetype==NTREE_TEXTURE) {
- if(snode->from) {
-
- // XXX xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXBROWSE, ID_TE, 1, snode->id, snode->from, &(snode->menunr),
- // B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
-
- if(snode->id) {
- Tex *tx= (Tex *)snode->id;
- uiDefButC(block, TOG, B_NODE_USETEX, "Use Nodes", xco+5,yco,90,19, &tx->use_nodes, 0.0f, 0.0f, 0, 0, "");
- xco+=80;
- }
- }
- }
-
- UI_view2d_totRect_set(&ar->v2d, xco+XIC+100, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin));
-
- uiEndBlock(C, block);
- uiDrawBlock(C, block);
-}
-
+#endif
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index d6680457376..5c66c902797 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -31,6 +31,7 @@
/* internal exports only */
struct ARegion;
+struct ARegionType;
struct View2D;
struct bContext;
struct wmWindowManager;
@@ -45,6 +46,7 @@ struct wmWindowManager;
/* node_header.c */
void node_header_buttons(const bContext *C, ARegion *ar);
+void node_menus_register(struct ARegionType *art);
/* node_draw.c */
void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d);
@@ -75,9 +77,6 @@ void snode_make_group_editable(SpaceNode *snode, bNode *gnode);
void snode_home(ScrArea *sa, ARegion *ar, SpaceNode *snode);
void node_set_active(SpaceNode *snode, bNode *node);
void node_deselectall(SpaceNode *snode, int swap);
-void node_shader_default(Material *ma);
-void node_composit_default(Scene *sce);
-void node_texture_default(Tex *tx);
void snode_composite_job(const struct bContext *C, ScrArea *sa);
bNode *snode_get_editgroup(SpaceNode *snode);
void snode_autoconnect(SpaceNode *snode, bNode *node_to, int flag);
diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c
index 8d805490942..dcab3dc0895 100644
--- a/source/blender/editors/space_node/node_state.c
+++ b/source/blender/editors/space_node/node_state.c
@@ -183,7 +183,7 @@ void NODE_OT_visibility_toggle(wmOperatorType *ot)
RNA_def_int(ot->srna, "mouse_y", 0, INT_MIN, INT_MAX, "Mouse Y", "", INT_MIN, INT_MAX);
}
-static int node_fit_all_exec(bContext *C, wmOperator *op)
+static int node_view_all_exec(bContext *C, wmOperator *op)
{
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
@@ -196,11 +196,11 @@ static int node_fit_all_exec(bContext *C, wmOperator *op)
void NODE_OT_view_all(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Fit All";
+ ot->name= "View All";
ot->idname= "NODE_OT_view_all";
/* api callbacks */
- ot->exec= node_fit_all_exec;
+ ot->exec= node_view_all_exec;
ot->poll= ED_operator_node_active;
/* flags */
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 25e1b368ccb..2233a4db3a0 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -46,6 +46,7 @@
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_screen.h"
+#include "BKE_node.h"
#include "ED_previewrender.h"
#include "ED_space_api.h"
@@ -152,12 +153,16 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
if(wmn->data==ND_FILEREAD)
ED_area_tag_refresh(sa);
break;
-
+
+ /* future: add ID checks? */
case NC_MATERIAL:
- /* future: add ID check? */
if(wmn->data==ND_SHADING)
ED_area_tag_refresh(sa);
break;
+ case NC_TEXTURE:
+ if(wmn->data==ND_NODES)
+ ED_area_tag_refresh(sa);
+ break;
}
}
@@ -170,13 +175,19 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa)
if(snode->treetype==NTREE_SHADER) {
Material *ma= (Material *)snode->id;
if(ma->use_nodes)
- ED_preview_shader_job(C, sa, snode->id, NULL, 100, 100);
+ ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100);
}
else if(snode->treetype==NTREE_COMPOSIT) {
Scene *scene= (Scene *)snode->id;
if(scene->use_nodes)
snode_composite_job(C, sa);
}
+ else if(snode->treetype==NTREE_TEXTURE) {
+ Tex *tex= (Tex *)snode->id;
+ if(tex->use_nodes) {
+ ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100);
+ }
+ }
}
}
@@ -244,29 +255,18 @@ static void node_main_area_draw(const bContext *C, ARegion *ar)
/* add handlers, stuff you only do once or on area/region changes */
static void node_header_area_init(wmWindowManager *wm, ARegion *ar)
{
- UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
+ ED_region_header_init(ar);
}
static void node_header_area_draw(const bContext *C, ARegion *ar)
{
- float col[3];
-
- /* clear */
- if(ED_screen_area_active(C))
- UI_GetThemeColor3fv(TH_HEADER, col);
- else
- UI_GetThemeColor3fv(TH_HEADERDESEL, col);
-
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- /* set view2d view matrix for scrolling (without scrollers) */
- UI_view2d_view_ortho(C, &ar->v2d);
-
- node_header_buttons(C, ar);
-
- /* restore view matrix? */
- UI_view2d_view_restore(C);
+ SpaceNode *snode= CTX_wm_space_node(C);
+ Scene *scene= CTX_data_scene(C);
+
+ /* find and set the context */
+ snode_set_context(snode, scene);
+
+ ED_region_header(C, ar);
}
/* used for header + main area */
@@ -275,9 +275,9 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
/* context changes */
switch(wmn->category) {
case NC_SCENE:
- ED_region_tag_redraw(ar);
- break;
case NC_MATERIAL:
+ case NC_TEXTURE:
+ case NC_NODE:
ED_region_tag_redraw(ar);
break;
}
@@ -344,6 +344,8 @@ void ED_spacetype_node(void)
art->draw= node_header_area_draw;
BLI_addhead(&st->regiontypes, art);
+
+ node_menus_register(art);
#if 0
/* regions: channels */
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 84dea679767..a9a9a5dab5f 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -620,7 +620,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
tenla->name= "Pose";
- if(arm->edbo==NULL && (ob->flag & OB_POSEMODE)) { // channels undefined in editmode, but we want the 'tenla' pose icon itself
+ if(arm->edbo==NULL && (ob->mode & OB_MODE_POSE)) { // channels undefined in editmode, but we want the 'tenla' pose icon itself
int a= 0, const_index= 1000; /* ensure unique id for bone constraints */
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) {
@@ -887,7 +887,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
else {
/* do not extend Armature when we have posemode */
tselem= TREESTORE(te->parent);
- if( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->flag & OB_POSEMODE);
+ if( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->mode & OB_MODE_POSE);
else {
Bone *curBone;
for (curBone=arm->bonebase.first; curBone; curBone=curBone->next){
@@ -1016,7 +1016,6 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
PointerRNA pptr, propptr, *ptr= (PointerRNA*)idv;
PropertyRNA *prop, *iterprop;
PropertyType proptype;
- PropertySubType propsubtype;
int a, tot;
/* we do lazy build, for speed and to avoid infinite recusion */
@@ -1085,7 +1084,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
te->flag |= TE_LAZY_CLOSED;
}
else if(ELEM3(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
- tot= RNA_property_array_length(prop);
+ tot= RNA_property_array_length(ptr, prop);
if(!(tselem->flag & TSE_CLOSED)) {
for(a=0; a<tot; a++)
@@ -1096,31 +1095,20 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
}
}
else if(type == TSE_RNA_ARRAY_ELEM) {
- /* array property element */
- static char *vectoritem[4]= {" x", " y", " z", " w"};
- static char *quatitem[4]= {" w", " x", " y", " z"};
- static char *coloritem[4]= {" r", " g", " b", " a"};
+ char c;
prop= parent->directdata;
- proptype= RNA_property_type(prop);
- propsubtype= RNA_property_subtype(prop);
- tot= RNA_property_array_length(prop);
te->directdata= prop;
te->rnaptr= *ptr;
te->index= index;
- if(tot == 4 && propsubtype == PROP_ROTATION)
- te->name= quatitem[index];
- else if(tot <= 4 && (propsubtype == PROP_VECTOR || propsubtype == PROP_ROTATION))
- te->name= vectoritem[index];
- else if(tot <= 4 && propsubtype == PROP_COLOR)
- te->name= coloritem[index];
- else {
- te->name= MEM_callocN(sizeof(char)*20, "OutlinerRNAArrayName");
- sprintf(te->name, " %d", index+1);
- te->flag |= TE_FREE_NAME;
- }
+ c= RNA_property_array_item_char(prop, index);
+
+ te->name= MEM_callocN(sizeof(char)*20, "OutlinerRNAArrayName");
+ if(c) sprintf(te->name, " %c", c);
+ else sprintf(te->name, " %d", index+1);
+ te->flag |= TE_FREE_NAME;
}
}
else if(type == TSE_KEYMAP) {
@@ -2132,9 +2120,7 @@ static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te,
{
if(set) {
Object *ob= (Object *)tselem->id;
- ParticleSystem *psys= te->directdata;
- PE_change_act_psys(scene, ob, psys);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob);
// XXX extern_set_butspace(F7KEY, 0);
@@ -2189,13 +2175,13 @@ static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *te,
if(scene->obedit)
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- if(ob->flag & OB_POSEMODE)
+ if(ob->mode & OB_MODE_POSE)
ED_armature_exit_posemode(C, base);
else
ED_armature_enter_posemode(C, base);
}
else {
- if(ob->flag & OB_POSEMODE) return 1;
+ if(ob->mode & OB_MODE_POSE) return 1;
}
return 0;
}
@@ -3073,10 +3059,6 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
if(scene->obedit==base->object)
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- if(base==BASACT) {
- ED_view3d_exit_paint_modes(C);
- }
-
ED_base_object_free_and_unlink(scene, base);
te->directdata= NULL;
tselem->id= NULL;
@@ -3250,7 +3232,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
SpaceOops *soops= CTX_wm_space_outliner(C);
int event;
- char *str;
+ char *str= NULL;
/* check for invalid states */
if (soops == NULL)
@@ -3674,7 +3656,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
}
else if(RNA_property_type(prop) == PROP_COLLECTION) {
char buf[128], *name;
-
+
temnext= (TreeElement*)(ld->next->data);
tsenext= TREESTORE(temnext);
@@ -3737,7 +3719,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
/* item is part of an array, so must set the array_index */
*array_index= te->index;
}
- else if (RNA_property_array_length(prop)) {
+ else if (RNA_property_array_length(ptr, prop)) {
/* entire array was selected, so keyframe all */
*flag |= KSP_FLAG_WHOLE_ARRAY;
}
@@ -3917,7 +3899,7 @@ static KeyingSet *verify_active_keyingset(Scene *scene, short add)
/* add if none found */
// XXX the default settings have yet to evolve
if ((add) && (ks==NULL)) {
- ks= BKE_keyingset_add(&scene->keyingsets, "Keying Set", KEYINGSET_ABSOLUTE, 0);
+ ks= BKE_keyingset_add(&scene->keyingsets, NULL, KEYINGSET_ABSOLUTE, 0);
scene->active_keyingset= BLI_countlist(&scene->keyingsets);
}
@@ -3942,7 +3924,7 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
short groupmode= KSP_GROUP_KSNAME;
/* check if RNA-property described by this selected element is an animateable prop */
- if ((tselem->type == TSE_RNA_PROPERTY) && RNA_property_animateable(&te->rnaptr, te->directdata)) {
+ if (ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM) && RNA_property_animateable(&te->rnaptr, te->directdata)) {
/* get id + path + index info from the selected element */
tree_element_to_path(soops, te, tselem,
&id, &path, &array_index, &flag, &groupmode);
@@ -3979,8 +3961,6 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
/* free path, since it had to be generated */
MEM_freeN(path);
}
-
-
}
/* go over sub-tree */
@@ -4178,13 +4158,13 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen
case TSE_POSEGRP_BASE:
UI_icon_draw(x, y, ICON_VERTEXSEL); break;
case TSE_SEQUENCE:
- if((te->idcode==SEQ_MOVIE) || (te->idcode==SEQ_MOVIE_AND_HD_SOUND))
+ if(te->idcode==SEQ_MOVIE)
UI_icon_draw(x, y, ICON_SEQUENCE);
else if(te->idcode==SEQ_META)
UI_icon_draw(x, y, ICON_DOT);
else if(te->idcode==SEQ_SCENE)
UI_icon_draw(x, y, ICON_SCENE);
- else if((te->idcode==SEQ_RAM_SOUND) || (te->idcode==SEQ_HD_SOUND))
+ else if(te->idcode==SEQ_SOUND)
UI_icon_draw(x, y, ICON_SOUND);
else if(te->idcode==SEQ_IMAGE)
UI_icon_draw(x, y, ICON_IMAGE_COL);
@@ -5097,6 +5077,28 @@ static char *keymap_tweak_menu(void)
return string;
}
+static char *keymap_tweak_dir_menu(void)
+{
+ static char string[500];
+ static char formatstr[] = "|%s %%x%d";
+ char *str= string;
+
+ str += sprintf(str, "Tweak Direction %%t");
+
+ str += sprintf(str, formatstr, "Any", KM_ANY);
+ str += sprintf(str, formatstr, "North", EVT_GESTURE_N);
+ str += sprintf(str, formatstr, "North-East", EVT_GESTURE_NE);
+ str += sprintf(str, formatstr, "East", EVT_GESTURE_E);
+ str += sprintf(str, formatstr, "Sout-East", EVT_GESTURE_SE);
+ str += sprintf(str, formatstr, "South", EVT_GESTURE_S);
+ str += sprintf(str, formatstr, "South-West", EVT_GESTURE_SW);
+ str += sprintf(str, formatstr, "West", EVT_GESTURE_W);
+ str += sprintf(str, formatstr, "North-West", EVT_GESTURE_NW);
+
+ return string;
+}
+
+
static void keymap_type_cb(bContext *C, void *kmi_v, void *unused_v)
{
wmKeymapItem *kmi= kmi_v;
@@ -5174,17 +5176,20 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
str= keymap_tweak_menu();
uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, OL_H-1, &kmi->type, 0, 0, 0, 0, "Tweak gesture");
xstart+= butw2+5;
+ str= keymap_tweak_dir_menu();
+ uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, OL_H-1, &kmi->val, 0, 0, 0, 0, "Tweak gesture direction");
+ xstart+= butw2+5;
break;
}
/* modifiers */
- uiBlockBeginAlign(block);
uiDefButS(block, OPTION, 0, "Shift", xstart, (int)te->ys+1, butw3+5, OL_H-1, &kmi->shift, 0, 0, 0, 0, "Modifier"); xstart+= butw3+5;
uiDefButS(block, OPTION, 0, "Ctrl", xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->ctrl, 0, 0, 0, 0, "Modifier"); xstart+= butw3;
uiDefButS(block, OPTION, 0, "Alt", xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->alt, 0, 0, 0, 0, "Modifier"); xstart+= butw3;
uiDefButS(block, OPTION, 0, "Cmd", xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->oskey, 0, 0, 0, 0, "Modifier"); xstart+= butw3;
xstart+= 5;
- uiBlockEndAlign(block);
+ uiDefKeyevtButS(block, 0, "", xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->keymodifier, "Key Modifier code");
+ xstart+= butw3+5;
/* rna property */
if(kmi->ptr && kmi->ptr->data)
@@ -5267,7 +5272,10 @@ void draw_outliner(const bContext *C)
sizex_rna= MAX2(OL_RNA_COLX, sizex_rna+OL_RNA_COL_SPACEX);
/* get width of data (for setting 'tot' rect, this is column 1 + column 2 + a bit extra) */
- sizex= sizex_rna + OL_RNA_COL_SIZEX + 50;
+ if (soops->outlinevis == SO_KEYMAP)
+ sizex= sizex_rna + OL_RNA_COL_SIZEX*3 + 50; // XXX this is only really a quick hack to make this wide enough...
+ else
+ sizex= sizex_rna + OL_RNA_COL_SIZEX + 50;
}
else {
/* width must take into account restriction columns (if visible) so that entries will still be visible */
@@ -5280,6 +5288,9 @@ void draw_outliner(const bContext *C)
sizex += OL_TOGW*3;
}
+ /* tweak to display last line (when list bigger than window) */
+ sizey += V2D_SCROLL_HEIGHT;
+
/* update size of tot-rect (extents of data/viewable area) */
UI_view2d_totRect_set(v2d, sizex, sizey);
diff --git a/source/blender/editors/space_outliner/outliner_header.c b/source/blender/editors/space_outliner/outliner_header.c
index 0c7859ed4e2..d4eeaabd1d3 100644
--- a/source/blender/editors/space_outliner/outliner_header.c
+++ b/source/blender/editors/space_outliner/outliner_header.c
@@ -177,7 +177,7 @@ static void do_outliner_buttons(bContext *C, void *arg, int event)
/* add a new KeyingSet if active is -1 */
if (scene->active_keyingset == -1) {
// XXX the default settings have yet to evolve... need to keep this in sync with the
- BKE_keyingset_add(&scene->keyingsets, "KeyingSet", KEYINGSET_ABSOLUTE, 0);
+ BKE_keyingset_add(&scene->keyingsets, NULL, KEYINGSET_ABSOLUTE, 0);
scene->active_keyingset= BLI_countlist(&scene->keyingsets);
}
@@ -196,6 +196,8 @@ static void do_outliner_buttons(bContext *C, void *arg, int event)
BLI_freelinkN(&scene->keyingsets, ks);
scene->active_keyingset= 0;
}
+ else
+ scene->active_keyingset= 0;
}
/* redraw regions with KeyingSet info */
diff --git a/source/blender/editors/space_sequencer/Makefile b/source/blender/editors/space_sequencer/Makefile
index 7be0bc9cfef..2fb3de516b4 100644
--- a/source/blender/editors/space_sequencer/Makefile
+++ b/source/blender/editors/space_sequencer/Makefile
@@ -50,6 +50,7 @@ CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../python
CPPFLAGS += -I../../blenfont
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I$(NAN_AUDASPACE)/include
# own include
diff --git a/source/blender/editors/space_sequencer/SConscript b/source/blender/editors/space_sequencer/SConscript
index ab51068a529..7a3fb6982ef 100644
--- a/source/blender/editors/space_sequencer/SConscript
+++ b/source/blender/editors/space_sequencer/SConscript
@@ -6,5 +6,6 @@ sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../blenfont ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../makesrna'
+incs += ' #/intern/audaspace/intern'
env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), [], libtype=['core'], priority=[100] )
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 4a300b7390d..e6d50976957 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -89,6 +89,9 @@
#include "UI_resources.h"
#include "UI_view2d.h"
+#include "BKE_sound.h"
+#include "AUD_C-API.h"
+
/* own include */
#include "sequencer_intern.h"
@@ -224,24 +227,80 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
RNA_def_string(ot->srna, "scene", "", MAX_ID_NAME-2, "Scene Name", "Scene name to add as a strip");
}
+static Sequence* sequencer_add_sound_strip(bContext *C, wmOperator *op, int start_frame, int channel, char* filename)
+{
+ Scene *scene= CTX_data_scene(C);
+ Editing *ed= seq_give_editing(scene, TRUE);
+
+ bSound *sound;
+
+ Sequence *seq; /* generic strip vars */
+ Strip *strip;
+ StripElem *se;
+
+ AUD_SoundInfo info;
+
+ sound = sound_new_file(CTX_data_main(C), filename);
+
+ if (sound==NULL || sound->handle == NULL) {
+ if(op)
+ BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
+ return NULL;
+ }
+
+ info = AUD_getInfo(sound->handle);
+
+ if (info.specs.format == AUD_FORMAT_INVALID) {
+ sound_delete(C, sound);
+ if(op)
+ BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
+ return NULL;
+ }
+
+ seq = alloc_sequence(ed->seqbasep, start_frame, channel);
+
+ seq->type= SEQ_SOUND;
+ seq->sound= sound;
+
+ /* basic defaults */
+ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
+ strip->len = seq->len = (int) (info.length * FPS);
+ strip->us= 1;
+
+ strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+
+ BLI_split_dirfile_basic(filename, strip->dir, se->name);
+
+ seq->sound_handle = sound_new_handle(scene, sound, start_frame, start_frame + strip->len, 0);
+
+ calc_sequence_disp(seq);
+ sort_seq(scene);
+
+ /* last active name */
+ strncpy(ed->act_sounddir, strip->dir, FILE_MAXDIR-1);
+
+ return seq;
+}
+
/* add movie operator */
static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Editing *ed= seq_give_editing(scene, TRUE);
-
+
struct anim *an;
char filename[FILE_MAX];
- Sequence *seq; /* generic strip vars */
+ Sequence *seq, *soundseq=NULL; /* generic strip vars */
Strip *strip;
StripElem *se;
-
- int start_frame, channel; /* operator props */
-
+
+ int start_frame, channel, sound; /* operator props */
+
start_frame= RNA_int_get(op->ptr, "start_frame");
channel= RNA_int_get(op->ptr, "channel");
-
+ sound = RNA_boolean_get(op->ptr, "sound");
+
RNA_string_get(op->ptr, "filename", filename);
an = openanim(filename, IB_rect);
@@ -271,10 +330,19 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
calc_sequence_disp(seq);
sort_seq(scene);
+ if(sound)
+ {
+ soundseq = sequencer_add_sound_strip(C, NULL, start_frame, channel+1, filename);
+ if(soundseq != NULL)
+ RNA_string_get(op->ptr, "name", soundseq->name);
+ }
+
if (RNA_boolean_get(op->ptr, "replace_sel")) {
deselect_all_seq(scene);
set_last_seq(scene, seq);
seq->flag |= SELECT;
+ if(soundseq)
+ soundseq->flag |= SELECT;
}
ED_area_tag_redraw(CTX_wm_area(C));
@@ -310,24 +378,15 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
- RNA_def_boolean(ot->srna, "sound", FALSE, "Sound", "Load hd sound with the movie"); // XXX need to impliment this
+ RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie");
}
-
/* add sound operator */
static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- Editing *ed= seq_give_editing(scene, TRUE);
-
- bSound *sound;
-
char filename[FILE_MAX];
-
+ Scene *scene= CTX_data_scene(C);
Sequence *seq; /* generic strip vars */
- Strip *strip;
- StripElem *se;
-
int start_frame, channel; /* operator props */
start_frame= RNA_int_get(op->ptr, "start_frame");
@@ -335,47 +394,16 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filename", filename);
- /* XXX if(sfile->flag & FILE_STRINGCODE) {
- BLI_makestringcode(G.sce, str);
- }*/
-
-// XXX sound= sound_new_sound(filename);
- sound= NULL;
-
- if (sound==NULL || sound->sample->type == SAMPLE_INVALID) {
- BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
- return OPERATOR_CANCELLED;
- }
+ seq = sequencer_add_sound_strip(C, op, start_frame, channel, filename);
- if (sound==NULL || sound->sample->bits != 16) {
- BKE_report(op->reports, RPT_ERROR, "Only 16 bit audio is supported");
+ if(seq == NULL)
return OPERATOR_CANCELLED;
- }
-
- sound->flags |= SOUND_FLAGS_SEQUENCE;
-// XXX audio_makestream(sound);
-
- seq = alloc_sequence(ed->seqbasep, start_frame, channel);
-
- seq->type= SEQ_RAM_SOUND;
- seq->sound= sound;
-
- /* basic defaults */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len = seq->len = (int) ( ((float)(sound->streamlen-1) / ( (float)scene->r.audio.mixrate*4.0 ))* FPS);
- strip->us= 1;
-
- strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
-
- BLI_split_dirfile_basic(filename, strip->dir, se->name);
RNA_string_get(op->ptr, "name", seq->name);
-
- calc_sequence_disp(seq);
- sort_seq(scene);
-
- /* last active name */
- strncpy(ed->act_sounddir, strip->dir, FILE_MAXDIR-1);
+
+ if (RNA_boolean_get(op->ptr, "cache")) {
+ sound_cache(seq->sound, 0);
+ }
if (RNA_boolean_get(op->ptr, "replace_sel")) {
deselect_all_seq(scene);
@@ -416,7 +444,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot)
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
- RNA_def_boolean(ot->srna, "hd", FALSE, "HD Sound", "Load the sound as streaming audio"); // XXX need to impliment this
+ RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
}
/* add image operator */
@@ -585,7 +613,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
if(seq->plugin==NULL) {
BLI_remlink(ed->seqbasep, seq);
- seq_free_sequence(ed, seq);
+ seq_free_sequence(scene, seq);
BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load.", filename);
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 3b90039335e..76bed3772b1 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -173,8 +173,7 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, char *col)
case SEQ_PLUGIN:
UI_GetThemeColor3ubv(TH_SEQ_PLUGIN, col);
break;
- case SEQ_HD_SOUND:
- case SEQ_RAM_SOUND:
+ case SEQ_SOUND:
UI_GetThemeColor3ubv(TH_SEQ_AUDIO, col);
blendcol[0] = blendcol[1] = blendcol[2] = 128;
if(seq->flag & SEQ_MUTE) UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20);
@@ -226,108 +225,6 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
}
}
-static void drawseqwave(Scene *scene, View2D *v2d, Sequence *seq, float x1, float y1, float x2, float y2, int winx)
-{
- /*
- x1 is the starting x value to draw the wave,
- x2 the end x value, same for y1 and y2
- winx is the zoom level.
- */
-
- float
- f, /* floating point value used to store the X draw location for the wave lines when openGL drawing*/
- midy, /* fast access to the middle location (y1+y2)/2 */
- clipxmin, /* the minimum X value, clip this with the window */
- clipxmax, /* the maximum X value, clip this with the window */
- sample_step, /* steps to move per sample, floating value must later translate into an int */
- fsofs, /* steps to move per sample, floating value must later translate into an int */
- feofs_sofs, /* */
- sound_width, /* convenience: x2-x1 */
- wavemulti; /* scale the samples by this value when GL_LINE drawing so it renders the right height */
-
- int
- offset, /* initial offset value for the wave drawing */
- offset_next, /* when in the wave drawing loop this value is the samples intil the next vert */
- sofs, /* Constrained offset value (~3) for the wave, start */
- eofs, /* ditto, end */
- wavesample, /* inner loop storage if the current wave sample value, used to make the 2 values below */
- wavesamplemin, /* used for finding the min and max wave peaks */
- wavesamplemax, /* ditto */
- subsample_step=4; /* when the sample step is 4 every sample of
- the wave is evaluated for min and max values used to draw the wave,
- however this is slow ehrn zoomed out so when the sample step is above
- 1 (the larger the further out the zoom is) so not evaluate all samples, only some. */
-
- signed short* s;
- bSound *sound;
- uint8_t *stream;
-
-// XXX audio_makestream(seq->sound);
- if(seq->sound==NULL || seq->sound->stream==NULL) return;
-
- if (seq->flag & SEQ_MUTE) glColor3ub(0x70, 0x80, 0x80); else glColor3ub(0x70, 0xc0, 0xc0);
-
- sofs = ((int)( FRA2TIME(seq->startdisp-seq->start+seq->anim_startofs)*(float)scene->r.audio.mixrate*4.0 )) & (~3);
- eofs = ((int)( FRA2TIME(seq->enddisp-seq->start+seq->anim_startofs)*(float)scene->r.audio.mixrate*4.0 )) & (~3);
-
- /* clip the drawing area to the screen bounds to save time */
- sample_step= (v2d->cur.xmax - v2d->cur.xmin)/winx;
- clipxmin= MAX2(x1, v2d->cur.xmin);
- clipxmax= MIN2(x2, v2d->cur.xmax);
-
- if (sample_step > 1)
- subsample_step= ((int)(subsample_step*sample_step*8)) & (~3);
-
- /* for speedy access */
- midy = (y1+y2)/2;
- fsofs= (float)sofs;
- feofs_sofs= (float)(eofs-sofs);
- sound_width= x2-x1;
- sound = seq->sound;
- stream = sound->stream;
- wavemulti = (y2-y1)/196605; /*y2-y1 is the height*/
- wavesample=0;
-
- /* we need to get the starting offset value, excuse the duplicate code */
- f=clipxmin;
- offset= (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3);
-
- /* start the loop, draw a line per sample_step -sample_step is about 1 line drawn per pixel */
- glBegin(GL_LINES);
- for (f=x1+sample_step; f<=clipxmax; f+=sample_step) {
-
- offset_next = (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3);
- if (f > v2d->cur.xmin) {
- /* if this is close to the last sample just exit */
- if (offset_next >= sound->streamlen) break;
-
- wavesamplemin = 131070;
- wavesamplemax = -131070;
-
- /*find with high and low of the waveform for this draw,
- evaluate small samples to find this range */
- while (offset < offset_next) {
- s = (signed short*)(stream+offset);
-
- wavesample = s[0]*2 + s[1];
- if (wavesamplemin>wavesample)
- wavesamplemin=wavesample;
- if (wavesamplemax<wavesample)
- wavesamplemax=wavesample;
- offset+=subsample_step;
- }
- /* draw the wave line, looks good up close and zoomed out */
- glVertex2f(f, midy-(wavemulti*wavesamplemin) );
- glVertex2f(f, midy-(wavemulti*wavesamplemax) );
- } else {
- while (offset < offset_next) offset+=subsample_step;
- }
-
- offset=offset_next;
- }
- glEnd();
-}
-
/* draw a handle, for each end of a sequence strip */
static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short direction)
{
@@ -546,11 +443,8 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
else
sprintf(str, "%d | %s", seq->len, give_seqname(seq));
}
- else if (seq->type == SEQ_RAM_SOUND) {
- sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name);
- }
- else if (seq->type == SEQ_HD_SOUND) {
- sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name);
+ else if (seq->type == SEQ_SOUND) {
+ sprintf(str, "%d | %s", seq->len, seq->sound->name);
}
else if (seq->type == SEQ_MOVIE) {
sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
@@ -664,9 +558,6 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, SpaceSeq *sseq, Sequence *
draw_shadedstrip(seq, background_col, x1, y1, x2, y2);
/* draw additional info and controls */
- if (seq->type == SEQ_RAM_SOUND)
- drawseqwave(scene, v2d, seq, x1, y1, x2, y2, ar->winx);
-
if (!is_single_image)
draw_seq_extensions(scene, sseq, seq);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 868897b76ac..1555784f470 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -65,6 +65,7 @@
#include "BKE_scene.h"
#include "BKE_utildefines.h"
#include "BKE_report.h"
+#include "BKE_sound.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -95,7 +96,7 @@
//static int _last_seq_init=0;
/* XXX */
static void error() {}
-static void waitcursor() {}
+static void waitcursor(int val) {}
static void activate_fileselect() {}
static int pupmenu() {return 0;}
static int okee() {return 0;}
@@ -166,7 +167,7 @@ Sequence *get_foreground_frame_seq(Scene *scene, int frame)
if(seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame)
continue;
/* only use elements you can see - not */
- if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_MOVIE_AND_HD_SOUND, SEQ_COLOR)) {
+ if (ELEM5(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR)) {
if (seq->machine > best_machine) {
best_seq = seq;
best_machine = seq->machine;
@@ -563,7 +564,7 @@ static void reload_sound_strip(Scene *scene, char *name)
calc_sequence(seqact);
seq->strip= 0;
- seq_free_sequence(ed, seq);
+ seq_free_sequence(scene, seq);
BLI_remlink(ed->seqbasep, seq);
seq= ed->seqbasep->first;
@@ -603,7 +604,7 @@ static void reload_image_strip(Scene *scene, char *name)
calc_sequence(seqact);
seq->strip= 0;
- seq_free_sequence(ed, seq);
+ seq_free_sequence(scene, seq);
BLI_remlink(ed->seqbasep, seq);
update_changed_seq_and_deps(scene, seqact, 1, 1);
@@ -722,7 +723,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
for(seq=ed->seqbasep->first; seq; seq=seq->next) {
if(seq->flag & SELECT) {
- if (seq->type == SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND) {
+ if (seq->type == SEQ_SOUND) {
*error_str= "Can't apply effects to audio sequence strips";
return 0;
}
@@ -849,7 +850,6 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short deleteall)
{
- Editing *ed= seq_give_editing(scene, FALSE);
Sequence *seq, *seqn;
Sequence *last_seq = get_last_seq(scene);
@@ -857,20 +857,20 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
while(seq) {
seqn= seq->next;
if((seq->flag & flag) || deleteall) {
- if(seq->type==SEQ_RAM_SOUND && seq->sound)
+ if(seq->type==SEQ_SOUND && seq->sound)
seq->sound->id.us--;
BLI_remlink(lb, seq);
if(seq==last_seq) set_last_seq(scene, NULL);
if(seq->type==SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
if(seq->ipo) seq->ipo->id.us--;
- seq_free_sequence(ed, seq);
+ seq_free_sequence(scene, seq);
}
seq= seqn;
}
}
-static Sequence *dupli_seq(Sequence *seq)
+static Sequence *dupli_seq(struct Scene *scene, Sequence *seq)
{
Sequence *seqn = MEM_dupallocN(seq);
// XXX animato: ID *id;
@@ -936,14 +936,13 @@ static Sequence *dupli_seq(Sequence *seq)
seqn->strip->stripdata =
MEM_dupallocN(seq->strip->stripdata);
seqn->anim= 0;
- } else if(seq->type == SEQ_RAM_SOUND) {
- seqn->strip->stripdata =
+ } else if(seq->type == SEQ_SOUND) {
+ seqn->strip->stripdata =
MEM_dupallocN(seq->strip->stripdata);
+ if(seq->sound_handle)
+ seqn->sound_handle = sound_new_handle(scene, seqn->sound, seq->sound_handle->startframe, seq->sound_handle->endframe, seq->sound_handle->frameskip);
+
seqn->sound->id.us++;
- } else if(seq->type == SEQ_HD_SOUND) {
- seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- seqn->hdaudio = 0;
} else if(seq->type == SEQ_IMAGE) {
seqn->strip->stripdata =
MEM_dupallocN(seq->strip->stripdata);
@@ -970,13 +969,13 @@ static Sequence *dupli_seq(Sequence *seq)
return seqn;
}
-static Sequence * deep_dupli_seq(Sequence * seq)
+static Sequence * deep_dupli_seq(struct Scene *scene, Sequence * seq)
{
- Sequence * seqn = dupli_seq(seq);
+ Sequence * seqn = dupli_seq(scene, seq);
if (seq->type == SEQ_META) {
Sequence * s;
for(s= seq->seqbase.first; s; s = s->next) {
- Sequence * n = deep_dupli_seq(s);
+ Sequence * n = deep_dupli_seq(scene, s);
if (n) {
BLI_addtail(&seqn->seqbase, n);
}
@@ -995,7 +994,7 @@ static void recurs_dupli_seq(Scene *scene, ListBase *old, ListBase *new)
for(seq= old->first; seq; seq= seq->next) {
seq->tmp= NULL;
if(seq->flag & SELECT) {
- seqn = dupli_seq(seq);
+ seqn = dupli_seq(scene, seq);
if (seqn) { /*should never fail */
seq->flag &= SEQ_DESEL;
seqn->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL+SEQ_LOCK);
@@ -1061,10 +1060,10 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
reload_sequence_new_file(scene, seq);
calc_sequence(seq);
-
+
if (!skip_dup) {
/* Duplicate AFTER the first change */
- seqn = deep_dupli_seq(seq);
+ seqn = deep_dupli_seq(scene, seq);
}
if (seqn) {
@@ -1150,10 +1149,10 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
}
calc_sequence(seq);
-
+
if (!skip_dup) {
/* Duplicate AFTER the first change */
- seqn = deep_dupli_seq(seq);
+ seqn = deep_dupli_seq(scene, seq);
}
if (seqn) {
@@ -1493,11 +1492,13 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op)
if(selected){ /* mute unselected */
if (seq->flag & SELECT) {
seq->flag |= SEQ_MUTE;
+ seq_update_sound(seq);
}
}
else {
if ((seq->flag & SELECT)==0) {
seq->flag |= SEQ_MUTE;
+ seq_update_sound(seq);
}
}
}
@@ -1544,11 +1545,13 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op)
if(selected){ /* unmute unselected */
if (seq->flag & SELECT) {
seq->flag &= ~SEQ_MUTE;
+ seq_update_sound(seq);
}
}
else {
if ((seq->flag & SELECT)==0) {
seq->flag &= ~SEQ_MUTE;
+ seq_update_sound(seq);
}
}
}
@@ -1694,7 +1697,7 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *op)
if(ed==NULL)
return OPERATOR_CANCELLED;
- free_imbuf_seq(&ed->seqbase);
+ free_imbuf_seq(&ed->seqbase, FALSE);
ED_area_tag_redraw(CTX_wm_area(C));
@@ -2007,7 +2010,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
start_ofs += step;
}
- seq_free_sequence(ed, seq);
+ seq_free_sequence(scene, seq);
seq = seq->next;
} else {
seq = seq->next;
@@ -2130,7 +2133,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
while(seq) {
if(seq->flag & SELECT) {
tot++;
- if (seq->type == SEQ_RAM_SOUND) {
+ if (seq->type == SEQ_SOUND) {
BKE_report(op->reports, RPT_ERROR, "Can't make Meta Strip from audio");
return OPERATOR_CANCELLED;;
}
@@ -2242,7 +2245,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *op)
last_seq->seqbase.last= 0;
BLI_remlink(ed->seqbasep, last_seq);
- seq_free_sequence(ed, last_seq);
+ seq_free_sequence(scene, last_seq);
/* emtpy meta strip, delete all effects depending on it */
for(seq=ed->seqbasep->first; seq; seq=seq->next)
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 335652235c6..dda5837e5f5 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -153,7 +153,7 @@ void select_single_seq(Scene *scene, Sequence *seq, int deselect_all) /* BRING B
if(seq->strip)
strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1);
}
- else if((seq->type==SEQ_HD_SOUND) || (seq->type==SEQ_RAM_SOUND)) {
+ else if(seq->type==SEQ_SOUND) {
if(seq->strip)
strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1);
}
@@ -336,7 +336,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1);
}
} else
- if (seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND) {
+ if (seq->type == SEQ_SOUND) {
if(seq->strip) {
strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1);
}
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index a9c0d3ff76b..4394fbfe1f5 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -210,21 +210,28 @@ static void text_keymap(struct wmWindowManager *wm)
WM_keymap_add_item(keymap, "TEXT_OT_open", OKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_reload", RKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT|KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_run_script", PKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
if(U.uiflag & USER_MMB_PASTE) // XXX not dynamic
RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_paste", MIDDLEMOUSE, KM_PRESS, 0, 0)->ptr, "selection", 1);
WM_keymap_add_item(keymap, "TEXT_OT_jump", JKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_ALT, 0);
@@ -233,6 +240,7 @@ static void text_keymap(struct wmWindowManager *wm)
WM_keymap_add_item(keymap, "TEXT_OT_to_3d_object", MKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_indent", TABKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "TEXT_OT_unindent", TABKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c
index c761587198f..089436cfcf9 100644
--- a/source/blender/editors/space_text/text_header.c
+++ b/source/blender/editors/space_text/text_header.c
@@ -186,12 +186,18 @@ ARegion *text_has_properties_region(ScrArea *sa)
return arnew;
}
-static int properties_poll(bContext *C)
+void text_toggle_properties_region(bContext *C, ScrArea *sa, ARegion *ar)
{
- SpaceText *st= CTX_wm_space_text(C);
- Text *text= CTX_data_edit_text(C);
+ ar->flag ^= RGN_FLAG_HIDDEN;
+ ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */
+
+ ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa);
+ ED_area_tag_redraw(sa);
+}
- return (st && text);
+static int properties_poll(bContext *C)
+{
+ return (CTX_wm_space_text(C) != NULL);
}
static int properties_exec(bContext *C, wmOperator *op)
@@ -199,13 +205,8 @@ static int properties_exec(bContext *C, wmOperator *op)
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= text_has_properties_region(sa);
- if(ar) {
- ar->flag ^= RGN_FLAG_HIDDEN;
- ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */
-
- ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa);
- ED_area_tag_redraw(sa);
- }
+ if(ar)
+ text_toggle_properties_region(C, sa, ar);
return OPERATOR_FINISHED;
}
@@ -214,6 +215,7 @@ void TEXT_OT_properties(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Properties";
+ ot->description= "Toggle text properties panel.";
ot->idname= "TEXT_OT_properties";
/* api callbacks */
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 4c9f47ed170..14b72e13856 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -176,6 +176,7 @@ void TEXT_OT_new(wmOperatorType *ot)
{
/* identifiers */
ot->name= "New";
+ ot->description= "Create a new text data block.";
ot->idname= "TEXT_OT_new";
/* api callbacks */
@@ -223,6 +224,7 @@ void TEXT_OT_open(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Open";
+ ot->description= "Open a new text data block.";
ot->idname= "TEXT_OT_open";
/* api callbacks */
@@ -260,6 +262,7 @@ void TEXT_OT_reload(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Reload";
+ ot->description= "Reload active text data block from its file.";
ot->idname= "TEXT_OT_reload";
/* api callbacks */
@@ -337,6 +340,7 @@ void TEXT_OT_unlink(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Unlink";
+ ot->description= "Unlink active text data block.";
ot->idname= "TEXT_OT_unlink";
/* api callbacks */
@@ -367,6 +371,7 @@ void TEXT_OT_make_internal(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Make Internal";
+ ot->description= "Make active text file internal.";
ot->idname= "TEXT_OT_make_internal";
/* api callbacks */
@@ -435,6 +440,7 @@ void TEXT_OT_save(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Save";
+ ot->description= "Save active text data block.";
ot->idname= "TEXT_OT_save";
/* api callbacks */
@@ -490,6 +496,7 @@ void TEXT_OT_save_as(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Save As";
+ ot->description= "Save active text file with options.";
ot->idname= "TEXT_OT_save_as";
/* api callbacks */
@@ -527,6 +534,7 @@ void TEXT_OT_run_script(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Run Script";
+ ot->description= "Run active script.";
ot->idname= "TEXT_OT_run_script";
/* api callbacks */
@@ -583,6 +591,7 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Refresh PyConstraints";
+ ot->description= "Refresh all pyconstraints.";
ot->idname= "TEXT_OT_refresh_pyconstraints";
/* api callbacks */
@@ -704,6 +713,7 @@ void TEXT_OT_paste(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Paste";
+ ot->description= "Paste text from clipboard.";
ot->idname= "TEXT_OT_paste";
/* api callbacks */
@@ -744,6 +754,7 @@ void TEXT_OT_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy";
+ ot->description= "Copy selected text to clipboard.";
ot->idname= "TEXT_OT_copy";
/* api callbacks */
@@ -774,6 +785,7 @@ void TEXT_OT_cut(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Cut";
+ ot->description= "Cut selected text to clipboard.";
ot->idname= "TEXT_OT_cut";
/* api callbacks */
@@ -809,6 +821,7 @@ void TEXT_OT_indent(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Indent";
+ ot->description= "Indent selected text.";
ot->idname= "TEXT_OT_indent";
/* api callbacks */
@@ -844,6 +857,7 @@ void TEXT_OT_unindent(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Unindent";
+ ot->description= "Unindent selected text.";
ot->idname= "TEXT_OT_unindent";
/* api callbacks */
@@ -884,6 +898,7 @@ void TEXT_OT_line_break(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Line Break";
+ ot->description= "Insert line break at cursor position.";
ot->idname= "TEXT_OT_line_break";
/* api callbacks */
@@ -916,6 +931,7 @@ void TEXT_OT_comment(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Comment";
+ ot->description= "Convert selected text to comment.";
ot->idname= "TEXT_OT_comment";
/* api callbacks */
@@ -949,6 +965,7 @@ void TEXT_OT_uncomment(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Uncomment";
+ ot->description= "Convert selected comment to text.";
ot->idname= "TEXT_OT_uncomment";
/* api callbacks */
@@ -1090,6 +1107,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Convert Whitespace";
+ ot->description= "Convert whitespaces by type.";
ot->idname= "TEXT_OT_convert_whitespace";
/* api callbacks */
@@ -1120,6 +1138,7 @@ void TEXT_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select All";
+ ot->description= "Select all text.";
ot->idname= "TEXT_OT_select_all";
/* api callbacks */
@@ -1147,6 +1166,7 @@ void TEXT_OT_select_line(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Line";
+ ot->description= "Select text by line.";
ot->idname= "TEXT_OT_select_line";
/* api clinebacks */
@@ -1184,6 +1204,7 @@ void TEXT_OT_previous_marker(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Previous Marker";
+ ot->description= "Move to previous marker.";
ot->idname= "TEXT_OT_previous_marker";
/* api callbacks */
@@ -1221,6 +1242,7 @@ void TEXT_OT_next_marker(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Next Marker";
+ ot->description= "Move to next marker";
ot->idname= "TEXT_OT_next_marker";
/* api callbacks */
@@ -1248,6 +1270,7 @@ void TEXT_OT_markers_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear All Markers";
+ ot->description= "Clear all markers.";
ot->idname= "TEXT_OT_markers_clear";
/* api callbacks */
@@ -1455,7 +1478,7 @@ static int move_cursor(bContext *C, int type, int select)
ARegion *ar= CTX_wm_region(C);
/* ensure we have the right region, it's optional */
- if(ar->regiontype != RGN_TYPE_WINDOW)
+ if(ar && ar->regiontype != RGN_TYPE_WINDOW)
ar= NULL;
switch(type) {
@@ -1531,6 +1554,7 @@ void TEXT_OT_move(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Cursor";
+ ot->description= "Move cursor to position type.";
ot->idname= "TEXT_OT_move";
/* api callbacks */
@@ -1557,6 +1581,7 @@ void TEXT_OT_move_select(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Select";
+ ot->description= "Make selection from current cursor position to new cursor position type.";
ot->idname= "TEXT_OT_move_select";
/* api callbacks */
@@ -1596,6 +1621,7 @@ void TEXT_OT_jump(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Jump";
+ ot->description= "Jump cursor to line.";
ot->idname= "TEXT_OT_jump";
/* api callbacks */
@@ -1648,6 +1674,7 @@ void TEXT_OT_delete(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete";
+ ot->description= "Delete text by cursor position.";
ot->idname= "TEXT_OT_delete";
/* api callbacks */
@@ -1828,6 +1855,10 @@ void TEXT_OT_scroll(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scroll";
+ /*don't really see the difference between this and
+ scroll_bar. Both do basically the same thing (aside
+ from keymaps).*/
+ ot->description= "Scroll text screen.";
ot->idname= "TEXT_OT_scroll";
/* api callbacks */
@@ -1876,6 +1907,10 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Scrollbar";
+ /*don't really see the difference between this and
+ scroll. Both do basically the same thing (aside
+ from keymaps).*/
+ ot->description= "Scroll text screen.";
ot->idname= "TEXT_OT_scroll_bar";
/* api callbacks */
@@ -2151,6 +2186,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Cursor";
+ ot->description= "Set cursor selection.";
ot->idname= "TEXT_OT_cursor_set";
/* api callbacks */
@@ -2274,6 +2310,7 @@ void TEXT_OT_insert(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Insert";
+ ot->description= "Insert text at cursor position.";
ot->idname= "TEXT_OT_insert";
/* api callbacks */
@@ -2378,6 +2415,7 @@ void TEXT_OT_find(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Find";
+ ot->description= "Find specified text.";
ot->idname= "TEXT_OT_find";
/* api callbacks */
@@ -2396,6 +2434,7 @@ void TEXT_OT_replace(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replace";
+ ot->description= "Replace text with specified text.";
ot->idname= "TEXT_OT_replace";
/* api callbacks */
@@ -2414,6 +2453,7 @@ void TEXT_OT_mark_all(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mark All";
+ ot->description= "Mark all specified text.";
ot->idname= "TEXT_OT_mark_all";
/* api callbacks */
@@ -2443,6 +2483,7 @@ void TEXT_OT_find_set_selected(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Find Set Selected";
+ ot->description= "Find specified text and set as selected.";
ot->idname= "TEXT_OT_find_set_selected";
/* api callbacks */
@@ -2469,6 +2510,7 @@ void TEXT_OT_replace_set_selected(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Replace Set Selected";
+ ot->description= "Replace text with specified text and set as selected.";
ot->idname= "TEXT_OT_replace_set_selected";
/* api callbacks */
@@ -2631,6 +2673,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot)
{
/* identifiers */
ot->name= "To 3D Object";
+ ot->description= "Create 3d text object from active text data block.";
ot->idname= "TEXT_OT_to_3d_object";
/* api callbacks */
diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c
index b606f8cb141..4400747a731 100644
--- a/source/blender/editors/space_text/text_python.c
+++ b/source/blender/editors/space_text/text_python.c
@@ -353,7 +353,7 @@ short do_texttools(SpaceText *st, char ascii, unsigned short evnt, short val)
}
if(draw)
- ; // XXX redraw_alltext();
+ {}; // XXX redraw_alltext();
return swallow;
}
@@ -536,7 +536,7 @@ short do_textmarkers(SpaceText *st, char ascii, unsigned short evnt, short val)
}
if(draw)
- ; // XXX redraw_alltext();
+ {}; // XXX redraw_alltext();
return swallow;
}
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 61488db0007..ce6846a4489 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -260,11 +260,15 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch(wmn->category) {
+ case NC_ANIMATION:
+ ED_region_tag_redraw(ar);
+ break;
case NC_SCENE:
/* any scene change for now */
ED_region_tag_redraw(ar);
break;
+
}
}
@@ -273,29 +277,12 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
/* add handlers, stuff you only do once or on area/region changes */
static void time_header_area_init(wmWindowManager *wm, ARegion *ar)
{
- UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
+ ED_region_header_init(ar);
}
static void time_header_area_draw(const bContext *C, ARegion *ar)
{
- float col[3];
-
- /* clear */
- if(ED_screen_area_active(C))
- UI_GetThemeColor3fv(TH_HEADER, col);
- else
- UI_GetThemeColor3fv(TH_HEADERDESEL, col);
-
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- /* set view2d view matrix for scrolling (without scrollers) */
- UI_view2d_view_ortho(C, &ar->v2d);
-
- time_header_buttons(C, ar);
-
- /* restore view matrix? */
- UI_view2d_view_restore(C);
+ ED_region_header(C, ar);
}
static void time_header_area_listener(ARegion *ar, wmNotifier *wmn)
@@ -372,8 +359,6 @@ static SpaceLink *time_new(const bContext *C)
static void time_free(SpaceLink *sl)
{
}
-
-
/* spacetype; init callback in ED_area_initialize() */
/* init is called to (re)initialize an existing editor (file read, screen changes) */
/* validate spacedata, add own area level handlers */
@@ -422,7 +407,7 @@ void ED_spacetype_time(void)
art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
art->regionid = RGN_TYPE_HEADER;
art->minsizey= HEADERY;
- art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES;
art->init= time_header_area_init;
art->draw= time_header_area_draw;
diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c
deleted file mode 100644
index 436a841deb8..00000000000
--- a/source/blender/editors/space_time/time_header.c
+++ /dev/null
@@ -1,612 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_windowmanager_types.h"
-#include "DNA_userdef_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-
-#include "BKE_context.h"
-#include "BKE_global.h"
-#include "BKE_screen.h"
-
-#include "ED_keyframing.h"
-#include "ED_screen.h"
-#include "ED_screen_types.h"
-#include "ED_types.h"
-#include "ED_util.h"
-
-#include "WM_api.h"
-#include "WM_types.h"
-
-#include "RNA_access.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-
-#include "UI_interface.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-
-#include "ED_markers.h"
-
-#include "time_intern.h"
-
-
-/* ************************ header time area region *********************** */
-
-static ARegion *time_top_left_3dwindow(bScreen *screen)
-{
- ARegion *aret= NULL;
- ScrArea *sa;
- int min= 10000;
-
- for(sa= screen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- ARegion *ar;
- for(ar= sa->regionbase.first; ar; ar= ar->next) {
- if(ar->regiontype==RGN_TYPE_WINDOW) {
- if(ar->winrct.xmin - ar->winrct.ymin < min) {
- aret= ar;
- min= ar->winrct.xmin - ar->winrct.ymin;
- }
- }
- }
- }
- }
- return aret;
-}
-
-static void do_time_redrawmenu(bContext *C, void *arg, int event)
-{
-
- if(event < 1001) {
- bScreen *screen= CTX_wm_screen(C);
- SpaceTime *stime= CTX_wm_space_time(C);
-
- stime->redraws ^= event;
-
- if(screen->animtimer) {
- wmTimer *wt= screen->animtimer;
- ScreenAnimData *sad= wt->customdata;
-
- sad->redraws= stime->redraws;
- sad->ar= NULL;
- if(stime->redraws & TIME_REGION)
- sad->ar= time_top_left_3dwindow(screen);
- }
- }
-}
-
-
-static uiBlock *time_redrawmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *curarea= CTX_wm_area(C);
- SpaceTime *stime= CTX_wm_space_time(C);
- uiBlock *block;
- short yco= 0, menuwidth=120, icon;
-
- block= uiBeginBlock(C, ar, "header time_redrawmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_time_redrawmenu, NULL);
-
- if(stime->redraws & TIME_REGION) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Top-Left 3D Window", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_REGION, "");
-
- if(stime->redraws & TIME_ALL_3D_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "All 3D Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_3D_WIN, "");
-
- if(stime->redraws & TIME_ALL_ANIM_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Animation Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_ANIM_WIN, "");
-
- if(stime->redraws & TIME_ALL_BUTS_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Buttons Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_BUTS_WIN, "");
-
- if(stime->redraws & TIME_ALL_IMAGE_WIN) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Image Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_IMAGE_WIN, "");
-
- /* Add sequencer only redraw*/
- if(stime->redraws & TIME_SEQ) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Sequencer Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_SEQ, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(stime->redraws & TIME_CONTINUE_PHYSICS) icon= ICON_CHECKBOX_HLT;
- else icon= ICON_CHECKBOX_DEHLT;
- uiDefIconTextBut(block, BUTM, 1, icon, "Continue Physics", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_CONTINUE_PHYSICS, "During playblack, continue physics simulations regardless of the frame number");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- uiEndBlock(C, block);
-
- return block;
-}
-
-static void do_time_viewmenu(bContext *C, void *arg, int event)
-{
- ScrArea *curarea= CTX_wm_area(C);
- SpaceTime *stime= CTX_wm_space_time(C);
- View2D *v2d= UI_view2d_fromcontext_rwin(C);
- Scene *scene= CTX_data_scene(C);
- int first;
-
- switch(event) {
- case 2: /* Play Back Animation */
- //if(!has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
- // start_animated_screen(stime);
- break;
- case 3: /* View All */
- if(v2d) {
- first= scene->r.sfra;
- if(first >= scene->r.efra) first= scene->r.efra;
- v2d->cur.xmin=v2d->tot.xmin= (float)first-2;
- v2d->cur.xmax=v2d->tot.xmax= (float)scene->r.efra+2;
-
- ED_area_tag_redraw(curarea);
- }
- break;
- case 4: /* Maximize Window */
- /* using event B_FULL */
- break;
- case 5: /* show time or frames */
- stime->flag ^= TIME_DRAWFRAMES;
- ED_area_tag_redraw(curarea);
- break;
- case 6:
- //nextprev_marker(1);
- break;
- case 7:
- //nextprev_marker(-1);
- break;
- case 8:
- //nextprev_timeline_key(1);
- break;
- case 9:
- //nextprev_timeline_key(-1);
- break;
- case 10:
- //timeline_frame_to_center();
- break;
- case 11:
- if(v2d) {
- v2d->flag ^= V2D_VIEWSYNC_SCREEN_TIME;
- UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_SET);
- }
- break;
- case 12: /* only show keyframes from selected data */
- stime->flag ^= TIME_ONLYACTSEL;
- ED_area_tag_redraw(curarea);
- break;
- }
-}
-
-static uiBlock *time_viewmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *curarea= CTX_wm_area(C);
- SpaceTime *stime= CTX_wm_space_time(C);
- View2D *v2d= UI_view2d_fromcontext_rwin(C);
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "time_viewmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_time_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(stime->flag & TIME_DRAWFRAMES)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefIconTextBut(block, BUTM, 1, (stime->flag & TIME_ONLYACTSEL)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Only Selected Data Keys|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Key|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Key|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-
-// if (!curarea->full)
-// uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-// else
-// uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- uiEndBlock(C, block);
-
- return block;
-}
-
-static void do_time_framemenu(bContext *C, void *arg, int event)
-{
- Scene *scene= CTX_data_scene(C);
-
- switch(event) {
- case 1: /*Set as Start */
- if (scene->r.psfra) {
- if (scene->r.pefra < scene->r.cfra)
- scene->r.pefra= scene->r.cfra;
- scene->r.psfra= scene->r.cfra;
- }
- else
- scene->r.sfra = scene->r.cfra;
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
- break;
- case 2: /* Set as End */
- if (scene->r.psfra) {
- if (scene->r.cfra < scene->r.psfra)
- scene->r.psfra= scene->r.cfra;
- scene->r.pefra= scene->r.cfra;
- }
- else
- scene->r.efra = scene->r.cfra;
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
- break;
- case 3: /* Rename Marker */
- //rename_marker();
- break;
- }
-}
-
-static uiBlock *time_framemenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *curarea= CTX_wm_area(C);
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "time_framemenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_time_framemenu, NULL);
-
- uiDefIconTextButO(block, BUTM, "MARKER_OT_add", WM_OP_EXEC_REGION_WIN, ICON_BLANK1, "Add Marker",
- 0, yco-=2, menuwidth, 19, "");
- uiDefIconTextButO(block, BUTM, "MARKER_OT_duplicate", WM_OP_EXEC_REGION_WIN, ICON_BLANK1, "Duplicate Marker",
- 0, yco-=20, menuwidth, 19, "");
- uiDefIconTextButO(block, BUTM, "MARKER_OT_delete", WM_OP_EXEC_REGION_WIN, ICON_BLANK1, "Delete Marker",
- 0, yco-=20, menuwidth, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Name Marker|Ctrl M",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextButO(block, BUTM, "MARKER_OT_move", WM_OP_INVOKE_REGION_WIN, ICON_BLANK1, "Grab/Move Marker",
- 0, yco-=20, menuwidth, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as Start|S",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as End|E",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- uiEndBlock(C, block);
-
- return block;
-}
-
-
-#define B_REDRAWALL 750
-#define B_TL_REW 751
-#define B_TL_PLAY 752
-#define B_TL_RPLAY 760
-#define B_TL_FF 753
-#define B_TL_STOP 756
-#define B_TL_PREVIEWON 757
-
-#define B_FLIPINFOMENU 0
-#define B_NEWFRAME 0
-#define B_DIFF 0
-
-
-void do_time_buttons(bContext *C, void *arg, int event)
-{
- bScreen *screen= CTX_wm_screen(C);
- SpaceTime *stime= CTX_wm_space_time(C);
- Scene *scene= CTX_data_scene(C);
-
- switch(event) {
- case B_REDRAWALL:
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
- break;
- case B_NEWFRAME:
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
- break;
- case B_TL_REW:
- scene->r.cfra= PSFRA;
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
- //update_for_newframe();
- break;
- case B_TL_PLAY:
- ED_screen_animation_timer(C, stime->redraws, 1);
-
- /* update region if TIME_REGION was set, to leftmost 3d window */
- if(screen->animtimer && (stime->redraws & TIME_REGION)) {
- wmTimer *wt= screen->animtimer;
- ScreenAnimData *sad= wt->customdata;
-
- sad->ar= time_top_left_3dwindow(screen);
- }
-
- break;
- case B_TL_RPLAY:
- ED_screen_animation_timer(C, stime->redraws, -1);
-
- /* update region if TIME_REGION was set, to leftmost 3d window */
- if(screen->animtimer && (stime->redraws & TIME_REGION)) {
- wmTimer *wt= screen->animtimer;
- ScreenAnimData *sad= wt->customdata;
-
- sad->ar= time_top_left_3dwindow(screen);
- }
-
- break;
- case B_TL_STOP:
- ED_screen_animation_timer(C, 0, 0);
- break;
- case B_TL_FF:
- /* end frame */
- scene->r.cfra= PEFRA;
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
- //update_for_newframe();
- break;
-
- case B_TL_PREVIEWON:
- if (scene->r.psfra) {
- /* turn on preview range */
- scene->r.psfra= scene->r.sfra;
- scene->r.pefra= scene->r.efra;
- }
- else {
- /* turn off preview range */
- scene->r.psfra= 0;
- scene->r.pefra= 0;
- }
- //BIF_undo_push("Set anim-preview range");
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
- break;
- }
-}
-
-
-void time_header_buttons(const bContext *C, ARegion *ar)
-{
- ScrArea *sa= CTX_wm_area(C);
- SpaceTime *stime= CTX_wm_space_time(C);
- Scene *scene= CTX_data_scene(C);
- uiBlock *block;
- uiBut *but;
- int xco, yco= 3;
- char *menustr= NULL;
-
- block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS);
- uiBlockSetHandleFunc(block, do_time_buttons, NULL);
-
- xco= ED_area_header_standardbuttons(C, block, yco);
-
- if((sa->flag & HEADER_NO_PULLDOWN)==0) {
- int xmax;
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, time_viewmenu, sa,
- "View", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- xmax= GetButStringLength("Frame");
- uiDefPulldownBut(block, time_framemenu, sa,
- "Frame", xco, yco, xmax-3, 20, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Playback");
- uiDefPulldownBut(block, time_redrawmenu, sa,
- "Playback", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- uiBlockBeginAlign(block);
-
- uiDefButI(block, TOG, B_TL_PREVIEWON,"PR",
- xco,yco, XIC*2, YIC,
- &scene->r.psfra,0, 1, 0, 0,
- "Show settings for frame range of animation preview");
-
- xco += XIC*2;
-
- if (scene->r.psfra) {
- uiDefButI(block, NUM, B_REDRAWALL,"Start:",
- xco,yco, (int)4.5*XIC, YIC,
- &scene->r.psfra,MINFRAMEF, MAXFRAMEF, 0, 0,
- "The start frame of the animation preview (inclusive)");
-
- xco += (int)(4.5*XIC);
-
- uiDefButI(block, NUM, B_REDRAWALL,"End:",
- xco,yco, (int)4.5*XIC,YIC,
- &scene->r.pefra,(float)PSFRA, MAXFRAMEF, 0, 0,
- "The end frame of the animation preview (inclusive)");
- }
- else {
- uiDefButI(block, NUM, B_REDRAWALL,"Start:",
- xco,yco, (int)4.5*XIC, YIC,
- &scene->r.sfra,MINFRAMEF, MAXFRAMEF, 0, 0,
- "The start frame of the animation (inclusive)");
-
- xco += (short)(4.5*XIC);
-
- uiDefButI(block, NUM, B_REDRAWALL,"End:",
- xco,yco, (int)4.5*XIC,YIC,
- &scene->r.efra,(float)SFRA, MAXFRAMEF, 0, 0,
- "The end frame of the animation (inclusive)");
- }
- uiBlockEndAlign(block);
-
- xco += (short)(4.5 * XIC);
-
- /* MINAFRAMEF not MINFRAMEF, since MINAFRAMEF allows to set current frame negative
- * to facilitate easier keyframing in some situations
- */
- uiDefButI(block, NUM, B_NEWFRAME, "",
- xco,yco, (int)3.5*XIC,YIC,
- &(scene->r.cfra), MINAFRAMEF, MAXFRAMEF, 0, 0,
- "Displays Current Frame of animation");
-
- xco += (short)(3.5 * XIC);
-
- uiBlockBeginAlign(block);
-
- uiDefIconBut(block, BUT, B_TL_REW, ICON_REW,
- xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to Start frame (Shift DownArrow)");
- xco+= XIC;
-
- but= uiDefIconButO(block, BUT, "SCREEN_OT_keyframe_jump", WM_OP_INVOKE_REGION_WIN, ICON_PREV_KEYFRAME, xco,yco,XIC,YIC, "Skip to previous keyframe (Ctrl PageDown)");
- RNA_boolean_set(uiButGetOperatorPtrRNA(but), "next", 0);
- xco+= XIC;
-
- if(CTX_wm_screen(C)->animtimer) {
- /* pause button 2*size to keep buttons in place */
- uiDefIconBut(block, BUT, B_TL_STOP, ICON_PAUSE,
- xco, yco, XIC*2, YIC, 0, 0, 0, 0, 0, "Stop Playing Timeline");
-
- xco+= XIC;
- }
- else {
- uiDefIconBut(block, BUT, B_TL_RPLAY, ICON_PLAY_REVERSE,
- xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline in Reverse");
-
- xco+= XIC;
-
- uiDefIconBut(block, BUT, B_TL_PLAY, ICON_PLAY,
- xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline ");
- }
- xco+= XIC;
-
- but= uiDefIconButO(block, BUT, "SCREEN_OT_keyframe_jump", WM_OP_INVOKE_REGION_WIN, ICON_NEXT_KEYFRAME, xco,yco,XIC,YIC, "Skip to next keyframe (Ctrl PageUp)");
- RNA_boolean_set(uiButGetOperatorPtrRNA(but), "next", 1);
- xco+= XIC;
-
- uiDefIconBut(block, BUT, B_TL_FF, ICON_FF,
- xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to End frame (Shift UpArrow)");
- uiBlockEndAlign(block);
-
- xco+= 2*XIC;
-
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, TOG, AUTOKEY_ON, B_REDRAWALL, ICON_REC,
- xco, yco, XIC, YIC, &(scene->toolsettings->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
- xco+= XIC;
-
- if(IS_AUTOKEY_ON(scene)) {
- uiDefButS(block, MENU, B_REDRAWALL,
- "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5",
- xco, yco, (int)5.5*XIC, YIC, &(scene->toolsettings->autokey_mode), 0, 1, 0, 0,
- "Mode of automatic keyframe insertion for Objects and Bones");
- xco+= (5.5*XIC);
- }
- else
- xco+= 6;
-
- uiBlockEndAlign(block);
-
- menustr= ANIM_build_keyingsets_menu(&scene->keyingsets, 0);
- uiDefButI(block, MENU, B_DIFF,
- menustr,
- xco, yco, (int)5.5*XIC, YIC, &(scene->active_keyingset), 0, 1, 0, 0,
- "Active Keying Set (i.e. set of channels to Insert Keyframes for)");
- MEM_freeN(menustr);
- xco+= (5.5*XIC);
-
- uiBlockBeginAlign(block);
- uiDefIconButO(block, BUT, "ANIM_OT_delete_keyframe", WM_OP_INVOKE_REGION_WIN, ICON_KEY_DEHLT, xco,yco,XIC,YIC, "Delete Keyframes for the Active Keying Set (Alt-I)");
- xco += XIC;
- uiDefIconButO(block, BUT, "ANIM_OT_insert_keyframe", WM_OP_INVOKE_REGION_WIN, ICON_KEY_HLT, xco,yco,XIC,YIC, "Insert Keyframes for the Active Keying Set (I)");
- xco += XIC;
- uiBlockEndAlign(block);
-
- xco+= XIC;
-
- uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER,
- xco, yco, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor");
-
-
- /* always as last */
- UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin));
-
- uiEndBlock(C, block);
- uiDrawBlock(C, block);
-}
-
-
diff --git a/source/blender/editors/space_userpref/Makefile b/source/blender/editors/space_userpref/Makefile
new file mode 100644
index 00000000000..be7206f51ce
--- /dev/null
+++ b/source/blender/editors/space_userpref/Makefile
@@ -0,0 +1,55 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_userpref
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I../../blenfont
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_userpref/SConscript b/source/blender/editors/space_userpref/SConscript
new file mode 100644
index 00000000000..1b808a5a7c0
--- /dev/null
+++ b/source/blender/editors/space_userpref/SConscript
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf ../../blenfont'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+defs = []
+
+if env['WITH_BF_GAMEENGINE']:
+ defs.append('GAMEBLENDER=1')
+
+env.BlenderLib ( 'bf_editors_space_userpref', sources, Split(incs), defs, libtype=['core'], priority=[70] )
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
new file mode 100644
index 00000000000..8c9d723ce2c
--- /dev/null
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -0,0 +1,188 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_context.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "userpref_intern.h" // own include
+
+/* ******************** default callbacks for userpref space ***************** */
+
+static SpaceLink *userpref_new(const bContext *C)
+{
+ ARegion *ar;
+ SpaceUserPref *spref;
+
+ spref= MEM_callocN(sizeof(SpaceUserPref), "inituserpref");
+ spref->spacetype= SPACE_USERPREF;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for userpref");
+
+ BLI_addtail(&spref->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for userpref");
+
+ BLI_addtail(&spref->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ return (SpaceLink *)spref;
+}
+
+/* not spacelink itself */
+static void userpref_free(SpaceLink *sl)
+{
+// SpaceUserPref *spref= (SpaceUserPref*) sl;
+
+}
+
+
+/* spacetype; init callback */
+static void userpref_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *userpref_duplicate(SpaceLink *sl)
+{
+ SpaceUserPref *sprefn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)sprefn;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void userpref_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ED_region_panels_init(wm, ar);
+}
+
+static void userpref_main_area_draw(const bContext *C, ARegion *ar)
+{
+ ED_region_panels(C, ar, 1, NULL, -1);
+}
+
+void userpref_operatortypes(void)
+{
+}
+
+void userpref_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void userpref_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ED_region_header_init(ar);
+}
+
+static void userpref_header_area_draw(const bContext *C, ARegion *ar)
+{
+ ED_region_header(C, ar);
+}
+
+static void userpref_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+static void userpref_header_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+ switch(wmn->category) {
+ default:
+ break;
+ }
+
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_userpref(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype userpref");
+ ARegionType *art;
+
+ st->spaceid= SPACE_USERPREF;
+
+ st->new= userpref_new;
+ st->free= userpref_free;
+ st->init= userpref_init;
+ st->duplicate= userpref_duplicate;
+ st->operatortypes= userpref_operatortypes;
+ st->keymap= userpref_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype userpref region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= userpref_main_area_init;
+ art->draw= userpref_main_area_draw;
+ art->listener= userpref_main_area_listener;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype userpref region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+ art->listener= userpref_header_listener;
+ art->init= userpref_header_area_init;
+ art->draw= userpref_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_userpref/userpref_intern.h b/source/blender/editors/space_userpref/userpref_intern.h
new file mode 100644
index 00000000000..596c2675b01
--- /dev/null
+++ b/source/blender/editors/space_userpref/userpref_intern.h
@@ -0,0 +1,34 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_USERPREF_INTERN_H
+#define ED_USERPREF_INTERN_H
+
+/* internal exports only */
+
+#endif /* ED_USERPREF_INTERN_H */
+
diff --git a/source/blender/editors/space_userpref/userpref_ops.c b/source/blender/editors/space_userpref/userpref_ops.c
new file mode 100644
index 00000000000..91a6651bd92
--- /dev/null
+++ b/source/blender/editors/space_userpref/userpref_ops.c
@@ -0,0 +1,33 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "userpref_intern.h"
+
diff --git a/source/blender/editors/space_view3d/Makefile b/source/blender/editors/space_view3d/Makefile
index 5e6f8a6c426..07102157854 100644
--- a/source/blender/editors/space_view3d/Makefile
+++ b/source/blender/editors/space_view3d/Makefile
@@ -52,7 +52,7 @@ CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I../../blenfont
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-
+CPPFLAGS += -I$(NAN_SMOKE)/include
# own include
CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript
index 7d51d237ef0..057c98a1d49 100644
--- a/source/blender/editors/space_view3d/SConscript
+++ b/source/blender/editors/space_view3d/SConscript
@@ -8,6 +8,8 @@ incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../render/extern/include #/intern/guardedalloc'
incs += ' ../../gpu ../../makesrna ../../blenfont'
+incs += ' #/intern/smoke/extern'
+incs += ' #source/kernel/gen_system'
if env['WITH_BF_GAMEENGINE']:
defs.append('GAMEBLENDER=1')
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 5a9790390b7..a5718386554 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -2271,7 +2271,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, RegionView3D *rv3d
range= (float)(end - start);
/* store values */
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
cfrao= CFRA;
flago= arm->flag;
arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
@@ -2308,7 +2308,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, RegionView3D *rv3d
ob->pose= poseo;
arm->flag= flago;
armature_rebuild_pose(ob, ob->data);
- ob->flag |= OB_POSEMODE;
+ ob->mode |= OB_MODE_POSE;
ob->ipoflag= ipoflago;
}
@@ -2349,7 +2349,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d,
if (range == 0) return;
/* store values */
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
cfrao= CFRA;
flago= arm->flag;
arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
@@ -2388,7 +2388,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d,
ob->pose= poseo;
arm->flag= flago;
armature_rebuild_pose(ob, ob->data);
- ob->flag |= OB_POSEMODE;
+ ob->mode |= OB_MODE_POSE;
}
/* draw ghosts around current frame
@@ -2415,7 +2415,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
range= (float)(arm->ghostep)*stepsize + 0.5f; /* plus half to make the for loop end correct */
/* store values */
- ob->flag &= ~OB_POSEMODE;
+ ob->mode &= ~OB_MODE_POSE;
cfrao= CFRA;
actframe= BKE_nla_tweakedit_remap(adt, (float)CFRA, 0);
flago= arm->flag;
@@ -2474,7 +2474,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
ob->pose= poseo;
arm->flag= flago;
armature_rebuild_pose(ob, ob->data);
- ob->flag |= OB_POSEMODE;
+ ob->mode |= OB_MODE_POSE;
}
/* ********************************** Armature Drawing - Main ************************* */
@@ -2513,10 +2513,10 @@ int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int
/* drawing posemode selection indices or colors only in these cases */
if(!(base->flag & OB_FROMDUPLI)) {
if(G.f & G_PICKSEL) {
- if(ob->flag & OB_POSEMODE)
+ if(ob->mode & OB_MODE_POSE)
arm->flag |= ARM_POSEMODE;
}
- else if(ob->flag & OB_POSEMODE) {
+ else if(ob->mode & OB_MODE_POSE) {
if (arm->ghosttype == ARM_GHOST_RANGE) {
draw_ghost_poses_range(scene, v3d, rv3d, base);
}
@@ -2530,7 +2530,7 @@ int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int
if ((flag & DRAW_SCENESET)==0) {
if(ob==OBACT)
arm->flag |= ARM_POSEMODE;
- else if(G.f & G_WEIGHTPAINT) {
+ else if(ob->mode & OB_MODE_WEIGHT_PAINT) {
if(OBACT && ob==modifiers_isDeformedByArmature(OBACT))
arm->flag |= ARM_POSEMODE;
}
@@ -2541,7 +2541,7 @@ int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int
draw_pose_channels(scene, v3d, rv3d, base, dt);
arm->flag &= ~ARM_POSEMODE;
- if(ob->flag & OB_POSEMODE)
+ if(ob->mode & OB_MODE_POSE)
UI_ThemeColor(TH_WIRE); /* restore, for extra draw stuff */
}
else retval= 1;
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 1807de9efbb..da67bd8707e 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -60,6 +60,7 @@
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_property.h"
#include "BKE_utildefines.h"
@@ -297,9 +298,9 @@ static int set_draw_settings_cached(int clearcache, int textured, MTFace *texfac
if (textured!=c_textured || texface!=c_texface) {
if (textured ) {
- c_badtex= !GPU_set_tpage(texface);
+ c_badtex= !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT));
} else {
- GPU_set_tpage(0);
+ GPU_set_tpage(NULL, 0);
c_badtex= 0;
}
c_textured= textured;
@@ -377,7 +378,7 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
static void draw_textured_end()
{
/* switch off textures */
- GPU_set_tpage(0);
+ GPU_set_tpage(NULL, 0);
glShadeModel(GL_FLAT);
glDisable(GL_CULL_FACE);
@@ -482,7 +483,7 @@ void draw_mesh_text(Scene *scene, Object *ob, int glsl)
if(ob == scene->obedit)
return;
else if(ob==OBACT)
- if(FACESEL_PAINT_TEST)
+ if(paint_facesel_test(ob))
return;
ddm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
@@ -562,7 +563,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o
if(ob == scene->obedit) {
dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, me->edit_mesh);
} else if(faceselect) {
- if(G.f & G_WEIGHTPAINT)
+ if(ob->mode & OB_MODE_WEIGHT_PAINT)
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1);
else
dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, me);
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 53630b2bee0..e49616fc740 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -59,6 +59,7 @@
#include "DNA_space_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "DNA_smoke_types.h"
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
@@ -86,9 +87,14 @@
#include "BKE_mball.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
+#include "BKE_paint.h"
#include "BKE_particle.h"
+#include "BKE_pointcache.h"
#include "BKE_property.h"
+#include "BKE_smoke.h"
+#include "BKE_unit.h"
#include "BKE_utildefines.h"
+#include "smoke_API.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -208,11 +214,10 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt)
return 0;
if(!CHECK_OB_DRAWTEXTURE(v3d, dt))
return 0;
- if(ob==OBACT && (G.f & G_WEIGHTPAINT))
+ if(ob==OBACT && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
return 0;
- return ((G.fileflags & G_FILE_GAME_MAT) &&
- (G.fileflags & G_FILE_GAME_MAT_GLSL) && (dt >= OB_SHADED));
+ return (scene->gm.matmode == GAME_MAT_GLSL) && (dt >= OB_SHADED);
}
static int check_material_alpha(Base *base, Mesh *me, int glsl)
@@ -1846,7 +1851,7 @@ static void draw_em_fancy_edges(Scene *scene, View3D *v3d, Mesh *me, DerivedMesh
}
}
-static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, EditMesh *em)
+static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, EditMesh *em, UnitSettings *unit)
{
Mesh *me= ob->data;
EditEdge *eed;
@@ -1856,18 +1861,20 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
char val[32]; /* Stores the measurement display text here */
char conv_float[5]; /* Use a float conversion matching the grid size */
float area, col[3]; /* area of the face, color of the text to draw */
-
+ float grid= unit->system ? unit->scale_length : v3d->grid;
+ int do_split= unit->flag & USER_UNIT_OPT_SPLIT;
if(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))
return;
/* make the precission of the pronted value proportionate to the gridsize */
- if ((v3d->grid) < 0.01)
+
+ if (grid < 0.01f)
strcpy(conv_float, "%.6f");
- else if ((v3d->grid) < 0.1)
+ else if (grid < 0.1f)
strcpy(conv_float, "%.5f");
- else if ((v3d->grid) < 1.0)
+ else if (grid < 1.0f)
strcpy(conv_float, "%.4f");
- else if ((v3d->grid) < 10.0)
+ else if (grid < 10.0f)
strcpy(conv_float, "%.3f");
else
strcpy(conv_float, "%.2f");
@@ -1876,13 +1883,13 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
if(v3d->zbuf && (v3d->flag & V3D_ZBUF_SELECT)==0)
glDisable(GL_DEPTH_TEST);
- if(v3d->zbuf) bglPolygonOffset(rv3d->dist, 5.0);
+ if(v3d->zbuf) bglPolygonOffset(rv3d->dist, 5.0f);
if(me->drawflag & ME_DRAW_EDGELEN) {
UI_GetThemeColor3fv(TH_TEXT, col);
/* make color a bit more red */
- if(col[0]> 0.5) {col[1]*=0.7; col[2]*= 0.7;}
- else col[0]= col[0]*0.7 + 0.3;
+ if(col[0]> 0.5f) {col[1]*=0.7f; col[2]*= 0.7f;}
+ else col[0]= col[0]*0.7f + 0.3f;
glColor3fv(col);
for(eed= em->edges.first; eed; eed= eed->next) {
@@ -1891,16 +1898,19 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
VECCOPY(v1, eed->v1->co);
VECCOPY(v2, eed->v2->co);
- x= 0.5*(v1[0]+v2[0]);
- y= 0.5*(v1[1]+v2[1]);
- z= 0.5*(v1[2]+v2[2]);
+ x= 0.5f*(v1[0]+v2[0]);
+ y= 0.5f*(v1[1]+v2[1]);
+ z= 0.5f*(v1[2]+v2[2]);
if(v3d->flag & V3D_GLOBAL_STATS) {
Mat4MulVecfl(ob->obmat, v1);
Mat4MulVecfl(ob->obmat, v2);
}
+ if(unit->system)
+ bUnit_AsString(val, sizeof(val), VecLenf(v1, v2)*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE);
+ else
+ sprintf(val, conv_float, VecLenf(v1, v2));
- sprintf(val, conv_float, VecLenf(v1, v2));
view3d_object_text_draw_add(x, y, z, val, 0);
}
}
@@ -1911,8 +1921,8 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
UI_GetThemeColor3fv(TH_TEXT, col);
/* make color a bit more green */
- if(col[1]> 0.5) {col[0]*=0.7; col[2]*= 0.7;}
- else col[1]= col[1]*0.7 + 0.3;
+ if(col[1]> 0.5f) {col[0]*=0.7f; col[2]*= 0.7f;}
+ else col[1]= col[1]*0.7f + 0.3f;
glColor3fv(col);
for(efa= em->faces.first; efa; efa= efa->next) {
@@ -1935,7 +1945,11 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
else
area = AreaT3Dfl(v1, v2, v3);
- sprintf(val, conv_float, area);
+ if(unit->system)
+ bUnit_AsString(val, sizeof(val), area*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); // XXX should be B_UNIT_AREA
+ else
+ sprintf(val, conv_float, area);
+
view3d_object_text_draw_add(efa->cent[0], efa->cent[1], efa->cent[2], val, 0);
}
}
@@ -1946,8 +1960,8 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
UI_GetThemeColor3fv(TH_TEXT, col);
/* make color a bit more blue */
- if(col[2]> 0.5) {col[0]*=0.7; col[1]*= 0.7;}
- else col[2]= col[2]*0.7 + 0.3;
+ if(col[2]> 0.5f) {col[0]*=0.7f; col[1]*= 0.7f;}
+ else col[2]= col[2]*0.7f + 0.3f;
glColor3fv(col);
for(efa= em->faces.first; efa; efa= efa->next) {
@@ -1977,13 +1991,13 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
if( (e4->f & e1->f & SELECT) || (G.moving && (efa->v1->f & SELECT)) ) {
/* Vec 1 */
sprintf(val,"%.3f", VecAngle3(v4, v1, v2));
- VecLerpf(fvec, efa->cent, efa->v1->co, 0.8);
+ VecLerpf(fvec, efa->cent, efa->v1->co, 0.8f);
view3d_object_text_draw_add(efa->cent[0], efa->cent[1], efa->cent[2], val, 0);
}
if( (e1->f & e2->f & SELECT) || (G.moving && (efa->v2->f & SELECT)) ) {
/* Vec 2 */
sprintf(val,"%.3f", VecAngle3(v1, v2, v3));
- VecLerpf(fvec, efa->cent, efa->v2->co, 0.8);
+ VecLerpf(fvec, efa->cent, efa->v2->co, 0.8f);
view3d_object_text_draw_add(fvec[0], fvec[1], fvec[2], val, 0);
}
if( (e2->f & e3->f & SELECT) || (G.moving && (efa->v3->f & SELECT)) ) {
@@ -1992,14 +2006,14 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
sprintf(val,"%.3f", VecAngle3(v2, v3, v4));
else
sprintf(val,"%.3f", VecAngle3(v2, v3, v1));
- VecLerpf(fvec, efa->cent, efa->v3->co, 0.8);
+ VecLerpf(fvec, efa->cent, efa->v3->co, 0.8f);
view3d_object_text_draw_add(fvec[0], fvec[1], fvec[2], val, 0);
}
/* Vec 4 */
if(efa->v4) {
if( (e3->f & e4->f & SELECT) || (G.moving && (efa->v4->f & SELECT)) ) {
sprintf(val,"%.3f", VecAngle3(v3, v4, v1));
- VecLerpf(fvec, efa->cent, efa->v4->co, 0.8);
+ VecLerpf(fvec, efa->cent, efa->v4->co, 0.8f);
view3d_object_text_draw_add(fvec[0], fvec[1], fvec[2], val, 0);
}
}
@@ -2008,7 +2022,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E
if(v3d->zbuf) {
glEnable(GL_DEPTH_TEST);
- bglPolygonOffset(rv3d->dist, 0.0);
+ bglPolygonOffset(rv3d->dist, 0.0f);
}
}
@@ -2093,7 +2107,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
}
}
- if((me->drawflag & (ME_DRAWFACES)) || FACESEL_PAINT_TEST) { /* transp faces */
+ if((me->drawflag & (ME_DRAWFACES)) || paint_facesel_test(ob)) { /* transp faces */
unsigned char col1[4], col2[4], col3[4];
UI_GetThemeColor4ubv(TH_FACE, (char *)col1);
@@ -2181,7 +2195,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
}
if(me->drawflag & (ME_DRAW_EDGELEN|ME_DRAW_FACEAREA|ME_DRAW_EDGEANG))
- draw_em_measure_stats(v3d, rv3d, ob, em);
+ draw_em_measure_stats(v3d, rv3d, ob, em, &scene->unit);
}
if(dt>OB_WIRE) {
@@ -2252,7 +2266,7 @@ static void draw_mesh_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
// Unwanted combination.
- if (ob==OBACT && FACESEL_PAINT_TEST) draw_wire = 0;
+ if (ob==OBACT && paint_facesel_test(ob)) draw_wire = 0;
if(dt==OB_BOUNDBOX) {
draw_bounding_volume(scene, ob);
@@ -2265,12 +2279,12 @@ static void draw_mesh_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
else if(dt==OB_WIRE || totface==0) {
draw_wire = 1; /* draw wire only, no depth buffer stuff */
}
- else if( (ob==OBACT && (G.f & G_TEXTUREPAINT || FACESEL_PAINT_TEST)) ||
+ else if( (ob==OBACT && (ob->mode & OB_MODE_TEXTURE_PAINT || paint_facesel_test(ob))) ||
CHECK_OB_DRAWTEXTURE(v3d, dt))
{
- int faceselect= (ob==OBACT && FACESEL_PAINT_TEST);
+ int faceselect= (ob==OBACT && paint_facesel_test(ob));
- if ((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !(G.f&G_PICKSEL || FACESEL_PAINT_TEST) && !draw_wire) {
+ if ((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !(G.f&G_PICKSEL || paint_facesel_test(ob)) && !draw_wire) {
draw_mesh_object_outline(v3d, ob, dm);
}
@@ -2324,7 +2338,7 @@ static void draw_mesh_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
if(ob==OBACT) {
do_draw= 0;
- if( (G.f & G_WEIGHTPAINT)) {
+ if(ob && ob->mode & OB_MODE_WEIGHT_PAINT) {
/* enforce default material settings */
GPU_enable_material(0, NULL);
@@ -2344,12 +2358,13 @@ static void draw_mesh_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
GPU_disable_material();
}
- else if((G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) && me->mcol) {
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1);
- }
- else if(G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) {
- glColor3f(1.0f, 1.0f, 1.0f);
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 0);
+ else if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_TEXTURE_PAINT)) {
+ if(me->mcol)
+ dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1);
+ else {
+ glColor3f(1.0f, 1.0f, 1.0f);
+ dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 0);
+ }
}
else do_draw= 1;
}
@@ -3124,6 +3139,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
{
Object *ob=base->object;
ParticleSystemModifierData *psmd;
+ ParticleEditSettings *pset = PE_settings(scene);
ParticleSettings *part;
ParticleData *pars, *pa;
ParticleKey state, *states=0;
@@ -3152,9 +3168,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if(pars==0) return;
- // XXX what logic is this?
- if(!scene->obedit && psys_in_edit_mode(scene, psys)
- && psys->flag & PSYS_HAIR_DONE && part->draw_as==PART_DRAW_PATH)
+ /* don't draw normal paths in edit mode */
+ if(psys_in_edit_mode(scene, psys) && (pset->flag & PE_DRAW_PART)==0)
return;
if(part->draw_as==PART_DRAW_NOT) return;
@@ -3509,7 +3524,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
}
if((part->draw&PART_DRAW_NUM || part->draw&PART_DRAW_HEALTH) && !(G.f & G_RENDER_SHADOW)){
- strcpy(val, "");
+ val[0]= '\0';
if(part->draw&PART_DRAW_NUM)
sprintf(val, " %i", a);
@@ -3695,33 +3710,27 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
wmLoadMatrix(rv3d->viewmat);
}
-static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, ParticleSystem *psys, int dt)
+static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, PTCacheEdit *edit, int dt)
{
- ParticleEdit *edit = psys->edit;
- ParticleData *pa;
- ParticleCacheKey **path;
- ParticleEditKey *key;
+ ParticleCacheKey **cache, *path, *pkey;
+ PTCacheEditPoint *point;
+ PTCacheEditKey *key;
ParticleEditSettings *pset = PE_settings(scene);
- int i, k, totpart = psys->totpart, totchild=0, timed = pset->draw_timed;
+ int i, k, totpoint = edit->totpoint, timed = pset->flag & PE_FADE_TIME ? pset->fade_frames : 0;
+ int steps;
char nosel[4], sel[4];
float sel_col[3];
float nosel_col[3];
- char val[32];
+ float *pathcol = NULL, *pcol;
/* create path and child path cache if it doesn't exist already */
- if(psys->pathcache==0){
- PE_hide_keys_time(scene, psys,CFRA);
- psys_cache_paths(scene, ob, psys, CFRA,0);
- }
- if(psys->pathcache==0)
+ if(edit->pathcache==0)
+ psys_cache_edit_paths(scene, ob, edit, CFRA);
+
+ if(edit->pathcache==0)
return;
- if(pset->flag & PE_SHOW_CHILD && psys->part->draw_as == PART_DRAW_PATH) {
- if(psys->childcache==0)
- psys_cache_child_paths(scene, ob, psys, CFRA, 0);
- }
- else if(!(pset->flag & PE_SHOW_CHILD) && psys->childcache)
- free_child_path_cache(psys);
+ PE_hide_keys_time(scene, edit, CFRA);
/* opengl setup */
if((v3d->flag & V3D_ZBUF_SELECT)==0)
@@ -3737,65 +3746,50 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob
nosel_col[1]=(float)nosel[1]/255.0f;
nosel_col[2]=(float)nosel[2]/255.0f;
- if(psys->childcache)
- totchild = psys->totchildcache;
/* draw paths */
- if(timed)
+ if(timed) {
glEnable(GL_BLEND);
+ steps = (*edit->pathcache)->steps + 1;
+ pathcol = MEM_callocN(steps*4*sizeof(float), "particle path color data");
+ }
glEnableClientState(GL_VERTEX_ARRAY);
- if(dt > OB_WIRE) {
- /* solid shaded with lighting */
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
+ /* solid shaded with lighting */
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- }
- else {
- /* flat wire color */
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisable(GL_LIGHTING);
- UI_ThemeColor(TH_WIRE);
- }
+ glEnable(GL_COLOR_MATERIAL);
+ glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
/* only draw child paths with lighting */
if(dt > OB_WIRE)
glEnable(GL_LIGHTING);
- if(psys->part->draw_as == PART_DRAW_PATH) {
- for(i=0, path=psys->childcache; i<totchild; i++,path++){
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co);
- if(dt > OB_WIRE) {
- glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel);
- glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col);
+ /* draw paths without lighting */
+ cache=edit->pathcache;
+ for(i=0; i<totpoint; i++){
+ path = cache[i];
+ glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
+ glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel);
+
+ if(timed) {
+ for(k=0, pcol=pathcol, pkey=path; k<steps; k++, pkey++, pcol+=4){
+ VECCOPY(pcol, pkey->col);
+ pcol[3] = 1.0f - fabs((float)CFRA - pkey->time)/(float)pset->fade_frames;
}
- glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1);
+ glColorPointer(4, GL_FLOAT, 4*sizeof(float), pathcol);
}
- }
-
- if(dt > OB_WIRE)
- glDisable(GL_LIGHTING);
+ else
+ glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col);
- if(pset->brushtype == PE_BRUSH_WEIGHT) {
- glLineWidth(2.0f);
- glEnableClientState(GL_COLOR_ARRAY);
- glDisable(GL_LIGHTING);
+ glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1);
}
- /* draw parents last without lighting */
- for(i=0, pa=psys->particles, path = psys->pathcache; i<totpart; i++, pa++, path++){
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co);
- if(dt > OB_WIRE)
- glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel);
- if(dt > OB_WIRE || pset->brushtype == PE_BRUSH_WEIGHT)
- glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col);
+ if(pathcol) { MEM_freeN(pathcol); pathcol = pcol = NULL; }
- glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1);
- }
/* draw edit vertices */
if(pset->selectmode!=SCE_SELECT_PATH){
@@ -3805,61 +3799,74 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
if(pset->selectmode==SCE_SELECT_POINT){
+ float *pd=0,*pdata=0;
float *cd=0,*cdata=0;
- cd=cdata=MEM_callocN(edit->totkeys*(timed?4:3)*sizeof(float), "particle edit color data");
+ int totkeys = 0;
+
+ for (i=0, point=edit->points; i<totpoint; i++, point++)
+ if(!(point->flag & PEP_HIDE))
+ totkeys += point->totkey;
+
+ if(!edit->psys)
+ pd=pdata=MEM_callocN(totkeys*3*sizeof(float), "particle edit point data");
+ cd=cdata=MEM_callocN(totkeys*(timed?4:3)*sizeof(float), "particle edit color data");
+
+ for(i=0, point=edit->points; i<totpoint; i++, point++){
+ if(point->flag & PEP_HIDE)
+ continue;
+
+ for(k=0, key=point->keys; k<point->totkey; k++, key++){
+ if(pd) {
+ VECCOPY(pd, key->co);
+ pd += 3;
+ }
- for(i=0, pa=psys->particles; i<totpart; i++, pa++){
- for(k=0, key=edit->keys[i]; k<pa->totkey; k++, key++){
if(key->flag&PEK_SELECT){
VECCOPY(cd,sel_col);
}
else{
VECCOPY(cd,nosel_col);
}
+
if(timed)
- *(cd+3) = (key->flag&PEK_HIDE)?0.0f:1.0f;
+ *(cd+3) = 1.0f - fabs((float)CFRA - *key->time)/(float)pset->fade_frames;
+
cd += (timed?4:3);
}
}
cd=cdata;
- for(i=0, pa=psys->particles; i<totpart; i++, pa++){
- if((pa->flag & PARS_HIDE)==0){
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleEditKey), edit->keys[i]->world_co);
- glColorPointer((timed?4:3), GL_FLOAT, (timed?4:3)*sizeof(float), cd);
- glDrawArrays(GL_POINTS, 0, pa->totkey);
- }
- cd += (timed?4:3) * pa->totkey;
+ pd=pdata;
+ for(i=0, point=edit->points; i<totpoint; i++, point++){
+ if(point->flag & PEP_HIDE)
+ continue;
- if((pset->flag&PE_SHOW_TIME) && (pa->flag&PARS_HIDE)==0 && !(G.f & G_RENDER_SHADOW)){
- for(k=0, key=edit->keys[i]+k; k<pa->totkey; k++, key++){
- if(key->flag & PEK_HIDE) continue;
+ if(edit->psys)
+ glVertexPointer(3, GL_FLOAT, sizeof(PTCacheEditKey), point->keys->world_co);
+ else
+ glVertexPointer(3, GL_FLOAT, 3*sizeof(float), pd);
- sprintf(val," %.1f",*key->time);
- view3d_particle_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0);
- }
- }
+ glColorPointer((timed?4:3), GL_FLOAT, (timed?4:3)*sizeof(float), cd);
+
+ glDrawArrays(GL_POINTS, 0, point->totkey);
+
+ pd += pd ? 3 * point->totkey : 0;
+ cd += (timed?4:3) * point->totkey;
}
- if(cdata)
- MEM_freeN(cdata);
- cd=cdata=0;
+ if(pdata) { MEM_freeN(pdata); pd=pdata=0; }
+ if(cdata) { MEM_freeN(cdata); cd=cdata=0; }
}
else if(pset->selectmode == SCE_SELECT_END){
- for(i=0, pa=psys->particles; i<totpart; i++, pa++){
- if((pa->flag & PARS_HIDE)==0){
- key = edit->keys[i] + pa->totkey - 1;
+ for(i=0, point=edit->points; i<totpoint; i++, point++){
+ if((point->flag & PEP_HIDE)==0){
+ key = point->keys + point->totkey - 1;
if(key->flag & PEK_SELECT)
glColor3fv(sel_col);
else
glColor3fv(nosel_col);
/* has to be like this.. otherwise selection won't work, have try glArrayElement later..*/
glBegin(GL_POINTS);
- glVertex3fv(key->world_co);
+ glVertex3fv(key->flag & PEK_USE_WCO ? key->world_co : key->co);
glEnd();
-
- if((pset->flag & PE_SHOW_TIME) && !(G.f & G_RENDER_SHADOW)){
- sprintf(val," %.1f",*key->time);
- view3d_particle_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0);
- }
}
}
}
@@ -4396,7 +4403,7 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
if(ml==NULL) return 1;
/* in case solid draw, reset wire colors */
- if(mb->editelems && (ob->flag & SELECT)) {
+ if(ob->flag & SELECT) {
if(ob==OBACT) UI_ThemeColor(TH_ACTIVE);
else UI_ThemeColor(TH_SELECT);
}
@@ -4773,7 +4780,7 @@ static void drawSolidSelect(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base
drawDispListwire(&ob->disp);
}
else if(ob->type==OB_ARMATURE) {
- if(!(ob->flag & OB_POSEMODE))
+ if(!(ob->mode & OB_MODE_POSE))
draw_armature(scene, v3d, rv3d, base, OB_WIRE, 0);
}
@@ -4898,6 +4905,7 @@ void drawRBpivot(bRigidBodyJointConstraint *data)
void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
{
static int warning_recursive= 0;
+ ModifierData *md = NULL;
Object *ob;
Curve *cu;
RegionView3D *rv3d= ar->regiondata;
@@ -4921,7 +4929,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* xray delay? */
if((flag & DRAW_PICKING)==0 && (base->flag & OB_FROMDUPLI)==0) {
/* don't do xray in particle mode, need the z-buffer */
- if(!(G.f & G_PARTICLEEDIT)) {
+ if(!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
/* xray and transp are set when it is drawing the 2nd/3rd pass */
if(!v3d->xray && !v3d->transp && (ob->dtx & OB_DRAWXRAY) && !(ob->dtx & OB_DRAWTRANSP)) {
add_view3d_after(v3d, base, V3D_XRAY, flag);
@@ -5008,6 +5016,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* patch? children objects with a timeoffs change the parents. How to solve! */
/* if( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(scene, ob); */
+
+ /* draw paths... */
+ // TODO...
/* multiply view with object matrix */
wmMultMatrix(ob->obmat);
@@ -5067,7 +5078,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
dtx= 0;
/* faceselect exception: also draw solid when dt==wire, except in editmode */
- if(ob==OBACT && (G.f & (G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT))) {
+ if(ob==OBACT && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
if(ob->type==OB_MESH) {
if(ob==scene->obedit);
@@ -5280,11 +5291,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
for(psys=ob->particlesystem.first; psys; psys=psys->next)
draw_new_particle_system(scene, v3d, rv3d, base, psys, dt);
- if(G.f & G_PARTICLEEDIT && ob==OBACT) {
- psys= PE_get_current(scene, ob);
- if(psys && !scene->obedit && psys_in_edit_mode(scene, psys))
- draw_particle_edit(scene, v3d, rv3d, ob, psys, dt);
- }
view3d_particle_text_draw(v3d, ar);
wmMultMatrix(ob->obmat);
@@ -5292,6 +5298,34 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
//glDepthMask(GL_TRUE);
if(col) cpack(col);
}
+
+ if( (warning_recursive==0) &&
+ (flag & DRAW_PICKING)==0 &&
+ (!scene->obedit)
+ ) {
+
+ if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) {
+ PTCacheEdit *edit = PE_get_current(scene, ob);
+ if(edit) {
+ wmLoadMatrix(rv3d->viewmat);
+ draw_ptcache_edit(scene, v3d, rv3d, ob, edit, dt);
+ wmMultMatrix(ob->obmat);
+ }
+ }
+ }
+
+ /* draw code for smoke */
+ {
+ md = modifiers_findByType(ob, eModifierType_Smoke);
+ if (md) {
+ SmokeModifierData *smd = (SmokeModifierData *)md;
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && smd->domain->fluid) {
+ GPU_create_smoke(smd);
+ draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->res);
+ GPU_free_smoke(smd);
+ }
+ }
+ }
{
bConstraint *con;
@@ -5351,7 +5385,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if(G.f & G_RENDER_SHADOW) return;
/* object centers, need to be drawn in viewmat space for speed, but OK for picking select */
- if(ob!=OBACT || (G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))==0) {
+ if(ob!=OBACT || !(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
int do_draw_center= -1; /* defines below are zero or positive... */
if((scene->basact)==base)
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
new file mode 100644
index 00000000000..f4242c70139
--- /dev/null
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -0,0 +1,304 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributor(s): Daniel Genrich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+
+#include <string.h>
+#include <math.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "MEM_guardedalloc.h"
+
+#include "IMB_imbuf.h"
+
+
+#include "MTC_matrixops.h"
+
+#include "DNA_armature_types.h"
+#include "DNA_boid_types.h"
+#include "DNA_camera_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_constraint_types.h" // for drawing constraint
+#include "DNA_effect_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_meta_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_object_types.h"
+#include "DNA_object_force.h"
+#include "DNA_object_fluidsim.h"
+#include "DNA_particle_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_smoke_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_view3d_types.h"
+#include "DNA_world_types.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_editVert.h"
+#include "BLI_edgehash.h"
+#include "BLI_rand.h"
+
+#include "BKE_anim.h" //for the where_on_path function
+#include "BKE_curve.h"
+#include "BKE_constraint.h" // for the get_constraint_target function
+#include "BKE_DerivedMesh.h"
+#include "BKE_deform.h"
+#include "BKE_displist.h"
+#include "BKE_effect.h"
+#include "BKE_font.h"
+#include "BKE_global.h"
+#include "BKE_image.h"
+#include "BKE_key.h"
+#include "BKE_lattice.h"
+#include "BKE_mesh.h"
+#include "BKE_material.h"
+#include "BKE_mball.h"
+#include "BKE_modifier.h"
+#include "BKE_object.h"
+#include "BKE_paint.h"
+#include "BKE_particle.h"
+#include "BKE_property.h"
+#include "BKE_smoke.h"
+#include "BKE_unit.h"
+#include "BKE_utildefines.h"
+#include "smoke_API.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "GPU_draw.h"
+#include "GPU_material.h"
+#include "GPU_extensions.h"
+
+#include "ED_mesh.h"
+#include "ED_particle.h"
+#include "ED_screen.h"
+#include "ED_types.h"
+#include "ED_util.h"
+
+#include "UI_resources.h"
+#include "UI_interface_icons.h"
+
+#include "WM_api.h"
+#include "BLF_api.h"
+
+#include "GPU_extensions.h"
+
+#include "view3d_intern.h" // own include
+
+struct GPUTexture;
+
+/* draw slices of smoke is adapted from c++ code authored by: Johannes Schmid and Ingemar Rask, 2006, johnny@grob.org */
+static float cv[][3] = {
+ {1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, 1.0f}, {-1.0f, -1.0f, 1.0f}, {1.0f, -1.0f, 1.0f},
+ {1.0f, 1.0f, -1.0f}, {-1.0f, 1.0f, -1.0f}, {-1.0f, -1.0f, -1.0f}, {1.0f, -1.0f, -1.0f}
+};
+
+// edges have the form edges[n][0][xyz] + t*edges[n][1][xyz]
+static float edges[12][2][3] = {
+ {{1.0f, 1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}},
+ {{-1.0f, 1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}},
+ {{-1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}},
+ {{1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}},
+
+ {{1.0f, -1.0f, 1.0f}, {0.0f, 1.0f, 0.0f}},
+ {{-1.0f, -1.0f, 1.0f}, {0.0f, 1.0f, 0.0f}},
+ {{-1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}},
+ {{1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}},
+
+ {{-1.0f, 1.0f, 1.0f}, {1.0f, 0.0f, 0.0f}},
+ {{-1.0f, -1.0f, 1.0f}, {1.0f, 0.0f, 0.0f}},
+ {{-1.0f, -1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}},
+ {{-1.0f, 1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}}
+};
+
+int intersect_edges(float *points, float a, float b, float c, float d)
+{
+ int i;
+ float t;
+ int numpoints = 0;
+
+ for (i=0; i<12; i++) {
+ t = -(a*edges[i][0][0] + b*edges[i][0][1] + c*edges[i][0][2] + d)
+ / (a*edges[i][1][0] + b*edges[i][1][1] + c*edges[i][1][2]);
+ if ((t>0)&&(t<2)) {
+ points[numpoints * 3 + 0] = edges[i][0][0] + edges[i][1][0]*t;
+ points[numpoints * 3 + 1] = edges[i][0][1] + edges[i][1][1]*t;
+ points[numpoints * 3 + 2] = edges[i][0][2] + edges[i][1][2]*t;
+ numpoints++;
+ }
+ }
+ return numpoints;
+}
+
+static int convex(float *p0, float *up, float *a, float *b)
+{
+ // Vec3 va = a-p0, vb = b-p0;
+ float va[3], vb[3], tmp[3];
+ VECSUB(va, a, p0);
+ VECSUB(vb, b, p0);
+ Crossf(tmp, va, vb);
+ return INPR(up, tmp) >= 0;
+}
+
+// copied from gpu_extension.c
+static int is_pow2(int n)
+{
+ return ((n)&(n-1))==0;
+}
+
+static int larger_pow2(int n)
+{
+ if (is_pow2(n))
+ return n;
+
+ while(!is_pow2(n))
+ n= n&(n-1);
+
+ return n*2;
+}
+
+void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture *tex, int res[3])
+{
+ Object *ob = base->object;
+ RegionView3D *rv3d= ar->regiondata;
+
+ float viewnormal[3];
+ int i, j, n;
+ float d, d0, dd;
+ float *points = NULL;
+ int numpoints = 0;
+ float cor[3] = {1.,1.,1.};
+ int gl_depth = 0, gl_blend = 0;
+
+ glGetBooleanv(GL_BLEND, (GLboolean *)&gl_blend);
+ glGetBooleanv(GL_DEPTH_TEST, (GLboolean *)&gl_depth);
+
+ wmLoadMatrix(rv3d->viewmat);
+ wmMultMatrix(ob->obmat);
+
+ glDepthMask(GL_FALSE);
+ glDisable(GL_DEPTH_TEST);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ // get view vector
+ VECCOPY(viewnormal, rv3d->viewinv[2]);
+ Normalize(viewnormal);
+
+ // find cube vertex that is closest to the viewer
+ for (i=0; i<8; i++) {
+ float x,y,z;
+
+ x = cv[i][0] + viewnormal[0];
+ y = cv[i][1] + viewnormal[1];
+ z = cv[i][2] + viewnormal[2];
+
+ if ((x>=-1.0f)&&(x<=1.0f)
+ &&(y>=-1.0f)&&(y<=1.0f)
+ &&(z>=-1.0f)&&(z<=1.0f)) {
+ break;
+ }
+ }
+
+ GPU_texture_bind(tex, 0);
+
+ if (!GLEW_ARB_texture_non_power_of_two) {
+ cor[0] = (float)res[0]/(float)larger_pow2(res[0]);
+ cor[1] = (float)res[1]/(float)larger_pow2(res[1]);
+ cor[2] = (float)res[2]/(float)larger_pow2(res[2]);
+ }
+
+ // our slices are defined by the plane equation a*x + b*y +c*z + d = 0
+ // (a,b,c), the plane normal, are given by viewdir
+ // d is the parameter along the view direction. the first d is given by
+ // inserting previously found vertex into the plane equation
+ d0 = -(viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]);
+ dd = 2.0*d0/64.0f;
+ n = 0;
+
+ // printf("d0: %f, dd: %f\n", d0, dd);
+
+ points = MEM_callocN(sizeof(float)*12*3, "smoke_points_preview");
+
+ for (d = d0; d > -d0; d -= dd) {
+ float p0[3];
+ // intersect_edges returns the intersection points of all cube edges with
+ // the given plane that lie within the cube
+ numpoints = intersect_edges(points, viewnormal[0], viewnormal[1], viewnormal[2], d);
+
+ if (numpoints > 2) {
+ VECCOPY(p0, points);
+
+ // sort points to get a convex polygon
+ for(i = 1; i < numpoints - 1; i++)
+ {
+ for(j = i + 1; j < numpoints; j++)
+ {
+ if(convex(p0, viewnormal, &points[j * 3], &points[i * 3]))
+ {
+ float tmp2[3];
+ VECCOPY(tmp2, &points[i * 3]);
+ VECCOPY(&points[i * 3], &points[j * 3]);
+ VECCOPY(&points[j * 3], tmp2);
+ }
+ }
+ }
+
+ glBegin(GL_POLYGON);
+ for (i = 0; i < numpoints; i++) {
+ glColor3f(1.0, 1.0, 1.0);
+ glTexCoord3d((points[i * 3 + 0] + 1.0)*cor[0]/2.0, (points[i * 3 + 1] + 1)*cor[1]/2.0, (points[i * 3 + 2] + 1.0)*cor[2]/2.0);
+ glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
+ }
+ glEnd();
+ }
+ n++;
+ }
+
+ GPU_texture_unbind(tex);
+
+ MEM_freeN(points);
+
+ if(!gl_blend)
+ glDisable(GL_BLEND);
+ if(gl_depth)
+ {
+ glEnable(GL_DEPTH_TEST);
+ glDepthMask(GL_TRUE);
+ }
+}
+
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index e1f0b537241..97c5549e1ea 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -280,7 +280,7 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype)
/* copy last mode, then we can re-init the region maps */
rv3d->lastmode= stype;
-
+
keymap= WM_keymap_listbase(wm, "Object Mode", 0, 0);
if(ELEM(stype, 0, NS_MODE_OBJECT))
WM_event_add_keymap_handler(&ar->handlers, keymap);
@@ -304,6 +304,12 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype)
WM_event_add_keymap_handler(&ar->handlers, keymap);
else
WM_event_remove_keymap_handler(&ar->handlers, keymap);
+
+ keymap= WM_keymap_listbase(wm, "Pose", 0, 0);
+ if(stype==NS_MODE_POSE)
+ WM_event_add_keymap_handler(&ar->handlers, keymap);
+ else
+ WM_event_remove_keymap_handler(&ar->handlers, keymap);
keymap= WM_keymap_listbase(wm, "Metaball", 0, 0);
if(stype==NS_EDITMODE_MBALL)
@@ -319,7 +325,7 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype)
/* armature sketching needs to take over mouse */
keymap= WM_keymap_listbase(wm, "Armature_Sketch", 0, 0);
- if(stype==NS_EDITMODE_TEXT)
+ if(stype==NS_EDITMODE_ARMATURE)
WM_event_add_keymap_handler_priority(&ar->handlers, keymap, 10);
else
WM_event_remove_keymap_handler(&ar->handlers, keymap);
@@ -595,7 +601,7 @@ static void view3d_tools_area_init(wmWindowManager *wm, ARegion *ar)
static void view3d_tools_area_draw(const bContext *C, ARegion *ar)
{
- ED_region_panels(C, ar, 1, view3d_context_string(C), -1);
+ ED_region_panels(C, ar, 1, CTX_data_mode_string(C), -1);
}
static int view3d_context(const bContext *C, const char *member, bContextDataResult *result)
@@ -865,7 +871,7 @@ void ED_spacetype_view3d(void)
/* regions: main window */
art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region");
art->regionid = RGN_TYPE_WINDOW;
- art->keymapflag= ED_KEYMAP_FRAMES;
+ art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_GPENCIL;
art->draw= view3d_main_area_draw;
art->init= view3d_main_area_init;
art->free= view3d_main_area_free;
@@ -889,7 +895,7 @@ void ED_spacetype_view3d(void)
/* regions: tool(bar) */
art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region");
art->regionid = RGN_TYPE_TOOLS;
- art->minsizex= 120; // XXX
+ art->minsizex= 160; // XXX
art->minsizey= 50; // XXX
art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
art->listener= view3d_buttons_area_listener;
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index a50502e8265..7c305d59866 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -36,6 +36,7 @@
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
#include "DNA_camera_types.h"
+#include "DNA_gpencil_types.h"
#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
@@ -81,6 +82,7 @@
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_image.h"
+#include "ED_gpencil.h"
#include "ED_keyframing.h"
#include "ED_mesh.h"
#include "ED_object.h"
@@ -510,7 +512,7 @@ static void v3d_posearmature_buts(uiBlock *block, View3D *v3d, Object *ob, float
uiButSetFunc(but, validate_bonebutton_cb, bone, NULL);
uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
- QuatToEul(pchan->quat, tfp->ob_eul);
+ QuatToEulO(pchan->quat, tfp->ob_eul, pchan->rotmode); // XXX?
tfp->ob_eul[0]*= 180.0/M_PI;
tfp->ob_eul[1]*= 180.0/M_PI;
tfp->ob_eul[2]*= 180.0/M_PI;
@@ -839,7 +841,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event)
eul[0]= M_PI*tfp->ob_eul[0]/180.0;
eul[1]= M_PI*tfp->ob_eul[1]/180.0;
eul[2]= M_PI*tfp->ob_eul[2]/180.0;
- EulToQuat(eul, pchan->quat);
+ EulOToQuat(eul, pchan->rotmode, pchan->quat); // xxx?
}
/* no break, pass on */
case B_ARMATUREPANEL2:
@@ -1002,74 +1004,7 @@ static void view3d_panel_transform_spaces(const bContext *C, Panel *pa)
}
#endif // XXX not used
-static void weight_paint_buttons(Scene *scene, uiBlock *block)
-{
- VPaint *wpaint= scene->toolsettings->wpaint;
- Object *ob;
- ob= OBACT;
-
- if(ob==NULL || ob->type!=OB_MESH) return;
-
- /* XXX
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_REDR, "Weight:",10,170,225,19, &wpaint->weight, 0, 1, 10, 0, "Sets the current vertex group's bone deformation strength");
-
- uiDefBut(block, BUT, B_WEIGHT0_0 , "0", 10,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT1_4 , "1/4", 55,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT1_2 , "1/2", 100,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT3_4 , "3/4", 145,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT1_0 , "1", 190,150,45,19, 0, 0, 0, 0, 0, "");
-
- uiDefButF(block, NUMSLI, B_NOP, "Opacity ", 10,130,225,19, &wpaint->a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
-
- uiDefBut(block, BUT, B_OPA1_8 , "1/8", 10,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA1_4 , "1/4", 55,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA1_2 , "1/2", 100,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA3_4 , "3/4", 145,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA1_0 , "1", 190,110,45,19, 0, 0, 0, 0, 0, "");
-
- uiDefButF(block, NUMSLI, B_NOP, "Size ", 10,90,225,19, &wpaint->size, 2.0, 64.0, 0, 0, "The size of the brush");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_NOP, "Mix", 250,170,60,17, &wpaint->mode, 1.0, 0.0, 0, 0, "Mix the vertex colors");
- uiDefButS(block, ROW, B_NOP, "Add", 250,152,60,17, &wpaint->mode, 1.0, 1.0, 0, 0, "Add the vertex colors");
- uiDefButS(block, ROW, B_NOP, "Sub", 250,134,60,17, &wpaint->mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color");
- uiDefButS(block, ROW, B_NOP, "Mul", 250,116,60,17, &wpaint->mode, 1.0, 3.0, 0, 0, "Multiply the vertex color");
- uiDefButS(block, ROW, B_NOP, "Blur", 250, 98,60,17, &wpaint->mode, 1.0, 4.0, 0, 0, "Blur the weight with surrounding values");
- uiDefButS(block, ROW, B_NOP, "Lighter", 250, 80,60,17, &wpaint->mode, 1.0, 5.0, 0, 0, "Paint over darker areas only");
- uiDefButS(block, ROW, B_NOP, "Darker", 250, 62,60,17, &wpaint->mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only");
- uiBlockEndAlign(block);
- */
-
- /* draw options same as below */
- uiBlockBeginAlign(block);
- if (FACESEL_PAINT_TEST) {
- Mesh *me= ob->data;
- uiDefButBitI(block, TOG, ME_DRAWFACES, B_REDR, "Faces", 10,45,60,19, &me->drawflag, 0, 0, 0, 0, "Displays all faces as shades");
- uiDefButBitI(block,TOG, ME_DRAWEDGES, B_REDR,"Edges",70,45,60,19, &me->drawflag, 2.0, 0, 0, 0, "Displays edges of visible faces");
- uiDefButBitI(block,TOG, ME_HIDDENEDGES, B_REDR,"Hidden Edges",130,45,100,19, &me->drawflag, 2.0, 1.0, 0, 0, "Displays edges of hidden faces");
- } else{
- uiDefButBitC(block, TOG, OB_DRAWWIRE, B_REDR, "Wire", 10,45,75,19, &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 10,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Paint on all faces inside brush (otherwise only on face under mouse cursor)");
- uiDefButBitS(block, TOG, VP_SOFT, 0, "Vert Dist", 70,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Use distances to vertices (instead of all vertices of face)");
- uiDefButBitS(block, TOGN, VP_HARD, 0, "Soft", 130,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Use a soft brush");
- uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 190,20,60,19, &wpaint->flag, 0, 0, 0, 0, "Applies the vertex normal before painting");
- uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray", 250,20,55,19, &wpaint->flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse");
- uiBlockEndAlign(block);
-
- if(ob) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, VP_ONLYVGROUP, B_REDR, "Vgroup", 10,0,100,19, &wpaint->flag, 0, 0, 0, 0, "Only paint on vertices in the selected vertex group.");
- uiDefButBitS(block, TOG, VP_MIRROR_X, B_REDR, "X-Mirror", 110,0,100,19, &wpaint->flag, 0, 0, 0, 0, "Mirrored Paint, applying on mirrored Weight Group name");
- uiDefBut(block, BUT, B_CLR_WPAINT, "Clear", 210,0,100,19, NULL, 0, 0, 0, 0, "Removes reference to this deform group from all vertices");
- uiBlockEndAlign(block);
- }
-}
-
+#if 0
static void brush_idpoin_handle(bContext *C, ID *id, int event)
{
Brush **br = current_brush_source(CTX_data_scene(C));
@@ -1100,6 +1035,7 @@ static void brush_idpoin_handle(bContext *C, ID *id, int event)
break;
}
}
+#endif
static void view3d_panel_object(const bContext *C, Panel *pa)
{
@@ -1111,7 +1047,6 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
Object *ob= OBACT;
TransformProperties *tfp;
float lim;
- static char hexcol[128];
if(ob==NULL) return;
@@ -1125,13 +1060,13 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
// XXX uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) {
+ if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) {
}
else {
//bt= uiDefBut(block, TEX, B_IDNAME, "OB: ", 10,180,140,20, ob->id.name+2, 0.0, 21.0, 0, 0, "");
//uiButSetFunc(bt, test_idbutton_cb, ob->id.name, NULL);
- if((G.f & G_PARTICLEEDIT)==0) {
+ if((ob->mode & OB_MODE_PARTICLE_EDIT)==0) {
// uiBlockBeginAlign(block);
// uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_OBJECTPANELPARENT, "Par:", 160, 180, 140, 20, &ob->parent, "Parent Object");
if((ob->parent) && (ob->partype == PARBONE)) {
@@ -1152,26 +1087,9 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
if(ob->type==OB_MBALL) v3d_editmetaball_buts(block, ob, lim);
else v3d_editvertex_buts(C, block, v3d, ob, lim);
}
- else if(ob->flag & OB_POSEMODE) {
+ else if(ob->mode & OB_MODE_POSE) {
v3d_posearmature_buts(block, v3d, ob, lim);
}
- else if(G.f & G_WEIGHTPAINT) {
- BLI_strncpy(pa->drawname, "Weight Paint Properties", sizeof(pa->drawname));
- weight_paint_buttons(scene, block);
- }
- else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) {
- static float hsv[3], old[3]; // used as temp mem for picker
- Brush **br = current_brush_source(scene);
-
- BLI_strncpy(pa->drawname, "Paint Properties", sizeof(pa->drawname));
- if(br && *br)
- /* 'f' is for floating panel */
- uiBlockPickerButtons(block, (*br)->rgb, hsv, old, hexcol, 'f', B_REDR);
- }
- else if(G.f & G_PARTICLEEDIT){
- BLI_strncpy(pa->drawname, "Particle Edit Properties", sizeof(pa->drawname));
-// XXX particle_edit_buttons(block);
- }
else {
BoundBox *bb = NULL;
@@ -1257,133 +1175,6 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
}
}
-#if 0 // XXX not used anymore
-static void view3d_panel_background(const bContext *C, Panel *pa)
-{
- View3D *v3d= CTX_wm_view3d(C);
- uiBlock *block;
-
- block= uiLayoutFreeBlock(pa->layout);
- uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
-
- if(v3d->flag & V3D_DISPBGPIC) {
- if(v3d->bgpic==NULL) {
- v3d->bgpic= MEM_callocN(sizeof(BGpic), "bgpic");
- v3d->bgpic->size= 5.0;
- v3d->bgpic->blend= 0.5;
- v3d->bgpic->iuser.fie_ima= 2;
- v3d->bgpic->iuser.ok= 1;
- }
- }
-
- if(!(v3d->flag & V3D_DISPBGPIC)) {
- uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use Background Image", 10, 180, 150, 20, &v3d->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View");
- uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- }
- else {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use", 10, 225, 50, 20, &v3d->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View");
- uiDefButF(block, NUMSLI, B_REDR, "Blend:", 60, 225, 150, 20, &v3d->bgpic->blend, 0.0,1.0, 0, 0, "Set the transparency of the background image");
- uiDefButF(block, NUM, B_REDR, "Size:", 210, 225, 100, 20, &v3d->bgpic->size, 0.1, 250.0*v3d->grid, 100, 0, "Set the size (width) of the background image");
-
- uiDefButF(block, NUM, B_REDR, "X Offset:", 10, 205, 150, 20, &v3d->bgpic->xof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the horizontal offset of the background image");
- uiDefButF(block, NUM, B_REDR, "Y Offset:", 160, 205, 150, 20, &v3d->bgpic->yof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the vertical offset of the background image");
-
- ED_image_uiblock_panel(C, block, &v3d->bgpic->ima, &v3d->bgpic->iuser, B_REDR, B_REDR);
- uiBlockEndAlign(block);
- }
-}
-
-
-static void view3d_panel_properties(const bContext *C, Panel *pa)
-{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *arlast;
- Scene *scene= CTX_data_scene(C);
- View3D *v3d= CTX_wm_view3d(C);
- RegionView3D *rv3d;
- uiBlock *block;
- float *curs;
-
- block= uiLayoutFreeBlock(pa->layout);
- uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
-
- uiDefBut(block, LABEL, 1, "Grid:", 10, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_REDR, "Spacing:", 10, 200, 140, 19, &v3d->grid, 0.001, 100.0, 10, 0, "Set the distance between grid lines");
- uiDefButS(block, NUM, B_REDR, "Lines:", 10, 180, 140, 19, &v3d->gridlines, 0.0, 100.0, 100, 0, "Set the number of grid lines in perspective view");
- uiDefButS(block, NUM, B_REDR, "Divisions:", 10, 160, 140, 19, &v3d->gridsubdiv, 1.0, 100.0, 100, 0, "Set the number of grid lines");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "3D Display:", 160, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefButBitS(block, TOG, V3D_SHOW_FLOOR, B_REDR, "Grid Floor",160, 200, 150, 19, &v3d->gridflag, 0, 0, 0, 0, "Show the grid floor in free camera mode");
- uiDefButBitS(block, TOG, V3D_SHOW_X, B_REDR, "X Axis", 160, 176, 48, 19, &v3d->gridflag, 0, 0, 0, 0, "Show the X Axis line");
- uiDefButBitS(block, TOG, V3D_SHOW_Y, B_REDR, "Y Axis", 212, 176, 48, 19, &v3d->gridflag, 0, 0, 0, 0, "Show the Y Axis line");
- uiDefButBitS(block, TOG, V3D_SHOW_Z, B_REDR, "Z Axis", 262, 176, 48, 19, &v3d->gridflag, 0, 0, 0, 0, "Show the Z Axis line");
-
- uiDefBut(block, LABEL, 1, "View Camera:", 10, 140, 140, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefButF(block, NUM, B_REDR, "Lens:", 10, 120, 140, 19, &v3d->lens, 10.0, 120.0, 100, 0, "The lens angle in perspective view");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_REDR, "Clip Start:", 10, 96, 140, 19, &v3d->near, v3d->grid/100.0, 100.0, 10, 0, "Set the beginning of the range in which 3D objects are displayed (perspective view)");
- uiDefButF(block, NUM, B_REDR, "Clip End:", 10, 76, 140, 19, &v3d->far, 1.0, 10000.0*v3d->grid, 100, 0, "Set the end of the range in which 3D objects are displayed (perspective view)");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "3D Cursor:", 160, 150, 140, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- curs= give_cursor(scene, v3d);
- uiDefButF(block, NUM, B_REDR, "X:", 160, 130, 150, 22, curs, -10000.0*v3d->grid, 10000.0*v3d->grid, 10, 0, "X co-ordinate of the 3D cursor");
- uiDefButF(block, NUM, B_REDR, "Y:", 160, 108, 150, 22, curs+1, -10000.0*v3d->grid, 10000.0*v3d->grid, 10, 0, "Y co-ordinate of the 3D cursor");
- uiDefButF(block, NUM, B_REDR, "Z:", 160, 86, 150, 22, curs+2, -10000.0*v3d->grid, 10000.0*v3d->grid, 10, 0, "Z co-ordinate of the 3D cursor");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "Display:", 10, 50, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_SELECT_OUTLINE, B_REDR, "Outline Selected", 10, 30, 140, 19, &v3d->flag, 0, 0, 0, 0, "Highlight selected objects with an outline, in Solid, Shaded or Textured viewport shading modes");
- uiDefButBitS(block, TOG, V3D_DRAW_CENTERS, B_REDR, "All Object Centers", 10, 10, 140, 19, &v3d->flag, 0, 0, 0, 0, "Draw the center points on all objects");
- uiDefButBitS(block, TOGN, V3D_HIDE_HELPLINES, B_REDR, "Relationship Lines", 10, -10, 140, 19, &v3d->flag, 0, 0, 0, 0, "Draw dashed lines indicating Parent, Constraint, or Hook relationships");
- uiDefButBitS(block, TOG, V3D_SOLID_TEX, B_REDR, "Solid Tex", 10, -30, 140, 19, &v3d->flag2, 0, 0, 0, 0, "Display textures in Solid draw type (Shift T)");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "View Locking:", 160, 60, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Object:", 160, 40, 150, 19, &v3d->ob_centre, "Lock view to center to this Object");
- uiDefBut(block, TEX, B_REDR, "Bone:", 160, 20, 150, 19, v3d->ob_centre_bone, 1, 31, 0, 0, "If view locked to Object, use this Bone to lock to view to");
- uiBlockEndAlign(block);
-
- /* last region is always 3d... a bit weak */
- arlast= sa->regionbase.last;
- uiBlockBeginAlign(block);
- if(arlast->alignment==RGN_ALIGN_QSPLIT) {
- arlast= arlast->prev;
- rv3d= arlast->regiondata;
-
- uiDefButO(block, BUT, "SCREEN_OT_region_foursplit", WM_OP_EXEC_REGION_WIN, "End 4-Split View", 160, -10, 150, 19, "Join the 3D View");
- uiDefButBitS(block, TOG, RV3D_LOCKED, B_RV3D_LOCKED, "Lock", 160, -30, 50, 19, &rv3d->viewlock, 0, 0, 0, 0, "");
- uiDefButBitS(block, TOG, RV3D_BOXVIEW, B_RV3D_BOXVIEW, "Box", 210, -30, 50, 19, &rv3d->viewlock, 0, 0, 0, 0, "");
- uiDefButBitS(block, TOG, RV3D_BOXCLIP, B_RV3D_BOXCLIP, "Clip", 260, -30, 50, 19, &rv3d->viewlock, 0, 0, 0, 0, "");
- }
- else
- uiDefButO(block, BUT, "SCREEN_OT_region_foursplit", WM_OP_EXEC_REGION_WIN, "4-Split View", 160, -10, 150, 19, "Split 3D View in 4 parts");
-
- uiBlockEndAlign(block);
-
-
-// XXX
-// uiDefBut(block, LABEL, 1, "Keyframe Display:", 160, -2, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
-// uiBlockBeginAlign(block);
-// uiDefButBitS(block, TOG, ANIMFILTER_ACTIVE, B_REDR, "Active",160, -22, 50, 19, &v3d->keyflags, 0, 0, 0, 0, "Show keyframes for active element only (i.e. active bone or active material)");
-// uiDefButBitS(block, TOG, ANIMFILTER_MUTED, B_REDR, "Muted",210, -22, 50, 19, &v3d->keyflags, 0, 0, 0, 0, "Show keyframes in muted channels");
-// uiDefButBitS(block, TOG, ANIMFILTER_LOCAL, B_REDR, "Local",260, -22, 50, 19, &v3d->keyflags, 0, 0, 0, 0, "Show keyframes directly connected to datablock");
-// if ((v3d->keyflags & ANIMFILTER_LOCAL)==0) {
-// uiDefButBitS(block, TOGN, ANIMFILTER_NOMAT, B_REDR, "Material",160, -42, 75, 19, &v3d->keyflags, 0, 0, 0, 0, "Show keyframes for any available Materials");
-// uiDefButBitS(block, TOGN, ANIMFILTER_NOSKEY, B_REDR, "ShapeKey",235, -42, 75, 19, &v3d->keyflags, 0, 0, 0, 0, "Show keyframes for any available Shape Keys");
-// }
- uiBlockEndAlign(block);
-}
-#endif // XXX not used anymore
-
#if 0
static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3D_HANDLER_PREVIEW
{
@@ -1410,33 +1201,6 @@ static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3
}
#endif
-#if 0
-static void view3d_panel_gpencil(const bContext *C, Panel *pa)
-{
- View3D *v3d= CTX_wm_view3d(C);
- uiBlock *block;
-
- block= uiLayoutFreeBlock(pa->layout);
-
- /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */
- if (v3d->flag2 & V3D_DISPGP) {
-// if (v3d->gpd == NULL)
-// XXX gpencil_data_setactive(ar, gpencil_data_addnew());
- }
-
- if (v3d->flag2 & V3D_DISPGP) {
-// XXX bGPdata *gpd= v3d->gpd;
-
- /* draw button for showing gpencil settings and drawings */
- uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &v3d->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View (draw using Shift-LMB)");
- }
- else {
- uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &v3d->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View");
- uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- }
-}
-#endif
-
static void delete_sketch_armature(bContext *C, void *arg1, void *arg2)
{
BIF_deleteSketch(C);
@@ -1627,6 +1391,12 @@ void view3d_buttons_register(ARegionType *art)
strcpy(pt->label, "Transform");
pt->draw= view3d_panel_object;
BLI_addtail(&art->paneltypes, pt);
+
+ pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
+ strcpy(pt->idname, "VIEW3D_PT_gpencil");
+ strcpy(pt->label, "Grease Pencil");
+ pt->draw= gpencil_panel_standard;
+ BLI_addtail(&art->paneltypes, pt);
/*
pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel properties");
strcpy(pt->idname, "VIEW3D_PT_properties");
@@ -1634,13 +1404,6 @@ void view3d_buttons_register(ARegionType *art)
pt->draw= view3d_panel_properties;
BLI_addtail(&art->paneltypes, pt);
-
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel background");
- strcpy(pt->idname, "VIEW3D_PT_background");
- strcpy(pt->label, "Background Image");
- pt->draw= view3d_panel_background;
- BLI_addtail(&art->paneltypes, pt);
-
pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel transform spaces");
strcpy(pt->idname, "VIEW3D_PT_transform spaces");
strcpy(pt->label, "Transform Orientations");
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 5e6bfe89165..66113ec4941 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -59,9 +59,11 @@
#include "BKE_key.h"
#include "BKE_object.h"
#include "BKE_global.h"
+#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_utildefines.h"
+#include "BKE_unit.h"
#include "RE_pipeline.h" // make_stars
@@ -76,6 +78,7 @@
#include "ED_armature.h"
#include "ED_keyframing.h"
+#include "ED_gpencil.h"
#include "ED_mesh.h"
#include "ED_screen.h"
#include "ED_space_api.h"
@@ -234,15 +237,18 @@ static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, flo
}
-static void drawgrid(ARegion *ar, View3D *v3d)
+#define GRID_MIN_PX 6.0f
+
+static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, char **grid_unit)
{
/* extern short bgpicmode; */
RegionView3D *rv3d= ar->regiondata;
float wx, wy, x, y, fw, fx, fy, dx;
float vec4[4];
char col[3], col2[3];
- short sublines = v3d->gridsubdiv;
+ *grid_unit= NULL;
+
vec4[0]=vec4[1]=vec4[2]=0.0;
vec4[3]= 1.0;
Mat4MulVec4fl(rv3d->persmat, vec4);
@@ -256,7 +262,8 @@ static void drawgrid(ARegion *ar, View3D *v3d)
x= (wx)*fx/fw;
y= (wy)*fy/fw;
- vec4[0]=vec4[1]=v3d->grid;
+ vec4[0]=vec4[1]= (unit->system) ? 1.0 : v3d->grid;
+
vec4[2]= 0.0;
vec4[3]= 1.0;
Mat4MulVec4fl(rv3d->persmat, vec4);
@@ -272,72 +279,115 @@ static void drawgrid(ARegion *ar, View3D *v3d)
/* check zoom out */
UI_ThemeColor(TH_GRID);
- if(dx<6.0) {
- v3d->gridview*= sublines;
- dx*= sublines;
-
- if(dx<6.0) {
+ if(unit->system) {
+ /* Use GRID_MIN_PX*2 for units because very very small grid
+ * items are less useful when dealing with units */
+ void *usys;
+ int len, i;
+ double scalar;
+ float dx_scalar;
+ float blend_fac;
+
+ bUnit_GetSystem(&usys, &len, unit->system, B_UNIT_LENGTH);
+
+ if(usys) {
+ i= len;
+ while(i--) {
+ scalar= bUnit_GetScaler(usys, i);
+
+ dx_scalar = dx * scalar * unit->scale_length;
+ if (dx_scalar < (GRID_MIN_PX*2))
+ continue;
+
+ /* Store the smallest drawn grid size units name so users know how big each grid cell is */
+ if(*grid_unit==NULL) {
+ *grid_unit= bUnit_GetNameDisplay(usys, i);
+ v3d->gridview= (scalar * unit->scale_length);
+ }
+ blend_fac= 1-((GRID_MIN_PX*2)/dx_scalar);
+
+ /* tweak to have the fade a bit nicer */
+ blend_fac= (blend_fac * blend_fac) * 2.0f;
+ CLAMP(blend_fac, 0.3f, 1.0f);
+
+
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, blend_fac);
+
+ drawgrid_draw(ar, wx, wy, x, y, dx_scalar);
+ }
+ }
+ }
+ else {
+ short sublines = v3d->gridsubdiv;
+
+ if(dx<GRID_MIN_PX) {
v3d->gridview*= sublines;
dx*= sublines;
- if(dx<6.0) {
+ if(dx<GRID_MIN_PX) {
v3d->gridview*= sublines;
- dx*=sublines;
- if(dx<6.0);
- else {
- UI_ThemeColor(TH_GRID);
+ dx*= sublines;
+
+ if(dx<GRID_MIN_PX) {
+ v3d->gridview*= sublines;
+ dx*=sublines;
+ if(dx<GRID_MIN_PX);
+ else {
+ UI_ThemeColor(TH_GRID);
+ drawgrid_draw(ar, wx, wy, x, y, dx);
+ }
+ }
+ else { // start blending out
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*10));
drawgrid_draw(ar, wx, wy, x, y, dx);
+
+ UI_ThemeColor(TH_GRID);
+ drawgrid_draw(ar, wx, wy, x, y, sublines*dx);
}
}
- else { // start blending out
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
+ else { // start blending out (GRID_MIN_PX < dx < (GRID_MIN_PX*10))
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*10));
drawgrid_draw(ar, wx, wy, x, y, dx);
-
+
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, sublines*dx);
}
}
- else { // start blending out (6 < dx < 60)
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
- drawgrid_draw(ar, wx, wy, x, y, dx);
-
- UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, sublines*dx);
- }
- }
- else {
- if(dx>60.0) { // start blending in
- v3d->gridview/= sublines;
- dx/= sublines;
- if(dx>60.0) { // start blending in
+ else {
+ if(dx>(GRID_MIN_PX*10)) { // start blending in
v3d->gridview/= sublines;
dx/= sublines;
- if(dx>60.0) {
- UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, dx);
+ if(dx>(GRID_MIN_PX*10)) { // start blending in
+ v3d->gridview/= sublines;
+ dx/= sublines;
+ if(dx>(GRID_MIN_PX*10)) {
+ UI_ThemeColor(TH_GRID);
+ drawgrid_draw(ar, wx, wy, x, y, dx);
+ }
+ else {
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*10));
+ drawgrid_draw(ar, wx, wy, x, y, dx);
+ UI_ThemeColor(TH_GRID);
+ drawgrid_draw(ar, wx, wy, x, y, dx*sublines);
+ }
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*10));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx*sublines);
}
}
else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/(GRID_MIN_PX*10));
drawgrid_draw(ar, wx, wy, x, y, dx);
- UI_ThemeColor(TH_GRID);
+ UI_ThemeColor(TH_GRID);
drawgrid_draw(ar, wx, wy, x, y, dx*sublines);
}
}
- else {
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
- drawgrid_draw(ar, wx, wy, x, y, dx);
- UI_ThemeColor(TH_GRID);
- drawgrid_draw(ar, wx, wy, x, y, dx*sublines);
- }
}
+
x+= (wx);
y+= (wy);
UI_GetThemeColor3ubv(TH_GRID, col);
@@ -361,7 +411,7 @@ static void drawgrid(ARegion *ar, View3D *v3d)
glDepthMask(1); // enable write in zbuffer
}
-
+#undef GRID_MIN_PX
static void drawfloor(Scene *scene, View3D *v3d)
{
@@ -749,7 +799,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
}
}
}
- else if(ob->pose && (ob->flag & OB_POSEMODE)) {
+ else if(ob->pose && (ob->mode & OB_MODE_POSE)) {
bPoseChannel *pchan;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if((pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) {
@@ -1042,7 +1092,8 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
{
RegionView3D *rv3d= ar->regiondata;
- struct Base *base;
+ struct Base *base = scene->basact;
+ rcti winrct;
/*for 2.43 release, don't use glext and just define the constant.
this to avoid possibly breaking platforms before release.*/
@@ -1054,9 +1105,11 @@ void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
int m;
#endif
- if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || (FACESEL_PAINT_TEST));
- else if((G.f & G_TEXTUREPAINT) && scene->toolsettings && (scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE));
- else if((G.f & G_PARTICLEEDIT) && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT));
+ if(base && (base->object->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT) ||
+ paint_facesel_test(base->object)));
+ else if((base && (base->object->mode & OB_MODE_TEXTURE_PAINT)) &&
+ scene->toolsettings && (scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE));
+ else if((base && (base->object->mode & OB_MODE_PARTICLE_EDIT)) && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT));
else if(scene->obedit && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT));
else {
v3d->flag &= ~V3D_NEEDBACKBUFDRAW;
@@ -1086,6 +1139,9 @@ void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
glDisable(GL_DITHER);
+ region_scissor_winrct(ar, &winrct);
+ glScissor(winrct.xmin, winrct.ymin, winrct.xmax - winrct.xmin, winrct.ymax - winrct.ymin);
+
glClearColor(0.0, 0.0, 0.0, 0.0);
if(v3d->zbuf) {
glEnable(GL_DEPTH_TEST);
@@ -1101,7 +1157,6 @@ void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
G.f |= G_BACKBUFSEL;
- base= (scene->basact);
if(base && (base->lay & v3d->lay)) {
draw_object_backbufsel(scene, v3d, rv3d, base->object);
}
@@ -1366,7 +1421,8 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
- glaDefine2DArea(&ar->winrct);
+// glaDefine2DArea(&ar->winrct);
+ ED_region_pixelspace(ar);
glEnable(GL_BLEND);
@@ -1805,13 +1861,13 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
/* *********************** customdata **************** */
/* goes over all modes and view3d settings */
-static CustomDataMask get_viewedit_datamask(bScreen *screen)
+static CustomDataMask get_viewedit_datamask(bScreen *screen, Scene *scene, Object *ob)
{
CustomDataMask mask = CD_MASK_BAREMESH;
ScrArea *sa;
/* check if we need tfaces & mcols due to face select or texture paint */
- if(FACESEL_PAINT_TEST || G.f & G_TEXTUREPAINT)
+ if(paint_facesel_test(ob) || (ob && ob->mode & OB_MODE_TEXTURE_PAINT))
mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
/* check if we need tfaces & mcols due to view mode */
@@ -1825,23 +1881,22 @@ static CustomDataMask get_viewedit_datamask(bScreen *screen)
if((view->drawtype == OB_TEXTURE) || ((view->drawtype == OB_SOLID) && (view->flag2 & V3D_SOLID_TEX))) {
mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
- if((G.fileflags & G_FILE_GAME_MAT) &&
- (G.fileflags & G_FILE_GAME_MAT_GLSL)) {
+ if(scene->gm.matmode == GAME_MAT_GLSL)
mask |= CD_MASK_ORCO;
- }
}
}
}
/* check if we need mcols due to vertex paint or weightpaint */
- if(G.f & G_VERTEXPAINT)
- mask |= CD_MASK_MCOL;
- if(G.f & G_WEIGHTPAINT)
- mask |= CD_MASK_WEIGHT_MCOL;
-
- if(G.f & G_SCULPTMODE)
- mask |= CD_MASK_MDISPS;
-
+ if(ob) {
+ if(ob->mode & OB_MODE_VERTEX_PAINT)
+ mask |= CD_MASK_MCOL;
+ if(ob->mode & OB_MODE_WEIGHT_PAINT)
+ mask |= CD_MASK_WEIGHT_MCOL;
+ if(ob->mode & OB_MODE_SCULPT)
+ mask |= CD_MASK_MDISPS;
+ }
+
return mask;
}
@@ -1855,9 +1910,10 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
Object *ob;
int retopo= 0, sculptparticle= 0;
Object *obact = OBACT;
+ char *grid_unit= NULL;
/* from now on all object derived meshes check this */
- v3d->customdata_mask= get_viewedit_datamask(CTX_wm_screen(C));
+ v3d->customdata_mask= get_viewedit_datamask(CTX_wm_screen(C), scene, obact);
/* shadow buffers, before we setup matrices */
if(draw_glsl_material(scene, NULL, v3d, v3d->drawtype))
@@ -1929,7 +1985,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
}
else {
ED_region_pixelspace(ar);
- drawgrid(ar, v3d);
+ drawgrid(&scene->unit, ar, v3d, &grid_unit);
/* XXX make function? replaces persp(1) */
glMatrixMode(GL_PROJECTION);
wmLoadMatrix(rv3d->winmat);
@@ -1983,7 +2039,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
}
// retopo= retopo_mesh_check() || retopo_curve_check();
- sculptparticle= (G.f & (G_SCULPTMODE|G_PARTICLEEDIT)) && !scene->obedit;
+ sculptparticle= (obact && obact->mode & (OB_MODE_SCULPT|OB_MODE_PARTICLE_EDIT)) && !scene->obedit;
if(retopo)
view3d_update_depths(ar, v3d);
@@ -1996,7 +2052,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
}
if(!retopo && sculptparticle && !(obact && (obact->dtx & OB_DRAWXRAY))) {
- if(G.f & G_SCULPTMODE)
+ if(obact && obact->mode & OB_MODE_SCULPT)
draw_sculpt_depths(scene, ar, v3d);
view3d_update_depths(ar, v3d);
}
@@ -2012,7 +2068,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used!
if(!retopo && sculptparticle && (obact && (OBACT->dtx & OB_DRAWXRAY))) {
- if(G.f & G_SCULPTMODE)
+ if(obact && obact->mode & OB_MODE_SCULPT)
draw_sculpt_depths(scene, ar, v3d);
view3d_update_depths(ar, v3d);
}
@@ -2028,8 +2084,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
}
/* draw grease-pencil stuff */
-// if (v3d->flag2 & V3D_DISPGP)
-// draw_gpencil_3dview(ar, 1);
+ //if (v3d->flag2 & V3D_DISPGP)
+ draw_gpencil_3dview((bContext *)C, 1);
BDR_drawSketch(C);
@@ -2045,9 +2101,9 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
if(rv3d->persp>1) drawviewborder(scene, ar, v3d);
if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar);
- /* draw grease-pencil stuff */
+ /* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */
// if (v3d->flag2 & V3D_DISPGP)
-// draw_gpencil_3dview(ar, 0);
+ draw_gpencil_3dview((bContext *)C, 0);
drawcursor(scene, ar, v3d);
@@ -2060,19 +2116,23 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
if(U.uiflag & USER_SHOW_VIEWPORTNAME) {
draw_viewport_name(ar, v3d);
}
-
+ if (grid_unit) { /* draw below the viewport name */
+ UI_ThemeColor(TH_TEXT_HI);
+ BLF_draw_default(10, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, grid_unit);
+ }
+
ob= OBACT;
if(U.uiflag & USER_DRAWVIEWINFO)
draw_selected_name(scene, ob, v3d);
/* XXX here was the blockhandlers for floating panels */
- if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT) {
+ if(ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) {
v3d->flag |= V3D_NEEDBACKBUFDRAW;
// XXX addafterqueue(ar->win, BACKBUFDRAW, 1);
}
- if((G.f & G_PARTICLEEDIT) && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT)) {
+ if((ob && ob->mode & OB_MODE_PARTICLE_EDIT) && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT)) {
v3d->flag |= V3D_NEEDBACKBUFDRAW;
// XXX addafterqueue(ar->win, BACKBUFDRAW, 1);
}
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index acb3a2257dc..a7ea19e49f9 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -54,6 +54,7 @@
#include "BKE_depsgraph.h"
#include "BKE_object.h"
#include "BKE_global.h"
+#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
@@ -856,6 +857,7 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
RegionView3D *rv3d= CTX_wm_region_view3d(C);
Scene *scene= CTX_data_scene(C);
Base *base;
+ float *curs;
int center= RNA_boolean_get(op->ptr, "center");
@@ -865,6 +867,10 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
if(center) {
min[0]= min[1]= min[2]= 0.0f;
max[0]= max[1]= max[2]= 0.0f;
+
+ /* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */
+ curs= give_cursor(scene, v3d);
+ curs[0]= curs[1]= curs[2]= 0.0;
}
else {
INIT_MINMAX(min, max);
@@ -904,6 +910,9 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
rv3d->persp= V3D_PERSP;
smooth_view(C, NULL, v3d->camera, new_ofs, NULL, &new_dist, NULL);
}
+ else {
+ smooth_view(C, NULL, NULL, new_ofs, NULL, &new_dist, NULL);
+ }
}
// XXX BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
@@ -947,14 +956,14 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
INIT_MINMAX(min, max);
- if (G.f & G_WEIGHTPAINT) {
+ if (ob && ob->mode & OB_MODE_WEIGHT_PAINT) {
/* hardcoded exception, we look for the one selected armature */
/* this is weak code this way, we should make a generic active/selection callback interface once... */
Base *base;
for(base=scene->base.first; base; base= base->next) {
if(TESTBASELIB(v3d, base)) {
if(base->object->type==OB_ARMATURE)
- if(base->object->flag & OB_POSEMODE)
+ if(base->object->mode & OB_MODE_POSE)
break;
}
}
@@ -966,7 +975,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
if(obedit) {
ok = minmax_verts(obedit, min, max); /* only selected */
}
- else if(ob && (ob->flag & OB_POSEMODE)) {
+ else if(ob && (ob->mode & OB_MODE_POSE)) {
if(ob->pose) {
bArmature *arm= ob->data;
bPoseChannel *pchan;
@@ -987,10 +996,10 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
}
}
}
- else if (FACESEL_PAINT_TEST) {
+ else if (paint_facesel_test(ob)) {
// XXX ok= minmax_tface(min, max);
}
- else if (G.f & G_PARTICLEEDIT) {
+ else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT)) {
ok= PE_minmax(scene, min, max);
}
else {
@@ -2196,7 +2205,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
rv3d->view = 0;
//printf("passing here \n");
//
- if (scene->obedit==NULL && ob && !(ob->flag & OB_POSEMODE)) {
+ if (scene->obedit==NULL && ob && !(ob->mode & OB_MODE_POSE)) {
use_sel = 1;
}
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 26ca5a07973..305b6956037 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -61,6 +61,7 @@
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
+#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_screen.h"
#include "BKE_utildefines.h" /* for VECCOPY */
@@ -79,6 +80,7 @@
#include "RNA_access.h"
#include "RNA_define.h"
+#include "RNA_enum_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -104,16 +106,6 @@
* This can be cleaned when I make some new 'mode' icons.
*/
-#define V3D_OBJECTMODE_SEL ICON_OBJECT_DATA
-#define V3D_EDITMODE_SEL ICON_EDITMODE_HLT
-#define V3D_SCULPTMODE_SEL ICON_SCULPTMODE_HLT
-#define V3D_FACESELECT_SEL ICON_FACESEL_HLT /* this is not a mode anymore - just a switch */
-#define V3D_VERTEXPAINTMODE_SEL ICON_VPAINT_HLT
-#define V3D_TEXTUREPAINTMODE_SEL ICON_TPAINT_HLT
-#define V3D_WEIGHTPAINTMODE_SEL ICON_WPAINT_HLT
-#define V3D_POSEMODE_SEL ICON_POSE_HLT
-#define V3D_PARTICLEEDITMODE_SEL ICON_ANIM
-
#define TEST_EDITMESH if(obedit==0) return; \
if( (v3d->lay & obedit->lay)==0 ) return;
@@ -134,29 +126,6 @@ static int retopo_mesh_paint_check() {return 0;}
/* end XXX ************* */
-
-/* well... in this file a lot of view mode manipulation happens, so let's have it defined here */
-void ED_view3d_exit_paint_modes(bContext *C)
-{
- if(G.f & G_TEXTUREPAINT)
- WM_operator_name_call(C, "PAINT_OT_texture_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(G.f & G_VERTEXPAINT)
- WM_operator_name_call(C, "PAINT_OT_vertex_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- else if(G.f & G_WEIGHTPAINT)
- WM_operator_name_call(C, "PAINT_OT_weight_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
-
- if(G.f & G_SCULPTMODE)
- WM_operator_name_call(C, "SCULPT_OT_sculptmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- if(G.f & G_PARTICLEEDIT)
- WM_operator_name_call(C, "PARTICLE_OT_particle_edit_toggle", WM_OP_EXEC_REGION_WIN, NULL);
-
- G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE+G_PARTICLEEDIT);
-}
-
-
-
-
-
static void do_view3d_header_buttons(bContext *C, void *arg, int event);
#define B_SCENELOCK 101
@@ -219,55 +188,6 @@ static void handle_view3d_lock(bContext *C)
}
}
-/* XXX; all this context stuff... should become operator */
-void do_layer_buttons(bContext *C, short event)
-{
- wmWindow *win= CTX_wm_window(C);
- Scene *scene= CTX_data_scene(C);
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
- static int oldlay= 1;
- short shift, alt, ctrl;
-
- shift= win->eventstate->shift;
- alt= win->eventstate->alt;
- ctrl= win->eventstate->ctrl;
-
- if(v3d==0) return;
- if(v3d->localview) return;
-
- if(event==-1 && ctrl) {
- v3d->scenelock= !v3d->scenelock;
- do_view3d_header_buttons(C, NULL, B_SCENELOCK);
- } else if (event<0) {
- if(v3d->lay== (1<<20)-1) {
- if(event==-2 || shift) v3d->lay= oldlay;
- }
- else {
- oldlay= v3d->lay;
- v3d->lay= (1<<20)-1;
- }
-
- if(v3d->scenelock) handle_view3d_lock(C);
-
- /* new layers might need unflushed events events */
- DAG_scene_update_flags(scene, v3d->lay); /* tags all that moves and flushes */
- }
- else {
- if(alt) {
- if(event<11) event+= 10;
- }
- if(shift) {
- if(v3d->lay & (1<<event)) v3d->lay -= (1<<event);
- else v3d->lay += (1<<event);
- }
- do_view3d_header_buttons(C, NULL, event+B_LAY);
- }
- ED_area_tag_redraw(sa);
-
- if(v3d->drawtype == OB_SHADED) reshadeall_displist(scene);
-}
-
static int layers_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
@@ -346,403 +266,6 @@ void VIEW3D_OT_layers(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "");
}
-
-#if 0
-static void do_view3d_view_camerasmenu(bContext *C, void *arg, int event)
-{
- Scene *scene= CTX_data_scene(C);
- Base *base;
- int i=1;
-
- if (event == 1) {
- /* Set Active Object as Active Camera */
- /* XXX ugly hack alert */
-// G.qual |= LR_CTRLKEY;
-// persptoetsen(PAD0);
-// G.qual &= ~LR_CTRLKEY;
- } else {
-
- for( base = FIRSTBASE; base; base = base->next ) {
- if (base->object->type == OB_CAMERA) {
- i++;
-
- if (event==i) {
- /* XXX use api call! */
-
- break;
- }
- }
- }
- }
-
-}
-
-
-static uiBlock *view3d_view_camerasmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- Scene *scene= CTX_data_scene(C);
- Base *base;
- uiBlock *block;
- short yco= 0, menuwidth=120;
- int i=1;
- char camname[48];
-
- block= uiBeginBlock(C, ar, "view3d_view_camerasmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_view_camerasmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Active Object as Active Camera|Ctrl NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- for( base = FIRSTBASE; base; base = base->next ) {
- if (base->object->type == OB_CAMERA) {
- i++;
-
- strcpy(camname, base->object->id.name+2);
- if (base->object == scene->camera) strcat(camname, " (Active)");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, camname, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, i, "");
- }
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-#endif
-
-#if 0
-static void do_view3d_view_cameracontrolsmenu(bContext *C, void *arg, int event)
-{
- switch(event) {
- case 0: /* Orbit Left */
- persptoetsen(PAD4);
- break;
- case 1: /* Orbit Right */
- persptoetsen(PAD6);
- break;
- case 2: /* Orbit Up */
- persptoetsen(PAD8);
- break;
- case 3: /* Orbit Down */
- persptoetsen(PAD2);
- break;
- case 4: /* Pan left */
- /* XXX ugly hack alert */
-// G.qual |= LR_CTRLKEY;
- persptoetsen(PAD4);
-// G.qual &= ~LR_CTRLKEY;
- break;
- case 5: /* Pan right */
- /* XXX ugly hack alert */
-// G.qual |= LR_CTRLKEY;
- persptoetsen(PAD6);
-// G.qual &= ~LR_CTRLKEY;
- break;
- case 6: /* Pan up */
- /* ugly hack alert */
-// G.qual |= LR_CTRLKEY;
- persptoetsen(PAD8);
-// G.qual &= ~LR_CTRLKEY;
- break;
- case 7: /* Pan down */
- /* ugly hack alert */
-// G.qual |= LR_CTRLKEY;
- persptoetsen(PAD2);
-// G.qual &= ~LR_CTRLKEY;
- break;
- case 8: /* Zoom In */
- persptoetsen(PADPLUSKEY);
- break;
- case 9: /* Zoom Out */
- persptoetsen(PADMINUS);
- break;
- case 10: /* Reset Zoom */
- persptoetsen(PADENTER);
- break;
- case 11: /* Camera Fly mode */
- fly();
- break;
- }
-}
-
-
-static uiBlock *view3d_view_cameracontrolsmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "view3d_view_cameracontrolsmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Fly Mode|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Up|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Down|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Left|Ctrl NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Right|Ctrl NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Up|Ctrl NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Down|Ctrl NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_view_alignviewmenu(bContext *C, void *arg, int event)
-{
- Scene *scene= CTX_data_scene(C);
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
- Object *obedit = CTX_data_edit_object(C);
- float *curs;
-
- switch(event) {
-
- case 0: /* Align View to Selected (edit/faceselect mode) */
- case 1:
- case 2:
- if ((obedit) && (obedit->type == OB_MESH)) {
- editmesh_align_view_to_selected(v3d, event + 1);
- }
- else if (FACESEL_PAINT_TEST) {
- Object *obact= OBACT;
- if (obact && obact->type==OB_MESH) {
- Mesh *me= obact->data;
-
- if (me->mtface) {
-// XXX faceselect_align_view_to_selected(v3d, me, event + 1);
- ED_area_tag_redraw(sa);
- }
- }
- }
- break;
- case 3: /* Center View to Cursor */
- curs= give_cursor(scene, v3d);
- v3d->ofs[0]= -curs[0];
- v3d->ofs[1]= -curs[1];
- v3d->ofs[2]= -curs[2];
- ED_area_tag_redraw(sa);
- break;
- case 4: /* Align Active Camera to View */
- /* XXX This ugly hack is a symptom of the nasty persptoetsen function,
- * but at least it works for now.
- */
-// G.qual |= LR_CTRLKEY|LR_ALTKEY;
- persptoetsen(PAD0);
-// G.qual &= ~(LR_CTRLKEY|LR_ALTKEY);
- break;
- case 5: /* Align View to Selected (object mode) */
-// XXX mainqenter(PADASTERKEY, 1);
- break;
- case 6: /* Center View and Cursor to Origin */
- WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL);
- curs= give_cursor(scene, v3d);
- curs[0]=curs[1]=curs[2]= 0.0;
- break;
- }
-}
-
-static uiBlock *view3d_view_alignviewmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- Object *obedit = CTX_data_edit_object(C);
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "view3d_view_alignviewmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_view_alignviewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if (((obedit) && (obedit->type == OB_MESH)) || (FACESEL_PAINT_TEST)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-#endif
-
-#if 0
-static uiBlock *view3d_view_spacehandlers(bContext *C, ARegion *ar, void *arg_unused)
-{
- /* XXX */
- return NULL;
-}
-
-
-static void do_view3d_viewmenu(bContext *C, void *arg, int event)
-{
-
- switch(event) {
- case 0: /* User */
- break;
- case 1: /* Camera */
- break;
- case 2: /* Top */
- break;
- case 3: /* Front */
- break;
- case 4: /* Side */
- break;
- case 5: /* Perspective */
- break;
- case 6: /* Orthographic */
- break;
- case 7: /* Local View */
- break;
- case 8: /* Global View */
- break;
- case 9: /* View All (Home) */
- WM_operator_name_call(C, "VIEW3D_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL);
- break;
- case 11: /* View Selected */
- WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL);
- break;
- case 13: /* Play Back Animation */
- break;
- case 15: /* Background Image... */
-// add_blockhandler(sa, VIEW3D_HANDLER_BACKGROUND, UI_PNL_UNSTOW);
- break;
- case 16: /* View Panel */
-// add_blockhandler(sa, VIEW3D_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 17: /* Set Clipping Border */
- WM_operator_name_call(C, "VIEW3D_OT_clip_border", WM_OP_INVOKE_REGION_WIN, NULL);
- break;
- case 18: /* render preview */
-// toggle_blockhandler(sa, VIEW3D_HANDLER_PREVIEW, 0);
- break;
- case 19: /* zoom within border */
-// view3d_border_zoom();
- break;
- case 20: /* Transform Space Panel */
-// add_blockhandler(sa, VIEW3D_HANDLER_TRANSFORM, UI_PNL_UNSTOW);
- break;
- case 21: /* Grease Pencil */
-// add_blockhandler(sa, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
- break;
- case 22: /* View all layers */
- do_layer_buttons(C, -2);
- break;
- }
-}
-#endif
-
-#if 0
-static uiBlock *view3d_viewmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
- RegionView3D *rv3d= wm_region_view3d(C);
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiBeginBlock(C, ar, "view3d_viewmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Orientations...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if ((rv3d->viewbut == 0) && !(rv3d->persp == V3D_CAMOB)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- if (rv3d->persp == V3D_CAMOB) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- if (rv3d->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- if (rv3d->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- if (rv3d->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- uiDefIconTextBlockBut(block, view3d_view_camerasmenu, NULL, ICON_RIGHTARROW_THIN, "Cameras", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(rv3d->persp==V3D_PERSP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- if(rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(v3d->lay== (1<<20)-1) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Previous Layers|Shift ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show All Layers| ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- if(!v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_view_alignviewmenu, NULL, ICON_RIGHTARROW_THIN, "Align View", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(rv3d->rflag & RV3D_CLIPPING)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
- if (rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Within Border...|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- if(!sa->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
- else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_view_spacehandlers, NULL, ICON_RIGHTARROW_THIN, "Space Handler Scripts", 0, yco-=20, 120, 19, "");
-#endif
-
- if(ar->alignment==RGN_ALIGN_TOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-#endif
-
#if 0
void do_view3d_select_object_typemenu(bContext *C, void *arg, int event)
{
@@ -963,188 +486,6 @@ static uiBlock *view3d_select_object_groupedmenu(bContext *C, ARegion *ar, void
#endif
-static void view3d_select_objectmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
-
- uiItemS(layout);
-
- uiItemO(layout, "Select/Deselect All", 0, "OBJECT_OT_select_all_toggle");
- uiItemO(layout, "Inverse", 0, "OBJECT_OT_select_inverse");
- uiItemO(layout, "Random", 0, "OBJECT_OT_select_random");
- uiItemO(layout, "Select All by Layer", 0, "OBJECT_OT_select_by_layer");
- uiItemMenuEnumO(layout, "Select All by Type", 0, "OBJECT_OT_select_by_type", "type");
- uiItemMenuEnumO(layout, "Select Grouped", 0, "OBJECT_OT_select_grouped", "type");
-
-#if 0
- uiDefIconTextBlockBut(block, view3d_select_object_layermenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Layer", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_select_object_typemenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Type", 0, yco-=20, 120, 19, "");
-
- uiItemS(layout);
-
- uiDefIconTextBlockBut(block, view3d_select_object_linkedmenu, NULL, ICON_RIGHTARROW_THIN, "Linked", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_select_object_groupedmenu, NULL, ICON_RIGHTARROW_THIN, "Grouped", 0, yco-=20, 120, 19, "");
-#endif
-}
-
-static void view3d_select_meshmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
-
- uiItemS(layout);
-
- uiItemO(layout, "Select/Deselect All", 0, "MESH_OT_select_all_toggle");
- uiItemO(layout, "Inverse", 0, "MESH_OT_select_inverse");
-
- uiItemS(layout);
-
- uiItemO(layout, "Random...", 0, "MESH_OT_select_random"); // Random...
- uiItemO(layout, "Sharp Edges", 0, "MESH_OT_edges_select_sharp");
- uiItemO(layout, "Linked Flat Faces", 0, "MESH_OT_faces_select_linked_flat");
-
- uiItemS(layout);
-
- uiItemEnumO(layout, "Triangles", 0, "MESH_OT_select_by_number_vertices", "type", 3); // Ctrl Alt Shift 3
- uiItemEnumO(layout, "Quads", 0, "MESH_OT_select_by_number_vertices", "type", 4); // Ctrl Alt Shift 4
- uiItemEnumO(layout, "Loose Verts/Edges", 0, "MESH_OT_select_by_number_vertices", "type", 5); // Ctrl Alt Shift 5
- uiItemO(layout, "Similar...", 0, "MESH_OT_select_similar");
-
- uiItemS(layout);
-
- uiItemO(layout, "Less", 0, "MESH_OT_select_more");
- uiItemO(layout, "More", 0, "MESH_OT_select_less");
-
- uiItemS(layout);
-
- uiItemO(layout, "Linked", 0, "MESH_OT_select_linked");
- uiItemO(layout, "Vertex Path", 0, "MESH_OT_select_vertex_path"); // W, Alt 7
- uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select");
- uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1);
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region"); // Ctrl E 8
- uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop"); // Ctrl E 9
-}
-
-static void view3d_select_curvemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Object *obedit= CTX_data_edit_object(C);
-
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_circle");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "CURVE_OT_select_all_toggle");
- uiItemO(layout, NULL, 0, "CURVE_OT_select_inverse");
- uiItemO(layout, NULL, 0, "CURVE_OT_select_random"); // Random...
- uiItemO(layout, NULL, 0, "CURVE_OT_select_every_nth"); // Every Nth..
-
- uiItemS(layout);
-
- if(obedit->type == OB_SURF) {
- uiItemO(layout, NULL, 0, "CURVE_OT_select_row");
- }
- else {
- uiItemO(layout, NULL, 0, "CURVE_OT_de_select_first");
- uiItemO(layout, NULL, 0, "CURVE_OT_de_select_last");
- uiItemO(layout, NULL, 0, "CURVE_OT_select_next");
- uiItemO(layout, NULL, 0, "CURVE_OT_select_previous");
- }
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "CURVE_OT_select_more");
- uiItemO(layout, NULL, 0, "CURVE_OT_select_less");
-
- /* commented out because it seems to only like the LKEY method - based on mouse pointer position :( */
- /* uiItemO(layout, NULL, 0, "CURVE_OT_select_linked"); */
-
-#if 0
- G.qual |= LR_CTRLKEY;
- select_connected_nurb();
- G.qual &= ~LR_CTRLKEY;
- break;*/
-#endif
-}
-
-static void view3d_select_metaballmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
- uiItemS(layout);
- uiItemO(layout, NULL, 0, "MBALL_OT_select_deselect_all_metaelems");
- uiItemO(layout, NULL, 0, "MBALL_OT_select_inverse_metaelems");
- uiItemS(layout);
- uiItemO(layout, NULL, 0, "MBALL_OT_select_random_metaelems");
-}
-
-static void view3d_select_latticemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
- uiItemS(layout);
- uiItemO(layout, NULL, 0, "LATTICE_OT_select_all_toggle");
-}
-
-static void view3d_select_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- PointerRNA ptr;
-
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
-
- uiItemS(layout);
-
- uiItemO(layout, "Select/Deselect All", 0, "ARMATURE_OT_select_all_toggle");
- uiItemO(layout, "Inverse", 0, "ARMATURE_OT_select_inverse");
-
- uiItemS(layout);
-
- uiItemEnumO(layout, "Parent", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_PARENT);
- uiItemEnumO(layout, "Child", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_CHILD);
-
- uiItemS(layout);
-
- WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy");
- RNA_boolean_set(&ptr, "extend", 1);
- RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT);
- uiItemFullO(layout, "Extend Parent", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
-
- WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy");
- RNA_boolean_set(&ptr, "extend", 1);
- RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD);
- uiItemFullO(layout, "Extend Child", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
-}
-
-static void view3d_select_posemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- PointerRNA ptr;
-
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
-
- uiItemS(layout);
-
- uiItemO(layout, "Select/Deselect All", 0, "POSE_OT_select_all_toggle");
- uiItemO(layout, "Inverse", 0, "POSE_OT_select_inverse");
- uiItemO(layout, "Constraint Target", 0, "POSE_OT_select_constraint_target");
-
- uiItemS(layout);
-
- uiItemEnumO(layout, "Parent", 0, "POSE_OT_select_hierarchy", "direction", BONE_SELECT_PARENT);
- uiItemEnumO(layout, "Child", 0, "POSE_OT_select_hierarchy", "direction", BONE_SELECT_CHILD);
-
- uiItemS(layout);
-
- WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy");
- RNA_boolean_set(&ptr, "extend", 1);
- RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT);
- uiItemFullO(layout, "Extend Parent", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
-
- WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy");
- RNA_boolean_set(&ptr, "extend", 1);
- RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD);
- uiItemFullO(layout, "Extend Child", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
-}
-
void do_view3d_select_faceselmenu(bContext *C, void *arg, int event)
{
#if 0
@@ -1215,19 +556,15 @@ static uiBlock *view3d_select_faceselmenu(bContext *C, ARegion *ar, void *arg_un
return block;
}
-static void view3d_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
+/* wrapper for python layouts */
+void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, bContext *C)
{
- uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_grid");
- uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_cursor");
- uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_center");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_selected");
- uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_grid");
- uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_active");
+ void *arg_unused = NULL;
+ ARegion *ar= CTX_wm_region(C);
+ view3d_select_faceselmenu(C, ar, arg_unused);
}
+#if 0
void do_view3d_transform_moveaxismenu(bContext *C, void *arg, int event)
{
#if 0
@@ -1428,7 +765,9 @@ static uiBlock *view3d_transform_scaleaxismenu(bContext *C, ARegion *ar, void *a
uiTextBoundsBlock(block, 60);
return block;
}
+#endif
+#if 0
static void do_view3d_transformmenu(bContext *C, void *arg, int event)
{
#if 0
@@ -1664,10 +1003,12 @@ static uiBlock *view3d_object_mirrormenu(bContext *C, ARegion *ar, void *arg_unu
return block;
}
#endif
+#endif
+#if 0
static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
-#if 0
+#if 0 // XXX not used anymore
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation to ObData|Ctrl A, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
apply_objects_locrot();
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Visual Transform|Ctrl A, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
@@ -1684,6 +1025,7 @@ static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void
uiItemO(layout, NULL, 0, "OBJECT_OT_scale_clear");
uiItemO(layout, NULL, 0, "OBJECT_OT_origin_clear");
}
+#endif
#if 0
static void do_view3d_edit_object_makelocalmenu(bContext *C, void *arg, int event)
@@ -1924,42 +1266,6 @@ static uiBlock *view3d_edit_object_copyattrmenu(bContext *C, ARegion *ar, void *
}
#endif
-static void view3d_edit_object_parentmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, "Make Parent...", 0, "OBJECT_OT_parent_set");
- uiItemO(layout, "Clear Parent...", 0, "OBJECT_OT_parent_clear");
-}
-
-static void view3d_edit_object_groupmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "GROUP_OT_group_create");
- uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "GROUP_OT_objects_add_active");
- uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove_active");
-}
-
-static void view3d_edit_object_trackmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, "Make Track...", 0, "OBJECT_OT_track_set");
- uiItemO(layout, "Clear Track...", 0, "OBJECT_OT_track_clear");
-}
-
-static void view3d_edit_object_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "OBJECT_OT_constraint_add_with_targets");
- uiItemO(layout, NULL, 0, "OBJECT_OT_constraints_clear");
-}
-
-static void view3d_edit_object_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, "Show Hidden", 0, "OBJECT_OT_restrictview_clear");
- uiItemO(layout, "Hide Selected", 0, "OBJECT_OT_restrictview_set");
- uiItemBooleanO(layout, "Hide Unselected", 0, "OBJECT_OT_restrictview_set", "unselected", 1);
-}
-
#if 0
#ifndef DISABLE_PYTHON
static void do_view3d_edit_object_scriptsmenu(bContext *C, void *arg, int event)
@@ -2033,919 +1339,6 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event)
}
#endif
-static void view3d_edit_objectmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
-#if 0
- Object *ob= CTX_data_active_object(C);
-
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
-#endif
-
- uiItemMenuF(layout, "Clear/Apply", 0, view3d_edit_object_transformmenu);
- uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
-
- uiItemS(layout);
-
- // TODO: these operators may get renamed
- uiItemO(layout, NULL, 0, "ANIM_OT_insert_keyframe_menu");
- uiItemO(layout, NULL, 0, "ANIM_OT_delete_keyframe_v3d");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "OBJECT_OT_duplicate");
- uiItemBooleanO(layout, "Duplicate Linked", 0, "OBJECT_OT_duplicate", "linked", 1);
- uiItemO(layout, NULL, 0, "OBJECT_OT_delete");
-
- uiItemO(layout, NULL, 0, "OBJECT_OT_proxy_make");
-#if 0
- uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_copyattrmenu, NULL, ICON_RIGHTARROW_THIN, "Copy Attributes", 0, yco-=20, 120, 19, "");
-#endif
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Parent", 0, view3d_edit_object_parentmenu);
- uiItemMenuF(layout, "Track", 0, view3d_edit_object_trackmenu);
- uiItemMenuF(layout, "Group", 0, view3d_edit_object_groupmenu);
- uiItemMenuF(layout, "Constraints", 0, view3d_edit_object_constraintsmenu);
-
-#if 0
- if(ob && ob->type == OB_MESH) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- }
-
- // join... (added already)
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-#endif
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "OBJECT_OT_join");
-
- uiItemS(layout);
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-#endif
-
- uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_object_showhidemenu);
-
-#if 0
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
-#endif
-#endif
-}
-
-static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
- uiItemO(layout, "Rip", 0, "MESH_OT_rip");
- uiItemO(layout, "Split", 0, "MESH_OT_split");
- uiItemO(layout, "Separate", 0, "MESH_OT_separate");
-
- uiItemS(layout);
-
- uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
- uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
-
-#if 0
- uiItemS(layout);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); // add_hook_menu();
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); // make_parent();
-#endif
-}
-
-void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event)
-{
-#if 0
- Scene *scene= CTX_data_scene(C);
- float fac;
- short randfac;
-
- switch(event) {
- case 9: /* Crease SubSurf */
- if(!multires_level1_test()) {
- initTransform(TFM_CREASE, CTX_EDGE);
- Transform();
- }
- break;
- case 12: /* Edgeslide */
- EdgeSlide(0,0.0);
- break;
- case 13: /* Edge Loop Delete */
- if(EdgeLoopDelete()) {
- countall();
- ED_undo_push(C, "Erase Edge Loop");
- DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
- }
- break;
- case 14: /*Collapse Edges*/
- collapseEdges();
- ED_undo_push(C, "Collapse");
- break;
- case 17: /* Adjust Bevel Weight */
- if(!multires_level1_test()) {
- initTransform(TFM_BWEIGHT, CTX_EDGE);
- Transform();
- }
- break;
- }
-#endif
-}
-
-static void view3d_edit_mesh_edgesmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add");
-
-#if 0
- uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
- uiItemO(layout, "Loop Subdivide...", 0, "MESH_OT_loop_subdivide"); // Ctr R, CutEdgeloop(1);
- uiItemO(layout, "Knife Subdivide...", 0, "MESH_OT_loop_subdivide"); // Shift K, KnifeSubdivide(KNIFE_PROMPT);
-
- uiItemS(layout);
-#endif
-
- uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide");
- uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f);
-
- uiItemS(layout);
-
- uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam");
- uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1);
-
- uiItemS(layout);
-
- uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp");
- uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1);
-
-#if 0
- uiItemS(layout);
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Adjust Bevel Weight|Ctrl Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Crease SubSurf|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-#endif
-
- uiItemS(layout);
-
- uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1);
- uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2);
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Slide Edge |Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Edge Loop|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
-#endif
-}
-
-static void view3d_edit_mesh_facesmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add");
- uiItemO(layout, NULL, 0, "MESH_OT_fill");
- uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris");
- uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads");
- uiItemO(layout, NULL, 0, "MESH_OT_edge_flip");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
- uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
-}
-
-static void view3d_edit_mesh_normalsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, "Recalculate Outside", 0, "MESH_OT_normals_make_consistent");
- uiItemBooleanO(layout, "Recalculate Inside", 0, "MESH_OT_normals_make_consistent", "inside", 1);
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
-}
-
-void do_view3d_edit_mirrormenu(bContext *C, void *arg, int event)
-{
-#if 0
- float mat[3][3];
-
- Mat3One(mat);
-
- switch(event) {
- case 0:
- initTransform(TFM_MIRROR, CTX_NO_PET);
- Transform();
- break;
- case 1:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[0], " on global X axis");
- Transform();
- break;
- case 2:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[1], " on global Y axis");
- Transform();
- break;
- case 3:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[2], "on global Z axis");
- Transform();
- break;
- case 4:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('X', " on local X axis");
- Transform();
- break;
- case 5:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('Y', " on local Y axis");
- Transform();
- break;
- case 6:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('Z', " on local Z axis");
- Transform();
- break;
- }
-#endif
-}
-
-static uiBlock *view3d_edit_mirrormenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiBeginBlock(C, ar, "view3d_edit_mirrormenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_edit_mirrormenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Interactive Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|Ctrl M, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|Ctrl M, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|Ctrl M, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, X X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, Y Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, Z Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void view3d_edit_mesh_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "MESH_OT_reveal");
- uiItemO(layout, NULL, 0, "MESH_OT_hide");
- uiItemBooleanO(layout, "Hide Unselected", 0, "MESH_OT_hide", "unselected", 1);
-}
-
-#ifndef DISABLE_PYTHON
-#if 0
-static void do_view3d_edit_mesh_scriptsmenu(bContext *C, void *arg, int event)
-{
- BPY_menu_do_python(PYMENU_MESH, event);
-}
-
-static uiBlock *view3d_edit_mesh_scriptsmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
-// short yco = 20, menuwidth = 120;
-// XXX BPyMenu *pym;
-// int i = 0;
-
- block= uiBeginBlock(C, ar, "v3d_emesh_pymenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_edit_mesh_scriptsmenu, NULL);
-
-// for (pym = BPyMenuTable[PYMENU_MESH]; pym; pym = pym->next, i++) {
-// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
-// }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-#endif
-#endif /* DISABLE_PYTHON */
-
-#if 0
-static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event)
-{
- ScrArea *sa= CTX_wm_area(C);
-
- switch(event) {
-
- case 2: /* transform properties */
- add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, 0);
- break;
- case 4: /* insert keyframe */
- common_insertkey();
- break;
- case 16: /* delete keyframe */
- common_deletekey();
- break;
- }
-}
-#endif
-
-static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- PointerRNA tsptr;
-
- RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
-
- uiItemO(layout, "Undo Editing", 0, "ED_OT_undo");
- uiItemO(layout, "Redo Editing", 0, "ED_OT_redo");
-
-#if 0
- uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, "");
-#endif
-
- uiItemS(layout);
-
-#if 0
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
-#endif
-
- uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
-
- uiItemS(layout);
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-
- uiItemS(layout);
-#endif
-
- uiItemO(layout, NULL, 0, "UV_OT_mapping_menu");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "MESH_OT_extrude");
- uiItemO(layout, NULL, 0, "MESH_OT_duplicate");
- uiItemO(layout, "Delete...", 0, "MESH_OT_delete");
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Vertices", 0, view3d_edit_mesh_verticesmenu);
- uiItemMenuF(layout, "Edges", 0, view3d_edit_mesh_edgesmenu);
- uiItemMenuF(layout, "Faces", 0, view3d_edit_mesh_facesmenu);
- uiItemMenuF(layout, "Normals", 0, view3d_edit_mesh_normalsmenu);
-
- uiItemS(layout);
-
- uiItemR(layout, NULL, 0, &tsptr, "automerge_editing", 0, 0, 0);
- uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
- uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_mesh_showhidemenu);
-
-#if 0
-#ifndef DISABLE_PYTHON
- uiItemS(layout);
- uiDefIconTextBlockBut(block, view3d_edit_mesh_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
-#endif
-#endif
-}
-
-static void view3d_edit_curve_controlpointsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Object *obedit= CTX_data_edit_object(C);
-
- if(obedit->type == OB_CURVE) {
- uiItemEnumO(layout, NULL, 0, "TFM_OT_transform", "mode", TFM_TILT);
- uiItemO(layout, NULL, 0, "CURVE_OT_tilt_clear");
- uiItemO(layout, NULL, 0, "CURVE_OT_separate");
-
- uiItemS(layout);
-
- uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 1);
- uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 3);
- uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 2);
-
- uiItemS(layout);
- }
-
- // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_make_vertex_parent"); Make VertexParent|Ctrl P
- // make_parent()
- // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_add_hook"); Add Hook| Ctrl H
- // add_hook_menu()
-}
-
-static void view3d_edit_curve_segmentsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "CURVE_OT_subdivide");
- uiItemO(layout, NULL, 0, "CURVE_OT_switch_direction");
-}
-
-static void view3d_edit_curve_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "CURVE_OT_reveal");
- uiItemO(layout, NULL, 0, "CURVE_OT_hide");
- uiItemBooleanO(layout, "Hide Unselected", 0, "CURVE_OT_hide", "unselected", 1);
-}
-
-static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- PointerRNA tsptr;
-
- RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
-#endif
-
- uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
-
- uiItemS(layout);
-
- // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- // common_insertkey();
- // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- // common_deletekey();
-
-
- uiItemO(layout, NULL, 0, "CURVE_OT_extrude");
- uiItemO(layout, NULL, 0, "CURVE_OT_duplicate");
- uiItemO(layout, NULL, 0, "CURVE_OT_separate");
- uiItemO(layout, NULL, 0, "CURVE_OT_make_segment");
- uiItemO(layout, NULL, 0, "CURVE_OT_cyclic_toggle");
- uiItemO(layout, NULL, 0, "CURVE_OT_delete"); // Delete...
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Control Points", 0, view3d_edit_curve_controlpointsmenu);
- uiItemMenuF(layout, "Segments", 0, view3d_edit_curve_segmentsmenu);
-
- uiItemS(layout);
-
- uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
- uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_curve_showhidemenu);
-}
-
-static void view3d_edit_metaball_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "MBALL_OT_hide_metaelems");
- uiItemO(layout, NULL, 0, "MBALL_OT_reveal_metaelems");
- uiItemBooleanO(layout, "Hide Unselected", 0, "MBALL_OT_hide_metaelems", "unselected", 1);
-}
-
-static void view3d_edit_metaballmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- PointerRNA tsptr;
-
- RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
-
- uiItemO(layout, "Undo Editing", 0, "ED_OT_undo");
- uiItemO(layout, "Redo Editing", 0, "ED_OT_redo");
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "MBALL_OT_delete_metaelems");
- uiItemO(layout, NULL, 0, "MBALL_OT_duplicate_metaelems");
-
- uiItemS(layout);
-
- uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
- uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_metaball_showhidemenu);
-}
-
-static void view3d_edit_text_charsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- /* the character codes are specified in UTF-8 */
-
- uiItemStringO(layout, "Copyright|Alt C", 0, "FONT_OT_text_insert", "text", "\xC2\xA9");
- uiItemStringO(layout, "Registered Trademark|Alt R", 0, "FONT_OT_text_insert", "text", "\xC2\xAE");
-
- uiItemS(layout);
-
- uiItemStringO(layout, "Degree Sign|Alt G", 0, "FONT_OT_text_insert", "text", "\xC2\xB0");
- uiItemStringO(layout, "Multiplication Sign|Alt x", 0, "FONT_OT_text_insert", "text", "\xC3\x97");
- uiItemStringO(layout, "Circle|Alt .", 0, "FONT_OT_text_insert", "text", "\xC2\x8A");
- uiItemStringO(layout, "Superscript 1|Alt 1", 0, "FONT_OT_text_insert", "text", "\xC2\xB9");
- uiItemStringO(layout, "Superscript 2|Alt 2", 0, "FONT_OT_text_insert", "text", "\xC2\xB2");
- uiItemStringO(layout, "Superscript 3|Alt 3", 0, "FONT_OT_text_insert", "text", "\xC2\xB3");
- uiItemStringO(layout, "Double >>|Alt >", 0, "FONT_OT_text_insert", "text", "\xC2\xBB");
- uiItemStringO(layout, "Double <<|Alt <", 0, "FONT_OT_text_insert", "text", "\xC2\xAB");
- uiItemStringO(layout, "Promillage|Alt %", 0, "FONT_OT_text_insert", "text", "\xE2\x80\xB0");
-
- uiItemS(layout);
-
- uiItemStringO(layout, "Dutch Florin|Alt F", 0, "FONT_OT_text_insert", "text", "\xC2\xA4");
- uiItemStringO(layout, "British Pound|Alt L", 0, "FONT_OT_text_insert", "text", "\xC2\xA3");
- uiItemStringO(layout, "Japanese Yen|Alt Y", 0, "FONT_OT_text_insert", "text", "\xC2\xA5");
-
- uiItemS(layout);
-
- uiItemStringO(layout, "German S|Alt S", 0, "FONT_OT_text_insert", "text", "\xC3\x9F");
- uiItemStringO(layout, "Spanish Question Mark|Alt ?", 0, "FONT_OT_text_insert", "text", "\xC2\xBF");
- uiItemStringO(layout, "Spanish Exclamation Mark|Alt !", 0, "FONT_OT_text_insert", "text", "\xC2\xA1");
-}
-
-static void view3d_edit_textmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "FONT_OT_file_paste");
- uiItemS(layout);
- uiItemMenuF(layout, "Special Characters", 0, view3d_edit_text_charsmenu);
-}
-
-static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Scene *scene= CTX_data_scene(C);
- ToolSettings *ts= CTX_data_tool_settings(C);
- PointerRNA tsptr;
-
- RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
-#endif
-
- uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
-
- uiItemS(layout);
-
- // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- // common_insertkey();
- // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- // common_deletekey();
-
- uiItemO(layout, NULL, 0, "LATTICE_OT_make_regular");
-
- uiItemS(layout);
-
- uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
- uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
-}
-
-
-static void view3d_edit_armature_parentmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "ARMATURE_OT_parent_set");
- uiItemO(layout, NULL, 0, "ARMATURE_OT_parent_clear");
-}
-
-static void view3d_edit_armature_rollmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- /* 0 = 'Global', 1 = 'Cursor' */
- // TODO: keep these in sync...
- uiItemEnumO(layout, "Clear Roll (Z-Axis Up)", 0, "ARMATURE_OT_calculate_roll", "type", 0);
- uiItemEnumO(layout, "Roll to Cursor", 0, "ARMATURE_OT_calculate_roll", "type", 1);
-
- uiItemS(layout);
-
- uiItemEnumO(layout, "Set Roll", 0, "TFM_OT_transform", "mode", TFM_BONE_ROLL);
-}
-
-static void view3d_edit_armature_settingsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemEnumO(layout, "Toggle a Setting", 0, "ARMATURE_OT_flags_set", "mode", 2);
- uiItemEnumO(layout, "Enable a Setting", 0, "ARMATURE_OT_flags_set", "mode", 1);
- uiItemEnumO(layout, "Disable a Setting", 0, "ARMATURE_OT_flags_set", "mode", 0);
-}
-
-#if 0
-static void do_view3d_edit_armaturemenu(bContext *C, void *arg, int event)
-{
- static short numcuts= 2;
-
- switch(event) {
- case 0: /* Undo Editing */
- remake_editArmature();
- break;
-
- case 6: /* Shear */
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 7: /* Warp */
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- case 23: /* bone sketching panel */
- add_blockhandler(curarea, VIEW3D_HANDLER_BONESKETCH, UI_PNL_UNSTOW);
- break;
- }
-}
-#endif
-
-static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Object *obedit = CTX_data_edit_object(C);
- bArmature *arm= obedit->data;
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Bone Sketching|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
-#endif
- uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
- uiItemMenuF(layout, "Bone Roll", 0, view3d_edit_armature_rollmenu);
-
- if (arm->drawtype == ARM_ENVELOPE)
- uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE);
- else
- uiItemEnumO(layout, "Scale B-Bone Width", 0, "TFM_OT_transform", "mode", TFM_BONESIZE);
-
- uiItemS(layout);
-
- uiItemO(layout, "Extrude", 0, "ARMATURE_OT_extrude");
- if (arm->flag & ARM_MIRROR_EDIT)
- uiItemBooleanO(layout, "Extrude Forked", 0, "ARMATURE_OT_extrude", "forked", 1);
-
- uiItemO(layout, NULL, 0, "ARMATURE_OT_duplicate");
- uiItemO(layout, NULL, 0, "ARMATURE_OT_merge");
- uiItemO(layout, NULL, 0, "ARMATURE_OT_fill");
- uiItemO(layout, NULL, 0, "ARMATURE_OT_delete");
- uiItemO(layout, NULL, 0, "ARMATURE_OT_separate");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_simple");
- uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_multi");
-
- uiItemEnumO(layout, "AutoName Left/Right", 0, "ARMATURE_OT_autoside_names", "axis", 0);
- uiItemEnumO(layout, "AutoName Front/Back", 0, "ARMATURE_OT_autoside_names", "axis", 1);
- uiItemEnumO(layout, "AutoName Top/Bottom", 0, "ARMATURE_OT_autoside_names", "axis", 2);
-
- uiItemO(layout, "Flip Left/Right Names", 0, "ARMATURE_OT_flip_names");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "ARMATURE_OT_armature_layers");
- uiItemO(layout, NULL, 0, "ARMATURE_OT_bone_layers");
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Parent", 0, view3d_edit_armature_parentmenu);
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Bone Settings ", 0, view3d_edit_armature_settingsmenu);
-}
-
-
-static void view3d_pose_armature_transformmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear User Transform|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- //used: clear_user_transform(scene, ob);
- //uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiItemO(layout, NULL, 0, "POSE_OT_loc_clear");
- uiItemO(layout, NULL, 0, "POSE_OT_rot_clear");
- uiItemO(layout, NULL, 0, "POSE_OT_scale_clear");
-
- // ???
- //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- //used:clear_object('o');
-}
-
-static void view3d_pose_armature_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, "Show Hidden", 0, "POSE_OT_reveal");
-
- uiItemO(layout, "Hide Selected", 0, "POSE_OT_hide");
- uiItemBooleanO(layout, "Hide Unselected", 0, "POSE_OT_hide", "unselected", 1);
-}
-
-static void view3d_pose_armature_ikmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "POSE_OT_ik_add");
- uiItemO(layout, NULL, 0, "POSE_OT_ik_clear");
-}
-
-static void view3d_pose_armature_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "POSE_OT_constraint_add_with_targets");
- uiItemO(layout, NULL, 0, "POSE_OT_constraints_clear");
-}
-
-static void view3d_pose_armature_groupmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, "Add Selected to Active Group", 0, "POSE_OT_group_assign");
- //uiItemO(layout, "Add Selected to Group", 0, "POSE_OT_group_assign");
-
- uiItemO(layout, "Add New Group", 0, "POSE_OT_group_add");
-
- uiItemO(layout, "Remove from All Groups", 0, "POSE_OT_group_unassign");
- uiItemO(layout, "Remove Active Group", 0, "POSE_OT_group_remove");
-}
-
-static void view3d_pose_armature_motionpathsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "POSE_OT_paths_calculate");
- uiItemO(layout, NULL, 0, "POSE_OT_paths_clear");
-}
-
-static void view3d_pose_armature_poselibmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "POSELIB_OT_browse_interactive");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "POSELIB_OT_pose_add");
- uiItemO(layout, NULL, 0, "POSELIB_OT_pose_rename");
- uiItemO(layout, NULL, 0, "POSELIB_OT_pose_remove");
-}
-
-static void view3d_pose_armature_settingsmenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemEnumO(layout, "Toggle a Setting", 0, "POSE_OT_flags_set", "mode", 2);
- uiItemEnumO(layout, "Enable a Setting", 0, "POSE_OT_flags_set", "mode", 1);
- uiItemEnumO(layout, "Disable a Setting", 0, "POSE_OT_flags_set", "mode", 0);
-}
-
-#if 0
-static void do_view3d_pose_armaturemenu(bContext *C, void *arg, int event)
-{
- Object *ob;
- ob=OBACT;
-
- switch(event) {
- case 5:
- pose_copy_menu();
- break;
- case 15:
- pose_relax();
- break;
- }
-}
-#endif
-
-static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- Object *ob = CTX_data_active_object(C);
- bArmature *arm= ob->data;
-
-#if 0 // XXX to be ported, using uiItemMenuF(layout, "<Name>", 0, view3d_pose_armature_<category>menu);
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
-#endif
- if ( (arm) && ((arm->drawtype == ARM_B_BONE) || (arm->drawtype == ARM_ENVELOPE)) )
- uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE);
- uiItemMenuF(layout, "Clear Transform", 0, view3d_pose_armature_transformmenu);
-
- uiItemS(layout);
-
- // TODO: these operators may get renamed
- uiItemO(layout, NULL, 0, "ANIM_OT_insert_keyframe_menu");
- uiItemO(layout, NULL, 0, "ANIM_OT_delete_keyframe_v3d");
-
- uiItemS(layout);
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Relax Pose|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-#endif
- uiItemO(layout, NULL, 0, "POSE_OT_apply");
-
- uiItemS(layout);
-
- uiItemO(layout, "Copy Current Pose", 0, "POSE_OT_copy");
- uiItemO(layout, "Paste Pose", 0, "POSE_OT_paste");
- uiItemBooleanO(layout, "Paste X-Flipped Pose", 0, "POSE_OT_paste", "flipped", 1);
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Pose Library", 0, view3d_pose_armature_poselibmenu);
- uiItemMenuF(layout, "Motion Paths", 0, view3d_pose_armature_motionpathsmenu);
- uiItemMenuF(layout, "Bone Groups", 0, view3d_pose_armature_groupmenu);
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Inverse Kinematics", 0, view3d_pose_armature_ikmenu);
- uiItemMenuF(layout, "Constraints", 0, view3d_pose_armature_constraintsmenu);
-
- uiItemS(layout);
-
- uiItemEnumO(layout, "AutoName Left/Right", 0, "POSE_OT_autoside_names", "axis", 0);
- uiItemEnumO(layout, "AutoName Front/Back", 0, "POSE_OT_autoside_names", "axis", 1);
- uiItemEnumO(layout, "AutoName Top/Bottom", 0, "POSE_OT_autoside_names", "axis", 2);
-
- uiItemO(layout, "Flip Left/Right Names", 0, "POSE_OT_flip_names");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "POSE_OT_armature_layers");
- uiItemO(layout, NULL, 0, "POSE_OT_bone_layers");
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Show/Hide Bones", 0, view3d_pose_armature_showhidemenu);
- uiItemMenuF(layout, "Bone Settings", 0, view3d_pose_armature_settingsmenu);
-
-#if 0
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-#endif
-}
-
-
-/* vertex paint menu */
-static void do_view3d_vpaintmenu(bContext *C, void *arg, int event)
-{
-#if 0
- /* events >= 3 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 3) BPY_menu_do_python(PYMENU_VERTEXPAINT, event - 3);
-#endif
- switch(event) {
- case 0: /* undo vertex painting */
- BIF_undo();
- break;
- case 1: /* set vertex colors/weight */
- if(FACESEL_PAINT_TEST)
- clear_vpaint_selectedfaces();
- else /* we know were in vertex paint mode */
- clear_vpaint();
- break;
- case 2:
- make_vertexcol(1);
- break;
- }
-#endif
-}
-
-static uiBlock *view3d_vpaintmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-#ifndef DISABLE_PYTHON
-// XXX BPyMenu *pym;
-// int i=0;
-#endif
-
- block= uiBeginBlock(C, ar, "view3d_paintmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_vpaintmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Shaded Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
-#ifndef DISABLE_PYTHON
- /* note that we account for the 3 previous entries with i+3:
- even if the last item isnt displayed, it dosent matter */
-// for (pym = BPyMenuTable[PYMENU_VERTEXPAINT]; pym; pym = pym->next, i++) {
-// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
-// menuwidth, 19, NULL, 0.0, 0.0, 1, i+3,
-// pym->tooltip?pym->tooltip:pym->filename);
-// }
-#endif
-
- if(ar->alignment==RGN_ALIGN_TOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
/* texture paint menu (placeholder, no items yet??) */
static void do_view3d_tpaintmenu(bContext *C, void *arg, int event)
@@ -3031,7 +1424,7 @@ static uiBlock *view3d_wpaintmenu(bContext *C, ARegion *ar, void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- if (FACESEL_PAINT_TEST) {
+ if (paint_facesel_test(CTX_data_active_object(C))) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Weight|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
menunr++;
@@ -3059,185 +1452,6 @@ static uiBlock *view3d_wpaintmenu(bContext *C, ARegion *ar, void *arg_unused)
return block;
}
-void do_view3d_sculpt_inputmenu(bContext *C, void *arg, int event)
-{
-#if 0
- Scene *scene= CTX_data_scene(C);
- SculptData *sd= &scene->sculptdata;
- short val;
-
- switch(event) {
- case 0:
- sd->flags ^= SCULPT_INPUT_SMOOTH;
- ED_undo_push(C, "Smooth stroke");
- break;
- case 1:
- val= sd->tablet_size;
- if(button(&val,0,10,"Tablet Size:")==0) return;
- sd->tablet_size= val;
- ED_undo_push(C, "Tablet size");
- break;
- case 2:
- val= sd->tablet_strength;
- if(button(&val,0,10,"Tablet Strength:")==0) return;
- sd->tablet_strength= val;
- ED_undo_push(C, "Tablet strength");
- break;
- }
-
-#endif
-}
-
-void do_view3d_sculptmenu(bContext *C, void *arg, int event)
-{
-#if 0
- Scene *scene= CTX_data_scene(C);
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
- SculptData *sd= &scene->sculptdata;
- BrushData *br= sculptmode_brush();
-
- switch(event) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- sd->brush_type= event+1;
- ED_undo_push(C, "Brush type");
- break;
- case 11:
- if(v3d)
- v3d->pivot_last= !v3d->pivot_last;
- break;
- case 12:
- sd->flags ^= SCULPT_DRAW_FAST;
- ED_undo_push(C, "Partial Redraw");
- break;
- case 13:
- sd->flags ^= SCULPT_DRAW_BRUSH;
- ED_undo_push(C, "Draw Brush");
- break;
- case 14:
- add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
- break;
- case 15:
- sculpt_radialcontrol_start(RADIALCONTROL_ROTATION);
- break;
- case 16:
- sculpt_radialcontrol_start(RADIALCONTROL_STRENGTH);
- break;
- case 17:
- sculpt_radialcontrol_start(RADIALCONTROL_SIZE);
- break;
-#endif
-}
-
-uiBlock *view3d_sculpt_inputmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth= 120;
- Sculpt *sd= CTX_data_tool_settings(C)->sculpt;
-
- block= uiBeginBlock(C, ar, "view3d_sculpt_inputmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_sculpt_inputmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_INPUT_SMOOTH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth Stroke|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tablet Size Adjust", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tablet Strength Adjust", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void view3d_sculpt_menu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- bScreen *sc= CTX_wm_screen(C);
- Sculpt *s = CTX_data_tool_settings(C)->sculpt;
- PointerRNA rna;
-
- RNA_pointer_create(&sc->id, &RNA_Sculpt, s, &rna);
-
- uiItemR(layout, NULL, 0, &rna, "symmetry_x", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "symmetry_y", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "symmetry_z", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "lock_x", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "lock_y", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "lock_z", 0, 0, 0);
-
- /* Brush settings */
- RNA_pointer_create(&sc->id, &RNA_Brush, s->brush, &rna);
-
- /* Curve */
- uiItemS(layout);
- uiItemEnumO(layout, NULL, 0, "SCULPT_OT_brush_curve_preset", "mode", BRUSH_PRESET_SHARP);
- uiItemEnumO(layout, NULL, 0, "SCULPT_OT_brush_curve_preset", "mode", BRUSH_PRESET_SMOOTH);
- uiItemEnumO(layout, NULL, 0, "SCULPT_OT_brush_curve_preset", "mode", BRUSH_PRESET_MAX);
-
- uiItemS(layout);
-
- uiItemR(layout, NULL, 0, &rna, "airbrush", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "rake", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "anchored", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "space", 0, 0, 0);
- uiItemR(layout, NULL, 0, &rna, "smooth_stroke", 0, 0, 0);
-
- uiItemR(layout, NULL, 0, &rna, "flip_direction", 0, 0, 0);
-}
-
-uiBlock *view3d_sculptmenu(bContext *C, ARegion *ar, void *arg_unused)
-{
- ScrArea *sa= CTX_wm_area(C);
- View3D *v3d= sa->spacedata.first;
- uiBlock *block;
- Sculpt *sd= CTX_data_tool_settings(C)->sculpt;
-// XXX const BrushData *br= sculptmode_brush();
- short yco= 0, menuwidth= 120;
-
- block= uiBeginBlock(C, ar, "view3d_sculptmenu", UI_EMBOSSP);
- uiBlockSetButmFunc(block, do_view3d_sculptmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Sculpt Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_sculpt_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input Settings", 0, yco-=20, 120, 19, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_BRUSH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Display Brush", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_FAST) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Partial Redraw", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- if(v3d)
- uiDefIconTextBut(block, BUTM, 1, (v3d->pivot_last ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pivot Last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Brush|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strengthen Brush|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Brush|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- /* XXX uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==FLATTEN_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Flatten|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==LAYER_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Layer|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==GRAB_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Grab|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==INFLATE_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Inflate|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==PINCH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pinch|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==SMOOTH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==DRAW_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Draw|D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");*/
-
-
- if(ar->alignment==RGN_ALIGN_TOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
static void do_view3d_facesel_showhidemenu(bContext *C, void *arg, int event)
{
#if 0
@@ -3322,61 +1536,6 @@ static uiBlock *view3d_faceselmenu(bContext *C, ARegion *ar, void *arg_unused)
return block;
}
-static void view3d_select_particlemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
-
- uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_all_toggle");
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_linked");
-
- if(ts->particle.selectmode & SCE_SELECT_POINT) {
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last"); // |W, 4
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first"); // |W, 3
- }
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_more");
- uiItemO(layout, NULL, 0, "PARTICLE_OT_select_less");
-}
-
-static void view3d_particle_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- uiItemO(layout, NULL, 0, "PARTICLE_OT_reveal");
- uiItemO(layout, NULL, 0, "PARTICLE_OT_hide");
- uiItemBooleanO(layout, "Hide Unselected", 0, "PARTICLE_OT_hide", "unselected", 1);
-}
-
-static void view3d_particlemenu(bContext *C, uiLayout *layout, void *arg_unused)
-{
- ToolSettings *ts= CTX_data_tool_settings(C);
-
- // XXX uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Particle Edit Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- // add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
- // XXX uiItemS(layout);
- //
- // XXX uiDefIconTextBut(block, BUTM, 1, (pset->flag & PE_X_MIRROR)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT, "X-Axis Mirror Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- // pset->flag ^= PE_X_MIRROR;
-
- uiItemO(layout, NULL, 0, "PARTICLE_OT_mirror"); // |Ctrl M
-
- uiItemS(layout);
-
- uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles"); // |W, 5
- uiItemO(layout, NULL, 0, "PARTICLE_OT_delete");
- if(ts->particle.selectmode & SCE_SELECT_POINT)
- uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); // |W, 2
- uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); // |W, 1
-
- uiItemS(layout);
-
- uiItemMenuF(layout, "Show/Hide Particles", 0, view3d_particle_showhidemenu);
-}
-
static char *view3d_modeselect_pup(Scene *scene)
{
Object *ob= OBACT;
@@ -3386,10 +1545,7 @@ static char *view3d_modeselect_pup(Scene *scene)
str += sprintf(str, "Mode: %%t");
- if(ob)
- str += sprintf(str, formatstr, "Object Mode", V3D_OBJECTMODE_SEL, ICON_OBJECT_DATA);
- else
- str += sprintf(str, formatstr, "Object Mode", V3D_OBJECTMODE_SEL, ICON_OBJECT_DATA);
+ str += sprintf(str, formatstr, "Object Mode", OB_MODE_OBJECT, ICON_OBJECT_DATA);
if(ob==NULL) return string;
@@ -3398,26 +1554,25 @@ static char *view3d_modeselect_pup(Scene *scene)
|| (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
|| (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
- str += sprintf(str, formatstr, "Edit Mode", V3D_EDITMODE_SEL, ICON_EDITMODE_HLT);
+ str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
if (ob->type == OB_MESH) {
- str += sprintf(str, formatstr, "Sculpt Mode", V3D_SCULPTMODE_SEL, ICON_SCULPTMODE_HLT);
- /*str += sprintf(str, formatstr, "Face Select", V3D_FACESELECTMODE_SEL, ICON_FACESEL_HLT);*/
- str += sprintf(str, formatstr, "Vertex Paint", V3D_VERTEXPAINTMODE_SEL, ICON_VPAINT_HLT);
- str += sprintf(str, formatstr, "Texture Paint", V3D_TEXTUREPAINTMODE_SEL, ICON_TPAINT_HLT);
- str += sprintf(str, formatstr, "Weight Paint", V3D_WEIGHTPAINTMODE_SEL, ICON_WPAINT_HLT);
+ str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
+ str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
+ str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
+ str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
}
/* if active object is an armature */
if (ob->type==OB_ARMATURE) {
- str += sprintf(str, formatstr, "Pose Mode", V3D_POSEMODE_SEL, ICON_POSE_HLT);
+ str += sprintf(str, formatstr, "Pose Mode", OB_MODE_POSE, ICON_POSE_HLT);
}
- if (ob->particlesystem.first) {
- str += sprintf(str, formatstr, "Particle Mode", V3D_PARTICLEEDITMODE_SEL, ICON_PARTICLEMODE);
+ if (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)) {
+ str += sprintf(str, formatstr, "Particle Mode", OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE);
}
return (string);
@@ -3505,11 +1660,11 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
ToolSettings *ts= CTX_data_tool_settings(C);
ScrArea *sa= CTX_wm_area(C);
View3D *v3d= sa->spacedata.first;
- Base *basact= CTX_data_active_base(C);
- Object *ob= CTX_data_active_object(C);
Object *obedit = CTX_data_edit_object(C);
+ Object *ob = CTX_data_active_object(C);
EditMesh *em= NULL;
int bit, ctrl= win->eventstate->ctrl, shift= win->eventstate->shift;
+ PointerRNA props_ptr;
if(obedit && obedit->type==OB_MESH) {
em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
@@ -3556,79 +1711,10 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
// XXX start_game();
break;
case B_MODESELECT:
- if (v3d->modeselect == V3D_OBJECTMODE_SEL) {
-
- v3d->flag &= ~V3D_MODE;
- ED_view3d_exit_paint_modes(C);
- ED_armature_exit_posemode(C, basact);
- if(obedit)
- ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
- }
- else if (v3d->modeselect == V3D_EDITMODE_SEL) {
- if(!obedit) {
- v3d->flag &= ~V3D_MODE;
- ED_object_enter_editmode(C, EM_WAITCURSOR);
- ED_undo_push(C, "Original"); /* here, because all over code enter_editmode is abused */
- }
- }
- else if (v3d->modeselect == V3D_SCULPTMODE_SEL) {
- if (!(G.f & G_SCULPTMODE)) {
- v3d->flag &= ~V3D_MODE;
- ED_view3d_exit_paint_modes(C);
- if(obedit) ED_object_exit_editmode(C, EM_FREEUNDO|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- WM_operator_name_call(C, "SCULPT_OT_sculptmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- }
- }
- else if (v3d->modeselect == V3D_VERTEXPAINTMODE_SEL) {
- if (!(G.f & G_VERTEXPAINT)) {
- v3d->flag &= ~V3D_MODE;
- ED_view3d_exit_paint_modes(C);
- if(obedit) ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- WM_operator_name_call(C, "PAINT_OT_vertex_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- }
- }
- else if (v3d->modeselect == V3D_TEXTUREPAINTMODE_SEL) {
- if (!(G.f & G_TEXTUREPAINT)) {
- v3d->flag &= ~V3D_MODE;
- ED_view3d_exit_paint_modes(C);
- if(obedit) ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- WM_operator_name_call(C, "PAINT_OT_texture_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- }
- }
- else if (v3d->modeselect == V3D_WEIGHTPAINTMODE_SEL) {
- if (!(G.f & G_WEIGHTPAINT) && (ob && ob->type == OB_MESH) ) {
- v3d->flag &= ~V3D_MODE;
- ED_view3d_exit_paint_modes(C);
- if(obedit)
- ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- WM_operator_name_call(C, "PAINT_OT_weight_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- }
- }
- else if (v3d->modeselect == V3D_POSEMODE_SEL) {
-
- if (ob) {
- v3d->flag &= ~V3D_MODE;
- if(obedit)
- ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- ED_armature_enter_posemode(C, basact);
- }
- }
- else if(v3d->modeselect == V3D_PARTICLEEDITMODE_SEL){
- if (!(G.f & G_PARTICLEEDIT)) {
- v3d->flag &= ~V3D_MODE;
- ED_view3d_exit_paint_modes(C);
- if(obedit) ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- WM_operator_name_call(C, "PARTICLE_OT_particle_edit_toggle", WM_OP_EXEC_REGION_WIN, NULL);
- }
- }
- break;
-
+ WM_operator_properties_create(&props_ptr, "OBJECT_OT_mode_set");
+ RNA_enum_set(&props_ptr, "mode", v3d->modeselect);
+ WM_operator_name_call(C, "OBJECT_OT_mode_set", WM_OP_EXEC_REGION_WIN, &props_ptr);
+ break;
case B_AROUND:
// XXX handle_view3d_around(); /* copies to other 3d windows */
break;
@@ -3674,34 +1760,37 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
case B_SEL_PATH:
ts->particle.selectmode= SCE_SELECT_PATH;
+ WM_event_add_notifier(C, NC_OBJECT, ob);
ED_undo_push(C, "Selectmode Set: Path");
break;
case B_SEL_POINT:
ts->particle.selectmode = SCE_SELECT_POINT;
+ WM_event_add_notifier(C, NC_OBJECT, ob);
ED_undo_push(C, "Selectmode Set: Point");
break;
case B_SEL_END:
ts->particle.selectmode = SCE_SELECT_END;
+ WM_event_add_notifier(C, NC_OBJECT, ob);
ED_undo_push(C, "Selectmode Set: End point");
break;
case B_MAN_TRANS:
if( shift==0 || v3d->twtype==0) {
v3d->twtype= V3D_MANIP_TRANSLATE;
- ED_area_tag_redraw(sa);
}
- break;
+ ED_area_tag_redraw(sa);
+ break;
case B_MAN_ROT:
if( shift==0 || v3d->twtype==0) {
- v3d->twtype= V3D_MANIP_ROTATE;
- ED_area_tag_redraw(sa);
+ v3d->twtype= V3D_MANIP_ROTATE;
}
+ ED_area_tag_redraw(sa);
break;
case B_MAN_SCALE:
if( shift==0 || v3d->twtype==0) {
- v3d->twtype= V3D_MANIP_SCALE;
- ED_area_tag_redraw(sa);
+ v3d->twtype= V3D_MANIP_SCALE;
}
+ ED_area_tag_redraw(sa);
break;
case B_NDOF:
break;
@@ -3771,111 +1860,34 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o
* height of the header */
xmax= GetButStringLength("Select");
- if (obedit) {
- if (ob && ob->type == OB_MESH) {
- uiDefMenuBut(block, view3d_select_meshmenu, NULL, "Select", xco,yco, xmax-3, 20, "");
- } else if (ob && (ob->type == OB_CURVE || ob->type == OB_SURF)) {
- uiDefMenuBut(block, view3d_select_curvemenu, NULL, "Select", xco, yco, xmax-3, 20, "");
- } else if (ob && ob->type == OB_FONT) {
- xmax= 0;
- } else if (ob && ob->type == OB_MBALL) {
- uiDefMenuBut(block, view3d_select_metaballmenu, NULL, "Select", xco,yco, xmax-3, 20, "");
- } else if (ob && ob->type == OB_LATTICE) {
- uiDefMenuBut(block, view3d_select_latticemenu, NULL, "Select", xco, yco, xmax-3, 20, "");
- } else if (ob && ob->type == OB_ARMATURE) {
- uiDefMenuBut(block, view3d_select_armaturemenu, NULL, "Select", xco,yco, xmax-3, 20, "");
- }
- } else if (FACESEL_PAINT_TEST) {
- if (ob && ob->type == OB_MESH) {
- uiDefPulldownBut(block, view3d_select_faceselmenu, NULL, "Select", xco,yco, xmax-3, 20, "");
- }
- } else if ((G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_WEIGHTPAINT)) {
- uiDefBut(block, LABEL,0,"", xco, 0, xmax, 20, 0, 0, 0, 0, 0, "");
- } else if (G.f & G_PARTICLEEDIT) {
- uiDefMenuBut(block, view3d_select_particlemenu, NULL, "Select", xco,yco, xmax-3, 20, "");
- } else {
-
- if (ob && (ob->flag & OB_POSEMODE))
- uiDefMenuBut(block, view3d_select_posemenu, NULL, "Select", xco,yco, xmax-3, 20, "");
- else
- uiDefMenuBut(block, view3d_select_objectmenu, NULL, "Select", xco,yco, xmax-3, 20, "");
- }
+
xco+= xmax;
if (obedit) {
- if (ob && ob->type == OB_MESH) {
- xmax= GetButStringLength("Mesh");
- uiDefMenuBut(block, view3d_edit_meshmenu, NULL, "Mesh", xco,yco, xmax-3, 20, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_CURVE) {
- xmax= GetButStringLength("Curve");
- uiDefMenuBut(block, view3d_edit_curvemenu, NULL, "Curve", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_SURF) {
- xmax= GetButStringLength("Surface");
- uiDefMenuBut(block, view3d_edit_curvemenu, NULL, "Surface", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_FONT) {
- xmax= GetButStringLength("Text");
- uiDefMenuBut(block, view3d_edit_textmenu, NULL, "Text", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_MBALL) {
- xmax= GetButStringLength("Metaball");
- uiDefMenuBut(block, view3d_edit_metaballmenu, NULL, "Metaball", xco,yco, xmax-3, 20, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_LATTICE) {
- xmax= GetButStringLength("Lattice");
- uiDefMenuBut(block, view3d_edit_latticemenu, NULL, "Lattice", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_ARMATURE) {
- xmax= GetButStringLength("Armature");
- uiDefMenuBut(block, view3d_edit_armaturemenu, NULL, "Armature", xco,yco, xmax-3, 20, "");
- xco+= xmax;
- }
-
}
- else if (G.f & G_WEIGHTPAINT) {
+ else if (ob && ob->mode & OB_MODE_WEIGHT_PAINT) {
xmax= GetButStringLength("Paint");
uiDefPulldownBut(block, view3d_wpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, "");
xco+= xmax;
}
- else if (G.f & G_VERTEXPAINT) {
- xmax= GetButStringLength("Paint");
- uiDefPulldownBut(block, view3d_vpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, "");
- xco+= xmax;
- }
- else if (G.f & G_TEXTUREPAINT) {
+ else if (ob && ob->mode & OB_MODE_TEXTURE_PAINT) {
xmax= GetButStringLength("Paint");
uiDefPulldownBut(block, view3d_tpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, "");
xco+= xmax;
}
- else if( G.f & G_SCULPTMODE) {
- xmax= GetButStringLength("Sculpt");
- uiDefMenuBut(block, view3d_sculpt_menu, NULL, "Sculpt", xco, yco, xmax-3, 20, "");
- xco+= xmax;
- }
- else if (FACESEL_PAINT_TEST) {
+ else if (paint_facesel_test(ob)) {
if (ob && ob->type == OB_MESH) {
xmax= GetButStringLength("Face");
uiDefPulldownBut(block, view3d_faceselmenu, NULL, "Face", xco,yco, xmax-3, 20, "");
xco+= xmax;
}
}
- else if(G.f & G_PARTICLEEDIT) {
- xmax= GetButStringLength("Particle");
- uiDefMenuBut(block, view3d_particlemenu, NULL, "Particle", xco,yco, xmax-3, 20, "");
- xco+= xmax;
+ else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) {
+ /* ported to python */
}
else {
- if (ob && (ob->flag & OB_POSEMODE)) {
- xmax= GetButStringLength("Pose");
- uiDefMenuBut(block, view3d_pose_armaturemenu, NULL, "Pose", xco,yco, xmax-3, 20, "");
- xco+= xmax;
- }
- else {
- xmax= GetButStringLength("Object");
- uiDefMenuBut(block, view3d_edit_objectmenu, NULL, "Object", xco,yco, xmax-3, 20, "");
- xco+= xmax;
+ if (ob && (ob->mode & OB_MODE_POSE)) {
+ /* ported to python */
}
}
@@ -3905,6 +1917,20 @@ static void header_xco_step(ARegion *ar, int *xco, int *yco, int *maxco, int ste
}
}
+/* Returns the icon associated with an object mode */
+static int object_mode_icon(int mode)
+{
+ EnumPropertyItem *item = object_mode_items;
+
+ while(item->name != NULL) {
+ if(item->value == mode)
+ return item->icon;
+ ++item;
+ }
+
+ return ICON_OBJECT_DATAMODE;
+}
+
void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
{
ARegion *ar= CTX_wm_region(C);
@@ -3927,29 +1953,23 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiBlockSetEmboss(block, UI_EMBOSS);
/* mode */
- v3d->modeselect = V3D_OBJECTMODE_SEL;
-
- if (obedit) v3d->modeselect = V3D_EDITMODE_SEL;
- else if(ob && (ob->flag & OB_POSEMODE)) v3d->modeselect = V3D_POSEMODE_SEL;
- else if (G.f & G_SCULPTMODE) v3d->modeselect = V3D_SCULPTMODE_SEL;
- else if (G.f & G_WEIGHTPAINT) v3d->modeselect = V3D_WEIGHTPAINTMODE_SEL;
- else if (G.f & G_VERTEXPAINT) v3d->modeselect = V3D_VERTEXPAINTMODE_SEL;
- else if (G.f & G_TEXTUREPAINT) v3d->modeselect = V3D_TEXTUREPAINTMODE_SEL;
- /*else if(G.f & G_FACESELECT) v3d->modeselect = V3D_FACESELECTMODE_SEL;*/
- else if(G.f & G_PARTICLEEDIT) v3d->modeselect = V3D_PARTICLEEDITMODE_SEL;
+ if(ob)
+ v3d->modeselect = ob->mode;
+ else
+ v3d->modeselect = OB_MODE_OBJECT;
v3d->flag &= ~V3D_MODE;
/* not sure what the v3d->flag is useful for now... modeselect is confusing */
if(obedit) v3d->flag |= V3D_EDITMODE;
- if(ob && (ob->flag & OB_POSEMODE)) v3d->flag |= V3D_POSEMODE;
- if(G.f & G_VERTEXPAINT) v3d->flag |= V3D_VERTEXPAINT;
- if(G.f & G_WEIGHTPAINT) v3d->flag |= V3D_WEIGHTPAINT;
- if (G.f & G_TEXTUREPAINT) v3d->flag |= V3D_TEXTUREPAINT;
- if(FACESEL_PAINT_TEST) v3d->flag |= V3D_FACESELECT;
-
- uiDefIconTextButS(block, MENU, B_MODESELECT, (v3d->modeselect),view3d_modeselect_pup(scene) ,
- xco,yco,126,20, &(v3d->modeselect), 0, 0, 0, 0, "Mode (Hotkeys: Tab, V, Ctrl Tab)");
+ if(ob && (ob->mode & OB_MODE_POSE)) v3d->flag |= V3D_POSEMODE;
+ if(ob && (ob->mode & OB_MODE_VERTEX_PAINT)) v3d->flag |= V3D_VERTEXPAINT;
+ if(ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) v3d->flag |= V3D_WEIGHTPAINT;
+ if(ob && (ob->mode & OB_MODE_TEXTURE_PAINT)) v3d->flag |= V3D_TEXTUREPAINT;
+ if(paint_facesel_test(ob)) v3d->flag |= V3D_FACESELECT;
+
+ uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) ,
+ xco,yco,126,20, &(v3d->modeselect), 0, 0, 0, 0, "Mode (Hotkeys: Tab, V, Ctrl Tab)");
header_xco_step(ar, &xco, &yco, &maxco, 126+8);
/* DRAWTYPE */
@@ -3989,7 +2009,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiBlockEndAlign(block);
}
} else {
- if (obedit==NULL && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))) {
+ if (obedit==NULL && ((ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)))) {
uiDefIconButBitI(block, TOG, G_FACESELECT, B_VIEW_BUTSEDIT, ICON_FACESEL_HLT,xco,yco,XIC,YIC, &G.f, 0, 0, 0, 0, "Painting Mask (FKey)");
header_xco_step(ar, &xco, &yco, &maxco, XIC+10);
} else {
@@ -4076,7 +2096,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
}
/* proportional falloff */
- if((obedit && (obedit->type == OB_MESH || obedit->type == OB_CURVE || obedit->type == OB_SURF || obedit->type == OB_LATTICE)) || G.f & G_PARTICLEEDIT) {
+ if((obedit && (obedit->type == OB_MESH || obedit->type == OB_CURVE || obedit->type == OB_SURF || obedit->type == OB_LATTICE)) || (ob && ob->mode & OB_MODE_PARTICLE_EDIT)) {
uiBlockBeginAlign(block);
uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_PROP_OFF, "Proportional %t|Off %x0|On %x1|Connected %x2", xco,yco,XIC+10,YIC, &(ts->proportional), 0, 1.0, 0, 0, "Proportional Edit Falloff (Hotkeys: O, Alt O) ");
@@ -4137,7 +2157,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
BKE_mesh_end_editmesh(obedit->data, em);
}
- else if(G.f & G_PARTICLEEDIT) {
+ else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) {
uiBlockBeginAlign(block);
uiDefIconButBitI(block, TOG, SCE_SELECT_PATH, B_SEL_PATH, ICON_EDGESEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Path edit mode");
xco+= XIC;
@@ -4157,7 +2177,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE, xco,yco,XIC,YIC, NULL, 0, 1.0, 0, 0, "Render this window (Ctrl Click for anim)");
- if (ob && (ob->flag & OB_POSEMODE)) {
+ if (ob && (ob->mode & OB_MODE_POSE)) {
xco+= XIC;
uiBlockBeginAlign(block);
@@ -4174,11 +2194,5 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
}
}
-
- /* always as last */
- UI_view2d_totRect_set(&ar->v2d, maxco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
-
- uiEndBlock(C, block);
- uiDrawBlock(C, block);
}
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 3e9382509f4..e5e85cf9d16 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -140,7 +140,6 @@ void view3d_buttons_register(struct ARegionType *art);
void VIEW3D_OT_toolbar(struct wmOperatorType *ot);
void view3d_toolbar_register(struct ARegionType *art);
void view3d_tool_props_register(struct ARegionType *art);
-char *view3d_context_string(const struct bContext *C);
/* view3d_snap.c */
int minmax_verts(Object *obedit, float *min, float *max);
@@ -157,6 +156,9 @@ void VIEW3D_OT_snap_menu(struct wmOperatorType *ot);
ARegion *view3d_has_buttons_region(ScrArea *sa);
ARegion *view3d_has_tools_region(ScrArea *sa);
+/* draw_volume.c */
+void draw_volume(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct Base *base, struct GPUTexture *tex, int res[3]);
+
#endif /* ED_VIEW3D_INTERN_H */
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index 112847272e5..7da2e591b10 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -106,9 +106,6 @@ void view3d_keymap(wmWindowManager *wm)
ListBase *keymap= WM_keymap_listbase(wm, "View3D Generic", SPACE_VIEW3D, 0);
wmKeymapItem *km;
- WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_toggle", VKEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_toggle", TABKEY, KM_PRESS, KM_CTRL, 0);
-
WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_toolbar", TKEY, KM_PRESS, 0, 0);
@@ -134,8 +131,9 @@ void view3d_keymap(wmWindowManager *wm)
WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
RNA_boolean_set(km->ptr, "snap", 1);
-
- WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", ACTIONMOUSE, KM_PRESS, 0, 0);
+
+ WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/
+
WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "VIEW3D_OT_viewrotate", MIDDLEMOUSE, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 54e556b58ed..7743ede399b 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -59,6 +59,7 @@
#include "BKE_depsgraph.h"
#include "BKE_object.h"
#include "BKE_global.h"
+#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_utildefines.h"
@@ -127,7 +128,7 @@ void view3d_get_transformation(ViewContext *vc, Object *ob, bglMats *mats)
float cpy[4][4];
int i, j;
- Mat4MulMat4(cpy, vc->rv3d->viewmat, ob->obmat);
+ Mat4MulMat4(cpy, ob->obmat, vc->rv3d->viewmat);
for(i = 0; i < 4; ++i) {
for(j = 0; j < 4; ++j) {
@@ -378,7 +379,7 @@ static void do_lasso_select_objects(ViewContext *vc, short mcords[][2], short mo
else ED_base_object_select(base, BA_DESELECT);
base->object->flag= base->flag;
}
- if(base->object->flag & OB_POSEMODE) {
+ if(base->object->mode & OB_MODE_POSE) {
do_lasso_select_pose(vc, mcords, moves, select);
}
}
@@ -693,12 +694,14 @@ static void do_lasso_select_node(short mcords[][2], short moves, short select)
void view3d_lasso_select(bContext *C, ViewContext *vc, short mcords[][2], short moves, short select)
{
+ Object *ob = CTX_data_active_object(C);
+
if(vc->obedit==NULL) {
- if(FACESEL_PAINT_TEST)
+ if(paint_facesel_test(ob))
do_lasso_select_facemode(vc, mcords, moves, select);
- else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))
+ else if(ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))
;
- else if(G.f & G_PARTICLEEDIT)
+ else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT)
PE_lasso_select(C, mcords, moves, select);
else
do_lasso_select_objects(vc, mcords, moves, select);
@@ -1109,7 +1112,7 @@ static void mouse_select(bContext *C, short *mval, short extend, short obcenter)
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE, basact->object);
/* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
- if(G.f & G_WEIGHTPAINT) {
+ if(basact->object->mode & OB_MODE_WEIGHT_PAINT) {
/* prevent activating */
basact= NULL;
}
@@ -1323,6 +1326,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
ScrArea *sa= CTX_wm_area(C);
View3D *v3d= sa->spacedata.first;
Object *obedit= CTX_data_edit_object(C);
+ Object *obact= CTX_data_active_object(C);
rcti rect;
Base *base;
MetaElem *ml;
@@ -1341,11 +1345,11 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
rect.xmax= RNA_int_get(op->ptr, "xmax");
rect.ymax= RNA_int_get(op->ptr, "ymax");
- if(obedit==NULL && (FACESEL_PAINT_TEST)) {
+ if(obedit==NULL && (paint_facesel_test(OBACT))) {
// XXX face_borderselect();
return OPERATOR_FINISHED;
}
- else if(obedit==NULL && (G.f & G_PARTICLEEDIT)) {
+ else if(obedit==NULL && (obact && obact->mode & OB_MODE_PARTICLE_EDIT)) {
return PE_border_select(C, &rect, (val==LEFTMOUSE));
}
@@ -1453,7 +1457,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
int bone_only;
int totobj= MAXPICKBUF; // XXX solve later
- if((ob) && (ob->flag & OB_POSEMODE))
+ if((ob) && (ob->mode & OB_MODE_POSE))
bone_only= 1;
else
bone_only= 0;
@@ -1558,6 +1562,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot)
static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Object *obedit= CTX_data_edit_object(C);
+ Object *obact= CTX_data_active_object(C);
short extend= RNA_boolean_get(op->ptr, "extend");
view3d_operator_needs_opengl(C);
@@ -1575,7 +1580,7 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
mouse_mball(C, event->mval, extend);
}
- else if(G.f & G_PARTICLEEDIT)
+ else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT)
PE_mouse_particles(C, event->mval, extend);
else
mouse_select(C, event->mval, extend, 0);
@@ -1637,9 +1642,9 @@ static void mesh_circle_select(ViewContext *vc, int selecting, short *mval, floa
{
ToolSettings *ts= vc->scene->toolsettings;
int bbsel;
+ Object *ob= vc->obact;
- if(vc->obedit==NULL && (FACESEL_PAINT_TEST)) {
- Object *ob= vc->obact;
+ if(vc->obedit==NULL && paint_facesel_test(ob)) {
Mesh *me = ob?ob->data:NULL;
if (me) {
@@ -1778,12 +1783,13 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
Scene *scene= CTX_data_scene(C);
+ Object *obact= CTX_data_active_object(C);
View3D *v3d= sa->spacedata.first;
int x= RNA_int_get(op->ptr, "x");
int y= RNA_int_get(op->ptr, "y");
int radius= RNA_int_get(op->ptr, "radius");
- if(CTX_data_edit_object(C) || (G.f & G_PARTICLEEDIT)) {
+ if(CTX_data_edit_object(C) || (obact && obact->mode & OB_MODE_PARTICLE_EDIT)) {
ViewContext vc;
short mval[2], selecting;
@@ -1794,8 +1800,10 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
mval[1]= y;
selecting= LEFTMOUSE==RNA_int_get(op->ptr, "event_type"); // XXX solve
- if(CTX_data_edit_object(C))
+ if(CTX_data_edit_object(C)) {
obedit_circle_select(&vc, selecting, mval, (float)radius);
+ WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obact);
+ }
else
return PE_circle_select(C, selecting, mval, (float)radius);
}
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index fba8d13c6a5..335bc2c9e56 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -482,7 +482,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
- if(ob->flag & OB_POSEMODE) {
+ if(ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
bArmature *arm= ob->data;
@@ -609,7 +609,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *op)
else {
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
- if(ob->flag & OB_POSEMODE) {
+ if(ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
bArmature *arm= ob->data;
float cursp[3];
@@ -775,7 +775,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *op)
else {
Object *ob= OBACT;
- if(ob && (ob->flag & OB_POSEMODE)) {
+ if(ob && (ob->mode & OB_MODE_POSE)) {
bArmature *arm= ob->data;
bPoseChannel *pchan;
for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
@@ -935,7 +935,7 @@ static int snap_selected_to_center(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
- if(ob->flag & OB_POSEMODE) {
+ if(ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
bArmature *arm= ob->data;
@@ -1004,7 +1004,7 @@ static int snap_selected_to_center(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
- if(ob->flag & OB_POSEMODE) {
+ if(ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
bArmature *arm= ob->data;
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 67d8bc3e5ee..c87dd0b7948 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -118,6 +118,19 @@ static void redo_cb(bContext *C, void *arg_op, void *arg2)
}
}
+static wmOperator *view3d_last_operator(const bContext *C)
+{
+ wmWindowManager *wm= CTX_wm_manager(C);
+ wmOperator *op;
+
+ /* only for operators that are registered and did an undo push */
+ for(op= wm->operators.last; op; op= op->prev)
+ if((op->type->flag & OPTYPE_REGISTER) && (op->type->flag & OPTYPE_UNDO))
+ break;
+
+ return op;
+}
+
static void view3d_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOperator *op)
{
wmWindowManager *wm= CTX_wm_manager(C);
@@ -129,28 +142,32 @@ static void view3d_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOper
}
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
- uiDefAutoButsRNA(C, pa->layout, &ptr, 1);
-
+ if(op->type->ui)
+ op->type->ui((bContext*)C, &ptr, pa->layout);
+ else
+ uiDefAutoButsRNA(C, pa->layout, &ptr, 1);
+}
+
+static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa)
+{
+ wmOperator *op= view3d_last_operator(C);
+
+ if(op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
+ else BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname));
}
static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmOperator *op;
+ wmOperator *op= view3d_last_operator(C);
uiBlock *block;
- block= uiLayoutGetBlock(pa->layout);
-
- /* only for operators that are registered and did an undo push */
- for(op= wm->operators.last; op; op= op->prev)
- if((op->type->flag & OPTYPE_REGISTER) && (op->type->flag & OPTYPE_UNDO))
- break;
-
if(op==NULL)
return;
if(op->type->poll && op->type->poll((bContext *)C)==0)
return;
+ block= uiLayoutGetBlock(pa->layout);
+
uiBlockSetFunc(block, redo_cb, op, NULL);
if(op->macro.first) {
@@ -164,42 +181,6 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
/* ******************* */
-char *view3d_context_string(const bContext *C)
-{
- Object *obedit= CTX_data_edit_object(C);
-
- if(obedit) {
- switch(obedit->type) {
- case OB_MESH:
- return "editmode_mesh";
- case OB_CURVE:
- return "editmode_curve";
- case OB_SURF:
- return "editmode_surface";
- case OB_FONT:
- return "editmode_text";
- case OB_ARMATURE:
- return "editmode_armature";
- case OB_MBALL:
- return "editmode_mball";
- case OB_LATTICE:
- return "editmode_lattice";
- }
- }
- else {
- Object *ob = CTX_data_active_object(C);
-
- if(ob && (ob->flag & OB_POSEMODE)) return "pose_mode";
- else if (G.f & G_SCULPTMODE) return "sculpt_mode";
- else if (G.f & G_WEIGHTPAINT) return "weight_paint";
- else if (G.f & G_VERTEXPAINT) return "vertex_paint";
- else if (G.f & G_TEXTUREPAINT) return "texture_paint";
- else if(G.f & G_PARTICLEEDIT) return "particle_mode";
- }
-
- return "objectmode";
-}
-
typedef struct CustomTool {
struct CustomTool *next, *prev;
char opname[OP_MAX_TYPENAME];
@@ -215,7 +196,7 @@ static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2)
BLI_addtail(arg_listbase, ct);
BLI_strncpy(ct->opname, ot->idname, OP_MAX_TYPENAME);
- BLI_strncpy(ct->context, view3d_context_string(C), OP_MAX_TYPENAME);
+ BLI_strncpy(ct->context, CTX_data_mode_string(C), OP_MAX_TYPENAME);
}
}
@@ -278,7 +259,7 @@ static void view3d_panel_tool_shelf(const bContext *C, Panel *pa)
SpaceLink *sl= CTX_wm_space_data(C);
SpaceType *st= NULL;
uiLayout *col;
- const char *context= view3d_context_string(C);
+ const char *context= CTX_data_mode_string(C);
if(sl)
st= BKE_spacetype_from_id(sl->spacetype);
@@ -289,7 +270,7 @@ static void view3d_panel_tool_shelf(const bContext *C, Panel *pa)
for(ct= st->toolshelf.first; ct; ct= ct->next) {
if(0==strncmp(context, ct->context, OP_MAX_TYPENAME)) {
col= uiLayoutColumn(pa->layout, 1);
- uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN);
+ uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN, 0);
}
}
}
@@ -315,7 +296,8 @@ void view3d_tool_props_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator");
strcpy(pt->idname, "VIEW3D_PT_last_operator");
- strcpy(pt->label, "Last Operator");
+ strcpy(pt->label, "Operator");
+ pt->draw_header= view3d_panel_operator_redo_header;
pt->draw= view3d_panel_operator_redo;
BLI_addtail(&art->paneltypes, pt);
}
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 20e0a79f0c7..de8166b372b 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -63,6 +63,7 @@
#include "RE_pipeline.h" // make_stars
#include "BIF_gl.h"
+#include "BIF_glutil.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -80,6 +81,10 @@
#include "PIL_time.h" /* smoothview */
+#if GAMEBLENDER == 1
+#include "SYS_System.h"
+#endif
+
#include "view3d_intern.h" // own include
/* use this call when executing an operator,
@@ -481,7 +486,10 @@ void initgrabz(RegionView3D *rv3d, float x, float y, float z)
/* Negative zfac means x, y, z was behind the camera (in perspective).
* This gives flipped directions, so revert back to ok default case.
*/
- if (rv3d->zfac < 0.0f) rv3d->zfac = 1.0f;
+ // NOTE: I've changed this to flip zfac to be positive again for now so that GPencil draws ok
+ // -- Aligorith, 2009Aug31
+ //if (rv3d->zfac < 0.0f) rv3d->zfac = 1.0f;
+ if (rv3d->zfac < 0.0f) rv3d->zfac= -rv3d->zfac;
}
/* always call initgrabz */
@@ -543,6 +551,18 @@ void view3d_get_object_project_mat(RegionView3D *rv3d, Object *ob, float pmat[4]
Mat4MulMat4(pmat, vmat, rv3d->winmat);
}
+/* Uses window coordinates (x,y) and depth component z to find a point in
+ modelspace */
+void view3d_unproject(bglMats *mats, float out[3], const short x, const short y, const float z)
+{
+ double ux, uy, uz;
+
+ gluUnProject(x,y,z, mats->modelview, mats->projection,
+ (GLint *)mats->viewport, &ux, &uy, &uz );
+ out[0] = ux;
+ out[1] = uy;
+ out[2] = uz;
+}
/* use above call to get projecting mat */
void view3d_project_float(ARegion *ar, float *vec, float *adr, float mat[4][4])
@@ -1389,12 +1409,13 @@ static ListBase queue_back;
static void SaveState(bContext *C)
{
wmWindow *win= CTX_wm_window(C);
+ Object *obact = CTX_data_active_object(C);
glPushAttrib(GL_ALL_ATTRIB_BITS);
GPU_state_init();
- if(G.f & G_TEXTUREPAINT)
+ if(obact && obact->mode & OB_MODE_TEXTURE_PAINT)
GPU_paint_set_mipmap(1);
queue_back= win->queue;
@@ -1407,8 +1428,9 @@ static void SaveState(bContext *C)
static void RestoreState(bContext *C)
{
wmWindow *win= CTX_wm_window(C);
+ Object *obact = CTX_data_active_object(C);
- if(G.f & G_TEXTUREPAINT)
+ if(obact && obact->mode & OB_MODE_TEXTURE_PAINT)
GPU_paint_set_mipmap(0);
//XXX curarea->win_swap = 0;
@@ -1424,11 +1446,66 @@ static void RestoreState(bContext *C)
glPopAttrib();
}
+/* was space_set_commmandline_options in 2.4x */
+void game_set_commmandline_options(GameData *gm)
+{
+ SYS_SystemHandle syshandle;
+ int test;
+
+ if ( (syshandle = SYS_GetSystem()) ) {
+ /* User defined settings */
+ test= (U.gameflags & USER_DISABLE_SOUND);
+ /* if user already disabled audio at the command-line, don't re-enable it */
+ if (test)
+ SYS_WriteCommandLineInt(syshandle, "noaudio", test);
+
+ test= (U.gameflags & USER_DISABLE_MIPMAP);
+ GPU_set_mipmap(!test);
+ SYS_WriteCommandLineInt(syshandle, "nomipmap", test);
+
+ /* File specific settings: */
+ /* Only test the first one. These two are switched
+ * simultaneously. */
+ test= (gm->flag & GAME_SHOW_FRAMERATE);
+ SYS_WriteCommandLineInt(syshandle, "show_framerate", test);
+ SYS_WriteCommandLineInt(syshandle, "show_profile", test);
+
+ test = (gm->flag & GAME_SHOW_FRAMERATE);
+ SYS_WriteCommandLineInt(syshandle, "show_properties", test);
+
+ test= (gm->flag & GAME_SHOW_PHYSICS);
+ SYS_WriteCommandLineInt(syshandle, "show_physics", test);
+
+ test= (gm->flag & GAME_ENABLE_ALL_FRAMES);
+ SYS_WriteCommandLineInt(syshandle, "fixedtime", test);
+
+// a= (G.fileflags & G_FILE_GAME_TO_IPO);
+// SYS_WriteCommandLineInt(syshandle, "game2ipo", a);
+
+ test= (gm->flag & GAME_IGNORE_DEPRECATION_WARNINGS);
+ SYS_WriteCommandLineInt(syshandle, "ignore_deprecation_warnings", test);
+
+ test= (gm->matmode == GAME_MAT_MULTITEX);
+ SYS_WriteCommandLineInt(syshandle, "blender_material", test);
+ test= (gm->matmode == GAME_MAT_GLSL);
+ SYS_WriteCommandLineInt(syshandle, "blender_glsl_material", test);
+ test= (gm->flag & GAME_DISPLAY_LISTS);
+ SYS_WriteCommandLineInt(syshandle, "displaylists", test);
+
+
+ }
+}
+
/* maybe we need this defined somewhere else */
extern void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int always_use_expand_framing);
#endif // GAMEBLENDER == 1
+int game_engine_poll(bContext *C)
+{
+ return CTX_data_mode_enum(C)==CTX_MODE_OBJECT ? 1:0;
+}
+
static int game_engine_exec(bContext *C, wmOperator *unused)
{
#if GAMEBLENDER == 1
@@ -1460,6 +1537,8 @@ static int game_engine_exec(bContext *C, wmOperator *unused)
view3d_operator_needs_opengl(C);
+ game_set_commmandline_options(&startscene->gm);
+
SaveState(C);
StartKetsjiShell(C, ar, 1);
RestoreState(C);
@@ -1488,7 +1567,7 @@ void VIEW3D_OT_game_start(wmOperatorType *ot)
/* api callbacks */
ot->exec= game_engine_exec;
- //ot->poll= ED_operator_view3d_active;
+ ot->poll= game_engine_poll;
}
/* ************************************** */
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index e3e4822b383..f0de28476f0 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -89,10 +89,12 @@
#include "BKE_pointcache.h"
#include "BKE_utildefines.h"
#include "BKE_context.h"
+#include "BKE_unit.h"
//#include "BSE_view.h"
#include "ED_image.h"
+#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_markers.h"
@@ -298,6 +300,10 @@ static void viewRedrawForce(bContext *C, TransInfo *t)
{
/* Do we need more refined tags? */
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
+
+ /* for realtime animation record - send notifiers recognised by animation editors */
+ if ((t->animtimer) && IS_AUTOKEY_ON(t->scene))
+ WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, NULL);
}
else if (t->spacetype == SPACE_ACTION) {
//SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
@@ -2664,21 +2670,21 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
/* this function works on end result */
protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat);
}
- else {
+ else {
float eulmat[3][3];
-
+
Mat3MulMat3(totmat, mat, td->mtx);
Mat3MulMat3(smat, td->smtx, totmat);
-
+
/* calculate the total rotatation in eulers */
VECCOPY(eul, td->ext->irot);
- EulToMat3(eul, eulmat);
-
+ EulOToMat3(eul, td->rotOrder, eulmat);
+
/* mat = transform, obmat = bone rotation */
Mat3MulMat3(fmat, smat, eulmat);
-
- Mat3ToCompatibleEul(fmat, eul, td->ext->rot);
-
+
+ Mat3ToCompatibleEulO(fmat, eul, td->ext->rot, td->rotOrder);
+
/* and apply (to end result only) */
protectedRotateBits(td->protectflag, eul, td->ext->irot);
VECCOPY(td->ext->rot, eul);
@@ -3034,12 +3040,22 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) {
applyAspectRatio(t, dvec);
dist = VecLength(vec);
- sprintf(&tvec[0], "%.4f", dvec[0]);
- sprintf(&tvec[20], "%.4f", dvec[1]);
- sprintf(&tvec[40], "%.4f", dvec[2]);
+ if(t->scene->unit.system) {
+ int i, do_split= t->scene->unit.flag & USER_UNIT_OPT_SPLIT ? 1:0;
+
+ for(i=0; i<3; i++)
+ bUnit_AsString(&tvec[i*20], 20, dvec[i]*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, do_split, 1);
+ }
+ else {
+ sprintf(&tvec[0], "%.4f", dvec[0]);
+ sprintf(&tvec[20], "%.4f", dvec[1]);
+ sprintf(&tvec[40], "%.4f", dvec[2]);
+ }
}
- if( dist > 1e10 || dist < -1e10 ) /* prevent string buffer overflow */
+ if(t->scene->unit.system)
+ bUnit_AsString(distvec, sizeof(distvec), dist*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, 0);
+ else if( dist > 1e10 || dist < -1e10 ) /* prevent string buffer overflow */
sprintf(distvec, "%.4e", dist);
else
sprintf(distvec, "%.4f", dist);
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index efa60b15293..e5bd405c0cd 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -199,6 +199,7 @@ typedef struct TransData {
void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */
short flag; /* Various flags */
short protectflag; /* If set, copy of Object or PoseChannel protection */
+ int rotOrder; /* rotation order (for eulers), as defined in BLI_arithb.h */
} TransData;
typedef struct MouseInput {
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 40e133f554f..302d9b675a0 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -502,22 +502,29 @@ static short apply_targetless_ik(Object *ob)
/* apply and decompose, doesn't work for constraints or non-uniform scale well */
{
- float rmat3[3][3], qmat[3][3], imat[3][3], smat[3][3];
+ float rmat3[3][3], qrmat[3][3], imat[3][3], smat[3][3];
Mat3CpyMat4(rmat3, rmat);
-
- /* quaternion */
- Mat3ToQuat(rmat3, parchan->quat);
-
+
+ /* rotation */
+ if (parchan->rotmode > 0)
+ Mat3ToEulO(rmat3, parchan->eul, parchan->rotmode);
+ else
+ Mat3ToQuat(rmat3, parchan->quat);
+
/* for size, remove rotation */
/* causes problems with some constraints (so apply only if needed) */
if (data->flag & CONSTRAINT_IK_STRETCH) {
- QuatToMat3(parchan->quat, qmat);
- Mat3Inv(imat, qmat);
+ if (parchan->rotmode > 0)
+ EulOToMat3(parchan->eul, parchan->rotmode, qrmat);
+ else
+ QuatToMat3(parchan->quat, qrmat);
+
+ Mat3Inv(imat, qrmat);
Mat3MulMat3(smat, rmat3, imat);
Mat3ToSize(smat, parchan->size);
}
-
+
/* causes problems with some constraints (e.g. childof), so disable this */
/* as it is IK shouldn't affect location directly */
/* VECCOPY(parchan->loc, rmat[3]); */
@@ -568,18 +575,20 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
td->ext->size= pchan->size;
VECCOPY(td->ext->isize, pchan->size);
- if (pchan->rotmode) {
+ if (pchan->rotmode > 0) {
td->ext->rot= pchan->eul;
td->ext->quat= NULL;
-
+
VECCOPY(td->ext->irot, pchan->eul);
+ td->rotOrder= pchan->rotmode;
}
else {
td->ext->rot= NULL;
td->ext->quat= pchan->quat;
-
+
QUATCOPY(td->ext->iquat, pchan->quat);
}
+
/* proper way to get parent transform + own transform + constraints transform */
Mat3CpyMat4(omat, ob->obmat);
@@ -698,6 +707,8 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
bone->flag &= ~BONE_HINGE_CHILD_TRANSFORM;
bone->flag &= ~BONE_TRANSFORM_CHILD;
}
+ else
+ bone->flag &= ~BONE_TRANSFORM;
}
/* make sure no bone can be transformed when a parent is transformed */
@@ -917,7 +928,7 @@ static short pose_grab_with_ik(Object *ob)
Bone *bonec;
short tot_ik= 0;
- if ((ob==NULL) || (ob->pose==NULL) || (ob->flag & OB_POSEMODE)==0)
+ if ((ob==NULL) || (ob->pose==NULL) || (ob->mode & OB_MODE_POSE)==0)
return 0;
arm = ob->data;
@@ -1615,31 +1626,32 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
TransDataExtension *tx;
Base *base = CTX_data_active_base(C);
Object *ob = CTX_data_active_object(C);
- ParticleSystem *psys = PE_get_current(t->scene, ob);
- ParticleSystemModifierData *psmd = NULL;
ParticleEditSettings *pset = PE_settings(t->scene);
- ParticleData *pa = NULL;
- ParticleEdit *edit;
- ParticleEditKey *key;
+ PTCacheEdit *edit = PE_get_current(t->scene, ob);
+ ParticleSystem *psys = NULL;
+ ParticleSystemModifierData *psmd = NULL;
+ PTCacheEditPoint *point;
+ PTCacheEditKey *key;
float mat[4][4];
- int i,k, totpart, transformparticle;
+ int i,k, transformparticle;
int count = 0, hasselected = 0;
int propmode = t->flag & T_PROP_EDIT;
- if(psys==NULL || t->settings->particle.selectmode==SCE_SELECT_PATH) return;
+ if(edit==NULL || t->settings->particle.selectmode==SCE_SELECT_PATH) return;
- psmd = psys_get_modifier(ob,psys);
+ psys = edit->psys;
+
+ if(psys)
+ psmd = psys_get_modifier(ob,psys);
- edit = psys->edit;
- totpart = psys->totpart;
base->flag |= BA_HAS_RECALC_DATA;
- for(i=0, pa=psys->particles; i<totpart; i++, pa++) {
- pa->flag &= ~PARS_TRANSFORM;
+ for(i=0, point=edit->points; i<edit->totpoint; i++, point++) {
+ point->flag &= ~PEP_TRANSFORM;
transformparticle= 0;
- if((pa->flag & PARS_HIDE)==0) {
- for(k=0, key=edit->keys[i]; k<pa->totkey; k++, key++) {
+ if((point->flag & PEP_HIDE)==0) {
+ for(k=0, key=point->keys; k<point->totkey; k++, key++) {
if((key->flag&PEK_HIDE)==0) {
if(key->flag&PEK_SELECT) {
hasselected= 1;
@@ -1652,8 +1664,8 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
}
if(transformparticle) {
- count += pa->totkey;
- pa->flag |= PARS_TRANSFORM;
+ count += point->totkey;
+ point->flag |= PEP_TRANSFORM;
}
}
@@ -1672,18 +1684,23 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
Mat4Invert(ob->imat,ob->obmat);
- for(i=0, pa=psys->particles; i<totpart; i++, pa++) {
+ for(i=0, point=edit->points; i<edit->totpoint; i++, point++) {
TransData *head, *tail;
head = tail = td;
- if(!(pa->flag & PARS_TRANSFORM)) continue;
+ if(!(point->flag & PEP_TRANSFORM)) continue;
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
+ if(psys)
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat);
- for(k=0, key=edit->keys[i]; k<pa->totkey; k++, key++) {
- VECCOPY(key->world_co, key->co);
- Mat4MulVecfl(mat, key->world_co);
- td->loc = key->world_co;
+ for(k=0, key=point->keys; k<point->totkey; k++, key++) {
+ if(psys) {
+ VECCOPY(key->world_co, key->co);
+ Mat4MulVecfl(mat, key->world_co);
+ td->loc = key->world_co;
+ }
+ else
+ td->loc = key->co;
VECCOPY(td->iloc, td->loc);
VECCOPY(td->center, td->loc);
@@ -1711,7 +1728,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
if(k==0) tx->size = 0;
else tx->size = (key - 1)->time;
- if(k == pa->totkey - 1) tx->quat = 0;
+ if(k == point->totkey - 1) tx->quat = 0;
else tx->quat = (key + 1)->time;
}
@@ -1729,35 +1746,42 @@ void flushTransParticles(TransInfo *t)
{
Scene *scene = t->scene;
Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(scene, ob);
- ParticleSystemModifierData *psmd;
- ParticleData *pa;
- ParticleEditKey *key;
+ PTCacheEdit *edit = PE_get_current(scene, ob);
+ ParticleSystem *psys = edit->psys;
+ ParticleSystemModifierData *psmd = NULL;
+ PTCacheEditPoint *point;
+ PTCacheEditKey *key;
TransData *td;
float mat[4][4], imat[4][4], co[3];
int i, k, propmode = t->flag & T_PROP_EDIT;
- psmd = psys_get_modifier(ob, psys);
+ if(psys)
+ psmd = psys_get_modifier(ob, psys);
/* we do transform in world space, so flush world space position
- * back to particle local space */
+ * back to particle local space (only for hair particles) */
td= t->data;
- for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++, td++) {
- if(!(pa->flag & PARS_TRANSFORM)) continue;
+ for(i=0, point=edit->points; i<edit->totpoint; i++, point++, td++) {
+ if(!(point->flag & PEP_TRANSFORM)) continue;
+
+ if(psys) {
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat);
+ Mat4Invert(imat,mat);
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
- Mat4Invert(imat,mat);
+ for(k=0, key=point->keys; k<point->totkey; k++, key++) {
+ VECCOPY(co, key->world_co);
+ Mat4MulVecfl(imat, co);
- for(k=0, key=psys->edit->keys[i]; k<pa->totkey; k++, key++) {
- VECCOPY(co, key->world_co);
- Mat4MulVecfl(imat, co);
- /* optimization for proportional edit */
- if(!propmode || !FloatCompare(key->co, co, 0.0001f)) {
- VECCOPY(key->co, co);
- pa->flag |= PARS_EDIT_RECALC;
+ /* optimization for proportional edit */
+ if(!propmode || !FloatCompare(key->co, co, 0.0001f)) {
+ VECCOPY(key->co, co);
+ point->flag |= PEP_EDIT_RECALC;
+ }
}
}
+ else
+ point->flag |= PEP_EDIT_RECALC;
}
PE_update_object(scene, OBACT, 1);
@@ -4324,12 +4348,14 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode)
AnimData *adt= ob->adt;
float cfra= (float)CFRA; // xxx this will do for now
short flag = 0;
-
+
if (IS_AUTOKEY_FLAG(INSERTNEEDED))
flag |= INSERTKEY_NEEDED;
if (IS_AUTOKEY_FLAG(AUTOMATKEY))
flag |= INSERTKEY_MATRIX;
-
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS))
+ flag |= INSERTKEY_REPLACE;
+
if (IS_AUTOKEY_FLAG(INSERTAVAIL)) {
/* only key on available channels */
if (adt && adt->action) {
@@ -4341,7 +4367,7 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode)
}
else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) {
short doLoc=0, doRot=0, doScale=0;
-
+
/* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
if (tmode == TFM_TRANSLATION) {
doLoc = 1;
@@ -4353,7 +4379,7 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode)
}
else if (v3d->around == V3D_CURSOR)
doLoc = 1;
-
+
if ((v3d->flag & V3D_ALIGN)==0)
doRot = 1;
}
@@ -4364,11 +4390,11 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode)
}
else if (v3d->around == V3D_CURSOR)
doLoc = 1;
-
+
if ((v3d->flag & V3D_ALIGN)==0)
doScale = 1;
}
-
+
// TODO: the group names here are temporary...
// TODO: should this be made to use the builtin KeyingSets instead?
if (doLoc) {
@@ -4393,16 +4419,16 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode)
insert_keyframe(id, NULL, "Object Transform", "location", 0, cfra, flag);
insert_keyframe(id, NULL, "Object Transform", "location", 1, cfra, flag);
insert_keyframe(id, NULL, "Object Transform", "location", 2, cfra, flag);
-
+
insert_keyframe(id, NULL, "Object Transform", "rotation", 0, cfra, flag);
insert_keyframe(id, NULL, "Object Transform", "rotation", 1, cfra, flag);
insert_keyframe(id, NULL, "Object Transform", "rotation", 2, cfra, flag);
-
+
insert_keyframe(id, NULL, "Object Transform", "scale", 0, cfra, flag);
insert_keyframe(id, NULL, "Object Transform", "scale", 1, cfra, flag);
insert_keyframe(id, NULL, "Object Transform", "scale", 2, cfra, flag);
}
-
+
// XXX todo... find a way to send notifiers from here...
}
}
@@ -4426,7 +4452,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
float cfra= (float)CFRA;
short flag= 0;
char buf[512];
-
+
/* flag is initialised from UserPref keyframing settings
* - special exception for targetless IK - INSERTKEY_MATRIX keyframes should get
* visual keyframes even if flag not set, as it's not that useful otherwise
@@ -4436,12 +4462,14 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
flag |= INSERTKEY_MATRIX;
if (IS_AUTOKEY_FLAG(INSERTNEEDED))
flag |= INSERTKEY_NEEDED;
-
+ if (IS_AUTOKEY_MODE(scene, EDITKEYS))
+ flag |= INSERTKEY_REPLACE;
+
for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
if (pchan->bone->flag & BONE_TRANSFORM) {
/* clear any 'unkeyed' flag it may have */
pchan->bone->flag &= ~BONE_UNKEYED;
-
+
/* only insert into available channels? */
if (IS_AUTOKEY_FLAG(INSERTAVAIL)) {
if (act) {
@@ -4452,7 +4480,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
/* only insert keyframe if needed? */
else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) {
short doLoc=0, doRot=0, doScale=0;
-
+
/* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
if (tmode == TFM_TRANSLATION) {
if (targetless_ik)
@@ -4463,18 +4491,18 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
else if (tmode == TFM_ROTATION) {
if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE))
doLoc = 1;
-
+
if ((v3d->flag & V3D_ALIGN)==0)
doRot = 1;
}
else if (tmode == TFM_RESIZE) {
if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE))
doLoc = 1;
-
+
if ((v3d->flag & V3D_ALIGN)==0)
doScale = 1;
}
-
+
if (doLoc) {
sprintf(buf, "pose.pose_channels[\"%s\"].location", pchan->name);
insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag);
@@ -4509,7 +4537,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag);
insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag);
insert_keyframe(id, NULL, pchan->name, buf, 2, cfra, flag);
-
+
if (pchan->rotmode == PCHAN_ROT_QUAT) {
sprintf(buf, "pose.pose_channels[\"%s\"].rotation", pchan->name);
insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag);
@@ -4523,7 +4551,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag);
insert_keyframe(id, NULL, pchan->name, buf, 2, cfra, flag);
}
-
+
sprintf(buf, "pose.pose_channels[\"%s\"].scale", pchan->name);
insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag);
insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag);
@@ -4531,14 +4559,14 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode,
}
}
}
-
+
// XXX todo... figure out way to get appropriate notifiers sent
-
+
/* do the bone paths */
-#if 0 // TRANSFORM_FIX_ME
+#if 0 // XXX TRANSFORM FIX ME
if (arm->pathflag & ARM_PATH_ACFRA) {
- pose_clear_paths(ob);
- pose_recalculate_paths(ob);
+ //pose_clear_paths(ob); // XXX for now, don't need to clear
+ ED_pose_recalculate_paths(C, scene, ob);
}
#endif
}
@@ -4734,7 +4762,7 @@ void special_aftertrans_update(TransInfo *t)
* - sync this with actdata_filter_gpencil() in editaction.c
*/
for (sa= sc->areabase.first; sa; sa= sa->next) {
- bGPdata *gpd= gpencil_data_getactive(sa);
+ bGPdata *gpd= gpencil_data_get_active(sa);
if (gpd)
posttrans_gpd_clean(gpd);
@@ -4898,7 +4926,7 @@ void special_aftertrans_update(TransInfo *t)
// allqueue(REDRAWBUTSEDIT, 0);
}
- else if(G.f & G_PARTICLEEDIT) {
+ else if(t->scene->basact && (ob = t->scene->basact->object) && ob->mode & OB_MODE_PARTICLE_EDIT) {
;
}
else {
@@ -4957,9 +4985,9 @@ static void createTransObject(bContext *C, TransInfo *t)
set_trans_object_base_flags(C, t);
/* count */
+#if 0 // TRANSFORM_FIX_ME
CTX_DATA_BEGIN(C, Object*, ob, selected_objects)
{
-#if 0 // TRANSFORM_FIX_ME
/* store ipo keys? */
if ((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) {
elems.first= elems.last= NULL;
@@ -4973,12 +5001,14 @@ static void createTransObject(bContext *C, TransInfo *t)
if(elems.first==NULL)
t->total++;
}
-#endif
// else {
t->total++;
// }
}
CTX_DATA_END;
+#else
+ t->total= CTX_DATA_COUNT(C, selected_objects);
+#endif
if(!t->total) {
/* clear here, main transform function escapes too */
@@ -5232,18 +5262,18 @@ void createTransData(bContext *C, TransInfo *t)
t->poseobj = ob; /* <- tsk tsk, this is going to give issues one day */
}
}
- else if (ob && (ob->flag & OB_POSEMODE)) {
+ else if (ob && (ob->mode & OB_MODE_POSE)) {
// XXX this is currently limited to active armature only...
// XXX active-layer checking isn't done as that should probably be checked through context instead
createTransPose(C, t, ob);
}
- else if (G.f & G_WEIGHTPAINT) {
+ else if (ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) {
/* exception, we look for the one selected armature */
CTX_DATA_BEGIN(C, Object*, ob_armature, selected_objects)
{
if(ob_armature->type==OB_ARMATURE)
{
- if(ob_armature->flag & OB_POSEMODE)
+ if(ob_armature->mode & OB_MODE_POSE)
{
createTransPose(C, t, ob_armature);
break;
@@ -5252,7 +5282,8 @@ void createTransData(bContext *C, TransInfo *t)
}
CTX_DATA_END;
}
- else if (G.f & G_PARTICLEEDIT && PE_can_edit(PE_get_current(scene, ob))) {
+ else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT)
+ && PE_start_edit(PE_get_current(scene, ob))) {
createTransParticleVerts(C, t);
if(t->data && t->flag & T_PROP_EDIT) {
@@ -5271,7 +5302,7 @@ void createTransData(bContext *C, TransInfo *t)
if (t->ar->regiontype == RGN_TYPE_WINDOW)
{
View3D *v3d = t->view;
- RegionView3D *rv3d = t->ar->regiondata;
+ RegionView3D *rv3d = CTX_wm_region_view3d(C);
if((t->flag & T_OBJECT) && v3d->camera == OBACT && rv3d->persp==V3D_CAMOB)
{
t->flag |= T_CAMERA;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 62b68589d98..0f715f1d35a 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -92,6 +92,7 @@
#include "ED_markers.h"
#include "ED_mesh.h"
#include "ED_retopo.h"
+#include "ED_screen_types.h"
#include "ED_space_api.h"
#include "ED_uvedit.h"
#include "ED_view3d.h"
@@ -268,23 +269,72 @@ static void editmesh_apply_to_mirror(TransInfo *t)
/* tags the given ID block for refreshes (if applicable) due to
* Animation Editor editing
*/
-static void animedit_refresh_id_tags (ID *id)
+static void animedit_refresh_id_tags (Scene *scene, ID *id)
{
- AnimData *adt= BKE_animdata_from_id(id);
-
- /* tag AnimData for refresh so that other views will update in realtime with these changes */
- if (adt)
- adt->recalc |= ADT_RECALC_ANIM;
+ if (id) {
+ AnimData *adt= BKE_animdata_from_id(id);
- /* if ID-block is Object, set recalc flags */
- // TODO: this should probably go through the depsgraph instead... but for now, let's be lazy
- switch (GS(id->name)) {
- case ID_OB:
- {
- Object *ob= (Object *)id;
- ob->recalc |= OB_RECALC;
+ /* tag AnimData for refresh so that other views will update in realtime with these changes */
+ if (adt)
+ adt->recalc |= ADT_RECALC_ANIM;
+
+ /* if ID-block is Object, set recalc flags */
+ switch (GS(id->name)) {
+ case ID_OB:
+ {
+ Object *ob= (Object *)id;
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */
+ }
+ break;
+ }
+ }
+}
+
+/* for the realtime animation recording feature, handle overlapping data */
+static void animrecord_check_state (Scene *scene, ID *id, wmTimer *animtimer)
+{
+ ScreenAnimData *sad= (animtimer) ? animtimer->customdata : NULL;
+
+ /* sanity checks */
+ if ELEM3(NULL, scene, id, sad)
+ return;
+
+ /* check if we need a new strip if:
+ * - if animtimer is running
+ * - we're not only keying for available channels
+ * - the option to add new actions for each round is not enabled
+ */
+ if (IS_AUTOKEY_FLAG(INSERTAVAIL)==0 && (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) {
+ /* if playback has just looped around, we need to add a new NLA track+strip to allow a clean pass to occur */
+ if ((sad) && (sad->flag & ANIMPLAY_FLAG_JUMPED)) {
+ AnimData *adt= BKE_animdata_from_id(id);
+
+ /* perform push-down manually with some differences
+ * NOTE: BKE_nla_action_pushdown() sync warning...
+ */
+ if ((adt->action) && !(adt->flag & ADT_NLA_EDIT_ON)) {
+ float astart, aend;
+
+ /* only push down if action is more than 1-2 frames long */
+ calc_action_range(adt->action, &astart, &aend, 1);
+ if (aend > astart+2.0f) {
+ NlaStrip *strip= add_nlastrip_to_stack(adt, adt->action);
+
+ /* clear reference to action now that we've pushed it onto the stack */
+ adt->action->id.us--;
+ adt->action= NULL;
+
+ /* adjust blending + extend so that they will behave correctly */
+ strip->extendmode= NLASTRIP_EXTEND_NOTHING;
+ strip->flag &= ~(NLASTRIP_FLAG_AUTO_BLENDS|NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_ACTIVE);
+
+ /* also, adjust the AnimData's action extend mode to be on
+ * 'nothing' so that previous result still play
+ */
+ adt->act_extendmode= NLASTRIP_EXTEND_NOTHING;
+ }
+ }
}
- break;
}
}
@@ -292,11 +342,11 @@ static void animedit_refresh_id_tags (ID *id)
void recalcData(TransInfo *t)
{
Scene *scene = t->scene;
- Base *base;
+ Base *base = scene->basact;
if (t->obedit) {
}
- else if(G.f & G_PARTICLEEDIT) {
+ else if(base && base->object->mode & OB_MODE_PARTICLE_EDIT) {
flushTransParticles(t);
}
if (t->spacetype==SPACE_NODE) {
@@ -306,7 +356,7 @@ void recalcData(TransInfo *t)
flushTransSeq(t);
}
else if (t->spacetype == SPACE_ACTION) {
- Scene *scene;
+ Scene *scene= t->scene;
bAnimContext ac;
ListBase anim_data = {NULL, NULL};
@@ -317,7 +367,7 @@ void recalcData(TransInfo *t)
/* NOTE: sync this with the code in ANIM_animdata_get_context() */
memset(&ac, 0, sizeof(bAnimContext));
- scene= ac.scene= t->scene;
+ ac.scene= t->scene;
ac.obact= OBACT;
ac.sa= t->sa;
ac.ar= t->ar;
@@ -333,7 +383,7 @@ void recalcData(TransInfo *t)
/* just tag these animdata-blocks to recalc, assuming that some data there changed */
for (ale= anim_data.first; ale; ale= ale->next) {
/* set refresh tags for objects using this animation */
- animedit_refresh_id_tags(ale->id);
+ animedit_refresh_id_tags(t->scene, ale->id);
}
/* now free temp channels */
@@ -381,7 +431,7 @@ void recalcData(TransInfo *t)
calchandles_fcurve(fcu);
/* set refresh tags for objects using this animation */
- animedit_refresh_id_tags(ale->id);
+ animedit_refresh_id_tags(t->scene, ale->id);
}
/* do resort and other updates? */
@@ -412,7 +462,7 @@ void recalcData(TransInfo *t)
continue;
/* set refresh tags for objects using this animation */
- animedit_refresh_id_tags(tdn->id);
+ animedit_refresh_id_tags(t->scene, tdn->id);
/* if cancelling transform, just write the values without validating, then move on */
if (t->state == TRANS_CANCEL) {
@@ -713,9 +763,10 @@ void recalcData(TransInfo *t)
* (i.e. uneditable animation values)
*/
// TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes?
- // TODO: maybe the ob->adt check isn't really needed? makes it too difficult to use...
- if (/*(ob->adt) && */(t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
- short targetless_ik= (t->flag & T_AUTOIK); // XXX this currently doesn't work, since flags aren't set yet!
+ if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
+ int targetless_ik= (t->flag & T_AUTOIK); // XXX this currently doesn't work, since flags aren't set yet!
+
+ animrecord_check_state(t->scene, &ob->id, t->animtimer);
autokeyframe_pose_cb_func(t->scene, (View3D *)t->view, ob, t->mode, targetless_ik);
}
@@ -743,8 +794,8 @@ void recalcData(TransInfo *t)
* (i.e. uneditable animation values)
*/
// TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes?
- // TODO: maybe the ob->adt check isn't really needed? makes it too difficult to use...
- if (/*(ob->adt) && */(t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
+ if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
+ animrecord_check_state(t->scene, &ob->id, t->animtimer);
autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode);
}
}
@@ -1272,7 +1323,7 @@ void calculateCenter(TransInfo *t)
/* voor panning from cameraview */
if(t->flag & T_OBJECT)
{
- if(t->spacetype==SPACE_VIEW3D)
+ if(t->spacetype==SPACE_VIEW3D && t->ar->regiontype == RGN_TYPE_WINDOW)
{
View3D *v3d = t->view;
Scene *scene = t->scene;
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 3366f8d72d7..e4ec43a8f38 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -62,6 +62,7 @@
#include "BKE_mesh.h"
#include "BKE_object.h"
#include "BKE_particle.h"
+#include "BKE_pointcache.h"
#include "BKE_utildefines.h"
#include "BLI_arithb.h"
@@ -338,7 +339,7 @@ int calc_manipulator_stats(const bContext *C)
Mat4MulVecfl(obedit->obmat, scene->twmax);
}
}
- else if(ob && (ob->flag & OB_POSEMODE)) {
+ else if(ob && (ob->mode & OB_MODE_POSE)) {
bPoseChannel *pchan;
int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed
@@ -358,22 +359,23 @@ int calc_manipulator_stats(const bContext *C)
Mat4MulVecfl(ob->obmat, scene->twmax);
}
}
- else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE)) {
+ else if(ob && (ob->mode & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
;
}
- else if(G.f & G_PARTICLEEDIT) {
- ParticleSystem *psys= PE_get_current(scene, ob);
- ParticleData *pa = psys->particles;
- ParticleEditKey *ek;
+ else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) {
+ PTCacheEdit *edit= PE_get_current(scene, ob);
+ PTCacheEditPoint *point;
+ PTCacheEditKey *ek;
int k;
- if(psys->edit) {
- for(a=0; a<psys->totpart; a++,pa++) {
- if(pa->flag & PARS_HIDE) continue;
+ if(edit) {
+ point = edit->points;
+ for(a=0; a<edit->totpoint; a++,point++) {
+ if(point->flag & PEP_HIDE) continue;
- for(k=0, ek=psys->edit->keys[a]; k<pa->totkey; k++, ek++) {
+ for(k=0, ek=point->keys; k<point->totkey; k++, ek++) {
if(ek->flag & PEK_SELECT) {
- calc_tw_center(scene, ek->world_co);
+ calc_tw_center(scene, ek->flag & PEK_USE_WCO ? ek->world_co : ek->co);
totsel++;
}
}
@@ -412,7 +414,7 @@ int calc_manipulator_stats(const bContext *C)
switch(v3d->twmode) {
case V3D_MANIP_NORMAL:
- if(obedit || ob->flag & OB_POSEMODE) {
+ if(obedit || ob->mode & OB_MODE_POSE) {
float mat[3][3];
int type;
@@ -1415,7 +1417,7 @@ void BIF_draw_manipulator(const bContext *C)
rv3d->twmat[3][2]= (scene->twmin[2] + scene->twmax[2])/2.0f;
if(v3d->around==V3D_ACTIVE && scene->obedit==NULL) {
Object *ob= OBACT;
- if(ob && !(ob->flag & OB_POSEMODE))
+ if(ob && !(ob->mode & OB_MODE_POSE))
VECCOPY(rv3d->twmat[3], ob->obmat[3]);
}
break;
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 081e9589fb8..08d22faf7e7 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -148,6 +148,7 @@ void TFM_OT_select_orientation(struct wmOperatorType *ot)
/* identifiers */
ot->name = "Select Orientation";
+ ot->description= "Select orientation type.";
ot->idname = "TFM_OT_select_orientation";
/* api callbacks */
@@ -308,6 +309,7 @@ void TFM_OT_translate(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Translate";
+ ot->description= "Translate selected items.";
ot->idname = OP_TRANSLATION;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -333,6 +335,7 @@ void TFM_OT_resize(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Resize";
+ ot->description= "Resize selected items.";
ot->idname = OP_RESIZE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -359,6 +362,7 @@ void TFM_OT_trackball(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Trackball";
+ ot->description= "Trackball style rotation of selected items.";
ot->idname = OP_TRACKBALL;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -380,6 +384,7 @@ void TFM_OT_rotate(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Rotate";
+ ot->description= "Rotate selected items.";
ot->idname = OP_ROTATION;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -405,6 +410,10 @@ void TFM_OT_tilt(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Tilt";
+ /*optionals -
+ "Tilt selected vertices."
+ "Specify an extra axis rotation for selected vertices of 3d curve." */
+ ot->description= "Tilt selected control vertices of 3d curve.";
ot->idname = OP_TILT;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -428,6 +437,7 @@ void TFM_OT_warp(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Warp";
+ ot->description= "Warp selected items around the cursor.";
ot->idname = OP_WARP;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -452,6 +462,7 @@ void TFM_OT_shear(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Shear";
+ ot->description= "Shear selected items along the horizontal screen axis.";
ot->idname = OP_SHEAR;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -476,6 +487,7 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Shrink/Fatten";
+ ot->description= "Shrink/fatten selected vertices along normals.";
ot->idname = OP_SHRINK_FATTEN;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -497,6 +509,8 @@ void TFM_OT_tosphere(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "To Sphere";
+ //added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()"
+ ot->description= "Move selected vertices outward in a spherical shape around mesh center.";
ot->idname = OP_TOSPHERE;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -548,6 +562,7 @@ void TFM_OT_transform(struct wmOperatorType *ot)
/* identifiers */
ot->name = "Transform";
+ ot->description= "Transform selected items by mode type.";
ot->idname = "TFM_OT_transform";
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 605eb6996a5..8f9d6108e37 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -87,7 +87,7 @@ void BIF_manageTransformOrientation(bContext *C, int confirm, int set) {
else if (obedit->type == OB_ARMATURE)
index = manageBoneSpace(C, confirm, set);
}
- else if (ob && (ob->flag & OB_POSEMODE)) {
+ else if (ob && (ob->mode & OB_MODE_POSE)) {
index = manageBoneSpace(C, confirm, set);
}
else {
@@ -487,7 +487,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
break;
case V3D_MANIP_NORMAL:
- if(obedit || ob->flag & OB_POSEMODE) {
+ if(obedit || ob->mode & OB_MODE_POSE) {
float mat[3][3];
int type;
@@ -864,7 +864,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
Mat3MulVecfl(mat, plane);
}
}
- else if(ob && (ob->flag & OB_POSEMODE))
+ else if(ob && (ob->mode & OB_MODE_POSE))
{
bArmature *arm= ob->data;
bPoseChannel *pchan;
@@ -894,10 +894,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
result = ORIENTATION_EDGE;
}
}
- else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE))
- {
- }
- else if(G.f & G_PARTICLEEDIT)
+ else if(ob && (ob->mode & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT|OB_MODE_PARTICLE_EDIT)))
{
}
else {
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 435f2c7ecf4..41159397634 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -75,14 +75,11 @@
/* ***************** generic undo system ********************* */
-/* ********* XXX **************** */
-static void sound_initialize_sounds() {}
-/* ********* XXX **************** */
-
void ED_undo_push(bContext *C, char *str)
{
wmWindowManager *wm= CTX_wm_manager(C);
Object *obedit= CTX_data_edit_object(C);
+ Object *obact= CTX_data_active_object(C);
if(obedit) {
if (U.undosteps == 0) return;
@@ -100,7 +97,7 @@ void ED_undo_push(bContext *C, char *str)
else if (obedit->type==OB_ARMATURE)
undo_push_armature(C, str);
}
- else if(G.f & G_PARTICLEEDIT) {
+ else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
if (U.undosteps == 0) return;
PE_undo_push(CTX_data_scene(C), str);
@@ -119,12 +116,13 @@ void ED_undo_push(bContext *C, char *str)
static int ed_undo_step(bContext *C, int step, const char *undoname)
{
Object *obedit= CTX_data_edit_object(C);
+ Object *obact= CTX_data_active_object(C);
ScrArea *sa= CTX_wm_area(C);
if(sa && sa->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
- if(G.f & G_TEXTUREPAINT || sima->flag & SI_DRAWTOOL) {
+ if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) || sima->flag & SI_DRAWTOOL) {
undo_imagepaint_step(step);
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -146,9 +144,9 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
else {
int do_glob_undo= 0;
- if(G.f & G_TEXTUREPAINT)
+ if(obact && obact->mode & OB_MODE_TEXTURE_PAINT)
undo_imagepaint_step(step);
- else if(G.f & G_PARTICLEEDIT) {
+ else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
if(step==1)
PE_undo(CTX_data_scene(C));
else
@@ -167,7 +165,6 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
BKE_undo_name(C, undoname);
else
BKE_undo_step(C, step);
- sound_initialize_sounds();
}
}
@@ -214,13 +211,14 @@ static int ed_redo_exec(bContext *C, wmOperator *op)
void ED_undo_menu(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
+ Object *obact= CTX_data_active_object(C);
if(obedit) {
//if ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)
// undo_editmode_menu();
}
else {
- if(G.f & G_PARTICLEEDIT)
+ if(obact && obact->mode & OB_MODE_PARTICLE_EDIT)
PE_undo_menu(CTX_data_scene(C), CTX_data_active_object(C));
else if(U.uiflag & USER_GLOBALUNDO) {
char *menu= BKE_undo_menu_string();
@@ -229,7 +227,6 @@ void ED_undo_menu(bContext *C)
MEM_freeN(menu);
if(event>0) {
BKE_undo_number(C, event);
- sound_initialize_sounds();
}
}
}
@@ -242,6 +239,7 @@ void ED_OT_undo(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Undo";
+ ot->description= "Undo previous action.";
ot->idname= "ED_OT_undo";
/* api callbacks */
@@ -253,6 +251,7 @@ void ED_OT_redo(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Redo";
+ ot->description= "Redo previous action.";
ot->idname= "ED_OT_redo";
/* api callbacks */
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 802f30506f8..00d0e3131e5 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -43,6 +43,7 @@ struct Object;
struct Scene;
struct View3D;
struct RegionView3D;
+struct SmokeModifierData;
/* OpenGL drawing functions related to shading. These are also
* shared with the game engine, where there were previously
@@ -78,7 +79,7 @@ int GPU_get_material_blend_mode(void);
* be drawn using one or the other
* - passing NULL clears the state again */
-int GPU_set_tpage(struct MTFace *tface);
+int GPU_set_tpage(struct MTFace *tface, int mipmap);
/* Lights
* - returns how many lights were enabled
@@ -105,13 +106,17 @@ void GPU_paint_set_mipmap(int mipmap);
/* Image updates and free
* - these deal with images bound as opengl textures */
-void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h);
+void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h, int mipmap);
void GPU_update_images_framechange(void);
int GPU_update_image_time(struct Image *ima, double time);
-int GPU_verify_image(struct Image *ima, int tftile, int tfmode, int compare);
+int GPU_verify_image(struct Image *ima, int tftile, int tfmode, int compare, int mipmap);
void GPU_free_image(struct Image *ima);
void GPU_free_images(void);
+/* smoke drawing functions */
+void GPU_free_smoke(struct SmokeModifierData *smd);
+void GPU_create_smoke(struct SmokeModifierData *smd);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 7218b6b1328..e00cab79ce0 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -73,9 +73,10 @@ int GPU_print_error(char *str);
GPUTexture *GPU_texture_create_1D(int w, float *pixels);
GPUTexture *GPU_texture_create_2D(int w, int h, float *pixels);
+GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels);
GPUTexture *GPU_texture_create_depth(int w, int h);
GPUTexture *GPU_texture_from_blender(struct Image *ima,
- struct ImageUser *iuser, double time);
+ struct ImageUser *iuser, double time, int mipmap);
void GPU_texture_free(GPUTexture *tex);
void GPU_texture_ref(GPUTexture *tex);
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 49c0dc166c1..f7318869fb3 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -124,7 +124,7 @@ void GPU_material_free(struct Material *ma);
void GPU_materials_free();
-void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time);
+void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time, int mipmap);
void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float viewmat[][4], float viewinv[][4], float obcol[4]);
void GPU_material_unbind(GPUMaterial *material);
int GPU_material_bound(GPUMaterial *material);
diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript
index 63f5fe53238..b45547e359c 100644
--- a/source/blender/gpu/SConscript
+++ b/source/blender/gpu/SConscript
@@ -8,4 +8,4 @@ incs += ' #/extern/glew/include #intern/guardedalloc ../imbuf .'
incs += ' ' + env['BF_OPENGL_INC']
-env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core', 'player'], priority=[160, 20] )
+env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core'], priority=[160] )
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 94c1910e3bc..c8a2d553685 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -824,7 +824,7 @@ void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
GPU_shader_unbind(shader);
}
-void GPU_pass_bind(GPUPass *pass, double time)
+void GPU_pass_bind(GPUPass *pass, double time, int mipmap)
{
GPUInput *input;
GPUShader *shader = pass->shader;
@@ -838,7 +838,7 @@ void GPU_pass_bind(GPUPass *pass, double time)
/* now bind the textures */
for (input=inputs->first; input; input=input->next) {
if (input->ima)
- input->tex = GPU_texture_from_blender(input->ima, input->iuser, time);
+ input->tex = GPU_texture_from_blender(input->ima, input->iuser, time, mipmap);
if(input->tex && input->bindtex) {
GPU_texture_bind(input->tex, input->texid);
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h
index 53b52f24f16..f5dd956d176 100644
--- a/source/blender/gpu/intern/gpu_codegen.h
+++ b/source/blender/gpu/intern/gpu_codegen.h
@@ -71,7 +71,7 @@ GPUPass *GPU_generate_pass(ListBase *nodes, struct GPUNodeLink *outlink,
struct GPUShader *GPU_pass_shader(GPUPass *pass);
-void GPU_pass_bind(GPUPass *pass, double time);
+void GPU_pass_bind(GPUPass *pass, double time, int mipmap);
void GPU_pass_update_uniforms(GPUPass *pass);
void GPU_pass_unbind(GPUPass *pass);
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index eb834abc670..a81c7e03455 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -38,9 +38,11 @@
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "DNA_smoke_types.h"
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
@@ -194,8 +196,11 @@ static int smaller_pow2(int num)
static int is_pow2_limit(int num)
{
/* take texture clamping into account */
- if (G.f & G_TEXTUREPAINT)
- return 1;
+
+ /* XXX: texturepaint not global!
+ if (G.f & G_TEXTUREPAINT)
+ return 1;*/
+
if (U.glreslimit != 0 && num > U.glreslimit)
return 0;
@@ -204,8 +209,9 @@ static int is_pow2_limit(int num)
static int smaller_pow2_limit(int num)
{
- if (G.f & G_TEXTUREPAINT)
- return 1;
+ /* XXX: texturepaint not global!
+ if (G.f & G_TEXTUREPAINT)
+ return 1;*/
/* take texture clamping into account */
if (U.glreslimit != 0 && num > U.glreslimit)
@@ -249,7 +255,7 @@ void GPU_set_linear_mipmap(int linear)
static int gpu_get_mipmap(void)
{
- return GTS.domipmap && (!(G.f & G_TEXTUREPAINT));
+ return GTS.domipmap;
}
static GLenum gpu_get_mipmap_filter(int mag)
@@ -382,7 +388,7 @@ static void gpu_verify_reflection(Image *ima)
}
}
-int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare)
+int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare, int mipmap)
{
ImBuf *ibuf = NULL;
unsigned int *bind = NULL;
@@ -507,7 +513,7 @@ int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare)
}
/* scale if not a power of two */
- if (!is_pow2_limit(rectw) || !is_pow2_limit(recth)) {
+ if (!mipmap && (!is_pow2_limit(rectw) || !is_pow2_limit(recth))) {
rectw= smaller_pow2_limit(rectw);
recth= smaller_pow2_limit(recth);
@@ -520,7 +526,7 @@ int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare)
glGenTextures(1, (GLuint *)bind);
glBindTexture( GL_TEXTURE_2D, *bind);
- if (!gpu_get_mipmap()) {
+ if (!(gpu_get_mipmap() && mipmap)) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
@@ -559,7 +565,7 @@ static void gpu_verify_repeat(Image *ima)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
}
-int GPU_set_tpage(MTFace *tface)
+int GPU_set_tpage(MTFace *tface, int mipmap)
{
Image *ima;
@@ -575,7 +581,7 @@ int GPU_set_tpage(MTFace *tface)
gpu_verify_alpha_mode(tface);
gpu_verify_reflection(ima);
- if(GPU_verify_image(ima, tface->tile, tface->mode, 1)) {
+ if(GPU_verify_image(ima, tface->tile, tface->mode, 1, mipmap)) {
GTS.curtile= GTS.tile;
GTS.curima= GTS.ima;
GTS.curtilemode= GTS.tilemode;
@@ -640,13 +646,13 @@ void GPU_paint_set_mipmap(int mipmap)
}
}
-void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
+void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap)
{
ImBuf *ibuf;
ibuf = BKE_image_get_ibuf(ima, NULL);
- if (ima->repbind || gpu_get_mipmap() || !ima->bindcode || !ibuf ||
+ if (ima->repbind || (gpu_get_mipmap() && mipmap) || !ima->bindcode || !ibuf ||
(!is_pow2(ibuf->x) || !is_pow2(ibuf->y)) ||
(w == 0) || (h == 0)) {
/* these cases require full reload still */
@@ -740,6 +746,23 @@ int GPU_update_image_time(Image *ima, double time)
return inc;
}
+
+void GPU_free_smoke(SmokeModifierData *smd)
+{
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain)
+ {
+ if(smd->domain->tex)
+ GPU_texture_free(smd->domain->tex);
+ smd->domain->tex = NULL;
+ }
+}
+
+void GPU_create_smoke(SmokeModifierData *smd)
+{
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex)
+ smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->view3d);
+}
+
void GPU_free_image(Image *ima)
{
/* free regular image binding */
@@ -988,7 +1011,7 @@ int GPU_enable_material(int nr, void *attribs)
gpumat = GPU_material_from_blender(GMS.gscene, mat);
GPU_material_vertex_attributes(gpumat, gattribs);
- GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0);
+ GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT));
GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col);
GMS.gboundmat= mat;
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 4984e043031..850b46dc28c 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -312,7 +312,70 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
return tex;
}
-GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time)
+
+GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels)
+{
+ GPUTexture *tex;
+ GLenum type, format, internalformat;
+ void *pixels = NULL;
+ float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+
+ tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
+ tex->w = w;
+ tex->h = h;
+ tex->depth = depth;
+ tex->number = -1;
+ tex->refcount = 1;
+ tex->target = GL_TEXTURE_3D;
+
+ glGenTextures(1, &tex->bindcode);
+
+ if (!tex->bindcode) {
+ fprintf(stderr, "GPUTexture: texture create failed: %d\n",
+ (int)glGetError());
+ GPU_texture_free(tex);
+ return NULL;
+ }
+
+ if (!GLEW_ARB_texture_non_power_of_two) {
+ tex->w = larger_pow2(tex->w);
+ tex->h = larger_pow2(tex->h);
+ tex->depth = larger_pow2(tex->depth);
+ }
+
+ tex->number = 0;
+ glBindTexture(tex->target, tex->bindcode);
+
+ type = GL_UNSIGNED_BYTE;
+ format = GL_RGBA;
+ internalformat = GL_RGBA8;
+
+ if (fpixels)
+ pixels = GPU_texture_convert_pixels(w*h*depth, fpixels);
+
+ glTexImage3D(tex->target, 0, internalformat, tex->w, tex->h, tex->depth, 0, format, type, 0);
+
+ if (fpixels) {
+ glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, pixels);
+ }
+
+ glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, vfBorderColor);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
+ glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_BORDER);
+
+ if (pixels)
+ MEM_freeN(pixels);
+
+ if (tex)
+ GPU_texture_unbind(tex);
+
+ return tex;
+}
+
+GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time, int mipmap)
{
GPUTexture *tex;
GLint w, h, border, lastbindcode, bindcode;
@@ -320,7 +383,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time)
glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode);
GPU_update_image_time(ima, time);
- bindcode = GPU_verify_image(ima, 0, 0, 0);
+ bindcode = GPU_verify_image(ima, 0, 0, 0, mipmap);
if(ima->gputexture) {
ima->gputexture->bindcode = bindcode;
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 7e8b5c18d71..c0fb069fc41 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -246,7 +246,7 @@ void GPU_material_free(Material *ma)
BLI_freelistN(&ma->gpumaterial);
}
-void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time)
+void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time, int mipmap)
{
if(material->pass) {
LinkData *nlink;
@@ -266,7 +266,7 @@ void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double tim
}
}
- GPU_pass_bind(material->pass, time);
+ GPU_pass_bind(material->pass, time, mipmap);
material->bound = 1;
}
}
@@ -500,7 +500,7 @@ static void ramp_diffuse_result(GPUShadeInput *shi, GPUNodeLink **diff)
GPUMaterial *mat= shi->gpumat;
GPUNodeLink *fac;
- if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS)) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS)) {
if(ma->ramp_col) {
if(ma->rampin_col==MA_RAMP_IN_RESULT) {
GPU_link(mat, "ramp_rgbtobw", *diff, &fac);
@@ -516,7 +516,7 @@ static void add_to_diffuse(GPUMaterial *mat, Material *ma, GPUShadeInput *shi, G
{
GPUNodeLink *fac, *tmp, *addcol;
- if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS) &&
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) &&
ma->ramp_col && (ma->mode & MA_RAMP_COL)) {
/* MA_RAMP_IN_RESULT is exceptional */
if(ma->rampin_col==MA_RAMP_IN_RESULT) {
@@ -556,7 +556,7 @@ static void ramp_spec_result(GPUShadeInput *shi, GPUNodeLink **spec)
GPUMaterial *mat= shi->gpumat;
GPUNodeLink *fac;
- if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS) &&
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) &&
ma->ramp_spec && ma->rampin_spec==MA_RAMP_IN_RESULT) {
GPU_link(mat, "ramp_rgbtobw", *spec, &fac);
@@ -644,7 +644,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
is= inp; /* Lambert */
- if(!(G.fileflags & G_FILE_GLSL_NO_SHADERS)) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS)) {
if(ma->diff_shader==MA_DIFF_ORENNAYAR)
GPU_link(mat, "shade_diffuse_oren_nayer", inp, vn, lv, view, GPU_uniform(&ma->roughness), &is);
else if(ma->diff_shader==MA_DIFF_TOON)
@@ -656,7 +656,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
}
}
- if(!(G.fileflags & G_FILE_GLSL_NO_SHADERS))
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS))
if(ma->shade_flag & MA_CUBIC)
GPU_link(mat, "shade_cubic", is, &is);
@@ -671,7 +671,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
// done in shade_visifac now, GPU_link(mat, "mtex_value_clamp_positive", i, &i);
if((ma->mode & MA_SHADOW) && GPU_lamp_has_shadow_buffer(lamp)) {
- if(!(G.fileflags & G_FILE_GLSL_NO_SHADOWS)) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS)) {
mat->dynproperty |= DYN_LAMP_PERSMAT;
GPU_link(mat, "test_shadowbuf",
@@ -700,7 +700,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
GPU_link(mat, "math_multiply", i, shadfac, &i);
}
}
- else if((G.fileflags & G_FILE_GLSL_NO_SHADOWS) && (lamp->mode & LA_ONLYSHADOW)) {
+ else if((mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS) && (lamp->mode & LA_ONLYSHADOW)) {
add_user_list(&mat->lamps, lamp);
add_user_list(&lamp->materials, shi->gpumat->ma);
return;
@@ -716,7 +716,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
}
}
- if(G.fileflags & G_FILE_GLSL_NO_SHADERS);
+ if(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS);
else if(!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) &&
(GPU_link_changed(shi->spec) || ma->spec != 0.0f)) {
if(lamp->type == LA_HEMI) {
@@ -1015,11 +1015,11 @@ static void do_material_tex(GPUShadeInput *shi)
if(mtex->mapto & MAP_COL)
texture_rgb_blend(mat, tcol, shi->rgb, tin, colfac, mtex->blendtype, &shi->rgb);
- if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_COLSPEC))
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_COLSPEC))
texture_rgb_blend(mat, tcol, shi->specrgb, tin, colfac, mtex->blendtype, &shi->specrgb);
}
- if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) {
if(mtex->maptoneg & MAP_NORM) tex->norfac= -mtex->norfac;
else tex->norfac= mtex->norfac;
@@ -1065,22 +1065,22 @@ static void do_material_tex(GPUShadeInput *shi)
GPU_link(mat, "mtex_rgbtoint", trgb, &tin);
}
- if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_REF) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_REF) {
int flip= mtex->maptoneg & MAP_REF;
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->refl, tin, varfac, mtex->blendtype, flip, &shi->refl);
GPU_link(mat, "mtex_value_clamp_positive", shi->refl, &shi->refl);
}
- if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_SPEC) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_SPEC) {
int flip= mtex->maptoneg & MAP_SPEC;
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->spec, tin, varfac, mtex->blendtype, flip, &shi->spec);
GPU_link(mat, "mtex_value_clamp_positive", shi->spec, &shi->spec);
}
- if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_EMIT) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_EMIT) {
int flip= mtex->maptoneg & MAP_EMIT;
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->emit, tin, varfac, mtex->blendtype, flip, &shi->emit);
GPU_link(mat, "mtex_value_clamp_positive", shi->emit, &shi->emit);
}
- if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_HAR) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_HAR) {
int flip= mtex->maptoneg & MAP_HAR;
GPU_link(mat, "mtex_har_divide", shi->har, &shi->har);
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->har, tin, varfac, mtex->blendtype, flip, &shi->har);
@@ -1091,7 +1091,7 @@ static void do_material_tex(GPUShadeInput *shi)
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->alpha, tin, varfac, mtex->blendtype, flip, &shi->alpha);
GPU_link(mat, "mtex_value_clamp", shi->alpha, &shi->alpha);
}
- if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_AMB) {
+ if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_AMB) {
int flip= mtex->maptoneg & MAP_AMB;
texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->amb, tin, varfac, mtex->blendtype, flip, &shi->amb);
GPU_link(mat, "mtex_value_clamp", shi->amb, &shi->amb);
@@ -1139,10 +1139,10 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
do_material_tex(shi);
- if(ma->mode & MA_ZTRA)
+ if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
GPU_material_enable_alpha(mat);
- if((G.fileflags & G_FILE_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) {
+ if((mat->scene->gm.flag & GAME_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) {
shr->combined = shi->rgb;
shr->alpha = shi->alpha;
GPU_link(mat, "set_rgb", shi->rgb, &shr->diff);
@@ -1213,7 +1213,7 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
GPU_uniform(&world->horr), &shr->combined);
}
- if(!(ma->mode & MA_ZTRA)) {
+ if(!((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))) {
if(world && (GPU_link_changed(shr->alpha) || ma->alpha != 1.0f))
GPU_link(mat, "shade_world_mix", GPU_uniform(&world->horr),
shr->combined, &shr->combined);
@@ -1251,7 +1251,7 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
mat = GPU_material_construct_begin(ma);
mat->scene = scene;
- if(!(G.fileflags & G_FILE_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) {
+ if(!(scene->gm.flag & GAME_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) {
ntreeGPUMaterialNodes(ma->nodetree, mat);
}
else {
@@ -1458,8 +1458,8 @@ void GPU_lamp_free(Object *ob)
int GPU_lamp_has_shadow_buffer(GPULamp *lamp)
{
- return (!(G.fileflags & G_FILE_GLSL_NO_SHADOWS) &&
- !(G.fileflags & G_FILE_GLSL_NO_LIGHTS) &&
+ return (!(lamp->scene->gm.flag & GAME_GLSL_NO_SHADOWS) &&
+ !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) &&
lamp->tex && lamp->fb);
}
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index 391f6e9e1a2..76dd2afebdc 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -28,7 +28,7 @@ FILE(GLOB SRC intern/*.c)
SET(INC
. ../makesdna ../../../intern/guardedalloc ../../../intern/memutil ../blenlib
- ../avi ../quicktime ../blenkernel
+ ../avi ../blenkernel
${JPEG_INC}
${PNG_INC}
${TIFF_INC}
@@ -45,7 +45,7 @@ IF(WITH_OPENJPEG)
ENDIF(WITH_OPENJPEG)
IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
+ SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
diff --git a/source/blender/imbuf/intern/cineon/SConscript b/source/blender/imbuf/intern/cineon/SConscript
index ef9c44b85c8..371e4cff9eb 100644
--- a/source/blender/imbuf/intern/cineon/SConscript
+++ b/source/blender/imbuf/intern/cineon/SConscript
@@ -14,4 +14,4 @@ incs = ['.',
defs = []
-env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [220, 75])
+env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core'], priority = [220])
diff --git a/source/blender/imbuf/intern/dds/SConscript b/source/blender/imbuf/intern/dds/SConscript
index cec6023648b..6cabc3f7d79 100644
--- a/source/blender/imbuf/intern/dds/SConscript
+++ b/source/blender/imbuf/intern/dds/SConscript
@@ -16,4 +16,4 @@ incs = ['.',
defs = ['WITH_DDS']
-env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [230, 105])
+env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core'], priority = [230])
diff --git a/source/blender/imbuf/intern/openexr/Makefile b/source/blender/imbuf/intern/openexr/Makefile
index f77e3723e8a..083089b11d5 100644
--- a/source/blender/imbuf/intern/openexr/Makefile
+++ b/source/blender/imbuf/intern/openexr/Makefile
@@ -35,6 +35,9 @@ include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
+# If compiling the API, WITH_OPENEXR must be set.
+CPPFLAGS += -DWITH_OPENEXR
+
CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I../../../blenlib
diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript
index aa166a1983c..729619c963b 100644
--- a/source/blender/imbuf/intern/openexr/SConscript
+++ b/source/blender/imbuf/intern/openexr/SConscript
@@ -13,6 +13,6 @@ incs = ['.',
'../../../makesdna']
incs += Split(env['BF_OPENEXR_INC'])
-defs = []
+defs = ['WITH_OPENEXR']
-env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [225, 85])
+env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core'], priority = [225])
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 32d97d79bd7..a780727b1a2 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -51,7 +51,6 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void)
#include "IMB_imbuf.h"
#include "IMB_allocimbuf.h"
-#define WITH_OPENEXR
#include "openexr_multi.h"
}
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index 4e6326a1fd6..c89bc6a632f 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -289,7 +289,10 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags)
fildes = fopen(name,"wb");
if (!fildes) return 0;
- if (fwrite(buf, 1, 18,fildes) != 18) return (0);
+ if (fwrite(buf, 1, 18,fildes) != 18) {
+ fclose(fildes);
+ return (0);
+ }
if (ibuf->cmap){
for (i = 0 ; i<ibuf->maxcol ; i++){
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 0c6c04273e3..474d5a4217f 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -41,6 +41,54 @@ struct SpaceLink;
struct Object;
/* ************************************************ */
+/* Visualisation */
+
+/* Motion Paths ------------------------------------ */
+/* (used for Pose Channels and Objects) */
+
+/* Data point for motion path */
+typedef struct bMotionPathVert {
+ float co[3]; /* coordinates of point in 3D-space */
+ int flag; /* quick settings */
+} bMotionPathVert;
+
+/* Motion Path data cache - for elements providing transforms (i.e. Objects or PoseChannels) */
+typedef struct bMotionPath {
+ bMotionPathVert *points; /* path samples */
+ int length; /* the number of cached verts */
+
+ int start_frame; /* for drawing paths, the start frame number */
+ int end_frame; /* for drawing paths, the end frame number */
+
+ int flag; /* extra settings */
+} bMotionPath;
+
+
+
+/* Animation Visualisation Settings - for Objects or Armatures (not PoseChannels) */
+typedef struct bAnimVizSettings {
+ int pad;
+ int pathflag; /* eMotionPath_Settings */
+
+ int pathsf, pathef; /* start and end frames of path-calculation range */
+ int pathbc, pathac; /* number of frames before/after current frame of path-calculation */
+} bAnimVizSettings;
+
+/* bMotionPathSettings->flag */
+typedef enum eMotionPath_Settings {
+ /* show frames on path */
+ MOTIONPATH_FLAG_FNUMS = (1<<0),
+ /* show keyframes on path */
+ MOTIONPATH_FLAG_KFRAS = (1<<1),
+ /* for bones - calculate head-points for curves instead of tips */
+ MOTIONPATH_FLAG_HEADS = (1<<2),
+ /* show path around current frame */
+ MOTIONPATH_FLAG_ACFRA = (1<<3),
+ /* show keyframe/frame numbers */
+ MOTIONPATH_FLAG_KFNOS = (1<<4)
+} eMotionPath_Settings;
+
+/* ************************************************ */
/* Poses */
/* PoseChannel ------------------------------------ */
@@ -151,8 +199,13 @@ typedef enum ePchan_IkFlag {
typedef enum ePchan_RotMode {
/* quaternion rotations (default, and for older Blender versions) */
PCHAN_ROT_QUAT = 0,
- /* euler rotations (xyz only) */
- PCHAN_ROT_EUL,
+ /* euler rotations - keep in sync with enum in BLI_arithb.h */
+ PCHAN_ROT_XYZ = 1, /* Blender 'default' (classic) - must be as 1 to sync with PoseChannel rotmode */
+ PCHAN_ROT_XZY,
+ PCHAN_ROT_YXZ,
+ PCHAN_ROT_YZX,
+ PCHAN_ROT_ZXY,
+ PCHAN_ROT_ZYX,
} ePchan_RotMode;
/* Pose ------------------------------------ */
@@ -313,6 +366,7 @@ typedef enum DOPESHEET_FILTERFLAG {
ADS_FILTER_NOWOR = (1<<14),
ADS_FILTER_NOSCE = (1<<15),
ADS_FILTER_NOPART = (1<<16),
+ ADS_FILTER_NOMBA = (1<<17),
/* NLA-specific filters */
ADS_FILTER_NLA_NOACT = (1<<20), /* if the AnimData block has no NLA data, don't include to just show Action-line */
@@ -437,5 +491,3 @@ typedef enum ACHAN_FLAG {
#endif
-
-
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index f713b4a8acc..278da27faf9 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -37,6 +37,9 @@ struct Scene;
struct Group;
struct Text;
+// for Sound3D
+#include "DNA_sound_types.h"
+
/* ****************** ACTUATORS ********************* */
/* unused now, moved to editobjectactuator in 2.02. Still needed for dna */
@@ -62,18 +65,13 @@ typedef struct bSoundActuator {
short flag, sndnr;
int sta, end;
short pad1[2];
+ float volume, pitch;
struct bSound *sound;
+ struct Sound3D sound3D;
short type, makecopy;
short copymade, pad2[1];
} bSoundActuator;
-typedef struct bCDActuator {
- short flag, sndnr;
- int sta, end;
- short type, track;
- float volume;
-} bCDActuator;
-
typedef struct bEditObjectActuator {
int time;
short type, flag;
@@ -291,7 +289,6 @@ typedef struct FreeCamera {
#define ACT_RANDOM 13
#define ACT_MESSAGE 14
#define ACT_ACTION 15 /* __ NLA */
-#define ACT_CD 16
#define ACT_GAME 17
#define ACT_VISIBILITY 18
#define ACT_2DFILTER 19
@@ -405,6 +402,10 @@ typedef struct FreeCamera {
/* editObjectActuator->flag */
#define ACT_TRACK_3D 1
+/* editObjectActuator->flag for replace mesh actuator */
+#define ACT_EDOB_REPLACE_MESH_NOGFX 2 /* use for replace mesh actuator */
+#define ACT_EDOB_REPLACE_MESH_PHYS 4
+
/* SceneActuator->type */
#define ACT_SCENE_RESTART 0
#define ACT_SCENE_SET 1
@@ -428,6 +429,9 @@ typedef struct FreeCamera {
#define ACT_RANDOM_FLOAT_NORMAL 8
#define ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL 9
+/* SoundActuator->flag */
+#define ACT_SND_3D_SOUND 1
+
/* SoundActuator->type */
#define ACT_SND_PLAY_STOP_SOUND 0
#define ACT_SND_PLAY_END_SOUND 1
@@ -440,15 +444,6 @@ typedef struct FreeCamera {
#define ACT_MESG_MESG 0
#define ACT_MESG_PROP 1
-/* cdactuator->type */
-#define ACT_CD_PLAY_ALL 0
-#define ACT_CD_PLAY_TRACK 1
-#define ACT_CD_LOOP_TRACK 2
-#define ACT_CD_VOLUME 3
-#define ACT_CD_STOP 4
-#define ACT_CD_PAUSE 5
-#define ACT_CD_RESUME 6
-
/* gameactuator->type */
#define ACT_GAME_LOAD 0
#define ACT_GAME_START 1
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 35381e4612a..f75ed273164 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -631,6 +631,8 @@ typedef enum eKSP_TemplateTypes {
KSP_TEMPLATE_PCHAN = (1<<1), /* #pch - selected posechannel */
KSP_TEMPLATE_CONSTRAINT = (1<<2), /* #con - active only */
KSP_TEMPLATE_NODE = (1<<3), /* #nod - selected node */
+
+ KSP_TEMPLATE_PCHAN_ROT = (1<<16), /* modify rotation paths based on rotation mode of Pose Channel */
} eKSP_TemplateTypes;
/* ---------------- */
@@ -734,8 +736,13 @@ typedef struct AnimData {
ListBase overrides; /* temp storage (AnimOverride) of values for settings that are animated (but the value hasn't been keyframed) */
/* settings for animation evaluation */
- int flag; /* user-defined settings */
- int recalc; /* depsgraph recalculation flags */
+ int flag; /* user-defined settings */
+ int recalc; /* depsgraph recalculation flags */
+
+ /* settings for active action evaluation (based on NLA strip settings) */
+ short act_blendmode; /* accumulation mode for active action */
+ short act_extendmode; /* extrapolation mode for active action */
+ float act_influence; /* influence for active action */
} AnimData;
/* Animation Data settings (mostly for NLA) */
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index f88d3b68ebf..a3a1a342584 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -58,18 +58,17 @@ typedef struct Brush {
int size; /* brush diameter */
float innerradius; /* inner radius after which the falloff starts */
float spacing; /* spacing of paint operations */
+ int smooth_stroke_radius; /* turning radius (in pixels) for smooth stroke */
+ float smooth_stroke_factor; /* higher values limit fast changes in the stroke direction */
float rate; /* paint operations / second (airbrush) */
float rgb[3]; /* color */
float alpha; /* opacity */
- float rot; /* rotation in radians */
-
short texact; /* active texture */
char sculpt_tool; /* active tool */
- char tex_mode;
- char pad[4];
+ char pad[1];
} Brush;
/* Brush.flag */
@@ -85,21 +84,7 @@ typedef struct Brush {
#define BRUSH_DIR_IN 512
#define BRUSH_SPACE 1024
#define BRUSH_SMOOTH_STROKE 2048
-
-/* Brush.blend */
-#define BRUSH_BLEND_MIX 0
-#define BRUSH_BLEND_ADD 1
-#define BRUSH_BLEND_SUB 2
-#define BRUSH_BLEND_MUL 3
-#define BRUSH_BLEND_LIGHTEN 4
-#define BRUSH_BLEND_DARKEN 5
-#define BRUSH_BLEND_ERASE_ALPHA 6
-#define BRUSH_BLEND_ADD_ALPHA 7
-
-/* Brush.tex_mode */
-#define BRUSH_TEX_DRAG 0
-#define BRUSH_TEX_TILE 1
-#define BRUSH_TEX_3D 2
+#define BRUSH_PERSISTENT 4096
/* Brush.sculpt_tool */
#define SCULPT_TOOL_DRAW 1
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 79f032d0d21..6fab633b192 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -85,7 +85,7 @@ typedef struct bConstraintTarget {
short space; /* space that target should be evaluated in (overrides bConstraint->tarspace) */
short flag; /* runtime settings (for editor, etc.) */
short type; /* type of target (B_CONSTRAINT_OB_TYPE) */
- short pad;
+ short rotOrder; /* rotation order for target (as defined in BLI_arithb.h) */
} bConstraintTarget;
/* bConstraintTarget -> flag */
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index b0f089d670f..3bac2c73bcb 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -75,25 +75,28 @@ typedef struct BevPoint {
short f1, f2;
} BevPoint;
-/* Keyframes on IPO curves and Points on Bezier Curves/Paths are generally BezTriples */
+/* Keyframes on F-Curves (allows code reuse of Bezier eval code) and
+ * Points on Bezier Curves/Paths are generally BezTriples
+ */
/* note: alfa location in struct is abused by Key system */
/* vec in BezTriple looks like this:
vec[0][0]=x location of handle 1
vec[0][1]=y location of handle 1
- vec[0][2]=z location of handle 1 (not used for IpoCurve Points(2d))
+ vec[0][2]=z location of handle 1 (not used for FCurve Points(2d))
vec[1][0]=x location of control point
vec[1][1]=y location of control point
vec[1][2]=z location of control point
vec[2][0]=x location of handle 2
vec[2][1]=y location of handle 2
- vec[2][2]=z location of handle 2 (not used for IpoCurve Points(2d))
+ vec[2][2]=z location of handle 2 (not used for FCurve Points(2d))
*/
typedef struct BezTriple {
float vec[3][3];
float alfa, weight, radius; /* alfa: tilt in 3D View, weight: used for softbody goal weight, radius: for bevel tapering */
short ipo; /* ipo: interpolation mode for segment from this BezTriple to the next */
char h1, h2; /* h1, h2: the handle type of the two handles */
- char f1, f2, f3, hide; /* f1, f2, f3: used for selection status, hide: used to indicate whether BezTriple is hidden */
+ char f1, f2, f3; /* f1, f2, f3: used for selection status */
+ char hide; /* hide: used to indicate whether BezTriple is hidden (3D), type of keyframe (eBezTriple_KeyframeTypes) */
} BezTriple;
/* note; alfa location in struct is abused by Key system */
@@ -279,6 +282,12 @@ typedef enum eBezTriple_Interpolation {
BEZT_IPO_BEZ, /* bezier interpolation */
} eBezTriple_Interpolation;
+/* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */
+typedef enum eBezTriple_KeyframeType {
+ BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */
+ BEZT_KEYTYPE_BREAKDOWN, /* 'breakdown' keyframe */
+} eBezTriple_KeyframeType;
+
/* *************** CHARINFO **************** */
/* flag */
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index ed209a127c7..4bae9935ea7 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -33,7 +33,7 @@
/* Grease-Pencil Annotations - 'Stroke Point'
* -> Coordinates may either be 2d or 3d depending on settings at the time
* -> Coordinates of point on stroke, in proportions of window size
- * (i.e. n/1000). This assumes that the bottom-left corner is (0,0)
+ * This assumes that the bottom-left corner is (0,0)
*/
typedef struct bGPDspoint {
float x, y, z; /* co-ordinates of point (usually 2d, but can be 3d as well) */
@@ -135,12 +135,14 @@ typedef struct bGPdata {
/* bGPdata->flag */
// XXX many of these flags should be depreceated for more general ideas in 2.5
/* don't allow painting to occur at all */
+ // XXX is depreceated - not well understood
#define GP_DATA_LMBPLOCK (1<<0)
/* show debugging info in viewport (i.e. status print) */
#define GP_DATA_DISPINFO (1<<1)
/* in Action Editor, show as expanded channel */
#define GP_DATA_EXPAND (1<<2)
/* is the block overriding all clicks? */
+ // XXX is depreceated - nasty old concept
#define GP_DATA_EDITPAINT (1<<3)
/* new strokes are added in viewport space */
#define GP_DATA_VIEWALIGN (1<<4)
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 5b566a244b4..f268c117065 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -47,6 +47,34 @@ struct Ipo;
/* WATCH IT: change type? also make changes in ipo.h */
+typedef struct VolumeSettings {
+ float density;
+ float emission;
+ float absorption;
+ float scattering;
+
+ float emission_col[3];
+ float absorption_col[3];
+ float density_scale;
+ float depth_cutoff;
+
+ short phasefunc_type;
+ short vpad[3];
+ float phasefunc_g;
+
+ float stepsize;
+ float shade_stepsize;
+
+ short stepsize_type;
+ short shadeflag;
+ short shade_type;
+ short precache_resolution;
+
+ float ms_diff;
+ float ms_intensity;
+ int ms_steps;
+} VolumeSettings;
+
typedef struct Material {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
@@ -62,6 +90,8 @@ typedef struct Material {
float translucency;
/* end synced with render_types.h */
+ struct VolumeSettings vol;
+
float fresnel_mir, fresnel_mir_i;
float fresnel_tra, fresnel_tra_i;
float filter; /* filter added, for raytrace transparency and transmissivity */
@@ -164,7 +194,7 @@ typedef struct Material {
#define MA_VERTEXCOL 16
#define MA_HALO_SOFT 16
#define MA_HALO 32 /* deprecated */
-#define MA_ZTRA 64
+#define MA_ZTRANSP 64
#define MA_VERTEXCOLP 128
#define MA_ZINV 256
#define MA_HALO_RINGS 256
@@ -180,7 +210,7 @@ typedef struct Material {
#define MA_NOMIST 0x4000
#define MA_HALO_SHADE 0x4000
#define MA_HALO_FLARE 0x8000
-#define MA_RADIO 0x10000
+#define MA_TRANSP 0x10000
#define MA_RAYTRANSP 0x20000
#define MA_RAYMIRROR 0x40000
#define MA_SHADOW_TRA 0x80000
@@ -224,7 +254,7 @@ typedef struct Material {
#define MA_SPEC_WARDISO 4
/* dynamode */
-#define MA_DRAW_DYNABUTS 1
+#define MA_DRAW_DYNABUTS 1 /* deprecated */
#define MA_FH_NOR 2
/* ramps */
@@ -287,6 +317,14 @@ typedef struct Material {
#define MAP_WARP 8192
#define MAP_LAYER 16384
+/* volume mapto - reuse definitions for now - a bit naughty! */
+#define MAP_DENSITY 128
+#define MAP_EMISSION 64
+#define MAP_EMISSION_COL 1
+#define MAP_ABSORPTION 512
+#define MAP_ABSORPTION_COL 8
+#define MAP_SCATTERING 16
+
/* mapto for halo */
//#define MAP_HA_COL 1
//#define MAP_HA_ALPHA 128
@@ -330,5 +368,29 @@ typedef struct Material {
/* sss_flag */
#define MA_DIFF_SSS 1
+/* vol_stepsize_type */
+#define MA_VOL_STEP_RANDOMIZED 0
+#define MA_VOL_STEP_CONSTANT 1
+#define MA_VOL_STEP_ADAPTIVE 2
+
+/* vol_shadeflag */
+#define MA_VOL_SHADED 1
+#define MA_VOL_RECVSHADOW 4
+#define MA_VOL_PRECACHESHADING 8
+
+/* vol_shading_type */
+#define MA_VOL_SHADE_NONE 0
+#define MA_VOL_SHADE_SINGLE 1
+#define MA_VOL_SHADE_MULTIPLE 2
+#define MA_VOL_SHADE_SINGLEPLUSMULTIPLE 3
+
+/* vol_phasefunc_type */
+#define MA_VOL_PH_ISOTROPIC 0
+#define MA_VOL_PH_MIEHAZY 1
+#define MA_VOL_PH_MIEMURKY 2
+#define MA_VOL_PH_RAYLEIGH 3
+#define MA_VOL_PH_HG 4
+#define MA_VOL_PH_SCHLICK 5
+
#endif
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 3ecfe416c79..f7f1d3b53bd 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -139,7 +139,7 @@ typedef struct TFace {
#define ME_DRAWCREASES (1 << 6)
#define ME_DRAWSEAMS (1 << 7)
#define ME_DRAWSHARP (1 << 8)
-#define ME_DRAWBWEIGHTS (1 << 8)
+#define ME_DRAWBWEIGHTS (1 << 9)
#define ME_DRAW_EDGELEN (1 << 10)
#define ME_DRAW_FACEAREA (1 << 11)
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index 2da4e9ab5a6..8b61405b851 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -35,6 +35,7 @@
#include "DNA_ID.h"
struct BoundBox;
+struct AnimData;
struct Ipo;
struct Material;
@@ -48,7 +49,9 @@ typedef struct MetaElem {
short type, flag, selcol1, selcol2;
float x, y, z; /* Position of center of MetaElem */
float quat[4]; /* Rotation of MetaElem */
- float expx, expy, expz; /* dimension parameters, used for some types like cubes */
+ float expx; /* dimension parameters, used for some types like cubes */
+ float expy;
+ float expz;
float rad; /* radius of the meta element */
float rad2; /* temp field, used only while processing */
float s; /* stiffness, how much of the element to fill */
@@ -60,18 +63,20 @@ typedef struct MetaElem {
typedef struct MetaBall {
ID id;
+ struct AnimData *adt;
struct BoundBox *bb;
ListBase elems;
ListBase disp;
ListBase *editelems; /* not saved in files, note we use pointer for editmode check */
- struct Ipo *ipo;
+ struct Ipo *ipo; // XXX... depreceated (old animation system)
/* material of the mother ball will define the material used of all others */
struct Material **mat;
- short flag, totcol;
+ char flag, flag2; /* flag is enum for updates, flag2 is bitflags for settings */
+ short totcol;
int texflag; /* used to store MB_AUTOSPACE */
/* texture space, copied as one block in editobject.c */
@@ -102,6 +107,10 @@ typedef struct MetaBall {
#define MB_UPDATE_FAST 2
#define MB_UPDATE_NEVER 3
+/* mb->flag2 */
+#define MB_DS_EXPAND (1<<0)
+
+
/* ml->type */
#define MB_BALL 0
#define MB_TUBEX 1 /* depercated */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index ab053c136ea..be7452c4ae1 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -41,6 +41,7 @@ typedef enum ModifierType {
eModifierType_SimpleDeform,
eModifierType_Multires,
eModifierType_Surface,
+ eModifierType_Smoke,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -237,6 +238,22 @@ typedef struct BMeshModifierData {
int type;
} BMeshModifierData;
+
+/* Smoke modifier flags */
+#define MOD_SMOKE_TYPE_DOMAIN (1 << 0)
+#define MOD_SMOKE_TYPE_FLOW (1 << 1)
+#define MOD_SMOKE_TYPE_COLL (1 << 2)
+
+typedef struct SmokeModifierData {
+ ModifierData modifier;
+
+ struct SmokeDomainSettings *domain;
+ struct SmokeFlowSettings *flow; /* inflow, outflow, smoke objects */
+ struct SmokeCollSettings *coll; /* collision objects */
+ float time;
+ int type; /* domain, inflow, outflow, ... */
+} SmokeModifierData;
+
typedef struct DisplaceModifierData {
ModifierData modifier;
@@ -272,7 +289,7 @@ typedef struct UVProjectModifierData {
ModifierData modifier;
/* the objects which do the projecting */
- struct Object *projectors[10];
+ struct Object *projectors[10]; /* MOD_UVPROJECT_MAX */
struct Image *image; /* the image to project */
int flags;
int num_projectors;
@@ -380,6 +397,8 @@ typedef struct HookModifierData {
ModifierData modifier;
struct Object *object;
+ char subtarget[32]; /* optional name of bone target */
+
float parentinv[4][4]; /* matrix making current transform unmodified */
float cent[3]; /* visualization of hook */
float falloff; /* if not zero, falloff is distance where influence zero */
@@ -402,6 +421,7 @@ typedef struct ClothModifierData {
struct ClothSimSettings *sim_parms; /* definition is in DNA_cloth_types.h */
struct ClothCollSettings *coll_parms; /* definition is in DNA_cloth_types.h */
struct PointCache *point_cache; /* definition is in DNA_object_force.h */
+ struct ListBase ptcaches;
} ClothModifierData;
typedef struct CollisionModifierData {
@@ -622,4 +642,6 @@ typedef struct SimpleDeformModifierData {
coordinates or global coordinates of origin */
#define MOD_SIMPLEDEFORM_ORIGIN_LOCAL (1<<0)
+#define MOD_UVPROJECT_MAX 10
+
#endif
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index b5b33610bfe..5696f82ab0d 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -74,14 +74,36 @@ typedef struct PartDeflect {
int seed; /* wind noise random seed */
} PartDeflect;
+/* Point cache file data types:
+ * - used as (1<<flag) so poke jahka if you reach the limit of 15
+ * - to add new data types update:
+ * * BKE_ptcache_data_size()
+ * * ptcache_file_init_pointers()
+*/
+#define BPHYS_DATA_INDEX 0
+#define BPHYS_DATA_LOCATION 1
+#define BPHYS_DATA_VELOCITY 2
+#define BPHYS_DATA_ROTATION 3
+#define BPHYS_DATA_AVELOCITY 4 /* used for particles */
+#define BPHYS_DATA_XCONST 4 /* used for cloth */
+#define BPHYS_DATA_SIZE 5
+#define BPHYS_DATA_TIMES 6
+#define BPHYS_DATA_BOIDS 7
+
+#define BPHYS_TOT_DATA 8
+
typedef struct PTCacheMem {
struct PTCacheMem *next, *prev;
int frame, totpoint;
- float *data; /* data points */
- void *xdata; /* extra data */
+ unsigned int data_types, flag;
+ int *index_array; /* quick access to stored points with index */
+
+ void *data[8]; /* BPHYS_TOT_DATA */
+ void *cur[8]; /* BPHYS_TOT_DATA */
} PTCacheMem;
typedef struct PointCache {
+ struct PointCache *next, *prev;
int flag; /* generic flag */
int step; /* frames between cached frames */
int simframe; /* current frame of simulation (only if SIMULATION_VALID) */
@@ -99,6 +121,9 @@ typedef struct PointCache {
char info[64];
char path[240]; /* file path */
struct ListBase mem_cache;
+
+ struct PTCacheEdit *edit;
+ void (*free_edit)(struct PTCacheEdit *edit); /* free callback */
} PointCache;
typedef struct SBVertex {
@@ -229,6 +254,7 @@ typedef struct SoftBody {
float inpush;
struct PointCache *pointcache;
+ struct ListBase ptcaches;
} SoftBody;
@@ -277,12 +303,13 @@ typedef struct SoftBody {
#define PTCACHE_OUTDATED 2
#define PTCACHE_SIMULATION_VALID 4
#define PTCACHE_BAKING 8
-#define PTCACHE_BAKE_EDIT 16
-#define PTCACHE_BAKE_EDIT_ACTIVE 32
+//#define PTCACHE_BAKE_EDIT 16
+//#define PTCACHE_BAKE_EDIT_ACTIVE 32
#define PTCACHE_DISK_CACHE 64
#define PTCACHE_QUICK_CACHE 128
#define PTCACHE_FRAMES_SKIPPED 256
#define PTCACHE_EXTERNAL 512
+#define PTCACHE_READ_INFO 1024
/* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */
#define PTCACHE_REDO_NEEDED 258
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index ae9d775a74a..d1e70c16408 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -53,7 +53,11 @@ struct SoftBody;
struct FluidsimSettings;
struct ParticleSystem;
struct DerivedMesh;
+struct SculptSession;
+struct bGPdata;
+
+/* Vertex Groups - Name Info */
typedef struct bDeformGroup {
struct bDeformGroup *next, *prev;
char name[32];
@@ -91,6 +95,8 @@ typedef struct BoundBox {
typedef struct Object {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
+
+ struct SculptSession *sculpt;
short type, partype;
int par1, par2, par3; /* can be vertexnrs */
@@ -107,12 +113,17 @@ typedef struct Object {
struct bPose *pose;
void *data;
+ struct bGPdata *gpd; /* Grease Pencil data */
+
ListBase constraintChannels; // XXX depreceated... old animation system
ListBase effect;
ListBase disp;
ListBase defbase;
ListBase modifiers; /* list of ModifierData structures */
+ int mode; /* Local object mode */
+ int restore_mode; /* Keep track of what mode to return to after toggling a mode */
+
/* materials */
struct Material **mat; /* material slots */
char *matbits; /* 1 if material linked to object */
@@ -203,7 +214,7 @@ typedef struct Object {
short recalc; /* dependency flag */
float anisotropicFriction[3];
- ListBase constraints;
+ ListBase constraints; /* object constraints */
ListBase nlastrips; // XXX depreceated... old animation system
ListBase hooks;
ListBase particlesystem; /* particle systems */
@@ -227,9 +238,11 @@ typedef struct Object {
int lastDataMask; /* the custom data layer mask that was last used to calculate derivedDeform and derivedFinal */
unsigned int state; /* bit masks of game controllers that are active */
unsigned int init_state; /* bit masks of initial state as recorded by the users */
+
int pad2;
ListBase gpulamp; /* runtime, for lamps only */
+ ListBase pc_ids;
} Object;
/* Warning, this is not used anymore because hooks are now modifiers */
@@ -395,7 +408,6 @@ extern Object workob;
#define OB_DONE 1024
#define OB_RADIO 2048
#define OB_FROMGROUP 4096
-#define OB_POSEMODE 8192
/* ob->recalc (flag bits!) */
#define OB_RECALC_OB 1
@@ -504,7 +516,17 @@ extern Object workob;
#define OB_LOCK_SCALEZ 256
#define OB_LOCK_SCALE 448
-/* ob->softflag in DNA_object_force.h */
+/* ob->mode */
+typedef enum ObjectMode {
+ OB_MODE_OBJECT = 0,
+ OB_MODE_EDIT = 1,
+ OB_MODE_SCULPT = 2,
+ OB_MODE_VERTEX_PAINT = 4,
+ OB_MODE_WEIGHT_PAINT = 8,
+ OB_MODE_TEXTURE_PAINT = 16,
+ OB_MODE_PARTICLE_EDIT = 32,
+ OB_MODE_POSE = 64
+} ObjectMode;
#ifdef __cplusplus
}
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index b71d390db5a..12c253a7cb8 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -194,8 +194,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
ParticleData *particles; /* (parent) particles */
ChildParticle *child; /* child particles */
- struct ParticleEdit *edit; /* particle editmode (runtime) */
- void (*free_edit)(struct ParticleSystem *sys); /* free callback */
+ struct PTCacheEdit *edit; /* particle editmode (runtime) */
+ void (*free_edit)(struct PTCacheEdit *edit); /* free callback */
struct ParticleCacheKey **pathcache; /* path cache (runtime) */
struct ParticleCacheKey **childcache; /* child cache (runtime) */
@@ -229,6 +229,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
/* point cache */
struct PointCache *pointcache;
+ struct ListBase ptcaches;
struct KDTree *tree; /* used for interactions with self and other systems */
}ParticleSystem;
@@ -418,7 +419,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
#define PSYS_DELETE 256 /* remove particlesystem as soon as possible */
#define PSYS_HAIR_DONE 512
#define PSYS_KEYED 1024
-#define PSYS_EDITED 2048
+//#define PSYS_EDITED 2048
//#define PSYS_PROTECT_CACHE 4096
#define PSYS_DISABLED 8192
@@ -426,11 +427,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
#define PARS_UNEXIST 1
#define PARS_NO_DISP 2
#define PARS_STICKY 4
-#define PARS_TRANSFORM 8
-#define PARS_HIDE 16
-#define PARS_TAG 32
-#define PARS_REKEY 64
-#define PARS_EDIT_RECALC 128
+#define PARS_REKEY 8
/* pars->alive */
#define PARS_KILLED 0
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 28da3ba1316..73afc3d1a53 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -47,6 +47,8 @@ struct Text;
struct bNodeTree;
struct AnimData;
struct Editing;
+struct SceneStats;
+struct bGPdata;
typedef struct Base {
struct Base *next, *prev;
@@ -387,7 +389,7 @@ typedef struct GameData {
* bit 3: (gameengine): Activity culling is enabled.
* bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
*/
- short mode, pad11;
+ short mode, flag, matmode, pad[3];
short occlusionRes; /* resolution of occlusion Z buffer in pixel */
short physicsEngine;
short ticrate, maxlogicstep, physubstep, maxphystep;
@@ -401,6 +403,7 @@ typedef struct GameData {
struct GameDome dome;
short stereoflag, stereomode, xsch, ysch; //xsch and ysch can be deleted !!!
} GameData;
+
#define STEREO_NOSTEREO 1
#define STEREO_ENABLED 2
#define STEREO_DOME 3
@@ -422,6 +425,25 @@ typedef struct GameData {
#define WOPHY_ODE 4
#define WOPHY_BULLET 5
+/* GameData.flag */
+#define GAME_ENABLE_ALL_FRAMES (1 << 1)
+#define GAME_SHOW_DEBUG_PROPS (1 << 2)
+#define GAME_SHOW_FRAMERATE (1 << 3)
+#define GAME_SHOW_PHYSICS (1 << 4)
+#define GAME_DISPLAY_LISTS (1 << 5)
+#define GAME_GLSL_NO_LIGHTS (1 << 6)
+#define GAME_GLSL_NO_SHADERS (1 << 7)
+#define GAME_GLSL_NO_SHADOWS (1 << 8)
+#define GAME_GLSL_NO_RAMPS (1 << 9)
+#define GAME_GLSL_NO_NODES (1 << 10)
+#define GAME_GLSL_NO_EXTRA_TEX (1 << 11)
+#define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12)
+
+/* GameData.matmode */
+#define GAME_MAT_TEXFACE 0
+#define GAME_MAT_MULTITEX 1
+#define GAME_MAT_GLSL 2
+
typedef struct TimeMarker {
struct TimeMarker *next, *prev;
int frame;
@@ -429,8 +451,21 @@ typedef struct TimeMarker {
unsigned int flag;
} TimeMarker;
+typedef struct Paint {
+ /* Array of brushes selected for use in this paint mode */
+ Brush **brushes;
+ int active_brush_index, brush_count;
+
+ /* WM Paint cursor */
+ void *paint_cursor;
+ unsigned char paint_cursor_col[4];
+
+ int pad;
+} Paint;
+
typedef struct ImagePaintSettings {
- struct Brush *brush;
+ Paint paint;
+
short flag, tool;
/* for projection painting only */
@@ -453,10 +488,15 @@ typedef struct ParticleEditSettings {
ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
void *paintcursor; /* runtime */
- float emitterdist;
- int draw_timed;
+ float emitterdist, rt;
+
+ int selectmode;
+ int edittype;
+
+ int draw_step, fade_frames;
- int selectmode, pad;
+ struct Scene *scene;
+ struct Object *object;
} ParticleEditSettings;
typedef struct TransformOrientation {
@@ -465,26 +505,20 @@ typedef struct TransformOrientation {
float mat[3][3];
} TransformOrientation;
-struct SculptSession;
-typedef struct Sculpt
-{
- /* Note! a deep copy of this struct must be done header_info.c's copy_scene function */
- /* Data stored only from entering sculptmode until exiting sculptmode */
- struct SculptSession *session;
- struct Brush *brush;
+typedef struct Sculpt {
+ Paint paint;
/* For rotating around a pivot point */
float pivot[3];
int flags;
- /* For the Brush Shape */
- char texsep;
+
/* Control tablet input */
char tablet_size, tablet_strength;
- char pad[5];
+ char pad[6];
} Sculpt;
typedef struct VPaint {
- struct Brush *brush;
+ Paint paint;
float gamma, mul; /* should become part of struct Brush? */
short mode, flag;
@@ -570,7 +604,7 @@ typedef struct ToolSettings {
float clean_thresh;
/* Auto-Keying Mode */
- short autokey_mode, pad2; /* defines in DNA_userdef_types.h */
+ short autokey_mode, autokey_flag; /* defines in DNA_userdef_types.h */
/* Retopo */
char retopo_mode;
@@ -622,6 +656,12 @@ typedef struct bStats {
int totvert, totface;
} bStats;
+typedef struct UnitSettings {
+ /* Display/Editing unit options for each scene */
+ float scale_length; /* maybe have other unit conversions? */
+ short system;
+ short flag; /* imperial, metric etc */
+} UnitSettings;
typedef struct Scene {
ID id;
@@ -642,7 +682,7 @@ typedef struct Scene {
float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
unsigned int lay;
-
+
short flag; /* various settings */
short use_nodes;
@@ -662,6 +702,7 @@ typedef struct Scene {
ListBase markers;
ListBase transform_spaces;
+ ListBase sound_handles;
/* none of the dependancy graph vars is mean to be saved */
struct DagForest *theDag;
@@ -680,6 +721,12 @@ typedef struct Scene {
/* Game Settings */
struct GameFraming framing; // XXX deprecated since 2.5
struct GameData gm;
+
+ /* Units */
+ struct UnitSettings unit;
+
+ /* Grease Pencil */
+ struct bGPdata *gpd;
} Scene;
@@ -1000,9 +1047,10 @@ typedef enum SculptFlags {
#define PE_LOCK_FIRST 2
#define PE_DEFLECT_EMITTER 4
#define PE_INTERPOLATE_ADDED 8
-#define PE_SHOW_CHILD 16
-#define PE_SHOW_TIME 32
+#define PE_DRAW_PART 16
#define PE_X_MIRROR 64
+#define PE_FADE_TIME 128
+#define PE_AUTO_VELOCITY 256
/* toolsetting->particle brushtype */
#define PE_BRUSH_NONE -1
@@ -1011,11 +1059,15 @@ typedef enum SculptFlags {
#define PE_BRUSH_LENGTH 2
#define PE_BRUSH_PUFF 3
#define PE_BRUSH_ADD 4
-#define PE_BRUSH_WEIGHT 5
-#define PE_BRUSH_SMOOTH 6
+#define PE_BRUSH_SMOOTH 5
/* this must equal ParticleEditSettings.brush array size */
-#define PE_TOT_BRUSH 7
+#define PE_TOT_BRUSH 6
+
+/* tooksettings->particle edittype */
+#define PE_TYPE_PARTICLES 0
+#define PE_TYPE_SOFTBODY 1
+#define PE_TYPE_CLOTH 2
/* toolsettings->retopo_mode */
#define RETOPO 1
@@ -1071,6 +1123,15 @@ typedef enum SculptFlags {
#define SK_RETARGET_ROLL_VIEW 1
#define SK_RETARGET_ROLL_JOINT 2
+/* UnitSettings */
+
+/* UnitSettings->system */
+#define USER_UNIT_NONE 0
+#define USER_UNIT_METRIC 1
+#define USER_UNIT_IMPERIAL 2
+/* UnitSettings->flag */
+#define USER_UNIT_OPT_SPLIT 1
+
#ifdef __cplusplus
}
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
index 8b29ce1338d..cc998de7eec 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -178,6 +178,9 @@ typedef struct bJoystickSensor {
/* bMouseSensor->type: uses blender event defines */
+/* bMouseSensor->flag: only pulse for now */
+#define SENS_MOUSE_FOCUS_PULSE 1
+
/* propertysensor->type */
#define SENS_PROP_EQUAL 0
#define SENS_PROP_NEQUAL 1
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 39e72c34adf..6d455d20f59 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -147,7 +147,7 @@ typedef struct Sequence {
Strip *strip;
- struct Ipo *ipo;
+ struct Ipo *ipo; // xxx depreceated... old animation system
struct Scene *scene;
struct anim *anim;
float facf0, facf1;
@@ -160,7 +160,7 @@ typedef struct Sequence {
ListBase seqbase; /* list of strips for metastrips */
struct bSound *sound; /* the linked "bSound" object */
- struct hdaudio *hdaudio; /* external hdaudio object */
+ struct SoundHandle *sound_handle;
float level, pan; /* level in dB (0=full), pan -1..1 */
int scenenr; /* for scene selection */
float strobe;
@@ -281,7 +281,7 @@ typedef struct SpeedControlVars {
#define SEQ_MOVIE 3
#define SEQ_RAM_SOUND 4
#define SEQ_HD_SOUND 5
-#define SEQ_MOVIE_AND_HD_SOUND 6 /* helper for add_sequence */
+#define SEQ_SOUND 4
#define SEQ_EFFECT 8
#define SEQ_CROSS 8
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
new file mode 100644
index 00000000000..7c6c7fab9e4
--- /dev/null
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -0,0 +1,125 @@
+/**
+* $Id$
+*
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+* The Original Code is Copyright (C) 2006 by NaN Holding BV.
+* All rights reserved.
+*
+* The Original Code is: all of this file.
+*
+* Contributor(s): Daniel Genrich (Genscher)
+*
+* ***** END GPL LICENSE BLOCK *****
+*/
+#ifndef DNA_SMOKE_TYPES_H
+#define DNA_SMOKE_TYPES_H
+
+/* flags */
+#define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */
+#define MOD_SMOKE_DISSOLVE (1<<2) /* let smoke dissolve */
+#define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve */
+
+/* noise */
+#define MOD_SMOKE_NOISEWAVE (1<<0)
+#define MOD_SMOKE_NOISEFFT (1<<1)
+#define MOD_SMOKE_NOISECURL (1<<2)
+
+/* viewsettings */
+#define MOD_SMOKE_SHOWHIGHRES (1<<0) /* show high resolution */
+
+typedef struct SmokeDomainSettings {
+ struct SmokeModifierData *smd; /* for fast RNA access */
+ struct FLUID_3D *fluid;
+ struct Group *fluid_group;
+ struct Group *eff_group; // effector group for e.g. wind force
+ struct Group *coll_group; // collision objects group
+ struct GPUTexture *tex;
+ float *view3d; /* voxel data for display */
+ unsigned int v3dnum; /* number of frame in view3d buffer */
+ float p0[3]; /* start point of BB */
+ float p1[3]; /* end point of BB */
+ float dx; /* edge length of one cell */
+ float firstframe;
+ float lastframe;
+ float temp; /* fluid temperature */
+ float tempAmb; /* ambient temperature */
+ float alpha;
+ float beta;
+ int res[3]; /* domain resolution */
+ int maxres; /* longest axis on the BB gets this resolution assigned */
+ int flags; /* show up-res or low res, etc */
+ int viewsettings;
+ short diss_percent;
+ short pad;
+ int diss_speed;/* in frames */
+ struct PointCache *point_cache[2]; /* definition is in DNA_object_force.h */
+ struct ListBase ptcaches[2];
+ struct WTURBULENCE *wt; // WTURBULENCE object, if active
+ int pad3;
+ float strength;
+ int res_wt[3];
+ int maxres_wt;
+ short noise; /* noise type: wave, curl, anisotropic */
+ short pad2;
+ int amplify;
+} SmokeDomainSettings;
+
+
+/* inflow / outflow */
+
+/* type */
+#define MOD_SMOKE_FLOW_TYPE_OUTFLOW (1<<1)
+
+typedef struct SmokeFlowSettings {
+ struct SmokeModifierData *smd; /* for fast RNA access */
+ struct ParticleSystem *psys;
+ float density;
+ float temp; /* delta temperature (temp - ambient temp) */
+ float velocity[3]; /* UNUSED, velocity taken from particles */
+ float vgrp_heat_scale[2]; /* min and max scaling for vgroup_heat */
+ short vgroup_flow; /* where inflow/outflow happens - red=1=action */
+ short vgroup_density;
+ short vgroup_heat;
+ short type; /* inflow =0 or outflow = 1 */
+ int pad;
+} SmokeFlowSettings;
+
+/*
+ struct BVHTreeFromMesh *bvh;
+ float mat[4][4];
+ float mat_old[4][4];
+ */
+
+/* collision objects (filled with smoke) */
+typedef struct SmokeCollSettings {
+ struct SmokeModifierData *smd; /* for fast RNA access */
+ struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */
+ struct DerivedMesh *dm;
+ float *points;
+ float *points_old;
+ float *vel;
+ float mat[4][4];
+ float mat_old[4][4];
+ int numpoints;
+ int numverts; // check if mesh changed
+ short type; // static = 0, rigid = 1, dynamic = 2
+ short pad;
+ int pad2;
+} SmokeCollSettings;
+
+#endif
diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h
index 5dedd20e1e4..55b48e4aacd 100644
--- a/source/blender/makesdna/DNA_sound_types.h
+++ b/source/blender/makesdna/DNA_sound_types.h
@@ -37,94 +37,92 @@
/* stupid... could easily be solved */
#include "DNA_view2d_types.h"
-/* extern int noaudio; * defined in sound.c . also not very nice */
-/* extern ListBase *samples; don't do this in DNA, but in BKE_... instead */
-
-struct bSample;
struct Ipo;
struct PackedFile;
struct SpaceLink;
-/* should not be here! */
-#
-#
-typedef struct bSample {
- ID id;
- void *data;
- void *snd_sample;
- short type, bits;
- short channels;
- int len, rate;
-// int buffer;
- int alindex;
- char fakedata[16];
- int flags;
- char name[160];
- struct PackedFile * packedfile;
- short us;
-} bSample;
-
-
+// runtime only - no saving
+typedef struct SoundHandle {
+ struct SoundHandle *next, *prev;
+ struct bSound *source;
+ void *handle;
+ int state;
+ int startframe;
+ int endframe;
+ int frameskip;
+ int mute;
+ int changed;
+ float volume;
+ float pad;
+} SoundHandle;
+
+typedef struct Sound3D
+{
+ float min_gain;
+ float max_gain;
+ float reference_distance;
+ float max_distance;
+ float rolloff_factor;
+ float cone_inner_angle;
+ float cone_outer_angle;
+ float cone_outer_gain;
+} Sound3D;
typedef struct bSound {
ID id;
- char name[160];
- struct bSample *sample;
- void *stream;
- struct PackedFile *packedfile;
- struct PackedFile *newpackedfile;
- void *snd_sound;
- struct Ipo *ipo;
- float volume, panning;
+
/**
- * Sets the rollofffactor. The rollofffactor is a per-Source parameter
- * the application can use to increase or decrease the range of a source
- * by decreasing or increasing the attenuation, respectively. The default
- * value is 1. The implementation is free to optimize for a rollofffactor
- * value of 0, which indicates that the application does not wish any
- * distance attenuation on the respective Source.
+ * The path to the sound file.
*/
- float attenuation;
- float pitch;
+ char name[160];
+
/**
- * min_gain indicates the minimal gain which is always guaranteed for this sound
+ * The packed file.
*/
- float min_gain;
+ struct PackedFile *packedfile;
+
/**
- * max_gain indicates the maximal gain which is always guaranteed for this sound
+ * The handle for audaspace.
*/
- float max_gain;
+ void *handle;
+
/**
- * Sets the referencedistance at which the listener will experience gain.
+ * Deprecated; used for loading pre 2.5 files.
*/
+ struct PackedFile *newpackedfile;
+ struct Ipo *ipo;
+ float volume;
+ float attenuation;
+ float pitch;
+ float min_gain;
+ float max_gain;
float distance;
int flags;
- int streamlen;
- char channels;
- char highprio;
- char pad[10];
-} bSound;
-typedef struct bSoundListener {
- ID id;
- /**
- * Overall gain
- */
- float gain;
+/** currently int type;
+ struct bSound *child_sound;*/
+
/**
- * Sets a scaling to exaggerate or deemphasize the Doppler (pitch) shift
- * resulting from the calculation.
+ * Whether the sound has been changed and must be restarted if playing.
*/
- float dopplerfactor;
+ int changed;
+
/**
- * Sets the value of the propagation speed relative to which the source
- * velocities are interpreted.
+ * The audaspace handle for cache.
*/
- float dopplervelocity;
- short numsoundsblender;
- short numsoundsgameengine;
-
-} bSoundListener;
+ void *cache;
+
+/** XXX unused currently // SOUND_TYPE_LIMITER
+ float start, end;*/
+} bSound;
+
+/* XXX unused currently
+typedef enum eSound_Type {
+ SOUND_TYPE_INVALID = -1,
+ SOUND_TYPE_FILE = 0,
+ SOUND_TYPE_BUFFER,
+ SOUND_TYPE_LIMITER
+} eSound_Type;*/
/* spacesound->flag */
#define SND_DRAWFRAMES 1
@@ -146,34 +144,7 @@ typedef struct SpaceSound {
int pad2;
} SpaceSound;
-
-enum SAMPLE_FileTypes {
- SAMPLE_INVALID = -1, // must be negative
- SAMPLE_UNKNOWN = 0,
- SAMPLE_RAW,
- SAMPLE_WAV,
- SAMPLE_MP2,
- SAMPLE_MP3,
- SAMPLE_OGG_VORBIS,
- SAMPLE_WMA,
- SAMPLE_ASF,
- SAMPLE_AIFF
-};
-
-
-#define SOUND_CHANNELS_STEREO 0
-#define SOUND_CHANNELS_LEFT 1
-#define SOUND_CHANNELS_RIGHT 2
-
-#define SOUND_FLAGS_LOOP (1 << 0)
-#define SOUND_FLAGS_FIXED_VOLUME (1 << 1)
-#define SOUND_FLAGS_FIXED_PANNING (1 << 2)
#define SOUND_FLAGS_3D (1 << 3)
-#define SOUND_FLAGS_BIDIRECTIONAL_LOOP (1 << 4)
-#define SOUND_FLAGS_PRIORITY (1 << 5)
-#define SOUND_FLAGS_SEQUENCE (1 << 6)
-
-#define SAMPLE_NEEDS_SAVE (1 << 0)
/* to DNA_sound_types.h*/
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index d24d9af4177..6fdc3a7787b 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -508,6 +508,13 @@ typedef struct SpaceConsole {
} SpaceConsole;
+typedef struct SpaceUserPref {
+ SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
+ int spacetype;
+
+ int pad;
+} SpaceUserPref;
/* view3d Now in DNA_view3d_types.h */
@@ -713,6 +720,7 @@ enum FileSortTypeE {
#define SIPO_DRAWTIME (1<<4)
#define SIPO_SELCUVERTSONLY (1<<5)
#define SIPO_DRAWNAMES (1<<6)
+#define SIPO_SLIDERS (1<<7)
/* SpaceIpo->mode (Graph Editor Mode) */
enum {
@@ -821,7 +829,7 @@ enum {
#define TIME_ALL_3D_WIN 2
#define TIME_ALL_ANIM_WIN 4
#define TIME_ALL_BUTS_WIN 8
-#define TIME_WITH_SEQ_AUDIO 16
+#define TIME_WITH_SEQ_AUDIO 16 // deprecated
#define TIME_SEQ 32
#define TIME_ALL_IMAGE_WIN 64
#define TIME_CONTINUE_PHYSICS 128
@@ -861,7 +869,8 @@ enum {
SPACE_NODE,
SPACE_LOGIC,
SPACE_CONSOLE,
- SPACEICONMAX = SPACE_CONSOLE
+ SPACE_USERPREF,
+ SPACEICONMAX = SPACE_USERPREF
};
#endif
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 7325181ee14..4df63ee9cd9 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -53,17 +53,17 @@ typedef struct MTex {
char uvname[32];
char projx, projy, projz, mapping;
- float ofs[3], size[3];
+ float ofs[3], size[3], rot;
short texflag, colormodel, pmapto, pmaptoneg;
- short normapspace, which_output, pad[2];
+ short normapspace, which_output;
+ char brush_map_mode, pad[7];
float r, g, b, k;
float def_var, rt;
float colfac, norfac, varfac;
float dispfac;
float warpfac;
-
} MTex;
#ifndef DNA_USHORT_FIX
@@ -128,6 +128,55 @@ typedef struct EnvMap {
short recalc, lastsize;
} EnvMap;
+typedef struct PointDensity {
+ short flag;
+
+ short falloff_type;
+ float falloff_softness;
+ float radius;
+ short source;
+ short color_source;
+ int totpoints;
+
+ int pdpad;
+
+ struct Object *object; /* for 'Object' or 'Particle system' type - source object */
+ struct ParticleSystem *psys;
+ short psys_cache_space; /* cache points in worldspace, object space, ... ? */
+ short ob_cache_space; /* cache points in worldspace, object space, ... ? */
+
+ short pdpad2[2];
+
+ void *point_tree; /* the acceleration tree containing points */
+ float *point_data; /* dynamically allocated extra for extra information, like particle age */
+
+ float noise_size;
+ short noise_depth;
+ short noise_influence;
+ short noise_basis;
+ short pdpad3[3];
+ float noise_fac;
+
+ float speed_scale;
+ struct ColorBand *coba; /* for time -> color */
+
+} PointDensity;
+
+typedef struct VoxelData {
+ int resol[3];
+ int interp_type;
+ short file_format;
+ short flag;
+ int pad;
+
+ struct Object *object; /* for rendering smoke sims */
+ float int_multiplier;
+ int still_frame;
+ char source_path[240];
+ float *dataset;
+
+} VoxelData;
+
typedef struct Tex {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
@@ -143,7 +192,11 @@ typedef struct Tex {
float dist_amount, ns_outscale;
/* newnoise: voronoi nearest neighbour weights, minkovsky exponent, distance metric & color type */
- float vn_w1, vn_w2, vn_w3, vn_w4, vn_mexp;
+ float vn_w1;
+ float vn_w2;
+ float vn_w3;
+ float vn_w4;
+ float vn_mexp;
short vn_distm, vn_coltype;
short noisedepth, noisetype;
@@ -177,6 +230,8 @@ typedef struct Tex {
struct ColorBand *coba;
struct EnvMap *env;
struct PreviewImage * preview;
+ struct PointDensity *pd;
+ struct VoxelData *vd;
char use_nodes;
char pad[7];
@@ -216,6 +271,8 @@ typedef struct TexMapping {
#define TEX_MUSGRAVE 11
#define TEX_VORONOI 12
#define TEX_DISTNOISE 13
+#define TEX_POINTDENSITY 14
+#define TEX_VOXELDATA 15
/* musgrave stype */
#define TEX_MFRACTAL 0
@@ -392,6 +449,11 @@ typedef struct TexMapping {
#define MTEX_BLEND_COLOR 13
#define MTEX_NUM_BLENDTYPES 14
+/* brush_map_mode */
+#define MTEX_MAP_MODE_FIXED 0
+#define MTEX_MAP_MODE_TILED 1
+#define MTEX_MAP_MODE_3D 2
+
/* **************** EnvMap ********************* */
/* type */
@@ -408,5 +470,62 @@ typedef struct TexMapping {
#define ENV_NORMAL 1
#define ENV_OSA 2
+/* **************** PointDensity ********************* */
+
+/* source */
+#define TEX_PD_PSYS 0
+#define TEX_PD_OBJECT 1
+#define TEX_PD_FILE 2
+
+/* falloff_type */
+#define TEX_PD_FALLOFF_STD 0
+#define TEX_PD_FALLOFF_SMOOTH 1
+#define TEX_PD_FALLOFF_SOFT 2
+#define TEX_PD_FALLOFF_CONSTANT 3
+#define TEX_PD_FALLOFF_ROOT 4
+
+/* psys_cache_space */
+#define TEX_PD_OBJECTLOC 0
+#define TEX_PD_OBJECTSPACE 1
+#define TEX_PD_WORLDSPACE 2
+
+/* flag */
+#define TEX_PD_TURBULENCE 1
+
+
+/* noise_influence */
+#define TEX_PD_NOISE_STATIC 0
+#define TEX_PD_NOISE_VEL 1
+#define TEX_PD_NOISE_AGE 2
+#define TEX_PD_NOISE_TIME 3
+
+/* color_source */
+#define TEX_PD_COLOR_CONSTANT 0
+#define TEX_PD_COLOR_PARTAGE 1
+#define TEX_PD_COLOR_PARTSPEED 2
+#define TEX_PD_COLOR_PARTVEL 3
+
+#define POINT_DATA_VEL 1
+#define POINT_DATA_LIFE 2
+
+/******************** Voxel Data *****************************/
+/* flag */
+#define TEX_VD_STILL 1
+
+/* interpolation */
+#define TEX_VD_NEARESTNEIGHBOR 0
+#define TEX_VD_LINEAR 1
+#define TEX_VD_QUADRATIC 2
+#define TEX_VD_TRICUBIC_CATROM 3
+#define TEX_VD_TRICUBIC_BSPLINE 4
+#define TEX_VD_TRICUBIC_SLOW 5
+
+/* file format */
+#define TEX_VD_BLENDERVOXEL 0
+#define TEX_VD_RAW_8BIT 1
+#define TEX_VD_RAW_16BIT 2
+#define TEX_VD_IMAGE_SEQUENCE 3
+#define TEX_VD_SMOKE 4
+
#endif
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index bda4355d30b..826eea43a4d 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -260,6 +260,7 @@ typedef struct bTheme {
ThemeSpace ttime;
ThemeSpace tnode;
ThemeSpace tlogic;
+ ThemeSpace tuserpref;
/* 20 sets of bone colors for this theme */
ThemeWireColor tarm[20];
@@ -293,6 +294,11 @@ typedef struct UserDef {
short userpref, viewzoom;
int mixbufsize;
+ int audiodevice;
+ int audiorate;
+ int audioformat;
+ int audiochannels;
+
int scrollback; /* console scrollback limit */
int dpi; /* range 48-128? */
short encoding;
@@ -363,6 +369,7 @@ extern UserDef U; /* from blenkernel blender.c */
#define USER_RELPATHS (1 << 20)
#define USER_DRAGIMMEDIATE (1 << 21)
#define USER_DONT_DOSCRIPTLINKS (1 << 22)
+#define USER_FILENOUI (1 << 23)
/* viewzom */
#define USER_ZOOM_CONT 0
@@ -404,10 +411,12 @@ extern UserDef U; /* from blenkernel blender.c */
#define AUTOKEY_MODE_EDITKEYS 5
/* Auto-Keying flag */
+ /* U.autokey_flag */
#define AUTOKEY_FLAG_INSERTAVAIL (1<<0)
#define AUTOKEY_FLAG_INSERTNEEDED (1<<1)
#define AUTOKEY_FLAG_AUTOMATKEY (1<<2)
-
+ /* toolsettings->autokey_flag */
+#define ANIMRECORD_FLAG_WITHNLA (1<<10)
/* transopts */
#define USER_TR_TOOLTIPS (1 << 0)
@@ -431,6 +440,7 @@ extern UserDef U; /* from blenkernel blender.c */
#define USER_DUP_TEX (1 << 8)
#define USER_DUP_ARM (1 << 9)
#define USER_DUP_ACT (1 << 10)
+#define USER_DUP_PSYS (1 << 11)
/* gameflags */
#define USER_DEPRECATED_FLAG 1
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index b6a2b4c0544..10f83c8b9ec 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -54,6 +54,7 @@ struct StructRNA;
struct PointerRNA;
struct ReportList;
struct Report;
+struct uiLayout;
#define OP_MAX_TYPENAME 64
#define KMAP_MAX_NAME 64
@@ -208,8 +209,8 @@ typedef struct wmOperatorType {
* that the operator might still fail to execute even if this return true */
int (*poll)(struct bContext *);
- /* panel for redo and repeat */
- void *(*uiBlock)(struct wmOperator *);
+ /* optional panel for redo and repeat, autogenerated if not set */
+ void (*ui)(struct bContext *, struct PointerRNA *, struct uiLayout *);
/* rna for properties */
struct StructRNA *srna;
@@ -284,6 +285,7 @@ typedef struct wmOperator {
ListBase macro; /* list of operators, can be a tree */
struct wmOperator *opm; /* current running macro, not saved */
+ short flag, pad[3];
} wmOperator;
@@ -294,6 +296,9 @@ typedef struct wmOperator {
/* add this flag if the event should pass through */
#define OPERATOR_PASS_THROUGH 8
+/* wmOperator flag */
+#define OPERATOR_REPORT_FREE 1
+
/* ************** wmEvent ************************ */
/* for read-only rna access, dont save this */
diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h
index 200ff6d9324..64ff23dd1a8 100644
--- a/source/blender/makesdna/DNA_world_types.h
+++ b/source/blender/makesdna/DNA_world_types.h
@@ -71,12 +71,12 @@ typedef struct World {
/**
* Gravitation constant for the game world
*/
- float gravity; // moved to scene->gamedata in 2.5
+ float gravity; // XXX moved to scene->gamedata in 2.5
/**
* Radius of the activity bubble, in Manhattan length. Objects
* outside the box are activity-culled. */
- float activityBoxRadius; // moved to scene->gamedata in 2.5
+ float activityBoxRadius; // XXX moved to scene->gamedata in 2.5
short skytype;
/**
@@ -89,9 +89,9 @@ typedef struct World {
* bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
*/
short mode; // partially moved to scene->gamedata in 2.5
- short occlusionRes; /* resolution of occlusion Z buffer in pixel */ // moved to scene->gamedata in 2.5
- short physicsEngine; /* here it's aligned */ // moved to scene->gamedata in 2.5
- short ticrate, maxlogicstep, physubstep, maxphystep; // moved to scene->gamedata in 2.5
+ short occlusionRes; /* resolution of occlusion Z buffer in pixel */ // XXX moved to scene->gamedata in 2.5
+ short physicsEngine; /* here it's aligned */ // XXX moved to scene->gamedata in 2.5
+ short ticrate, maxlogicstep, physubstep, maxphystep; // XXX moved to scene->gamedata in 2.5
float misi, miststa, mistdist, misthi;
diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript
index f91cf166f62..1cb61f59121 100644
--- a/source/blender/makesdna/SConscript
+++ b/source/blender/makesdna/SConscript
@@ -8,4 +8,4 @@ objs += o
incs = '#/intern/guardedalloc .'
-env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215, 215] )
+env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core'], priority = [215] )
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 207d6fdd94a..cae28f163ed 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -132,6 +132,7 @@ char *includefiles[] = {
"DNA_windowmanager_types.h",
"DNA_anim_types.h",
"DNA_boid_types.h",
+ "DNA_smoke_types.h",
// empty string to indicate end of includefiles
""
@@ -484,15 +485,18 @@ static void *read_file_data(char *filename, int *len_r)
data= MEM_mallocN(*len_r, "read_file_data");
if (!data) {
*len_r= -1;
+ fclose(fp);
return NULL;
}
if (fread(data, *len_r, 1, fp)!=1) {
*len_r= -1;
MEM_freeN(data);
+ fclose(fp);
return NULL;
}
-
+
+ fclose(fp);
return data;
}
@@ -1154,4 +1158,5 @@ int main(int argc, char ** argv)
#include "DNA_windowmanager_types.h"
#include "DNA_anim_types.h"
#include "DNA_boid_types.h"
+#include "DNA_smoke_types.h"
/* end of list */
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 64a4887701b..98205d17ef3 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -213,6 +213,11 @@ extern StructRNA RNA_GameSoftBodySettings;
extern StructRNA RNA_GameStringProperty;
extern StructRNA RNA_GameTimerProperty;
extern StructRNA RNA_GlowSequence;
+extern StructRNA RNA_GreasePencil;
+extern StructRNA RNA_GPencilLayer;
+extern StructRNA RNA_GPencilFrame;
+extern StructRNA RNA_GPencilStroke;
+extern StructRNA RNA_GPencilStrokePoint;
extern StructRNA RNA_Group;
extern StructRNA RNA_Header;
extern StructRNA RNA_HemiLamp;
@@ -252,6 +257,7 @@ extern StructRNA RNA_MarbleTexture;
extern StructRNA RNA_MaskModifier;
extern StructRNA RNA_Material;
extern StructRNA RNA_MaterialHalo;
+extern StructRNA RNA_MaterialPhysics;
extern StructRNA RNA_MaterialRaytraceMirror;
extern StructRNA RNA_MaterialRaytraceTransparency;
extern StructRNA RNA_MaterialSlot;
@@ -304,8 +310,11 @@ extern StructRNA RNA_OperatorStrokeElement;
extern StructRNA RNA_OrController;
extern StructRNA RNA_OutflowFluidSettings;
extern StructRNA RNA_PackedFile;
+extern StructRNA RNA_Paint;
extern StructRNA RNA_Panel;
extern StructRNA RNA_Particle;
+extern StructRNA RNA_ParticleBrush;
+extern StructRNA RNA_ParticleEdit;
extern StructRNA RNA_ParticleFluidSettings;
extern StructRNA RNA_ParticleHairKey;
extern StructRNA RNA_ParticleInstanceModifier;
@@ -317,6 +326,8 @@ extern StructRNA RNA_ParticleTarget;
extern StructRNA RNA_PluginSequence;
extern StructRNA RNA_PluginTexture;
extern StructRNA RNA_PointCache;
+extern StructRNA RNA_PointDensity;
+extern StructRNA RNA_PointDensityTexture;
extern StructRNA RNA_PointerProperty;
extern StructRNA RNA_Pose;
extern StructRNA RNA_PoseChannel;
@@ -328,6 +339,7 @@ extern StructRNA RNA_RadarSensor;
extern StructRNA RNA_RandomSensor;
extern StructRNA RNA_RaySensor;
extern StructRNA RNA_Region;
+extern StructRNA RNA_RenderEngine;
extern StructRNA RNA_RenderLayer;
extern StructRNA RNA_RenderPass;
extern StructRNA RNA_RenderResult;
@@ -378,6 +390,10 @@ extern StructRNA RNA_ShapeKeyPoint;
extern StructRNA RNA_ShrinkwrapConstraint;
extern StructRNA RNA_ShrinkwrapModifier;
extern StructRNA RNA_SimpleDeformModifier;
+extern StructRNA RNA_SmokeCollSettings;
+extern StructRNA RNA_SmokeDomainSettings;
+extern StructRNA RNA_SmokeFlowSettings;
+extern StructRNA RNA_SmokeModifier;
extern StructRNA RNA_SmoothModifier;
extern StructRNA RNA_SoftBodyModifier;
extern StructRNA RNA_SoftBodySettings;
@@ -385,17 +401,22 @@ extern StructRNA RNA_Sound;
extern StructRNA RNA_SoundSequence;
extern StructRNA RNA_Space;
extern StructRNA RNA_Space3DView;
-extern StructRNA RNA_SpaceButtonsWindow;
extern StructRNA RNA_SpaceConsole;
extern StructRNA RNA_SpaceDopeSheetEditor;
extern StructRNA RNA_SpaceFileBrowser;
extern StructRNA RNA_SpaceGraphEditor;
extern StructRNA RNA_SpaceImageEditor;
+extern StructRNA RNA_SpaceInfo;
+extern StructRNA RNA_SpaceLogicEditor;
extern StructRNA RNA_SpaceNLA;
+extern StructRNA RNA_SpaceNodeEditor;
extern StructRNA RNA_SpaceOutliner;
+extern StructRNA RNA_SpaceProperties;
extern StructRNA RNA_SpaceSequenceEditor;
extern StructRNA RNA_SpaceTextEditor;
+extern StructRNA RNA_SpaceTimeline;
extern StructRNA RNA_SpaceUVEditor;
+extern StructRNA RNA_SpaceUserPreferences;
extern StructRNA RNA_SpeedControlSequence;
extern StructRNA RNA_SpotLamp;
extern StructRNA RNA_StretchToConstraint;
@@ -441,16 +462,17 @@ extern StructRNA RNA_TextureSlot;
extern StructRNA RNA_Theme;
extern StructRNA RNA_ThemeAudioWindow;
extern StructRNA RNA_ThemeBoneColorSet;
-extern StructRNA RNA_ThemeButtonsWindow;
extern StructRNA RNA_ThemeDopeSheet;
extern StructRNA RNA_ThemeFileBrowser;
extern StructRNA RNA_ThemeFontStyle;
extern StructRNA RNA_ThemeGraphEditor;
extern StructRNA RNA_ThemeImageEditor;
+extern StructRNA RNA_ThemeInfo;
extern StructRNA RNA_ThemeLogicEditor;
extern StructRNA RNA_ThemeNLAEditor;
extern StructRNA RNA_ThemeNodeEditor;
extern StructRNA RNA_ThemeOutliner;
+extern StructRNA RNA_ThemeProperties;
extern StructRNA RNA_ThemeSequenceEditor;
extern StructRNA RNA_ThemeStyle;
extern StructRNA RNA_ThemeTextEditor;
@@ -469,20 +491,22 @@ extern StructRNA RNA_TransformSequence;
extern StructRNA RNA_UILayout;
extern StructRNA RNA_UIListItem;
extern StructRNA RNA_UVProjectModifier;
+extern StructRNA RNA_UnitSettings;
extern StructRNA RNA_UnknownType;
extern StructRNA RNA_UserPreferences;
-extern StructRNA RNA_UserPreferencesAutosave;
extern StructRNA RNA_UserPreferencesEdit;
extern StructRNA RNA_UserPreferencesFilePaths;
extern StructRNA RNA_UserPreferencesLanguage;
extern StructRNA RNA_UserPreferencesSystem;
extern StructRNA RNA_UserPreferencesView;
extern StructRNA RNA_UserSolidLight;
-extern StructRNA RNA_VertexPaint;
extern StructRNA RNA_VectorFont;
extern StructRNA RNA_VertexGroup;
extern StructRNA RNA_VertexGroupElement;
+extern StructRNA RNA_VertexPaint;
extern StructRNA RNA_VoronoiTexture;
+extern StructRNA RNA_VoxelData;
+extern StructRNA RNA_VoxelDataTexture;
extern StructRNA RNA_WaveModifier;
extern StructRNA RNA_Window;
extern StructRNA RNA_WindowManager;
@@ -558,9 +582,13 @@ char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen);
const char *RNA_property_identifier(PropertyRNA *prop);
PropertyType RNA_property_type(PropertyRNA *prop);
PropertySubType RNA_property_subtype(PropertyRNA *prop);
+PropertyUnit RNA_property_unit(PropertyRNA *prop);
int RNA_property_flag(PropertyRNA *prop);
-int RNA_property_array_length(PropertyRNA *prop);
+int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop);
+int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length);
+char RNA_property_array_item_char(PropertyRNA *prop, int index);
+unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dim_size[]);
int RNA_property_string_maxlength(PropertyRNA *prop);
@@ -644,7 +672,7 @@ RawPropertyType RNA_property_raw_type(PropertyRNA *prop);
void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop);
void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop);
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr);
-void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key);
+int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key);
void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop);
/* Path
@@ -762,7 +790,7 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name);
int RNA_property_is_set(PointerRNA *ptr, const char *name);
/* python compatible string representation of this property, (must be freed!) */
-char *RNA_property_as_string(PointerRNA *ptr, PropertyRNA *prop);
+char *RNA_property_as_string(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop);
char *RNA_pointer_as_string(PointerRNA *ptr);
/* Function */
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index ae9eaba8646..1c6837bbcc8 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -63,6 +63,7 @@ void RNA_def_struct_path_func(StructRNA *srna, const char *path);
void RNA_def_struct_identifier(StructRNA *srna, const char *identifier);
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description);
void RNA_def_struct_ui_icon(StructRNA *srna, int icon);
+void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext);
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna);
/* Compact Property Definitions */
@@ -87,11 +88,15 @@ void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc);
PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
-PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
+PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int len, int rowsize, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
+ /*
+PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *identifier, float hardmin, float hardmax,
+ const char *ui_name, const char *ui_description, float softmin, float softmax, unsigned int dimension, unsigned short dim_size[]);
+ */
PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax,
const char *ui_name, const char *ui_description, float softmin, float softmax);
@@ -122,6 +127,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
void RNA_def_property_flag(PropertyRNA *prop, int flag);
void RNA_def_property_clear_flag(PropertyRNA *prop, int flag);
void RNA_def_property_array(PropertyRNA *prop, int arraylength);
+void RNA_def_property_multidimensional_array(PropertyRNA *prop, int arraylength, unsigned short arraydimension, unsigned short dimsize[]);
void RNA_def_property_range(PropertyRNA *prop, double min, double max);
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item);
@@ -145,6 +151,7 @@ void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive);
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *updatefunc);
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable);
+void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength, const char *setlength);
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set);
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range);
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range);
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index 2592a1340ec..a59fc8716ec 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -29,6 +29,8 @@
/* Types */
+extern EnumPropertyItem object_mode_items[];
+
extern EnumPropertyItem prop_mode_items[];
extern EnumPropertyItem space_type_items[];
extern EnumPropertyItem region_type_items[];
@@ -36,14 +38,24 @@ extern EnumPropertyItem modifier_type_items[];
extern EnumPropertyItem constraint_type_items[];
extern EnumPropertyItem boidrule_type_items[];
+extern EnumPropertyItem beztriple_keyframe_type_items[];
extern EnumPropertyItem beztriple_handle_type_items[];
extern EnumPropertyItem beztriple_interpolation_mode_items[];
+extern EnumPropertyItem keyingset_path_grouping_items[];
+
extern EnumPropertyItem fmodifier_type_items[];
+extern EnumPropertyItem nla_mode_extend_items[];
+extern EnumPropertyItem nla_mode_blend_items[];
+
extern EnumPropertyItem event_value_items[];
extern EnumPropertyItem event_type_items[];
+extern EnumPropertyItem brush_sculpt_tool_items[];
+
+extern EnumPropertyItem unpack_method_items[];
+
#endif /* RNA_ENUM_TYPES */
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index a1e98ae8a17..b57cbc3aa2c 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -66,17 +66,51 @@ typedef enum PropertyType {
PROP_COLLECTION = 6
} PropertyType;
+/* also update rna_property_subtype_unit when you change this */
+typedef enum PropertyUnit {
+ PROP_UNIT_NONE = (0<<16),
+ PROP_UNIT_LENGTH = (1<<16), /* m */
+ PROP_UNIT_AREA = (2<<16), /* m^2 */
+ PROP_UNIT_VOLUME = (3<<16), /* m^3 */
+ PROP_UNIT_MASS = (4<<16), /* kg */
+ PROP_UNIT_ROTATION = (5<<16), /* rad */
+ PROP_UNIT_TIME = (6<<16), /* frame */
+ PROP_UNIT_VELOCITY = (7<<16), /* m/s */
+ PROP_UNIT_ACCELERATION = (8<<16) /* m/(s^2) */
+} PropertyUnit;
+
+#define RNA_SUBTYPE_UNIT(subtype) (subtype & 0x00FF0000)
+#define RNA_SUBTYPE_UNIT_VALUE(subtype) (subtype>>16)
+
+/* also update rna_property_subtypename when you change this */
typedef enum PropertySubType {
PROP_NONE = 0,
- PROP_UNSIGNED = 1,
- PROP_FILEPATH = 2,
- PROP_DIRPATH = 3,
- PROP_COLOR = 4,
- PROP_VECTOR = 5,
- PROP_MATRIX = 6,
- PROP_ROTATION = 7,
- PROP_NEVER_NULL = 8,
- PROP_PERCENTAGE = 9
+
+ /* strings */
+ PROP_FILEPATH = 1,
+ PROP_DIRPATH = 2,
+
+ /* numbers */
+ PROP_UNSIGNED = 13,
+ PROP_PERCENTAGE = 14,
+ PROP_ANGLE = 15|PROP_UNIT_ROTATION,
+ PROP_TIME = 16|PROP_UNIT_TIME,
+ PROP_DISTANCE = 17|PROP_UNIT_LENGTH,
+
+ /* number arrays */
+ PROP_COLOR = 20,
+ PROP_TRANSLATION = 21|PROP_UNIT_LENGTH,
+ PROP_DIRECTION = 22,
+ PROP_VELOCITY = 23|PROP_UNIT_VELOCITY,
+ PROP_ACCELERATION = 24|PROP_UNIT_ACCELERATION,
+ PROP_MATRIX = 25,
+ PROP_EULER = 26|PROP_UNIT_ROTATION,
+ PROP_QUATERNION = 27,
+ PROP_XYZ = 28,
+ PROP_RGB = 29,
+
+ /* pointers */
+ PROP_NEVER_NULL = 30,
} PropertySubType;
typedef enum PropertyFlag {
@@ -118,7 +152,8 @@ typedef enum PropertyFlag {
PROP_IDPROPERTY = 1024,
PROP_RAW_ACCESS = 8192,
PROP_RAW_ARRAY = 16384,
- PROP_FREE_POINTERS = 32768
+ PROP_FREE_POINTERS = 32768,
+ PROP_DYNAMIC = 131072 /* for dynamic arrays, and retvals of type string */
} PropertyFlag;
typedef struct CollectionPropertyIterator {
@@ -141,11 +176,11 @@ typedef struct CollectionPointerLink {
} CollectionPointerLink;
typedef enum RawPropertyType {
- PROP_RAW_CHAR,
+ PROP_RAW_INT, // XXX - abused for types that are not set, eg. MFace.verts, needs fixing.
PROP_RAW_SHORT,
- PROP_RAW_INT,
- PROP_RAW_FLOAT,
- PROP_RAW_DOUBLE
+ PROP_RAW_CHAR,
+ PROP_RAW_DOUBLE,
+ PROP_RAW_FLOAT
} RawPropertyType;
typedef struct RawArray {
@@ -229,7 +264,7 @@ typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_
typedef int (*StructCallbackFunc)(struct PointerRNA *ptr, struct FunctionRNA *func, ParameterList *list);
typedef void (*StructFreeFunc)(void *data);
typedef struct StructRNA *(*StructRegisterFunc)(const struct bContext *C, struct ReportList *reports, void *data,
- StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
+ const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
typedef void (*StructUnregisterFunc)(const struct bContext *C, struct StructRNA *type);
typedef struct StructRNA StructRNA;
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 2aa0fcc79ff..a1f42fbccb3 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -42,6 +42,10 @@ SET(SRC
INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
+IF(WITH_GAMEENGINE)
+ ADD_DEFINITIONS(-DGAMEBLENDER)
+ENDIF(WITH_GAMEENGINE)
+
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
@@ -67,6 +71,22 @@ IF(NOT WITH_ELBEEM)
ADD_DEFINITIONS(-DDISABLE_ELBEEM)
ENDIF(NOT WITH_ELBEEM)
+IF(WITH_FFTW3)
+ ADD_DEFINITIONS(-DFFTW3=1)
+ENDIF(WITH_FFTW3)
+
+IF(WITH_SDL)
+ ADD_DEFINITIONS(-DWITH_SDL)
+ENDIF(WITH_SDL)
+
+IF(WITH_OPENAL)
+ ADD_DEFINITIONS(-DWITH_OPENAL)
+ENDIF(WITH_OPENAL)
+
+IF(WITH_JACK)
+ ADD_DEFINITIONS(-DWITH_JACK)
+ENDIF(WITH_JACK)
+
# Build makesrna executable
ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
TARGET_LINK_LIBRARIES(makesrna bf_dna)
diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile
index c7cc6e7a4bf..4a4e41edd15 100644
--- a/source/blender/makesrna/intern/Makefile
+++ b/source/blender/makesrna/intern/Makefile
@@ -77,6 +77,18 @@ ifeq ($(WITH_QUICKTIME), true)
CPPFLAGS += -DWITH_QUICKTIME
endif
+ifeq ($(WITH_SDL),true)
+ CPPFLAGS += -DWITH_SDL
+endif
+
+ifeq ($(WITH_JACK),true)
+ CPPFLAGS += -DWITH_JACK
+endif
+
+ifeq ($(WITH_OPENAL),true)
+ CPPFLAGS += -DWITH_OPENAL
+endif
+
ifeq ($(OS),windows)
# Windows needs these extra libs because of winstuff... It is not
# _really_ needed, but it is the easiest fix for now. If you have
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index 6c8038bd509..a24c25b8b95 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -58,6 +58,18 @@ if env['WITH_BF_LCMS']:
if env['WITH_BF_GAMEENGINE']:
defs.append('GAMEBLENDER=1')
+
+if env['WITH_BF_FFTW3']:
+ defs.append('FFTW3=1')
+
+if env['WITH_BF_SDL']:
+ defs.append('WITH_SDL')
+
+if env['WITH_BF_OPENAL']:
+ defs.append('WITH_OPENAL')
+
+if env['WITH_BF_JACK']:
+ defs.append('WITH_JACK')
makesrna_tool.Append(CPPDEFINES=defs)
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 0b7fa0e4634..bb7b6cbcd37 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1198,7 +1198,13 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
dparm= dfunc->cont.properties.first;
for(; dparm; dparm= dparm->next) {
- ptrstr= (dparm->prop->type == PROP_POINTER || dparm->prop->arraylength > 0)? "*" : "";
+ if(dparm->prop->arraylength > 0)
+ ptrstr= "*";
+ else if(dparm->prop==func->ret)
+ ptrstr= ((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR))? "*": "";
+ else
+ ptrstr= (dparm->prop->type == PROP_POINTER)? "*": "";
+
fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
}
@@ -1274,7 +1280,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
if(func->ret) {
dparm= rna_find_parameter_def(func->ret);
- ptrstr= dparm->prop->type == PROP_POINTER || dparm->prop->arraylength > 0 ? "*" : "";
+ ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraylength > 0))? "*": "";
fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, func->ret->identifier);
}
}
@@ -1370,15 +1376,48 @@ static const char *rna_property_subtypename(PropertyType type)
{
switch(type) {
case PROP_NONE: return "PROP_NONE";
- case PROP_UNSIGNED: return "PROP_UNSIGNED";
case PROP_FILEPATH: return "PROP_FILEPATH";
case PROP_DIRPATH: return "PROP_DIRPATH";
+ case PROP_UNSIGNED: return "PROP_UNSIGNED";
+ case PROP_PERCENTAGE: return "PROP_PERCENTAGE";
+ case PROP_ANGLE: return "PROP_ANGLE";
+ case PROP_TIME: return "PROP_TIME";
+ case PROP_DISTANCE: return "PROP_DISTANCE";
case PROP_COLOR: return "PROP_COLOR";
- case PROP_VECTOR: return "PROP_VECTOR";
+ case PROP_TRANSLATION: return "PROP_TRANSLATION";
+ case PROP_DIRECTION: return "PROP_DIRECTION";
case PROP_MATRIX: return "PROP_MATRIX";
- case PROP_ROTATION: return "PROP_ROTATION";
+ case PROP_EULER: return "PROP_EULER";
+ case PROP_QUATERNION: return "PROP_QUATERNION";
+ case PROP_VELOCITY: return "PROP_VELOCITY";
+ case PROP_ACCELERATION: return "PROP_ACCELERATION";
+ case PROP_XYZ: return "PROP_XYZ";
+ case PROP_RGB: return "PROP_RGB";
case PROP_NEVER_NULL: return "PROP_NEVER_NULL";
- case PROP_PERCENTAGE: return "PROP_PERCENTAGE";
+ default: {
+ /* incase we dont have a type preset that includes the subtype */
+ if(RNA_SUBTYPE_UNIT(type)) {
+ return rna_property_subtypename(type & ~RNA_SUBTYPE_UNIT(type));
+ }
+ else {
+ return "PROP_SUBTYPE_UNKNOWN";
+ }
+ }
+ }
+}
+
+static const char *rna_property_subtype_unit(PropertyType type)
+{
+ switch(RNA_SUBTYPE_UNIT(type)) {
+ case PROP_UNIT_NONE: return "PROP_UNIT_NONE";
+ case PROP_UNIT_LENGTH: return "PROP_UNIT_LENGTH";
+ case PROP_UNIT_AREA: return "PROP_UNIT_AREA";
+ case PROP_UNIT_VOLUME: return "PROP_UNIT_VOLUME";
+ case PROP_UNIT_MASS: return "PROP_UNIT_MASS";
+ case PROP_UNIT_ROTATION: return "PROP_UNIT_ROTATION";
+ case PROP_UNIT_TIME: return "PROP_UNIT_TIME";
+ case PROP_UNIT_VELOCITY: return "PROP_UNIT_VELOCITY";
+ case PROP_UNIT_ACCELERATION:return "PROP_UNIT_ACCELERATION";
default: return "PROP_UNKNOWN";
}
}
@@ -1483,7 +1522,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
if(dparm->prop==func->ret) {
if(dparm->prop->arraylength)
fprintf(f, "XXX no array return types yet"); /* XXX not supported */
- else if(dparm->prop->type == PROP_POINTER)
+ else if(dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR))
fprintf(f, "%s%s *", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
else
fprintf(f, "%s%s ", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
@@ -1684,7 +1723,15 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
rna_print_c_string(f, prop->name); fprintf(f, ",\n\t");
rna_print_c_string(f, prop->description); fprintf(f, ",\n\t");
fprintf(f, "%d,\n", prop->icon);
- fprintf(f, "\t%s, %s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), prop->arraylength);
+ fprintf(f, "\t%s, %s|%s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), prop->arraylength);
+ {
+ int i;
+ int tot= sizeof(prop->dimsize) / sizeof(prop->dimsize[0]);
+ fprintf(f, "\t%s, %s, %d, {", rna_function_string(prop->getlength), rna_function_string(prop->setlength), (int)prop->arraydimension);
+ for(i= 0; i < tot; i++) {
+ fprintf(f, i == tot - 1 ? "%d},\n" : "%d, ", (int)prop->dimsize[i]);
+ }
+ }
fprintf(f, "\t%s, %d, %s,\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable));
if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
@@ -1903,7 +1950,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_ID.c", NULL, RNA_def_ID},
{"rna_texture.c", NULL, RNA_def_texture},
{"rna_action.c", NULL, RNA_def_action},
- {"rna_animation.c", NULL, RNA_def_animation},
+ {"rna_animation.c", "rna_animation_api.c", RNA_def_animation},
{"rna_actuator.c", NULL, RNA_def_actuator},
{"rna_armature.c", NULL, RNA_def_armature},
{"rna_boid.c", NULL, RNA_def_boid},
@@ -1917,6 +1964,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_curve.c", NULL, RNA_def_curve},
{"rna_fcurve.c", NULL, RNA_def_fcurve},
{"rna_fluidsim.c", NULL, RNA_def_fluidsim},
+ {"rna_gpencil.c", NULL, RNA_def_gpencil},
{"rna_group.c", NULL, RNA_def_group},
{"rna_image.c", NULL, RNA_def_image},
{"rna_key.c", NULL, RNA_def_key},
@@ -1936,11 +1984,12 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_pose.c", NULL, RNA_def_pose},
{"rna_property.c", NULL, RNA_def_gameproperty},
{"rna_render.c", NULL, RNA_def_render},
- {"rna_scene.c", NULL, RNA_def_scene},
+ {"rna_scene.c", "rna_scene_api.c", RNA_def_scene},
{"rna_screen.c", NULL, RNA_def_screen},
{"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint},
{"rna_sensor.c", NULL, RNA_def_sensor},
{"rna_sequence.c", NULL, RNA_def_sequence},
+ {"rna_smoke.c", NULL, RNA_def_smoke},
{"rna_space.c", NULL, RNA_def_space},
{"rna_text.c", NULL, RNA_def_text},
{"rna_timeline.c", NULL, RNA_def_timeline_marker},
@@ -2193,7 +2242,7 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
fprintf(f, "#include \"RNA_blender.h\"\n");
fprintf(f, "#include \"RNA_types.h\"\n");
- fprintf(f, cpp_classes);
+ fprintf(f, "%s", cpp_classes);
fprintf(f, "/**************** Declarations ****************/\n\n");
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index cf3d59f78a0..f5c6063e892 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -65,6 +65,7 @@ short RNA_type_to_ID_code(StructRNA *type)
if(RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
if(RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
+ if(RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
if(RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
@@ -97,6 +98,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
case ID_BR: return &RNA_Brush;
case ID_CA: return &RNA_Camera;
case ID_CU: return &RNA_Curve;
+ case ID_GD: return &RNA_GreasePencil;
case ID_GR: return &RNA_Group;
case ID_IM: return &RNA_Image;
case ID_KE: return &RNA_Key;
@@ -152,6 +154,30 @@ IDProperty *rna_IDPropertyGroup_idproperties(PointerRNA *ptr, int create)
return ptr->data;
}
+void rna_IDPropertyGroup_unregister(const bContext *C, StructRNA *type)
+{
+ RNA_struct_free(&BLENDER_RNA, type);
+}
+
+StructRNA *rna_IDPropertyGroup_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+{
+ PointerRNA dummyptr;
+
+ /* create dummy pointer */
+ RNA_pointer_create(NULL, &RNA_IDPropertyGroup, NULL, &dummyptr);
+
+ /* validate the python class */
+ if(validate(&dummyptr, data, NULL) != 0)
+ return NULL;
+
+ return RNA_def_struct(&BLENDER_RNA, identifier, "IDPropertyGroup"); // XXX
+}
+
+StructRNA* rna_IDPropertyGroup_refine(PointerRNA *ptr)
+{
+ return ptr->type;
+}
+
#else
static void rna_def_ID_properties(BlenderRNA *brna)
@@ -210,6 +236,8 @@ static void rna_def_ID_properties(BlenderRNA *brna)
srna= RNA_def_struct(brna, "IDPropertyGroup", NULL);
RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties.");
RNA_def_struct_idproperties_func(srna, "rna_IDPropertyGroup_idproperties");
+ RNA_def_struct_register_funcs(srna, "rna_IDPropertyGroup_register", "rna_IDPropertyGroup_unregister");
+ RNA_def_struct_refine_func(srna, "rna_IDPropertyGroup_refine");
}
static void rna_def_ID(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index b0db6ae9de5..e71dcc2a586 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -343,10 +343,11 @@ const char *rna_ensure_property_name(PropertyRNA *prop)
return ((IDProperty*)prop)->name;
}
-int rna_ensure_property_array_length(PropertyRNA *prop)
+int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
{
- if(prop->magic == RNA_MAGIC)
- return prop->arraylength;
+ if(prop->magic == RNA_MAGIC) {
+ return prop->getlength ? prop->getlength(ptr) : prop->arraylength;
+ }
else {
IDProperty *idprop= (IDProperty*)prop;
@@ -539,14 +540,55 @@ PropertySubType RNA_property_subtype(PropertyRNA *prop)
return rna_ensure_property(prop)->subtype;
}
+PropertyUnit RNA_property_unit(PropertyRNA *prop)
+{
+ return RNA_SUBTYPE_UNIT(rna_ensure_property(prop)->subtype);
+}
+
int RNA_property_flag(PropertyRNA *prop)
{
return rna_ensure_property(prop)->flag;
}
-int RNA_property_array_length(PropertyRNA *prop)
+int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
+{
+ return rna_ensure_property_array_length(ptr, prop);
+}
+
+int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length)
+{
+ if (prop->setlength)
+ return prop->setlength(ptr, length);
+ else
+ prop->arraylength= length; /* function parameters only? */
+
+ return 1;
+}
+
+unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dimsize[])
{
- return rna_ensure_property_array_length(prop);
+ if (dimsize && prop->arraydimension > 1) {
+ memcpy(dimsize, prop->dimsize, sizeof(prop->dimsize[0]) * (prop->arraydimension - 1));
+ }
+ return prop->arraydimension;
+}
+
+char RNA_property_array_item_char(PropertyRNA *prop, int index)
+{
+ const char *vectoritem= "XYZW";
+ const char *quatitem= "WXYZ";
+ const char *coloritem= "RGBA";
+ PropertySubType subtype= rna_ensure_property(prop)->subtype;
+
+ /* get string to use for array index */
+ if ((index < 4) && (subtype == PROP_QUATERNION))
+ return quatitem[index];
+ else if((index < 4) && ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
+ return vectoritem[index];
+ else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_RGB))
+ return coloritem[index];
+ else
+ return '\0';
}
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
@@ -1236,8 +1278,15 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
else if(pprop->get) {
return pprop->get(ptr);
}
+ else if(prop->flag & PROP_IDPROPERTY) {
+ /* XXX temporary hack to add it automatically, reading should
+ never do any write ops, to ensure thread safety etc .. */
+ RNA_property_pointer_add(ptr, prop);
+ return RNA_property_pointer_get(ptr, prop);
+ }
else {
PointerRNA result;
+
memset(&result, 0, sizeof(result));
return result;
}
@@ -1375,7 +1424,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
{
IDProperty *idprop;
- //CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
if((idprop=rna_idproperty_check(&prop, ptr))) {
IDPropertyTemplate val = {0};
@@ -1401,7 +1450,6 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
MEM_freeN(item);
}
}
-#if 0
else if(cprop->add){
if(!(cprop->add->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */
ParameterList params;
@@ -1410,9 +1458,8 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
RNA_parameter_list_free(&params);
}
}
-#endif
- else
- printf("RNA_property_collection_add %s.%s: not implemented for this property.\n", ptr->type->identifier, prop->identifier);
+ /*else
+ printf("RNA_property_collection_add %s.%s: not implemented for this property.\n", ptr->type->identifier, prop->identifier);*/
if(r_ptr) {
if(idprop) {
@@ -1427,10 +1474,10 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
}
}
-void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
+int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
{
IDProperty *idprop;
- //CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
if((idprop=rna_idproperty_check(&prop, ptr))) {
IDProperty tmp, *array;
@@ -1449,20 +1496,25 @@ void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
IDP_ResizeIDPArray(idprop, len-1);
}
+
+ return 1;
}
- else if(prop->flag & PROP_IDPROPERTY);
-#if 0
+ else if(prop->flag & PROP_IDPROPERTY)
+ return 1;
else if(cprop->remove){
if(!(cprop->remove->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */
ParameterList params;
- RNA_parameter_list_create(&ptr, cprop->remove);
+ RNA_parameter_list_create(&params, ptr, cprop->remove);
RNA_function_call(NULL, NULL, ptr, cprop->remove, &params);
RNA_parameter_list_free(&params);
}
+
+ return 0;
}
-#endif
- else
- printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
+ /*else
+ printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);*/
+
+ return 0;
}
void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop)
@@ -1651,7 +1703,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
}
/* check item array */
- itemlen= RNA_property_array_length(itemprop);
+ itemlen= RNA_property_array_length(&itemptr, itemprop);
/* try to access as raw array */
if(RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
@@ -1703,7 +1755,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
iprop= RNA_struct_find_property(&itemptr, propname);
if(iprop) {
- itemlen= RNA_property_array_length(iprop);
+ itemlen= RNA_property_array_length(&itemptr, iprop);
itemtype= RNA_property_type(iprop);
}
else {
@@ -1966,9 +2018,10 @@ void rna_iterator_array_end(CollectionPropertyIterator *iter)
{
ArrayIterator *internal= iter->internal;
- if(internal->free_ptr)
+ if(internal->free_ptr) {
MEM_freeN(internal->free_ptr);
-
+ internal->free_ptr= NULL;
+ }
MEM_freeN(iter->internal);
iter->internal= NULL;
}
@@ -2624,7 +2677,7 @@ char *RNA_pointer_as_string(PointerRNA *ptr)
BLI_dynstr_append(dynstr, ", ");
first_time= 0;
- cstring = RNA_property_as_string(ptr, prop);
+ cstring = RNA_property_as_string(NULL, ptr, prop);
BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring);
MEM_freeN(cstring);
}
@@ -2638,10 +2691,10 @@ char *RNA_pointer_as_string(PointerRNA *ptr)
return cstring;
}
-char *RNA_property_as_string(PointerRNA *ptr, PropertyRNA *prop)
+char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
{
int type = RNA_property_type(prop);
- int len = RNA_property_array_length(prop);
+ int len = RNA_property_array_length(ptr, prop);
int i;
DynStr *dynstr= BLI_dynstr_new();
@@ -2707,7 +2760,7 @@ char *RNA_property_as_string(PointerRNA *ptr, PropertyRNA *prop)
const char *identifier;
int val = RNA_property_enum_get(ptr, prop);
- if(RNA_property_enum_identifier(NULL, ptr, prop, val, &identifier)) {
+ if(RNA_property_enum_identifier(C, ptr, prop, val, &identifier)) {
BLI_dynstr_appendf(dynstr, "'%s'", identifier);
}
else {
@@ -2810,8 +2863,10 @@ const struct ListBase *RNA_function_defined_parameters(FunctionRNA *func)
ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, FunctionRNA *func)
{
PropertyRNA *parm;
- int tot= 0;
+ void *data;
+ int tot= 0, size;
+ /* allocate data */
for(parm= func->cont.properties.first; parm; parm= parm->next)
tot+= rna_parameter_size(parm);
@@ -2819,6 +2874,44 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr,
parms->func= func;
parms->tot= tot;
+ /* set default values */
+ data= parms->data;
+
+ for(parm= func->cont.properties.first; parm; parm= parm->next) {
+ size= rna_parameter_size(parm);
+
+ if(!(parm->flag & PROP_REQUIRED)) {
+ switch(parm->type) {
+ case PROP_BOOLEAN:
+ if(parm->arraylength) memcpy(data, &((BooleanPropertyRNA*)parm)->defaultarray, size);
+ else memcpy(data, &((BooleanPropertyRNA*)parm)->defaultvalue, size);
+ break;
+ case PROP_INT:
+ if(parm->arraylength) memcpy(data, &((IntPropertyRNA*)parm)->defaultarray, size);
+ else memcpy(data, &((IntPropertyRNA*)parm)->defaultvalue, size);
+ break;
+ case PROP_FLOAT:
+ if(parm->arraylength) memcpy(data, &((FloatPropertyRNA*)parm)->defaultarray, size);
+ else memcpy(data, &((FloatPropertyRNA*)parm)->defaultvalue, size);
+ break;
+ case PROP_ENUM:
+ memcpy(data, &((EnumPropertyRNA*)parm)->defaultvalue, size);
+ break;
+ case PROP_STRING: {
+ const char *defvalue= ((StringPropertyRNA*)parm)->defaultvalue;
+ if(defvalue && defvalue[0])
+ memcpy(data, &defvalue, size);
+ break;
+ }
+ case PROP_POINTER:
+ case PROP_COLLECTION:
+ break;
+ }
+ }
+
+ data= ((char*)data) + size;
+ }
+
return parms;
}
@@ -2831,6 +2924,12 @@ void RNA_parameter_list_free(ParameterList *parms)
for(tot= 0; parm; parm= parm->next) {
if(parm->type == PROP_COLLECTION)
BLI_freelistN((ListBase*)((char*)parms->data+tot));
+ else if (parm->flag & PROP_DYNAMIC) {
+ /* for dynamic arrays and strings, data is a pointer to an array */
+ char *array= *(char**)((char*)parms->data+tot);
+ if(array)
+ MEM_freeN(array);
+ }
tot+= rna_parameter_size(parm);
}
@@ -3203,7 +3302,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
type= RNA_property_type(parm);
ftype= format[ofs++];
- len= RNA_property_array_length(parm);
+ len= RNA_property_array_length(&funcptr, parm);
alen= rna_function_format_array_length(format, ofs, flen);
if (len!=alen) {
@@ -3268,7 +3367,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
type= RNA_property_type(parm);
ftype= format[ofs++];
- len= RNA_property_array_length(parm);
+ len= RNA_property_array_length(&funcptr, parm);
alen= rna_function_format_array_length(format, ofs, flen);
if (len!=alen) {
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 3639d6d3fff..e376d3125e3 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -42,15 +42,15 @@ void rna_def_action_group(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
+
srna= RNA_def_struct(brna, "ActionGroup", NULL);
RNA_def_struct_sdna(srna, "bActionGroup");
RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves.");
-
+
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
-
+
/* dna warns not to treat the Action Channel listbase in the Action Group struct like a
normal listbase. I'll leave this here but comment out, for Joshua to review. He can
probably shed some more light on why this is */
@@ -58,19 +58,19 @@ void rna_def_action_group(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "channels", NULL);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group.");*/
-
+
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "Action Group is selected.");
-
+
prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "Action Group is locked.");
-
+
prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded.");
-
+
prop= RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "customCol");
RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set.");
@@ -85,17 +85,17 @@ void rna_def_action(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation.");
RNA_def_struct_ui_icon(srna, ICON_ACTION);
-
+
prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "curves", NULL);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action.");
-
+
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "groups", NULL);
RNA_def_property_struct_type(prop, "ActionGroup");
RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves.");
-
+
prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
RNA_def_property_struct_type(prop, "TimelineMarker");
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 3eb88e706e9..473e726db60 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -51,8 +51,7 @@ void RNA_def_actuator(BlenderRNA *brna)
{ACT_SCENE, "SCENE", 0, "Scene", ""},
{ACT_RANDOM, "RANDOM", 0, "Random", ""},
{ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
- {ACT_ACTION, "ACTION", 0, "Action", ""},
- {ACT_CD, "CD", 0, "CD", ""},
+ {ACT_ACTION, "ACTION", 0, "Action", ""},
{ACT_GAME, "GAME", 0, "Game", ""},
{ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
{ACT_2DFILTER, "FILTER_2D", 0, "2D Filter", ""},
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 3469d716853..e4bea893992 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * Contributor(s): Blender Foundation (2008), Roland Hess
+ * Contributor(s): Blender Foundation (2009), Joshua Leung
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -26,6 +26,7 @@
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -35,8 +36,27 @@
#include "MEM_guardedalloc.h"
+/* exported for use in API */
+EnumPropertyItem keyingset_path_grouping_items[] = {
+ {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""},
+ {KSP_GROUP_NONE, "NONE", 0, "None", ""},
+ {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""},
+ {KSP_GROUP_TEMPLATE_ITEM, "TEMPLATE", 0, "Innermost Context-Item Name", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
+static int rna_AnimData_action_editable(PointerRNA *ptr)
+{
+ AnimData *adt= (AnimData *)ptr->data;
+
+ /* active action is only editable when it is not a tweaking strip */
+ if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact))
+ return 0;
+ else
+ return 1;
+}
+
static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value)
{
KS_Path *ksp= (KS_Path *)ptr->data;
@@ -78,13 +98,6 @@ void rna_def_keyingset_path(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_mode_grouping_items[] = {
- {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""},
- {KSP_GROUP_NONE, "NONE", 0, "None", ""},
- {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""},
- {KSP_GROUP_TEMPLATE_ITEM, "TEMPLATE", 0, "Innermost Context-Item Name", ""},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "KeyingSetPath", NULL);
RNA_def_struct_sdna(srna, "KS_Path");
RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set.");
@@ -100,7 +113,7 @@ void rna_def_keyingset_path(BlenderRNA *brna)
/* Grouping */
prop= RNA_def_property(srna, "grouping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "groupmode");
- RNA_def_property_enum_items(prop, prop_mode_grouping_items);
+ RNA_def_property_enum_items(prop, keyingset_path_grouping_items);
RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use.");
/* Path + Array Index */
@@ -144,7 +157,6 @@ void rna_def_keyingset(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_BUILTIN);
RNA_def_property_ui_text(prop, "Built-In", "Keying Set is a built-in to Blender.");
- /* TODO: for now, this is editable, but do we really want this to happen? */
prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE);
RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
@@ -158,7 +170,8 @@ void rna_def_keyingset(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_MATRIX);
RNA_def_property_ui_text(prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
-
+ /* Keying Set API */
+ RNA_api_keyingset(srna);
}
/* --- */
@@ -187,9 +200,27 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "NlaTrack");
RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers).");
- /* Action */
+ /* Active Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
- RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock.");
+ RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock.");
+ RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
+
+ /* Active Action Settings */
+ prop= RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "act_extendmode");
+ RNA_def_property_enum_items(prop, nla_mode_extend_items);
+ RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA).");
+
+ prop= RNA_def_property(srna, "action_blending", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
+ RNA_def_property_enum_items(prop, nla_mode_blend_items);
+ RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack.");
+
+ prop= RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "act_influence");
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Action Influence", "Amount the Active Action contributes to the result of the NLA stack.");
/* Drivers */
prop= RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
@@ -197,7 +228,10 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock.");
- /* Settings */
+ /* General Settings */
+ prop= RNA_def_property(srna, "nla_enabled", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF);
+ RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block.");
}
/* --- */
diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c
new file mode 100644
index 00000000000..6af87335e02
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_animation_api.c
@@ -0,0 +1,89 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+#include "RNA_types.h"
+
+#include "DNA_anim_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_animsys.h"
+
+static void rna_KeyingSet_add_destination(KeyingSet *keyingset, ReportList *reports,
+ ID *id, char rna_path[], int array_index, int entire_array,
+ int grouping_method, char group_name[])
+{
+ short flag = 0;
+
+ /* validate flags */
+ if (entire_array)
+ flag |= KSP_FLAG_WHOLE_ARRAY;
+
+ /* if data is valid, call the API function for this */
+ if (keyingset) {
+ BKE_keyingset_add_destination(keyingset, id, group_name, rna_path, array_index, flag, grouping_method);
+ }
+ else {
+ BKE_report(reports, RPT_ERROR, "Keying Set Destination could not be added.");
+ }
+}
+
+#else
+
+void RNA_api_keyingset(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ /* Add Destination */
+ func= RNA_def_function(srna, "add_destination", "rna_KeyingSet_add_destination");
+ RNA_def_function_ui_description(func, "Add a new destination for the Keying Set.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ /* ID-block for target */
+ parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* rna-path */
+ parm= RNA_def_string(func, "rna_path", "", 256, "RNA-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm=RNA_def_int(func, "array_index", 0, 0, INT_MAX, "Array Index", "If applicable, the index ", 0, INT_MAX);
+ /* flags */
+ parm=RNA_def_boolean(func, "entire_array", 1, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used.");
+ /* grouping */
+ parm=RNA_def_enum(func, "grouping_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use.");
+ parm=RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name).");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index cf20e92b289..7bab7947843 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -495,13 +495,13 @@ static void rna_def_edit_bone(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Roll", "Bone rotation around head-tail axis.");
RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
- prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "head");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone.");
RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
- prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "tail");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone.");
@@ -708,13 +708,13 @@ void rna_def_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skining method).");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "ghost_start_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "ghost_start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghostsf");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Ghosting Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method).");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "ghost_end_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "ghost_end_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghostef");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "Ghosting End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method).");
@@ -727,13 +727,13 @@ void rna_def_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Paths Frame Step", "Number of frames between 'dots' on Bone Paths (when drawing).");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "pathsf");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations.");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "pathef");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 2bb4333365b..9c453ac44df 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -32,6 +32,19 @@
#include "DNA_brush_types.h"
#include "DNA_texture_types.h"
+#include "IMB_imbuf.h"
+
+EnumPropertyItem brush_sculpt_tool_items[] = {
+ {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
+ {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""},
+ {SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", ""},
+ {SCULPT_TOOL_INFLATE, "INFLATE", 0, "Inflate", ""},
+ {SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", ""},
+ {SCULPT_TOOL_LAYER, "LAYER", 0, "Layer", ""},
+ {SCULPT_TOOL_FLATTEN, "FLATTEN", 0, "Flatten", ""},
+ {SCULPT_TOOL_CLAY, "CLAY", 0, "Clay", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -74,52 +87,24 @@ static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value)
}
}
-static float rna_Brush_rotation_get(PointerRNA *ptr)
-{
- Brush *brush= (Brush*)ptr->data;
- const float conv = 57.295779506;
- return brush->rot * conv;
-}
-
-static void rna_Brush_rotation_set(PointerRNA *ptr, float v)
-{
- Brush *brush= (Brush*)ptr->data;
- const float conv = 0.017453293;
- brush->rot = v * conv;
-}
-
#else
void rna_def_brush(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+
static EnumPropertyItem prop_blend_items[] = {
- {BRUSH_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting."},
- {BRUSH_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting."},
- {BRUSH_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending mode while painting."},
- {BRUSH_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending mode while painting."},
- {BRUSH_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."},
- {BRUSH_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken blending mode while painting."},
- {BRUSH_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."},
- {BRUSH_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."},
- {0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_texture_mode_items[] = {
- {BRUSH_TEX_DRAG, "TEX_DRAG", 0, "Drag", ""},
- {BRUSH_TEX_TILE, "TEX_TILE", 0, "Tile", ""},
- {BRUSH_TEX_3D, "TEX_3D", 0, "3D", ""},
+ {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting."},
+ {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting."},
+ {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending mode while painting."},
+ {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending mode while painting."},
+ {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."},
+ {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken blending mode while painting."},
+ {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."},
+ {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_sculpt_tool_items[] = {
- {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
- {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""},
- {SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", ""},
- {SCULPT_TOOL_INFLATE, "INFLATE", 0, "Inflate", ""},
- {SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", ""},
- {SCULPT_TOOL_LAYER, "LAYER", 0, "Layer", ""},
- {SCULPT_TOOL_FLATTEN, "FLATTEN", 0, "Flatten", ""},
- {SCULPT_TOOL_CLAY, "CLAY", 0, "Clay", ""},
- {0, NULL, 0, NULL, NULL}};
-
+
srna= RNA_def_struct(brna, "Brush", "ID");
RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting.");
RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
@@ -129,13 +114,8 @@ void rna_def_brush(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_blend_items);
RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode.");
- prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "tex_mode");
- RNA_def_property_enum_items(prop, prop_texture_mode_items);
- RNA_def_property_ui_text(prop, "Texture Mode", "");
-
prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_sculpt_tool_items);
+ RNA_def_property_enum_items(prop, brush_sculpt_tool_items);
RNA_def_property_ui_text(prop, "Sculpt Tool", "");
/* number values */
@@ -152,6 +132,14 @@ void rna_def_brush(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 1.0f, 100.0f);
RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush stamps.");
+
+ prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 10, 200);
+ RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues.");
+
+ prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.5, 0.99);
+ RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke.");
prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rate");
@@ -167,12 +155,6 @@ void rna_def_brush(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Strength", "The amount of pressure on the brush.");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "rot");
- RNA_def_property_range(prop, 0, 360);
- RNA_def_property_float_funcs(prop, "rna_Brush_rotation_get", "rna_Brush_rotation_set", NULL);
- RNA_def_property_ui_text(prop, "Rotation", "Angle of the brush texture.");
-
/* flag */
prop= RNA_def_property(srna, "airbrush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
@@ -182,9 +164,9 @@ void rna_def_brush(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting.");
- prop= RNA_def_property(srna, "opacity_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "strength_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
- RNA_def_property_ui_text(prop, "Opacity Pressure", "Enable tablet pressure sensitivity for opacity.");
+ RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength.");
prop= RNA_def_property(srna, "size_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
@@ -217,6 +199,10 @@ void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path.");
+
+ prop= RNA_def_property(srna, "persistent", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT);
+ RNA_def_property_ui_text(prop, "Persistent", "Sculpts on a persistent layer of the mesh.");
/* not exposed in the interface yet
prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE);
@@ -241,7 +227,7 @@ void rna_def_brush(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clone Opacity", "Opacity of clone image display.");
- prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "clone.offset");
RNA_def_property_ui_text(prop, "Clone Offset", "");
RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3);
@@ -266,12 +252,12 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
srna= RNA_def_struct(brna, "OperatorStrokeElement", "IDPropertyGroup");
RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location", "");
- prop= RNA_def_property(srna, "mouse", PROP_INT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Mouse", "");
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 11443ddfde1..9096bfc2844 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -218,7 +218,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices.");
RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update");
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -100.0, 100.0);
RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL);
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index f4248d18db3..420add2622a 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -130,7 +130,7 @@ static void rna_def_curvemappoint(BlenderRNA *brna)
/* not editable for now, need to have CurveMapping to do curvemapping_changed */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 2);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index d84d6f159d8..a8dc0454cef 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -141,7 +141,21 @@ StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
static char *rna_Constraint_path(PointerRNA *ptr)
{
- return BLI_sprintfN("constraints[%s]", ((bConstraint*)ptr->data)->name);
+ Object *ob= ptr->id.data;
+ bConstraint *con= ptr->data;
+ bPoseChannel *pchan= get_active_posechannel(ob);
+ ListBase *actlist= get_active_constraints(ob);
+ short inList = 0;
+
+ /* check if constraint is in the given list */
+ if (actlist)
+ inList= (BLI_findindex(actlist, con) != -1);
+
+ /* if constraint is in the list, the list is for the active bone... */
+ if ((inList) && (actlist != &ob->constraints) && (pchan))
+ return BLI_sprintfN("pose.pose_channels[\"%s\"].constraints[\"%s\"]", pchan->name, con->name);
+ else
+ return BLI_sprintfN("constraints[\"%s\"]", con->name);
}
static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
@@ -402,7 +416,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pole Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE); // XXX - todo, convert to rad
RNA_def_property_float_sdna(prop, NULL, "poleangle");
RNA_def_property_range(prop, 0.0, 180.f);
RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset.");
@@ -662,7 +676,7 @@ static void rna_def_constraint_minmax(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object center.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -754,13 +768,13 @@ static void rna_def_constraint_action(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use.");
@@ -857,7 +871,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset", PROP_INT, PROP_TIME);
RNA_def_property_range(prop, -300000.0, 300000.f);
RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -906,6 +920,11 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Target", "Target Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "subtarget");
+ RNA_def_property_ui_text(prop, "Sub-Target", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "volmode");
@@ -919,7 +938,7 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Keep Axis", "Axis to maintain during stretch.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "original_length", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "original_length", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "orglength");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Original Length", "Length at rest position.");
@@ -964,37 +983,37 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pivot Type", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "pivX");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot X", "Offset pivot on X.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "pivY");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot Y", "Offset pivot on Y.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "pivZ");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Pivot Z", "Offset pivot on Z.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_ANGLE); // XXX - convert to radians
RNA_def_property_float_sdna(prop, NULL, "axX");
RNA_def_property_range(prop, -360.0, 360.f);
RNA_def_property_ui_text(prop, "Axis X", "Rotate pivot on X axis in degrees.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_ANGLE); // XXX - convert to radians
RNA_def_property_float_sdna(prop, NULL, "axY");
RNA_def_property_range(prop, -360.0, 360.f);
RNA_def_property_ui_text(prop, "Axis Y", "Rotate pivot on Y axis in degrees.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_ANGLE); // XXX - convert to radians
RNA_def_property_float_sdna(prop, NULL, "axZ");
RNA_def_property_range(prop, -360.0, 360.f);
RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis in degrees.");
@@ -1116,73 +1135,73 @@ static void rna_def_constraint_transform(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_min[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_min[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_min[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_max[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_max[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "from_max[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_min[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_min[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_min[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_max[0]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_max[1]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "to_max[2]");
RNA_def_property_range(prop, 0.0, 1000.f);
RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion.");
@@ -1228,37 +1247,37 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
@@ -1294,37 +1313,37 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "xmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "ymin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "zmin");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "xmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "ymax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "zmax");
RNA_def_property_range(prop, -1000.0, 1000.f);
RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
@@ -1443,7 +1462,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sub-Target", "");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere.");
@@ -1483,7 +1502,7 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Selects type of shrinkwrap algorithm for target position");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0, 100.f);
RNA_def_property_ui_text(prop, "Distance", "Distance to Target.");
diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c
index 5e164c6525f..7239fc1ff3d 100644
--- a/source/blender/makesrna/intern/rna_context.c
+++ b/source/blender/makesrna/intern/rna_context.c
@@ -31,10 +31,10 @@
#include "RNA_define.h"
#include "RNA_types.h"
-#ifdef RNA_RUNTIME
-
#include "BKE_context.h"
+#ifdef RNA_RUNTIME
+
static PointerRNA rna_Context_manager_get(PointerRNA *ptr)
{
bContext *C= (bContext*)ptr->data;
@@ -110,6 +110,12 @@ static PointerRNA rna_Context_user_preferences_get(PointerRNA *ptr)
return newptr;
}
+static int rna_Context_mode_get(PointerRNA *ptr)
+{
+ bContext *C= (bContext*)ptr->data;
+ return CTX_data_mode_enum(C);
+}
+
#else
void RNA_def_context(BlenderRNA *brna)
@@ -117,6 +123,23 @@ void RNA_def_context(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ static EnumPropertyItem mode_items[] = {
+ {CTX_MODE_EDIT_MESH, "EDIT_MESH", 0, "Mesh Edit", ""},
+ {CTX_MODE_EDIT_CURVE, "EDIT_CURVE", 0, "Curve Edit", ""},
+ {CTX_MODE_EDIT_SURFACE, "EDIT_SURFACE", 0, "Surface Edit", ""},
+ {CTX_MODE_EDIT_TEXT, "EDIT_TEXT", 0, "Edit Edit", ""},
+ {CTX_MODE_EDIT_ARMATURE, "EDIT_ARMATURE", 0, "Armature Edit", ""}, // PARSKEL reuse will give issues
+ {CTX_MODE_EDIT_METABALL, "EDIT_METABALL", 0, "Metaball Edit", ""},
+ {CTX_MODE_EDIT_LATTICE, "EDIT_LATTICE", 0, "Lattice Edit", ""},
+ {CTX_MODE_POSE, "POSE", 0, "Pose ", ""},
+ {CTX_MODE_SCULPT, "SCULPT", 0, "Sculpt", ""},
+ {CTX_MODE_PAINT_WEIGHT, "PAINT_WEIGHT", 0, "Weight Paint", ""},
+ {CTX_MODE_PAINT_VERTEX, "PAINT_VERTEX", 0, "Vertex Paint", ""},
+ {CTX_MODE_PAINT_TEXTURE, "PAINT_TEXTURE", 0, "Texture Paint", ""},
+ {CTX_MODE_PARTICLE, "PARTICLE", 0, "Particle", ""},
+ {CTX_MODE_OBJECT, "OBJECT", 0, "Object", ""},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "Context", NULL);
RNA_def_struct_ui_text(srna, "Context", "Current windowmanager and data context.");
RNA_def_struct_sdna(srna, "bContext");
@@ -177,6 +200,11 @@ void RNA_def_context(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "UserPreferences");
RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL);
+
+ prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, mode_items);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_enum_funcs(prop, "rna_Context_mode_get", NULL, NULL);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index faf6c3a1f75..503ca031fb6 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -33,6 +33,8 @@
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
+#include "BKE_font.h"
+
EnumPropertyItem beztriple_handle_type_items[] = {
{HD_FREE, "FREE", 0, "Free", ""},
{HD_AUTO, "AUTO", 0, "Auto", ""},
@@ -46,12 +48,22 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = {
{BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""},
{BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
{0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem beztriple_keyframe_type_items[] = {
+ {BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""},
+ {BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""},
+ {0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
#include "DNA_object_types.h"
#include "BKE_curve.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
StructRNA *rna_Curve_refine(PointerRNA *ptr)
{
@@ -142,6 +154,25 @@ static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA
rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint*), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
}
+static void rna_Curve_update_data(bContext *C, PointerRNA *ptr)
+{
+ Main *bmain= CTX_data_main(C);
+ Scene *scene= CTX_data_scene(C);
+ Curve *cu= ptr->id.data;
+ Object *ob;
+
+ if (cu == NULL)
+ return;
+
+ for(ob=bmain->object.first; ob; ob= ob->id.next) {
+ if(ob->data == cu) {
+ /* XXX this will loop over all objects again (slow) */
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
+ }
+ }
+}
+
#else
static void rna_def_bpoint(BlenderRNA *brna)
@@ -157,32 +188,38 @@ static void rna_def_bpoint(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Selected", "Selection status");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Vector value */
- prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 4);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Number values */
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alfa");
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3d View");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
/*RNA_def_property_range(prop, 0.0f, 1.0f);*/
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_beztriple(BlenderRNA *brna)
@@ -198,67 +235,85 @@ static void rna_def_beztriple(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected_handle1", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "selected_handle2", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "selected_control_point", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
RNA_def_property_ui_text(prop, "Control Point selected", "Control point selection status");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
RNA_def_property_ui_text(prop, "Hidden", "Visibility status");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Enums */
prop= RNA_def_property(srna, "handle1_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h1");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "handle2_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h2");
RNA_def_property_enum_items(prop, beztriple_handle_type_items);
RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipo");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
RNA_def_property_ui_text(prop, "Interpolation", "(For F-Curves Only) Interpolation to use for segment of curve starting from current BezTriple.");
+ //RNA_def_property_update(prop, 0, "rna_Curve_update_data"); // this should be an F-Curve update call instead...
+
+ prop= RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "hide");
+ RNA_def_property_enum_items(prop, beztriple_keyframe_type_items);
+ RNA_def_property_ui_text(prop, "Keyframe Type", "(For F-Curves only) The type of keyframe this control point defines.");
+ //RNA_def_property_update(prop, 0, "rna_Curve_update_data"); // this should be an F-Curve update call instead...
/* Vector values */
- prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle1_get", "rna_BezTriple_handle1_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "control_point", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "control_point", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_ctrlpoint_get", "rna_BezTriple_ctrlpoint_set", NULL);
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "handle2", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "handle2", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_BezTriple_handle2_get", "rna_BezTriple_handle2_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Number values */
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alfa");
/*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/
RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3d View");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01f, 100.0f);
RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "bevel_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
/*RNA_def_property_range(prop, 0.0f, 1.0f);*/
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_path(BlenderRNA *brna, StructRNA *srna)
@@ -270,23 +325,28 @@ static void rna_def_path(BlenderRNA *brna, StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "pathlen");
RNA_def_property_range(prop, 1, 32767);
RNA_def_property_ui_text(prop, "Path Length", "If no speed IPO was set, the length of path in frames.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* flags */
prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH);
RNA_def_property_ui_text(prop, "Path", "Enable the curve to become a translation path.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "follow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FOLLOW);
RNA_def_property_ui_text(prop, "Follow", "Make curve path children to rotate along the path.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: makes deformed child to stretch along entire path.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "offset_path_distance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_OFFS_PATHDIST);
RNA_def_property_ui_text(prop, "Offset Path Distance", "Children will use TimeOffs value as path distance offset.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna)
@@ -297,10 +357,12 @@ static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna)
prop= RNA_def_property(srna, "uv_orco", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
RNA_def_property_ui_text(prop, "UV Orco", "Forces to use UV coordinates for texture mapping 'orco'.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_NOPUNOFLIP);
RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
@@ -319,62 +381,74 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
prop= RNA_def_property(srna, "spacemode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_align_items);
RNA_def_property_ui_text(prop, "Text Align", "Text align from the object center.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* number values */
prop= RNA_def_property(srna, "text_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fsize");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Font size", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "line_dist", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "linedist");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Distance between lines of text", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "word_spacing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wordspace");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Spacing between words", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Global spacing between characters", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shear");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object center");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object center");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "ul_position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulpos");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline position", "Vertical position of underline");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "ul_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ulheight");
RNA_def_property_range(prop, -0.2f, 0.8f);
RNA_def_property_ui_text(prop, "Underline thickness", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "actbox");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "The active text box", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* strings */
prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
RNA_def_property_string_maxlength(prop, 21);
RNA_def_property_ui_text(prop, "Family", "Blender uses font from selfmade objects.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "str", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "str");
@@ -388,23 +462,28 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vfont");
RNA_def_property_ui_text(prop, "Font", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "textbox", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tb");
RNA_def_property_ui_text(prop, "Textbox", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "edit_format", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curinfo");
RNA_def_property_ui_text(prop, "Edit Format", "Editing settings character formatting.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* flags */
prop= RNA_def_property(srna, "fast", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST);
RNA_def_property_ui_text(prop, "Fast", "Don't fill polygons while editing.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_textbox(BlenderRNA *brna)
@@ -420,21 +499,25 @@ static void rna_def_textbox(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox X Offset", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "y");
RNA_def_property_range(prop, -50.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Y Offset", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "w");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Width", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "h");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Textbox Height", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_charinfo(BlenderRNA *brna)
@@ -450,22 +533,27 @@ static void rna_def_charinfo(BlenderRNA *brna)
prop= RNA_def_property(srna, "style", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STYLE);
RNA_def_property_ui_text(prop, "Style", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "bold", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BOLD);
RNA_def_property_ui_text(prop, "Bold", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "italic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_ITALIC);
RNA_def_property_ui_text(prop, "Italic", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "underline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UNDERLINE);
RNA_def_property_ui_text(prop, "Underline", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_WRAP);
RNA_def_property_ui_text(prop, "Wrap", "");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_surface(BlenderRNA *brna)
@@ -523,31 +611,37 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 32);
RNA_def_property_ui_range(prop, 0, 32, 1.0, 0);
RNA_def_property_ui_text(prop, "Bevel Resolution", "Bevel resolution when depth is non-zero and no specific bevel object has been defined.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "width");
RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 0);
RNA_def_property_ui_text(prop, "Width", "Scale the original width (1.0) based on given factor.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ext1");
RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 0);
RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ext2");
RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 0);
RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu");
RNA_def_property_ui_range(prop, 1, 1024, 1, 0);
RNA_def_property_ui_text(prop, "Resolution U", "Surface resolution in U direction.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv");
RNA_def_property_ui_range(prop, 1, 1024, 1, 0);
RNA_def_property_ui_text(prop, "Resolution V", "Surface resolution in V direction.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
@@ -563,34 +657,41 @@ static void rna_def_curve(BlenderRNA *brna)
prop= RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ctime");
RNA_def_property_ui_text(prop, "Evaluation Time", "Parametric position along the length of the curve that Objects 'following' it should be at.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* pointers */
prop= RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bevobj");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "taperobj");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width).");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Flags */
prop= RNA_def_property(srna, "curve_2d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_3D);
RNA_def_property_ui_text(prop, "2D Curve", "Define curve in two dimensions only. Note that fill only works when this is enabled.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "front", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT);
RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "back", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK);
RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "retopo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_RETOPO);
RNA_def_property_ui_text(prop, "Retopo", "Turn on the re-topology tool.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_curve_nurb(BlenderRNA *brna)
@@ -624,89 +725,107 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "tilt_interp");
RNA_def_property_enum_items(prop, spline_interpolation_items);
RNA_def_property_ui_text(prop, "Tilt Interpolation", "The type of tilt interpolation for 3D, Bezier curves.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "radius_interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "radius_interp");
RNA_def_property_enum_items(prop, spline_interpolation_items);
RNA_def_property_ui_text(prop, "Radius Interpolation", "The type of radius interpolation for Bezier curves.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "point_count_u", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
RNA_def_property_int_sdna(prop, NULL, "pntsu");
RNA_def_property_ui_text(prop, "Points U", "Total number points for the curve or surface in the U direction");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "point_count_v", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
RNA_def_property_int_sdna(prop, NULL, "pntsv");
RNA_def_property_ui_text(prop, "Points V", "Total number points for the surface on the V direction");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderu");
RNA_def_property_range(prop, 2, 6);
RNA_def_property_ui_text(prop, "Order U", "Nurbs order in the U direction (For curves and surfaces), Higher values let points influence a greater area");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderv");
RNA_def_property_range(prop, 2, 6);
RNA_def_property_ui_text(prop, "Order V", "Nurbs order in the V direction (For surfaces only), Higher values let points influence a greater area");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolu");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Resolution U", "Curve or Surface subdivisions per segment");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolv");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Resolution V", "Surface subdivisions per segment");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "cyclic_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "cyclic_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Note, endpoint and bezier flags should never be on at the same time! */
prop= RNA_def_property(srna, "endpoint_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", 2);
RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled).");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "endpoint_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", 2);
RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled).");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "bezier_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagu", 4);
RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled).");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "bezier_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flagv", 4);
RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled).");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth", "Smooth the normals of the surface or beveled curve.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 1);
RNA_def_property_ui_text(prop, "Hide", "Hide this curve in editmode.");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
RNA_def_property_ui_text(prop, "Material Index", "");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_material_index_range");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "charidx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
- RNA_def_property_ui_text(prop, "Character Index", "the location of this character in the text data (only for text curves)");
+ RNA_def_property_ui_text(prop, "Character Index", "Location of this character in the text data (only for text curves)");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
void RNA_def_curve(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 42c6f74b6ec..1f51b3ff34c 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -77,6 +77,20 @@ void rna_remlink(ListBase *listbase, void *vlink)
if (listbase->first == link) listbase->first = link->next;
}
+PropertyDefRNA *rna_findlink(ListBase *listbase, const char *identifier)
+{
+ Link *link;
+
+ for(link=listbase->first; link; link=link->next) {
+ PropertyRNA *prop= ((PropertyDefRNA *)link)->prop;
+ if(prop && (strcmp(prop->identifier, identifier)==0)) {
+ return (PropertyDefRNA *)link;
+ }
+ }
+
+ return NULL;
+}
+
void rna_freelinkN(ListBase *listbase, void *vlink)
{
rna_remlink(listbase, vlink);
@@ -444,6 +458,15 @@ void RNA_define_verify_sdna(int verify)
DefRNA.verify= verify;
}
+void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
+{
+#ifdef RNA_RUNTIME
+ ext->free(ext->data); /* decref's the PyObject that the srna owns */
+ RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */
+ RNA_struct_py_type_set(srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */
+#endif
+}
+
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
{
#ifdef RNA_RUNTIME
@@ -451,6 +474,12 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop, *nextprop;
PropertyRNA *parm, *nextparm;
+ if(srna->flag & STRUCT_RUNTIME) {
+ if(RNA_struct_py_type_get(srna)) {
+ fprintf(stderr, "StructRNA \"%s\" freed while holdng a python reference\n", srna->name);
+ }
+ }
+
for(prop=srna->cont.properties.first; prop; prop=nextprop) {
nextprop= prop->next;
@@ -482,6 +511,7 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
if(srna->flag & STRUCT_RUNTIME)
rna_freelinkN(&brna->structs, srna);
+
#endif
}
@@ -821,6 +851,13 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
}
dcont= rna_find_container_def(cont);
+
+ /* XXX - toto, detect supertype collisions */
+ if(rna_findlink(&dcont->properties, identifier)) {
+ fprintf(stderr, "RNA_def_property: duplicate identifier \"%s\"\n", identifier);
+ DefRNA.error= 1;
+ }
+
dprop= MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA");
rna_addtail(&dcont->properties, dprop);
}
@@ -991,6 +1028,26 @@ void RNA_def_property_array(PropertyRNA *prop, int arraylength)
DefRNA.error= 1;
break;
}
+
+ prop->arraydimension= 1;
+}
+
+void RNA_def_property_multidimensional_array(PropertyRNA *prop, int arraylength, unsigned short dimension, unsigned short dimsize[])
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) {
+ fprintf(stderr, "RNA_def_property_multidimensional_array: %s.%s, array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION);
+ DefRNA.error= 1;
+ return;
+ }
+
+ RNA_def_property_array(prop, arraylength);
+
+ prop->arraydimension= dimension;
+
+ if (dimension > 1)
+ memcpy(prop->dimsize, dimsize, sizeof(dimsize[0]) * (dimension - 1));
}
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
@@ -1066,7 +1123,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_struct_type: only during preprocessing.\n");
+ fprintf(stderr, "RNA_def_property_struct_type %s.%s: only during preprocessing.\n", srna->identifier, prop->identifier);
return;
}
@@ -1136,8 +1193,14 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
defaultfound= 1;
}
- if(!defaultfound)
- eprop->defaultvalue= item[0].value;
+ if(!defaultfound) {
+ for(i=0; item[i].identifier; i++) {
+ if(item[i].identifier[0]) {
+ eprop->defaultvalue= item[i].value;
+ break;
+ }
+ }
+ }
break;
}
@@ -1645,6 +1708,23 @@ void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
prop->update= (UpdateFunc)func;
}
+void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength, const char *setlength)
+{
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ if (!(prop->flag & PROP_DYNAMIC)) {
+ fprintf(stderr, "RNA_def_property_dynamic_array_funcs: property is a not dynamic array.\n");
+ DefRNA.error= 1;
+ return;
+ }
+
+ if(getlength) prop->getlength= (PropArrayLengthGetFunc)getlength;
+ if(setlength) prop->setlength= (PropArrayLengthSetFunc)setlength;
+}
+
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
{
StructRNA *srna= DefRNA.laststruct;
@@ -1877,7 +1957,7 @@ PropertyRNA *RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *iden
ContainerRNA *cont= cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_VECTOR);
+ prop= RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_XYZ); // XXX
if(len != 0) RNA_def_property_array(prop, len);
if(default_value) RNA_def_property_boolean_array_default(prop, default_value);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -1906,7 +1986,7 @@ PropertyRNA *RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifi
ContainerRNA *cont= cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_INT, PROP_VECTOR);
+ prop= RNA_def_property(cont, identifier, PROP_INT, PROP_XYZ); // XXX
if(len != 0) RNA_def_property_array(prop, len);
if(default_value) RNA_def_property_int_array_default(prop, default_value);
if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
@@ -2015,7 +2095,7 @@ PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identi
ContainerRNA *cont= cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_XYZ);
if(len != 0) RNA_def_property_array(prop, len);
if(default_value) RNA_def_property_float_array_default(prop, default_value);
if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
@@ -2042,14 +2122,15 @@ PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identif
}
-PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
+PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int len, int rowsize, const float *default_value,
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
{
ContainerRNA *cont= cont_;
PropertyRNA *prop;
+ unsigned short dimsize[1]= {rowsize};
prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_MATRIX);
- if(len != 0) RNA_def_property_array(prop, len);
+ if(len != 0) RNA_def_property_multidimensional_array(prop, len, 2, dimsize);
if(default_value) RNA_def_property_float_array_default(prop, default_value);
if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
RNA_def_property_ui_text(prop, ui_name, ui_description);
@@ -2064,7 +2145,7 @@ PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *iden
ContainerRNA *cont= cont_;
PropertyRNA *prop;
- prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_EULER); // XXX
if(len != 0) RNA_def_property_array(prop, len);
if(default_value) RNA_def_property_float_array_default(prop, default_value);
if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
@@ -2249,6 +2330,10 @@ int rna_parameter_size(PropertyRNA *parm)
int len= parm->arraylength;
if(len > 0) {
+
+ if (parm->flag & PROP_DYNAMIC)
+ return sizeof(void *);
+
switch (ptype) {
case PROP_BOOLEAN:
case PROP_INT:
@@ -2382,6 +2467,7 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop)
EnumPropertyItem *earray;
float *farray;
int *iarray;
+ int a;
if(prop->identifier) prop->identifier= BLI_strdup(prop->identifier);
if(prop->name) prop->name= BLI_strdup(prop->name);
@@ -2415,7 +2501,14 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop)
earray= MEM_callocN(sizeof(EnumPropertyItem)*(eprop->totitem+1), "RNA_def_property_store"),
memcpy(earray, eprop->item, sizeof(EnumPropertyItem)*(eprop->totitem+1));
eprop->item= earray;
+
+ for(a=0; a<eprop->totitem; a++) {
+ if(eprop->item[a].identifier) eprop->item[a].identifier= BLI_strdup(eprop->item[a].identifier);
+ if(eprop->item[a].name) eprop->item[a].name= BLI_strdup(eprop->item[a].name);
+ if(eprop->item[a].description) eprop->item[a].description= BLI_strdup(eprop->item[a].description);
+ }
}
+ break;
}
case PROP_FLOAT: {
FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
@@ -2442,6 +2535,8 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop)
void RNA_def_property_free_pointers(PropertyRNA *prop)
{
if(prop->flag & PROP_FREE_POINTERS) {
+ int a;
+
if(prop->identifier) MEM_freeN((void*)prop->identifier);
if(prop->name) MEM_freeN((void*)prop->name);
if(prop->description) MEM_freeN((void*)prop->description);
@@ -2465,6 +2560,13 @@ void RNA_def_property_free_pointers(PropertyRNA *prop)
case PROP_ENUM: {
EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
if(eprop->item) MEM_freeN((void*)eprop->item);
+
+ for(a=0; a<eprop->totitem; a++) {
+ if(eprop->item[a].identifier) MEM_freeN((void*)eprop->item[a].identifier);
+ if(eprop->item[a].name) MEM_freeN((void*)eprop->item[a].name);
+ if(eprop->item[a].description) MEM_freeN((void*)eprop->item[a].description);
+ }
+ break;
}
case PROP_STRING: {
StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index ceef84b92df..bafe83f1812 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -34,6 +34,8 @@
#include "MEM_guardedalloc.h"
+#include "WM_types.h"
+
EnumPropertyItem fmodifier_type_items[] = {
{FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""},
{FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""},
@@ -168,17 +170,20 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
// XXX this has a special validation func
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Type of generator to use.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
/* order of the polynomial */
// XXX this has a special validation func
prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
/* coefficients array */
// FIXME: this is quite difficult to try to wrap
@@ -210,25 +215,31 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
/* coefficients */
prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
/* flags */
prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
}
/* --------- */
@@ -249,15 +260,18 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
/* Frame */
- prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
// TODO:
// - selection flags (not implemented in UI yet though)
@@ -282,14 +296,17 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna)
prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "midval");
RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "default_minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "default_maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
}
/* --------- */
@@ -314,18 +331,21 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
prop= RNA_def_property(srna, "before_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "before_cycles", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe. (0 = infinite)");
-
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
/* after */
prop= RNA_def_property(srna, "after_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "after_cycles", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe. (0 = infinite)");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
}
/* --------- */
@@ -354,34 +374,42 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmin");
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymin");
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmax");
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymax");
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
}
/* --------- */
@@ -405,22 +433,27 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
prop= RNA_def_property(srna, "modification", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_modification_items);
RNA_def_property_ui_text(prop, "Modification", "Method of modifying the existing F-Curve.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Size", "Scaling (in time) of the noise");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "phase");
RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
}
@@ -459,17 +492,20 @@ void rna_def_fmodifier(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
// XXX this is really an internal flag, but it may be useful for some tools to be able to access this...
prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED);
RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated.");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
// TODO: setting this to true must ensure that all others in stack are turned off too...
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "F-Curve Modifier is the one being edited ");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
}
/* *********************** */
@@ -548,7 +584,7 @@ static void rna_def_fpoint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Selected", "Selection status");
/* Vector value */
- prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index ea4deae08e7..dda21f63528 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -98,7 +98,7 @@ static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr)
part->type= PART_FLUID;
psys->part= part;
- psys->pointcache= BKE_ptcache_add();
+ psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
psys->flag |= PSYS_ENABLED;
BLI_addtail(&ob->particlesystem,psys);
@@ -162,7 +162,7 @@ static void rna_def_fluidsim_slip(StructRNA *srna)
RNA_def_property_enum_items(prop, slip_items);
RNA_def_property_ui_text(prop, "Slip Type", "");
- prop= RNA_def_property(srna, "partial_slip_amount", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "partial_slip_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "partSlipValue");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Partial Slip Amount", "Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip.");
@@ -202,12 +202,12 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Preview Resolution", "Preview resolution in X,Y and Z direction.");
- prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animStart");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame.");
- prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animEnd");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame.");
@@ -240,7 +240,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
/* advanced settings */
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "gravx");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
@@ -338,7 +338,7 @@ static void rna_def_fluidsim_fluid(BlenderRNA *brna)
rna_def_fluidsim_volume(srna);
- prop= RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "iniVelx");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
@@ -374,7 +374,7 @@ static void rna_def_fluidsim_inflow(BlenderRNA *brna)
rna_def_fluidsim_volume(srna);
- prop= RNA_def_property(srna, "inflow_velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "inflow_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "iniVelx");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1);
@@ -443,12 +443,12 @@ static void rna_def_fluidsim_control(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Control Fluid Simulation Settings", "Fluid simulation settings for objects controlling the motion of fluid in the simulation.");
- prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeStart");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Start Time", "Specifies time when the control particles are activated.");
- prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeEnd");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "End Time", "Specifies time when the control particles are deactivated.");
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
new file mode 100644
index 00000000000..5caa868fd2e
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -0,0 +1,252 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2009), Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+#include "RNA_enum_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_gpencil_types.h"
+#include "DNA_scene_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#ifdef RNA_RUNTIME
+
+static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
+{
+ bGPDlayer *gpl= (bGPDlayer *)ptr->data;
+
+ /* surely there must be other criteria too... */
+ if (gpl->flag & GP_LAYER_LOCKED)
+ return 0;
+ else
+ return 1;
+}
+
+void rna_GPencilLayer_active_set(PointerRNA *ptr, int value)
+{
+ bGPdata *gpd= ptr->id.data;
+ bGPDlayer *gpl= ptr->data;
+
+ /* disabled all other layers anyway */
+ if (GS(gpd->id.name) == ID_GD) {
+ bGPDlayer *gl;
+
+ for (gl= gpd->layers.first; gl; gl= gl->next)
+ gl->flag &= ~GP_LAYER_ACTIVE;
+ }
+
+ /* if enabling value, make it active */
+ if (value)
+ gpl->flag |= GP_LAYER_ACTIVE;
+}
+
+#else
+
+void rna_def_gpencil_stroke_point(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "GPencilStrokePoint", NULL);
+ RNA_def_struct_sdna(srna, "bGPDspoint");
+ RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve.");
+
+ prop= RNA_def_property(srna, "coordinates", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "x");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Coordinates", "");
+
+ prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "pressure");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it.");
+}
+
+void rna_def_gpencil_stroke(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "GPencilStroke", NULL);
+ RNA_def_struct_sdna(srna, "bGPDstroke");
+ RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch.");
+
+ /* Points */
+ prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints");
+ RNA_def_property_struct_type(prop, "GPencilStrokePoint");
+ RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points");
+
+ /* Flags - Readonly type-info really... */
+ // TODO...
+}
+
+void rna_def_gpencil_frame(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "GPencilFrame", NULL);
+ RNA_def_struct_sdna(srna, "bGPDframe");
+ RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame");
+
+ /* Strokes */
+ prop= RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL);
+ RNA_def_property_struct_type(prop, "GPencilStroke");
+ RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame.");
+
+ /* Frame Number */
+ prop= RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "framenum");
+ RNA_def_property_range(prop, MINFRAME, MAXFRAME); // XXX note: this cannot occur on the same frame as another sketch
+ RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears.");
+
+ /* Flags */
+ prop= RNA_def_property(srna, "paint_lock", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); // XXX should it be editable?
+ RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on).");
+
+ prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT);
+ RNA_def_property_ui_text(prop, "Selected", "Frame is selected for editing in the DopeSheet.");
+}
+
+void rna_def_gpencil_layer(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "GPencilLayer", NULL);
+ RNA_def_struct_sdna(srna, "bGPDlayer");
+ RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches");
+
+ /* Name */
+ prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Info", "Description of layer");
+ RNA_def_struct_name_property(srna, prop);
+
+ /* Frames */
+ prop= RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
+ RNA_def_property_struct_type(prop, "GPencilFrame");
+ RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames.");
+
+ /* Active Frame */
+ prop= RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "actframe");
+ RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer.");
+ RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
+
+ /* Drawing Color */
+ prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Color", "Color that all sketches in this layer are drawn with.");
+
+ prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "color[3]");
+ RNA_def_property_range(prop, 0.3, 1.0f);
+ RNA_def_property_ui_text(prop, "Opacity", "Visibility of strokes.");
+
+ /* Line Thickness */
+ prop= RNA_def_property(srna, "line_thickness", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "thickness");
+ RNA_def_property_range(prop, 1, 10);
+ RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels).");
+
+ /* Onion-Skinning */
+ prop= RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
+ RNA_def_property_ui_text(prop, "Use Onion Skinning", "Ghost frames on either side of frame.");
+
+ prop= RNA_def_property(srna, "max_ghost_range", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "gstep");
+ RNA_def_property_range(prop, 0, 120);
+ RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show. (0 = just show the 'first' available sketch on either side)");
+
+ /* Flags */
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
+ RNA_def_property_ui_text(prop, "Hide", "Layer doesn't get drawn.");
+
+ prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
+ RNA_def_property_ui_text(prop, "Locked", "Layer is protected from further editing and/or frame changes.");
+
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
+ RNA_def_property_ui_text(prop, "Active", "Layer is 'active' layer being edited.");
+
+ prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
+ RNA_def_property_ui_text(prop, "Selected", "Layer is selected for editing in the DopeSheet.");
+
+ // XXX keep this option?
+ prop= RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
+ RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes).");
+
+}
+
+void rna_def_gpencil_data(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "GreasePencil", "ID");
+ RNA_def_struct_sdna(srna, "bGPdata");
+ RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook.");
+ RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA); // XXX: ICON_GPENCIL!!!
+
+ /* Layers */
+ prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
+ RNA_def_property_struct_type(prop, "GPencilLayer");
+ RNA_def_property_ui_text(prop, "Layers", "Similar to layers in Photoshop.");
+
+ /* Flags */
+ prop= RNA_def_property(srna, "view_space_draw", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_VIEWALIGN);
+ RNA_def_property_ui_text(prop, "Stick to View", "Newly drawn strokes get added in view space (i.e. sketches stick to data when view is manipulated).");
+}
+
+/* --- */
+
+void RNA_def_gpencil(BlenderRNA *brna)
+{
+ rna_def_gpencil_data(brna);
+
+ rna_def_gpencil_layer(brna);
+ rna_def_gpencil_frame(brna);
+ rna_def_gpencil_stroke(brna);
+ rna_def_gpencil_stroke_point(brna);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index 1406ad1ae60..18c04fbfb50 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -52,7 +52,7 @@ void RNA_def_group(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks.");
RNA_def_struct_ui_icon(srna, ICON_GROUP);
- prop= RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dupli_ofs");
RNA_def_property_ui_text(prop, "Dupli Offset", "Offset from the center to use when instancing as DupliGroup.");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index c74e46c17da..4d04f4ee1f3 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -93,7 +93,7 @@ static void rna_def_imageuser(BlenderRNA *brna)
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation.");
- prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie.");
@@ -219,7 +219,7 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine.");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
- prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "aspx");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0.1f, 5000.0f);
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index ed0395ede23..0a9ef9f90d1 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -130,6 +130,7 @@ void RNA_def_curve(struct BlenderRNA *brna);
void RNA_def_fluidsim(struct BlenderRNA *brna);
void RNA_def_fcurve(struct BlenderRNA *brna);
void RNA_def_gameproperty(struct BlenderRNA *brna);
+void RNA_def_gpencil(struct BlenderRNA *brna);
void RNA_def_group(struct BlenderRNA *brna);
void RNA_def_image(struct BlenderRNA *brna);
void RNA_def_key(struct BlenderRNA *brna);
@@ -154,6 +155,7 @@ void RNA_def_screen(struct BlenderRNA *brna);
void RNA_def_sculpt_paint(struct BlenderRNA *brna);
void RNA_def_sensor(struct BlenderRNA *brna);
void RNA_def_sequence(struct BlenderRNA *brna);
+void RNA_def_smoke(struct BlenderRNA *brna);
void RNA_def_space(struct BlenderRNA *brna);
void RNA_def_text(struct BlenderRNA *brna);
void RNA_def_texture(struct BlenderRNA *brna);
@@ -180,6 +182,9 @@ struct StructRNA *rna_ID_refine(struct PointerRNA *ptr);
struct IDProperty *rna_ID_idproperties(struct PointerRNA *ptr, int create);
void rna_ID_fake_user_set(struct PointerRNA *ptr, int value);
struct IDProperty *rna_IDPropertyGroup_idproperties(struct PointerRNA *ptr, int create);
+void rna_IDPropertyGroup_unregister(const struct bContext *C, struct StructRNA *type);
+struct StructRNA *rna_IDPropertyGroup_register(const struct bContext *C, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free);
+struct StructRNA* rna_IDPropertyGroup_refine(struct PointerRNA *ptr);
void rna_object_vgroup_name_index_get(struct PointerRNA *ptr, char *value, int index);
int rna_object_vgroup_name_index_length(struct PointerRNA *ptr, int index);
@@ -193,9 +198,11 @@ void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr);
/* API functions */
+void RNA_api_keyingset(struct StructRNA *srna);
void RNA_api_main(struct StructRNA *srna);
void RNA_api_mesh(struct StructRNA *srna);
void RNA_api_object(struct StructRNA *srna);
+void RNA_api_scene(struct StructRNA *srna);
void RNA_api_ui_layout(struct StructRNA *srna);
void RNA_api_wm(struct StructRNA *srna);
@@ -258,6 +265,7 @@ void rna_iterator_array_end(struct CollectionPropertyIterator *iter);
void rna_addtail(struct ListBase *listbase, void *vlink);
void rna_freelinkN(struct ListBase *listbase, void *vlink);
void rna_freelistN(struct ListBase *listbase);
+PropertyDefRNA *rna_findlink(ListBase *listbase, const char *identifier);
StructDefRNA *rna_find_struct_def(StructRNA *srna);
FunctionDefRNA *rna_find_function_def(FunctionRNA *func);
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 12bd876ce52..d706fd5ac19 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -40,6 +40,7 @@ struct IDProperty;
struct GHash;
#define RNA_MAX_ARRAY 32
+#define RNA_MAX_ARRAY_DIMENSION 3
/* Function Callbacks */
@@ -49,6 +50,8 @@ typedef struct IDProperty* (*IDPropertiesFunc)(struct PointerRNA *ptr, int creat
typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr);
typedef char *(*StructPathFunc)(struct PointerRNA *ptr);
+typedef int (*PropArrayLengthGetFunc)(struct PointerRNA *ptr);
+typedef int (*PropArrayLengthSetFunc)(struct PointerRNA *ptr, int length);
typedef int (*PropBooleanGetFunc)(struct PointerRNA *ptr);
typedef void (*PropBooleanSetFunc)(struct PointerRNA *ptr, int value);
typedef void (*PropBooleanArrayGetFunc)(struct PointerRNA *ptr, int *values);
@@ -131,6 +134,14 @@ struct PropertyRNA {
PropertySubType subtype;
/* if an array this is > 0, specifying the length */
unsigned int arraylength;
+ /* these, if non-NULL, override arraylength */
+ PropArrayLengthGetFunc getlength;
+ /* if NULL, length cannot be changed by a user */
+ PropArrayLengthSetFunc setlength;
+ /* used only for dynamic arrays for now, default 1 */
+ unsigned short arraydimension;
+ /* dimension sizes for dimensions greater than 1, first dimension size is not specified */
+ unsigned short dimsize[RNA_MAX_ARRAY_DIMENSION - 1];
/* callback for updates on change */
UpdateFunc update;
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index 7297ee8cb97..88047cda12b 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -47,6 +47,21 @@
#include "WM_api.h"
#include "WM_types.h"
+static void rna_ShapeKey_value_set(PointerRNA *ptr, float value)
+{
+ KeyBlock *data= (KeyBlock*)ptr->data;
+ CLAMP(value, data->slidermin, data->slidermax);
+ data->curval= value;
+}
+
+static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max)
+{
+ KeyBlock *data= (KeyBlock*)ptr->data;
+
+ *min= data->slidermin;
+ *max= data->slidermax;
+}
+
static Key *rna_ShapeKey_find_key(ID *id)
{
switch(GS(id->name)) {
@@ -267,7 +282,7 @@ static void rna_def_keydata(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ShapeKeyPoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Point", "Point in a shape key.");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", "");
@@ -276,7 +291,7 @@ static void rna_def_keydata(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves.");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", "");
@@ -290,19 +305,19 @@ static void rna_def_keydata(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for bezier curves.");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "handle_1_co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "handle_1_co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1 Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
- prop= RNA_def_property(srna, "handle_2_co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "handle_2_co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2 Location", "");
@@ -336,7 +351,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
RNA_def_struct_name_property(srna, prop);
/* keys need to be sorted to edit this */
- prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys.");
@@ -345,6 +360,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
/* for now, this is editable directly, as users can set this even if they're not animating them (to test results) */
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "curval");
+ RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_value_set", "rna_ShapeKey_value_range");
RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame.");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
@@ -380,6 +396,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
prop= RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "slidermax");
RNA_def_property_range(prop, -10.0f, 10.0f);
+ RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider.");
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 299bd37496b..57aa1ba2736 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -151,13 +151,13 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shadow", "Lets the texture affect the shadow color of the lamp.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow.");
@@ -314,7 +314,7 @@ static void rna_def_lamp(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "Type of Lamp.");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_range(prop, 0, 1000, 1.0, 2);
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point.");
@@ -465,7 +465,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows).");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
- prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows).");
@@ -526,13 +526,13 @@ static void rna_def_area_lamp(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp.");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes.");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
- prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_sizey");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes.");
@@ -628,13 +628,13 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam in degrees.");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
- prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start: objects closer will not generate shadows");
RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
- prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end beyond which objects will not generate shadows.");
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index 03a1dc9ec8f..b53a0589ba6 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -178,13 +178,13 @@ static void rna_def_latticepoint(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "BPoint");
RNA_def_struct_ui_text(srna, "LatticePoint", "Point in the lattice grid.");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Location", "");
- prop= RNA_def_property(srna, "deformed_co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "deformed_co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Deformed Location", "");
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 26fc3c2941e..82e460ea57d 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -207,6 +207,12 @@ static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA
rna_iterator_listbase_begin(iter, &bmain->particle, NULL);
}
+static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL);
+}
+
static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Main *bmain= (Main*)ptr->data;
@@ -220,34 +226,35 @@ void RNA_def_main(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- const char *lists[][5]= {
- {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks."},
- {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks."},
- {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks."},
- {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks."},
- {"nodetrees", "NodeTree", "rna_Main_nodetree_begin", "Node Trees", "Nodetree datablocks."},
- {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks."},
- {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks."},
- {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks."},
- {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks."},
- {"windowmanagers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks."},
- {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks."},
- {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks."},
- {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks."},
- {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks."},
- {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks."},
- {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks."},
- {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks."},
- {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks."},
- {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks."},
- {"keys", "ID", "rna_Main_key_begin", "Keys", "Key datablocks."},
- {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks."},
- {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks."},
- {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks."},
- {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks."},
- {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks."},
- {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks."},
- {NULL, NULL, NULL, NULL, NULL}};
+ const char *lists[][7]= {
+ {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks.", NULL, NULL},
+ {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", NULL, NULL},
+ {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks.", NULL, NULL},
+ {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks.", NULL, NULL},
+ {"nodegroups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks.", NULL, NULL},
+ {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks.", "add_mesh", "remove_mesh"},
+ {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks.", NULL, NULL},
+ {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks.", NULL, NULL},
+ {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks.", NULL, NULL},
+ {"windowmanagers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks.", NULL, NULL},
+ {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks.", NULL, NULL},
+ {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks.", NULL, NULL},
+ {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks.", NULL, NULL} ,
+ {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks.", NULL, NULL},
+ {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks.", NULL, NULL},
+ {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks.", NULL, NULL},
+ {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", NULL, NULL},
+ {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", NULL, NULL},
+ {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", NULL, NULL},
+ {"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL},
+ {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks.", NULL, NULL},
+ {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", NULL, NULL},
+ {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL},
+ {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", NULL, NULL},
+ {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", NULL, NULL},
+ {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", NULL, NULL},
+ {"gpencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", NULL, NULL},
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
int i;
srna= RNA_def_struct(brna, "Main", NULL);
@@ -264,7 +271,7 @@ void RNA_def_main(BlenderRNA *brna)
{
prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, lists[i][1]);
- RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, lists[i][5], lists[i][6]);
RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]);
}
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index d7c677d05f3..651aeae217e 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -35,12 +35,28 @@
#include "WM_types.h"
+static EnumPropertyItem prop_texture_coordinates_items[] = {
+{TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."},
+{TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."},
+{TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates."},
+{TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object."},
+{TEXCO_STRAND, "STRAND", 0, "Strand", "Uses normalized strand texture coordinate (1D)."},
+{TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."},
+{TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates."},
+{TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates."},
+{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates."},
+{TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh."},
+{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates."},
+{0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
#include "BKE_texture.h"
+#include "ED_node.h"
+
static PointerRNA rna_Material_mirror_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_MaterialRaytraceMirror, ptr->id.data);
@@ -66,6 +82,11 @@ static PointerRNA rna_Material_strand_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_MaterialStrand, ptr->id.data);
}
+static PointerRNA rna_Material_physics_get(PointerRNA *ptr)
+{
+ return rna_pointer_inherit_refine(ptr, &RNA_MaterialPhysics, ptr->id.data);
+}
+
static void rna_Material_type_set(PointerRNA *ptr, int value)
{
Material *ma= (Material*)ptr->data;
@@ -191,6 +212,51 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value)
ma->ramp_spec= add_colorband(0);
}
+void rna_Material_use_nodes_set(PointerRNA *ptr, int value)
+{
+ Material *ma= (Material*)ptr->data;
+
+ ma->use_nodes= value;
+ if(ma->use_nodes && ma->nodetree==NULL)
+ ED_node_shader_default(ma);
+}
+
+static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Material *ma= (Material*)ptr->id.data;
+ EnumPropertyItem *item= NULL;
+ int totitem= 0;
+
+ if(C==NULL) {
+ return prop_texture_coordinates_items;
+ }
+
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_GLOB);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_OBJECT);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_ORCO);
+
+ if(ma->material_type == MA_TYPE_VOLUME) {
+
+ }
+ else if (ELEM3(ma->material_type, MA_TYPE_SURFACE, MA_TYPE_HALO, MA_TYPE_WIRE)) {
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_UV);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRAND);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STICKY);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_WINDOW);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_NORM);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_REFL);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRESS);
+ RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_TANGENT);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+
+ *free= 1;
+
+ return item;
+}
+
+
#else
static void rna_def_material_mtex(BlenderRNA *brna)
@@ -198,21 +264,6 @@ static void rna_def_material_mtex(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_texture_coordinates_items[] = {
- {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."},
- {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."},
- {TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates."},
- {TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object."},
- {TEXCO_STRAND, "STRAND", 0, "Strand", "Uses normalized strand texture coordinate (1D)."},
- {TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."},
- {TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates."},
- {TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates."},
- {TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates."},
- {TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh."},
- {TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates."},
-
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem prop_mapping_items[] = {
{MTEX_FLAT, "FLAT", 0, "Flat", "Maps X and Y coordinates directly."},
{MTEX_CUBE, "CUBE", 0, "Cube", "Maps using the normal vector."},
@@ -255,9 +306,10 @@ static void rna_def_material_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf");
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
+
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
@@ -403,7 +455,7 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Specular Color Factor", "Amount texture affects specular color.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "colordiff_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "colordiff_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color.");
@@ -463,6 +515,75 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Ambient Factor", "Amount texture affects ambient.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ /* volume material */
+ prop= RNA_def_property(srna, "map_coloremission", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL);
+ RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the colour of emission");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "map_colorabsorption", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION_COL);
+ RNA_def_property_ui_text(prop, "Absorption Color", "Causes the texture to affect the result colour after absorption");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "map_density", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY);
+ RNA_def_property_ui_text(prop, "Density", "Causes the texture to affect the volume's density");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "map_emission", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION);
+ RNA_def_property_ui_text(prop, "Emission", "Causes the texture to affect the volume's emission");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "map_absorption", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION);
+ RNA_def_property_ui_text(prop, "Absorption", "Causes the texture to affect the volume's absorption");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "map_scattering", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING);
+ RNA_def_property_ui_text(prop, "Scattering", "Causes the texture to affect the volume's scattering");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "coloremission_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "colorabsorption_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Absorpion Color Factor", "Amount texture affects diffuse color.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "absorption_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Absorption Factor", "Amount texture affects absorption.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Scattering Factor", "Amount texture affects scattering.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ /* end volume material */
+
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_enabled_get", "rna_MaterialTextureSlot_enabled_set");
RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot.");
@@ -477,6 +598,32 @@ static void rna_def_material_mtex(BlenderRNA *brna)
static void rna_def_material_colors(StructRNA *srna)
{
PropertyRNA *prop;
+
+ static EnumPropertyItem prop_ramp_blend_diffuse_items[] = {
+ {MA_RAMP_BLEND, "MIX", 0, "Mix", ""},
+ {MA_RAMP_ADD, "ADD", 0, "Add", ""},
+ {MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""},
+ {MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""},
+ {MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""},
+ {MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""},
+ {MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""},
+ {MA_RAMP_DARK, "DARKEN", 0, "Darken", ""},
+ {MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""},
+ {MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""},
+ {MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""},
+ {MA_RAMP_BURN, "BURN", 0, "Burn", ""},
+ {MA_RAMP_HUE, "HUE", 0, "Hue", ""},
+ {MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""},
+ {MA_RAMP_VAL, "VALUE", 0, "Value", ""},
+ {MA_RAMP_COLOR, "COLOR", 0, "Color", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_ramp_input_items[] = {
+ {MA_RAMP_IN_SHADER, "SHADER", 0, "Shader", ""},
+ {MA_RAMP_IN_ENERGY, "ENERGY", 0, "Energy", ""},
+ {MA_RAMP_IN_NOR, "NORMAL", 0, "Normal", ""},
+ {MA_RAMP_IN_RESULT, "RESULT", 0, "Result", ""},
+ {0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
@@ -496,10 +643,16 @@ static void rna_def_material_colors(StructRNA *srna)
RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color of the material.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Alpha", "Alpha transparency of the material.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ RNA_def_property_float_sdna(prop, NULL, "spectra");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Specular Alpha", "Alpha transparency for specular areas.");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
/* Color bands */
prop= RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE);
@@ -523,6 +676,31 @@ static void rna_def_material_colors(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "ramp_spec");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Specular Ramp", "Color ramp used to affect specular shading.");
+
+ prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "rampblend_col");
+ RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
+ RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec");
+ RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
+ RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "rampin_col");
+ RNA_def_property_enum_items(prop, prop_ramp_input_items);
+ RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "rampin_spec");
+ RNA_def_property_enum_items(prop, prop_ramp_input_items);
+ RNA_def_property_ui_text(prop, "Specular Ramp Input", "");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
}
static void rna_def_material_diffuse(StructRNA *srna)
@@ -543,10 +721,10 @@ static void rna_def_material_diffuse(StructRNA *srna)
RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "diffuse_reflection", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "ref");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Diffuse Reflection", "Amount of diffuse reflection.");
+ RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
@@ -560,7 +738,7 @@ static void rna_def_material_diffuse(StructRNA *srna)
RNA_def_property_ui_text(prop, "Diffuse Toon Size", "Size of diffuse toon area.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Toon Smooth", "Smoothness of diffuse toon area.");
@@ -590,8 +768,8 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_fadeto_mir_items[] = {
- {MA_RAYMIR_FADETOSKY, "FADE_TO_SKY", 0, "Fade to Sky Color", ""},
- {MA_RAYMIR_FADETOMAT, "FADE_TO_MATERIAL", 0, "Fade to Material Color", ""},
+ {MA_RAYMIR_FADETOSKY, "FADE_TO_SKY", 0, "Sky", ""},
+ {MA_RAYMIR_FADETOMAT, "FADE_TO_MATERIAL", 0, "Material", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MaterialRaytraceMirror", NULL);
@@ -604,10 +782,10 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "reflect", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Reflect", "Sets the amount mirror reflection for raytrace.");
+ RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
@@ -616,19 +794,19 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "fresnel_fac", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Gloss", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections.");
+ RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Anisotropy", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent.");
@@ -640,7 +818,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
@@ -652,7 +830,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-reflections.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist_mir");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color.");
@@ -675,11 +853,6 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Raytrace Transparency", "Raytraced refraction settings for a Material datablock.");
- prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYTRANSP); /* use bitflags */
- RNA_def_property_ui_text(prop, "Enabled", "Enables raytracing for transparent refraction rendering.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ang");
RNA_def_property_range(prop, 1.0f, 3.0f);
@@ -692,16 +865,16 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for transparency (Ray or ZTransp).");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "fresnel_fac", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra_i");
RNA_def_property_range(prop, 1.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "gloss_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Gloss", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions.");
+ RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
@@ -710,7 +883,7 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry refractions.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
@@ -722,13 +895,13 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-refractions.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "filter");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Filter", "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption).");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "limit", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "limit", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tx_limit");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Limit", "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled).");
@@ -739,14 +912,161 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Falloff", "Falloff power for transmissivity filter effect (1.0 is linear).");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+}
+
+static void rna_def_material_volume(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_scattering_items[] = {
+ {MA_VOL_SHADE_NONE, "NONE", 0, "None", ""},
+ {MA_VOL_SHADE_SINGLE, "SINGLE_SCATTERING", 0, "Single Scattering", ""},
+ {MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""},
+ {MA_VOL_SHADE_SINGLEPLUSMULTIPLE, "SINGLE_PLUS_MULTIPLE_SCATTERING", 0, "Single + Multiple Scattering", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_stepsize_items[] = {
+ {MA_VOL_STEP_RANDOMIZED, "RANDOMIZED", 0, "Randomized", ""},
+ {MA_VOL_STEP_CONSTANT, "CONSTANT", 0, "Constant", ""},
+ //{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_phasefunction_items[] = {
+ {MA_VOL_PH_ISOTROPIC, "ISOTROPIC", 0, "Isotropic", ""},
+ {MA_VOL_PH_MIEHAZY, "MIE_HAZY", 0, "Mie Hazy", ""},
+ {MA_VOL_PH_MIEMURKY, "MIE_MURKY", 0, "Mie Murky", ""},
+ {MA_VOL_PH_RAYLEIGH, "RAYLEIGH", 0, "Rayleigh", ""},
+ {MA_VOL_PH_HG, "HENYEY-GREENSTEIN", 0, "Henyey-Greenstein", ""},
+ {MA_VOL_PH_SCHLICK, "SCHLICK", 0, "Schlick", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "MaterialVolume", NULL);
+ RNA_def_struct_sdna(srna, "VolumeSettings");
+ RNA_def_struct_nested(brna, srna, "Material");
+ RNA_def_struct_ui_text(srna, "Material Volume", "Volume rendering settings for a Material datablock.");
- prop= RNA_def_property(srna, "specular_opacity", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "spectra");
+ prop= RNA_def_property(srna, "step_calculation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "stepsize_type");
+ RNA_def_property_enum_items(prop, prop_stepsize_items);
+ RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "stepsize");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
+ RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples.");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "shading_step_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "shade_stepsize");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
+ RNA_def_property_ui_text(prop, "Shading Step Size", "Distance between subsequent volume shading samples.");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "scattering_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "shade_type");
+ RNA_def_property_enum_items(prop, prop_scattering_items);
+ RNA_def_property_ui_text(prop, "Scattering Mode", "Method of shading, attenuating, and scattering light through the volume");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "light_cache", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */
+ RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "precache_resolution");
+ RNA_def_property_range(prop, 0, 1024);
+ RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory.");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ms_diff");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "ms_spread", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ms_steps");
+ RNA_def_property_range(prop, 0, 1024);
+ RNA_def_property_ui_text(prop, "Spread", "Simulation steps, the effective distance over which the light is diffused");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ms_intensity");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "depth_cutoff", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "depth_cutoff");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy.");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_PERCENTAGE);
+ RNA_def_property_float_sdna(prop, NULL, "density");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Specular Opacity", "Makes specular areas opaque on transparent materials.");
+ RNA_def_property_ui_text(prop, "Density", "The base density of the volume");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "density_scale");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+ RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "absorption");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+ RNA_def_property_ui_text(prop, "Absorption", "Amount of light that gets absorbed by the volume - higher values mean light travels less distance");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "absorption_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "absorption_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Absorption Color", "");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "scattering");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
+ RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered by the volume - values > 1.0 are non-physical");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "emission");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+ RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "emission_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Emission Color", "");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "phase_function", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "phasefunc_type");
+ RNA_def_property_enum_items(prop, prop_phasefunction_items);
+ RNA_def_property_ui_text(prop, "Phase Function", "Isotropic/Anisotropic scattering");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "phasefunc_g");
+ RNA_def_property_range(prop, -1.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Asymmetry", "Continuum between forward scattering and back scattering");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
}
+
static void rna_def_material_halo(BlenderRNA *brna)
{
StructRNA *srna;
@@ -769,7 +1089,7 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Hardness", "Sets the hardness of the halo.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "add");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Add", "Sets the strength of the add effect.");
@@ -849,14 +1169,14 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Star", "Renders halo as a star.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX);
- RNA_def_property_ui_text(prop, "Use Texture", "Gives halo a texture.");
+ RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO);
- RNA_def_property_ui_text(prop, "Use Vertex Normal", "Uses the vertex normal to specify the dimension of the halo.");
+ RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE);
@@ -885,7 +1205,7 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Subsurface Scattering", "Diffuse subsurface scattering settings for a Material datablock.");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_RGB|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "sss_radius");
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3);
@@ -915,13 +1235,13 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "IOR", "Index of refraction (higher values are denser).");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "sss_colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Blend factor for SSS colors.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "sss_texfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Texture Factor", "Texture scatting blend factor.");
@@ -963,10 +1283,10 @@ void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_ui_text(prop, "Specular Shader Model", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "specular_reflection", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_range(prop, 0, 1);
- RNA_def_property_ui_text(prop, "Specularity Intensity", "");
+ RNA_def_property_ui_text(prop, "Specular Intensity", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
/* NOTE: "har", "param", etc are used for multiple purposes depending on
@@ -992,7 +1312,7 @@ void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_ui_text(prop, "Specular Toon Size", "Size of specular toon area.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "param[3]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Toon Smooth", "Ssmoothness of specular toon area.");
@@ -1025,10 +1345,10 @@ void rna_def_material_strand(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Surface Diffuse", "Make diffuse shading more similar to shading the surface.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "strand_surfnor");
RNA_def_property_range(prop, 0, 10);
- RNA_def_property_ui_text(prop, "Blend Distance", "Distance in Blender units over which to blend in the surface normal.");
+ RNA_def_property_ui_text(prop, "Blend Distance", "Worldspace distance over which to blend in the surface normal.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "blender_units", PROP_BOOLEAN, PROP_NONE);
@@ -1036,16 +1356,16 @@ void rna_def_material_strand(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "start_size", PROP_FLOAT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_sta");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range");
- RNA_def_property_ui_text(prop, "Start Size", "Start size of strands in pixels Blender units.");
+ RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels Blender units.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "end_size", PROP_FLOAT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_end");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range");
- RNA_def_property_ui_text(prop, "End Size", "Start size of strands in pixels or Blender units.");
+ RNA_def_property_ui_text(prop, "Tip Size", "Start size of strands in pixels or Blender units.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED);
@@ -1072,6 +1392,46 @@ void rna_def_material_strand(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
}
+void rna_def_material_physics(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MaterialPhysics", NULL);
+ RNA_def_struct_sdna(srna, "Material");
+ RNA_def_struct_nested(brna, srna, "Material");
+ RNA_def_struct_ui_text(srna, "Material Physics", "Physics settings for a Material datablock.");
+
+ prop= RNA_def_property(srna, "align_to_normal", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FH_NOR);
+ RNA_def_property_ui_text(prop, "Align to Normal", "Align dynamic game objects along the surface normal, when inside the physics distance area");
+
+ prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "friction");
+ RNA_def_property_range(prop, 0, 100);
+ RNA_def_property_ui_text(prop, "Friction", "Coulomb friction coeffecient, when inside the physics distance area");
+
+ prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fh");
+ RNA_def_property_range(prop, 0, 1);
+ RNA_def_property_ui_text(prop, "Force", "Upward spring force, when inside the physics distance area");
+
+ prop= RNA_def_property(srna, "elasticity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "reflect");
+ RNA_def_property_range(prop, 0, 1);
+ RNA_def_property_ui_text(prop, "Elasticity", "Elasticity of collisions");
+
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fhdist");
+ RNA_def_property_range(prop, 0, 20);
+ RNA_def_property_ui_text(prop, "Distance", "Distance of the physics area");
+
+ prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "xyfrict");
+ RNA_def_property_range(prop, 0, 1);
+ RNA_def_property_ui_text(prop, "Damping", "Damping of the spring force, when inside the physics distance area");
+}
+
void RNA_def_material(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1080,9 +1440,13 @@ void RNA_def_material(BlenderRNA *brna)
static EnumPropertyItem prop_type_items[] = {
{MA_TYPE_SURFACE, "SURFACE", 0, "Surface", "Render object as a surface."},
{MA_TYPE_WIRE, "WIRE", 0, "Wire", "Render the edges of faces as wires (not supported in ray tracing)."},
- // {MA_TYPE_VOLUME, "VOLUME", 0, "Volume", "Render object as a volume."},
+ {MA_TYPE_VOLUME, "VOLUME", 0, "Volume", "Render object as a volume."},
{MA_TYPE_HALO, "HALO", 0, "Halo", "Render object as halo particles."},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem transparency_items[] = {
+ {MA_ZTRANSP, "Z_TRANSPARENCY", 0, "Z Transparency", "Use alpha buffer for transparent faces."},
+ {MA_RAYTRANSP, "RAYTRACE", 0, "Raytrace", "Use raytracing for transparent refraction rendering."},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Material", "ID");
RNA_def_struct_ui_text(srna, "Material", "Material datablock to defined the appearance of geometric objects for rendering.");
@@ -1094,19 +1458,31 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered.");
RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "transparency", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRANSP);
+ RNA_def_property_ui_text(prop, "Transparency", "Render material as transparent.");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+
+ prop= RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, transparency_items);
+ RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency.");
+ RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "amb");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Ambient", "Amount of global ambient color the material receives.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "emit", PROP_FLOAT, PROP_NONE);
- RNA_def_property_range(prop, 0, 2);
+ RNA_def_property_range(prop, 0, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0, 2.0f, 10, 2);
RNA_def_property_ui_text(prop, "Emit", "Amount of light to emit.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
@@ -1131,7 +1507,7 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Factor to multiply shadow buffer bias with (0 is ignore.)");
- prop= RNA_def_property(srna, "shadow_casting_alpha", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "shadow_casting_alpha", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "shad_alpha");
RNA_def_property_range(prop, 0.001, 1);
RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, only in use for Irregular Shadowbuffer.");
@@ -1166,11 +1542,6 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shadeless", "Makes this material insensitive to light or shadow.");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "z_transparency", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZTRA);
- RNA_def_property_ui_text(prop, "Z Transparency", "Enable alpha buffer for transparent faces.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
prop= RNA_def_property(srna, "vertex_color_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL);
RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting.");
@@ -1216,14 +1587,9 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Exclude Mist", "Excludes this material from mist effects (in world settings)");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "radiosity", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RADIO);
- RNA_def_property_ui_text(prop, "Radiosity", "Include this material in radiosity calculations");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
- prop= RNA_def_property(srna, "transparent_shadows", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA);
- RNA_def_property_ui_text(prop, "Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects");
+ RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
@@ -1257,6 +1623,11 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced reflection settings for the material.");
+ prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "vol");
+ RNA_def_property_struct_type(prop, "MaterialVolume");
+ RNA_def_property_ui_text(prop, "Volume", "Volume settings for the material.");
+
prop= RNA_def_property(srna, "halo", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialHalo");
RNA_def_property_pointer_funcs(prop, "rna_Material_halo_get", NULL, NULL);
@@ -1271,12 +1642,23 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "MaterialStrand");
RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material.");
+
+ prop= RNA_def_property(srna, "physics", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "MaterialPhysics");
+ RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Physics", "Game physics settings.");
/* nodetree */
prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based materials.");
+ prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_nodes_set");
+ RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the material.");
+ RNA_def_property_update(prop, NC_MATERIAL, NULL);
+
/* common */
rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get",
@@ -1289,10 +1671,12 @@ void RNA_def_material(BlenderRNA *brna)
/* nested structs */
rna_def_material_raymirror(brna);
rna_def_material_raytra(brna);
+ rna_def_material_volume(brna);
rna_def_material_halo(brna);
rna_def_material_sss(brna);
rna_def_material_mtex(brna);
rna_def_material_strand(brna);
+ rna_def_material_physics(brna);
}
void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname)
@@ -1310,11 +1694,13 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL);
RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed.");
+ RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "texact");
RNA_def_property_range(prop, 0, MAX_MTEX-1);
RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot.");
+ RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 525814f1f5e..edecfc8cdb0 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -398,6 +398,51 @@ static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values)
mtface->uv[3][1]= values[1];
}
+static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomData *fdata= rna_mesh_fdata(me);
+ CustomDataLayer *cdl;
+ int a;
+ size_t b;
+
+ for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) {
+ if(cdl->type == type) {
+ b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
+ if(b >= 0 && b < me->totface)
+ return (me->mface[b].v4? 4: 3);
+ }
+ }
+
+ return 0;
+}
+
+static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr)
+{
+ return rna_CustomDataData_numverts(ptr, CD_MTFACE) * 2;
+}
+
+static int rna_MeshTextureFace_uv_set_length(PointerRNA *ptr, int length)
+{
+ return length == rna_MeshTextureFace_uv_get_length(ptr);
+}
+
+static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE);
+
+ memcpy(values, mtface->uv, totvert * 2 * sizeof(float));
+}
+
+static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE);
+
+ memcpy(mtface->uv, values, totvert * 2 * sizeof(float));
+}
+
static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me= (Mesh*)ptr->id.data;
@@ -660,6 +705,43 @@ static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value)
tf->tpage= (struct Image*)id;
}
+static int rna_MeshFace_verts_get_length(PointerRNA *ptr)
+{
+ MFace *face= (MFace*)ptr->data;
+ if(face)
+ return face->v4 ? 4 : 3;
+ else
+ return 4; // XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell
+}
+
+static int rna_MeshFace_verts_set_length(PointerRNA *ptr, int length)
+{
+ MFace *face= (MFace*)ptr->data;
+ if (length == 3) {
+ face->v4= 0;
+ }
+ else if(length == 4) {
+ face->v4= 1;
+ }
+ else
+ return 0;
+
+ return 1;
+}
+
+static void rna_MeshFace_verts_get(PointerRNA *ptr, int *values)
+{
+ MFace *face= (MFace*)ptr->data;
+ int verts[4] = {face->v1, face->v2, face->v3, face->v4};
+ memcpy(values, verts, (face->v4 ? 4 : 3) * sizeof(int));
+}
+
+static void rna_MeshFace_verts_set(PointerRNA *ptr, const int *values)
+{
+ MFace *face= (MFace*)ptr->data;
+ memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int));
+}
+
/* path construction */
static char *rna_VertexGroupElement_path(PointerRNA *ptr)
@@ -802,10 +884,10 @@ static void rna_def_mvert(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_MeshVertex_path");
RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL);
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_ui_text(prop, "Location", "");
- prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_float_sdna(prop, NULL, "no");
RNA_def_property_float_funcs(prop, "rna_MeshVertex_normal_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Normal", "Vertex Normal");
@@ -882,11 +964,21 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_MeshFace_path");
RNA_def_struct_ui_icon(srna, ICON_FACESEL);
+ /*
+ // XXX allows creating invalid meshes
prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "v1");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
+ */
+
// XXX allows creating invalid meshes
+ prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_flag(prop, PROP_DYNAMIC);
+ RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length", "rna_MeshFace_verts_set_length");
+ RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL);
+ RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
@@ -905,7 +997,7 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth", "");
- prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -923,6 +1015,7 @@ static void rna_def_mtface(BlenderRNA *brna)
{TF_ALPHA, "ALPHA", 0, "Alpha", "Render polygon transparent, depending on alpha channel of the texture"},
{TF_CLIP, "CLIPALPHA", 0, "Clip Alpha", "Use the images alpha values clipped with no blending (binary alpha)"},
{0, NULL, 0, NULL, NULL}};
+ unsigned short uv_dim[1]= {2};
srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
RNA_def_struct_ui_text(srna, "Mesh Texture Face Layer", "Layer of texture faces in a Mesh datablock.");
@@ -1022,25 +1115,32 @@ static void rna_def_mtface(BlenderRNA *brna)
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "UV Pinned", "");
- prop= RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv1_get", "rna_MeshTextureFace_uv1_set", NULL);
RNA_def_property_ui_text(prop, "UV 1", "");
- prop= RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv2_get", "rna_MeshTextureFace_uv2_set", NULL);
RNA_def_property_ui_text(prop, "UV 2", "");
- prop= RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv3_get", "rna_MeshTextureFace_uv3_set", NULL);
RNA_def_property_ui_text(prop, "UV 3", "");
- prop= RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv4_get", "rna_MeshTextureFace_uv4_set", NULL);
RNA_def_property_ui_text(prop, "UV 4", "");
+
+ prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_multidimensional_array(prop, 4 * 2, 2, uv_dim);
+ RNA_def_property_flag(prop, PROP_DYNAMIC);
+ RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length", "rna_MeshTextureFace_uv_set_length");
+ RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv_get", "rna_MeshTextureFace_uv_set", NULL);
+ RNA_def_property_ui_text(prop, "UV", "");
}
static void rna_def_msticky(BlenderRNA *brna)
@@ -1053,7 +1153,7 @@ static void rna_def_msticky(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Mesh Vertex Sticky Texture Coordinate", "Stricky texture coordinate.");
RNA_def_struct_path_func(srna, "rna_MeshSticky_path");
- prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_text(prop, "Location", "Sticky texture coordinate location.");
}
@@ -1203,18 +1303,18 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object.");
- prop= RNA_def_property(srna, "texspace_loc", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "texspace_loc", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location.");
RNA_def_property_editable_func(prop, texspace_editable);
- prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size.");
RNA_def_property_editable_func(prop, texspace_editable);
/* not supported yet
- prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);*/
@@ -1339,6 +1439,64 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "key");
RNA_def_property_ui_text(prop, "Shape Keys", "");
+
+ /* Mesh Draw Options for Edit Mode*/
+
+ prop= RNA_def_property(srna, "draw_edges", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES);
+ RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using hilights in the 3d view and UV editor");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_faces", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
+ RNA_def_property_ui_text(prop, "Draw Faces", "Displays all faces as shades in the 3d view and UV editor");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_normals", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS);
+ RNA_def_property_ui_text(prop, "Draw Normals", "Displays face normals as lines");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_vertex_normals", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS);
+ RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Displays vertex normals as lines");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_creases", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES);
+ RNA_def_property_ui_text(prop, "Draw Creases", "Displays creases created for subsurf weighting");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_bevel_weights", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS);
+ RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Displays weights created for the Bevel modifier");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_seams", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS);
+ RNA_def_property_ui_text(prop, "Draw Seams", "Displays UV unwrapping seams");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_sharp", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP);
+ RNA_def_property_ui_text(prop, "Draw Sharp", "Displays sharp edges, used with the EdgeSplit modifier");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+
+ prop= RNA_def_property(srna, "draw_edge_lenght", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGELEN);
+ RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_edge_angle", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGEANG);
+ RNA_def_property_ui_text(prop, "Edge Angles", "Displays the angles in the selected edges in degrees");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "draw_face_area", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FACEAREA);
+ RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index 257b10d8408..7b14a7a4712 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -37,7 +37,9 @@
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
+#include "BKE_mball.h"
#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "WM_types.h"
#include "WM_api.h"
@@ -50,11 +52,19 @@ static int rna_Meta_texspace_editable(PointerRNA *ptr)
static void rna_MetaBall_update_data(bContext *C, PointerRNA *ptr)
{
+ Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
-
- WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
- DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+ MetaBall *mb= ptr->id.data;
+ Object *ob;
+
+ for(ob=bmain->object.first; ob; ob= ob->id.next) {
+ if(ob->data == mb) {
+ copy_mball_properties(scene, ob);
+ /* XXX this will loop over all objects again (slow) */
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
+ }
+ }
}
#else
@@ -83,27 +93,38 @@ void rna_def_metaelement(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "rad");
RNA_def_property_ui_text(prop, "Radius", "");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "expx");
RNA_def_property_range(prop, 0.0f, 20.0f);
- RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Size", "Size of element, use of components depends on element type.");
+ RNA_def_property_ui_text(prop, "Size X", "Size of element, use of components depends on element type.");
+ RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
+
+ prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "expy");
+ RNA_def_property_range(prop, 0.0f, 20.0f);
+ RNA_def_property_ui_text(prop, "Size Y", "Size of element, use of components depends on element type.");
+ RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
+
+ prop= RNA_def_property(srna, "size_z", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "expz");
+ RNA_def_property_range(prop, 0.0f, 20.0f);
+ RNA_def_property_ui_text(prop, "Size Z", "Size of element, use of components depends on element type.");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
@@ -144,7 +165,7 @@ void rna_def_metaball(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "MetaElement");
RNA_def_property_ui_text(prop, "Elements", "Meta elements.");
- prop= RNA_def_property(srna, "last_selected_element", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "active_element", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "lastelem");
RNA_def_property_ui_text(prop, "Last selected element.", "Last selected element.");
@@ -155,16 +176,17 @@ void rna_def_metaball(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */
- prop= RNA_def_property(srna, "wire_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "wire_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "wiresize");
RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport.");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
- prop= RNA_def_property(srna, "render_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "render_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "rendersize");
RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering.");
+ RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "thresh");
@@ -174,6 +196,9 @@ void rna_def_metaball(BlenderRNA *brna)
/* materials, textures */
rna_def_texmat_common(srna, "rna_Meta_texspace_editable");
+
+ /* anim */
+ rna_def_animdata_common(srna);
}
void RNA_def_meta(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index c89cc4ad63e..bb073d19a46 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -34,46 +34,51 @@
#include "DNA_armature_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
+#include "DNA_object_force.h"
#include "DNA_scene_types.h"
#include "BKE_bmesh.h" /* For BevelModifierData */
+#include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */
#include "WM_types.h"
EnumPropertyItem modifier_type_items[] ={
- {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
+ {0, "", 0, "Generate", ""},
{eModifierType_Array, "ARRAY", ICON_MOD_ARRAY, "Array", ""},
{eModifierType_Bevel, "BEVEL", ICON_MOD_BEVEL, "Bevel", ""},
{eModifierType_Boolean, "BOOLEAN", ICON_MOD_BOOLEAN, "Boolean", ""},
{eModifierType_Build, "BUILD", ICON_MOD_BUILD, "Build", ""},
+ {eModifierType_Decimate, "DECIMATE", ICON_MOD_DECIM, "Decimate", ""},
+ {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
+ {eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
+ {eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
+ {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
+ {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
+ {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
+ {0, "", 0, "Deform", ""},
+ {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
{eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
- {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
- {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
{eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""},
- {eModifierType_Decimate, "DECIMATE", ICON_MOD_DECIM, "Decimate", ""},
{eModifierType_Displace, "DISPLACE", ICON_MOD_DISPLACE, "Displace", ""},
- {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
- {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""},
- {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""},
{eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", ""},
{eModifierType_Lattice, "LATTICE", ICON_MOD_LATTICE, "Lattice", ""},
- {eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
{eModifierType_MeshDeform, "MESH_DEFORM", ICON_MOD_MESHDEFORM, "Mesh Deform", ""},
- {eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
- {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multires", ""},
- {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
- {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
{eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""},
{eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""},
{eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""},
- {eModifierType_Softbody, "SOFTBODY", ICON_MOD_SOFT, "Soft Body", ""},
- {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subsurf", ""},
- {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""},
- {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""},
{eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""},
+ {0, "", 0, "Physics", ""},
+ {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
+ {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
+ {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""},
+ {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""},
+ {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
+ {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
+ {eModifierType_Smoke, "SMOKE", 0, "Smoke", ""},
+ {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
+ {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""},
{0, NULL, 0, NULL, NULL}};
-
#ifdef RNA_RUNTIME
#include "BKE_context.h"
@@ -83,7 +88,7 @@ EnumPropertyItem modifier_type_items[] ={
static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
UVProjectModifierData *uvp= (UVProjectModifierData*)ptr->data;
- rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), 10, 0, NULL);
+ rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), uvp->num_projectors, 0, NULL);
}
static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
@@ -151,6 +156,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
return &RNA_MultiresModifier;
case eModifierType_Surface:
return &RNA_SurfaceModifier;
+ case eModifierType_Smoke:
+ return &RNA_SmokeModifier;
default:
return &RNA_Modifier;
}
@@ -172,6 +179,25 @@ static void rna_Modifier_dependency_update(bContext *C, PointerRNA *ptr)
DAG_scene_sort(CTX_data_scene(C));
}
+static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr)
+{
+ SmokeModifierData *smd= (SmokeModifierData *)ptr->data;
+ Object *ob= (Object*)ptr->id.data;
+
+ // nothing changed
+ if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
+ return;
+
+ smokeModifier_free(smd); // XXX TODO: completely free all 3 pointers
+ smokeModifier_createType(smd); // create regarding of selected type
+
+ if(smd->type & MOD_SMOKE_TYPE_DOMAIN)
+ ob->dt = OB_WIRE;
+
+ // update dependancy since a domain - other type switch could have happened
+ rna_Modifier_dependency_update(C, ptr);
+}
+
static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
{
ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
@@ -362,12 +388,46 @@ static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_SoftBodySettings, ob->soft);
}
+static PointerRNA rna_SoftBodyModifier_point_cache_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ return rna_pointer_inherit_refine(ptr, &RNA_PointCache, ob->soft->pointcache);
+}
+
static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
}
+static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr)
+{
+ Object **ob= (Object**)ptr->data;
+ return rna_pointer_inherit_refine(ptr, &RNA_Object, *ob);
+}
+
+static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value)
+{
+ Object **ob= (Object**)ptr->data;
+
+ if(*ob)
+ id_us_min((ID*)*ob);
+ if(value.data)
+ id_us_plus((ID*)value.data);
+
+ *ob= value.data;
+}
+
+static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
+{
+ UVProjectModifierData *md= (UVProjectModifierData*)ptr->data;
+ int a;
+
+ md->num_projectors= CLAMPIS(value, 1, MOD_UVPROJECT_MAX);
+ for(a=md->num_projectors; a<MOD_UVPROJECT_MAX; a++)
+ md->projectors[a]= NULL;
+}
+
#else
static void rna_def_property_subdivision_common(StructRNA *srna, const char type[])
@@ -510,12 +570,12 @@ static void rna_def_modifier_build(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "BuildModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD);
- prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_TIME);
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start", "Specify the start frame of the effect.");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_TIME);
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Length", "Specify the total time the build effect requires");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
@@ -669,32 +729,32 @@ static void rna_def_modifier_wave(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Time Offset", "Either the starting frame (for positive speed) or ending frame (for negative speed.)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Lifetime", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "damp");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Damping Time", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "falloff");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 100, 100, 2);
RNA_def_property_ui_text(prop, "Falloff Radius", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "startx");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100, 100, 100, 2);
RNA_def_property_ui_text(prop, "Start Position X", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starty");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, -100, 100, 100, 2);
@@ -825,7 +885,7 @@ static void rna_def_modifier_hook(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "HookModifierData");
RNA_def_struct_ui_icon(srna, ICON_HOOK);
- prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 100, 100, 2);
RNA_def_property_ui_text(prop, "Falloff", "If not zero, the distance from the hook where influence ends.");
@@ -840,6 +900,11 @@ static void rna_def_modifier_hook(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
+
+ prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "subtarget");
+ RNA_def_property_ui_text(prop, "Sub-Target", "Name of Parent Bone for hook (if applicable), also recalculates and clears offset");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
@@ -862,6 +927,11 @@ static void rna_def_modifier_softbody(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "SoftBodySettings");
RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Settings", "");
+
+ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "PointCache");
+ RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Soft Body Point Cache", "");
}
static void rna_def_modifier_boolean(BlenderRNA *brna)
@@ -920,7 +990,7 @@ static void rna_def_modifier_array(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make.");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Length", "Length to fit array within.");
@@ -934,22 +1004,22 @@ static void rna_def_modifier_array(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update");
/* Offset parameters */
- prop= RNA_def_property(srna, "constant_offset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "constant_offset", PROP_BOOLEAN, PROP_TRANSLATION);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST);
RNA_def_property_ui_text(prop, "Constant Offset", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "constant_offset_displacement", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "constant_offset_displacement", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Constant Offset Displacement", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "relative_offset", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "relative_offset", PROP_BOOLEAN, PROP_TRANSLATION);
RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_RELATIVE);
RNA_def_property_ui_text(prop, "Relative Offset", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "relative_offset_displacement", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "relative_offset_displacement", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_ui_text(prop, "Relative Offset Displacement", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
@@ -965,7 +1035,7 @@ static void rna_def_modifier_array(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in first and last duplicates.");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "merge_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "merge_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "merge_dist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 1, 4);
@@ -1103,7 +1173,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "UVProjectModifier", "Modifier");
- RNA_def_struct_ui_text(srna, "UVProject Modifier", "UV projection modifier to sets UVs from a projector.");
+ RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to sets UVs from a projector.");
RNA_def_struct_sdna(srna, "UVProjectModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT);
@@ -1113,9 +1183,15 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+ prop= RNA_def_property(srna, "num_projectors", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use.");
+ RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL);
+ RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+
prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "Object");
- RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", 0, 0, 0, 0, 0);
+ RNA_def_property_struct_type(prop, "UVProjector");
+ RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0);
RNA_def_property_ui_text(prop, "Projectors", "");
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
@@ -1141,6 +1217,15 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE);
RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image.");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
+
+ srna= RNA_def_struct(brna, "UVProjector", NULL);
+ RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier.");
+
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform.");
}
static void rna_def_modifier_smooth(BlenderRNA *brna)
@@ -1247,7 +1332,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Factor", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 100, 10, 2);
RNA_def_property_ui_text(prop, "Radius", "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite.)");
@@ -1466,6 +1551,41 @@ static void rna_def_modifier_cloth(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Point Cache", "");
}
+static void rna_def_modifier_smoke(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_smoke_type_items[] = {
+ {0, "NONE", 0, "None", ""},
+ {MOD_SMOKE_TYPE_DOMAIN, "TYPE_DOMAIN", 0, "Domain", ""},
+ {MOD_SMOKE_TYPE_FLOW, "TYPE_FLOW", 0, "Flow", "Inflow/Outflow"},
+ {MOD_SMOKE_TYPE_COLL, "TYPE_COLL", 0, "Collision", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "SmokeModifier", "Modifier");
+ RNA_def_struct_ui_text(srna, "Smoke Modifier", "Smoke simulation modifier.");
+ RNA_def_struct_sdna(srna, "SmokeModifierData");
+
+ prop= RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "domain");
+ RNA_def_property_ui_text(prop, "Domain Settings", "");
+
+ prop= RNA_def_property(srna, "flow_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "flow");
+ RNA_def_property_ui_text(prop, "Flow Settings", "");
+
+ prop= RNA_def_property(srna, "coll_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "coll");
+ RNA_def_property_ui_text(prop, "Collision Settings", "");
+
+ prop= RNA_def_property(srna, "smoke_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, prop_smoke_type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_set_type");
+}
+
static void rna_def_modifier_collision(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1763,7 +1883,6 @@ static void rna_def_modifier_surface(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SurfaceModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
}
-
void RNA_def_modifier(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1793,7 +1912,7 @@ void RNA_def_modifier(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime);
RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier.");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
- RNA_def_property_ui_icon(prop, ICON_VIEW3D, 0);
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
prop= RNA_def_property(srna, "render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
@@ -1847,6 +1966,7 @@ void RNA_def_modifier(BlenderRNA *brna)
rna_def_modifier_simpledeform(brna);
rna_def_modifier_multires(brna);
rna_def_modifier_surface(brna);
+ rna_def_modifier_smoke(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index bc636af6849..690a198f12c 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -61,6 +61,30 @@ void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
}
}
+static char *rna_NlaStrip_path(PointerRNA *ptr)
+{
+ NlaStrip *strip= (NlaStrip *)ptr->data;
+ AnimData *adt= BKE_animdata_from_id(ptr->id.data);
+
+ /* if we're attached to AnimData, try to resolve path back to AnimData */
+ if (adt) {
+ NlaTrack *nlt;
+ NlaStrip *nls;
+
+ for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
+ for (nls = nlt->strips.first; nls; nls = nls->next) {
+ if (nls == strip) {
+ // XXX but if we animate like this, the control will never work...
+ return BLI_sprintfN("animation_data.nla_tracks[\"%s\"].strips[\"%s\"]", nlt->name, strip->name);
+ }
+ }
+ }
+ }
+
+ /* no path */
+ return "";
+}
+
static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
{
@@ -243,6 +267,19 @@ static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value)
#else
+/* enum defines exported for rna_animation.c */
+EnumPropertyItem nla_mode_blend_items[] = {
+ {NLASTRIP_MODE_REPLACE, "REPLACE", 0, "Replace", "Result strip replaces the accumulated results by amount specified by influence."},
+ {NLASTRIP_MODE_ADD, "ADD", 0, "Add", "Weighted result of strip is added to the accumlated results."},
+ {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", 0, "Subtract", "Weighted result of strip is removed from the accumlated results."},
+ {NLASTRIP_MODE_MULTIPLY, "MULITPLY", 0, "Multiply", "Weighted result of strip is multiplied with the accumlated results."},
+ {0, NULL, 0, NULL, NULL}};
+EnumPropertyItem nla_mode_extend_items[] = {
+ {NLASTRIP_EXTEND_NOTHING, "NOTHING", 0, "Nothing", "Strip has no influence past its extents."},
+ {NLASTRIP_EXTEND_HOLD, "HOLD", 0, "Hold", "Hold the first frame if no previous strips in track, and always hold last frame."},
+ {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame."},
+ {0, NULL, 0, NULL, NULL}};
+
void rna_def_nlastrip(BlenderRNA *brna)
{
StructRNA *srna;
@@ -254,21 +291,11 @@ void rna_def_nlastrip(BlenderRNA *brna)
{NLASTRIP_TYPE_TRANSITION, "TRANSITION", 0, "Transition", "NLA Strip 'transitions' between adjacent strips."},
{NLASTRIP_TYPE_META, "META", 0, "Meta", "NLA Strip acts as a container for adjacent strips."},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_mode_blend_items[] = {
- {NLASTRIP_MODE_REPLACE, "REPLACE", 0, "Replace", "Result strip replaces the accumulated results by amount specified by influence."},
- {NLASTRIP_MODE_ADD, "ADD", 0, "Add", "Weighted result of strip is added to the accumlated results."},
- {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", 0, "Subtract", "Weighted result of strip is removed from the accumlated results."},
- {NLASTRIP_MODE_MULTIPLY, "MULITPLY", 0, "Multiply", "Weighted result of strip is multiplied with the accumlated results."},
- {0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_mode_extend_items[] = {
- {NLASTRIP_EXTEND_NOTHING, "NOTHING", 0, "Nothing", "Strip has no influence past its extents."},
- {NLASTRIP_EXTEND_HOLD, "HOLD", 0, "Hold", "Hold the first frame if no previous strips in track, and always hold last frame."},
- {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame."},
- {0, NULL, 0, NULL, NULL}};
/* struct definition */
srna= RNA_def_struct(brna, "NlaStrip", NULL);
RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action.");
+ RNA_def_struct_path_func(srna, "rna_NlaStrip_path");
RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX
/* name property */
@@ -286,21 +313,21 @@ void rna_def_nlastrip(BlenderRNA *brna)
prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extendmode");
- RNA_def_property_enum_items(prop, prop_mode_extend_items);
+ RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents.");
prop= RNA_def_property(srna, "blending", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendmode");
- RNA_def_property_enum_items(prop, prop_mode_blend_items);
+ RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result.");
/* Strip extents */
- prop= RNA_def_property(srna, "start_frame", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "start");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "");
- prop= RNA_def_property(srna, "end_frame", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "end_frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "end");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "");
@@ -323,15 +350,16 @@ void rna_def_nlastrip(BlenderRNA *brna)
/* Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip.");
/* Action extents */
- prop= RNA_def_property(srna, "action_start_frame", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "action_start_frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actstart");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action Start Frame", "");
- prop= RNA_def_property(srna, "action_end_frame", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "action_end_frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actend");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action End Frame", "");
@@ -369,7 +397,7 @@ void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result.");
- prop= RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate.");
// TODO: should the animated_influence/time settings be animatable themselves?
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index a03b59556e1..23e79831292 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1354,7 +1354,7 @@ static void rna_def_node(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "bNode");
RNA_def_struct_refine_func(srna, "rna_Node_refine");
- prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "locx");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, -10000.0f, 10000.0f);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 53a73e0b03e..bbb10991564 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -41,6 +41,18 @@
#include "WM_types.h"
+
+EnumPropertyItem object_mode_items[] = {
+ {OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object", ""},
+ {OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit", ""},
+ {OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt", ""},
+ {OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""},
+ {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""},
+ {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
+ {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""},
+ {OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose", ""},
+ {0, NULL, 0, NULL, NULL}};
+
static EnumPropertyItem parent_type_items[] = {
{PAROBJECT, "OBJECT", 0, "Object", ""},
{PARCURVE, "CURVE", 0, "Curve", ""},
@@ -57,6 +69,7 @@ static EnumPropertyItem parent_type_items[] = {
#include "DNA_key_types.h"
#include "BKE_armature.h"
+#include "BKE_bullet.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
@@ -479,6 +492,86 @@ static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str)
strcpy(str, "");
}
+/* why does this have to be so complicated?, can't all this crap be
+ * moved to in BGE conversion function? - Campbell *
+ *
+ * logic from check_body_type()
+ * */
+static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+
+ /* determine the body_type setting based on flags */
+ if (!(ob->gameflag & OB_COLLISION)) {
+ if (ob->gameflag & OB_OCCLUDER) {
+ ob->body_type = OB_BODY_TYPE_OCCLUDER;
+ } else {
+ ob->body_type = OB_BODY_TYPE_NO_COLLISION;
+ }
+ } else if (ob->gameflag & OB_SENSOR) {
+ ob->body_type = OB_BODY_TYPE_SENSOR;
+ } else if (!(ob->gameflag & OB_DYNAMIC)) {
+ ob->body_type = OB_BODY_TYPE_STATIC;
+ } else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY))) {
+ ob->body_type = OB_BODY_TYPE_DYNAMIC;
+ } else if (ob->gameflag & OB_RIGID_BODY) {
+ ob->body_type = OB_BODY_TYPE_RIGID;
+ } else {
+ ob->body_type = OB_BODY_TYPE_SOFT;
+ /* create the structure here because we display soft body buttons in the main panel */
+ if (!ob->bsoft)
+ ob->bsoft = bsbNew();
+ }
+
+ return ob->body_type;
+}
+
+static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
+{
+ Object *ob= (Object*)ptr->id.data;
+ ob->body_type= value;
+
+ switch (ob->body_type) {
+ case OB_BODY_TYPE_SENSOR:
+ ob->gameflag |= OB_SENSOR|OB_COLLISION|OB_GHOST;
+ ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE);
+ break;
+ case OB_BODY_TYPE_OCCLUDER:
+ ob->gameflag |= OB_OCCLUDER;
+ ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_DYNAMIC);
+ break;
+ case OB_BODY_TYPE_NO_COLLISION:
+ ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_OCCLUDER|OB_DYNAMIC);
+ break;
+ case OB_BODY_TYPE_STATIC:
+ ob->gameflag |= OB_COLLISION;
+ ob->gameflag &= ~(OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR);
+ break;
+ case OB_BODY_TYPE_DYNAMIC:
+ ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_ACTOR;
+ ob->gameflag &= ~(OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR);
+ break;
+ case OB_BODY_TYPE_RIGID:
+ ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR;
+ ob->gameflag &= ~(OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR);
+ break;
+ default:
+ case OB_BODY_TYPE_SOFT:
+ ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_SOFT_BODY|OB_ACTOR;
+ ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR);
+
+ /* assume triangle mesh, if no bounds chosen for soft body */
+ if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_POLYH))
+ {
+ ob->boundtype=OB_BOUND_POLYH;
+ }
+ /* create a BulletSoftBody structure if not already existing */
+ if (!ob->bsoft)
+ ob->bsoft = bsbNew();
+ break;
+ }
+}
+
static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -667,11 +760,13 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem body_type_items[] = {
- {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", 0, "No Collision", ""},
- {OB_BODY_TYPE_STATIC, "STATIC", 0, "Static", ""},
- {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", ""},
- {OB_BODY_TYPE_RIGID, "RIGID_BODY", 0, "Rigid Body", ""},
- {OB_BODY_TYPE_SOFT, "SOFT_BODY", 0, "Soft Body", ""},
+ {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", 0, "No Collision", "Disable colision for this object"},
+ {OB_BODY_TYPE_STATIC, "STATIC", 0, "Static", "Stationary object"},
+ {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", "Linear physics"},
+ {OB_BODY_TYPE_RIGID, "RIGID_BODY", 0, "Rigid Body", "Linear and angular physics"},
+ {OB_BODY_TYPE_SOFT, "SOFT_BODY", 0, "Soft Body", "Soft body"},
+ {OB_BODY_TYPE_OCCLUDER, "OCCLUDE", 0, "Occlude", "Occluder for optimizing scene rendering"},
+ {OB_BODY_TYPE_SENSOR, "SENSOR", 0, "Sensor", "Collision Sensor, detects static and dynamic objects but not the other collision sensor objects"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem collision_bounds_items[] = {
@@ -679,8 +774,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
{OB_BOUND_CONE, "CONE", 0, "Cone", ""},
- {OB_BOUND_POLYH, "CONVEX_HULL", 0, "Convex Hull", ""},
- {OB_BOUND_POLYT, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
+ {OB_BOUND_POLYT, "CONVEX_HULL", 0, "Convex Hull", ""},
+ {OB_BOUND_POLYH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
//{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
{0, NULL, 0, NULL, NULL}};
@@ -726,7 +821,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "body_type");
RNA_def_property_enum_items(prop, body_type_items);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // this controls various gameflags
+ RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation.");
prop= RNA_def_property(srna, "actor", PROP_BOOLEAN, PROP_NONE);
@@ -741,10 +836,10 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0.01, 10000.0);
RNA_def_property_ui_text(prop, "Mass", "Mass of the object.");
- prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "inertia");
RNA_def_property_range(prop, 0.01, 10.0);
- RNA_def_property_ui_text(prop, "Radius", "Radius for Bounding sphere and Fh/Fh Rot.");
+ RNA_def_property_ui_text(prop, "Radius", "Radius of bounding sphere and material physics");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "no_sleeping", PROP_BOOLEAN, PROP_NONE);
@@ -804,13 +899,13 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis.");
- prop= RNA_def_property(srna, "do_fh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "material_physics", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH);
- RNA_def_property_ui_text(prop, "Do Fh", "Use Fh settings in materials.");
+ RNA_def_property_ui_text(prop, "Use Material Physics", "Use physics settings in materials.");
- prop= RNA_def_property(srna, "rotation_fh", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "rotate_from_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);
- RNA_def_property_ui_text(prop, "Rotation Fh", "Use face normal to rotate Object");
+ RNA_def_property_ui_text(prop, "Rotate From Normal", "Use face normal to rotate object, so that it points away from the surface");
prop= RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "formfactor");
@@ -821,7 +916,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION);
RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction.");
- prop= RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Friction Coefficients", "Relative friction coefficient in the in the X, Y and Z directions, when anisotropic friction is enabled.");
@@ -839,7 +934,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD);
RNA_def_property_ui_text(prop, "Collison Compound", "Add children to form a compound collision object.");
- prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "margin");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Collision Margin", "Extra margin around object for collision detection, small amount required for stability.");
@@ -934,6 +1029,8 @@ static void rna_def_object(BlenderRNA *brna)
{OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing."},
{0, NULL, 0, NULL, NULL}};
+ unsigned short matrix_dimsize[]= {4};
+
srna= RNA_def_struct(brna, "Object", "ID");
RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene..");
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
@@ -953,6 +1050,12 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Type", "Type of Object.");
+ prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, object_mode_items);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Mode", "Object interaction mode.");
+
prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
@@ -1038,50 +1141,51 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "actcol");
RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", "rna_Object_active_material_index_range");
RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot.");
-
+ RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, NULL);
+
/* transform */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "Location of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dloc");
RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "Rotation of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "delta_rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "delta_rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "drot");
RNA_def_property_ui_text(prop, "Delta Rotation", "Extra added rotation to the rotation of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "Scaling of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "dsize");
RNA_def_property_ui_text(prop, "Delta Scale", "Extra added scaling to the scale of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_VECTOR);
+ prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface.");
- prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_VECTOR);
+ prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface.");
- prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_VECTOR);
+ prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface.");
@@ -1089,7 +1193,7 @@ static void rna_def_object(BlenderRNA *brna)
/* matrix */
prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "obmat");
- RNA_def_property_array(prop, 16);
+ RNA_def_property_multidimensional_array(prop, 16, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix.");
/* collections */
@@ -1135,7 +1239,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Empty Draw Type", "Viewport display style for empties.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "empty_drawsize");
RNA_def_property_range(prop, 0.01, 10.0);
RNA_def_property_ui_text(prop, "Empty Draw Size", "Size of of display for empties in the viewport.");
@@ -1261,25 +1365,25 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
- prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupsta");
RNA_def_property_range(prop, 1, 32767);
RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
- prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupend");
RNA_def_property_range(prop, 1, 32767);
RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
- prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupon");
RNA_def_property_range(prop, 1, 1500);
RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
- prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupoff");
RNA_def_property_range(prop, 0, 1500);
RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes.");
@@ -1287,7 +1391,7 @@ static void rna_def_object(BlenderRNA *brna)
/* time offset */
- prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_float_sdna(prop, NULL, "sf");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for IPO's and dupligroup instances.");
@@ -1361,6 +1465,13 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ /* Grease Pencil */
+ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "gpd");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_struct_type(prop, "GreasePencil");
+ RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
+
/* pose */
prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "poselib");
@@ -1372,11 +1483,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Pose");
RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures.");
- prop= RNA_def_property(srna, "pose_mode", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_POSEMODE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode.");
-
/* shape keys */
prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 965b70714dc..932bef9969d 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -148,6 +148,7 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr)
if(new_name) {
if(pid2 && cache->flag & PTCACHE_DISK_CACHE) {
+ /* TODO: change to simple file rename */
strcpy(name, cache->name);
strcpy(cache->name, cache->prev_name);
@@ -169,93 +170,174 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr)
BLI_freelistN(&pidlist);
}
+static void rna_Cache_list_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Object *ob = ptr->id.data;
+ PointCache *cache= ptr->data;
+ PTCacheID *pid;
+ ListBase pidlist;
+
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache) {
+ rna_iterator_listbase_begin(iter, pid->ptcaches, NULL);
+ break;
+ }
+ }
+
+ BLI_freelistN(&pidlist);
+}
+static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ Object *ob = ptr->id.data;
+ PointCache *cache= ptr->data;
+ PTCacheID *pid;
+ ListBase pidlist;
+
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ *min= 0;
+ *max= 0;
+
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache) {
+ *max= BLI_countlist(pid->ptcaches)-1;
+ *max= MAX2(0, *max);
+ break;
+ }
+ }
+
+ BLI_freelistN(&pidlist);
+}
+
+static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr)
+{
+ Object *ob = ptr->id.data;
+ PointCache *cache= ptr->data;
+ PTCacheID *pid;
+ ListBase pidlist;
+ int num = 0;
+
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache) {
+ num = BLI_findindex(pid->ptcaches, cache);
+ break;
+ }
+ }
+
+ BLI_freelistN(&pidlist);
+
+ return num;
+}
+
+static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int value)
+{
+ Object *ob = ptr->id.data;
+ PointCache *cache= ptr->data;
+ PTCacheID *pid;
+ ListBase pidlist;
+
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ for(pid=pidlist.first; pid; pid=pid->next) {
+ if(pid->cache == cache) {
+ *(pid->cache_ptr) = BLI_findlink(pid->ptcaches, value);
+ break;
+ }
+ }
+
+ BLI_freelistN(&pidlist);
+}
static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_EDGES) != 0);
}
static void rna_SoftBodySettings_use_edges_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
if(value) data->softflag |= OB_SB_EDGES;
else data->softflag &= ~OB_SB_EDGES;
}
static int rna_SoftBodySettings_use_goal_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_GOAL) != 0);
}
static void rna_SoftBodySettings_use_goal_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
if(value) data->softflag |= OB_SB_GOAL;
else data->softflag &= ~OB_SB_GOAL;
}
static int rna_SoftBodySettings_stiff_quads_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_QUADS) != 0);
}
static void rna_SoftBodySettings_stiff_quads_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
if(value) data->softflag |= OB_SB_QUADS;
else data->softflag &= ~OB_SB_QUADS;
}
static int rna_SoftBodySettings_self_collision_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_SELF) != 0);
}
static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
if(value) data->softflag |= OB_SB_SELF;
else data->softflag &= ~OB_SB_SELF;
}
static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_AERO_ANGLE) != 0);
}
static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
if(value) data->softflag |= OB_SB_AERO_ANGLE;
else data->softflag &= ~OB_SB_AERO_ANGLE;
}
static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_FACECOLL) != 0);
}
static void rna_SoftBodySettings_face_collision_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
if(value) data->softflag |= OB_SB_FACECOLL;
else data->softflag &= ~OB_SB_FACECOLL;
}
static int rna_SoftBodySettings_edge_collision_get(PointerRNA *ptr)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
return (((data->softflag) & OB_SB_EDGECOLL) != 0);
}
static void rna_SoftBodySettings_edge_collision_set(PointerRNA *ptr, int value)
{
- Object *data= (Object*)(ptr->data);
+ Object *data= (Object*)(ptr->id.data);
if(value) data->softflag |= OB_SB_EDGECOLL;
else data->softflag &= ~OB_SB_EDGECOLL;
}
@@ -371,13 +453,14 @@ static void rna_def_pointcache(BlenderRNA *brna)
srna= RNA_def_struct(brna, "PointCache", NULL);
RNA_def_struct_ui_text(srna, "Point Cache", "Point cache for physics simulations.");
+ RNA_def_struct_ui_icon(srna, ICON_PHYSICS);
- prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startframe");
RNA_def_property_range(prop, 1, 300000);
RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts.");
- prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endframe");
RNA_def_property_range(prop, 1, 300000);
RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops.");
@@ -420,6 +503,7 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "Cache name");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
+ RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "path");
@@ -440,6 +524,16 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_EXTERNAL);
RNA_def_property_ui_text(prop, "External", "Read cache from an external location");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
+
+ prop= RNA_def_property(srna, "point_cache_list", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0);
+ RNA_def_property_struct_type(prop, "PointCache");
+ RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list");
+
+ prop= RNA_def_property(srna, "active_point_cache_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range");
+ RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
}
static void rna_def_collision(BlenderRNA *brna)
@@ -715,10 +809,68 @@ static void rna_def_field(BlenderRNA *brna)
static void rna_def_game_softbody(BlenderRNA *brna)
{
StructRNA *srna;
+ PropertyRNA *prop;
srna= RNA_def_struct(brna, "GameSoftBodySettings", NULL);
RNA_def_struct_sdna(srna, "BulletSoftBody");
RNA_def_struct_ui_text(srna, "Game Soft Body Settings", "Soft body simulation settings for an object in the game engine.");
+
+ /* Floats */
+
+ prop= RNA_def_property(srna, "linstiff", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "linStiff");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Linear Stiffness", "Linear stiffness of the soft body links");
+
+ prop= RNA_def_property(srna, "dynamic_friction", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "kDF");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Friction", "Dynamic Friction");
+
+ prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "kMT");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Threshold", "Shape matching threshold");
+
+ prop= RNA_def_property(srna, "margin", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "margin");
+ RNA_def_property_range(prop, 0.01f, 1.0f);
+ RNA_def_property_ui_text(prop, "Margin", "Collision margin for soft body. Small value makes the algorithm unstable");
+
+ prop= RNA_def_property(srna, "welding", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "welding");
+ RNA_def_property_range(prop, 0.0f, 0.01f);
+ RNA_def_property_ui_text(prop, "Welding", "Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)");
+
+ /* Integers */
+
+ prop= RNA_def_property(srna, "position_iterations", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "piterations");
+ RNA_def_property_range(prop, 0, 10);
+ RNA_def_property_ui_text(prop, "Position Iterations", "Position solver iterations");
+
+ prop= RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "numclusteriterations");
+ RNA_def_property_range(prop, 1, 128);
+ RNA_def_property_ui_text(prop, "Cluster Iterations", "Specify the number of cluster iterations");
+
+ /* Booleans */
+
+ prop= RNA_def_property(srna, "shape_match", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_SHAPE_MATCHING);
+ RNA_def_property_ui_text(prop, "Shape Match", "Enable soft body shape matching goal");
+
+ prop= RNA_def_property(srna, "bending_const", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_BENDING_CONSTRAINTS);
+ RNA_def_property_ui_text(prop, "Bending Const", "Enable bending constraints");
+
+ prop= RNA_def_property(srna, "cluster_rigid_to_softbody", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_RS);
+ RNA_def_property_ui_text(prop, "Rigid to Soft Body", "Enable cluster collision between soft and rigid body");
+
+ prop= RNA_def_property(srna, "cluster_soft_to_softbody", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_SS);
+ RNA_def_property_ui_text(prop, "Soft to Soft Body", "Enable cluster collision between soft and soft body");
}
static void rna_def_softbody(BlenderRNA *brna)
@@ -752,7 +904,7 @@ static void rna_def_softbody(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mass", "");
RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data");
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "grav");
RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_text(prop, "Gravitation", "Apply gravitation to point movement");
diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c
index 6b9a708f555..85918bce05b 100644
--- a/source/blender/makesrna/intern/rna_packedfile.c
+++ b/source/blender/makesrna/intern/rna_packedfile.c
@@ -31,6 +31,13 @@
#include "DNA_packedFile_types.h"
+EnumPropertyItem unpack_method_items[] = {
+ {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""},
+ {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""},
+ {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""},
+ {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#else
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 3ebdd61ca50..a1f35eca3c2 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -98,6 +98,7 @@ EnumPropertyItem part_hair_ren_as_items[] = {
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_particle.h"
+#include "BKE_pointcache.h"
#include "BLI_arithb.h"
@@ -436,7 +437,30 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
else
strcpy(str, "Invalid target!");
}
+static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr)
+{
+ ParticleSystem *psys= (ParticleSystem*)ptr->data;
+
+ return (psys->ptcaches.first != psys->ptcaches.last);
+}
+static int rna_ParticleSystem_editable_get(PointerRNA *ptr)
+{
+ ParticleSystem *psys= (ParticleSystem*)ptr->data;
+
+ if(psys->part && psys->part->type==PART_HAIR)
+ return (psys->flag & PSYS_HAIR_DONE);
+ else
+ return (psys->pointcache->flag & PTCACHE_BAKED);
+}
+static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
+{
+ ParticleSystem *psys= (ParticleSystem*)ptr->data;
+ if(psys->part && psys->part->type==PART_HAIR)
+ return (psys->edit && psys->edit->edited);
+ else
+ return (psys->pointcache->edit && psys->pointcache->edit->edited);
+}
EnumPropertyItem from_items[] = {
{PART_FROM_VERT, "VERT", 0, "Vertexes", ""},
{PART_FROM_FACE, "FACE", 0, "Faces", ""},
@@ -536,7 +560,7 @@ static void rna_def_particle_hair_key(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "HairKey");
RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system.");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "co");
RNA_def_property_ui_text(prop, "Location", "Key location.");
@@ -555,19 +579,19 @@ static void rna_def_particle_key(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ParticleKey", NULL);
RNA_def_struct_ui_text(srna, "Particle Key", "Key location for a particle over time.");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "co");
RNA_def_property_ui_text(prop, "Location", "Key location.");
- prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "vel");
RNA_def_property_ui_text(prop, "Velocity", "Key velocity");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "Key rotation quaterion.");
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "ave");
RNA_def_property_ui_text(prop, "Angular Velocity", "Key angular velocity.");
@@ -616,35 +640,35 @@ static void rna_def_particle(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stick Object", "Object that particle sticks to when dead");
/* Particle State & Previous State */
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "state.co");
RNA_def_property_ui_text(prop, "Particle Location", "");
- prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "state.vel");
RNA_def_property_ui_text(prop, "Particle Velocity", "");
- prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "state.ave");
RNA_def_property_ui_text(prop, "Angular Velocity", "");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "state.rot");
RNA_def_property_ui_text(prop, "Rotation", "");
- prop= RNA_def_property(srna, "prev_location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "prev_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "prev_state.co");
RNA_def_property_ui_text(prop, "Previous Particle Location", "");
- prop= RNA_def_property(srna, "prev_velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "prev_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "prev_state.vel");
RNA_def_property_ui_text(prop, "Previous Particle Velocity", "");
- prop= RNA_def_property(srna, "prev_angular_velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "prev_angular_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "prev_state.ave");
RNA_def_property_ui_text(prop, "Previous Angular Velocity", "");
- prop= RNA_def_property(srna, "prev_rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "prev_rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "prev_state.rot");
RNA_def_property_ui_text(prop, "Previous Rotation", "");
@@ -662,17 +686,17 @@ static void rna_def_particle(BlenderRNA *brna)
/* Random variables */
- prop= RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "r_rot");
// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
RNA_def_property_ui_text(prop, "Random Rotation", "");
- prop= RNA_def_property(srna, "random_a_velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "random_a_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "r_ave");
// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
RNA_def_property_ui_text(prop, "Random Angular Velocity", "");
- prop= RNA_def_property(srna, "random_velocity", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "random_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "r_ve");
// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
RNA_def_property_ui_text(prop, "Random Velocity", "");
@@ -681,16 +705,16 @@ static void rna_def_particle(BlenderRNA *brna)
// float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
// /* face normal for volume emission */
- prop= RNA_def_property(srna, "birthtime", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "birthtime", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
RNA_def_property_ui_text(prop, "Birth Time", "");
- prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
RNA_def_property_ui_text(prop, "Lifetime", "");
- prop= RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "dietime");
// RNA_def_property_range(prop, lowerLimitf, upperLimitf);
RNA_def_property_ui_text(prop, "Die Time", "");
@@ -725,27 +749,10 @@ static void rna_def_particle(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_STICKY);
RNA_def_property_ui_text(prop, "sticky", "");
- prop= RNA_def_property(srna, "transform", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TRANSFORM);
- RNA_def_property_ui_text(prop, "transform", "");
-
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_HIDE);
- RNA_def_property_ui_text(prop, "hide", "");
-
- prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TAG);
- RNA_def_property_ui_text(prop, "tag", "");
-
prop= RNA_def_property(srna, "rekey", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_REKEY);
RNA_def_property_ui_text(prop, "rekey", "");
- prop= RNA_def_property(srna, "edit_recalc", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_EDIT_RECALC);
- RNA_def_property_ui_text(prop, "edit_recalc", "");
-
-
prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "alive");
RNA_def_property_enum_items(prop, alive_items);
@@ -1261,7 +1268,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards");
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
- prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "bb_offset");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, -100.0f, 100.0f);
@@ -1312,7 +1319,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles.");
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
- prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles");
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
@@ -1465,14 +1472,14 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* global physical properties */
- prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "acc");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration");
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "acc[2]");
RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in global Z axis direction");
@@ -1837,7 +1844,7 @@ static void rna_def_particle_target(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object.");
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset");
- prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
RNA_def_property_ui_text(prop, "Time", "");
@@ -1907,11 +1914,6 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE);
RNA_def_property_ui_text(prop, "Use Soft Body", "Enable use of soft body for hair physics simulation.");
- prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_EDITED);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* various checks needed */
- RNA_def_property_ui_text(prop, "Editable", "For hair particle systems, finalize the hair to enable editing.");
-
/* reactor */
prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
@@ -2089,12 +2091,28 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
+ prop= RNA_def_property(srna, "multiple_caches", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_multiple_caches_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Multiple Caches", "Particle system has multiple point caches");
+
/* offset ob */
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "parent");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system.");
RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
+
+ /* hair or cache editing */
+ prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_editable_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Editable", "Particle system can be edited in particle mode");
+
+ prop= RNA_def_property(srna, "edited", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_edited_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode");
}
void RNA_def_particle(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 0963f2483f3..727e3ff6a6d 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -58,6 +58,11 @@ static void rna_Pose_update(bContext *C, PointerRNA *ptr)
DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA);
}
+static char *rna_PoseChannel_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("pose.pose_channels[\"%s\"]", ((bPoseChannel*)ptr->data)->name);
+}
+
static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
{
bActionGroup *grp= ptr->data;
@@ -119,7 +124,7 @@ static void rna_PoseChannel_euler_rotation_set(PointerRNA *ptr, const float *val
{
bPoseChannel *pchan= ptr->data;
- if(pchan->rotmode == PCHAN_ROT_QUAT)
+ if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers when using quats... */
EulToQuat((float*)value, pchan->quat);
else
VECCOPY(pchan->eul, value);
@@ -146,12 +151,72 @@ static int rna_PoseChannel_has_ik_get(PointerRNA *ptr)
return ED_pose_channel_in_IK_chain(ob, pchan);
}
+static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ bPose *pose= (ob) ? ob->pose : NULL;
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ bActionGroup *grp;
+
+ if (pose)
+ grp= BLI_findlink(&pose->agroups, pchan->agrp_index-1);
+ else
+ grp= NULL;
+
+ return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, grp);
+}
+
+static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value)
+{
+ Object *ob= (Object*)ptr->id.data;
+ bPose *pose= (ob) ? ob->pose : NULL;
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+
+ if (pose)
+ pchan->agrp_index= BLI_findindex(&pose->agroups, value.data) + 1;
+ else
+ pchan->agrp_index= 0;
+}
+
+static int rna_PoseChannel_bone_group_index_get(PointerRNA *ptr)
+{
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ return MAX2(pchan->agrp_index-1, 0);
+}
+
+static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value)
+{
+ bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+ pchan->agrp_index= value+1;
+}
+
+static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ Object *ob= (Object*)ptr->id.data;
+ bPose *pose= (ob) ? ob->pose : NULL;
+
+ *min= 0;
+
+ if (pose) {
+ *max= BLI_countlist(&pose->agroups)-1;
+ *max= MAX2(0, *max);
+ }
+ else
+ *max= 0;
+}
+
static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr)
{
bPose *pose= (bPose*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group-1));
}
+static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value)
+{
+ bPose *pose= (bPose*)ptr->data;
+ pose->active_group= BLI_findindex(&pose->agroups, value.data) + 1;
+}
+
static int rna_Pose_active_bone_group_index_get(PointerRNA *ptr)
{
bPose *pose= (bPose*)ptr->data;
@@ -288,7 +353,12 @@ static void rna_def_pose_channel(BlenderRNA *brna)
{
static EnumPropertyItem prop_rotmode_items[] = {
{PCHAN_ROT_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
- {PCHAN_ROT_EUL, "EULER", 0, "Euler (XYZ)", "Prone to Gimbal Lock"},
+ {PCHAN_ROT_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"},
+ {PCHAN_ROT_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
+ {PCHAN_ROT_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
+ {PCHAN_ROT_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
+ {PCHAN_ROT_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
+ {PCHAN_ROT_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@@ -297,73 +367,38 @@ static void rna_def_pose_channel(BlenderRNA *brna)
srna= RNA_def_struct(brna, "PoseChannel", NULL);
RNA_def_struct_sdna(srna, "bPoseChannel");
RNA_def_struct_ui_text(srna, "Pose Channel", "Channel defining pose data for a bone in a Pose.");
+ RNA_def_struct_path_func(srna, "rna_PoseChannel_path");
RNA_def_struct_idproperties_func(srna, "rna_PoseChannel_idproperties");
-
+
+ /* Bone Constraints */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel.");
+ /* Name + Selection Status */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_PoseChannel_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
-
- prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
- RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
- RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
- RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
- RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
- RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
- RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "");
-
- prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "agrp_index");
- RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
- prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_NONE);
+ /* Baked Bone Path cache data s*/
+ prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "pathsf");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "pathef");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
+
+ /* Relationships to other bones */
prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -378,23 +413,24 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "PoseChannel");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Child", "Child of this pose channel.");
-
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+
+ /* Transformation settings */
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_ui_text(prop, "Rotation", "Rotation in Quaternions.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "euler_rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "euler_rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "eul");
RNA_def_property_float_funcs(prop, "rna_PoseChannel_euler_rotation_get", "rna_PoseChannel_euler_rotation_set", NULL);
RNA_def_property_ui_text(prop, "Rotation (Euler)", "Rotation in Eulers.");
@@ -423,45 +459,83 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position."); */
- prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_VECTOR);
+ /* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
+ prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Head Position", "Location of head of the channel's bone.");
- prop= RNA_def_property(srna, "pose_tail", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "pose_tail", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone.");
+
+ /* IK Settings */
+ prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
+ RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
+ RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
+ RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
+ RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
+ RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
+ RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[0]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[0]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[1]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[1]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[2]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[2]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit");
@@ -490,22 +564,42 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "custom", PROP_POINTER, PROP_NONE);
+
+ /* custom bone shapes */
+ prop= RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "custom");
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_VECTOR);
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ /* bone groups */
+ prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "agrp_index");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set", "rna_PoseChannel_bone_group_index_range");
+ RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "BoneGroup");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL);
+ RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ /* transform locks */
+ prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface.");
- prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_VECTOR);
+ prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface.");
- prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_VECTOR);
+ prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface.");
@@ -535,8 +629,9 @@ static void rna_def_pose(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_bone_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL);
- RNA_def_property_ui_text(prop, "Active Bone Group", "Bone groups of the pose.");
+ RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
prop= RNA_def_property(srna, "active_bone_group_index", PROP_INT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index 7268d560282..9137e596da1 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -106,11 +106,12 @@ static void rna_RenderEngine_unregister(const bContext *C, StructRNA *type)
if(!et)
return;
+ RNA_struct_free_extension(type, &et->ext);
BLI_freelinkN(&R_engines, et);
RNA_struct_free(&BLENDER_RNA, type);
}
-static StructRNA *rna_RenderEngine_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_RenderEngine_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
RenderEngineType *et, dummyet = {0};
RenderEngine dummyengine= {0};
@@ -272,10 +273,17 @@ static void rna_def_render_result(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+ FunctionRNA *func;
srna= RNA_def_struct(brna, "RenderResult", NULL);
RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes.");
+ func= RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
+ RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ prop= RNA_def_string(func, "filename", "", 0, "Filename", "Filename to load into this render tile, must be no smaller then the render result");
+ RNA_def_property_flag(prop, PROP_REQUIRED);
+
RNA_define_verify_sdna(0);
prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
@@ -302,15 +310,11 @@ static void rna_def_render_layer(BlenderRNA *brna)
srna= RNA_def_struct(brna, "RenderLayer", NULL);
RNA_def_struct_ui_text(srna, "Render Layer", "");
- func= RNA_def_function(srna, "rect_from_file", "RE_layer_rect_from_file");
+ func= RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
prop= RNA_def_string(func, "filename", "", 0, "Filename", "Filename to load into this render tile, must be no smaller then the renderlayer");
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", "Offset the position to copy from if the image is larger then the render layer", 0, INT_MAX);
- RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y", "Offset the position to copy from if the image is larger then the render layer", 0, INT_MAX);
- RNA_def_property_flag(prop, PROP_REQUIRED);
RNA_define_verify_sdna(0);
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 385c7f5b2b1..57ed5ccef39 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -407,12 +407,25 @@ static int rna_Property_subtype_get(PointerRNA *ptr)
return prop->subtype;
}
+static int rna_Property_unit_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return RNA_SUBTYPE_UNIT(prop->subtype);
+}
+
static int rna_Property_editable_get(PointerRNA *ptr)
{
PropertyRNA *prop= (PropertyRNA*)ptr->data;
return RNA_property_editable(ptr, prop);
}
+static int rna_Property_use_return_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ return prop->flag & PROP_RETURN ? 1:0;
+}
+
static int rna_Property_array_length_get(PointerRNA *ptr)
{
PropertyRNA *prop= (PropertyRNA*)ptr->data;
@@ -769,15 +782,32 @@ static void rna_def_property(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem subtype_items[] = {
{PROP_NONE, "NONE", 0, "None", ""},
- {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned Number", ""},
{PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""},
{PROP_DIRPATH, "DIRECTORY_PATH", 0, "Directory Path", ""},
+ {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned Number", ""},
+ {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""},
+ {PROP_ANGLE, "ANGLE", 0, "Angle", ""},
+ {PROP_TIME, "TIME", 0, "Time", ""},
+ {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""},
{PROP_COLOR, "COLOR", 0, "Color", ""},
- {PROP_VECTOR, "VECTOR", 0, "Vector", ""},
+ {PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""},
+ {PROP_DIRECTION, "DIRECTION", 0, "Direction", ""},
{PROP_MATRIX, "MATRIX", 0, "Matrix", ""},
- {PROP_ROTATION, "ROTATION", 0, "Rotation", ""},
+ {PROP_EULER, "EULER", 0, "Euler", ""},
+ {PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""},
+ {PROP_XYZ, "XYZ", 0, "XYZ", ""},
+ {PROP_RGB, "RGB", 0, "RGB", ""},
{PROP_NEVER_NULL, "NEVER_NULL", 0, "Never Null", ""},
- {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""},
+ {0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem unit_items[] = {
+ {PROP_UNIT_NONE, "NONE", 0, "None", ""},
+ {PROP_UNIT_LENGTH, "LENGTH", 0, "Length", ""},
+ {PROP_UNIT_AREA, "AREA", 0, "Area", ""},
+ {PROP_UNIT_VOLUME, "VOLUME", 0, "Volume", ""},
+ {PROP_UNIT_ROTATION, "ROTATION", 0, "Rotation", ""},
+ {PROP_UNIT_TIME, "TIME", 0, "Time", ""},
+ {PROP_UNIT_VELOCITY, "VELOCITY", 0, "Velocity", ""},
+ {PROP_UNIT_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Property", NULL);
@@ -813,11 +843,22 @@ static void rna_def_property(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, "rna_Property_subtype_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Subtype", "Semantic interpretation of the property.");
+ prop= RNA_def_property(srna, "unit", PROP_ENUM, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_enum_items(prop, unit_items);
+ RNA_def_property_enum_funcs(prop, "rna_Property_unit_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Unit", "Type of units for this property.");
+
prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_editable_get", NULL);
RNA_def_property_ui_text(prop, "Editable", "Property is editable through RNA.");
+ prop= RNA_def_property(srna, "use_return", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_Property_use_return_get", NULL);
+ RNA_def_property_ui_text(prop, "Return", "True when this property is a return value from an rna function..");
+
prop= RNA_def_property(srna, "registered", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_registered_get", NULL);
@@ -875,15 +916,17 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type)
RNA_def_property_ui_text(prop, "Default", "Default value for this number");
switch(type) {
- case PROP_BOOLEAN:
- RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_get", NULL);
- break;
- case PROP_INT:
- RNA_def_property_int_funcs(prop, "rna_IntProperty_default_get", NULL, NULL);
- break;
- case PROP_FLOAT:
- RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_get", NULL, NULL);
- break;
+ case PROP_BOOLEAN:
+ RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_get", NULL);
+ break;
+ case PROP_INT:
+ RNA_def_property_int_funcs(prop, "rna_IntProperty_default_get", NULL, NULL);
+ break;
+ case PROP_FLOAT:
+ RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_get", NULL, NULL);
+ break;
+ default:
+ break;
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 2066ebe18a9..935bf8ccc3f 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -30,6 +30,10 @@
#include "rna_internal.h"
#include "DNA_scene_types.h"
+#include "DNA_userdef_types.h"
+
+/* Include for Bake Options */
+#include "RE_pipeline.h"
#ifdef WITH_FFMPEG
#include "BKE_writeffmpeg.h"
@@ -52,6 +56,7 @@ EnumPropertyItem prop_mode_items[] ={
#ifdef RNA_RUNTIME
+#include "DNA_anim_types.h"
#include "DNA_node_types.h"
#include "BKE_context.h"
@@ -60,6 +65,9 @@ EnumPropertyItem prop_mode_items[] ={
#include "BLI_threads.h"
+#include "ED_info.h"
+#include "ED_node.h"
+
#include "RE_pipeline.h"
PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
@@ -174,6 +182,54 @@ static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
//ED_update_for_newframe(C);
}
+static int rna_Scene_active_keying_set_editable(PointerRNA *ptr)
+{
+ Scene *scene= (Scene *)ptr->data;
+
+ /* only editable if there are some Keying Sets to change to */
+ return (scene->keyingsets.first != NULL);
+}
+
+static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
+{
+ Scene *scene= (Scene *)ptr->data;
+ return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, BLI_findlink(&scene->keyingsets, scene->active_keyingset-1));
+}
+
+static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
+{
+ Scene *scene= (Scene *)ptr->data;
+ KeyingSet *ks= (KeyingSet*)value.data;
+ scene->active_keyingset= BLI_findindex(&scene->keyingsets, ks) + 1;
+}
+
+static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
+{
+ Scene *scene= (Scene *)ptr->data;
+ return MAX2(scene->active_keyingset-1, 0);
+}
+
+static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
+{
+ Scene *scene= (Scene *)ptr->data;
+ scene->active_keyingset= value+1;
+}
+
+static void rna_Scene_active_keying_set_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ Scene *scene= (Scene *)ptr->data;
+
+ *min= 0;
+ *max= BLI_countlist(&scene->keyingsets)-1;
+ *max= MAX2(0, *max);
+}
+
+
+static char *rna_SceneRenderData_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("render_data");
+}
+
static int rna_SceneRenderData_threads_get(PointerRNA *ptr)
{
RenderData *rd= (RenderData*)ptr->data;
@@ -321,6 +377,15 @@ static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr)
ntreeCompositForceHidden(scene->nodetree, scene);
}
+void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
+{
+ Scene *scene= (Scene*)ptr->data;
+
+ scene->use_nodes= value;
+ if(scene->use_nodes && scene->nodetree==NULL)
+ ED_node_composit_default(scene);
+}
+
#else
static void rna_def_tool_settings(BlenderRNA *brna)
@@ -354,6 +419,11 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
{SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem auto_key_items[] = {
+ {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
+ {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ToolSettings", NULL);
RNA_def_struct_ui_text(srna, "Tool Settings", "");
@@ -416,6 +486,20 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center.");
RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
+
+ /* Auto Keying */
+ prop= RNA_def_property(srna, "enable_auto_key", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
+ RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
+
+ prop= RNA_def_property(srna, "autokey_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
+ RNA_def_property_enum_items(prop, auto_key_items);
+ RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
+
+ prop= RNA_def_property(srna, "record_with_nla", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
+ RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking.");
/* UV */
prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);
@@ -443,6 +527,40 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups.");
}
+
+static void rna_def_unit_settings(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem unit_systems[] = {
+ {USER_UNIT_NONE, "NONE", 0, "None", ""},
+ {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
+ {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "UnitSettings", NULL);
+ RNA_def_struct_ui_text(srna, "Unit Settings", "");
+
+ /* Units */
+ prop= RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, unit_systems);
+ RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+
+ prop= RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_ui_text(prop, "Unit Scale", "Scale to use when converting between blender units and dimensions.");
+ RNA_def_property_range(prop, 0.00001, 100000.0);
+ RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+
+ prop= RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_UNIT_OPT_SPLIT);
+ RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+}
+
+
void rna_def_render_layer_common(StructRNA *srna, int scene)
{
PropertyRNA *prop;
@@ -673,9 +791,9 @@ void rna_def_scene_game_data(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem framing_types_items[] ={
- {SCE_GAMEFRAMING_BARS, "BARS", 0, "Stretch", ""},
- {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", ""},
- {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", ""},
+ {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
+ {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
+ {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem dome_modes_items[] ={
@@ -698,7 +816,7 @@ void rna_def_scene_game_data(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem stereo_items[] ={
- {STEREO_NOSTEREO, "NO_STEREO", 0, "No Stereo", ""},
+ {STEREO_NOSTEREO, "NONE", 0, "None", ""},
{STEREO_ENABLED, "STEREO", 0, "Stereo", ""},
{STEREO_DOME, "DOME", 0, "Dome", ""},
{0, NULL, 0, NULL, NULL}};
@@ -712,6 +830,12 @@ void rna_def_scene_game_data(BlenderRNA *brna)
{WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem material_items[] ={
+ {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials."},
+ {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials."},
+ {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders."},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "SceneGameData", NULL);
RNA_def_struct_sdna(srna, "GameData");
RNA_def_struct_nested(brna, srna, "Scene");
@@ -818,7 +942,7 @@ void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Physics Engine", "Physics engine used for physics simulation in the game engine.");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "physics_gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "gravity");
RNA_def_property_range(prop, 0.0, 25.0);
RNA_def_property_ui_text(prop, "Physics Gravity", "Gravitational constant used for physics simulation in the game engine.");
@@ -876,6 +1000,74 @@ void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ /* booleans */
+ prop= RNA_def_property(srna, "all_frames", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES);
+ RNA_def_property_ui_text(prop, "All Frames", "Render as many frames as possible, rather than respecting framerate.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS);
+ RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
+ RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
+ RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "display_lists", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS);
+ RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "deprecation_warnings", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS);
+ RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ /* materials */
+ prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "matmode");
+ RNA_def_property_enum_items(prop, material_items);
+ RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "glsl_lights", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS);
+ RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "glsl_shaders", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS);
+ RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "glsl_shadows", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS);
+ RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "glsl_ramps", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS);
+ RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "glsl_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES);
+ RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX);
+ RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
}
static void rna_def_scene_render_layer(BlenderRNA *brna)
@@ -921,6 +1113,30 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"},
{0, NULL, 0, NULL, NULL}};
+ /* Bake */
+ static EnumPropertyItem bake_mode_items[] ={
+ {RE_BAKE_ALL, "FULL", 0, "Full Render", ""},
+ {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""},
+ {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""},
+ {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""},
+ {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""},
+ {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem bake_normal_space_items[] ={
+ {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""},
+ {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""},
+ {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""},
+ {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem bake_aa_items[] ={
+ {5, "AA_5", 0, "5", ""},
+ {8, "AA_8", 0, "8", ""},
+ {11, "AA_11", 0, "11", ""},
+ {16, "AA_16", 0, "16", ""},
+ {0, NULL, 0, NULL, NULL}};
+
static EnumPropertyItem octree_resolution_items[] = {
{64, "OCTREE_RES_64", 0, "64", ""},
{128, "OCTREE_RES_128", 0, "128", ""},
@@ -952,30 +1168,30 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{0, "STAMP_FONT_LARGE", 0, "Large", ""},
{4, "STAMP_FONT_EXTRALARGE", 0, "Extra Large", ""},
{0, NULL, 0, NULL, NULL}};
-
-
+
static EnumPropertyItem image_type_items[] = {
+ {0, "", 0, "Image", NULL},
{R_PNG, "PNG", 0, "PNG", ""},
{R_JPEG90, "JPEG", 0, "JPEG", ""},
#ifdef WITH_OPENJPEG
{R_JP2, "JPEG2000", 0, "JPEG 2000", ""},
#endif
- {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff
{R_BMP, "BMP", 0, "BMP", ""},
{R_TARGA, "TARGA", 0, "Targa", ""},
{R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""},
//{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented
{R_HAMX, "HAMX", 0, "HamX", ""},
{R_IRIS, "IRIS", 0, "Iris", ""},
- {0, "", 0, NULL, NULL},
+ {0, "", 0, " ", NULL},
#ifdef WITH_OPENEXR
{R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
{R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""},
#endif
+ {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff
{R_RADHDR, "RADHDR", 0, "Radiance HDR", ""},
{R_CINEON, "CINEON", 0, "Cineon", ""},
{R_DPX, "DPX", 0, "DPX", ""},
- {0, "", 0, NULL, NULL},
+ {0, "", 0, "Movie", NULL},
{R_AVIRAW, "AVIRAW", 0, "AVI Raw", ""},
{R_AVIJPEG, "AVIJPEG", 0, "AVI JPEG", ""},
#ifdef _WIN32
@@ -998,7 +1214,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
#endif
{R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""},
#endif
- {0, "", 0, NULL, NULL},
{R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""},
{0, NULL, 0, NULL, NULL}};
@@ -1081,6 +1296,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SceneRenderData", NULL);
RNA_def_struct_sdna(srna, "RenderData");
RNA_def_struct_nested(brna, srna, "Scene");
+ RNA_def_struct_path_func(srna, "rna_SceneRenderData_path");
RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene datablock.");
prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
@@ -1365,6 +1581,11 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
+ RNA_def_property_ui_text(prop, "Sync Audio", "Play back and sync with audio from Sequence Editor");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering.");
@@ -1400,10 +1621,10 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "edge_intensity", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "edgeint");
RNA_def_property_range(prop, 0, 255);
- RNA_def_property_ui_text(prop, "Edge Intensity", "Threshold for drawing outlines on geometry edges");
+ RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR);
@@ -1429,7 +1650,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur (uses number of anti-aliasing samples).");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "border", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -1439,14 +1660,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "placeholders", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch').");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "no_overwrite", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
- RNA_def_property_ui_text(prop, "No Overwrite", "Skip and don't overwrite existing files while rendering");
+ prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE);
+ RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
@@ -1480,7 +1701,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
-
+
+ prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
+ RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_save_buffers_get", NULL);
@@ -1507,6 +1733,57 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ /* Bake */
+
+ prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
+ RNA_def_property_enum_items(prop, bake_mode_items);
+ RNA_def_property_ui_text(prop, "Bake Mode", "");
+
+ prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space");
+ RNA_def_property_enum_items(prop, bake_normal_space_items);
+ RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
+
+ prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa");
+ RNA_def_property_enum_items(prop, bake_aa_items);
+ RNA_def_property_ui_text(prop, "Anti-Aliasing Level", "");
+
+ prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
+ RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
+
+ prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
+ RNA_def_property_ui_text(prop, "Normalized", "");
+ //"Bake ambient occlusion normalized, without taking into acount material settings"
+ //"Normalized displacement value to fit the 'Dist' range"
+ // XXX: Need 1 tooltip here...
+
+ prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
+ RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
+
+ prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA);
+ RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing");
+
+ prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "bake_filter");
+ RNA_def_property_range(prop, 0, 32);
+ RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter");
+
+ prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
+ RNA_def_property_range(prop, 0.0, 1000.0);
+ RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
+
+ prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
+ RNA_def_property_range(prop, 0.0, 1000.0);
+ RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)");
+
/* stamp */
prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE);
@@ -1624,6 +1901,7 @@ void RNA_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+ FunctionRNA *func;
/* Struct definition */
srna= RNA_def_struct(brna, "Scene", "ID");
@@ -1641,7 +1919,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "World", "World used for rendering the scene.");
RNA_def_property_update(prop, NC_WORLD, NULL);
- prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "cursor");
RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
@@ -1663,28 +1941,28 @@ void RNA_def_scene(BlenderRNA *brna)
/* Frame Range Stuff */
- prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
- prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.sfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.efra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "frame_step");
RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
@@ -1697,14 +1975,14 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Preview Range", "");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "preview_range_start_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "preview_range_start_frame", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.psfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Preview Range Start Frame", "");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "preview_range_end_frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "preview_range_end_frame", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.pefra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
@@ -1720,6 +1998,12 @@ void RNA_def_scene(BlenderRNA *brna)
/* Nodes (Compositing) */
prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
+
+ prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_nodes_set");
+ RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* Sequencer */
prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
@@ -1728,24 +2012,40 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sequence Editor", "");
/* Keying Sets */
- // TODO: hide the fact that active keyingset is an int?
- prop= RNA_def_property(srna, "keyingsets", PROP_COLLECTION, PROP_NONE);
+ prop= RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
RNA_def_property_struct_type(prop, "KeyingSet");
RNA_def_property_ui_text(prop, "Keying Sets", "Keying Sets for this Scene.");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
- prop= RNA_def_property(srna, "active_keyingset", PROP_INT, PROP_NONE);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Active Keying Set", "Current Keying Set index.");
+ prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyingSet");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_editable_func(prop, "rna_Scene_active_keying_set_editable");
+ RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL);
+ RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes.");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
+
+ prop= RNA_def_property(srna, "active_keying_set_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
+ RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", "rna_Scene_active_keying_set_index_range");
+ RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index.");
+ RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
/* Tool Settings */
- prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
RNA_def_property_struct_type(prop, "ToolSettings");
RNA_def_property_ui_text(prop, "Tool Settings", "");
+
+ /* Unit Settings */
+ prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "unit");
+ RNA_def_property_struct_type(prop, "UnitSettings");
+ RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
/* Render Data */
- prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "r");
RNA_def_property_struct_type(prop, "SceneRenderData");
RNA_def_property_ui_text(prop, "Render Data", "");
@@ -1757,15 +2057,32 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene.");
/* Game Settings */
- prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NONE);
+ prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "gm");
RNA_def_property_struct_type(prop, "SceneGameData");
RNA_def_property_ui_text(prop, "Game Data", "");
+
+ /* Statistics */
+ func= RNA_def_function(srna, "statistics", "ED_info_stats_string");
+ prop= RNA_def_string(func, "statistics", "", 0, "Statistics", "");
+ RNA_def_function_return(func, prop);
+ /* Grease Pencil */
+ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "gpd");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_struct_type(prop, "GreasePencil");
+ RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
+
+ /* Nestled Data */
rna_def_tool_settings(brna);
+ rna_def_unit_settings(brna);
rna_def_scene_render_data(brna);
rna_def_scene_game_data(brna);
rna_def_scene_render_layer(brna);
+
+ /* Scene API */
+ RNA_api_scene(srna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
new file mode 100644
index 00000000000..26047ab5dc3
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -0,0 +1,100 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+#include "RNA_types.h"
+
+#include "DNA_anim_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_animsys.h"
+
+// Scene API stuff from kazanbas branch here...
+
+
+static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports,
+ char name[], int absolute, int insertkey_needed, int insertkey_visual)
+{
+ KeyingSet *ks= NULL;
+ short flag=0, keyingflag=0;
+
+ /* validate flags */
+ if (absolute)
+ flag |= KEYINGSET_ABSOLUTE;
+ if (insertkey_needed)
+ keyingflag |= INSERTKEY_NEEDED;
+ if (insertkey_visual)
+ keyingflag |= INSERTKEY_MATRIX;
+
+ /* call the API func, and set the active keyingset index */
+ ks= BKE_keyingset_add(&sce->keyingsets, name, flag, keyingflag);
+
+ if (ks) {
+ sce->active_keyingset= BLI_countlist(&sce->keyingsets);
+ return ks;
+ }
+ else {
+ BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
+ return NULL;
+ }
+}
+
+#else
+
+void RNA_api_scene(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ // Scene API stuff from kazanbas branch here...
+
+ /* Add Keying Set */
+ func= RNA_def_function(srna, "add_keying_set", "rna_Scene_add_keying_set");
+ RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ /* returns the new KeyingSet */
+ parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
+ RNA_def_function_return(func, parm);
+ /* name */
+ RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
+ /* flags */
+ RNA_def_boolean(func, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
+ /* keying flags */
+ RNA_def_boolean(func, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves.");
+ RNA_def_boolean(func, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index e3171d38932..7a243327bd1 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -71,9 +71,15 @@ static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
}
}
+static int rna_Screen_animation_playing_get(PointerRNA *ptr)
+{
+ bScreen *sc= (bScreen*)ptr->data;
+ return (sc->animtimer != NULL);
+}
+
#else
-static void rna_def_scrarea(BlenderRNA *brna)
+static void rna_def_area(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -119,7 +125,7 @@ static void rna_def_region(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Region ID", "Uniqute ID for this region.");
}
-static void rna_def_bscreen(BlenderRNA *brna)
+static void rna_def_screen(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -139,12 +145,17 @@ static void rna_def_bscreen(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL);
RNA_def_property_struct_type(prop, "Area");
RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into.");
+
+ prop= RNA_def_property(srna, "animation_playing", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_Screen_animation_playing_get", NULL);
+ RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active.");
}
void RNA_def_screen(BlenderRNA *brna)
{
- rna_def_bscreen(brna);
- rna_def_scrarea(brna);
+ rna_def_screen(brna);
+ rna_def_area(brna);
rna_def_region(brna);
}
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 1e512d8f9bb..b00119efaf6 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -31,8 +31,36 @@
#include "DNA_scene_types.h"
+#include "BKE_paint.h"
+
+#include "WM_types.h"
+
+static EnumPropertyItem particle_edit_hair_brush_items[] = {
+ {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."},
+ {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs."},
+ {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs."},
+ {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs."},
+ {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter."},
+ {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up."},
+ {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."},
+ {0, NULL, 0, NULL, NULL}};
+
+static EnumPropertyItem particle_edit_cache_brush_items[] = {
+ {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."},
+ {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths."},
+ {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths."},
+ {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter."},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
+#include "BKE_context.h"
+#include "BKE_pointcache.h"
+#include "BKE_particle.h"
+#include "BKE_depsgraph.h"
+
+#include "ED_particle.h"
+
static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
{
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
@@ -44,25 +72,131 @@ static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
}
+
static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
}
+static void rna_Paint_brushes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Paint *p= (Paint*)ptr->data;
+ rna_iterator_array_begin(iter, (void*)p->brushes, sizeof(Brush*), p->brush_count, 0, NULL);
+}
+
+static int rna_Paint_brushes_length(PointerRNA *ptr)
+{
+ Paint *p= (Paint*)ptr->data;
+
+ return p->brush_count;
+}
+
+static PointerRNA rna_Paint_active_brush_get(PointerRNA *ptr)
+{
+ return rna_pointer_inherit_refine(ptr, &RNA_Brush, paint_brush(ptr->data));
+}
+
+static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value)
+{
+ paint_brush_set(ptr->data, value.data);
+}
+
+static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr)
+{
+ PTCacheEdit *edit = PE_get_current(CTX_data_scene(C), CTX_data_active_object(C));
+
+ if(!edit)
+ return;
+
+ psys_free_path_cache(NULL, edit);
+}
+
+static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = CTX_data_active_object(C);
+
+ if(ob)
+ DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
+}
+
+static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ if(C==NULL) {
+ EnumPropertyItem *item= NULL;
+ int totitem= 0;
+
+ /* needed for doc generation */
+ RNA_enum_items_add(&item, &totitem, particle_edit_hair_brush_items);
+ RNA_enum_item_end(&item, &totitem);
+
+ *free= 1;
+
+ return item;
+ }
+ else {
+ Scene *scene= CTX_data_scene(C);
+ PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C));
+
+ if(edit && edit->psys)
+ return particle_edit_hair_brush_items;
+
+ return particle_edit_cache_brush_items;
+ }
+}
+
+static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
+{
+ ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
+
+ return (pset->object && PE_get_current(pset->scene, pset->object));
+}
+static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
+{
+ ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
+
+ PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
+
+ return (edit && edit->psys);
+}
#else
-static void rna_def_sculpt(BlenderRNA *brna)
+static void rna_def_paint(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "Sculpt", NULL);
- RNA_def_struct_ui_text(srna, "Sculpt", "");
-
+ srna= RNA_def_struct(brna, "Paint", NULL);
+ RNA_def_struct_ui_text(srna, "Paint", "");
+
+ prop= RNA_def_property(srna, "brushes", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Brush");
+ RNA_def_property_collection_funcs(prop, "rna_Paint_brushes_begin",
+ "rna_iterator_array_next",
+ "rna_iterator_array_end",
+ "rna_iterator_array_dereference_get",
+ "rna_Paint_brushes_length", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Brushes", "Brushes selected for this paint mode.");
+
+ prop= RNA_def_property(srna, "active_brush_index", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, INT_MAX);
+
+ /* Fake property to get active brush directly, rather than integer index */
prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Brush");
- RNA_def_property_ui_text(prop, "Brush", "");
+ RNA_def_property_pointer_funcs(prop, "rna_Paint_active_brush_get", "rna_Paint_active_brush_set", NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Brush", "Active paint brush.");
+}
+
+static void rna_def_sculpt(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ srna= RNA_def_struct(brna, "Sculpt", "Paint");
+ RNA_def_struct_ui_text(srna, "Sculpt", "");
+
prop= RNA_def_property(srna, "symmetry_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis.");
@@ -110,14 +244,10 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
{6, "DARKEN", 0, "Darken", "Use darken blending mode while painting."},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "VertexPaint", NULL);
+ srna= RNA_def_struct(brna, "VertexPaint", "Paint");
RNA_def_struct_sdna(srna, "VPaint");
RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode.");
- prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Brush");
- RNA_def_property_ui_text(prop, "Brush", "");
-
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mode_items);
RNA_def_property_ui_text(prop, "Brush Mode", "Mode in which color is painted.");
@@ -159,14 +289,10 @@ static void rna_def_image_paint(BlenderRNA *brna)
{PAINT_TOOL_CLONE, "CLONE", 0, "Clone", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "ImagePaint", NULL);
+ srna= RNA_def_struct(brna, "ImagePaint", "Paint");
RNA_def_struct_sdna(srna, "ImagePaintSettings");
RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode.");
- prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "Brush");
- RNA_def_property_ui_text(prop, "Brush", "");
-
prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, tool_items);
RNA_def_property_ui_text(prop, "Tool", "");
@@ -225,17 +351,6 @@ static void rna_def_particle_edit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem tool_items[] = {
- {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."},
- {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs."},
- {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs."},
- {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Assign weight to hairs."},
- {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs."},
- {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter."},
- {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up."},
- {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem select_mode_items[] = {
{SCE_SELECT_PATH, "PATH", ICON_EDGESEL, "Path", ""}, // XXX icon
{SCE_SELECT_POINT, "POINT", ICON_VERTEXSEL, "Point", ""}, // XXX icon
@@ -252,6 +367,14 @@ static void rna_def_particle_edit(BlenderRNA *brna)
{1, "SHRINK", 0, "Shrink", "Make hairs shorter."},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem edit_type_items[]= {
+ {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
+ {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""},
+ {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+
/* edit */
srna= RNA_def_struct(brna, "ParticleEdit", NULL);
@@ -260,13 +383,15 @@ static void rna_def_particle_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "brushtype");
- RNA_def_property_enum_items(prop, tool_items);
+ RNA_def_property_enum_items(prop, particle_edit_hair_brush_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ParticleEdit_tool_itemf");
RNA_def_property_ui_text(prop, "Tool", "");
prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
RNA_def_property_enum_items(prop, select_mode_items);
RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode.");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update");
prop= RNA_def_property(srna, "keep_lengths", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
@@ -285,13 +410,19 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter.");
- prop= RNA_def_property(srna, "show_time", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_SHOW_TIME);
- RNA_def_property_ui_text(prop, "Show Time", "Show time values of the baked keys.");
+ prop= RNA_def_property(srna, "fade_time", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
+ RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame.");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update");
+
+ prop= RNA_def_property(srna, "auto_velocity", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
+ RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically.");
- prop= RNA_def_property(srna, "show_children", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_SHOW_CHILD);
- RNA_def_property_ui_text(prop, "Show Children", "Show child particles.");
+ prop= RNA_def_property(srna, "draw_particles", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
+ RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles.");
+ RNA_def_property_update(prop, NC_OBJECT, NULL);
prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_X_MIRROR);
@@ -312,6 +443,37 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Brush", "");
+ prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 2, 10);
+ RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with.");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_redo");
+
+ prop= RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 2, 100);
+ RNA_def_property_ui_text(prop, "Frames", "How many frames to fade.");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update");
+
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "edittype");
+ RNA_def_property_enum_items(prop, edit_type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+ RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_redo");
+
+ prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
+
+ prop= RNA_def_property(srna, "hair", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Hair", "Editing hair");
+
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Object", "The edited object");
+
+
/* brush */
srna= RNA_def_struct(brna, "ParticleBrush", NULL);
@@ -353,6 +515,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
void RNA_def_sculpt_paint(BlenderRNA *brna)
{
+ rna_def_paint(brna);
rna_def_sculpt(brna);
rna_def_vertex_paint(brna);
rna_def_image_paint(brna);
diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c
index 8ca023dc57c..5d275f7a87c 100644
--- a/source/blender/makesrna/intern/rna_sequence.c
+++ b/source/blender/makesrna/intern/rna_sequence.c
@@ -192,10 +192,8 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
case SEQ_SCENE:
return &RNA_SceneSequence;
case SEQ_MOVIE:
- case SEQ_MOVIE_AND_HD_SOUND:
return &RNA_MovieSequence;
- case SEQ_RAM_SOUND:
- case SEQ_HD_SOUND:
+ case SEQ_SOUND:
return &RNA_SoundSequence;
case SEQ_CROSS:
case SEQ_ADD:
@@ -362,9 +360,7 @@ static void rna_def_sequence(BlenderRNA *brna)
{SEQ_META, "META", 0, "Meta", ""},
{SEQ_SCENE, "SCENE", 0, "Scene", ""},
{SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
- {SEQ_RAM_SOUND, "RAM_SOUND", 0, "Ram Sound", ""},
- {SEQ_HD_SOUND, "HD_SOUND", 0, "HD Sound", ""},
- {SEQ_MOVIE_AND_HD_SOUND, "MOVIE_AND_HD_SOUND", 0, "Movie and HD Sound", ""},
+ {SEQ_SOUND, "SOUND", 0, "Sound", ""},
{SEQ_EFFECT, "REPLACE", 0, "Replace", ""},
{SEQ_CROSS, "CROSS", 0, "Cross", ""},
{SEQ_ADD, "ADD", 0, "Add", ""},
@@ -442,38 +438,39 @@ static void rna_def_sequence(BlenderRNA *brna)
/* strip positioning */
- prop= RNA_def_property(srna, "length", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "len");
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
RNA_def_property_int_funcs(prop, "rna_SequenceEditor_length_get", "rna_SequenceEditor_length_set",NULL);
-
- prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_start_frame_set",NULL); // overlap tests and calc_seq_disp
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startofs");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
RNA_def_property_ui_text(prop, "Start Offset", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endofs");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
RNA_def_property_ui_text(prop, "End offset", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startstill");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Still", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
- prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endstill");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests
RNA_def_property_range(prop, 0, MAXFRAME);
@@ -616,21 +613,6 @@ static void rna_def_filter_video(StructRNA *srna)
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
}
-static void rna_def_filter_sound(StructRNA *srna)
-{
- PropertyRNA *prop;
-
- prop= RNA_def_property(srna, "sound_gain", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "level");
- RNA_def_property_range(prop, -96.0f, 6.0f);
- RNA_def_property_ui_text(prop, "Sound Gain", "Sound level in dB (0 = full volume).");
-
- prop= RNA_def_property(srna, "sound_pan", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "pan");
- RNA_def_property_range(prop, -1.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Sound Pan", "Stereo sound balance.");
-}
-
static void rna_def_proxy(StructRNA *srna)
{
PropertyRNA *prop;
@@ -657,11 +639,13 @@ static void rna_def_input(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start).");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test
RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end).");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
}
static void rna_def_image(BlenderRNA *brna)
@@ -761,7 +745,7 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "Sequence");
prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "UnknownType");
+ RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence (RAM audio only).");
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
@@ -772,7 +756,6 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
RNA_def_property_ui_text(prop, "Directory", "");
- rna_def_filter_sound(srna);
rna_def_input(srna);
}
@@ -833,21 +816,25 @@ static void rna_def_wipe(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, -90.0f, 90.0f);
RNA_def_property_ui_text(prop, "Angle", "Edge angle.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "forward");
RNA_def_property_enum_items(prop, wipe_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Wipe direction.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wipetype");
RNA_def_property_enum_items(prop, wipe_type_items);
RNA_def_property_ui_text(prop, "Transition Type", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
}
static void rna_def_glow(BlenderRNA *brna)
@@ -863,30 +850,36 @@ static void rna_def_glow(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "fMini");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fClamp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fBoost");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dDist");
RNA_def_property_range(prop, 0.5f, 20.0f);
RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dQuality");
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only.");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
}
static void rna_def_transform(BlenderRNA *brna)
@@ -915,60 +908,72 @@ static void rna_def_transform(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
RNA_def_property_ui_text(prop, "Scale Start X", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
RNA_def_property_ui_text(prop, "Scale Start Y", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
-
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+
prop= RNA_def_property(srna, "scale_end_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScalexFin");
RNA_def_property_ui_text(prop, "Scale End X", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "scale_end_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScaleyFin");
RNA_def_property_ui_text(prop, "Scale End Y", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xIni");
RNA_def_property_ui_text(prop, "Translate Start X", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
-
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+
prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yIni");
RNA_def_property_ui_text(prop, "Translate Start Y", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
-
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
+
prop= RNA_def_property(srna, "translate_end_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xFin");
RNA_def_property_ui_text(prop, "Translate End X", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "translate_end_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yFin");
RNA_def_property_ui_text(prop, "Translate End Y", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rotIni");
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Rotation Start", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "rotation_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rotFin");
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Rotation End", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "percent");
RNA_def_property_enum_items(prop, translation_unit_items);
RNA_def_property_ui_text(prop, "Translation Unit", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
}
static void rna_def_solid_color(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
new file mode 100644
index 00000000000..d7c70d8b9e9
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -0,0 +1,290 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Daniel Genrich
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <limits.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "BKE_modifier.h"
+#include "BKE_smoke.h"
+
+#include "DNA_modifier_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_smoke_types.h"
+
+#include "WM_types.h"
+
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_particle.h"
+#include "BKE_pointcache.h"
+
+#include "ED_object.h"
+
+static void rna_Smoke_update(bContext *C, PointerRNA *ptr)
+{
+ DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA);
+}
+
+static void rna_Smoke_dependency_update(bContext *C, PointerRNA *ptr)
+{
+ rna_Smoke_update(C, ptr);
+ DAG_scene_sort(CTX_data_scene(C));
+}
+
+static void rna_Smoke_reset(bContext *C, PointerRNA *ptr)
+{
+ SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
+
+ smokeModifier_reset(settings->smd);
+
+ rna_Smoke_update(C, ptr);
+}
+
+static void rna_Smoke_reset_dependancy(bContext *C, PointerRNA *ptr)
+{
+ SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
+
+ smokeModifier_reset(settings->smd);
+
+ rna_Smoke_dependency_update(C, ptr);
+}
+
+#if 0
+static void rna_Smoke_redraw(bContext *C, PointerRNA *ptr)
+{
+ SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
+
+ settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE;
+}
+#endif
+
+static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
+{
+ SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
+ ModifierData *md= (ModifierData *)settings->smd;
+
+ return BLI_sprintfN("modifiers[%s].domain_settings", md->name);
+}
+
+static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
+{
+ SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data;
+ ModifierData *md= (ModifierData *)settings->smd;
+
+ return BLI_sprintfN("modifiers[%s].flow_settings", md->name);
+}
+
+static char *rna_SmokeCollSettings_path(PointerRNA *ptr)
+{
+ SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data;
+ ModifierData *md= (ModifierData *)settings->smd;
+
+ return BLI_sprintfN("modifiers[%s].coll_settings", md->name);
+}
+
+#else
+
+static void rna_def_smoke_domain_settings(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_noise_type_items[] = {
+ {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
+#if FFTW3 == 1
+ {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
+#endif
+ /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
+ {0, NULL, 0, NULL, NULL}};
+
+ srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
+ RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings.");
+ RNA_def_struct_sdna(srna, "SmokeDomainSettings");
+ RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path");
+
+ prop= RNA_def_property(srna, "maxres", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "maxres");
+ RNA_def_property_range(prop, 24, 512);
+ RNA_def_property_ui_range(prop, 24, 512, 2, 0);
+ RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "alpha");
+ RNA_def_property_range(prop, -5.0, 5.0);
+ RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
+ RNA_def_property_ui_text(prop, "Gravity", "Higher value results in sinking smoke");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "beta");
+ RNA_def_property_range(prop, -5.0, 5.0);
+ RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
+ RNA_def_property_ui_text(prop, "Heat", "Higher value results in faster rising smoke.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
+ RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
+
+ prop= RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
+ RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
+
+ prop= RNA_def_property(srna, "eff_group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
+ RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
+
+ prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "diss_speed");
+ RNA_def_property_range(prop, 1.0, 100.0);
+ RNA_def_property_ui_range(prop, 1.0, 1000.0, 1, 0);
+ RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
+ RNA_def_property_ui_text(prop, "High Resolution Smoke", "Enable high resolution smoke");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
+
+ prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
+ RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
+ RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]");
+ RNA_def_property_struct_type(prop, "PointCache");
+ RNA_def_property_ui_text(prop, "Point Cache", "");
+
+ prop= RNA_def_property(srna, "show_highres", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_SHOWHIGHRES);
+ RNA_def_property_ui_text(prop, "High res", "Show high resolution (using amplification).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noise");
+ RNA_def_property_enum_items(prop, prop_noise_type_items);
+ RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "amplify");
+ RNA_def_property_range(prop, 1, 10);
+ RNA_def_property_ui_range(prop, 1, 10, 1, 0);
+ RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "strength");
+ RNA_def_property_range(prop, 1.0, 10.0);
+ RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2);
+ RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "point_cache_turbulence", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "point_cache[1]");
+ RNA_def_property_struct_type(prop, "PointCache");
+ RNA_def_property_ui_text(prop, "Point Cache", "");
+}
+
+static void rna_def_smoke_flow_settings(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "SmokeFlowSettings", NULL);
+ RNA_def_struct_ui_text(srna, "Flow Settings", "Smoke flow settings.");
+ RNA_def_struct_sdna(srna, "SmokeFlowSettings");
+ RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path");
+
+ prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "density");
+ RNA_def_property_range(prop, 0.001, 1);
+ RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4);
+ RNA_def_property_ui_text(prop, "Density", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
+
+ prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "temp");
+ RNA_def_property_range(prop, -10, 10);
+ RNA_def_property_ui_range(prop, -10, 10, 1, 1);
+ RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambientt temperature.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
+
+ prop= RNA_def_property(srna, "psys", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "psys");
+ RNA_def_property_struct_type(prop, "ParticleSystem");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
+
+ prop= RNA_def_property(srna, "outflow", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
+ RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
+}
+
+static void rna_def_smoke_coll_settings(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ srna = RNA_def_struct(brna, "SmokeCollSettings", NULL);
+ RNA_def_struct_ui_text(srna, "Collision Settings", "Smoke collision settings.");
+ RNA_def_struct_sdna(srna, "SmokeCollSettings");
+ RNA_def_struct_path_func(srna, "rna_SmokeCollSettings_path");
+}
+
+void RNA_def_smoke(BlenderRNA *brna)
+{
+ rna_def_smoke_domain_settings(brna);
+ rna_def_smoke_flow_settings(brna);
+ rna_def_smoke_coll_settings(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index 363a5595b43..38e4d850c68 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -34,97 +34,30 @@
#ifdef RNA_RUNTIME
-#else
-
-/* sample and listener are internal .. */
+#include "BKE_sound.h"
+#include "BKE_context.h"
-#if 0
-static void rna_def_sample(BlenderRNA *brna)
+static void rna_Sound_filename_update(bContext *C, PointerRNA *ptr)
{
- StructRNA *srna;
- PropertyRNA *prop;
-
- /* sound types */
- static EnumPropertyItem prop_sample_type_items[] = {
- {SAMPLE_INVALID, "INVALID", 0, "Invalid", ""},
- {SAMPLE_UNKNOWN, "UNKNOWN", 0, "Unknown", ""},
- {SAMPLE_RAW, "RAW", 0, "Raw", ""},
- {SAMPLE_WAV, "WAV", 0, "WAV", "Uncompressed"},
- {SAMPLE_MP2, "MP2", 0, "MP2", "MPEG-1 Audio Layer 2"},
- {SAMPLE_MP3, "MP3", 0, "MP3", "MPEG-1 Audio Layer 3"},
- {SAMPLE_OGG_VORBIS, "OGG_VORBIS", 0, "Ogg Vorbis", ""},
- {SAMPLE_WMA, "WMA", 0, "WMA", "Windows Media Audio"},
- {SAMPLE_ASF, "ASF", 0, "ASF", "Windows Advanced Systems Format"},
- {SAMPLE_AIFF, "AIFF", 0, "AIFF", "Audio Interchange File Format"},
- {0, NULL, 0, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "SoundSample", "ID");
- RNA_def_struct_sdna(srna, "bSample");
- RNA_def_struct_ui_text(srna, "SoundSample", "Sound data loaded from a sound datablock.");
-
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_sample_type_items);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Types", "");
-
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
- RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Filename", "Full path filename of the sample");
-
- prop= RNA_def_property(srna, "length", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_sdna(prop, NULL, "len");
- RNA_def_property_ui_text(prop, "Length", "The length of sample in seconds");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
- prop= RNA_def_property(srna, "rate", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_ui_text(prop, "Rate", "Sample rate in kHz");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
- prop= RNA_def_property(srna, "bits", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_ui_text(prop, "Bits", "Bit-depth of sample");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
- prop= RNA_def_property(srna, "channels", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_ui_text(prop, "Channels", "Number of channels (mono=1; stereo=2)");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ sound_load(CTX_data_main(C), (bSound*)ptr->data);
}
-static void rna_def_soundlistener(BlenderRNA *brna)
+static int rna_Sound_caching_get(PointerRNA *ptr)
{
+ bSound *sound = (bSound*)(ptr->data);
+ return sound->cache != NULL;
+}
- StructRNA *srna;
- PropertyRNA *prop;
-
- srna= RNA_def_struct(brna, "SoundListener", "ID");
- RNA_def_struct_sdna(srna, "bSoundListener");
- RNA_def_struct_ui_text(srna, "Sound Listener", "Sound listener defining parameters about how sounds are played.");
-
- prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
- RNA_def_property_ui_text(prop, "Gain", "Overall volume for Game Engine sound.");
- RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 4);
-
- prop= RNA_def_property(srna, "doppler_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "dopplerfactor");
- RNA_def_property_ui_text(prop, "Doppler Factor", "Amount of Doppler effect in Game Engine sound.");
- RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 4);
-
- prop= RNA_def_property(srna, "doppler_velocity", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "dopplervelocity");
- RNA_def_property_ui_text(prop, "Doppler Velocity", "The speed of sound in the Game Engine.");
- RNA_def_property_ui_range(prop, 0.0, 10000.0, 0.1, 4);
-
- prop= RNA_def_property(srna, "num_sounds_blender", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_sdna(prop, NULL, "numsoundsblender");
- RNA_def_property_ui_text(prop, "Total Sounds in Blender", "The total number of sounds currently linked and available.");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
- prop= RNA_def_property(srna, "num_sounds_gameengine", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_sdna(prop, NULL, "numsoundsgameengine");
- RNA_def_property_ui_text(prop, "Total Sounds in Game Engine", "The total number of sounds in the Game Engine.");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+static void rna_Sound_caching_set(PointerRNA *ptr, const int value)
+{
+ bSound *sound = (bSound*)(ptr->data);
+ if(value)
+ sound_cache(sound, 0);
+ else
+ sound_delete_cache(sound);
}
-#endif
+
+#else
static void rna_def_sound(BlenderRNA *brna)
{
@@ -138,88 +71,23 @@ static void rna_def_sound(BlenderRNA *brna)
//rna_def_ipo_common(srna);
- /*prop= RNA_def_property(srna, "sample", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "SoundSample");
- RNA_def_property_ui_text(prop, "Sample", "Sound sample.");*/
-
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "Sound sample file used by this Sound datablock.");
+ RNA_def_property_update(prop, 0, "rna_Sound_filename_update");
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", "");
- /* game engine settings */
- prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_UNSIGNED);
- RNA_def_property_float_sdna(prop, NULL, "volume");
- RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 4);
- RNA_def_property_ui_text(prop, "Volume", "Game engine only: volume for this sound.");
-
- prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "pitch");
- RNA_def_property_ui_range(prop, -12.0, 12.0, 10, 4);
- RNA_def_property_ui_text(prop, "Pitch", "Game engine only: set the pitch of this sound.");
-
- prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_LOOP);
- RNA_def_property_ui_text(prop, "Sound Loop", "Game engine only: toggle between looping on/off.");
-
- prop= RNA_def_property(srna, "ping_pong", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_BIDIRECTIONAL_LOOP);
- RNA_def_property_ui_text(prop, "Ping Pong", "Game engine only: Toggle between A->B and A->B->A looping.");
-
- prop= RNA_def_property(srna, "sound_3d", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_3D);
- RNA_def_property_ui_text(prop, "3D Sound", "Game engine only: turns 3D sound on.");
-
- prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "attenuation");
- RNA_def_property_range(prop, 0.0, 5.0);
- RNA_def_property_ui_text(prop, "Attenuation", "Game engine only: sets the surround scaling factor for 3D sound.");
-
- /* gain */
- prop= RNA_def_property(srna, "min_gain", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "min_gain");
- RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_ui_text(prop, "Min Gain", "Minimal gain which is always guaranteed for this sound.");
-
- prop= RNA_def_property(srna, "max_gain", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "max_gain");
- RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_ui_text(prop, "Max Gain", "Maximal gain which is always guaranteed for this sound.");
-
- prop= RNA_def_property(srna, "reference_distance", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "distance");
- RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which the listener will experience gain.");
- RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 4); /* NOT used anywhere */
-
- /* unused
- prop= RNA_def_property(srna, "panning", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "panning");
- RNA_def_property_ui_range(prop, -1.0, 1.0, 10, 4);
- RNA_def_property_ui_text(prop, "Panning", "Pan the sound from left to right"); */
-
- /* unused
- prop= RNA_def_property(srna, "fixed_volume", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_VOLUME);
- RNA_def_property_ui_text(prop, "Fixed Volume", "Constraint sound to fixed volume."); */
-
- /* unused
- prop= RNA_def_property(srna, "fixed_panning", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_PANNING);
- RNA_def_property_ui_text(prop, "Fixed Panning", "Constraint sound to fixed panning."); */
-
- /* unused
- prop= RNA_def_property(srna, "priority", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_PRIORITY);
- RNA_def_property_ui_text(prop, "Priority", "Make sound higher priority."); */
+ prop= RNA_def_property(srna, "caching", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set");
+ RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM.");
+ RNA_def_property_update(prop, 0, "rna_Sound_filename_update");
}
void RNA_def_sound(BlenderRNA *brna)
{
- //rna_def_sample(brna);
- //rna_def_soundlistener(brna);
rna_def_sound(brna);
}
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 4fb494256f7..d6a17526a65 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -33,10 +33,13 @@
#include "rna_internal.h"
#include "DNA_action_types.h"
+#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
+#include "BKE_paint.h"
+
#include "WM_types.h"
EnumPropertyItem space_type_items[] = {
@@ -44,10 +47,10 @@ EnumPropertyItem space_type_items[] = {
{SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""},
{SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""},
{SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""},
- {SPACE_BUTS, "BUTTONS_WINDOW", 0, "Buttons Window", ""},
+ {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""},
{SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""},
{SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""},
- {SPACE_INFO, "USER_PREFERENCES", 0, "User Preferences", ""},
+ {SPACE_INFO, "INFO", 0, "Info", ""},
{SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""},
{SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""},
//{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""},
@@ -59,6 +62,7 @@ EnumPropertyItem space_type_items[] = {
{SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""},
{SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
{SPACE_CONSOLE, "CONSOLE", 0, "Console", ""},
+ {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
{0, NULL, 0, NULL, NULL}};
#define DC_RGB {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."}
@@ -83,6 +87,7 @@ static EnumPropertyItem dc_all_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_Z, DC_LC
#include "BKE_context.h"
#include "ED_image.h"
+#include "ED_screen.h"
#include "IMB_imbuf_types.h"
@@ -98,13 +103,13 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
case SPACE_OUTLINER:
return &RNA_SpaceOutliner;
case SPACE_BUTS:
- return &RNA_SpaceButtonsWindow;
+ return &RNA_SpaceProperties;
case SPACE_FILE:
return &RNA_SpaceFileBrowser;
case SPACE_IMAGE:
return &RNA_SpaceImageEditor;
- /*case SPACE_INFO:
- return &RNA_SpaceUserPreferences;*/
+ case SPACE_INFO:
+ return &RNA_SpaceInfo;
case SPACE_SEQ:
return &RNA_SpaceSequenceEditor;
case SPACE_TEXT:
@@ -118,15 +123,17 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
case SPACE_NLA:
return &RNA_SpaceNLA;
/*case SPACE_SCRIPT:
- return &RNA_SpaceScriptsWindow;
+ return &RNA_SpaceScriptsWindow;*/
case SPACE_TIME:
return &RNA_SpaceTimeline;
case SPACE_NODE:
return &RNA_SpaceNodeEditor;
case SPACE_LOGIC:
- return &RNA_SpaceLogicEditor;*/
+ return &RNA_SpaceLogicEditor;
case SPACE_CONSOLE:
return &RNA_SpaceConsole;
+ case SPACE_USERPREF:
+ return &RNA_SpaceUserPreferences;
default:
return &RNA_Space;
}
@@ -144,7 +151,7 @@ static void rna_SpaceImageEditor_paint_update(bContext *C, PointerRNA *ptr)
Scene *scene= CTX_data_scene(C);
if(scene)
- brush_check_exists(&scene->toolsettings->imapaint.brush);
+ paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
}
static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
@@ -227,9 +234,9 @@ void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value)
sfile->params= value.data;
}
-/* Space Buttons */
+/* Space Properties */
-StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr)
+StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
{
SpaceButs *sbuts= (SpaceButs*)(ptr->data);
@@ -239,7 +246,7 @@ StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr)
return &RNA_ID;
}
-void rna_SpaceButtonsWindow_align_set(PointerRNA *ptr, int value)
+void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
{
SpaceButs *sbuts= (SpaceButs*)(ptr->data);
@@ -303,6 +310,13 @@ static void rna_View3D_display_background_image_set(PointerRNA *ptr, int value)
}
}
+/* Space Time */
+static void rna_SpaceTime_redraw_update(bContext *C, PointerRNA *ptr)
+{
+ SpaceTime *st= (SpaceTime*)ptr->data;
+ ED_screen_animation_timer_update(C, st->redraws);
+}
+
#else
static void rna_def_space(BlenderRNA *brna)
@@ -477,24 +491,29 @@ static void rna_def_background_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the view center");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image.");
RNA_def_property_range(prop, 0.0, FLT_MAX);
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "transparency", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blend");
RNA_def_property_ui_text(prop, "Transparency", "Amount to blend the image against the background color.");
RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
}
@@ -504,11 +523,11 @@ static void rna_def_space_3dview(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem viewport_shading_items[] = {
- {OB_BOUNDBOX, "BOUNDBOX", 0, "Bounding Box", "Display the object's local bounding boxes only"},
- {OB_WIRE, "WIREFRAME", 0, "Wireframe", "Display the object as wire edges"},
- {OB_SOLID, "SOLID", 0, "Solid", "Display the object solid, lit with default OpenGL lights"},
- {OB_SHADED, "SHADED", 0, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
- {OB_TEXTURE, "TEXTURED", 0, "Textured", "Display the object solid, with face-assigned textures"},
+ {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
+ {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
+ {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
+ {OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
+ {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem pivot_items[] = {
@@ -559,19 +578,19 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_range(prop, 1.0f, 250.0f);
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "near");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "far");
RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
- prop= RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "grid");
RNA_def_property_ui_text(prop, "Grid Spacing", "The distance between 3D View grid lines.");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
@@ -703,9 +722,9 @@ static void rna_def_space_buttons(BlenderRNA *brna)
{BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
{0, NULL, 0, NULL, NULL}};
- srna= RNA_def_struct(brna, "SpaceButtonsWindow", "Space");
+ srna= RNA_def_struct(brna, "SpaceProperties", "Space");
RNA_def_struct_sdna(srna, "SpaceButs");
- RNA_def_struct_ui_text(srna, "Buttons Space", "Buttons Window space data");
+ RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mainb");
@@ -716,7 +735,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "align");
RNA_def_property_enum_items(prop, align_items);
- RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceButtonsWindow_align_set", NULL);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels.");
RNA_def_property_update(prop, NC_WINDOW, NULL);
@@ -729,7 +748,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pinid");
RNA_def_property_struct_type(prop, "ID");
- RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceButtonsWindow_pin_id_typef");
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef");
RNA_def_property_flag(prop, PROP_EDITABLE);
}
@@ -831,11 +850,11 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem display_mode_items[] = {
- {SEQ_DRAW_SEQUENCE, "SEQUENCER", 0, "Sequencer", ""},
- {SEQ_DRAW_IMG_IMBUF, "IMAGE", 0, "Image Preview", ""},
- {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", 0, "Luma Waveform", ""},
- {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", 0, "Chroma Vectorscope", ""},
- {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", 0, "Histogram", ""},
+ {SEQ_DRAW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
+ {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
+ {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
+ {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
+ {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
@@ -894,11 +913,11 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
/* not sure we need rna access to these but adding anyway */
- prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
- prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
@@ -1056,6 +1075,10 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
+ prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
+ RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels.");
+
prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points.");
@@ -1099,6 +1122,59 @@ static void rna_def_space_nla(BlenderRNA *brna)
// TODO... autosnap, dopesheet?
}
+static void rna_def_space_time(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "SpaceTimeline", "Space");
+ RNA_def_struct_sdna(srna, "SpaceTime");
+ RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data.");
+
+ /* Define Anim Playback Areas */
+
+ prop= RNA_def_property(srna, "play_top_left", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_REGION);
+ RNA_def_property_ui_text(prop, "Top-Left 3D Window", "");
+ RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
+
+ prop= RNA_def_property(srna, "play_all_3d", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_3D_WIN);
+ RNA_def_property_ui_text(prop, "All 3D Windows", "");
+ RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
+
+ prop= RNA_def_property(srna, "play_anim", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_ANIM_WIN);
+ RNA_def_property_ui_text(prop, "Animation Windows", "");
+ RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
+
+ prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN);
+ RNA_def_property_ui_text(prop, "Properties Windows", "");
+ RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
+
+ prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_IMAGE_WIN);
+ RNA_def_property_ui_text(prop, "Image Windows", "");
+ RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
+
+ prop= RNA_def_property(srna, "play_sequencer", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_SEQ);
+ RNA_def_property_ui_text(prop, "Sequencer Windows", "");
+ RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update");
+
+ /* Other options */
+
+ prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_CONTINUE_PHYSICS);
+ RNA_def_property_ui_text(prop, "Continue Physics", "During playblack, continue physics simulations regardless of the frame number");
+
+ prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
+ RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes only from active/selected channels.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
+}
+
static void rna_def_console_line(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1309,7 +1385,85 @@ static void rna_def_space_filebrowser(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "params");
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceFileBrowser_params_set", NULL);
RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser.");
+}
+
+static void rna_def_space_info(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ srna= RNA_def_struct(brna, "SpaceInfo", "Space");
+ RNA_def_struct_sdna(srna, "SpaceInfo");
+ RNA_def_struct_ui_text(srna, "Space Info", "Info space data.");
+}
+
+static void rna_def_space_userpref(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
+ RNA_def_struct_sdna(srna, "SpaceUserPref");
+ RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data.");
+}
+
+static void rna_def_space_node(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem tree_type_items[] = {
+ {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes."},
+ {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nodes."},
+ {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDERLAYERS, "Compositing", "Compositing nodes."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem texture_type_items[] = {
+ {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object."},
+ {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World."},
+ {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush."},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
+ RNA_def_struct_sdna(srna, "SpaceNode");
+ RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data.");
+
+ prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "treetype");
+ RNA_def_property_enum_items(prop, tree_type_items);
+ RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit.");
+ RNA_def_property_update(prop, NC_NODE, NULL);
+
+ prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "texfrom");
+ RNA_def_property_enum_items(prop, texture_type_items);
+ RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from.");
+ RNA_def_property_update(prop, NC_NODE, NULL);
+
+ prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited.");
+
+ prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "from");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked.");
+
+ prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited.");
+
+ prop= RNA_def_property(srna, "backdrop", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
+ RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes.");
+ RNA_def_property_update(prop, NC_NODE, NULL);
+}
+
+static void rna_def_space_logic(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
+ RNA_def_struct_sdna(srna, "SpaceLogic");
+ RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data.");
}
void RNA_def_space(BlenderRNA *brna)
@@ -1327,8 +1481,13 @@ void RNA_def_space(BlenderRNA *brna)
rna_def_space_dopesheet(brna);
rna_def_space_graph(brna);
rna_def_space_nla(brna);
+ rna_def_space_time(brna);
rna_def_space_console(brna);
rna_def_console_line(brna);
+ rna_def_space_info(brna);
+ rna_def_space_userpref(brna);
+ rna_def_space_node(brna);
+ rna_def_space_logic(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 224e6643944..b11e5c6c12f 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -36,6 +36,9 @@
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
+#include "DNA_node_types.h"
+
+#include "BKE_node.h"
#include "WM_types.h"
@@ -50,6 +53,7 @@ static EnumPropertyItem texture_filter_items[] = {
#ifdef RNA_RUNTIME
#include "BKE_texture.h"
+#include "ED_node.h"
StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
{
@@ -82,11 +86,32 @@ StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
return &RNA_VoronoiTexture;
case TEX_DISTNOISE:
return &RNA_DistortedNoiseTexture;
+ case TEX_POINTDENSITY:
+ return &RNA_PointDensityTexture;
+ case TEX_VOXELDATA:
+ return &RNA_VoxelDataTexture;
default:
return &RNA_Texture;
}
}
+static void rna_Texture_type_set(PointerRNA *ptr, int value)
+{
+ Tex *tex= (Tex*)ptr->data;
+
+ if (value == TEX_VOXELDATA) {
+ if (tex->vd == NULL) {
+ tex->vd = BKE_add_voxeldata();
+ }
+ } else if (value == TEX_POINTDENSITY) {
+ if (tex->pd == NULL) {
+ tex->pd = BKE_add_pointdensity();
+ }
+ }
+
+ tex->type = value;
+}
+
static int rna_TextureSlot_name_length(PointerRNA *ptr)
{
MTex *mtex= ptr->data;
@@ -107,6 +132,65 @@ static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str)
strcpy(str, "");
}
+static int rna_TextureSlot_output_node_get(PointerRNA *ptr)
+{
+ MTex *mtex= ptr->data;
+ Tex *tex= mtex->tex;
+ int cur= mtex->which_output;
+
+ if(tex) {
+ bNodeTree *ntree= tex->nodetree;
+ bNode *node;
+ if(ntree) {
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if(node->type == TEX_NODE_OUTPUT) {
+ if(cur == node->custom1)
+ return cur;
+ }
+ }
+ }
+ }
+
+ mtex->which_output= 0;
+ return 0;
+}
+
+
+static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ MTex *mtex= ptr->data;
+ Tex *tex= mtex->tex;
+ EnumPropertyItem *item= NULL;
+ int totitem= 0;
+
+ if(tex && C) { /* Note, tex/mtex/ntree can be invalid of C is NULL, TODO - can this give valid results when C is NULL? */
+ bNodeTree *ntree= tex->nodetree;
+ if(ntree) {
+ EnumPropertyItem tmp= {0, "", 0, "", ""};
+ bNode *node;
+
+ tmp.value = 0;
+ tmp.name = "Not Specified";
+ tmp.identifier = "NOT_SPECIFIED";
+ RNA_enum_item_add(&item, &totitem, &tmp);
+
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if(node->type == TEX_NODE_OUTPUT) {
+ tmp.value= node->custom1;
+ tmp.name= ((TexNodeOutput*)node->storage)->name;
+ tmp.identifier = tmp.name;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ }
+ }
+ }
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+
+ *free = 1;
+ return item;
+}
+
static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
@@ -118,6 +202,17 @@ static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value)
tex->coba= add_colorband(0);
}
+void rna_Texture_use_nodes_set(PointerRNA *ptr, int v)
+{
+ Tex *tex= (Tex*)ptr->data;
+
+ tex->use_nodes = v;
+ tex->type = 0;
+
+ if(v && tex->nodetree==NULL)
+ ED_node_texture_default(tex);
+}
+
static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
@@ -147,6 +242,20 @@ static EnumPropertyItem *rna_ImageTexture_filter_itemf(bContext *C, PointerRNA *
return item;
}
+static float rna_TextureSlot_angle_get(PointerRNA *ptr)
+{
+ MTex *tex= (MTex*)ptr->data;
+ const float conv = 57.295779506;
+ return tex->rot * conv;
+}
+
+static void rna_TextureSlot_angle_set(PointerRNA *ptr, float v)
+{
+ MTex *tex= (MTex*)ptr->data;
+ const float conv = 0.017453293;
+ tex->rot = v * conv;
+}
+
#else
static void rna_def_color_ramp_element(BlenderRNA *brna)
@@ -209,27 +318,27 @@ static void rna_def_texmapping(BlenderRNA *brna)
srna= RNA_def_struct(brna, "TexMapping", NULL);
RNA_def_struct_ui_text(srna, "Texture Mapping", "Mapping settings");
- prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
@@ -267,6 +376,16 @@ static void rna_def_mtex(BlenderRNA *brna)
{MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem prop_map_mode_items[] = {
+ {MTEX_MAP_MODE_FIXED, "FIXED", 0, "Fixed", ""},
+ {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
+ {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem output_node_items[] = {
+ {0, "DUMMY", 0, "Dummy", ""},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "TextureSlot", NULL);
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Texture Slot", "Texture slot defining the mapping and influence of a texture.");
@@ -287,13 +406,13 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* mapping */
- prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "ofs");
RNA_def_property_ui_range(prop, -10, 10, 10, 2);
RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
@@ -325,23 +444,41 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "rot");
+ RNA_def_property_range(prop, 0, 360);
+ RNA_def_property_float_funcs(prop, "rna_TextureSlot_angle_get", "rna_TextureSlot_angle_set", NULL);
+ RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "brush_map_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_map_mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "");
+
+ prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "def_var");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "variable_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "variable_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Variable Factor", "Amount texture affects other values.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "norfac");
RNA_def_property_ui_range(prop, 0, 5, 10, 3);
RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "which_output");
+ RNA_def_property_enum_items(prop, output_node_items);
+ RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf");
+ RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_filter_size_common(StructRNA *srna)
@@ -1085,17 +1222,34 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Voronoi", "Procedural voronoi texture.");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "feature_weights", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "weight_1", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w1");
- RNA_def_property_array(prop, 4);
RNA_def_property_range(prop, -2, 2);
- RNA_def_property_ui_text(prop, "Feature Weights", "");
+ RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vn_w2");
+ RNA_def_property_range(prop, -2, 2);
+ RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vn_w3");
+ RNA_def_property_range(prop, -2, 2);
+ RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vn_w4");
+ RNA_def_property_range(prop, -2, 2);
+ RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_mexp");
RNA_def_property_range(prop, 0.01, 10);
- RNA_def_property_ui_text(prop, "Minkovsky Exponent", "");
+ RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
@@ -1139,7 +1293,7 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Distorted Noise", "Procedural distorted noise texture.");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "distortion_amount", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist_amount");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Distortion Amount", "");
@@ -1153,13 +1307,13 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
+ RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
+ RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
@@ -1171,6 +1325,252 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
+static void rna_def_texture_pointdensity(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem point_source_items[] = {
+ {TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"},
+ {TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"},
+ //{TEX_PD_FILE, "FILE", 0 , "File", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem particle_cache_items[] = {
+ {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""},
+ {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""},
+ {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem vertice_cache_items[] = {
+ {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""},
+ {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""},
+ {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem falloff_items[] = {
+ {TEX_PD_FALLOFF_STD, "STANDARD", 0, "Standard", ""},
+ {TEX_PD_FALLOFF_SMOOTH, "SMOOTH", 0, "Smooth", ""},
+ {TEX_PD_FALLOFF_SOFT, "SOFT", 0, "Soft", ""},
+ {TEX_PD_FALLOFF_CONSTANT, "CONSTANT", 0, "Constant", "Density is constant within lookup radius"},
+ {TEX_PD_FALLOFF_ROOT, "ROOT", 0, "Root", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem color_source_items[] = {
+ {TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""},
+ {TEX_PD_COLOR_PARTAGE, "PARTICLE_AGE", 0, "Particle Age", "Lifetime mapped as 0.0 - 1.0 intensity"},
+ {TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed", "Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"},
+ {TEX_PD_COLOR_PARTVEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "XYZ velocity mapped to RGB colors"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem turbulence_influence_items[] = {
+ {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"},
+ {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "Turbulent noise driven by particle velocity"},
+ {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", "Turbulent noise driven by the particle's age between birth and death"},
+ {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "PointDensity", NULL);
+ RNA_def_struct_sdna(srna, "PointDensity");
+ RNA_def_struct_ui_text(srna, "PointDensity", "Point density settings.");
+
+ prop= RNA_def_property(srna, "point_source", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "source");
+ RNA_def_property_enum_items(prop, point_source_items);
+ RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "object");
+ RNA_def_property_ui_text(prop, "Object", "Object to take point data from");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "psys");
+ RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points");
+ RNA_def_property_struct_type(prop, "ParticleSystem");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
+ RNA_def_property_enum_items(prop, particle_cache_items);
+ RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space");
+ RNA_def_property_enum_items(prop, vertice_cache_items);
+ RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "radius");
+ RNA_def_property_range(prop, 0.01, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "falloff_type");
+ RNA_def_property_enum_items(prop, falloff_items);
+ RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "falloff_softness", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "falloff_softness");
+ RNA_def_property_range(prop, 0.01, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "color_source");
+ RNA_def_property_enum_items(prop, color_source_items);
+ RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "speed_scale");
+ RNA_def_property_range(prop, 0.001, 100.0);
+ RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "coba");
+ RNA_def_property_struct_type(prop, "ColorRamp");
+ RNA_def_property_ui_text(prop, "Color Ramp", "");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ /* Turbulence */
+ prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE);
+ RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "turbulence_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "noise_size");
+ RNA_def_property_range(prop, 0.01, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "noise_fac");
+ RNA_def_property_range(prop, 0.01, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Strength", "");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "noise_depth");
+ RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noise_influence");
+ RNA_def_property_enum_items(prop, turbulence_influence_items);
+ RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noise_basis");
+ RNA_def_property_enum_items(prop, prop_noise_basis_items);
+ RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+
+ srna= RNA_def_struct(brna, "PointDensityTexture", "Texture");
+ RNA_def_struct_sdna(srna, "Tex");
+ RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture");
+
+ prop= RNA_def_property(srna, "pointdensity", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "pd");
+ RNA_def_property_struct_type(prop, "PointDensity");
+ RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+}
+
+static void rna_def_texture_voxeldata(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem interpolation_type_items[] = {
+ {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor", "No interpolation, fast but blocky and low quality."},
+ {TEX_VD_LINEAR, "TRILINEAR", 0, "Linear", "Good smoothness and speed"},
+ {TEX_VD_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Mid-range quality and speed"},
+ {TEX_VD_TRICUBIC_CATROM, "TRICUBIC_CATROM", 0, "Cubic Catmull-Rom", "High quality interpolation, but slower"},
+ {TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline", "Smoothed high quality interpolation, but slower"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem file_format_items[] = {
+ {TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"},
+ {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit greyscale binary data"},
+ //{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""},
+ {TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"},
+ {TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "VoxelData", NULL);
+ RNA_def_struct_sdna(srna, "VoxelData");
+ RNA_def_struct_ui_text(srna, "VoxelData", "Voxel data settings.");
+
+ prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "interp_type");
+ RNA_def_property_enum_items(prop, interpolation_type_items);
+ RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "int_multiplier");
+ RNA_def_property_range(prop, 0.01, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "file_format");
+ RNA_def_property_enum_items(prop, file_format_items);
+ RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_sdna(prop, NULL, "source_path");
+ RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resol");
+ RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid.");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
+ RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "still_frame");
+ RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "object");
+ RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+
+ srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
+ RNA_def_struct_sdna(srna, "Tex");
+ RNA_def_struct_ui_text(srna, "Voxel Data", "Settings for the Voxel Data texture");
+
+ prop= RNA_def_property(srna, "voxeldata", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "vd");
+ RNA_def_property_struct_type(prop, "VoxelData");
+ RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+}
+
static void rna_def_texture(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1178,19 +1578,21 @@ static void rna_def_texture(BlenderRNA *brna)
static EnumPropertyItem prop_type_items[] = {
{0, "NONE", 0, "None", ""},
- {TEX_CLOUDS, "CLOUDS", 0, "Clouds", ""},
- {TEX_WOOD, "WOOD", 0, "Wood", ""},
- {TEX_MARBLE, "MARBLE", 0, "Marble", ""},
- {TEX_MAGIC, "MAGIC", 0, "Magic", ""},
- {TEX_BLEND, "BLEND", 0, "Blend", ""},
- {TEX_STUCCI, "STUCCI", 0, "Stucci", ""},
- {TEX_NOISE, "NOISE", 0, "Noise", ""},
- {TEX_IMAGE, "IMAGE", 0, "Image or Movie", ""},
- {TEX_PLUGIN, "PLUGIN", 0, "Plugin", ""},
- {TEX_ENVMAP, "ENVIRONMENT_MAP", 0, "Environment Map", ""},
- {TEX_MUSGRAVE, "MUSGRAVE", 0, "Musgrave", ""},
- {TEX_VORONOI, "VORONOI", 0, "Voronoi", ""},
- {TEX_DISTNOISE, "DISTORTED_NOISE", 0, "Distorted Noise", ""},
+ {TEX_PLUGIN, "PLUGIN", ICON_CONSTRAINT, "Plugin", ""},
+ {TEX_IMAGE, "IMAGE", ICON_RENDER_RESULT, "Image or Movie", ""},
+ {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_RENDER_RESULT, "Environment Map", ""},
+ {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", ""},
+ {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", ""},
+ {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", ""},
+ {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", ""},
+ {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", ""},
+ {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", ""},
+ {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", ""},
+ {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", ""},
+ {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", ""},
+ {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", ""},
+ {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""},
+ {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Texture", "ID");
@@ -1200,10 +1602,13 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_struct_refine_func(srna, "rna_Texture_refine");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ //RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
+
prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set");
@@ -1235,7 +1640,19 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "RGB Factor", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
+
+ /* nodetree */
+ prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set");
+ RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
+ prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
+ RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures");
+ RNA_def_property_update(prop, NC_TEXTURE, NULL);
+
rna_def_animdata_common(srna);
/* specific types */
@@ -1252,6 +1669,8 @@ static void rna_def_texture(BlenderRNA *brna)
rna_def_texture_musgrave(brna);
rna_def_texture_voronoi(brna);
rna_def_texture_distorted_noise(brna);
+ rna_def_texture_pointdensity(brna);
+ rna_def_texture_voxeldata(brna);
/* XXX add more types here .. */
}
diff --git a/source/blender/makesrna/intern/rna_timeline.c b/source/blender/makesrna/intern/rna_timeline.c
index d42603e1952..5e20fca15f0 100644
--- a/source/blender/makesrna/intern/rna_timeline.c
+++ b/source/blender/makesrna/intern/rna_timeline.c
@@ -49,7 +49,7 @@ static void rna_def_timeline_marker(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "frame", PROP_INT, PROP_TIME);
RNA_def_property_ui_text(prop, "Frame", "The frame on which the timeline marker appears.");
}
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 590f85fedd7..f16180451a7 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -138,6 +138,8 @@ static void rna_Panel_unregister(const bContext *C, StructRNA *type)
if(!(art=region_type_find(NULL, pt->space_type, pt->region_type)))
return;
+ RNA_struct_free_extension(type, &pt->ext);
+
BLI_freelinkN(&art->paneltypes, pt);
RNA_struct_free(&BLENDER_RNA, type);
@@ -146,7 +148,7 @@ static void rna_Panel_unregister(const bContext *C, StructRNA *type)
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
}
-static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
ARegionType *art;
PanelType *pt, dummypt = {0};
@@ -233,6 +235,8 @@ static void rna_Header_unregister(const bContext *C, StructRNA *type)
if(!(art=region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER)))
return;
+ RNA_struct_free_extension(type, &ht->ext);
+
BLI_freelinkN(&art->headertypes, ht);
RNA_struct_free(&BLENDER_RNA, type);
@@ -241,7 +245,7 @@ static void rna_Header_unregister(const bContext *C, StructRNA *type)
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
}
-static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
ARegionType *art;
HeaderType *ht, dummyht = {0};
@@ -347,6 +351,8 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type)
if(!(art=region_type_find(NULL, mt->space_type, RGN_TYPE_HEADER)))
return;
+ RNA_struct_free_extension(type, &mt->ext);
+
BLI_freelinkN(&art->menutypes, mt);
RNA_struct_free(&BLENDER_RNA, type);
@@ -355,7 +361,7 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type)
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
}
-static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
ARegionType *art;
MenuType *mt, dummymt = {0};
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 67ade9998ed..7fc2d75a708 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -37,6 +37,23 @@
#ifdef RNA_RUNTIME
+static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle)
+{
+ int flag= 0;
+
+ flag |= (slider)? UI_ITEM_R_SLIDER: 0;
+ flag |= (expand)? UI_ITEM_R_EXPAND: 0;
+ flag |= (toggle)? UI_ITEM_R_TOGGLE: 0;
+
+ uiItemR(layout, name, icon, ptr, propname, flag);
+}
+
+static PointerRNA rna_uiItemO(uiLayout *layout, char *name, int icon, char *opname, int properties)
+{
+ int flag= (properties)? UI_ITEM_O_RETURN_PROPS: 0;
+ return uiItemFullO(layout, name, icon, opname, NULL, uiLayoutGetOperatorContext(layout), flag);
+}
+
#else
#define DEF_ICON(name) {name, #name, 0, #name, ""},
@@ -119,10 +136,10 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "split", "uiLayoutSplit");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
- RNA_def_float(func, "percentage", 0.5f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f);
+ RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f);
/* items */
- func= RNA_def_function(srna, "itemR", "uiItemR");
+ func= RNA_def_function(srna, "itemR", "rna_uiItemR");
api_ui_item_common(func);
api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
@@ -150,8 +167,12 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property.");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "itemO", "uiItemO");
+ func= RNA_def_function(srna, "itemO", "rna_uiItemO");
api_ui_item_op_common(func);
+ parm= RNA_def_boolean(func, "properties", 0, "Properties", "Return operator properties to fill in manually.");
+ parm= RNA_def_pointer(func, "return_properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "item_enumO", "uiItemEnumO_string");
api_ui_item_op_common(func);
@@ -220,6 +241,7 @@ void RNA_api_ui_layout(StructRNA *srna)
/* templates */
func= RNA_def_function(srna, "template_header", "uiTemplateHeader");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander.");
func= RNA_def_function(srna, "template_ID", "uiTemplateID");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
@@ -243,11 +265,13 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "parent", "ID", "", "ID datablock.");
+ parm= RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot.");
func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
parm= RNA_def_pointer(func, "curvemap", "CurveMapping", "", "Curve mapping pointer.");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display.");
+ RNA_def_boolean(func, "compact", 0, "", "Use more compact curve mapping.");
func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
parm= RNA_def_pointer(func, "ramp", "ColorRamp", "", "Color ramp pointer.");
@@ -287,6 +311,9 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ func= RNA_def_function(srna, "view3d_select_faceselmenu", "uiTemplate_view3d_select_faceselmenu");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+
func= RNA_def_function(srna, "template_texture_image", "uiTemplateTextureImage");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "texture", "Texture", "", "");
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index f1fd11a0094..a0716cc7dc7 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -37,6 +37,8 @@
#include "BKE_utildefines.h"
+#include "BKE_sound.h"
+
#ifdef RNA_RUNTIME
static void rna_userdef_lmb_select_set(struct PointerRNA *ptr,int value)
@@ -116,6 +118,11 @@ static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
}
+static void rna_UserDef_audio_update(bContext *C, PointerRNA *ptr)
+{
+ sound_init(C);
+}
+
#else
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
@@ -683,7 +690,7 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
- RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the Ipo Editor.");
+ RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor.");
rna_def_userdef_theme_spaces_main(srna, SPACE_IPO);
@@ -820,19 +827,33 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER);
}
-static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
+static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
{
StructRNA *srna;
- /* space_info */
+ /* space_userpref */
srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences.");
+ rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
+}
+
+static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ /* space_info */
+
+ srna= RNA_def_struct(brna, "ThemeInfo", NULL);
+ RNA_def_struct_sdna(srna, "ThemeSpace");
+ RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info.");
+
rna_def_userdef_theme_spaces_main(srna, SPACE_INFO);
}
+
static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
{
StructRNA *srna;
@@ -990,9 +1011,9 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
/* space_buts */
- srna= RNA_def_struct(brna, "ThemeButtonsWindow", NULL);
+ srna= RNA_def_struct(brna, "ThemeProperties", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
- RNA_def_struct_ui_text(srna, "Theme Buttons Window", "Theme settings for the Buttons Window.");
+ RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties.");
rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS);
@@ -1393,10 +1414,10 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
RNA_def_property_ui_text(prop, "Sequence Editor", "");
- prop= RNA_def_property(srna, "buttons_window", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
- RNA_def_property_struct_type(prop, "ThemeButtonsWindow");
- RNA_def_property_ui_text(prop, "Buttons Window", "");
+ RNA_def_property_struct_type(prop, "ThemeProperties");
+ RNA_def_property_ui_text(prop, "Properties", "");
prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "text");
@@ -1423,8 +1444,13 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ThemeOutliner");
RNA_def_property_ui_text(prop, "Outliner", "");
- prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
+ RNA_def_property_struct_type(prop, "ThemeInfo");
+ RNA_def_property_ui_text(prop, "Info", "");
+
+ prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
RNA_def_property_struct_type(prop, "ThemeUserPreferences");
RNA_def_property_ui_text(prop, "User Preferences", "");
@@ -1453,6 +1479,7 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna)
rna_def_userdef_theme_space_node(brna);
rna_def_userdef_theme_space_outliner(brna);
rna_def_userdef_theme_space_info(brna);
+ rna_def_userdef_theme_space_userpref(brna);
rna_def_userdef_theme_space_sound(brna);
rna_def_userdef_theme_space_logic(brna);
rna_def_userdef_theme_colorset(brna);
@@ -1472,7 +1499,7 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode.");
- prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining.");
@@ -1635,16 +1662,19 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvisize");
RNA_def_property_range(prop, 10, 64);
RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvibright");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
/* middle mouse button */
prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE);
@@ -1678,16 +1708,19 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1);
RNA_def_property_ui_text(prop, "Manipulator", "Use 3d transform manipulator.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_size");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
RNA_def_property_range(prop, 2, 40);
RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
@@ -1698,6 +1731,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
RNA_def_property_range(prop, 4, 10);
RNA_def_property_ui_text(prop, "Object Center Size", "Diameter in Pixels for Object/Lamp center display.");
+ RNA_def_property_update(prop, NC_WINDOW, NULL);
prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ndof_pan");
@@ -1819,11 +1853,9 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke.");
-#if 0
prop= RNA_def_property(srna, "grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke.");
-#endif
prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
@@ -1832,47 +1864,51 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
- RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
- RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
- RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_text", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
- RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
- RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_armature", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
- RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
- RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
- RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
- RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_ipo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
- RNA_def_property_ui_text(prop, "Duplicate Ipo", "Causes ipo data to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Ipo", "Causes ipo data to be duplicated with the object.");
prop= RNA_def_property(srna, "duplicate_action", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
- RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with Shift+D.");
+ RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object.");
+
+ prop= RNA_def_property(srna, "duplicate_particle", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
+ RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object.");
}
static void rna_def_userdef_language(BlenderRNA *brna)
@@ -1977,6 +2013,53 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{512, "AUDIO_SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
{1024, "AUDIO_SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
{2048, "AUDIO_SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
+ {4096, "AUDIO_SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
+ {8192, "AUDIO_SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
+ {16384, "AUDIO_SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
+ {32768, "AUDIO_SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_device_items[] = {
+ {0, "AUDIO_DEVICE_NULL", 0, "No Audio", "Null device - there will be no audio output."},
+#ifdef WITH_SDL
+ {1, "AUDIO_DEVICE_SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage."},
+#endif
+#ifdef WITH_OPENAL
+ {2, "AUDIO_DEVICE_OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage."},
+#endif
+#ifdef WITH_JACK
+ {3, "AUDIO_DEVICE_JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users."},
+#endif
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_rate_items[] = {
+// {8000, "AUDIO_RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second."},
+// {11025, "AUDIO_RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second."},
+// {16000, "AUDIO_RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second."},
+// {22050, "AUDIO_RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second."},
+// {32000, "AUDIO_RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second."},
+ {44100, "AUDIO_RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second."},
+ {48000, "AUDIO_RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second."},
+// {88200, "AUDIO_RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second."},
+ {96000, "AUDIO_RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second."},
+ {192000, "AUDIO_RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_format_items[] = {
+ {0x01, "AUDIO_FORMAT_U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer."},
+ {0x12, "AUDIO_FORMAT_S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer."},
+ {0x13, "AUDIO_FORMAT_S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer."},
+ {0x14, "AUDIO_FORMAT_S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer."},
+ {0x24, "AUDIO_FORMAT_FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float."},
+ {0x28, "AUDIO_FORMAT_DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_channel_items[] = {
+ {1, "AUDIO_CHANNELS_MONO", 0, "Mono", "Set audio channels to mono."},
+ {2, "AUDIO_CHANNELS_STEREO", 0, "Stereo", "Set audio channels to stereo."},
+ {4, "AUDIO_CHANNELS_SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels."},
+ {6, "AUDIO_CHANNELS_SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound."},
+ {8, "AUDIO_CHANNELS_SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem draw_method_items[] = {
@@ -2078,6 +2161,31 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
RNA_def_property_enum_items(prop, audio_mixing_samples_items);
RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
+ RNA_def_property_enum_items(prop, audio_device_items);
+ RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audiorate");
+ RNA_def_property_enum_items(prop, audio_rate_items);
+ RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audioformat");
+ RNA_def_property_enum_items(prop, audio_format_items);
+ RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
+
+ prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
+ RNA_def_property_enum_items(prop, audio_channel_items);
+ RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
#if 0
prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
@@ -2108,6 +2216,10 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files.");
+ prop= RNA_def_property(srna, "load_ui", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
+ RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files.");
+
prop= RNA_def_property(srna, "fonts_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "fontdir");
RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts.");
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 4a2154bc3cf..eaed0100386 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -297,7 +297,7 @@ static void rna_def_operator_utils(BlenderRNA *brna)
srna= RNA_def_struct(brna, "OperatorMousePath", "IDPropertyGroup");
RNA_def_struct_ui_text(srna, "Operator Mouse Path", "Mouse path values for operators that record such paths.");
- prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Location", "Mouse location.");
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index f23b893539d..0ed5016ccd2 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -154,25 +154,25 @@ static void rna_def_world_mtex(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
- prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below.");
@@ -216,7 +216,7 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC);
RNA_def_property_ui_text(prop, "Enabled", "Use Ambient Occlusion to add light based on distance between elements, creating the illusion of omnipresent light");
- prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "aodist");
RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect.");
@@ -319,19 +319,21 @@ static void rna_def_world_mist(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Intensity", "Intensity of the mist effect.");
- prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "miststa");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "mistdist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "misthi");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height");
@@ -363,7 +365,7 @@ static void rna_def_world_stars(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars.");
RNA_def_property_update(prop, NC_WORLD, NULL);
- prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starmindist");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars.");
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 664aacf11ab..bba96adf25e 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -29,9 +29,8 @@ SET(INC
. ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna
../render/extern/include ../../../intern/decimation/extern ../makesrna
../imbuf ../avi ../../../intern/elbeem/extern
- ../../../intern/iksolver/extern ../blenloader ../quicktime
+ ../../../intern/iksolver/extern ../blenloader
../blenkernel ../../../extern/glew/include ../gpu
- ${SDL_INC}
${ZLIB_INC}
)
@@ -40,7 +39,7 @@ IF(WITH_OPENEXR)
ENDIF(WITH_OPENEXR)
IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
+ SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
index 973d74d71ff..9aebd999b29 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
@@ -53,7 +53,7 @@ static void do_luma_matte(bNode *node, float *out, float *in)
if(in[0]>c->t1) {
alpha=1.0;
}
- else if(in[1]<c->t2){
+ else if(in[0]<c->t2){
alpha=0.0;
}
else {/*blend */
@@ -99,7 +99,7 @@ static void node_composit_init_luma_matte(bNode *node)
{
NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
node->storage=c;
- c->t1= 0.0f;
+ c->t1= 1.0f;
c->t2= 0.0f;
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
index fbc56dfcc83..693a20b5b0f 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
@@ -34,9 +34,7 @@
#endif
/* TODO, support python3.x */
-#if PY_VERSION_HEX >= 0x03000000
#define DISABLE_PYTHON 1
-#endif
#include "DNA_text_types.h"
#include "BKE_text.h"
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_at.c b/source/blender/nodes/intern/TEX_nodes/TEX_at.c
index 80f232ccd0c..4d714d91130 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_at.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_at.c
@@ -38,12 +38,14 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
+ TexParams np = *p;
float new_coord[3];
+ np.coord = new_coord;
- tex_input_vec(new_coord, in[1], coord, thread);
- tex_input_rgba(out, in[0], new_coord, thread);
+ tex_input_vec(new_coord, in[1], p, thread);
+ tex_input_rgba(out, in[0], &np, thread);
}
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
index 80cbd6188ee..f1f3b0919ae 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -57,8 +57,10 @@ static float noise(int n) /* fast integer noise */
return 0.5f * ((float)nn / 1073741824.0f);
}
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
+ float *coord = p->coord;
+
float x = coord[0];
float y = coord[1];
@@ -71,14 +73,14 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor
float bricks2[4];
float mortar[4];
- float mortar_thickness = tex_input_value(in[3], coord, thread);
- float bias = tex_input_value(in[4], coord, thread);
- float brick_width = tex_input_value(in[5], coord, thread);
- float row_height = tex_input_value(in[6], coord, thread);
+ float mortar_thickness = tex_input_value(in[3], p, thread);
+ float bias = tex_input_value(in[4], p, thread);
+ float brick_width = tex_input_value(in[5], p, thread);
+ float row_height = tex_input_value(in[6], p, thread);
- tex_input_rgba(bricks1, in[0], coord, thread);
- tex_input_rgba(bricks2, in[1], coord, thread);
- tex_input_rgba(mortar, in[2], coord, thread);
+ tex_input_rgba(bricks1, in[0], p, thread);
+ tex_input_rgba(bricks2, in[1], p, thread);
+ tex_input_rgba(mortar, in[2], p, thread);
rownum = (int)floor(y / row_height);
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
index 60357782e25..b889f1e2164 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -40,12 +40,12 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- float x = coord[0];
- float y = coord[1];
- float z = coord[2];
- float sz = tex_input_value(in[2], coord, thread);
+ float x = p->coord[0];
+ float y = p->coord[1];
+ float z = p->coord[2];
+ float sz = tex_input_value(in[2], p, thread);
/* 0.00001 because of unit sized stuff */
int xi = (int)fabs(floor(0.00001 + x / sz));
@@ -53,9 +53,9 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor
int zi = (int)fabs(floor(0.00001 + z / sz));
if( (xi % 2 == yi % 2) == (zi % 2) ) {
- tex_input_rgba(out, in[0], coord, thread);
+ tex_input_rgba(out, in[0], p, thread);
} else {
- tex_input_rgba(out, in[1], coord, thread);
+ tex_input_rgba(out, in[1], p, thread);
}
}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c
index 26576befa3e..9fc4b2ff7c2 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -40,11 +40,11 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
int i;
for(i = 0; i < 4; i++)
- out[i] = tex_input_value(in[i], coord, thread);
+ out[i] = tex_input_value(in[i], p, thread);
}
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
index da487c190af..e5c2b309fb3 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
@@ -33,11 +33,11 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void vectorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void vectorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- out[0] = coord[0];
- out[1] = coord[1];
- out[2] = coord[2];
+ out[0] = p->coord[0];
+ out[1] = p->coord[1];
+ out[2] = p->coord[2];
}
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
index 7d1366b5b18..61ebcea7360 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -36,14 +36,13 @@ static bNodeSocketType time_outputs[]= {
{ -1, 0, "" }
};
-static void time_colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void time_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
/* stack order output: fac */
float fac= 0.0f;
- // XXX SOLVE! these functions should get the TexCallData pointer
-// if(node->custom1 < node->custom2)
-// fac = (scene->r.cfra - node->custom1)/(float)(node->custom2-node->custom1);
+ if(node->custom1 < node->custom2)
+ fac = (p->cfra - node->custom1)/(float)(node->custom2-node->custom1);
fac = curvemapping_evaluateF(node->storage, 0, fac);
out[0] = CLAMPIS(fac, 0.0f, 1.0f);
@@ -90,10 +89,10 @@ static bNodeSocketType rgb_outputs[]= {
{ -1, 0, "" }
};
-static void rgb_colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void rgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float cin[4];
- tex_input_rgba(cin, in[0], coord, thread);
+ tex_input_rgba(cin, in[0], p, thread);
curvemapping_evaluateRGBF(node->storage, out, cin);
out[3] = cin[3];
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
index c08eb12a18f..f7a409f0230 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -41,27 +41,27 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void valuefn_r(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void valuefn_r(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- tex_input_rgba(out, in[0], coord, thread);
+ tex_input_rgba(out, in[0], p, thread);
*out = out[0];
}
-static void valuefn_g(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void valuefn_g(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- tex_input_rgba(out, in[0], coord, thread);
+ tex_input_rgba(out, in[0], p, thread);
*out = out[1];
}
-static void valuefn_b(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void valuefn_b(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- tex_input_rgba(out, in[0], coord, thread);
+ tex_input_rgba(out, in[0], p, thread);
*out = out[2];
}
-static void valuefn_a(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void valuefn_a(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- tex_input_rgba(out, in[0], coord, thread);
+ tex_input_rgba(out, in[0], p, thread);
*out = out[3];
}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
index d23eb6bc589..4e145e26b72 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
@@ -41,12 +41,12 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float coord1[3], coord2[3];
- tex_input_vec(coord1, in[0], coord, thread);
- tex_input_vec(coord2, in[1], coord, thread);
+ tex_input_vec(coord1, in[0], p, thread);
+ tex_input_vec(coord2, in[1], p, thread);
*out = VecLenf(coord2, coord1);
}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
index bb1a49fb235..192c7a39ee8 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c
@@ -65,15 +65,15 @@ static void do_hue_sat_fac(bNode *node, float *out, float hue, float sat, float
}
}
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- float hue = tex_input_value(in[0], coord, thread);
- float sat = tex_input_value(in[1], coord, thread);
- float val = tex_input_value(in[2], coord, thread);
- float fac = tex_input_value(in[3], coord, thread);
+ float hue = tex_input_value(in[0], p, thread);
+ float sat = tex_input_value(in[1], p, thread);
+ float val = tex_input_value(in[2], p, thread);
+ float fac = tex_input_value(in[3], p, thread);
float col[4];
- tex_input_rgba(col, in[4], coord, thread);
+ tex_input_rgba(col, in[4], p, thread);
hue += 0.5f; /* [-.5, .5] -> [0, 1] */
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
index b84088da154..0a55af70b52 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
@@ -22,7 +22,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -34,10 +34,10 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- float x = coord[0];
- float y = coord[1];
+ float x = p->coord[0];
+ float y = p->coord[1];
Image *ima= (Image *)node->id;
ImageUser *iuser= (ImageUser *)node->storage;
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c
index 09716951009..5663f897ff5 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -39,11 +39,11 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float col[4];
- tex_input_rgba(col, in[0], coord, thread);
+ tex_input_rgba(col, in[0], p, thread);
col[0] = 1.0f - col[0];
col[1] = 1.0f - col[1];
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_math.c b/source/blender/nodes/intern/TEX_nodes/TEX_math.c
index bac91fc0901..4ee04140fca 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_math.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_math.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -42,10 +42,10 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- float in0 = tex_input_value(in[0], coord, thread);
- float in1 = tex_input_value(in[1], coord, thread);
+ float in0 = tex_input_value(in[0], p, thread);
+ float in1 = tex_input_value(in[1], p, thread);
switch(node->custom1){
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
index b1ccb7a3d07..24bdde70127 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -41,13 +41,13 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
- float fac = tex_input_value(in[0], coord, thread);
+ float fac = tex_input_value(in[0], p, thread);
float col1[4], col2[4];
- tex_input_rgba(col1, in[1], coord, thread);
- tex_input_rgba(col2, in[2], coord, thread);
+ tex_input_rgba(col1, in[1], p, thread);
+ tex_input_rgba(col2, in[2], p, thread);
CLAMP(fac, 0.0f, 1.0f);
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
index 060ea8d7e67..7ce5ec88c48 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -35,6 +35,48 @@ static bNodeSocketType inputs[]= {
{ -1, 0, "" }
};
+static void osa(
+ void (*input_fn)(float *, bNodeStack *, TexParams *, short),
+ float *out,
+ bNodeStack *in,
+ TexParams *p,
+ short thread
+){
+ if(!p->dxt) {
+ input_fn(out, in, p, thread);
+ } else {
+ float sample[4] = {0};
+ float coord[3];
+ TexParams sp = *p;
+ int i;
+
+ sp.coord = coord;
+ sp.dxt = sp.dyt = 0;
+
+ QUATCOPY(out, sample);
+
+ for(i=0; i<5; i++) {
+ VECCOPY(coord, p->coord);
+
+ if(i < 4)
+ {
+ if(i % 2) VECADD(coord, coord, p->dxt);
+ if(i > 1) VECADD(coord, coord, p->dyt);
+ }
+ else
+ {
+ VECADDFAC(coord, coord, p->dxt, 0.5);
+ VECADDFAC(coord, coord, p->dyt, 0.5);
+ }
+
+ input_fn(sample, in, &sp, thread);
+
+ QUATADDFAC(out, out, sample, 0.2);
+ }
+ }
+}
+
+
/* applies to render pipeline */
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
@@ -49,14 +91,17 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
if(!cdata->do_preview) {
if(cdata->which_output == node->custom1)
{
- tex_input_rgba(&target->tr, in[0], cdata->coord, cdata->thread);
+ TexParams params;
+ params_from_cdata(&params, cdata);
+
+ osa(tex_input_rgba, &target->tr, in[0], &params, cdata->thread);
target->tin = (target->tr + target->tg + target->tb) / 3.0f;
target->talpha = 1.0f;
if(target->nor) {
if(in[1]->hasinput)
- tex_input_vec(target->nor, in[1], cdata->coord, cdata->thread);
+ osa(tex_input_vec, target->nor, in[1], &params, cdata->thread);
else
target->nor = 0;
}
@@ -64,13 +109,85 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
}
}
-static void init(bNode* node)
+static void unique_name(bNode *node)
{
- TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output");
- strcpy(tno->name, "Default");
- node->storage= tno;
+ TexNodeOutput *tno = (TexNodeOutput *)node->storage;
+ char *new_name = 0;
+ int new_len;
+ int suffix;
+ bNode *i;
+ char *name = tno->name;
+
+ i = node;
+ while(i->prev) i = i->prev;
+ for(; i; i=i->next) {
+ if(
+ i == node ||
+ i->type != TEX_NODE_OUTPUT ||
+ strcmp(name, ((TexNodeOutput*)(i->storage))->name)
+ )
+ continue;
+
+ if(!new_name) {
+ int len = strlen(name);
+ if(len >= 4 && sscanf(name + len - 4, ".%03d", &suffix) == 1) {
+ new_len = len;
+ } else {
+ suffix = 0;
+ new_len = len + 4;
+ if(new_len > 31)
+ new_len = 31;
+ }
+
+ new_name = malloc(new_len + 1);
+ strcpy(new_name, name);
+ name = new_name;
+ }
+ sprintf(new_name + new_len - 4, ".%03d", ++suffix);
+ }
+
+ if(new_name) {
+ strcpy(tno->name, new_name);
+ free(new_name);
+ }
+}
+
+static void assign_index(struct bNode *node)
+{
+ bNode *tnode;
+ int index = 1;
+
+ tnode = node;
+ while(tnode->prev)
+ tnode = tnode->prev;
+
+ check_index:
+ for(; tnode; tnode= tnode->next)
+ if(tnode->type == TEX_NODE_OUTPUT && tnode != node)
+ if(tnode->custom1 == index) {
+ index ++;
+ goto check_index;
+ }
+
+ node->custom1 = index;
}
+static void init(bNode *node)
+{
+ TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output");
+ node->storage= tno;
+
+ strcpy(tno->name, "Default");
+ unique_name(node);
+ assign_index(node);
+}
+
+static void copy(bNode *orig, bNode *new)
+{
+ node_copy_standard_storage(orig, new);
+ unique_name(new);
+ assign_index(new);
+}
bNodeType tex_node_output= {
/* *next,*prev */ NULL, NULL,
@@ -85,6 +202,6 @@ bNodeType tex_node_output= {
/* butfunc */ NULL,
/* initfunc */ init,
/* freestoragefunc */ node_free_standard_storage,
- /* copystoragefunc */ node_copy_standard_storage,
+ /* copystoragefunc */ copy,
/* id */ NULL
};
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
index ec65cf186a8..ce7324e2085 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -51,7 +51,7 @@ static bNodeSocketType outputs_color_only[]= {
{ SOCK_RGBA, 1, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f }
/* Calls multitex and copies the result to the outputs. Called by xxx_exec, which handles inputs. */
-static void do_proc(float *result, float *coord, float *col1, float *col2, char is_normal, Tex *tex, short thread)
+static void do_proc(float *result, TexParams *p, float *col1, float *col2, char is_normal, Tex *tex, short thread)
{
TexResult texres;
int textype;
@@ -62,7 +62,7 @@ static void do_proc(float *result, float *coord, float *col1, float *col2, char
else
texres.nor = NULL;
- textype = multitex_thread(tex, coord, 0, 0, 0, &texres, thread, 0);
+ textype = multitex_thread(tex, p->coord, p->dxt, p->dyt, 0, &texres, thread, 0);
if(is_normal)
return;
@@ -76,11 +76,11 @@ static void do_proc(float *result, float *coord, float *col1, float *col2, char
}
}
-typedef void (*MapFn) (Tex *tex, bNodeStack **in, float *coord, short thread);
+typedef void (*MapFn) (Tex *tex, bNodeStack **in, TexParams *p, short thread);
static void texfn(
float *result,
- float *coord,
+ TexParams *p,
bNode *node,
bNodeStack **in,
char is_normal,
@@ -89,12 +89,12 @@ static void texfn(
{
Tex tex = *((Tex*)(node->storage));
float col1[4], col2[4];
- tex_input_rgba(col1, in[0], coord, thread);
- tex_input_rgba(col2, in[1], coord, thread);
+ tex_input_rgba(col1, in[0], p, thread);
+ tex_input_rgba(col2, in[1], p, thread);
- map_inputs(&tex, in, coord, thread);
+ map_inputs(&tex, in, p, thread);
- do_proc(result, coord, col1, col2, is_normal, &tex, thread);
+ do_proc(result, p, col1, col2, is_normal, &tex, thread);
}
static int count_outputs(bNode *node)
@@ -110,17 +110,17 @@ static int count_outputs(bNode *node)
/* Boilerplate generators */
#define ProcNoInputs(name) \
- static void name##_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) \
+ static void name##_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) \
{}
#define ProcDef(name) \
- static void name##_colorfn(float *result, float *coord, bNode *node, bNodeStack **in, short thread) \
+ static void name##_colorfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
{ \
- texfn(result, coord, node, in, 0, &name##_map_inputs, thread); \
+ texfn(result, p, node, in, 0, &name##_map_inputs, thread); \
} \
- static void name##_normalfn(float *result, float *coord, bNode *node, bNodeStack **in, short thread) \
+ static void name##_normalfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \
{ \
- texfn(result, coord, node, in, 1, &name##_map_inputs, thread); \
+ texfn(result, p, node, in, 1, &name##_map_inputs, thread); \
} \
static void name##_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) \
{ \
@@ -144,15 +144,15 @@ static bNodeSocketType voronoi_inputs[]= {
{ -1, 0, "" }
};
-static void voronoi_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void voronoi_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->vn_w1 = tex_input_value(in[I+0], coord, thread);
- tex->vn_w2 = tex_input_value(in[I+1], coord, thread);
- tex->vn_w3 = tex_input_value(in[I+2], coord, thread);
- tex->vn_w4 = tex_input_value(in[I+3], coord, thread);
+ tex->vn_w1 = tex_input_value(in[I+0], p, thread);
+ tex->vn_w2 = tex_input_value(in[I+1], p, thread);
+ tex->vn_w3 = tex_input_value(in[I+2], p, thread);
+ tex->vn_w4 = tex_input_value(in[I+3], p, thread);
- tex->ns_outscale = tex_input_value(in[I+4], coord, thread);
- tex->noisesize = tex_input_value(in[I+5], coord, thread);
+ tex->ns_outscale = tex_input_value(in[I+4], p, thread);
+ tex->noisesize = tex_input_value(in[I+5], p, thread);
}
ProcDef(voronoi)
@@ -170,9 +170,9 @@ static bNodeSocketType magic_inputs[]= {
{ SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f },
{ -1, 0, "" }
};
-static void magic_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void magic_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->turbul = tex_input_value(in[I+0], coord, thread);
+ tex->turbul = tex_input_value(in[I+0], p, thread);
}
ProcDef(magic)
@@ -183,10 +183,10 @@ static bNodeSocketType marble_inputs[]= {
{ SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f },
{ -1, 0, "" }
};
-static void marble_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->noisesize = tex_input_value(in[I+0], coord, thread);
- tex->turbul = tex_input_value(in[I+1], coord, thread);
+ tex->noisesize = tex_input_value(in[I+0], p, thread);
+ tex->turbul = tex_input_value(in[I+1], p, thread);
}
ProcDef(marble)
@@ -196,9 +196,9 @@ static bNodeSocketType clouds_inputs[]= {
{ SOCK_VALUE, 1, "Size", 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f },
{ -1, 0, "" }
};
-static void clouds_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void clouds_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->noisesize = tex_input_value(in[I+0], coord, thread);
+ tex->noisesize = tex_input_value(in[I+0], p, thread);
}
ProcDef(clouds)
@@ -209,10 +209,10 @@ static bNodeSocketType distnoise_inputs[]= {
{ SOCK_VALUE, 1, "Distortion", 1.00f, 0.0f, 0.0f, 0.0f, 0.0000f, 10.0f },
{ -1, 0, "" }
};
-static void distnoise_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void distnoise_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->noisesize = tex_input_value(in[I+0], coord, thread);
- tex->dist_amount = tex_input_value(in[I+1], coord, thread);
+ tex->noisesize = tex_input_value(in[I+0], p, thread);
+ tex->dist_amount = tex_input_value(in[I+1], p, thread);
}
ProcDef(distnoise)
@@ -223,10 +223,10 @@ static bNodeSocketType wood_inputs[]= {
{ SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f },
{ -1, 0, "" }
};
-static void wood_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void wood_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->noisesize = tex_input_value(in[I+0], coord, thread);
- tex->turbul = tex_input_value(in[I+1], coord, thread);
+ tex->noisesize = tex_input_value(in[I+0], p, thread);
+ tex->turbul = tex_input_value(in[I+1], p, thread);
}
ProcDef(wood)
@@ -241,13 +241,13 @@ static bNodeSocketType musgrave_inputs[]= {
{ SOCK_VALUE, 1, "Size", 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f },
{ -1, 0, "" }
};
-static void musgrave_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->mg_H = tex_input_value(in[I+0], coord, thread);
- tex->mg_lacunarity = tex_input_value(in[I+1], coord, thread);
- tex->mg_octaves = tex_input_value(in[I+2], coord, thread);
- tex->ns_outscale = tex_input_value(in[I+3], coord, thread);
- tex->noisesize = tex_input_value(in[I+4], coord, thread);
+ tex->mg_H = tex_input_value(in[I+0], p, thread);
+ tex->mg_lacunarity = tex_input_value(in[I+1], p, thread);
+ tex->mg_octaves = tex_input_value(in[I+2], p, thread);
+ tex->ns_outscale = tex_input_value(in[I+3], p, thread);
+ tex->noisesize = tex_input_value(in[I+4], p, thread);
}
ProcDef(musgrave)
@@ -266,10 +266,10 @@ static bNodeSocketType stucci_inputs[]= {
{ SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f },
{ -1, 0, "" }
};
-static void stucci_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread)
+static void stucci_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread)
{
- tex->noisesize = tex_input_value(in[I+0], coord, thread);
- tex->turbul = tex_input_value(in[I+1], coord, thread);
+ tex->noisesize = tex_input_value(in[I+0], p, thread);
+ tex->turbul = tex_input_value(in[I+1], p, thread);
}
ProcDef(stucci)
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
index 3a2c2b1def1..0fd95642be6 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -42,9 +42,10 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float new_coord[3];
+ float *coord = p->coord;
float ax[4];
float para[3];
@@ -53,13 +54,13 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor
float magsq, ndx;
- float a = tex_input_value(in[1], coord, thread);
+ float a = tex_input_value(in[1], p, thread);
float cos_a = cos(a * 2 * M_PI);
float sin_a = sin(a * 2 * M_PI);
// x' = xcosa + n(n.x)(1-cosa)+(x*n)sina
- tex_input_vec(ax, in[2], coord, thread);
+ tex_input_vec(ax, in[2], p, thread);
magsq = ax[0]*ax[0] + ax[1]*ax[1] + ax[2]*ax[2];
if(magsq == 0) magsq = 1;
@@ -86,7 +87,11 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor
new_coord[1] = para[1] + perp[1] + cp[1];
new_coord[2] = para[2] + perp[2] + cp[2];
- tex_input_rgba(out, in[0], new_coord, thread);
+ {
+ TexParams np = *p;
+ np.coord = new_coord;
+ tex_input_rgba(out, in[0], &np, thread);
+ }
}
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c
index 792c3468e9f..3d4415365aa 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -40,17 +40,19 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float scale[3], new_coord[3];
+ TexParams np = *p;
+ np.coord = new_coord;
- tex_input_vec(scale, in[1], coord, thread);
+ tex_input_vec(scale, in[1], p, thread);
- new_coord[0] = coord[0] * scale[0];
- new_coord[1] = coord[1] * scale[1];
- new_coord[2] = coord[2] * scale[2];
+ new_coord[0] = p->coord[0] * scale[0];
+ new_coord[1] = p->coord[1] * scale[1];
+ new_coord[2] = p->coord[2] * scale[2];
- tex_input_rgba(out, in[0], new_coord, thread);
+ tex_input_rgba(out, in[0], &np, thread);
}
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
index 30492b84764..0ca80a82271 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -40,10 +40,11 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
static float red[] = {1,0,0,1};
static float white[] = {1,1,1,1};
+ float *coord = p->coord;
Tex *nodetex = (Tex *)node->id;
@@ -60,8 +61,8 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor
float nor[] = {0,0,0};
float col1[4], col2[4];
- tex_input_rgba(col1, in[0], coord, thread);
- tex_input_rgba(col2, in[1], coord, thread);
+ tex_input_rgba(col1, in[0], p, thread);
+ tex_input_rgba(col2, in[1], p, thread);
texres.nor = nor;
textype = multitex_ext(nodetex, coord, 0, 0, 0, &texres);
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c
index cadd27612f4..ba3dcfa27a2 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -40,17 +40,19 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float offset[3], new_coord[3];
+ TexParams np = *p;
+ np.coord = new_coord;
- tex_input_vec(offset, in[1], coord, thread);
+ tex_input_vec(offset, in[1], p, thread);
- new_coord[0] = coord[0] + offset[0];
- new_coord[1] = coord[1] + offset[1];
- new_coord[2] = coord[2] + offset[2];
+ new_coord[0] = p->coord[0] + offset[0];
+ new_coord[1] = p->coord[1] + offset[1];
+ new_coord[2] = p->coord[2] + offset[2];
- tex_input_rgba(out, in[0], new_coord, thread);
+ tex_input_rgba(out, in[0], &np, thread);
}
static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
index 0d24652a8f6..75b88c3a460 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
@@ -39,28 +39,32 @@ static bNodeSocketType outputs[]= {
{ -1, 0, "" }
};
-static void normalfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void normalfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float new_coord[3];
+ float *coord = p->coord;
- float nabla = tex_input_value(in[1], coord, thread);
+ float nabla = tex_input_value(in[1], p, thread);
float val;
float nor[3];
+
+ TexParams np = *p;
+ np.coord = new_coord;
- val = tex_input_value(in[0], coord, thread);
+ val = tex_input_value(in[0], p, thread);
new_coord[0] = coord[0] + nabla;
new_coord[1] = coord[1];
new_coord[2] = coord[2];
- nor[0] = tex_input_value(in[0], new_coord, thread);
+ nor[0] = tex_input_value(in[0], &np, thread);
new_coord[0] = coord[0];
new_coord[1] = coord[1] + nabla;
- nor[1] = tex_input_value(in[0], new_coord, thread);
+ nor[1] = tex_input_value(in[0], &np, thread);
new_coord[1] = coord[1];
new_coord[2] = coord[2] + nabla;
- nor[2] = tex_input_value(in[0], new_coord, thread);
+ nor[2] = tex_input_value(in[0], &np, thread);
out[0] = val-nor[0];
out[1] = val-nor[1];
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
index 71d9cb07e18..90a444bcff0 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
@@ -22,7 +22,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -39,10 +39,10 @@ static bNodeSocketType valtorgb_out[]= {
{ -1, 0, "" }
};
-static void valtorgb_colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void valtorgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
if(node->storage) {
- float fac = tex_input_value(in[0], coord, thread);
+ float fac = tex_input_value(in[0], p, thread);
do_colorband(node->storage, fac, out);
}
@@ -87,10 +87,10 @@ static bNodeSocketType rgbtobw_out[]= {
};
-static void rgbtobw_valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+static void rgbtobw_valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
{
float cin[4];
- tex_input_rgba(cin, in[0], coord, thread);
+ tex_input_rgba(cin, in[0], p, thread);
*out = cin[0] * 0.35f + cin[1] * 0.45f + cin[2] * 0.2f;
}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
index acdaacf873c..2d29b03b38c 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c
@@ -21,7 +21,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Robin Allen
*
* ***** END GPL LICENSE BLOCK *****
*/
diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c
index 867e754f960..2c21627dad9 100644
--- a/source/blender/nodes/intern/TEX_util.c
+++ b/source/blender/nodes/intern/TEX_util.c
@@ -47,17 +47,19 @@
#define PREV_RES 128 /* default preview resolution */
-void tex_call_delegate(TexDelegate *dg, float *out, float *coord, short thread)
+int preview_flag = 0;
+
+void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, short thread)
{
if(dg->node->need_exec)
- dg->fn(out, coord, dg->node, dg->in, thread);
+ dg->fn(out, params, dg->node, dg->in, thread);
}
-void tex_input(float *out, int sz, bNodeStack *in, float *coord, short thread)
+void tex_input(float *out, int sz, bNodeStack *in, TexParams *params, short thread)
{
TexDelegate *dg = in->data;
if(dg) {
- tex_call_delegate(dg, in->vec, coord, thread);
+ tex_call_delegate(dg, in->vec, params, thread);
if(in->hasoutput && in->sockettype == SOCK_VALUE)
in->vec[1] = in->vec[2] = in->vec[0];
@@ -65,14 +67,14 @@ void tex_input(float *out, int sz, bNodeStack *in, float *coord, short thread)
memcpy(out, in->vec, sz * sizeof(float));
}
-void tex_input_vec(float *out, bNodeStack *in, float *coord, short thread)
+void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread)
{
- tex_input(out, 3, in, coord, thread);
+ tex_input(out, 3, in, params, thread);
}
-void tex_input_rgba(float *out, bNodeStack *in, float *coord, short thread)
+void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread)
{
- tex_input(out, 4, in, coord, thread);
+ tex_input(out, 4, in, params, thread);
if(in->hasoutput && in->sockettype == SOCK_VALUE)
{
@@ -88,10 +90,10 @@ void tex_input_rgba(float *out, bNodeStack *in, float *coord, short thread)
}
}
-float tex_input_value(bNodeStack *in, float *coord, short thread)
+float tex_input_value(bNodeStack *in, TexParams *params, short thread)
{
float out[4];
- tex_input_vec(out, in, coord, thread);
+ tex_input_vec(out, in, params, thread);
return out[0];
}
@@ -108,12 +110,6 @@ static void init_preview(bNode *node)
if(node->preview==NULL)
node->preview= MEM_callocN(sizeof(bNodePreview), "node preview");
- if(node->preview->rect)
- if(node->preview->xsize!=xsize && node->preview->ysize!=ysize) {
- MEM_freeN(node->preview->rect);
- node->preview->rect= NULL;
- }
-
if(node->preview->rect==NULL) {
node->preview->rect= MEM_callocN(4*xsize + xsize*ysize*sizeof(float)*4, "node preview rect");
node->preview->xsize= xsize;
@@ -121,11 +117,23 @@ static void init_preview(bNode *node)
}
}
+void params_from_cdata(TexParams *out, TexCallData *in)
+{
+ out->coord = in->coord;
+ out->dxt = in->dxt;
+ out->dyt = in->dyt;
+ out->cfra = in->cfra;
+}
+
void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata)
{
int x, y;
float *result;
bNodePreview *preview;
+ float coord[3] = {0, 0, 0};
+ TexParams params;
+ int resolution;
+ int xsize, ysize;
if(!cdata->do_preview)
return;
@@ -136,16 +144,25 @@ void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata)
init_preview(node);
preview = node->preview;
+ xsize = preview->xsize;
+ ysize = preview->ysize;
- for(x=0; x<preview->xsize; x++)
- for(y=0; y<preview->ysize; y++)
+ params.dxt = 0;
+ params.dyt = 0;
+ params.cfra = cdata->cfra;
+ params.coord = coord;
+
+ resolution = (xsize < ysize) ? xsize : ysize;
+
+ for(x=0; x<xsize; x++)
+ for(y=0; y<ysize; y++)
{
- cdata->coord[0] = ((float) x / preview->xsize) * 2 - 1;
- cdata->coord[1] = ((float) y / preview->ysize) * 2 - 1;
+ params.coord[0] = ((float) x / resolution) * 2 - 1;
+ params.coord[1] = ((float) y / resolution) * 2 - 1;
- result = preview->rect + 4 * (preview->xsize*y + x);
+ result = preview->rect + 4 * (xsize*y + x);
- tex_input_rgba(result, ns, cdata->coord, cdata->thread);
+ tex_input_rgba(result, ns, &params, cdata->thread);
}
}
@@ -192,38 +209,41 @@ void ntreeTexCheckCyclics(struct bNodeTree *ntree)
}
}
-void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, Tex *tex, short which_output, int cfra)
-{
+void ntreeTexExecTree(
+ bNodeTree *nodes,
+ TexResult *texres,
+ float *coord,
+ float *dxt, float *dyt,
+ short thread,
+ Tex *tex,
+ short which_output,
+ int cfra
+){
TexResult dummy_texres;
TexCallData data;
+ /* 0 means don't care, so just use first */
+ if(which_output == 0)
+ which_output = 1;
+
if(!texres) texres = &dummy_texres;
data.coord = coord;
+ data.dxt = dxt;
+ data.dyt = dyt;
data.target = texres;
- data.do_preview = do_preview;
+ data.do_preview = preview_flag;
data.thread = thread;
data.which_output = which_output;
data.cfra= cfra;
+ preview_flag = 0;
+
ntreeExecTree(nodes, &data, thread);
}
-void ntreeTexUpdatePreviews(bNodeTree* nodetree)
+void ntreeTexSetPreviewFlag(int doit)
{
- Tex *tex;
- float coord[] = {0,0,0};
- TexResult dummy_texres;
-
- for(tex= G.main->tex.first; tex; tex= tex->id.next)
- if(tex->nodetree == nodetree) break;
- if(!tex) return;
-
- dummy_texres.nor = 0;
-
- ntreeBeginExecTree(nodetree);
- ntreeTexExecTree(nodetree, &dummy_texres, coord, 1, 0, tex, 0, 0);
- ntreeEndExecTree(nodetree);
-
+ preview_flag = doit;
}
char* ntreeTexOutputMenu(bNodeTree *ntree)
@@ -267,19 +287,3 @@ char* ntreeTexOutputMenu(bNodeTree *ntree)
return str;
}
-void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node)
-{
- bNode *tnode;
- int index = 0;
-
- check_index:
- for(tnode= ntree->nodes.first; tnode; tnode= tnode->next)
- if(tnode->type == TEX_NODE_OUTPUT && tnode != node)
- if(tnode->custom1 == index) {
- index ++;
- goto check_index;
- }
-
- node->custom1 = index;
-}
-
diff --git a/source/blender/nodes/intern/TEX_util.h b/source/blender/nodes/intern/TEX_util.h
index e560aa57921..87a9cf288d6 100644
--- a/source/blender/nodes/intern/TEX_util.h
+++ b/source/blender/nodes/intern/TEX_util.h
@@ -71,13 +71,20 @@
typedef struct TexCallData {
TexResult *target;
float *coord;
+ float *dxt, *dyt;
char do_preview;
short thread;
short which_output;
int cfra;
} TexCallData;
-typedef void(*TexFn) (float *out, float *coord, bNode *node, bNodeStack **in, short thread);
+typedef struct TexParams {
+ float *coord;
+ float *dxt, *dyt;
+ int cfra;
+} TexParams;
+
+typedef void(*TexFn) (float *out, TexParams *params, bNode *node, bNodeStack **in, short thread);
typedef struct TexDelegate {
TexFn fn;
@@ -86,16 +93,17 @@ typedef struct TexDelegate {
int type;
} TexDelegate;
-void tex_call_delegate(TexDelegate*, float *out, float *coord, short thread);
+void tex_call_delegate(TexDelegate*, float *out, TexParams *params, short thread);
-void tex_input_rgba(float *out, bNodeStack *in, float *coord, short thread);
-void tex_input_vec(float *out, bNodeStack *in, float *coord, short thread);
-float tex_input_value(bNodeStack *in, float *coord, short thread);
+void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread);
+void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread);
+float tex_input_value(bNodeStack *in, TexParams *params, short thread);
void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn);
void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata);
-void ntreeTexUpdatePreviews( bNodeTree* nodetree );
-void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, struct Tex *tex, short which_output, int cfra);
-
+void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra);
+
+void params_from_cdata(TexParams *out, TexCallData *in);
+
#endif
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index db0404c33a8..acb45790ed2 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -122,7 +122,7 @@ extern "C" {
void BPY_pydriver_update(void);
float BPY_pydriver_eval(struct ChannelDriver *driver);
- int BPY_button_eval(char *expr, double *value);
+ int BPY_button_eval(struct bContext *C, char *expr, double *value);
/* format importer hook */
int BPY_call_importloader( char *name );
diff --git a/source/blender/python/epy_doc_gen.py b/source/blender/python/epy_doc_gen.py
index 8630a0c8f8e..c2ef6bbc0d0 100644
--- a/source/blender/python/epy_doc_gen.py
+++ b/source/blender/python/epy_doc_gen.py
@@ -37,6 +37,94 @@ Generate html docs by running...
# if you dont have graphvis installed ommit the --graph arg.
+# GLOBALS['BASEDIR'] = './source/blender/python/doc'
+
+import os
+
+SUBMODULES = {}
+INIT_SUBMODULES = {} # store initialized files
+
+INIT_SUBMODULES_IMPORTS = {} # dont import the same module twice
+
+def append_package(package_path, mod_name):
+
+ init_path = os.path.join(os.path.dirname(package_path), "__init__.py")
+
+ # avoid double ups
+ if mod_name:
+ imports = INIT_SUBMODULES_IMPORTS.setdefault(init_path, [])
+ if mod_name in imports:
+ return
+ imports.append(mod_name)
+
+ try:
+ os.makedirs(os.path.dirname(init_path)) # make the dirs if they are not there
+ except:
+ pass
+
+ # Open the new file for the first time, otherwise keep it open.
+ f = INIT_SUBMODULES.get(init_path)
+ if f == None:
+ f = INIT_SUBMODULES[init_path] = open(init_path, 'w')
+
+ if mod_name:
+ f.write("import %s\n" % mod_name)
+
+ return f
+
+def append_package_recursive(package_path, BASEPATH):
+ '''
+ assume the last item of package_path will be a file (not a dir thats created)
+ '''
+
+ package_path = os.path.splitext(package_path)[0] # incase of .py
+
+ try:
+ os.makedirs(os.path.join(BASEPATH, os.path.dirname(package_path))) # make the dirs if they are not there
+ except:
+ pass
+
+ new_path = BASEPATH
+
+ for mod_name in package_path.split(os.sep):
+ init_path = os.path.join(new_path, "__init__.py")
+ new_path = os.path.join(new_path, mod_name)
+ append_package(init_path, mod_name)
+
+
+def open_submodule(subpath, BASEPATH):
+ '''
+ This is a utility function that lets us quickly add submodules
+ '''
+
+ # create all the package paths leading up to this module
+ append_package_recursive(subpath, BASEPATH)
+
+ module_name = os.path.basename( os.path.splitext(subpath)[0] )
+ mod_path = os.path.join(BASEPATH, subpath)
+
+ # Open the new file for the first time, otherwise keep it open.
+ f = SUBMODULES.get(mod_path)
+ if f == None:
+ f = SUBMODULES[mod_path] = open(mod_path, 'w')
+
+ f = open(mod_path, 'w')
+ return f
+
+def close_all():
+ for files in (INIT_SUBMODULES.values(), SUBMODULES.values()):
+ for f in files:
+ if f.name.endswith('.py'):
+ f_name = f.name
+ f.close()
+
+ f = open(f_name, 'a')
+ f.write("\ndel __package__\n") # annoying, no need do show this
+
+
+ f.close()
+
+
def range_str(val):
if val < -10000000: return '-inf'
if val > 10000000: return 'inf'
@@ -59,6 +147,19 @@ def full_rna_struct_path(rna_struct):
else:
return rna_struct.identifier
+def rna_id_ignore(rna_id):
+ if rna_id == "rna_type":
+ return True
+
+ if "_OT_" in rna_id:
+ return True
+ if "_MT_" in rna_id:
+ return True
+ if "_PT_" in rna_id:
+ return True
+
+ return False
+
def write_func(rna, ident, out, func_type):
# Keyword attributes
kw_args = [] # "foo = 1", "bar=0.5", "spam='ENUM'"
@@ -68,7 +169,7 @@ def write_func(rna, ident, out, func_type):
# Operators and functions work differently
if func_type=='OPERATOR':
- rna_func_name = rna_struct.identifier
+ rna_func_name = rna_struct.identifier.split("_OT_")[-1]
rna_func_desc = rna_struct.description.strip()
items = rna_struct.properties.items()
else:
@@ -76,8 +177,9 @@ def write_func(rna, ident, out, func_type):
rna_func_desc = rna.description.strip()
items = rna.parameters.items()
+
for rna_prop_identifier, rna_prop in items:
- if rna_prop_identifier=='rna_type':
+ if rna_id_ignore(rna_prop_identifier):
continue
# clear vars
@@ -88,13 +190,25 @@ def write_func(rna, ident, out, func_type):
rna_prop_type = rna_prop.type.lower() # enum, float, int, boolean
+ # only for rna functions, operators should not get pointers as args
+ if rna_prop_type=='pointer':
+ rna_prop_type_refine = "L{%s}" % rna_prop.fixed_type.identifier
+ else:
+ rna_prop_type_refine = rna_prop_type
+
+
try: length = rna_prop.array_length
except: length = 0
array_str = get_array_str(length)
- kw_type_str= "@type %s: %s%s" % (rna_prop_identifier, rna_prop_type, array_str)
- kw_param_str= "@param %s: %s" % (rna_prop_identifier, rna_prop.description.strip())
+ if rna_prop.use_return:
+ kw_type_str= "@rtype: %s%s" % (rna_prop_type_refine, array_str)
+ kw_param_str= "@return: %s" % (rna_prop.description.strip())
+ else:
+ kw_type_str= "@type %s: %s%s" % (rna_prop_identifier, rna_prop_type_refine, array_str)
+ kw_param_str= "@param %s: %s" % (rna_prop_identifier, rna_prop.description.strip())
+
kw_param_set = False
if func_type=='OPERATOR':
@@ -159,8 +273,11 @@ def write_func(rna, ident, out, func_type):
# stora
else:
# currently functions dont have a default value
- kw_args.append('%s' % (rna_prop_identifier))
-
+ if not rna_prop.use_return:
+ kw_args.append('%s' % (rna_prop_identifier))
+ else:
+ kw_param_set = True
+
# Same for operators and functions
kw_arg_attrs.append(kw_type_str)
@@ -174,15 +291,17 @@ def write_func(rna, ident, out, func_type):
out.write(ident+'\t%s\n' % rna_func_desc)
for desc in kw_arg_attrs:
out.write(ident+'\t%s\n' % desc)
- out.write(ident+'\t@rtype: None\n')
+
+ # out.write(ident+'\t@rtype: None\n') # implicit
out.write(ident+'\t"""\n')
-def rna2epy(target_path):
+def rna2epy(BASEPATH):
# Use for faster lookups
# use rna_struct.identifier as the key for each dict
+ rna_struct_dict = {} # store identifier:rna lookups
rna_full_path_dict = {} # store the result of full_rna_struct_path(rna_struct)
rna_children_dict = {} # store all rna_structs nested from here
rna_references_dict = {} # store a list of rna path strings that reference this type
@@ -199,8 +318,12 @@ def rna2epy(target_path):
if rna_base:
out.write(ident+ 'class %s(%s):\n' % (identifier, rna_base.identifier))
+ rna_base_prop_keys = rna_base.properties.keys() # could be cached
+ rna_base_func_keys = [f.identifier for f in rna_base.functions]
else:
out.write(ident+ 'class %s:\n' % identifier)
+ rna_base_prop_keys = []
+ rna_base_func_keys = []
out.write(ident+ '\t"""\n')
@@ -232,11 +355,9 @@ def rna2epy(target_path):
for rna_prop_identifier, rna_prop in rna_struct.properties.items():
- if rna_prop_identifier=='RNA':
- continue
-
- if rna_prop_identifier=='rna_type':
- continue
+ if rna_prop_identifier=='RNA': continue
+ if rna_id_ignore(rna_prop_identifier): continue
+ if rna_prop_identifier in rna_base_prop_keys: continue # does this prop exist in our parent class, if so skip
rna_desc = rna_prop.description.strip()
@@ -269,7 +390,8 @@ def rna2epy(target_path):
out.write(ident+ '\t@ivar %s: %s in (%s)\n' % (rna_prop_identifier, rna_desc, ', '.join(rna_prop.items.keys())))
else:
out.write(ident+ '\t@ivar %s: %s in...\n' % (rna_prop_identifier, rna_desc))
- for e in rna_prop.items.keys():
+ for e, e_rna_prop in rna_prop.items.items():
+ #out.write(ident+ '\t\t- %s: %s\n' % (e, e_rna_prop.description)) # XXX - segfaults, FIXME
out.write(ident+ '\t\t- %s\n' % e)
out.write(ident+ '\t@type %s: %s%s%s\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str))
@@ -290,7 +412,8 @@ def rna2epy(target_path):
# Write functions
# for rna_func in rna_struct.functions: # Better ignore inherited (line below)
for rna_func in rna_functions_dict[identifier]:
- write_func(rna_func, ident+'\t', out, 'FUNCTION')
+ if rna_func not in rna_base_func_keys:
+ write_func(rna_func, ident+'\t', out, 'FUNCTION')
out.write('\n')
@@ -298,7 +421,10 @@ def rna2epy(target_path):
for child in rna_children_dict[identifier]:
write_struct(child, ident + '\t')
- out = open(target_path, 'w')
+
+
+ # out = open(target_path, 'w')
+ out = open_submodule("types.py", BASEPATH) # bpy.types
def base_id(rna_struct):
try: return rna_struct.base.identifier
@@ -313,24 +439,31 @@ def rna2epy(target_path):
structs = []
for rna_type_name in dir(bpy.types):
rna_type = getattr(bpy.types, rna_type_name)
- if hasattr(rna_type, '__rna__'):
+
+ try: rna_struct = rna_type.__rna__
+ except: rna_struct = None
+
+ if rna_struct:
#if not rna_type_name.startswith('__'):
- rna_struct = rna_type.__rna__
- identifier = rna_struct.identifier
- structs.append( (base_id(rna_struct), identifier, rna_struct) )
-
-
-
- # Store full rna path 'GameObjectSettings' -> 'Object.GameObjectSettings'
- rna_full_path_dict[identifier] = full_rna_struct_path(rna_struct)
-
- # Store a list of functions, remove inherited later
- rna_functions_dict[identifier]= list(rna_struct.functions)
+ identifier = rna_struct.identifier
- # fill in these later
- rna_children_dict[identifier]= []
- rna_references_dict[identifier]= []
+ if not rna_id_ignore(identifier):
+ structs.append( (base_id(rna_struct), identifier, rna_struct) )
+
+ # Simple lookup
+ rna_struct_dict[identifier] = rna_struct
+
+ # Store full rna path 'GameObjectSettings' -> 'Object.GameObjectSettings'
+ rna_full_path_dict[identifier] = full_rna_struct_path(rna_struct)
+
+ # Store a list of functions, remove inherited later
+ rna_functions_dict[identifier]= list(rna_struct.functions)
+
+
+ # fill in these later
+ rna_children_dict[identifier]= []
+ rna_references_dict[identifier]= []
else:
@@ -377,16 +510,21 @@ def rna2epy(target_path):
# precalc vars to avoid a lot of looping
for (rna_base, identifier, rna_struct) in structs:
+ if rna_base:
+ rna_base_prop_keys = rna_struct_dict[rna_base].properties.keys() # could cache
+ rna_base_func_keys = [f.identifier for f in rna_struct_dict[rna_base].functions]
+ else:
+ rna_base_prop_keys = []
+ rna_base_func_keys= []
# rna_struct_path = full_rna_struct_path(rna_struct)
rna_struct_path = rna_full_path_dict[identifier]
for rna_prop_identifier, rna_prop in rna_struct.properties.items():
- if rna_prop_identifier=='RNA':
- continue
- if rna_prop_identifier=='rna_type':
- continue
+ if rna_prop_identifier=='RNA': continue
+ if rna_id_ignore(rna_prop_identifier): continue
+ if rna_prop_identifier in rna_base_prop_keys: continue
try: rna_prop_ptr = rna_prop.fixed_type
except: rna_prop_ptr = None
@@ -395,7 +533,21 @@ def rna2epy(target_path):
if rna_prop_ptr:
rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_prop_identifier) )
-
+ for rna_func in rna_struct.functions:
+ for rna_prop_identifier, rna_prop in rna_func.parameters.items():
+
+ if rna_prop_identifier=='RNA': continue
+ if rna_id_ignore(rna_prop_identifier): continue
+ if rna_prop_identifier in rna_base_func_keys: continue
+
+
+ try: rna_prop_ptr = rna_prop.fixed_type
+ except: rna_prop_ptr = None
+
+ # Does this property point to me?
+ if rna_prop_ptr:
+ rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_func.identifier) )
+
# Store nested children
nested = rna_struct.nested
@@ -430,6 +582,7 @@ def rna2epy(target_path):
# # We could also just run....
# os.system('epydoc source/blender/python/doc/rna.py -o ./source/blender/python/doc/html -v')
+ target_path = os.path.join(BASEPATH, "dump.py") # XXX - used for other funcs
# Write graphviz
out= open(target_path.replace('.py', '.dot'), 'w')
@@ -500,8 +653,8 @@ def rna2epy(target_path):
out.write('%s\n' % w)
-def op2epy(target_path):
- out = open(target_path, 'w')
+def op2epy(BASEPATH):
+ # out = open(target_path, 'w')
op_mods = dir(bpy.ops)
op_mods.remove('add')
@@ -510,26 +663,73 @@ def op2epy(target_path):
for op_mod_name in sorted(op_mods):
if op_mod_name.startswith('__'):
continue
+
+ # open the submodule
+ mod_path = os.path.join("ops", op_mod_name + ".py")
+ out = open_submodule(mod_path, BASEPATH)
+
op_mod = getattr(bpy.ops, op_mod_name)
-
operators = dir(op_mod)
for op in sorted(operators):
# rna = getattr(bpy.types, op).__rna__
rna = getattr(op_mod, op).get_rna()
write_func(rna, '', out, 'OPERATOR')
+
+ out.write('\n')
+ out.close()
+
+def misc2epy(BASEPATH):
+ '''
+ Hard coded modules, try to avoid adding stuff here
+ '''
- out.write('\n')
- out.close()
+ f = append_package(os.path.join(BASEPATH, ""), ""); # add a slash on the end of the base path
+ f.write('''
+"""
+@type data: L{bpy.types.Main}
+@var data: blender data is accessed from here
+"""
+''')
+
+ f = open_submodule("props.py", BASEPATH)
+ f.write('''
+MAX_INT= 2**31
+MAX_FLOAT= 1e+37
+def BoolProperty(attr, name="", description="", default=False):
+ """
+ return a new bool property
+ """
+def IntProperty(attr, name="", description="", min=-MAX_INT, max=MAX_INT, soft_min=-MAX_INT, soft_max=MAX_INT, default=0):
+ """
+ return a new int property
+ """
+def FloatProperty(attr, name="", description="", min=-MAX_FLOAT, max=MAX_FLOAT, soft_min=-MAX_FLOAT, soft_max=MAX_FLOAT, default=0.0):
+ """
+ return a new float property
+ """
+def StringProperty(attr, name="", description="", maxlen=0, default=""):
+ """
+ return a new string property
+ """
+def EnumProperty(attr, items, name="", description="", default=""):
+ """
+ return a new enum property
+ """
+''')
+
if __name__ == '__main__':
if 'bpy' not in dir():
print("\nError, this script must run from inside blender2.5")
print(script_help_msg)
-
else:
- rna2epy('source/blender/python/doc/rna.py')
- op2epy('source/blender/python/doc/bpyoperator.py')
+ misc2epy('source/blender/python/doc/bpy') # first to write in info in some of the modules.
+ rna2epy('source/blender/python/doc/bpy')
+ op2epy('source/blender/python/doc/bpy')
+
+
+ close_all()
import sys
sys.exit()
diff --git a/source/blender/python/generic/BGL.c b/source/blender/python/generic/BGL.c
index de82781cf3a..767af8e0836 100644
--- a/source/blender/python/generic/BGL.c
+++ b/source/blender/python/generic/BGL.c
@@ -67,7 +67,7 @@ static int Buffer_ass_slice( PyObject * self, int begin, int end,
PyObject * seq );
static PySequenceMethods Buffer_SeqMethods = {
- ( inquiry ) Buffer_len, /*sq_length */
+ ( lenfunc ) Buffer_len, /*sq_length */
( binaryfunc ) 0, /*sq_concat */
( ssizeargfunc ) 0, /*sq_repeat */
( ssizeargfunc ) Buffer_item, /*sq_item */
@@ -83,13 +83,7 @@ static PyObject *Buffer_getattr( PyObject * self, char *name );
static PyObject *Buffer_repr( PyObject * self );
PyTypeObject buffer_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"buffer", /*tp_name */
sizeof( Buffer ), /*tp_basicsize */
0, /*tp_itemsize */
@@ -1090,7 +1084,6 @@ static struct PyMethodDef BGL_methods[] = {
{NULL, NULL, 0, NULL}
};
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef BGL_module_def = {
PyModuleDef_HEAD_INIT,
"BGL", /* m_name */
@@ -1102,17 +1095,13 @@ static struct PyModuleDef BGL_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
-PyObject *BGL_Init(const char *from)
+
+PyObject *BGL_Init(void)
{
PyObject *mod, *dict, *item;
-#if (PY_VERSION_HEX >= 0x03000000)
mod = PyModule_Create(&BGL_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), BGL_module_def.m_name, mod);
-#else
- mod= Py_InitModule(from, BGL_methods);
-#endif
dict= PyModule_GetDict(mod);
if( PyType_Ready( &buffer_Type) < 0)
diff --git a/source/blender/python/generic/BGL.h b/source/blender/python/generic/BGL.h
index 938c916bcea..91f88549faf 100644
--- a/source/blender/python/generic/BGL.h
+++ b/source/blender/python/generic/BGL.h
@@ -42,9 +42,8 @@
#include <Python.h>
#include <GL/glew.h>
-#include "../intern/bpy_compat.h"
-PyObject *BGL_Init( const char *from );
+PyObject *BGL_Init(void);
/*@ Buffer Object */
/*@ For Python access to OpenGL functions requiring a pointer. */
@@ -305,31 +304,30 @@ typedef struct _Buffer {
#define ret_def_void
#define ret_set_void
-/* would use Py_RETURN_NONE - except for py 2.3 doesnt have it */
-#define ret_ret_void { Py_INCREF(Py_None); return Py_None; }
+#define ret_ret_void return Py_INCREF(Py_None), Py_None
#define ret_def_GLint int ret_int
#define ret_set_GLint ret_int=
-#define ret_ret_GLint return PyLong_FromLong(ret_int);
+#define ret_ret_GLint return PyLong_FromLong(ret_int)
#define ret_def_GLuint unsigned int ret_uint
#define ret_set_GLuint ret_uint=
-#define ret_ret_GLuint return PyLong_FromLong((long) ret_uint);
+#define ret_ret_GLuint return PyLong_FromLong((long) ret_uint)
#define ret_def_GLenum unsigned int ret_uint
#define ret_set_GLenum ret_uint=
-#define ret_ret_GLenum return PyLong_FromLong((long) ret_uint);
+#define ret_ret_GLenum return PyLong_FromLong((long) ret_uint)
#define ret_def_GLboolean unsigned char ret_bool
#define ret_set_GLboolean ret_bool=
-#define ret_ret_GLboolean return PyLong_FromLong((long) ret_bool);
+#define ret_ret_GLboolean return PyLong_FromLong((long) ret_bool)
#define ret_def_GLstring const unsigned char *ret_str;
#define ret_set_GLstring ret_str=
#define ret_ret_GLstring \
if (ret_str) {\
- return PyUnicode_FromString(ret_str);\
+ return PyUnicode_FromString((const char *)ret_str);\
} else {\
PyErr_SetString(PyExc_AttributeError, "could not get opengl string");\
return NULL;\
diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c
index b4a34d30051..70295d1c2d9 100644
--- a/source/blender/python/generic/Geometry.c
+++ b/source/blender/python/generic/Geometry.c
@@ -78,7 +78,6 @@ struct PyMethodDef M_Geometry_methods[] = {
{NULL, NULL, 0, NULL}
};
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef M_Geometry_module_def = {
PyModuleDef_HEAD_INIT,
"Geometry", /* m_name */
@@ -90,19 +89,14 @@ static struct PyModuleDef M_Geometry_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
/*----------------------------MODULE INIT-------------------------*/
-PyObject *Geometry_Init(const char *from)
+PyObject *Geometry_Init(void)
{
PyObject *submodule;
-#if (PY_VERSION_HEX >= 0x03000000)
submodule = PyModule_Create(&M_Geometry_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), M_Geometry_module_def.m_name, submodule);
-#else
- submodule = Py_InitModule3(from, M_Geometry_methods, M_Geometry_doc);
-#endif
return (submodule);
}
diff --git a/source/blender/python/generic/Geometry.h b/source/blender/python/generic/Geometry.h
index ebfb054c54a..0e46c0d18db 100644
--- a/source/blender/python/generic/Geometry.h
+++ b/source/blender/python/generic/Geometry.h
@@ -34,6 +34,6 @@
#include <Python.h>
#include "Mathutils.h"
-PyObject *Geometry_Init( const char *from );
+PyObject *Geometry_Init(void);
#endif /* EXPP_Geometry_H */
diff --git a/source/blender/python/generic/Makefile b/source/blender/python/generic/Makefile
index 0dbfbd1d102..dc674478dab 100644
--- a/source/blender/python/generic/Makefile
+++ b/source/blender/python/generic/Makefile
@@ -43,7 +43,7 @@ CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
# PreProcessor stuff
CPPFLAGS += -I$(NAN_GHOST)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS)
+CPPFLAGS += $(NAN_SDLCFLAGS)
# modules
CPPFLAGS += -I../../editors/include
diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c
index 53077659655..f53fd66ba99 100644
--- a/source/blender/python/generic/Mathutils.c
+++ b/source/blender/python/generic/Mathutils.c
@@ -94,7 +94,6 @@ struct PyMethodDef M_Mathutils_methods[] = {
/*----------------------------MODULE INIT-------------------------*/
/* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef M_Mathutils_module_def = {
PyModuleDef_HEAD_INIT,
"Mathutils", /* m_name */
@@ -106,21 +105,13 @@ static struct PyModuleDef M_Mathutils_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
-PyObject *Mathutils_Init(const char *from)
+PyObject *Mathutils_Init(void)
{
PyObject *submodule;
//seed the generator for the rand function
BLI_srand((unsigned int) (PIL_check_seconds_timer() * 0x7FFFFFFF));
-
-#if (PY_VERSION_HEX < 0x03000000)
- vector_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
- matrix_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
- euler_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
- quaternion_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES;
-#endif
if( PyType_Ready( &vector_Type ) < 0 )
return NULL;
@@ -131,12 +122,8 @@ PyObject *Mathutils_Init(const char *from)
if( PyType_Ready( &quaternion_Type ) < 0 )
return NULL;
-#if (PY_VERSION_HEX >= 0x03000000)
submodule = PyModule_Create(&M_Mathutils_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), M_Mathutils_module_def.m_name, submodule);
-#else
- submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc);
-#endif
/* each type has its own new() function */
PyModule_AddObject( submodule, "Vector", (PyObject *)&vector_Type );
diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h
index 5bdd9d9cfe0..ad67d2e511e 100644
--- a/source/blender/python/generic/Mathutils.h
+++ b/source/blender/python/generic/Mathutils.h
@@ -32,7 +32,6 @@
#define EXPP_Mathutils_H
#include <Python.h>
-#include "../intern/bpy_compat.h"
#include "vector.h"
#include "matrix.h"
#include "quat.h"
@@ -55,10 +54,7 @@ PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * );
PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void * );
void BaseMathObject_dealloc(BaseMathObject * self);
-
-
-
-PyObject *Mathutils_Init( const char * from );
+PyObject *Mathutils_Init(void);
PyObject *quat_rotation(PyObject *arg1, PyObject *arg2);
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 733576146b7..05c846b16f5 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -111,8 +111,8 @@ PyObject *bpy_text_import( char *name, int *found )
PyObject *bpy_text_reimport( PyObject *module, int *found )
{
Text *text;
- char *txtname;
- char *name;
+ const char *txtname;
+ const char *name;
char *buf = NULL;
//XXX Main *maggie= bpy_import_main ? bpy_import_main:G.main;
Main *maggie= bpy_import_main;
@@ -166,7 +166,7 @@ PyObject *bpy_text_reimport( PyObject *module, int *found )
}
/* make into a module */
- return PyImport_ExecCodeModule( name, text->compiled );
+ return PyImport_ExecCodeModule( (char *)name, text->compiled );
}
@@ -179,20 +179,12 @@ static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * k
PyObject *newmodule;
//PyObject_Print(args, stderr, 0);
-#if (PY_VERSION_HEX >= 0x02060000)
int dummy_val; /* what does this do?*/
static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0};
if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOOi:bpy_import_meth", kwlist,
&name, &globals, &locals, &fromlist, &dummy_val) )
return NULL;
-#else
- static char *kwlist[] = {"name", "globals", "locals", "fromlist", 0};
-
- if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOO:bpy_import_meth", kwlist,
- &name, &globals, &locals, &fromlist ) )
- return NULL;
-#endif
/* import existing builtin modules or modules that have been imported alredy */
newmodule = PyImport_ImportModuleEx( name, globals, locals, fromlist );
@@ -273,8 +265,8 @@ static PyObject *blender_reload( PyObject * self, PyObject * args )
return newmodule;
}
-PyMethodDef bpy_import_meth[] = { {"bpy_import_meth", blender_import, METH_VARARGS | METH_KEYWORDS, "blenders import"} };
-PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", blender_reload, METH_VARARGS, "blenders reload"} };
+PyMethodDef bpy_import_meth[] = { {"bpy_import_meth", (PyCFunction)blender_import, METH_VARARGS | METH_KEYWORDS, "blenders import"} };
+PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", (PyCFunction)blender_reload, METH_VARARGS, "blenders reload"} };
/* Clear user modules.
diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h
index aeeafb7c1c4..4e761fe8da0 100644
--- a/source/blender/python/generic/bpy_internal_import.h
+++ b/source/blender/python/generic/bpy_internal_import.h
@@ -31,8 +31,16 @@
#ifndef EXPP_bpy_import_h
#define EXPP_bpy_import_h
+/* python redefines :/ */
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
+
#include <Python.h>
-#include "../intern/bpy_compat.h"
#include "compile.h" /* for the PyCodeObject */
#include "eval.h" /* for PyEval_EvalCode */
diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c
index 69373b1aa36..73fcaeb457b 100644
--- a/source/blender/python/generic/euler.c
+++ b/source/blender/python/generic/euler.c
@@ -242,7 +242,7 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args)
PyErr_SetString(PyExc_TypeError, "euler.rotate():expected angle (float) and axis (x,y,z)");
return NULL;
}
- if(!STREQ3(axis,"x","y","z")){
+ if(ELEM3(*axis, 'x', 'y', 'z') && axis[1]=='\0'){
PyErr_SetString(PyExc_TypeError, "euler.rotate(): expected axis to be 'x', 'y' or 'z'");
return NULL;
}
@@ -508,7 +508,7 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end,
}
//-----------------PROTCOL DECLARATIONS--------------------------
static PySequenceMethods Euler_SeqMethods = {
- (inquiry) Euler_len, /* sq_length */
+ (lenfunc) Euler_len, /* sq_length */
(binaryfunc) 0, /* sq_concat */
(ssizeargfunc) 0, /* sq_repeat */
(ssizeargfunc) Euler_item, /* sq_item */
@@ -547,13 +547,7 @@ static PyGetSetDef Euler_getseters[] = {
//------------------PY_OBECT DEFINITION--------------------------
PyTypeObject euler_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"euler", //tp_name
sizeof(EulerObject), //tp_basicsize
0, //tp_itemsize
diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h
index a3706d53756..74d184fef81 100644
--- a/source/blender/python/generic/euler.h
+++ b/source/blender/python/generic/euler.h
@@ -32,7 +32,6 @@
#define EXPP_euler_h
#include <Python.h>
-#include "../intern/bpy_compat.h"
extern PyTypeObject euler_Type;
#define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type)
diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c
index 5bdbf804618..be3e704460a 100644
--- a/source/blender/python/generic/matrix.c
+++ b/source/blender/python/generic/matrix.c
@@ -37,14 +37,17 @@ static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject*
/* matrix vector callbacks */
int mathutils_matrix_vector_cb_index= -1;
-static int mathutils_matrix_vector_check(MatrixObject *self)
+static int mathutils_matrix_vector_check(PyObject *self_p)
{
+ MatrixObject *self= (MatrixObject*)self_p;
return BaseMath_ReadCallback(self);
}
-static int mathutils_matrix_vector_get(MatrixObject *self, int subtype, float *vec_from)
+static int mathutils_matrix_vector_get(PyObject *self_p, int subtype, float *vec_from)
{
+ MatrixObject *self= (MatrixObject*)self_p;
int i;
+
if(!BaseMath_ReadCallback(self))
return 0;
@@ -54,9 +57,11 @@ static int mathutils_matrix_vector_get(MatrixObject *self, int subtype, float *v
return 1;
}
-static int mathutils_matrix_vector_set(MatrixObject *self, int subtype, float *vec_to)
+static int mathutils_matrix_vector_set(PyObject *self_p, int subtype, float *vec_to)
{
+ MatrixObject *self= (MatrixObject*)self_p;
int i;
+
if(!BaseMath_ReadCallback(self))
return 0;
@@ -67,8 +72,10 @@ static int mathutils_matrix_vector_set(MatrixObject *self, int subtype, float *v
return 1;
}
-static int mathutils_matrix_vector_get_index(MatrixObject *self, int subtype, float *vec_from, int index)
+static int mathutils_matrix_vector_get_index(PyObject *self_p, int subtype, float *vec_from, int index)
{
+ MatrixObject *self= (MatrixObject*)self_p;
+
if(!BaseMath_ReadCallback(self))
return 0;
@@ -76,8 +83,10 @@ static int mathutils_matrix_vector_get_index(MatrixObject *self, int subtype, fl
return 1;
}
-static int mathutils_matrix_vector_set_index(MatrixObject *self, int subtype, float *vec_to, int index)
+static int mathutils_matrix_vector_set_index(PyObject *self_p, int subtype, float *vec_to, int index)
{
+ MatrixObject *self= (MatrixObject*)self_p;
+
if(!BaseMath_ReadCallback(self))
return 0;
@@ -988,7 +997,7 @@ static PyObject* Matrix_inv(MatrixObject *self)
/*-----------------PROTOCOL DECLARATIONS--------------------------*/
static PySequenceMethods Matrix_SeqMethods = {
- (inquiry) Matrix_len, /* sq_length */
+ (lenfunc) Matrix_len, /* sq_length */
(binaryfunc) 0, /* sq_concat */
(ssizeargfunc) 0, /* sq_repeat */
(ssizeargfunc) Matrix_item, /* sq_item */
@@ -998,8 +1007,6 @@ static PySequenceMethods Matrix_SeqMethods = {
};
-
-#if (PY_VERSION_HEX >= 0x03000000)
static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
{
if (PyIndex_Check(item)) {
@@ -1071,11 +1078,8 @@ static PyMappingMethods Matrix_AsMapping = {
(binaryfunc)Matrix_subscript,
(objobjargproc)Matrix_ass_subscript
};
-#endif /* (PY_VERSION_HEX >= 0x03000000) */
-
-#if (PY_VERSION_HEX >= 0x03000000)
static PyNumberMethods Matrix_NumMethods = {
(binaryfunc) Matrix_add, /*nb_add*/
(binaryfunc) Matrix_sub, /*nb_subtract*/
@@ -1112,33 +1116,6 @@ static PyNumberMethods Matrix_NumMethods = {
0, /* nb_inplace_true_divide */
0, /* nb_index */
};
-#else
-static PyNumberMethods Matrix_NumMethods = {
- (binaryfunc) Matrix_add, /* __add__ */
- (binaryfunc) Matrix_sub, /* __sub__ */
- (binaryfunc) Matrix_mul, /* __mul__ */
- (binaryfunc) 0, /* __div__ */
- (binaryfunc) 0, /* __mod__ */
- (binaryfunc) 0, /* __divmod__ */
- (ternaryfunc) 0, /* __pow__ */
- (unaryfunc) 0, /* __neg__ */
- (unaryfunc) 0, /* __pos__ */
- (unaryfunc) 0, /* __abs__ */
- (inquiry) 0, /* __nonzero__ */
- (unaryfunc) Matrix_inv, /* __invert__ */
- (binaryfunc) 0, /* __lshift__ */
- (binaryfunc) 0, /* __rshift__ */
- (binaryfunc) 0, /* __and__ */
- (binaryfunc) 0, /* __xor__ */
- (binaryfunc) 0, /* __or__ */
- /*(coercion)*/ 0, /* __coerce__ */
- (unaryfunc) 0, /* __int__ */
- (unaryfunc) 0, /* __long__ */
- (unaryfunc) 0, /* __float__ */
- (unaryfunc) 0, /* __oct__ */
- (unaryfunc) 0, /* __hex__ */
-};
-#endif
static PyObject *Matrix_getRowSize( MatrixObject * self, void *type )
{
@@ -1164,13 +1141,7 @@ static PyGetSetDef Matrix_getseters[] = {
/*------------------PY_OBECT DEFINITION--------------------------*/
PyTypeObject matrix_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"matrix", /*tp_name*/
sizeof(MatrixObject), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -1182,11 +1153,7 @@ PyTypeObject matrix_Type = {
(reprfunc) Matrix_repr, /*tp_repr*/
&Matrix_NumMethods, /*tp_as_number*/
&Matrix_SeqMethods, /*tp_as_sequence*/
-#if (PY_VERSION_HEX >= 0x03000000)
&Matrix_AsMapping, /*tp_as_mapping*/
-#else
- 0,
-#endif
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c
index a353f73c854..7e12fe7925a 100644
--- a/source/blender/python/generic/quat.c
+++ b/source/blender/python/generic/quat.c
@@ -611,7 +611,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2)
//-----------------PROTOCOL DECLARATIONS--------------------------
static PySequenceMethods Quaternion_SeqMethods = {
- (inquiry) Quaternion_len, /* sq_length */
+ (lenfunc) Quaternion_len, /* sq_length */
(binaryfunc) 0, /* sq_concat */
(ssizeargfunc) 0, /* sq_repeat */
(ssizeargfunc) Quaternion_item, /* sq_item */
@@ -620,7 +620,6 @@ static PySequenceMethods Quaternion_SeqMethods = {
(ssizessizeobjargproc) Quaternion_ass_slice, /* sq_ass_slice */
};
-#if (PY_VERSION_HEX >= 0x03000000)
static PyNumberMethods Quaternion_NumMethods = {
(binaryfunc) Quaternion_add, /*nb_add*/
(binaryfunc) Quaternion_sub, /*nb_subtract*/
@@ -657,33 +656,6 @@ static PyNumberMethods Quaternion_NumMethods = {
0, /* nb_inplace_true_divide */
0, /* nb_index */
};
-#else
-static PyNumberMethods Quaternion_NumMethods = {
- (binaryfunc) Quaternion_add, /* __add__ */
- (binaryfunc) Quaternion_sub, /* __sub__ */
- (binaryfunc) Quaternion_mul, /* __mul__ */
- (binaryfunc) 0, /* __div__ */
- (binaryfunc) 0, /* __mod__ */
- (binaryfunc) 0, /* __divmod__ */
- (ternaryfunc) 0, /* __pow__ */
- (unaryfunc) 0, /* __neg__ */
- (unaryfunc) 0, /* __pos__ */
- (unaryfunc) 0, /* __abs__ */
- (inquiry) 0, /* __nonzero__ */
- (unaryfunc) 0, /* __invert__ */
- (binaryfunc) 0, /* __lshift__ */
- (binaryfunc) 0, /* __rshift__ */
- (binaryfunc) 0, /* __and__ */
- (binaryfunc) 0, /* __xor__ */
- (binaryfunc) 0, /* __or__ */
- /*(coercion)*/ 0, /* __coerce__ */
- (unaryfunc) 0, /* __int__ */
- (unaryfunc) 0, /* __long__ */
- (unaryfunc) 0, /* __float__ */
- (unaryfunc) 0, /* __oct__ */
- (unaryfunc) 0, /* __hex__ */
-};
-#endif
static PyObject *Quaternion_getAxis( QuaternionObject * self, void *type )
{
@@ -778,13 +750,7 @@ static PyGetSetDef Quaternion_getseters[] = {
//------------------PY_OBECT DEFINITION--------------------------
PyTypeObject quaternion_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"quaternion", //tp_name
sizeof(QuaternionObject), //tp_basicsize
0, //tp_itemsize
diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h
index a7cfb7898b1..a1d01b4982d 100644
--- a/source/blender/python/generic/quat.h
+++ b/source/blender/python/generic/quat.h
@@ -32,7 +32,6 @@
#define EXPP_quat_h
#include <Python.h>
-#include "../intern/bpy_compat.h"
extern PyTypeObject quaternion_Type;
#define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type)
diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c
index cf2396b30d4..c4a8a37ee05 100644
--- a/source/blender/python/generic/vector.c
+++ b/source/blender/python/generic/vector.c
@@ -168,7 +168,7 @@ static PyObject *Vector_Resize2D(VectorObject * self)
return NULL;
}
if(self->cb_user) {
- PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner");
+ PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize a vector that has an owner");
return NULL;
}
@@ -191,7 +191,7 @@ static PyObject *Vector_Resize3D(VectorObject * self)
return NULL;
}
if(self->cb_user) {
- PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner");
+ PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize a vector that has an owner");
return NULL;
}
@@ -1054,25 +1054,15 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
/*-----------------PROTCOL DECLARATIONS--------------------------*/
static PySequenceMethods Vector_SeqMethods = {
- (inquiry) Vector_len, /* sq_length */
+ (lenfunc) Vector_len, /* sq_length */
(binaryfunc) 0, /* sq_concat */
(ssizeargfunc) 0, /* sq_repeat */
(ssizeargfunc) Vector_item, /* sq_item */
-#if (PY_VERSION_HEX < 0x03000000)
- (ssizessizeargfunc) Vector_slice, /* sq_slice */ /* PY2 ONLY */
-#else
- NULL,
-#endif
+ NULL, /* py3 deprecated slice func */
(ssizeobjargproc) Vector_ass_item, /* sq_ass_item */
-#if (PY_VERSION_HEX < 0x03000000)
- (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ /* PY2 ONLY */
-#else
- NULL,
-#endif
+ NULL, /* py3 deprecated slice assign func */
};
-
-#if (PY_VERSION_HEX >= 0x03000000)
static PyObject *Vector_subscript(VectorObject* self, PyObject* item)
{
if (PyIndex_Check(item)) {
@@ -1144,9 +1134,8 @@ static PyMappingMethods Vector_AsMapping = {
(binaryfunc)Vector_subscript,
(objobjargproc)Vector_ass_subscript
};
-#endif /* (PY_VERSION_HEX >= 0x03000000) */
-
-#if (PY_VERSION_HEX >= 0x03000000)
+
+
static PyNumberMethods Vector_NumMethods = {
(binaryfunc) Vector_add, /*nb_add*/
(binaryfunc) Vector_sub, /*nb_subtract*/
@@ -1183,53 +1172,6 @@ static PyNumberMethods Vector_NumMethods = {
Vector_idiv, /* nb_inplace_true_divide */
0, /* nb_index */
};
-#else
-static PyNumberMethods Vector_NumMethods = {
- (binaryfunc) Vector_add, /* __add__ */
- (binaryfunc) Vector_sub, /* __sub__ */
- (binaryfunc) Vector_mul, /* __mul__ */
- (binaryfunc) Vector_div, /* __div__ */
- (binaryfunc) NULL, /* __mod__ */
- (binaryfunc) NULL, /* __divmod__ */
- (ternaryfunc) NULL, /* __pow__ */
- (unaryfunc) Vector_neg, /* __neg__ */
- (unaryfunc) NULL, /* __pos__ */
- (unaryfunc) NULL, /* __abs__ */
- (inquiry) NULL, /* __nonzero__ */
- (unaryfunc) NULL, /* __invert__ */
- (binaryfunc) NULL, /* __lshift__ */
- (binaryfunc) NULL, /* __rshift__ */
- (binaryfunc) NULL, /* __and__ */
- (binaryfunc) NULL, /* __xor__ */
- (binaryfunc) NULL, /* __or__ */
- /*(coercion)*/ NULL, /* __coerce__ */
- (unaryfunc) NULL, /* __int__ */
- (unaryfunc) NULL, /* __long__ */
- (unaryfunc) NULL, /* __float__ */
- (unaryfunc) NULL, /* __oct__ */
- (unaryfunc) NULL, /* __hex__ */
-
- /* Added in release 2.0 */
- (binaryfunc) Vector_iadd, /*__iadd__*/
- (binaryfunc) Vector_isub, /*__isub__*/
- (binaryfunc) Vector_imul, /*__imul__*/
- (binaryfunc) Vector_idiv, /*__idiv__*/
- (binaryfunc) NULL, /*__imod__*/
- (ternaryfunc) NULL, /*__ipow__*/
- (binaryfunc) NULL, /*__ilshift__*/
- (binaryfunc) NULL, /*__irshift__*/
- (binaryfunc) NULL, /*__iand__*/
- (binaryfunc) NULL, /*__ixor__*/
- (binaryfunc) NULL, /*__ior__*/
-
- /* Added in release 2.2 */
- /* The following require the Py_TPFLAGS_HAVE_CLASS flag */
- (binaryfunc) NULL, /*__floordiv__ __rfloordiv__*/
- (binaryfunc) NULL, /*__truediv__ __rfloordiv__*/
- (binaryfunc) NULL, /*__ifloordiv__*/
- (binaryfunc) NULL, /*__itruediv__*/
-};
-#endif
/*------------------PY_OBECT DEFINITION--------------------------*/
@@ -1325,7 +1267,7 @@ static PyObject *Vector_getSwizzle(VectorObject * self, void *closure)
/* Unpack the axes from the closure into an array. */
axisA = 0;
- swizzleClosure = (unsigned int) closure;
+ swizzleClosure = GET_INT_FROM_POINTER(closure);
while (swizzleClosure & SWIZZLE_VALID_AXIS)
{
axisB = swizzleClosure & SWIZZLE_AXIS;
@@ -1365,7 +1307,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur
/* Check that the closure can be used with this vector: even 2D vectors have
swizzles defined for axes z and w, but they would be invalid. */
- swizzleClosure = (unsigned int) closure;
+ swizzleClosure = GET_INT_FROM_POINTER(closure);
while (swizzleClosure & SWIZZLE_VALID_AXIS)
{
axisA = swizzleClosure & SWIZZLE_AXIS;
@@ -1382,7 +1324,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur
/* Copy vector contents onto swizzled axes. */
vecVal = (VectorObject*) value;
axisB = 0;
- swizzleClosure = (unsigned int) closure;
+ swizzleClosure = GET_INT_FROM_POINTER(closure);
while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < vecVal->size)
{
axisA = swizzleClosure & SWIZZLE_AXIS;
@@ -1398,7 +1340,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur
{
/* Copy list contents onto swizzled axes. */
listLen = PyList_Size(value);
- swizzleClosure = (unsigned int) closure;
+ swizzleClosure = GET_INT_FROM_POINTER(closure);
axisB = 0;
while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < listLen)
{
@@ -1423,7 +1365,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur
else if (((scalarVal = (float)PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred())==0)
{
/* Assign the same value to each axis. */
- swizzleClosure = (unsigned int) closure;
+ swizzleClosure = GET_INT_FROM_POINTER(closure);
while (swizzleClosure & SWIZZLE_VALID_AXIS)
{
axisA = swizzleClosure & SWIZZLE_AXIS;
@@ -1482,342 +1424,342 @@ static PyGetSetDef Vector_getseters[] = {
NULL},
/* autogenerated swizzle attrs, see python script below */
- {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 36 */
- {"xxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 292 */
- {"xxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2340 */
- {"xxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2852 */
- {"xxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3364 */
- {"xxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3876 */
- {"xxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 356 */
- {"xxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2404 */
- {"xxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2916 */
- {"xxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3428 */
- {"xxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3940 */
- {"xxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 420 */
- {"xxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2468 */
- {"xxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2980 */
- {"xxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3492 */
- {"xxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4004 */
- {"xxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 484 */
- {"xxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2532 */
- {"xxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3044 */
- {"xxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3556 */
- {"xxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4068 */
- {"xy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 44 */
- {"xyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 300 */
- {"xyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2348 */
- {"xyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2860 */
- {"xyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3372 */
- {"xyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3884 */
- {"xyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 364 */
- {"xyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2412 */
- {"xyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2924 */
- {"xyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3436 */
- {"xyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3948 */
- {"xyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 428 */
- {"xyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2476 */
- {"xyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2988 */
- {"xyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3500 */
- {"xyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4012 */
- {"xyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 492 */
- {"xywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2540 */
- {"xywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3052 */
- {"xywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3564 */
- {"xyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4076 */
- {"xz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 52 */
- {"xzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 308 */
- {"xzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2356 */
- {"xzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2868 */
- {"xzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3380 */
- {"xzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3892 */
- {"xzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 372 */
- {"xzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2420 */
- {"xzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2932 */
- {"xzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3444 */
- {"xzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3956 */
- {"xzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 436 */
- {"xzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2484 */
- {"xzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2996 */
- {"xzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3508 */
- {"xzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4020 */
- {"xzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 500 */
- {"xzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2548 */
- {"xzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3060 */
- {"xzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3572 */
- {"xzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4084 */
- {"xw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 60 */
- {"xwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 316 */
- {"xwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2364 */
- {"xwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2876 */
- {"xwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3388 */
- {"xwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3900 */
- {"xwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 380 */
- {"xwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2428 */
- {"xwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2940 */
- {"xwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3452 */
- {"xwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3964 */
- {"xwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 444 */
- {"xwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2492 */
- {"xwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3004 */
- {"xwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3516 */
- {"xwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4028 */
- {"xww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 508 */
- {"xwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2556 */
- {"xwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3068 */
- {"xwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3580 */
- {"xwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4092 */
- {"yx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 37 */
- {"yxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 293 */
- {"yxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2341 */
- {"yxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2853 */
- {"yxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3365 */
- {"yxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3877 */
- {"yxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 357 */
- {"yxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2405 */
- {"yxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2917 */
- {"yxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3429 */
- {"yxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3941 */
- {"yxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 421 */
- {"yxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2469 */
- {"yxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2981 */
- {"yxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3493 */
- {"yxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4005 */
- {"yxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 485 */
- {"yxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2533 */
- {"yxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3045 */
- {"yxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3557 */
- {"yxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4069 */
- {"yy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 45 */
- {"yyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 301 */
- {"yyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2349 */
- {"yyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2861 */
- {"yyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3373 */
- {"yyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3885 */
- {"yyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 365 */
- {"yyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2413 */
- {"yyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2925 */
- {"yyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3437 */
- {"yyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3949 */
- {"yyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 429 */
- {"yyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2477 */
- {"yyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2989 */
- {"yyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3501 */
- {"yyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4013 */
- {"yyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 493 */
- {"yywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2541 */
- {"yywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3053 */
- {"yywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3565 */
- {"yyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4077 */
- {"yz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 53 */
- {"yzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 309 */
- {"yzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2357 */
- {"yzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2869 */
- {"yzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3381 */
- {"yzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3893 */
- {"yzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 373 */
- {"yzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2421 */
- {"yzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2933 */
- {"yzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3445 */
- {"yzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3957 */
- {"yzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 437 */
- {"yzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2485 */
- {"yzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2997 */
- {"yzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3509 */
- {"yzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4021 */
- {"yzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 501 */
- {"yzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2549 */
- {"yzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3061 */
- {"yzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3573 */
- {"yzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4085 */
- {"yw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 61 */
- {"ywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 317 */
- {"ywxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2365 */
- {"ywxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2877 */
- {"ywxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3389 */
- {"ywxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3901 */
- {"ywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 381 */
- {"ywyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2429 */
- {"ywyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2941 */
- {"ywyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3453 */
- {"ywyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3965 */
- {"ywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 445 */
- {"ywzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2493 */
- {"ywzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3005 */
- {"ywzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3517 */
- {"ywzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4029 */
- {"yww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 509 */
- {"ywwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2557 */
- {"ywwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3069 */
- {"ywwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3581 */
- {"ywww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4093 */
- {"zx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 38 */
- {"zxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 294 */
- {"zxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2342 */
- {"zxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2854 */
- {"zxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3366 */
- {"zxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3878 */
- {"zxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 358 */
- {"zxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2406 */
- {"zxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2918 */
- {"zxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3430 */
- {"zxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3942 */
- {"zxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 422 */
- {"zxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2470 */
- {"zxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2982 */
- {"zxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3494 */
- {"zxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4006 */
- {"zxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 486 */
- {"zxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2534 */
- {"zxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3046 */
- {"zxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3558 */
- {"zxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4070 */
- {"zy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 46 */
- {"zyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 302 */
- {"zyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2350 */
- {"zyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2862 */
- {"zyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3374 */
- {"zyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3886 */
- {"zyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 366 */
- {"zyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2414 */
- {"zyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2926 */
- {"zyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3438 */
- {"zyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3950 */
- {"zyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 430 */
- {"zyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2478 */
- {"zyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2990 */
- {"zyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3502 */
- {"zyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4014 */
- {"zyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 494 */
- {"zywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2542 */
- {"zywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3054 */
- {"zywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3566 */
- {"zyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4078 */
- {"zz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 54 */
- {"zzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 310 */
- {"zzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2358 */
- {"zzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2870 */
- {"zzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3382 */
- {"zzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3894 */
- {"zzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 374 */
- {"zzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2422 */
- {"zzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2934 */
- {"zzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3446 */
- {"zzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3958 */
- {"zzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 438 */
- {"zzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2486 */
- {"zzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2998 */
- {"zzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3510 */
- {"zzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4022 */
- {"zzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 502 */
- {"zzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2550 */
- {"zzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3062 */
- {"zzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3574 */
- {"zzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4086 */
- {"zw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 62 */
- {"zwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 318 */
- {"zwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2366 */
- {"zwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2878 */
- {"zwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3390 */
- {"zwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3902 */
- {"zwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 382 */
- {"zwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2430 */
- {"zwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2942 */
- {"zwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3454 */
- {"zwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3966 */
- {"zwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 446 */
- {"zwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2494 */
- {"zwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3006 */
- {"zwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3518 */
- {"zwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4030 */
- {"zww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 510 */
- {"zwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2558 */
- {"zwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3070 */
- {"zwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3582 */
- {"zwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4094 */
- {"wx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 39 */
- {"wxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 295 */
- {"wxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2343 */
- {"wxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2855 */
- {"wxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3367 */
- {"wxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3879 */
- {"wxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 359 */
- {"wxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2407 */
- {"wxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2919 */
- {"wxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3431 */
- {"wxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3943 */
- {"wxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 423 */
- {"wxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2471 */
- {"wxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2983 */
- {"wxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3495 */
- {"wxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4007 */
- {"wxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 487 */
- {"wxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2535 */
- {"wxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3047 */
- {"wxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3559 */
- {"wxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4071 */
- {"wy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 47 */
- {"wyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 303 */
- {"wyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2351 */
- {"wyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2863 */
- {"wyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3375 */
- {"wyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3887 */
- {"wyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 367 */
- {"wyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2415 */
- {"wyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2927 */
- {"wyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3439 */
- {"wyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3951 */
- {"wyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 431 */
- {"wyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2479 */
- {"wyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2991 */
- {"wyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3503 */
- {"wyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4015 */
- {"wyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 495 */
- {"wywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2543 */
- {"wywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3055 */
- {"wywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3567 */
- {"wyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4079 */
- {"wz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 55 */
- {"wzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 311 */
- {"wzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2359 */
- {"wzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2871 */
- {"wzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3383 */
- {"wzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3895 */
- {"wzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 375 */
- {"wzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2423 */
- {"wzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2935 */
- {"wzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3447 */
- {"wzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3959 */
- {"wzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 439 */
- {"wzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2487 */
- {"wzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2999 */
- {"wzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3511 */
- {"wzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4023 */
- {"wzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 503 */
- {"wzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2551 */
- {"wzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3063 */
- {"wzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3575 */
- {"wzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4087 */
- {"ww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 63 */
- {"wwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 319 */
- {"wwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2367 */
- {"wwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2879 */
- {"wwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3391 */
- {"wwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3903 */
- {"wwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 383 */
- {"wwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2431 */
- {"wwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2943 */
- {"wwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3455 */
- {"wwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3967 */
- {"wwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 447 */
- {"wwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2495 */
- {"wwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3007 */
- {"wwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3519 */
- {"wwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4031 */
- {"www", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 511 */
- {"wwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2559 */
- {"wwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3071 */
- {"wwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3583 */
- {"wwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4095 */
+ {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 36 */
+ {"xxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 292 */
+ {"xxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2340 */
+ {"xxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2852 */
+ {"xxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3364 */
+ {"xxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3876 */
+ {"xxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 356 */
+ {"xxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2404 */
+ {"xxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2916 */
+ {"xxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3428 */
+ {"xxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3940 */
+ {"xxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 420 */
+ {"xxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2468 */
+ {"xxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2980 */
+ {"xxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3492 */
+ {"xxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4004 */
+ {"xxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 484 */
+ {"xxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2532 */
+ {"xxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3044 */
+ {"xxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3556 */
+ {"xxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4068 */
+ {"xy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 44 */
+ {"xyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 300 */
+ {"xyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2348 */
+ {"xyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2860 */
+ {"xyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3372 */
+ {"xyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3884 */
+ {"xyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 364 */
+ {"xyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2412 */
+ {"xyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2924 */
+ {"xyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3436 */
+ {"xyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3948 */
+ {"xyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 428 */
+ {"xyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2476 */
+ {"xyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2988 */
+ {"xyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3500 */
+ {"xyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4012 */
+ {"xyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 492 */
+ {"xywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2540 */
+ {"xywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3052 */
+ {"xywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3564 */
+ {"xyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4076 */
+ {"xz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 52 */
+ {"xzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 308 */
+ {"xzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2356 */
+ {"xzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2868 */
+ {"xzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3380 */
+ {"xzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3892 */
+ {"xzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 372 */
+ {"xzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2420 */
+ {"xzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2932 */
+ {"xzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3444 */
+ {"xzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3956 */
+ {"xzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 436 */
+ {"xzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2484 */
+ {"xzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2996 */
+ {"xzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3508 */
+ {"xzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4020 */
+ {"xzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 500 */
+ {"xzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2548 */
+ {"xzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3060 */
+ {"xzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3572 */
+ {"xzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4084 */
+ {"xw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 60 */
+ {"xwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 316 */
+ {"xwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2364 */
+ {"xwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2876 */
+ {"xwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3388 */
+ {"xwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3900 */
+ {"xwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 380 */
+ {"xwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2428 */
+ {"xwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2940 */
+ {"xwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3452 */
+ {"xwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3964 */
+ {"xwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 444 */
+ {"xwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2492 */
+ {"xwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3004 */
+ {"xwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3516 */
+ {"xwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4028 */
+ {"xww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 508 */
+ {"xwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2556 */
+ {"xwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3068 */
+ {"xwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3580 */
+ {"xwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4092 */
+ {"yx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 37 */
+ {"yxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 293 */
+ {"yxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2341 */
+ {"yxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2853 */
+ {"yxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3365 */
+ {"yxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3877 */
+ {"yxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 357 */
+ {"yxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2405 */
+ {"yxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2917 */
+ {"yxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3429 */
+ {"yxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3941 */
+ {"yxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 421 */
+ {"yxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2469 */
+ {"yxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2981 */
+ {"yxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3493 */
+ {"yxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4005 */
+ {"yxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 485 */
+ {"yxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2533 */
+ {"yxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3045 */
+ {"yxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3557 */
+ {"yxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4069 */
+ {"yy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 45 */
+ {"yyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 301 */
+ {"yyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2349 */
+ {"yyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2861 */
+ {"yyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3373 */
+ {"yyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3885 */
+ {"yyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 365 */
+ {"yyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2413 */
+ {"yyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2925 */
+ {"yyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3437 */
+ {"yyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3949 */
+ {"yyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 429 */
+ {"yyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2477 */
+ {"yyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2989 */
+ {"yyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3501 */
+ {"yyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4013 */
+ {"yyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 493 */
+ {"yywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2541 */
+ {"yywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3053 */
+ {"yywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3565 */
+ {"yyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4077 */
+ {"yz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 53 */
+ {"yzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 309 */
+ {"yzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2357 */
+ {"yzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2869 */
+ {"yzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3381 */
+ {"yzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3893 */
+ {"yzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 373 */
+ {"yzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2421 */
+ {"yzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2933 */
+ {"yzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3445 */
+ {"yzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3957 */
+ {"yzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 437 */
+ {"yzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2485 */
+ {"yzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2997 */
+ {"yzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3509 */
+ {"yzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4021 */
+ {"yzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 501 */
+ {"yzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2549 */
+ {"yzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3061 */
+ {"yzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3573 */
+ {"yzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4085 */
+ {"yw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 61 */
+ {"ywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 317 */
+ {"ywxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2365 */
+ {"ywxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2877 */
+ {"ywxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3389 */
+ {"ywxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3901 */
+ {"ywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 381 */
+ {"ywyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2429 */
+ {"ywyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2941 */
+ {"ywyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3453 */
+ {"ywyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3965 */
+ {"ywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 445 */
+ {"ywzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2493 */
+ {"ywzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3005 */
+ {"ywzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3517 */
+ {"ywzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4029 */
+ {"yww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 509 */
+ {"ywwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2557 */
+ {"ywwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3069 */
+ {"ywwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3581 */
+ {"ywww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4093 */
+ {"zx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 38 */
+ {"zxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 294 */
+ {"zxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2342 */
+ {"zxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2854 */
+ {"zxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3366 */
+ {"zxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3878 */
+ {"zxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 358 */
+ {"zxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2406 */
+ {"zxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2918 */
+ {"zxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3430 */
+ {"zxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3942 */
+ {"zxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 422 */
+ {"zxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2470 */
+ {"zxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2982 */
+ {"zxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3494 */
+ {"zxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4006 */
+ {"zxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 486 */
+ {"zxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2534 */
+ {"zxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3046 */
+ {"zxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3558 */
+ {"zxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4070 */
+ {"zy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 46 */
+ {"zyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 302 */
+ {"zyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2350 */
+ {"zyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2862 */
+ {"zyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3374 */
+ {"zyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3886 */
+ {"zyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 366 */
+ {"zyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2414 */
+ {"zyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2926 */
+ {"zyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3438 */
+ {"zyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3950 */
+ {"zyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 430 */
+ {"zyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2478 */
+ {"zyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2990 */
+ {"zyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3502 */
+ {"zyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4014 */
+ {"zyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 494 */
+ {"zywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2542 */
+ {"zywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3054 */
+ {"zywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3566 */
+ {"zyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4078 */
+ {"zz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 54 */
+ {"zzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 310 */
+ {"zzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2358 */
+ {"zzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2870 */
+ {"zzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3382 */
+ {"zzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3894 */
+ {"zzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 374 */
+ {"zzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2422 */
+ {"zzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2934 */
+ {"zzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3446 */
+ {"zzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3958 */
+ {"zzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 438 */
+ {"zzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2486 */
+ {"zzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2998 */
+ {"zzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3510 */
+ {"zzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4022 */
+ {"zzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 502 */
+ {"zzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2550 */
+ {"zzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3062 */
+ {"zzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3574 */
+ {"zzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4086 */
+ {"zw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 62 */
+ {"zwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 318 */
+ {"zwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2366 */
+ {"zwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2878 */
+ {"zwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3390 */
+ {"zwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3902 */
+ {"zwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 382 */
+ {"zwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2430 */
+ {"zwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2942 */
+ {"zwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3454 */
+ {"zwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3966 */
+ {"zwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 446 */
+ {"zwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2494 */
+ {"zwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3006 */
+ {"zwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3518 */
+ {"zwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4030 */
+ {"zww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 510 */
+ {"zwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2558 */
+ {"zwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3070 */
+ {"zwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3582 */
+ {"zwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4094 */
+ {"wx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 39 */
+ {"wxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 295 */
+ {"wxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2343 */
+ {"wxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2855 */
+ {"wxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3367 */
+ {"wxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3879 */
+ {"wxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 359 */
+ {"wxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2407 */
+ {"wxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2919 */
+ {"wxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3431 */
+ {"wxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3943 */
+ {"wxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 423 */
+ {"wxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2471 */
+ {"wxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2983 */
+ {"wxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3495 */
+ {"wxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4007 */
+ {"wxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 487 */
+ {"wxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2535 */
+ {"wxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3047 */
+ {"wxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3559 */
+ {"wxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4071 */
+ {"wy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 47 */
+ {"wyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 303 */
+ {"wyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2351 */
+ {"wyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2863 */
+ {"wyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3375 */
+ {"wyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3887 */
+ {"wyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 367 */
+ {"wyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2415 */
+ {"wyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2927 */
+ {"wyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3439 */
+ {"wyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3951 */
+ {"wyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 431 */
+ {"wyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2479 */
+ {"wyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2991 */
+ {"wyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3503 */
+ {"wyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4015 */
+ {"wyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 495 */
+ {"wywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2543 */
+ {"wywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3055 */
+ {"wywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3567 */
+ {"wyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4079 */
+ {"wz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 55 */
+ {"wzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 311 */
+ {"wzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2359 */
+ {"wzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2871 */
+ {"wzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3383 */
+ {"wzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3895 */
+ {"wzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 375 */
+ {"wzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2423 */
+ {"wzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2935 */
+ {"wzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3447 */
+ {"wzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3959 */
+ {"wzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 439 */
+ {"wzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2487 */
+ {"wzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2999 */
+ {"wzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3511 */
+ {"wzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4023 */
+ {"wzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 503 */
+ {"wzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2551 */
+ {"wzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3063 */
+ {"wzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3575 */
+ {"wzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4087 */
+ {"ww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 63 */
+ {"wwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 319 */
+ {"wwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2367 */
+ {"wwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2879 */
+ {"wwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3391 */
+ {"wwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3903 */
+ {"wwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 383 */
+ {"wwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2431 */
+ {"wwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2943 */
+ {"wwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3455 */
+ {"wwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3967 */
+ {"wwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 447 */
+ {"wwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2495 */
+ {"wwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3007 */
+ {"wwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3519 */
+ {"wwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4031 */
+ {"www", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 511 */
+ {"wwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2559 */
+ {"wwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3071 */
+ {"wwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3583 */
+ {"wwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4095 */
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
};
@@ -1854,7 +1796,7 @@ items.sort(key = lambda a: a[0].replace('x', '0').replace('y', '1').replace('z',
unique = set()
for key, val in items:
num = eval(val)
- print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, (void *)((unsigned int)%s)}, // %s' % (key, (' '*(4-len(key))), axis_dict[key], num)
+ print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(%s)}, // %s' % (key, (' '*(4-len(key))), axis_dict[key], num)
unique.add(num)
if len(unique) != len(items):
@@ -1872,13 +1814,7 @@ if len(unique) != len(items):
*/
PyTypeObject vector_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
/* For printing, in format "<module>.<name>" */
"vector", /* char *tp_name; */
sizeof( VectorObject ), /* int tp_basicsize; */
@@ -1897,11 +1833,7 @@ PyTypeObject vector_Type = {
&Vector_NumMethods, /* PyNumberMethods *tp_as_number; */
&Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */
-#if (PY_VERSION_HEX >= 0x03000000)
&Vector_AsMapping, /* PyMappingMethods *tp_as_mapping; */
-#else
- NULL,
-#endif
/* More standard operations (here for binary compatibility) */
diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h
index f6babac7ed9..a13ec0f80f3 100644
--- a/source/blender/python/generic/vector.h
+++ b/source/blender/python/generic/vector.h
@@ -31,7 +31,6 @@
#define EXPP_vector_h
#include <Python.h>
-#include "../intern/bpy_compat.h"
extern PyTypeObject vector_Type;
#define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type)
diff --git a/source/blender/python/intern/Makefile b/source/blender/python/intern/Makefile
index d210cfaf973..419092cbe21 100644
--- a/source/blender/python/intern/Makefile
+++ b/source/blender/python/intern/Makefile
@@ -43,7 +43,7 @@ CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
# PreProcessor stuff
CPPFLAGS += -I$(NAN_GHOST)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS)
+CPPFLAGS += $(NAN_SDLCFLAGS)
# modules
CPPFLAGS += -I../../editors/include
diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c
new file mode 100644
index 00000000000..669cccb7011
--- /dev/null
+++ b/source/blender/python/intern/bpy_array.c
@@ -0,0 +1,235 @@
+/**
+ *
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Arystanbek Dyussenov
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "Python.h"
+
+#include "bpy_rna.h"
+
+#include "RNA_access.h"
+
+#include "BLI_string.h"
+
+#include "MEM_guardedalloc.h"
+
+typedef void (*ItemConvertFunc)(PyObject *, char *);
+typedef int (*ItemTypeCheckFunc)(PyObject *);
+typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *);
+
+/* Ensures that a python sequence has an expected number of items/sub-items and items are of expected type. */
+static int pyrna_validate_array(PyObject *seq, unsigned short dim, unsigned short totdim, unsigned short dim_size[],
+ ItemTypeCheckFunc check_item_type, const char *item_type_str, char *error_str, int error_str_size)
+{
+ int i;
+ if (dim < totdim) {
+ for (i= 0; i < PySequence_Length(seq); i++) {
+ PyObject *item;
+ int ok= 1;
+ item= PySequence_GetItem(seq, i);
+
+ if (!PySequence_Check(item)) {
+ BLI_snprintf(error_str, error_str_size, "expected a %d-dimensional sequence of %s", (int)totdim, item_type_str);
+ ok= 0;
+ }
+ else if (PySequence_Length(item) != dim_size[dim - 1]) {
+ BLI_snprintf(error_str, error_str_size, "dimension %d should contain %d items", (int)dim, (int)dim_size[dim - 1]);
+ ok= 0;
+ }
+
+ if (!pyrna_validate_array(item, dim + 1, totdim, dim_size, check_item_type, item_type_str, error_str, error_str_size)) {
+ ok= 0;
+ }
+
+ Py_DECREF(item);
+
+ if (!ok)
+ return 0;
+ }
+ }
+ else {
+ for (i= 0; i < PySequence_Length(seq); i++) {
+ PyObject *item= PySequence_GetItem(seq, i);
+
+ if (!check_item_type(item)) {
+ Py_DECREF(item);
+
+ BLI_snprintf(error_str, error_str_size, "sequence items should be of type %s", item_type_str);
+ return 0;
+ }
+
+ Py_DECREF(item);
+ }
+ }
+
+ return 1;
+}
+
+/* Returns the number of items in a single- or multi-dimensional sequence. */
+static int pyrna_count_items(PyObject *seq)
+{
+ int totitem= 0;
+
+ if (PySequence_Check(seq)) {
+ int i;
+ for (i= 0; i < PySequence_Length(seq); i++) {
+ PyObject *item= PySequence_GetItem(seq, i);
+ totitem += pyrna_count_items(item);
+ Py_DECREF(item);
+ }
+ }
+ else
+ totitem= 1;
+
+ return totitem;
+}
+
+static int pyrna_apply_array_length(PointerRNA *ptr, PropertyRNA *prop, int totitem, char *error_str, int error_str_size)
+{
+ if (RNA_property_flag(prop) & PROP_DYNAMIC) {
+ /* length can be flexible */
+ if (RNA_property_array_length(ptr, prop) != totitem) {
+ if (!RNA_property_dynamic_array_set_length(ptr, prop, totitem)) {
+ BLI_snprintf(error_str, error_str_size, "%s.%s: array length cannot be changed to %d", RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), totitem);
+ return 0;
+ }
+ }
+ }
+ else {
+ /* length is a constraint */
+ int len= RNA_property_array_length(ptr, prop);
+ if (totitem != len) {
+ BLI_snprintf(error_str, error_str_size, "sequence must have length of %d", len);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static char *pyrna_py_to_array(PyObject *seq, unsigned short dim, unsigned short totdim, char *data, unsigned int item_size, ItemConvertFunc convert_item)
+{
+ unsigned int i;
+ for (i= 0; i < PySequence_Length(seq); i++) {
+ PyObject *item= PySequence_GetItem(seq, i);
+
+ if (dim < totdim) {
+ data= pyrna_py_to_array(item, dim + 1, totdim, data, item_size, convert_item);
+ }
+ else {
+ convert_item(item, data);
+ data += item_size;
+ }
+
+ Py_DECREF(item);
+ }
+
+ return data;
+}
+
+static int pyrna_py_to_array_generic(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size,
+ ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array)
+{
+ unsigned short totdim, dim_size[100];
+ int totitem;
+ char *data= NULL;
+
+ totdim= RNA_property_array_dimension(prop, dim_size);
+
+ if (!pyrna_validate_array(py, 1, totdim, dim_size, check_item_type, item_type_str, error_str, error_str_size))
+ return 0;
+
+ totitem= pyrna_count_items(py);
+
+ if (!pyrna_apply_array_length(ptr, prop, totitem, error_str, error_str_size))
+ return 0;
+
+ if (totitem) {
+ if (!param_data || RNA_property_flag(prop) & PROP_DYNAMIC)
+ data= MEM_callocN(item_size * totitem, "pyrna primitive type array");
+ else
+ data= param_data;
+
+ pyrna_py_to_array(py, 1, totdim, data, item_size, convert_item);
+
+ if (param_data) {
+ if (RNA_property_flag(prop) & PROP_DYNAMIC) {
+ /* not freeing allocated mem, RNA_parameter_list_free will do this */
+ *(char**)param_data= data;
+ }
+ }
+ else {
+ /* NULL can only pass through in case RNA property arraylength is 0 (impossible?) */
+ rna_set_array(ptr, prop, data);
+ MEM_freeN(data);
+ }
+ }
+
+ return 1;
+}
+
+static void pyrna_py_to_float(PyObject *py, char *data)
+{
+ *(float*)data= (float)PyFloat_AsDouble(py);
+}
+
+static void pyrna_py_to_int(PyObject *py, char *data)
+{
+ *(int*)data= (int)PyLong_AsSsize_t(py);
+}
+
+static void pyrna_py_to_boolean(PyObject *py, char *data)
+{
+ *(int*)data= (int)PyObject_IsTrue(py);
+}
+
+static int py_float_check(PyObject *py)
+{
+ return PyFloat_Check(py) || (PyIndex_Check(py));
+}
+
+static int py_int_check(PyObject *py)
+{
+ return PyLong_Check(py) || (PyIndex_Check(py));
+}
+
+static int py_bool_check(PyObject *py)
+{
+ return PyBool_Check(py) || (PyIndex_Check(py));
+}
+
+int pyrna_py_to_float_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size)
+{
+ return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size,
+ py_float_check, "float", sizeof(float), pyrna_py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array);
+}
+
+int pyrna_py_to_int_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size)
+{
+ return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size,
+ py_int_check, "int", sizeof(int), pyrna_py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array);
+}
+
+int pyrna_py_to_boolean_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size)
+{
+ return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size,
+ py_bool_check, "boolean", sizeof(int), pyrna_py_to_boolean, (RNA_SetArrayFunc)RNA_property_boolean_set_array);
+}
diff --git a/source/blender/python/intern/bpy_compat.h b/source/blender/python/intern/bpy_compat.h
deleted file mode 100644
index e999f57c733..00000000000
--- a/source/blender/python/intern/bpy_compat.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* This file is only to contain definitions to functions that enable
- * the python api to compile with different python versions.
- * no utility functions please
- */
-
-#ifndef BPY_COMPAT_H__
-#define BPY_COMPAT_H__
-
-/* if you are NOT using python 3.0 - define these */
-#if PY_VERSION_HEX < 0x03000000
-#define _PyUnicode_AsString PyString_AsString
-
-#undef PyUnicode_Check
-#define PyUnicode_Check PyString_Check
-
-#define PyLong_FromSsize_t PyInt_FromLong
-#define PyLong_AsSsize_t PyInt_AsLong
-
-#undef PyLong_Check
-#define PyLong_Check PyInt_Check
-
-
-#ifdef PyUnicode_FromString
-#undef PyUnicode_FromString
-#endif
-#define PyUnicode_FromString PyString_FromString
-
-#ifdef PyUnicode_FromFormat
-#undef PyUnicode_FromFormat
-#endif
-#define PyUnicode_FromFormat PyString_FromFormat
-
-#endif
-
-#ifndef Py_REFCNT
-#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-#endif
-
-#ifndef Py_TYPE
-#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
-#endif
-
-#ifndef Py_TYPE
-#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
-#endif
-
-/* older then python 2.6 - define these */
-// #if (PY_VERSION_HEX < 0x02060000)
-// #endif
-
-/* older then python 2.5 - define these */
-#if (PY_VERSION_HEX < 0x02050000)
-#define Py_ssize_t ssize_t
-typedef Py_ssize_t (*lenfunc)(PyObject *);
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE return Py_BuildValue("O", Py_None)
-#endif
-#ifndef Py_RETURN_FALSE
-#define Py_RETURN_FALSE return PyBool_FromLong(0)
-#endif
-#ifndef Py_RETURN_TRUE
-#define Py_RETURN_TRUE return PyBool_FromLong(1)
-#endif
-
-#define PyInt_FromSsize_t PyInt_FromLong
-#define PyNumber_AsSsize_t(ob, exc) PyInt_AsLong(ob)
-#define PyIndex_Check(ob) PyInt_Check(ob)
-
-
-#endif
-
-
-#if PY_VERSION_HEX < 0x03000000
-#ifndef ssizeargfunc
-#define ssizeargfunc intargfunc
-#endif
-
-#ifndef ssizessizeargfunc
-#define ssizessizeargfunc intintargfunc
-#endif
-
-#ifndef ssizeobjargproc
-#define ssizeobjargproc intobjargproc
-#endif
-
-#ifndef ssizessizeobjargproc
-#define ssizessizeobjargproc intintobjargproc
-#endif
-#endif
-
-
-
-/* defined in bpy_util.c */
-#if PY_VERSION_HEX < 0x03000000
-PyObject *Py_CmpToRich(int op, int cmp);
-#endif
-
-#ifndef Py_CmpToRich
-PyObject *Py_CmpToRich(int op, int cmp); /* bpy_util.c */
-#endif
-
-#endif /* BPY_COMPAT_H__ */
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 707c5769357..a935b517f77 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -1,4 +1,28 @@
-
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Michel Selten, Willian P. Germano, Stephen Swaney,
+ * Chris Keith, Chris Want, Ken Hughes, Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -10,12 +34,15 @@
#include "BLI_winstuff.h"
#endif
+/* grr, python redefines */
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
#include <Python.h>
#include "compile.h" /* for the PyCodeObject */
#include "eval.h" /* for PyEval_EvalCode */
-#include "bpy_compat.h"
-
#include "bpy_rna.h"
#include "bpy_operator.h"
#include "bpy_ui.h"
@@ -28,6 +55,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_util.h"
+#include "BLI_storage.h"
#include "BLI_fileops.h"
#include "BLI_string.h"
@@ -45,6 +73,80 @@
#include "../generic/BGL.h"
+/* for internal use, when starting and ending python scripts */
+
+/* incase a python script triggers another python call, stop bpy_context_clear from invalidating */
+static int py_call_level= 0;
+
+
+// only for tests
+#define TIME_PY_RUN
+
+#ifdef TIME_PY_RUN
+#include "PIL_time.h"
+static int bpy_timer_count = 0;
+static double bpy_timer; /* time since python starts */
+static double bpy_timer_run; /* time for each python script run */
+static double bpy_timer_run_tot; /* accumulate python runs */
+#endif
+
+void bpy_context_set(bContext *C, PyGILState_STATE *gilstate)
+{
+ py_call_level++;
+
+ if(gilstate)
+ *gilstate = PyGILState_Ensure();
+
+ if(py_call_level==1) {
+
+ BPY_update_modules(); /* can give really bad results if this isnt here */
+
+ if(C) { // XXX - should always be true.
+ BPy_SetContext(C);
+ bpy_import_main_set(CTX_data_main(C));
+ }
+ else {
+ fprintf(stderr, "ERROR: Python context called with a NULL Context. this should not happen!\n");
+ }
+
+#ifdef TIME_PY_RUN
+ if(bpy_timer_count==0) {
+ /* record time from the beginning */
+ bpy_timer= PIL_check_seconds_timer();
+ bpy_timer_run = bpy_timer_run_tot = 0.0;
+ }
+ bpy_timer_run= PIL_check_seconds_timer();
+
+
+ bpy_timer_count++;
+#endif
+ }
+}
+
+void bpy_context_clear(bContext *C, PyGILState_STATE *gilstate)
+{
+ py_call_level--;
+
+ if(gilstate)
+ PyGILState_Release(*gilstate);
+
+ if(py_call_level < 0) {
+ fprintf(stderr, "ERROR: Python context internal state bug. this should not happen!\n");
+ }
+ else if(py_call_level==0) {
+ // XXX - Calling classes currently wont store the context :\, cant set NULL because of this. but this is very flakey still.
+ //BPy_SetContext(NULL);
+ //bpy_import_main_set(NULL);
+
+#ifdef TIME_PY_RUN
+ bpy_timer_run_tot += PIL_check_seconds_timer() - bpy_timer_run;
+ bpy_timer_count++;
+#endif
+
+ }
+}
+
+
void BPY_free_compiled_text( struct Text *text )
{
if( text->compiled ) {
@@ -75,23 +177,22 @@ static void bpy_init_modules( void )
/* stand alone utility modules not related to blender directly */
- Geometry_Init("Geometry");
- Mathutils_Init("Mathutils");
- BGL_Init("BGL");
-}
-
-#if (PY_VERSION_HEX < 0x02050000)
-PyObject *PyImport_ImportModuleLevel(char *name, void *a, void *b, void *c, int d)
-{
- return PyImport_ImportModule(name);
+ Geometry_Init();
+ Mathutils_Init();
+ BGL_Init();
}
-#endif
void BPY_update_modules( void )
{
+#if 0 // slow, this runs all the time poll, draw etc 100's of time a sec.
PyObject *mod= PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0);
PyModule_AddObject( mod, "data", BPY_rna_module() );
- PyModule_AddObject( mod, "types", BPY_rna_types() );
+ PyModule_AddObject( mod, "types", BPY_rna_types() ); // atm this does not need updating
+#endif
+
+ /* refreshes the main struct */
+ BPY_update_rna_module();
+
}
/*****************************************************************************
@@ -106,9 +207,6 @@ static PyObject *CreateGlobalDictionary( bContext *C )
PyDict_SetItemString( dict, "__name__", item );
Py_DECREF(item);
- // XXX - evil, need to access context
- BPy_SetContext(C);
-
// XXX - put somewhere more logical
{
PyMethodDef *ml;
@@ -173,9 +271,7 @@ void BPY_start_python( int argc, char **argv )
Py_Initialize( );
-#if (PY_VERSION_HEX < 0x03000000)
- PySys_SetArgv( argc, argv);
-#else
+ // PySys_SetArgv( argc, argv); // broken in py3, not a huge deal
/* sigh, why do python guys not have a char** version anymore? :( */
{
int i;
@@ -187,7 +283,6 @@ void BPY_start_python( int argc, char **argv )
PySys_SetObject("argv", py_argv);
Py_DECREF(py_argv);
}
-#endif
/* Initialize thread support (also acquires lock) */
PyEval_InitThreads();
@@ -205,38 +300,57 @@ void BPY_start_python( int argc, char **argv )
PyDict_SetItemString(d, "__import__", item=PyCFunction_New(bpy_import_meth, NULL)); Py_DECREF(item);
}
+ pyrna_alloc_types();
+
py_tstate = PyGILState_GetThisThreadState();
PyEval_ReleaseThread(py_tstate);
}
void BPY_end_python( void )
{
+ // fprintf(stderr, "Ending Python!\n");
+
PyGILState_Ensure(); /* finalizing, no need to grab the state */
// free other python data.
- //BPY_rna_free_types();
+ pyrna_free_types();
+
+ /* clear all python data from structs */
Py_Finalize( );
- return;
+#ifdef TIME_PY_RUN
+ // measure time since py started
+ bpy_timer = PIL_check_seconds_timer() - bpy_timer;
+
+ printf("*bpy stats* - ");
+ printf("tot exec: %d, ", bpy_timer_count);
+ printf("tot run: %.4fsec, ", bpy_timer_run_tot);
+ if(bpy_timer_count>0)
+ printf("average run: %.6fsec, ", (bpy_timer_run_tot/bpy_timer_count));
+
+ if(bpy_timer>0.0)
+ printf("tot usage %.4f%%", (bpy_timer_run_tot/bpy_timer)*100.0);
+
+ printf("\n");
+
+ // fprintf(stderr, "Ending Python Done!\n");
+
+#endif
+
}
/* Can run a file or text block */
int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struct ReportList *reports)
{
- PyObject *py_dict, *py_result;
+ PyObject *py_dict, *py_result= NULL;
PyGILState_STATE gilstate;
if (fn==NULL && text==NULL) {
return 0;
}
- //BPY_start_python();
-
- gilstate = PyGILState_Ensure();
-
- BPY_update_modules(); /* can give really bad results if this isnt here */
- bpy_import_main_set(CTX_data_main(C));
+ bpy_context_set(C, &gilstate);
py_dict = CreateGlobalDictionary(C);
@@ -251,13 +365,11 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
MEM_freeN( buf );
if( PyErr_Occurred( ) ) {
- BPy_errors_to_report(reports);
BPY_free_compiled_text( text );
- PyGILState_Release(gilstate);
- return 0;
}
}
- py_result = PyEval_EvalCode( text->compiled, py_dict, py_dict );
+ if(text->compiled)
+ py_result = PyEval_EvalCode( text->compiled, py_dict, py_dict );
} else {
#if 0
@@ -287,10 +399,9 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
}
Py_DECREF(py_dict);
- PyGILState_Release(gilstate);
- bpy_import_main_set(NULL);
- //BPY_end_python();
+ bpy_context_clear(C, &gilstate);
+
return py_result ? 1:0;
}
@@ -473,12 +584,7 @@ void BPY_run_ui_scripts(bContext *C, int reload)
PyGILState_STATE gilstate;
PyObject *sys_path;
- gilstate = PyGILState_Ensure();
-
- // XXX - evil, need to access context
- BPy_SetContext(C);
- bpy_import_main_set(CTX_data_main(C));
-
+ bpy_context_set(C, &gilstate);
sys_path= PySys_GetObject("path"); /* borrow */
PyList_Insert(sys_path, 0, Py_None); /* place holder, resizes the list */
@@ -513,7 +619,7 @@ void BPY_run_ui_scripts(bContext *C, int reload)
}
}
#ifndef __linux__
- else if( BLI_join_dirfile(path, dirname, de->d_name), S_ISDIR(BLI_exists(path))) {
+ else if( BLI_join_dirfile(path, dirname, de->d_name), S_ISDIR(BLI_exist(path))) {
#else
else if(de->d_type==DT_DIR) {
BLI_join_dirfile(path, dirname, de->d_name);
@@ -537,12 +643,14 @@ void BPY_run_ui_scripts(bContext *C, int reload)
PyList_SetSlice(sys_path, 0, 1, NULL); /* remove the first item */
- bpy_import_main_set(NULL);
+ bpy_context_clear(C, &gilstate);
- PyGILState_Release(gilstate);
#ifdef TIME_REGISTRATION
printf("script time %f\n", (PIL_check_seconds_timer()-time));
#endif
+
+ /* reset the timer so as not to take loading into the stats */
+ bpy_timer_count = 0;
}
/* ****************************************** */
@@ -740,3 +848,56 @@ float BPY_pydriver_eval (ChannelDriver *driver)
return result;
}
+
+int BPY_button_eval(bContext *C, char *expr, double *value)
+{
+ PyGILState_STATE gilstate;
+ PyObject *dict, *retval;
+ int error_ret = 0;
+
+ if (!value || !expr || expr[0]=='\0') return -1;
+
+ bpy_context_set(C, &gilstate);
+
+ dict= CreateGlobalDictionary(C);
+ retval = PyRun_String(expr, Py_eval_input, dict, dict);
+
+ if (retval == NULL) {
+ error_ret= -1;
+ }
+ else {
+ double val;
+
+ if(PyTuple_Check(retval)) {
+ /* Users my have typed in 10km, 2m
+ * add up all values */
+ int i;
+ val= 0.0;
+
+ for(i=0; i<PyTuple_GET_SIZE(retval); i++) {
+ val+= PyFloat_AsDouble(PyTuple_GET_ITEM(retval, i));
+ }
+ }
+ else {
+ val = PyFloat_AsDouble(retval);
+ }
+ Py_DECREF(retval);
+
+ if(val==-1 && PyErr_Occurred()) {
+ error_ret= -1;
+ }
+ else {
+ *value= val;
+ }
+ }
+
+ if(error_ret) {
+ BPy_errors_to_report(CTX_wm_reports(C));
+ }
+
+ Py_DECREF(dict);
+ bpy_context_clear(C, &gilstate);
+
+ return error_ret;
+}
+
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 034440d77ac..062db42e0e9 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -30,7 +30,6 @@
#include "bpy_operator.h"
#include "bpy_operator_wrap.h"
#include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
-#include "bpy_compat.h"
#include "bpy_util.h"
#include "WM_api.h"
@@ -41,42 +40,23 @@
#include "BKE_utildefines.h"
-/* 'self' stores the operator string */
static PyObject *pyop_call( PyObject * self, PyObject * args)
{
wmOperatorType *ot;
int error_val = 0;
PointerRNA ptr;
- char *opname;
- PyObject *kw= NULL;
+ char *opname;
+ PyObject *kw= NULL; /* optional args */
+
+ /* note that context is an int, python does the conversion in this case */
+ int context= WM_OP_EXEC_DEFAULT;
// XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it...
bContext *C = BPy_GetContext();
-
- switch(PyTuple_Size(args)) {
- case 2:
- kw = PyTuple_GET_ITEM(args, 1);
-
- if(!PyDict_Check(kw)) {
- PyErr_SetString( PyExc_AttributeError, "bpy.__ops__.call: expected second arg to be a dict");
- return NULL;
- }
- /* pass through */
- case 1:
- opname = _PyUnicode_AsString(PyTuple_GET_ITEM(args, 0));
-
- if(opname==NULL) {
- PyErr_SetString( PyExc_AttributeError, "bpy.__ops__.call: expected the first arg to be a string");
- return NULL;
- }
- break;
- default:
- PyErr_SetString( PyExc_AttributeError, "bpy.__ops__.call: expected a string and optional dict");
+ if (!PyArg_ParseTuple(args, "s|O!i:bpy.__ops__.call", &opname, &PyDict_Type, &kw, &context))
return NULL;
- }
-
ot= WM_operatortype_find(opname, TRUE);
@@ -89,7 +69,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args)
PyErr_SetString( PyExc_SystemError, "bpy.__ops__.call: operator poll() function failed, context is incorrect");
return NULL;
}
-
+
/* WM_operator_properties_create(&ptr, opname); */
/* Save another lookup */
RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
@@ -103,7 +83,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args)
BKE_reports_init(&reports, RPT_STORE);
- WM_operator_call_py(C, ot, &ptr, &reports);
+ WM_operator_call_py(C, ot, context, &ptr, &reports);
if(BPy_reports_to_error(&reports))
error_val = -1;
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 080d2e8ce6a..0a487a8dbe8 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -37,7 +37,6 @@
#include "RNA_define.h"
#include "bpy_rna.h"
-#include "bpy_compat.h"
#include "bpy_util.h"
#include "../generic/bpy_internal_import.h" // our own imports
@@ -93,11 +92,9 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve
PointerRNA ptr_event;
PyObject *py_operator;
- PyGILState_STATE gilstate = PyGILState_Ensure();
+ PyGILState_STATE gilstate;
- bpy_import_main_set(CTX_data_main(C));
-
- BPY_update_modules(); // XXX - the RNA pointers can change so update before running, would like a nicer solutuon for this.
+ bpy_context_set(C, &gilstate);
args = PyTuple_New(1);
PyTuple_SET_ITEM(args, 0, PyObject_GetAttrString(py_class, "__rna__")); // need to use an rna instance as the first arg
@@ -221,8 +218,7 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve
}
#endif
- PyGILState_Release(gilstate);
- bpy_import_main_set(NULL);
+ bpy_context_clear(C, &gilstate);
return ret_flag;
}
@@ -232,7 +228,7 @@ static int PYTHON_OT_invoke(bContext *C, wmOperator *op, wmEvent *event)
return PYTHON_OT_generic(PYOP_INVOKE, C, op, event);
}
-static int PYTHON_OT_exec(bContext *C, wmOperator *op)
+static int PYTHON_OT_execute(bContext *C, wmOperator *op)
{
return PYTHON_OT_generic(PYOP_EXEC, C, op, NULL);
}
@@ -272,7 +268,7 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata)
if (PyObject_HasAttrString(py_class, "invoke"))
ot->invoke= PYTHON_OT_invoke;
if (PyObject_HasAttrString(py_class, "execute"))
- ot->exec= PYTHON_OT_exec;
+ ot->exec= PYTHON_OT_execute;
if (PyObject_HasAttrString(py_class, "poll"))
ot->poll= PYTHON_OT_poll;
@@ -299,7 +295,7 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata)
PyObject *py_func_ptr, *py_kw, *py_srna_cobject, *py_ret;
item = PyList_GET_ITEM(props, i);
- if (PyArg_ParseTuple(item, "O!O!", &PyCObject_Type, &py_func_ptr, &PyDict_Type, &py_kw)) {
+ if (PyArg_ParseTuple(item, "O!O!:PYTHON_OT_wrapper", &PyCObject_Type, &py_func_ptr, &PyDict_Type, &py_kw)) {
PyObject *(*pyfunc)(PyObject *, PyObject *, PyObject *);
pyfunc = PyCObject_AsVoidPtr(py_func_ptr);
@@ -309,6 +305,8 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata)
if (py_ret) {
Py_DECREF(py_ret);
} else {
+ fprintf(stderr, "BPy Operator \"%s\" registration error: %s item %d could not run\n", ot->idname, PYOP_ATTR_PROP, i);
+ PyLineSpit();
PyErr_Print();
PyErr_Clear();
}
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 27bfb89b963..8ba3b5f8732 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -23,7 +23,6 @@
*/
#include "bpy_rna.h"
-#include "bpy_compat.h"
#include "bpy_util.h"
//#include "blendef.h"
#include "BLI_dynstr.h"
@@ -133,6 +132,8 @@ Mathutils_Callback mathutils_rna_matrix_cb = {
#endif
+static StructRNA *pyrna_struct_as_srna(PyObject *self);
+
static int pyrna_struct_compare( BPy_StructRNA * a, BPy_StructRNA * b )
{
return (a->ptr.data==b->ptr.data) ? 0 : -1;
@@ -143,25 +144,64 @@ static int pyrna_prop_compare( BPy_PropertyRNA * a, BPy_PropertyRNA * b )
return (a->prop==b->prop && a->ptr.data==b->ptr.data ) ? 0 : -1;
}
-/* For some reason python3 needs these :/ */
-static PyObject *pyrna_struct_richcmp(BPy_StructRNA * a, BPy_StructRNA * b, int op)
+static PyObject *pyrna_struct_richcmp(PyObject *a, PyObject *b, int op)
{
- int cmp_result= -1; /* assume false */
- if (BPy_StructRNA_Check(a) && BPy_StructRNA_Check(b)) {
- cmp_result= pyrna_struct_compare(a, b);
+ PyObject *res;
+ int ok= -1; /* zero is true */
+
+ if (BPy_StructRNA_Check(a) && BPy_StructRNA_Check(b))
+ ok= pyrna_struct_compare((BPy_StructRNA *)a, (BPy_StructRNA *)b);
+
+ switch (op) {
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
+
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
- return Py_CmpToRich(op, cmp_result);
+ Py_INCREF(res);
+ return res;
}
-static PyObject *pyrna_prop_richcmp(BPy_PropertyRNA * a, BPy_PropertyRNA * b, int op)
+static PyObject *pyrna_prop_richcmp(PyObject *a, PyObject *b, int op)
{
- int cmp_result= -1; /* assume false */
- if (BPy_PropertyRNA_Check(a) && BPy_PropertyRNA_Check(b)) {
- cmp_result= pyrna_prop_compare(a, b);
+ PyObject *res;
+ int ok= -1; /* zero is true */
+
+ if (BPy_PropertyRNA_Check(a) && BPy_PropertyRNA_Check(b))
+ ok= pyrna_prop_compare((BPy_PropertyRNA *)a, (BPy_PropertyRNA *)b);
+
+ switch (op) {
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
+
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
}
- return Py_CmpToRich(op, cmp_result);
+ Py_INCREF(res);
+ return res;
}
/*----------------------repr--------------------------------------------*/
@@ -245,7 +285,7 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
{
PyObject *ret;
int type = RNA_property_type(prop);
- int len = RNA_property_array_length(prop);
+ int len = RNA_property_array_length(ptr, prop);
if (len > 0) {
/* resolve the array from a new pytype */
@@ -256,7 +296,11 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
/* return a mathutils vector where possible */
if(RNA_property_type(prop)==PROP_FLOAT) {
switch(RNA_property_subtype(prop)) {
- case PROP_VECTOR:
+ case PROP_TRANSLATION:
+ case PROP_DIRECTION:
+ case PROP_VELOCITY:
+ case PROP_ACCELERATION:
+ case PROP_XYZ:
if(len>=2 && len <= 4) {
PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_array_cb_index, FALSE);
Py_DECREF(ret); /* the vector owns now */
@@ -275,7 +319,8 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
ret= mat_cb; /* return the matrix instead */
}
break;
- case PROP_ROTATION:
+ case PROP_EULER:
+ case PROP_QUATERNION:
if(len==3) { /* euler */
PyObject *eul_cb= newEulerObject_cb(ret, mathutils_rna_array_cb_index, FALSE);
Py_DECREF(ret); /* the matrix owns now */
@@ -463,128 +508,43 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v
{
/* XXX hard limits should be checked here */
int type = RNA_property_type(prop);
- int len = RNA_property_array_length(prop);
+ int len = RNA_property_array_length(ptr, prop);
if (len > 0) {
- PyObject *item;
- int py_len = -1;
- int i;
-
+ char error_str[512];
+ int ok= 1;
#ifdef USE_MATHUTILS
if(MatrixObject_Check(value)) {
MatrixObject *mat = (MatrixObject*)value;
if(!BaseMath_ReadCallback(mat))
return -1;
-
- py_len = mat->rowSize * mat->colSize;
} else /* continue... */
#endif
- if (PySequence_Check(value)) {
- py_len= (int)PySequence_Length(value);
- }
- else {
+ if (!PySequence_Check(value)) {
PyErr_Format(PyExc_TypeError, "%.200s RNA array assignment expected a sequence instead of %.200s instance.", error_prefix, Py_TYPE(value)->tp_name);
return -1;
}
/* done getting the length */
- if (py_len != len) {
- PyErr_Format(PyExc_TypeError, "%.200s python sequence length %d did not match the RNA array length %d.", error_prefix, py_len, len);
- return -1;
- }
-
/* for arrays we have a limited number of types */
switch (type) {
case PROP_BOOLEAN:
- {
- int *param_arr;
- if(data) param_arr= (int*)data;
- else param_arr= MEM_mallocN(sizeof(int) * len, "pyrna bool array");
-
-
- /* collect the variables before assigning, incase one of them is incorrect */
- for (i=0; i<len; i++) {
- item = PySequence_GetItem(value, i);
- param_arr[i] = PyObject_IsTrue( item );
- Py_DECREF(item);
-
- if (param_arr[i] < 0) {
- if(data==NULL)
- MEM_freeN(param_arr);
- PyErr_Format(PyExc_AttributeError, "%.200s one or more of the values in the sequence is not a boolean", error_prefix);
- return -1;
- }
- }
- if(data==NULL) {
- RNA_property_boolean_set_array(ptr, prop, param_arr);
- MEM_freeN(param_arr);
- }
-
+ ok= pyrna_py_to_boolean_array(value, ptr, prop, data, error_str, sizeof(error_str));
break;
- }
case PROP_INT:
- {
- int *param_arr;
- if(data) param_arr= (int*)data;
- else param_arr= MEM_mallocN(sizeof(int) * len, "pyrna int array");
-
-
- /* collect the variables */
- for (i=0; i<len; i++) {
- item = PySequence_GetItem(value, i);
- param_arr[i] = (int)PyLong_AsSsize_t(item); /* deal with any errors later */
- Py_DECREF(item);
- }
-
- if (PyErr_Occurred()) {
- if(data==NULL)
- MEM_freeN(param_arr);
- PyErr_Format(PyExc_AttributeError, "%.200s one or more of the values in the sequence could not be used as an int", error_prefix);
- return -1;
- }
- if(data==NULL) {
- RNA_property_int_set_array(ptr, prop, param_arr);
- MEM_freeN(param_arr);
- }
+ ok= pyrna_py_to_int_array(value, ptr, prop, data, error_str, sizeof(error_str));
break;
- }
case PROP_FLOAT:
- {
- float *param_arr;
- if(data) param_arr = (float*)data;
- else param_arr = MEM_mallocN(sizeof(float) * len, "pyrna float array");
-
-
-#ifdef USE_MATHUTILS
- if(MatrixObject_Check(value) && RNA_property_subtype(prop) == PROP_MATRIX) {
- MatrixObject *mat = (MatrixObject*)value;
- memcpy(param_arr, mat->contigPtr, sizeof(float) * len);
- } else /* continue... */
-#endif
- {
- /* collect the variables */
- for (i=0; i<len; i++) {
- item = PySequence_GetItem(value, i);
- param_arr[i] = (float)PyFloat_AsDouble(item); /* deal with any errors later */
- Py_DECREF(item);
- }
- }
-
- if (PyErr_Occurred()) {
- if(data==NULL)
- MEM_freeN(param_arr);
- PyErr_Format(PyExc_AttributeError, "%.200s one or more of the values in the sequence could not be used as a float", error_prefix);
- return -1;
- }
- if(data==NULL) {
- RNA_property_float_set_array(ptr, prop, param_arr);
- MEM_freeN(param_arr);
- }
+ ok= pyrna_py_to_float_array(value, ptr, prop, data, error_str, sizeof(error_str));
break;
}
+ if (!ok) {
+ PyErr_Format(PyExc_AttributeError, "%.200s %s", error_prefix, error_str);
+ return -1;
}
- } else {
+ }
+ else {
/* Normal Property (not an array) */
/* see if we can coorce into a python type - PropertyType */
@@ -856,7 +816,7 @@ static Py_ssize_t pyrna_prop_len( BPy_PropertyRNA * self )
if (RNA_property_type(self->prop) == PROP_COLLECTION) {
len = RNA_property_collection_length(&self->ptr, self->prop);
} else {
- len = RNA_property_array_length(self->prop);
+ len = RNA_property_array_length(&self->ptr, self->prop);
if (len==0) { /* not an array*/
PyErr_SetString(PyExc_AttributeError, "len() only available for collection RNA types");
@@ -882,7 +842,7 @@ static PyObject *prop_subscript_collection_int(BPy_PropertyRNA * self, int keynu
}
static PyObject *prop_subscript_array_int(BPy_PropertyRNA * self, int keynum)
{
- int len= RNA_property_array_length(self->prop);
+ int len= RNA_property_array_length(&self->ptr, self->prop);
if(keynum < 0) keynum += len;
@@ -904,10 +864,6 @@ static PyObject *prop_subscript_collection_str(BPy_PropertyRNA * self, char *key
}
/* static PyObject *prop_subscript_array_str(BPy_PropertyRNA * self, char *keyname) */
-
-
-
-#if PY_VERSION_HEX >= 0x03000000
static PyObject *prop_subscript_collection_slice(BPy_PropertyRNA * self, int start, int stop)
{
PointerRNA newptr;
@@ -942,7 +898,6 @@ static PyObject *prop_subscript_array_slice(BPy_PropertyRNA * self, int start, i
return list;
}
-#endif
static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key)
{
@@ -956,7 +911,6 @@ static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key
return prop_subscript_collection_int(self, i);
}
-#if PY_VERSION_HEX >= 0x03000000
else if (PySlice_Check(key)) {
int len= RNA_property_collection_length(&self->ptr, self->prop);
Py_ssize_t start, stop, step, slicelength;
@@ -975,7 +929,6 @@ static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key
return NULL;
}
}
-#endif
else {
PyErr_Format(PyExc_TypeError, "invalid rna key, key must be a string or an int instead of %.200s instance.", Py_TYPE(key)->tp_name);
return NULL;
@@ -993,9 +946,8 @@ static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key)
return NULL;
return prop_subscript_array_int(self, PyLong_AsSsize_t(key));
}
-#if PY_VERSION_HEX >= 0x03000000
else if (PySlice_Check(key)) {
- int len= RNA_property_array_length(self->prop);
+ int len= RNA_property_array_length(&self->ptr, self->prop);
Py_ssize_t start, stop, step, slicelength;
if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0)
@@ -1012,7 +964,6 @@ static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key)
return NULL;
}
}
-#endif
else {
PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int");
return NULL;
@@ -1023,7 +974,7 @@ static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key )
{
if (RNA_property_type(self->prop) == PROP_COLLECTION) {
return prop_subscript_collection(self, key);
- } else if (RNA_property_array_length(self->prop)) { /* arrays are currently fixed length, zero length means its not an array */
+ } else if (RNA_property_array_length(&self->ptr, self->prop)) { /* arrays are currently fixed length, zero length means its not an array */
return prop_subscript_array(self, key);
} else {
PyErr_SetString(PyExc_TypeError, "rna type is not an array or a collection");
@@ -1032,7 +983,6 @@ static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key )
}
-#if PY_VERSION_HEX >= 0x03000000
static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int end, PyObject *value)
{
int count;
@@ -1049,12 +999,11 @@ static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int
return 0;
}
-#endif
static int prop_subscript_ass_array_int(BPy_PropertyRNA * self, int keynum, PyObject *value)
{
- int len= RNA_property_array_length(self->prop);
+ int len= RNA_property_array_length(&self->ptr, self->prop);
if(keynum < 0) keynum += len;
@@ -1087,9 +1036,8 @@ static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyOb
return prop_subscript_ass_array_int(self, i, value);
}
-#if PY_VERSION_HEX >= 0x03000000
else if (PySlice_Check(key)) {
- int len= RNA_property_array_length(self->prop);
+ int len= RNA_property_array_length(&self->ptr, self->prop);
Py_ssize_t start, stop, step, slicelength;
if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0)
@@ -1106,7 +1054,6 @@ static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyOb
return -1;
}
}
-#endif
else {
PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int");
return -1;
@@ -1458,7 +1405,39 @@ static PyObject *pyrna_prop_get(BPy_PropertyRNA *self, PyObject *args)
}
-#if (PY_VERSION_HEX >= 0x03000000) /* foreach needs py3 */
+static PyObject *pyrna_prop_add(BPy_PropertyRNA *self, PyObject *args)
+{
+ PointerRNA newptr;
+
+ RNA_property_collection_add(&self->ptr, self->prop, &newptr);
+ if(!newptr.data) {
+ PyErr_SetString( PyExc_TypeError, "add() not supported for this collection");
+ return NULL;
+ }
+ else {
+ return pyrna_struct_CreatePyObject(&newptr);
+ }
+}
+
+static PyObject *pyrna_prop_remove(BPy_PropertyRNA *self, PyObject *args)
+{
+ PyObject *ret;
+ int key= 0;
+
+ if (!PyArg_ParseTuple(args, "i:remove", &key))
+ return NULL;
+
+ if(!RNA_property_collection_remove(&self->ptr, self->prop, key)) {
+ PyErr_SetString( PyExc_TypeError, "remove() not supported for this collection");
+ return NULL;
+ }
+
+ ret = Py_None;
+ Py_INCREF(ret);
+
+ return ret;
+}
+
static void foreach_attr_type( BPy_PropertyRNA *self, char *attr,
/* values to assign */
RawPropertyType *raw_type, int *attr_tot, int *attr_signed )
@@ -1471,7 +1450,7 @@ static void foreach_attr_type( BPy_PropertyRNA *self, char *attr,
RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) {
prop = RNA_struct_find_property(&itemptr, attr);
*raw_type= RNA_property_raw_type(prop);
- *attr_tot = RNA_property_array_length(prop);
+ *attr_tot = RNA_property_array_length(&itemptr, prop);
*attr_signed= (RNA_property_subtype(prop)==PROP_UNSIGNED) ? FALSE:TRUE;
break;
}
@@ -1510,7 +1489,7 @@ static int foreach_parse_args(
if (RNA_property_type(self->prop) == PROP_COLLECTION)
array_tot = RNA_property_collection_length(&self->ptr, self->prop);
else
- array_tot = RNA_property_array_length(self->prop);
+ array_tot = RNA_property_array_length(&self->ptr, self->prop);
target_tot= array_tot * (*attr_tot);
@@ -1693,7 +1672,6 @@ static PyObject *pyrna_prop_foreach_set(BPy_PropertyRNA *self, PyObject *args)
{
return foreach_getset(self, args, 1);
}
-#endif /* #if (PY_VERSION_HEX >= 0x03000000) */
/* A bit of a kludge, make a list out of a collection or array,
* then return the lists iter function, not especially fast but convenient for now */
@@ -1704,7 +1682,7 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self)
if (ret==NULL) {
/* collection did not work, try array */
- int len = RNA_property_array_length(self->prop);
+ int len = RNA_property_array_length(&self->ptr, self->prop);
if (len) {
int i;
@@ -1744,11 +1722,13 @@ static struct PyMethodDef pyrna_prop_methods[] = {
{"get", (PyCFunction)pyrna_prop_get, METH_VARARGS, NULL},
-#if (PY_VERSION_HEX >= 0x03000000)
+ {"add", (PyCFunction)pyrna_prop_add, METH_VARARGS, NULL},
+ {"remove", (PyCFunction)pyrna_prop_remove, METH_VARARGS, NULL},
+
/* array accessor function */
{"foreach_get", (PyCFunction)pyrna_prop_foreach_get, METH_VARARGS, NULL},
{"foreach_set", (PyCFunction)pyrna_prop_foreach_set, METH_VARARGS, NULL},
-#endif
+
{NULL, NULL, 0, NULL}
};
@@ -1793,7 +1773,7 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
{
PyObject *ret;
int type = RNA_property_type(prop);
- int len = RNA_property_array_length(prop);
+ int len = RNA_property_array_length(ptr, prop);
int a;
@@ -2112,13 +2092,7 @@ static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw)
/*-----------------------BPy_StructRNA method def------------------------------*/
PyTypeObject pyrna_struct_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"StructRNA", /* tp_name */
sizeof( BPy_StructRNA ), /* tp_basicsize */
0, /* tp_itemsize */
@@ -2197,14 +2171,7 @@ PyTypeObject pyrna_struct_Type = {
/*-----------------------BPy_PropertyRNA method def------------------------------*/
PyTypeObject pyrna_prop_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
-
"PropertyRNA", /* tp_name */
sizeof( BPy_PropertyRNA ), /* tp_basicsize */
0, /* tp_itemsize */
@@ -2287,7 +2254,7 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna)
PyObject *item;
Py_INCREF(newclass);
-
+
if (RNA_struct_py_type_get(srna))
PyObSpit("RNA WAS SET - ", RNA_struct_py_type_get(srna));
@@ -2297,18 +2264,47 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna)
/* Not 100% needed but useful,
* having an instance within a type looks wrong however this instance IS an rna type */
+
+ /* python deals with the curcular ref */
RNA_pointer_create(NULL, &RNA_Struct, srna, &ptr);
item = pyrna_struct_CreatePyObject(&ptr);
+
+ //item = PyCObject_FromVoidPtr(srna, NULL);
PyDict_SetItemString(((PyTypeObject *)newclass)->tp_dict, "__rna__", item);
Py_DECREF(item);
/* done with rna instance */
}
+/*
+static StructRNA *srna_from_self(PyObject *self);
+PyObject *BPy_GetStructRNA(PyObject *self)
+{
+ StructRNA *srna= pyrna_struct_as_srna(self);
+ PointerRNA ptr;
+ PyObject *ret;
+
+ RNA_pointer_create(NULL, &RNA_Struct, srna, &ptr);
+ ret= pyrna_struct_CreatePyObject(&ptr);
+
+ if(ret) {
+ return ret;
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+*/
+
static struct PyMethodDef pyrna_struct_subtype_methods[] = {
- {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""},
- {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""},
{"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""},
{"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"EnumProperty", (PyCFunction)BPy_EnumProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"PointerProperty", (PyCFunction)BPy_PointerProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"CollectionProperty", (PyCFunction)BPy_CollectionProperty, METH_VARARGS|METH_KEYWORDS, ""},
+
+// {"__get_rna", (PyCFunction)BPy_GetStructRNA, METH_NOARGS, ""},
{NULL, NULL, 0, NULL}
};
@@ -2343,18 +2339,26 @@ PyObject* pyrna_srna_Subtype(StructRNA *srna)
if(base && base != srna) {
/*/printf("debug subtype %s %p\n", RNA_struct_identifier(srna), srna); */
py_base= pyrna_srna_Subtype(base);
+ Py_DECREF(py_base); /* srna owns, this is only to pass as an arg */
}
if(py_base==NULL) {
py_base= (PyObject *)&pyrna_struct_Type;
- Py_INCREF(py_base);
}
- newclass = PyObject_CallFunction( (PyObject*)&PyType_Type, "s(N){ssss}", idname, py_base, "__module__","bpy.types", "__doc__",descr);
+ /* always use O not N when calling, N causes refcount errors */
+ newclass = PyObject_CallFunction( (PyObject*)&PyType_Type, "s(O){ssss}", idname, py_base, "__module__","bpy.types", "__doc__",descr);
+ /* newclass will now have 2 ref's, ???, probably 1 is internal since decrefing here segfaults */
+
+ /* PyObSpit("new class ref", newclass); */
if (newclass) {
+
+ /* srna owns one, and the other is owned by the caller */
pyrna_subtype_set_rna(newclass, srna);
- // PyObSpit("NewStructRNA Type: ", (PyObject *)newclass);
+
+ Py_DECREF(newclass); /* let srna own */
+
/* attach functions into the class
* so you can do... bpy.types.Scene.SomeFunction()
@@ -2377,9 +2381,21 @@ PyObject* pyrna_srna_Subtype(StructRNA *srna)
return newclass;
}
+/* use for subtyping so we know which srna is used for a PointerRNA */
+static StructRNA *srna_from_ptr(PointerRNA *ptr)
+{
+ if(ptr->type == &RNA_Struct) {
+ return ptr->data;
+ }
+ else {
+ return ptr->type;
+ }
+}
+
+/* always returns a new ref, be sure to decref when done */
PyObject* pyrna_struct_Subtype(PointerRNA *ptr)
{
- return pyrna_srna_Subtype((ptr->type == &RNA_Struct) ? ptr->data : ptr->type);
+ return pyrna_srna_Subtype(srna_from_ptr(ptr));
}
/*-----------------------CreatePyObject---------------------------------*/
@@ -2395,6 +2411,7 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr )
if (tp) {
pyrna = (BPy_StructRNA *) tp->tp_alloc(tp, 0);
+ Py_DECREF(tp); /* srna owns, cant hold a ref */
}
else {
fprintf(stderr, "Could not make type\n");
@@ -2432,8 +2449,11 @@ PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop )
return ( PyObject * ) pyrna;
}
+/* bpy.data from python */
+static PointerRNA *rna_module_ptr= NULL;
PyObject *BPY_rna_module( void )
{
+ BPy_StructRNA *pyrna;
PointerRNA ptr;
#ifdef USE_MATHUTILS // register mathutils callbacks, ok to run more then once.
@@ -2453,8 +2473,15 @@ PyObject *BPY_rna_module( void )
/* for now, return the base RNA type rather then a real module */
RNA_main_pointer_create(G.main, &ptr);
+ pyrna= (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr);
- return pyrna_struct_CreatePyObject(&ptr);
+ rna_module_ptr= &pyrna->ptr;
+ return (PyObject *)pyrna;
+}
+
+void BPY_update_rna_module(void)
+{
+ RNA_main_pointer_create(G.main, rna_module_ptr);
}
#if 0
@@ -2500,8 +2527,8 @@ static PyObject *pyrna_basetype_getattro( BPy_BaseTypeRNA * self, PyObject *pyna
static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self);
static struct PyMethodDef pyrna_basetype_methods[] = {
{"__dir__", (PyCFunction)pyrna_basetype_dir, METH_NOARGS, ""},
- {"register", (PyCFunction)pyrna_basetype_register, METH_VARARGS, ""},
- {"unregister", (PyCFunction)pyrna_basetype_unregister, METH_VARARGS, ""},
+ {"register", (PyCFunction)pyrna_basetype_register, METH_O, ""},
+ {"unregister", (PyCFunction)pyrna_basetype_unregister, METH_O, ""},
{NULL, NULL, 0, NULL}
};
@@ -2548,14 +2575,16 @@ PyObject *BPY_rna_types(void)
}
static struct PyMethodDef props_methods[] = {
- {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""},
- {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""},
{"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""},
{"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"EnumProperty", (PyCFunction)BPy_EnumProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"PointerProperty", (PyCFunction)BPy_PointerProperty, METH_VARARGS|METH_KEYWORDS, ""},
+ {"CollectionProperty", (PyCFunction)BPy_CollectionProperty, METH_VARARGS|METH_KEYWORDS, ""},
{NULL, NULL, 0, NULL}
};
-#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef props_module = {
PyModuleDef_HEAD_INIT,
"bpy.props",
@@ -2564,16 +2593,11 @@ static struct PyModuleDef props_module = {
props_methods,
NULL, NULL, NULL, NULL
};
-#endif
PyObject *BPY_rna_props( void )
{
PyObject *submodule;
-#if PY_VERSION_HEX >= 0x03000000
submodule= PyModule_Create(&props_module);
-#else /* Py2.x */
- submodule= Py_InitModule3( "bpy.props", props_methods, "" );
-#endif
/* INCREF since its its assumed that all these functions return the
* module with a new ref like PyDict_New, since they are passed to
@@ -2583,18 +2607,92 @@ PyObject *BPY_rna_props( void )
return submodule;
}
+static StructRNA *pyrna_struct_as_srna(PyObject *self)
+{
+ BPy_StructRNA *py_srna;
+ StructRNA *srna;
+
+ /* ack, PyObject_GetAttrString wont look up this types tp_dict first :/ */
+ if(PyType_Check(self)) {
+ py_srna = (BPy_StructRNA *)PyDict_GetItemString(((PyTypeObject *)self)->tp_dict, "__rna__");
+ Py_XINCREF(py_srna);
+ }
+
+ if(py_srna==NULL)
+ py_srna = (BPy_StructRNA*)PyObject_GetAttrString(self, "__rna__");
+
+ if(py_srna==NULL) {
+ PyErr_SetString(PyExc_SystemError, "internal error, self had no __rna__ attribute, should never happen.");
+ return NULL;
+ }
+
+ if(!BPy_StructRNA_Check(py_srna)) {
+ PyErr_Format(PyExc_SystemError, "internal error, __rna__ was of type %.200s, instead of %.200s instance.", Py_TYPE(py_srna)->tp_name, pyrna_struct_Type.tp_name);
+ Py_DECREF(py_srna);
+ return NULL;
+ }
+
+ if(py_srna->ptr.type != &RNA_Struct) {
+ PyErr_SetString(PyExc_SystemError, "internal error, __rna__ was not a RNA_Struct type of rna struct.");
+ Py_DECREF(py_srna);
+ return NULL;
+ }
+
+ srna= py_srna->ptr.data;
+ Py_DECREF(py_srna);
+
+ return srna;
+}
+
+
/* Orphan functions, not sure where they should go */
+/* get the srna for methods attached to types */
+/* */
+static StructRNA *srna_from_self(PyObject *self)
+{
+ /* a bit sloppy but would cause a very confusing bug if
+ * an error happened to be set here */
+ PyErr_Clear();
+
+ if(self==NULL) {
+ return NULL;
+ }
+ else if (PyCObject_Check(self)) {
+ return PyCObject_AsVoidPtr(self);
+ }
+ else if (PyType_Check(self)==0) {
+ return NULL;
+ }
+ /* These cases above not errors, they just mean the type was not compatible
+ * After this any errors will be raised in the script */
+
+ return pyrna_struct_as_srna(self);
+}
+
+/* operators use this so it can store the args given but defer running
+ * it until the operator runs where these values are used to setup the
+ * default args for that operator instance */
+static PyObject *bpy_prop_deferred_return(void *func, PyObject *kw)
+{
+ PyObject *ret = PyTuple_New(2);
+ PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr(func, NULL));
+ PyTuple_SET_ITEM(ret, 1, kw);
+ Py_INCREF(kw);
+ return ret;
+}
/* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna allong
* This isnt incorrect since its a python object - but be careful */
-PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
+
+PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
{
- static char *kwlist[] = {"attr", "name", "description", "min", "max", "soft_min", "soft_max", "default", NULL};
+ static char *kwlist[] = {"attr", "name", "description", "default", NULL};
char *id, *name="", *description="";
- float min=FLT_MIN, max=FLT_MAX, soft_min=FLT_MIN, soft_max=FLT_MAX, def=0.0f;
+ int def=0;
PropertyRNA *prop;
-
- if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssfffff:FloatProperty", kwlist, &id, &name, &description, &min, &max, &soft_min, &soft_max, &def))
+ StructRNA *srna;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssi:BoolProperty", kwlist, &id, &name, &description, &def))
return NULL;
if (PyTuple_Size(args) > 0) {
@@ -2602,34 +2700,17 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- if (self && PyCObject_Check(self)) {
- StructRNA *srna = PyCObject_AsVoidPtr(self);
- prop= RNA_def_float(srna, id, def, min, max, name, description, soft_min, soft_max);
+ srna= srna_from_self(self);
+ if(srna==NULL && PyErr_Occurred()) {
+ return NULL; /* self's type was compatible but error getting the srna */
+ }
+ else if(srna) {
+ prop= RNA_def_boolean(srna, id, def, name, description);
RNA_def_property_duplicate_pointers(prop);
Py_RETURN_NONE;
- } else if(self && PyType_Check(self)) {
- PyObject *pyob= PyObject_GetAttrString(self, "__rna__");
-
- if(pyob && BPy_StructRNA_Check(pyob)) {
- BPy_StructRNA *py_srna= (BPy_StructRNA*)pyob;
-
- if(py_srna->ptr.data && py_srna->ptr.type == &RNA_Struct) {
- if(RNA_struct_is_ID(py_srna->ptr.data)) {
- prop= RNA_def_float(py_srna->ptr.data, id, def, min, max, name, description, soft_min, soft_max);
- RNA_def_property_duplicate_pointers(prop);
- Py_RETURN_NONE;
- }
- }
- }
-
- PyErr_SetString(PyExc_ValueError, "only works on ID types");
- return NULL;
- } else {
- PyObject *ret = PyTuple_New(2);
- PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr((void *)BPy_FloatProperty, NULL));
- PyTuple_SET_ITEM(ret, 1, kw);
- Py_INCREF(kw);
- return ret;
+ }
+ else { /* operators defer running this function */
+ return bpy_prop_deferred_return((void *)BPy_BoolProperty, kw);
}
}
@@ -2639,7 +2720,8 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
char *id, *name="", *description="";
int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, def=0;
PropertyRNA *prop;
-
+ StructRNA *srna;
+
if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssiiiii:IntProperty", kwlist, &id, &name, &description, &min, &max, &soft_min, &soft_max, &def))
return NULL;
@@ -2648,45 +2730,59 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- if (self && PyCObject_Check(self)) {
- StructRNA *srna = PyCObject_AsVoidPtr(self);
+ srna= srna_from_self(self);
+ if(srna==NULL && PyErr_Occurred()) {
+ return NULL; /* self's type was compatible but error getting the srna */
+ }
+ else if(srna) {
prop= RNA_def_int(srna, id, def, min, max, name, description, soft_min, soft_max);
RNA_def_property_duplicate_pointers(prop);
Py_RETURN_NONE;
- } else if(self && PyType_Check(self)) {
- PyObject *pyob= PyObject_GetAttrString(self, "__rna__");
-
- if(pyob && BPy_StructRNA_Check(pyob)) {
- BPy_StructRNA *py_srna= (BPy_StructRNA*)pyob;
+ }
+ else { /* operators defer running this function */
+ return bpy_prop_deferred_return((void *)BPy_IntProperty, kw);
+ }
+}
- if(py_srna->ptr.data && py_srna->ptr.type == &RNA_Struct) {
- if(RNA_struct_is_ID(py_srna->ptr.data)) {
- prop= RNA_def_int(py_srna->ptr.data, id, def, min, max, name, description, soft_min, soft_max);
- RNA_def_property_duplicate_pointers(prop);
- Py_RETURN_NONE;
- }
- }
- }
+PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
+{
+ static char *kwlist[] = {"attr", "name", "description", "min", "max", "soft_min", "soft_max", "default", NULL};
+ char *id, *name="", *description="";
+ float min=FLT_MIN, max=FLT_MAX, soft_min=FLT_MIN, soft_max=FLT_MAX, def=0.0f;
+ PropertyRNA *prop;
+ StructRNA *srna;
- PyErr_SetString(PyExc_ValueError, "only works on ID types");
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssfffff:FloatProperty", kwlist, &id, &name, &description, &min, &max, &soft_min, &soft_max, &def))
return NULL;
- } else {
- PyObject *ret = PyTuple_New(2);
- PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr((void *)BPy_IntProperty, NULL));
- PyTuple_SET_ITEM(ret, 1, kw);
- Py_INCREF(kw);
- return ret;
+
+ if (PyTuple_Size(args) > 0) {
+ PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this.
+ return NULL;
+ }
+
+ srna= srna_from_self(self);
+ if(srna==NULL && PyErr_Occurred()) {
+ return NULL; /* self's type was compatible but error getting the srna */
+ }
+ else if(srna) {
+ prop= RNA_def_float(srna, id, def, min, max, name, description, soft_min, soft_max);
+ RNA_def_property_duplicate_pointers(prop);
+ Py_RETURN_NONE;
+ }
+ else { /* operators defer running this function */
+ return bpy_prop_deferred_return((void *)BPy_FloatProperty, kw);
}
}
-PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
+PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
{
- static char *kwlist[] = {"attr", "name", "description", "default", NULL};
- char *id, *name="", *description="";
- int def=0;
+ static char *kwlist[] = {"attr", "name", "description", "maxlen", "default", NULL};
+ char *id, *name="", *description="", *def="";
+ int maxlen=0;
PropertyRNA *prop;
-
- if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssi:BoolProperty", kwlist, &id, &name, &description, &def))
+ StructRNA *srna;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssis:StringProperty", kwlist, &id, &name, &description, &maxlen, &def))
return NULL;
if (PyTuple_Size(args) > 0) {
@@ -2694,81 +2790,236 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- if (self && PyCObject_Check(self)) {
- StructRNA *srna = PyCObject_AsVoidPtr(self);
- prop= RNA_def_boolean(srna, id, def, name, description);
+ srna= srna_from_self(self);
+ if(srna==NULL && PyErr_Occurred()) {
+ return NULL; /* self's type was compatible but error getting the srna */
+ }
+ else if(srna) {
+ prop= RNA_def_string(srna, id, def, maxlen, name, description);
RNA_def_property_duplicate_pointers(prop);
Py_RETURN_NONE;
- } else if(self && PyType_Check(self)) {
- PyObject *pyob= PyObject_GetAttrString(self, "__rna__");
+ }
+ else { /* operators defer running this function */
+ return bpy_prop_deferred_return((void *)BPy_StringProperty, kw);
+ }
+}
+
+static EnumPropertyItem *enum_items_from_py(PyObject *value, const char *def, int *defvalue)
+{
+ EnumPropertyItem *items= NULL;
+ PyObject *item;
+ int seq_len, i, totitem= 0;
+
+ if(!PySequence_Check(value)) {
+ PyErr_SetString(PyExc_TypeError, "expected a sequence of tuples for the enum items");
+ return NULL;
+ }
- if(pyob && BPy_StructRNA_Check(pyob)) {
- BPy_StructRNA *py_srna= (BPy_StructRNA*)pyob;
+ seq_len = PySequence_Length(value);
+ for(i=0; i<seq_len; i++) {
+ EnumPropertyItem tmp= {0, "", 0, "", ""};
- if(py_srna->ptr.data && py_srna->ptr.type == &RNA_Struct) {
- if(RNA_struct_is_ID(py_srna->ptr.data)) {
- prop= RNA_def_boolean(py_srna->ptr.data, id, def, name, description);
- RNA_def_property_duplicate_pointers(prop);
- Py_RETURN_NONE;
- }
- }
+ item= PySequence_GetItem(value, i);
+ if(item==NULL || PyTuple_Check(item)==0) {
+ PyErr_SetString(PyExc_TypeError, "expected a sequence of tuples for the enum items");
+ if(items) MEM_freeN(items);
+ Py_XDECREF(item);
+ return NULL;
}
- PyErr_SetString(PyExc_ValueError, "only works on ID types");
- return NULL;
- } else {
- PyObject *ret = PyTuple_New(2);
- PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr((void *)BPy_BoolProperty, NULL));
- PyTuple_SET_ITEM(ret, 1, kw);
- Py_INCREF(kw);
- return ret;
+ if(!PyArg_ParseTuple(item, "sss", &tmp.identifier, &tmp.name, &tmp.description)) {
+ PyErr_SetString(PyExc_TypeError, "expected an identifier, name and description in the tuple");
+ Py_DECREF(item);
+ return NULL;
+ }
+
+ tmp.value= i;
+ RNA_enum_item_add(&items, &totitem, &tmp);
+
+ if(def[0] && strcmp(def, tmp.identifier) == 0)
+ *defvalue= tmp.value;
+
+ Py_DECREF(item);
}
+
+ if(!def[0])
+ *defvalue= 0;
+
+ RNA_enum_item_end(&items, &totitem);
+
+ return items;
}
-PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
+PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
{
- static char *kwlist[] = {"attr", "name", "description", "maxlen", "default", NULL};
+ static char *kwlist[] = {"attr", "items", "name", "description", "default", NULL};
char *id, *name="", *description="", *def="";
- int maxlen=0;
+ int defvalue=0;
+ PyObject *items= Py_None;
+ EnumPropertyItem *eitems;
PropertyRNA *prop;
+ StructRNA *srna;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|sss:EnumProperty", kwlist, &id, &items, &name, &description, &def))
+ return NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssis:StringProperty", kwlist, &id, &name, &description, &maxlen, &def))
+ if (PyTuple_Size(args) > 0) {
+ PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this.
+ return NULL;
+ }
+
+ srna= srna_from_self(self);
+ if(srna==NULL && PyErr_Occurred()) {
+ return NULL; /* self's type was compatible but error getting the srna */
+ }
+ else if(srna) {
+ eitems= enum_items_from_py(items, def, &defvalue);
+ if(!eitems)
+ return NULL;
+
+ prop= RNA_def_enum(srna, id, eitems, defvalue, name, description);
+ RNA_def_property_duplicate_pointers(prop);
+ MEM_freeN(eitems);
+
+ Py_RETURN_NONE;
+ }
+ else { /* operators defer running this function */
+ return bpy_prop_deferred_return((void *)BPy_EnumProperty, kw);
+ }
+}
+
+static StructRNA *pointer_type_from_py(PyObject *value)
+{
+ StructRNA *srna;
+
+ srna= srna_from_self(value);
+ if(!srna) {
+ PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup");
+ return NULL;
+ }
+
+ if(!RNA_struct_is_a(srna, &RNA_IDPropertyGroup)) {
+ PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup");
+ return NULL;
+ }
+
+ return srna;
+}
+
+PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
+{
+ static char *kwlist[] = {"attr", "type", "name", "description", NULL};
+ char *id, *name="", *description="";
+ PropertyRNA *prop;
+ StructRNA *srna, *ptype;
+ PyObject *type= Py_None;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ss:PointerProperty", kwlist, &id, &type, &name, &description))
return NULL;
if (PyTuple_Size(args) > 0) {
PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this.
return NULL;
}
+
+ srna= srna_from_self(self);
+ if(srna==NULL && PyErr_Occurred()) {
+ return NULL; /* self's type was compatible but error getting the srna */
+ }
+ else if(srna) {
+ ptype= pointer_type_from_py(type);
+ if(!ptype)
+ return NULL;
+
+ prop= RNA_def_pointer_runtime(srna, id, ptype, name, description);
+ RNA_def_property_duplicate_pointers(prop);
+ Py_RETURN_NONE;
+ }
+ else { /* operators defer running this function */
+ return bpy_prop_deferred_return((void *)BPy_PointerProperty, kw);
+ }
+ return NULL;
+}
+
+PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
+{
+ static char *kwlist[] = {"attr", "type", "name", "description", NULL};
+ char *id, *name="", *description="";
+ PropertyRNA *prop;
+ StructRNA *srna, *ptype;
+ PyObject *type= Py_None;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ss:CollectionProperty", kwlist, &id, &type, &name, &description))
+ return NULL;
- if (self && PyCObject_Check(self)) {
- StructRNA *srna = PyCObject_AsVoidPtr(self);
- prop= RNA_def_string(srna, id, def, maxlen, name, description);
+ if (PyTuple_Size(args) > 0) {
+ PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this.
+ return NULL;
+ }
+
+ srna= srna_from_self(self);
+ if(srna==NULL && PyErr_Occurred()) {
+ return NULL; /* self's type was compatible but error getting the srna */
+ }
+ else if(srna) {
+ ptype= pointer_type_from_py(type);
+ if(!ptype)
+ return NULL;
+
+ prop= RNA_def_collection_runtime(srna, id, ptype, name, description);
RNA_def_property_duplicate_pointers(prop);
Py_RETURN_NONE;
- } else if(self && PyType_Check(self)) {
- PyObject *pyob= PyObject_GetAttrString(self, "__rna__");
+ }
+ else { /* operators defer running this function */
+ return bpy_prop_deferred_return((void *)BPy_CollectionProperty, kw);
+ }
+ return NULL;
+}
- if(pyob && BPy_StructRNA_Check(pyob)) {
- BPy_StructRNA *py_srna= (BPy_StructRNA*)pyob;
+static int deferred_register_props(PyObject *py_class, StructRNA *srna)
+{
+ PyObject *props, *dummy_args, *item;
+ int i;
- if(py_srna->ptr.data && py_srna->ptr.type == &RNA_Struct) {
- if(RNA_struct_is_ID(py_srna->ptr.data)) {
- prop= RNA_def_string(py_srna->ptr.data, id, def, maxlen, name, description);
- RNA_def_property_duplicate_pointers(prop);
- Py_RETURN_NONE;
- }
+ props= PyObject_GetAttrString(py_class, "__props__");
+
+ if(!props) {
+ PyErr_Clear();
+ return 1;
+ }
+
+ dummy_args = PyTuple_New(0);
+
+ for(i=0; i<PyList_Size(props); i++) {
+ PyObject *py_func_ptr, *py_kw, *py_srna_cobject, *py_ret;
+ item = PyList_GET_ITEM(props, i);
+
+ if(PyArg_ParseTuple(item, "O!O!", &PyCObject_Type, &py_func_ptr, &PyDict_Type, &py_kw)) {
+ PyObject *(*pyfunc)(PyObject *, PyObject *, PyObject *);
+ pyfunc = PyCObject_AsVoidPtr(py_func_ptr);
+ py_srna_cobject = PyCObject_FromVoidPtr(srna, NULL);
+
+ py_ret = pyfunc(py_srna_cobject, dummy_args, py_kw);
+ Py_DECREF(py_srna_cobject);
+
+ if(py_ret) {
+ Py_DECREF(py_ret);
+ }
+ else {
+ Py_DECREF(dummy_args);
+ return 0;
}
}
-
- PyErr_SetString(PyExc_ValueError, "only works on ID types");
- return NULL;
- } else {
- PyObject *ret = PyTuple_New(2);
- PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr((void *)BPy_StringProperty, NULL));
- PyTuple_SET_ITEM(ret, 1, kw);
- Py_INCREF(kw);
- return ret;
+ else {
+ PyErr_Clear();
+ PyErr_SetString(PyExc_AttributeError, "expected list of dicts for __props__.");
+ Py_DECREF(dummy_args);
+ return 0;
+ }
}
+
+ Py_DECREF(dummy_args);
+ return 1;
}
/*-------------------- Type Registration ------------------------*/
@@ -2918,9 +3169,10 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par
void *retdata= NULL;
int err= 0, i, flag;
- PyGILState_STATE gilstate = PyGILState_Ensure();
+ PyGILState_STATE gilstate;
- BPY_update_modules(); // XXX - the RNA pointers can change so update before running, would like a nicer solution for this.
+ bContext *C= BPy_GetContext(); // XXX - NEEDS FIXING, QUITE BAD.
+ bpy_context_set(C, &gilstate);
py_class= RNA_struct_py_type_get(ptr->type);
@@ -2996,57 +3248,103 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par
PyErr_Clear();
}
- PyGILState_Release(gilstate);
+ bpy_context_clear(C, &gilstate);
return err;
}
static void bpy_class_free(void *pyob_ptr)
{
+ PyObject *self= (PyObject *)pyob_ptr;
+ PyGILState_STATE gilstate;
+
+ gilstate = PyGILState_Ensure();
+
+ PyDict_Clear(((PyTypeObject*)self)->tp_dict);
+
if(G.f&G_DEBUG) {
- if(((PyObject *)pyob_ptr)->ob_refcnt > 1)
- PyObSpit("zombie class - ref should be 1", (PyObject *)pyob_ptr);
+ if(self->ob_refcnt > 1) {
+ PyObSpit("zombie class - ref should be 1", self);
+ }
}
+
Py_DECREF((PyObject *)pyob_ptr);
+
+ PyGILState_Release(gilstate);
}
-PyObject *pyrna_basetype_register(PyObject *self, PyObject *args)
+void pyrna_alloc_types(void)
{
- bContext *C= NULL;
- PyObject *py_class, *item;
- ReportList reports;
- StructRegisterFunc reg;
- BPy_StructRNA *py_srna;
- StructRNA *srna;
+ PyGILState_STATE gilstate;
- if(!PyArg_ParseTuple(args, "O:register", &py_class))
- return NULL;
+ PointerRNA ptr;
+ PropertyRNA *prop;
- if(!PyType_Check(py_class)) {
- PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (no a Type object).");
- return NULL;
+ gilstate = PyGILState_Ensure();
+
+ /* avoid doing this lookup for every getattr */
+ RNA_blender_rna_pointer_create(&ptr);
+ prop = RNA_struct_find_property(&ptr, "structs");
+
+ RNA_PROP_BEGIN(&ptr, itemptr, prop) {
+ Py_DECREF(pyrna_struct_Subtype(&itemptr));
}
+ RNA_PROP_END;
- /* check we got an __rna__ attribute */
- item= PyObject_GetAttrString(py_class, "__rna__");
+ PyGILState_Release(gilstate);
+}
- if(!item || !BPy_StructRNA_Check(item)) {
- Py_XDECREF(item);
- PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (no __rna__ property).");
- return NULL;
+
+void pyrna_free_types(void)
+{
+ PointerRNA ptr;
+ PropertyRNA *prop;
+
+ /* avoid doing this lookup for every getattr */
+ RNA_blender_rna_pointer_create(&ptr);
+ prop = RNA_struct_find_property(&ptr, "structs");
+
+
+ RNA_PROP_BEGIN(&ptr, itemptr, prop) {
+ StructRNA *srna= srna_from_ptr(&itemptr);
+ void *py_ptr= RNA_struct_py_type_get(srna);
+
+ if(py_ptr) {
+#if 0 // XXX - should be able to do this but makes python crash on exit
+ bpy_class_free(py_ptr);
+#endif
+ RNA_struct_py_type_set(srna, NULL);
+ }
}
+ RNA_PROP_END;
+}
- /* check the __rna__ attribute has the right type */
- Py_DECREF(item);
- py_srna= (BPy_StructRNA*)item;
+/* Note! MemLeak XXX
+ *
+ * There is currently a bug where moving registering a python class does
+ * not properly manage refcounts from the python class, since the srna owns
+ * the python class this should not be so tricky but changing the references as
+ * youd expect when changing ownership crashes blender on exit so I had to comment out
+ * the decref. This is not so bad because the leak only happens when re-registering (hold F8)
+ * - Should still be fixed - Campbell
+ * */
- if(py_srna->ptr.type != &RNA_Struct) {
- PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (not a Struct).");
+PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class)
+{
+ bContext *C= NULL;
+ ReportList reports;
+ StructRegisterFunc reg;
+ StructRNA *srna;
+ StructRNA *srna_new;
+ PyObject *item;
+ const char *identifier= "";
+
+ srna= pyrna_struct_as_srna(py_class);
+ if(srna==NULL)
return NULL;
- }
/* check that we have a register callback for this type */
- reg= RNA_struct_register(py_srna->ptr.data);
+ reg= RNA_struct_register(srna);
if(!reg) {
PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (no register supported).");
@@ -3056,11 +3354,19 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *args)
/* get the context, so register callback can do necessary refreshes */
C= BPy_GetContext();
- /* call the register callback */
+ /* call the register callback with reports & identifier */
BKE_reports_init(&reports, RPT_STORE);
- srna= reg(C, &reports, py_class, bpy_class_validate, bpy_class_call, bpy_class_free);
- if(!srna) {
+ item= PyObject_GetAttrString(py_class, "__name__");
+
+ if(item) {
+ identifier= _PyUnicode_AsString(item);
+ Py_DECREF(item); /* no need to keep a ref, the class owns it */
+ }
+
+ srna_new= reg(C, &reports, py_class, identifier, bpy_class_validate, bpy_class_call, bpy_class_free);
+
+ if(!srna_new) {
BPy_reports_to_error(&reports);
BKE_reports_clear(&reports);
return NULL;
@@ -3068,44 +3374,32 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *args)
BKE_reports_clear(&reports);
- pyrna_subtype_set_rna(py_class, srna); /* takes a ref to py_class */
+ pyrna_subtype_set_rna(py_class, srna_new); /* takes a ref to py_class */
+
+ /* old srna still references us, keep the check incase registering somehow can free it */
+ if(RNA_struct_py_type_get(srna)) {
+ RNA_struct_py_type_set(srna, NULL);
+ // Py_DECREF(py_class); // shuld be able to do this XXX since the old rna adds a new ref.
+ }
+
+ if(!deferred_register_props(py_class, srna_new))
+ return NULL;
Py_RETURN_NONE;
}
-PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *args)
+PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class)
{
bContext *C= NULL;
- PyObject *py_class, *item;
- BPy_StructRNA *py_srna;
StructUnregisterFunc unreg;
+ StructRNA *srna;
- if(!PyArg_ParseTuple(args, "O:unregister", &py_class))
- return NULL;
-
- if(!PyType_Check(py_class)) {
- PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (no a Type object).");
- return NULL;
- }
-
- /* check we got an __rna__ attribute */
- item= PyDict_GetItemString(((PyTypeObject*)py_class)->tp_dict, "__rna__"); /* borrow ref */
-
- if(!item || !BPy_StructRNA_Check(item)) {
- PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (no __rna__ property).");
- return NULL;
- }
-
- /* check the __rna__ attribute has the right type */
- py_srna= (BPy_StructRNA*)item;
-
- if(py_srna->ptr.type != &RNA_Struct) {
- PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (not a Struct).");
+ srna= pyrna_struct_as_srna(py_class);
+ if(srna==NULL)
return NULL;
- }
/* check that we have a unregister callback for this type */
- unreg= RNA_struct_unregister(py_srna->ptr.data);
+ unreg= RNA_struct_unregister(srna);
if(!unreg) {
PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (no unregister supported).");
@@ -3114,13 +3408,9 @@ PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *args)
/* get the context, so register callback can do necessary refreshes */
C= BPy_GetContext();
-
/* call unregister */
- unreg(C, py_srna->ptr.data);
-
- /* remove reference to old type */
- Py_DECREF(py_class);
+ unreg(C, srna); /* calls bpy_class_free, this decref's py_class */
Py_RETURN_NONE;
}
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index 9138fd511b0..d65849ad8a4 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -61,6 +61,7 @@ typedef struct {
#define BPy_BaseTypeRNA BPy_PropertyRNA
PyObject *BPY_rna_module( void );
+void BPY_update_rna_module( void );
/*PyObject *BPY_rna_doc( void );*/
PyObject *BPY_rna_types( void );
PyObject *BPY_rna_props( void );
@@ -74,13 +75,25 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha
PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop);
/* functions for setting up new props - experemental */
-PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw);
PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw);
PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw);
/* function for registering types */
PyObject *pyrna_basetype_register(PyObject *self, PyObject *args);
PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *args);
+/* called before stopping python */
+void pyrna_alloc_types(void);
+void pyrna_free_types(void);
+
+/* primitive type conversion */
+int pyrna_py_to_boolean_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size);
+int pyrna_py_to_int_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size);
+int pyrna_py_to_float_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size);
+
#endif
diff --git a/source/blender/python/intern/bpy_ui.c b/source/blender/python/intern/bpy_ui.c
index 59e566b3b37..f03a83bee9c 100644
--- a/source/blender/python/intern/bpy_ui.c
+++ b/source/blender/python/intern/bpy_ui.c
@@ -26,7 +26,6 @@
#include "bpy_util.h"
#include "bpy_rna.h" /* for rna buttons */
#include "bpy_operator.h" /* for setting button operator properties */
-#include "bpy_compat.h"
#include "WM_types.h" /* for WM_OP_INVOKE_DEFAULT & friends */
@@ -47,7 +46,6 @@ static struct PyMethodDef ui_methods[] = {
{NULL, NULL, 0, NULL}
};
-#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef ui_module = {
PyModuleDef_HEAD_INIT,
"bpy.ui",
@@ -56,16 +54,11 @@ static struct PyModuleDef ui_module = {
ui_methods,
NULL, NULL, NULL, NULL
};
-#endif
PyObject *BPY_ui_module( void )
{
- PyObject *submodule, *mod;
-#if PY_VERSION_HEX >= 0x03000000
+ PyObject *submodule;
submodule= PyModule_Create(&ui_module);
-#else /* Py2.x */
- submodule= Py_InitModule3( "bpy.ui", ui_methods, "" );
-#endif
/* INCREF since its its assumed that all these functions return the
* module with a new ref like PyDict_New, since they are passed to
diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c
index 3084cc1f871..1766be62c83 100644
--- a/source/blender/python/intern/bpy_util.c
+++ b/source/blender/python/intern/bpy_util.c
@@ -122,46 +122,6 @@ int BPY_flag_from_seq(BPY_flag_def *flagdef, PyObject *seq, int *flag)
return 0; /* ok */
}
-
-/* Copied from pythons 3's Object.c */
-#ifndef Py_CmpToRich
-PyObject *
-Py_CmpToRich(int op, int cmp)
-{
- PyObject *res;
- int ok;
-
- if (PyErr_Occurred())
- return NULL;
- switch (op) {
- case Py_LT:
- ok = cmp < 0;
- break;
- case Py_LE:
- ok = cmp <= 0;
- break;
- case Py_EQ:
- ok = cmp == 0;
- break;
- case Py_NE:
- ok = cmp != 0;
- break;
- case Py_GT:
- ok = cmp > 0;
- break;
- case Py_GE:
- ok = cmp >= 0;
- break;
- default:
- PyErr_BadArgument();
- return NULL;
- }
- res = ok ? Py_True : Py_False;
- Py_INCREF(res);
- return res;
-}
-#endif
-
/* for debugging */
void PyObSpit(char *name, PyObject *var) {
fprintf(stderr, "<%s> : ", name);
@@ -170,7 +130,7 @@ void PyObSpit(char *name, PyObject *var) {
}
else {
PyObject_Print(var, stderr, 0);
- fprintf(stderr, " ref:%d ", var->ob_refcnt);
+ fprintf(stderr, " ref:%d ", (int)var->ob_refcnt);
fprintf(stderr, " ptr:%p", (void *)var);
fprintf(stderr, " type:");
@@ -373,11 +333,7 @@ PyObject *BPY_exception_buffer(void)
* string_io = StringIO.StringIO()
*/
-#if PY_VERSION_HEX < 0x03000000
- if(! (string_io_mod= PyImport_ImportModule("StringIO")) ) {
-#else
if(! (string_io_mod= PyImport_ImportModule("io")) ) {
-#endif
goto error_cleanup;
} else if (! (string_io = PyObject_CallMethod(string_io_mod, "StringIO", NULL))) {
goto error_cleanup;
diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h
index 470dd4c2a45..83fa7a5b7c4 100644
--- a/source/blender/python/intern/bpy_util.h
+++ b/source/blender/python/intern/bpy_util.h
@@ -27,7 +27,10 @@
#ifndef BPY_UTIL_H
#define BPY_UTIL_H
-#include "bpy_compat.h"
+#if PY_VERSION_HEX < 0x03010000
+#error "Python versions below 3.1 are not supported anymore, you'll need to update your python."
+#endif
+
#include "RNA_types.h" /* for EnumPropertyItem only */
struct EnumPropertyItem;
@@ -72,7 +75,7 @@ int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_c
char *BPy_enum_as_string(struct EnumPropertyItem *item);
-#define BLANK_PYTHON_TYPE {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
+#define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
/* error reporting */
int BPy_reports_to_error(struct ReportList *reports);
@@ -82,4 +85,8 @@ int BPy_errors_to_report(struct ReportList *reports);
struct bContext *BPy_GetContext(void);
void BPy_SetContext(struct bContext *C);
+extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate);
+extern void bpy_context_clear(struct bContext *C, PyGILState_STATE *gilstate);
+
+
#endif
diff --git a/source/blender/readblenfile/SConscript b/source/blender/readblenfile/SConscript
index 59771aa0829..c8189501d4b 100644
--- a/source/blender/readblenfile/SConscript
+++ b/source/blender/readblenfile/SConscript
@@ -5,4 +5,4 @@ sources = env.Glob('intern/*.c')
incs = '. ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging'
-env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core','player'], priority = [0, 220] )
+env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core'], priority = [0] )
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index 411bd61c3ff..ad96b9db166 100644
--- a/source/blender/render/CMakeLists.txt
+++ b/source/blender/render/CMakeLists.txt
@@ -28,8 +28,9 @@ FILE(GLOB SRC intern/source/*.c)
SET(INC
intern/include ../../../intern/guardedalloc ../blenlib ../makesdna
- extern/include ../blenkernel ../radiosity/extern/include ../imbuf
- ../quicktime ../include ../../kernel/gen_messaging ../blenloader
+ extern/include ../blenkernel ../imbuf
+ ../include ../../kernel/gen_messaging ../blenloader
+ ../../../intern/smoke/extern
../makesrna
)
@@ -38,7 +39,7 @@ IF(WITH_OPENEXR)
ENDIF(WITH_OPENEXR)
IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
+ SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript
index dbd9f65254b..db151775b96 100644
--- a/source/blender/render/SConscript
+++ b/source/blender/render/SConscript
@@ -6,7 +6,7 @@ sources = env.Glob('intern/source/*.c')
incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna'
incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
-incs += ' ../include ../blenloader'
+incs += ' ../include ../blenloader ../../../intern/smoke/extern'
defs = []
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index 2df3a0a4f8b..bf02af6ac36 100644
--- a/source/blender/render/extern/include/RE_pipeline.h
+++ b/source/blender/render/extern/include/RE_pipeline.h
@@ -266,7 +266,8 @@ typedef struct RenderEngine {
ListBase fullresult;
} RenderEngine;
-void RE_layer_rect_from_file(RenderLayer *layer, struct ReportList *reports, char *filename, int x, int y);
+void RE_layer_load_from_file(RenderLayer *layer, struct ReportList *reports, char *filename);
+void RE_result_load_from_file(RenderResult *result, struct ReportList *reports, char *filename);
struct RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h);
void RE_engine_update_result(RenderEngine *engine, struct RenderResult *result);
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h
index 0ad48fe97a9..435e3ddc07f 100644
--- a/source/blender/render/extern/include/RE_shader_ext.h
+++ b/source/blender/render/extern/include/RE_shader_ext.h
@@ -55,7 +55,6 @@ typedef struct ShadeResult
float refl[3];
float refr[3];
float nor[3];
- float rad[3];
float winspeed[4];
} ShadeResult;
@@ -113,7 +112,7 @@ typedef struct ShadeInput
/* internal face coordinates */
float u, v, dx_u, dx_v, dy_u, dy_v;
- float co[3], view[3];
+ float co[3], view[3], camera_co[3];
/* copy from material, keep synced so we can do memcopy */
/* current size: 23*4 */
@@ -132,7 +131,7 @@ typedef struct ShadeInput
float layerfac;
/* texture coordinates */
- float lo[3], gl[3], ref[3], orn[3], winco[3], sticky[3], vcol[4], rad[3];
+ float lo[3], gl[3], ref[3], orn[3], winco[3], sticky[3], vcol[4];
float refcol[4], displace[3];
float strandco, tang[3], nmaptang[3], stress, winspeed[4];
float duplilo[3], dupliuv[3];
@@ -161,6 +160,7 @@ typedef struct ShadeInput
int samplenr; /* sample counter, to detect if we should do shadow again */
int depth; /* 1 or larger on raytrace shading */
+ int volume_depth; /* number of intersections through volumes */
/* stored copy of original face normal (facenor)
* before flipping. Used in Front/back output on geometry node */
diff --git a/intern/SoundSystem/SND_DependKludge.h b/source/blender/render/intern/include/pointdensity.h
index 06d4ec9c0c9..93cdef3b14e 100644
--- a/intern/SoundSystem/SND_DependKludge.h
+++ b/source/blender/render/intern/include/pointdensity.h
@@ -1,9 +1,4 @@
/*
- * SND_DependKludge.h
- *
- * who needs what?
- *
- * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -26,25 +21,24 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Matt Ebb
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef HAVE_CONFIG_H
+#ifndef POINTDENSITY_H
+#define POINTDENSITY_H
+
+/**
+ * Make point density kd-trees for all point density textures in the scene
+ */
-#ifndef NO_SOUND
+struct Render;
+struct TexResult;
-#if defined (_WIN32) && !defined(FREE_WINDOWS)
-# define USE_OPENAL
-#elif defined (__linux__) || (__FreeBSD__) || defined(__APPLE__) || defined(__sun)
-# define USE_OPENAL
-#else
-# ifdef USE_OPENAL
-# undef USE_OPENAL
-# endif
-#endif
+void make_pointdensities(struct Render *re);
+void free_pointdensities(struct Render *re);
+int pointdensitytex(struct Tex *tex, float *texvec, struct TexResult *texres);
-#endif /* NO_SOUND */
+#endif /* POINTDENSITY_H */
-#endif /* HAVE_CONFIG_H */
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index ab3758781ce..e50e498228d 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -201,6 +201,9 @@ struct Render
ListBase customdata_names;
struct Object *excludeob;
+ ListBase render_volumes_inside;
+ ListBase volumes;
+ ListBase volume_precache_parts;
/* arena for allocating data for use during render, for
* example dynamic TFaces to go in the VlakRen structure.
@@ -292,7 +295,9 @@ typedef struct ObjectInstanceRen {
float dupliorco[3], dupliuv[2];
float (*duplitexmat)[4];
-
+
+ struct VolumePrecache *volume_precache;
+
float *vectors;
int totvector;
} ObjectInstanceRen;
@@ -402,6 +407,46 @@ typedef struct StrandRen {
float orco[3];
} StrandRen;
+/* ------------------------------------------------------------------------- */
+
+typedef struct VolumeOb
+{
+ struct VolumeOb *next, *prev;
+ struct Material *ma;
+ struct ObjectRen *obr;
+} VolumeOb;
+
+typedef struct MatInside {
+ struct MatInside *next, *prev;
+ struct Material *ma;
+ struct ObjectInstanceRen *obi;
+} MatInside;
+
+typedef struct VolPrecachePart
+{
+ struct VolPrecachePart *next, *prev;
+ struct RayTree *tree;
+ struct ShadeInput *shi;
+ struct ObjectInstanceRen *obi;
+ int num;
+ int minx, maxx;
+ int miny, maxy;
+ int minz, maxz;
+ int res[3];
+ float bbmin[3];
+ float voxel[3];
+ int working, done;
+} VolPrecachePart;
+
+typedef struct VolumePrecache
+{
+ int res[3];
+ float *data_r;
+ float *data_g;
+ float *data_b;
+} VolumePrecache;
+
+/* ------------------------------------------------------------------------- */
struct LampRen;
struct MTex;
diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h
index d195f32d5ef..95bccd2be1e 100644
--- a/source/blender/render/intern/include/shading.h
+++ b/source/blender/render/intern/include/shading.h
@@ -33,6 +33,7 @@ struct VlakRen;
struct StrandSegment;
struct StrandPoint;
struct ObjectInstanceRen obi;
+struct Isect;
/* shadeinput.c */
@@ -52,6 +53,7 @@ typedef struct ShadeSample {
/* also the node shader callback */
void shade_material_loop(struct ShadeInput *shi, struct ShadeResult *shr);
+void shade_volume_loop(struct ShadeInput *shi, struct ShadeResult *shr);
void shade_input_set_triangle_i(struct ShadeInput *shi, struct ObjectInstanceRen *obi, struct VlakRen *vlr, short i1, short i2, short i3);
void shade_input_set_triangle(struct ShadeInput *shi, volatile int obi, volatile int facenr, int normal_flip);
@@ -87,7 +89,11 @@ void shade_color(struct ShadeInput *shi, ShadeResult *shr);
void ambient_occlusion_to_diffuse(struct ShadeInput *shi, float *diff);
void ambient_occlusion(struct ShadeInput *shi);
+ListBase *get_lights(struct ShadeInput *shi);
float lamp_get_visibility(struct LampRen *lar, float *co, float *lv, float *dist);
void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float *shadfac, int do_real);
float fresnel_fac(float *view, float *vn, float fresnel, float fac);
+
+/* rayshade.c */
+extern void shade_ray(struct Isect *is, struct ShadeInput *shi, struct ShadeResult *shr);
diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h
index c254b768292..78d6a912af1 100644
--- a/source/blender/render/intern/include/texture.h
+++ b/source/blender/render/intern/include/texture.h
@@ -56,6 +56,7 @@ void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf);
void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag, short thread);
void do_material_tex(struct ShadeInput *shi);
void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf, int effect);
+void do_volume_tex(struct ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val);
void init_render_textures(Render *re);
void end_render_textures(void);
diff --git a/source/gameengine/Expressions/KX_Python_dynamic.h b/source/blender/render/intern/include/volume_precache.h
index eb435bdf1c3..9d87a219c82 100644
--- a/source/gameengine/Expressions/KX_Python_dynamic.h
+++ b/source/blender/render/intern/include/volume_precache.h
@@ -1,5 +1,4 @@
/**
- * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -22,15 +21,13 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Matt Ebb.
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef KX_PYTHON_H
-#define KX_PYTHON_H
-
-//#define USE_DL_EXPORT
-#include "Python.h"
-
-#endif // KX_PYTHON_H
+
+void volume_precache(Render *re);
+void free_volume_precache(Render *re);
+int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co);
+#define VOL_MS_TIMESTEP 0.1f \ No newline at end of file
diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h
new file mode 100644
index 00000000000..026b4840ea3
--- /dev/null
+++ b/source/blender/render/intern/include/volumetric.h
@@ -0,0 +1,47 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Matt Ebb.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+float vol_get_stepsize(struct ShadeInput *shi, int context);
+float vol_get_density(struct ShadeInput *shi, float *co);
+void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density);
+
+void shade_volume_outside(ShadeInput *shi, ShadeResult *shr);
+void shade_volume_inside(ShadeInput *shi, ShadeResult *shr);
+void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is);
+
+#define STEPSIZE_VIEW 0
+#define STEPSIZE_SHADE 1
+
+#define VOL_IS_BACKFACE 1
+#define VOL_IS_SAMEMATERIAL 2
+
+#define VOL_BOUNDS_DEPTH 0
+#define VOL_BOUNDS_SS 1
+
+#define VOL_SHADE_OUTSIDE 0
+#define VOL_SHADE_INSIDE 1
diff --git a/intern/SoundSystem/dummy/SND_DummyDevice.cpp b/source/blender/render/intern/include/voxeldata.h
index 672c73e9c52..b291bdc096d 100644
--- a/intern/SoundSystem/dummy/SND_DummyDevice.cpp
+++ b/source/blender/render/intern/include/voxeldata.h
@@ -1,5 +1,4 @@
-/*
- * $Id$
+/**
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -22,31 +21,25 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Raul Fernandez Hernandez (Farsthary), Matt Ebb.
*
* ***** END GPL LICENSE BLOCK *****
- * SND_DummyDevice derived from SND_IAudioDevice
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#ifndef VOXELDATA_H
+#define VOXELDATA_H
-#ifdef WIN32
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
+struct Render;
+struct TexResult;
-#include "SND_DummyDevice.h"
-
-SND_DummyDevice::SND_DummyDevice()
-{
-}
-
-SND_DummyDevice::~SND_DummyDevice()
+typedef struct VoxelDataHeader
{
-#ifdef ONTKEVER
- printf("SND_DummyDevice destructor");
-#endif
-}
+ int resolX, resolY, resolZ;
+ int frames;
+} VoxelDataHeader;
+void make_voxeldata(struct Render *re);
+void free_voxeldata(struct Render *re);
+int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres);
+#endif /* VOXELDATA_H */
diff --git a/source/blender/render/intern/source/Makefile b/source/blender/render/intern/source/Makefile
index 3c8d0f637a3..c313549f9b9 100644
--- a/source/blender/render/intern/source/Makefile
+++ b/source/blender/render/intern/source/Makefile
@@ -39,7 +39,6 @@ CFLAGS += $(LEVEL_1_C_WARNINGS)
# The external modules follow after. There should be a nicer way to say this.
CPPFLAGS += -I../include
CPPFLAGS += -I../../extern/include
-CPPFLAGS += -I../../../radiosity/extern/include
CPPFLAGS += -I../../../blenlib
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../makesdna
@@ -51,6 +50,7 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# not very neat: the rest of blender..
CPPFLAGS += -I../../../editors/include
CPPFLAGS += $(NAN_SDLCFLAGS)
+CPPFLAGS += -I../../../../../intern/smoke/extern
ifeq ($(WITH_QUICKTIME), true)
CPPFLAGS += -DWITH_QUICKTIME
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 2b06f164c12..cf6246e3641 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -100,6 +100,8 @@
#include "envmap.h"
#include "occlusion.h"
+#include "pointdensity.h"
+#include "voxeldata.h"
#include "render_types.h"
#include "rendercore.h"
#include "renderdatabase.h"
@@ -108,6 +110,7 @@
#include "shading.h"
#include "strand.h"
#include "texture.h"
+#include "volume_precache.h"
#include "sss.h"
#include "strand.h"
#include "zbuf.h"
@@ -895,7 +898,7 @@ static void flag_render_node_material(Render *re, bNodeTree *ntree)
if(GS(node->id->name)==ID_MA) {
Material *ma= (Material *)node->id;
- if(ma->mode & MA_ZTRA)
+ if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
re->flag |= R_ZTRA;
ma->flag |= MA_IS_USED;
@@ -917,7 +920,8 @@ static Material *give_render_material(Render *re, Object *ob, int nr)
if(re->r.mode & R_SPEED) ma->texco |= NEED_UV;
- if(ma->mode & MA_ZTRA)
+ if(ma->material_type == MA_TYPE_VOLUME) ma->mode |= MA_TRANSP;
+ if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
re->flag |= R_ZTRA;
/* for light groups */
@@ -2976,6 +2980,53 @@ static void use_mesh_edge_lookup(ObjectRen *obr, DerivedMesh *dm, MEdge *medge,
}
}
+static void free_camera_inside_volumes(Render *re)
+{
+ BLI_freelistN(&re->render_volumes_inside);
+}
+
+static void init_camera_inside_volumes(Render *re)
+{
+ ObjectInstanceRen *obi;
+ VolumeOb *vo;
+ float co[3] = {0.f, 0.f, 0.f};
+
+ for(vo= re->volumes.first; vo; vo= vo->next) {
+ for(obi= re->instancetable.first; obi; obi= obi->next) {
+ if (obi->obr == vo->obr) {
+ if (point_inside_volume_objectinstance(obi, co)) {
+ MatInside *mi;
+
+ mi = MEM_mallocN(sizeof(MatInside), "camera inside material");
+ mi->ma = vo->ma;
+ mi->obi = obi;
+
+ BLI_addtail(&(re->render_volumes_inside), mi);
+ }
+ }
+ }
+ }
+
+ /* debug {
+ MatInside *m;
+ for (m=re->render_volumes_inside.first; m; m=m->next) {
+ printf("matinside: ma: %s \n", m->ma->id.name+2);
+ }
+ }*/
+}
+
+static void add_volume(Render *re, ObjectRen *obr, Material *ma)
+{
+ struct VolumeOb *vo;
+
+ vo = MEM_mallocN(sizeof(VolumeOb), "volume object");
+
+ vo->ma = ma;
+ vo->obr = obr;
+
+ BLI_addtail(&re->volumes, vo);
+}
+
static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
{
Object *ob= obr->ob;
@@ -3025,11 +3076,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
}
need_nmap_tangent= 1;
}
-
- /* radio faces need autosmooth, to separate shared vertices in corners */
- if(re->r.mode & R_RADIO)
- if(ma->mode & MA_RADIO)
- do_autosmooth= 1;
+
+ if (ma->material_type == MA_TYPE_VOLUME)
+ add_volume(re, obr, ma);
}
}
@@ -3799,7 +3848,7 @@ static void set_phong_threshold(ObjectRen *obr)
static void set_fullsample_flag(Render *re, ObjectRen *obr)
{
VlakRen *vlr;
- int a, trace;
+ int a, trace, mode;
if(re->osa==0)
return;
@@ -3808,12 +3857,14 @@ static void set_fullsample_flag(Render *re, ObjectRen *obr)
for(a=obr->totvlak-1; a>=0; a--) {
vlr= RE_findOrAddVlak(obr, a);
+ mode= vlr->mat->mode;
- if(vlr->mat->mode & MA_FULL_OSA)
+ if(mode & MA_FULL_OSA)
vlr->flag |= R_FULL_OSA;
else if(trace) {
- if(vlr->mat->mode & MA_SHLESS);
- else if(vlr->mat->mode & (MA_RAYTRANSP|MA_RAYMIRROR))
+ if(mode & MA_SHLESS);
+ else if(vlr->mat->material_type == MA_TYPE_VOLUME);
+ else if((mode & MA_RAYMIRROR) || ((mode & MA_TRANSP) && (mode & MA_RAYTRANSP)))
/* for blurry reflect/refract, better to take more samples
* inside the raytrace than as OSA samples */
if ((vlr->mat->gloss_mir == 1.0) && (vlr->mat->gloss_tra == 1.0))
@@ -4338,6 +4389,8 @@ void RE_Database_Free(Render *re)
curvemapping_free(lar->curfalloff);
}
+ free_volume_precache(re);
+
BLI_freelistN(&re->lampren);
BLI_freelistN(&re->lights);
@@ -4364,6 +4417,11 @@ void RE_Database_Free(Render *re)
end_render_materials();
end_render_textures();
+ free_pointdensities(re);
+ free_voxeldata(re);
+
+ free_camera_inside_volumes(re);
+
if(re->wrld.aosphere) {
MEM_freeN(re->wrld.aosphere);
re->wrld.aosphere= NULL;
@@ -4756,6 +4814,8 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
/* MAKE RENDER DATA */
database_init_objects(re, lay, 0, 0, 0, 0);
+
+ init_camera_inside_volumes(re);
if(!re->test_break(re->tbh)) {
int tothalo;
@@ -4804,6 +4864,13 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
/* ENVIRONMENT MAPS */
if(!re->test_break(re->tbh))
make_envmaps(re);
+
+ /* point density texture */
+ if(!re->test_break(re->tbh))
+ make_pointdensities(re);
+ /* voxel data texture */
+ if(!re->test_break(re->tbh))
+ make_voxeldata(re);
}
if(!re->test_break(re->tbh))
@@ -4820,6 +4887,11 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
if((re->r.mode & R_SSS) && !re->test_break(re->tbh))
if(re->r.renderer==R_INTERN)
make_sss_tree(re);
+
+ if(!re->test_break(re->tbh))
+ if(re->r.mode & R_RAYTRACE)
+ volume_precache(re);
+
}
if(re->test_break(re->tbh))
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index feef3dd424a..a15377a8c6d 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -630,7 +630,7 @@ static OcclusionTree *occ_tree_build(Render *re)
if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
- if(vlr->mat->mode & MA_TRACEBLE)
+ if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_TYPE_SURFACE))
totface++;
}
}
@@ -663,7 +663,7 @@ static OcclusionTree *occ_tree_build(Render *re)
if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
else vlr++;
- if(vlr->mat->mode & MA_TRACEBLE) {
+ if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_TYPE_SURFACE)) {
tree->face[b].obi= c;
tree->face[b].facenr= a;
tree->occlusion[b]= 1.0f;
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 4a84b1e78b6..a6b089c6029 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -48,6 +48,7 @@
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */
+#include "BKE_sequence.h"
#include "BKE_pointcache.h"
#include "MEM_guardedalloc.h"
@@ -867,33 +868,26 @@ static void renderresult_add_names(RenderResult *rr)
strcpy(rpass->name, get_pass_name(rpass->passtype, -1));
}
-
-/* only for temp buffer files, makes exact copy of render result */
-static void read_render_result(Render *re, int sample)
+/* called for reading temp files, and for external engines */
+static int read_render_result_from_file(char *filename, RenderResult *rr)
{
RenderLayer *rl;
RenderPass *rpass;
void *exrhandle= IMB_exr_get_handle();
int rectx, recty;
- char str[FILE_MAX];
-
- RE_FreeRenderResult(re->result);
- re->result= new_render_result(re, &re->disprect, 0, RR_USEMEM);
- render_unique_exr_name(re, str, sample);
- if(IMB_exr_begin_read(exrhandle, str, &rectx, &recty)==0) {
+ if(IMB_exr_begin_read(exrhandle, filename, &rectx, &recty)==0) {
IMB_exr_close(exrhandle);
- printf("cannot read: %s\n", str);
- return;
+ return 0;
}
- printf("read exr tmp file: %s\n", str);
-
- if(re->result == NULL || rectx!=re->result->rectx || recty!=re->result->recty) {
+ if(rr == NULL || rectx!=rr->rectx || recty!=rr->recty) {
printf("error in reading render result\n");
+ IMB_exr_close(exrhandle);
+ return 0;
}
else {
- for(rl= re->result->layers.first; rl; rl= rl->next) {
+ for(rl= rr->layers.first; rl; rl= rl->next) {
/* combined */
if(rl->rectf) {
@@ -913,10 +907,27 @@ static void read_render_result(Render *re, int sample)
}
IMB_exr_read_channels(exrhandle);
- renderresult_add_names(re->result);
+ renderresult_add_names(rr);
}
IMB_exr_close(exrhandle);
+
+ return 1;
+}
+
+/* only for temp buffer files, makes exact copy of render result */
+static void read_render_result(Render *re, int sample)
+{
+ char str[FILE_MAX];
+
+ RE_FreeRenderResult(re->result);
+ re->result= new_render_result(re, &re->disprect, 0, RR_USEMEM);
+
+ render_unique_exr_name(re, str, sample);
+ printf("read exr tmp file: %s\n", str);
+
+ if(!read_render_result_from_file(str, re->result))
+ printf("cannot read: %s\n", str);
}
/* *************************************************** */
@@ -2303,6 +2314,63 @@ static void renderresult_stampinfo(Scene *scene)
BKE_stamp_buf(scene, (unsigned char *)rres.rect32, rres.rectf, rres.rectx, rres.recty, 4);
}
+static void do_render_seq(Render * re)
+{
+ static int recurs_depth = 0;
+ struct ImBuf *ibuf;
+ RenderResult *rr = re->result;
+ int cfra = re->r.cfra;
+
+ recurs_depth++;
+
+ ibuf= give_ibuf_seq(re->scene, rr->rectx, rr->recty, cfra, 0, 100.0);
+
+ recurs_depth--;
+
+ if(ibuf) {
+ if(ibuf->rect_float) {
+ if (!rr->rectf)
+ rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf");
+
+ memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty);
+
+ /* TSK! Since sequence render doesn't free the *rr render result, the old rect32
+ can hang around when sequence render has rendered a 32 bits one before */
+ if(rr->rect32) {
+ MEM_freeN(rr->rect32);
+ rr->rect32= NULL;
+ }
+ }
+ else if(ibuf->rect) {
+ if (!rr->rect32)
+ rr->rect32= MEM_mallocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
+
+ memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty);
+
+ /* if (ibuf->zbuf) { */
+ /* if (R.rectz) freeN(R.rectz); */
+ /* R.rectz = BLI_dupallocN(ibuf->zbuf); */
+ /* } */
+ }
+
+ if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */
+ Editing * ed = re->scene->ed;
+ if (ed) {
+ free_imbuf_seq(&ed->seqbase, TRUE);
+ }
+ }
+ }
+ else {
+ /* render result is delivered empty in most cases, nevertheless we handle all cases */
+ if (rr->rectf)
+ memset(rr->rectf, 0, 4*sizeof(float)*rr->rectx*rr->recty);
+ else if (rr->rect32)
+ memset(rr->rect32, 0, 4*rr->rectx*rr->recty);
+ else
+ rr->rect32= MEM_callocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
+ }
+}
+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* main loop: doing sequence + fields + blur + 3d render + compositing */
@@ -2316,7 +2384,7 @@ static void do_render_all_options(Render *re)
if((re->r.scemode & R_DOSEQ) && re->scene->ed && re->scene->ed->seqbase.first) {
/* note: do_render_seq() frees rect32 when sequencer returns float images */
if(!re->test_break(re->tbh))
- ; //XXX do_render_seq(re->result, re->r.cfra);
+ do_render_seq(re);
re->stats_draw(re->sdh, &re->i);
re->display_draw(re->ddh, re->result, NULL);
@@ -2502,8 +2570,15 @@ static int render_initialize_from_scene(Render *re, Scene *scene, int anim, int
/* check all scenes involved */
tag_scenes_for_render(re);
- /* make sure dynamics are up to date */
- update_physics_cache(re, scene, anim_init);
+ /*
+ * Disabled completely for now,
+ * can be later set as render profile option
+ * and default for background render.
+ */
+ if(0) {
+ /* make sure dynamics are up to date */
+ update_physics_cache(re, scene, anim_init);
+ }
if(scene->r.scemode & R_SINGLE_LAYER)
push_render_result(re);
@@ -2634,7 +2709,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra)
re->result_ok= 0;
if(BKE_imtype_is_movie(scene->r.imtype))
- mh->start_movie(&re->r, re->rectx, re->recty);
+ mh->start_movie(scene, &re->r, re->rectx, re->recty);
if (mh->get_next_frame) {
while (!(G.afbreek == 1)) {
@@ -2879,7 +2954,7 @@ void RE_engine_update_stats(RenderEngine *engine, char *stats, char *info)
/* loads in image into a result, size must match
* x/y offsets are only used on a partial copy when dimensions dont match */
-void RE_layer_rect_from_file(RenderLayer *layer, ReportList *reports, char *filename, int x, int y)
+void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, char *filename)
{
ImBuf *ibuf = IMB_loadiffname(filename, IB_rect);
@@ -2890,7 +2965,7 @@ void RE_layer_rect_from_file(RenderLayer *layer, ReportList *reports, char *file
memcpy(layer->rectf, ibuf->rect_float, sizeof(float)*4*layer->rectx*layer->recty);
} else {
- if ((ibuf->x - x >= layer->rectx) && (ibuf->y - y >= layer->recty)) {
+ if ((ibuf->x >= layer->rectx) && (ibuf->y >= layer->recty)) {
ImBuf *ibuf_clip;
if(ibuf->rect_float==NULL)
@@ -2898,7 +2973,7 @@ void RE_layer_rect_from_file(RenderLayer *layer, ReportList *reports, char *file
ibuf_clip = IMB_allocImBuf(layer->rectx, layer->recty, 32, IB_rectfloat, 0);
if(ibuf_clip) {
- IMB_rectcpy(ibuf_clip, ibuf, 0,0, x,y, layer->rectx, layer->recty);
+ IMB_rectcpy(ibuf_clip, ibuf, 0,0, 0,0, layer->rectx, layer->recty);
memcpy(layer->rectf, ibuf_clip->rect_float, sizeof(float)*4*layer->rectx*layer->recty);
IMB_freeImBuf(ibuf_clip);
@@ -2918,6 +2993,15 @@ void RE_layer_rect_from_file(RenderLayer *layer, ReportList *reports, char *file
BKE_reportf(reports, RPT_ERROR, "RE_result_rect_from_file: failed to load '%s'\n", filename);
}
}
+
+void RE_result_load_from_file(RenderResult *result, ReportList *reports, char *filename)
+{
+ if(!read_render_result_from_file(filename, result)) {
+ BKE_reportf(reports, RPT_ERROR, "RE_result_rect_from_file: failed to load '%s'\n", filename);
+ return;
+ }
+}
+
static void external_render_3d(Render *re, RenderEngineType *type)
{
RenderEngine engine;
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
new file mode 100644
index 00000000000..5f8cf5504fa
--- /dev/null
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -0,0 +1,484 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributors: Matt Ebb
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "BLI_kdopbvh.h"
+
+#include "BKE_DerivedMesh.h"
+#include "BKE_global.h"
+#include "BKE_lattice.h"
+#include "BKE_main.h"
+#include "BKE_object.h"
+#include "BKE_particle.h"
+#include "BKE_texture.h"
+
+#include "DNA_texture_types.h"
+#include "DNA_particle_types.h"
+
+#include "render_types.h"
+#include "renderdatabase.h"
+#include "texture.h"
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */
+/* only to be used here in this file, it's for speed */
+extern struct Render R;
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+
+static int point_data_used(PointDensity *pd)
+{
+ int pd_bitflag = 0;
+
+ if ((pd->noise_influence == TEX_PD_NOISE_VEL) || (pd->color_source == TEX_PD_COLOR_PARTVEL) || (pd->color_source == TEX_PD_COLOR_PARTSPEED))
+ pd_bitflag |= POINT_DATA_VEL;
+ if ((pd->noise_influence == TEX_PD_NOISE_AGE) || (pd->color_source == TEX_PD_COLOR_PARTAGE))
+ pd_bitflag |= POINT_DATA_LIFE;
+
+ return pd_bitflag;
+}
+
+
+/* additional data stored alongside the point density BVH,
+ * accessible by point index number to retrieve other information
+ * such as particle velocity or lifetime */
+static void alloc_point_data(PointDensity *pd, int total_particles, int point_data_used)
+{
+ int data_size = 0;
+
+ if (point_data_used & POINT_DATA_VEL) {
+ /* store 3 channels of velocity data */
+ data_size += 3;
+ }
+ if (point_data_used & POINT_DATA_LIFE) {
+ /* store 1 channel of lifetime data */
+ data_size += 1;
+ }
+
+ if (data_size)
+ pd->point_data = MEM_mallocN(sizeof(float)*data_size*total_particles, "particle point data");
+}
+
+static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, ParticleSystem *psys)
+{
+ DerivedMesh* dm;
+ ParticleKey state;
+ ParticleData *pa=NULL;
+ float cfra = bsystem_time(re->scene, ob, (float)re->scene->r.cfra, 0.0);
+ int i, childexists;
+ int total_particles, offset=0;
+ int data_used = point_data_used(pd);
+ float partco[3];
+ float obview[4][4];
+
+
+ /* init everything */
+ if (!psys || !ob || !pd) return;
+
+ Mat4MulMat4(obview, re->viewinv, ob->obmat);
+
+ /* Just to create a valid rendering context for particles */
+ psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy, 0);
+
+ dm = mesh_create_derived_render(re->scene, ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
+
+ if ( !psys_check_enabled(ob, psys)) {
+ psys_render_restore(ob, psys);
+ return;
+ }
+
+ /* in case ob->imat isn't up-to-date */
+ Mat4Invert(ob->imat, ob->obmat);
+
+ total_particles = psys->totpart+psys->totchild;
+ psys->lattice=psys_get_lattice(re->scene,ob,psys);
+
+ pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 4, 6);
+ alloc_point_data(pd, total_particles, data_used);
+ pd->totpoints = total_particles;
+ if (data_used & POINT_DATA_VEL) offset = pd->totpoints*3;
+
+ if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT))
+ childexists = 1;
+
+ for (i=0, pa=psys->particles; i < total_particles; i++, pa++) {
+
+ state.time = cfra;
+ if(psys_get_particle_state(re->scene, ob, psys, i, &state, 0)) {
+
+ VECCOPY(partco, state.co);
+
+ if (pd->psys_cache_space == TEX_PD_OBJECTSPACE)
+ Mat4MulVecfl(ob->imat, partco);
+ else if (pd->psys_cache_space == TEX_PD_OBJECTLOC) {
+ float obloc[3];
+ VECCOPY(obloc, ob->loc);
+ VecSubf(partco, partco, obloc);
+ } else {
+ /* TEX_PD_WORLDSPACE */
+ }
+
+ BLI_bvhtree_insert(pd->point_tree, i, partco, 1);
+
+ if (data_used & POINT_DATA_VEL) {
+ pd->point_data[i*3 + 0] = state.vel[0];
+ pd->point_data[i*3 + 1] = state.vel[1];
+ pd->point_data[i*3 + 2] = state.vel[2];
+ }
+ if (data_used & POINT_DATA_LIFE) {
+ float pa_time;
+
+ if (i < psys->totpart) {
+ pa_time = (cfra - pa->time)/pa->lifetime;
+ } else {
+ ChildParticle *cpa= (psys->child + i) - psys->totpart;
+ float pa_birthtime, pa_dietime;
+
+ pa_time = psys_get_child_time(psys, cpa, cfra, &pa_birthtime, &pa_dietime);
+ }
+
+ pd->point_data[offset + i] = pa_time;
+ }
+ }
+ }
+
+ BLI_bvhtree_balance(pd->point_tree);
+ dm->release(dm);
+
+ if(psys->lattice){
+ end_latt_deform(psys->lattice);
+ psys->lattice=0;
+ }
+
+ psys_render_restore(ob, psys);
+}
+
+
+static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *obr)
+{
+ int i;
+
+ if (!obr || !pd) return;
+ if(!obr->vertnodes) return;
+
+ /* in case ob->imat isn't up-to-date */
+ Mat4Invert(obr->ob->imat, obr->ob->obmat);
+
+ pd->point_tree = BLI_bvhtree_new(obr->totvert, 0.0, 4, 6);
+ pd->totpoints = obr->totvert;
+
+ for(i=0; i<obr->totvert; i++) {
+ float ver_co[3];
+ VertRen *ver= RE_findOrAddVert(obr, i);
+
+ VECCOPY(ver_co, ver->co);
+ Mat4MulVecfl(re->viewinv, ver_co);
+
+ if (pd->ob_cache_space == TEX_PD_OBJECTSPACE) {
+ Mat4MulVecfl(obr->ob->imat, ver_co);
+ } else if (pd->psys_cache_space == TEX_PD_OBJECTLOC) {
+ VecSubf(ver_co, ver_co, obr->ob->loc);
+ } else {
+ /* TEX_PD_WORLDSPACE */
+ }
+
+ BLI_bvhtree_insert(pd->point_tree, i, ver_co, 1);
+ }
+
+ BLI_bvhtree_balance(pd->point_tree);
+
+}
+static void cache_pointdensity(Render *re, Tex *tex)
+{
+ PointDensity *pd = tex->pd;
+
+ if (pd->point_tree) {
+ BLI_bvhtree_free(pd->point_tree);
+ pd->point_tree = NULL;
+ }
+
+ if (pd->source == TEX_PD_PSYS) {
+ Object *ob = pd->object;
+
+ if (!ob) return;
+ if (!pd->psys) return;
+
+ pointdensity_cache_psys(re, pd, ob, pd->psys);
+ }
+ else if (pd->source == TEX_PD_OBJECT) {
+ Object *ob = pd->object;
+ ObjectRen *obr;
+ int found=0;
+
+ /* find the obren that corresponds to the object */
+ for (obr=re->objecttable.first; obr; obr=obr->next) {
+ if (obr->ob == ob) {
+ found=1;
+ break;
+ }
+ }
+ if (!found) return;
+
+ pointdensity_cache_object(re, pd, obr);
+ }
+}
+
+static void free_pointdensity(Render *re, Tex *tex)
+{
+ PointDensity *pd = tex->pd;
+
+ if (!pd) return;
+
+ if (pd->point_tree) {
+ BLI_bvhtree_free(pd->point_tree);
+ pd->point_tree = NULL;
+ }
+
+ if (pd->point_data) {
+ MEM_freeN(pd->point_data);
+ pd->point_data = NULL;
+ }
+ pd->totpoints = 0;
+}
+
+
+
+void make_pointdensities(Render *re)
+{
+ Tex *tex;
+
+ if(re->scene->r.scemode & R_PREVIEWBUTS)
+ return;
+
+ re->i.infostr= "Caching Point Densities";
+ re->stats_draw(re->sdh, &re->i);
+
+ for (tex= G.main->tex.first; tex; tex= tex->id.next) {
+ if(tex->id.us && tex->type==TEX_POINTDENSITY) {
+ cache_pointdensity(re, tex);
+ }
+ }
+
+ re->i.infostr= NULL;
+ re->stats_draw(re->sdh, &re->i);
+}
+
+void free_pointdensities(Render *re)
+{
+ Tex *tex;
+
+ if(re->scene->r.scemode & R_PREVIEWBUTS)
+ return;
+
+ for (tex= G.main->tex.first; tex; tex= tex->id.next) {
+ if(tex->id.us && tex->type==TEX_POINTDENSITY) {
+ free_pointdensity(re, tex);
+ }
+ }
+}
+
+typedef struct PointDensityRangeData
+{
+ float *density;
+ float squared_radius;
+ float *point_data;
+ float *vec;
+ float softness;
+ short falloff_type;
+ short noise_influence;
+ float *age;
+ int point_data_used;
+ int offset;
+} PointDensityRangeData;
+
+void accum_density(void *userdata, int index, float squared_dist)
+{
+ PointDensityRangeData *pdr = (PointDensityRangeData *)userdata;
+ const float dist = (pdr->squared_radius - squared_dist) / pdr->squared_radius * 0.5f;
+ float density = 0.0f;
+
+ if (pdr->falloff_type == TEX_PD_FALLOFF_STD)
+ density = dist;
+ else if (pdr->falloff_type == TEX_PD_FALLOFF_SMOOTH)
+ density = 3.0f*dist*dist - 2.0f*dist*dist*dist;
+ else if (pdr->falloff_type == TEX_PD_FALLOFF_SOFT)
+ density = pow(dist, pdr->softness);
+ else if (pdr->falloff_type == TEX_PD_FALLOFF_CONSTANT)
+ density = pdr->squared_radius;
+ else if (pdr->falloff_type == TEX_PD_FALLOFF_ROOT)
+ density = sqrt(dist);
+
+ if (pdr->point_data_used & POINT_DATA_VEL) {
+ pdr->vec[0] += pdr->point_data[index*3 + 0]; //* density;
+ pdr->vec[1] += pdr->point_data[index*3 + 1]; //* density;
+ pdr->vec[2] += pdr->point_data[index*3 + 2]; //* density;
+ }
+ if (pdr->point_data_used & POINT_DATA_LIFE) {
+ *pdr->age += pdr->point_data[pdr->offset + index]; // * density;
+ }
+
+ *pdr->density += density;
+}
+
+
+static void init_pointdensityrangedata(PointDensity *pd, PointDensityRangeData *pdr, float *density, float *vec, float *age)
+{
+ pdr->squared_radius = pd->radius*pd->radius;
+ pdr->density = density;
+ pdr->point_data = pd->point_data;
+ pdr->falloff_type = pd->falloff_type;
+ pdr->vec = vec;
+ pdr->age = age;
+ pdr->softness = pd->falloff_softness;
+ pdr->noise_influence = pd->noise_influence;
+ pdr->point_data_used = point_data_used(pd);
+ pdr->offset = (pdr->point_data_used & POINT_DATA_VEL)?pd->totpoints*3:0;
+}
+
+
+int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
+{
+ int retval = TEX_INT;
+ PointDensity *pd = tex->pd;
+ PointDensityRangeData pdr;
+ float density=0.0f, age=0.0f, time=0.0f;
+ float vec[3] = {0.0f, 0.0f, 0.0f}, co[3];
+ float col[4];
+ float turb, noise_fac;
+ int num=0;
+
+ texres->tin = 0.0f;
+
+ if ((!pd) || (!pd->point_tree))
+ return 0;
+
+ init_pointdensityrangedata(pd, &pdr, &density, vec, &age);
+ noise_fac = pd->noise_fac * 0.5f; /* better default */
+
+ VECCOPY(co, texvec);
+
+ if (point_data_used(pd)) {
+ /* does a BVH lookup to find accumulated density and additional point data *
+ * stores particle velocity vector in 'vec', and particle lifetime in 'time' */
+ num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr);
+ if (num > 0) {
+ age /= num;
+ VecMulf(vec, 1.0f/num);
+ }
+
+ /* reset */
+ density = vec[0] = vec[1] = vec[2] = 0.0f;
+ }
+
+ if (pd->flag & TEX_PD_TURBULENCE) {
+
+ if (pd->noise_influence == TEX_PD_NOISE_AGE) {
+ turb = BLI_gTurbulence(pd->noise_size, texvec[0]+age, texvec[1]+age, texvec[2]+age, pd->noise_depth, 0, pd->noise_basis);
+ }
+ else if (pd->noise_influence == TEX_PD_NOISE_TIME) {
+ time = R.cfra / (float)R.r.efra;
+ turb = BLI_gTurbulence(pd->noise_size, texvec[0]+time, texvec[1]+time, texvec[2]+time, pd->noise_depth, 0, pd->noise_basis);
+ //turb = BLI_turbulence(pd->noise_size, texvec[0]+time, texvec[1]+time, texvec[2]+time, pd->noise_depth);
+ }
+ else {
+ turb = BLI_gTurbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth, 0, pd->noise_basis);
+ }
+
+ turb -= 0.5f; /* re-center 0.0-1.0 range around 0 to prevent offsetting result */
+
+ /* now we have an offset coordinate to use for the density lookup */
+ co[0] = texvec[0] + noise_fac * turb;
+ co[1] = texvec[1] + noise_fac * turb;
+ co[2] = texvec[2] + noise_fac * turb;
+ }
+
+ /* BVH query with the potentially perturbed coordinates */
+ num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr);
+ if (num > 0) {
+ age /= num;
+ VecMulf(vec, 1.0f/num);
+ }
+
+ texres->tin = density;
+ BRICONT;
+
+ if (pd->color_source == TEX_PD_COLOR_CONSTANT)
+ return retval;
+
+ retval |= TEX_RGB;
+
+ switch (pd->color_source) {
+ case TEX_PD_COLOR_PARTAGE:
+ if (pd->coba) {
+ if (do_colorband(pd->coba, age, col)) {
+ texres->talpha= 1;
+ VECCOPY(&texres->tr, col);
+ texres->tin *= col[3];
+ texres->ta = texres->tin;
+ }
+ }
+ break;
+ case TEX_PD_COLOR_PARTSPEED:
+ {
+ float speed = VecLength(vec) * pd->speed_scale;
+
+ if (pd->coba) {
+ if (do_colorband(pd->coba, speed, col)) {
+ texres->talpha= 1;
+ VECCOPY(&texres->tr, col);
+ texres->tin *= col[3];
+ texres->ta = texres->tin;
+ }
+ }
+ break;
+ }
+ case TEX_PD_COLOR_PARTVEL:
+ texres->talpha= 1;
+ VecMulf(vec, pd->speed_scale);
+ VECCOPY(&texres->tr, vec);
+ texres->ta = texres->tin;
+ break;
+ case TEX_PD_COLOR_CONSTANT:
+ default:
+ texres->tr = texres->tg = texres->tb = texres->ta = 1.0f;
+ break;
+ }
+ BRICONTRGB;
+
+ return retval;
+
+ /*
+ if (texres->nor!=NULL) {
+ texres->nor[0] = texres->nor[1] = texres->nor[2] = 0.0f;
+ }
+ */
+}
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 010930fcb85..d2599f6050c 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -54,6 +54,7 @@
#include "pixelshading.h"
#include "shading.h"
#include "texture.h"
+#include "volumetric.h"
#include "RE_raytrace.h"
@@ -95,6 +96,17 @@ static int vlr_check_intersect(Isect *is, int ob, RayFace *face)
return (is->lay & obi->lay);
}
+static int vlr_check_intersect_solid(Isect *is, int ob, RayFace *face)
+{
+ VlakRen *vlr = (VlakRen*)face;
+
+ /* solid material types only */
+ if (vlr->mat->material_type == MA_TYPE_SURFACE)
+ return 1;
+ else
+ return 0;
+}
+
static float *vlr_get_transform(void *userdata, int i)
{
ObjectInstanceRen *obi= RAY_OBJECT_GET((Render*)userdata, i);
@@ -205,7 +217,7 @@ void makeraytree(Render *re)
re->stats_draw(re->sdh, &re->i);
}
-static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
+void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
{
VlakRen *vlr= (VlakRen*)is->face;
ObjectInstanceRen *obi= RAY_OBJECT_GET(&R, is->ob);
@@ -260,8 +272,14 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
shade_input_flip_normals(shi);
shade_input_set_shade_texco(shi);
-
- if(is->mode==RE_RAY_SHADOW_TRA) {
+ if (shi->mat->material_type == MA_TYPE_VOLUME) {
+ if(ELEM(is->mode, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA)) {
+ shade_volume_shadow(shi, shr, is);
+ } else {
+ shade_volume_outside(shi, shr);
+ }
+ }
+ else if(is->mode==RE_RAY_SHADOW_TRA) {
/* temp hack to prevent recursion */
if(shi->nodes==0 && shi->mat->nodetree && shi->mat->use_nodes) {
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
@@ -275,9 +293,20 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
shi->mat= vlr->mat; /* shi->mat is being set in nodetree */
}
- else
- shade_material_loop(shi, shr);
-
+ else {
+ int tempdepth;
+ /* XXX dodgy business here, set ray depth to -1
+ * to ignore raytrace in shade_material_loop()
+ * this could really use a refactor --Matt */
+ if (shi->volume_depth == 0) {
+ tempdepth = shi->depth;
+ shi->depth = -1;
+ shade_material_loop(shi, shr);
+ shi->depth = tempdepth;
+ } else {
+ shade_material_loop(shi, shr);
+ }
+ }
/* raytrace likes to separate the spec color */
VECSUB(shr->diff, shr->combined, shr->spec);
}
@@ -361,7 +390,7 @@ static float shade_by_transmission(Isect *is, ShadeInput *shi, ShadeResult *shr)
{
float dx, dy, dz, d, p;
- if (0 == (shi->mat->mode & (MA_RAYTRANSP|MA_ZTRA)))
+ if (0 == (shi->mat->mode & MA_TRANSP))
return -1;
if (shi->mat->tx_limit <= 0.0f) {
@@ -468,7 +497,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo
if(depth>0) {
- if(shi.mat->mode_l & (MA_RAYTRANSP|MA_ZTRA) && shr.alpha < 1.0f) {
+ if((shi.mat->mode_l & MA_TRANSP) && shr.alpha < 1.0f) {
float nf, f, f1, refract[3], tracol[4];
tracol[0]= shi.r;
@@ -476,7 +505,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo
tracol[2]= shi.b;
tracol[3]= col[3]; // we pass on and accumulate alpha
- if(shi.mat->mode & MA_RAYTRANSP) {
+ if((shi.mat->mode & MA_TRANSP) && (shi.mat->mode & MA_RAYTRANSP)) {
/* odd depths: use normal facing viewer, otherwise flip */
if(traflag & RAY_TRAFLIP) {
float norm[3];
@@ -1183,7 +1212,7 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
float diff[3];
int do_tra, do_mir;
- do_tra= ((shi->mat->mode & (MA_RAYTRANSP)) && shr->alpha!=1.0f);
+ do_tra= ((shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_RAYTRANSP) && shr->alpha!=1.0f);
do_mir= ((shi->mat->mode & MA_RAYMIRROR) && shi->ray_mirror!=0.0f);
@@ -1238,15 +1267,20 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
}
if(shi->combinedflag & SCE_PASS_REFLECT) {
+ /* values in shr->spec can be greater then 1.0.
+ * In this case the mircol uses a zero blending factor, so ignoring it is ok.
+ * Fixes bug #18837 - when the spec is higher then 1.0,
+ * diff can become a negative color - Campbell */
- f= fr*(1.0f-shr->spec[0]); f1= 1.0f-i;
- diff[0]= f*mircol[0] + f1*diff[0];
+ f1= 1.0f-i;
- f= fg*(1.0f-shr->spec[1]); f1= 1.0f-i;
- diff[1]= f*mircol[1] + f1*diff[1];
+ diff[0] *= f1;
+ diff[1] *= f1;
+ diff[2] *= f1;
- f= fb*(1.0f-shr->spec[2]); f1= 1.0f-i;
- diff[2]= f*mircol[2] + f1*diff[2];
+ if(shr->spec[0]<1.0f) diff[0] += mircol[0] * (fr*(1.0f-shr->spec[0]));
+ if(shr->spec[1]<1.0f) diff[1] += mircol[1] * (fg*(1.0f-shr->spec[1]));
+ if(shr->spec[2]<1.0f) diff[2] += mircol[2] * (fb*(1.0f-shr->spec[2]));
}
}
}
@@ -1302,11 +1336,15 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int
shi.nodes= origshi->nodes;
shade_ray(is, &shi, &shr);
- if (traflag & RAY_TRA)
- d= shade_by_transmission(is, &shi, &shr);
-
- /* mix colors based on shadfac (rgb + amount of light factor) */
- addAlphaLight(is->col, shr.diff, shr.alpha, d*shi.mat->filter);
+ if (shi.mat->material_type == MA_TYPE_SURFACE) {
+ if (traflag & RAY_TRA)
+ d= shade_by_transmission(is, &shi, &shr);
+
+ /* mix colors based on shadfac (rgb + amount of light factor) */
+ addAlphaLight(is->col, shr.diff, shr.alpha, d*shi.mat->filter);
+ } else if (shi.mat->material_type == MA_TYPE_VOLUME) {
+ addAlphaLight(is->col, shr.combined, shr.alpha, 1.0f);
+ }
if(depth>0 && is->col[3]>0.0f) {
@@ -1607,7 +1645,7 @@ static void ray_ao_qmc(ShadeInput *shi, float *shadfac)
prev = fac;
- if(RE_ray_tree_intersect(R.raytree, &isec)) {
+ if(RE_ray_tree_intersect_check(R.raytree, &isec, vlr_check_intersect_solid)) {
if (R.wrld.aomode & WO_AODIST) fac+= exp(-isec.labda*R.wrld.aodistfac);
else fac+= 1.0f;
}
@@ -1732,7 +1770,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float *shadfac)
isec.end[2] = shi->co[2] - maxdist*vec[2];
/* do the trace */
- if(RE_ray_tree_intersect(R.raytree, &isec)) {
+ if(RE_ray_tree_intersect_check(R.raytree, &isec, vlr_check_intersect_solid)) {
if (R.wrld.aomode & WO_AODIST) sh+= exp(-isec.labda*R.wrld.aodistfac);
else sh+= 1.0f;
}
diff --git a/source/blender/render/intern/source/raytrace.c b/source/blender/render/intern/source/raytrace.c
index 09d3711885a..b34fe6a7039 100644
--- a/source/blender/render/intern/source/raytrace.c
+++ b/source/blender/render/intern/source/raytrace.c
@@ -931,7 +931,7 @@ int RE_ray_face_intersection(Isect *is, RayObjectTransformFunc transformfunc, Ra
intersection to be detected in its neighbour face */
if(is->facecontr && is->faceisect); // optimizing, the tests below are not needed
- else if(is->labda< .1) {
+ else if(is->labda< .1 && is->faceorig) {
RayFace *face= is->faceorig;
float *origv1, *origv2, *origv3, *origv4;
short de= 0;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 3a3d6f57830..5db81288c1e 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -477,7 +477,7 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
col= shr->refr;
break;
case SCE_PASS_RADIO:
- col= shr->rad;
+ col= NULL; // removed shr->rad;
break;
case SCE_PASS_NORMAL:
col= shr->nor;
@@ -569,7 +569,7 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult
col= shr->refr;
break;
case SCE_PASS_RADIO:
- col= shr->rad;
+ col= NULL; // removed shr->rad;
break;
case SCE_PASS_NORMAL:
col= shr->nor;
@@ -2234,7 +2234,7 @@ static int bake_check_intersect(Isect *is, int ob, RayFace *face)
/* no direction checking for now, doesn't always improve the result
* (INPR(shi->facenor, bs->dir) > 0.0f); */
- return (R.objectinstance[ob].obr->ob != bs->actob);
+ return (R.objectinstance[ob & ~RE_RAY_TRANSFORM_OFFS].obr->ob != bs->actob);
}
static int bake_intersect_tree(RayTree* raytree, Isect* isect, float *start, float *dir, float sign, float *hitco, float *dist)
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index c860e9ac5d1..1a0edfd53ed 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -52,6 +52,7 @@
#include "shading.h"
#include "strand.h"
#include "texture.h"
+#include "volumetric.h"
#include "zbuf.h"
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@@ -156,16 +157,21 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
/* depth >= 1 when ray-shading */
if(shi->depth==0) {
if(R.r.mode & R_RAYTRACE) {
- if(shi->ray_mirror!=0.0f || ((shi->mat->mode & MA_RAYTRANSP) && shr->alpha!=1.0f)) {
+ if(shi->ray_mirror!=0.0f || ((shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_RAYTRANSP) && shr->alpha!=1.0f)) {
/* ray trace works on combined, but gives pass info */
ray_trace(shi, shr);
}
}
/* disable adding of sky for raytransp */
- if(shi->mat->mode & MA_RAYTRANSP)
+ if((shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_RAYTRANSP))
if((shi->layflag & SCE_LAY_SKY) && (R.r.alphamode==R_ADDSKY))
shr->alpha= 1.0f;
}
+
+ if(R.r.mode & R_RAYTRACE) {
+ if (R.render_volumes_inside.first)
+ shade_volume_inside(shi, shr);
+ }
}
@@ -183,14 +189,18 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
/* copy all relevant material vars, note, keep this synced with render_types.h */
shade_input_init_material(shi);
- shade_material_loop(shi, shr);
+ if (shi->mat->material_type == MA_TYPE_VOLUME) {
+ if(R.r.mode & R_RAYTRACE)
+ shade_volume_outside(shi, shr);
+ } else { /* MA_TYPE_SURFACE, MA_TYPE_WIRE */
+ shade_material_loop(shi, shr);
+ }
}
/* copy additional passes */
if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL|SCE_PASS_RADIO)) {
QUATCOPY(shr->winspeed, shi->winspeed);
VECCOPY(shr->nor, shi->vn);
- VECCOPY(shr->rad, shi->rad);
}
/* MIST */
@@ -211,11 +221,12 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
if(shr->alpha!=1.0f || alpha!=1.0f) {
float fac= alpha*(shr->alpha);
shr->combined[3]= fac;
- shr->combined[0]*= fac;
- shr->combined[1]*= fac;
- shr->combined[2]*= fac;
+
+ if (shi->mat->material_type!= MA_TYPE_VOLUME)
+ VecMulf(shr->combined, fac);
}
- else shr->combined[3]= 1.0f;
+ else
+ shr->combined[3]= 1.0f;
/* add z */
shr->z= -shi->co[2];
@@ -558,10 +569,6 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
shi->orn[2]= -shi->vn[2];
}
- if(mode & MA_RADIO) {
- /* not supported */
- }
-
if(texco & TEXCO_REFL) {
/* mirror reflection color textures (and envmap) */
calc_R_ref(shi); /* wrong location for normal maps! XXXXXXXXXXXXXX */
@@ -580,8 +587,6 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
}
- shi->rad[0]= shi->rad[1]= shi->rad[2]= 0.0f;
-
/* this only avalailable for scanline renders */
if(shi->depth==0) {
if(texco & TEXCO_WINDOW) {
@@ -705,6 +710,10 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float *
}
}
+ /* set camera coords - for scanline, it's always 0.0,0.0,0.0 (render is in camera space)
+ * however for raytrace it can be different - the position of the last intersection */
+ shi->camera_co[0] = shi->camera_co[1] = shi->camera_co[2] = 0.0f;
+
/* cannot normalize earlier, code above needs it at viewplane level */
Normalize(view);
}
@@ -1154,24 +1163,6 @@ void shade_input_set_shade_texco(ShadeInput *shi)
shi->orn[2]= -shi->vn[2];
}
- if(mode & MA_RADIO) {
- float *r1, *r2, *r3;
-
- r1= RE_vertren_get_rad(obr, v1, 0);
- r2= RE_vertren_get_rad(obr, v2, 0);
- r3= RE_vertren_get_rad(obr, v3, 0);
-
- if(r1 && r2 && r3) {
- shi->rad[0]= (l*r3[0] - u*r1[0] - v*r2[0]);
- shi->rad[1]= (l*r3[1] - u*r1[1] - v*r2[1]);
- shi->rad[2]= (l*r3[2] - u*r1[2] - v*r2[2]);
- }
- else
- shi->rad[0]= shi->rad[1]= shi->rad[2]= 0.0f;
- }
- else
- shi->rad[0]= shi->rad[1]= shi->rad[2]= 0.0f;
-
if(texco & TEXCO_REFL) {
/* mirror reflection color textures (and envmap) */
calc_R_ref(shi); /* wrong location for normal maps! XXXXXXXXXXXXXX */
@@ -1199,8 +1190,6 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
}
}
- else
- shi->rad[0]= shi->rad[1]= shi->rad[2]= 0.0f;
/* this only avalailable for scanline renders */
if(shi->depth==0) {
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 2fbd93df0ce..2f6f86e9a09 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -58,7 +58,7 @@
extern struct Render R;
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-static ListBase *get_lights(ShadeInput *shi)
+ListBase *get_lights(ShadeInput *shi)
{
if(R.r.scemode & R_PREVIEWBUTS)
@@ -1713,7 +1713,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shi->alpha*= fresnel_fac(shi->view, shi->vn, ma->fresnel_tra_i, ma->fresnel_tra);
/* note: shi->mode! */
- if(shi->mode & (MA_ZTRA|MA_RAYTRANSP)) {
+ if(shi->mode & MA_TRANSP) {
if(shi->spectra!=0.0f) {
float t = MAX3(shr->spec[0], shr->spec[1], shr->spec[2]);
t *= shi->spectra;
@@ -1730,11 +1730,12 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shr->combined[1]+= shi->ambg;
shr->combined[2]+= shi->ambb;
+ /* removed
if(shi->combinedflag & SCE_PASS_RADIO) {
shr->combined[0]+= shi->r*shi->amb*shi->rad[0];
shr->combined[1]+= shi->g*shi->amb*shi->rad[1];
shr->combined[2]+= shi->b*shi->amb*shi->rad[2];
- }
+ }*/
/* add AO in combined? */
if(R.wrld.mode & WO_AMB_OCC) {
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index a47fef840ca..6e2a0e966dc 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -234,8 +234,8 @@ void interpolate_shade_result(ShadeResult *shr1, ShadeResult *shr2, float t, Sha
interpolate_vec3(shr1->refl, shr2->refl, t, negt, shr->refl);
if(addpassflag & SCE_PASS_REFRACT)
interpolate_vec3(shr1->refr, shr2->refr, t, negt, shr->refr);
- if(addpassflag & SCE_PASS_RADIO)
- interpolate_vec3(shr1->rad, shr2->rad, t, negt, shr->rad);
+ /* removed if(addpassflag & SCE_PASS_RADIO)
+ interpolate_vec3(shr1->rad, shr2->rad, t, negt, shr->rad);*/
if(addpassflag & SCE_PASS_MIST)
interpolate_vec1(&shr1->mist, &shr2->mist, t, negt, &shr->mist);
}
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index bb491efdaba..c706c6ccc11 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -65,6 +65,8 @@
#include "BKE_ipo.h"
#include "envmap.h"
+#include "pointdensity.h"
+#include "voxeldata.h"
#include "renderpipeline.h"
#include "render_types.h"
#include "rendercore.h"
@@ -714,12 +716,12 @@ static float voronoiTex(Tex *tex, float *texvec, TexResult *texres)
/* ------------------------------------------------------------------------- */
-static int evalnodes(Tex *tex, float *texvec, TexResult *texres, short thread, short which_output)
+static int evalnodes(Tex *tex, float *texvec, float *dxt, float *dyt, TexResult *texres, short thread, short which_output)
{
short rv = TEX_INT;
bNodeTree *nodes = tex->nodetree;
- ntreeTexExecTree(nodes, texres, texvec, 0, thread, tex, which_output, R.r.cfra);
+ ntreeTexExecTree(nodes, texres, texvec, dxt, dyt, thread, tex, which_output, R.r.cfra);
if(texres->nor) rv |= TEX_NOR;
rv |= TEX_RGB;
@@ -1180,7 +1182,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
texres->talpha= 0; /* is set when image texture returns alpha (considered premul) */
if(tex->use_nodes && tex->nodetree) {
- retval = evalnodes(tex, texvec, texres, thread, which_output);
+ retval = evalnodes(tex, texvec, dxt, dyt, texres, thread, which_output);
}
else
switch(tex->type) {
@@ -1262,6 +1264,13 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
retval= mg_distNoiseTex(tex, tmpvec, texres);
break;
+ case TEX_POINTDENSITY:
+ retval= pointdensitytex(tex, texvec, texres);
+ break;
+ case TEX_VOXELDATA:
+ retval= voxeldatatex(tex, texvec, texres);
+ break;
+
}
if (tex->flag & TEX_COLORBAND) {
@@ -1272,7 +1281,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex,
texres->tg= col[1];
texres->tb= col[2];
texres->ta= col[3];
- retval |= 1;
+ retval |= TEX_RGB;
}
}
return retval;
@@ -2248,6 +2257,187 @@ void do_material_tex(ShadeInput *shi)
}
}
+
+void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val)
+{
+ MTex *mtex;
+ Tex *tex;
+ TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
+ int tex_nr, rgbnor= 0;
+ float co[3], texvec[3];
+ float fact, stencilTin=1.0;
+
+ if (R.r.scemode & R_NO_TEX) return;
+ /* here: test flag if there's a tex (todo) */
+
+ for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ /* separate tex switching */
+ if(shi->mat->septex & (1<<tex_nr)) continue;
+
+ if(shi->mat->mtex[tex_nr]) {
+ mtex= shi->mat->mtex[tex_nr];
+ tex= mtex->tex;
+ if(tex==0) continue;
+
+ /* only process if this texture is mapped
+ * to one that we're interested in */
+ if (!(mtex->mapto & mapto_flag)) continue;
+
+ /* which coords */
+ if(mtex->texco==TEXCO_OBJECT) {
+ Object *ob= mtex->object;
+ ob= mtex->object;
+ if(ob) {
+ VECCOPY(co, xyz);
+ if(mtex->texflag & MTEX_OB_DUPLI_ORIG) {
+ if(shi->obi && shi->obi->duplitexmat)
+ MTC_Mat4MulVecfl(shi->obi->duplitexmat, co);
+ }
+ MTC_Mat4MulVecfl(ob->imat, co);
+ }
+ }
+ /* not really orco, but 'local' */
+ else if(mtex->texco==TEXCO_ORCO) {
+
+ if(mtex->texflag & MTEX_DUPLI_MAPTO) {
+ VECCOPY(co, shi->duplilo);
+ }
+ else {
+ Object *ob= shi->obi->ob;
+ VECCOPY(co, xyz);
+ MTC_Mat4MulVecfl(ob->imat, co);
+ }
+ }
+ else if(mtex->texco==TEXCO_GLOB) {
+ VECCOPY(co, xyz);
+ MTC_Mat4MulVecfl(R.viewinv, co);
+ }
+ else continue; // can happen when texco defines disappear and it renders old files
+
+ texres.nor= NULL;
+
+ if(tex->type==TEX_IMAGE) {
+ continue; /* not supported yet */
+ //do_2d_mapping(mtex, texvec, NULL, NULL, dxt, dyt);
+ }
+ else {
+ /* placement */
+ if(mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]);
+ else texvec[0]= mtex->size[0]*(mtex->ofs[0]);
+
+ if(mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]);
+ else texvec[1]= mtex->size[1]*(mtex->ofs[1]);
+
+ if(mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]);
+ else texvec[2]= mtex->size[2]*(mtex->ofs[2]);
+ }
+
+ rgbnor= multitex(tex, texvec, NULL, NULL, 0, &texres, 0, mtex->which_output); /* NULL = dxt/dyt, 0 = shi->osatex - not supported */
+
+ /* texture output */
+
+ if( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
+ texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb);
+ rgbnor-= TEX_RGB;
+ }
+ if(mtex->texflag & MTEX_NEGATIVE) {
+ if(rgbnor & TEX_RGB) {
+ texres.tr= 1.0-texres.tr;
+ texres.tg= 1.0-texres.tg;
+ texres.tb= 1.0-texres.tb;
+ }
+ texres.tin= 1.0-texres.tin;
+ }
+ if(mtex->texflag & MTEX_STENCIL) {
+ if(rgbnor & TEX_RGB) {
+ fact= texres.ta;
+ texres.ta*= stencilTin;
+ stencilTin*= fact;
+ }
+ else {
+ fact= texres.tin;
+ texres.tin*= stencilTin;
+ stencilTin*= fact;
+ }
+ }
+
+
+ if((mapto_flag & (MAP_EMISSION_COL+MAP_ABSORPTION_COL)) && (mtex->mapto & (MAP_EMISSION_COL+MAP_ABSORPTION_COL))) {
+ float tcol[3], colfac;
+
+ /* stencil maps on the texture control slider, not texture intensity value */
+ colfac= mtex->colfac*stencilTin;
+
+ if((rgbnor & TEX_RGB)==0) {
+ tcol[0]= mtex->r;
+ tcol[1]= mtex->g;
+ tcol[2]= mtex->b;
+ } else {
+ tcol[0]=texres.tr;
+ tcol[1]=texres.tg;
+ tcol[2]=texres.tb;
+ if(texres.talpha)
+ texres.tin= texres.ta;
+ }
+
+ /* inverse gamma correction */
+ if (R.r.color_mgt_flag & R_COLOR_MANAGEMENT) {
+ color_manage_linearize(tcol, tcol);
+ }
+
+ /* used for emit */
+ if((mapto_flag & MAP_EMISSION_COL) && (mtex->mapto & MAP_EMISSION_COL)) {
+ texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype);
+ }
+
+ /* MAP_COLMIR is abused for absorption colour at the moment */
+ if((mapto_flag & MAP_ABSORPTION_COL) && (mtex->mapto & MAP_ABSORPTION_COL)) {
+ texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype);
+ }
+ }
+
+ if((mapto_flag & MAP_VARS) && (mtex->mapto & MAP_VARS)) {
+ /* stencil maps on the texture control slider, not texture intensity value */
+ float varfac= mtex->varfac*stencilTin;
+
+ /* convert RGB to intensity if intensity info isn't provided */
+ if (!(rgbnor & TEX_INT)) {
+ if (rgbnor & TEX_RGB) {
+ if(texres.talpha) texres.tin= texres.ta;
+ else texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb);
+ }
+ }
+
+ if((mapto_flag & MAP_EMISSION) && (mtex->mapto & MAP_EMISSION)) {
+ int flip= mtex->maptoneg & MAP_EMISSION;
+
+ *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip);
+ if(*val<0.0) *val= 0.0;
+ }
+ if((mapto_flag & MAP_DENSITY) && (mtex->mapto & MAP_DENSITY)) {
+ int flip= mtex->maptoneg & MAP_DENSITY;
+
+ *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip);
+ CLAMP(*val, 0.0, 1.0);
+ }
+ if((mapto_flag & MAP_ABSORPTION) && (mtex->mapto & MAP_ABSORPTION)) {
+ int flip= mtex->maptoneg & MAP_ABSORPTION;
+
+ *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip);
+ CLAMP(*val, 0.0, 1.0);
+ }
+ if((mapto_flag & MAP_SCATTERING) && (mtex->mapto & MAP_SCATTERING)) {
+ int flip= mtex->maptoneg & MAP_SCATTERING;
+
+ *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip);
+ CLAMP(*val, 0.0, 1.0);
+ }
+ }
+ }
+ }
+}
+
+
/* ------------------------------------------------------------------------- */
void do_halo_tex(HaloRen *har, float xn, float yn, float *colf)
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
new file mode 100644
index 00000000000..d5a54759332
--- /dev/null
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -0,0 +1,746 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Matt Ebb.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <float.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_threads.h"
+#include "BLI_voxel.h"
+
+#include "PIL_time.h"
+
+#include "RE_shader_ext.h"
+#include "RE_raytrace.h"
+
+#include "DNA_material_types.h"
+
+#include "render_types.h"
+#include "renderdatabase.h"
+#include "volumetric.h"
+#include "volume_precache.h"
+
+#if defined( _MSC_VER ) && !defined( __cplusplus )
+# define inline __inline
+#endif // defined( _MSC_VER ) && !defined( __cplusplus )
+
+#include "BKE_global.h"
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */
+/* only to be used here in this file, it's for speed */
+extern struct Render R;
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+/* *** utility code to set up an individual raytree for objectinstance, for checking inside/outside *** */
+
+/* Recursive test for intersections, from a point inside the mesh, to outside
+ * Number of intersections (depth) determine if a point is inside or outside the mesh */
+int intersect_outside_volume(RayTree *tree, Isect *isect, float *offset, int limit, int depth)
+{
+ if (limit == 0) return depth;
+
+ if (RE_ray_tree_intersect(tree, isect)) {
+ float hitco[3];
+
+ hitco[0] = isect->start[0] + isect->labda*isect->vec[0];
+ hitco[1] = isect->start[1] + isect->labda*isect->vec[1];
+ hitco[2] = isect->start[2] + isect->labda*isect->vec[2];
+ VecAddf(isect->start, hitco, offset);
+
+ return intersect_outside_volume(tree, isect, offset, limit-1, depth+1);
+ } else {
+ return depth;
+ }
+}
+
+/* Uses ray tracing to check if a point is inside or outside an ObjectInstanceRen */
+int point_inside_obi(RayTree *tree, ObjectInstanceRen *obi, float *co)
+{
+ float maxsize = RE_ray_tree_max_size(tree);
+ Isect isect;
+ float vec[3] = {0.0f,0.0f,1.0f};
+ int final_depth=0, depth=0, limit=20;
+
+ /* set up the isect */
+ memset(&isect, 0, sizeof(isect));
+ VECCOPY(isect.start, co);
+ isect.end[0] = co[0] + vec[0] * maxsize;
+ isect.end[1] = co[1] + vec[1] * maxsize;
+ isect.end[2] = co[2] + vec[2] * maxsize;
+
+ /* and give it a little offset to prevent self-intersections */
+ VecMulf(vec, 1e-5);
+ VecAddf(isect.start, isect.start, vec);
+
+ isect.mode= RE_RAY_MIRROR;
+ isect.face_last= NULL;
+ isect.lay= -1;
+
+ final_depth = intersect_outside_volume(tree, &isect, vec, limit, depth);
+
+ /* even number of intersections: point is outside
+ * odd number: point is inside */
+ if (final_depth % 2 == 0) return 0;
+ else return 1;
+}
+
+static int inside_check_func(Isect *is, int ob, RayFace *face)
+{
+ return 1;
+}
+static void vlr_face_coords(RayFace *face, float **v1, float **v2, float **v3, float **v4)
+{
+ VlakRen *vlr= (VlakRen*)face;
+
+ *v1 = (vlr->v1)? vlr->v1->co: NULL;
+ *v2 = (vlr->v2)? vlr->v2->co: NULL;
+ *v3 = (vlr->v3)? vlr->v3->co: NULL;
+ *v4 = (vlr->v4)? vlr->v4->co: NULL;
+}
+
+RayTree *create_raytree_obi(ObjectInstanceRen *obi, float *bbmin, float *bbmax)
+{
+ int v;
+ VlakRen *vlr= NULL;
+
+ /* create empty raytree */
+ RayTree *tree = RE_ray_tree_create(64, obi->obr->totvlak, bbmin, bbmax,
+ vlr_face_coords, inside_check_func, NULL, NULL);
+
+ /* fill it with faces */
+ for(v=0; v<obi->obr->totvlak; v++) {
+ if((v & 255)==0)
+ vlr= obi->obr->vlaknodes[v>>8].vlak;
+ else
+ vlr++;
+
+ RE_ray_tree_add_face(tree, 0, vlr);
+ }
+
+ RE_ray_tree_done(tree);
+
+ return tree;
+}
+
+/* *** light cache filtering *** */
+
+static float get_avg_surrounds(float *cache, int *res, int xx, int yy, int zz)
+{
+ int x, y, z, x_, y_, z_;
+ int added=0;
+ float tot=0.0f;
+
+ for (z=-1; z <= 1; z++) {
+ z_ = zz+z;
+ if (z_ >= 0 && z_ <= res[2]-1) {
+
+ for (y=-1; y <= 1; y++) {
+ y_ = yy+y;
+ if (y_ >= 0 && y_ <= res[1]-1) {
+
+ for (x=-1; x <= 1; x++) {
+ x_ = xx+x;
+ if (x_ >= 0 && x_ <= res[0]-1) {
+
+ if (cache[ V_I(x_, y_, z_, res) ] > 0.0f) {
+ tot += cache[ V_I(x_, y_, z_, res) ];
+ added++;
+ }
+
+ }
+ }
+ }
+ }
+ }
+ }
+
+ tot /= added;
+
+ return ((added>0)?tot:0.0f);
+}
+
+/* function to filter the edges of the light cache, where there was no volume originally.
+ * For each voxel which was originally external to the mesh, it finds the average values of
+ * the surrounding internal voxels and sets the original external voxel to that average amount.
+ * Works almost a bit like a 'dilate' filter */
+static void lightcache_filter(VolumePrecache *vp)
+{
+ int x, y, z;
+
+ for (z=0; z < vp->res[2]; z++) {
+ for (y=0; y < vp->res[1]; y++) {
+ for (x=0; x < vp->res[0]; x++) {
+ /* trigger for outside mesh */
+ if (vp->data_r[ V_I(x, y, z, vp->res) ] < -0.5f)
+ vp->data_r[ V_I(x, y, z, vp->res) ] = get_avg_surrounds(vp->data_r, vp->res, x, y, z);
+ if (vp->data_g[ V_I(x, y, z, vp->res) ] < -0.5f)
+ vp->data_g[ V_I(x, y, z, vp->res) ] = get_avg_surrounds(vp->data_g, vp->res, x, y, z);
+ if (vp->data_b[ V_I(x, y, z, vp->res) ] < -0.5f)
+ vp->data_b[ V_I(x, y, z, vp->res) ] = get_avg_surrounds(vp->data_b, vp->res, x, y, z);
+ }
+ }
+ }
+}
+
+static inline int ms_I(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation
+{
+ return z*(n[1]+2)*(n[0]+2) + y*(n[0]+2) + x;
+}
+
+
+/* *** multiple scattering approximation *** */
+
+/* get the total amount of light energy in the light cache. used to normalise after multiple scattering */
+static float total_ss_energy(VolumePrecache *vp)
+{
+ int x, y, z;
+ int *res = vp->res;
+ float energy=0.f;
+
+ for (z=0; z < res[2]; z++) {
+ for (y=0; y < res[1]; y++) {
+ for (x=0; x < res[0]; x++) {
+ if (vp->data_r[ V_I(x, y, z, res) ] > 0.f) energy += vp->data_r[ V_I(x, y, z, res) ];
+ if (vp->data_g[ V_I(x, y, z, res) ] > 0.f) energy += vp->data_g[ V_I(x, y, z, res) ];
+ if (vp->data_b[ V_I(x, y, z, res) ] > 0.f) energy += vp->data_b[ V_I(x, y, z, res) ];
+ }
+ }
+ }
+
+ return energy;
+}
+
+static float total_ms_energy(float *sr, float *sg, float *sb, int *res)
+{
+ int x, y, z, i;
+ float energy=0.f;
+
+ for (z=1;z<=res[2];z++) {
+ for (y=1;y<=res[1];y++) {
+ for (x=1;x<=res[0];x++) {
+
+ i = ms_I(x,y,z,res);
+ if (sr[i] > 0.f) energy += sr[i];
+ if (sg[i] > 0.f) energy += sg[i];
+ if (sb[i] > 0.f) energy += sb[i];
+ }
+ }
+ }
+
+ return energy;
+}
+
+static void ms_diffuse(int b, float* x0, float* x, float diff, int *n)
+{
+ int i, j, k, l;
+ const float dt = VOL_MS_TIMESTEP;
+ const float a = dt*diff*n[0]*n[1]*n[2];
+
+ for (l=0; l<20; l++)
+ {
+ for (k=1; k<=n[2]; k++)
+ {
+ for (j=1; j<=n[1]; j++)
+ {
+ for (i=1; i<=n[0]; i++)
+ {
+ x[ms_I(i,j,k,n)] = (x0[ms_I(i,j,k,n)] + a*(
+ x[ms_I(i-1,j,k,n)]+x[ms_I(i+1,j,k,n)]+
+ x[ms_I(i,j-1,k,n)]+x[ms_I(i,j+1,k,n)]+
+ x[ms_I(i,j,k-1,n)]+x[ms_I(i,j,k+1,n)]))/(1+6*a);
+ }
+ }
+ }
+ }
+}
+
+void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Material *ma)
+{
+ const float diff = ma->vol.ms_diff * 0.001f; /* compensate for scaling for a nicer UI range */
+ const float simframes = ma->vol.ms_steps;
+ const int shade_type = ma->vol.shade_type;
+ float fac = ma->vol.ms_intensity;
+
+ int x, y, z, m;
+ int *n = vp->res;
+ const int size = (n[0]+2)*(n[1]+2)*(n[2]+2);
+ double time, lasttime= PIL_check_seconds_timer();
+ float total;
+ float c=1.0f;
+ int i;
+ float origf; /* factor for blending in original light cache */
+ float energy_ss, energy_ms;
+
+ float *sr0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer");
+ float *sr=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer");
+ float *sg0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer");
+ float *sg=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer");
+ float *sb0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer");
+ float *sb=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer");
+
+ total = (float)(n[0]*n[1]*n[2]*simframes);
+
+ energy_ss = total_ss_energy(vp);
+
+ /* Scattering as diffusion pass */
+ for (m=0; m<simframes; m++)
+ {
+ /* add sources */
+ for (z=1; z<=n[2]; z++)
+ {
+ for (y=1; y<=n[1]; y++)
+ {
+ for (x=1; x<=n[0]; x++)
+ {
+ i = V_I((x-1), (y-1), (z-1), n);
+ time= PIL_check_seconds_timer();
+ c++;
+
+ if (vp->data_r[i] > 0.f)
+ sr[ms_I(x,y,z,n)] += vp->data_r[i];
+ if (vp->data_g[i] > 0.f)
+ sg[ms_I(x,y,z,n)] += vp->data_g[i];
+ if (vp->data_b[i] > 0.f)
+ sb[ms_I(x,y,z,n)] += vp->data_b[i];
+
+ /* Displays progress every second */
+ if(time-lasttime>1.0f) {
+ char str[64];
+ sprintf(str, "Simulating multiple scattering: %d%%", (int)
+ (100.0f * (c / total)));
+ re->i.infostr= str;
+ re->stats_draw(re->sdh, &re->i);
+ re->i.infostr= NULL;
+ lasttime= time;
+ }
+ }
+ }
+ }
+ SWAP(float *, sr, sr0);
+ SWAP(float *, sg, sg0);
+ SWAP(float *, sb, sb0);
+
+ /* main diffusion simulation */
+ ms_diffuse(0, sr0, sr, diff, n);
+ ms_diffuse(0, sg0, sg, diff, n);
+ ms_diffuse(0, sb0, sb, diff, n);
+
+ if (re->test_break(re->tbh)) break;
+ }
+
+ /* normalisation factor to conserve energy */
+ energy_ms = total_ms_energy(sr, sg, sb, n);
+ fac *= (energy_ss / energy_ms);
+
+ /* blend multiple scattering back in the light cache */
+ if (shade_type == MA_VOL_SHADE_SINGLEPLUSMULTIPLE) {
+ /* conserve energy - half single, half multiple */
+ origf = 0.5f;
+ fac *= 0.5f;
+ } else {
+ origf = 0.0f;
+ }
+
+ for (z=1;z<=n[2];z++)
+ {
+ for (y=1;y<=n[1];y++)
+ {
+ for (x=1;x<=n[0];x++)
+ {
+ int index=(x-1)*n[1]*n[2] + (y-1)*n[2] + z-1;
+ vp->data_r[index] = origf * vp->data_r[index] + fac * sr[ms_I(x,y,z,n)];
+ vp->data_g[index] = origf * vp->data_g[index] + fac * sg[ms_I(x,y,z,n)];
+ vp->data_b[index] = origf * vp->data_b[index] + fac * sb[ms_I(x,y,z,n)];
+ }
+ }
+ }
+
+ MEM_freeN(sr0);
+ MEM_freeN(sr);
+ MEM_freeN(sg0);
+ MEM_freeN(sg);
+ MEM_freeN(sb0);
+ MEM_freeN(sb);
+}
+
+
+
+#if 0 // debug stuff
+static void *vol_precache_part_test(void *data)
+{
+ VolPrecachePart *pa = data;
+
+ printf("part number: %d \n", pa->num);
+ printf("done: %d \n", pa->done);
+ printf("x min: %d x max: %d \n", pa->minx, pa->maxx);
+ printf("y min: %d y max: %d \n", pa->miny, pa->maxy);
+ printf("z min: %d z max: %d \n", pa->minz, pa->maxz);
+
+ return NULL;
+}
+#endif
+
+/* Iterate over the 3d voxel grid, and fill the voxels with scattering information
+ *
+ * It's stored in memory as 3 big float grids next to each other, one for each RGB channel.
+ * I'm guessing the memory alignment may work out better this way for the purposes
+ * of doing linear interpolation, but I haven't actually tested this theory! :)
+ */
+static void *vol_precache_part(void *data)
+{
+ VolPrecachePart *pa = (VolPrecachePart *)data;
+ ObjectInstanceRen *obi = pa->obi;
+ RayTree *tree = pa->tree;
+ ShadeInput *shi = pa->shi;
+ float density, scatter_col[3] = {0.f, 0.f, 0.f};
+ float co[3];
+ int x, y, z;
+ const int res[3]= {pa->res[0], pa->res[1], pa->res[2]};
+ const float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW);
+
+ for (z= pa->minz; z < pa->maxz; z++) {
+ co[2] = pa->bbmin[2] + (pa->voxel[2] * z);
+
+ for (y= pa->miny; y < pa->maxy; y++) {
+ co[1] = pa->bbmin[1] + (pa->voxel[1] * y);
+
+ for (x=pa->minx; x < pa->maxx; x++) {
+ co[0] = pa->bbmin[0] + (pa->voxel[0] * x);
+
+ // don't bother if the point is not inside the volume mesh
+ if (!point_inside_obi(tree, obi, co)) {
+ obi->volume_precache->data_r[ V_I(x, y, z, res) ] = -1.0f;
+ obi->volume_precache->data_g[ V_I(x, y, z, res) ] = -1.0f;
+ obi->volume_precache->data_b[ V_I(x, y, z, res) ] = -1.0f;
+ continue;
+ }
+
+ VecCopyf(shi->view, co);
+ Normalize(shi->view);
+ density = vol_get_density(shi, co);
+ vol_get_scattering(shi, scatter_col, co, stepsize, density);
+
+ obi->volume_precache->data_r[ V_I(x, y, z, res) ] = scatter_col[0];
+ obi->volume_precache->data_g[ V_I(x, y, z, res) ] = scatter_col[1];
+ obi->volume_precache->data_b[ V_I(x, y, z, res) ] = scatter_col[2];
+ }
+ }
+ }
+
+ pa->done = 1;
+
+ return 0;
+}
+
+
+static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Material *ma, ShadeInput *shi)
+{
+ memset(shi, 0, sizeof(ShadeInput));
+ shi->depth= 1;
+ shi->mask= 1;
+ shi->mat = ma;
+ shi->vlr = NULL;
+ memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h
+ shi->har= shi->mat->har;
+ shi->obi= obi;
+ shi->obr= obi->obr;
+ shi->lay = re->scene->lay;
+}
+
+static void precache_init_parts(Render *re, RayTree *tree, ShadeInput *shi, ObjectInstanceRen *obi, int totthread, int *parts)
+{
+ VolumePrecache *vp = obi->volume_precache;
+ int i=0, x, y, z;
+ float voxel[3];
+ int sizex, sizey, sizez;
+ float *bbmin=obi->obr->boundbox[0], *bbmax=obi->obr->boundbox[1];
+ int *res;
+ int minx, maxx;
+ int miny, maxy;
+ int minz, maxz;
+
+ if (!vp) return;
+
+ BLI_freelistN(&re->volume_precache_parts);
+
+ /* currently we just subdivide the box, number of threads per side */
+ parts[0] = parts[1] = parts[2] = totthread;
+ res = vp->res;
+
+ VecSubf(voxel, bbmax, bbmin);
+
+ voxel[0] /= res[0];
+ voxel[1] /= res[1];
+ voxel[2] /= res[2];
+
+ for (x=0; x < parts[0]; x++) {
+ sizex = ceil(res[0] / (float)parts[0]);
+ minx = x * sizex;
+ maxx = minx + sizex;
+ maxx = (maxx>res[0])?res[0]:maxx;
+
+ for (y=0; y < parts[1]; y++) {
+ sizey = ceil(res[1] / (float)parts[1]);
+ miny = y * sizey;
+ maxy = miny + sizey;
+ maxy = (maxy>res[1])?res[1]:maxy;
+
+ for (z=0; z < parts[2]; z++) {
+ VolPrecachePart *pa= MEM_callocN(sizeof(VolPrecachePart), "new precache part");
+
+ sizez = ceil(res[2] / (float)parts[2]);
+ minz = z * sizez;
+ maxz = minz + sizez;
+ maxz = (maxz>res[2])?res[2]:maxz;
+
+ pa->done = 0;
+ pa->working = 0;
+
+ pa->num = i;
+ pa->tree = tree;
+ pa->shi = shi;
+ pa->obi = obi;
+ VECCOPY(pa->bbmin, bbmin);
+ VECCOPY(pa->voxel, voxel);
+ VECCOPY(pa->res, res);
+
+ pa->minx = minx; pa->maxx = maxx;
+ pa->miny = miny; pa->maxy = maxy;
+ pa->minz = minz; pa->maxz = maxz;
+
+
+ BLI_addtail(&re->volume_precache_parts, pa);
+
+ i++;
+ }
+ }
+ }
+}
+
+static VolPrecachePart *precache_get_new_part(Render *re)
+{
+ VolPrecachePart *pa, *nextpa=NULL;
+
+ for (pa = re->volume_precache_parts.first; pa; pa=pa->next)
+ {
+ if (pa->done==0 && pa->working==0) {
+ nextpa = pa;
+ break;
+ }
+ }
+
+ return nextpa;
+}
+
+static int precache_resolution(VolumePrecache *vp, float *bbmin, float *bbmax, int res)
+{
+ float dim[3], div;
+
+ VecSubf(dim, bbmax, bbmin);
+
+ div = MAX3(dim[0], dim[1], dim[2]);
+ dim[0] /= div;
+ dim[1] /= div;
+ dim[2] /= div;
+
+ vp->res[0] = dim[0] * (float)res;
+ vp->res[1] = dim[1] * (float)res;
+ vp->res[2] = dim[2] * (float)res;
+
+ if ((vp->res[0] < 1) || (vp->res[1] < 1) || (vp->res[2] < 1))
+ return 0;
+
+ return 1;
+}
+
+/* Precache a volume into a 3D voxel grid.
+ * The voxel grid is stored in the ObjectInstanceRen,
+ * in camera space, aligned with the ObjectRen's bounding box.
+ * Resolution is defined by the user.
+ */
+void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma)
+{
+ VolumePrecache *vp;
+ VolPrecachePart *nextpa, *pa;
+ RayTree *tree;
+ ShadeInput shi;
+ ListBase threads;
+ float *bbmin=obi->obr->boundbox[0], *bbmax=obi->obr->boundbox[1];
+ int parts[3], totparts;
+
+ int caching=1, counter=0;
+ int totthread = re->r.threads;
+
+ double time, lasttime= PIL_check_seconds_timer();
+
+ R = *re;
+
+ /* create a raytree with just the faces of the instanced ObjectRen,
+ * used for checking if the cached point is inside or outside. */
+ tree = create_raytree_obi(obi, bbmin, bbmax);
+ if (!tree) return;
+
+ vp = MEM_callocN(sizeof(VolumePrecache), "volume light cache");
+
+ if (!precache_resolution(vp, bbmin, bbmax, ma->vol.precache_resolution)) {
+ MEM_freeN(vp);
+ vp = NULL;
+ return;
+ }
+
+ vp->data_r = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data red channel");
+ vp->data_g = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data green channel");
+ vp->data_b = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data blue channel");
+ obi->volume_precache = vp;
+
+ /* Need a shadeinput to calculate scattering */
+ precache_setup_shadeinput(re, obi, ma, &shi);
+
+ precache_init_parts(re, tree, &shi, obi, totthread, parts);
+ totparts = parts[0] * parts[1] * parts[2];
+
+ BLI_init_threads(&threads, vol_precache_part, totthread);
+
+ while(caching) {
+
+ if(BLI_available_threads(&threads) && !(re->test_break(re->tbh))) {
+ nextpa = precache_get_new_part(re);
+ if (nextpa) {
+ nextpa->working = 1;
+ BLI_insert_thread(&threads, nextpa);
+ }
+ }
+ else PIL_sleep_ms(50);
+
+ caching=0;
+ counter=0;
+ for(pa= re->volume_precache_parts.first; pa; pa= pa->next) {
+
+ if(pa->done) {
+ counter++;
+ BLI_remove_thread(&threads, pa);
+ } else
+ caching = 1;
+ }
+
+ if (re->test_break(re->tbh) && BLI_available_threads(&threads)==totthread)
+ caching=0;
+
+ time= PIL_check_seconds_timer();
+ if(time-lasttime>1.0f) {
+ char str[64];
+ sprintf(str, "Precaching volume: %d%%", (int)(100.0f * ((float)counter / (float)totparts)));
+ re->i.infostr= str;
+ re->stats_draw(re->sdh, &re->i);
+ re->i.infostr= NULL;
+ lasttime= time;
+ }
+ }
+
+ BLI_end_threads(&threads);
+ BLI_freelistN(&re->volume_precache_parts);
+
+ if(tree) {
+ RE_ray_tree_free(tree);
+ tree= NULL;
+ }
+
+ lightcache_filter(obi->volume_precache);
+
+ if (ELEM(ma->vol.shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE))
+ {
+ multiple_scattering_diffusion(re, vp, ma);
+ }
+}
+
+static int using_lightcache(Material *ma)
+{
+ return (((ma->vol.shadeflag & MA_VOL_PRECACHESHADING) && (ma->vol.shade_type == MA_VOL_SHADE_SINGLE))
+ || (ELEM(ma->vol.shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE)));
+}
+
+/* loop through all objects (and their associated materials)
+ * marked for pre-caching in convertblender.c, and pre-cache them */
+void volume_precache(Render *re)
+{
+ ObjectInstanceRen *obi;
+ VolumeOb *vo;
+
+ for(vo= re->volumes.first; vo; vo= vo->next) {
+ if (using_lightcache(vo->ma)) {
+ for(obi= re->instancetable.first; obi; obi= obi->next) {
+ if (obi->obr == vo->obr) {
+ vol_precache_objectinstance_threads(re, obi, vo->ma);
+ }
+ }
+ }
+ }
+
+ re->i.infostr= NULL;
+ re->stats_draw(re->sdh, &re->i);
+}
+
+void free_volume_precache(Render *re)
+{
+ ObjectInstanceRen *obi;
+
+ for(obi= re->instancetable.first; obi; obi= obi->next) {
+ if (obi->volume_precache != NULL) {
+ MEM_freeN(obi->volume_precache->data_r);
+ MEM_freeN(obi->volume_precache->data_g);
+ MEM_freeN(obi->volume_precache->data_b);
+ MEM_freeN(obi->volume_precache);
+ obi->volume_precache = NULL;
+ }
+ }
+
+ BLI_freelistN(&re->volumes);
+}
+
+int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co)
+{
+ RayTree *tree;
+ int inside=0;
+
+ tree = create_raytree_obi(obi, obi->obr->boundbox[0], obi->obr->boundbox[1]);
+ if (!tree) return 0;
+
+ inside = point_inside_obi(tree, obi, co);
+
+ RE_ray_tree_free(tree);
+ tree= NULL;
+
+ return inside;
+}
+
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
new file mode 100644
index 00000000000..4fa31674bbe
--- /dev/null
+++ b/source/blender/render/intern/source/volumetric.c
@@ -0,0 +1,698 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary)
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <float.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+#include "BLI_voxel.h"
+
+#include "RE_shader_ext.h"
+#include "RE_raytrace.h"
+
+#include "DNA_material_types.h"
+#include "DNA_group_types.h"
+#include "DNA_lamp_types.h"
+
+#include "BKE_global.h"
+
+#include "render_types.h"
+#include "pixelshading.h"
+#include "shading.h"
+#include "texture.h"
+#include "volumetric.h"
+#include "volume_precache.h"
+
+#if defined( _MSC_VER ) && !defined( __cplusplus )
+# define inline __inline
+#endif // defined( _MSC_VER ) && !defined( __cplusplus )
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */
+/* only to be used here in this file, it's for speed */
+extern struct Render R;
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+
+/* tracing */
+
+static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type)
+{
+ float maxsize = RE_ray_tree_max_size(R.raytree);
+
+ /* XXX TODO - get raytrace max distance from object instance's bounding box */
+ /* need to account for scaling only, but keep coords in camera space...
+ * below code is WIP and doesn't work!
+ VecSubf(bb_dim, shi->obi->obr->boundbox[1], shi->obi->obr->boundbox[2]);
+ Mat3MulVecfl(shi->obi->nmat, bb_dim);
+ maxsize = VecLength(bb_dim);
+ */
+
+ VECCOPY(isect->start, co);
+ isect->end[0] = co[0] + vec[0] * maxsize;
+ isect->end[1] = co[1] + vec[1] * maxsize;
+ isect->end[2] = co[2] + vec[2] * maxsize;
+
+ isect->mode= RE_RAY_MIRROR;
+ isect->oborig= RAY_OBJECT_SET(&R, shi->obi);
+ isect->face_last= NULL;
+ isect->ob_last= 0;
+ isect->lay= -1;
+
+ if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr;
+ else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL;
+
+ if(RE_ray_tree_intersect(R.raytree, isect))
+ {
+ hitco[0] = isect->start[0] + isect->labda*isect->vec[0];
+ hitco[1] = isect->start[1] + isect->labda*isect->vec[1];
+ hitco[2] = isect->start[2] + isect->labda*isect->vec[2];
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+static void shade_intersection(ShadeInput *shi, float *col, Isect *is)
+{
+ ShadeInput shi_new;
+ ShadeResult shr_new;
+
+ memset(&shi_new, 0, sizeof(ShadeInput));
+
+ shi_new.mask= shi->mask;
+ shi_new.osatex= shi->osatex;
+ shi_new.thread= shi->thread;
+ shi_new.depth = shi->depth + 1;
+ shi_new.volume_depth= shi->volume_depth + 1;
+ shi_new.xs= shi->xs;
+ shi_new.ys= shi->ys;
+ shi_new.lay= shi->lay;
+ shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */
+ shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */
+ shi_new.light_override= shi->light_override;
+ shi_new.mat_override= shi->mat_override;
+
+ VECCOPY(shi_new.camera_co, is->start);
+
+ memset(&shr_new, 0, sizeof(ShadeResult));
+
+ /* hardcoded limit of 100 for now - prevents problems in weird geometry */
+ if (shi->volume_depth < 100) {
+ shade_ray(is, &shi_new, &shr_new);
+ }
+
+ VecCopyf(col, shr_new.combined);
+ col[3] = shr_new.alpha;
+}
+
+static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col)
+{
+ Isect isect;
+ float maxsize = RE_ray_tree_max_size(R.raytree);
+
+ VECCOPY(isect.start, co);
+ isect.end[0] = isect.start[0] + shi->view[0] * maxsize;
+ isect.end[1] = isect.start[1] + shi->view[1] * maxsize;
+ isect.end[2] = isect.start[2] + shi->view[2] * maxsize;
+
+ isect.faceorig= (RayFace *)vlr;
+
+ isect.mode= RE_RAY_MIRROR;
+ isect.oborig= RAY_OBJECT_SET(&R, shi->obi);
+ isect.face_last= NULL;
+ isect.ob_last= 0;
+ isect.lay= -1;
+
+ /* check to see if there's anything behind the volume, otherwise shade the sky */
+ if(RE_ray_tree_intersect(R.raytree, &isect)) {
+ shade_intersection(shi, col, &isect);
+ } else {
+ shadeSkyView(col, co, shi->view, NULL, shi->thread);
+ shadeSunView(col, shi->view);
+ }
+}
+
+/* input shader data */
+
+float vol_get_stepsize(struct ShadeInput *shi, int context)
+{
+ if (shi->mat->vol.stepsize_type == MA_VOL_STEP_RANDOMIZED) {
+ /* range between 0.75 and 1.25 */
+ const float rnd = 0.5f * BLI_thread_frand(shi->thread) + 0.75f;
+
+ if (context == STEPSIZE_VIEW)
+ return shi->mat->vol.stepsize * rnd;
+ else if (context == STEPSIZE_SHADE)
+ return shi->mat->vol.shade_stepsize * rnd;
+ }
+ else { // MA_VOL_STEP_CONSTANT
+
+ if (context == STEPSIZE_VIEW)
+ return shi->mat->vol.stepsize;
+ else if (context == STEPSIZE_SHADE)
+ return shi->mat->vol.shade_stepsize;
+ }
+
+ return shi->mat->vol.stepsize;
+}
+
+/* trilinear interpolation */
+static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co)
+{
+ VolumePrecache *vp = shi->obi->volume_precache;
+ float bbmin[3], bbmax[3], dim[3];
+ float sample_co[3];
+
+ if (!vp) return;
+
+ /* convert input coords to 0.0, 1.0 */
+ VECCOPY(bbmin, shi->obi->obr->boundbox[0]);
+ VECCOPY(bbmax, shi->obi->obr->boundbox[1]);
+ VecSubf(dim, bbmax, bbmin);
+
+ sample_co[0] = ((co[0] - bbmin[0]) / dim[0]);
+ sample_co[1] = ((co[1] - bbmin[1]) / dim[1]);
+ sample_co[2] = ((co[2] - bbmin[2]) / dim[2]);
+
+ scatter_col[0] = voxel_sample_trilinear(vp->data_r, vp->res, sample_co);
+ scatter_col[1] = voxel_sample_trilinear(vp->data_g, vp->res, sample_co);
+ scatter_col[2] = voxel_sample_trilinear(vp->data_b, vp->res, sample_co);
+}
+
+float vol_get_density(struct ShadeInput *shi, float *co)
+{
+ float density = shi->mat->vol.density;
+ float density_scale = shi->mat->vol.density_scale;
+ float col[3] = {0.0, 0.0, 0.0};
+
+ do_volume_tex(shi, co, MAP_DENSITY, col, &density);
+
+ return density * density_scale;
+}
+
+/* scattering multiplier, values above 1.0 are non-physical,
+ * but can be useful to tweak lighting */
+float vol_get_scattering_fac(ShadeInput *shi, float *co)
+{
+ float scatter = shi->mat->vol.scattering;
+ float col[3] = {0.0, 0.0, 0.0};
+
+ do_volume_tex(shi, co, MAP_SCATTERING, col, &scatter);
+
+ return scatter;
+}
+
+/* compute emission component, amount of radiance to add per segment
+ * can be textured with 'emit' */
+void vol_get_emission(ShadeInput *shi, float *emission_col, float *co, float density)
+{
+ float emission = shi->mat->vol.emission;
+ VECCOPY(emission_col, shi->mat->vol.emission_col);
+
+ do_volume_tex(shi, co, MAP_EMISSION+MAP_EMISSION_COL, emission_col, &emission);
+
+ emission_col[0] = emission_col[0] * emission * density;
+ emission_col[1] = emission_col[1] * emission * density;
+ emission_col[2] = emission_col[2] * emission * density;
+}
+
+void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co)
+{
+ float absorption = shi->mat->vol.absorption;
+ VECCOPY(absorb_col, shi->mat->vol.absorption_col);
+
+ do_volume_tex(shi, co, MAP_ABSORPTION+MAP_ABSORPTION_COL, absorb_col, &absorption);
+
+ absorb_col[0] = (1.0f - absorb_col[0]) * absorption;
+ absorb_col[1] = (1.0f - absorb_col[1]) * absorption;
+ absorb_col[2] = (1.0f - absorb_col[2]) * absorption;
+}
+
+
+/* phase function - determines in which directions the light
+ * is scattered in the volume relative to incoming direction
+ * and view direction */
+float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w, float *wp)
+{
+ const float costheta = Inpf(w, wp);
+ const float scale = M_PI;
+
+ /*
+ * Scale constant is required, since Blender's shading system doesn't normalise for
+ * energy conservation - eg. scaling by 1/pi for a lambert shader.
+ * This makes volumes darker than other solid objects, for the same lighting intensity.
+ * To correct this, scale up the phase function values
+ * until Blender's shading system supports this better. --matt
+ */
+
+ switch (phasefunc_type) {
+ case MA_VOL_PH_MIEHAZY:
+ return scale * (0.5f + 4.5f * powf(0.5 * (1.f + costheta), 8.f)) / (4.f*M_PI);
+ case MA_VOL_PH_MIEMURKY:
+ return scale * (0.5f + 16.5f * powf(0.5 * (1.f + costheta), 32.f)) / (4.f*M_PI);
+ case MA_VOL_PH_RAYLEIGH:
+ return scale * 3.f/(16.f*M_PI) * (1 + costheta * costheta);
+ case MA_VOL_PH_HG:
+ return scale * (1.f / (4.f * M_PI) * (1.f - g*g) / powf(1.f + g*g - 2.f * g * costheta, 1.5f));
+ case MA_VOL_PH_SCHLICK:
+ {
+ const float k = 1.55f * g - .55f * g * g * g;
+ const float kcostheta = k * costheta;
+ return scale * (1.f / (4.f * M_PI) * (1.f - k*k) / ((1.f - kcostheta) * (1.f - kcostheta)));
+ }
+ case MA_VOL_PH_ISOTROPIC:
+ default:
+ return scale * (1.f / (4.f * M_PI));
+ }
+}
+
+/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau.
+ * Used in the relationship Transmittance = e^(-attenuation)
+ */
+void vol_get_attenuation_seg(ShadeInput *shi, float *transmission, float stepsize, float *co, float density)
+{
+ /* input density = density at co */
+ float tau[3] = {0.f, 0.f, 0.f};
+ float absorb_col[3];
+
+ vol_get_absorption(shi, absorb_col, co);
+
+ /* homogenous volume within the sampled distance */
+ tau[0] = stepsize * density * absorb_col[0];
+ tau[1] = stepsize * density * absorb_col[1];
+ tau[2] = stepsize * density * absorb_col[2];
+
+ transmission[0] *= exp(-tau[0]);
+ transmission[1] *= exp(-tau[1]);
+ transmission[2] *= exp(-tau[2]);
+}
+
+/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau.
+ * Used in the relationship Transmittance = e^(-attenuation)
+ */
+void vol_get_attenuation(ShadeInput *shi, float *transmission, float *co, float *endco, float density, float stepsize)
+{
+ /* input density = density at co */
+ float tau[3] = {0.f, 0.f, 0.f};
+ float absorb_col[3];
+ int s, nsteps;
+ float step_vec[3], step_sta[3], step_end[3];
+ const float dist = VecLenf(co, endco);
+
+ vol_get_absorption(shi, absorb_col, co);
+
+ nsteps = (int)((dist / stepsize) + 0.5);
+
+ VecSubf(step_vec, endco, co);
+ VecMulf(step_vec, 1.0f / nsteps);
+
+ VecCopyf(step_sta, co);
+ VecAddf(step_end, step_sta, step_vec);
+
+ for (s = 0; s < nsteps; s++) {
+ if (s > 0)
+ density = vol_get_density(shi, step_sta);
+
+ tau[0] += stepsize * density;
+ tau[1] += stepsize * density;
+ tau[2] += stepsize * density;
+
+ if (s < nsteps-1) {
+ VecCopyf(step_sta, step_end);
+ VecAddf(step_end, step_end, step_vec);
+ }
+ }
+ VecMulVecf(tau, tau, absorb_col);
+
+ transmission[0] *= exp(-tau[0]);
+ transmission[1] *= exp(-tau[1]);
+ transmission[2] *= exp(-tau[2]);
+}
+
+void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *lacol, float stepsize, float density)
+{
+ float visifac, lv[3], lampdist;
+ float tr[3]={1.0,1.0,1.0};
+ float hitco[3], *atten_co;
+ float p;
+ float scatter_fac;
+ float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE);
+
+ if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return;
+ if ((lar->lay & shi->lay)==0) return;
+ if (lar->energy == 0.0) return;
+
+ if ((visifac= lamp_get_visibility(lar, co, lv, &lampdist)) == 0.f) return;
+
+ VecCopyf(lacol, &lar->r);
+
+ if(lar->mode & LA_TEXTURE) {
+ shi->osatex= 0;
+ do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE);
+ }
+
+ VecMulf(lacol, visifac*lar->energy);
+
+ if (ELEM(lar->type, LA_SUN, LA_HEMI))
+ VECCOPY(lv, lar->vec);
+ VecMulf(lv, -1.0f);
+
+ if (shi->mat->vol.shade_type != MA_VOL_SHADE_NONE) {
+ Isect is;
+
+ /* find minimum of volume bounds, or lamp coord */
+ if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS)) {
+ float dist = VecLenf(co, hitco);
+ VlakRen *vlr = (VlakRen *)is.face;
+
+ /* simple internal shadowing */
+ if (vlr->mat->material_type == MA_TYPE_SURFACE) {
+ lacol[0] = lacol[1] = lacol[2] = 0.0f;
+ return;
+ }
+
+ if (ELEM(lar->type, LA_SUN, LA_HEMI))
+ /* infinite lights, can never be inside volume */
+ atten_co = hitco;
+ else if ( lampdist < dist ) {
+ atten_co = lar->co;
+ } else
+ atten_co = hitco;
+
+ vol_get_attenuation(shi, tr, co, atten_co, density, shade_stepsize);
+
+ VecMulVecf(lacol, lacol, tr);
+ }
+ else {
+ /* Point is on the outside edge of the volume,
+ * therefore no attenuation, full transmission.
+ * Radiance from lamp remains unchanged */
+ }
+ }
+
+ p = vol_get_phasefunc(shi, shi->mat->vol.phasefunc_type, shi->mat->vol.phasefunc_g, shi->view, lv);
+ VecMulf(lacol, p);
+
+ scatter_fac = vol_get_scattering_fac(shi, co);
+ VecMulf(lacol, scatter_fac);
+}
+
+/* single scattering only for now */
+void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density)
+{
+ ListBase *lights;
+ GroupObject *go;
+ LampRen *lar;
+
+ scatter_col[0] = scatter_col[1] = scatter_col[2] = 0.f;
+
+ lights= get_lights(shi);
+ for(go=lights->first; go; go= go->next)
+ {
+ float lacol[3] = {0.f, 0.f, 0.f};
+ lar= go->lampren;
+
+ if (lar) {
+ vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density);
+ VecAddf(scatter_col, scatter_col, lacol);
+ }
+ }
+}
+
+
+/*
+The main volumetric integrator, using an emission/absorption/scattering model.
+
+Incoming radiance =
+
+outgoing radiance from behind surface * beam transmittance/attenuation
++ added radiance from all points along the ray due to participating media
+ --> radiance for each segment =
+ (radiance added by scattering + radiance added by emission) * beam transmittance/attenuation
+*/
+static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco)
+{
+ float tr[3] = {1.0f, 1.0f, 1.0f};
+ float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f};
+ float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW);
+ int nsteps, s;
+ float emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0};
+ float stepvec[3], step_sta[3], step_end[3], step_mid[3];
+ float density;
+ const float depth_cutoff = shi->mat->vol.depth_cutoff;
+
+ /* ray marching */
+ nsteps = (int)((VecLenf(co, endco) / stepsize) + 0.5);
+
+ VecSubf(stepvec, endco, co);
+ VecMulf(stepvec, 1.0f / nsteps);
+ VecCopyf(step_sta, co);
+ VecAddf(step_end, step_sta, stepvec);
+
+ /* get radiance from all points along the ray due to participating media */
+ for (s = 0; s < nsteps; s++) {
+
+ density = vol_get_density(shi, step_sta);
+
+ /* there's only any use in shading here if there's actually some density to shade! */
+ if (density > 0.01f) {
+
+ /* transmittance component (alpha) */
+ vol_get_attenuation_seg(shi, tr, stepsize, co, density);
+
+ step_mid[0] = step_sta[0] + (stepvec[0] * 0.5);
+ step_mid[1] = step_sta[1] + (stepvec[1] * 0.5);
+ step_mid[2] = step_sta[2] + (stepvec[2] * 0.5);
+
+ /* incoming light via emission or scattering (additive) */
+ vol_get_emission(shi, emit_col, step_mid, density);
+
+ if (shi->obi->volume_precache)
+ vol_get_precached_scattering(shi, scatter_col, step_mid);
+ else
+ vol_get_scattering(shi, scatter_col, step_mid, stepsize, density);
+
+ VecMulf(scatter_col, density);
+ VecAddf(d_radiance, emit_col, scatter_col);
+
+ /* Lv += Tr * (Lve() + Ld) */
+ VecMulVecf(d_radiance, tr, d_radiance);
+ VecMulf(d_radiance, stepsize);
+
+ VecAddf(radiance, radiance, d_radiance);
+ }
+
+ VecCopyf(step_sta, step_end);
+ VecAddf(step_end, step_end, stepvec);
+
+ /* luminance rec. 709 */
+ if ((0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]) < depth_cutoff) break;
+ }
+
+ /* multiply original color (behind volume) with beam transmittance over entire distance */
+ VecMulVecf(col, tr, col);
+ VecAddf(col, col, radiance);
+
+ /* alpha <-- transmission luminance */
+ col[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]);
+}
+
+/* the main entry point for volume shading */
+static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume)
+{
+ float hitco[3], col[4] = {0.f,0.f,0.f,0.f};
+ float *startco, *endco;
+ int trace_behind = 1;
+ const int ztransp= ((shi->depth==0) && (shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_ZTRANSP));
+ Isect is;
+
+ /* check for shading an internal face a volume object directly */
+ if (inside_volume == VOL_SHADE_INSIDE)
+ trace_behind = 0;
+ else if (inside_volume == VOL_SHADE_OUTSIDE) {
+ if (shi->flippednor)
+ inside_volume = VOL_SHADE_INSIDE;
+ }
+
+ if (ztransp && inside_volume == VOL_SHADE_INSIDE) {
+ MatInside *mi;
+ int render_this=0;
+
+ /* don't render the backfaces of ztransp volume materials.
+
+ * volume shading renders the internal volume from between the
+ * near view intersection of the solid volume to the
+ * intersection on the other side, as part of the shading of
+ * the front face.
+
+ * Because ztransp renders both front and back faces independently
+ * this will double up, so here we prevent rendering the backface as well,
+ * which would otherwise render the volume in between the camera and the backface
+ * --matt */
+
+ for (mi=R.render_volumes_inside.first; mi; mi=mi->next) {
+ /* weak... */
+ if (mi->ma == shi->mat) render_this=1;
+ }
+ if (!render_this) return;
+ }
+
+
+ if (inside_volume == VOL_SHADE_INSIDE)
+ {
+ startco = shi->camera_co;
+ endco = shi->co;
+
+ if (trace_behind) {
+ if (!ztransp)
+ /* trace behind the volume object */
+ vol_trace_behind(shi, shi->vlr, endco, col);
+ } else {
+ /* we're tracing through the volume between the camera
+ * and a solid surface, so use that pre-shaded radiance */
+ QUATCOPY(col, shr->combined);
+ }
+
+ /* shade volume from 'camera' to 1st hit point */
+ volumeintegrate(shi, col, startco, endco);
+ }
+ /* trace to find a backface, the other side bounds of the volume */
+ /* (ray intersect ignores front faces here) */
+ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH))
+ {
+ VlakRen *vlr = (VlakRen *)is.face;
+
+ startco = shi->co;
+ endco = hitco;
+
+ if (!ztransp) {
+ /* if it's another face in the same material */
+ if (vlr->mat == shi->mat) {
+ /* trace behind the 2nd (raytrace) hit point */
+ vol_trace_behind(shi, (VlakRen *)is.face, endco, col);
+ } else {
+ shade_intersection(shi, col, &is);
+ }
+ }
+
+ /* shade volume from 1st hit point to 2nd hit point */
+ volumeintegrate(shi, col, startco, endco);
+ }
+
+ if (ztransp)
+ col[3] = col[3]>1.f?1.f:col[3];
+ else
+ col[3] = 1.f;
+
+ VecCopyf(shr->combined, col);
+ shr->alpha = col[3];
+
+ VECCOPY(shr->diff, shr->combined);
+}
+
+/* Traces a shadow through the object,
+ * pretty much gets the transmission over a ray path */
+void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is)
+{
+ float hitco[3];
+ float tr[3] = {1.0,1.0,1.0};
+ Isect is;
+ float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE);
+ float *startco, *endco;
+ float density=0.f;
+
+ memset(shr, 0, sizeof(ShadeResult));
+
+ /* if 1st hit normal is facing away from the camera,
+ * then we're inside the volume already. */
+ if (shi->flippednor) {
+ startco = last_is->start;
+ endco = shi->co;
+ }
+ /* trace to find a backface, the other side bounds of the volume */
+ /* (ray intersect ignores front faces here) */
+ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) {
+ startco = shi->co;
+ endco = hitco;
+ }
+ else {
+ shr->combined[0] = shr->combined[1] = shr->combined[2] = 0.f;
+ shr->alpha = shr->combined[3] = 1.f;
+ return;
+ }
+
+ density = vol_get_density(shi, startco);
+ vol_get_attenuation(shi, tr, startco, endco, density, shade_stepsize);
+
+ VecCopyf(shr->combined, tr);
+ shr->combined[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]);
+ shr->alpha = shr->combined[3];
+}
+
+
+/* delivers a fully filled in ShadeResult, for all passes */
+void shade_volume_outside(ShadeInput *shi, ShadeResult *shr)
+{
+ memset(shr, 0, sizeof(ShadeResult));
+ volume_trace(shi, shr, VOL_SHADE_OUTSIDE);
+}
+
+
+void shade_volume_inside(ShadeInput *shi, ShadeResult *shr)
+{
+ MatInside *m;
+ Material *mat_backup;
+ ObjectInstanceRen *obi_backup;
+ float prev_alpha = shr->alpha;
+
+ //if (BLI_countlist(&R.render_volumes_inside) == 0) return;
+
+ /* XXX: extend to multiple volumes perhaps later */
+ mat_backup = shi->mat;
+ obi_backup = shi->obi;
+
+ m = R.render_volumes_inside.first;
+ shi->mat = m->ma;
+ shi->obi = m->obi;
+ shi->obr = m->obi->obr;
+
+ volume_trace(shi, shr, VOL_SHADE_INSIDE);
+ shr->alpha += prev_alpha;
+ CLAMP(shr->alpha, 0.f, 1.f);
+
+ shi->mat = mat_backup;
+ shi->obi = obi_backup;
+ shi->obr = obi_backup->obr;
+} \ No newline at end of file
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
new file mode 100644
index 00000000000..17858e55e3d
--- /dev/null
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -0,0 +1,346 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Raul Fernandez Hernandez (Farsthary), Matt Ebb.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "BLI_voxel.h"
+
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "BKE_global.h"
+#include "BKE_image.h"
+#include "BKE_main.h"
+#include "BKE_modifier.h"
+
+#include "smoke_API.h"
+
+#include "DNA_texture_types.h"
+#include "DNA_object_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_smoke_types.h"
+
+
+#include "render_types.h"
+#include "renderdatabase.h"
+#include "texture.h"
+#include "voxeldata.h"
+
+void load_frame_blendervoxel(FILE *fp, float *F, int size, int frame, int offset)
+{
+ fseek(fp,frame*size*sizeof(float)+offset,0);
+ fread(F,sizeof(float),size,fp);
+}
+
+void load_frame_raw8(FILE *fp, float *F, int size, int frame)
+{
+ char *tmp;
+ int i;
+
+ tmp = (char *)MEM_mallocN(sizeof(char)*size, "temporary voxel file reading storage");
+
+ fseek(fp,(frame-1)*size*sizeof(char),0);
+ fread(tmp, sizeof(char), size, fp);
+
+ for (i=0; i<size; i++) {
+ F[i] = (float)tmp[i] / 256.f;
+ }
+ MEM_freeN(tmp);
+}
+
+void load_frame_image_sequence(Render *re, VoxelData *vd, Tex *tex)
+{
+ ImBuf *ibuf;
+ Image *ima = tex->ima;
+ ImageUser *iuser = &tex->iuser;
+ int x=0, y=0, z=0;
+ float *rf;
+
+ if (!ima || !iuser) return;
+
+ ima->source = IMA_SRC_SEQUENCE;
+ iuser->framenr = 1 + iuser->offset;
+
+ /* find the first valid ibuf and use it to initialise the resolution of the data set */
+ /* need to do this in advance so we know how much memory to allocate */
+ ibuf= BKE_image_get_ibuf(ima, iuser);
+ while (!ibuf && (iuser->framenr < iuser->frames)) {
+ iuser->framenr++;
+ ibuf= BKE_image_get_ibuf(ima, iuser);
+ }
+ if (!ibuf) return;
+ if (!ibuf->rect_float) IMB_float_from_rect(ibuf);
+
+ vd->flag |= TEX_VD_STILL;
+ vd->resol[0] = ibuf->x;
+ vd->resol[1] = ibuf->y;
+ vd->resol[2] = iuser->frames;
+ vd->dataset = MEM_mapallocN(sizeof(float)*(vd->resol[0])*(vd->resol[1])*(vd->resol[2]), "voxel dataset");
+
+ for (z=0; z < iuser->frames; z++)
+ {
+ /* get a new ibuf for each frame */
+ if (z > 0) {
+ iuser->framenr++;
+ ibuf= BKE_image_get_ibuf(ima, iuser);
+ if (!ibuf) break;
+ if (!ibuf->rect_float) IMB_float_from_rect(ibuf);
+ }
+ rf = ibuf->rect_float;
+
+ for (y=0; y < ibuf->y; y++)
+ {
+ for (x=0; x < ibuf->x; x++)
+ {
+ /* currently converted to monchrome */
+ vd->dataset[ V_I(x, y, z, vd->resol) ] = (rf[0] + rf[1] + rf[2])*0.333f;
+ rf +=4;
+ }
+ }
+
+ BKE_image_free_anim_ibufs(ima, iuser->framenr);
+ }
+}
+
+void write_voxeldata_header(struct VoxelDataHeader *h, FILE *fp)
+{
+ fwrite(h,sizeof(struct VoxelDataHeader),1,fp);
+}
+
+void read_voxeldata_header(FILE *fp, struct VoxelData *vd)
+{
+ VoxelDataHeader *h=(VoxelDataHeader *)MEM_mallocN(sizeof(VoxelDataHeader), "voxel data header");
+
+ rewind(fp);
+ fread(h,sizeof(VoxelDataHeader),1,fp);
+
+ vd->resol[0]=h->resolX;
+ vd->resol[1]=h->resolY;
+ vd->resol[2]=h->resolZ;
+
+ MEM_freeN(h);
+}
+
+void init_frame_smoke(Render *re, VoxelData *vd, Tex *tex)
+{
+ Object *ob;
+ ModifierData *md;
+
+ vd->dataset = NULL;
+ if (vd->object == NULL) return;
+ ob= vd->object;
+
+ /* draw code for smoke */
+ if( (md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke)) )
+ {
+ SmokeModifierData *smd = (SmokeModifierData *)md;
+
+ if(smd->domain && smd->domain->fluid) {
+ //int big = (smd->domain->flags & MOD_SMOKE_HIGHRES);
+ int big=0;
+
+ if (big) {
+ //smoke_turbulence_get_res(smd->domain->wt, vd->resol);
+ //vd->dataset = smoke_turbulence_get_density(smd->domain->wt);
+ } else {
+ VECCOPY(vd->resol, smd->domain->res);
+ vd->dataset = smoke_get_density(smd->domain->fluid);
+ }
+ }
+ }
+}
+
+void cache_voxeldata(struct Render *re,Tex *tex)
+{
+ VoxelData *vd = tex->vd;
+ FILE *fp;
+ int size;
+ int curframe;
+
+ if (!vd) return;
+
+ /* image sequence gets special treatment */
+ if (vd->file_format == TEX_VD_IMAGE_SEQUENCE) {
+ load_frame_image_sequence(re, vd, tex);
+ return;
+ } else if (vd->file_format == TEX_VD_SMOKE) {
+ init_frame_smoke(re, vd, tex);
+ return;
+ }
+
+ if (!BLI_exists(vd->source_path)) return;
+ fp = fopen(vd->source_path,"rb");
+ if (!fp) return;
+
+ if (vd->file_format == TEX_VD_BLENDERVOXEL)
+ read_voxeldata_header(fp, vd);
+
+ size = (vd->resol[0])*(vd->resol[1])*(vd->resol[2]);
+ vd->dataset = MEM_mapallocN(sizeof(float)*size, "voxel dataset");
+
+ if (vd->flag & TEX_VD_STILL) curframe = vd->still_frame;
+ else curframe = re->r.cfra;
+
+ switch(vd->file_format) {
+ case TEX_VD_BLENDERVOXEL:
+ load_frame_blendervoxel(fp, vd->dataset, size, curframe-1, sizeof(VoxelDataHeader));
+ break;
+ case TEX_VD_RAW_8BIT:
+ load_frame_raw8(fp, vd->dataset, size, curframe);
+ break;
+ }
+
+ fclose(fp);
+}
+
+void make_voxeldata(struct Render *re)
+{
+ Tex *tex;
+
+ if(re->scene->r.scemode & R_PREVIEWBUTS)
+ return;
+
+ re->i.infostr= "Loading voxel datasets";
+ re->stats_draw(re->sdh, &re->i);
+
+ /* XXX: should be doing only textures used in this render */
+ for (tex= G.main->tex.first; tex; tex= tex->id.next) {
+ if(tex->id.us && tex->type==TEX_VOXELDATA) {
+ cache_voxeldata(re, tex);
+ }
+ }
+
+ re->i.infostr= NULL;
+ re->stats_draw(re->sdh, &re->i);
+
+}
+
+static void free_voxeldata_one(Render *re, Tex *tex)
+{
+ VoxelData *vd = tex->vd;
+
+ if (vd->dataset) {
+ MEM_freeN(vd->dataset);
+ vd->dataset = NULL;
+ }
+}
+
+
+void free_voxeldata(Render *re)
+{
+ Tex *tex;
+
+ if(re->scene->r.scemode & R_PREVIEWBUTS)
+ return;
+
+ for (tex= G.main->tex.first; tex; tex= tex->id.next) {
+ if(tex->id.us && tex->type==TEX_VOXELDATA) {
+ free_voxeldata_one(re, tex);
+ }
+ }
+}
+
+int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres)
+{
+ int retval = TEX_INT;
+ VoxelData *vd = tex->vd;
+ float co[3], offset[3] = {0.5, 0.5, 0.5};
+
+ if ((!vd) || (vd->dataset==NULL)) {
+ texres->tin = 0.0f;
+ return 0;
+ }
+
+ /* scale lookup from 0.0-1.0 (original location) to -1.0, 1.0, consistent with image texture tex coords */
+ /* in implementation this works backwards, bringing sample locations from -1.0, 1.0
+ * to the range 0.0, 1.0, before looking up in the voxel structure. */
+ VecCopyf(co, texvec);
+ VecMulf(co, 0.5f);
+ VecAddf(co, co, offset);
+
+ /* co is now in the range 0.0, 1.0 */
+ switch (tex->extend) {
+ case TEX_CLIP:
+ {
+ if ((co[0] < 0.f || co[0] > 1.f) || (co[1] < 0.f || co[1] > 1.f) || (co[2] < 0.f || co[2] > 1.f)) {
+ texres->tin = 0.f;
+ return retval;
+ }
+ break;
+ }
+ case TEX_REPEAT:
+ {
+ co[0] = co[0] - floor(co[0]);
+ co[1] = co[1] - floor(co[1]);
+ co[2] = co[2] - floor(co[2]);
+ break;
+ }
+ case TEX_EXTEND:
+ {
+ CLAMP(co[0], 0.f, 1.f);
+ CLAMP(co[1], 0.f, 1.f);
+ CLAMP(co[2], 0.f, 1.f);
+ break;
+ }
+ }
+
+ switch (vd->interp_type) {
+ case TEX_VD_NEARESTNEIGHBOR:
+ texres->tin = voxel_sample_nearest(vd->dataset, vd->resol, co);
+ break;
+ case TEX_VD_LINEAR:
+ texres->tin = voxel_sample_trilinear(vd->dataset, vd->resol, co);
+ break;
+ case TEX_VD_QUADRATIC:
+ texres->tin = voxel_sample_triquadratic(vd->dataset, vd->resol, co);
+ break;
+ case TEX_VD_TRICUBIC_CATROM:
+ case TEX_VD_TRICUBIC_BSPLINE:
+ texres->tin = voxel_sample_tricubic(vd->dataset, vd->resol, co, (vd->interp_type == TEX_VD_TRICUBIC_BSPLINE));
+ break;
+ }
+
+ texres->tin *= vd->int_multiplier;
+ BRICONT;
+
+ texres->tr = texres->tin;
+ texres->tg = texres->tin;
+ texres->tb = texres->tin;
+ texres->ta = texres->tin;
+ BRICONTRGB;
+
+ return retval;
+}
+
+
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 4436f3aa047..53a05dd0d67 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -2152,7 +2152,7 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*,
if(obi->lay & lay) {
if(vlr->mat!=ma) {
ma= vlr->mat;
- nofill= ma->mode & (MA_ZTRA|MA_ONLYCAST);
+ nofill= (ma->mode & MA_ONLYCAST) || ((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP));
env= (ma->mode & MA_ENV);
wire= (ma->material_type == MA_TYPE_WIRE);
@@ -3306,7 +3306,7 @@ static int zbuffer_abuf(RenderPart *pa, APixstr *APixbuf, ListBase *apsmbase, Re
if(vlr->mat!=ma) {
ma= vlr->mat;
- dofill= (ma->mode & MA_ZTRA) && !(ma->mode & MA_ONLYCAST);
+ dofill= ((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP)) && !(ma->mode & MA_ONLYCAST);
}
if(dofill) {
@@ -3480,7 +3480,7 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
col= shr->refl;
break;
case SCE_PASS_RADIO:
- col= shr->rad;
+ col= NULL; // removed shr->rad;
break;
case SCE_PASS_REFRACT:
col= shr->refr;
@@ -3582,7 +3582,7 @@ void add_transp_passes(RenderLayer *rl, int offset, ShadeResult *shr, float alph
col= shr->refr;
break;
case SCE_PASS_RADIO:
- col= shr->rad;
+ col= NULL; // removed shr->rad;
break;
case SCE_PASS_NORMAL:
col= shr->nor;
@@ -3817,8 +3817,8 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf
if(addpassflag & SCE_PASS_REFRACT)
addvecmul(samp_shr->refr, shr->refr, fac);
- if(addpassflag & SCE_PASS_RADIO)
- addvecmul(samp_shr->rad, shr->rad, fac);
+ /* removed if(addpassflag & SCE_PASS_RADIO)
+ addvecmul(samp_shr->rad, shr->rad, fac);*/
if(addpassflag & SCE_PASS_MIST)
samp_shr->mist= samp_shr->mist+fac*shr->mist;
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt
index 088bdc99687..26d4ab20356 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -31,15 +31,15 @@ SET(INC .
../../../intern/guardedalloc ../../../intern/memutil
../blenlib ../makesdna ../makesrna ../blenkernel
../include ../imbuf ../render/extern/include
- ../../../intern/bsp/extern ../radiosity/extern/include
+ ../../../intern/bsp/extern
../../../intern/decimation/extern ../blenloader
- ../../kernel/gen_system ../../../intern/SoundSystem ../readstreamglue
- ../quicktime ../../../intern/elbeem/extern
+ ../../kernel/gen_system ../readstreamglue
+ ../../../intern/elbeem/extern
../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include
../nodes
../gpu
../blenfont
- ${SDL_INC}
+ ${OPENGL_INCLUDE_DIR}
)
IF(WITH_INTERNATIONAL)
@@ -51,7 +51,7 @@ IF(WITH_OPENEXR)
ENDIF(WITH_OPENEXR)
IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
+ SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index decd855eae0..544804b26d6 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -165,14 +165,14 @@ wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char
int WM_operator_call (struct bContext *C, struct wmOperator *op);
int WM_operator_repeat (struct bContext *C, struct wmOperator *op);
int WM_operator_name_call (struct bContext *C, const char *opstring, int context, struct PointerRNA *properties);
-int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *properties, struct ReportList *reports);
+int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports);
void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring);
void WM_operator_properties_free(struct PointerRNA *ptr);
void WM_operator_properties_filesel(struct wmOperatorType *ot, int filter);
/* operator as a python command (resultuing string must be free'd) */
-char *WM_operator_pystring(struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args);
+char *WM_operator_pystring(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *opptr, int all_args);
void WM_operator_bl_idname(char *to, const char *from);
void WM_operator_py_idname(char *to, const char *from);
@@ -245,6 +245,5 @@ void WM_jobs_stop_all(struct wmWindowManager *wm);
char *WM_clipboard_text_get(int selection);
void WM_clipboard_text_set(char *buf, int selection);
-
#endif /* WM_API_H */
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index a083d589d31..5687cb565d1 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -133,6 +133,8 @@ typedef struct wmNotifier {
#define NC_FILE (14<<24)
#define NC_ANIMATION (15<<24)
#define NC_CONSOLE (16<<24)
+#define NC_NODE (17<<24)
+#define NC_INFO (18<<24)
/* data type, 256 entries is enough, it can overlap */
#define NOTE_DATA 0x00FF0000
@@ -144,8 +146,10 @@ typedef struct wmNotifier {
/* NC_SCREEN screen */
#define ND_SCREENBROWSE (1<<16)
-#define ND_SCREENCAST (2<<16)
-#define ND_ANIMPLAY (3<<16)
+#define ND_SCREENDELETE (2<<16)
+#define ND_SCREENCAST (3<<16)
+#define ND_ANIMPLAY (4<<16)
+#define ND_GPENCIL (5<<16)
/* NC_SCENE Scene */
#define ND_SCENEBROWSE (1<<16)
@@ -160,6 +164,7 @@ typedef struct wmNotifier {
#define ND_RENDER_RESULT (10<<16)
#define ND_COMPO_RESULT (11<<16)
#define ND_KEYINGSET (12<<16)
+#define ND_SCENEDELETE (13<<16)
/* NC_OBJECT Object */
#define ND_TRANSFORM (16<<16)
@@ -279,10 +284,17 @@ typedef struct wmTimer {
double delta; /* time since previous step in seconds */
double ltime; /* internal, last time timer was activated */
+ double ntime; /* internal, next time we want to activate the timer */
+ double stime; /* internal, when the timer started */
int sleep; /* internal, put timers to sleep when needed */
} wmTimer;
+/* **************** Paint Cursor ******************* */
+
+typedef void (*wmPaintCursorDraw)(struct bContext *C, int, int, void *customdata);
+
+
/* ****************** Messages ********************* */
enum {
diff --git a/source/blender/windowmanager/intern/Makefile b/source/blender/windowmanager/intern/Makefile
index 8f0f47c52d0..f4d65975d43 100644
--- a/source/blender/windowmanager/intern/Makefile
+++ b/source/blender/windowmanager/intern/Makefile
@@ -44,7 +44,7 @@ CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
CPPFLAGS += -I$(NAN_GHOST)/include
CPPFLAGS += -I$(NAN_ELBEEM)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS)
+CPPFLAGS += $(NAN_SDLCFLAGS)
# modules
CPPFLAGS += -I../../editors/include
@@ -58,7 +58,6 @@ CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../gpu
CPPFLAGS += -I../../render/extern/include
-CPPFLAGS += -I../../radiosity/extern/include
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I../../blenfont
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 13157378057..fecd5c20a15 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -69,7 +69,7 @@ void WM_operator_free(wmOperator *op)
MEM_freeN(op->properties);
}
- if(op->reports) {
+ if(op->reports && (op->flag & OPERATOR_REPORT_FREE)) {
BKE_reports_clear(op->reports);
MEM_freeN(op->reports);
}
@@ -103,7 +103,7 @@ void wm_operator_register(bContext *C, wmOperator *op)
/* Report the string representation of the operator */
- buf = WM_operator_pystring(op->type, op->ptr, 1);
+ buf = WM_operator_pystring(C, op->type, op->ptr, 1);
BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
MEM_freeN(buf);
@@ -130,7 +130,7 @@ void WM_keymap_init(bContext *C)
{
wmWindowManager *wm= CTX_wm_manager(C);
- if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
+ if(wm && CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
wm_window_keymap(wm);
ED_spacetypes_keymap(wm);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index d40e6c60bfd..717c2d25261 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -52,6 +52,7 @@
#include "BKE_pointcache.h"
#include "ED_fileselect.h"
+#include "ED_info.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_util.h"
@@ -129,7 +130,7 @@ static wmNotifier *wm_notifier_next(wmWindowManager *wm)
void wm_event_do_notifiers(bContext *C)
{
wmWindowManager *wm= CTX_wm_manager(C);
- wmNotifier *note;
+ wmNotifier *note, *next;
wmWindow *win;
if(wm==NULL)
@@ -141,7 +142,9 @@ void wm_event_do_notifiers(bContext *C)
CTX_wm_window_set(C, win);
- for(note= wm->queue.first; note; note= note->next) {
+ for(note= wm->queue.first; note; note= next) {
+ next= note->next;
+
if(note->category==NC_WM) {
if( ELEM(note->data, ND_FILEREAD, ND_FILESAVE)) {
wm->file_saved= 1;
@@ -156,16 +159,28 @@ void wm_event_do_notifiers(bContext *C)
ED_screen_set(C, note->reference); // XXX hrms, think this over!
printf("screen set %p\n", note->reference);
}
+ else if(note->data==ND_SCREENDELETE) {
+ ED_screen_delete(C, note->reference); // XXX hrms, think this over!
+ printf("screen delete %p\n", note->reference);
+ }
}
else if(note->category==NC_SCENE) {
if(note->data==ND_SCENEBROWSE) {
ED_screen_set_scene(C, note->reference); // XXX hrms, think this over!
printf("scene set %p\n", note->reference);
}
+ if(note->data==ND_SCENEDELETE) {
+ ED_screen_delete_scene(C, note->reference); // XXX hrms, think this over!
+ printf("scene delete %p\n", note->reference);
+ }
else if(note->data==ND_FRAME)
do_anim= 1;
}
}
+ if(note->category == NC_SCENE || note->category == NC_OBJECT) {
+ ED_info_stats_clear(CTX_data_scene(C));
+ WM_event_add_notifier(C, NC_INFO, NULL);
+ }
}
if(do_anim) {
/* depsgraph gets called, might send more notifiers */
@@ -330,11 +345,12 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
/* initialize error reports */
if (reports) {
- op->reports= reports; /* must be initialized alredy */
+ op->reports= reports; /* must be initialized already */
}
else {
op->reports= MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
BKE_reports_init(op->reports, RPT_STORE);
+ op->flag |= OPERATOR_REPORT_FREE;
}
/* recursive filling of operator macro list */
@@ -362,7 +378,7 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
static void wm_operator_print(wmOperator *op)
{
- char *buf = WM_operator_pystring(op->type, op->ptr, 1);
+ char *buf = WM_operator_pystring(NULL, op->type, op->ptr, 1);
printf("%s\n", buf);
MEM_freeN(buf);
}
@@ -377,13 +393,13 @@ static void wm_region_mouse_co(bContext *C, wmEvent *event)
}
}
-static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties)
+static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports)
{
wmWindowManager *wm= CTX_wm_manager(C);
int retval= OPERATOR_PASS_THROUGH;
if(wm_operator_poll(C, ot)) {
- wmOperator *op= wm_operator_create(wm, ot, properties, NULL);
+ wmOperator *op= wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */
if((G.f & G_DEBUG) && event && event->type!=MOUSEMOVE)
printf("handle evt %d win %d op %s\n", event?event->type:0, CTX_wm_screen(C)->subwinactive, ot->idname);
@@ -427,10 +443,12 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
return retval;
}
-/* invokes operator in context */
-int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties)
+/* WM_operator_name_call is the main accessor function
+ * this is for python to access since its done the operator lookup
+ *
+ * invokes operator in context */
+static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports)
{
- wmOperatorType *ot= WM_operatortype_find(opstring, 0);
wmWindow *window= CTX_wm_window(C);
wmEvent *event;
@@ -458,7 +476,7 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe
CTX_wm_region_set(C, ar1);
}
- retval= wm_operator_invoke(C, ot, event, properties);
+ retval= wm_operator_invoke(C, ot, event, properties, reports);
/* set region back */
CTX_wm_region_set(C, ar);
@@ -473,7 +491,7 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe
ARegion *ar= CTX_wm_region(C);
CTX_wm_region_set(C, NULL);
- retval= wm_operator_invoke(C, ot, event, properties);
+ retval= wm_operator_invoke(C, ot, event, properties, reports);
CTX_wm_region_set(C, ar);
return retval;
@@ -488,7 +506,7 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe
CTX_wm_region_set(C, NULL);
CTX_wm_area_set(C, NULL);
- retval= wm_operator_invoke(C, ot, event, properties);
+ retval= wm_operator_invoke(C, ot, event, properties, reports);
CTX_wm_region_set(C, ar);
CTX_wm_area_set(C, area);
@@ -497,32 +515,45 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe
case WM_OP_EXEC_DEFAULT:
event= NULL; /* pass on without break */
case WM_OP_INVOKE_DEFAULT:
- return wm_operator_invoke(C, ot, event, properties);
+ return wm_operator_invoke(C, ot, event, properties, reports);
}
}
return 0;
}
+
+/* invokes operator in context */
+int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties)
+{
+ wmOperatorType *ot= WM_operatortype_find(opstring, 0);
+ if(ot)
+ return wm_operator_call_internal(C, ot, context, properties, NULL);
+
+ return 0;
+}
+
/* Similar to WM_operator_name_call called with WM_OP_EXEC_DEFAULT context.
- wmOperatorType is used instead of operator name since python alredy has the operator type
- poll() must be called by python before this runs.
- reports can be passed to this function (so python can report them as exceptions)
*/
-int WM_operator_call_py(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports)
+int WM_operator_call_py(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- wmOperator *op= wm_operator_create(wm, ot, properties, reports);
int retval= OPERATOR_CANCELLED;
-
+
+#if 0
+ wmOperator *op;
+ wmWindowManager *wm= CTX_wm_manager(C);
+ op= wm_operator_create(wm, ot, properties, reports);
+
if (op->type->exec)
retval= op->type->exec(C, op);
else
printf("error \"%s\" operator has no exec function, python cannot call it\n", op->type->name);
-
- if (reports)
- op->reports= NULL; /* dont let the operator free reports passed to this function */
- WM_operator_free(op);
+#endif
+
+ retval= wm_operator_call_internal(C, ot, context, properties, reports);
return retval;
}
@@ -664,7 +695,19 @@ static int wm_eventmatch(wmEvent *winevent, wmKeymapItem *kmi)
int kmitype= wm_userdef_event_map(kmi->type);
if(kmi->inactive) return 0;
-
+
+ /* exception for middlemouse emulation */
+ if((U.flag & USER_TWOBUTTONMOUSE) && (kmi->type == MIDDLEMOUSE)) {
+ if(winevent->type == LEFTMOUSE && winevent->alt) {
+ wmKeymapItem tmp= *kmi;
+
+ tmp.type= winevent->type;
+ tmp.alt= winevent->alt;
+ if(wm_eventmatch(winevent, &tmp))
+ return 1;
+ }
+ }
+
/* the matching rules */
if(kmitype==KM_TEXTINPUT)
if(ISKEYBOARD(winevent->type)) return 1;
@@ -683,8 +726,15 @@ static int wm_eventmatch(wmEvent *winevent, wmKeymapItem *kmi)
if(winevent->alt != kmi->alt && !(winevent->alt & kmi->alt)) return 0;
if(kmi->oskey!=KM_ANY)
if(winevent->oskey != kmi->oskey && !(winevent->oskey & kmi->oskey)) return 0;
+
if(kmi->keymodifier)
if(winevent->keymodifier!=kmi->keymodifier) return 0;
+
+ /* key modifiers always check when event has it */
+ /* otherwise regular keypresses with keymodifier still work */
+ if(winevent->keymodifier)
+ if(ISKEYBOARD(winevent->type))
+ if(winevent->keymodifier!=kmi->keymodifier) return 0;
return 1;
}
@@ -786,7 +836,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
wmOperatorType *ot= WM_operatortype_find(event->keymap_idname, 0);
if(ot)
- retval= wm_operator_invoke(C, ot, event, properties);
+ retval= wm_operator_invoke(C, ot, event, properties, NULL);
}
if(retval & OPERATOR_PASS_THROUGH)
@@ -1501,11 +1551,6 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata)
else
event.type= MIDDLEMOUSE;
- if(event.val)
- event.keymodifier= evt->keymodifier= event.type;
- else
- event.keymodifier= evt->keymodifier= 0;
-
update_tablet_data(win, &event);
wm_event_add(win, &event);
@@ -1544,6 +1589,12 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata)
if(event.val==KM_PRESS && (evt->ctrl || evt->alt || evt->shift))
event.oskey= evt->oskey = 3; // define?
}
+ else {
+ if(event.val==KM_PRESS && event.keymodifier==0)
+ evt->keymodifier= event.type; /* only set in eventstate, for next event */
+ else if(event.val==KM_RELEASE && event.keymodifier==event.type)
+ event.keymodifier= evt->keymodifier= 0;
+ }
/* if test_break set, it catches this. XXX Keep global for now? */
if(event.type==ESCKEY)
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index ffaa315f04e..3921da4f062 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -68,6 +68,7 @@
#include "BKE_main.h"
#include "BKE_packedFile.h"
#include "BKE_report.h"
+#include "BKE_sound.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
@@ -95,6 +96,7 @@
#include "wm.h"
#include "wm_window.h"
+static void writeBlog(void);
/* To be able to read files without windows closing, opening, moving
we try to prepare for worst case:
@@ -224,7 +226,7 @@ static void wm_init_userdef()
{
UI_init_userdef();
MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
-
+ sound_init();
}
void WM_read_file(bContext *C, char *name, ReportList *reports)
@@ -252,11 +254,13 @@ void WM_read_file(bContext *C, char *name, ReportList *reports)
wm_check(C); /* opens window(s), checks keymaps */
// XXX mainwindow_set_filename_to_title(G.main->name);
-// XXX sound_initialize_sounds();
if(retval==2) wm_init_userdef(); // in case a userdef is read from regular .blend
- if (retval!=0) G.relbase_valid = 1;
+ if (retval!=0) {
+ G.relbase_valid = 1;
+ writeBlog();
+ }
// XXX undo_editmode_clear();
BKE_reset_undo();
@@ -384,7 +388,7 @@ void WM_read_autosavefile(bContext *C)
void read_Blog(void)
{
- char name[FILE_MAX], filename[FILE_MAX];
+ char name[FILE_MAX];
LinkNode *l, *lines;
struct RecentFile *recent;
char *line;
@@ -416,58 +420,6 @@ void read_Blog(void)
BLI_free_file_lines(lines);
-#ifdef WIN32
- /* Add the drive names to the listing */
- {
- __int64 tmp;
- char folder[MAX_PATH];
- char tmps[4];
- int i;
-
- tmp= GetLogicalDrives();
-
- for (i=2; i < 26; i++) {
- if ((tmp>>i) & 1) {
- tmps[0]='a'+i;
- tmps[1]=':';
- tmps[2]='\\';
- tmps[3]=0;
-
-// XX fsmenu_insert_entry(tmps, 0, 0);
- }
- }
-
- /* Adding Desktop and My Documents */
-// XXX fsmenu_append_separator();
-
- SHGetSpecialFolderPath(0, folder, CSIDL_PERSONAL, 0);
-// XXX fsmenu_insert_entry(folder, 0, 0);
- SHGetSpecialFolderPath(0, folder, CSIDL_DESKTOPDIRECTORY, 0);
-// XXX fsmenu_insert_entry(folder, 0, 0);
-
-// XXX fsmenu_append_separator();
- }
-#endif
-
- BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs");
- lines= BLI_read_file_as_lines(name);
-
- for (l= lines; l; l= l->next) {
- char *line= l->link;
-
- if (!BLI_streq(line, "")) {
-// XXX fsmenu_insert_entry(line, 0, 1);
- }
- }
-
-// XXX fsmenu_append_separator();
-
- /* add last saved file */
- BLI_split_dirfile(G.sce, name, filename); /* G.sce shouldn't be relative */
-
-// XXX fsmenu_insert_entry(name, 0, 0);
-
- BLI_free_file_lines(lines);
}
static void writeBlog(void)
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 599844f1020..9a268f8be17 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -38,7 +38,6 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
@@ -90,17 +89,7 @@
#include "GPU_extensions.h"
#include "GPU_draw.h"
-
-
-/* XXX */
-static void sound_init_listener(void)
-{
- G.listener = MEM_callocN(sizeof(bSoundListener), "soundlistener");
- G.listener->gain = 1.0;
- G.listener->dopplerfactor = 1.0;
- G.listener->dopplervelocity = 340.29f;
-}
-
+#include "BKE_sound.h"
static void wm_init_reports(bContext *C)
{
@@ -145,7 +134,6 @@ void WM_init(bContext *C)
// glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- sound_init_listener();
// init_node_butfuncs();
ED_preview_init_dbase();
@@ -184,7 +172,9 @@ extern void free_posebuf();
void WM_exit(bContext *C)
{
wmWindow *win;
-
+
+ sound_exit();
+
/* first wrap up running stuff, we assume only the active WM is running */
/* modal handlers are on window level freed, others too? */
/* note; same code copied in wm_files.c */
@@ -216,16 +206,6 @@ void WM_exit(bContext *C)
BKE_freecubetable();
-// if (G.background == 0)
-// sound_end_all_sounds();
-
-
- /* before free_blender so py's gc happens while library still exists */
- /* needed at least for a rare sigsegv that can happen in pydrivers */
-#ifndef DISABLE_PYTHON
- BPY_end_python();
-#endif
-
fastshade_free_render(); /* shaded view */
ED_preview_free_dbase(); /* frees a Main dbase, before free_blender! */
wm_free_reports(C); /* before free_blender! - since the ListBases get freed there */
@@ -245,10 +225,18 @@ void WM_exit(bContext *C)
// free_txt_data();
-// sound_exit_audio();
- if(G.listener) MEM_freeN(G.listener);
-
-
+
+#ifndef DISABLE_PYTHON
+ /* XXX - old note */
+ /* before free_blender so py's gc happens while library still exists */
+ /* needed at least for a rare sigsegv that can happen in pydrivers */
+
+ /* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's
+ * so decref'ing them after python ends causes bad problems every time
+ * the pyDriver bug can be fixed if it happens again we can deal with it then */
+ BPY_end_python();
+#endif
+
libtiff_exit();
#ifdef WITH_QUICKTIME
@@ -272,10 +260,14 @@ void WM_exit(bContext *C)
UI_exit();
BKE_userdef_free();
- RNA_exit();
+ RNA_exit(); /* should be after BPY_end_python so struct python slots are cleared */
+ wm_ghost_exit();
+
CTX_free(C);
+ SYS_DeleteSystem(SYS_GetSystem());
+
if(MEM_get_memory_blocks_in_use()!=0) {
printf("Error Totblock: %d\n", MEM_get_memory_blocks_in_use());
MEM_printmemlist();
@@ -292,9 +284,6 @@ void WM_exit(bContext *C)
}
#endif
-
- SYS_DeleteSystem(SYS_GetSystem());
-
exit(G.afbreek==1);
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index c40b5070fe6..16c574ae7d1 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -322,7 +322,7 @@ void WM_operator_py_idname(char *to, const char *from)
/* some.op -> SOME_OT_op */
void WM_operator_bl_idname(char *to, const char *from)
{
- char *sep= strstr(from, ".");
+ char *sep= strchr(from, '.');
if(sep) {
int i, ofs= (sep-from);
@@ -345,7 +345,7 @@ void WM_operator_bl_idname(char *to, const char *from)
* When calling from an existing wmOperator do.
* WM_operator_pystring(op->type, op->ptr);
*/
-char *WM_operator_pystring(wmOperatorType *ot, PointerRNA *opptr, int all_args)
+char *WM_operator_pystring(bContext *C, wmOperatorType *ot, PointerRNA *opptr, int all_args)
{
const char *arg_name= NULL;
char idname_py[OP_MAX_TYPENAME];
@@ -378,7 +378,7 @@ char *WM_operator_pystring(wmOperatorType *ot, PointerRNA *opptr, int all_args)
if (strcmp(arg_name, "rna_type")==0) continue;
- buf= RNA_property_as_string(opptr, prop);
+ buf= RNA_property_as_string(C, opptr, prop);
ok= 1;
@@ -388,7 +388,7 @@ char *WM_operator_pystring(wmOperatorType *ot, PointerRNA *opptr, int all_args)
prop_default= RNA_struct_find_property(&opptr_default, arg_name);
if(prop_default) {
- buf_default= RNA_property_as_string(&opptr_default, prop_default);
+ buf_default= RNA_property_as_string(C, &opptr_default, prop_default);
if(strcmp(buf, buf_default)==0)
ok= 0; /* values match, dont bother printing */
@@ -543,7 +543,12 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style);
- uiDefAutoButsRNA(C, layout, &ptr, 2);
+ uiItemL(layout, op->type->name, 0);
+
+ if(op->type->ui)
+ op->type->ui((bContext*)C, &ptr, layout);
+ else
+ uiDefAutoButsRNA(C, layout, &ptr, 2);
uiPopupBoundsBlock(block, 4.0f, 0, 0);
uiEndBlock(C, block);
@@ -586,7 +591,12 @@ static uiBlock *wm_block_create_menu(bContext *C, ARegion *ar, void *arg_op)
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1);
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style);
- uiDefAutoButsRNA(C, layout, op->ptr, 2);
+ uiItemL(layout, op->type->name, 0);
+
+ if(op->type->ui)
+ op->type->ui(C, op->ptr, layout);
+ else
+ uiDefAutoButsRNA(C, layout, op->ptr, 2);
uiPopupBoundsBlock(block, 4.0f, 0, 0);
uiEndBlock(C, block);
@@ -711,6 +721,7 @@ int wm_search_menu_poll(bContext *C)
{
if(CTX_wm_window(C)==NULL) return 0;
if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console
+ if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor
return 1;
}
@@ -733,7 +744,6 @@ static void WM_OT_window_duplicate(wmOperatorType *ot)
ot->name= "Duplicate Window";
ot->idname= "WM_OT_window_duplicate";
- ot->invoke= WM_operator_confirm;
ot->exec= wm_window_duplicate_op;
ot->poll= WM_operator_winactive;
}
@@ -806,22 +816,12 @@ static EnumPropertyItem *open_recentfile_itemf(bContext *C, PointerRNA *ptr, int
struct RecentFile *recent;
int totitem= 0, i, ofs= 0;
- if(G.sce[0]) {
- tmp.value= 1;
- tmp.identifier= G.sce;
- tmp.name= G.sce;
- RNA_enum_item_add(&item, &totitem, &tmp);
- ofs = 1;
- }
-
/* dynamically construct enum */
for(recent = G.recent_files.first, i=0; (i<U.recent_files) && (recent); recent = recent->next, i++) {
- if(strcmp(recent->filename, G.sce)) {
- tmp.value= i+ofs+1;
- tmp.identifier= recent->filename;
- tmp.name= recent->filename;
- RNA_enum_item_add(&item, &totitem, &tmp);
- }
+ tmp.value= i+ofs+1;
+ tmp.identifier= recent->filename;
+ tmp.name= recent->filename;
+ RNA_enum_item_add(&item, &totitem, &tmp);
}
RNA_enum_item_end(&item, &totitem);
@@ -861,10 +861,17 @@ static void untitled(char *name)
}
}
+static void load_set_load_ui(wmOperator *op)
+{
+ if(!RNA_property_is_set(op->ptr, "load_ui"))
+ RNA_boolean_set(op->ptr, "load_ui", !(U.flag & USER_FILENOUI));
+}
static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
RNA_string_set(op->ptr, "filename", G.sce);
+ load_set_load_ui(op);
+
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
@@ -873,7 +880,14 @@ static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
{
char filename[FILE_MAX];
+
RNA_string_get(op->ptr, "filename", filename);
+ load_set_load_ui(op);
+
+ if(RNA_boolean_get(op->ptr, "load_ui"))
+ G.fileflags &= ~G_FILE_NO_UI;
+ else
+ G.fileflags |= G_FILE_NO_UI;
// XXX wm in context is not set correctly after WM_read_file -> crash
// do it before for now, but is this correct with multiple windows?
@@ -894,6 +908,8 @@ static void WM_OT_open_mainfile(wmOperatorType *ot)
ot->poll= WM_operator_winactive;
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE);
+
+ RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file.");
}
static int wm_recover_last_session_exec(bContext *C, wmOperator *op)
@@ -1129,7 +1145,6 @@ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot)
ot->name= "Toggle Fullscreen";
ot->idname= "WM_OT_window_fullscreen_toggle";
- ot->invoke= WM_operator_confirm;
ot->exec= wm_window_fullscreen_toggle_op;
ot->poll= WM_operator_winactive;
}
@@ -1161,7 +1176,7 @@ static void WM_OT_exit_blender(wmOperatorType *ot)
*/
void *WM_paint_cursor_activate(wmWindowManager *wm, int (*poll)(bContext *C),
- void (*draw)(bContext *C, int, int, void *customdata), void *customdata)
+ wmPaintCursorDraw draw, void *customdata)
{
wmPaintCursor *pc= MEM_callocN(sizeof(wmPaintCursor), "paint cursor");
@@ -1993,19 +2008,29 @@ void wm_window_keymap(wmWindowManager *wm)
/* note, this doesn't replace existing keymap items */
WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
- WM_keymap_verify_item(keymap, "WM_OT_read_homefile", XKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0);
- WM_keymap_verify_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
+// WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_read_homefile", XKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
+// WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0);
+// WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0);
+// WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
/* debug/testing */
WM_keymap_verify_item(keymap, "WM_OT_ten_timer", TKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0);
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 31e6de2527b..d70516ef02e 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -26,6 +26,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -90,7 +91,7 @@ static void wm_window_check_position(rcti *rect)
wm_get_screensize(&width, &height);
#ifdef __APPLE__
- height -= 42;
+ height -= 70;
#endif
if(rect->xmin < 0) {
@@ -207,7 +208,10 @@ wmWindow *wm_window_copy(bContext *C, wmWindow *winorig)
win->sizey= winorig->sizey;
/* duplicate assigns to window */
- ED_screen_duplicate(win, winorig->screen);
+ win->screen= ED_screen_duplicate(win, winorig->screen);
+ BLI_strncpy(win->screenname, win->screen->id.name+2, 21);
+ win->screen->winid= win->winid;
+
win->screen->do_refresh= 1;
win->screen->do_draw= 1;
@@ -443,14 +447,14 @@ void WM_window_open_temp(bContext *C, rcti *position, int type)
ED_area_newspace(C, sa, SPACE_IMAGE);
}
else {
- ED_area_newspace(C, sa, SPACE_INFO);
+ ED_area_newspace(C, sa, SPACE_USERPREF);
}
ED_screen_set(C, win->screen);
if(sa->spacetype==SPACE_IMAGE)
GHOST_SetTitle(win->ghostwin, "Blender Render");
- else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_INFO))
+ else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF))
GHOST_SetTitle(win->ghostwin, "Blender User Preferences");
else if(sa->spacetype==SPACE_FILE)
GHOST_SetTitle(win->ghostwin, "Blender File View");
@@ -585,6 +589,8 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
kdata.key= GHOST_kKeyCommand;
wm_event_add_ghostevent(win, GHOST_kEventKeyUp, &kdata);
}
+ /* keymodifier zero, it hangs on hotkeys that open windows otherwise */
+ win->eventstate->keymodifier= 0;
/* entering window, update mouse pos. but no event */
GHOST_GetCursorPosition(g_system, &wx, &wy);
@@ -685,12 +691,13 @@ static int wm_window_timer(const bContext *C)
wmTimer *wt;
for(wt= win->timers.first; wt; wt= wt->next) {
if(wt->sleep==0) {
- if(wt->timestep < time - wt->ltime) {
+ if(time > wt->ntime) {
wmEvent event= *(win->eventstate);
wt->delta= time - wt->ltime;
wt->duration += wt->delta;
wt->ltime= time;
+ wt->ntime= wt->stime + wt->timestep*ceil(wt->duration/wt->timestep);
event.type= wt->event_type;
event.custom= EVT_DATA_TIMER;
@@ -756,6 +763,14 @@ void wm_ghost_init(bContext *C)
}
}
+void wm_ghost_exit(void)
+{
+ if(g_system)
+ GHOST_DisposeSystem(g_system);
+
+ g_system= NULL;
+}
+
/* **************** timer ********************** */
/* to (de)activate running timers temporary */
@@ -777,6 +792,8 @@ wmTimer *WM_event_add_window_timer(wmWindow *win, int event_type, double timeste
wt->event_type= event_type;
wt->ltime= PIL_check_seconds_timer();
+ wt->ntime= wt->ltime + timestep;
+ wt->stime= wt->ltime;
wt->timestep= timestep;
BLI_addtail(&win->timers, wt);
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index c2a2b00b796..f159f7f098d 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -33,6 +33,7 @@ struct bScreen;
/* *************** internal api ************** */
void wm_ghost_init (bContext *C);
+void wm_ghost_exit(void);
wmWindow *wm_window_new (bContext *C);
void wm_window_free (bContext *C, wmWindow *win);
diff --git a/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt
index 28fe13cbf64..30a1c08ebc9 100644
--- a/blenderplayer/CMakeLists.txt
+++ b/source/blenderplayer/CMakeLists.txt
@@ -66,17 +66,13 @@ IF(UNIX)
gp_common
bf_string
bf_ghost
- bf_blenkernel
- verse
- bf_blenkernel
+ bf_rna
+ bf_blenkernel
bf_blenloader
bf_blenpluginapi
bf_blroutines
bf_converter
- bf_sumo
bf_ketsji
- extern_solid
- extern_qhull
bf_bullet
bf_common
bf_dummy
@@ -85,12 +81,11 @@ IF(UNIX)
bf_oglrasterizer
bf_expressions
bf_scenegraph
- bf_IK
+ bf_IK
bf_moto
- bf_soundsystem
bf_kernel
bf_nodes
- bf_gpu
+ bf_gpu
bf_imbuf
bf_avi
kx_network
@@ -99,17 +94,30 @@ IF(UNIX)
extern_bullet
bf_guardedalloc
bf_memutil
+ bf_python
+ bf_gen_python
bf_blenlib
bf_cineon
bf_openexr
extern_libopenjpeg
bf_dds
bf_readblenfile
+ bf_dna
+ bf_videotex
+ bf_blenfont
+ bf_audaspace
blenkernel_blc
- bf_quicktime
extern_binreloc
- extern_glew
- )
+ extern_glew
+ )
+
+ IF(WITH_QUICKTIME)
+ SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} quicktime)
+ ENDIF(WITH_QUICKTIME)
+
+ IF(WITH_CXX_GUARDEDALLOC)
+ SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
+ ENDIF(WITH_CXX_GUARDEDALLOC)
FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
SET(REMLIB ${SORTLIB})
@@ -129,4 +137,8 @@ ELSE(UNIX)
TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS})
ENDIF(UNIX)
+IF(WITH_PLAYER)
+ ADD_SUBDIRECTORY(bad_level_call_stubs)
+ENDIF(WITH_PLAYER)
+
SETUP_LIBLINKS(blenderplayer)
diff --git a/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt
new file mode 100644
index 00000000000..fea19d90ed0
--- /dev/null
+++ b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt
@@ -0,0 +1,40 @@
+# $Id$
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+FILE(GLOB SRC stubs.c)
+
+SET(INC
+ .
+ ..
+ ../../../source/blender/makesdna
+ ../../../source/blender/makesrna
+)
+
+IF(WITH_INTERNATIONAL)
+ ADD_DEFINITIONS(-DWITH_FREETYPE2)
+ENDIF(WITH_INTERNATIONAL)
+
+BLENDERLIB_NOLIST(blenkernel_blc "${SRC}" "${INC}")
diff --git a/source/blenderplayer/bad_level_call_stubs/Makefile b/source/blenderplayer/bad_level_call_stubs/Makefile
new file mode 100644
index 00000000000..1d9f6a27327
--- /dev/null
+++ b/source/blenderplayer/bad_level_call_stubs/Makefile
@@ -0,0 +1,45 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+#
+
+LIBNAME = blenkernel_blc
+DIR = $(OCGDIR)/blenderplayer/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_2_C_WARNINGS)
+CFLAGS += $(FIX_STUBS_WARNINGS)
+
+CPPFLAGS += $(OGL_CPPFLAGS)
+CPPFLAGS += -I../../source/blender/makesdna
+CPPFLAGS += -I../../source/blender/makesrna
+
+# path to our own external headerfiles
+CPPFLAGS += -I..
+
diff --git a/source/blenderplayer/bad_level_call_stubs/SConscript b/source/blenderplayer/bad_level_call_stubs/SConscript
new file mode 100644
index 00000000000..ce502af57be
--- /dev/null
+++ b/source/blenderplayer/bad_level_call_stubs/SConscript
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = 'stubs.c'
+
+incs = '#/source/blender/makesdna'
+incs += ' #/source/blender/makesrna'
+
+defs = ''
+if env['WITH_BF_INTERNATIONAL']:
+ defs += 'WITH_FREETYPE2'
+
+env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype=['player'],priority=[145] )
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
new file mode 100644
index 00000000000..5ddafca5340
--- /dev/null
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -0,0 +1,200 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * BKE_bad_level_calls function stubs
+ */
+
+#include <stdlib.h>
+#include "DNA_listBase.h"
+#include "RNA_types.h"
+
+/*new render funcs */
+float *RE_RenderLayerGetPass(struct RenderLayer *rl, int passtype) {return NULL;}
+float RE_filter_value(int type, float x) {return 0.0f;}
+struct RenderLayer *RE_GetRenderLayer(struct RenderResult *rr, const char *name) {return (struct RenderLayer *)NULL;}
+
+/* zbuf.c stub */
+void antialias_tagbuf(int xsize, int ysize, char *rectmove) {}
+void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize, float *newrect, float *imgrect, float *vecbufrect, float *zbufrect) {}
+
+/* imagetexture.c stub */
+void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result) {}
+
+/* texture.c */
+int multitex_thread(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres, short thread, short which_output) {return 0;}
+int multitex_ext(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres){return 0;}
+
+/* nodes */
+struct RenderResult *RE_GetResult(struct Render *re){return (struct RenderResult *) NULL;}
+struct Render *RE_GetRender(const char *name){return (struct Render *) NULL;}
+
+/* blenkernel */
+char* btempdir(){return NULL;}
+void RE_FreeRenderResult(struct RenderResult *res){}
+char* datatoc_bmonofont_ttf(){return NULL;}
+int datatoc_bmonofont_ttf_size(){return 0;}
+struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return (struct RenderResult *) NULL;}
+void RE_GetResultImage(struct Render *re, struct RenderResult *rr){}
+int RE_RenderInProgress(struct Render *re){return 0;}
+struct Scene *RE_GetScene(struct Render *re){return (struct Scene *) NULL;}
+void RE_Database_Free(struct Render *re){}
+void RE_FreeRender(struct Render *re){}
+void RE_shade_external(struct Render *re, struct ShadeInput *shi, struct ShadeResult *shr){}
+void RE_DataBase_GetView(struct Render *re, float mat[][4]){}
+int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta){return 0;}
+float texture_value_blend(float tex, float out, float fact, float facg, int blendtype, int flip){return 0.0f;}
+void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype){}
+char stipple_quarttone[1]; //GLubyte stipple_quarttone[128]
+double elbeemEstimateMemreq(int res, float sx, float sy, float sz, int refine, char *retstr) {return 0.0f;}
+
+/* rna */
+void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference){}
+void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep){}
+void object_test_constraints (struct Object *owner){}
+void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr){}
+void ED_node_composit_default(struct Scene *sce){}
+
+struct EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, struct EditBone *ebo){return (struct EditBone *) NULL;}
+struct ListBase *get_active_constraints (struct Object *ob){return (struct ListBase *) NULL;}
+int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan){return 0;}
+
+int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit){return 0;}
+int ED_space_image_show_render(struct SpaceImage *sima){return 0;}
+int ED_space_image_show_paint(struct SpaceImage *sima){return 0;}
+void ED_space_image_set(struct bContext *C, struct SpaceImage *sima, struct Scene *scene, struct Object *obedit, struct Image *ima){}
+struct ImBuf *ED_space_image_buffer(struct SpaceImage *sima){return (struct ImBuf *) NULL;}
+
+struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob){return (struct PTCacheEdit *) NULL;}
+
+/* rna editors */
+char *ED_info_stats_string(struct Scene *scene){return NULL;}
+void ED_area_tag_redraw(struct ScrArea *sa){}
+void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op){}
+void ED_node_texture_default(struct Tex *tx){}
+int text_file_modified(struct Text *text){return 0;}
+void ED_node_shader_default(struct Material *ma){}
+void ED_screen_animation_timer_update(struct bContext *C, int redraws){}
+int ED_object_modifier_remove(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md){return 0;}
+int ED_object_modifier_add(struct ReportList *reports, struct Scene *scene, struct Object *ob, int type){return 0;}
+int uiLayoutGetActive(struct uiLayout *layout){return 0;}
+int uiLayoutGetOperatorContext(struct uiLayout *layout){return 0;}
+int uiLayoutGetAlignment(struct uiLayout *layout){return 0;}
+int uiLayoutGetEnabled(struct uiLayout *layout){return 0;}
+float uiLayoutGetScaleX(struct uiLayout *layout){return 0.0f;}
+float uiLayoutGetScaleY(struct uiLayout *layout){return 0.0f;}
+void uiLayoutSetActive(struct uiLayout *layout, int active){}
+void uiLayoutSetOperatorContext(struct uiLayout *layout, int opcontext){}
+void uiLayoutSetEnabled(struct uiLayout *layout, int enabled){}
+void uiLayoutSetAlignment(struct uiLayout *layout, int alignment){}
+void uiLayoutSetScaleX(struct uiLayout *layout, float scale){}
+void uiLayoutSetScaleY(struct uiLayout *layout, float scale){}
+
+void uiItemR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int flag){}
+
+PointerRNA uiItemFullO(struct uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context, int flag){PointerRNA a; return a;}
+struct uiLayout *uiLayoutRow(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;}
+struct uiLayout *uiLayoutColumn(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;}
+struct uiLayout *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align){return (struct uiLayout *) NULL;}
+struct uiLayout *uiLayoutBox(struct uiLayout *layout){return (struct uiLayout *) NULL;}
+struct uiLayout *uiLayoutSplit(struct uiLayout *layout, float percentage){return (struct uiLayout *) NULL;}
+void uiItemsEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){}
+void uiItemMenuEnumR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname){}
+void uiItemEnumR_string(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value){}
+void uiItemPointerR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname){}
+void uiItemsEnumO(struct uiLayout *layout, char *opname, char *propname){}
+void uiItemEnumO_string(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value_str){}
+void uiItemMenuEnumO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname){}
+void uiItemBooleanO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){}
+void uiItemIntO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){}
+void uiItemFloatO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, float value){}
+void uiItemStringO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value){}
+void uiItemL(struct uiLayout *layout, char *name, int icon){}
+void uiItemM(struct uiLayout *layout, struct bContext *C, char *name, int icon, char *menuname){}
+void uiItemS(struct uiLayout *layout){}
+void uiLayoutSetContextPointer(struct uiLayout *layout, char *name, struct PointerRNA *ptr){}
+
+/* rna template */
+void uiTemplateHeader(struct uiLayout *layout, struct bContext *C, int menus){}
+void uiTemplateID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop){}
+struct uiLayout *uiTemplateModifier(struct uiLayout *layout, struct PointerRNA *ptr){return (struct uiLayout *) NULL;}
+struct uiLayout *uiTemplateConstraint(struct uiLayout *layout, struct PointerRNA *ptr){return (struct uiLayout *) NULL;}
+void uiTemplatePreview(struct uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot){}
+void uiTemplateCurveMapping(struct uiLayout *layout, struct CurveMapping *cumap, int type, int compact){}
+void uiTemplateColorRamp(struct uiLayout *layout, struct ColorBand *coba, int expand){}
+void uiTemplateLayers(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){}
+void uiTemplateTriColorSet(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){}
+void uiTemplateImageLayers(struct uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser){}
+ListBase uiTemplateList(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activepropname, int rows, int listtype){struct ListBase b = {0,0}; return b;}
+void uiTemplateRunningJobs(struct uiLayout *layout, struct bContext *C){}
+void uiTemplateOperatorSearch(struct uiLayout *layout){}
+void uiTemplateHeader3D(struct uiLayout *layout, struct bContext *C){}
+void uiTemplate_view3d_select_faceselmenu(struct uiLayout *layout, struct bContext *C){}
+void uiTemplateTextureImage(struct uiLayout *layout, struct bContext *C, struct Tex *tex){}
+
+/* rna render */
+struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;}
+void RE_engine_update_result(struct RenderEngine *engine, struct RenderResult *result){}
+void RE_engine_end_result(struct RenderEngine *engine, struct RenderResult *result){}
+void RE_engine_update_stats(struct RenderEngine *engine, char *stats, char *info){}
+void RE_layer_load_from_file(struct RenderLayer *layer, struct ReportList *reports, char *filename){}
+void RE_result_load_from_file(struct RenderResult *result, struct ReportList *reports, char *filename){}
+int RE_engine_test_break(struct RenderEngine *engine){return 0;}
+
+/* python */
+struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet){return (struct wmOperatorType *) NULL;}
+struct wmOperatorType *WM_operatortype_first(){return (struct wmOperatorType *) NULL;}
+struct wmOperatorType *WM_operatortype_exists(const char *idname){return (struct wmOperatorType *) NULL;}
+int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports){return 0;}
+int WM_operatortype_remove(const char *idname){return 0;}
+void WM_operator_properties_free(struct PointerRNA *ptr){}
+void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring){}
+void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata){}
+void WM_operator_bl_idname(char *to, const char *from){}
+short insert_keyframe (struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;}
+
+/* smoke */
+void lzo1x_1_compress(void) {return;};
+void LzmaCompress(void) {return;};
+void smoke_export(void) {return;};
+void lzo1x_decompress(void) {return;};
+void LzmaUncompress(void) {return;};
+void smoke_init(void) {return;};
+void smoke_turbulence_init(void) {return;};
+void smoke_turbulence_initBlenderRNA(void) {return;};
+void smoke_initBlenderRNA(void) {return;};
+void smoke_free(void) {return;};
+void smoke_turbulence_free(void) {return;};
+void smoke_turbulence_step(void) {return;};
+void smoke_dissolve(void) {return;};
+void smoke_get_density(void) {return;};
+void smoke_get_heat(void) {return;};
+void smoke_get_velocity_x(void) {return;};
+void smoke_get_velocity_y(void) {return;};
+void smoke_get_velocity_z(void) {return;};
+void smoke_get_obstacle(void) {return;};
+void smoke_get_index(void) {return;};
+void smoke_step(void) {return;};
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index d1fc5f9261a..0138761ab0b 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -84,123 +84,213 @@ ENDIF(WIN32)
SET(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
+IF(WITH_INSTALL)
-IF(UNIX)
- ADD_CUSTOM_COMMAND(TARGET blender
- POST_BUILD
- MAIN_DEPENDENCY blender
- #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/plugins ${TARGETDIR}/
- #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/text/* ${TARGETDIR}/
- )
-ENDIF(UNIX)
+ IF(UNIX)
+ ADD_CUSTOM_COMMAND(TARGET blender
+ POST_BUILD
+ MAIN_DEPENDENCY blender
+ #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/plugins ${TARGETDIR}/
+ #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/text/* ${TARGETDIR}/
+ )
+ ENDIF(UNIX)
-IF(UNIX AND NOT APPLE)
- ADD_CUSTOM_COMMAND(TARGET blender
- POST_BUILD
- MAIN_DEPENDENCY blender
- COMMAND rm -Rf ${TARGETDIR}/.blender
- COMMAND mkdir ${TARGETDIR}/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/
- COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/
- COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/.blender/
- COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/.blender/
- COMMAND find ${TARGETDIR} -name CVS -prune -exec rm -rf {} "\;"
- )
-ENDIF(UNIX AND NOT APPLE)
-
-IF(APPLE)
- SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
- SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
- SET(TARGETINFO ${TARGETDIR}/blender.app/Contents/Info.plist)
-
- ADD_CUSTOM_COMMAND(TARGET blender
- POST_BUILD
- MAIN_DEPENDENCY blender
- COMMAND cp -R ${SOURCEINFO} ${TARGETDIR}/blender.app/Contents/
- COMMAND cp -R ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/
- COMMAND cp -R ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/
- COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO}
- COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender
- COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/
- COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/
- COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/io ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
- COMMAND unzip -q ${LIBDIR}/release/python.zip -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
- COMMAND find ${TARGETDIR}/blender.app -name CVS -prune -exec rm -rf {} "\;"
- COMMAND find ${TARGETDIR}/blender.app -name CVS.sandboxinfo -prune -exec rm -rf {} "\;"
- COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;"
- COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;"
- )
-ENDIF(APPLE)
+ IF(UNIX AND NOT APPLE)
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMAND rm -Rf ${TARGETDIR}/.blender
+ COMMAND mkdir ${TARGETDIR}/.blender/
+ COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/
+ )
+
+ IF(WITH_INTERNATIONAL)
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/
+ COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/
+ )
+ ENDIF(WITH_INTERNATIONAL)
+
+ IF(WITH_PYTHON)
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMENT "copying blender scripts..."
+ COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/.blender/
+ COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/io ${TARGETDIR}/.blender/
+ COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;"
+ )
+
+ # Copy the systems python into the install directory
+ # Scons copy in tools/Blender.py
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMENT "copying a subset of the systems python..."
+
+ COMMAND mkdir ${TARGETDIR}/.blender/python # PYTHONPATH and PYTHONHOME is set here
+ COMMAND mkdir ${TARGETDIR}/.blender/python/lib/
+ COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/.blender/python/lib/
+
+ COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/distutils
+ COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib2to3
+ COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/idlelib
+ COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/tkinter
+ COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/config
+
+ COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages
+ COMMAND mkdir ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages # python needs it.
-IF(WIN32)
- FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} WIN_SOURCE_DIR)
-
- ADD_CUSTOM_COMMAND(TARGET blender
- POST_BUILD
- MAIN_DEPENDENCY blender
- COMMAND if not exist \"${TARGETDIR}\\.blender\" mkdir \"${TARGETDIR}\\.blender\"
- COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\"
- COMMAND if not exist \"${TARGETDIR}\\.blender\\scripts\" mkdir \"${TARGETDIR}\\.blender\\scripts\"
- COMMAND if not exist \"${TARGETDIR}\\.blender\\ui\" mkdir \"${TARGETDIR}\\.blender\\ui\"
- COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\"
- COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\"
- COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
- COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
- COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
- COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\ui\\*.*\" \"${TARGETDIR}\\.blender\\ui\"
- COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
- COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
- COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python26.zip\" \"${TARGETDIR}\\\"
- )
-
- FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR)
-
- ADD_CUSTOM_COMMAND(TARGET blender
- POST_BUILD
- MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python26.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python26_d.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
- )
+ COMMAND rm -f ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so
+ COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;"
+ COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;"
+ COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;"
+ )
+
+ ENDIF(WITH_PYTHON)
+
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMAND find ${TARGETDIR} -name .svn -prune -exec rm -rf {} "\;"
+ )
+
+ ENDIF(UNIX AND NOT APPLE)
+
+ IF(APPLE)
+ SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
+ SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
+ SET(TARGETINFO ${TARGETDIR}/blender.app/Contents/Info.plist)
+
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMAND cp -R ${SOURCEINFO} ${TARGETDIR}/blender.app/Contents/
+ COMMAND cp -R ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/
+ COMMAND cp -R ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/
+ COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO}
+ COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender
+ COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
+ COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
+ )
+
+ IF(WITH_INTERNATIONAL)
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
+ COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/
+ COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
+ COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/
+ )
+ ENDIF(WITH_INTERNATIONAL)
+
+ IF(WITH_PYTHON)
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
+ COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/io ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
+ COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
+ COMMAND unzip -q ${LIBDIR}/release/python.zip -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
+ COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;"
+ )
+ ENDIF(WITH_PYTHON)
+
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;"
+ COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;"
+ )
+ ENDIF(APPLE)
- IF(WITH_INTERNATIONAL)
+ IF(WIN32)
+ FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} WIN_SOURCE_DIR)
+
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
+ COMMAND if not exist \"${TARGETDIR}\\.blender\" mkdir \"${TARGETDIR}\\.blender\"
+ COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\"
+ COMMAND if not exist \"${TARGETDIR}\\.blender\\ui\" mkdir \"${TARGETDIR}\\.blender\\ui\"
+ COMMAND if not exist \"${TARGETDIR}\\.blender\\io\" mkdir \"${TARGETDIR}\\.blender\\io\"
+ COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\"
+ COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\"
+ COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
+ COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
+ COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
+ COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\ui\\*.*\" \"${TARGETDIR}\\.blender\\ui\"
+ COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\io\\*.*\" \"${TARGETDIR}\\.blender\\io\"
+ COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
+ COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
+ COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python26.zip\" \"${TARGETDIR}\\\"
)
- ENDIF(WITH_INTERNATIONAL)
-
- IF(WITH_FFMPEG)
+
+ FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR)
+
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
)
- ENDIF(WITH_FFMPEG)
-ENDIF(WIN32)
+
+ IF(WITH_INTERNATIONAL)
+ ADD_CUSTOM_COMMAND(TARGET blender
+ POST_BUILD
+ MAIN_DEPENDENCY blender
+ COMMAND copy /Y \"${WIN_LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
+ )
+ ENDIF(WITH_INTERNATIONAL)
+
+ IF(WITH_FFMPEG)
+ ADD_CUSTOM_COMMAND(TARGET blender
+ POST_BUILD
+ MAIN_DEPENDENCY blender
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
+ )
+ ENDIF(WITH_FFMPEG)
+
+ IF(WITH_SNDFILE)
+ ADD_CUSTOM_COMMAND(TARGET blender
+ POST_BUILD
+ MAIN_DEPENDENCY blender
+ COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
+ )
+ ENDIF(WITH_SNDFILE)
+
+ IF(WITH_JACK)
+ ADD_CUSTOM_COMMAND(TARGET blender
+ POST_BUILD
+ MAIN_DEPENDENCY blender
+ COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
+ )
+ ENDIF(WITH_JACK)
+
+ IF(WITH_OPENAL)
+ ADD_CUSTOM_COMMAND(TARGET blender
+ POST_BUILD
+ MAIN_DEPENDENCY blender
+ COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
+
+ )
+ ENDIF(WITH_OPENAL)
+
+
+ ENDIF(WIN32)
+ENDIF(WITH_INSTALL)
ADD_DEPENDENCIES(blender makesdna)
@@ -220,7 +310,7 @@ IF(UNIX)
# Sort libraries
SET(BLENDER_SORTED_LIBS
bf_windowmanager
- bf_editors
+ bf_editors
bf_decimation
blender_BSP
bf_ghost
@@ -231,7 +321,7 @@ IF(UNIX)
bf_gen_python
bf_blenkernel
bf_nodes
- bf_gpu
+ bf_gpu
bf_blenloader
bf_blenpluginapi
bf_imbuf
@@ -257,6 +347,9 @@ IF(UNIX)
bf_converter
bf_dummy
bf_bullet
+ bf_smoke
+ bf_minilzo
+ bf_lzma
bf_common
bf_ketsji
bf_logic
@@ -275,7 +368,6 @@ IF(UNIX)
bf_moto
bf_python
bf_gen_python
- bf_quicktime
extern_binreloc
extern_glew
extern_libopenjpeg
@@ -283,9 +375,18 @@ IF(UNIX)
bf_rna
bf_dna
bf_blenfont
- bf_soundsystem
+ bf_audaspace
)
+ IF(WITH_CXX_GUARDEDALLOC)
+ SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
+ ENDIF(WITH_CXX_GUARDEDALLOC)
+
+ IF(WITH_QUICKTIME)
+ SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_quicktime)
+ ENDIF(WITH_QUICKTIME)
+
+
FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
SET(REMLIB ${SORTLIB})
FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
diff --git a/source/creator/Makefile b/source/creator/Makefile
index fbe5d252a77..592cf913dfa 100644
--- a/source/creator/Makefile
+++ b/source/creator/Makefile
@@ -40,7 +40,6 @@ include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I../blender/render/extern/include
-CPPFLAGS += -I../blender/radiosity/extern/include
# two needed for the kernel
CPPFLAGS += -I../blender/imbuf
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 9034833563b..41b27b1c915 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -177,6 +177,8 @@ static void print_help(void)
printf (" When the filename has no #, The suffix #### is added to the filename\n");
printf (" The frame number will be added at the end of the filename.\n");
printf (" eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n");
+ printf (" -E <engine>\tSpecify the render engine.\n");
+ printf (" use -E help to list available engines.\n");
printf ("\nFormat options:\n");
printf (" -F <format>\tSet the render format, Valid options are...\n");
printf (" \tTGA IRIS HAMX JPEG MOVIE IRIZ RAWTGA\n");
@@ -201,13 +203,11 @@ static void print_help(void)
printf ("\nGame Engine specific options:\n");
printf (" -g fixedtime\t\tRun on 50 hertz without dropping frames\n");
printf (" -g vertexarrays\tUse Vertex Arrays for rendering (usually faster)\n");
- printf (" -g noaudio\t\tNo audio in Game Engine\n");
printf (" -g nomipmap\t\tNo Texture Mipmapping\n");
printf (" -g linearmipmap\tLinear Texture Mipmapping instead of Nearest (default)\n");
printf ("\nMisc options:\n");
printf (" -d\t\tTurn debugging on\n");
- printf (" -noaudio\tDisable audio on systems that support audio\n");
printf (" -nojoystick\tDisable joystick support\n");
printf (" -noglsl\tDisable GLSL shading\n");
printf (" -h\t\tPrint this help text\n");
@@ -267,13 +267,6 @@ int main(int argc, char **argv)
bContext *C= CTX_create();
int a, i, stax, stay, sizx, sizy /*XXX, scr_init = 0*/;
-#if defined(WIN32) || defined (__linux__)
- int audio = 1;
-#else
- int audio = 0;
-#endif
-
-
#ifdef WITH_BINRELOC
br_init( NULL );
#endif
@@ -462,16 +455,6 @@ int main(int argc, char **argv)
break;
case 'n':
case 'N':
- if (BLI_strcasecmp(argv[a], "-noaudio") == 0|| BLI_strcasecmp(argv[a], "-nosound") == 0) {
- /**
- notify the gameengine that no audio is wanted, even if the user didn't give
- the flag -g noaudio.
- */
-
- SYS_WriteCommandLineInt(syshandle,"noaudio",1);
- audio = 0;
- if (G.f & G_DEBUG) printf("setting audio to: %d\n", audio);
- }
if (BLI_strcasecmp(argv[a], "-nojoystick") == 0) {
/**
don't initialize joysticks if user doesn't want to use joysticks
@@ -490,11 +473,6 @@ int main(int argc, char **argv)
#ifndef DISABLE_PYTHON
BPY_start_python(argc, argv);
#endif
- /**
- * NOTE: sound_init_audio() *must be* after start_python,
- * at least on FreeBSD.
- * added note (ton): i removed it altogether
- */
WM_init(C);
@@ -515,12 +493,6 @@ int main(int argc, char **argv)
BPY_start_python(argc, argv);
#endif
BLI_where_is_temp( btempdir, 0 ); /* call after loading the .B.blend so we can read U.tempdir */
-
- // (ton) Commented out. I have no idea whats thisfor... will mail around!
- // SYS_WriteCommandLineInt(syshandle,"noaudio",1);
- // audio = 0;
- // sound_init_audio();
- // if (G.f & G_DEBUG) printf("setting audio to: %d\n", audio);
}
#ifndef DISABLE_PYTHON
/**
@@ -533,11 +505,13 @@ int main(int argc, char **argv)
*/
BPY_post_start_python();
- BPY_run_ui_scripts(C, 0); /* dont need to reload the first time */
+ if(!G.background)
+ BPY_run_ui_scripts(C, 0); /* dont need to reload the first time */
#endif
CTX_py_init_set(C, 1);
- WM_keymap_init(C); /* after BPY_run_ui_scripts() */
+ if(!G.background)
+ WM_keymap_init(C); /* after BPY_run_ui_scripts() */
#ifdef WITH_QUICKTIME
@@ -720,6 +694,47 @@ int main(int argc, char **argv)
printf("\nError: you must specify a path after '-o '.\n");
}
break;
+ case 'E':
+ a++;
+ if (a < argc)
+ {
+ if (!strcmp(argv[a],"help"))
+ {
+ RenderEngineType *type = NULL;
+
+ for( type = R_engines.first; type; type = type->next )
+ {
+ printf("\t%s\n", type->idname);
+ }
+ exit(0);
+ }
+ else
+ {
+ if (CTX_data_scene(C)==NULL)
+ {
+ printf("\nError: no blend loaded. order the arguments so '-E ' is after the blend is loaded.\n");
+ }
+ else
+ {
+ Scene *scene= CTX_data_scene(C);
+ RenderData *rd = &scene->r;
+ RenderEngineType *type = NULL;
+
+ for( type = R_engines.first; type; type = type->next )
+ {
+ if (!strcmp(argv[a],type->idname))
+ {
+ BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine));
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ printf("\nEngine not specified.\n");
+ }
+ break;
case 'F':
a++;
if (a < argc){
@@ -806,7 +821,6 @@ int main(int argc, char **argv)
if (G.background) {
int retval = BKE_read_file(C, argv[a], NULL, NULL);
-// XXX sound_initialize_sounds();
/*we successfully loaded a blend file, get sure that
pointcache works */
diff --git a/source/darwin/Makefile b/source/darwin/Makefile
index 35ecc6de8f1..35842b43eae 100644
--- a/source/darwin/Makefile
+++ b/source/darwin/Makefile
@@ -51,8 +51,11 @@ ifeq ($(APPLICATION), blender)
@cp -R $(NANBLENDERHOME)/release/scripts $(DIR)/bin/$(APPLICATION).app/Contents/MacOS/.blender/
@echo "---> copying ui scripts"
@cp -R $(NANBLENDERHOME)/release/ui $(DIR)/bin/$(APPLICATION).app/Contents/MacOS/.blender/
+ @echo "---> copying python modules"
+ @mkdir $(DIR)/bin/$(APPLICATION).app/Contents/MacOS/.blender/python
+ @unzip -q $(LCGDIR)/release/python.zip -d $(DIR)/bin/$(APPLICATION).app/Contents/MacOS/.blender/python/
endif
- @echo "---> removing SNV directories and Mac hidden files from distribution"
+ @echo "---> removing SVN directories and Mac hidden files from distribution"
@find $(DIR)/bin/$(APPLICATION).app -name CVS -prune -exec rm -rf {} \;
@find $(DIR)/bin/$(APPLICATION).app -name .DS_Store -exec rm -f {} \;
@find $(DIR)/bin/$(APPLICATION).app -name .svn -prune -exec rm -rf {} \;
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index 6e6531c9b5f..ae46f880711 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -61,7 +61,6 @@
#include "RAS_ListRasterizer.h"
#include "NG_LoopBackNetworkDeviceInterface.h"
-#include "SND_DeviceManager.h"
#include "SYS_System.h"
@@ -186,19 +185,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
// create a networkdevice
NG_NetworkDeviceInterface* networkdevice = new
NG_LoopBackNetworkDeviceInterface();
-
- //
- SYS_SystemHandle hSystem = SYS_GetSystem();
- bool noaudio = SYS_GetCommandLineInt(hSystem,"noaudio",0);
-
- if (noaudio)/*(noaudio) intrr: disable game engine audio (openal) */
- SND_DeviceManager::SetDeviceType(snd_e_dummydevice);
- // get an audiodevice
- SND_DeviceManager::Subscribe();
- SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
- audiodevice->UseCD();
-
+ //
// create a ketsji/blendersystem (only needed for timing and stuff)
KX_BlenderSystem* kxsystem = new KX_BlenderSystem();
@@ -213,7 +201,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
ketsjiengine->SetRenderTools(rendertools);
ketsjiengine->SetRasterizer(rasterizer);
ketsjiengine->SetNetworkDevice(networkdevice);
- ketsjiengine->SetAudioDevice(audiodevice);
ketsjiengine->SetUseFixedTime(usefixed);
ketsjiengine->SetTimingDisplay(frameRate, profile, properties);
@@ -363,18 +350,17 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
if(GPU_extensions_minimum_support())
useglslmat = true;
- else if(G.fileflags & G_FILE_GAME_MAT_GLSL)
+ else if(blscene->gm.matmode == GAME_MAT_GLSL)
usemat = false;
- if(usemat && (G.fileflags & G_FILE_GAME_MAT))
+ if(usemat && (blscene->gm.matmode != GAME_MAT_TEXFACE))
sceneconverter->SetMaterials(true);
- if(useglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL))
+ if(useglslmat && (blscene->gm.matmode == GAME_MAT_GLSL))
sceneconverter->SetGLSLMaterials(true);
KX_Scene* startscene = new KX_Scene(keyboarddevice,
mousedevice,
networkdevice,
- audiodevice,
startscenename,
blscene);
@@ -404,10 +390,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
{
// convert and add scene
sceneconverter->ConvertScene(
- startscenename,
startscene,
dictionaryobject,
- keyboarddevice,
rendertools,
canvas);
ketsjiengine->AddScene(startscene);
@@ -521,8 +505,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
// clean up some stuff
- audiodevice->StopCD();
-
if (ketsjiengine)
{
delete ketsjiengine;
@@ -562,8 +544,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw
{
delete canvas;
canvas = NULL;
- }
- SND_DeviceManager::Unsubscribe();
+ }
} while (exitrequested == KX_EXIT_REQUEST_RESTART_GAME || exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME);
@@ -639,11 +620,6 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
NG_NetworkDeviceInterface* networkdevice = new
NG_LoopBackNetworkDeviceInterface();
- // get an audiodevice
- SND_DeviceManager::Subscribe();
- SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
- audiodevice->UseCD();
-
// create a ketsji/blendersystem (only needed for timing and stuff)
KX_BlenderSystem* kxsystem = new KX_BlenderSystem();
@@ -694,7 +670,6 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
KX_Scene* startscene = new KX_Scene(keyboarddevice,
mousedevice,
networkdevice,
- audiodevice,
startscenename,
blscene);
@@ -717,10 +692,8 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
{
// convert and add scene
sceneconverter->ConvertScene(
- startscenename,
startscene,
dictionaryobject,
- keyboarddevice,
rendertools,
canvas);
ketsjiengine->AddScene(startscene);
@@ -760,7 +733,6 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
// clean up some stuff
- audiodevice->StopCD();
if (ketsjiengine)
{
delete ketsjiengine;
@@ -786,7 +758,16 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win,
delete mousedevice;
mousedevice = NULL;
}
- SND_DeviceManager::Unsubscribe();
+ if (rasterizer)
+ {
+ delete rasterizer;
+ rasterizer = NULL;
+ }
+ if (rendertools)
+ {
+ delete rendertools;
+ rendertools = NULL;
+ }
} while (exitrequested == KX_EXIT_REQUEST_RESTART_GAME || exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME);
diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt
index 2874a0273cc..42e270d0fe7 100644
--- a/source/gameengine/BlenderRoutines/CMakeLists.txt
+++ b/source/gameengine/BlenderRoutines/CMakeLists.txt
@@ -27,16 +27,12 @@ SET(INC
../../../source/gameengine/Network
../../../source/gameengine/SceneGraph
../../../source/gameengine/Physics/common
- ../../../source/gameengine/Physics/Bullet
- ../../../source/gameengine/Physics/Sumo
- ../../../source/gameengine/Physics/Sumo/Fuzzics/include
+ ../../../source/gameengine/Physics/Bullet
../../../source/gameengine/Network/LoopBackNetwork
- ../../../intern/SoundSystem
../../../source/blender/misc
../../../source/blender/blenloader
../../../source/blender/gpu
../../../extern/bullet2/src
- ../../../extern/solid
../../../extern/glew/include
${PYTHON_INC}
)
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
index fd41fb90f2f..d49c877f610 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
@@ -40,6 +40,10 @@
#include "KX_BlenderGL.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
struct ARegion;
struct wmWindow;
@@ -166,6 +170,13 @@ private:
struct ARegion* m_ar;
struct wmWindow* m_win;
RAS_Rect m_area_rect;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderCanvas"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // __KX_BLENDERCANVAS
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
index 5cf696fe146..dba6d1113c9 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
@@ -103,6 +103,8 @@ void BL_SwapBuffers(wmWindow *win)
void DisableForText()
{
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* needed for texture fonts otherwise they render as wireframe */
+
if(glIsEnabled(GL_BLEND)) glDisable(GL_BLEND);
if(glIsEnabled(GL_ALPHA_TEST)) glDisable(GL_ALPHA_TEST);
@@ -135,32 +137,25 @@ void DisableForText()
}
}
-void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height)
+void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height)
{
/* gl prepping */
DisableForText();
- //glDisable(GL_TEXTURE_2D);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
-
- glOrtho(0, width,
- 0, height, 0, 1);
-
+
+ glOrtho(0, width, 0, height, -100, 100);
+
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
- glMatrixMode(GL_TEXTURE);
- glPushMatrix();
- glLoadIdentity();
/* the actual drawing */
glColor3ub(255, 255, 255);
- BLF_draw_default(xco, height-yco, 0.0f, text);
+ BLF_draw_default(xco, height-yco, 0.0f, (char *)text);
- glMatrixMode(GL_TEXTURE);
- glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
@@ -168,36 +163,29 @@ void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height
glEnable(GL_DEPTH_TEST);
}
-void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int height)
+void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height)
{
/* This is a rather important line :( The gl-mode hasn't been left
* behind quite as neatly as we'd have wanted to. I don't know
* what cause it, though :/ .*/
DisableForText();
- //glDisable(GL_TEXTURE_2D);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
- glOrtho(0, width,
- 0, height, 0, 1);
+ glOrtho(0, width, 0, height, -100, 100);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
- glMatrixMode(GL_TEXTURE);
- glPushMatrix();
- glLoadIdentity();
/* draw in black first*/
glColor3ub(0, 0, 0);
- BLF_draw_default(xco+1, height-yco-1, 0.0f, text);
+ BLF_draw_default(xco+2, height-yco-2, 0.0f, (char *)text);
glColor3ub(255, 255, 255);
- BLF_draw_default(xco, height-yco, 0.0f, text);
+ BLF_draw_default(xco, height-yco, 0.0f, (char *)text);
- glMatrixMode(GL_TEXTURE);
- glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.h b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
index 1e65f29d87c..5c947ff630e 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
@@ -47,8 +47,8 @@ void BL_HideMouse();
void BL_NormalMouse();
void BL_WaitMouse();
-void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height);
-void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int height);
+void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height);
+void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height);
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
index 32391e63264..d4dd9af3d4f 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
@@ -39,7 +39,9 @@
#include "WM_types.h"
#include "SCA_IInputDevice.h"
-
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
/**
Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode.
@@ -222,6 +224,12 @@ public:
// virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0;
virtual bool ConvertBlenderEvent(unsigned short incode,short val)=0;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_BLENDERINPUTDEVICE
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
index 5bf37acf236..c801322e787 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
@@ -31,6 +31,10 @@
#include "KX_BlenderInputDevice.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class KX_BlenderKeyboardDevice : public BL_BlenderInputDevice
{
bool m_hookesc;
@@ -43,6 +47,13 @@ public:
virtual bool ConvertBlenderEvent(unsigned short incode,short val);
virtual void NextFrame();
virtual void HookEscape();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_BLENDERKEYBOARDDEVICE
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h
index 2f9e956a1d8..92383e4b533 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h
@@ -31,6 +31,10 @@
#include "KX_BlenderInputDevice.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class KX_BlenderMouseDevice : public BL_BlenderInputDevice
{
public:
@@ -41,6 +45,13 @@ public:
// virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode);
virtual bool ConvertBlenderEvent(unsigned short incode,short val);
virtual void NextFrame();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderMouseDevice"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_BLENDERMOUSEDEVICE
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
index 8ed36e860b4..ee9dae14b9b 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
@@ -284,12 +284,10 @@ void KX_BlenderRenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
int width,
int height)
{
- STR_String tmpstr(text);
-
if(mode == RAS_IRenderTools::RAS_TEXT_PADDED)
- BL_print_gamedebug_line_padded(tmpstr.Ptr(), xco, yco, width, height);
+ BL_print_gamedebug_line_padded(text, xco, yco, width, height);
else
- BL_print_gamedebug_line(tmpstr.Ptr(), xco, yco, width, height);
+ BL_print_gamedebug_line(text, xco, yco, width, height);
}
/* Render Text renders text into a (series of) polygon, using a texture font,
@@ -390,4 +388,4 @@ void KX_BlenderRenderTools::Update2DFilter(vector<STR_String>& propNames, void*
void KX_BlenderRenderTools::Render2DFilters(RAS_ICanvas* canvas)
{
m_filtermanager.RenderFilters(canvas);
-} \ No newline at end of file
+}
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
index 60130e6bfc9..70672b8350b 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
@@ -37,6 +37,10 @@
#include "RAS_IRenderTools.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
struct KX_ClientObjectInfo;
class KX_RayCast;
@@ -95,6 +99,13 @@ public:
virtual void Render2DFilters(RAS_ICanvas* canvas);
virtual void SetClientObject(RAS_IRasterizer *rasty, void* obj);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderRenderTools"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_BLENDERRENDERTOOLS
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
index d99bb9b14a8..b6b2841e81c 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h
@@ -34,6 +34,10 @@
*/
#include "KX_ISystem.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class KX_BlenderSystem : public KX_ISystem
{
double m_starttime;
@@ -42,6 +46,14 @@ public:
KX_BlenderSystem();
virtual ~KX_BlenderSystem() {};
virtual double GetTimeInSeconds();
+
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSystem"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_BLENDERSYSTEM
diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile
index ffa99a0c1b2..4b65da667ef 100644
--- a/source/gameengine/BlenderRoutines/Makefile
+++ b/source/gameengine/BlenderRoutines/Makefile
@@ -38,8 +38,6 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
-CPPFLAGS += -I$(NAN_FUZZICS)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
# because of kernel dependency on makesdna
diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript
index 0239af22b8c..cfb5b0ef525 100644
--- a/source/gameengine/BlenderRoutines/SConscript
+++ b/source/gameengine/BlenderRoutines/SConscript
@@ -17,7 +17,7 @@ incs += ' #source/gameengine/Expressions #source/gameengine/Network'
incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common'
incs += ' #source/gameengine/Physics/Bullet'
incs += ' #source/gameengine/Network/LoopBackNetwork'
-incs += ' #intern/SoundSystem #source/blender/misc #source/blender/blenloader'
+incs += ' #source/blender/misc #source/blender/blenloader'
incs += ' #extern/glew/include #source/blender/gpu'
incs += ' #source/blender/windowmanager'
@@ -28,10 +28,4 @@ incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_BULLET_INC']
incs += ' ' + env['BF_OPENGL_INC']
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc','win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core', 'player'], priority=[300, 45] , cxx_compileflags=cxxflags)
+env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core'], priority=[300] , cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index 30055a717e3..ca4290703e1 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -436,365 +436,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
/* Python functions */
/* ------------------------------------------------------------------------- */
-/* setStart */
-const char BL_ActionActuator::GetAction_doc[] =
-"getAction()\n"
-"\tReturns a string containing the name of the current action.\n";
-
-PyObject* BL_ActionActuator::PyGetAction(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getAction()", "the action property");
-
- if (m_action){
- return PyUnicode_FromString(m_action->id.name+2);
- }
- Py_RETURN_NONE;
-}
-
-/* getProperty */
-const char BL_ActionActuator::GetProperty_doc[] =
-"getProperty()\n"
-"\tReturns the name of the property to be used in FromProp mode.\n";
-
-PyObject* BL_ActionActuator::PyGetProperty(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getProperty()", "the property property");
-
- PyObject *result;
-
- result = Py_BuildValue("s", (const char *)m_propname);
-
- return result;
-}
-
-/* getProperty */
-const char BL_ActionActuator::GetFrameProperty_doc[] =
-"getFrameProperty()\n"
-"\tReturns the name of the property, that is set to the current frame number.\n";
-
-PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getFrameProperty()", "the frameProperty property");
-
- PyObject *result;
-
- result = Py_BuildValue("s", (const char *)m_framepropname);
-
- return result;
-}
-
-/* getFrame */
-const char BL_ActionActuator::GetFrame_doc[] =
-"getFrame()\n"
-"\tReturns the current frame number.\n";
-
-PyObject* BL_ActionActuator::PyGetFrame(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getFrame()", "the frame property");
-
- PyObject *result;
-
- result = Py_BuildValue("f", m_localtime);
-
- return result;
-}
-
-/* getEnd */
-const char BL_ActionActuator::GetEnd_doc[] =
-"getEnd()\n"
-"\tReturns the last frame of the action.\n";
-
-PyObject* BL_ActionActuator::PyGetEnd(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getEnd()", "the end property");
-
- PyObject *result;
-
- result = Py_BuildValue("f", m_endframe);
-
- return result;
-}
-
-/* getStart */
-const char BL_ActionActuator::GetStart_doc[] =
-"getStart()\n"
-"\tReturns the starting frame of the action.\n";
-
-PyObject* BL_ActionActuator::PyGetStart(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getStart()", "the start property");
-
- PyObject *result;
-
- result = Py_BuildValue("f", m_startframe);
-
- return result;
-}
-
-/* getBlendin */
-const char BL_ActionActuator::GetBlendin_doc[] =
-"getBlendin()\n"
-"\tReturns the number of interpolation animation frames to be\n"
-"\tgenerated when this actuator is triggered.\n";
-
-PyObject* BL_ActionActuator::PyGetBlendin(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getBlendin()", "the blendin property");
-
- PyObject *result;
-
- result = Py_BuildValue("f", m_blendin);
-
- return result;
-}
-
-/* getPriority */
-const char BL_ActionActuator::GetPriority_doc[] =
-"getPriority()\n"
-"\tReturns the priority for this actuator. Actuators with lower\n"
-"\tPriority numbers will override actuators with higher numbers.\n";
-
-PyObject* BL_ActionActuator::PyGetPriority(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getPriority()", "the priority property");
-
- PyObject *result;
-
- result = Py_BuildValue("i", m_priority);
-
- return result;
-}
-
-/* setAction */
-const char BL_ActionActuator::SetAction_doc[] =
-"setAction(action, (reset))\n"
-"\t - action : The name of the action to set as the current action.\n"
-"\t - reset : Optional parameter indicating whether to reset the\n"
-"\t blend timer or not. A value of 1 indicates that the\n"
-"\t timer should be reset. A value of 0 will leave it\n"
-"\t unchanged. If reset is not specified, the timer will"
-"\t be reset.\n";
-
-PyObject* BL_ActionActuator::PySetAction(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setAction()", "the action property");
-
- char *string;
- int reset = 1;
-
- if (PyArg_ParseTuple(args,"s|i:setAction",&string, &reset))
- {
- bAction *action;
-
- action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string));
-
- if (!action){
- /* NOTE! Throw an exception or something */
- // printf ("setAction failed: Action not found\n", string);
- }
- else{
- m_action=action;
- if (reset)
- m_blendframe = 0;
- }
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setStart */
-const char BL_ActionActuator::SetStart_doc[] =
-"setStart(start)\n"
-"\t - start : Specifies the starting frame of the animation.\n";
-
-PyObject* BL_ActionActuator::PySetStart(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setStart()", "the start property");
-
- float start;
-
- if (PyArg_ParseTuple(args,"f:setStart",&start))
- {
- m_startframe = start;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setEnd */
-const char BL_ActionActuator::SetEnd_doc[] =
-"setEnd(end)\n"
-"\t - end : Specifies the ending frame of the animation.\n";
-
-PyObject* BL_ActionActuator::PySetEnd(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setEnd()", "the end property");
-
- float end;
-
- if (PyArg_ParseTuple(args,"f:setEnd",&end))
- {
- m_endframe = end;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setBlendin */
-const char BL_ActionActuator::SetBlendin_doc[] =
-"setBlendin(blendin)\n"
-"\t - blendin : Specifies the number of frames of animation to generate\n"
-"\t when making transitions between actions.\n";
-
-PyObject* BL_ActionActuator::PySetBlendin(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setBlendin()", "the blendin property");
-
- float blendin;
-
- if (PyArg_ParseTuple(args,"f:setBlendin",&blendin))
- {
- m_blendin = blendin;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setBlendtime */
-const char BL_ActionActuator::SetBlendtime_doc[] =
-"setBlendtime(blendtime)\n"
-"\t - blendtime : Allows the script to directly modify the internal timer\n"
-"\t used when generating transitions between actions. This\n"
-"\t parameter must be in the range from 0.0 to 1.0.\n";
-
-PyObject* BL_ActionActuator::PySetBlendtime(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setBlendtime()", "the blendtime property");
-
- float blendframe;
-
- if (PyArg_ParseTuple(args,"f:setBlendtime",&blendframe))
- {
- m_blendframe = blendframe * m_blendin;
- if (m_blendframe<0)
- m_blendframe = 0;
- if (m_blendframe>m_blendin)
- m_blendframe = m_blendin;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setPriority */
-const char BL_ActionActuator::SetPriority_doc[] =
-"setPriority(priority)\n"
-"\t - priority : Specifies the new priority. Actuators will lower\n"
-"\t priority numbers will override actuators with higher\n"
-"\t numbers.\n";
-
-PyObject* BL_ActionActuator::PySetPriority(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setPriority()", "the priority property");
-
- int priority;
-
- if (PyArg_ParseTuple(args,"i:setPriority",&priority))
- {
- m_priority = priority;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setFrame */
-const char BL_ActionActuator::SetFrame_doc[] =
-"setFrame(frame)\n"
-"\t - frame : Specifies the new current frame for the animation\n";
-
-PyObject* BL_ActionActuator::PySetFrame(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setFrame()", "the frame property");
-
- float frame;
-
- if (PyArg_ParseTuple(args,"f:setFrame",&frame))
- {
- m_localtime = frame;
- if (m_localtime<m_startframe)
- m_localtime=m_startframe;
- else if (m_localtime>m_endframe)
- m_localtime=m_endframe;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setProperty */
-const char BL_ActionActuator::SetProperty_doc[] =
-"setProperty(prop)\n"
-"\t - prop : A string specifying the property name to be used in\n"
-"\t FromProp playback mode.\n";
-
-PyObject* BL_ActionActuator::PySetProperty(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setProperty()", "the property property");
-
- char *string;
-
- if (PyArg_ParseTuple(args,"s:setProperty",&string))
- {
- m_propname = string;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setFrameProperty */
-const char BL_ActionActuator::SetFrameProperty_doc[] =
-"setFrameProperty(prop)\n"
-"\t - prop : A string specifying the property of the frame set up update.\n";
-
-PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setFrameProperty()", "the frameProperty property");
-
- char *string;
-
- if (PyArg_ParseTuple(args,"s:setFrameProperty",&string))
- {
- m_framepropname = string;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) {
char *string= _PyUnicode_AsString(value);
@@ -849,72 +490,6 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) {
*/
}
-/* getType */
-const char BL_ActionActuator::GetType_doc[] =
-"getType()\n"
-"\tReturns the operation mode of the actuator.\n";
-PyObject* BL_ActionActuator::PyGetType(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("getType()", "the type property");
-
- return Py_BuildValue("h", m_playtype);
-}
-
-/* setType */
-const char BL_ActionActuator::SetType_doc[] =
-"setType(mode)\n"
-"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n"
-"\tSet the operation mode of the actuator.\n";
-PyObject* BL_ActionActuator::PySetType(PyObject* args,
- PyObject* kwds) {
- ShowDeprecationWarning("setType()", "the type property");
-
- short typeArg;
-
- if (!PyArg_ParseTuple(args, "h:setType", &typeArg)) {
- return NULL;
- }
-
- switch (typeArg) {
- case ACT_ACTION_PLAY:
- case ACT_ACTION_FLIPPER:
- case ACT_ACTION_LOOP_STOP:
- case ACT_ACTION_LOOP_END:
- case ACT_ACTION_FROM_PROP:
- m_playtype = typeArg;
- break;
- default:
- printf("Invalid type for action actuator: %d\n", typeArg); /* error */
- }
- Py_RETURN_NONE;
-}
-
-PyObject* BL_ActionActuator::PyGetContinue() {
- ShowDeprecationWarning("getContinue()", "the continue property");
-
- return PyLong_FromSsize_t((long)(m_end_reset==0));
-}
-
-PyObject* BL_ActionActuator::PySetContinue(PyObject* value) {
- ShowDeprecationWarning("setContinue()", "the continue property");
-
- int param = PyObject_IsTrue( value );
-
- if( param == -1 ) {
- PyErr_SetString( PyExc_TypeError, "expected True/False or 0/1" );
- return NULL;
- }
-
- if (param) {
- m_end_reset = 0;
- } else {
- m_end_reset = 1;
- }
- Py_RETURN_NONE;
-}
-
-//<-----Deprecated
-
/* setChannel */
KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
"setChannel(channel, matrix)\n"
@@ -1006,59 +581,29 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
/* ------------------------------------------------------------------------- */
PyTypeObject BL_ActionActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "BL_ActionActuator",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IActuator::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "BL_ActionActuator",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IActuator::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef BL_ActionActuator::Methods[] = {
- //Deprecated ----->
- {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc},
- {"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
- {"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc},
- {"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, METH_VARARGS, (PY_METHODCHAR)SetBlendin_doc},
- {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, (PY_METHODCHAR)SetPriority_doc},
- {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, (PY_METHODCHAR)SetFrame_doc},
- {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, (PY_METHODCHAR)SetFrameProperty_doc},
- {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, (PY_METHODCHAR)SetBlendtime_doc},
-
- {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, (PY_METHODCHAR)GetAction_doc},
- {"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, METH_VARARGS, (PY_METHODCHAR)GetStart_doc},
- {"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, (PY_METHODCHAR)GetEnd_doc},
- {"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, METH_VARARGS, (PY_METHODCHAR)GetBlendin_doc},
- {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, (PY_METHODCHAR)GetPriority_doc},
- {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, (PY_METHODCHAR)GetFrame_doc},
- {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
- {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, (PY_METHODCHAR)GetFrameProperty_doc},
{"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_O},
- {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, (PY_METHODCHAR)GetType_doc},
- {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
- {"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, METH_NOARGS, 0},
- {"setContinue", (PyCFunction) BL_ActionActuator::sPySetContinue, METH_O, 0},
- //<------
KX_PYMETHODTABLE(BL_ActionActuator, setChannel),
{NULL,NULL} //Sentinel
};
diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h
index 6003e23e315..a6b4c4a055d 100644
--- a/source/gameengine/Converter/BL_ActionActuator.h
+++ b/source/gameengine/Converter/BL_ActionActuator.h
@@ -84,32 +84,7 @@ public:
bAction* GetAction() { return m_action; }
void SetAction(bAction* act) { m_action= act; }
- //Deprecated ----->
- KX_PYMETHOD_DOC(BL_ActionActuator,SetAction);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetBlendin);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetPriority);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetStart);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetEnd);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetFrame);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetProperty);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetFrameProperty);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetBlendtime);
-
- KX_PYMETHOD_DOC(BL_ActionActuator,GetAction);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetBlendin);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetPriority);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetStart);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetEnd);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetFrame);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetProperty);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetFrameProperty);
KX_PYMETHOD_O(BL_ActionActuator,GetChannel);
- KX_PYMETHOD_DOC(BL_ActionActuator,GetType);
- KX_PYMETHOD_DOC(BL_ActionActuator,SetType);
- KX_PYMETHOD_NOARGS(BL_ActionActuator,GetContinue);
- KX_PYMETHOD_O(BL_ActionActuator,SetContinue);
- //<-----
-
KX_PYMETHOD_DOC(BL_ActionActuator,setChannel);
static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp
index f8a9b1b637f..cfd90813a16 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.cpp
+++ b/source/gameengine/Converter/BL_ArmatureObject.cpp
@@ -54,8 +54,8 @@ BL_ArmatureObject::BL_ArmatureObject(
: KX_GameObject(sgReplicationInfo,callbacks),
m_objArma(armature),
- m_scene(scene), // maybe remove later. needed for where_is_pose
m_framePose(NULL),
+ m_scene(scene), // maybe remove later. needed for where_is_pose
m_lastframe(0.0),
m_activeAct(NULL),
m_activePriority(999),
diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h
index 684d89d492b..af0b7dc201c 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.h
+++ b/source/gameengine/Converter/BL_ArmatureObject.h
@@ -93,6 +93,13 @@ protected:
short m_activePriority;
double m_lastapplyframe;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ArmatureObject"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 4309ca6c1ff..230820719aa 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -101,9 +101,6 @@
#include "KX_KetsjiEngine.h"
#include "KX_BlenderSceneConverter.h"
-#include"SND_Scene.h"
-#include "SND_SoundListener.h"
-
/* This little block needed for linking to Blender... */
#ifdef WIN32
#include "BLI_winstuff.h"
@@ -323,9 +320,7 @@ bool ConvertMaterial(
MTFace* tface,
const char *tfaceName,
MFace* mface,
- MCol* mmcol,
- int lightlayer,
- Object* blenderobj,
+ MCol* mmcol,
MTF_localLayer *layers,
bool glslmat)
{
@@ -628,7 +623,7 @@ bool ConvertMaterial(
}
// with ztransp enabled, enforce alpha blending mode
- if(validmat && (mat->mode & MA_ZTRA) && (material->transp == TF_SOLID))
+ if(validmat && (mat->mode & MA_TRANSP) && (mat->mode & MA_ZTRANSP) && (material->transp == TF_SOLID))
material->transp = TF_ALPHA;
// always zsort alpha + add
@@ -721,12 +716,12 @@ bool ConvertMaterial(
return true;
}
-
-RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* rendertools, KX_Scene* scene, KX_BlenderSceneConverter *converter)
+/* blenderobj can be NULL, make sure its checked for */
+RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, KX_BlenderSceneConverter *converter)
{
RAS_MeshObject *meshobj;
bool skinMesh = false;
- int lightlayer = blenderobj->lay;
+ int lightlayer = blenderobj ? blenderobj->lay:(1<<20)-1; // all layers if no object.
if ((meshobj = converter->FindGameMesh(mesh/*, ob->lay*/)) != NULL)
return meshobj;
@@ -749,13 +744,13 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
}
// Determine if we need to make a skinned mesh
- if (mesh->dvert || mesh->key || ((blenderobj->gameflag & OB_SOFT_BODY) != 0) || BL_ModifierDeformer::HasCompatibleDeformer(blenderobj))
+ if (blenderobj && (mesh->dvert || mesh->key || ((blenderobj->gameflag & OB_SOFT_BODY) != 0) || BL_ModifierDeformer::HasCompatibleDeformer(blenderobj)))
{
- meshobj = new BL_SkinMeshObject(mesh, lightlayer);
+ meshobj = new BL_SkinMeshObject(mesh);
skinMesh = true;
}
else
- meshobj = new RAS_MeshObject(mesh, lightlayer);
+ meshobj = new RAS_MeshObject(mesh);
// Extract avaiable layers
MTF_localLayer *layers = new MTF_localLayer[MAX_MTFACE];
@@ -844,9 +839,8 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
tan3 = tangent[f*4 + 3];
}
- /* get material */
- ma = give_current_material(blenderobj, mface->mat_nr+1);
-
+ ma = give_current_material(blenderobj, mface->mat_nr+1);
+
{
bool visible = true;
bool twoside = false;
@@ -860,7 +854,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
if (!bl_mat)
bl_mat = new BL_Material();
ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol,
- lightlayer, blenderobj, layers, converter->GetGLSLMaterials());
+ layers, converter->GetGLSLMaterials());
visible = ((bl_mat->ras_mode & POLY_VIS)!=0);
collider = ((bl_mat->ras_mode & COLLIDER)!=0);
@@ -883,7 +877,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
if (kx_blmat == NULL)
kx_blmat = new KX_BlenderMaterial();
- kx_blmat->Initialize(scene, bl_mat, skinMesh, lightlayer);
+ kx_blmat->Initialize(scene, bl_mat, skinMesh);
polymat = static_cast<RAS_IPolyMaterial*>(kx_blmat);
}
else {
@@ -1067,8 +1061,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
-static PHY_MaterialProps *CreateMaterialFromBlenderObject(struct Object* blenderobject,
- KX_Scene *kxscene)
+static PHY_MaterialProps *CreateMaterialFromBlenderObject(struct Object* blenderobject)
{
PHY_MaterialProps *materialProps = new PHY_MaterialProps;
@@ -1101,8 +1094,7 @@ static PHY_MaterialProps *CreateMaterialFromBlenderObject(struct Object* blender
return materialProps;
}
-static PHY_ShapeProps *CreateShapePropsFromBlenderObject(struct Object* blenderobject,
- KX_Scene *kxscene)
+static PHY_ShapeProps *CreateShapePropsFromBlenderObject(struct Object* blenderobject)
{
PHY_ShapeProps *shapeProps = new PHY_ShapeProps;
@@ -1385,7 +1377,9 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
bool isCompoundChild = false;
bool hasCompoundChildren = !parent && (blenderobject->gameflag & OB_CHILD);
- if (parent/* && (parent->gameflag & OB_DYNAMIC)*/) {
+ /* When the parent is not OB_DYNAMIC and has no OB_COLLISION then it gets no bullet controller
+ * and cant be apart of the parents compound shape */
+ if (parent && (parent->gameflag & (OB_DYNAMIC | OB_COLLISION))) {
if ((parent->gameflag & OB_CHILD) != 0 && (blenderobject->gameflag & OB_CHILD))
{
@@ -1397,12 +1391,11 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
PHY_ShapeProps* shapeprops =
- CreateShapePropsFromBlenderObject(blenderobject,
- kxscene);
+ CreateShapePropsFromBlenderObject(blenderobject);
PHY_MaterialProps* smmaterial =
- CreateMaterialFromBlenderObject(blenderobject, kxscene);
+ CreateMaterialFromBlenderObject(blenderobject);
KX_ObjectProperties objprop;
objprop.m_lockXaxis = (blenderobject->gameflag2 & OB_LOCK_RIGID_BODY_X_AXIS) !=0;
@@ -1686,8 +1679,7 @@ static KX_GameObject *gameobject_from_blenderobject(
Object *ob,
KX_Scene *kxscene,
RAS_IRenderTools *rendertools,
- KX_BlenderSceneConverter *converter,
- Scene *blenderscene)
+ KX_BlenderSceneConverter *converter)
{
KX_GameObject *gameobj = NULL;
@@ -1721,7 +1713,7 @@ static KX_GameObject *gameobject_from_blenderobject(
Mesh* mesh = static_cast<Mesh*>(ob->data);
float center[3], extents[3];
float radius = my_boundbox_mesh((Mesh*) ob->data, center, extents);
- RAS_MeshObject* meshobj = BL_ConvertMesh(mesh,ob,rendertools,kxscene,converter);
+ RAS_MeshObject* meshobj = BL_ConvertMesh(mesh,ob,kxscene,converter);
// needed for python scripting
kxscene->GetLogicManager()->RegisterMeshName(meshobj->GetName(),meshobj);
@@ -1747,7 +1739,7 @@ static KX_GameObject *gameobject_from_blenderobject(
if (bHasModifier) {
BL_ModifierDeformer *dcont = new BL_ModifierDeformer((BL_DeformableGameObject *)gameobj,
- blenderscene, ob, (BL_SkinMeshObject *)meshobj);
+ kxscene->GetBlenderScene(), ob, (BL_SkinMeshObject *)meshobj);
((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont);
if (bHasShapeKey && bHasArmature)
dcont->LoadShapeDrivers(ob->parent);
@@ -1786,7 +1778,7 @@ static KX_GameObject *gameobject_from_blenderobject(
kxscene,
KX_Scene::m_callbacks,
ob,
- blenderscene // handle
+ kxscene->GetBlenderScene() // handle
);
/* Get the current pose from the armature object and apply it as the rest pose */
break;
@@ -1801,7 +1793,6 @@ static KX_GameObject *gameobject_from_blenderobject(
}
if (gameobj)
{
- gameobj->SetPhysicsEnvironment(kxscene->GetPhysicsEnvironment());
gameobj->SetLayer(ob->lay);
gameobj->SetBlenderObject(ob);
/* set the visibility state based on the objects render option in the outliner */
@@ -1837,7 +1828,8 @@ ListBase *get_active_constraints2(Object *ob)
if (!ob)
return NULL;
- if (ob->flag & OB_POSEMODE) {
+ // XXX - shouldnt we care about the pose data and not the mode???
+ if (ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
pchan = get_active_posechannel2(ob);
@@ -1900,12 +1892,10 @@ KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist){
// convert blender objects into ketsji gameobjects
void BL_ConvertBlenderObjects(struct Main* maggie,
- const STR_String& scenename,
KX_Scene* kxscene,
KX_KetsjiEngine* ketsjiEngine,
e_PhysicsEngine physics_engine,
PyObject* pythondictionary,
- SCA_IInputDevice* keydev,
RAS_IRenderTools* rendertools,
RAS_ICanvas* canvas,
KX_BlenderSceneConverter* converter,
@@ -1913,7 +1903,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
)
{
- Scene *blenderscene = converter->GetBlenderSceneForName(scenename);
+ Scene *blenderscene = kxscene->GetBlenderScene();
// for SETLOOPER
Scene *sce;
Base *base;
@@ -2005,8 +1995,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
base->object,
kxscene,
rendertools,
- converter,
- blenderscene);
+ converter);
bool isInActiveLayer = (blenderobject->lay & activeLayerBitInfo) !=0;
bool addobj=true;
@@ -2195,8 +2184,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
blenderobject,
kxscene,
rendertools,
- converter,
- blenderscene);
+ converter);
// this code is copied from above except that
// object from groups are never in active layer
@@ -2418,8 +2406,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
obj->Release();
}
childrenlist->Release();
+
// now destroy recursively
+ converter->UnregisterGameObject(childobj); // removing objects during conversion make sure this runs too
kxscene->RemoveObject(childobj);
+
continue;
}
@@ -2496,10 +2487,10 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
}
}
if (occlusion)
- kxscene->SetDbvtOcclusionRes(blenderscene->world->occlusionRes);
+ kxscene->SetDbvtOcclusionRes(blenderscene->gm.occlusionRes);
}
if (blenderscene->world)
- kxscene->GetPhysicsEnvironment()->setNumTimeSubSteps(blenderscene->world->physubstep);
+ kxscene->GetPhysicsEnvironment()->setNumTimeSubSteps(blenderscene->gm.physubstep);
// now that the scenegraph is complete, let's instantiate the deformers.
// We need that to create reusable derived mesh and physic shapes
@@ -2516,7 +2507,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
for (i=0;i<sumolist->GetCount();i++)
{
KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i);
- struct Object* blenderobject = converter->FindBlenderObject(gameobj);
+ struct Object* blenderobject = gameobj->GetBlenderObject();
int nummeshes = gameobj->GetMeshCount();
RAS_MeshObject* meshobj = 0;
if (nummeshes > 0)
@@ -2532,7 +2523,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
for (i=0;i<sumolist->GetCount();i++)
{
KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i);
- struct Object* blenderobject = converter->FindBlenderObject(gameobj);
+ struct Object* blenderobject = gameobj->GetBlenderObject();
int nummeshes = gameobj->GetMeshCount();
RAS_MeshObject* meshobj = 0;
if (nummeshes > 0)
@@ -2560,7 +2551,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
for (i=0;i<sumolist->GetCount();i++)
{
KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i);
- struct Object* blenderobject = converter->FindBlenderObject(gameobj);
+ struct Object* blenderobject = gameobj->GetBlenderObject();
ListBase *conlist;
bConstraint *curcon;
conlist = get_active_constraints2(blenderobject);
@@ -2628,23 +2619,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
}
}
- sumolist->Release();
-
- // convert global sound stuff
-
- /* XXX, glob is the very very wrong place for this
- * to be, re-enable once the listener has been moved into
- * the scene. */
-#if 1
- SND_Scene* soundscene = kxscene->GetSoundScene();
- SND_SoundListener* listener = soundscene->GetListener();
- if (listener && G.listener)
- {
- listener->SetDopplerFactor(G.listener->dopplerfactor);
- listener->SetDopplerVelocity(G.listener->dopplervelocity);
- listener->SetGain(G.listener->gain);
- }
-#endif
+ sumolist->Release();
// convert world
KX_WorldInfo* worldinfo = new BlenderWorldInfo(blenderscene->world);
@@ -2657,7 +2632,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
for (i=0;i<logicbrick_conversionlist->GetCount();i++)
{
KX_GameObject* gameobj = static_cast<KX_GameObject*>(logicbrick_conversionlist->GetValue(i));
- struct Object* blenderobj = converter->FindBlenderObject(gameobj);
+ struct Object* blenderobj = gameobj->GetBlenderObject();
int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0;
bool isInActiveLayer = (blenderobj->lay & layerMask)!=0;
BL_ConvertActuators(maggie->name, blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,layerMask,isInActiveLayer,rendertools,converter);
@@ -2665,7 +2640,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
for ( i=0;i<logicbrick_conversionlist->GetCount();i++)
{
KX_GameObject* gameobj = static_cast<KX_GameObject*>(logicbrick_conversionlist->GetValue(i));
- struct Object* blenderobj = converter->FindBlenderObject(gameobj);
+ struct Object* blenderobj = gameobj->GetBlenderObject();
int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0;
bool isInActiveLayer = (blenderobj->lay & layerMask)!=0;
BL_ConvertControllers(blenderobj,gameobj,logicmgr,pythondictionary,layerMask,isInActiveLayer,converter);
@@ -2673,10 +2648,10 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
for ( i=0;i<logicbrick_conversionlist->GetCount();i++)
{
KX_GameObject* gameobj = static_cast<KX_GameObject*>(logicbrick_conversionlist->GetValue(i));
- struct Object* blenderobj = converter->FindBlenderObject(gameobj);
+ struct Object* blenderobj = gameobj->GetBlenderObject();
int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0;
bool isInActiveLayer = (blenderobj->lay & layerMask)!=0;
- BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,keydev,layerMask,isInActiveLayer,canvas,converter);
+ BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,layerMask,isInActiveLayer,canvas,converter);
// set the init state to all objects
gameobj->SetInitState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state);
}
@@ -2714,4 +2689,3 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
RAS_BucketManager *bucketmanager = kxscene->GetBucketManager();
bucketmanager->OptimizeBuckets(distance);
}
-
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.h b/source/gameengine/Converter/BL_BlenderDataConversion.h
index 48f08fb357b..b8f9d1ec4e6 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.h
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.h
@@ -34,15 +34,13 @@
#include "KX_Python.h"
#include "KX_PhysicsEngineEnums.h"
-class RAS_MeshObject* BL_ConvertMesh(struct Mesh* mesh,struct Object* lightobj,class RAS_IRenderTools* rendertools,class KX_Scene* scene, class KX_BlenderSceneConverter *converter);
+class RAS_MeshObject* BL_ConvertMesh(struct Mesh* mesh,struct Object* lightobj,class KX_Scene* scene, class KX_BlenderSceneConverter *converter);
void BL_ConvertBlenderObjects(struct Main* maggie,
- const STR_String& scenename,
class KX_Scene* kxscene,
class KX_KetsjiEngine* ketsjiEngine,
e_PhysicsEngine physics_engine,
PyObject* pythondictionary,
- class SCA_IInputDevice* keydev,
class RAS_IRenderTools* rendertools,
class RAS_ICanvas* canvas,
class KX_BlenderSceneConverter* sceneconverter,
diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h
index b20b8e81b37..ed329e7953d 100644
--- a/source/gameengine/Converter/BL_DeformableGameObject.h
+++ b/source/gameengine/Converter/BL_DeformableGameObject.h
@@ -45,7 +45,6 @@ struct Key;
class BL_DeformableGameObject : public KX_GameObject
{
public:
-
CValue* GetReplica();
double GetLastFrame ()
@@ -100,6 +99,12 @@ protected:
Object* m_blendobj;
short m_activePriority;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DeformableGameObject"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h
index 289826e45e7..1749d438d21 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.h
+++ b/source/gameengine/Converter/BL_MeshDeformer.h
@@ -85,6 +85,13 @@ protected:
int m_tvtot;
BL_DeformableGameObject* m_gameobj;
double m_lastDeformUpdate;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_MeshDeformer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h
index b09cc2087ca..5cc84c7d1e4 100644
--- a/source/gameengine/Converter/BL_ModifierDeformer.h
+++ b/source/gameengine/Converter/BL_ModifierDeformer.h
@@ -101,6 +101,12 @@ protected:
Scene *m_scene;
DerivedMesh *m_dm;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
index 970539777f4..81ce9ff6154 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
@@ -40,6 +40,7 @@
#include "STR_HashedString.h"
#include "DNA_nla_types.h"
#include "DNA_action_types.h"
+#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "BKE_action.h"
#include "DNA_armature_types.h"
@@ -51,6 +52,10 @@
#include "FloatValue.h"
#include "PyObjectPlus.h"
+extern "C" {
+ #include "BKE_animsys.h"
+}
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -370,8 +375,11 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
m_blendstart = curtime;
}
// only interested in shape channel
- // XXX extract_ipochannels_from_action(&tchanbase, &key->id, m_action, "Shape", m_localtime);
-
+
+ // in 2.4x was // extract_ipochannels_from_action(&tchanbase, &key->id, m_action, "Shape", m_localtime);
+ BKE_animsys_evaluate_animdata(&key->id, key->adt, m_localtime, ADT_RECALC_ANIM);
+
+ // XXX - in 2.5 theres no way to do this. possibly not that important to support - Campbell
if (0) { // XXX !execute_ipochannels(&tchanbase)) {
// no update, this is possible if action does not match the keys, stop the action
keepgoing = false;
@@ -411,55 +419,29 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject BL_ShapeActionActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "BL_ShapeActionActuator",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IActuator::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "BL_ShapeActionActuator",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IActuator::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef BL_ShapeActionActuator::Methods[] = {
- {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc},
- {"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
- {"setEnd", (PyCFunction) BL_ShapeActionActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc},
- {"setBlendin", (PyCFunction) BL_ShapeActionActuator::sPySetBlendin, METH_VARARGS, (PY_METHODCHAR)SetBlendin_doc},
- {"setPriority", (PyCFunction) BL_ShapeActionActuator::sPySetPriority, METH_VARARGS, (PY_METHODCHAR)SetPriority_doc},
- {"setFrame", (PyCFunction) BL_ShapeActionActuator::sPySetFrame, METH_VARARGS, (PY_METHODCHAR)SetFrame_doc},
- {"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"setFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPySetFrameProperty, METH_VARARGS, (PY_METHODCHAR)SetFrameProperty_doc},
- {"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, (PY_METHODCHAR)SetBlendtime_doc},
-
- {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, (PY_METHODCHAR)GetAction_doc},
- {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, (PY_METHODCHAR)GetStart_doc},
- {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, (PY_METHODCHAR)GetEnd_doc},
- {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, (PY_METHODCHAR)GetBlendin_doc},
- {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, (PY_METHODCHAR)GetPriority_doc},
- {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, (PY_METHODCHAR)GetFrame_doc},
- {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
- {"getFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetFrameProperty, METH_NOARGS, (PY_METHODCHAR)GetFrameProperty_doc},
- {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc},
- {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, (PY_METHODCHAR)SetType_doc},
{NULL,NULL} //Sentinel
};
@@ -477,370 +459,6 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = {
{ NULL } //Sentinel
};
-/* setStart */
-const char BL_ShapeActionActuator::GetAction_doc[] =
-"getAction()\n"
-"\tReturns a string containing the name of the current action.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetAction() {
- ShowDeprecationWarning("getAction()", "the action property");
- if (m_action){
- return PyUnicode_FromString(m_action->id.name+2);
- }
- Py_RETURN_NONE;
-}
-
-/* getProperty */
-const char BL_ShapeActionActuator::GetProperty_doc[] =
-"getProperty()\n"
-"\tReturns the name of the property to be used in FromProp mode.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetProperty() {
- ShowDeprecationWarning("getProperty()", "the property property");
- PyObject *result;
-
- result = Py_BuildValue("s", (const char *)m_propname);
-
- return result;
-}
-
-/* getFrame */
-const char BL_ShapeActionActuator::GetFrame_doc[] =
-"getFrame()\n"
-"\tReturns the current frame number.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetFrame() {
- ShowDeprecationWarning("getFrame()", "the frame property");
- PyObject *result;
-
- result = Py_BuildValue("f", m_localtime);
-
- return result;
-}
-
-/* getEnd */
-const char BL_ShapeActionActuator::GetEnd_doc[] =
-"getEnd()\n"
-"\tReturns the last frame of the action.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetEnd() {
- ShowDeprecationWarning("getEnd()", "the end property");
- PyObject *result;
-
- result = Py_BuildValue("f", m_endframe);
-
- return result;
-}
-
-/* getStart */
-const char BL_ShapeActionActuator::GetStart_doc[] =
-"getStart()\n"
-"\tReturns the starting frame of the action.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetStart() {
- ShowDeprecationWarning("getStart()", "the start property");
- PyObject *result;
-
- result = Py_BuildValue("f", m_startframe);
-
- return result;
-}
-
-/* getBlendin */
-const char BL_ShapeActionActuator::GetBlendin_doc[] =
-"getBlendin()\n"
-"\tReturns the number of interpolation animation frames to be\n"
-"\tgenerated when this actuator is triggered.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetBlendin() {
- ShowDeprecationWarning("getBlendin()", "the blendin property");
- PyObject *result;
-
- result = Py_BuildValue("f", m_blendin);
-
- return result;
-}
-
-/* getPriority */
-const char BL_ShapeActionActuator::GetPriority_doc[] =
-"getPriority()\n"
-"\tReturns the priority for this actuator. Actuators with lower\n"
-"\tPriority numbers will override actuators with higher numbers.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetPriority() {
- ShowDeprecationWarning("getPriority()", "the priority property");
- PyObject *result;
-
- result = Py_BuildValue("i", m_priority);
-
- return result;
-}
-
-/* setAction */
-const char BL_ShapeActionActuator::SetAction_doc[] =
-"setAction(action, (reset))\n"
-"\t - action : The name of the action to set as the current action.\n"
-"\t Should be an action with Shape channels.\n"
-"\t - reset : Optional parameter indicating whether to reset the\n"
-"\t blend timer or not. A value of 1 indicates that the\n"
-"\t timer should be reset. A value of 0 will leave it\n"
-"\t unchanged. If reset is not specified, the timer will"
-"\t be reset.\n";
-
-PyObject* BL_ShapeActionActuator::PySetAction(PyObject* args) {
- ShowDeprecationWarning("setAction()", "the action property");
- char *string;
- int reset = 1;
-
- if (PyArg_ParseTuple(args,"s|i:setAction",&string, &reset))
- {
- bAction *action;
-
- action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string));
-
- if (!action){
- /* NOTE! Throw an exception or something */
- // printf ("setAction failed: Action not found\n", string);
- }
- else{
- m_action=action;
- if (reset)
- m_blendframe = 0.f;
- }
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setStart */
-const char BL_ShapeActionActuator::SetStart_doc[] =
-"setStart(start)\n"
-"\t - start : Specifies the starting frame of the animation.\n";
-
-PyObject* BL_ShapeActionActuator::PySetStart(PyObject* args) {
- ShowDeprecationWarning("setStart()", "the start property");
- float start;
-
- if (PyArg_ParseTuple(args,"f:setStart",&start))
- {
- m_startframe = start;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setEnd */
-const char BL_ShapeActionActuator::SetEnd_doc[] =
-"setEnd(end)\n"
-"\t - end : Specifies the ending frame of the animation.\n";
-
-PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* args) {
- ShowDeprecationWarning("setEnd()", "the end property");
- float end;
-
- if (PyArg_ParseTuple(args,"f:setEnd",&end))
- {
- m_endframe = end;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setBlendin */
-const char BL_ShapeActionActuator::SetBlendin_doc[] =
-"setBlendin(blendin)\n"
-"\t - blendin : Specifies the number of frames of animation to generate\n"
-"\t when making transitions between actions.\n";
-
-PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* args) {
- ShowDeprecationWarning("setBlendin()", "the blendin property");
- float blendin;
-
- if (PyArg_ParseTuple(args,"f:setBlendin",&blendin))
- {
- m_blendin = blendin;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setBlendtime */
-const char BL_ShapeActionActuator::SetBlendtime_doc[] =
-"setBlendtime(blendtime)\n"
-"\t - blendtime : Allows the script to directly modify the internal timer\n"
-"\t used when generating transitions between actions. This\n"
-"\t parameter must be in the range from 0.0 to 1.0.\n";
-
-PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* args) {
- ShowDeprecationWarning("setBlendtime()", "the blendTime property");
- float blendframe;
-
- if (PyArg_ParseTuple(args,"f:setBlendtime",&blendframe))
- {
- m_blendframe = blendframe * m_blendin;
- if (m_blendframe<0.f)
- m_blendframe = 0.f;
- if (m_blendframe>m_blendin)
- m_blendframe = m_blendin;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setPriority */
-const char BL_ShapeActionActuator::SetPriority_doc[] =
-"setPriority(priority)\n"
-"\t - priority : Specifies the new priority. Actuators will lower\n"
-"\t priority numbers will override actuators with higher\n"
-"\t numbers.\n";
-
-PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* args) {
- ShowDeprecationWarning("setPriority()", "the priority property");
- int priority;
-
- if (PyArg_ParseTuple(args,"i:setPriority",&priority))
- {
- m_priority = priority;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* getProperty */
-const char BL_ShapeActionActuator::GetFrameProperty_doc[] =
-"getFrameProperty()\n"
-"\tReturns the name of the property, that is set to the current frame number.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetFrameProperty() {
- ShowDeprecationWarning("getFrameProperty()", "the frameProperty property");
- PyObject *result;
-
- result = Py_BuildValue("s", (const char *)m_framepropname);
-
- return result;
-}
-
-
-/* setFrame */
-const char BL_ShapeActionActuator::SetFrame_doc[] =
-"setFrame(frame)\n"
-"\t - frame : Specifies the new current frame for the animation\n";
-
-PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* args) {
- ShowDeprecationWarning("setFrame()", "the frame property");
- float frame;
-
- if (PyArg_ParseTuple(args,"f:setFrame",&frame))
- {
- m_localtime = frame;
- if (m_localtime<m_startframe)
- m_localtime=m_startframe;
- else if (m_localtime>m_endframe)
- m_localtime=m_endframe;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setProperty */
-const char BL_ShapeActionActuator::SetProperty_doc[] =
-"setProperty(prop)\n"
-"\t - prop : A string specifying the property name to be used in\n"
-"\t FromProp playback mode.\n";
-
-PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* args) {
- ShowDeprecationWarning("setProperty()", "the property property");
- char *string;
-
- if (PyArg_ParseTuple(args,"s:setProperty",&string))
- {
- m_propname = string;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* setFrameProperty */
-const char BL_ShapeActionActuator::SetFrameProperty_doc[] =
-"setFrameProperty(prop)\n"
-"\t - prop : A string specifying the property of the frame set up update.\n";
-
-PyObject* BL_ShapeActionActuator::PySetFrameProperty(PyObject* args) {
- ShowDeprecationWarning("setFrameProperty()", "the frameProperty property");
- char *string;
-
- if (PyArg_ParseTuple(args,"s:setFrameProperty",&string))
- {
- m_framepropname = string;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* getType */
-const char BL_ShapeActionActuator::GetType_doc[] =
-"getType()\n"
-"\tReturns the operation mode of the actuator.\n";
-PyObject* BL_ShapeActionActuator::PyGetType() {
- ShowDeprecationWarning("getType()", "the type property");
- return Py_BuildValue("h", m_playtype);
-}
-
-/* setType */
-const char BL_ShapeActionActuator::SetType_doc[] =
-"setType(mode)\n"
-"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n"
-"\tSet the operation mode of the actuator.\n";
-PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) {
- ShowDeprecationWarning("setType()", "the type property");
- short typeArg;
-
- if (!PyArg_ParseTuple(args, "h:setType", &typeArg)) {
- return NULL;
- }
-
- switch (typeArg) {
- case ACT_ACTION_PLAY:
- case ACT_ACTION_FLIPPER:
- case ACT_ACTION_LOOP_STOP:
- case ACT_ACTION_LOOP_END:
- case ACT_ACTION_FROM_PROP:
- m_playtype = typeArg;
- break;
- default:
- printf("Invalid type for action actuator: %d\n", typeArg); /* error */
- }
-
- Py_RETURN_NONE;
-}
-
PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h
index 890fe3f9de9..28a6d90abdf 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.h
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.h
@@ -82,29 +82,6 @@ public:
bAction* GetAction() { return m_action; }
void SetAction(bAction* act) { m_action= act; }
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetAction);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendin);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetPriority);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetStart);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetEnd);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrame);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetProperty);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrameProperty);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendtime);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetChannel);
-
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetPriority);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetStart);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetEnd);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrame);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetProperty);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrameProperty);
-// KX_PYMETHOD(BL_ActionActuator,GetChannel);
- KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType);
- KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType);
-
static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp
index d39917b0e5c..20ca7f07f2b 100644
--- a/source/gameengine/Converter/BL_ShapeDeformer.cpp
+++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp
@@ -109,8 +109,8 @@ bool BL_ShapeDeformer::ExecuteShapeDrivers(void)
{
if (!m_shapeDrivers.empty() && PoseUpdated()) {
vector<IpoCurve*>::iterator it;
- void *poin;
- int type;
+// void *poin;
+// int type;
// the shape drivers use the bone matrix as input. Must
// update the matrix now
diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h
index 949e5e1e3ad..ca3770d4006 100644
--- a/source/gameengine/Converter/BL_ShapeDeformer.h
+++ b/source/gameengine/Converter/BL_ShapeDeformer.h
@@ -83,6 +83,12 @@ protected:
vector<IpoCurve*> m_shapeDrivers;
double m_lastShapeUpdate;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h
index 7c43246a9d7..b83895d5609 100644
--- a/source/gameengine/Converter/BL_SkinDeformer.h
+++ b/source/gameengine/Converter/BL_SkinDeformer.h
@@ -105,6 +105,12 @@ protected:
bool m_poseApplied;
bool m_recalcNormal;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinDeformer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Converter/BL_SkinMeshObject.cpp b/source/gameengine/Converter/BL_SkinMeshObject.cpp
index 0a18296f261..4eb01df410b 100644
--- a/source/gameengine/Converter/BL_SkinMeshObject.cpp
+++ b/source/gameengine/Converter/BL_SkinMeshObject.cpp
@@ -46,8 +46,8 @@
#include "BL_SkinMeshObject.h"
#include "BL_DeformableGameObject.h"
-BL_SkinMeshObject::BL_SkinMeshObject(Mesh* mesh, int lightlayer)
- : RAS_MeshObject (mesh, lightlayer)
+BL_SkinMeshObject::BL_SkinMeshObject(Mesh* mesh)
+ : RAS_MeshObject (mesh)
{
m_bDeformed = true;
diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h
index 8544a2b958c..838c6c3cb95 100644
--- a/source/gameengine/Converter/BL_SkinMeshObject.h
+++ b/source/gameengine/Converter/BL_SkinMeshObject.h
@@ -46,7 +46,7 @@ protected:
vector<int> m_cacheWeightIndex;
public:
- BL_SkinMeshObject(Mesh* mesh, int lightlayer);
+ BL_SkinMeshObject(Mesh* mesh);
~BL_SkinMeshObject();
void UpdateBuckets(void* clientobj, double* oglmatrix,
@@ -54,6 +54,13 @@ public:
// for shape keys,
void CheckWeightCache(struct Object* obj);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinMeshObject"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h
index fd6bb0212b7..7ccb96e4683 100644
--- a/source/gameengine/Converter/BlenderWorldInfo.h
+++ b/source/gameengine/Converter/BlenderWorldInfo.h
@@ -94,6 +94,13 @@ public:
setMistColorBlue(
float d
);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__BLENDERWORLDINFO_H
diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt
index 031c2234ea8..f16e9e169ab 100644
--- a/source/gameengine/Converter/CMakeLists.txt
+++ b/source/gameengine/Converter/CMakeLists.txt
@@ -32,11 +32,7 @@ SET(INC
../../../intern/string
../../../intern/guardedalloc
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
- ../../../intern/SoundSystem
- ../../../intern/SoundSystem/include
- ../../../intern/SoundSystem/openal
- ../../../intern/SoundSystem/dummy
- ../../../intern/SoundSystem/intern
+ ../../../intern/audaspace/intern
../../../source/gameengine/Converter
../../../source/gameengine/BlenderRoutines
../../../source/blender/imbuf
@@ -58,16 +54,12 @@ SET(INC
../../../source/gameengine/SceneGraph
../../../source/gameengine/Physics/common
../../../source/gameengine/Physics/Bullet
- ../../../source/gameengine/Physics/BlOde
../../../source/gameengine/Physics/Dummy
- ../../../source/gameengine/Physics/Sumo
- ../../../source/gameengine/Physics/Sumo/Fuzzics/include
../../../source/gameengine/Network/LoopBackNetwork
../../../source/blender/misc
../../../source/blender/blenloader
../../../source/blender/gpu
../../../extern/bullet2/src
- ../../../extern/solid
${PYTHON_INC}
)
diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
index c3264a2bc37..24910422176 100644
--- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
+++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
@@ -62,7 +62,7 @@ BL_InterpolatorList::~BL_InterpolatorList() {
}
}
-KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(char *rna_path, int array_index) {
+KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(const char *rna_path, int array_index) {
for(BL_InterpolatorList::iterator i = begin(); (i != end()) ; i++ )
{
FCurve *fcu= (static_cast<BL_ScalarInterpolator *>(*i))->GetFCurve();
diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
index 396a7d197df..e7fbb8083e4 100644
--- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
+++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
@@ -49,6 +49,13 @@ public:
private:
struct FCurve *m_fcu;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ScalarInterpolator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
@@ -57,7 +64,14 @@ public:
BL_InterpolatorList(struct AnimData *adt);
~BL_InterpolatorList();
- KX_IScalarInterpolator *GetScalarInterpolator(char *rna_path, int array_index);
+ KX_IScalarInterpolator *GetScalarInterpolator(const char *rna_path, int array_index);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_InterpolatorList"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_SCALARINTERPOLATOR_H
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 9e0a710f44f..151564391f3 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -242,15 +242,13 @@ struct BlenderDebugDraw : public btIDebugDraw
#endif
-void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename,
- class KX_Scene* destinationscene,
+void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
PyObject* dictobj,
- class SCA_IInputDevice* keyinputdev,
class RAS_IRenderTools* rendertools,
class RAS_ICanvas* canvas)
{
//find out which physics engine
- Scene *blenderscene = GetBlenderSceneForName(scenename);
+ Scene *blenderscene = destinationscene->GetBlenderScene();
e_PhysicsEngine physics_engine = UseBullet;
bool useDbvtCulling = false;
@@ -262,38 +260,34 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename,
if (blenderscene)
{
- if (blenderscene->world)
+ switch (blenderscene->gm.physicsEngine)
{
- switch (blenderscene->world->physicsEngine)
+ case WOPHY_BULLET:
{
- case WOPHY_BULLET:
- {
- physics_engine = UseBullet;
- useDbvtCulling = (blenderscene->world->mode & WO_DBVT_CULLING) != 0;
- break;
- }
-
- case WOPHY_ODE:
- {
- physics_engine = UseODE;
- break;
- }
- case WOPHY_DYNAMO:
- {
- physics_engine = UseDynamo;
- break;
- }
- case WOPHY_SUMO:
- {
- physics_engine = UseSumo;
- break;
- }
- case WOPHY_NONE:
- {
- physics_engine = UseNone;
- }
+ physics_engine = UseBullet;
+ useDbvtCulling = (blenderscene->gm.mode & WO_DBVT_CULLING) != 0;
+ break;
+ }
+
+ case WOPHY_ODE:
+ {
+ physics_engine = UseODE;
+ break;
+ }
+ case WOPHY_DYNAMO:
+ {
+ physics_engine = UseDynamo;
+ break;
+ }
+ case WOPHY_SUMO:
+ {
+ physics_engine = UseSumo;
+ break;
+ }
+ case WOPHY_NONE:
+ {
+ physics_engine = UseNone;
}
-
}
}
@@ -331,12 +325,10 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename,
}
BL_ConvertBlenderObjects(m_maggie,
- scenename,
destinationscene,
m_ketsjiEngine,
physics_engine,
dictobj,
- keyinputdev,
rendertools,
canvas,
this,
@@ -353,10 +345,6 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename,
//This cache mecanism is buggy so I leave it disable and the memory leak
//that would result from this is fixed in RemoveScene()
m_map_mesh_to_gamemesh.clear();
- //Don't clear this lookup, it is needed for the baking physics into ipo animation
- //To avoid it's infinite grows, object will be unregister when they are deleted
- //see KX_Scene::NewRemoveObject
- //m_map_gameobject_to_blender.clear();
}
// This function removes all entities stored in the converter for that scene
@@ -470,27 +458,28 @@ void KX_BlenderSceneConverter::RegisterGameObject(
KX_GameObject *gameobject,
struct Object *for_blenderobject)
{
- m_map_gameobject_to_blender.insert(CHashedPtr(gameobject),for_blenderobject);
+ /* only maintained while converting, freed during game runtime */
m_map_blender_to_gameobject.insert(CHashedPtr(for_blenderobject),gameobject);
}
+/* only need to run this during conversion since
+ * m_map_blender_to_gameobject is freed after conversion */
void KX_BlenderSceneConverter::UnregisterGameObject(
KX_GameObject *gameobject)
{
- CHashedPtr gptr(gameobject);
- struct Object **bobp= m_map_gameobject_to_blender[gptr];
+ struct Object *bobp= gameobject->GetBlenderObject();
if (bobp) {
- CHashedPtr bptr(*bobp);
+ CHashedPtr bptr(bobp);
KX_GameObject **gobp= m_map_blender_to_gameobject[bptr];
if (gobp && *gobp == gameobject)
+ {
// also maintain m_map_blender_to_gameobject if the gameobject
// being removed is matching the blender object
m_map_blender_to_gameobject.remove(bptr);
- m_map_gameobject_to_blender.remove(gptr);
+ }
}
}
-
KX_GameObject *KX_BlenderSceneConverter::FindGameObject(
struct Object *for_blenderobject)
{
@@ -499,18 +488,6 @@ KX_GameObject *KX_BlenderSceneConverter::FindGameObject(
return obp?*obp:NULL;
}
-
-
-struct Object *KX_BlenderSceneConverter::FindBlenderObject(
- KX_GameObject *for_gameobject)
-{
- struct Object **obp= m_map_gameobject_to_blender[CHashedPtr(for_gameobject)];
-
- return obp?*obp:NULL;
-}
-
-
-
void KX_BlenderSceneConverter::RegisterGameMesh(
RAS_MeshObject *gamemesh,
struct Mesh *for_blendermesh)
@@ -697,7 +674,7 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo)
{
//KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
- Object* blenderObject = FindBlenderObject(gameObj);
+ Object* blenderObject = gameObj->GetBlenderObject();
if (blenderObject)
{
//erase existing ipo's
@@ -761,7 +738,7 @@ void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo(){
for (int ix=0;ix<parentList->GetCount();ix++){
KX_GameObject* gameobj = (KX_GameObject*)parentList->GetValue(ix);
if (!gameobj->IsDynamic()){
- Object* blenderobject = FindBlenderObject(gameobj);
+ Object* blenderobject = gameobj->GetBlenderObject();
if (!blenderobject)
continue;
if (blenderobject->type==OB_ARMATURE)
@@ -815,9 +792,10 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
{
//KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
- Object* blenderObject = FindBlenderObject(gameObj);
+ Object* blenderObject = gameObj->GetBlenderObject();
if (blenderObject && blenderObject->ipo)
{
+#if 0
const MT_Point3& position = gameObj->NodeGetWorldPosition();
//const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
const MT_Matrix3x3& orn = gameObj->NodeGetWorldOrientation();
@@ -827,7 +805,6 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
float tmat[3][3];
// XXX animato
-#if 0
Ipo* ipo = blenderObject->ipo;
//create the curves, if not existing, set linear if new
@@ -916,7 +893,7 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
{
//KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
- Object* blenderObject = FindBlenderObject(gameObj);
+ Object* blenderObject = gameObj->GetBlenderObject();
if (blenderObject && blenderObject->ipo)
{
// XXX animato
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h
index b65f49c2b59..bb87a21a683 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.h
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h
@@ -56,14 +56,10 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter
// Should also have a list of collision shapes.
// For the time being this is held in KX_Scene::m_shapes
- GEN_Map<CHashedPtr,struct Object*> m_map_gameobject_to_blender;
- GEN_Map<CHashedPtr,KX_GameObject*> m_map_blender_to_gameobject;
-
- GEN_Map<CHashedPtr,RAS_MeshObject*> m_map_mesh_to_gamemesh;
-// GEN_Map<CHashedPtr,DT_ShapeHandle> m_map_gamemesh_to_sumoshape;
-
- GEN_Map<CHashedPtr,SCA_IActuator*> m_map_blender_to_gameactuator;
- GEN_Map<CHashedPtr,SCA_IController*> m_map_blender_to_gamecontroller;
+ GEN_Map<CHashedPtr,KX_GameObject*> m_map_blender_to_gameobject; /* cleared after conversion */
+ GEN_Map<CHashedPtr,RAS_MeshObject*> m_map_mesh_to_gamemesh; /* cleared after conversion */
+ GEN_Map<CHashedPtr,SCA_IActuator*> m_map_blender_to_gameactuator; /* cleared after conversion */
+ GEN_Map<CHashedPtr,SCA_IController*>m_map_blender_to_gamecontroller; /* cleared after conversion */
GEN_Map<CHashedPtr,BL_InterpolatorList*> m_map_blender_to_gameAdtList;
@@ -92,10 +88,8 @@ public:
* dictobj: python dictionary (for pythoncontrollers)
*/
virtual void ConvertScene(
- const STR_String& scenename,
class KX_Scene* destinationscene,
PyObject* dictobj,
- class SCA_IInputDevice* keyinputdev,
class RAS_IRenderTools* rendertools,
class RAS_ICanvas* canvas
);
@@ -109,14 +103,10 @@ public:
void RegisterGameObject(KX_GameObject *gameobject, struct Object *for_blenderobject);
void UnregisterGameObject(KX_GameObject *gameobject);
KX_GameObject *FindGameObject(struct Object *for_blenderobject);
- struct Object *FindBlenderObject(KX_GameObject *for_gameobject);
void RegisterGameMesh(RAS_MeshObject *gamemesh, struct Mesh *for_blendermesh);
RAS_MeshObject *FindGameMesh(struct Mesh *for_blendermesh/*, unsigned int onlayer*/);
-// void RegisterSumoShape(DT_ShapeHandle shape, RAS_MeshObject *for_gamemesh);
-// DT_ShapeHandle FindSumoShape(RAS_MeshObject *for_gamemesh);
-
void RegisterPolyMaterial(RAS_IPolyMaterial *polymat);
void RegisterBlenderMaterial(BL_Material *mat);
@@ -150,6 +140,15 @@ public:
virtual bool GetGLSLMaterials();
struct Scene* GetBlenderSceneForName(const STR_String& name);
+
+ struct Main* GetMain() { return m_maggie; };
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSceneConverter"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_BLENDERSCENECONVERTER_H
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index ea812a71fdd..91a39bd7686 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -38,7 +38,7 @@
#include "KX_BlenderSceneConverter.h"
#include "KX_ConvertActuators.h"
-#include "SND_Scene.h"
+#include "AUD_C-API.h"
// Actuators
//SCA logiclibrary native logicbricks
#include "SCA_PropertyActuator.h"
@@ -50,7 +50,6 @@
#include "KX_SceneActuator.h"
#include "KX_IpoActuator.h"
#include "KX_SoundActuator.h"
-#include "KX_CDActuator.h"
#include "KX_ObjectActuator.h"
#include "KX_TrackToActuator.h"
#include "KX_ConstraintActuator.h"
@@ -347,8 +346,7 @@ void BL_ConvertActuators(char* maggiename,
{
bSoundActuator* soundact = (bSoundActuator*) bact->data;
/* get type, and possibly a start and end frame */
- short startFrame = soundact->sta, stopFrame = soundact->end;
- KX_SoundActuator::KX_SOUNDACT_TYPE
+ KX_SoundActuator::KX_SOUNDACT_TYPE
soundActuatorType = KX_SoundActuator::KX_SOUNDACT_NODEF;
switch(soundact->type) {
@@ -378,173 +376,38 @@ void BL_ConvertActuators(char* maggiename,
if (soundActuatorType != KX_SoundActuator::KX_SOUNDACT_NODEF)
{
- SND_Scene* soundscene = scene->GetSoundScene();
- STR_String samplename = "";
- bool sampleisloaded = false;
-
- if (soundact->sound) {
- /* Need to convert the samplename into absolute path
- * before checking if its loaded */
- char fullpath[FILE_MAX];
-
- /* dont modify soundact->sound->name, only change a copy */
- BLI_strncpy(fullpath, soundact->sound->name, sizeof(fullpath));
- BLI_convertstringcode(fullpath, maggiename);
- samplename = fullpath;
-
- /* let's see if the sample was already loaded */
- if (soundscene->IsSampleLoaded(samplename))
- {
- sampleisloaded = true;
- }
- else {
- /* if not, make it so */
- PackedFile* pf = soundact->sound->newpackedfile;
-
- /* but we need a packed file then */
- if (pf)
- {
- if (soundscene->LoadSample(samplename, pf->data, pf->size) > -1)
- sampleisloaded = true;
- }
- /* or else load it from disk */
- else
- {
- if (soundscene->LoadSample(samplename, NULL, 0) > -1) {
- sampleisloaded = true;
- }
- else {
- std::cout << "WARNING: Sound actuator \"" << bact->name <<
- "\" from object \"" << blenderobject->id.name+2 <<
- "\" failed to load sample." << std::endl;
- }
- }
- }
- } else {
+ bSound* sound = soundact->sound;
+ bool is3d = soundact->flag & ACT_SND_3D_SOUND ? true : false;
+ AUD_Sound* snd_sound = NULL;
+ KX_3DSoundSettings settings;
+ settings.cone_inner_angle = soundact->sound3D.cone_inner_angle;
+ settings.cone_outer_angle = soundact->sound3D.cone_outer_angle;
+ settings.cone_outer_gain = soundact->sound3D.cone_outer_gain;
+ settings.max_distance = soundact->sound3D.max_distance;
+ settings.max_gain = soundact->sound3D.max_gain;
+ settings.min_gain = soundact->sound3D.min_gain;
+ settings.reference_distance = soundact->sound3D.reference_distance;
+ settings.rolloff_factor = soundact->sound3D.rolloff_factor;
+
+ if(!sound)
+ {
std::cout << "WARNING: Sound actuator \"" << bact->name <<
"\" from object \"" << blenderobject->id.name+2 <<
"\" has no sound datablock." << std::endl;
}
-
- /* Note, allowing actuators for sounds that are not there was added since 2.47
- * This is because python may expect the actuator and raise an exception if it dosnt find it
- * better just to add a dummy sound actuator. */
- SND_SoundObject* sndobj = NULL;
- if (sampleisloaded)
- {
- /* setup the SND_SoundObject */
- sndobj = new SND_SoundObject();
- sndobj->SetSampleName(samplename.Ptr());
- sndobj->SetObjectName(bact->name);
- if (soundact->sound) {
- sndobj->SetRollOffFactor(soundact->sound->attenuation);
- sndobj->SetGain(soundact->sound->volume);
- sndobj->SetPitch(exp((soundact->sound->pitch / 12.0) * log(2.0)));
- // sndobj->SetLoopStart(soundact->sound->loopstart);
- // sndobj->SetLoopStart(soundact->sound->loopend);
- if (soundact->sound->flags & SOUND_FLAGS_LOOP)
- {
- if (soundact->sound->flags & SOUND_FLAGS_BIDIRECTIONAL_LOOP)
- sndobj->SetLoopMode(SND_LOOP_BIDIRECTIONAL);
- else
- sndobj->SetLoopMode(SND_LOOP_NORMAL);
- }
- else {
- sndobj->SetLoopMode(SND_LOOP_OFF);
- }
-
- if (soundact->sound->flags & SOUND_FLAGS_PRIORITY)
- sndobj->SetHighPriority(true);
- else
- sndobj->SetHighPriority(false);
-
- if (soundact->sound->flags & SOUND_FLAGS_3D)
- sndobj->Set3D(true);
- else
- sndobj->Set3D(false);
- }
- else {
- /* dummy values for a NULL sound
- * see editsound.c - defaults are unlikely to change soon */
- sndobj->SetRollOffFactor(1.0);
- sndobj->SetGain(1.0);
- sndobj->SetPitch(1.0);
- sndobj->SetLoopMode(SND_LOOP_OFF);
- sndobj->SetHighPriority(false);
- sndobj->Set3D(false);
- }
- }
- KX_SoundActuator* tmpsoundact =
- new KX_SoundActuator(gameobj,
- sndobj,
- scene->GetSoundScene(), // needed for replication!
- soundActuatorType,
- startFrame,
- stopFrame);
-
+ else
+ snd_sound = sound->cache ? sound->cache : sound->handle;
+ KX_SoundActuator* tmpsoundact =
+ new KX_SoundActuator(gameobj,
+ snd_sound,
+ soundact->volume,
+ exp((soundact->pitch / 12.0) * log(2.0)),
+ is3d,
+ settings,
+ soundActuatorType);
+
tmpsoundact->SetName(bact->name);
baseact = tmpsoundact;
- if (sndobj)
- soundscene->AddObject(sndobj);
- }
- break;
- }
- case ACT_CD:
- {
- bCDActuator* cdact = (bCDActuator*) bact->data;
- /* get type, and possibly a start and end frame */
- short startFrame = cdact->sta, stopFrame = cdact->end;
- KX_CDActuator::KX_CDACT_TYPE
- cdActuatorType = KX_CDActuator::KX_CDACT_NODEF;
-
- switch(cdact->type)
- {
- case ACT_CD_PLAY_ALL:
- cdActuatorType = KX_CDActuator::KX_CDACT_PLAY_ALL;
- break;
- case ACT_CD_PLAY_TRACK:
- cdActuatorType = KX_CDActuator::KX_CDACT_PLAY_TRACK;
- break;
- case ACT_CD_LOOP_TRACK:
- cdActuatorType = KX_CDActuator::KX_CDACT_LOOP_TRACK;
- break;
- case ACT_CD_VOLUME:
- cdActuatorType = KX_CDActuator::KX_CDACT_VOLUME;
- break;
- case ACT_CD_STOP:
- cdActuatorType = KX_CDActuator::KX_CDACT_STOP;
- break;
- case ACT_CD_PAUSE:
- cdActuatorType = KX_CDActuator::KX_CDACT_PAUSE;
- break;
- case ACT_CD_RESUME:
- cdActuatorType = KX_CDActuator::KX_CDACT_RESUME;
- break;
-
- default:
- /* This is an error!!! */
- cdActuatorType = KX_CDActuator::KX_CDACT_NODEF;
- }
-
- if (cdActuatorType != KX_CDActuator::KX_CDACT_NODEF)
- {
- SND_CDObject* pCD = SND_CDObject::Instance();
-
- if (pCD)
- {
- pCD->SetGain(cdact->volume);
-
- KX_CDActuator* tmpcdact =
- new KX_CDActuator(gameobj,
- scene->GetSoundScene(), // needed for replication!
- cdActuatorType,
- cdact->track,
- startFrame,
- stopFrame);
-
- tmpcdact->SetName(bact->name);
- baseact = tmpcdact;
- }
}
break;
}
@@ -629,7 +492,6 @@ void BL_ConvertActuators(char* maggiename,
tmpmesh = BL_ConvertMesh(
editobact->me,
blenderobject,
- rendertools,
scene,
converter
);
@@ -638,7 +500,10 @@ void BL_ConvertActuators(char* maggiename,
= new KX_SCA_ReplaceMeshActuator(
gameobj,
tmpmesh,
- scene
+ scene,
+ (editobact->flag & ACT_EDOB_REPLACE_MESH_NOGFX)==0,
+ (editobact->flag & ACT_EDOB_REPLACE_MESH_PHYS)!=0
+
);
baseact = tmpreplaceact;
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp
index 0b395cfd402..09027f18844 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -28,6 +28,7 @@
* Conversion of Blender data blocks to KX sensor system
*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -94,7 +95,6 @@ void BL_ConvertSensors(struct Object* blenderobject,
SCA_LogicManager* logicmgr,
KX_Scene* kxscene,
KX_KetsjiEngine* kxengine,
- SCA_IInputDevice* keydev,
int activeLayerBitInfo,
bool isInActiveLayer,
RAS_ICanvas* canvas,
@@ -444,9 +444,8 @@ void BL_ConvertSensors(struct Object* blenderobject,
blendernearsensor->dist,
blendernearsensor->resetdist,
bFindMaterial,
- nearpropertyname,kxscene,
- physCtrl
- );
+ nearpropertyname,
+ physCtrl);
}
break;
@@ -537,6 +536,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
starty,
keytype,
trackfocus,
+ (bmouse->flag & SENS_MOUSE_FOCUS_PULSE) ? true:false,
kxscene,
kxengine,
gameobj);
@@ -648,8 +648,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
smallmargin,
largemargin,
bFindMaterial,
- radarpropertyname,
- kxscene);
+ radarpropertyname);
}
diff --git a/source/gameengine/Converter/KX_ConvertSensors.h b/source/gameengine/Converter/KX_ConvertSensors.h
index 9162a866768..630323f30b4 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.h
+++ b/source/gameengine/Converter/KX_ConvertSensors.h
@@ -34,7 +34,6 @@ void BL_ConvertSensors(struct Object* blenderobject,
class SCA_LogicManager* logicmgr,
class KX_Scene* kxscene,
class KX_KetsjiEngine* kxengine,
- class SCA_IInputDevice* keydev,
int activeLayerBitInfo,
bool isInActiveLayer,
class RAS_ICanvas* canvas,
diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp
index d3a2e1a9ba4..848fcfcdaa0 100644
--- a/source/gameengine/Converter/KX_IpoConvert.cpp
+++ b/source/gameengine/Converter/KX_IpoConvert.cpp
@@ -175,7 +175,7 @@ void BL_ConvertIpos(struct Object* blenderobject,KX_GameObject* gameobj,KX_Blend
KX_ObColorIpoSGController* ipocontr_obcol=NULL;
for(int i=0; i<4; i++) {
- if (interp = adtList->GetScalarInterpolator("color", i)) {
+ if ((interp = adtList->GetScalarInterpolator("color", i))) {
if (!ipocontr_obcol) {
ipocontr_obcol = new KX_ObColorIpoSGController();
gameobj->GetSGNode()->AddSGController(ipocontr_obcol);
diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile
index ed95aa968c7..e261f9350e9 100644
--- a/source/gameengine/Converter/Makefile
+++ b/source/gameengine/Converter/Makefile
@@ -37,10 +37,10 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include
+CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_BULLET2)/include
+CPPFLAGS += -I$(NAN_AUDASPACE)/include
CPPFLAGS += -I../../blender
# these two needed because of blenkernel
diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript
index 05ea01c902a..bf2dfa5e659 100644
--- a/source/gameengine/Converter/SConscript
+++ b/source/gameengine/Converter/SConscript
@@ -6,8 +6,7 @@ defs = []
incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc'
incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer'
-incs += ' #intern/SoundSystem #intern/SoundSystem/include #intern/SoundSystem/openal'
-incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengine/Converter'
+incs += ' #intern/audaspace/intern #source/gameengine/Converter'
incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf'
incs += ' #intern/moto/include #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork'
incs += ' #source/blender/blenlib #source/blender/blenkernel #source/blender'
@@ -24,4 +23,4 @@ incs += ' #source/blender/makesrna'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_BULLET_INC']
-env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,50] )
+env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core'], priority=[305], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h
index 726619e7193..4d0103ec1dd 100644
--- a/source/gameengine/Expressions/BoolValue.h
+++ b/source/gameengine/Expressions/BoolValue.h
@@ -49,6 +49,13 @@ public:
private:
bool m_bool;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _BOOLVALUE_H
diff --git a/source/gameengine/Expressions/ConstExpr.h b/source/gameengine/Expressions/ConstExpr.h
index b117140fe70..f48b8d34355 100644
--- a/source/gameengine/Expressions/ConstExpr.h
+++ b/source/gameengine/Expressions/ConstExpr.h
@@ -41,6 +41,13 @@ public:
private:
CValue* m_value;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined(AFX_CONSTEXPR_H__061ECFC3_BE87_11D1_A51C_00A02472FC58__INCLUDED_)
diff --git a/source/gameengine/Expressions/EmptyValue.h b/source/gameengine/Expressions/EmptyValue.h
index fb6b4a477a6..01029d1655d 100644
--- a/source/gameengine/Expressions/EmptyValue.h
+++ b/source/gameengine/Expressions/EmptyValue.h
@@ -34,6 +34,13 @@ public:
CValue * Calc(VALUE_OPERATOR op, CValue *val);
CValue * CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
virtual CValue* GetReplica();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _EMPTYVALUE_H
diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h
index b4b758feea7..2f65850c4f1 100644
--- a/source/gameengine/Expressions/ErrorValue.h
+++ b/source/gameengine/Expressions/ErrorValue.h
@@ -33,6 +33,13 @@ public:
private:
STR_String m_strErrorText;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _ERRORVALUE_H
diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h
index 400a2b7c789..bd346fd0552 100644
--- a/source/gameengine/Expressions/Expression.h
+++ b/source/gameengine/Expressions/Expression.h
@@ -63,6 +63,12 @@ class CBrokenLinkInfo
CExpression* m_pExpr;
bool m_bRestored;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
@@ -126,6 +132,13 @@ public:
protected:
int m_refcount;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _EXPRESSION_H
diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h
index fb75b7c702b..442f0eb6cf8 100644
--- a/source/gameengine/Expressions/FloatValue.h
+++ b/source/gameengine/Expressions/FloatValue.h
@@ -42,6 +42,12 @@ protected:
float m_float;
STR_String* m_pstrRep;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _FLOATVALUE_H
diff --git a/source/gameengine/Expressions/IdentifierExpr.h b/source/gameengine/Expressions/IdentifierExpr.h
index b307228c8b9..7c14329f755 100644
--- a/source/gameengine/Expressions/IdentifierExpr.h
+++ b/source/gameengine/Expressions/IdentifierExpr.h
@@ -46,6 +46,13 @@ public:
virtual CExpression* CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks);
virtual void ClearModified();
virtual void BroadcastOperators(VALUE_OPERATOR op);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__IDENTIFIER_EXPR
diff --git a/source/gameengine/Expressions/IfExpr.h b/source/gameengine/Expressions/IfExpr.h
index 9ab13dca413..f06718c851f 100644
--- a/source/gameengine/Expressions/IfExpr.h
+++ b/source/gameengine/Expressions/IfExpr.h
@@ -44,6 +44,13 @@ public:
virtual CExpression* CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks);
virtual void ClearModified();
virtual void BroadcastOperators(VALUE_OPERATOR op);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined(AFX_IFEXPR_H__1F691841_C5C7_11D1_A863_0000B4542BD8__INCLUDED_)
diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h
index 810bdc244a8..0d7eab27aeb 100644
--- a/source/gameengine/Expressions/InputParser.h
+++ b/source/gameengine/Expressions/InputParser.h
@@ -102,7 +102,13 @@ private:
int Priority(int optor);
CExpression *Ex(int i);
CExpression *Expr();
-
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h
index 06bf1755749..0513026c4cf 100644
--- a/source/gameengine/Expressions/IntValue.h
+++ b/source/gameengine/Expressions/IntValue.h
@@ -56,6 +56,12 @@ private:
cInt m_int;
STR_String* m_pstrRep;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _INTVALUE_H
diff --git a/source/gameengine/Expressions/KX_HashedPtr.h b/source/gameengine/Expressions/KX_HashedPtr.h
index b11efb99d68..0b54436147b 100644
--- a/source/gameengine/Expressions/KX_HashedPtr.h
+++ b/source/gameengine/Expressions/KX_HashedPtr.h
@@ -29,6 +29,10 @@
#ifndef __KX_HASHEDPTR
#define __KX_HASHEDPTR
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
unsigned int KX_Hash(void * inDWord);
class CHashedPtr
@@ -44,6 +48,13 @@ public:
{
return rhs.m_valptr == lhs.m_valptr;
}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_HASHEDPTR
diff --git a/source/gameengine/Expressions/KX_Python.h b/source/gameengine/Expressions/KX_Python.h
index 61f7ef05042..f41accec730 100644
--- a/source/gameengine/Expressions/KX_Python.h
+++ b/source/gameengine/Expressions/KX_Python.h
@@ -30,6 +30,17 @@
#define KX_PYTHON_H
//#define USE_DL_EXPORT
+
+/* python redefines, quiet the compiler */
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
+
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
+
#include "Python.h"
#define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index 38b00dcc8fb..002674450d1 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -242,15 +242,10 @@ static PySequenceMethods listvalue_as_sequence = {
listvalue_buffer_concat, /*sq_concat*/
NULL, /*sq_repeat*/
listvalue_buffer_item, /*sq_item*/
-#if (PY_VERSION_HEX >= 0x03000000) // TODO, slicing in py3?
- NULL,
- NULL,
- NULL,
-#else
- listvalue_buffer_slice, /*sq_slice*/
+// TODO, slicing in py3
+ NULL, // listvalue_buffer_slice, /*sq_slice*/
NULL, /*sq_ass_item*/
NULL, /*sq_ass_slice*/
-#endif
(objobjproc)listvalue_buffer_contains, /* sq_contains */
};
@@ -266,13 +261,7 @@ static PyMappingMethods instance_as_mapping = {
PyTypeObject CListValue::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"CListValue", /*tp_name*/
sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -311,7 +300,6 @@ PyMethodDef CListValue::Methods[] = {
/* Dict style access */
{"get", (PyCFunction)CListValue::sPyget,METH_VARARGS},
- {"has_key", (PyCFunction)CListValue::sPyhas_key,METH_O},
/* Own cvalue funcs */
{"from_id", (PyCFunction)CListValue::sPyfrom_id,METH_O},
@@ -605,14 +593,6 @@ PyObject* CListValue::Pyget(PyObject *args)
return def;
}
-/* Matches python dict.has_key() */
-PyObject* CListValue::Pyhas_key(PyObject* value)
-{
- if (PyUnicode_Check(value) && FindValue((const char *)_PyUnicode_AsString(value)))
- Py_RETURN_TRUE;
-
- Py_RETURN_FALSE;
-}
PyObject* CListValue::Pyfrom_id(PyObject* value)
{
diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h
index 98e6f216f11..2dc458e0148 100644
--- a/source/gameengine/Expressions/ListValue.h
+++ b/source/gameengine/Expressions/ListValue.h
@@ -74,7 +74,6 @@ public:
KX_PYMETHOD_O(CListValue,index);
KX_PYMETHOD_O(CListValue,count);
KX_PYMETHOD_VARARGS(CListValue,get);
- KX_PYMETHOD_O(CListValue,has_key);
KX_PYMETHOD_O(CListValue,from_id);
diff --git a/source/gameengine/Expressions/Operator1Expr.h b/source/gameengine/Expressions/Operator1Expr.h
index 4a1deb0eca3..c2bc68076a0 100644
--- a/source/gameengine/Expressions/Operator1Expr.h
+++ b/source/gameengine/Expressions/Operator1Expr.h
@@ -46,6 +46,13 @@ public:
private:
VALUE_OPERATOR m_op;
CExpression * m_lhs;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined(AFX_OPERATOR1EXPR_H__A1653901_BF41_11D1_A51C_00A02472FC58__INCLUDED_)
diff --git a/source/gameengine/Expressions/Operator2Expr.h b/source/gameengine/Expressions/Operator2Expr.h
index 4064890bbae..bb26b7c03be 100644
--- a/source/gameengine/Expressions/Operator2Expr.h
+++ b/source/gameengine/Expressions/Operator2Expr.h
@@ -52,7 +52,13 @@ protected:
private:
VALUE_OPERATOR m_op;
-
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _OPERATOR2EXPR_H
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 729fff31052..1d1d9e6103b 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -57,13 +57,7 @@
PyTypeObject PyObjectPlus::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"PyObjectPlus", /*tp_name*/
sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -87,8 +81,8 @@ PyTypeObject PyObjectPlus::Type = {
PyObjectPlus::~PyObjectPlus()
{
if(m_proxy) {
- Py_DECREF(m_proxy); /* Remove own reference, python may still have 1 */
BGE_PROXY_REF(m_proxy)= NULL;
+ Py_DECREF(m_proxy); /* Remove own reference, python may still have 1 */
}
// assert(ob_refcnt==0);
}
@@ -757,16 +751,17 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt
STR_String *var = reinterpret_cast<STR_String*>(ptr);
if (PyUnicode_Check(value))
{
- char *val = _PyUnicode_AsString(value);
+ Py_ssize_t val_len;
+ char *val = _PyUnicode_AsStringAndSize(value, &val_len);
if (attrdef->m_clamp)
{
- if (strlen(val) < attrdef->m_imin)
+ if (val_len < attrdef->m_imin)
{
// can't increase the length of the string
PyErr_Format(PyExc_ValueError, "string length too short for attribute \"%s\"", attrdef->m_name);
goto FREE_AND_ERROR;
}
- else if (strlen(val) > attrdef->m_imax)
+ else if (val_len > attrdef->m_imax)
{
// trim the string
char c = val[attrdef->m_imax];
@@ -775,7 +770,7 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt
val[attrdef->m_imax] = c;
break;
}
- } else if (strlen(val) < attrdef->m_imin || strlen(val) > attrdef->m_imax)
+ } else if (val_len < attrdef->m_imin || val_len > attrdef->m_imax)
{
PyErr_Format(PyExc_ValueError, "string length out of range for attribute \"%s\"", attrdef->m_name);
goto FREE_AND_ERROR;
@@ -912,45 +907,47 @@ void PyObjectPlus::SetDeprecationWarnings(bool ignoreDeprecationWarnings)
m_ignore_deprecation_warnings = ignoreDeprecationWarnings;
}
-void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* new_way)
+void PyDebugLine()
{
- {
- printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way);
-
- // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno)
-
- PyObject *getframe, *frame;
- PyObject *f_lineno, *f_code, *co_filename;
-
- getframe = PySys_GetObject((char *)"_getframe"); // borrowed
- if (getframe) {
- frame = PyObject_CallObject(getframe, NULL);
- if (frame) {
- f_lineno= PyObject_GetAttrString(frame, "f_lineno");
- f_code= PyObject_GetAttrString(frame, "f_code");
- if (f_lineno && f_code) {
- co_filename= PyObject_GetAttrString(f_code, "co_filename");
- if (co_filename) {
-
- printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno));
-
- Py_DECREF(f_lineno);
- Py_DECREF(f_code);
- Py_DECREF(co_filename);
- Py_DECREF(frame);
- return;
- }
+ // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno)
+
+ PyObject *getframe, *frame;
+ PyObject *f_lineno, *f_code, *co_filename;
+
+ getframe = PySys_GetObject((char *)"_getframe"); // borrowed
+ if (getframe) {
+ frame = PyObject_CallObject(getframe, NULL);
+ if (frame) {
+ f_lineno= PyObject_GetAttrString(frame, "f_lineno");
+ f_code= PyObject_GetAttrString(frame, "f_code");
+ if (f_lineno && f_code) {
+ co_filename= PyObject_GetAttrString(f_code, "co_filename");
+ if (co_filename) {
+
+ printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno));
+
+ Py_DECREF(f_lineno);
+ Py_DECREF(f_code);
+ Py_DECREF(co_filename);
+ Py_DECREF(frame);
+ return;
}
-
- Py_XDECREF(f_lineno);
- Py_XDECREF(f_code);
- Py_DECREF(frame);
}
+ Py_XDECREF(f_lineno);
+ Py_XDECREF(f_code);
+ Py_DECREF(frame);
}
- PyErr_Clear();
- printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n");
+
}
+ PyErr_Clear();
+ printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n");
+}
+
+void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* new_way)
+{
+ printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way);
+ PyDebugLine();
}
void PyObjectPlus::ClearDeprecationWarning()
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index a18df9d36a9..f9edb7877b0 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -51,44 +51,6 @@ extern "C" {
}
#endif
-extern "C" {
-#include "../../blender/python/intern/bpy_compat.h"
-}
-
-
-/*
- Py_RETURN_NONE
- Python 2.4 macro.
- defined here until we switch to 2.4
- also in api2_2x/gen_utils.h
-*/
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
-#endif
-#ifndef Py_RETURN_FALSE
-#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
-#endif
-#ifndef Py_RETURN_TRUE
-#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
-#endif
-
-/* for pre Py 2.5 */
-#if PY_VERSION_HEX < 0x02050000
-typedef int Py_ssize_t;
-typedef Py_ssize_t (*lenfunc)(PyObject *);
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#define PY_METHODCHAR char *
-#else
-/* Py 2.5 and later */
-#define intargfunc ssizeargfunc
-#define intintargfunc ssizessizeargfunc
-#define PY_METHODCHAR const char *
-#endif
-
-#include "descrobject.h"
-
-
static inline void Py_Fatal(const char *M) {
fprintf(stderr, "%s\n", M);
exit(-1);
@@ -124,7 +86,7 @@ typedef struct {
-typedef struct {
+typedef struct PyObjectPlus_Proxy {
PyObject_HEAD /* required python macro */
class PyObjectPlus *ref;
bool py_owns;
@@ -137,10 +99,13 @@ typedef struct {
/* Note, sometimes we dont care what BGE type this is as long as its a proxy */
#define BGE_PROXY_CHECK_TYPE(_type) ((_type)->tp_dealloc == PyObjectPlus::py_base_dealloc)
+/* Opposite of BGE_PROXY_REF */
+#define BGE_PROXY_FROM_REF(_self) (((PyObjectPlus *)_self)->GetProxy())
+
// This must be the first line of each
// PyC++ class
-#define Py_Header \
+#define __Py_Header \
public: \
static PyTypeObject Type; \
static PyMethodDef Methods[]; \
@@ -149,6 +114,16 @@ typedef struct {
virtual PyObject *GetProxy() {return GetProxy_Ext(this, &Type);}; \
virtual PyObject *NewProxy(bool py_owns) {return NewProxy_Ext(this, &Type, py_owns);}; \
+
+#ifdef WITH_CXX_GUARDEDALLOC
+#define Py_Header __Py_Header \
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \
+ void operator delete( void *mem ) { MEM_freeN(mem); } \
+
+#else
+#define Py_Header __Py_Header
+#endif
+
/*
* nonzero values are an error for setattr
* however because of the nested lookups we need to know if the errors
@@ -230,13 +205,13 @@ typedef struct {
* Method table macro (with doc)
*/
#define KX_PYMETHODTABLE(class_name, method_name) \
- {#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (PY_METHODCHAR)class_name::method_name##_doc}
+ {#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (const char *)class_name::method_name##_doc}
#define KX_PYMETHODTABLE_O(class_name, method_name) \
- {#method_name , (PyCFunction) class_name::sPy##method_name, METH_O, (PY_METHODCHAR)class_name::method_name##_doc}
+ {#method_name , (PyCFunction) class_name::sPy##method_name, METH_O, (const char *)class_name::method_name##_doc}
#define KX_PYMETHODTABLE_NOARGS(class_name, method_name) \
- {#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (PY_METHODCHAR)class_name::method_name##_doc}
+ {#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (const char *)class_name::method_name##_doc}
/**
* Function implementation macro
diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript
index 69f87ffbb90..cbf33f39568 100644
--- a/source/gameengine/Expressions/SConscript
+++ b/source/gameengine/Expressions/SConscript
@@ -6,10 +6,4 @@ sources = env.Glob('*.cpp')
incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader'
incs += ' ' + env['BF_PYTHON_INC']
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,120], cxx_compileflags=cxxflags)
+env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core'], priority = [360], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h
index c580e8fd23a..069eb8d9c24 100644
--- a/source/gameengine/Expressions/StringValue.h
+++ b/source/gameengine/Expressions/StringValue.h
@@ -46,6 +46,13 @@ public:
private:
// data member
STR_String m_strString;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp
index d8c81f56f66..130317d77e2 100644
--- a/source/gameengine/Expressions/Value.cpp
+++ b/source/gameengine/Expressions/Value.cpp
@@ -36,13 +36,7 @@ double CValue::m_sZeroVec[3] = {0.0,0.0,0.0};
#ifndef NO_EXP_PYTHON_EMBEDDING
PyTypeObject CValue::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"CValue",
sizeof(PyObjectPlus_Proxy),
0,
@@ -68,17 +62,9 @@ PyTypeObject CValue::Type = {
};
PyMethodDef CValue::Methods[] = {
- { "getName", (PyCFunction) CValue::sPyGetName, METH_NOARGS},
{NULL,NULL} //Sentinel
};
-PyObject* CValue::PyGetName()
-{
- ShowDeprecationWarning("getName()", "the name property");
-
- return PyUnicode_FromString(this->GetName());
-}
-
/*#define CVALUE_DEBUG*/
#ifdef CVALUE_DEBUG
int gRefCount;
@@ -543,13 +529,6 @@ CValue* CValue::FindIdentifier(const STR_String& identifiername)
#ifndef NO_EXP_PYTHON_EMBEDDING
-
-static PyMethodDef CValueMethods[] =
-{
- //{ "new", CValue::PyMake , METH_VARARGS},
- { NULL,NULL} // Sentinel
-};
-
PyAttributeDef CValue::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("name", CValue, pyattr_get_name),
{ NULL } //Sentinel
@@ -601,12 +580,6 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
{
vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) );
} else
-#if PY_VERSION_HEX < 0x03000000
- if (PyInt_Check(pyobj))
- {
- vallie = new CIntValue( (cInt)PyInt_AS_LONG(pyobj) );
- } else
-#endif
if (PyLong_Check(pyobj))
{
vallie = new CIntValue( (cInt)PyLong_AsLongLong(pyobj) );
diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h
index 8c9f99b335e..7d4adcdb64f 100644
--- a/source/gameengine/Expressions/Value.h
+++ b/source/gameengine/Expressions/Value.h
@@ -42,6 +42,10 @@
#include <map> // array functionality for the propertylist
#include "STR_String.h" // STR_String class
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
#ifndef GEN_NO_ASSERT
#undef assert
#define assert(exp) ((void)NULL)
@@ -173,6 +177,13 @@ public:
virtual ~CAction(){
};
virtual void Execute() const =0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
//
@@ -231,8 +242,6 @@ public:
static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
virtual PyObject* ConvertKeysToPython( void );
-
- KX_PYMETHOD_NOARGS(CValue,GetName);
#else
CValue();
@@ -407,7 +416,6 @@ public: \
class CPropValue : public CValue
{
public:
-
#ifndef NO_EXP_PYTHON_EMBEDDING
CPropValue() :
CValue(),
@@ -436,6 +444,13 @@ public:
protected:
STR_String m_strNewName; // Identification
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _VALUEBASECLASS_H
diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h
index 19c7dd30076..49fb1e7ea08 100644
--- a/source/gameengine/Expressions/VectorValue.h
+++ b/source/gameengine/Expressions/VectorValue.h
@@ -79,6 +79,13 @@ public:
protected:
double m_vec[3];
double m_transformedvec[3];
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _VECTORVALUE_H
diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h
index 10a6ff9ad3d..50ec4ff1ee7 100644
--- a/source/gameengine/Expressions/VoidValue.h
+++ b/source/gameengine/Expressions/VoidValue.h
@@ -59,6 +59,13 @@ public:
/// Data members
bool m_bDeleteOnDestruct;
void* m_pAnything;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // !defined _VOIDVALUE_H
diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt
index 530664dce55..a1dce49e14b 100644
--- a/source/gameengine/GameLogic/CMakeLists.txt
+++ b/source/gameengine/GameLogic/CMakeLists.txt
@@ -38,7 +38,7 @@ SET(INC
)
IF(WITH_SDL)
- SET(INC ${INC} ${SDL_INC})
+ SET(INC ${INC} ${SDL_INCLUDE_DIR})
ELSE(WITH_SDL)
ADD_DEFINITIONS(-DDISABLE_SDL)
ENDIF(WITH_SDL)
diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
index 04d46e259d3..9dfb5ddc38f 100644
--- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
@@ -107,31 +107,25 @@ void SCA_2DFilterActuator::SetShaderText(const char *text)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_2DFilterActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "SCA_2DFilterActuator",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IActuator::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "SCA_2DFilterActuator",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IActuator::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef SCA_2DFilterActuator::Methods[] = {
diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp
index 78e1350428e..ac9e238bd64 100644
--- a/source/gameengine/GameLogic/SCA_ANDController.cpp
+++ b/source/gameengine/GameLogic/SCA_ANDController.cpp
@@ -99,13 +99,7 @@ CValue* SCA_ANDController::GetReplica()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_ANDController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_ANDController",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
index a7d61627c23..f3884c87a75 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
+++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
@@ -45,6 +45,13 @@ public:
virtual void NextFrame();
virtual void UpdateFrame();
//SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ActuatorEventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_ACTUATOREVENTMANAGER
diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
index bdcc923e1d9..428362a0a24 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
@@ -121,13 +121,7 @@ void SCA_ActuatorSensor::Update()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_ActuatorSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_ActuatorSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -149,10 +143,6 @@ PyTypeObject SCA_ActuatorSensor::Type = {
};
PyMethodDef SCA_ActuatorSensor::Methods[] = {
- //Deprecated functions ------>
- {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_NOARGS, (PY_METHODCHAR)GetActuator_doc},
- {"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, (PY_METHODCHAR)SetActuator_doc},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -173,41 +163,4 @@ int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*)
return 1;
}
-/* 3. getActuator */
-const char SCA_ActuatorSensor::GetActuator_doc[] =
-"getActuator()\n"
-"\tReturn the Actuator with which the sensor operates.\n";
-PyObject* SCA_ActuatorSensor::PyGetActuator()
-{
- ShowDeprecationWarning("getActuator()", "the actuator property");
- return PyUnicode_FromString(m_checkactname);
-}
-
-/* 4. setActuator */
-const char SCA_ActuatorSensor::SetActuator_doc[] =
-"setActuator(name)\n"
-"\t- name: string\n"
-"\tSets the Actuator with which to operate. If there is no Actuator\n"
-"\tof this name, the call is ignored.\n";
-PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* args)
-{
- ShowDeprecationWarning("setActuator()", "the actuator property");
- /* We should query whether the name exists. Or should we create a prop */
- /* on the fly? */
- char *actNameArg = NULL;
-
- if (!PyArg_ParseTuple(args, "s:setActuator", &actNameArg)) {
- return NULL;
- }
-
- SCA_IActuator* act = GetParent()->FindActuator(STR_String(actNameArg));
- if (act) {
- m_checkactname = actNameArg;
- m_actuator = act;
- } else {
- ; /* error: bad actuator name */
- }
- Py_RETURN_NONE;
-}
-
/* eof */
diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h
index cf8e735cad4..1a095148500 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h
+++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h
@@ -59,11 +59,6 @@ public:
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
-
- /* 3. setProperty */
- KX_PYMETHOD_DOC_VARARGS(SCA_ActuatorSensor,SetActuator);
- /* 4. getProperty */
- KX_PYMETHOD_DOC_NOARGS(SCA_ActuatorSensor,GetActuator);
static int CheckActuator(void *self, const PyAttributeDef*);
};
diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
index a619eecddd4..9540e3b71f6 100644
--- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
+++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
@@ -41,6 +41,11 @@ public:
virtual void NextFrame();
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_AlwaysEventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_ALWAYSEVENTMGR
diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
index ddb54c580b8..35b035f6466 100644
--- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
@@ -104,13 +104,7 @@ bool SCA_AlwaysSensor::Evaluate()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_AlwaysSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_AlwaysSensor",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp
index 11c6996a0a1..0f67ddd56a5 100644
--- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp
+++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp
@@ -130,13 +130,7 @@ bool SCA_DelaySensor::Evaluate()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_DelaySensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_DelaySensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -158,16 +152,6 @@ PyTypeObject SCA_DelaySensor::Type = {
};
PyMethodDef SCA_DelaySensor::Methods[] = {
- //Deprecated functions ------>
- /* setProperty */
- {"setDelay", (PyCFunction) SCA_DelaySensor::sPySetDelay, METH_VARARGS, (PY_METHODCHAR)SetDelay_doc},
- {"setDuration", (PyCFunction) SCA_DelaySensor::sPySetDuration, METH_VARARGS, (PY_METHODCHAR)SetDuration_doc},
- {"setRepeat", (PyCFunction) SCA_DelaySensor::sPySetRepeat, METH_VARARGS, (PY_METHODCHAR)SetRepeat_doc},
- /* getProperty */
- {"getDelay", (PyCFunction) SCA_DelaySensor::sPyGetDelay, METH_NOARGS, (PY_METHODCHAR)GetDelay_doc},
- {"getDuration", (PyCFunction) SCA_DelaySensor::sPyGetDuration, METH_NOARGS, (PY_METHODCHAR)GetDuration_doc},
- {"getRepeat", (PyCFunction) SCA_DelaySensor::sPyGetRepeat, METH_NOARGS, (PY_METHODCHAR)GetRepeat_doc},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -178,91 +162,4 @@ PyAttributeDef SCA_DelaySensor::Attributes[] = {
{ NULL } //Sentinel
};
-const char SCA_DelaySensor::SetDelay_doc[] =
-"setDelay(delay)\n"
-"\t- delay: length of the initial OFF period as number of frame\n"
-"\t 0 for immediate trigger\n"
-"\tSet the initial delay before the positive trigger\n";
-PyObject* SCA_DelaySensor::PySetDelay(PyObject* args)
-{
- ShowDeprecationWarning("setDelay()", "the delay property");
- int delay;
-
- if(!PyArg_ParseTuple(args, "i:setDelay", &delay)) {
- return NULL;
- }
- if (delay < 0) {
- PyErr_SetString(PyExc_ValueError, "Delay cannot be negative");
- return NULL;
- }
- m_delay = delay;
- Py_RETURN_NONE;
-}
-
-const char SCA_DelaySensor::SetDuration_doc[] =
-"setDuration(duration)\n"
-"\t- duration: length of the ON period in number of frame after the initial off period\n"
-"\t 0 for no ON period\n"
-"\tSet the duration of the ON pulse after initial delay.\n"
-"\tIf > 0, a negative trigger is fired at the end of the ON pulse.\n";
-PyObject* SCA_DelaySensor::PySetDuration(PyObject* args)
-{
- ShowDeprecationWarning("setDuration()", "the duration property");
- int duration;
-
- if(!PyArg_ParseTuple(args, "i:setDuration", &duration)) {
- return NULL;
- }
- if (duration < 0) {
- PyErr_SetString(PyExc_ValueError, "Duration cannot be negative");
- return NULL;
- }
- m_duration = duration;
- Py_RETURN_NONE;
-}
-
-const char SCA_DelaySensor::SetRepeat_doc[] =
-"setRepeat(repeat)\n"
-"\t- repeat: 1 if the initial OFF-ON cycle should be repeated indefinately\n"
-"\t 0 if the initial OFF-ON cycle should run only once\n"
-"\tSet the sensor repeat mode\n";
-PyObject* SCA_DelaySensor::PySetRepeat(PyObject* args)
-{
- ShowDeprecationWarning("setRepeat()", "the repeat property");
- int repeat;
-
- if(!PyArg_ParseTuple(args, "i:setRepeat", &repeat)) {
- return NULL;
- }
- m_repeat = (repeat != 0);
- Py_RETURN_NONE;
-}
-
-const char SCA_DelaySensor::GetDelay_doc[] =
-"getDelay()\n"
-"\tReturn the delay parameter value\n";
-PyObject* SCA_DelaySensor::PyGetDelay()
-{
- ShowDeprecationWarning("getDelay()", "the delay property");
- return PyLong_FromSsize_t(m_delay);
-}
-
-const char SCA_DelaySensor::GetDuration_doc[] =
-"getDuration()\n"
-"\tReturn the duration parameter value\n";
-PyObject* SCA_DelaySensor::PyGetDuration()
-{
- ShowDeprecationWarning("getDuration()", "the duration property");
- return PyLong_FromSsize_t(m_duration);
-}
-
-const char SCA_DelaySensor::GetRepeat_doc[] =
-"getRepeat()\n"
-"\tReturn the repeat parameter value\n";
-PyObject* SCA_DelaySensor::PyGetRepeat()
-{
- ShowDeprecationWarning("getRepeat()", "the repeat property");
- return BoolToPyArg(m_repeat);
-}
-
/* eof */
diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h
index 8270e8959b7..187a9179b5d 100644
--- a/source/gameengine/GameLogic/SCA_DelaySensor.h
+++ b/source/gameengine/GameLogic/SCA_DelaySensor.h
@@ -59,14 +59,6 @@ public:
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- /* setProperty */
- KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay);
- KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDuration);
- KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetRepeat);
- /* getProperty */
- KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay);
- KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration);
- KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetRepeat);
};
diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h
index 5ff55849bfe..424150ffa63 100644
--- a/source/gameengine/GameLogic/SCA_EventManager.h
+++ b/source/gameengine/GameLogic/SCA_EventManager.h
@@ -71,6 +71,13 @@ public:
protected:
EVENT_MANAGER_TYPE m_mgrtype;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_EventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h
index 705f6dfc415..4c1dfcb95a2 100644
--- a/source/gameengine/GameLogic/SCA_ExpressionController.h
+++ b/source/gameengine/GameLogic/SCA_ExpressionController.h
@@ -53,6 +53,13 @@ public:
* so that self references are removed before the controller itself is released
*/
virtual void Delete();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ExpressionController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_EXPRESSIONCONTROLLER
diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h
index 13c718ee837..00ba8c9ce4e 100644
--- a/source/gameengine/GameLogic/SCA_IActuator.h
+++ b/source/gameengine/GameLogic/SCA_IActuator.h
@@ -127,6 +127,13 @@ public:
void IncLink() { m_links++; }
void DecLink();
bool IsNoLink() const { return !m_links; }
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IActuator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_IACTUATOR
diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp
index 7cbb728753a..7cfd2adc1d0 100644
--- a/source/gameengine/GameLogic/SCA_IController.cpp
+++ b/source/gameengine/GameLogic/SCA_IController.cpp
@@ -199,41 +199,28 @@ void SCA_IController::ApplyState(unsigned int state)
/* Python api */
PyTypeObject SCA_IController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "SCA_IController",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_ILogicBrick::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "SCA_IController",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_ILogicBrick::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef SCA_IController::Methods[] = {
- //Deprecated functions ------>
- {"getSensor", (PyCFunction) SCA_IController::sPyGetSensor, METH_O},
- {"getActuator", (PyCFunction) SCA_IController::sPyGetActuator, METH_O},
- {"getSensors", (PyCFunction) SCA_IController::sPyGetSensors, METH_NOARGS},
- {"getActuators", (PyCFunction) SCA_IController::sPyGetActuators, METH_NOARGS},
- {"getState", (PyCFunction) SCA_IController::sPyGetState, METH_NOARGS},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -245,85 +232,6 @@ PyAttributeDef SCA_IController::Attributes[] = {
{ NULL } //Sentinel
};
-PyObject* SCA_IController::PyGetActuators()
-{
- ShowDeprecationWarning("getActuators()", "the actuators property");
-
- PyObject* resultlist = PyList_New(m_linkedactuators.size());
- for (unsigned int index=0;index<m_linkedactuators.size();index++)
- {
- PyList_SET_ITEM(resultlist,index, m_linkedactuators[index]->GetProxy());
- }
-
- return resultlist;
-}
-
-PyObject* SCA_IController::PyGetSensor(PyObject* value)
-{
- ShowDeprecationWarning("getSensor(string)", "the sensors[string] property");
-
- char *scriptArg = _PyUnicode_AsString(value);
- if (scriptArg==NULL) {
- PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)");
- return NULL;
- }
-
- for (unsigned int index=0;index<m_linkedsensors.size();index++)
- {
- SCA_ISensor* sensor = m_linkedsensors[index];
- STR_String& realname = sensor->GetName();
- if (realname == scriptArg)
- {
- return sensor->GetProxy();
- }
- }
-
- PyErr_Format(PyExc_AttributeError, "controller.getSensor(string): Python Controller, unable to find requested sensor \"%s\"", scriptArg);
- return NULL;
-}
-
-PyObject* SCA_IController::PyGetActuator(PyObject* value)
-{
- ShowDeprecationWarning("getActuator(string)", "the actuators[string] property");
-
- char *scriptArg = _PyUnicode_AsString(value);
- if (scriptArg==NULL) {
- PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)");
- return NULL;
- }
-
- for (unsigned int index=0;index<m_linkedactuators.size();index++)
- {
- SCA_IActuator* actua = m_linkedactuators[index];
- if (actua->GetName() == scriptArg)
- {
- return actua->GetProxy();
- }
- }
-
- PyErr_Format(PyExc_AttributeError, "controller.getActuator(string): Python Controller, unable to find requested actuator \"%s\"", scriptArg);
- return NULL;
-}
-
-PyObject* SCA_IController::PyGetSensors()
-{
- ShowDeprecationWarning("getSensors()", "the sensors property");
-
- PyObject* resultlist = PyList_New(m_linkedsensors.size());
- for (unsigned int index=0;index<m_linkedsensors.size();index++)
- {
- PyList_SET_ITEM(resultlist,index, m_linkedsensors[index]->GetProxy());
- }
-
- return resultlist;
-}
-
-PyObject* SCA_IController::PyGetState()
-{
- ShowDeprecationWarning("getState()", "the state property");
- return PyLong_FromSsize_t(m_statemask);
-}
-
PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_IController* self= static_cast<SCA_IController*>(self_v);
diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h
index 523878bee26..202921c6986 100644
--- a/source/gameengine/GameLogic/SCA_IController.h
+++ b/source/gameengine/GameLogic/SCA_IController.h
@@ -97,12 +97,6 @@ public:
}
}
}
-
- KX_PYMETHOD_NOARGS(SCA_IController,GetSensors);
- KX_PYMETHOD_NOARGS(SCA_IController,GetActuators);
- KX_PYMETHOD_O(SCA_IController,GetSensor);
- KX_PYMETHOD_O(SCA_IController,GetActuator);
- KX_PYMETHOD_NOARGS(SCA_IController,GetState);
static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h
index a0d77ed3c03..228d7684b0f 100644
--- a/source/gameengine/GameLogic/SCA_IInputDevice.h
+++ b/source/gameengine/GameLogic/SCA_IInputDevice.h
@@ -33,6 +33,10 @@
#ifndef KX_INPUTDEVICE_H
#define KX_INPUTDEVICE_H
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class SCA_InputEvent
{
@@ -302,6 +306,12 @@ public:
*/
virtual void NextFrame();
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_InputEvent"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //KX_INPUTDEVICE_H
diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
index ccb79a2d49f..f679d0ee487 100644
--- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
+++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
@@ -177,13 +177,7 @@ CValue* SCA_ILogicBrick::GetEvent()
/* python stuff */
PyTypeObject SCA_ILogicBrick::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_ILogicBrick",
sizeof(PyObjectPlus_Proxy),
0,
@@ -205,11 +199,6 @@ PyTypeObject SCA_ILogicBrick::Type = {
};
PyMethodDef SCA_ILogicBrick::Methods[] = {
- // --> Deprecated
- {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_NOARGS},
- {"getExecutePriority", (PyCFunction) SCA_ILogicBrick::sPyGetExecutePriority, METH_NOARGS},
- {"setExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_VARARGS},
- // <-- Deprecated
{NULL,NULL} //Sentinel
};
@@ -238,46 +227,6 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef)
return 0;
}
-PyObject* SCA_ILogicBrick::PyGetOwner()
-{
- ShowDeprecationWarning("getOwner()", "the owner property");
-
- CValue* parent = GetParent();
- if (parent)
- {
- return parent->GetProxy();
- }
-
- printf("ERROR: Python scriptblock without owner\n");
- Py_RETURN_NONE; //Int_FromLong(IsPositiveTrigger());
-}
-
-
-
-PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args)
-{
- ShowDeprecationWarning("setExecutePriority()", "the executePriority property");
-
- int priority=0;
-
- if (!PyArg_ParseTuple(args, "i:setExecutePriority", &priority)) {
- return NULL;
- }
-
- m_Execute_Priority = priority;
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* SCA_ILogicBrick::PyGetExecutePriority()
-{
- ShowDeprecationWarning("getExecutePriority()", "the executePriority property");
- return PyLong_FromSsize_t(m_Execute_Priority);
-}
-
-
/*Attribute functions */
PyObject* SCA_ILogicBrick::pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h
index 50679856802..ac533335f0b 100644
--- a/source/gameengine/GameLogic/SCA_ILogicBrick.h
+++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h
@@ -126,10 +126,6 @@ public:
// python methods
-
- KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetOwner);
- KX_PYMETHOD_VARARGS(SCA_ILogicBrick,SetExecutePriority);
- KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetExecutePriority);
static PyObject* pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp
index 6cd11f9e553..2bffd029bd4 100644
--- a/source/gameengine/GameLogic/SCA_IObject.cpp
+++ b/source/gameengine/GameLogic/SCA_IObject.cpp
@@ -288,13 +288,7 @@ void SCA_IObject::SetState(unsigned int state)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_IObject::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_IObject",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SCA_IScene.h b/source/gameengine/GameLogic/SCA_IScene.h
index b641efc6ee1..ced9ca94cec 100644
--- a/source/gameengine/GameLogic/SCA_IScene.h
+++ b/source/gameengine/GameLogic/SCA_IScene.h
@@ -33,6 +33,10 @@
#include "STR_String.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
struct SCA_DebugProp
{
class CValue* m_obj;
@@ -55,11 +59,18 @@ public:
//virtual void DelayedReleaseObject(class CValue* gameobj)=0;
virtual void ReplaceMesh(class CValue* gameobj,
- void* meshobj)=0;
+ void* meshobj, bool use_gfx, bool use_phys)=0;
std::vector<SCA_DebugProp*>& GetDebugProperties();
void AddDebugProperty(class CValue* debugprop,
const STR_String &name);
void RemoveAllDebugProperties();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IScene"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_ISCENE_H
diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp
index 4c1e0bd01c4..497a5d1095a 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.cpp
+++ b/source/gameengine/GameLogic/SCA_ISensor.cpp
@@ -292,171 +292,6 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr)
/* Python Functions */
/* ----------------------------------------------- */
-//Deprecated Functions ------>
-const char SCA_ISensor::IsPositive_doc[] =
-"isPositive()\n"
-"\tReturns whether the sensor is in an active state.\n";
-PyObject* SCA_ISensor::PyIsPositive()
-{
- ShowDeprecationWarning("isPositive()", "the read-only positive property");
- int retval = GetState();
- return PyLong_FromSsize_t(retval);
-}
-
-const char SCA_ISensor::IsTriggered_doc[] =
-"isTriggered()\n"
-"\tReturns whether the sensor has triggered the current controller.\n";
-PyObject* SCA_ISensor::PyIsTriggered()
-{
- ShowDeprecationWarning("isTriggered()", "the read-only triggered property");
- // check with the current controller
- int retval = 0;
- if (SCA_PythonController::m_sCurrentController)
- retval = SCA_PythonController::m_sCurrentController->IsTriggered(this);
- return PyLong_FromSsize_t(retval);
-}
-
-/**
- * getUsePulseMode: getter for the pulse mode (KX_TRUE = on)
- */
-const char SCA_ISensor::GetUsePosPulseMode_doc[] =
-"getUsePosPulseMode()\n"
-"\tReturns whether positive pulse mode is active.\n";
-PyObject* SCA_ISensor::PyGetUsePosPulseMode()
-{
- ShowDeprecationWarning("getUsePosPulseMode()", "the usePosPulseMode property");
- return BoolToPyArg(m_pos_pulsemode);
-}
-
-/**
- * setUsePulseMode: setter for the pulse mode (KX_TRUE = on)
- */
-const char SCA_ISensor::SetUsePosPulseMode_doc[] =
-"setUsePosPulseMode(pulse?)\n"
-"\t - pulse? : Pulse when a positive event occurs?\n"
-"\t (KX_TRUE, KX_FALSE)\n"
-"\tSet whether to do pulsing when positive pulses occur.\n";
-PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* args)
-{
- ShowDeprecationWarning("setUsePosPulseMode()", "the usePosPulseMode property");
- int pyarg = 0;
- if(!PyArg_ParseTuple(args, "i:setUsePosPulseMode", &pyarg)) { return NULL; }
- m_pos_pulsemode = PyArgToBool(pyarg);
- Py_RETURN_NONE;
-}
-
-/**
- * getFrequency: getter for the pulse mode interval
- */
-const char SCA_ISensor::GetFrequency_doc[] =
-"getFrequency()\n"
-"\tReturns the frequency of the updates in pulse mode.\n" ;
-PyObject* SCA_ISensor::PyGetFrequency()
-{
- ShowDeprecationWarning("getFrequency()", "the frequency property");
- return PyLong_FromSsize_t(m_pulse_frequency);
-}
-
-/**
- * setFrequency: setter for the pulse mode (KX_TRUE = on)
- */
-const char SCA_ISensor::SetFrequency_doc[] =
-"setFrequency(pulse_frequency)\n"
-"\t- pulse_frequency: The frequency of the updates in pulse mode (integer)"
-"\tSet the frequency of the updates in pulse mode.\n"
-"\tIf the frequency is negative, it is set to 0.\n" ;
-PyObject* SCA_ISensor::PySetFrequency(PyObject* args)
-{
- ShowDeprecationWarning("setFrequency()", "the frequency property");
- int pulse_frequencyArg = 0;
-
- if(!PyArg_ParseTuple(args, "i:setFrequency", &pulse_frequencyArg)) {
- return NULL;
- }
-
- /* We can do three things here: clip, ignore and raise an exception. */
- /* Exceptions don't work yet, ignoring is not desirable now... */
- if (pulse_frequencyArg < 0) {
- pulse_frequencyArg = 0;
- };
- m_pulse_frequency = pulse_frequencyArg;
-
- Py_RETURN_NONE;
-}
-
-
-const char SCA_ISensor::GetInvert_doc[] =
-"getInvert()\n"
-"\tReturns whether or not pulses from this sensor are inverted.\n" ;
-PyObject* SCA_ISensor::PyGetInvert()
-{
- ShowDeprecationWarning("getInvert()", "the invert property");
- return BoolToPyArg(m_invert);
-}
-
-const char SCA_ISensor::SetInvert_doc[] =
-"setInvert(invert?)\n"
-"\t- invert?: Invert the event-values? (KX_TRUE, KX_FALSE)\n"
-"\tSet whether to invert pulses.\n";
-PyObject* SCA_ISensor::PySetInvert(PyObject* args)
-{
- ShowDeprecationWarning("setInvert()", "the invert property");
- int pyarg = 0;
- if(!PyArg_ParseTuple(args, "i:setInvert", &pyarg)) { return NULL; }
- m_invert = PyArgToBool(pyarg);
- Py_RETURN_NONE;
-}
-
-const char SCA_ISensor::GetLevel_doc[] =
-"getLevel()\n"
-"\tReturns whether this sensor is a level detector or a edge detector.\n"
-"\tIt makes a difference only in case of logic state transition (state actuator).\n"
-"\tA level detector will immediately generate a pulse, negative or positive\n"
-"\tdepending on the sensor condition, as soon as the state is activated.\n"
-"\tA edge detector will wait for a state change before generating a pulse.\n";
-PyObject* SCA_ISensor::PyGetLevel()
-{
- ShowDeprecationWarning("getLevel()", "the level property");
- return BoolToPyArg(m_level);
-}
-
-const char SCA_ISensor::SetLevel_doc[] =
-"setLevel(level?)\n"
-"\t- level?: Detect level instead of edge? (KX_TRUE, KX_FALSE)\n"
-"\tSet whether to detect level or edge transition when entering a state.\n";
-PyObject* SCA_ISensor::PySetLevel(PyObject* args)
-{
- ShowDeprecationWarning("setLevel()", "the level property");
- int pyarg = 0;
- if(!PyArg_ParseTuple(args, "i:setLevel", &pyarg)) { return NULL; }
- m_level = PyArgToBool(pyarg);
- Py_RETURN_NONE;
-}
-
-const char SCA_ISensor::GetUseNegPulseMode_doc[] =
-"getUseNegPulseMode()\n"
-"\tReturns whether negative pulse mode is active.\n";
-PyObject* SCA_ISensor::PyGetUseNegPulseMode()
-{
- ShowDeprecationWarning("getUseNegPulseMode()", "the useNegPulseMode property");
- return BoolToPyArg(m_neg_pulsemode);
-}
-
-const char SCA_ISensor::SetUseNegPulseMode_doc[] =
-"setUseNegPulseMode(pulse?)\n"
-"\t - pulse? : Pulse when a negative event occurs?\n"
-"\t (KX_TRUE, KX_FALSE)\n"
-"\tSet whether to do pulsing when negative pulses occur.\n";
-PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* args)
-{
- ShowDeprecationWarning("setUseNegPulseMode()", "the useNegPulseMode property");
- int pyarg = 0;
- if(!PyArg_ParseTuple(args, "i:setUseNegPulseMode", &pyarg)) { return NULL; }
- m_neg_pulsemode = PyArgToBool(pyarg);
- Py_RETURN_NONE;
-}
-//<------Deprecated
-
KX_PYMETHODDEF_DOC_NOARGS(SCA_ISensor, reset,
"reset()\n"
"\tReset sensor internal state, effect depends on the type of sensor and settings.\n"
@@ -472,13 +307,7 @@ KX_PYMETHODDEF_DOC_NOARGS(SCA_ISensor, reset,
/* ----------------------------------------------- */
PyTypeObject SCA_ISensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_ISensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -500,32 +329,6 @@ PyTypeObject SCA_ISensor::Type = {
};
PyMethodDef SCA_ISensor::Methods[] = {
- //Deprecated functions ----->
- {"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive,
- METH_NOARGS, (PY_METHODCHAR)IsPositive_doc},
- {"isTriggered", (PyCFunction) SCA_ISensor::sPyIsTriggered,
- METH_VARARGS, (PY_METHODCHAR)IsTriggered_doc},
- {"getUsePosPulseMode", (PyCFunction) SCA_ISensor::sPyGetUsePosPulseMode,
- METH_NOARGS, (PY_METHODCHAR)GetUsePosPulseMode_doc},
- {"setUsePosPulseMode", (PyCFunction) SCA_ISensor::sPySetUsePosPulseMode,
- METH_VARARGS, (PY_METHODCHAR)SetUsePosPulseMode_doc},
- {"getFrequency", (PyCFunction) SCA_ISensor::sPyGetFrequency,
- METH_NOARGS, (PY_METHODCHAR)GetFrequency_doc},
- {"setFrequency", (PyCFunction) SCA_ISensor::sPySetFrequency,
- METH_VARARGS, (PY_METHODCHAR)SetFrequency_doc},
- {"getUseNegPulseMode", (PyCFunction) SCA_ISensor::sPyGetUseNegPulseMode,
- METH_NOARGS, (PY_METHODCHAR)GetUseNegPulseMode_doc},
- {"setUseNegPulseMode", (PyCFunction) SCA_ISensor::sPySetUseNegPulseMode,
- METH_VARARGS, (PY_METHODCHAR)SetUseNegPulseMode_doc},
- {"getInvert", (PyCFunction) SCA_ISensor::sPyGetInvert,
- METH_NOARGS, (PY_METHODCHAR)GetInvert_doc},
- {"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert,
- METH_VARARGS, (PY_METHODCHAR)SetInvert_doc},
- {"getLevel", (PyCFunction) SCA_ISensor::sPyGetLevel,
- METH_NOARGS, (PY_METHODCHAR)GetLevel_doc},
- {"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel,
- METH_VARARGS, (PY_METHODCHAR)SetLevel_doc},
- //<----- Deprecated
KX_PYMETHODTABLE_NOARGS(SCA_ISensor, reset),
{NULL,NULL} //Sentinel
};
diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h
index 81864ab6a34..742b05bd88b 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.h
+++ b/source/gameengine/GameLogic/SCA_ISensor.h
@@ -172,21 +172,6 @@ public:
{ return !m_links; }
/* Python functions: */
-
- //Deprecated functions ----->
- KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive);
- KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsTriggered);
- KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUsePosPulseMode);
- KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUsePosPulseMode);
- KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetFrequency);
- KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetFrequency);
- KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUseNegPulseMode);
- KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUseNegPulseMode);
- KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetInvert);
- KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetInvert);
- KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel);
- KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetLevel);
- //<------
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset);
static PyObject* pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.h b/source/gameengine/GameLogic/SCA_JoystickManager.h
index d3a7ac95bea..be55e95b033 100644
--- a/source/gameengine/GameLogic/SCA_JoystickManager.h
+++ b/source/gameengine/GameLogic/SCA_JoystickManager.h
@@ -47,6 +47,12 @@ public:
virtual void NextFrame(double curtime,double deltatime);
SCA_Joystick* GetJoystickDevice(short int joyindex);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_JoystickManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
index f55921e648b..4936b380352 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
@@ -48,7 +48,6 @@ SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr,
int button,
int hat, int hatf, bool allevents)
:SCA_ISensor(gameobj,eventmgr),
- m_pJoystickMgr(eventmgr),
m_axis(axis),
m_axisf(axisf),
m_button(button),
@@ -103,7 +102,7 @@ bool SCA_JoystickSensor::IsPositiveTrigger()
bool SCA_JoystickSensor::Evaluate()
{
- SCA_Joystick *js = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ SCA_Joystick *js = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
bool result = false;
bool reset = m_reset && m_level;
@@ -252,54 +251,30 @@ bool SCA_JoystickSensor::isValid(SCA_JoystickSensor::KX_JOYSENSORMODE m)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_JoystickSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "SCA_JoystickSensor",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_ISensor::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "SCA_JoystickSensor",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_ISensor::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef SCA_JoystickSensor::Methods[] = {
- //Deprecated functions ------>
- {"getIndex", (PyCFunction) SCA_JoystickSensor::sPyGetIndex, METH_NOARGS, (PY_METHODCHAR)GetIndex_doc},
- {"setIndex", (PyCFunction) SCA_JoystickSensor::sPySetIndex, METH_O, (PY_METHODCHAR)SetIndex_doc},
- {"getAxis", (PyCFunction) SCA_JoystickSensor::sPyGetAxis, METH_NOARGS, (PY_METHODCHAR)GetAxis_doc},
- {"setAxis", (PyCFunction) SCA_JoystickSensor::sPySetAxis, METH_VARARGS, (PY_METHODCHAR)SetAxis_doc},
- {"getAxisValue", (PyCFunction) SCA_JoystickSensor::sPyGetAxisValue, METH_NOARGS, (PY_METHODCHAR)GetAxisValue_doc},
- {"getThreshold", (PyCFunction) SCA_JoystickSensor::sPyGetThreshold, METH_NOARGS, (PY_METHODCHAR)GetThreshold_doc},
- {"setThreshold", (PyCFunction) SCA_JoystickSensor::sPySetThreshold, METH_VARARGS, (PY_METHODCHAR)SetThreshold_doc},
- {"getButton", (PyCFunction) SCA_JoystickSensor::sPyGetButton, METH_NOARGS, (PY_METHODCHAR)GetButton_doc},
- {"setButton", (PyCFunction) SCA_JoystickSensor::sPySetButton, METH_O, (PY_METHODCHAR)SetButton_doc},
- {"getHat", (PyCFunction) SCA_JoystickSensor::sPyGetHat, METH_NOARGS, (PY_METHODCHAR)GetHat_doc},
- {"setHat", (PyCFunction) SCA_JoystickSensor::sPySetHat, METH_VARARGS, (PY_METHODCHAR)SetHat_doc},
- {"getNumAxes", (PyCFunction) SCA_JoystickSensor::sPyNumberOfAxes, METH_NOARGS, (PY_METHODCHAR)NumberOfAxes_doc},
- {"getNumButtons",(PyCFunction) SCA_JoystickSensor::sPyNumberOfButtons,METH_NOARGS, (PY_METHODCHAR)NumberOfButtons_doc},
- {"getNumHats", (PyCFunction) SCA_JoystickSensor::sPyNumberOfHats, METH_NOARGS, (PY_METHODCHAR)NumberOfHats_doc},
- {"isConnected", (PyCFunction) SCA_JoystickSensor::sPyConnected, METH_NOARGS, (PY_METHODCHAR)Connected_doc},
- {"getButtonValue",(PyCFunction) SCA_JoystickSensor::sPyGetButtonValue, METH_NOARGS,(PY_METHODCHAR)GetButtonValue_doc},
- //<----- Deprecated
- {"getButtonActiveList",(PyCFunction) SCA_JoystickSensor::sPyGetButtonActiveList, METH_NOARGS,(PY_METHODCHAR)GetButtonActiveList_doc},
- {"getButtonStatus",(PyCFunction) SCA_JoystickSensor::sPyGetButtonStatus, METH_VARARGS,(PY_METHODCHAR)GetButtonStatus_doc},
+ {"getButtonActiveList",(PyCFunction) SCA_JoystickSensor::sPyGetButtonActiveList, METH_NOARGS,(const char *)GetButtonActiveList_doc},
+ {"getButtonStatus",(PyCFunction) SCA_JoystickSensor::sPyGetButtonStatus, METH_VARARGS,(const char *)GetButtonStatus_doc},
{NULL,NULL} //Sentinel
};
@@ -321,144 +296,12 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = {
{ NULL } //Sentinel
};
-
-/* get index ---------------------------------------------------------- */
-const char SCA_JoystickSensor::GetIndex_doc[] =
-"getIndex\n"
-"\tReturns the joystick index to use.\n";
-PyObject* SCA_JoystickSensor::PyGetIndex( ) {
- ShowDeprecationWarning("getIndex()", "the index property");
- return PyLong_FromSsize_t(m_joyindex);
-}
-
-
-/* set index ---------------------------------------------------------- */
-const char SCA_JoystickSensor::SetIndex_doc[] =
-"setIndex\n"
-"\tSets the joystick index to use.\n";
-PyObject* SCA_JoystickSensor::PySetIndex( PyObject* value ) {
- ShowDeprecationWarning("setIndex()", "the index property");
- int index = PyLong_AsSsize_t( value ); /* -1 on error, will raise an error in this case */
- if (index < 0 || index >= JOYINDEX_MAX) {
- PyErr_SetString(PyExc_ValueError, "joystick index out of range or not an int");
- return NULL;
- }
-
- m_joyindex = index;
- Py_RETURN_NONE;
-}
-
-/* get axis ---------------------------------------------------------- */
-const char SCA_JoystickSensor::GetAxis_doc[] =
-"getAxis\n"
-"\tReturns the current axis this sensor reacts to.\n";
-PyObject* SCA_JoystickSensor::PyGetAxis( ) {
- ShowDeprecationWarning("getAxis()", "the axis property");
- return Py_BuildValue("[ii]",m_axis, m_axisf);
-}
-
-
-/* set axis ---------------------------------------------------------- */
-const char SCA_JoystickSensor::SetAxis_doc[] =
-"setAxis\n"
-"\tSets the current axis this sensor reacts to.\n";
-PyObject* SCA_JoystickSensor::PySetAxis( PyObject* args ) {
- ShowDeprecationWarning("setAxis()", "the axis property");
-
- int axis,axisflag;
- if(!PyArg_ParseTuple(args, "ii:setAxis", &axis, &axisflag)){
- return NULL;
- }
- m_axis = axis;
- m_axisf = axisflag;
-
- CheckAxis((void *)this, NULL); /* clamp values */
- Py_RETURN_NONE;
-}
-
-
-/* get axis value ----------------------------------------------------- */
-const char SCA_JoystickSensor::GetAxisValue_doc[] =
-"getAxisValue\n"
-"\tReturns a list of the values for the current state of each axis.\n";
-PyObject* SCA_JoystickSensor::PyGetAxisValue( ) {
- ShowDeprecationWarning("getAxisValue()", "the axisPosition property");
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
-
- int axis_index= joy->GetNumberOfAxes();
- PyObject *list= PyList_New(axis_index);
-
- while(axis_index--) {
- PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index)));
- }
-
- return list;
-}
-
-
-/* get threshold ----------------------------------------------------- */
-const char SCA_JoystickSensor::GetThreshold_doc[] =
-"getThreshold\n"
-"\tReturns the threshold of the axis.\n";
-PyObject* SCA_JoystickSensor::PyGetThreshold( ) {
- ShowDeprecationWarning("getThreshold()", "the threshold property");
- return PyLong_FromSsize_t(m_precision);
-}
-
-
-/* set threshold ----------------------------------------------------- */
-const char SCA_JoystickSensor::SetThreshold_doc[] =
-"setThreshold\n"
-"\tSets the threshold of the axis.\n";
-PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* args ) {
- ShowDeprecationWarning("setThreshold()", "the threshold property");
- int thresh;
- if(!PyArg_ParseTuple(args, "i:setThreshold", &thresh)){
- return NULL;
- }
- m_precision = thresh;
- Py_RETURN_NONE;
-}
-
-/* get button -------------------------------------------------------- */
-const char SCA_JoystickSensor::GetButton_doc[] =
-"getButton\n"
-"\tReturns the current button this sensor is checking.\n";
-PyObject* SCA_JoystickSensor::PyGetButton( ) {
- ShowDeprecationWarning("getButton()", "the button property");
- return PyLong_FromSsize_t(m_button);
-}
-
-/* set button -------------------------------------------------------- */
-const char SCA_JoystickSensor::SetButton_doc[] =
-"setButton\n"
-"\tSets the button the sensor reacts to.\n";
-PyObject* SCA_JoystickSensor::PySetButton( PyObject* value ) {
- ShowDeprecationWarning("setButton()", "the button property");
- int button = PyLong_AsSsize_t(value);
- if(button==-1 && PyErr_Occurred()) {
- PyErr_SetString(PyExc_ValueError, "expected an int");
- return NULL;
- }
- m_button = button;
- Py_RETURN_NONE;
-}
-
-/* get button value -------------------------------------------------- */
-const char SCA_JoystickSensor::GetButtonValue_doc[] =
-"getButtonValue\n"
-"\tReturns a list containing the indicies of the current pressed state of each button.\n";
-PyObject* SCA_JoystickSensor::PyGetButtonValue( ) {
- ShowDeprecationWarning("getButtonValue()", "getButtonActiveList");
- return PyGetButtonActiveList( );
-}
-
/* get button active list -------------------------------------------------- */
const char SCA_JoystickSensor::GetButtonActiveList_doc[] =
"getButtonActiveList\n"
"\tReturns a list containing the indicies of the button currently pressed.\n";
PyObject* SCA_JoystickSensor::PyGetButtonActiveList( ) {
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
PyObject *ls = PyList_New(0);
PyObject *value;
int i;
@@ -480,7 +323,7 @@ const char SCA_JoystickSensor::GetButtonStatus_doc[] =
"getButtonStatus(buttonIndex)\n"
"\tReturns a bool of the current pressed state of the specified button.\n";
PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) {
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
int index;
if(!PyArg_ParseTuple(args, "i:getButtonStatus", &index)){
@@ -492,79 +335,10 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) {
return PyBool_FromLong(0);
}
-/* get hat ----------------------------------------------------------- */
-const char SCA_JoystickSensor::GetHat_doc[] =
-"getHat\n"
-"\tReturns the current direction of the hat.\n";
-PyObject* SCA_JoystickSensor::PyGetHat( ) {
- ShowDeprecationWarning("getHat()", "the hat property");
- return Py_BuildValue("[ii]",m_hat, m_hatf);
-}
-
-
-/* set hat ----------------------------------------------------------- */
-const char SCA_JoystickSensor::SetHat_doc[] =
-"setHat\n"
-"\tSets the hat the sensor reacts to.\n";
-PyObject* SCA_JoystickSensor::PySetHat( PyObject* args ) {
- ShowDeprecationWarning("setHat()", "the hat property");
- int hat,hatflag;
- if(!PyArg_ParseTuple(args, "ii:setHat", &hat, &hatflag)){
- return NULL;
- }
- m_hat = hat;
- m_hatf = hatflag;
-
- CheckHat((void *)this, NULL); /* clamp values */
- Py_RETURN_NONE;
-}
-
-
-/* get # of ----------------------------------------------------- */
-const char SCA_JoystickSensor::NumberOfAxes_doc[] =
-"getNumAxes\n"
-"\tReturns the number of axes .\n";
-PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) {
- ShowDeprecationWarning("getNumAxes()", "the numAxis property");
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
- // when the joystick is null their is 0 exis still. dumb but scripters should use isConnected()
- return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 );
-}
-
-
-const char SCA_JoystickSensor::NumberOfButtons_doc[] =
-"getNumButtons\n"
-"\tReturns the number of buttons .\n";
-PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) {
- ShowDeprecationWarning("getNumButtons()", "the numButtons property");
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
- return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 );
-}
-
-
-const char SCA_JoystickSensor::NumberOfHats_doc[] =
-"getNumHats\n"
-"\tReturns the number of hats .\n";
-PyObject* SCA_JoystickSensor::PyNumberOfHats( ) {
- ShowDeprecationWarning("getNumHats()", "the numHats property");
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
- return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 );
-}
-
-const char SCA_JoystickSensor::Connected_doc[] =
-"getConnected\n"
-"\tReturns True if a joystick is connected at this joysticks index.\n";
-PyObject* SCA_JoystickSensor::PyConnected( ) {
- ShowDeprecationWarning("getConnected()", "the connected property");
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
- return PyBool_FromLong( joy ? joy->Connected() : 0 );
-}
-
-
PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
int axis_index= joy->GetNumberOfAxes();
PyObject *list= PyList_New(axis_index);
@@ -579,7 +353,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT
PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
if(self->m_joymode != KX_JOYSENSORMODE_AXIS_SINGLE) {
PyErr_SetString(PyExc_TypeError, "val = sensor.axisSingle: Joystick Sensor, not 'Single Axis' type");
@@ -592,7 +366,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT
PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
int hat_index= joy->GetNumberOfHats();
PyObject *list= PyList_New(hat_index);
@@ -607,7 +381,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT
PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
return PyLong_FromSsize_t(joy->GetHat(self->m_hat-1));
}
@@ -615,27 +389,27 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT
PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 );
}
PyObject* SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 );
}
PyObject* SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 );
}
PyObject* SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
- SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+ SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
return PyBool_FromLong( joy ? joy->Connected() : 0 );
}
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h
index 32f8ce567d2..b793c591ac1 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.h
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h
@@ -35,7 +35,6 @@
class SCA_JoystickSensor :public SCA_ISensor
{
Py_Header;
- class SCA_JoystickManager* m_pJoystickMgr;
/**
* Axis 1-JOYAXIS_MAX, MUST be followed by m_axisf
@@ -123,28 +122,8 @@ public:
/* --------------------------------------------------------------------- */
/* Joystick Index */
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetIndex);
- KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetIndex);
- /* Axes*/
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetAxis);
- KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetAxis);
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetAxisValue);
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetThreshold);
- KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetThreshold);
- /* Buttons */
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButton);
- KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetButton);
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonValue);
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonActiveList);
KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,GetButtonStatus);
- /* Hats */
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetHat);
- KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetHat);
- /* number of */
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfAxes);
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfButtons);
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfHats);
- KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,Connected);
static PyObject* pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.h b/source/gameengine/GameLogic/SCA_KeyboardManager.h
index 8f3cc0ab715..c5553a74aef 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardManager.h
+++ b/source/gameengine/GameLogic/SCA_KeyboardManager.h
@@ -56,6 +56,13 @@ public:
virtual void NextFrame();
SCA_IInputDevice* GetInputDevice();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_KeyboardManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_KEYBOARDMANAGER
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
index 999e34dfa36..d2e3871fec2 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
@@ -50,7 +50,6 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr,
const STR_String& toggleProp,
SCA_IObject* gameobj)
:SCA_ISensor(gameobj,keybdmgr),
- m_pKeyboardMgr(keybdmgr),
m_hotkey(hotkey),
m_qual(qual),
m_qual2(qual2),
@@ -125,7 +124,7 @@ bool SCA_KeyboardSensor::Evaluate()
bool qual_change = false;
short int m_val_orig = m_val;
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
// cerr << "SCA_KeyboardSensor::Eval event, sensing for "<< m_hotkey << " at device " << inputdev << "\n";
/* See if we need to do logging: togPropState exists and is
@@ -360,7 +359,7 @@ void SCA_KeyboardSensor::AddToTargetProp(int keyIndex)
*/
bool SCA_KeyboardSensor::IsShifted(void)
{
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
if ( (inputdev->GetEventValue(SCA_IInputDevice::KX_RIGHTSHIFTKEY).m_status
== SCA_InputEvent::KX_ACTIVE)
@@ -379,7 +378,7 @@ bool SCA_KeyboardSensor::IsShifted(void)
void SCA_KeyboardSensor::LogKeystrokes(void)
{
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
int num = inputdev->GetNumActiveEvents();
/* weird loop, this one... */
@@ -409,184 +408,6 @@ void SCA_KeyboardSensor::LogKeystrokes(void)
/* Python Functions */
/* ------------------------------------------------------------------------- */
-//Deprecated ----->
-/** 1. GetKey : check which key this sensor looks at */
-const char SCA_KeyboardSensor::GetKey_doc[] =
-"getKey()\n"
-"\tReturn the code of the key this sensor is listening to.\n" ;
-PyObject* SCA_KeyboardSensor::PyGetKey()
-{
- ShowDeprecationWarning("getKey()", "the key property");
- return PyLong_FromSsize_t(m_hotkey);
-}
-
-/** 2. SetKey: change the key to look at */
-const char SCA_KeyboardSensor::SetKey_doc[] =
-"setKey(keycode)\n"
-"\t- keycode: any code from GameKeys\n"
-"\tSet the key this sensor should listen to.\n" ;
-PyObject* SCA_KeyboardSensor::PySetKey(PyObject* args)
-{
- ShowDeprecationWarning("setKey()", "the key property");
- int keyCode;
-
- if(!PyArg_ParseTuple(args, "i:setKey", &keyCode)) {
- return NULL;
- }
-
- /* Since we have symbolic constants for this in Python, we don't guard */
- /* anything. It's up to the user to provide a sensible number. */
- m_hotkey = keyCode;
-
- Py_RETURN_NONE;
-}
-
-/** 3. GetHold1 : set the first bucky bit */
-const char SCA_KeyboardSensor::GetHold1_doc[] =
-"getHold1()\n"
-"\tReturn the code of the first key modifier to the key this \n"
-"\tsensor is listening to.\n" ;
-PyObject* SCA_KeyboardSensor::PyGetHold1()
-{
- ShowDeprecationWarning("getHold1()", "the hold1 property");
- return PyLong_FromSsize_t(m_qual);
-}
-
-/** 4. SetHold1: change the first bucky bit */
-const char SCA_KeyboardSensor::SetHold1_doc[] =
-"setHold1(keycode)\n"
-"\t- keycode: any code from GameKeys\n"
-"\tSet the first modifier to the key this sensor should listen to.\n" ;
-PyObject* SCA_KeyboardSensor::PySetHold1(PyObject* args)
-{
- ShowDeprecationWarning("setHold1()", "the hold1 property");
- int keyCode;
-
- if(!PyArg_ParseTuple(args, "i:setHold1", &keyCode)) {
- return NULL;
- }
-
- /* Since we have symbolic constants for this in Python, we don't guard */
- /* anything. It's up to the user to provide a sensible number. */
- m_qual = keyCode;
-
- Py_RETURN_NONE;
-}
-
-/** 5. GetHold2 : get the second bucky bit */
-const char SCA_KeyboardSensor::GetHold2_doc[] =
-"getHold2()\n"
-"\tReturn the code of the second key modifier to the key this \n"
-"\tsensor is listening to.\n" ;
-PyObject* SCA_KeyboardSensor::PyGetHold2()
-{
- ShowDeprecationWarning("getHold2()", "the hold2 property");
- return PyLong_FromSsize_t(m_qual2);
-}
-
-/** 6. SetHold2: change the second bucky bit */
-const char SCA_KeyboardSensor::SetHold2_doc[] =
-"setHold2(keycode)\n"
-"\t- keycode: any code from GameKeys\n"
-"\tSet the first modifier to the key this sensor should listen to.\n" ;
-PyObject* SCA_KeyboardSensor::PySetHold2(PyObject* args)
-{
- ShowDeprecationWarning("setHold2()", "the hold2 property");
- int keyCode;
-
- if(!PyArg_ParseTuple(args, "i:setHold2", &keyCode)) {
- return NULL;
- }
-
- /* Since we have symbolic constants for this in Python, we don't guard */
- /* anything. It's up to the user to provide a sensible number. */
- m_qual2 = keyCode;
-
- Py_RETURN_NONE;
-}
-
-
-const char SCA_KeyboardSensor::GetPressedKeys_doc[] =
-"getPressedKeys()\n"
-"\tGet a list of pressed keys that have either been pressed, or just released this frame.\n" ;
-
-PyObject* SCA_KeyboardSensor::PyGetPressedKeys()
-{
- ShowDeprecationWarning("getPressedKeys()", "events");
-
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
-
- int num = inputdev->GetNumJustEvents();
- PyObject* resultlist = PyList_New(num);
-
- if (num > 0)
- {
-
- int index = 0;
-
- for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++)
- {
- const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);
- if ((inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED)
- || (inevent.m_status == SCA_InputEvent::KX_JUSTRELEASED))
- {
- PyObject* keypair = PyList_New(2);
- PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i));
- PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
- PyList_SET_ITEM(resultlist,index,keypair);
- index++;
-
- if (index >= num) /* should not happen */
- break;
- }
- }
- }
-
- return resultlist;
-}
-
-
-
-const char SCA_KeyboardSensor::GetCurrentlyPressedKeys_doc[] =
-"getCurrentlyPressedKeys()\n"
-"\tGet a list of keys that are currently pressed.\n" ;
-
-PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys()
-{
- ShowDeprecationWarning("getCurrentlyPressedKeys()", "events");
-
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
-
- int num = inputdev->GetNumActiveEvents();
- PyObject* resultlist = PyList_New(num);
-
- if (num > 0)
- {
- int index = 0;
-
- for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++)
- {
- const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);
- if ( (inevent.m_status == SCA_InputEvent::KX_ACTIVE)
- || (inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED))
- {
- PyObject* keypair = PyList_New(2);
- PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i));
- PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
- PyList_SET_ITEM(resultlist,index,keypair);
- index++;
-
- if (index >= num) /* should never happen */
- break;
- }
- }
- }
-
- return resultlist;
-}
-
-//<---- Deprecated
-
KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus,
"getKeyStatus(keycode)\n"
"\tGet the given key's status (KX_NO_INPUTSTATUS, KX_JUSTACTIVATED, KX_ACTIVE or KX_JUSTRELEASED).\n")
@@ -604,7 +425,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus,
return NULL;
}
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) keycode);
return PyLong_FromSsize_t(inevent.m_status);
}
@@ -614,13 +435,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus,
/* ------------------------------------------------------------------------- */
PyTypeObject SCA_KeyboardSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_KeyboardSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -642,16 +457,6 @@ PyTypeObject SCA_KeyboardSensor::Type = {
};
PyMethodDef SCA_KeyboardSensor::Methods[] = {
- //Deprecated functions ------>
- {"getKey", (PyCFunction) SCA_KeyboardSensor::sPyGetKey, METH_NOARGS, (PY_METHODCHAR)GetKey_doc},
- {"setKey", (PyCFunction) SCA_KeyboardSensor::sPySetKey, METH_VARARGS, (PY_METHODCHAR)SetKey_doc},
- {"getHold1", (PyCFunction) SCA_KeyboardSensor::sPyGetHold1, METH_NOARGS, (PY_METHODCHAR)GetHold1_doc},
- {"setHold1", (PyCFunction) SCA_KeyboardSensor::sPySetHold1, METH_VARARGS, (PY_METHODCHAR)SetHold1_doc},
- {"getHold2", (PyCFunction) SCA_KeyboardSensor::sPyGetHold2, METH_NOARGS, (PY_METHODCHAR)GetHold2_doc},
- {"setHold2", (PyCFunction) SCA_KeyboardSensor::sPySetHold2, METH_VARARGS, (PY_METHODCHAR)SetHold2_doc},
- {"getPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetPressedKeys, METH_NOARGS, (PY_METHODCHAR)GetPressedKeys_doc},
- {"getCurrentlyPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetCurrentlyPressedKeys, METH_NOARGS, (PY_METHODCHAR)GetCurrentlyPressedKeys_doc},
- //<----- Deprecated
KX_PYMETHODTABLE_O(SCA_KeyboardSensor, getKeyStatus),
{NULL,NULL} //Sentinel
};
@@ -672,7 +477,7 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU
{
SCA_KeyboardSensor* self= static_cast<SCA_KeyboardSensor*>(self_v);
- SCA_IInputDevice* inputdev = self->m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)self->m_eventmgr)->GetInputDevice();
PyObject* resultlist = PyList_New(0);
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h
index 3185b386d41..d7e0f301a9d 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h
+++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h
@@ -43,8 +43,6 @@
class SCA_KeyboardSensor : public SCA_ISensor
{
Py_Header;
- class SCA_KeyboardManager* m_pKeyboardMgr;
-
/**
* the key this sensor is sensing for
@@ -109,25 +107,6 @@ public:
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- //Deprecated functions ----->
- /** 1. GetKey : check which key this sensor looks at */
- KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetKey);
- /** 2. SetKey: change the key to look at */
- KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetKey);
- /** 3. GetHold1 : set the first bucky bit */
- KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold1);
- /** 4. SetHold1: change the first bucky bit */
- KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold1);
- /** 5. GetHold2 : set the second bucky bit */
- KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold2);
- /** 6. SetHold2: change the second bucky bit */
- KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold2);
- /** 9. GetPressedKeys: */
- KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetPressedKeys);
- /** 9. GetCurrrentlyPressedKeys: */
- KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetCurrentlyPressedKeys);
- // <------
-
// KeyEvents:
KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,getEventList);
// KeyStatus:
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h
index 53e75e1eaee..402090357cb 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.h
+++ b/source/gameengine/GameLogic/SCA_LogicManager.h
@@ -137,6 +137,13 @@ public:
void RegisterGameObj(void* blendobj, CValue* gameobj);
void UnregisterGameObj(void* blendobj, CValue* gameobj);
CValue* FindGameObjByBlendObj(void* blendobj);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_LogicManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_LOGICMANAGER
diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h
index efa4c639ce7..ef1533c636b 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.h
+++ b/source/gameengine/GameLogic/SCA_MouseManager.h
@@ -63,6 +63,13 @@ public:
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
virtual void NextFrame();
SCA_IInputDevice* GetInputDevice();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_MOUSEMANAGER
diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp
index 49fa19dce38..9d32682eaa9 100644
--- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp
@@ -51,7 +51,6 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr,
short int mousemode,
SCA_IObject* gameobj)
: SCA_ISensor(gameobj,eventmgr),
- m_pMouseMgr(eventmgr),
m_x(startx),
m_y(starty)
{
@@ -147,7 +146,7 @@ bool SCA_MouseSensor::Evaluate()
{
bool result = false;
bool reset = m_reset && m_level;
- SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice();
+ SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice();
m_reset = false;
switch (m_mousemode) {
@@ -244,30 +243,6 @@ bool SCA_MouseSensor::isValid(SCA_MouseSensor::KX_MOUSESENSORMODE m)
/* Python functions */
/* ------------------------------------------------------------------------- */
-//Deprecated functions ------>
-/* get x position ---------------------------------------------------------- */
-const char SCA_MouseSensor::GetXPosition_doc[] =
-"getXPosition\n"
-"\tReturns the x-coordinate of the mouse sensor, in frame coordinates.\n"
-"\tThe lower-left corner is the origin. The coordinate is given in\n"
-"\tpixels\n";
-PyObject* SCA_MouseSensor::PyGetXPosition() {
- ShowDeprecationWarning("getXPosition()", "the position property");
- return PyLong_FromSsize_t(m_x);
-}
-
-/* get y position ---------------------------------------------------------- */
-const char SCA_MouseSensor::GetYPosition_doc[] =
-"getYPosition\n"
-"\tReturns the y-coordinate of the mouse sensor, in frame coordinates.\n"
-"\tThe lower-left corner is the origin. The coordinate is given in\n"
-"\tpixels\n";
-PyObject* SCA_MouseSensor::PyGetYPosition() {
- ShowDeprecationWarning("getYPosition()", "the position property");
- return PyLong_FromSsize_t(m_y);
-}
-//<----- Deprecated
-
KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus,
"getButtonStatus(button)\n"
"\tGet the given button's status (KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED).\n")
@@ -282,7 +257,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus,
return NULL;
}
- SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice();
+ SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice();
const SCA_InputEvent& event = mousedev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) button);
return PyLong_FromSsize_t(event.m_status);
}
@@ -295,13 +270,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus,
/* ------------------------------------------------------------------------- */
PyTypeObject SCA_MouseSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_MouseSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -323,10 +292,6 @@ PyTypeObject SCA_MouseSensor::Type = {
};
PyMethodDef SCA_MouseSensor::Methods[] = {
- //Deprecated functions ------>
- {"getXPosition", (PyCFunction) SCA_MouseSensor::sPyGetXPosition, METH_VARARGS, (PY_METHODCHAR)GetXPosition_doc},
- {"getYPosition", (PyCFunction) SCA_MouseSensor::sPyGetYPosition, METH_VARARGS, (PY_METHODCHAR)GetYPosition_doc},
- //<----- Deprecated
KX_PYMETHODTABLE_O(SCA_MouseSensor, getButtonStatus),
{NULL,NULL} //Sentinel
};
diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h
index 47f0378bf69..a679e605428 100644
--- a/source/gameengine/GameLogic/SCA_MouseSensor.h
+++ b/source/gameengine/GameLogic/SCA_MouseSensor.h
@@ -39,7 +39,6 @@
class SCA_MouseSensor : public SCA_ISensor
{
Py_Header;
- class SCA_MouseManager* m_pMouseMgr;
/**
* Use SCA_IInputDevice values to encode the mouse mode for now.
@@ -107,13 +106,6 @@ class SCA_MouseSensor : public SCA_ISensor
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
-
- //Deprecated functions ----->
- /* read x-coordinate */
- KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetXPosition);
- /* read y-coordinate */
- KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetYPosition);
- //<----- deprecated
// get button status
KX_PYMETHOD_DOC_O(SCA_MouseSensor,getButtonStatus);
diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp
index c00e5d6e617..c971c06fadd 100644
--- a/source/gameengine/GameLogic/SCA_NANDController.cpp
+++ b/source/gameengine/GameLogic/SCA_NANDController.cpp
@@ -99,13 +99,7 @@ CValue* SCA_NANDController::GetReplica()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_NANDController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_NANDController",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp
index 9762d44fd5d..7a8b09e4bec 100644
--- a/source/gameengine/GameLogic/SCA_NORController.cpp
+++ b/source/gameengine/GameLogic/SCA_NORController.cpp
@@ -99,13 +99,7 @@ CValue* SCA_NORController::GetReplica()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_NORController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_NORController",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp
index a526dd8353c..12e2f610986 100644
--- a/source/gameengine/GameLogic/SCA_ORController.cpp
+++ b/source/gameengine/GameLogic/SCA_ORController.cpp
@@ -93,13 +93,7 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_ORController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_ORController",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
index 215e30eceaf..9446487cdb7 100644
--- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
@@ -228,13 +228,7 @@ void SCA_PropertyActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_PropertyActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_PropertyActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -256,12 +250,6 @@ PyTypeObject SCA_PropertyActuator::Type = {
};
PyMethodDef SCA_PropertyActuator::Methods[] = {
- //Deprecated functions ------>
- {"setProperty", (PyCFunction) SCA_PropertyActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"getProperty", (PyCFunction) SCA_PropertyActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
- {"setValue", (PyCFunction) SCA_PropertyActuator::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
- {"getValue", (PyCFunction) SCA_PropertyActuator::sPyGetValue, METH_VARARGS, (PY_METHODCHAR)GetValue_doc},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -272,71 +260,4 @@ PyAttributeDef SCA_PropertyActuator::Attributes[] = {
{ NULL } //Sentinel
};
-/* 1. setProperty */
-const char SCA_PropertyActuator::SetProperty_doc[] =
-"setProperty(name)\n"
-"\t- name: string\n"
-"\tSet the property on which to operate. If there is no property\n"
-"\tof this name, the call is ignored.\n";
-PyObject* SCA_PropertyActuator::PySetProperty(PyObject* args, PyObject* kwds)
-{
- ShowDeprecationWarning("setProperty()", "the 'propName' property");
- /* Check whether the name exists first ! */
- char *nameArg;
- if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) {
- return NULL;
- }
-
- CValue* prop = GetParent()->FindIdentifier(nameArg);
-
- if (!prop->IsError()) {
- m_propname = nameArg;
- } else {
- ; /* not found ... */
- }
- prop->Release();
-
- Py_RETURN_NONE;
-}
-
-/* 2. getProperty */
-const char SCA_PropertyActuator::GetProperty_doc[] =
-"getProperty(name)\n"
-"\tReturn the property on which the actuator operates.\n";
-PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds)
-{
- ShowDeprecationWarning("getProperty()", "the 'propName' property");
- return PyUnicode_FromString(m_propname);
-}
-
-/* 3. setValue */
-const char SCA_PropertyActuator::SetValue_doc[] =
-"setValue(value)\n"
-"\t- value: string\n"
-"\tSet the value with which the actuator operates. If the value\n"
-"\tis not compatible with the type of the property, the subsequent\n"
-"\t action is ignored.\n";
-PyObject* SCA_PropertyActuator::PySetValue(PyObject* args, PyObject* kwds)
-{
- ShowDeprecationWarning("setValue()", "the value property");
- char *valArg;
- if(!PyArg_ParseTuple(args, "s:setValue", &valArg)) {
- return NULL;
- }
-
- if (valArg) m_exprtxt = valArg;
-
- Py_RETURN_NONE;
-}
-
-/* 4. getValue */
-const char SCA_PropertyActuator::GetValue_doc[] =
-"getValue()\n"
-"\tReturns the value with which the actuator operates.\n";
-PyObject* SCA_PropertyActuator::PyGetValue(PyObject* args, PyObject* kwds)
-{
- ShowDeprecationWarning("getValue()", "the value property");
- return PyUnicode_FromString(m_exprtxt);
-}
-
/* eof */
diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h
index 8fb2e7a7bc5..833547a5cd3 100644
--- a/source/gameengine/GameLogic/SCA_PropertyActuator.h
+++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h
@@ -83,14 +83,6 @@ public:
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
-
- // python wrapped methods
- KX_PYMETHOD_DOC(SCA_PropertyActuator,SetProperty);
- KX_PYMETHOD_DOC(SCA_PropertyActuator,GetProperty);
- KX_PYMETHOD_DOC(SCA_PropertyActuator,SetValue);
- KX_PYMETHOD_DOC(SCA_PropertyActuator,GetValue);
-
- /* 5. - ... setObject, getObject, setProp2, getProp2, setMode, getMode*/
};
diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h
index f166065b198..a9692377df8 100644
--- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h
+++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h
@@ -44,6 +44,13 @@ public:
virtual ~SCA_PropertyEventManager();
virtual void NextFrame();
//SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_PROPERTYEVENTMANAGER
diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
index 6d2e1a0aca5..9c09c8410fb 100644
--- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
@@ -302,13 +302,7 @@ int SCA_PropertySensor::validValueForProperty(void *self, const PyAttributeDef*)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_PropertySensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_PropertySensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -330,14 +324,6 @@ PyTypeObject SCA_PropertySensor::Type = {
};
PyMethodDef SCA_PropertySensor::Methods[] = {
- //Deprecated functions ------>
- {"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc},
- {"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
- {"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
- {"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_NOARGS, (PY_METHODCHAR)GetValue_doc},
- {"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -348,111 +334,4 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = {
{ NULL } //Sentinel
};
-/* 1. getType */
-const char SCA_PropertySensor::GetType_doc[] =
-"getType()\n"
-"\tReturns the type of check this sensor performs.\n";
-PyObject* SCA_PropertySensor::PyGetType()
-{
- ShowDeprecationWarning("getType()", "the mode property");
- return PyLong_FromSsize_t(m_checktype);
-}
-
-/* 2. setType */
-const char SCA_PropertySensor::SetType_doc[] =
-"setType(type)\n"
-"\t- type: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL,\n"
-"\t KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,\n"
-"\t or KX_PROPSENSOR_EXPRESSION.\n"
-"\tSet the type of check to perform.\n";
-PyObject* SCA_PropertySensor::PySetType(PyObject* args)
-{
- ShowDeprecationWarning("setType()", "the mode property");
- int typeArg;
-
- if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) {
- return NULL;
- }
-
- if ( (typeArg > KX_PROPSENSOR_NODEF)
- && (typeArg < KX_PROPSENSOR_MAX) ) {
- m_checktype = typeArg;
- }
-
- Py_RETURN_NONE;
-}
-
-/* 3. getProperty */
-const char SCA_PropertySensor::GetProperty_doc[] =
-"getProperty()\n"
-"\tReturn the property with which the sensor operates.\n";
-PyObject* SCA_PropertySensor::PyGetProperty()
-{
- ShowDeprecationWarning("getProperty()", "the 'propName' property");
- return PyUnicode_FromString(m_checkpropname);
-}
-
-/* 4. setProperty */
-const char SCA_PropertySensor::SetProperty_doc[] =
-"setProperty(name)\n"
-"\t- name: string\n"
-"\tSets the property with which to operate. If there is no property\n"
-"\tof this name, the call is ignored.\n";
-PyObject* SCA_PropertySensor::PySetProperty(PyObject* args)
-{
- ShowDeprecationWarning("setProperty()", "the 'propName' property");
- /* We should query whether the name exists. Or should we create a prop */
- /* on the fly? */
- char *propNameArg = NULL;
-
- if (!PyArg_ParseTuple(args, "s:setProperty", &propNameArg)) {
- return NULL;
- }
-
- CValue *prop = FindIdentifier(STR_String(propNameArg));
- if (!prop->IsError()) {
- m_checkpropname = propNameArg;
- } else {
- ; /* error: bad property name */
- }
- prop->Release();
- Py_RETURN_NONE;
-}
-
-/* 5. getValue */
-const char SCA_PropertySensor::GetValue_doc[] =
-"getValue()\n"
-"\tReturns the value with which the sensor operates.\n";
-PyObject* SCA_PropertySensor::PyGetValue()
-{
- ShowDeprecationWarning("getValue()", "the value property");
- return PyUnicode_FromString(m_checkpropval);
-}
-
-/* 6. setValue */
-const char SCA_PropertySensor::SetValue_doc[] =
-"setValue(value)\n"
-"\t- value: string\n"
-"\tSet the value with which the sensor operates. If the value\n"
-"\tis not compatible with the type of the property, the subsequent\n"
-"\t action is ignored.\n";
-PyObject* SCA_PropertySensor::PySetValue(PyObject* args)
-{
- ShowDeprecationWarning("setValue()", "the value property");
- /* Here, we need to check whether the value is 'valid' for this property.*/
- /* We know that the property exists, or is NULL. */
- char *propValArg = NULL;
-
- if(!PyArg_ParseTuple(args, "s:setValue", &propValArg)) {
- return NULL;
- }
- STR_String oldval = m_checkpropval;
- m_checkpropval = propValArg;
- if (validValueForProperty(m_proxy, NULL)) {
- m_checkpropval = oldval;
- return NULL;
- }
- Py_RETURN_NONE;
-}
-
/* eof */
diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h
index 3513fcdf5ae..a5bbfc8438b 100644
--- a/source/gameengine/GameLogic/SCA_PropertySensor.h
+++ b/source/gameengine/GameLogic/SCA_PropertySensor.h
@@ -88,18 +88,6 @@ public:
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- /* 1. getType */
- KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetType);
- /* 2. setType */
- KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetType);
- /* 3. setProperty */
- KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetProperty);
- /* 4. getProperty */
- KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetProperty);
- /* 5. getValue */
- KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetValue);
- /* 6. setValue */
- KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetValue);
/**
* Test whether this is a sensible value (type check)
*/
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index ffd95f00699..ecaa8c508db 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -204,64 +204,33 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value)
return false;
}
-/* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
-PyObject* SCA_PythonController::sPyAddActiveActuator(PyObject* self, PyObject* args)
-{
- ShowDeprecationWarning("GameLogic.addActiveActuator(act, bool)", "controller.activate(act) or controller.deactivate(act)");
-
- PyObject* ob1;
- int activate;
- if (!PyArg_ParseTuple(args, "Oi:addActiveActuator", &ob1,&activate))
- return NULL;
-
- SCA_IActuator* actu = LinkedActuatorFromPy(ob1);
- if(actu==NULL)
- return NULL;
-
- bool boolval = (activate!=0);
- m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu,boolval);
- Py_RETURN_NONE;
-}
-
const char* SCA_PythonController::sPyGetCurrentController__doc__ = "getCurrentController()";
-const char* SCA_PythonController::sPyAddActiveActuator__doc__= "addActiveActuator(actuator,bool)";
PyTypeObject SCA_PythonController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "SCA_PythonController",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IController::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "SCA_PythonController",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IController::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef SCA_PythonController::Methods[] = {
{"activate", (PyCFunction) SCA_PythonController::sPyActivate, METH_O},
{"deactivate", (PyCFunction) SCA_PythonController::sPyDeActivate, METH_O},
-
- //Deprecated functions ------>
- {"setScript", (PyCFunction) SCA_PythonController::sPySetScript, METH_O},
- {"getScript", (PyCFunction) SCA_PythonController::sPyGetScript, METH_NOARGS},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -516,33 +485,6 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value)
Py_RETURN_NONE;
}
-/* 1. getScript */
-PyObject* SCA_PythonController::PyGetScript()
-{
- ShowDeprecationWarning("getScript()", "the script property");
- return PyUnicode_FromString(m_scriptText);
-}
-
-/* 2. setScript */
-PyObject* SCA_PythonController::PySetScript(PyObject* value)
-{
- char *scriptArg = _PyUnicode_AsString(value);
-
- ShowDeprecationWarning("setScript()", "the script property");
-
- if (scriptArg==NULL) {
- PyErr_SetString(PyExc_TypeError, "expected a string (script name)");
- return NULL;
- }
-
- /* set scripttext sets m_bModified to true,
- so next time the script is needed, a reparse into byte code is done */
-
- this->SetScriptText(scriptArg);
-
- Py_RETURN_NONE;
-}
-
PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
//SCA_PythonController* self= static_cast<SCA_PythonController*>(static_cast<SCA_IController*>(static_cast<SCA_ILogicBrick*>(static_cast<CValue*>(static_cast<PyObjectPlus*>(self_v)))));
diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp
index e903d10f9a5..a3a5cc2303e 100644
--- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp
@@ -315,13 +315,7 @@ void SCA_RandomActuator::enforceConstraints() {
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_RandomActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_RandomActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -343,15 +337,6 @@ PyTypeObject SCA_RandomActuator::Type = {
};
PyMethodDef SCA_RandomActuator::Methods[] = {
- //Deprecated functions ------>
- {"setSeed", (PyCFunction) SCA_RandomActuator::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc},
- {"getSeed", (PyCFunction) SCA_RandomActuator::sPyGetSeed, METH_NOARGS, (PY_METHODCHAR)GetSeed_doc},
- {"getPara1", (PyCFunction) SCA_RandomActuator::sPyGetPara1, METH_NOARGS, (PY_METHODCHAR)GetPara1_doc},
- {"getPara2", (PyCFunction) SCA_RandomActuator::sPyGetPara2, METH_NOARGS, (PY_METHODCHAR)GetPara2_doc},
- {"getDistribution", (PyCFunction) SCA_RandomActuator::sPyGetDistribution, METH_NOARGS, (PY_METHODCHAR)GetDistribution_doc},
- {"setProperty", (PyCFunction) SCA_RandomActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"getProperty", (PyCFunction) SCA_RandomActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
- //<----- Deprecated
KX_PYMETHODTABLE(SCA_RandomActuator, setBoolConst),
KX_PYMETHODTABLE_NOARGS(SCA_RandomActuator, setBoolUniform),
KX_PYMETHODTABLE(SCA_RandomActuator, setBoolBernouilli),
@@ -395,104 +380,6 @@ int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_
}
}
-/* 1. setSeed */
-const char SCA_RandomActuator::SetSeed_doc[] =
-"setSeed(seed)\n"
-"\t- seed: integer\n"
-"\tSet the initial seed of the generator. Equal seeds produce\n"
-"\tequal series. If the seed is 0, the generator will produce\n"
-"\tthe same value on every call.\n";
-PyObject* SCA_RandomActuator::PySetSeed(PyObject* args) {
- ShowDeprecationWarning("setSeed()", "the seed property");
- long seedArg;
- if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) {
- return NULL;
- }
-
- m_base->SetSeed(seedArg);
-
- Py_RETURN_NONE;
-}
-/* 2. getSeed */
-const char SCA_RandomActuator::GetSeed_doc[] =
-"getSeed()\n"
-"\tReturns the initial seed of the generator. Equal seeds produce\n"
-"\tequal series.\n";
-PyObject* SCA_RandomActuator::PyGetSeed()
-{
- ShowDeprecationWarning("getSeed()", "the seed property");
- return PyLong_FromSsize_t(m_base->GetSeed());
-}
-
-/* 4. getPara1 */
-const char SCA_RandomActuator::GetPara1_doc[] =
-"getPara1()\n"
-"\tReturns the first parameter of the active distribution. Refer\n"
-"\tto the documentation of the generator types for the meaning\n"
-"\tof this value.";
-PyObject* SCA_RandomActuator::PyGetPara1()
-{
- ShowDeprecationWarning("getPara1()", "the para1 property");
- return PyFloat_FromDouble(m_parameter1);
-}
-
-/* 6. getPara2 */
-const char SCA_RandomActuator::GetPara2_doc[] =
-"getPara2()\n"
-"\tReturns the first parameter of the active distribution. Refer\n"
-"\tto the documentation of the generator types for the meaning\n"
-"\tof this value.";
-PyObject* SCA_RandomActuator::PyGetPara2()
-{
- ShowDeprecationWarning("getPara2()", "the para2 property");
- return PyFloat_FromDouble(m_parameter2);
-}
-
-/* 8. getDistribution */
-const char SCA_RandomActuator::GetDistribution_doc[] =
-"getDistribution()\n"
-"\tReturns the type of the active distribution.\n";
-PyObject* SCA_RandomActuator::PyGetDistribution()
-{
- ShowDeprecationWarning("getDistribution()", "the distribution property");
- return PyLong_FromSsize_t(m_distribution);
-}
-
-/* 9. setProperty */
-const char SCA_RandomActuator::SetProperty_doc[] =
-"setProperty(name)\n"
-"\t- name: string\n"
-"\tSet the property to which the random value is assigned. If the \n"
-"\tgenerator and property types do not match, the assignment is ignored.\n";
-PyObject* SCA_RandomActuator::PySetProperty(PyObject* args) {
- ShowDeprecationWarning("setProperty()", "the 'propName' property");
- char *nameArg;
- if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) {
- return NULL;
- }
-
- CValue* prop = GetParent()->FindIdentifier(nameArg);
-
- if (!prop->IsError()) {
- m_propname = nameArg;
- } else {
- ; /* not found ... */
- }
- prop->Release();
-
- Py_RETURN_NONE;
-}
-/* 10. getProperty */
-const char SCA_RandomActuator::GetProperty_doc[] =
-"getProperty(name)\n"
-"\tReturn the property to which the random value is assigned. If the \n"
-"\tgenerator and property types do not match, the assignment is ignored.\n";
-PyObject* SCA_RandomActuator::PyGetProperty()
-{
- ShowDeprecationWarning("getProperty()", "the 'propName' property");
- return PyUnicode_FromString(m_propname);
-}
-
/* 11. setBoolConst */
KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setBoolConst,
"setBoolConst(value)\n"
diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h
index c7d3fe21217..f84c44b43c9 100644
--- a/source/gameengine/GameLogic/SCA_RandomActuator.h
+++ b/source/gameengine/GameLogic/SCA_RandomActuator.h
@@ -99,16 +99,6 @@ class SCA_RandomActuator : public SCA_IActuator
static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- // Deprecated methods ----->
- KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetSeed);
- KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetSeed);
- KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara1);
- KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara2);
- KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetDistribution);
- KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetProperty);
- KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetProperty);
- // <-----
-
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst);
KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator, setBoolUniform);
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolBernouilli);
diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.h b/source/gameengine/GameLogic/SCA_RandomEventManager.h
index 79138c23c62..c8b511b87b7 100644
--- a/source/gameengine/GameLogic/SCA_RandomEventManager.h
+++ b/source/gameengine/GameLogic/SCA_RandomEventManager.h
@@ -45,6 +45,13 @@ public:
SCA_RandomEventManager(class SCA_LogicManager* logicmgr);
virtual void NextFrame();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomEventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_RANDOMEVENTMGR
diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h
index 842a0331752..f986fadeaf0 100644
--- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h
+++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h
@@ -34,6 +34,10 @@
#ifndef __KX_RANDOMNUMBERGENERATOR
#define __KX_RANDOMNUMBERGENERATOR
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class SCA_RandomNumberGenerator {
/* reference counted for memleak */
@@ -69,6 +73,13 @@ class SCA_RandomNumberGenerator {
if (--m_refcount == 0)
delete this;
}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomNumberGenerator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif /* __KX_RANDOMNUMBERGENERATOR */
diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp
index e036a77707e..890875e61c6 100644
--- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp
@@ -130,13 +130,7 @@ bool SCA_RandomSensor::Evaluate()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_RandomSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_RandomSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -158,11 +152,6 @@ PyTypeObject SCA_RandomSensor::Type = {
};
PyMethodDef SCA_RandomSensor::Methods[] = {
- //Deprecated functions ----->
- {"setSeed", (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc},
- {"getSeed", (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_NOARGS, (PY_METHODCHAR)GetSeed_doc},
- {"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_NOARGS, (PY_METHODCHAR)GetLastDraw_doc},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -172,45 +161,6 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = {
{NULL} //Sentinel
};
-/* 1. setSeed */
-const char SCA_RandomSensor::SetSeed_doc[] =
-"setSeed(seed)\n"
-"\t- seed: integer\n"
-"\tSet the initial seed of the generator. Equal seeds produce\n"
-"\tequal series. If the seed is 0, the generator will produce\n"
-"\tthe same value on every call.\n";
-PyObject* SCA_RandomSensor::PySetSeed(PyObject* args) {
- ShowDeprecationWarning("setSeed()", "the seed property");
- long seedArg;
- if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) {
- return NULL;
- }
-
- m_basegenerator->SetSeed(seedArg);
-
- Py_RETURN_NONE;
-}
-
-/* 2. getSeed */
-const char SCA_RandomSensor::GetSeed_doc[] =
-"getSeed()\n"
-"\tReturns the initial seed of the generator. Equal seeds produce\n"
-"\tequal series.\n";
-PyObject* SCA_RandomSensor::PyGetSeed() {
- ShowDeprecationWarning("getSeed()", "the seed property");
- return PyLong_FromSsize_t(m_basegenerator->GetSeed());
-}
-
-/* 3. getLastDraw */
-const char SCA_RandomSensor::GetLastDraw_doc[] =
-"getLastDraw()\n"
-"\tReturn the last value that was drawn.\n";
-PyObject* SCA_RandomSensor::PyGetLastDraw() {
- ShowDeprecationWarning("getLastDraw()", "the lastDraw property");
- return PyLong_FromSsize_t(m_lastdraw);
-}
-
-
PyObject* SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v);
diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h
index 5e66c36cccf..f93cf57370e 100644
--- a/source/gameengine/GameLogic/SCA_RandomSensor.h
+++ b/source/gameengine/GameLogic/SCA_RandomSensor.h
@@ -59,13 +59,6 @@ public:
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
-
- /* 1. setSeed */
- KX_PYMETHOD_DOC_VARARGS(SCA_RandomSensor,SetSeed);
- /* 2. getSeed */
- KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetSeed);
- /* 3. getLastDraw */
- KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetLastDraw);
static PyObject* pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h
index bd57e12eb44..089f21e603b 100644
--- a/source/gameengine/GameLogic/SCA_TimeEventManager.h
+++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h
@@ -48,6 +48,13 @@ public:
virtual void RemoveSensor(class SCA_ISensor* sensor);
void AddTimeProperty(CValue* timeval);
void RemoveTimeProperty(CValue* timeval);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_TimeEventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_TIMEEVENTMANAGER
diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp
index 527adc70cc6..17350feb98b 100644
--- a/source/gameengine/GameLogic/SCA_XNORController.cpp
+++ b/source/gameengine/GameLogic/SCA_XNORController.cpp
@@ -103,13 +103,7 @@ CValue* SCA_XNORController::GetReplica()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_XNORController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_XNORController",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp
index c0916224fe6..a6a7cc25897 100644
--- a/source/gameengine/GameLogic/SCA_XORController.cpp
+++ b/source/gameengine/GameLogic/SCA_XORController.cpp
@@ -103,13 +103,7 @@ CValue* SCA_XORController::GetReplica()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_XORController::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"SCA_XORController",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript
index 837769e5e78..f456f4125ab 100644
--- a/source/gameengine/GameLogic/SConscript
+++ b/source/gameengine/GameLogic/SConscript
@@ -17,12 +17,8 @@ if env['WITH_BF_SDL']:
else:
defs.append('DISABLE_SDL')
-cxxflags = []
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
if env['BF_DEBUG']:
defs.append('_DEBUG')
-env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core','player'], priority=[330, 100], cxx_compileflags=cxxflags )
+env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core'], priority=[330], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt
index ce1cd217f60..da99087c917 100644
--- a/source/gameengine/GamePlayer/common/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/common/CMakeLists.txt
@@ -43,7 +43,6 @@ SET(INC
../../../../intern/ghost
../../../../intern/guardedalloc
../../../../intern/moto/include
- ../../../../intern/SoundSystem
../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
../../../../source/kernel/gen_system
../../../../source/kernel/gen_messaging
@@ -61,8 +60,6 @@ SET(INC
../../../../source/gameengine/Network
../../../../source/gameengine/SceneGraph
../../../../source/gameengine/Physics/common
- ../../../../source/gameengine/Physics/Sumo
- ../../../../source/gameengine/Physics/Sumo/Fuzzics/include
../../../../source/gameengine/Network/LoopBackNetwork
../../../../source/gameengine/GamePlayer/ghost
../../../../source/blender/misc
@@ -70,7 +67,6 @@ SET(INC
../../../../source/blender/gpu
../../../../extern/glew/include
${PYTHON_INC}
- ${SOLID_INC}
${PNG_INC}
${ZLIB_INC}
)
diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp
index a46f30c1209..85a362d042a 100644
--- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp
@@ -58,7 +58,6 @@
#include "NG_LoopBackNetworkDeviceInterface.h"
#include "RAS_IRenderTools.h"
-#include "SND_DeviceManager.h"
#include "GPC_Engine.h"
#include "GPC_KeyboardDevice.h"
@@ -75,8 +74,7 @@ GPC_Engine::GPC_Engine(char *customLoadingAnimationURL,
m_system(NULL), m_keyboarddev(NULL),
m_mousedev(NULL), m_canvas(NULL), m_rendertools(NULL),
m_portal(NULL), m_sceneconverter(NULL), m_networkdev(NULL),
- m_audiodevice(NULL), m_curarea(NULL),
- m_customLoadingAnimationURL(NULL),
+ m_curarea(NULL), m_customLoadingAnimationURL(NULL),
m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor),
m_frameRate(frameRate),
m_BlenderLogo(0), m_Blender3DLogo(0)/*, m_NaNLogo(0)*/
@@ -201,7 +199,6 @@ bool GPC_Engine::StartKetsji(void)
m_keyboarddev,
m_mousedev,
m_networkdev,
- m_audiodevice,
m_system);
m_system->SetMainLoop(m_portal->m_ketsjieng);
@@ -337,12 +334,6 @@ void GPC_Engine::Exit()
m_networkdev = 0;
}
- if (m_audiodevice)
- {
- SND_DeviceManager::Unsubscribe();
- m_audiodevice = 0;
- }
-
m_initialized = false;
}
diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.h b/source/gameengine/GamePlayer/common/GPC_Engine.h
index b7121599c6e..42234bcbcd6 100644
--- a/source/gameengine/GamePlayer/common/GPC_Engine.h
+++ b/source/gameengine/GamePlayer/common/GPC_Engine.h
@@ -40,7 +40,6 @@ class RAS_IRenderTools;
class KetsjiPortal;
class KX_ISceneConverter;
class NG_LoopBackNetworkDeviceInterface;
-class SND_IAudioDevice;
class GPC_RawImage;
@@ -77,8 +76,6 @@ public:
KX_ISceneConverter* m_sceneconverter;
/** Network interface. */
NG_LoopBackNetworkDeviceInterface* m_networkdev;
- /** Audiodevice interface */
- SND_IAudioDevice* m_audiodevice;
struct ScrArea *m_curarea; // for future use, not used yet
diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile
index 4a952856739..e1b07a226f6 100644
--- a/source/gameengine/GamePlayer/common/Makefile
+++ b/source/gameengine/GamePlayer/common/Makefile
@@ -47,14 +47,13 @@ CPPFLAGS += -I../../../blender/gpu
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-CPPFLAGS += -I$(NAN_FUZZICS)/include
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_PNG)/include
CPPFLAGS += -I$(NAN_ZLIB)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
+CPPFLAGS += -I$(NAN_AUDASPACE)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I../../../gameengine/Converter
CPPFLAGS += -I../../../gameengine/Expressions
CPPFLAGS += -I../../../gameengine/GameLogic
diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript
index b7b3b9b12c4..6f37c2f769e 100644
--- a/source/gameengine/GamePlayer/common/SConscript
+++ b/source/gameengine/GamePlayer/common/SConscript
@@ -19,7 +19,6 @@ incs = ['.',
'#intern/ghost',
'#intern/guardedalloc',
'#intern/moto/include',
- '#intern/SoundSystem',
'#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
'#source/kernel/gen_system',
'#source/kernel/gen_messaging',
@@ -63,10 +62,4 @@ incs += Split(env['BF_PYTHON_INC'])
incs += Split(env['BF_PNG_INC'])
incs += Split(env['BF_ZLIB_INC'])
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype='player', priority=5, cxx_compileflags=cxxflags)
+env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype=['player'], priority=[15], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/GamePlayer/common/unix/Makefile b/source/gameengine/GamePlayer/common/unix/Makefile
index 08c52ddc904..c86f61b45d8 100644
--- a/source/gameengine/GamePlayer/common/unix/Makefile
+++ b/source/gameengine/GamePlayer/common/unix/Makefile
@@ -56,8 +56,6 @@ CPPFLAGS += -I../../../../gameengine/Rasterizer
CPPFLAGS += -I../../../../gameengine/Rasterizer/RAS_OpenGLRasterizer
CPPFLAGS += -I../../../../gameengine/SceneGraph
-CPPFLAGS += -I$(NAN_FUZZICS)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_MOTO)/include
# Blender stuff
diff --git a/source/gameengine/GamePlayer/common/windows/Makefile b/source/gameengine/GamePlayer/common/windows/Makefile
index b622ee974c8..3f1deb05f3a 100644
--- a/source/gameengine/GamePlayer/common/windows/Makefile
+++ b/source/gameengine/GamePlayer/common/windows/Makefile
@@ -48,7 +48,6 @@ CPPFLAGS += -I$(SRCHOME)/gameengine/Physics/Sumo/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_GLEW)/include
# Blender stuff
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index 0d4abf1e1fe..377d765af85 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -38,7 +38,6 @@ SET(INC
../../../../intern/ghost
../../../../intern/guardedalloc
../../../../intern/moto/include
- ../../../../intern/SoundSystem
../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
../../../../source/kernel/gen_system
../../../../source/kernel/gen_messaging
@@ -58,14 +57,11 @@ SET(INC
../../../../source/gameengine/Network
../../../../source/gameengine/SceneGraph
../../../../source/gameengine/Physics/common
- ../../../../source/gameengine/Physics/Sumo
- ../../../../source/gameengine/Physics/Sumo/Fuzzics/include
../../../../source/gameengine/Network/LoopBackNetwork
../../../../source/gameengine/GamePlayer/common
../../../../source/blender/misc
../../../../source/blender/blenloader
../../../../source/blender/gpu
- ../../../../extern/solid
../../../../extern/glew/include
${PYTHON_INC}
)
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index a3805bd4317..8ec41968042 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -57,6 +57,7 @@ extern "C"
#include "BLO_readfile.h"
#include "BKE_global.h"
#include "BKE_main.h"
+#include "BKE_sound.h"
#include "IMB_imbuf.h"
#include "DNA_scene_types.h"
#ifdef __cplusplus
@@ -84,7 +85,6 @@ extern "C"
#include "KX_BlenderSceneConverter.h"
#include "NG_LoopBackNetworkDeviceInterface.h"
-#include "SND_DeviceManager.h"
#include "GPC_MouseDevice.h"
#include "GPC_RenderTools.h"
@@ -125,8 +125,7 @@ GPG_Application::GPG_Application(GHOST_ISystem* system)
m_rendertools(0),
m_rasterizer(0),
m_sceneconverter(0),
- m_networkdevice(0),
- m_audiodevice(0),
+ m_networkdevice(0),
m_blendermat(0),
m_blenderglslmat(0),
m_pyGlobalDictString(0),
@@ -524,16 +523,17 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
// SYS_WriteCommandLineInt(syshandle, "fixedtime", 0);
// SYS_WriteCommandLineInt(syshandle, "vertexarrays",1);
+ GameData *gm= &m_startScene->gm;
bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0);
bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0);
- bool fixedFr = (G.fileflags & G_FILE_ENABLE_ALL_FRAMES);
+ bool fixedFr = (gm->flag & GAME_ENABLE_ALL_FRAMES);
- bool showPhysics = (G.fileflags & G_FILE_SHOW_PHYSICS);
+ bool showPhysics = (gm->flag & GAME_SHOW_PHYSICS);
SYS_WriteCommandLineInt(syshandle, "show_physics", showPhysics);
bool fixed_framerate= (SYS_GetCommandLineInt(syshandle, "fixed_framerate", fixedFr) != 0);
bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0);
- bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DISPLAY_LISTS) != 0);
+ bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", gm->flag & GAME_DISPLAY_LISTS) != 0);
bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 1) != 0);
if(GLEW_ARB_multitexture && GLEW_VERSION_1_1)
@@ -541,7 +541,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
if(GPU_extensions_minimum_support())
m_blenderglslmat = (SYS_GetCommandLineInt(syshandle, "blender_glsl_material", 1) != 0);
- else if(G.fileflags & G_FILE_GAME_MAT_GLSL)
+ else if(gm->matmode == GAME_MAT_GLSL)
m_blendermat = false;
// create the canvas, rasterizer and rendertools
@@ -583,13 +583,8 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
if (!m_networkdevice)
goto initFailed;
- // get an audiodevice
- SND_DeviceManager::Subscribe();
- m_audiodevice = SND_DeviceManager::Instance();
- if (!m_audiodevice)
- goto initFailed;
- m_audiodevice->UseCD();
-
+ sound_init();
+
// create a ketsjisystem (only needed for timing and stuff)
m_kxsystem = new GPG_System (m_system);
if (!m_kxsystem)
@@ -606,7 +601,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
m_ketsjiengine->SetRenderTools(m_rendertools);
m_ketsjiengine->SetRasterizer(m_rasterizer);
m_ketsjiengine->SetNetworkDevice(m_networkdevice);
- m_ketsjiengine->SetAudioDevice(m_audiodevice);
+
m_ketsjiengine->SetTimingDisplay(frameRate, false, false);
CValue::SetDeprecationWarnings(nodepwarnings);
@@ -619,8 +614,8 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
return m_engineInitialized;
initFailed:
+ sound_exit();
delete m_kxsystem;
- delete m_audiodevice;
delete m_networkdevice;
delete m_mouse;
delete m_keyboard;
@@ -633,7 +628,6 @@ initFailed:
m_keyboard = NULL;
m_mouse = NULL;
m_networkdevice = NULL;
- m_audiodevice = NULL;
m_kxsystem = NULL;
return false;
}
@@ -671,15 +665,14 @@ bool GPG_Application::startEngine(void)
// if (always_use_expand_framing)
// sceneconverter->SetAlwaysUseExpandFraming(true);
- if(m_blendermat && (G.fileflags & G_FILE_GAME_MAT))
+ if(m_blendermat && (m_startScene->gm.matmode != GAME_MAT_TEXFACE))
m_sceneconverter->SetMaterials(true);
- if(m_blenderglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL))
+ if(m_blenderglslmat && (m_startScene->gm.matmode == GAME_MAT_GLSL))
m_sceneconverter->SetGLSLMaterials(true);
KX_Scene* startscene = new KX_Scene(m_keyboard,
m_mouse,
m_networkdevice,
- m_audiodevice,
startscenename,
m_startScene);
@@ -708,10 +701,8 @@ bool GPG_Application::startEngine(void)
loadGamePythonConfig(m_pyGlobalDictString, m_pyGlobalDictString_Length);
m_sceneconverter->ConvertScene(
- startscenename,
startscene,
dictionaryobject,
- m_keyboard,
m_rendertools,
m_canvas);
m_ketsjiengine->AddScene(startscene);
@@ -771,6 +762,7 @@ void GPG_Application::stopEngine()
void GPG_Application::exitEngine()
{
+ sound_exit();
if (m_ketsjiengine)
{
stopEngine();
@@ -782,11 +774,6 @@ void GPG_Application::exitEngine()
delete m_kxsystem;
m_kxsystem = 0;
}
- if (m_audiodevice)
- {
- SND_DeviceManager::Unsubscribe();
- m_audiodevice = 0;
- }
if (m_networkdevice)
{
delete m_networkdevice;
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h
index 845686f5770..73430213078 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h
@@ -38,7 +38,6 @@
class KX_KetsjiEngine;
class KX_ISceneConverter;
class NG_LoopBackNetworkDeviceInterface;
-class SND_IAudioDevice;
class RAS_IRasterizer;
class GHOST_IEvent;
class GHOST_ISystem;
@@ -142,8 +141,6 @@ protected:
KX_ISceneConverter* m_sceneconverter;
/** Network interface. */
NG_LoopBackNetworkDeviceInterface* m_networkdevice;
- /** Sound device. */
- SND_IAudioDevice* m_audiodevice;
bool m_blendermat;
bool m_blenderglslmat;
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 2433c587179..edc32093eab 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -67,6 +67,9 @@ extern "C"
int GHOST_HACK_getFirstFile(char buf[]);
+extern char bprogname[]; /* holds a copy of argv[0], from creator.c */
+extern char btempdir[]; /* use this to store a valid temp directory */
+
#ifdef __cplusplus
}
#endif // __cplusplus
diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile
index 49ad9457ee3..a7fcf46b695 100644
--- a/source/gameengine/GamePlayer/ghost/Makefile
+++ b/source/gameengine/GamePlayer/ghost/Makefile
@@ -39,7 +39,6 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../GamePlayer/common
diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript
index ca06b9ca0dd..6c71eafa1dc 100644
--- a/source/gameengine/GamePlayer/ghost/SConscript
+++ b/source/gameengine/GamePlayer/ghost/SConscript
@@ -13,7 +13,6 @@ incs = ['.',
'#intern/ghost',
'#intern/guardedalloc',
'#intern/moto/include',
- '#intern/SoundSystem',
'#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
'#source/kernel/gen_system',
'#source/kernel/gen_messaging',
@@ -43,14 +42,8 @@ incs = ['.',
incs += Split(env['BF_PYTHON_INC'])
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-defs = ''
+defs = []
if env['WITH_BF_FFMPEG']:
- defs += ' WITH_FFMPEG'
+ defs.append('WITH_FFMPEG')
-env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = Split(defs), libtype='player',priority=5, cxx_compileflags=cxxflags)
+env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = defs, libtype=['player'],priority=[5], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp
index a0a61d01bb2..109a693ec6d 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.cpp
+++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp
@@ -44,7 +44,7 @@ void BL_BlenderShader::SetProg(bool enable, double time)
{
if(VerifyShader()) {
if(enable)
- GPU_material_bind(mGPUMat, mLightLayer, mBlenderScene->lay, time);
+ GPU_material_bind(mGPUMat, mLightLayer, mBlenderScene->lay, time, 1);
else
GPU_material_unbind(mGPUMat);
}
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h
index 9af53bfc863..073ce8f1ca5 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.h
+++ b/source/gameengine/Ketsji/BL_BlenderShader.h
@@ -57,6 +57,13 @@ public:
int GetBlendMode();
bool Equals(BL_BlenderShader *blshader);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif//__BL_GPUSHADER_H__
diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h
index 4f572f95891..6b53e7fa8b1 100644
--- a/source/gameengine/Ketsji/BL_Material.h
+++ b/source/gameengine/Ketsji/BL_Material.h
@@ -4,6 +4,10 @@
#include "STR_String.h"
#include "MT_Point2.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
// --
struct MTex;
struct Material;
@@ -98,6 +102,13 @@ public:
void SetSharedMaterial(bool v);
bool IsShared();
void SetUsers(int num);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
// BL_Material::IdMode
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp
index 8bde5dd3a51..f548bcdaae1 100644
--- a/source/gameengine/Ketsji/BL_Shader.cpp
+++ b/source/gameengine/Ketsji/BL_Shader.cpp
@@ -765,31 +765,25 @@ PyAttributeDef BL_Shader::Attributes[] = {
};
PyTypeObject BL_Shader::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "BL_Shader",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &PyObjectPlus::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "BL_Shader",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProgram)" )
diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h
index 42969996b3e..b2610d7762a 100644
--- a/source/gameengine/Ketsji/BL_Shader.h
+++ b/source/gameengine/Ketsji/BL_Shader.h
@@ -25,6 +25,12 @@ public:
{
}
int mLoc; // Sampler location
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
/**
@@ -65,6 +71,13 @@ public:
int GetLocation() { return mLoc; }
void* getData() { return mData; }
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
/**
@@ -83,6 +96,13 @@ public:
int mType;
int mLoc;
unsigned int mFlag;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
/**
diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h
index 830ffceb0f7..2dfd9c542d3 100644
--- a/source/gameengine/Ketsji/BL_Texture.h
+++ b/source/gameengine/Ketsji/BL_Texture.h
@@ -67,6 +67,12 @@ public:
return tmp;
}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif//__BL_TEXTURE_H__
diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt
index f703841c40b..c91a3771b45 100644
--- a/source/gameengine/Ketsji/CMakeLists.txt
+++ b/source/gameengine/Ketsji/CMakeLists.txt
@@ -52,21 +52,18 @@ SET(INC
../../../source/gameengine/SceneGraph
../../../source/gameengine/Physics/common
../../../source/gameengine/Physics/Bullet
- ../../../source/gameengine/Physics/Sumo
- ../../../source/gameengine/Physics/Sumo/Fuzzics/include
../../../source/gameengine/Network/LoopBackNetwork
- ../../../intern/SoundSystem
+ ../../../intern/audaspace/intern
../../../source/blender/misc
../../../source/blender/blenloader
../../../source/blender/gpu
../../../extern/bullet2/src
- ../../../extern/solid
../../../extern/glew/include
${PYTHON_INC}
)
IF(WITH_SDL)
- SET(INC ${INC} ${SDL_INC})
+ SET(INC ${INC} ${SDL_INCLUDE_DIR})
ELSE(WITH_SDL)
ADD_DEFINITIONS(-DDISABLE_SDL)
ENDIF(WITH_SDL)
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
index de820ddaaae..3af8f765251 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
@@ -101,13 +101,7 @@ CValue* KX_NetworkMessageActuator::GetReplica()
/* Integration hooks -------------------------------------------------- */
PyTypeObject KX_NetworkMessageActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_NetworkMessageActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -129,16 +123,6 @@ PyTypeObject KX_NetworkMessageActuator::Type = {
};
PyMethodDef KX_NetworkMessageActuator::Methods[] = {
- // Deprecated ----->
- {"setToPropName", (PyCFunction)
- KX_NetworkMessageActuator::sPySetToPropName, METH_VARARGS},
- {"setSubject", (PyCFunction)
- KX_NetworkMessageActuator::sPySetSubject, METH_VARARGS},
- {"setBodyType", (PyCFunction)
- KX_NetworkMessageActuator::sPySetBodyType, METH_VARARGS},
- {"setBody", (PyCFunction)
- KX_NetworkMessageActuator::sPySetBody, METH_VARARGS},
- // <-----
{NULL,NULL} // Sentinel
};
@@ -149,78 +133,3 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = {
KX_PYATTRIBUTE_STRING_RW("body", 0, 16384, false, KX_NetworkMessageActuator, m_body),
{ NULL } //Sentinel
};
-
-// Deprecated ----->
-// 1. SetToPropName
-PyObject* KX_NetworkMessageActuator::PySetToPropName(
- PyObject* args,
- PyObject* kwds)
-{
- ShowDeprecationWarning("setToProp()", "the propName property");
- char* ToPropName;
-
- if (PyArg_ParseTuple(args, "s:setToPropName", &ToPropName)) {
- m_toPropName = ToPropName;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-// 2. SetSubject
-PyObject* KX_NetworkMessageActuator::PySetSubject(
- PyObject* args,
- PyObject* kwds)
-{
- ShowDeprecationWarning("setSubject()", "the subject property");
- char* Subject;
-
- if (PyArg_ParseTuple(args, "s:setSubject", &Subject)) {
- m_subject = Subject;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-// 3. SetBodyType
-PyObject* KX_NetworkMessageActuator::PySetBodyType(
- PyObject* args,
- PyObject* kwds)
-{
- ShowDeprecationWarning("setBodyType()", "the usePropBody property");
- int BodyType;
-
- if (PyArg_ParseTuple(args, "i:setBodyType", &BodyType)) {
- m_bPropBody = (BodyType != 0);
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-// 4. SetBody
-PyObject* KX_NetworkMessageActuator::PySetBody(
- PyObject* args,
- PyObject* kwds)
-{
- ShowDeprecationWarning("setBody()", "the body property");
- char* Body;
-
- if (PyArg_ParseTuple(args, "s:setBody", &Body)) {
- m_body = Body;
- }
- else {
- return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-// <----- Deprecated
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h
index b4f55f2a466..fa7a674c250 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h
@@ -60,13 +60,6 @@ public:
/* Python interface ------------------------------------------- */
/* ------------------------------------------------------------ */
- // Deprecated ----->
- KX_PYMETHOD(KX_NetworkMessageActuator, SetToPropName);
- KX_PYMETHOD(KX_NetworkMessageActuator, SetSubject);
- KX_PYMETHOD(KX_NetworkMessageActuator, SetBodyType);
- KX_PYMETHOD(KX_NetworkMessageActuator, SetBody);
- // <-----
-
};
#endif //__KX_NETWORKMESSAGEACTUATOR_H
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
index 78dda1f6db7..392e9dd9d1b 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
@@ -53,7 +53,6 @@ KX_NetworkMessageSensor::KX_NetworkMessageSensor(
const STR_String &subject
) :
SCA_ISensor(gameobj,eventmgr),
- m_Networkeventmgr(eventmgr),
m_NetworkScene(NetworkScene),
m_subject(subject),
m_frame_message_count (0),
@@ -165,13 +164,7 @@ bool KX_NetworkMessageSensor::IsPositiveTrigger()
/* Integration hooks --------------------------------------------------- */
PyTypeObject KX_NetworkMessageSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_NetworkMessageSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -193,23 +186,6 @@ PyTypeObject KX_NetworkMessageSensor::Type = {
};
PyMethodDef KX_NetworkMessageSensor::Methods[] = {
- // Deprecated ----->
- {"setSubjectFilterText", (PyCFunction)
- KX_NetworkMessageSensor::sPySetSubjectFilterText, METH_O,
- (PY_METHODCHAR)SetSubjectFilterText_doc},
- {"getFrameMessageCount", (PyCFunction)
- KX_NetworkMessageSensor::sPyGetFrameMessageCount, METH_NOARGS,
- (PY_METHODCHAR)GetFrameMessageCount_doc},
- {"getBodies", (PyCFunction)
- KX_NetworkMessageSensor::sPyGetBodies, METH_NOARGS,
- (PY_METHODCHAR)GetBodies_doc},
- {"getSubject", (PyCFunction)
- KX_NetworkMessageSensor::sPyGetSubject, METH_NOARGS,
- (PY_METHODCHAR)GetSubject_doc},
- {"getSubjects", (PyCFunction)
- KX_NetworkMessageSensor::sPyGetSubjects, METH_NOARGS,
- (PY_METHODCHAR)GetSubjects_doc},
- // <-----
{NULL,NULL} //Sentinel
};
@@ -240,75 +216,3 @@ PyObject* KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PY
return (new CListValue())->NewProxy(true);
}
}
-
-// Deprecated ----->
-// 1. Set the message subject that this sensor listens for
-const char KX_NetworkMessageSensor::SetSubjectFilterText_doc[] =
-"\tsetSubjectFilterText(value)\n"
-"\tChange the message subject text that this sensor is listening to.\n";
-
-PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText(PyObject* value)
-{
- ShowDeprecationWarning("setSubjectFilterText()", "subject");
- char* Subject = _PyUnicode_AsString(value);
- if (Subject==NULL) {
- PyErr_SetString(PyExc_TypeError, "sensor.tsetSubjectFilterText(string): KX_NetworkMessageSensor, expected a string message");
- return NULL;
- }
-
- m_subject = Subject;
- Py_RETURN_NONE;
-}
-
-// 2. Get the number of messages received since the last frame
-const char KX_NetworkMessageSensor::GetFrameMessageCount_doc[] =
-"\tgetFrameMessageCount()\n"
-"\tGet the number of messages received since the last frame.\n";
-
-PyObject* KX_NetworkMessageSensor::PyGetFrameMessageCount()
-{
- ShowDeprecationWarning("getFrameMessageCount()", "frameMessageCount");
- return PyLong_FromSsize_t(long(m_frame_message_count));
-}
-
-// 3. Get the message bodies
-const char KX_NetworkMessageSensor::GetBodies_doc[] =
-"\tgetBodies()\n"
-"\tGet the list of message bodies.\n";
-
-PyObject* KX_NetworkMessageSensor::PyGetBodies()
-{
- ShowDeprecationWarning("getBodies()", "bodies");
- if (m_BodyList) {
- return m_BodyList->GetProxy();
- } else {
- return (new CListValue())->NewProxy(true);
- }
-}
-
-// 4. Get the message subject: field of the message sensor
-const char KX_NetworkMessageSensor::GetSubject_doc[] =
-"\tgetSubject()\n"
-"\tGet the subject: field of the message sensor.\n";
-
-PyObject* KX_NetworkMessageSensor::PyGetSubject()
-{
- ShowDeprecationWarning("getSubject()", "subject");
- return PyUnicode_FromString(m_subject ? m_subject : "");
-}
-
-// 5. Get the message subjects
-const char KX_NetworkMessageSensor::GetSubjects_doc[] =
-"\tgetSubjects()\n"
-"\tGet list of message subjects.\n";
-
-PyObject* KX_NetworkMessageSensor::PyGetSubjects()
-{
- ShowDeprecationWarning("getSubjects()", "subjects");
- if (m_SubjectList) {
- return m_SubjectList->GetProxy();
- } else {
- return (new CListValue())->NewProxy(true);
- }
-}
-// <----- Deprecated
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
index ade87697303..d8a0651d2f1 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
@@ -39,7 +39,6 @@ class KX_NetworkMessageSensor : public SCA_ISensor
{
// note: Py_Header MUST BE the first listed here
Py_Header;
- KX_NetworkEventManager *m_Networkeventmgr;
NG_NetworkScene *m_NetworkScene;
// The subject we filter on.
@@ -71,14 +70,6 @@ public:
/* Python interface -------------------------------------------- */
/* ------------------------------------------------------------- */
- // Deprecated ----->
- KX_PYMETHOD_DOC_O(KX_NetworkMessageSensor, SetSubjectFilterText);
- KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetFrameMessageCount);
- KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetBodies);
- KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubject);
- KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubjects);
- // <-----
-
/* attributes */
static PyObject* pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript
index e6584b55ed2..6429bd76a37 100644
--- a/source/gameengine/Ketsji/KXNetwork/SConscript
+++ b/source/gameengine/Ketsji/KXNetwork/SConscript
@@ -9,11 +9,4 @@ incs += ' #source/gameengine/Network #source/gameengine/SceneGraph'
incs += ' ' + env['BF_PYTHON_INC']
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-
-env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 145], cxx_compileflags=cxxflags )
+env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=[],libtype=['core'], priority=[400], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index 314becc702d..be3d4906761 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -59,8 +59,7 @@ KX_BlenderMaterial::KX_BlenderMaterial()
void KX_BlenderMaterial::Initialize(
KX_Scene *scene,
BL_Material *data,
- bool skin,
- int lightlayer)
+ bool skin)
{
RAS_IPolyMaterial::Initialize(
data->texname[0],
@@ -72,8 +71,7 @@ void KX_BlenderMaterial::Initialize(
data->mode,
data->transp,
((data->ras_mode &ALPHA)!=0),
- ((data->ras_mode &ZSORT)!=0),
- lightlayer
+ ((data->ras_mode &ZSORT)!=0)
);
mMaterial = data;
mShader = 0;
@@ -237,7 +235,7 @@ void KX_BlenderMaterial::OnExit()
}
if( mMaterial->tface )
- GPU_set_tpage(mMaterial->tface);
+ GPU_set_tpage(mMaterial->tface, 1);
}
@@ -776,6 +774,7 @@ void KX_BlenderMaterial::UpdateIPO(
mMaterial->hard = (float)(hard);
mMaterial->emit = (float)(emit);
mMaterial->spec_f = (float)(spec);
+ mMaterial->ref = (float)(ref);
}
@@ -795,31 +794,25 @@ PyAttributeDef KX_BlenderMaterial::Attributes[] = {
};
PyTypeObject KX_BlenderMaterial::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_BlenderMaterial",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &PyObjectPlus::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_BlenderMaterial",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
index 1f5edc1d7d1..cdbdc4bd429 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.h
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -15,6 +15,10 @@
#include "MT_Vector3.h"
#include "MT_Vector4.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
struct MTFace;
class KX_Scene;
@@ -27,8 +31,7 @@ public:
void Initialize(
class KX_Scene* scene,
BL_Material* mat,
- bool skin,
- int lightlayer
+ bool skin
);
virtual ~KX_BlenderMaterial();
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
index 755b1cbd780..7fc799abb7e 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
@@ -18,7 +18,6 @@ private:
btCollisionShape* m_bulletChildShape;
public:
-
KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool compound);
virtual ~KX_BulletPhysicsController ();
@@ -81,6 +80,12 @@ public:
// intentionally empty
};
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //KX_BULLET2PHYSICS_CONTROLLER
diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp
deleted file mode 100644
index bfca81f45d9..00000000000
--- a/source/gameengine/Ketsji/KX_CDActuator.cpp
+++ /dev/null
@@ -1,295 +0,0 @@
-/**
- * KX_CDActuator.cpp
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#include "KX_CDActuator.h"
-#include "SND_CDObject.h"
-#include "KX_GameObject.h"
-#include "SND_Scene.h" // needed for replication
-#include <iostream>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* ------------------------------------------------------------------------- */
-/* Native functions */
-/* ------------------------------------------------------------------------- */
-KX_CDActuator::KX_CDActuator(SCA_IObject* gameobject,
- SND_Scene* soundscene,
- KX_CDACT_TYPE type,
- int track,
- short start,
- short end)
- : SCA_IActuator(gameobject)
-{
- m_soundscene = soundscene;
- m_type = type;
- m_track = track;
- m_lastEvent = true;
- m_isplaying = false;
- m_startFrame = start;
- m_endFrame = end;
- m_gain = SND_CDObject::Instance()->GetGain();
-}
-
-
-
-KX_CDActuator::~KX_CDActuator()
-{
-}
-
-
-/* hmmm, do we want this? */
-CValue* KX_CDActuator::GetReplica()
-{
- KX_CDActuator* replica = new KX_CDActuator(*this);
- replica->ProcessReplica();
- return replica;
-};
-
-
-
-bool KX_CDActuator::Update()
-{
- bool result = false;
- bool bNegativeEvent = IsNegativeEvent();
-
- RemoveAllEvents();
-
- if (!bNegativeEvent)
- {
- switch (m_type)
- {
- case KX_CDACT_PLAY_ALL:
- {
- SND_CDObject::Instance()->SetPlaymode(SND_CD_ALL);
- SND_CDObject::Instance()->SetTrack(1);
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY);
- //result = true;
- break;
- }
- case KX_CDACT_PLAY_TRACK:
- {
- SND_CDObject::Instance()->SetPlaymode(SND_CD_TRACK);
- SND_CDObject::Instance()->SetTrack(m_track);
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY);
- //result = true;
- break;
- }
- case KX_CDACT_LOOP_TRACK:
- {
- SND_CDObject::Instance()->SetPlaymode(SND_CD_ALL);
- SND_CDObject::Instance()->SetTrack(m_track);
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY);
- //result = true;
- break;
- }
- case KX_CDACT_STOP:
- {
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_STOP);
- break;
- }
- case KX_CDACT_PAUSE:
- {
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PAUSE);
- //result = true;
- break;
- }
- case KX_CDACT_RESUME:
- {
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_RESUME);
- //result = true;
- break;
- }
- case KX_CDACT_VOLUME:
- {
- SND_CDObject::Instance()->SetGain(m_gain);
- //result = true;
- break;
- }
- default:
- // implement me !!
- break;
- }
- }
- return result;
-}
-
-
-
-/* ------------------------------------------------------------------------- */
-/* Python functions */
-/* ------------------------------------------------------------------------- */
-
-
-
-/* Integration hooks ------------------------------------------------------- */
-PyTypeObject KX_CDActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
- PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_SoundActuator",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IActuator::Type,
- 0,0,0,0,0,0,
- py_base_new
-};
-
-PyMethodDef KX_CDActuator::Methods[] = {
- // Deprecated ----->
- {"setGain",(PyCFunction) KX_CDActuator::sPySetGain,METH_VARARGS,NULL},
- {"getGain",(PyCFunction) KX_CDActuator::sPyGetGain,METH_VARARGS,NULL},
- // <-----
- KX_PYMETHODTABLE_NOARGS(KX_CDActuator, startCD),
- KX_PYMETHODTABLE_NOARGS(KX_CDActuator, pauseCD),
- KX_PYMETHODTABLE_NOARGS(KX_CDActuator, resumeCD),
- KX_PYMETHODTABLE_NOARGS(KX_CDActuator, stopCD),
- KX_PYMETHODTABLE_NOARGS(KX_CDActuator, playAll),
- KX_PYMETHODTABLE_O(KX_CDActuator, playTrack),
- {NULL,NULL,NULL,NULL} //Sentinel
-};
-
-PyAttributeDef KX_CDActuator::Attributes[] = {
- KX_PYATTRIBUTE_FLOAT_RW_CHECK("volume", 0.0, 1.0, KX_CDActuator, m_gain,pyattr_setGain),
- KX_PYATTRIBUTE_INT_RW("track", 1, 99, false, KX_CDActuator, m_track),
- { NULL } //Sentinel
-};
-
-int KX_CDActuator::pyattr_setGain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_CDActuator* act = static_cast<KX_CDActuator*>(self);
- SND_CDObject::Instance()->SetGain(act->m_gain);
- return PY_SET_ATTR_SUCCESS;
-}
-
-KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, startCD,
-"startCD()\n"
-"\tStarts the CD playing.\n")
-{
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY);
- Py_RETURN_NONE;
-}
-
-
-KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, pauseCD,
-"pauseCD()\n"
-"\tPauses the CD playing.\n")
-{
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PAUSE);
- Py_RETURN_NONE;
-}
-
-
-KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, resumeCD,
-"resumeCD()\n"
-"\tResumes the CD playing.\n")
-{
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_RESUME);
- Py_RETURN_NONE;
-}
-
-
-KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, stopCD,
-"stopCD()\n"
-"\tStops the CD playing.\n")
-{
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_STOP);
- Py_RETURN_NONE;
-}
-
-
-KX_PYMETHODDEF_DOC_O(KX_CDActuator, playTrack,
-"playTrack(trackNumber)\n"
-"\tPlays the track selected.\n")
-{
- if (PyLong_Check(value)) {
- int track = PyLong_AsSsize_t(value);
- SND_CDObject::Instance()->SetPlaymode(SND_CD_TRACK);
- SND_CDObject::Instance()->SetTrack(track);
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY);
- }
- Py_RETURN_NONE;
-}
-
-
-
-KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, playAll,
-"playAll()\n"
-"\tPlays the CD from the beginning.\n")
-{
- SND_CDObject::Instance()->SetPlaymode(SND_CD_ALL);
- SND_CDObject::Instance()->SetTrack(1);
- SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY);
- Py_RETURN_NONE;
-}
-
-// Deprecated ----->
-PyObject* KX_CDActuator::PySetGain(PyObject* args)
-{
- float gain = 1.0;
- ShowDeprecationWarning("setGain()", "the volume property");
- if (!PyArg_ParseTuple(args, "f:setGain", &gain))
- return NULL;
-
- SND_CDObject::Instance()->SetGain(gain);
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* KX_CDActuator::PyGetGain(PyObject* args)
-{
- float gain = SND_CDObject::Instance()->GetGain();
- ShowDeprecationWarning("getGain()", "the volume property");
- PyObject* result = PyFloat_FromDouble(gain);
-
- return result;
-}
-// <-----
diff --git a/source/gameengine/Ketsji/KX_CDActuator.h b/source/gameengine/Ketsji/KX_CDActuator.h
deleted file mode 100644
index b01ad73777e..00000000000
--- a/source/gameengine/Ketsji/KX_CDActuator.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * KX_CDActuator.h
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __KX_CDACTUATOR
-#define __KX_CDACTUATOR
-
-#include "SCA_IActuator.h"
-#include "SND_CDObject.h"
-
-class KX_CDActuator : public SCA_IActuator
-{
- Py_Header;
- bool m_lastEvent;
- bool m_isplaying;
- /* just some handles to the audio-data... */
- class SND_Scene* m_soundscene;
- int m_track;
- float m_gain;
- short m_startFrame;
- short m_endFrame;
-
-public:
- enum KX_CDACT_TYPE
- {
- KX_CDACT_NODEF = 0,
- KX_CDACT_PLAY_ALL,
- KX_CDACT_PLAY_TRACK,
- KX_CDACT_LOOP_TRACK,
- KX_CDACT_VOLUME,
- KX_CDACT_STOP,
- KX_CDACT_PAUSE,
- KX_CDACT_RESUME,
- KX_SOUNDACT_MAX
- };
-
- KX_CDACT_TYPE m_type;
-
- KX_CDActuator(SCA_IObject* gameobject,
- SND_Scene* soundscene,
- KX_CDACT_TYPE type,
- int track,
- short start,
- short end);
-
- ~KX_CDActuator();
-
- virtual bool Update();
-
- CValue* GetReplica();
-
- /* -------------------------------------------------------------------- */
- /* Python interface --------------------------------------------------- */
- /* -------------------------------------------------------------------- */
-
- // Deprecated ----->
- KX_PYMETHOD_VARARGS(KX_CDActuator,SetGain);
- KX_PYMETHOD_VARARGS(KX_CDActuator,GetGain);
- // <-----
-
- KX_PYMETHOD_DOC_NOARGS(KX_CDActuator, startCD);
- KX_PYMETHOD_DOC_NOARGS(KX_CDActuator, pauseCD);
- KX_PYMETHOD_DOC_NOARGS(KX_CDActuator, resumeCD);
- KX_PYMETHOD_DOC_NOARGS(KX_CDActuator, stopCD);
- KX_PYMETHOD_DOC_NOARGS(KX_CDActuator, playAll);
- KX_PYMETHOD_DOC_O(KX_CDActuator, playTrack);
-
- static int pyattr_setGain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
-
-
-};
-
-#endif //__KX_CDACTUATOR
-
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index f762699f780..0832809772d 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -496,12 +496,6 @@ PyMethodDef KX_Camera::Methods[] = {
KX_PYMETHODTABLE_O(KX_Camera, getScreenPosition),
KX_PYMETHODTABLE(KX_Camera, getScreenVect),
KX_PYMETHODTABLE(KX_Camera, getScreenRay),
-
- // DEPRECATED
- KX_PYMETHODTABLE_O(KX_Camera, enableViewport),
- KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix),
- KX_PYMETHODTABLE_O(KX_Camera, setProjectionMatrix),
-
{NULL,NULL} //Sentinel
};
@@ -530,37 +524,31 @@ PyAttributeDef KX_Camera::Attributes[] = {
};
PyTypeObject KX_Camera::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_Camera",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,
- &KX_GameObject::Sequence,
- &KX_GameObject::Mapping,
- 0,0,0,
- NULL,
- NULL,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &KX_GameObject::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_Camera",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,
+ &KX_GameObject::Sequence,
+ &KX_GameObject::Mapping,
+ 0,0,0,
+ NULL,
+ NULL,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &KX_GameObject::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum,
@@ -686,92 +674,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getWorldToCamera,
return PyObjectFrom(GetWorldToCamera()); /* new ref */
}
-KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getProjectionMatrix,
-"getProjectionMatrix() -> Matrix4x4\n"
-"\treturns this camera's projection matrix, as a list of four lists of four values.\n\n"
-"\tie: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])\n"
-)
-{
- ShowDeprecationWarning("getProjectionMatrix()", "the projection_matrix property");
- return PyObjectFrom(GetProjectionMatrix()); /* new ref */
-}
-
-KX_PYMETHODDEF_DOC_O(KX_Camera, setProjectionMatrix,
-"setProjectionMatrix(MT_Matrix4x4 m) -> None\n"
-"\tSets this camera's projection matrix\n"
-"\n"
-"\tExample:\n"
-"\timport GameLogic\n"
-"\t# Set a perspective projection matrix\n"
-"\tdef Perspective(left, right, bottom, top, near, far):\n"
-"\t\tm = MT_Matrix4x4()\n"
-"\t\tm[0][0] = m[0][2] = right - left\n"
-"\t\tm[1][1] = m[1][2] = top - bottom\n"
-"\t\tm[2][2] = m[2][3] = -far - near\n"
-"\t\tm[3][2] = -1\n"
-"\t\tm[3][3] = 0\n"
-"\t\treturn m\n"
-"\n"
-"\t# Set an orthographic projection matrix\n"
-"\tdef Orthographic(left, right, bottom, top, near, far):\n"
-"\t\tm = MT_Matrix4x4()\n"
-"\t\tm[0][0] = right - left\n"
-"\t\tm[0][3] = -right - left\n"
-"\t\tm[1][1] = top - bottom\n"
-"\t\tm[1][3] = -top - bottom\n"
-"\t\tm[2][2] = far - near\n"
-"\t\tm[2][3] = -far - near\n"
-"\t\tm[3][3] = 1\n"
-"\t\treturn m\n"
-"\n"
-"\t# Set an isometric projection matrix\n"
-"\tdef Isometric(left, right, bottom, top, near, far):\n"
-"\t\tm = MT_Matrix4x4()\n"
-"\t\tm[0][0] = m[0][2] = m[1][1] = 0.8660254037844386\n"
-"\t\tm[1][0] = 0.25\n"
-"\t\tm[1][2] = -0.25\n"
-"\t\tm[3][3] = 1\n"
-"\t\treturn m\n"
-"\n"
-"\t"
-"\tco = GameLogic.getCurrentController()\n"
-"\tcam = co.getOwner()\n"
-"\tcam.setProjectionMatrix(Perspective(-1.0, 1.0, -1.0, 1.0, 0.1, 1))\n")
-{
- ShowDeprecationWarning("setProjectionMatrix(mat)", "the projection_matrix property");
-
- MT_Matrix4x4 mat;
- if (!PyMatTo(value, mat))
- {
- PyErr_SetString(PyExc_TypeError, "camera.setProjectionMatrix(matrix): KX_Camera, expected 4x4 list as matrix argument.");
- return NULL;
- }
-
- SetProjectionMatrix(mat);
- Py_RETURN_NONE;
-}
-
-KX_PYMETHODDEF_DOC_O(KX_Camera, enableViewport,
-"enableViewport(viewport)\n"
-"Sets this camera's viewport status\n"
-)
-{
- ShowDeprecationWarning("enableViewport(bool)", "the useViewport property");
-
- int viewport = PyObject_IsTrue(value);
- if (viewport == -1) {
- PyErr_SetString(PyExc_ValueError, "camera.enableViewport(bool): KX_Camera, expected True/False or 0/1");
- return NULL;
- }
-
- if(viewport)
- EnableViewport(true);
- else
- EnableViewport(false);
-
- Py_RETURN_NONE;
-}
-
KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, setViewport,
"setViewport(left, bottom, right, top)\n"
"Sets this camera's viewport\n")
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h
index 74c8e6d4e4f..bf7a39d93c8 100644
--- a/source/gameengine/Ketsji/KX_Camera.h
+++ b/source/gameengine/Ketsji/KX_Camera.h
@@ -273,10 +273,7 @@ public:
KX_PYMETHOD_DOC_NOARGS(KX_Camera, getCameraToWorld);
KX_PYMETHOD_DOC_NOARGS(KX_Camera, getWorldToCamera);
- KX_PYMETHOD_DOC_NOARGS(KX_Camera, getProjectionMatrix);
- KX_PYMETHOD_DOC_O(KX_Camera, setProjectionMatrix);
- KX_PYMETHOD_DOC_O(KX_Camera, enableViewport);
KX_PYMETHOD_DOC_VARARGS(KX_Camera, setViewport);
KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop);
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index 3d3b68ed85d..9c00b5991af 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -38,9 +38,6 @@
#include "PyObjectPlus.h"
-STR_String KX_CameraActuator::X_AXIS_STRING = "x";
-STR_String KX_CameraActuator::Y_AXIS_STRING = "y";
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -353,28 +350,13 @@ CValue *KX_CameraActuator::findObject(char *obName)
return NULL;
}
-bool KX_CameraActuator::string2axischoice(const char *axisString)
-{
- bool res = true;
-
- res = !(axisString == Y_AXIS_STRING);
-
- return res;
-}
-
/* ------------------------------------------------------------------------- */
/* Python functions */
/* ------------------------------------------------------------------------- */
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_CameraActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_CameraActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -396,17 +378,6 @@ PyTypeObject KX_CameraActuator::Type = {
};
PyMethodDef KX_CameraActuator::Methods[] = {
- // ---> deprecated (all)
- {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
- {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
- {"setMin" ,(PyCFunction) KX_CameraActuator::sPySetMin, METH_VARARGS, (PY_METHODCHAR)SetMin_doc},
- {"getMin" ,(PyCFunction) KX_CameraActuator::sPyGetMin, METH_NOARGS, (PY_METHODCHAR)GetMin_doc},
- {"setMax" ,(PyCFunction) KX_CameraActuator::sPySetMax, METH_VARARGS, (PY_METHODCHAR)SetMax_doc},
- {"getMax" ,(PyCFunction) KX_CameraActuator::sPyGetMax, METH_NOARGS, (PY_METHODCHAR)GetMax_doc},
- {"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight, METH_VARARGS, (PY_METHODCHAR)SetHeight_doc},
- {"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight, METH_NOARGS, (PY_METHODCHAR)GetHeight_doc},
- {"setXY" ,(PyCFunction) KX_CameraActuator::sPySetXY, METH_VARARGS, (PY_METHODCHAR)SetXY_doc},
- {"getXY" ,(PyCFunction) KX_CameraActuator::sPyGetXY, METH_NOARGS, (PY_METHODCHAR)GetXY_doc},
{NULL,NULL,NULL,NULL} //Sentinel
};
@@ -419,152 +390,6 @@ PyAttributeDef KX_CameraActuator::Attributes[] = {
{NULL}
};
-/* get obj ---------------------------------------------------------- */
-const char KX_CameraActuator::GetObject_doc[] =
-"getObject(name_only = 1)\n"
-"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
-"\tReturns the object this sensor reacts to.\n";
-PyObject* KX_CameraActuator::PyGetObject(PyObject* args)
-{
- int ret_name_only = 1;
-
- ShowDeprecationWarning("getObject()", "the object property");
-
- if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
- return NULL;
-
- if (!m_ob)
- Py_RETURN_NONE;
-
- if (ret_name_only)
- return PyUnicode_FromString(m_ob->GetName().ReadPtr());
- else
- return m_ob->GetProxy();
-}
-/* set obj ---------------------------------------------------------- */
-const char KX_CameraActuator::SetObject_doc[] =
-"setObject(object)\n"
-"\t- object: KX_GameObject, string or None\n"
-"\tSets the object this sensor reacts to.\n";
-PyObject* KX_CameraActuator::PySetObject(PyObject* value)
-{
- KX_GameObject *gameobj;
-
- ShowDeprecationWarning("setObject()", "the object property");
-
- if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_CameraActuator"))
- return NULL; // ConvertPythonToGameObject sets the error
-
- if (m_ob != NULL)
- m_ob->UnregisterActuator(this);
-
- m_ob = (SCA_IObject*)gameobj;
- if (m_ob)
- m_ob->RegisterActuator(this);
-
- Py_RETURN_NONE;
-}
-
-/* get min ---------------------------------------------------------- */
-const char KX_CameraActuator::GetMin_doc[] =
-"getMin\n"
-"\tReturns the minimum value set in the Min: field.\n";
-PyObject* KX_CameraActuator::PyGetMin()
-{
- ShowDeprecationWarning("getMin()", "the min property");
- return PyFloat_FromDouble(m_minHeight);
-}
-/* set min ---------------------------------------------------------- */
-const char KX_CameraActuator::SetMin_doc[] =
-"setMin\n"
-"\tSets the minimum value.\n";
-PyObject* KX_CameraActuator::PySetMin(PyObject* args)
-{
- ShowDeprecationWarning("setMin()", "the min property");
- float min;
- if(PyArg_ParseTuple(args,"f:setMin", &min))
- {
- m_minHeight = min;
- Py_RETURN_NONE;
- }
- return NULL;
-}
-/* get min ---------------------------------------------------------- */
-const char KX_CameraActuator::GetMax_doc[] =
-"getMax\n"
-"\tReturns the maximum value set in the Max: field.\n";
-PyObject* KX_CameraActuator::PyGetMax()
-{
- ShowDeprecationWarning("getMax()", "the max property");
- return PyFloat_FromDouble(m_maxHeight);
-}
-/* set min ---------------------------------------------------------- */
-const char KX_CameraActuator::SetMax_doc[] =
-"setMax\n"
-"\tSets the maximum value.\n";
-PyObject* KX_CameraActuator::PySetMax(PyObject* args)
-{
- ShowDeprecationWarning("getMax()", "the max property");
- float max;
- if(PyArg_ParseTuple(args,"f:setMax", &max))
- {
- m_maxHeight = max;
- Py_RETURN_NONE;
- }
- return NULL;
-}
-/* get height ---------------------------------------------------------- */
-const char KX_CameraActuator::GetHeight_doc[] =
-"getHeight\n"
-"\tReturns the height value set in the height: field.\n";
-PyObject* KX_CameraActuator::PyGetHeight()
-{
- ShowDeprecationWarning("getHeight()", "the height property");
- return PyFloat_FromDouble(m_height);
-}
-/* set height ---------------------------------------------------------- */
-const char KX_CameraActuator::SetHeight_doc[] =
-"setHeight\n"
-"\tSets the height value.\n";
-PyObject* KX_CameraActuator::PySetHeight(PyObject* args)
-{
- ShowDeprecationWarning("getHeight()", "the height property");
- float height;
- if(PyArg_ParseTuple(args,"f:setHeight", &height))
- {
- m_height = height;
- Py_RETURN_NONE;
- }
- return NULL;
-}
-/* set XY ---------------------------------------------------------- */
-const char KX_CameraActuator::SetXY_doc[] =
-"setXY\n"
-"\tSets axis the camera tries to get behind.\n"
-"\t1=x, 0=y\n";
-PyObject* KX_CameraActuator::PySetXY(PyObject* args)
-{
- ShowDeprecationWarning("setXY()", "the useXY property");
- int value;
- if(PyArg_ParseTuple(args,"i:setXY", &value))
- {
- m_x = value != 0;
- Py_RETURN_NONE;
- }
- return NULL;
-}
-
-/* get XY -------------------------------------------------------------*/
-const char KX_CameraActuator::GetXY_doc[] =
-"getXY\n"
-"\tGets the axis the camera tries to get behind.\n"
-"\tTrue = X, False = Y\n";
-PyObject* KX_CameraActuator::PyGetXY()
-{
- ShowDeprecationWarning("getXY()", "the xy property");
- return PyLong_FromSsize_t(m_x);
-}
-
PyObject* KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_CameraActuator* self= static_cast<KX_CameraActuator*>(self_v);
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h
index 057c6fed770..e047e3724ea 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.h
+++ b/source/gameengine/Ketsji/KX_CameraActuator.h
@@ -119,18 +119,6 @@ private :
/* --------------------------------------------------------------------- */
/* set object to look at */
- KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject);
- /* get current object */
- KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject);
- KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMin);
- KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMin);
- KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMax);
- KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMax);
- KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetHeight);
- KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetHeight);
- KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetXY);
- KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetXY);
-
static PyObject* pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.h b/source/gameengine/Ketsji/KX_CameraIpoSGController.h
index 33245e79c23..85d93962a14 100644
--- a/source/gameengine/Ketsji/KX_CameraIpoSGController.h
+++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.h
@@ -84,6 +84,13 @@ public:
m_modify_clipstart = modify;
}
void AddInterpolator(KX_IInterpolator* interp);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // KX_CAMERAIPOSGCONTROLLER_H
diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h
index 1898dc71ef8..74647dd47fd 100644
--- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h
+++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h
@@ -74,6 +74,13 @@ public:
bool isActor() { return m_type <= ACTOR; }
bool isSensor() { return m_type >= SENSOR && m_type <= OBACTORSENSOR; }
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_CLIENTOBJECT_INFO_H
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
index d09eae647c8..7f1d2c7d53c 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
@@ -36,6 +36,7 @@
#include "MT_Matrix3x3.h"
#include "KX_GameObject.h"
#include "KX_RayCast.h"
+#include "KX_PythonInit.h" // KX_GetActiveScene
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -327,7 +328,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
}
{
MT_Point3 topoint = position + (m_maximumBound) * direction;
- PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment();
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = obj->GetPhysicsController();
if (!pe) {
@@ -440,7 +441,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
}
normal.normalize();
{
- PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment();
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = obj->GetPhysicsController();
if (!pe) {
@@ -564,13 +565,7 @@ bool KX_ConstraintActuator::IsValidMode(KX_ConstraintActuator::KX_CONSTRAINTTYPE
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_ConstraintActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_ConstraintActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -592,30 +587,6 @@ PyTypeObject KX_ConstraintActuator::Type = {
};
PyMethodDef KX_ConstraintActuator::Methods[] = {
- // Deprecated -->
- {"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, (PY_METHODCHAR)SetDamp_doc},
- {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, (PY_METHODCHAR)GetDamp_doc},
- {"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, (PY_METHODCHAR)SetRotDamp_doc},
- {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, (PY_METHODCHAR)GetRotDamp_doc},
- {"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, (PY_METHODCHAR)SetDirection_doc},
- {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, (PY_METHODCHAR)GetDirection_doc},
- {"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, (PY_METHODCHAR)SetOption_doc},
- {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, (PY_METHODCHAR)GetOption_doc},
- {"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc},
- {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, (PY_METHODCHAR)GetTime_doc},
- {"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
- {"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (PY_METHODCHAR)SetMin_doc},
- {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (PY_METHODCHAR)GetMin_doc},
- {"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (PY_METHODCHAR)SetDistance_doc},
- {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (PY_METHODCHAR)GetDistance_doc},
- {"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (PY_METHODCHAR)SetMax_doc},
- {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (PY_METHODCHAR)GetMax_doc},
- {"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (PY_METHODCHAR)SetRayLength_doc},
- {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (PY_METHODCHAR)GetRayLength_doc},
- {"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, (PY_METHODCHAR)SetLimit_doc},
- {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, (PY_METHODCHAR)GetLimit_doc},
- // <--
{NULL,NULL} //Sentinel
};
@@ -647,318 +618,4 @@ int KX_ConstraintActuator::pyattr_check_direction(void *self, const struct KX_PY
return 0;
}
-/* 2. setDamp */
-const char KX_ConstraintActuator::SetDamp_doc[] =
-"setDamp(duration)\n"
-"\t- duration: integer\n"
-"\tSets the time constant of the orientation and distance constraint.\n"
-"\tIf the duration is negative, it is set to 0.\n";
-PyObject* KX_ConstraintActuator::PySetDamp(PyObject* args) {
- ShowDeprecationWarning("setDamp()", "the damp property");
- int dampArg;
- if(!PyArg_ParseTuple(args, "i:setDamp", &dampArg)) {
- return NULL;
- }
-
- m_posDampTime = dampArg;
- if (m_posDampTime < 0) m_posDampTime = 0;
-
- Py_RETURN_NONE;
-}
-/* 3. getDamp */
-const char KX_ConstraintActuator::GetDamp_doc[] =
-"getDamp()\n"
-"\tReturns the damping parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetDamp(){
- ShowDeprecationWarning("getDamp()", "the damp property");
- return PyLong_FromSsize_t(m_posDampTime);
-}
-
-/* 2. setRotDamp */
-const char KX_ConstraintActuator::SetRotDamp_doc[] =
-"setRotDamp(duration)\n"
-"\t- duration: integer\n"
-"\tSets the time constant of the orientation constraint.\n"
-"\tIf the duration is negative, it is set to 0.\n";
-PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* args) {
- ShowDeprecationWarning("setRotDamp()", "the rotDamp property");
- int dampArg;
- if(!PyArg_ParseTuple(args, "i:setRotDamp", &dampArg)) {
- return NULL;
- }
-
- m_rotDampTime = dampArg;
- if (m_rotDampTime < 0) m_rotDampTime = 0;
-
- Py_RETURN_NONE;
-}
-/* 3. getRotDamp */
-const char KX_ConstraintActuator::GetRotDamp_doc[] =
-"getRotDamp()\n"
-"\tReturns the damping time for application of the constraint.\n";
-PyObject* KX_ConstraintActuator::PyGetRotDamp(){
- ShowDeprecationWarning("getRotDamp()", "the rotDamp property");
- return PyLong_FromSsize_t(m_rotDampTime);
-}
-
-/* 2. setDirection */
-const char KX_ConstraintActuator::SetDirection_doc[] =
-"setDirection(vector)\n"
-"\t- vector: 3-tuple\n"
-"\tSets the reference direction in world coordinate for the orientation constraint.\n";
-PyObject* KX_ConstraintActuator::PySetDirection(PyObject* args) {
- ShowDeprecationWarning("setDirection()", "the direction property");
- float x, y, z;
- MT_Scalar len;
- MT_Vector3 dir;
-
- if(!PyArg_ParseTuple(args, "(fff):setDirection", &x, &y, &z)) {
- return NULL;
- }
- dir[0] = x;
- dir[1] = y;
- dir[2] = z;
- len = dir.length();
- if (MT_fuzzyZero(len)) {
- std::cout << "Invalid direction" << std::endl;
- return NULL;
- }
- m_refDirVector = dir/len;
- m_refDirection[0] = x/len;
- m_refDirection[1] = y/len;
- m_refDirection[2] = z/len;
-
- Py_RETURN_NONE;
-}
-/* 3. getDirection */
-const char KX_ConstraintActuator::GetDirection_doc[] =
-"getDirection()\n"
-"\tReturns the reference direction of the orientation constraint as a 3-tuple.\n";
-PyObject* KX_ConstraintActuator::PyGetDirection(){
- ShowDeprecationWarning("getDirection()", "the direction property");
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_refDirection[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_refDirection[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_refDirection[2]));
- return retVal;
-}
-
-/* 2. setOption */
-const char KX_ConstraintActuator::SetOption_doc[] =
-"setOption(option)\n"
-"\t- option: integer\n"
-"\tSets several options of the distance constraint.\n"
-"\tBinary combination of the following values:\n"
-"\t\t 64 : Activate alignment to surface\n"
-"\t\t128 : Detect material rather than property\n"
-"\t\t256 : No deactivation if ray does not hit target\n"
-"\t\t512 : Activate distance control\n";
-PyObject* KX_ConstraintActuator::PySetOption(PyObject* args) {
- ShowDeprecationWarning("setOption()", "the option property");
- int option;
- if(!PyArg_ParseTuple(args, "i:setOption", &option)) {
- return NULL;
- }
-
- m_option = option;
-
- Py_RETURN_NONE;
-}
-/* 3. getOption */
-const char KX_ConstraintActuator::GetOption_doc[] =
-"getOption()\n"
-"\tReturns the option parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetOption(){
- ShowDeprecationWarning("getOption()", "the option property");
- return PyLong_FromSsize_t(m_option);
-}
-
-/* 2. setTime */
-const char KX_ConstraintActuator::SetTime_doc[] =
-"setTime(duration)\n"
-"\t- duration: integer\n"
-"\tSets the activation time of the actuator.\n"
-"\tThe actuator disables itself after this many frame.\n"
-"\tIf set to 0 or negative, the actuator is not limited in time.\n";
-PyObject* KX_ConstraintActuator::PySetTime(PyObject* args) {
- ShowDeprecationWarning("setTime()", "the time property");
- int t;
- if(!PyArg_ParseTuple(args, "i:setTime", &t)) {
- return NULL;
- }
-
- if (t < 0)
- t = 0;
- m_activeTime = t;
-
- Py_RETURN_NONE;
-}
-/* 3. getTime */
-const char KX_ConstraintActuator::GetTime_doc[] =
-"getTime()\n"
-"\tReturns the time parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetTime(){
- ShowDeprecationWarning("getTime()", "the time property");
- return PyLong_FromSsize_t(m_activeTime);
-}
-
-/* 2. setProperty */
-const char KX_ConstraintActuator::SetProperty_doc[] =
-"setProperty(property)\n"
-"\t- property: string\n"
-"\tSets the name of the property or material for the ray detection of the distance constraint.\n"
-"\tIf empty, the ray will detect any collisioning object.\n";
-PyObject* KX_ConstraintActuator::PySetProperty(PyObject* args) {
- ShowDeprecationWarning("setProperty()", "the 'property' property");
- char *property;
- if (!PyArg_ParseTuple(args, "s:setProperty", &property)) {
- return NULL;
- }
- if (property == NULL) {
- m_property = "";
- } else {
- m_property = property;
- }
-
- Py_RETURN_NONE;
-}
-/* 3. getProperty */
-const char KX_ConstraintActuator::GetProperty_doc[] =
-"getProperty()\n"
-"\tReturns the property parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetProperty(){
- ShowDeprecationWarning("getProperty()", "the 'property' property");
- return PyUnicode_FromString(m_property.Ptr());
-}
-
-/* 4. setDistance */
-const char KX_ConstraintActuator::SetDistance_doc[] =
-"setDistance(distance)\n"
-"\t- distance: float\n"
-"\tSets the target distance in distance constraint\n";
-/* 4. setMin */
-const char KX_ConstraintActuator::SetMin_doc[] =
-"setMin(lower_bound)\n"
-"\t- lower_bound: float\n"
-"\tSets the lower value of the interval to which the value\n"
-"\tis clipped.\n";
-PyObject* KX_ConstraintActuator::PySetMin(PyObject* args) {
- ShowDeprecationWarning("setMin() or setDistance()", "the min or distance property");
- float minArg;
- if(!PyArg_ParseTuple(args, "f:setMin", &minArg)) {
- return NULL;
- }
-
- switch (m_locrot) {
- default:
- m_minimumBound = minArg;
- break;
- case KX_ACT_CONSTRAINT_ROTX:
- case KX_ACT_CONSTRAINT_ROTY:
- case KX_ACT_CONSTRAINT_ROTZ:
- m_minimumBound = MT_radians(minArg);
- break;
- }
-
- Py_RETURN_NONE;
-}
-/* 5. getDistance */
-const char KX_ConstraintActuator::GetDistance_doc[] =
-"getDistance()\n"
-"\tReturns the distance parameter \n";
-/* 5. getMin */
-const char KX_ConstraintActuator::GetMin_doc[] =
-"getMin()\n"
-"\tReturns the lower value of the interval to which the value\n"
-"\tis clipped.\n";
-PyObject* KX_ConstraintActuator::PyGetMin() {
- ShowDeprecationWarning("getMin() or getDistance()", "the min or distance property");
- return PyFloat_FromDouble(m_minimumBound);
-}
-
-/* 6. setRayLength */
-const char KX_ConstraintActuator::SetRayLength_doc[] =
-"setRayLength(length)\n"
-"\t- length: float\n"
-"\tSets the maximum ray length of the distance constraint\n";
-/* 6. setMax */
-const char KX_ConstraintActuator::SetMax_doc[] =
-"setMax(upper_bound)\n"
-"\t- upper_bound: float\n"
-"\tSets the upper value of the interval to which the value\n"
-"\tis clipped.\n";
-PyObject* KX_ConstraintActuator::PySetMax(PyObject* args){
- ShowDeprecationWarning("setMax() or setRayLength()", "the max or rayLength property");
- float maxArg;
- if(!PyArg_ParseTuple(args, "f:setMax", &maxArg)) {
- return NULL;
- }
-
- switch (m_locrot) {
- default:
- m_maximumBound = maxArg;
- break;
- case KX_ACT_CONSTRAINT_ROTX:
- case KX_ACT_CONSTRAINT_ROTY:
- case KX_ACT_CONSTRAINT_ROTZ:
- m_maximumBound = MT_radians(maxArg);
- break;
- }
-
- Py_RETURN_NONE;
-}
-/* 7. getRayLength */
-const char KX_ConstraintActuator::GetRayLength_doc[] =
-"getRayLength()\n"
-"\tReturns the length of the ray\n";
-/* 7. getMax */
-const char KX_ConstraintActuator::GetMax_doc[] =
-"getMax()\n"
-"\tReturns the upper value of the interval to which the value\n"
-"\tis clipped.\n";
-PyObject* KX_ConstraintActuator::PyGetMax() {
- ShowDeprecationWarning("getMax() or getRayLength()", "the max or rayLength property");
- return PyFloat_FromDouble(m_maximumBound);
-}
-
-
-/* This setter/getter probably for the constraint type */
-/* 8. setLimit */
-const char KX_ConstraintActuator::SetLimit_doc[] =
-"setLimit(type)\n"
-"\t- type: integer\n"
-"\t 1 : LocX\n"
-"\t 2 : LocY\n"
-"\t 3 : LocZ\n"
-"\t 7 : Distance along +X axis\n"
-"\t 8 : Distance along +Y axis\n"
-"\t 9 : Distance along +Z axis\n"
-"\t 10 : Distance along -X axis\n"
-"\t 11 : Distance along -Y axis\n"
-"\t 12 : Distance along -Z axis\n"
-"\t 13 : Align X axis\n"
-"\t 14 : Align Y axis\n"
-"\t 15 : Align Z axis\n"
-"\tSets the type of constraint.\n";
-PyObject* KX_ConstraintActuator::PySetLimit(PyObject* args) {
- ShowDeprecationWarning("setLimit()", "the limit property");
- int locrotArg;
- if(!PyArg_ParseTuple(args, "i:setLimit", &locrotArg)) {
- return NULL;
- }
-
- if (IsValidMode((KX_CONSTRAINTTYPE)locrotArg)) m_locrot = locrotArg;
-
- Py_RETURN_NONE;
-}
-/* 9. getLimit */
-const char KX_ConstraintActuator::GetLimit_doc[] =
-"getLimit()\n"
-"\tReturns the type of constraint.\n";
-PyObject* KX_ConstraintActuator::PyGetLimit() {
- ShowDeprecationWarning("setLimit()", "the limit property");
- return PyLong_FromSsize_t(m_locrot);
-}
-
/* eof */
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h
index 677904aedc9..9b6ed59e75c 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.h
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h
@@ -143,28 +143,6 @@ protected:
static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDamp);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp);
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetRotDamp);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp);
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDirection);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection);
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetOption);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption);
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetTime);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime);
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetProperty);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty);
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMin);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin);
- static const char SetDistance_doc[];
- static const char GetDistance_doc[];
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMax);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax);
- static const char SetRayLength_doc[];
- static const char GetRayLength_doc[];
- KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetLimit);
- KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit);
};
#endif //__KX_CONSTRAINTACTUATOR
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
index ec7bb470235..54e083b48f0 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
@@ -83,31 +83,25 @@ PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds)
//python specific stuff
PyTypeObject KX_ConstraintWrapper::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_ConstraintWrapper",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &PyObjectPlus::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_ConstraintWrapper",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_ConstraintWrapper::Methods[] = {
diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h
index 20b60ef0173..9ff33fe2852 100644
--- a/source/gameengine/Ketsji/KX_Dome.h
+++ b/source/gameengine/Ketsji/KX_Dome.h
@@ -18,7 +18,7 @@ http://www.gnu.org/copyleft/lesser.txt.
Contributor(s): Dalai Felinto
This source uses some of the ideas and code from Paul Bourke.
-Developed as part of a Research and Development project for SAT - La Société des arts technologiques.
+Developed as part of a Research and Development project for SAT - La Soci�t� des arts technologiques.
-----------------------------------------------------------------------------
*/
@@ -78,7 +78,7 @@ public:
bool fboSupported;
//openGL names:
- GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180º x 360º dome, 6 for panoramic and +1 for warp mesh
+ GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180� x 360� dome, 6 for panoramic and +1 for warp mesh
GLuint dlistId; // ID of the Display Lists of the images (used as an offset)
typedef struct {
@@ -184,6 +184,13 @@ protected:
RAS_IRenderTools* m_rendertools;
/// engine
KX_KetsjiEngine* m_engine;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_EmptyObject.h b/source/gameengine/Ketsji/KX_EmptyObject.h
index 62aa7fcd017..fa405e20076 100644
--- a/source/gameengine/Ketsji/KX_EmptyObject.h
+++ b/source/gameengine/Ketsji/KX_EmptyObject.h
@@ -37,7 +37,13 @@ public:
KX_GameObject(sgReplicationInfo,callbacks)
{};
virtual ~KX_EmptyObject();
-
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_EMPTYOBJECT
diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp
index 560c7fa4bb4..42dc4d8fd24 100644
--- a/source/gameengine/Ketsji/KX_GameActuator.cpp
+++ b/source/gameengine/Ketsji/KX_GameActuator.cpp
@@ -207,39 +207,29 @@ bool KX_GameActuator::Update()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_GameActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_GameActuator",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IActuator::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_GameActuator",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IActuator::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_GameActuator::Methods[] =
{
- // Deprecated ----->
- {"getFile", (PyCFunction) KX_GameActuator::sPyGetFile, METH_VARARGS, (PY_METHODCHAR)GetFile_doc},
- {"setFile", (PyCFunction) KX_GameActuator::sPySetFile, METH_VARARGS, (PY_METHODCHAR)SetFile_doc},
- // <-----
{NULL,NULL} //Sentinel
};
@@ -248,36 +238,3 @@ PyAttributeDef KX_GameActuator::Attributes[] = {
KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode),
{ NULL } //Sentinel
};
-
-// Deprecated ----->
-/* getFile */
-const char KX_GameActuator::GetFile_doc[] =
-"getFile()\n"
-"get the name of the file to start.\n";
-PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds)
-{
- ShowDeprecationWarning("getFile()", "the fileName property");
- return PyUnicode_FromString(m_filename);
-}
-
-/* setFile */
-const char KX_GameActuator::SetFile_doc[] =
-"setFile(name)\n"
-"set the name of the file to start.\n";
-PyObject* KX_GameActuator::PySetFile(PyObject* args, PyObject* kwds)
-{
- char* new_file;
-
- ShowDeprecationWarning("setFile()", "the fileName property");
-
- if (!PyArg_ParseTuple(args, "s:setFile", &new_file))
- {
- return NULL;
- }
-
- m_filename = STR_String(new_file);
-
- Py_RETURN_NONE;
-
-}
-// <-----
diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h
index cabbf827b40..37d09a5a9fb 100644
--- a/source/gameengine/Ketsji/KX_GameActuator.h
+++ b/source/gameengine/Ketsji/KX_GameActuator.h
@@ -75,11 +75,6 @@ protected:
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
-
- // Deprecated functions ----->
- KX_PYMETHOD_DOC(KX_GameActuator,GetFile);
- KX_PYMETHOD_DOC(KX_GameActuator,SetFile);
- // <-----
}; /* end of class KX_GameActuator */
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 75688a63530..8193aa8c37b 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -101,7 +101,6 @@ KX_GameObject::KX_GameObject(
m_bOccluder(false),
m_pPhysicsController1(NULL),
m_pGraphicController(NULL),
- m_pPhysicsEnvironment(NULL),
m_xray(false),
m_pHitObject(NULL),
m_isDeformable(false),
@@ -465,7 +464,7 @@ void KX_GameObject::AddMeshUser()
double* fl = GetOpenGLMatrixPtr()->getPointer();
SG_QList::iterator<RAS_MeshSlot> mit(m_meshSlots);
- RAS_MeshSlot* ms;
+// RAS_MeshSlot* ms;
for(mit.begin(); !mit.end(); ++mit)
{
(*mit)->m_OpenGLMatrix = fl;
@@ -1384,11 +1383,11 @@ PyMethodDef KX_GameObject::Methods[] = {
{"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS},
{"setOcclusion",(PyCFunction) KX_GameObject::sPySetOcclusion, METH_VARARGS},
{"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_NOARGS},
- {"getChildren", (PyCFunction)KX_GameObject::sPyGetChildren,METH_NOARGS},
- {"getChildrenRecursive", (PyCFunction)KX_GameObject::sPyGetChildrenRecursive,METH_NOARGS},
+
+
{"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_NOARGS},
{"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_NOARGS},
- {"replaceMesh",(PyCFunction) KX_GameObject::sPyReplaceMesh, METH_O},
+ {"replaceMesh",(PyCFunction) KX_GameObject::sPyReplaceMesh, METH_VARARGS},
{"endObject",(PyCFunction) KX_GameObject::sPyEndObject, METH_NOARGS},
{"reinstancePhysicsMesh", (PyCFunction)KX_GameObject::sPyReinstancePhysicsMesh,METH_VARARGS},
@@ -1399,21 +1398,8 @@ PyMethodDef KX_GameObject::Methods[] = {
KX_PYMETHODTABLE(KX_GameObject, sendMessage),
// dict style access for props
- {"has_key",(PyCFunction) KX_GameObject::sPyhas_key, METH_O},
{"get",(PyCFunction) KX_GameObject::sPyget, METH_VARARGS},
- // deprecated
- {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS},
- {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O},
- {"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, METH_O},
- {"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_NOARGS},
- {"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_O},
- {"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_NOARGS},
- {"setState",(PyCFunction) KX_GameObject::sPySetState, METH_O},
- {"getParent", (PyCFunction)KX_GameObject::sPyGetParent,METH_NOARGS},
- {"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_NOARGS},
- {"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_NOARGS},
- {"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS},
{NULL,NULL} //Sentinel
};
@@ -1466,15 +1452,21 @@ bool KX_GameObject::ConvertPythonVectorArgs(PyObject* args,
}
*/
-PyObject* KX_GameObject::PyReplaceMesh(PyObject* value)
+PyObject* KX_GameObject::PyReplaceMesh(PyObject* args)
{
KX_Scene *scene = KX_GetActiveScene();
- RAS_MeshObject* new_mesh;
+
+ PyObject *value;
+ int use_gfx= 1, use_phys= 0;
+ RAS_MeshObject *new_mesh;
+
+ if (!PyArg_ParseTuple(args,"O|ii:replaceMesh", &value, &use_gfx, &use_phys))
+ return NULL;
if (!ConvertPythonToMesh(value, &new_mesh, false, "gameOb.replaceMesh(value): KX_GameObject"))
return NULL;
- scene->ReplaceMesh(this, new_mesh);
+ scene->ReplaceMesh(this, new_mesh, (bool)use_gfx, (bool)use_phys);
Py_RETURN_NONE;
}
@@ -1510,13 +1502,6 @@ PyObject* KX_GameObject::PyReinstancePhysicsMesh(PyObject* args)
Py_RETURN_FALSE;
}
-
-PyObject* KX_GameObject::PyGetPosition()
-{
- ShowDeprecationWarning("getPosition()", "the position property");
- return PyObjectFrom(NodeGetWorldPosition());
-}
-
static PyObject *Map_GetItem(PyObject *self_v, PyObject *item)
{
KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
@@ -1676,37 +1661,31 @@ PySequenceMethods KX_GameObject::Sequence = {
};
PyTypeObject KX_GameObject::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_GameObject",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,
- &Sequence,
- &Mapping,
- 0,0,0,
- NULL,
- NULL,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IObject::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_GameObject",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,
+ &Sequence,
+ &Mapping,
+ 0,0,0,
+ NULL,
+ NULL,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IObject::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
@@ -1818,10 +1797,10 @@ int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *at
PyObject* KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
- return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL);
+ return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetWorldPosition());
#endif
}
@@ -1840,10 +1819,10 @@ int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_D
PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
- return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL);
+ return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetLocalPosition());
#endif
}
@@ -1862,10 +1841,10 @@ int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_D
PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
- return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL);
+ return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
if (self->GetPhysicsController())
return PyObjectFrom(self->GetPhysicsController()->GetLocalInertia());
return Py_BuildValue("fff", 0.0f, 0.0f, 0.0f);
@@ -1875,7 +1854,7 @@ PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIB
PyObject* KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
#ifdef USE_MATHUTILS
- return newMatrixObject_cb((PyObject *)self_v, 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL);
+ return newMatrixObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL);
#else
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetWorldOrientation());
@@ -1900,7 +1879,7 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT
PyObject* KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
#ifdef USE_MATHUTILS
- return newMatrixObject_cb((PyObject *)self_v, 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL);
+ return newMatrixObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL);
#else
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetLocalOrientation());
@@ -1923,20 +1902,20 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT
PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
- return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL);
+ return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetWorldScaling());
#endif
}
PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
- return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL);
+ return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetLocalScaling());
#endif
}
@@ -2202,41 +2181,6 @@ PyObject* KX_GameObject::PySetOcclusion(PyObject* args)
Py_RETURN_NONE;
}
-PyObject* KX_GameObject::PyGetVisible()
-{
- ShowDeprecationWarning("getVisible()", "the visible property");
- return PyLong_FromSsize_t(m_bVisible);
-}
-
-PyObject* KX_GameObject::PyGetState()
-{
- ShowDeprecationWarning("getState()", "the state property");
- int state = 0;
- state |= GetState();
- return PyLong_FromSsize_t(state);
-}
-
-PyObject* KX_GameObject::PySetState(PyObject* value)
-{
- ShowDeprecationWarning("setState()", "the state property");
- int state_i = PyLong_AsSsize_t(value);
- unsigned int state = 0;
-
- if (state_i == -1 && PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError, "expected an int bit field");
- return NULL;
- }
-
- state |= state_i;
- if ((state & ((1<<30)-1)) == 0) {
- PyErr_SetString(PyExc_AttributeError, "The state bitfield was not between 0 and 30 (1<<0 and 1<<29)");
- return NULL;
- }
- SetState(state);
-
- Py_RETURN_NONE;
-}
-
PyObject* KX_GameObject::PyGetVelocity(PyObject* args)
{
// only can get the velocity if we have a physics object connected to us...
@@ -2255,14 +2199,6 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* args)
}
}
-
-
-PyObject* KX_GameObject::PyGetMass()
-{
- ShowDeprecationWarning("getMass()", "the mass property");
- return PyFloat_FromDouble((GetPhysicsController() != NULL) ? GetPhysicsController()->GetMass() : 0.0f);
-}
-
PyObject* KX_GameObject::PyGetReactionForce()
{
// only can get the velocity if we have a physics object connected to us...
@@ -2299,18 +2235,6 @@ PyObject* KX_GameObject::PyDisableRigidBody()
}
-
-PyObject* KX_GameObject::PyGetParent()
-{
- ShowDeprecationWarning("getParent()", "the parent property");
- KX_GameObject* parent = this->GetParent();
- if (parent) {
- parent->Release(); /* self->GetParent() AddRef's */
- return parent->GetProxy();
- }
- Py_RETURN_NONE;
-}
-
PyObject* KX_GameObject::PySetParent(PyObject* args)
{
KX_Scene *scene = KX_GetActiveScene();
@@ -2336,41 +2260,6 @@ PyObject* KX_GameObject::PyRemoveParent()
Py_RETURN_NONE;
}
-PyObject* KX_GameObject::PyGetChildren()
-{
- ShowDeprecationWarning("getChildren()", "the children property");
-
- return GetChildren()->NewProxy(true);
-}
-
-PyObject* KX_GameObject::PyGetChildrenRecursive()
-{
- ShowDeprecationWarning("getChildrenRecursive()", "the childrenRecursive property");
-
- return GetChildrenRecursive()->NewProxy(true);
-}
-
-PyObject* KX_GameObject::PyGetMesh(PyObject* args)
-{
- ShowDeprecationWarning("getMesh()", "the meshes property (now a list of meshes)");
-
- int mesh = 0;
-
- if (!PyArg_ParseTuple(args, "|i:getMesh", &mesh))
- return NULL; // python sets a simple error
-
- if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0)
- {
- KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]);
- return meshproxy->NewProxy(true); // XXX Todo Python own.
- }
-
- Py_RETURN_NONE;
-}
-
-
-
-
PyObject* KX_GameObject::PySetCollisionMargin(PyObject* value)
{
@@ -2434,29 +2323,6 @@ PyObject* KX_GameObject::PyRestoreDynamics()
}
-
-PyObject* KX_GameObject::PyGetOrientation() //keywords
-{
- ShowDeprecationWarning("getOrientation()", "the orientation property");
- return PyObjectFrom(NodeGetWorldOrientation());
-}
-
-
-
-PyObject* KX_GameObject::PySetOrientation(PyObject* value)
-{
- ShowDeprecationWarning("setOrientation()", "the orientation property");
- MT_Matrix3x3 rot;
-
- /* if value is not a sequence PyOrientationTo makes an error */
- if (!PyOrientationTo(value, rot, "gameOb.setOrientation(sequence): KX_GameObject, "))
- return NULL;
-
- NodeSetLocalOrientation(rot);
- NodeUpdateGS(0.f);
- Py_RETURN_NONE;
-}
-
PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args)
{
PyObject* pyvect;
@@ -2489,33 +2355,6 @@ PyObject* KX_GameObject::PyGetAxisVect(PyObject* value)
return NULL;
}
-PyObject* KX_GameObject::PySetPosition(PyObject* value)
-{
- ShowDeprecationWarning("setPosition()", "the localPosition property");
- MT_Point3 pos;
- if (PyVecTo(value, pos))
- {
- NodeSetLocalPosition(pos);
- NodeUpdateGS(0.f);
- Py_RETURN_NONE;
- }
-
- return NULL;
-}
-
-PyObject* KX_GameObject::PySetWorldPosition(PyObject* value)
-{
- ShowDeprecationWarning("setWorldPosition()", "the worldPosition property");
- MT_Point3 pos;
- if (PyVecTo(value, pos))
- {
- NodeSetWorldPosition(pos);
- NodeUpdateGS(0.f);
- Py_RETURN_NONE;
- }
-
- return NULL;
-}
PyObject* KX_GameObject::PyGetPhysicsId()
{
@@ -2681,14 +2520,11 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
}
}
MT_Point3 fromPoint = NodeGetWorldPosition();
+
if (dist != 0.0f)
- {
- MT_Vector3 toDir = toPoint-fromPoint;
- toDir.normalize();
- toPoint = fromPoint + (dist) * toDir;
- }
-
- PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment();
+ toPoint = fromPoint + dist * (toPoint-fromPoint).safe_normalized();
+
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = GetPhysicsController();
KX_GameObject *parent = GetParent();
if (!spc && parent)
@@ -2815,7 +2651,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
return none_tuple_3();
}
- PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment();
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = GetPhysicsController();
KX_GameObject *parent = GetParent();
if (!spc && parent)
@@ -2880,7 +2716,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_GameObject, sendMessage,
char* to = (char *)"";
const STR_String& from = GetName();
- if (!PyArg_ParseTuple(args, "s|sss:sendMessage", &subject, &body, &to))
+ if (!PyArg_ParseTuple(args, "s|ss:sendMessage", &subject, &body, &to))
return NULL;
scene->GetNetworkScene()->SendMessage(to, from, subject, body);
@@ -2921,14 +2757,6 @@ PyObject* KX_GameObject::Pyget(PyObject *args)
return def;
}
-/* Matches python dict.has_key() */
-PyObject* KX_GameObject::Pyhas_key(PyObject* value)
-{
- // the ONLY error case is invalid data, this is checked by the macro'd static function
- // that calls this one. but make sure Seq_Contains doesnt add extra errors later on.
- return PyBool_FromLong(Seq_Contains((PyObject *)this, value));
-}
-
/* ---------------------------------------------------------------------
* Some stuff taken from the header
* --------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index 118e17128f0..845cead1cdb 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -98,8 +98,6 @@ protected:
KX_IPhysicsController* m_pPhysicsController1;
PHY_IGraphicController* m_pGraphicController;
- // used for ray casting
- PHY_IPhysicsEnvironment* m_pPhysicsEnvironment;
STR_String m_testPropName;
bool m_xray;
KX_GameObject* m_pHitObject;
@@ -337,20 +335,6 @@ public:
bool ang_vel_local
);
-
- /**
- * @return a pointer to the physics environment in use during the game, for rayCasting
- */
- PHY_IPhysicsEnvironment* GetPhysicsEnvironment()
- {
- return m_pPhysicsEnvironment;
- }
-
- void SetPhysicsEnvironment(PHY_IPhysicsEnvironment* physicsEnvironment)
- {
- m_pPhysicsEnvironment = physicsEnvironment;
- }
-
/**
* @return a pointer to the physics controller owned by this class.
*/
@@ -811,9 +795,7 @@ public:
{
return PyUnicode_FromString(GetName().ReadPtr());
}
-
- KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition);
- KX_PYMETHOD_O(KX_GameObject,SetPosition);
+
KX_PYMETHOD_O(KX_GameObject,SetWorldPosition);
KX_PYMETHOD_VARARGS(KX_GameObject, ApplyForce);
KX_PYMETHOD_VARARGS(KX_GameObject, ApplyTorque);
@@ -824,10 +806,10 @@ public:
KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity);
KX_PYMETHOD_VARARGS(KX_GameObject,SetAngularVelocity);
KX_PYMETHOD_VARARGS(KX_GameObject,GetVelocity);
- KX_PYMETHOD_NOARGS(KX_GameObject,GetMass);
+
KX_PYMETHOD_NOARGS(KX_GameObject,GetReactionForce);
- KX_PYMETHOD_NOARGS(KX_GameObject,GetOrientation);
- KX_PYMETHOD_O(KX_GameObject,SetOrientation);
+
+
KX_PYMETHOD_NOARGS(KX_GameObject,GetVisible);
KX_PYMETHOD_VARARGS(KX_GameObject,SetVisible);
KX_PYMETHOD_VARARGS(KX_GameObject,SetOcclusion);
@@ -844,12 +826,12 @@ public:
KX_PYMETHOD_NOARGS(KX_GameObject,GetParent);
KX_PYMETHOD_VARARGS(KX_GameObject,SetParent);
KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent);
- KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren);
+ KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren);
KX_PYMETHOD_NOARGS(KX_GameObject,GetChildrenRecursive);
KX_PYMETHOD_VARARGS(KX_GameObject,GetMesh);
KX_PYMETHOD_NOARGS(KX_GameObject,GetPhysicsId);
KX_PYMETHOD_NOARGS(KX_GameObject,GetPropertyNames);
- KX_PYMETHOD_O(KX_GameObject,ReplaceMesh);
+ KX_PYMETHOD_VARARGS(KX_GameObject,ReplaceMesh);
KX_PYMETHOD_NOARGS(KX_GameObject,EndObject);
KX_PYMETHOD_DOC(KX_GameObject,rayCastTo);
KX_PYMETHOD_DOC(KX_GameObject,rayCast);
@@ -860,7 +842,6 @@ public:
/* Dict access */
KX_PYMETHOD_VARARGS(KX_GameObject,get);
- KX_PYMETHOD_O(KX_GameObject,has_key);
/* attributes */
static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Ketsji/KX_IInterpolator.h b/source/gameengine/Ketsji/KX_IInterpolator.h
index 8c899a4db0b..52b9b3be5af 100644
--- a/source/gameengine/Ketsji/KX_IInterpolator.h
+++ b/source/gameengine/Ketsji/KX_IInterpolator.h
@@ -31,11 +31,22 @@
#include <vector>
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class KX_IInterpolator {
public:
virtual ~KX_IInterpolator() {}
virtual void Execute(float currentTime) const = 0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
typedef std::vector<KX_IInterpolator *> T_InterpolatorList;
diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h
index 031b74294ce..68a74c3a364 100644
--- a/source/gameengine/Ketsji/KX_IPO_SGController.h
+++ b/source/gameengine/Ketsji/KX_IPO_SGController.h
@@ -116,6 +116,12 @@ public:
m_ipotime = time;
m_modified = true;
}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__IPO_SGCONTROLLER_H
diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h
index 81c01045071..f9dcf81bca5 100644
--- a/source/gameengine/Ketsji/KX_IPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_IPhysicsController.h
@@ -126,6 +126,13 @@ public:
// call from scene graph to update
virtual bool Update(double time)=0;
void* GetUserData() { return m_userdata;}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_IPHYSICSCONTROLLER_H
diff --git a/source/gameengine/Ketsji/KX_IScalarInterpolator.h b/source/gameengine/Ketsji/KX_IScalarInterpolator.h
index 6ba685885e9..ec6183b88a1 100644
--- a/source/gameengine/Ketsji/KX_IScalarInterpolator.h
+++ b/source/gameengine/Ketsji/KX_IScalarInterpolator.h
@@ -29,11 +29,22 @@
#ifndef KX_ISCALARINTERPOLATOR_H
#define KX_ISCALARINTERPOLATOR_H
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class KX_IScalarInterpolator {
public:
virtual ~KX_IScalarInterpolator() {}
virtual float GetValue(float currentTime) const = 0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h
index 3709fa8c784..f098b0bebf5 100644
--- a/source/gameengine/Ketsji/KX_ISceneConverter.h
+++ b/source/gameengine/Ketsji/KX_ISceneConverter.h
@@ -32,6 +32,10 @@
#include "STR_String.h"
#include "KX_Python.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
struct Scene;
class KX_ISceneConverter
@@ -47,10 +51,9 @@ public:
destinationscene: pass an empty scene, everything goes into this
dictobj: python dictionary (for pythoncontrollers)
*/
- virtual void ConvertScene(const STR_String& scenename,
+ virtual void ConvertScene(
class KX_Scene* destinationscene,
PyObject* dictobj,
- class SCA_IInputDevice* keyinputdev,
class RAS_IRenderTools* rendertools,
class RAS_ICanvas* canvas)=0;
@@ -81,6 +84,13 @@ public:
virtual bool GetGLSLMaterials()=0;
virtual struct Scene* GetBlenderSceneForName(const STR_String& name)=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_ISCENECONVERTER_H
diff --git a/source/gameengine/Ketsji/KX_ISystem.h b/source/gameengine/Ketsji/KX_ISystem.h
index 204e116e822..deee91f62e8 100644
--- a/source/gameengine/Ketsji/KX_ISystem.h
+++ b/source/gameengine/Ketsji/KX_ISystem.h
@@ -37,6 +37,10 @@ using namespace std;
#include "STR_String.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/**
* System Abstraction, needed only for getting some timing stuff from the host.
*/
@@ -47,6 +51,13 @@ public:
virtual ~KX_ISystem() {};
virtual double GetTimeInSeconds()=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp
index 73a370a1681..b71907be961 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.cpp
+++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp
@@ -49,13 +49,13 @@
/* Type strings */
/* ------------------------------------------------------------------------- */
-STR_String KX_IpoActuator::S_KX_ACT_IPO_PLAY_STRING = "Play";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_PINGPONG_STRING = "PingPong";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_FLIPPER_STRING = "Flipper";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_LOOPSTOP_STRING = "LoopStop";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_LOOPEND_STRING = "LoopEnd";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_KEY2KEY_STRING = "Key2key";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_FROM_PROP_STRING = "FromProp";
+const char *KX_IpoActuator::S_KX_ACT_IPO_PLAY_STRING = "Play";
+const char *KX_IpoActuator::S_KX_ACT_IPO_PINGPONG_STRING = "PingPong";
+const char *KX_IpoActuator::S_KX_ACT_IPO_FLIPPER_STRING = "Flipper";
+const char *KX_IpoActuator::S_KX_ACT_IPO_LOOPSTOP_STRING = "LoopStop";
+const char *KX_IpoActuator::S_KX_ACT_IPO_LOOPEND_STRING = "LoopEnd";
+const char *KX_IpoActuator::S_KX_ACT_IPO_KEY2KEY_STRING = "Key2key";
+const char *KX_IpoActuator::S_KX_ACT_IPO_FROM_PROP_STRING = "FromProp";
/* ------------------------------------------------------------------------- */
/* Native functions */
@@ -385,19 +385,19 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
int KX_IpoActuator::string2mode(char* modename) {
IpoActType res = KX_ACT_IPO_NODEF;
- if (modename == S_KX_ACT_IPO_PLAY_STRING) {
+ if (strcmp(modename, S_KX_ACT_IPO_PLAY_STRING)==0) {
res = KX_ACT_IPO_PLAY;
- } else if (modename == S_KX_ACT_IPO_PINGPONG_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_PINGPONG_STRING)==0) {
res = KX_ACT_IPO_PINGPONG;
- } else if (modename == S_KX_ACT_IPO_FLIPPER_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_FLIPPER_STRING)==0) {
res = KX_ACT_IPO_FLIPPER;
- } else if (modename == S_KX_ACT_IPO_LOOPSTOP_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_LOOPSTOP_STRING)==0) {
res = KX_ACT_IPO_LOOPSTOP;
- } else if (modename == S_KX_ACT_IPO_LOOPEND_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_LOOPEND_STRING)==0) {
res = KX_ACT_IPO_LOOPEND;
- } else if (modename == S_KX_ACT_IPO_KEY2KEY_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_KEY2KEY_STRING)==0) {
res = KX_ACT_IPO_KEY2KEY;
- } else if (modename == S_KX_ACT_IPO_FROM_PROP_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_FROM_PROP_STRING)==0) {
res = KX_ACT_IPO_FROM_PROP;
}
@@ -412,13 +412,7 @@ int KX_IpoActuator::string2mode(char* modename) {
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_IpoActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_IpoActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -440,21 +434,6 @@ PyTypeObject KX_IpoActuator::Type = {
};
PyMethodDef KX_IpoActuator::Methods[] = {
- // deprecated
- {"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (PY_METHODCHAR)Set_doc},
- {"setProperty", (PyCFunction) KX_IpoActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
- {"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
- {"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, METH_NOARGS, (PY_METHODCHAR)GetStart_doc},
- {"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc},
- {"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd, METH_NOARGS, (PY_METHODCHAR)GetEnd_doc},
- {"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce, METH_VARARGS, (PY_METHODCHAR)SetIpoAsForce_doc},
- {"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, METH_NOARGS, (PY_METHODCHAR)GetIpoAsForce_doc},
- {"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, METH_VARARGS, (PY_METHODCHAR)SetIpoAdd_doc},
- {"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, METH_NOARGS, (PY_METHODCHAR)GetIpoAdd_doc},
- {"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal, METH_VARARGS, (PY_METHODCHAR)SetForceIpoActsLocal_doc},
- {"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal, METH_NOARGS, (PY_METHODCHAR)GetForceIpoActsLocal_doc},
- {"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc},
- {"getType", (PyCFunction) KX_IpoActuator::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc},
{NULL,NULL} //Sentinel
};
@@ -472,237 +451,4 @@ PyAttributeDef KX_IpoActuator::Attributes[] = {
{ NULL } //Sentinel
};
-
-/* set --------------------------------------------------------------------- */
-const char KX_IpoActuator::Set_doc[] =
-"set(type, startframe, endframe, mode?)\n"
-"\t - type: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n"
-"\t - startframe: first frame to use (int)\n"
-"\t - endframe : last frame to use (int)\n"
-"\t - mode? : special mode (0=normal, 1=interpret location as force, 2=additive)"
-"\tSet the properties of the actuator.\n";
-PyObject* KX_IpoActuator::PySet(PyObject* args) {
-
- ShowDeprecationWarning("set()", "a range properties");
-
- /* sets modes PLAY, PINGPONG, FLIPPER, LOOPSTOP, LOOPEND */
- /* arg 1 = mode string, arg 2 = startframe, arg3 = stopframe, */
- /* arg4 = force toggle */
- char* mode;
- int forceToggle;
- int modenum;
- int startFrame, stopFrame;
- if(!PyArg_ParseTuple(args, "siii:set", &mode, &startFrame,
- &stopFrame, &forceToggle)) {
- return NULL;
- }
- modenum = string2mode(mode);
-
- switch (modenum) {
- case KX_ACT_IPO_PLAY:
- case KX_ACT_IPO_PINGPONG:
- case KX_ACT_IPO_FLIPPER:
- case KX_ACT_IPO_LOOPSTOP:
- case KX_ACT_IPO_LOOPEND:
- m_type = modenum;
- m_startframe = startFrame;
- m_endframe = stopFrame;
- m_ipo_as_force = forceToggle == 1;
- m_ipo_add = forceToggle == 2;
- break;
- default:
- ; /* error */
- }
-
- Py_RETURN_NONE;
-}
-
-/* set property ----------------------------------------------------------- */
-const char KX_IpoActuator::SetProperty_doc[] =
-"setProperty(propname)\n"
-"\t - propname: name of the property (string)\n"
-"\tSet the property to be used in FromProp mode.\n";
-PyObject* KX_IpoActuator::PySetProperty(PyObject* args) {
-
- ShowDeprecationWarning("setProperty()", "the propName property");
-
- /* mode is implicit here, but not supported yet... */
- /* args: property */
- char *propertyName;
- if(!PyArg_ParseTuple(args, "s:setProperty", &propertyName)) {
- return NULL;
- }
-
- m_propname = propertyName;
-
- Py_RETURN_NONE;
-}
-
-/* 4. setStart: */
-const char KX_IpoActuator::SetStart_doc[] =
-"setStart(frame)\n"
-"\t - frame: first frame to use (int)\n"
-"\tSet the frame from which the ipo starts playing.\n";
-PyObject* KX_IpoActuator::PySetStart(PyObject* args) {
-
- ShowDeprecationWarning("setStart()", "the frameStart property");
-
- float startArg;
- if(!PyArg_ParseTuple(args, "f:setStart", &startArg)) {
- return NULL;
- }
-
- m_startframe = startArg;
-
- Py_RETURN_NONE;
-}
-/* 5. getStart: */
-const char KX_IpoActuator::GetStart_doc[] =
-"getStart()\n"
-"\tReturns the frame from which the ipo starts playing.\n";
-PyObject* KX_IpoActuator::PyGetStart() {
- ShowDeprecationWarning("getStart()", "the frameStart property");
- return PyFloat_FromDouble(m_startframe);
-}
-
-/* 6. setEnd: */
-const char KX_IpoActuator::SetEnd_doc[] =
-"setEnd(frame)\n"
-"\t - frame: last frame to use (int)\n"
-"\tSet the frame at which the ipo stops playing.\n";
-PyObject* KX_IpoActuator::PySetEnd(PyObject* args) {
- ShowDeprecationWarning("setEnd()", "the frameEnd property");
- float endArg;
- if(!PyArg_ParseTuple(args, "f:setEnd", &endArg)) {
- return NULL;
- }
-
- m_endframe = endArg;
-
- Py_RETURN_NONE;
-}
-/* 7. getEnd: */
-const char KX_IpoActuator::GetEnd_doc[] =
-"getEnd()\n"
-"\tReturns the frame at which the ipo stops playing.\n";
-PyObject* KX_IpoActuator::PyGetEnd() {
- ShowDeprecationWarning("getEnd()", "the frameEnd property");
- return PyFloat_FromDouble(m_endframe);
-}
-
-/* 6. setIpoAsForce: */
-const char KX_IpoActuator::SetIpoAsForce_doc[] =
-"setIpoAsForce(force?)\n"
-"\t - force? : interpret this ipo as a force? (KX_TRUE, KX_FALSE)\n"
-"\tSet whether to interpret the ipo as a force rather than a displacement.\n";
-PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* args) {
- ShowDeprecationWarning("setIpoAsForce()", "the useIpoAsForce property");
- int boolArg;
-
- if (!PyArg_ParseTuple(args, "i:setIpoAsForce", &boolArg)) {
- return NULL;
- }
-
- m_ipo_as_force = PyArgToBool(boolArg);
- if (m_ipo_as_force)
- m_ipo_add = false;
-
- Py_RETURN_NONE;
-}
-/* 7. getIpoAsForce: */
-const char KX_IpoActuator::GetIpoAsForce_doc[] =
-"getIpoAsForce()\n"
-"\tReturns whether to interpret the ipo as a force rather than a displacement.\n";
-PyObject* KX_IpoActuator::PyGetIpoAsForce() {
- ShowDeprecationWarning("getIpoAsForce()", "the useIpoAsForce property");
- return BoolToPyArg(m_ipo_as_force);
-}
-
-/* 6. setIpoAsForce: */
-const char KX_IpoActuator::SetIpoAdd_doc[] =
-"setIpoAdd(add?)\n"
-"\t - add? : add flag (KX_TRUE, KX_FALSE)\n"
-"\tSet whether to interpret the ipo as additive rather than absolute.\n";
-PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* args) {
- ShowDeprecationWarning("setIpoAdd()", "the useIpoAdd property");
- int boolArg;
-
- if (!PyArg_ParseTuple(args, "i:setIpoAdd", &boolArg)) {
- return NULL;
- }
-
- m_ipo_add = PyArgToBool(boolArg);
- if (m_ipo_add)
- m_ipo_as_force = false;
-
- Py_RETURN_NONE;
-}
-/* 7. getIpoAsForce: */
-const char KX_IpoActuator::GetIpoAdd_doc[] =
-"getIpoAsAdd()\n"
-"\tReturns whether to interpret the ipo as additive rather than absolute.\n";
-PyObject* KX_IpoActuator::PyGetIpoAdd() {
- ShowDeprecationWarning("getIpoAdd()", "the useIpoAdd property");
- return BoolToPyArg(m_ipo_add);
-}
-
-/* 8. setType: */
-const char KX_IpoActuator::SetType_doc[] =
-"setType(mode)\n"
-"\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n"
-"\tSet the operation mode of the actuator.\n";
-PyObject* KX_IpoActuator::PySetType(PyObject* args) {
- ShowDeprecationWarning("setType()", "the mode property");
- int typeArg;
-
- if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) {
- return NULL;
- }
-
- if ( (typeArg > KX_ACT_IPO_NODEF)
- && (typeArg < KX_ACT_IPO_MAX) ) {
- m_type = typeArg;
- }
-
- Py_RETURN_NONE;
-}
-/* 9. getType: */
-const char KX_IpoActuator::GetType_doc[] =
-"getType()\n"
-"\tReturns the operation mode of the actuator.\n";
-PyObject* KX_IpoActuator::PyGetType() {
- ShowDeprecationWarning("getType()", "the mode property");
- return PyLong_FromSsize_t(m_type);
-}
-
-/* 10. setForceIpoActsLocal: */
-const char KX_IpoActuator::SetForceIpoActsLocal_doc[] =
-"setForceIpoActsLocal(local?)\n"
-"\t - local? : Apply the ipo-as-force in the object's local\n"
-"\t coordinates? (KX_TRUE, KX_FALSE)\n"
-"\tSet whether to apply the force in the object's local\n"
-"\tcoordinates rather than the world global coordinates.\n";
-PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* args) {
- ShowDeprecationWarning("setForceIpoActsLocal()", "the useIpoLocal property");
- int boolArg;
-
- if (!PyArg_ParseTuple(args, "i:setForceIpoActsLocal", &boolArg)) {
- return NULL;
- }
-
- m_ipo_local = PyArgToBool(boolArg);
-
- Py_RETURN_NONE;
-}
-/* 11. getForceIpoActsLocal: */
-const char KX_IpoActuator::GetForceIpoActsLocal_doc[] =
-"getForceIpoActsLocal()\n"
-"\tReturn whether to apply the force in the object's local\n"
-"\tcoordinates rather than the world global coordinates.\n";
-PyObject* KX_IpoActuator::PyGetForceIpoActsLocal() {
- ShowDeprecationWarning("getForceIpoActsLocal()", "the useIpoLocal property");
- return BoolToPyArg(m_ipo_local);
-}
-
-
/* eof */
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h
index 01051ca82dc..72fe812f98e 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.h
+++ b/source/gameengine/Ketsji/KX_IpoActuator.h
@@ -100,13 +100,13 @@ public:
KX_ACT_IPO_MAX
};
- static STR_String S_KX_ACT_IPO_PLAY_STRING;
- static STR_String S_KX_ACT_IPO_PINGPONG_STRING;
- static STR_String S_KX_ACT_IPO_FLIPPER_STRING;
- static STR_String S_KX_ACT_IPO_LOOPSTOP_STRING;
- static STR_String S_KX_ACT_IPO_LOOPEND_STRING;
- static STR_String S_KX_ACT_IPO_KEY2KEY_STRING;
- static STR_String S_KX_ACT_IPO_FROM_PROP_STRING;
+ static const char *S_KX_ACT_IPO_PLAY_STRING;
+ static const char *S_KX_ACT_IPO_PINGPONG_STRING;
+ static const char *S_KX_ACT_IPO_FLIPPER_STRING;
+ static const char *S_KX_ACT_IPO_LOOPSTOP_STRING;
+ static const char *S_KX_ACT_IPO_LOOPEND_STRING;
+ static const char *S_KX_ACT_IPO_KEY2KEY_STRING;
+ static const char *S_KX_ACT_IPO_FROM_PROP_STRING;
int string2mode(char* modename);
@@ -138,23 +138,6 @@ public:
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- //KX_PYMETHOD_DOC
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,Set);
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetProperty);
-/* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetStart);
- KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart);
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetEnd);
- KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd);
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAsForce);
- KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce);
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAdd);
- KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd);
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetType);
- KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType);
- KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetForceIpoActsLocal);
- KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal);
-
};
#endif //__KX_IPOACTUATOR
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index cc0f50d9e7a..4117e493322 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -61,8 +61,7 @@
#include "KX_PyConstraintBinding.h"
#include "PHY_IPhysicsEnvironment.h"
-#include "SND_Scene.h"
-#include "SND_IAudioDevice.h"
+#include "AUD_C-API.h"
#include "NG_NetworkScene.h"
#include "NG_NetworkDeviceInterface.h"
@@ -113,7 +112,6 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system)
m_rendertools(NULL),
m_sceneconverter(NULL),
m_networkdevice(NULL),
- m_audiodevice(NULL),
m_pythondictionary(NULL),
m_keyboarddevice(NULL),
m_mousedevice(NULL),
@@ -211,15 +209,6 @@ void KX_KetsjiEngine::SetNetworkDevice(NG_NetworkDeviceInterface* networkdevice)
}
-
-void KX_KetsjiEngine::SetAudioDevice(SND_IAudioDevice* audiodevice)
-{
- MT_assert(audiodevice);
- m_audiodevice = audiodevice;
-}
-
-
-
void KX_KetsjiEngine::SetCanvas(RAS_ICanvas* canvas)
{
MT_assert(canvas);
@@ -393,12 +382,12 @@ void KX_KetsjiEngine::StartEngine(bool clearIpo)
m_firstframe = true;
m_bInitialized = true;
// there is always one scene enabled at startup
- World* world = m_scenes[0]->GetBlenderScene()->world;
- if (world)
+ Scene* scene = m_scenes[0]->GetBlenderScene();
+ if (scene)
{
- m_ticrate = world->ticrate ? world->ticrate : DEFAULT_LOGIC_TIC_RATE;
- m_maxLogicFrame = world->maxlogicstep ? world->maxlogicstep : 5;
- m_maxPhysicsFrame = world->maxphystep ? world->maxlogicstep : 5;
+ m_ticrate = scene->gm.ticrate ? scene->gm.ticrate : DEFAULT_LOGIC_TIC_RATE;
+ m_maxLogicFrame = scene->gm.maxlogicstep ? scene->gm.maxlogicstep : 5;
+ m_maxPhysicsFrame = scene->gm.maxphystep ? scene->gm.maxlogicstep : 5;
}
else
{
@@ -690,10 +679,7 @@ else
if (m_networkdevice)
m_networkdevice->NextFrame();
-
- if (m_audiodevice)
- m_audiodevice->NextFrame();
-
+
// scene management
ProcessScheduledScenes();
@@ -970,13 +956,40 @@ void KX_KetsjiEngine::DoSound(KX_Scene* scene)
MT_Vector3 listenervelocity = cam->GetLinearVelocity();
MT_Matrix3x3 listenerorientation = cam->NodeGetWorldOrientation();
- SND_Scene* soundscene = scene->GetSoundScene();
- soundscene->SetListenerTransform(
- listenerposition,
- listenervelocity,
- listenerorientation);
+ {
+ AUD_3DData data;
+ float f;
+
+ listenerorientation.getValue3x3(data.orientation);
+ listenerposition.getValue(data.position);
+ listenervelocity.getValue(data.velocity);
+
+ f = data.position[1];
+ data.position[1] = data.position[2];
+ data.position[2] = -f;
+
+ f = data.velocity[1];
+ data.velocity[1] = data.velocity[2];
+ data.velocity[2] = -f;
+
+ f = data.orientation[1];
+ data.orientation[1] = data.orientation[2];
+ data.orientation[2] = -f;
- soundscene->Proceed();
+ f = data.orientation[3];
+ data.orientation[3] = -data.orientation[6];
+ data.orientation[6] = f;
+
+ f = data.orientation[4];
+ data.orientation[4] = -data.orientation[8];
+ data.orientation[8] = -f;
+
+ f = data.orientation[5];
+ data.orientation[5] = data.orientation[7];
+ data.orientation[7] = f;
+
+ AUD_updateListener(&data);
+ }
}
@@ -1595,14 +1608,11 @@ KX_Scene* KX_KetsjiEngine::CreateScene(const STR_String& scenename)
KX_Scene* tmpscene = new KX_Scene(m_keyboarddevice,
m_mousedevice,
m_networkdevice,
- m_audiodevice,
scenename,
scene);
- m_sceneconverter->ConvertScene(scenename,
- tmpscene,
+ m_sceneconverter->ConvertScene(tmpscene,
m_pythondictionary,
- m_keyboarddevice,
m_rendertools,
m_canvas);
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index abba23ca376..acb9e53df8a 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -70,7 +70,6 @@ private:
class RAS_IRenderTools* m_rendertools;
class KX_ISceneConverter* m_sceneconverter;
class NG_NetworkDeviceInterface* m_networkdevice;
- class SND_IAudioDevice* m_audiodevice;
PyObject* m_pythondictionary;
class SCA_IInputDevice* m_keyboarddevice;
class SCA_IInputDevice* m_mousedevice;
@@ -191,7 +190,6 @@ private:
void DoSound(KX_Scene* scene);
public:
-
KX_KetsjiEngine(class KX_ISystem* system);
virtual ~KX_KetsjiEngine();
@@ -200,7 +198,6 @@ public:
void SetKeyboardDevice(SCA_IInputDevice* keyboarddevice);
void SetMouseDevice(SCA_IInputDevice* mousedevice);
void SetNetworkDevice(NG_NetworkDeviceInterface* networkdevice);
- void SetAudioDevice(SND_IAudioDevice* audiodevice);
void SetCanvas(RAS_ICanvas* canvas);
void SetRenderTools(RAS_IRenderTools* rendertools);
void SetRasterizer(RAS_IRasterizer* rasterizer);
@@ -398,6 +395,13 @@ protected:
bool BeginFrame();
void ClearFrame();
void EndFrame();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_KETSJI_ENGINE
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp
index fb385f8a9a2..85c495bc2bd 100644
--- a/source/gameengine/Ketsji/KX_Light.cpp
+++ b/source/gameengine/Ketsji/KX_Light.cpp
@@ -269,37 +269,31 @@ void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras)
/* ------------------------------------------------------------------------- */
PyTypeObject KX_LightObject::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_LightObject",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,
- &KX_GameObject::Sequence,
- &KX_GameObject::Mapping,
- 0,0,0,
- NULL,
- NULL,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &KX_GameObject::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_LightObject",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,
+ &KX_GameObject::Sequence,
+ &KX_GameObject::Mapping,
+ 0,0,0,
+ NULL,
+ NULL,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &KX_GameObject::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_LightObject::Methods[] = {
diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.h b/source/gameengine/Ketsji/KX_LightIpoSGController.h
index 98870cf5b3f..811dba5dba8 100644
--- a/source/gameengine/Ketsji/KX_LightIpoSGController.h
+++ b/source/gameengine/Ketsji/KX_LightIpoSGController.h
@@ -92,6 +92,13 @@ public:
};
void AddInterpolator(KX_IInterpolator* interp);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // KX_LIGHTIPOSGCONTROLLER_H
diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h
index 4d2e258bf94..906c12426eb 100644
--- a/source/gameengine/Ketsji/KX_MaterialIpoController.h
+++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h
@@ -50,6 +50,13 @@ public:
void AddInterpolator(KX_IInterpolator* interp);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MaterialIpoController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp
index ea9bc3e0fbc..744fdb75796 100644
--- a/source/gameengine/Ketsji/KX_MeshProxy.cpp
+++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp
@@ -46,13 +46,7 @@
#include "PyObjectPlus.h"
PyTypeObject KX_MeshProxy::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_MeshProxy",
sizeof(PyObjectPlus_Proxy),
0,
@@ -74,18 +68,12 @@ PyTypeObject KX_MeshProxy::Type = {
};
PyMethodDef KX_MeshProxy::Methods[] = {
-// Deprecated ----->
-{"getNumMaterials", (PyCFunction)KX_MeshProxy::sPyGetNumMaterials,METH_VARARGS},
-{"getNumPolygons", (PyCFunction)KX_MeshProxy::sPyGetNumPolygons,METH_NOARGS},
-// <-----
-
{"getMaterialName", (PyCFunction)KX_MeshProxy::sPyGetMaterialName,METH_VARARGS},
{"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS},
{"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS},
{"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS},
{"getPolygon", (PyCFunction)KX_MeshProxy::sPyGetPolygon,METH_VARARGS},
//{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS},
-
{NULL,NULL} //Sentinel
};
@@ -125,20 +113,6 @@ CValue* KX_MeshProxy::GetReplica() { return NULL;}
// stuff for python integration
-
-PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* args, PyObject* kwds)
-{
- int num = m_meshobj->NumMaterials();
- ShowDeprecationWarning("getNumMaterials()", "the numMaterials property");
- return PyLong_FromSsize_t(num);
-}
-
-PyObject* KX_MeshProxy::PyGetNumPolygons()
-{
- int num = m_meshobj->NumPolygons();
- ShowDeprecationWarning("getNumPolygons()", "the numPolygons property");
- return PyLong_FromSsize_t(num);
-}
PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds)
{
diff --git a/source/gameengine/Ketsji/KX_MotionState.h b/source/gameengine/Ketsji/KX_MotionState.h
index 0e43e88fbeb..63c265aa8a7 100644
--- a/source/gameengine/Ketsji/KX_MotionState.h
+++ b/source/gameengine/Ketsji/KX_MotionState.h
@@ -31,6 +31,10 @@
#include "PHY_IMotionState.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class KX_MotionState : public PHY_IMotionState
{
class SG_Spatial* m_node;
@@ -48,6 +52,12 @@ public:
virtual void setWorldOrientation(const float* ori);
virtual void calculateWorldTransformations();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_MOTIONSTATE
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
index ba4b47cb03f..8abc4f6b897 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
@@ -61,11 +61,13 @@ KX_MouseFocusSensor::KX_MouseFocusSensor(SCA_MouseManager* eventmgr,
int starty,
short int mousemode,
int focusmode,
+ bool bTouchPulse,
KX_Scene* kxscene,
KX_KetsjiEngine *kxengine,
SCA_IObject* gameobj)
: SCA_MouseSensor(eventmgr, startx, starty, mousemode, gameobj),
m_focusmode(focusmode),
+ m_bTouchPulse(bTouchPulse),
m_kxscene(kxscene),
m_kxengine(kxengine)
{
@@ -77,6 +79,7 @@ void KX_MouseFocusSensor::Init()
m_mouse_over_in_previous_frame = (m_invert)?true:false;
m_positive_event = false;
m_hitObject = 0;
+ m_hitObject_Last = NULL;
m_reset = true;
m_hitPosition.setValue(0,0,0);
@@ -107,7 +110,10 @@ bool KX_MouseFocusSensor::Evaluate()
m_positive_event = true;
if (!m_mouse_over_in_previous_frame) {
result = true;
- }
+ }
+ else if(m_bTouchPulse && (m_hitObject != m_hitObject_Last)) {
+ result = true;
+ }
}
if (reset) {
// force an event
@@ -123,7 +129,8 @@ bool KX_MouseFocusSensor::Evaluate()
}
m_mouse_over_in_previous_frame = obHasFocus;
-
+ m_hitObject_Last = (void *)m_hitObject;
+
return result;
}
@@ -339,13 +346,7 @@ const MT_Vector3& KX_MouseFocusSensor::HitNormal() const
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_MouseFocusSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_MouseFocusSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -367,13 +368,6 @@ PyTypeObject KX_MouseFocusSensor::Type = {
};
PyMethodDef KX_MouseFocusSensor::Methods[] = {
- {"getRayTarget", (PyCFunction) KX_MouseFocusSensor::sPyGetRayTarget, METH_NOARGS, (PY_METHODCHAR)GetRayTarget_doc},
- {"getRaySource", (PyCFunction) KX_MouseFocusSensor::sPyGetRaySource, METH_NOARGS, (PY_METHODCHAR)GetRaySource_doc},
- {"getHitObject",(PyCFunction) KX_MouseFocusSensor::sPyGetHitObject,METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
- {"getHitPosition",(PyCFunction) KX_MouseFocusSensor::sPyGetHitPosition,METH_NOARGS, (PY_METHODCHAR)GetHitPosition_doc},
- {"getHitNormal",(PyCFunction) KX_MouseFocusSensor::sPyGetHitNormal,METH_NOARGS, (PY_METHODCHAR)GetHitNormal_doc},
- {"getRayDirection",(PyCFunction) KX_MouseFocusSensor::sPyGetRayDirection,METH_NOARGS, (PY_METHODCHAR)GetRayDirection_doc},
-
{NULL,NULL} //Sentinel
};
@@ -384,81 +378,10 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("hitObject", KX_MouseFocusSensor, pyattr_get_hit_object),
KX_PYATTRIBUTE_RO_FUNCTION("hitPosition", KX_MouseFocusSensor, pyattr_get_hit_position),
KX_PYATTRIBUTE_RO_FUNCTION("hitNormal", KX_MouseFocusSensor, pyattr_get_hit_normal),
+ KX_PYATTRIBUTE_BOOL_RW("usePulseFocus", KX_MouseFocusSensor,m_bTouchPulse),
{ NULL } //Sentinel
};
-const char KX_MouseFocusSensor::GetHitObject_doc[] =
-"getHitObject()\n"
-"\tReturns the object that was hit by this ray.\n";
-PyObject* KX_MouseFocusSensor::PyGetHitObject()
-{
- ShowDeprecationWarning("GetHitObject()", "the hitObject property");
-
- if (m_hitObject)
- return m_hitObject->GetProxy();
-
- Py_RETURN_NONE;
-}
-
-
-const char KX_MouseFocusSensor::GetHitPosition_doc[] =
-"getHitPosition()\n"
-"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n";
-PyObject* KX_MouseFocusSensor::PyGetHitPosition()
-{
- ShowDeprecationWarning("getHitPosition()", "the hitPosition property");
-
- return PyObjectFrom(m_hitPosition);
-}
-
-const char KX_MouseFocusSensor::GetRayDirection_doc[] =
-"getRayDirection()\n"
-"\tReturns the direction from the ray (in worldcoordinates) .\n";
-PyObject* KX_MouseFocusSensor::PyGetRayDirection()
-{
- ShowDeprecationWarning("getRayDirection()", "the rayDirection property");
-
- MT_Vector3 dir = m_prevTargetPoint - m_prevSourcePoint;
- if(MT_fuzzyZero(dir)) dir.setValue(0,0,0);
- else dir.normalize();
- return PyObjectFrom(dir);
-}
-
-const char KX_MouseFocusSensor::GetHitNormal_doc[] =
-"getHitNormal()\n"
-"\tReturns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.\n";
-PyObject* KX_MouseFocusSensor::PyGetHitNormal()
-{
- ShowDeprecationWarning("getHitNormal()", "the hitNormal property");
-
- return PyObjectFrom(m_hitNormal);
-}
-
-
-/* getRayTarget */
-const char KX_MouseFocusSensor::GetRayTarget_doc[] =
-"getRayTarget()\n"
-"\tReturns the target of the ray that seeks the focus object,\n"
-"\tin worldcoordinates.";
-PyObject* KX_MouseFocusSensor::PyGetRayTarget()
-{
- ShowDeprecationWarning("getRayTarget()", "the rayTarget property");
-
- return PyObjectFrom(m_prevTargetPoint);
-}
-
-/* getRayTarget */
-const char KX_MouseFocusSensor::GetRaySource_doc[] =
-"getRaySource()\n"
-"\tReturns the source of the ray that seeks the focus object,\n"
-"\tin worldcoordinates.";
-PyObject* KX_MouseFocusSensor::PyGetRaySource()
-{
- ShowDeprecationWarning("getRaySource()", "the raySource property");
-
- return PyObjectFrom(m_prevSourcePoint);
-}
-
/* Attributes */
PyObject* KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
index dfada7a59cc..7b53557467f 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
@@ -49,11 +49,12 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
public:
- KX_MouseFocusSensor(class SCA_MouseManager* keybdmgr,
+ KX_MouseFocusSensor(class SCA_MouseManager* eventmgr,
int startx,
int starty,
short int mousemode,
int focusmode,
+ bool bTouchPulse,
KX_Scene* kxscene,
KX_KetsjiEngine* kxengine,
SCA_IObject* gameobj);
@@ -89,14 +90,6 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayTarget);
- KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRaySource);
-
- KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitObject);
- KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitPosition);
- KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitNormal);
- KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayDirection);
-
/* attributes */
static PyObject* pyattr_get_ray_source(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_ray_target(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
@@ -107,6 +100,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
/* --------------------------------------------------------------------- */
SCA_IObject* m_hitObject;
+ void* m_hitObject_Last; /* only use for comparison, never access */
private:
/**
@@ -120,6 +114,11 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
bool m_mouse_over_in_previous_frame;
/**
+ * Flags whether changes in hit object should trigger a pulse
+ */
+ bool m_bTouchPulse;
+
+ /**
* Flags whether the previous test evaluated positive.
*/
bool m_positive_event;
diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp
index 1a211a64b35..f7baacdfa61 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.cpp
+++ b/source/gameengine/Ketsji/KX_NearSensor.cpp
@@ -47,14 +47,12 @@ KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr,
float resetmargin,
bool bFindMaterial,
const STR_String& touchedpropname,
- class KX_Scene* scene,
PHY_IPhysicsController* ctrl)
:KX_TouchSensor(eventmgr,
gameobj,
bFindMaterial,
false,
- touchedpropname
- /*, scene */),
+ touchedpropname),
m_Margin(margin),
m_ResetMargin(resetmargin)
@@ -254,13 +252,7 @@ bool KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData
/* ------------------------------------------------------------------------- */
PyTypeObject KX_NearSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_NearSensor",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h
index f3c1d74805c..03d6f830579 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.h
+++ b/source/gameengine/Ketsji/KX_NearSensor.h
@@ -44,7 +44,7 @@ class KX_NearSensor : public KX_TouchSensor
protected:
float m_Margin;
float m_ResetMargin;
- KX_Scene* m_scene;
+
KX_ClientObjectInfo* m_client_info;
public:
KX_NearSensor(class SCA_EventManager* eventmgr,
@@ -53,7 +53,6 @@ public:
float resetmargin,
bool bFindMaterial,
const STR_String& touchedpropname,
- class KX_Scene* scene,
PHY_IPhysicsController* ctrl);
/*
public:
diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h
index 6d63dd77683..a32d027be9c 100644
--- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h
+++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h
@@ -67,6 +67,13 @@ public:
void AddInterpolator(KX_IInterpolator* interp);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ObColorIpoSGController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // KX_OBCOLORIPOSGCONTROLLER_H
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
index ae340d12be4..2601ced9c38 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
@@ -325,13 +325,7 @@ bool KX_ObjectActuator::isValid(KX_ObjectActuator::KX_OBJECT_ACT_VEC_TYPE type)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_ObjectActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_ObjectActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -353,32 +347,6 @@ PyTypeObject KX_ObjectActuator::Type = {
};
PyMethodDef KX_ObjectActuator::Methods[] = {
- // Deprecated ----->
- {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS},
- {"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS},
- {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS},
- {"setTorque", (PyCFunction) KX_ObjectActuator::sPySetTorque, METH_VARARGS},
- {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_NOARGS},
- {"setDLoc", (PyCFunction) KX_ObjectActuator::sPySetDLoc, METH_VARARGS},
- {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_NOARGS},
- {"setDRot", (PyCFunction) KX_ObjectActuator::sPySetDRot, METH_VARARGS},
- {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_NOARGS},
- {"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS},
- {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_NOARGS},
- {"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS},
- {"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS},
- {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_NOARGS},
- {"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS},
- {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_NOARGS},
- {"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS},
- {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_NOARGS},
- {"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS},
- {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_NOARGS},
- {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS},
- {"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS},
-
- // <----- Deprecated
-
{NULL,NULL} //Sentinel
};
@@ -499,7 +467,7 @@ Mathutils_Callback mathutils_obactu_vector_cb = {
PyObject* KX_ObjectActuator::pyattr_get_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_LINV);
+ return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_LINV);
}
int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
@@ -513,7 +481,7 @@ int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *a
PyObject* KX_ObjectActuator::pyattr_get_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_ANGV);
+ return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_ANGV);
}
int KX_ObjectActuator::pyattr_set_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
@@ -673,305 +641,4 @@ int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIB
return PY_SET_ATTR_SUCCESS;
}
-
-/* 1. set ------------------------------------------------------------------ */
-/* Removed! */
-
-/* 2. getForce */
-PyObject* KX_ObjectActuator::PyGetForce()
-{
- ShowDeprecationWarning("getForce()", "the force and the useLocalForce properties");
- PyObject *retVal = PyList_New(4);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_force[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_force[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_force[2]));
- PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Force));
-
- return retVal;
-}
-/* 3. setForce */
-PyObject* KX_ObjectActuator::PySetForce(PyObject* args)
-{
- ShowDeprecationWarning("setForce()", "the force and the useLocalForce properties");
- float vecArg[3];
- int bToggle = 0;
- if (!PyArg_ParseTuple(args, "fffi:setForce", &vecArg[0], &vecArg[1],
- &vecArg[2], &bToggle)) {
- return NULL;
- }
- m_force.setValue(vecArg);
- m_bitLocalFlag.Force = PyArgToBool(bToggle);
- UpdateFuzzyFlags();
- Py_RETURN_NONE;
-}
-
-/* 4. getTorque */
-PyObject* KX_ObjectActuator::PyGetTorque()
-{
- ShowDeprecationWarning("getTorque()", "the torque and the useLocalTorque properties");
- PyObject *retVal = PyList_New(4);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2]));
- PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Torque));
-
- return retVal;
-}
-/* 5. setTorque */
-PyObject* KX_ObjectActuator::PySetTorque(PyObject* args)
-{
- ShowDeprecationWarning("setTorque()", "the torque and the useLocalTorque properties");
- float vecArg[3];
- int bToggle = 0;
- if (!PyArg_ParseTuple(args, "fffi:setTorque", &vecArg[0], &vecArg[1],
- &vecArg[2], &bToggle)) {
- return NULL;
- }
- m_torque.setValue(vecArg);
- m_bitLocalFlag.Torque = PyArgToBool(bToggle);
- UpdateFuzzyFlags();
- Py_RETURN_NONE;
-}
-
-/* 6. getDLoc */
-PyObject* KX_ObjectActuator::PyGetDLoc()
-{
- ShowDeprecationWarning("getDLoc()", "the dLoc and the useLocalDLoc properties");
- PyObject *retVal = PyList_New(4);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_dloc[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_dloc[2]));
- PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DLoc));
-
- return retVal;
-}
-/* 7. setDLoc */
-PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args)
-{
- ShowDeprecationWarning("setDLoc()", "the dLoc and the useLocalDLoc properties");
- float vecArg[3];
- int bToggle = 0;
- if(!PyArg_ParseTuple(args, "fffi:setDLoc", &vecArg[0], &vecArg[1],
- &vecArg[2], &bToggle)) {
- return NULL;
- }
- m_dloc.setValue(vecArg);
- m_bitLocalFlag.DLoc = PyArgToBool(bToggle);
- UpdateFuzzyFlags();
- Py_RETURN_NONE;
-}
-
-/* 8. getDRot */
-PyObject* KX_ObjectActuator::PyGetDRot()
-{
- ShowDeprecationWarning("getDRot()", "the dRot and the useLocalDRot properties");
- PyObject *retVal = PyList_New(4);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_drot[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_drot[2]));
- PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DRot));
-
- return retVal;
-}
-/* 9. setDRot */
-PyObject* KX_ObjectActuator::PySetDRot(PyObject* args)
-{
- ShowDeprecationWarning("setDRot()", "the dRot and the useLocalDRot properties");
- float vecArg[3];
- int bToggle = 0;
- if (!PyArg_ParseTuple(args, "fffi:setDRot", &vecArg[0], &vecArg[1],
- &vecArg[2], &bToggle)) {
- return NULL;
- }
- m_drot.setValue(vecArg);
- m_bitLocalFlag.DRot = PyArgToBool(bToggle);
- UpdateFuzzyFlags();
- Py_RETURN_NONE;
-}
-
-/* 10. getLinearVelocity */
-PyObject* KX_ObjectActuator::PyGetLinearVelocity() {
- ShowDeprecationWarning("getLinearVelocity()", "the linV and the useLocalLinV properties");
- PyObject *retVal = PyList_New(4);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2]));
- PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity));
-
- return retVal;
-}
-
-/* 11. setLinearVelocity */
-PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) {
- ShowDeprecationWarning("setLinearVelocity()", "the linV and the useLocalLinV properties");
- float vecArg[3];
- int bToggle = 0;
- if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1],
- &vecArg[2], &bToggle)) {
- return NULL;
- }
- m_linear_velocity.setValue(vecArg);
- m_bitLocalFlag.LinearVelocity = PyArgToBool(bToggle);
- UpdateFuzzyFlags();
- Py_RETURN_NONE;
-}
-
-
-/* 12. getAngularVelocity */
-PyObject* KX_ObjectActuator::PyGetAngularVelocity() {
- ShowDeprecationWarning("getAngularVelocity()", "the angV and the useLocalAngV properties");
- PyObject *retVal = PyList_New(4);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2]));
- PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity));
-
- return retVal;
-}
-/* 13. setAngularVelocity */
-PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) {
- ShowDeprecationWarning("setAngularVelocity()", "the angV and the useLocalAngV properties");
- float vecArg[3];
- int bToggle = 0;
- if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1],
- &vecArg[2], &bToggle)) {
- return NULL;
- }
- m_angular_velocity.setValue(vecArg);
- m_bitLocalFlag.AngularVelocity = PyArgToBool(bToggle);
- UpdateFuzzyFlags();
- Py_RETURN_NONE;
-}
-
-/* 13. setDamping */
-PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) {
- ShowDeprecationWarning("setDamping()", "the damping property");
- int damping = 0;
- if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) {
- return NULL;
- }
- m_damping = damping;
- Py_RETURN_NONE;
-}
-
-/* 13. getVelocityDamping */
-PyObject* KX_ObjectActuator::PyGetDamping() {
- ShowDeprecationWarning("getDamping()", "the damping property");
- return Py_BuildValue("i",m_damping);
-}
-/* 6. getForceLimitX */
-PyObject* KX_ObjectActuator::PyGetForceLimitX()
-{
- ShowDeprecationWarning("getForceLimitX()", "the forceLimitX property");
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[0]));
- PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque));
-
- return retVal;
-}
-/* 7. setForceLimitX */
-PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args)
-{
- ShowDeprecationWarning("setForceLimitX()", "the forceLimitX property");
- float vecArg[2];
- int bToggle = 0;
- if(!PyArg_ParseTuple(args, "ffi:setForceLimitX", &vecArg[0], &vecArg[1], &bToggle)) {
- return NULL;
- }
- m_drot[0] = vecArg[0];
- m_dloc[0] = vecArg[1];
- m_bitLocalFlag.Torque = PyArgToBool(bToggle);
- Py_RETURN_NONE;
-}
-
-/* 6. getForceLimitY */
-PyObject* KX_ObjectActuator::PyGetForceLimitY()
-{
- ShowDeprecationWarning("getForceLimitY()", "the forceLimitY property");
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[1]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1]));
- PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc));
-
- return retVal;
-}
-/* 7. setForceLimitY */
-PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args)
-{
- ShowDeprecationWarning("setForceLimitY()", "the forceLimitY property");
- float vecArg[2];
- int bToggle = 0;
- if(!PyArg_ParseTuple(args, "ffi:setForceLimitY", &vecArg[0], &vecArg[1], &bToggle)) {
- return NULL;
- }
- m_drot[1] = vecArg[0];
- m_dloc[1] = vecArg[1];
- m_bitLocalFlag.DLoc = PyArgToBool(bToggle);
- Py_RETURN_NONE;
-}
-
-/* 6. getForceLimitZ */
-PyObject* KX_ObjectActuator::PyGetForceLimitZ()
-{
- ShowDeprecationWarning("getForceLimitZ()", "the forceLimitZ property");
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[2]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[2]));
- PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot));
-
- return retVal;
-}
-/* 7. setForceLimitZ */
-PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args)
-{
- ShowDeprecationWarning("setForceLimitZ()", "the forceLimitZ property");
- float vecArg[2];
- int bToggle = 0;
- if(!PyArg_ParseTuple(args, "ffi:setForceLimitZ", &vecArg[0], &vecArg[1], &bToggle)) {
- return NULL;
- }
- m_drot[2] = vecArg[0];
- m_dloc[2] = vecArg[1];
- m_bitLocalFlag.DRot = PyArgToBool(bToggle);
- Py_RETURN_NONE;
-}
-
-/* 4. getPID */
-PyObject* KX_ObjectActuator::PyGetPID()
-{
- ShowDeprecationWarning("getPID()", "the pid property");
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_pid[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_pid[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_pid[2]));
-
- return retVal;
-}
-/* 5. setPID */
-PyObject* KX_ObjectActuator::PySetPID(PyObject* args)
-{
- ShowDeprecationWarning("setPID()", "the pid property");
- float vecArg[3];
- if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) {
- return NULL;
- }
- m_pid.setValue(vecArg);
- Py_RETURN_NONE;
-}
-
-
-
-
-
/* eof */
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h
index 20aec9e0e86..7a8c7de16b1 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.h
@@ -163,29 +163,6 @@ public:
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetTorque);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDLoc);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDRot);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetLinearVelocity);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetAngularVelocity);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDamping);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitX);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitY);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitZ);
- KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID);
- KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetPID);
-
/* Attributes */
static PyObject* pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h
index 2bd9f69d824..d8ecc74277c 100644
--- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h
+++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h
@@ -50,6 +50,13 @@ public:
private:
MT_Matrix3x3& m_target;
KX_IScalarInterpolator *m_ipos[3];
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+private:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp
index befa2aaff56..20e982f03e0 100644
--- a/source/gameengine/Ketsji/KX_ParentActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp
@@ -140,13 +140,7 @@ bool KX_ParentActuator::Update()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_ParentActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_ParentActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -168,10 +162,6 @@ PyTypeObject KX_ParentActuator::Type = {
};
PyMethodDef KX_ParentActuator::Methods[] = {
- // Deprecated ----->
- {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
- {"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
- // <-----
{NULL,NULL} //Sentinel
};
@@ -211,55 +201,4 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE
return PY_SET_ATTR_SUCCESS;
}
-
-/* Deprecated -----> */
-/* 1. setObject */
-const char KX_ParentActuator::SetObject_doc[] =
-"setObject(object)\n"
-"\t- object: KX_GameObject, string or None\n"
-"\tSet the object to set as parent.\n";
-PyObject* KX_ParentActuator::PySetObject(PyObject* value) {
- KX_GameObject *gameobj;
-
- ShowDeprecationWarning("setObject()", "the object property");
-
- if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_ParentActuator"))
- return NULL; // ConvertPythonToGameObject sets the error
-
- if (m_ob != NULL)
- m_ob->UnregisterActuator(this);
-
- m_ob = (SCA_IObject*)gameobj;
- if (m_ob)
- m_ob->RegisterActuator(this);
-
- Py_RETURN_NONE;
-}
-
-/* 2. getObject */
-
-/* get obj ---------------------------------------------------------- */
-const char KX_ParentActuator::GetObject_doc[] =
-"getObject(name_only = 1)\n"
-"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
-"\tReturns the object that is set to.\n";
-PyObject* KX_ParentActuator::PyGetObject(PyObject* args)
-{
- int ret_name_only = 1;
-
- ShowDeprecationWarning("getObject()", "the object property");
-
- if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
- return NULL;
-
- if (!m_ob)
- Py_RETURN_NONE;
-
- if (ret_name_only)
- return PyUnicode_FromString(m_ob->GetName().ReadPtr());
- else
- return m_ob->GetProxy();
-}
-/* <----- */
-
/* eof */
diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h
index aeb39eabf89..f750affc8a1 100644
--- a/source/gameengine/Ketsji/KX_ParentActuator.h
+++ b/source/gameengine/Ketsji/KX_ParentActuator.h
@@ -84,11 +84,6 @@ class KX_ParentActuator : public SCA_IActuator
/* These are used to get and set m_ob */
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
-
- // Deprecated ----->
- KX_PYMETHOD_DOC_O(KX_ParentActuator,SetObject);
- KX_PYMETHOD_DOC_VARARGS(KX_ParentActuator,GetObject);
- // <-----
}; /* end of class KX_ParentActuator : public SCA_PropertyActuator */
diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
index 7bce311f1b6..edb19002671 100644
--- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
@@ -113,31 +113,25 @@ PyAttributeDef KX_PhysicsObjectWrapper::Attributes[] = {
//python specific stuff
PyTypeObject KX_PhysicsObjectWrapper::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_PhysicsObjectWrapper",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &PyObjectPlus::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_PhysicsObjectWrapper",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_PhysicsObjectWrapper::Methods[] = {
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp
index a1571b17756..af8e0510a11 100644
--- a/source/gameengine/Ketsji/KX_PolyProxy.cpp
+++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp
@@ -39,13 +39,7 @@
#include "KX_PyMath.h"
PyTypeObject KX_PolyProxy::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_PolyProxy",
sizeof(PyObjectPlus_Proxy),
0,
@@ -138,19 +132,19 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr)
}
if (!strcmp(attr_str, "v1"))
{
- return PyLong_FromSsize_t(m_polygon->GetVertexOffset(0));
+ return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 0));
}
if (!strcmp(attr_str, "v2"))
{
- return PyLong_FromSsize_t(m_polygon->GetVertexOffset(1));
+ return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 1));
}
if (!strcmp(attr_str, "v3"))
{
- return PyLong_FromSsize_t(m_polygon->GetVertexOffset(2));
+ return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, 2));
}
if (!strcmp(attr_str, "v4"))
{
- return PyLong_FromSsize_t(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0));
+ return PyLong_FromSsize_t(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffsetAbs(m_mesh, 3):0));
}
if (!strcmp(attr_str, "visible"))
{
@@ -250,7 +244,7 @@ KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex,
}
if (index < m_polygon->VertexCount())
{
- return PyLong_FromSsize_t(m_polygon->GetVertexOffset(index));
+ return PyLong_FromSsize_t(m_polygon->GetVertexOffsetAbs(m_mesh, index));
}
return PyLong_FromSsize_t(0);
}
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
index 9bc84127572..5b4322ae4cd 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
@@ -88,8 +88,7 @@ void KX_PolygonMaterial::Initialize(
mode,
transp,
alpha,
- zsort,
- lightlayer);
+ zsort);
m_tface = tface;
m_mcol = mcol;
m_material = ma;
@@ -149,7 +148,7 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c
if (GetCachingInfo() != cachingInfo)
{
if (!cachingInfo)
- GPU_set_tpage(NULL);
+ GPU_set_tpage(NULL, 0);
cachingInfo = GetCachingInfo();
@@ -157,10 +156,10 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c
{
Image *ima = (Image*)m_tface->tpage;
GPU_update_image_time(ima, rasty->GetTime());
- GPU_set_tpage(m_tface);
+ GPU_set_tpage(m_tface, 1);
}
else
- GPU_set_tpage(NULL);
+ GPU_set_tpage(NULL, 0);
if(m_drawingmode & RAS_IRasterizer::KX_TWOSIDE)
rasty->SetCullFace(false);
@@ -239,31 +238,25 @@ PyAttributeDef KX_PolygonMaterial::Attributes[] = {
};
PyTypeObject KX_PolygonMaterial::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_PolygonMaterial",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &PyObjectPlus::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_PolygonMaterial",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setCustomMaterial, "setCustomMaterial(material)")
@@ -304,7 +297,7 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setTexture, "setTexture(tface)")
if (PyArg_ParseTuple(args, "O!:setTexture", &PyCObject_Type, &pytface))
{
MTFace *tface = (MTFace*) PyCObject_AsVoidPtr(pytface);
- GPU_set_tpage(tface);
+ GPU_set_tpage(tface, 1);
Py_RETURN_NONE;
}
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h
index 266b4d7e789..dc42bd2f81b 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.h
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h
@@ -35,6 +35,10 @@
#include "RAS_IRasterizer.h"
#include "DNA_ID.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
struct MTFace;
struct Material;
struct MTex;
@@ -57,6 +61,7 @@ private:
mutable int m_pass;
public:
+
KX_PolygonMaterial();
void Initialize(const STR_String &texname,
Material* ma,
diff --git a/source/gameengine/Ketsji/KX_PositionInterpolator.h b/source/gameengine/Ketsji/KX_PositionInterpolator.h
index bff0b4201c2..f6c6fa98a0e 100644
--- a/source/gameengine/Ketsji/KX_PositionInterpolator.h
+++ b/source/gameengine/Ketsji/KX_PositionInterpolator.h
@@ -50,6 +50,13 @@ public:
private:
MT_Point3& m_target;
KX_IScalarInterpolator *m_ipos[3];
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+private:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index 94e8d1fd583..04cec3c9106 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -542,62 +542,60 @@ static PyObject* gPyRemoveConstraint(PyObject* self,
static struct PyMethodDef physicsconstraints_methods[] = {
{"setGravity",(PyCFunction) gPySetGravity,
- METH_VARARGS, (PY_METHODCHAR)gPySetGravity__doc__},
+ METH_VARARGS, (const char *)gPySetGravity__doc__},
{"setDebugMode",(PyCFunction) gPySetDebugMode,
- METH_VARARGS, (PY_METHODCHAR)gPySetDebugMode__doc__},
+ METH_VARARGS, (const char *)gPySetDebugMode__doc__},
/// settings that influence quality of the rigidbody dynamics
{"setNumIterations",(PyCFunction) gPySetNumIterations,
- METH_VARARGS, (PY_METHODCHAR)gPySetNumIterations__doc__},
+ METH_VARARGS, (const char *)gPySetNumIterations__doc__},
{"setNumTimeSubSteps",(PyCFunction) gPySetNumTimeSubSteps,
- METH_VARARGS, (PY_METHODCHAR)gPySetNumTimeSubSteps__doc__},
+ METH_VARARGS, (const char *)gPySetNumTimeSubSteps__doc__},
{"setDeactivationTime",(PyCFunction) gPySetDeactivationTime,
- METH_VARARGS, (PY_METHODCHAR)gPySetDeactivationTime__doc__},
+ METH_VARARGS, (const char *)gPySetDeactivationTime__doc__},
{"setDeactivationLinearTreshold",(PyCFunction) gPySetDeactivationLinearTreshold,
- METH_VARARGS, (PY_METHODCHAR)gPySetDeactivationLinearTreshold__doc__},
+ METH_VARARGS, (const char *)gPySetDeactivationLinearTreshold__doc__},
{"setDeactivationAngularTreshold",(PyCFunction) gPySetDeactivationAngularTreshold,
- METH_VARARGS, (PY_METHODCHAR)gPySetDeactivationAngularTreshold__doc__},
+ METH_VARARGS, (const char *)gPySetDeactivationAngularTreshold__doc__},
{"setContactBreakingTreshold",(PyCFunction) gPySetContactBreakingTreshold,
- METH_VARARGS, (PY_METHODCHAR)gPySetContactBreakingTreshold__doc__},
+ METH_VARARGS, (const char *)gPySetContactBreakingTreshold__doc__},
{"setCcdMode",(PyCFunction) gPySetCcdMode,
- METH_VARARGS, (PY_METHODCHAR)gPySetCcdMode__doc__},
+ METH_VARARGS, (const char *)gPySetCcdMode__doc__},
{"setSorConstant",(PyCFunction) gPySetSorConstant,
- METH_VARARGS, (PY_METHODCHAR)gPySetSorConstant__doc__},
+ METH_VARARGS, (const char *)gPySetSorConstant__doc__},
{"setSolverTau",(PyCFunction) gPySetSolverTau,
- METH_VARARGS, (PY_METHODCHAR)gPySetSolverTau__doc__},
+ METH_VARARGS, (const char *)gPySetSolverTau__doc__},
{"setSolverDamping",(PyCFunction) gPySetSolverDamping,
- METH_VARARGS, (PY_METHODCHAR)gPySetSolverDamping__doc__},
+ METH_VARARGS, (const char *)gPySetSolverDamping__doc__},
{"setLinearAirDamping",(PyCFunction) gPySetLinearAirDamping,
- METH_VARARGS, (PY_METHODCHAR)gPySetLinearAirDamping__doc__},
+ METH_VARARGS, (const char *)gPySetLinearAirDamping__doc__},
{"setUseEpa",(PyCFunction) gPySetUseEpa,
- METH_VARARGS, (PY_METHODCHAR)gPySetUseEpa__doc__},
+ METH_VARARGS, (const char *)gPySetUseEpa__doc__},
{"setSolverType",(PyCFunction) gPySetSolverType,
- METH_VARARGS, (PY_METHODCHAR)gPySetSolverType__doc__},
+ METH_VARARGS, (const char *)gPySetSolverType__doc__},
{"createConstraint",(PyCFunction) gPyCreateConstraint,
- METH_VARARGS, (PY_METHODCHAR)gPyCreateConstraint__doc__},
+ METH_VARARGS, (const char *)gPyCreateConstraint__doc__},
{"getVehicleConstraint",(PyCFunction) gPyGetVehicleConstraint,
- METH_VARARGS, (PY_METHODCHAR)gPyGetVehicleConstraint__doc__},
+ METH_VARARGS, (const char *)gPyGetVehicleConstraint__doc__},
{"removeConstraint",(PyCFunction) gPyRemoveConstraint,
- METH_VARARGS, (PY_METHODCHAR)gPyRemoveConstraint__doc__},
+ METH_VARARGS, (const char *)gPyRemoveConstraint__doc__},
{"getAppliedImpulse",(PyCFunction) gPyGetAppliedImpulse,
- METH_VARARGS, (PY_METHODCHAR)gPyGetAppliedImpulse__doc__},
+ METH_VARARGS, (const char *)gPyGetAppliedImpulse__doc__},
//sentinel
{ NULL, (PyCFunction) NULL, 0, NULL }
};
-
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef PhysicsConstraints_module_def = {
{}, /* m_base */
"PhysicsConstraints", /* m_name */
@@ -609,7 +607,6 @@ static struct PyModuleDef PhysicsConstraints_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
PyObject* initPythonConstraintBinding()
{
@@ -627,15 +624,9 @@ PyObject* initPythonConstraintBinding()
}
else {
PyErr_Clear();
-
-#if (PY_VERSION_HEX >= 0x03000000)
+
m = PyModule_Create(&PhysicsConstraints_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), PhysicsConstraints_module_def.m_name, m);
-#else
- m = Py_InitModule4("PhysicsConstraints", physicsconstraints_methods,
- PhysicsConstraints_module_documentation,
- (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
}
// Add some symbolic constants to the module
diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp
index 6d33c38190c..a41dab194dd 100644
--- a/source/gameengine/Ketsji/KX_PyMath.cpp
+++ b/source/gameengine/Ketsji/KX_PyMath.cpp
@@ -146,7 +146,7 @@ PyObject* PyObjectFrom(const MT_Quaternion &qrot)
{
/* NOTE, were re-ordering here for Mathutils compat */
float fvec[4]= {qrot[3], qrot[0], qrot[1], qrot[2]};
- return newQuaternionObject(fvec, Py_WRAP, NULL);
+ return newQuaternionObject(fvec, Py_NEW, NULL);
}
#endif
@@ -154,7 +154,7 @@ PyObject* PyObjectFrom(const MT_Tuple4 &vec)
{
#ifdef USE_MATHUTILS
float fvec[4]= {vec[0], vec[1], vec[2], vec[3]};
- return newVectorObject(fvec, 4, Py_WRAP, NULL);
+ return newVectorObject(fvec, 4, Py_NEW, NULL);
#else
PyObject *list = PyList_New(4);
PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0]));
@@ -169,7 +169,7 @@ PyObject* PyObjectFrom(const MT_Tuple3 &vec)
{
#ifdef USE_MATHUTILS
float fvec[3]= {vec[0], vec[1], vec[2]};
- return newVectorObject(fvec, 3, Py_WRAP, NULL);
+ return newVectorObject(fvec, 3, Py_NEW, NULL);
#else
PyObject *list = PyList_New(3);
PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0]));
@@ -183,7 +183,7 @@ PyObject* PyObjectFrom(const MT_Tuple2 &vec)
{
#ifdef USE_MATHUTILS
float fvec[2]= {vec[0], vec[1]};
- return newVectorObject(fvec, 2, Py_WRAP, NULL);
+ return newVectorObject(fvec, 2, Py_NEW, NULL);
#else
PyObject *list = PyList_New(2);
PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0]));
diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h
index 9ee11c9e745..17102905607 100644
--- a/source/gameengine/Ketsji/KX_PyMath.h
+++ b/source/gameengine/Ketsji/KX_PyMath.h
@@ -109,30 +109,33 @@ bool PyVecTo(PyObject* pyval, T& vec)
if(VectorObject_Check(pyval)) {
VectorObject *pyvec= (VectorObject *)pyval;
+ BaseMath_ReadCallback(pyvec);
if (pyvec->size != Size(vec)) {
PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", pyvec->size, Size(vec));
return false;
}
- vec.getValue((float *) pyvec->vec);
+ vec.setValue((float *) pyvec->vec);
return true;
}
else if(QuaternionObject_Check(pyval)) {
QuaternionObject *pyquat= (QuaternionObject *)pyval;
+ BaseMath_ReadCallback(pyquat);
if (4 != Size(vec)) {
PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 4, Size(vec));
return false;
}
/* xyzw -> wxyz reordering is done by PyQuatTo */
- vec.getValue((float *) pyquat->quat);
+ vec.setValue((float *) pyquat->quat);
return true;
}
else if(EulerObject_Check(pyval)) {
EulerObject *pyeul= (EulerObject *)pyval;
+ BaseMath_ReadCallback(pyeul);
if (3 != Size(vec)) {
PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 3, Size(vec));
return false;
}
- vec.getValue((float *) pyeul->eul);
+ vec.setValue((float *) pyeul->eul);
return true;
} else
#endif
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index ac49b49c130..9e81bcb3871 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -79,7 +79,6 @@ extern "C" {
#include "ListValue.h"
#include "InputParser.h"
#include "KX_Scene.h"
-#include "SND_DeviceManager.h"
#include "NG_NetworkScene.h" //Needed for sendMessage()
@@ -93,6 +92,7 @@ extern "C" {
/* we only need this to get a list of libraries from the main struct */
#include "DNA_ID.h"
+#include "DNA_scene_types.h"
#include "marshal.h" /* python header for loading/saving dicts */
@@ -142,7 +142,7 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons
// List of methods defined in the module
static PyObject* ErrorObject;
-STR_String gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1)";
+static const char *gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1]";
static PyObject* gPyGetRandomFloat(PyObject*)
{
@@ -207,74 +207,24 @@ static PyObject* gPySendMessage(PyObject*, PyObject* args)
Py_RETURN_NONE;
}
-static bool usedsp = false;
-
// this gets a pointer to an array filled with floats
static PyObject* gPyGetSpectrum(PyObject*)
{
- SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
-
PyObject* resultlist = PyList_New(512);
- if (audiodevice)
- {
- if (!usedsp)
- {
- audiodevice->StartUsingDSP();
- usedsp = true;
- }
-
- float* spectrum = audiodevice->GetSpectrum();
-
- for (int index = 0; index < 512; index++)
- {
- PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(spectrum[index]));
- }
- }
- else {
- for (int index = 0; index < 512; index++)
- {
- PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0));
- }
- }
+ for (int index = 0; index < 512; index++)
+ {
+ PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0));
+ }
return resultlist;
}
-#if 0 // unused
-static PyObject* gPyStartDSP(PyObject*, PyObject* args)
-{
- SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
-
- if (!audiodevice) {
- PyErr_SetString(PyExc_RuntimeError, "no audio device available");
- return NULL;
- }
-
- if (!usedsp) {
- audiodevice->StartUsingDSP();
- usedsp = true;
- }
-
- Py_RETURN_NONE;
-}
-#endif
-
-
static PyObject* gPyStopDSP(PyObject*, PyObject* args)
{
- SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
-
- if (!audiodevice) {
- PyErr_SetString(PyExc_RuntimeError, "no audio device available");
- return NULL;
- }
-
- if (usedsp) {
- audiodevice->StopUsingDSP();
- usedsp = true;
- }
+ PyErr_SetString(PyExc_RuntimeError, "no audio device available");
+ return NULL;
Py_RETURN_NONE;
}
@@ -396,7 +346,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
return list;
}
-static STR_String gPyGetCurrentScene_doc =
+static const char *gPyGetCurrentScene_doc =
"getCurrentScene()\n"
"Gets a reference to the current scene.\n";
static PyObject* gPyGetCurrentScene(PyObject* self)
@@ -404,7 +354,7 @@ static PyObject* gPyGetCurrentScene(PyObject* self)
return gp_KetsjiScene->GetProxy();
}
-static STR_String gPyGetSceneList_doc =
+static const char *gPyGetSceneList_doc =
"getSceneList()\n"
"Return a list of converted scenes.\n";
static PyObject* gPyGetSceneList(PyObject* self)
@@ -498,61 +448,32 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *)
}
-static PyObject *gEvalExpression(PyObject*, PyObject* value)
-{
- char* txt= _PyUnicode_AsString(value);
-
- if (txt==NULL) {
- PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument");
- return NULL;
- }
-
- CParser parser;
- CExpression* expr = parser.ProcessText(txt);
- CValue* val = expr->Calculate();
- expr->Release();
-
- if (val) {
- PyObject* pyobj = val->ConvertValueToPython();
- if (pyobj)
- return pyobj;
- else
- return val->GetProxy();
- }
-
- Py_RETURN_NONE;
-}
-
-
static struct PyMethodDef game_methods[] = {
- {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (PY_METHODCHAR)gPyExpandPath_doc},
- {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (PY_METHODCHAR)gPySendMessage_doc},
+ {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (const char *)gPyExpandPath_doc},
+ {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (const char *)gPySendMessage_doc},
{"getCurrentController",
(PyCFunction) SCA_PythonController::sPyGetCurrentController,
- METH_NOARGS, (PY_METHODCHAR)SCA_PythonController::sPyGetCurrentController__doc__},
+ METH_NOARGS, SCA_PythonController::sPyGetCurrentController__doc__},
{"getCurrentScene", (PyCFunction) gPyGetCurrentScene,
- METH_NOARGS, (PY_METHODCHAR)gPyGetCurrentScene_doc.Ptr()},
+ METH_NOARGS, gPyGetCurrentScene_doc},
{"getSceneList", (PyCFunction) gPyGetSceneList,
- METH_NOARGS, (PY_METHODCHAR)gPyGetSceneList_doc.Ptr()},
- {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator,
- METH_VARARGS, (PY_METHODCHAR)SCA_PythonController::sPyAddActiveActuator__doc__},
+ METH_NOARGS, (const char *)gPyGetSceneList_doc},
{"getRandomFloat",(PyCFunction) gPyGetRandomFloat,
- METH_NOARGS, (PY_METHODCHAR)gPyGetRandomFloat_doc.Ptr()},
- {"setGravity",(PyCFunction) gPySetGravity, METH_O, (PY_METHODCHAR)"set Gravitation"},
- {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (PY_METHODCHAR)"get audio spectrum"},
- {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (PY_METHODCHAR)"stop using the audio dsp (for performance reasons)"},
- {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (PY_METHODCHAR)"Gets the max number of logic frame per render frame"},
- {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (PY_METHODCHAR)"Sets the max number of logic frame per render frame"},
- {"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS, (PY_METHODCHAR)"Gets the max number of physics frame per render frame"},
- {"setMaxPhysicsFrame", (PyCFunction) gPySetMaxPhysicsFrame, METH_VARARGS, (PY_METHODCHAR)"Sets the max number of physics farme per render frame"},
- {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the logic tic rate"},
- {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (PY_METHODCHAR)"Sets the logic tic rate"},
- {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the physics tic rate"},
- {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS, (PY_METHODCHAR)"Sets the physics tic rate"},
- {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (PY_METHODCHAR)"Gets the estimated average frame rate"},
- {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (PY_METHODCHAR)"Gets a list of blend files in the same directory as the current blend file"},
- {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (PY_METHODCHAR)"Prints GL Extension Info"},
- {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (PY_METHODCHAR)"Evaluate a string as a game logic expression"},
+ METH_NOARGS, (const char *)gPyGetRandomFloat_doc},
+ {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"},
+ {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)"get audio spectrum"},
+ {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (const char *)"stop using the audio dsp (for performance reasons)"},
+ {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (const char *)"Gets the max number of logic frame per render frame"},
+ {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (const char *)"Sets the max number of logic frame per render frame"},
+ {"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS, (const char *)"Gets the max number of physics frame per render frame"},
+ {"setMaxPhysicsFrame", (PyCFunction) gPySetMaxPhysicsFrame, METH_VARARGS, (const char *)"Sets the max number of physics farme per render frame"},
+ {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (const char *)"Gets the logic tic rate"},
+ {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (const char *)"Sets the logic tic rate"},
+ {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (const char *)"Gets the physics tic rate"},
+ {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS, (const char *)"Sets the physics tic rate"},
+ {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (const char *)"Gets the estimated average frame rate"},
+ {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (const char *)"Gets a list of blend files in the same directory as the current blend file"},
+ {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (const char *)"Prints GL Extension Info"},
{NULL, (PyCFunction) NULL, 0, NULL }
};
@@ -818,17 +739,17 @@ static PyObject* gPyDisableMotionBlur(PyObject*)
int getGLSLSettingFlag(char *setting)
{
if(strcmp(setting, "lights") == 0)
- return G_FILE_GLSL_NO_LIGHTS;
+ return GAME_GLSL_NO_LIGHTS;
else if(strcmp(setting, "shaders") == 0)
- return G_FILE_GLSL_NO_SHADERS;
+ return GAME_GLSL_NO_SHADERS;
else if(strcmp(setting, "shadows") == 0)
- return G_FILE_GLSL_NO_SHADOWS;
+ return GAME_GLSL_NO_SHADOWS;
else if(strcmp(setting, "ramps") == 0)
- return G_FILE_GLSL_NO_RAMPS;
+ return GAME_GLSL_NO_RAMPS;
else if(strcmp(setting, "nodes") == 0)
- return G_FILE_GLSL_NO_NODES;
+ return GAME_GLSL_NO_NODES;
else if(strcmp(setting, "extra_textures") == 0)
- return G_FILE_GLSL_NO_EXTRA_TEX;
+ return GAME_GLSL_NO_EXTRA_TEX;
else
return -1;
}
@@ -837,8 +758,9 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*,
PyObject* args,
PyObject*)
{
+ GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm);
char *setting;
- int enable, flag, fileflags;
+ int enable, flag, sceneflag;
if (!PyArg_ParseTuple(args,"si:setGLSLMaterialSetting",&setting,&enable))
return NULL;
@@ -850,15 +772,15 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*,
return NULL;
}
- fileflags = G.fileflags;
+ sceneflag= gm->flag;
if (enable)
- G.fileflags &= ~flag;
+ gm->flag &= ~flag;
else
- G.fileflags |= flag;
+ gm->flag |= flag;
/* display lists and GLSL materials need to be remade */
- if(G.fileflags != fileflags) {
+ if(sceneflag != gm->flag) {
GPU_materials_free();
if(gp_KetsjiEngine) {
KX_SceneList *scenes = gp_KetsjiEngine->CurrentScenes();
@@ -879,6 +801,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*,
PyObject* args,
PyObject*)
{
+ GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm);
char *setting;
int enabled = 0, flag;
@@ -892,7 +815,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*,
return NULL;
}
- enabled = ((G.fileflags & flag) != 0);
+ enabled = ((gm->flag & flag) != 0);
return PyLong_FromSsize_t(enabled);
}
@@ -904,35 +827,34 @@ static PyObject* gPySetMaterialType(PyObject*,
PyObject* args,
PyObject*)
{
- int flag, type;
+ GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm);
+ int type;
if (!PyArg_ParseTuple(args,"i:setMaterialType",&type))
return NULL;
if(type == KX_BLENDER_GLSL_MATERIAL)
- flag = G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL;
+ gm->matmode= GAME_MAT_GLSL;
else if(type == KX_BLENDER_MULTITEX_MATERIAL)
- flag = G_FILE_GAME_MAT;
+ gm->matmode= GAME_MAT_MULTITEX;
else if(type == KX_TEXFACE_MATERIAL)
- flag = 0;
+ gm->matmode= GAME_MAT_TEXFACE;
else {
PyErr_SetString(PyExc_ValueError, "Rasterizer.setMaterialType(int): material type is not known");
return NULL;
}
- G.fileflags &= ~(G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL);
- G.fileflags |= flag;
-
Py_RETURN_NONE;
}
static PyObject* gPyGetMaterialType(PyObject*)
{
+ GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm);
int flag;
- if(G.fileflags & G_FILE_GAME_MAT_GLSL)
+ if(gm->matmode == GAME_MAT_GLSL)
flag = KX_BLENDER_GLSL_MATERIAL;
- else if(G.fileflags & G_FILE_GAME_MAT)
+ else if(gm->matmode == GAME_MAT_MULTITEX)
flag = KX_BLENDER_MULTITEX_MATERIAL;
else
flag = KX_TEXFACE_MATERIAL;
@@ -1019,7 +941,6 @@ static char Rasterizer_module_documentation[] =
"This is the Python API for the game engine of Rasterizer"
;
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef GameLogic_module_def = {
{}, /* m_base */
"GameLogic", /* m_name */
@@ -1031,7 +952,6 @@ static struct PyModuleDef GameLogic_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack to get gravity hook
{
@@ -1055,16 +975,9 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
}
else {
PyErr_Clear();
-
// Create the module and add the functions
-#if (PY_VERSION_HEX >= 0x03000000)
m = PyModule_Create(&GameLogic_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), GameLogic_module_def.m_name, m);
-#else
- m = Py_InitModule4("GameLogic", game_methods,
- GameLogic_module_documentation,
- (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
}
// Add some symbolic constants to the module
@@ -1346,18 +1259,11 @@ PyObject *KXpy_import(PyObject *self, PyObject *args)
PyObject *locals = NULL;
PyObject *fromlist = NULL;
PyObject *l, *m, *n;
-
-#if (PY_VERSION_HEX >= 0x02060000)
- int dummy_val; /* what does this do?*/
+ int level; /* not used yet */
if (!PyArg_ParseTuple(args, "s|OOOi:m_import",
- &name, &globals, &locals, &fromlist, &dummy_val))
+ &name, &globals, &locals, &fromlist, &level))
return NULL;
-#else
- if (!PyArg_ParseTuple(args, "s|OOO:m_import",
- &name, &globals, &locals, &fromlist))
- return NULL;
-#endif
/* check for builtin modules */
m = PyImport_AddModule("sys");
@@ -1614,7 +1520,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
*/
static bool first_time = true;
-#if (PY_VERSION_HEX < 0x03000000)
+#if 0 // TODO - py3
STR_String pname = progname;
Py_SetProgramName(pname.Ptr());
#endif
@@ -1623,9 +1529,8 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
Py_Initialize();
if(argv && first_time) { /* browser plugins dont currently set this */
-#if (PY_VERSION_HEX < 0x03000000)
- PySys_SetArgv(argc, argv);
-#else
+ // Until python support ascii again, we use our own.
+ // PySys_SetArgv(argc, argv);
int i;
PyObject *py_argv= PyList_New(argc);
@@ -1634,9 +1539,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
PySys_SetObject("argv", py_argv);
Py_DECREF(py_argv);
-#endif
}
- //importBlenderModules()
setSandbox(level);
initPyTypes();
@@ -1670,7 +1573,7 @@ void exitGamePlayerPythonScripting()
*/
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie)
{
-#if (PY_VERSION_HEX < 0x03000000)
+#if 0 // XXX TODO Py3
STR_String pname = progname;
Py_SetProgramName(pname.Ptr());
#endif
@@ -1698,7 +1601,6 @@ void exitGamePythonScripting()
}
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef Rasterizer_module_def = {
{}, /* m_base */
"Rasterizer", /* m_name */
@@ -1710,7 +1612,6 @@ static struct PyModuleDef Rasterizer_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
{
@@ -1733,14 +1634,8 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
PyErr_Clear();
// Create the module and add the functions
-#if (PY_VERSION_HEX >= 0x03000000)
m = PyModule_Create(&Rasterizer_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), Rasterizer_module_def.m_name, m);
-#else
- m = Py_InitModule4("Rasterizer", rasterizer_methods,
- Rasterizer_module_documentation,
- (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
}
// Add some symbolic constants to the module
@@ -1791,12 +1686,7 @@ static PyObject* gPyEventToString(PyObject*, PyObject* value)
dict = PyModule_GetDict(mod);
while (PyDict_Next(dict, &pos, &key, &val)) {
-#if (PY_VERSION_HEX >= 0x03000000)
if (PyObject_RichCompareBool(value, val, Py_EQ)) {
-#else
- if (PyObject_Compare(value, val)==0) {
-#endif
-
ret = key;
break;
}
@@ -1832,13 +1722,11 @@ static PyObject* gPyEventToCharacter(PyObject*, PyObject* args)
static struct PyMethodDef gamekeys_methods[] = {
- {"EventToCharacter", (PyCFunction)gPyEventToCharacter, METH_VARARGS, (PY_METHODCHAR)gPyEventToCharacter_doc},
- {"EventToString", (PyCFunction)gPyEventToString, METH_O, (PY_METHODCHAR)gPyEventToString_doc},
+ {"EventToCharacter", (PyCFunction)gPyEventToCharacter, METH_VARARGS, (const char *)gPyEventToCharacter_doc},
+ {"EventToString", (PyCFunction)gPyEventToString, METH_O, (const char *)gPyEventToString_doc},
{ NULL, (PyCFunction) NULL, 0, NULL }
};
-
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef GameKeys_module_def = {
{}, /* m_base */
"GameKeys", /* m_name */
@@ -1850,7 +1738,6 @@ static struct PyModuleDef GameKeys_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
PyObject* initGameKeys()
{
@@ -1868,14 +1755,8 @@ PyObject* initGameKeys()
PyErr_Clear();
// Create the module and add the functions
-#if (PY_VERSION_HEX >= 0x03000000)
m = PyModule_Create(&GameKeys_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), GameKeys_module_def.m_name, m);
-#else
- m = Py_InitModule4("GameKeys", gamekeys_methods,
- GameKeys_module_documentation,
- (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
}
// Add some symbolic constants to the module
@@ -2007,17 +1888,17 @@ PyObject* initGameKeys()
PyObject* initMathutils()
{
- return Mathutils_Init("Mathutils"); // Use as a top level module in BGE
+ return Mathutils_Init();
}
PyObject* initGeometry()
{
- return Geometry_Init("Geometry"); // Use as a top level module in BGE
+ return Geometry_Init();
}
PyObject* initBGL()
{
- return BGL_Init("BGL"); // Use as a top level module in BGE
+ return BGL_Init();
}
void KX_SetActiveScene(class KX_Scene* scene)
@@ -2053,13 +1934,8 @@ int saveGamePythonConfig( char **marshal_buffer)
// PyObject_Print(pyGlobalDictMarshal, stderr, 0);
char *marshal_cstring;
-#if PY_VERSION_HEX < 0x03000000
- marshal_cstring = _PyUnicode_AsString(pyGlobalDictMarshal);
- marshal_length= PyString_Size(pyGlobalDictMarshal);
-#else // py3 uses byte arrays
- marshal_cstring = PyBytes_AsString(pyGlobalDictMarshal);
+ marshal_cstring = PyBytes_AsString(pyGlobalDictMarshal); // py3 uses byte arrays
marshal_length= PyBytes_Size(pyGlobalDictMarshal);
-#endif
*marshal_buffer = new char[marshal_length + 1];
memcpy(*marshal_buffer, marshal_cstring, marshal_length);
Py_DECREF(pyGlobalDictMarshal);
diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
index 8ff0bfd5379..61e563791c3 100644
--- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
@@ -36,7 +36,6 @@
#include "BL_BlenderShader.h"
#include "BL_ShapeActionActuator.h"
#include "KX_BlenderMaterial.h"
-#include "KX_CDActuator.h"
#include "KX_CameraActuator.h"
#include "KX_ConstraintActuator.h"
#include "KX_ConstraintWrapper.h"
@@ -124,9 +123,6 @@ static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *a
memset(attr_getset, 0, sizeof(PyGetSetDef));
}
} else {
-
- PyObject *item;
-
PyType_Ready(tp);
PyDict_SetItemString(dict, tp->tp_name, reinterpret_cast<PyObject *>(tp));
}
@@ -158,7 +154,6 @@ void initPyTypes(void)
PyType_Ready_Attr(dict, CListValue, init_getset);
PyType_Ready_Attr(dict, CValue, init_getset);
PyType_Ready_Attr(dict, KX_BlenderMaterial, init_getset);
- PyType_Ready_Attr(dict, KX_CDActuator, init_getset);
PyType_Ready_Attr(dict, KX_Camera, init_getset);
PyType_Ready_Attr(dict, KX_CameraActuator, init_getset);
PyType_Ready_Attr(dict, KX_ConstraintActuator, init_getset);
diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp
index 5b4d77156db..75a7c9b8aeb 100644
--- a/source/gameengine/Ketsji/KX_PythonSeq.cpp
+++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp
@@ -340,11 +340,42 @@ static PyObject *KX_PythonSeq_nextIter(KX_PythonSeq *self)
}
-static int KX_PythonSeq_compare( KX_PythonSeq * a, KX_PythonSeq * b ) /* TODO - python3.x wants richcmp */
+static int KX_PythonSeq_compare( KX_PythonSeq * a, KX_PythonSeq * b )
{
return ( a->type == b->type && a->base == b->base) ? 0 : -1;
}
+static PyObject *KX_PythonSeq_richcmp(PyObject *a, PyObject *b, int op)
+{
+ PyObject *res;
+ int ok= -1; /* zero is true */
+
+ if(BPy_KX_PythonSeq_Check(a) && BPy_KX_PythonSeq_Check(b))
+ ok= KX_PythonSeq_compare((KX_PythonSeq *)a, (KX_PythonSeq *)b);
+
+ switch (op) {
+ case Py_NE:
+ ok = !ok; /* pass through */
+ case Py_EQ:
+ res = ok ? Py_False : Py_True;
+ break;
+
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ res = Py_NotImplemented;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
+ }
+
+ Py_INCREF(res);
+ return res;
+}
+
+
/*
* repr function
* convert to a list and get its string value
@@ -362,13 +393,7 @@ static PyObject *KX_PythonSeq_repr( KX_PythonSeq * self )
/* Python KX_PythonSeq_Type structure definition: */
/*****************************************************************************/
PyTypeObject KX_PythonSeq_Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
/* For printing, in format "<module>.<name>" */
"KX_PythonSeq", /* char *tp_name; */
sizeof( KX_PythonSeq ), /* int tp_basicsize; */
@@ -380,11 +405,7 @@ PyTypeObject KX_PythonSeq_Type = {
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
-#if PY_VERSION_HEX >= 0x03000000 // TODO - richcmp
- NULL,
-#else
- ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */
-#endif
+ NULL, /* cmpfunc tp_compare; */
( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
@@ -410,14 +431,14 @@ PyTypeObject KX_PythonSeq_Type = {
NULL, /* char *tp_doc; Documentation string */
/*** Assigned meaning in release 2.0 ***/
/* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
+ NULL, /* traverseproc tp_traverse; */
/* delete references to contained objects */
NULL, /* inquiry tp_clear; */
/*** Assigned meaning in release 2.1 ***/
/*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
+ (richcmpfunc)KX_PythonSeq_richcmp, /* richcmpfunc tp_richcompare; */
/*** weak reference enabler ***/
0, /* long tp_weaklistoffset; */
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp
index e39d3756b71..eb127be8044 100644
--- a/source/gameengine/Ketsji/KX_RadarSensor.cpp
+++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp
@@ -48,8 +48,7 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr,
double margin,
double resetmargin,
bool bFindMaterial,
- const STR_String& touchedpropname,
- class KX_Scene* kxscene)
+ const STR_String& touchedpropname)
: KX_NearSensor(
eventmgr,
@@ -59,7 +58,6 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr,
resetmargin,
bFindMaterial,
touchedpropname,
- kxscene,
physCtrl),
m_coneradius(coneradius),
@@ -178,63 +176,13 @@ void KX_RadarSensor::SynchronizeTransform()
/* Python Functions */
/* ------------------------------------------------------------------------- */
-//Deprecated ----->
-/* getConeOrigin */
-const char KX_RadarSensor::GetConeOrigin_doc[] =
-"getConeOrigin()\n"
-"\tReturns the origin of the cone with which to test. The origin\n"
-"\tis in the middle of the cone.";
-PyObject* KX_RadarSensor::PyGetConeOrigin() {
- ShowDeprecationWarning("getConeOrigin()", "the coneOrigin property");
-
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_origin[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_origin[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_origin[2]));
-
- return retVal;
-}
-
-/* getConeOrigin */
-const char KX_RadarSensor::GetConeTarget_doc[] =
-"getConeTarget()\n"
-"\tReturns the center of the bottom face of the cone with which to test.\n";
-PyObject* KX_RadarSensor::PyGetConeTarget() {
- ShowDeprecationWarning("getConeTarget()", "the coneTarget property");
-
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_target[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_target[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_target[2]));
-
- return retVal;
-}
-
-/* getConeHeight */
-const char KX_RadarSensor::GetConeHeight_doc[] =
-"getConeHeight()\n"
-"\tReturns the height of the cone with which to test.\n";
-PyObject* KX_RadarSensor::PyGetConeHeight() {
-
- ShowDeprecationWarning("getConeHeight()", "the distance property");
-
- return PyFloat_FromDouble(m_coneheight);
-}
-//<----- Deprecated
+/* none */
/* ------------------------------------------------------------------------- */
/* Python Integration Hooks */
/* ------------------------------------------------------------------------- */
PyTypeObject KX_RadarSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_RadarSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -256,14 +204,6 @@ PyTypeObject KX_RadarSensor::Type = {
};
PyMethodDef KX_RadarSensor::Methods[] = {
- //Deprecated ----->
- {"getConeOrigin", (PyCFunction) KX_RadarSensor::sPyGetConeOrigin,
- METH_VARARGS, (PY_METHODCHAR)GetConeOrigin_doc},
- {"getConeTarget", (PyCFunction) KX_RadarSensor::sPyGetConeTarget,
- METH_VARARGS, (PY_METHODCHAR)GetConeTarget_doc},
- {"getConeHeight", (PyCFunction) KX_RadarSensor::sPyGetConeHeight,
- METH_VARARGS, (PY_METHODCHAR)GetConeHeight_doc},
- //<-----
{NULL} //Sentinel
};
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h
index 344be0e399f..487e9f1aaa7 100644
--- a/source/gameengine/Ketsji/KX_RadarSensor.h
+++ b/source/gameengine/Ketsji/KX_RadarSensor.h
@@ -69,8 +69,7 @@ public:
double margin,
double resetmargin,
bool bFindMaterial,
- const STR_String& touchedpropname,
- class KX_Scene* kxscene);
+ const STR_String& touchedpropname);
KX_RadarSensor();
virtual ~KX_RadarSensor();
virtual void SynchronizeTransform();
@@ -91,11 +90,6 @@ public:
/* python */
virtual sensortype GetSensorType() { return ST_RADAR; }
- //Deprecated ----->
- KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeOrigin);
- KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeTarget);
- KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeHeight);
- //<-----
};
#endif //__KX_RADAR_SENSOR_H
diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h
index c3084c997a1..cdafc894f6c 100644
--- a/source/gameengine/Ketsji/KX_RayCast.h
+++ b/source/gameengine/Ketsji/KX_RayCast.h
@@ -89,6 +89,12 @@ public:
const MT_Point3& topoint,
KX_RayCast& callback);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
template<class T> class KX_RayCast::Callback : public KX_RayCast
@@ -121,7 +127,13 @@ public:
}
return self->NeedRayCast(info);
}
-
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h
index b816d4d5250..27c9be14d1f 100644
--- a/source/gameengine/Ketsji/KX_RayEventManager.h
+++ b/source/gameengine/Ketsji/KX_RayEventManager.h
@@ -45,6 +45,13 @@ public:
m_logicmgr(logicmgr)
{}
virtual void NextFrame();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_RAYEVENTMGR
diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp
index 3f27496df71..1f36945ccaa 100644
--- a/source/gameengine/Ketsji/KX_RaySensor.cpp
+++ b/source/gameengine/Ketsji/KX_RaySensor.cpp
@@ -319,13 +319,7 @@ bool KX_RaySensor::Evaluate()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_RaySensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_RaySensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -348,12 +342,6 @@ PyTypeObject KX_RaySensor::Type = {
};
PyMethodDef KX_RaySensor::Methods[] = {
- // Deprecated ----->
- {"getHitObject",(PyCFunction) KX_RaySensor::sPyGetHitObject,METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
- {"getHitPosition",(PyCFunction) KX_RaySensor::sPyGetHitPosition,METH_NOARGS, (PY_METHODCHAR)GetHitPosition_doc},
- {"getHitNormal",(PyCFunction) KX_RaySensor::sPyGetHitNormal,METH_NOARGS, (PY_METHODCHAR)GetHitNormal_doc},
- {"getRayDirection",(PyCFunction) KX_RaySensor::sPyGetRayDirection,METH_NOARGS, (PY_METHODCHAR)GetRayDirection_doc},
- // <-----
{NULL,NULL} //Sentinel
};
@@ -378,68 +366,3 @@ PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_
Py_RETURN_NONE;
}
-
-// Deprecated ----->
-const char KX_RaySensor::GetHitObject_doc[] =
-"getHitObject()\n"
-"\tReturns the name of the object that was hit by this ray.\n";
-PyObject* KX_RaySensor::PyGetHitObject()
-{
- ShowDeprecationWarning("getHitObject()", "the hitObject property");
- if (m_hitObject)
- {
- return m_hitObject->GetProxy();
- }
- Py_RETURN_NONE;
-}
-
-
-const char KX_RaySensor::GetHitPosition_doc[] =
-"getHitPosition()\n"
-"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n";
-PyObject* KX_RaySensor::PyGetHitPosition()
-{
- ShowDeprecationWarning("getHitPosition()", "the hitPosition property");
-
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitPosition[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitPosition[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitPosition[2]));
-
- return retVal;
-}
-
-const char KX_RaySensor::GetRayDirection_doc[] =
-"getRayDirection()\n"
-"\tReturns the direction from the ray (in worldcoordinates) .\n";
-PyObject* KX_RaySensor::PyGetRayDirection()
-{
- ShowDeprecationWarning("getRayDirection()", "the rayDirection property");
-
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_rayDirection[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_rayDirection[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_rayDirection[2]));
-
- return retVal;
-}
-
-const char KX_RaySensor::GetHitNormal_doc[] =
-"getHitNormal()\n"
-"\tReturns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.\n";
-PyObject* KX_RaySensor::PyGetHitNormal()
-{
- ShowDeprecationWarning("getHitNormal()", "the hitNormal property");
-
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitNormal[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitNormal[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitNormal[2]));
-
- return retVal;
-}
-
-// <----- Deprecated
diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h
index 530c8ce54e5..d3e92a14214 100644
--- a/source/gameengine/Ketsji/KX_RaySensor.h
+++ b/source/gameengine/Ketsji/KX_RaySensor.h
@@ -84,12 +84,6 @@ public:
KX_RAY_AXIS_NEG_Z
};
- // Deprecated ----->
- KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitObject);
- KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitPosition);
- KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitNormal);
- KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetRayDirection);
- // <-----
/* Attributes */
static PyObject* pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
index 239c4a0be67..099403fc28d 100644
--- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
@@ -170,13 +170,7 @@ void KX_SCA_AddObjectActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_SCA_AddObjectActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_SCA_AddObjectActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -198,18 +192,7 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = {
};
PyMethodDef KX_SCA_AddObjectActuator::Methods[] = {
- // ---> deprecated
- {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (PY_METHODCHAR)SetTime_doc},
- {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_NOARGS, (PY_METHODCHAR)GetTime_doc},
- {"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_NOARGS, (PY_METHODCHAR)GetLinearVelocity_doc},
- {"setLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetLinearVelocity, METH_VARARGS, (PY_METHODCHAR)SetLinearVelocity_doc},
- {"getAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetAngularVelocity, METH_NOARGS, (PY_METHODCHAR)GetAngularVelocity_doc},
- {"setAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetAngularVelocity, METH_VARARGS, (PY_METHODCHAR)SetAngularVelocity_doc},
- {"getLastCreatedObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLastCreatedObject, METH_NOARGS,"getLastCreatedObject() : get the object handle to the last created object\n"},
{"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS,"instantAddObject() : immediately add object without delay\n"},
- {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
- {"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
-
{NULL,NULL} //Sentinel
};
@@ -259,181 +242,6 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con
return actuator->m_lastCreatedObject->GetProxy();
}
-/* 1. setObject */
-const char KX_SCA_AddObjectActuator::SetObject_doc[] =
-"setObject(object)\n"
-"\t- object: KX_GameObject, string or None\n"
-"\tSets the object that will be added. There has to be an object\n"
-"\tof this name. If not, this function does nothing.\n";
-PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* value)
-{
- KX_GameObject *gameobj;
-
- ShowDeprecationWarning("setObject()", "the object property");
-
- if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_SCA_AddObjectActuator"))
- return NULL; // ConvertPythonToGameObject sets the error
-
- if (m_OriginalObject != NULL)
- m_OriginalObject->UnregisterActuator(this);
-
- m_OriginalObject = (SCA_IObject*)gameobj;
- if (m_OriginalObject)
- m_OriginalObject->RegisterActuator(this);
-
- Py_RETURN_NONE;
-}
-
-
-
-/* 2. setTime */
-const char KX_SCA_AddObjectActuator::SetTime_doc[] =
-"setTime(duration)\n"
-"\t- duration: integer\n"
-"\tSets the lifetime of the object that will be added, in frames. \n"
-"\tIf the duration is negative, it is set to 0.\n";
-
-
-PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* value)
-{
- ShowDeprecationWarning("setTime()", "the time property");
- int deltatime = PyLong_AsSsize_t(value);
- if (deltatime==-1 && PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError, "expected an int");
- return NULL;
- }
-
- m_timeProp = deltatime;
- if (m_timeProp < 0) m_timeProp = 0;
-
- Py_RETURN_NONE;
-}
-
-
-
-/* 3. getTime */
-const char KX_SCA_AddObjectActuator::GetTime_doc[] =
-"getTime()\n"
-"\tReturns the lifetime of the object that will be added.\n";
-
-
-PyObject* KX_SCA_AddObjectActuator::PyGetTime()
-{
- ShowDeprecationWarning("getTime()", "the time property");
- return PyLong_FromSsize_t(m_timeProp);
-}
-
-
-/* 4. getObject */
-const char KX_SCA_AddObjectActuator::GetObject_doc[] =
-"getObject(name_only = 1)\n"
-"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
-"\tReturns the name of the object that will be added.\n";
-PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args)
-{
- int ret_name_only = 1;
-
- ShowDeprecationWarning("getObject()", "the object property");
-
- if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
- return NULL;
-
- if (!m_OriginalObject)
- Py_RETURN_NONE;
-
- if (ret_name_only)
- return PyUnicode_FromString(m_OriginalObject->GetName().ReadPtr());
- else
- return m_OriginalObject->GetProxy();
-}
-
-
-
-/* 5. getLinearVelocity */
-const char KX_SCA_AddObjectActuator::GetLinearVelocity_doc[] =
-"GetLinearVelocity()\n"
-"\tReturns the linear velocity that will be assigned to \n"
-"\tthe created object.\n";
-
-PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity()
-{
- ShowDeprecationWarning("getLinearVelocity()", "the linearVelocity property");
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2]));
-
- return retVal;
-}
-
-
-
-/* 6. setLinearVelocity */
-const char KX_SCA_AddObjectActuator::SetLinearVelocity_doc[] =
-"setLinearVelocity(vx, vy, vz)\n"
-"\t- vx: float\n"
-"\t- vy: float\n"
-"\t- vz: float\n"
-"\t- local: bool\n"
-"\tAssign this velocity to the created object. \n";
-
-PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* args)
-{
- ShowDeprecationWarning("setLinearVelocity()", "the linearVelocity property");
-
- float vecArg[3];
- if (!PyArg_ParseTuple(args, "fff:setLinearVelocity", &vecArg[0], &vecArg[1], &vecArg[2]))
- return NULL;
-
- m_linear_velocity[0] = vecArg[0];
- m_linear_velocity[1] = vecArg[1];
- m_linear_velocity[2] = vecArg[2];
- Py_RETURN_NONE;
-}
-
-/* 7. getAngularVelocity */
-const char KX_SCA_AddObjectActuator::GetAngularVelocity_doc[] =
-"GetAngularVelocity()\n"
-"\tReturns the angular velocity that will be assigned to \n"
-"\tthe created object.\n";
-
-PyObject* KX_SCA_AddObjectActuator::PyGetAngularVelocity()
-{
- ShowDeprecationWarning("getAngularVelocity()", "the angularVelocity property");
- PyObject *retVal = PyList_New(3);
-
- PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0]));
- PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1]));
- PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2]));
-
- return retVal;
-}
-
-
-
-/* 8. setAngularVelocity */
-const char KX_SCA_AddObjectActuator::SetAngularVelocity_doc[] =
-"setAngularVelocity(vx, vy, vz)\n"
-"\t- vx: float\n"
-"\t- vy: float\n"
-"\t- vz: float\n"
-"\t- local: bool\n"
-"\tAssign this angular velocity to the created object. \n";
-
-PyObject* KX_SCA_AddObjectActuator::PySetAngularVelocity(PyObject* args)
-{
- ShowDeprecationWarning("setAngularVelocity()", "the angularVelocity property");
-
- float vecArg[3];
- if (!PyArg_ParseTuple(args, "fff:setAngularVelocity", &vecArg[0], &vecArg[1], &vecArg[2]))
- return NULL;
-
- m_angular_velocity[0] = vecArg[0];
- m_angular_velocity[1] = vecArg[1];
- m_angular_velocity[2] = vecArg[2];
- Py_RETURN_NONE;
-}
void KX_SCA_AddObjectActuator::InstantAddObject()
{
@@ -476,26 +284,3 @@ PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject()
Py_RETURN_NONE;
}
-
-
-
-/* 7. GetLastCreatedObject */
-const char KX_SCA_AddObjectActuator::GetLastCreatedObject_doc[] =
-"getLastCreatedObject()\n"
-"\tReturn the last created object. \n";
-
-
-PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject()
-{
- ShowDeprecationWarning("getLastCreatedObject()", "the objectLastCreated property");
- SCA_IObject* result = this->GetLastCreatedObject();
-
- // if result->GetSGNode() is NULL
- // it means the object has ended, The BGE python api crashes in many places if the object is returned.
- if (result && (static_cast<KX_GameObject *>(result))->GetSGNode())
- {
- return result->GetProxy();
- }
- // don't return NULL to python anymore, it gives trouble in the scripts
- Py_RETURN_NONE;
-}
diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
index 3151e7a89ca..7137ba5209e 100644
--- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
@@ -115,25 +115,6 @@ public:
void InstantAddObject();
- /* 1. setObject */
- KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetObject);
- /* 2. setTime */
- KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetTime);
- /* 3. getTime */
- KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetTime);
- /* 4. getObject */
- KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,GetObject);
- /* 5. getLinearVelocity */
- KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLinearVelocity);
- /* 6. setLinearVelocity */
- KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetLinearVelocity);
- /* 7. getAngularVelocity */
- KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetAngularVelocity);
- /* 8. setAngularVelocity */
- KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetAngularVelocity);
- /* 9. getLastCreatedObject */
- KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLastCreatedObject);
- /* 10. instantAddObject*/
KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject);
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
index 423fd0db7f2..646cfb7219f 100644
--- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
@@ -48,13 +48,7 @@
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_SCA_DynamicActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_SCA_DynamicActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -76,9 +70,6 @@ PyTypeObject KX_SCA_DynamicActuator::Type = {
};
PyMethodDef KX_SCA_DynamicActuator::Methods[] = {
- // ---> deprecated
- KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation),
- KX_PYMETHODTABLE(KX_SCA_DynamicActuator, getOperation),
{NULL,NULL} //Sentinel
};
@@ -88,42 +79,6 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = {
{ NULL } //Sentinel
};
-
-/* 1. setOperation */
-KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation,
-"setOperation(operation?)\n"
-"\t - operation? : type of dynamic operation\n"
-"\t 0 = restore dynamics\n"
-"\t 1 = disable dynamics\n"
-"\t 2 = enable rigid body\n"
-"\t 3 = disable rigid body\n"
-"Change the dynamic status of the parent object.\n")
-{
- ShowDeprecationWarning("setOperation()", "the mode property");
- int dyn_operation;
-
- if (!PyArg_ParseTuple(args, "i:setOperation", &dyn_operation))
- {
- return NULL;
- }
- if (dyn_operation <0 || dyn_operation>3) {
- PyErr_SetString(PyExc_IndexError, "Dynamic Actuator's setOperation() range must be between 0 and 3");
- return NULL;
- }
- m_dyn_operation= dyn_operation;
- Py_RETURN_NONE;
-}
-
-KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation,
-"getOperation() -> integer\n"
-"Returns the operation type of this actuator.\n"
-)
-{
- ShowDeprecationWarning("getOperation()", "the mode property");
- return PyLong_FromSsize_t((long)m_dyn_operation);
-}
-
-
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
index 8b598c9ecfa..58b28654eca 100644
--- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
@@ -71,11 +71,6 @@ class KX_SCA_DynamicActuator : public SCA_IActuator
KX_DYN_DISABLE_RIGID_BODY,
KX_DYN_SET_MASS,
};
-
- /* 1. setOperation */
- KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,setOperation);
- KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,getOperation);
-
};
#endif
diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
index 47c5c3aeeeb..dd9d8015724 100644
--- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
@@ -91,13 +91,7 @@ CValue* KX_SCA_EndObjectActuator::GetReplica()
/* ------------------------------------------------------------------------- */
PyTypeObject KX_SCA_EndObjectActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_SCA_EndObjectActuator",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
index 2884bb76565..e85b8a32798 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
@@ -51,13 +51,7 @@
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_SCA_ReplaceMeshActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_SCA_ReplaceMeshActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -80,14 +74,13 @@ PyTypeObject KX_SCA_ReplaceMeshActuator::Type = {
PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = {
KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh),
- // Deprecated ----->
- {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_O, (PY_METHODCHAR)SetMesh_doc},
- KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh),
{NULL,NULL} //Sentinel
};
PyAttributeDef KX_SCA_ReplaceMeshActuator::Attributes[] = {
KX_PYATTRIBUTE_RW_FUNCTION("mesh", KX_SCA_ReplaceMeshActuator, pyattr_get_mesh, pyattr_set_mesh),
+ KX_PYATTRIBUTE_BOOL_RW ("useDisplayMesh", KX_SCA_ReplaceMeshActuator, m_use_gfx),
+ KX_PYATTRIBUTE_BOOL_RW ("usePhysicsMesh", KX_SCA_ReplaceMeshActuator, m_use_phys),
{ NULL } //Sentinel
};
@@ -112,37 +105,6 @@ int KX_SCA_ReplaceMeshActuator::pyattr_set_mesh(void *self, const struct KX_PYAT
return PY_SET_ATTR_SUCCESS;
}
-/* 1. setMesh */
-const char KX_SCA_ReplaceMeshActuator::SetMesh_doc[] =
- "setMesh(name)\n"
- "\t- name: string or None\n"
- "\tSet the mesh that will be substituted for the current one.\n";
-
-PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* value)
-{
- ShowDeprecationWarning("setMesh()", "the mesh property");
- RAS_MeshObject* new_mesh;
-
- if (!ConvertPythonToMesh(value, &new_mesh, true, "actuator.mesh = value: KX_SCA_ReplaceMeshActuator"))
- return NULL;
-
- m_mesh = new_mesh;
- Py_RETURN_NONE;
-}
-
-KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh,
-"getMesh() -> string\n"
-"Returns the name of the mesh to be substituted.\n"
-)
-{
- ShowDeprecationWarning("getMesh()", "the mesh property");
- if (!m_mesh)
- Py_RETURN_NONE;
-
- return PyUnicode_FromString(const_cast<char *>(m_mesh->GetName().ReadPtr()));
-}
-
-
KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh,
"instantReplaceMesh() : immediately replace mesh without delay\n")
{
@@ -156,11 +118,15 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh,
KX_SCA_ReplaceMeshActuator::KX_SCA_ReplaceMeshActuator(SCA_IObject *gameobj,
class RAS_MeshObject *mesh,
- SCA_IScene* scene) :
+ SCA_IScene* scene,
+ bool use_gfx,
+ bool use_phys) :
SCA_IActuator(gameobj),
m_mesh(mesh),
- m_scene(scene)
+ m_scene(scene),
+ m_use_gfx(use_gfx),
+ m_use_phys(use_phys)
{
} /* End of constructor */
@@ -182,7 +148,8 @@ bool KX_SCA_ReplaceMeshActuator::Update()
if (bNegativeEvent)
return false; // do nothing on negative events
- if (m_mesh) m_scene->ReplaceMesh(GetParent(),m_mesh);
+ if (m_mesh || m_use_phys) /* NULL mesh is ok if were updating physics */
+ m_scene->ReplaceMesh(GetParent(),m_mesh, m_use_gfx, m_use_phys);
return false;
}
@@ -204,7 +171,7 @@ CValue* KX_SCA_ReplaceMeshActuator::GetReplica()
void KX_SCA_ReplaceMeshActuator::InstantReplaceMesh()
{
- if (m_mesh) m_scene->ReplaceMesh(GetParent(),m_mesh);
+ if (m_mesh) m_scene->ReplaceMesh(GetParent(),m_mesh, m_use_gfx, m_use_phys);
}
/* eof */
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
index 6a68bd88cc5..e5482c29aa7 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
@@ -50,12 +50,17 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
// mesh reference (mesh to replace)
RAS_MeshObject* m_mesh;
SCA_IScene* m_scene;
+ bool m_use_gfx;
+ bool m_use_phys;
public:
KX_SCA_ReplaceMeshActuator(
SCA_IObject* gameobj,
RAS_MeshObject *mesh,
- SCA_IScene* scene);
+ SCA_IScene* scene,
+ bool use_gfx,
+ bool use_phys
+ );
~KX_SCA_ReplaceMeshActuator(
);
@@ -69,13 +74,13 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
void InstantReplaceMesh();
- /* python api */
+ /* --------------------------------------------------------------------- */
+ /* Python interface ---------------------------------------------------- */
+ /* --------------------------------------------------------------------- */
+
static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- /* 1. setMesh */
- KX_PYMETHOD_DOC_O(KX_SCA_ReplaceMeshActuator,SetMesh);
- KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,getMesh);
KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh);
};
diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
index c9baf228855..dd4419543a2 100644
--- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
+++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
@@ -59,7 +59,6 @@ class KX_BoneParentRelation : public SG_ParentRelation
{
public :
-
/**
* Allocate and construct a new KX_SG_BoneParentRelation
* on the heap.
@@ -101,6 +100,12 @@ private :
KX_BoneParentRelation(Bone* bone
);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h
index d8fb9211f21..c1640f3e0a0 100644
--- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h
+++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h
@@ -53,7 +53,6 @@ class KX_NormalParentRelation : public SG_ParentRelation
{
public :
-
/**
* Allocate and construct a new KX_NormalParentRelation
* on the heap.
@@ -91,6 +90,12 @@ private :
KX_NormalParentRelation(
);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
@@ -142,6 +147,12 @@ private :
KX_VertexParentRelation(
);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
@@ -219,6 +230,12 @@ private :
bool m_initialized;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_ScalarInterpolator.h b/source/gameengine/Ketsji/KX_ScalarInterpolator.h
index 8835c98c184..ca011ab5db0 100644
--- a/source/gameengine/Ketsji/KX_ScalarInterpolator.h
+++ b/source/gameengine/Ketsji/KX_ScalarInterpolator.h
@@ -55,6 +55,13 @@ public:
private:
MT_Scalar* m_target;
KX_IScalarInterpolator *m_ipo;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_ScalingInterpolator.h b/source/gameengine/Ketsji/KX_ScalingInterpolator.h
index a7b5d7e559a..460563d4135 100644
--- a/source/gameengine/Ketsji/KX_ScalingInterpolator.h
+++ b/source/gameengine/Ketsji/KX_ScalingInterpolator.h
@@ -50,6 +50,13 @@ public:
private:
MT_Vector3& m_target;
KX_IScalarInterpolator *m_ipos[3];
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 51f5276e075..3483496c3a6 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -34,7 +34,6 @@
#include "KX_Scene.h"
#include "MT_assert.h"
-#include "SND_Scene.h"
#include "KX_KetsjiEngine.h"
#include "KX_BlenderMaterial.h"
#include "RAS_IPolygonMaterial.h"
@@ -135,7 +134,6 @@ extern bool gUseVisibilityTemp;
KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
class SCA_IInputDevice* mousedevice,
class NG_NetworkDeviceInterface *ndi,
- class SND_IAudioDevice* adi,
const STR_String& sceneName,
Scene *scene):
PyObjectPlus(),
@@ -144,7 +142,6 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
m_sceneConverter(NULL),
m_physicsEnvironment(0),
m_sceneName(sceneName),
- m_adi(adi),
m_networkDeviceInterface(ndi),
m_active_camera(NULL),
m_ueberExecutionPriority(0),
@@ -200,7 +197,6 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
m_logicmgr->RegisterEventManager(joymgr);
}
- m_soundScene = new SND_Scene(adi);
MT_assert (m_networkDeviceInterface != NULL);
m_networkScene = new NG_NetworkScene(m_networkDeviceInterface);
@@ -250,9 +246,6 @@ KX_Scene::~KX_Scene()
if (m_physicsEnvironment)
delete m_physicsEnvironment;
- if (m_soundScene)
- delete m_soundScene;
-
if (m_networkScene)
delete m_networkScene;
@@ -364,12 +357,6 @@ class KX_WorldInfo* KX_Scene::GetWorldInfo()
}
-
-SND_Scene* KX_Scene::GetSoundScene()
-{
- return m_soundScene;
-}
-
const STR_String& KX_Scene::GetName()
{
return m_sceneName;
@@ -1008,8 +995,12 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
// in case this is a camera
m_cameras.remove((KX_Camera*)newobj);
+ /* currently does nothing, keep incase we need to Unregister something */
+#if 0
if (m_sceneConverter)
m_sceneConverter->UnregisterGameObject(newobj);
+#endif
+
// return value will be 0 if the object is actually deleted (all reference gone)
return ret;
@@ -1017,17 +1008,18 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
-void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj)
+void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool use_phys)
{
KX_GameObject* gameobj = static_cast<KX_GameObject*>(obj);
RAS_MeshObject* mesh = static_cast<RAS_MeshObject*>(meshobj);
- if(!gameobj || !mesh)
- {
- std::cout << "warning: invalid object, mesh will not be replaced" << std::endl;
+ if(!gameobj) {
+ std::cout << "KX_Scene::ReplaceMesh Warning: invalid object, doing nothing" << std::endl;
return;
}
+ if(use_gfx && mesh != NULL)
+ {
gameobj->RemoveMeshes();
gameobj->AddMesh(mesh);
@@ -1156,6 +1148,11 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj)
}
gameobj->AddMeshUser();
+ }
+
+ if(use_phys) { /* update the new assigned mesh with the physics mesh */
+ KX_ReInstanceBulletShapeFromMesh(gameobj, NULL, use_gfx?NULL:mesh);
+ }
}
KX_Camera* KX_Scene::FindCamera(KX_Camera* cam)
@@ -1573,11 +1570,6 @@ void KX_Scene::SetGravity(const MT_Vector3& gravity)
GetPhysicsEnvironment()->setGravity(gravity[0],gravity[1],gravity[2]);
}
-void KX_Scene::SetNodeTree(SG_Tree* root)
-{
- m_objecttree = root;
-}
-
void KX_Scene::SetSceneConverter(class KX_BlenderSceneConverter* sceneConverter)
{
m_sceneConverter = sceneConverter;
@@ -1613,41 +1605,142 @@ double KX_Scene::getSuspendedDelta()
//Python
PyTypeObject KX_Scene::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_Scene",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &CValue::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_Scene",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,
+ &Sequence,
+ &Mapping,
+ 0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &CValue::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_Scene::Methods[] = {
- KX_PYMETHODTABLE_NOARGS(KX_Scene, getLightList),
- KX_PYMETHODTABLE_NOARGS(KX_Scene, getObjectList),
- KX_PYMETHODTABLE_NOARGS(KX_Scene, getName),
KX_PYMETHODTABLE(KX_Scene, addObject),
+ /* dict style access */
+ KX_PYMETHODTABLE(KX_Scene, get),
+
{NULL,NULL} //Sentinel
};
+static PyObject *Map_GetItem(PyObject *self_v, PyObject *item)
+{
+ KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v);
+ const char *attr_str= _PyUnicode_AsString(item);
+ PyObject* pyconvert;
+
+ if (self==NULL) {
+ PyErr_SetString(PyExc_SystemError, "val = scene[key]: KX_Scene, "BGE_PROXY_ERROR_MSG);
+ return NULL;
+ }
+
+ if (self->m_attr_dict && (pyconvert=PyDict_GetItem(self->m_attr_dict, item))) {
+
+ if (attr_str)
+ PyErr_Clear();
+ Py_INCREF(pyconvert);
+ return pyconvert;
+ }
+ else {
+ if(attr_str) PyErr_Format(PyExc_KeyError, "value = scene[key]: KX_Scene, key \"%s\" does not exist", attr_str);
+ else PyErr_SetString(PyExc_KeyError, "value = scene[key]: KX_Scene, key does not exist");
+ return NULL;
+ }
+
+}
+
+static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val)
+{
+ KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v);
+ const char *attr_str= _PyUnicode_AsString(key);
+ if(attr_str==NULL)
+ PyErr_Clear();
+
+ if (self==NULL) {
+ PyErr_SetString(PyExc_SystemError, "scene[key] = value: KX_Scene, "BGE_PROXY_ERROR_MSG);
+ return -1;
+ }
+
+ if (val==NULL) { /* del ob["key"] */
+ int del= 0;
+
+ if(self->m_attr_dict)
+ del |= (PyDict_DelItem(self->m_attr_dict, key)==0) ? 1:0;
+
+ if (del==0) {
+ if(attr_str) PyErr_Format(PyExc_KeyError, "scene[key] = value: KX_Scene, key \"%s\" could not be set", attr_str);
+ else PyErr_SetString(PyExc_KeyError, "del scene[key]: KX_Scene, key could not be deleted");
+ return -1;
+ }
+ else if (self->m_attr_dict) {
+ PyErr_Clear(); /* PyDict_DelItem sets an error when it fails */
+ }
+ }
+ else { /* ob["key"] = value */
+ int set = 0;
+
+ if (self->m_attr_dict==NULL) /* lazy init */
+ self->m_attr_dict= PyDict_New();
+
+
+ if(PyDict_SetItem(self->m_attr_dict, key, val)==0)
+ set= 1;
+ else
+ PyErr_SetString(PyExc_KeyError, "scene[key] = value: KX_Scene, key not be added to internal dictionary");
+
+ if(set==0)
+ return -1; /* pythons error value */
+
+ }
+
+ return 0; /* success */
+}
+
+static int Seq_Contains(PyObject *self_v, PyObject *value)
+{
+ KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v);
+
+ if (self==NULL) {
+ PyErr_SetString(PyExc_SystemError, "val in scene: KX_Scene, "BGE_PROXY_ERROR_MSG);
+ return -1;
+ }
+
+ if (self->m_attr_dict && PyDict_GetItem(self->m_attr_dict, value))
+ return 1;
+
+ return 0;
+}
+
+PyMappingMethods KX_Scene::Mapping = {
+ (lenfunc)NULL , /*inquiry mp_length */
+ (binaryfunc)Map_GetItem, /*binaryfunc mp_subscript */
+ (objobjargproc)Map_SetItem, /*objobjargproc mp_ass_subscript */
+};
+
+PySequenceMethods KX_Scene::Sequence = {
+ NULL, /* Cant set the len otherwise it can evaluate as false */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+ NULL, /* sq_item */
+ NULL, /* sq_slice */
+ NULL, /* sq_ass_item */
+ NULL, /* sq_ass_slice */
+ (objobjproc)Seq_Contains, /* sq_contains */
+};
PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
@@ -1728,33 +1821,6 @@ PyAttributeDef KX_Scene::Attributes[] = {
{ NULL } //Sentinel
};
-KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getLightList,
-"getLightList() -> list [KX_Light]\n"
-"Returns a list of all lights in the scene.\n"
-)
-{
- ShowDeprecationWarning("getLightList()", "the lights property");
- return m_lightlist->GetProxy();
-}
-
-KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getObjectList,
-"getObjectList() -> list [KX_GameObject]\n"
-"Returns a list of all game objects in the scene.\n"
-)
-{
- ShowDeprecationWarning("getObjectList()", "the objects property");
- return m_objectlist->GetProxy();
-}
-
-KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getName,
-"getName() -> string\n"
-"Returns the name of the scene.\n"
-)
-{
- ShowDeprecationWarning("getName()", "the name property");
- return PyUnicode_FromString(GetName());
-}
-
KX_PYMETHODDEF_DOC(KX_Scene, addObject,
"addObject(object, other, time=0)\n"
"Returns the added object.\n")
@@ -1779,3 +1845,22 @@ KX_PYMETHODDEF_DOC(KX_Scene, addObject,
replica->Release();
return replica->GetProxy();
}
+
+/* Matches python dict.get(key, [default]) */
+KX_PYMETHODDEF_DOC(KX_Scene, get, "")
+{
+ PyObject *key;
+ PyObject* def = Py_None;
+ PyObject* ret;
+
+ if (!PyArg_ParseTuple(args, "O|O:get", &key, &def))
+ return NULL;
+
+ if (m_attr_dict && (ret=PyDict_GetItem(m_attr_dict, key))) {
+ Py_INCREF(ret);
+ return ret;
+ }
+
+ Py_INCREF(def);
+ return def;
+}
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 2792f1f5fe4..3e0dc303d72 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -63,8 +63,6 @@ class SCA_TimeEventManager;
class SCA_MouseManager;
class SCA_ISystem;
class SCA_IInputDevice;
-class SND_Scene;
-class SND_IAudioDevice;
class NG_NetworkDeviceInterface;
class NG_NetworkScene;
class SG_IObject;
@@ -92,6 +90,7 @@ struct KX_ClientObjectInfo;
class KX_Scene : public PyObjectPlus, public SCA_IScene
{
Py_Header;
+ PyObject* m_attr_dict;
struct CullingInfo {
int m_layer;
@@ -119,10 +118,6 @@ protected:
// the Qlist is for objects that needs to be rescheduled
// for updates after udpate is over (slow parent, bone parent)
- /**
- * The tree of objects in the scene.
- */
- SG_Tree* m_objecttree;
/**
* The set of cameras for this scene
@@ -164,14 +159,7 @@ protected:
* @section Different scenes, linked to ketsji scene
*/
-
/**
- * Sound scenes
- */
- SND_Scene* m_soundScene;
- SND_IAudioDevice* m_adi;
-
- /**
* Network scene.
*/
NG_NetworkDeviceInterface* m_networkDeviceInterface;
@@ -275,19 +263,13 @@ protected:
double m_suspendedtime;
double m_suspendeddelta;
-
- /**
- * This stores anything from python
- */
- PyObject* m_attr_dict;
struct Scene* m_blenderScene;
-public:
+public:
KX_Scene(class SCA_IInputDevice* keyboarddevice,
class SCA_IInputDevice* mousedevice,
class NG_NetworkDeviceInterface* ndi,
- class SND_IAudioDevice* adi,
const STR_String& scenename,
struct Scene* scene);
@@ -323,7 +305,7 @@ public:
int NewRemoveObject(CValue* gameobj);
void ReplaceMesh(CValue* gameobj,
- void* meshobj);
+ void* meshob, bool use_gfx, bool use_phys);
/**
* @section Logic stuff
* Initiate an update of the logic system.
@@ -484,7 +466,6 @@ public:
void CalculateVisibleMeshes(RAS_IRasterizer* rasty, KX_Camera *cam, int layer=0);
void UpdateMeshTransformations();
KX_Camera* GetpCamera();
- SND_Scene* GetSoundScene();
NG_NetworkDeviceInterface* GetNetworkDeviceInterface();
NG_NetworkScene* GetNetworkScene();
@@ -536,23 +517,12 @@ public:
*/
void SetNodeTree(SG_Tree* root);
- KX_PYMETHOD_DOC_NOARGS(KX_Scene, getLightList);
- KX_PYMETHOD_DOC_NOARGS(KX_Scene, getObjectList);
- KX_PYMETHOD_DOC_NOARGS(KX_Scene, getName);
+ /* --------------------------------------------------------------------- */
+ /* Python interface ---------------------------------------------------- */
+ /* --------------------------------------------------------------------- */
+
KX_PYMETHOD_DOC(KX_Scene, addObject);
-/*
- KX_PYMETHOD_DOC(KX_Scene, getActiveCamera);
- KX_PYMETHOD_DOC(KX_Scene, getActiveCamera);
- KX_PYMETHOD_DOC(KX_Scene, findCamera);
-
- KX_PYMETHOD_DOC(KX_Scene, getGravity);
-
- KX_PYMETHOD_DOC(KX_Scene, setActivityCulling);
- KX_PYMETHOD_DOC(KX_Scene, setActivityCullingRadius);
-
- KX_PYMETHOD_DOC(KX_Scene, setSceneViewport);
- KX_PYMETHOD_DOC(KX_Scene, setSceneViewport);
- */
+ KX_PYMETHOD_DOC(KX_Scene, get);
/* attributes */
static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
@@ -564,7 +534,11 @@ public:
static int pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
virtual PyObject* py_repr(void) { return PyUnicode_FromString(GetName().ReadPtr()); }
-
+
+ /* getitem/setitem */
+ static PyMappingMethods Mapping;
+ static PySequenceMethods Sequence;
+
/**
* Sets the time the scene was suspended
*/
diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp
index 5528e58ef77..ea1be7bca6c 100644
--- a/source/gameengine/Ketsji/KX_SceneActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp
@@ -222,43 +222,29 @@ KX_Scene* KX_SceneActuator::FindScene(char * sceneName)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_SceneActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_SceneActuator",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IActuator::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_SceneActuator",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IActuator::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_SceneActuator::Methods[] =
{
- //Deprecated functions ------>
- {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (PY_METHODCHAR)SetUseRestart_doc},
- {"setScene", (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (PY_METHODCHAR)SetScene_doc},
- {"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (PY_METHODCHAR)SetCamera_doc},
- {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (PY_METHODCHAR)GetUseRestart_doc},
- {"getScene", (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (PY_METHODCHAR)GetScene_doc},
- {"getCamera", (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (PY_METHODCHAR)GetCamera_doc},
- //<----- Deprecated
{NULL,NULL} //Sentinel
};
@@ -301,117 +287,4 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_
return PY_SET_ATTR_SUCCESS;
}
-
-/* 2. setUseRestart--------------------------------------------------------- */
-const char KX_SceneActuator::SetUseRestart_doc[] =
-"setUseRestart(flag)\n"
-"\t- flag: 0 or 1.\n"
-"\tSet flag to 1 to restart the scene.\n" ;
-PyObject* KX_SceneActuator::PySetUseRestart(PyObject* args)
-{
- ShowDeprecationWarning("setUseRestart()", "the useRestart property");
- int boolArg;
-
- if (!PyArg_ParseTuple(args, "i:setUseRestart", &boolArg))
- {
- return NULL;
- }
-
- m_restart = boolArg != 0;
-
- Py_RETURN_NONE;
-}
-
-
-
-/* 3. getUseRestart: */
-const char KX_SceneActuator::GetUseRestart_doc[] =
-"getUseRestart()\n"
-"\tReturn whether the scene will be restarted.\n" ;
-PyObject* KX_SceneActuator::PyGetUseRestart()
-{
- ShowDeprecationWarning("getUseRestart()", "the useRestart property");
- return PyLong_FromSsize_t(!(m_restart == 0));
-}
-
-
-
-/* 4. set scene------------------------------------------------------------- */
-const char KX_SceneActuator::SetScene_doc[] =
-"setScene(scene)\n"
-"\t- scene: string\n"
-"\tSet the name of scene the actuator will switch to.\n" ;
-PyObject* KX_SceneActuator::PySetScene(PyObject* args)
-{
- ShowDeprecationWarning("setScene()", "the scene property");
- /* one argument: a scene, ignore the rest */
- char *scene_name;
-
- if(!PyArg_ParseTuple(args, "s:setScene", &scene_name))
- {
- return NULL;
- }
-
- /* Scene switch is done by name. */
- m_nextSceneName = scene_name;
-
- Py_RETURN_NONE;
-}
-
-
-
-/* 5. getScene: */
-const char KX_SceneActuator::GetScene_doc[] =
-"getScene()\n"
-"\tReturn the name of the scene the actuator wants to switch to.\n" ;
-PyObject* KX_SceneActuator::PyGetScene()
-{
- ShowDeprecationWarning("getScene()", "the scene property");
- return PyUnicode_FromString(m_nextSceneName);
-}
-
-
-
-/* 6. set camera------------------------------------------------------------ */
-const char KX_SceneActuator::SetCamera_doc[] =
-"setCamera(camera)\n"
-"\t- camera: string\n"
-"\tSet the camera to switch to.\n" ;
-PyObject* KX_SceneActuator::PySetCamera(PyObject* value)
-{
- ShowDeprecationWarning("setCamera()", "the camera property");
- KX_Camera *camOb;
-
- if (!ConvertPythonToCamera(value, &camOb, true, "actu.setCamera(value): KX_SceneActuator"))
- return NULL;
-
- if (m_camera)
- m_camera->UnregisterActuator(this);
-
- if(camOb==NULL) {
- m_camera= NULL;
- }
- else {
- m_camera = camOb;
- m_camera->RegisterActuator(this);
- }
- Py_RETURN_NONE;
-}
-
-
-
-/* 7. getCamera: */
-const char KX_SceneActuator::GetCamera_doc[] =
-"getCamera()\n"
-"\tReturn the name of the camera to switch to.\n" ;
-PyObject* KX_SceneActuator::PyGetCamera()
-{
- ShowDeprecationWarning("getCamera()", "the camera property");
- if (m_camera) {
- return PyUnicode_FromString(m_camera->GetName());
- }
- else {
- Py_RETURN_NONE;
- }
-}
/* eof */
diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h
index 86de3395d1e..e979a8ce559 100644
--- a/source/gameengine/Ketsji/KX_SceneActuator.h
+++ b/source/gameengine/Ketsji/KX_SceneActuator.h
@@ -90,22 +90,6 @@ class KX_SceneActuator : public SCA_IActuator
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
-
- /* 1. set */
- /* Removed */
-
- /* 2. setUseRestart: */
- KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetUseRestart);
- /* 3. getUseRestart: */
- KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetUseRestart);
- /* 4. setScene: */
- KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetScene);
- /* 5. getScene: */
- KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetScene);
- /* 6. setCamera: */
- KX_PYMETHOD_DOC_O(KX_SceneActuator,SetCamera);
- /* 7. getCamera: */
- KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetCamera);
static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 39381182944..e2b4022a312 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -31,10 +31,7 @@
*/
#include "KX_SoundActuator.h"
-#include "SND_SoundObject.h"
#include "KX_GameObject.h"
-#include "SND_SoundObject.h"
-#include "SND_Scene.h" // needed for replication
#include "KX_PyMath.h" // needed for PyObjectFrom()
#include <iostream>
@@ -46,37 +43,94 @@
/* Native functions */
/* ------------------------------------------------------------------------- */
KX_SoundActuator::KX_SoundActuator(SCA_IObject* gameobj,
- SND_SoundObject* sndobj,
- SND_Scene* sndscene,
- KX_SOUNDACT_TYPE type,
- short start,
- short end)
+ AUD_Sound* sound,
+ float volume,
+ float pitch,
+ bool is3d,
+ KX_3DSoundSettings settings,
+ KX_SOUNDACT_TYPE type)//,
: SCA_IActuator(gameobj)
{
- m_soundObject = sndobj;
- m_soundScene = sndscene;
+ m_sound = sound;
+ m_volume = volume;
+ m_pitch = pitch;
+ m_is3d = is3d;
+ m_3d = settings;
+ m_handle = NULL;
m_type = type;
- m_lastEvent = true;
m_isplaying = false;
- m_startFrame = start;
- m_endFrame = end;
- m_pino = false;
-
-
}
KX_SoundActuator::~KX_SoundActuator()
{
- if (m_soundObject)
- {
- m_soundScene->RemoveActiveObject(m_soundObject);
- m_soundScene->DeleteObject(m_soundObject);
- }
+ if(m_handle)
+ AUD_stop(m_handle);
}
+void KX_SoundActuator::play()
+{
+ if(m_handle)
+ AUD_stop(m_handle);
+ if(!m_sound)
+ return;
+
+ // this is the sound that will be played and not deleted afterwards
+ AUD_Sound* sound = m_sound;
+ // this sounds are for temporary stacked sounds, will be deleted if not NULL
+ AUD_Sound* sound2 = NULL;
+ AUD_Sound* sound3 = NULL;
+
+ switch (m_type)
+ {
+ case KX_SOUNDACT_LOOPBIDIRECTIONAL:
+ case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:
+ // create a ping pong sound on sound2 stacked on the orignal sound
+ sound2 = AUD_pingpongSound(sound);
+ // create a loop sound on sound3 stacked on the pingpong sound and let that one play (save it to sound)
+ sound = sound3 = AUD_loopSound(sound2);
+ break;
+ case KX_SOUNDACT_LOOPEND:
+ case KX_SOUNDACT_LOOPSTOP:
+ // create a loop sound on sound2 stacked on the pingpong sound and let that one play (save it to sound)
+ sound = sound2 = AUD_loopSound(sound);
+ break;
+ case KX_SOUNDACT_PLAYSTOP:
+ case KX_SOUNDACT_PLAYEND:
+ default:
+ break;
+ }
+
+ if(m_is3d)
+ {
+ // sound shall be played 3D
+ m_handle = AUD_play3D(sound, 0);
+
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_MAX_GAIN, m_3d.max_gain);
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_MIN_GAIN, m_3d.min_gain);
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_REFERENCE_DISTANCE, m_3d.reference_distance);
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_MAX_DISTANCE, m_3d.max_distance);
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_ROLLOFF_FACTOR, m_3d.rolloff_factor);
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_INNER_ANGLE, m_3d.cone_inner_angle);
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_OUTER_ANGLE, m_3d.cone_outer_angle);
+ AUD_set3DSourceSetting(m_handle, AUD_3DSS_CONE_OUTER_GAIN, m_3d.cone_outer_gain);
+ }
+ else
+ m_handle = AUD_play(sound, 0);
+
+ AUD_setSoundPitch(m_handle, m_pitch);
+ AUD_setSoundVolume(m_handle, m_volume);
+ m_isplaying = true;
+
+ // now we unload the pingpong and loop sounds, as we don't need them anymore
+ // the started sound will continue playing like it was created, don't worry!
+ if(sound3)
+ AUD_unload(sound3);
+ if(sound2)
+ AUD_unload(sound2);
+}
CValue* KX_SoundActuator::GetReplica()
{
@@ -88,13 +142,8 @@ CValue* KX_SoundActuator::GetReplica()
void KX_SoundActuator::ProcessReplica()
{
SCA_IActuator::ProcessReplica();
- if (m_soundObject)
- {
- SND_SoundObject* soundobj = new SND_SoundObject(*m_soundObject);
- setSoundObject(soundobj);
- m_soundScene->AddObject(soundobj);
- }
-}
+ m_handle = 0;
+}
bool KX_SoundActuator::Update(double curtime, bool frame)
{
@@ -108,22 +157,16 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
RemoveAllEvents();
- if (!m_soundObject)
+ if(!m_sound)
return false;
// actual audio device playing state
- bool isplaying = (m_soundObject->GetPlaystate() != SND_STOPPED && m_soundObject->GetPlaystate() != SND_INITIAL) ? true : false;
-
- if (m_pino)
- {
- bNegativeEvent = true;
- m_pino = false;
- }
+ bool isplaying = AUD_getStatus(m_handle) == AUD_STATUS_PLAYING;
if (bNegativeEvent)
- {
+ {
// here must be a check if it is still playing
- if (m_isplaying && isplaying)
+ if (m_isplaying && isplaying)
{
switch (m_type)
{
@@ -131,19 +174,20 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
case KX_SOUNDACT_LOOPSTOP:
case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:
{
- m_soundScene->RemoveActiveObject(m_soundObject);
+ // stop immediately
+ AUD_stop(m_handle);
break;
}
case KX_SOUNDACT_PLAYEND:
{
- m_soundObject->SetPlaystate(SND_MUST_STOP_WHEN_FINISHED);
+ // do nothing, sound will stop anyway when it's finished
break;
}
case KX_SOUNDACT_LOOPEND:
case KX_SOUNDACT_LOOPBIDIRECTIONAL:
{
- m_soundObject->SetLoopMode(SND_LOOP_OFF);
- m_soundObject->SetPlaystate(SND_MUST_STOP_WHEN_FINISHED);
+ // stop the looping so that the sound stops when it finished
+ AUD_stopLoop(m_handle);
break;
}
default:
@@ -166,50 +210,49 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
// the negative pulse is done continuesly
#endif
if (!m_isplaying)
- {
- switch (m_type)
- {
- case KX_SOUNDACT_LOOPBIDIRECTIONAL:
- case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:
- {
- m_soundObject->SetLoopMode(SND_LOOP_BIDIRECTIONAL);
- m_soundScene->AddActiveObject(m_soundObject, curtime);
- m_isplaying = true;
- result = true;
- break;
- }
- case KX_SOUNDACT_LOOPEND:
- case KX_SOUNDACT_LOOPSTOP:
- {
- m_soundObject->SetLoopMode(SND_LOOP_NORMAL);
- m_soundScene->AddActiveObject(m_soundObject, curtime);
- m_isplaying = true;
- result = true;
- break;
- }
- case KX_SOUNDACT_PLAYSTOP:
- case KX_SOUNDACT_PLAYEND:
- {
- m_soundObject->SetLoopMode(SND_LOOP_OFF);
- m_soundScene->AddActiveObject(m_soundObject, curtime);
- m_isplaying = true;
- result = true;
- break;
- }
- default:
- // implement me !!
- break;
- }
- }
+ play();
}
// verify that the sound is still playing
- isplaying = (m_soundObject->GetPlaystate() != SND_STOPPED && m_soundObject->GetPlaystate() != SND_INITIAL) ? true : false;
+ isplaying = AUD_getStatus(m_handle) == AUD_STATUS_PLAYING ? true : false;
if (isplaying)
{
- m_soundObject->SetPosition(((KX_GameObject*)this->GetParent())->NodeGetWorldPosition());
- m_soundObject->SetVelocity(((KX_GameObject*)this->GetParent())->GetLinearVelocity());
- m_soundObject->SetOrientation(((KX_GameObject*)this->GetParent())->NodeGetWorldOrientation());
+ if(m_is3d)
+ {
+ AUD_3DData data;
+ float f;
+ ((KX_GameObject*)this->GetParent())->NodeGetWorldPosition().getValue(data.position);
+ ((KX_GameObject*)this->GetParent())->GetLinearVelocity().getValue(data.velocity);
+ ((KX_GameObject*)this->GetParent())->NodeGetWorldOrientation().getValue3x3(data.orientation);
+
+ /*
+ * The 3D data from blender has to be transformed for OpenAL:
+ * - In blender z is up and y is forwards
+ * - In OpenAL y is up and z is backwards
+ * We have to do that for all 5 vectors.
+ */
+ f = data.position[1];
+ data.position[1] = data.position[2];
+ data.position[2] = -f;
+
+ f = data.velocity[1];
+ data.velocity[1] = data.velocity[2];
+ data.velocity[2] = -f;
+
+ f = data.orientation[1];
+ data.orientation[1] = data.orientation[2];
+ data.orientation[2] = -f;
+
+ f = data.orientation[4];
+ data.orientation[4] = data.orientation[5];
+ data.orientation[5] = -f;
+
+ f = data.orientation[7];
+ data.orientation[7] = data.orientation[8];
+ data.orientation[8] = -f;
+
+ AUD_update3DSource(m_handle, &data);
+ }
result = true;
}
else
@@ -217,23 +260,11 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
m_isplaying = false;
result = false;
}
- /*
- if (result && (m_soundObject->IsLifeSpanOver(curtime)) && ((m_type == KX_SOUNDACT_PLAYEND) || (m_type == KX_SOUNDACT_PLAYSTOP)))
- {
- m_pino = true;
- }
- */
return result;
}
-void KX_SoundActuator::setSoundObject(class SND_SoundObject* soundobject)
-{
- m_soundObject = soundobject;
-}
-
-
/* ------------------------------------------------------------------------- */
/* Python functions */
@@ -243,52 +274,28 @@ void KX_SoundActuator::setSoundObject(class SND_SoundObject* soundobject)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_SoundActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_SoundActuator",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &SCA_IActuator::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_SoundActuator",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &SCA_IActuator::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_SoundActuator::Methods[] = {
- // Deprecated ----->
- {"setFilename", (PyCFunction) KX_SoundActuator::sPySetFilename, METH_VARARGS,NULL},
- {"getFilename", (PyCFunction) KX_SoundActuator::sPyGetFilename, METH_NOARGS,NULL},
- {"setGain",(PyCFunction) KX_SoundActuator::sPySetGain,METH_VARARGS,NULL},
- {"getGain",(PyCFunction) KX_SoundActuator::sPyGetGain,METH_NOARGS,NULL},
- {"setPitch",(PyCFunction) KX_SoundActuator::sPySetPitch,METH_VARARGS,NULL},
- {"getPitch",(PyCFunction) KX_SoundActuator::sPyGetPitch,METH_NOARGS,NULL},
- {"setRollOffFactor",(PyCFunction) KX_SoundActuator::sPySetRollOffFactor,METH_VARARGS,NULL},
- {"getRollOffFactor",(PyCFunction) KX_SoundActuator::sPyGetRollOffFactor,METH_NOARGS,NULL},
- {"setLooping",(PyCFunction) KX_SoundActuator::sPySetLooping,METH_VARARGS,NULL},
- {"getLooping",(PyCFunction) KX_SoundActuator::sPyGetLooping,METH_NOARGS,NULL},
- {"setPosition",(PyCFunction) KX_SoundActuator::sPySetPosition,METH_VARARGS,NULL},
- {"setVelocity",(PyCFunction) KX_SoundActuator::sPySetVelocity,METH_VARARGS,NULL},
- {"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL},
- {"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL},
- {"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_NOARGS,NULL},
- // <-----
-
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, startSound),
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, pauseSound),
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, stopSound),
@@ -296,171 +303,91 @@ PyMethodDef KX_SoundActuator::Methods[] = {
};
PyAttributeDef KX_SoundActuator::Attributes[] = {
- KX_PYATTRIBUTE_RW_FUNCTION("fileName", KX_SoundActuator, pyattr_get_filename, pyattr_set_filename),
KX_PYATTRIBUTE_RW_FUNCTION("volume", KX_SoundActuator, pyattr_get_gain, pyattr_set_gain),
KX_PYATTRIBUTE_RW_FUNCTION("pitch", KX_SoundActuator, pyattr_get_pitch, pyattr_set_pitch),
KX_PYATTRIBUTE_RW_FUNCTION("rollOffFactor", KX_SoundActuator, pyattr_get_rollOffFactor, pyattr_set_rollOffFactor),
- KX_PYATTRIBUTE_RW_FUNCTION("looping", KX_SoundActuator, pyattr_get_looping, pyattr_set_looping),
- KX_PYATTRIBUTE_RW_FUNCTION("position", KX_SoundActuator, pyattr_get_position, pyattr_set_position),
- KX_PYATTRIBUTE_RW_FUNCTION("velocity", KX_SoundActuator, pyattr_get_velocity, pyattr_set_velocity),
- KX_PYATTRIBUTE_RW_FUNCTION("orientation", KX_SoundActuator, pyattr_get_orientation, pyattr_set_orientation),
KX_PYATTRIBUTE_ENUM_RW("mode",KX_SoundActuator::KX_SOUNDACT_NODEF+1,KX_SoundActuator::KX_SOUNDACT_MAX-1,false,KX_SoundActuator,m_type),
{ NULL } //Sentinel
};
/* Methods ----------------------------------------------------------------- */
-KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, startSound,
+KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, startSound,
"startSound()\n"
"\tStarts the sound.\n")
{
- if (m_soundObject)
- // This has no effect if the actuator is not active.
- // To start the sound you must activate the actuator.
- // This function is to restart the sound.
- m_soundObject->StartSound();
+ switch(AUD_getStatus(m_handle))
+ {
+ case AUD_STATUS_PLAYING:
+ break;
+ case AUD_STATUS_PAUSED:
+ AUD_resume(m_handle);
+ break;
+ default:
+ play();
+ }
Py_RETURN_NONE;
-}
+}
KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, pauseSound,
"pauseSound()\n"
"\tPauses the sound.\n")
{
- if (m_soundObject)
- // unfortunately, openal does not implement pause correctly, it is equivalent to a stop
- m_soundObject->PauseSound();
+ AUD_pause(m_handle);
Py_RETURN_NONE;
-}
+}
KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, stopSound,
"stopSound()\n"
"\tStops the sound.\n")
{
- if (m_soundObject)
- m_soundObject->StopSound();
+ AUD_stop(m_handle);
Py_RETURN_NONE;
}
/* Atribute setting and getting -------------------------------------------- */
-PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- if (!actuator->m_soundObject)
- {
- return PyUnicode_FromString("");
- }
- STR_String objectname = actuator->m_soundObject->GetObjectName();
- char* name = objectname.Ptr();
-
- if (!name) {
- PyErr_SetString(PyExc_RuntimeError, "value = actuator.fileName: KX_SoundActuator, unable to get sound fileName");
- return NULL;
- } else
- return PyUnicode_FromString(name);
-}
-
PyObject* KX_SoundActuator::pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- float gain = (actuator->m_soundObject) ? actuator->m_soundObject->GetGain() : 1.0f;
+ float gain = actuator->m_volume;
PyObject* result = PyFloat_FromDouble(gain);
-
+
return result;
}
PyObject* KX_SoundActuator::pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- float pitch = (actuator->m_soundObject) ? actuator->m_soundObject->GetPitch() : 1.0;
+ float pitch = actuator->m_pitch;
+
PyObject* result = PyFloat_FromDouble(pitch);
-
+
return result;
}
PyObject* KX_SoundActuator::pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
{
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- float rollofffactor = (actuator->m_soundObject) ? actuator->m_soundObject->GetRollOffFactor() : 1.0;
+ float rollofffactor = actuator->m_3d.rolloff_factor;
PyObject* result = PyFloat_FromDouble(rollofffactor);
-
- return result;
-}
-
-PyObject* KX_SoundActuator::pyattr_get_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- int looping = (actuator->m_soundObject) ? actuator->m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF;
- PyObject* result = PyLong_FromSsize_t(looping);
-
- return result;
-}
-
-PyObject* KX_SoundActuator::pyattr_get_position(void * self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- MT_Vector3 pos(0.0, 0.0, 0.0);
-
- if (actuator->m_soundObject)
- pos = actuator->m_soundObject->GetPosition();
-
- PyObject * result = PyObjectFrom(pos);
- return result;
-}
-
-PyObject* KX_SoundActuator::pyattr_get_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- MT_Vector3 vel;
-
- if (actuator->m_soundObject)
- vel = actuator->m_soundObject->GetVelocity();
-
- PyObject * result = PyObjectFrom(vel);
- return result;
-}
-
-PyObject* KX_SoundActuator::pyattr_get_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- MT_Matrix3x3 ori;
-
- if (actuator->m_soundObject)
- ori = actuator->m_soundObject->GetOrientation();
- PyObject * result = PyObjectFrom(ori);
return result;
}
-int KX_SoundActuator::pyattr_set_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
-{
- char *soundName = NULL;
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator*> (self);
- // void *soundPointer = NULL; /*unused*/
-
- if (!PyArg_Parse(value, "s", &soundName))
- return PY_SET_ATTR_FAIL;
-
- if (actuator->m_soundObject) {
- actuator->m_soundObject->SetObjectName(soundName);
- }
-
- return PY_SET_ATTR_SUCCESS;
-}
-
-
int KX_SoundActuator::pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
float gain = 1.0;
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
if (!PyArg_Parse(value, "f", &gain))
return PY_SET_ATTR_FAIL;
-
- if (actuator->m_soundObject)
- actuator->m_soundObject->SetGain(gain);
-
+
+ actuator->m_volume = gain;
+ if(actuator->m_handle)
+ AUD_setSoundVolume(actuator->m_handle, gain);
+
return PY_SET_ATTR_SUCCESS;
-}
+}
int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
@@ -468,12 +395,13 @@ int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_D
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
if (!PyArg_Parse(value, "f", &pitch))
return PY_SET_ATTR_FAIL;
-
- if (actuator->m_soundObject)
- actuator->m_soundObject->SetPitch(pitch);
-
+
+ actuator->m_pitch = pitch;
+ if(actuator->m_handle)
+ AUD_setSoundPitch(actuator->m_handle, pitch);
+
return PY_SET_ATTR_SUCCESS;
-}
+}
int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
@@ -481,292 +409,10 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT
float rollofffactor = 1.0;
if (!PyArg_Parse(value, "f", &rollofffactor))
return PY_SET_ATTR_FAIL;
-
- if (actuator->m_soundObject)
- actuator->m_soundObject->SetRollOffFactor(rollofffactor);
-
- return PY_SET_ATTR_SUCCESS;
-}
-
-int KX_SoundActuator::pyattr_set_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
-{
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
- int looping = 1;
- if (!PyArg_Parse(value, "i", &looping))
- return PY_SET_ATTR_FAIL;
-
- if (actuator->m_soundObject)
- actuator->m_soundObject->SetLoopMode(looping);
-
- return PY_SET_ATTR_SUCCESS;
-}
-
-int KX_SoundActuator::pyattr_set_position(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
-{
- float pos[3];
-
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
-
- if (!PyArg_ParseTuple(value, "fff", &pos[0], &pos[1], &pos[2]))
- return PY_SET_ATTR_FAIL;
-
- if (actuator->m_soundObject)
- actuator->m_soundObject->SetPosition(MT_Vector3(pos));
-
- return PY_SET_ATTR_SUCCESS;
-}
-int KX_SoundActuator::pyattr_set_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
-{
- float vel[3];
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
+ actuator->m_3d.rolloff_factor = rollofffactor;
+ if(actuator->m_handle)
+ AUD_set3DSourceSetting(actuator->m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor);
-
- if (!PyArg_ParseTuple(value, "fff", &vel[0], &vel[1], &vel[2]))
- return PY_SET_ATTR_FAIL;
-
- if (actuator->m_soundObject)
- actuator->m_soundObject->SetVelocity(MT_Vector3(vel));
-
return PY_SET_ATTR_SUCCESS;
-
-}
-
-int KX_SoundActuator::pyattr_set_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
-{
-
- MT_Matrix3x3 rot;
- KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
-
- /* if value is not a sequence PyOrientationTo makes an error */
- if (!PyOrientationTo(value, rot, "actuator.orientation = value: KX_SoundActuator"))
- return PY_SET_ATTR_FAIL;
-
- /* Since not having m_soundObject didn't do anything in the old version,
- * it probably should be kept that way */
- if (!actuator->m_soundObject)
- return PY_SET_ATTR_SUCCESS;
-
- actuator->m_soundObject->SetOrientation(rot);
- return PY_SET_ATTR_SUCCESS;
-}
-
-// Deprecated ----->
-PyObject* KX_SoundActuator::PySetFilename(PyObject* args)
-{
- char *soundName = NULL;
- ShowDeprecationWarning("setFilename()", "the fileName property");
- // void *soundPointer = NULL; /*unused*/
-
- if (!PyArg_ParseTuple(args, "s", &soundName))
- return NULL;
-
- Py_RETURN_NONE;
-}
-
-PyObject* KX_SoundActuator::PyGetFilename()
-{
- ShowDeprecationWarning("getFilename()", "the fileName property");
- if (!m_soundObject)
- {
- return PyUnicode_FromString("");
- }
- STR_String objectname = m_soundObject->GetObjectName();
- char* name = objectname.Ptr();
-
- if (!name) {
- PyErr_SetString(PyExc_RuntimeError, "Unable to get sound fileName");
- return NULL;
- } else
- return PyUnicode_FromString(name);
-}
-
-PyObject* KX_SoundActuator::PySetGain(PyObject* args)
-{
- ShowDeprecationWarning("setGain()", "the volume property");
- float gain = 1.0;
- if (!PyArg_ParseTuple(args, "f:setGain", &gain))
- return NULL;
-
- if (m_soundObject)
- m_soundObject->SetGain(gain);
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* KX_SoundActuator::PyGetGain()
-{
- ShowDeprecationWarning("getGain()", "the volume property");
- float gain = (m_soundObject) ? m_soundObject->GetGain() : 1.0f;
- PyObject* result = PyFloat_FromDouble(gain);
-
- return result;
-}
-
-
-
-PyObject* KX_SoundActuator::PySetPitch(PyObject* args)
-{
- ShowDeprecationWarning("setPitch()", "the pitch property");
- float pitch = 1.0;
- if (!PyArg_ParseTuple(args, "f:setPitch", &pitch))
- return NULL;
-
- if (m_soundObject)
- m_soundObject->SetPitch(pitch);
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* KX_SoundActuator::PyGetPitch()
-{
- ShowDeprecationWarning("getPitch()", "the pitch property");
- float pitch = (m_soundObject) ? m_soundObject->GetPitch() : 1.0;
- PyObject* result = PyFloat_FromDouble(pitch);
-
- return result;
}
-
-
-
-PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* args)
-{
- ShowDeprecationWarning("setRollOffFactor()", "the rollOffFactor property");
- float rollofffactor = 1.0;
- if (!PyArg_ParseTuple(args, "f:setRollOffFactor", &rollofffactor))
- return NULL;
-
- if (m_soundObject)
- m_soundObject->SetRollOffFactor(rollofffactor);
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* KX_SoundActuator::PyGetRollOffFactor()
-{
- ShowDeprecationWarning("getRollOffFactor()", "the rollOffFactor property");
- float rollofffactor = (m_soundObject) ? m_soundObject->GetRollOffFactor() : 1.0;
- PyObject* result = PyFloat_FromDouble(rollofffactor);
-
- return result;
-}
-
-
-
-PyObject* KX_SoundActuator::PySetLooping(PyObject* args)
-{
- ShowDeprecationWarning("setLooping()", "the looping property");
- bool looping = 1;
- if (!PyArg_ParseTuple(args, "i:setLooping", &looping))
- return NULL;
-
- if (m_soundObject)
- m_soundObject->SetLoopMode(looping);
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* KX_SoundActuator::PyGetLooping()
-{
- ShowDeprecationWarning("getLooping()", "the looping property");
- int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF;
- PyObject* result = PyLong_FromSsize_t(looping);
-
- return result;
-}
-
-
-
-PyObject* KX_SoundActuator::PySetPosition(PyObject* args)
-{
- MT_Point3 pos;
- ShowDeprecationWarning("setPosition()", "the position property");
- pos[0] = 0.0;
- pos[1] = 0.0;
- pos[2] = 0.0;
-
- if (!PyArg_ParseTuple(args, "fff:setPosition", &pos[0], &pos[1], &pos[2]))
- return NULL;
-
- if (m_soundObject)
- m_soundObject->SetPosition(pos);
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* KX_SoundActuator::PySetVelocity(PyObject* args)
-{
- MT_Vector3 vel;
- ShowDeprecationWarning("setVelocity()", "the velocity property");
- vel[0] = 0.0;
- vel[1] = 0.0;
- vel[2] = 0.0;
-
- if (!PyArg_ParseTuple(args, "fff:setVelocity", &vel[0], &vel[1], &vel[2]))
- return NULL;
-
- if (m_soundObject)
- m_soundObject->SetVelocity(vel);
-
- Py_RETURN_NONE;
-}
-
-
-
-PyObject* KX_SoundActuator::PySetOrientation(PyObject* args)
-{
- MT_Matrix3x3 ori;
- ShowDeprecationWarning("setOrientation()", "the orientation property");
- ori[0][0] = 1.0;
- ori[0][1] = 0.0;
- ori[0][2] = 0.0;
- ori[1][0] = 0.0;
- ori[1][1] = 1.0;
- ori[1][2] = 0.0;
- ori[2][0] = 0.0;
- ori[2][1] = 0.0;
- ori[2][2] = 1.0;
-
- if (!PyArg_ParseTuple(args, "fffffffff:setOrientation", &ori[0][0], &ori[0][1], &ori[0][2], &ori[1][0], &ori[1][1], &ori[1][2], &ori[2][0], &ori[2][1], &ori[2][2]))
- return NULL;
-
- if (m_soundObject)
- m_soundObject->SetOrientation(ori);
-
- Py_RETURN_NONE;
-}
-
-PyObject* KX_SoundActuator::PySetType(PyObject* args)
-{
- int typeArg;
- ShowDeprecationWarning("setType()", "the mode property");
-
- if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) {
- return NULL;
- }
-
- if ( (typeArg > KX_SOUNDACT_NODEF)
- && (typeArg < KX_SOUNDACT_MAX) ) {
- m_type = (KX_SOUNDACT_TYPE) typeArg;
- }
-
- Py_RETURN_NONE;
-}
-
-PyObject* KX_SoundActuator::PyGetType()
-{
- ShowDeprecationWarning("getType()", "the mode property");
- return PyLong_FromSsize_t(m_type);
-}
-// <-----
-
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h
index adafee0a30b..43198f1a253 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.h
+++ b/source/gameengine/Ketsji/KX_SoundActuator.h
@@ -34,17 +34,34 @@
#include "SCA_IActuator.h"
+#include "AUD_C-API.h"
+#include "BKE_sound.h"
+
+typedef struct KX_3DSoundSettings
+{
+ float min_gain;
+ float max_gain;
+ float reference_distance;
+ float max_distance;
+ float rolloff_factor;
+ float cone_inner_angle;
+ float cone_outer_angle;
+ float cone_outer_gain;
+} KX_3DSoundSettings;
+
class KX_SoundActuator : public SCA_IActuator
{
- Py_Header;
- bool m_lastEvent;
- bool m_isplaying;
- /* just some handles to the audio-data... */
- class SND_SoundObject* m_soundObject;
- class SND_Scene* m_soundScene;
- short m_startFrame;
- short m_endFrame;
- bool m_pino;
+ Py_Header;
+ bool m_isplaying;
+ AUD_Sound* m_sound;
+ float m_volume;
+ float m_pitch;
+ bool m_is3d;
+ KX_3DSoundSettings m_3d;
+ AUD_Handle* m_handle;
+
+ void play();
+
public:
enum KX_SOUNDACT_TYPE
@@ -62,15 +79,15 @@ public:
KX_SOUNDACT_TYPE m_type;
KX_SoundActuator(SCA_IObject* gameobj,
- class SND_SoundObject* sndobj,
- class SND_Scene* sndscene,
- KX_SOUNDACT_TYPE type,
- short start,
- short end);
+ AUD_Sound* sound,
+ float volume,
+ float pitch,
+ bool is3d,
+ KX_3DSoundSettings settings,
+ KX_SOUNDACT_TYPE type);
~KX_SoundActuator();
- void setSoundObject(class SND_SoundObject* soundobject);
virtual bool Update(double curtime, bool frame);
CValue* GetReplica();
@@ -84,44 +101,15 @@ public:
KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, pauseSound);
KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, stopSound);
- static int pyattr_set_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- static int pyattr_set_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- static int pyattr_set_position(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- static int pyattr_set_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- static int pyattr_set_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
static int pyattr_set_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
- static PyObject* pyattr_get_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_position(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
- static PyObject* pyattr_get_orientation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
-
- // Deprecated ----->
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetFilename);
- KX_PYMETHOD_NOARGS(KX_SoundActuator,GetFilename);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetGain);
- KX_PYMETHOD_NOARGS(KX_SoundActuator,GetGain);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPitch);
- KX_PYMETHOD_NOARGS(KX_SoundActuator,GetPitch);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetRollOffFactor);
- KX_PYMETHOD_NOARGS(KX_SoundActuator,GetRollOffFactor);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetLooping);
- KX_PYMETHOD_NOARGS(KX_SoundActuator,GetLooping);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPosition);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetVelocity);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetOrientation);
- KX_PYMETHOD_VARARGS(KX_SoundActuator,SetType);
- KX_PYMETHOD_NOARGS(KX_SoundActuator,GetType);
- // <-----
-
};
#endif //__KX_SOUNDACTUATOR
diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp
index 9815d6274aa..4159e9c373d 100644
--- a/source/gameengine/Ketsji/KX_StateActuator.cpp
+++ b/source/gameengine/Ketsji/KX_StateActuator.cpp
@@ -137,13 +137,7 @@ void KX_StateActuator::Activate(SG_DList& head)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_StateActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_StateActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -165,12 +159,6 @@ PyTypeObject KX_StateActuator::Type = {
};
PyMethodDef KX_StateActuator::Methods[] = {
- // deprecated -->
- {"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation,
- METH_VARARGS, (PY_METHODCHAR)SetOperation_doc},
- {"setMask", (PyCFunction) KX_StateActuator::sPySetMask,
- METH_VARARGS, (PY_METHODCHAR)SetMask_doc},
- // <--
{NULL,NULL} //Sentinel
};
@@ -179,52 +167,3 @@ PyAttributeDef KX_StateActuator::Attributes[] = {
KX_PYATTRIBUTE_INT_RW("mask",0,0x3FFFFFFF,false,KX_StateActuator,m_mask),
{ NULL } //Sentinel
};
-
-
-/* set operation ---------------------------------------------------------- */
-const char
-KX_StateActuator::SetOperation_doc[] =
-"setOperation(op)\n"
-"\t - op : bit operation (0=Copy, 1=Set, 2=Clear, 3=Negate)"
-"\tSet the type of bit operation to be applied on object state mask.\n"
-"\tUse setMask() to specify the bits that will be modified.\n";
-PyObject*
-
-KX_StateActuator::PySetOperation(PyObject* args) {
- ShowDeprecationWarning("setOperation()", "the operation property");
- int oper;
-
- if(!PyArg_ParseTuple(args, "i:setOperation", &oper)) {
- return NULL;
- }
-
- m_operation = oper;
-
- Py_RETURN_NONE;
-}
-
-/* set mask ---------------------------------------------------------- */
-const char
-KX_StateActuator::SetMask_doc[] =
-"setMask(mask)\n"
-"\t - mask : bits that will be modified"
-"\tSet the value that defines the bits that will be modified by the operation.\n"
-"\tThe bits that are 1 in the value will be updated in the object state,\n"
-"\tthe bits that are 0 are will be left unmodified expect for the Copy operation\n"
-"\twhich copies the value to the object state.\n";
-PyObject*
-
-KX_StateActuator::PySetMask(PyObject* args) {
- ShowDeprecationWarning("setMask()", "the mask property");
- int mask;
-
- if(!PyArg_ParseTuple(args, "i:setMask", &mask)) {
- return NULL;
- }
-
- m_mask = mask;
-
- Py_RETURN_NONE;
-}
-
-
diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h
index ce86c4b44fe..4cf84f74287 100644
--- a/source/gameengine/Ketsji/KX_StateActuator.h
+++ b/source/gameengine/Ketsji/KX_StateActuator.h
@@ -88,9 +88,7 @@ class KX_StateActuator : public SCA_IActuator
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- //KX_PYMETHOD_DOC
- KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation);
- KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask);
+
};
#endif
diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h
index 0cc34b53736..fe15967f93c 100644
--- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h
+++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h
@@ -125,6 +125,12 @@ protected:
/** Maximum number of measurements. */
unsigned int m_maxNumMeasurements;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // __KX_TIME_CATEGORY_LOGGER_H
diff --git a/source/gameengine/Ketsji/KX_TimeLogger.h b/source/gameengine/Ketsji/KX_TimeLogger.h
index 0962f02a877..2e73abc75b5 100644
--- a/source/gameengine/Ketsji/KX_TimeLogger.h
+++ b/source/gameengine/Ketsji/KX_TimeLogger.h
@@ -36,6 +36,10 @@
#include <deque>
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/**
* Stores and manages time measurements.
*/
@@ -98,6 +102,13 @@ protected:
/** State of logging. */
bool m_logging;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // __KX_TIME_LOGGER_H
diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h
index cc77bccfc31..6da37d615a4 100644
--- a/source/gameengine/Ketsji/KX_TouchEventManager.h
+++ b/source/gameengine/Ketsji/KX_TouchEventManager.h
@@ -76,6 +76,12 @@ public:
SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
PHY_IPhysicsEnvironment *GetPhysicsEnvironment() { return m_physEnv; }
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_TOUCHEVENTMANAGER
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp
index b0cf172c27a..cde67787e2f 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.cpp
+++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp
@@ -101,8 +101,7 @@ KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj
:SCA_ISensor(gameobj,eventmgr),
m_touchedpropname(touchedpropname),
m_bFindMaterial(bFindMaterial),
-m_bTouchPulse(bTouchPulse),
-m_eventmgr(eventmgr)
+m_bTouchPulse(bTouchPulse)
/*m_sumoObj(sumoObj),*/
{
// KX_TouchEventManager* touchmgr = (KX_TouchEventManager*) eventmgr;
@@ -294,13 +293,7 @@ bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_Coll
/* ------------------------------------------------------------------------- */
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_TouchSensor::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_TouchSensor",
sizeof(PyObjectPlus_Proxy),
0,
@@ -322,16 +315,6 @@ PyTypeObject KX_TouchSensor::Type = {
};
PyMethodDef KX_TouchSensor::Methods[] = {
- //Deprecated ----->
- {"setProperty",
- (PyCFunction) KX_TouchSensor::sPySetProperty, METH_O, (PY_METHODCHAR)SetProperty_doc},
- {"getProperty",
- (PyCFunction) KX_TouchSensor::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
- {"getHitObject",
- (PyCFunction) KX_TouchSensor::sPyGetHitObject, METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
- {"getHitObjectList",
- (PyCFunction) KX_TouchSensor::sPyGetHitObjectList, METH_NOARGS, (PY_METHODCHAR)GetHitObjectList_doc},
- //<-----
{NULL,NULL} //Sentinel
};
@@ -346,101 +329,6 @@ PyAttributeDef KX_TouchSensor::Attributes[] = {
/* Python API */
-/* 1. setProperty */
-const char KX_TouchSensor::SetProperty_doc[] =
-"setProperty(name)\n"
-"\t- name: string\n"
-"\tSet the property or material to collide with. Use\n"
-"\tsetTouchMaterial() to switch between properties and\n"
-"\tmaterials.";
-PyObject* KX_TouchSensor::PySetProperty(PyObject* value)
-{
- ShowDeprecationWarning("setProperty()", "the propName property");
- char *nameArg= _PyUnicode_AsString(value);
- if (nameArg==NULL) {
- PyErr_SetString(PyExc_ValueError, "expected a ");
- return NULL;
- }
-
- m_touchedpropname = nameArg;
- Py_RETURN_NONE;
-}
-/* 2. getProperty */
-const char KX_TouchSensor::GetProperty_doc[] =
-"getProperty(name)\n"
-"\tReturns the property or material to collide with. Use\n"
-"\tgetTouchMaterial() to find out whether this sensor\n"
-"\tlooks for properties or materials.";
-PyObject* KX_TouchSensor::PyGetProperty() {
- ShowDeprecationWarning("getProperty()", "the propName property");
-
- return PyUnicode_FromString(m_touchedpropname);
-}
-
-const char KX_TouchSensor::GetHitObject_doc[] =
-"getHitObject()\n"
-;
-PyObject* KX_TouchSensor::PyGetHitObject()
-{
- ShowDeprecationWarning("getHitObject()", "the hitObject property");
- /* to do: do Py_IncRef if the object is already known in Python */
- /* otherwise, this leaks memory */
- if (m_hitObject)
- {
- return m_hitObject->GetProxy();
- }
- Py_RETURN_NONE;
-}
-
-const char KX_TouchSensor::GetHitObjectList_doc[] =
-"getHitObjectList()\n"
-"\tReturn a list of the objects this object collided with,\n"
-"\tbut only those matching the property/material condition.\n";
-PyObject* KX_TouchSensor::PyGetHitObjectList()
-{
- ShowDeprecationWarning("getHitObjectList()", "the hitObjectList property");
- /* to do: do Py_IncRef if the object is already known in Python */
- /* otherwise, this leaks memory */ /* Edit, this seems ok and not to leak memory - Campbell */
- return m_colliders->GetProxy();
-}
-
-/*getTouchMaterial and setTouchMaterial were never added to the api,
-they can probably be removed with out anyone noticing*/
-
-/* 5. getTouchMaterial */
-const char KX_TouchSensor::GetTouchMaterial_doc[] =
-"getTouchMaterial()\n"
-"\tReturns KX_TRUE if this sensor looks for a specific material,\n"
-"\tKX_FALSE if it looks for a specific property.\n" ;
-PyObject* KX_TouchSensor::PyGetTouchMaterial()
-{
- ShowDeprecationWarning("getTouchMaterial()", "the useMaterial property");
- return PyLong_FromSsize_t(m_bFindMaterial);
-}
-
-/* 6. setTouchMaterial */
-#if 0
-const char KX_TouchSensor::SetTouchMaterial_doc[] =
-"setTouchMaterial(flag)\n"
-"\t- flag: KX_TRUE or KX_FALSE.\n"
-"\tSet flag to KX_TRUE to switch on positive pulse mode,\n"
-"\tKX_FALSE to switch off positive pulse mode.\n" ;
-PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject *value)
-{
- ShowDeprecationWarning("setTouchMaterial()", "the useMaterial property");
- int pulseArg = PyLong_AsSsize_t(value);
-
- if(pulseArg ==-1 && PyErr_Occurred()) {
- PyErr_SetString(PyExc_ValueError, "expected a bool");
- return NULL;
- }
-
- m_bFindMaterial = pulseArg != 0;
-
- Py_RETURN_NONE;
-}
-#endif
-
PyObject* KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v);
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h
index 6cbf5b15e3b..ad1830e05c9 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.h
+++ b/source/gameengine/Ketsji/KX_TouchSensor.h
@@ -58,7 +58,6 @@ protected:
STR_String m_touchedpropname;
bool m_bFindMaterial;
bool m_bTouchPulse; /* changes in the colliding objects trigger pulses */
- class SCA_EventManager* m_eventmgr;
class PHY_IPhysicsController* m_physCtrl;
@@ -120,23 +119,6 @@ public:
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
-
- //Deprecated ----->
- /* 1. setProperty */
- KX_PYMETHOD_DOC_O(KX_TouchSensor,SetProperty);
- /* 2. getProperty */
- KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetProperty);
- /* 3. getHitObject */
- KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObject);
- /* 4. getHitObject */
- KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObjectList);
- /* 5. getTouchMaterial */
- KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetTouchMaterial);
-#if 0
- /* 6. setTouchMaterial */
- KX_PYMETHOD_DOC_O(KX_TouchSensor,SetTouchMaterial);
-#endif
- //<-----
static PyObject* pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
index e8a06d8d619..e6c2f86bbce 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
@@ -431,13 +431,7 @@ bool KX_TrackToActuator::Update(double curtime, bool frame)
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_TrackToActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_TrackToActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -459,14 +453,6 @@ PyTypeObject KX_TrackToActuator::Type = {
};
PyMethodDef KX_TrackToActuator::Methods[] = {
- // ---> deprecated
- {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc},
- {"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_NOARGS, (PY_METHODCHAR)GetTime_doc},
- {"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (PY_METHODCHAR)SetUse3D_doc},
- {"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_NOARGS, (PY_METHODCHAR)GetUse3D_doc},
- {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (PY_METHODCHAR)SetObject_doc},
- {"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (PY_METHODCHAR)GetObject_doc},
-
{NULL,NULL} //Sentinel
};
@@ -506,123 +492,4 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT
return PY_SET_ATTR_SUCCESS;
}
-
-/* 1. setObject */
-const char KX_TrackToActuator::SetObject_doc[] =
-"setObject(object)\n"
-"\t- object: KX_GameObject, string or None\n"
-"\tSet the object to track with the parent of this actuator.\n";
-PyObject* KX_TrackToActuator::PySetObject(PyObject* value)
-{
- KX_GameObject *gameobj;
-
- ShowDeprecationWarning("setObject()", "the object property");
-
- if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_TrackToActuator"))
- return NULL; // ConvertPythonToGameObject sets the error
-
- if (m_object != NULL)
- m_object->UnregisterActuator(this);
-
- m_object = (SCA_IObject*)gameobj;
- if (m_object)
- m_object->RegisterActuator(this);
-
- Py_RETURN_NONE;
-}
-
-
-
-/* 2. getObject */
-const char KX_TrackToActuator::GetObject_doc[] =
-"getObject(name_only = 1)\n"
-"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
-"\tReturns the object to track with the parent of this actuator\n";
-PyObject* KX_TrackToActuator::PyGetObject(PyObject* args)
-{
- int ret_name_only = 1;
-
- ShowDeprecationWarning("getObject()", "the object property");
-
- if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
- return NULL;
-
- if (!m_object)
- Py_RETURN_NONE;
-
- if (ret_name_only)
- return PyUnicode_FromString(m_object->GetName());
- else
- return m_object->GetProxy();
-}
-
-
-
-/* 3. setTime */
-const char KX_TrackToActuator::SetTime_doc[] =
-"setTime(time)\n"
-"\t- time: integer\n"
-"\tSet the time in frames with which to delay the tracking motion.\n";
-PyObject* KX_TrackToActuator::PySetTime(PyObject* args)
-{
- ShowDeprecationWarning("setTime()", "the timer property");
- int timeArg;
-
- if (!PyArg_ParseTuple(args, "i:setTime", &timeArg))
- {
- return NULL;
- }
-
- m_time= timeArg;
-
- Py_RETURN_NONE;
-}
-
-
-
-/* 4.getTime */
-const char KX_TrackToActuator::GetTime_doc[] =
-"getTime()\n"
-"\t- time: integer\n"
-"\tReturn the time in frames with which the tracking motion is delayed.\n";
-PyObject* KX_TrackToActuator::PyGetTime()
-{
- ShowDeprecationWarning("getTime()", "the timer property");
- return PyLong_FromSsize_t(m_time);
-}
-
-
-
-/* 5. getUse3D */
-const char KX_TrackToActuator::GetUse3D_doc[] =
-"getUse3D()\n"
-"\tReturns 1 if the motion is allowed to extend in the z-direction.\n";
-PyObject* KX_TrackToActuator::PyGetUse3D()
-{
- ShowDeprecationWarning("setTime()", "the use3D property");
- return PyLong_FromSsize_t(!(m_allow3D == 0));
-}
-
-
-
-/* 6. setUse3D */
-const char KX_TrackToActuator::SetUse3D_doc[] =
-"setUse3D(value)\n"
-"\t- value: 0 or 1\n"
-"\tSet to 1 to allow the tracking motion to extend in the z-direction,\n"
-"\tset to 0 to lock the tracking motion to the x-y plane.\n";
-PyObject* KX_TrackToActuator::PySetUse3D(PyObject* args)
-{
- ShowDeprecationWarning("setTime()", "the use3D property");
- int boolArg;
-
- if (!PyArg_ParseTuple(args, "i:setUse3D", &boolArg)) {
- return NULL;
- }
-
- m_allow3D = !(boolArg == 0);
-
- Py_RETURN_NONE;
-}
-
/* eof */
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h
index 801e695bb9b..bbfc1d17576 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.h
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.h
@@ -74,19 +74,6 @@ class KX_TrackToActuator : public SCA_IActuator
/* These are used to get and set m_ob */
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
-
- /* 1. setObject */
- KX_PYMETHOD_DOC_O(KX_TrackToActuator,SetObject);
- /* 2. getObject */
- KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject);
- /* 3. setTime */
- KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetTime);
- /* 4. getTime */
- KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetTime);
- /* 5. getUse3D */
- KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetUse3D);
- /* 6. setUse3D */
- KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetUse3D);
}; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */
diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
index 7001bfc8b7e..1f46cbf53be 100644
--- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
@@ -273,31 +273,25 @@ PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args)
//python specific stuff
PyTypeObject KX_VehicleWrapper::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
- "KX_VehicleWrapper",
- sizeof(PyObjectPlus_Proxy),
- 0,
- py_base_dealloc,
- 0,
- 0,
- 0,
- 0,
- py_base_repr,
- 0,0,0,0,0,0,0,0,0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- 0,0,0,0,0,0,0,
- Methods,
- 0,
- 0,
- &PyObjectPlus::Type,
- 0,0,0,0,0,0,
- py_base_new
+ "KX_VehicleWrapper",
+ sizeof(PyObjectPlus_Proxy),
+ 0,
+ py_base_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ py_base_repr,
+ 0,0,0,0,0,0,0,0,0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef KX_VehicleWrapper::Methods[] = {
diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp
index cb8c891969d..6a47dec181b 100644
--- a/source/gameengine/Ketsji/KX_VertexProxy.cpp
+++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp
@@ -37,13 +37,7 @@
#include "KX_PyMath.h"
PyTypeObject KX_VertexProxy::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_VertexProxy",
sizeof(PyObjectPlus_Proxy),
0,
diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
index 3561ccde9d9..184e127209f 100644
--- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
+++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
@@ -91,13 +91,7 @@ KX_VisibilityActuator::Update()
/* Integration hooks ------------------------------------------------------- */
PyTypeObject KX_VisibilityActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"KX_VisibilityActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -119,10 +113,6 @@ PyTypeObject KX_VisibilityActuator::Type = {
};
PyMethodDef KX_VisibilityActuator::Methods[] = {
- // Deprecated ----->
- {"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS,
- (PY_METHODCHAR) SetVisible_doc},
- // <-----
{NULL,NULL} //Sentinel
};
@@ -132,26 +122,3 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = {
KX_PYATTRIBUTE_BOOL_RW("useRecursion", KX_VisibilityActuator, m_recursive),
{ NULL } //Sentinel
};
-
-/* set visibility ---------------------------------------------------------- */
-const char
-KX_VisibilityActuator::SetVisible_doc[] =
-"setVisible(visible?)\n"
-"\t - visible? : Make the object visible? (KX_TRUE, KX_FALSE)"
-"\tSet the properties of the actuator.\n";
-PyObject*
-
-KX_VisibilityActuator::PySetVisible(PyObject* args) {
- int vis;
- ShowDeprecationWarning("SetVisible()", "the visible property");
-
- if(!PyArg_ParseTuple(args, "i:setVisible", &vis)) {
- return NULL;
- }
-
- m_visible = PyArgToBool(vis);
-
- Py_RETURN_NONE;
-}
-
-
diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h
index 3ad50c6cea2..e75551644a4 100644
--- a/source/gameengine/Ketsji/KX_VisibilityActuator.h
+++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h
@@ -67,11 +67,6 @@ class KX_VisibilityActuator : public SCA_IActuator
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
- // Deprecated ----->
- KX_PYMETHOD_DOC_VARARGS(KX_VisibilityActuator,SetVisible);
- // <-----
-
-
};
#endif
diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h
index fe4e0c51b24..2c2346ca38e 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.h
+++ b/source/gameengine/Ketsji/KX_WorldInfo.h
@@ -31,6 +31,10 @@
#include "MT_Scalar.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class MT_CmMatrix4x4;
class KX_WorldInfo
@@ -59,6 +63,13 @@ public:
virtual void setMistColorRed(float)=0;
virtual void setMistColorGreen(float)=0;
virtual void setMistColorBlue(float)=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_WORLDINFO_H
diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.h b/source/gameengine/Ketsji/KX_WorldIpoController.h
index d90c03d09ee..8622d80a35f 100644
--- a/source/gameengine/Ketsji/KX_WorldIpoController.h
+++ b/source/gameengine/Ketsji/KX_WorldIpoController.h
@@ -90,6 +90,13 @@ public:
};
void AddInterpolator(KX_IInterpolator* interp);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // KX_LIGHTIPOSGCONTROLLER_H
diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile
index 8e91eb6ff9a..0e9e657cc16 100644
--- a/source/gameengine/Ketsji/Makefile
+++ b/source/gameengine/Ketsji/Makefile
@@ -43,10 +43,10 @@ CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
CPPFLAGS += -I../../blender/python
CPPFLAGS += -I../../blender/python/generic
CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
-CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include
-CPPFLAGS += -I$(NAN_SOLID)/include
+CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_BULLET2)/include
+CPPFLAGS += -I$(NAN_AUDASPACE)/include
+
CPPFLAGS += -I../Rasterizer/RAS_OpenGLRasterizer
CPPFLAGS += -I../Rasterizer -I../GameLogic -I../SceneGraph
CPPFLAGS += -I../BlenderRoutines -I../Expressions
diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript
index 1edffe0e587..122b77e0173 100644
--- a/source/gameengine/Ketsji/SConscript
+++ b/source/gameengine/Ketsji/SConscript
@@ -10,8 +10,7 @@ incs = '. #source/blender/python/generic' # Only for Mathutils! and bpy_internal
incs += ' #source/kernel/gen_system #intern/string #intern/guardedalloc'
incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer'
-incs += ' #intern/SoundSystem #intern/SoundSystem/include #intern/SoundSystem/openal'
-incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengine/Converter'
+incs += ' #intern/audaspace/intern #source/gameengine/Converter'
incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf #intern/moto/include'
incs += ' #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork #source/blender/blenlib'
incs += ' #source/blender/blenkernel #source/blender #source/blender/editors/include'
@@ -30,12 +29,8 @@ if env['WITH_BF_SDL']:
else:
defs.append('DISABLE_SDL')
-cxxflags = []
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
if env['BF_DEBUG']:
defs.append('_DEBUG') # for Python
-env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core','player'], priority=[320, 60], cxx_compileflags = cxxflags )
+env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core'], priority=[320], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Makefile b/source/gameengine/Makefile
index 51bc0f7d39f..bcb4b9098e7 100644
--- a/source/gameengine/Makefile
+++ b/source/gameengine/Makefile
@@ -38,7 +38,7 @@ DIRS += Expressions GameLogic Ketsji Rasterizer SceneGraph
DIRS += Network Physics VideoTexture
ifeq ($(WITH_BF_BLENDERGAMEENGINE),true)
- DIRS += GamePlayer
+# DIRS += GamePlayer
endif
include nan_subdirs.mk
diff --git a/source/gameengine/Network/LoopBackNetwork/SConscript b/source/gameengine/Network/LoopBackNetwork/SConscript
index be6545b4fd6..2c27ee707f0 100644
--- a/source/gameengine/Network/LoopBackNetwork/SConscript
+++ b/source/gameengine/Network/LoopBackNetwork/SConscript
@@ -5,4 +5,4 @@ sources = 'NG_LoopBackNetworkDeviceInterface.cpp'
incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Network'
-env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 155] )
+env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core'], priority=[400] )
diff --git a/source/gameengine/Network/NG_NetworkDeviceInterface.h b/source/gameengine/Network/NG_NetworkDeviceInterface.h
index 4a47774a762..2a2a909a04d 100644
--- a/source/gameengine/Network/NG_NetworkDeviceInterface.h
+++ b/source/gameengine/Network/NG_NetworkDeviceInterface.h
@@ -76,6 +76,13 @@ public:
*/
virtual STR_String GetNetworkVersion(void)=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkDeviceInterface"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //NG_NETWORKDEVICEINTERFACE_H
diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h
index 687c8120eca..a2f76dc1fae 100644
--- a/source/gameengine/Network/NG_NetworkMessage.h
+++ b/source/gameengine/Network/NG_NetworkMessage.h
@@ -32,6 +32,10 @@
#include "STR_HashedString.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class NG_NetworkMessage
{
static int s_nextID;
@@ -122,6 +126,13 @@ public:
int GetMessageID() {
return m_uniqueMessageID;
}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkMessage"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //NG_NETWORKMESSAGE_H
diff --git a/source/gameengine/Network/NG_NetworkObject.h b/source/gameengine/Network/NG_NetworkObject.h
index c01d76a47fc..4bf636bf011 100644
--- a/source/gameengine/Network/NG_NetworkObject.h
+++ b/source/gameengine/Network/NG_NetworkObject.h
@@ -32,6 +32,10 @@
#include "STR_String.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class NG_NetworkObject
{
STR_String m_name;
@@ -39,6 +43,13 @@ public:
NG_NetworkObject();
~NG_NetworkObject();
const STR_String& GetName();
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkObject"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //NG_NETWORKOBJECT_H
diff --git a/source/gameengine/Network/NG_NetworkScene.h b/source/gameengine/Network/NG_NetworkScene.h
index fc6367c3526..d5d6e8e0534 100644
--- a/source/gameengine/Network/NG_NetworkScene.h
+++ b/source/gameengine/Network/NG_NetworkScene.h
@@ -34,6 +34,10 @@
#include "STR_HashedString.h"
#include <vector>
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
//MSVC defines SendMessage as a win api function, even though we aren't using it
#ifdef SendMessage
#undef SendMessage
@@ -52,7 +56,7 @@ class NG_NetworkScene
TMessageMap m_messagesBySenderName;
TMessageMap m_messagesBySubject;
-public:
+public:
NG_NetworkScene(NG_NetworkDeviceInterface *nic);
~NG_NetworkScene();
@@ -100,6 +104,13 @@ protected:
* @param map Message map with messages.
*/
void ClearMessageMap(TMessageMap& map);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkScene"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__NG_NETWORKSCENE_H
diff --git a/source/gameengine/Network/SConscript b/source/gameengine/Network/SConscript
index 804851973af..f584503e109 100644
--- a/source/gameengine/Network/SConscript
+++ b/source/gameengine/Network/SConscript
@@ -5,4 +5,4 @@ sources = env.Glob('*.cpp') #'NG_NetworkMessage.cpp NG_NetworkObject.cpp NG_Netw
incs = '. #source/kernel/gen_system #intern/string #intern/moto/include'
-env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core', 'player'], priority=[400, 150] )
+env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core'], priority=[400] )
diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt
index 02f2aa635af..7b7fb508ebd 100644
--- a/source/gameengine/Physics/Bullet/CMakeLists.txt
+++ b/source/gameengine/Physics/Bullet/CMakeLists.txt
@@ -35,7 +35,6 @@ SET(INC
../../../../intern/guardedalloc
../../../kernel/gen_system
../../../../intern/string
- ../../../../intern/SoundSystem
../../Rasterizer
../../Ketsji
../../Expressions
diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h
index b0626f902c2..99885eb99ee 100644
--- a/source/gameengine/Physics/Bullet/CcdGraphicController.h
+++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h
@@ -75,6 +75,12 @@ private:
btBroadphaseProxy* m_handle;
void* m_newClientInfo;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdGraphicController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //BULLET2_PHYSICSCONTROLLER_H
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 20e830c9dc3..df8dc3560ac 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -1073,7 +1073,7 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque
//workaround for incompatibility between 'DYNAMIC' game object, and angular factor
//a DYNAMIC object has some inconsistency: it has no angular effect due to collisions, but still has torque
const btVector3& angFac = body->getAngularFactor();
- btVector3 tmpFac(0,0,1);
+ btVector3 tmpFac(1,1,1);
body->setAngularFactor(tmpFac);
body->applyTorque(torque);
body->setAngularFactor(angFac);
@@ -1829,8 +1829,6 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
}
for(mf= mface, i=0; i < numpolys; mf++, i++) {
- unsigned int *fv = &mf->v1;
-
if(mf->v4) {
fv_pt= quad_verts;
*poly_index_pt++ = *poly_index_pt++ = index[i];
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
index 8eb2e616ecf..69b16ca35bd 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
@@ -58,8 +58,6 @@ class btCollisionShape;
class CcdShapeConstructionInfo
{
public:
-
-
static CcdShapeConstructionInfo* FindMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope, bool gimpact);
CcdShapeConstructionInfo() :
@@ -191,6 +189,13 @@ protected:
bool m_forceReInstance; //use gimpact for concave dynamic/moving collision detection
float m_weldingThreshold1; //welding closeby vertices together can improve softbody stability etc.
CcdShapeConstructionInfo* m_shapeProxy; // only used for PHY_SHAPE_PROXY, pointer to actual shape info
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
struct CcdConstructionInfo
@@ -559,7 +564,11 @@ protected:
}
-
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
@@ -587,7 +596,13 @@ class DefaultMotionState : public PHY_IMotionState
btTransform m_worldTransform;
btVector3 m_localScaling;
-
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index bc7ccacc39b..bf28802870a 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -327,7 +327,6 @@ CcdPhysicsEnvironment::CcdPhysicsEnvironment(bool useDbvtCulling,btDispatcher* d
:m_cullingCache(NULL),
m_cullingTree(NULL),
m_numIterations(10),
-m_scalingPropagated(false),
m_numTimeSubSteps(1),
m_ccdMode(0),
m_solverType(-1),
@@ -336,7 +335,8 @@ m_enableSatCollisionDetection(false),
m_solver(NULL),
m_ownPairCache(NULL),
m_filterCallback(NULL),
-m_ownDispatcher(NULL)
+m_ownDispatcher(NULL),
+m_scalingPropagated(false)
{
for (int i=0;i<PHY_NUM_RESPONSE;i++)
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index bc5491e00cc..e087eac32c5 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -275,7 +275,11 @@ protected:
bool m_scalingPropagated;
-
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsEnvironment"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //CCDPHYSICSENVIRONMENT
diff --git a/source/gameengine/Physics/Bullet/Makefile b/source/gameengine/Physics/Bullet/Makefile
index 19b17de275a..433d1df3d2f 100644
--- a/source/gameengine/Physics/Bullet/Makefile
+++ b/source/gameengine/Physics/Bullet/Makefile
@@ -41,7 +41,6 @@ CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I../../Physics/common
CPPFLAGS += -I../../Physics/Dummy
diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript
index b6d0a75fd04..baba40bcdc7 100644
--- a/source/gameengine/Physics/Bullet/SConscript
+++ b/source/gameengine/Physics/Bullet/SConscript
@@ -16,16 +16,9 @@ incs += ' #source/gameengine/SceneGraph'
incs += ' #source/blender/makesdna'
incs += ' #source/blender/blenkernel'
incs += ' #source/blender/blenlib'
-incs += ' #intern/SoundSystem'
incs += ' #intern/guardedalloc'
incs += ' ' + env['BF_BULLET_INC']
incs += ' ' + env['BF_PYTHON_INC']
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,80], cxx_compileflags=cxxflags )
+env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
index 8dbd137f9de..28440ebdad4 100644
--- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
@@ -93,6 +93,12 @@ public:
return 0.f;
}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //_DUMMYPHYSICSENVIRONMENT
diff --git a/source/gameengine/Physics/Dummy/Makefile b/source/gameengine/Physics/Dummy/Makefile
index c016a0bebcb..0e36266ae09 100644
--- a/source/gameengine/Physics/Dummy/Makefile
+++ b/source/gameengine/Physics/Dummy/Makefile
@@ -39,7 +39,7 @@ CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include
+CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../Physics/common
CPPFLAGS += -I../../Physics/Dummy
diff --git a/source/gameengine/Physics/Dummy/SConscript b/source/gameengine/Physics/Dummy/SConscript
index 93d6ac36446..f4444cf6746 100644
--- a/source/gameengine/Physics/Dummy/SConscript
+++ b/source/gameengine/Physics/Dummy/SConscript
@@ -5,4 +5,4 @@ sources = 'DummyPhysicsEnvironment.cpp'
incs = '. ../common'
-env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,95] )
+env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core'], priority=[350] )
diff --git a/source/gameengine/Physics/common/Makefile b/source/gameengine/Physics/common/Makefile
index f2dd0134b71..f87da383520 100644
--- a/source/gameengine/Physics/common/Makefile
+++ b/source/gameengine/Physics/common/Makefile
@@ -37,10 +37,9 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include
+CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../blender
# these two needed because of blenkernel
CPPFLAGS += -I../../blender/makesdna
diff --git a/source/gameengine/Physics/common/PHY_IController.h b/source/gameengine/Physics/common/PHY_IController.h
index 45e93f9d24e..a053a9679b8 100644
--- a/source/gameengine/Physics/common/PHY_IController.h
+++ b/source/gameengine/Physics/common/PHY_IController.h
@@ -31,7 +31,9 @@
#include "PHY_DynamicTypes.h"
-
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
/**
PHY_IController is the abstract simplified Interface to objects
@@ -41,12 +43,17 @@
class PHY_IController
{
public:
-
virtual ~PHY_IController();
// clientinfo for raycasts for example
virtual void* getNewClientInfo()=0;
virtual void setNewClientInfo(void* clientinfo)=0;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //PHY_ICONTROLLER_H
diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h
index 470d42cb84a..aae971ff42a 100644
--- a/source/gameengine/Physics/common/PHY_IGraphicController.h
+++ b/source/gameengine/Physics/common/PHY_IGraphicController.h
@@ -39,9 +39,7 @@
*/
class PHY_IGraphicController : public PHY_IController
{
-
public:
-
virtual ~PHY_IGraphicController();
/**
SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
@@ -53,6 +51,11 @@ class PHY_IGraphicController : public PHY_IController
virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate) {return 0;}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //PHY_IGRAPHICCONTROLLER_H
diff --git a/source/gameengine/Physics/common/PHY_IMotionState.h b/source/gameengine/Physics/common/PHY_IMotionState.h
index f7bcbd4f2d0..c3d01c010ff 100644
--- a/source/gameengine/Physics/common/PHY_IMotionState.h
+++ b/source/gameengine/Physics/common/PHY_IMotionState.h
@@ -29,6 +29,10 @@
#ifndef PHY__MOTIONSTATE_H
#define PHY__MOTIONSTATE_H
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/**
PHY_IMotionState is the Interface to explicitly synchronize the world transformation.
Default implementations for mayor graphics libraries like OpenGL and DirectX can be provided.
@@ -36,8 +40,7 @@
class PHY_IMotionState
{
- public:
-
+ public:
virtual ~PHY_IMotionState();
virtual void getWorldPosition(float& posX,float& posY,float& posZ)=0;
@@ -52,6 +55,13 @@ class PHY_IMotionState
virtual void calculateWorldTransformations()=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IMotionState"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //PHY__MOTIONSTATE_H
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h
index d7b8cb0b54f..664e5fddd83 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsController.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h
@@ -41,7 +41,6 @@ class PHY_IPhysicsController : public PHY_IController
{
public:
-
virtual ~PHY_IPhysicsController();
/**
SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
@@ -99,6 +98,11 @@ class PHY_IPhysicsController : public PHY_IController
PHY__Vector3 GetWorldPosition(PHY__Vector3& localpos);
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsController"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //PHY_IPHYSICSCONTROLLER_H
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
index c76e9d175ce..291dac298dc 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
@@ -32,6 +32,11 @@
#include <vector>
#include "PHY_DynamicTypes.h"
+
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class PHY_IVehicle;
class RAS_MeshObject;
class PHY_IPhysicsController;
@@ -76,6 +81,12 @@ public:
m_faceNormal(faceNormal)
{
}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IRayCastFilterCallback"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
/**
@@ -160,6 +171,13 @@ class PHY_IPhysicsEnvironment
virtual void setConstraintParam(int constraintId,int param,float value,float value1) = 0;
virtual float getConstraintParam(int constraintId,int param) = 0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsEnvironment"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //_IPHYSICSENVIRONMENT
diff --git a/source/gameengine/Physics/common/PHY_IVehicle.h b/source/gameengine/Physics/common/PHY_IVehicle.h
index 498df0dd840..261bae480f5 100644
--- a/source/gameengine/Physics/common/PHY_IVehicle.h
+++ b/source/gameengine/Physics/common/PHY_IVehicle.h
@@ -6,10 +6,13 @@
class PHY_IMotionState;
#include "PHY_DynamicTypes.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class PHY_IVehicle
{
public:
-
virtual ~PHY_IVehicle();
virtual void AddWheel(
@@ -52,6 +55,12 @@ public:
virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //PHY_IVEHICLE_H
diff --git a/source/gameengine/Physics/common/SConscript b/source/gameengine/Physics/common/SConscript
index 447b0ec1bbb..b9adbd7210a 100644
--- a/source/gameengine/Physics/common/SConscript
+++ b/source/gameengine/Physics/common/SConscript
@@ -5,10 +5,4 @@ sources = 'PHY_IMotionState.cpp PHY_IController.cpp PHY_IPhysicsController.cpp P
incs = '. ../Dummy #intern/moto/include'
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['core','player'], priority=[360, 90], cxx_compileflags = cxxflags )
+env.BlenderLib ( 'bf_physics_common', Split(sources), Split(incs), [], libtype=['core'], priority=[360], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py
index 46f00fa7ea6..d22b1690e74 100644
--- a/source/gameengine/PyDoc/GameLogic.py
+++ b/source/gameengine/PyDoc/GameLogic.py
@@ -52,7 +52,6 @@ Documentation for the GameLogic Module.
- L{ActionActuator<GameTypes.BL_ActionActuator>}
- L{AddObjectActuator<GameTypes.KX_SCA_AddObjectActuator>}
- L{CameraActuator<GameTypes.KX_CameraActuator>}
- - L{CDActuator<GameTypes.KX_CDActuator>}
- L{ConstraintActuator<GameTypes.KX_ConstraintActuator>}
- L{DynamicActuator<GameTypes.KX_SCA_DynamicActuator>}
- L{EndObjectActuator<GameTypes.KX_SCA_EndObjectActuator>}
@@ -448,14 +447,6 @@ def setPhysicsTicRate(ticrate):
@type ticrate: float
"""
-def EvalExpression(text):
- """
- Evaluate the string as an expression, similar to the expression controller logic brick.
- @param text: The expression to evaluate.
- @type text: string
- @return: The result of the expression. The type depends on the expression.
- """
-
#{ Utility functions
def getAverageFrameRate():
"""
diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py
index 6a554a7c42e..c391d0c3dec 100644
--- a/source/gameengine/PyDoc/GameTypes.py
+++ b/source/gameengine/PyDoc/GameTypes.py
@@ -12,7 +12,7 @@ Documentation for the GameTypes Module.
@group Sensors: SCA_ActuatorSensor, SCA_AlwaysSensor, SCA_DelaySensor, SCA_JoystickSensor, SCA_KeyboardSensor, KX_MouseFocusSensor, SCA_MouseSensor, KX_NearSensor, KX_NetworkMessageSensor, SCA_PropertySensor, KX_RadarSensor, SCA_RandomSensor, KX_RaySensor, KX_TouchSensor
-@group Actuators: SCA_2DFilterActuator, BL_ActionActuator, KX_SCA_AddObjectActuator, KX_CameraActuator, KX_CDActuator, KX_ConstraintActuator, KX_SCA_DynamicActuator, KX_SCA_EndObjectActuator, KX_GameActuator, KX_IpoActuator, KX_NetworkMessageActuator, KX_ObjectActuator, KX_ParentActuator, SCA_PropertyActuator, SCA_RandomActuator, KX_SCA_ReplaceMeshActuator, KX_SceneActuator, BL_ShapeActionActuator, KX_SoundActuator, KX_StateActuator, KX_TrackToActuator, KX_VisibilityActuator
+@group Actuators: SCA_2DFilterActuator, BL_ActionActuator, KX_SCA_AddObjectActuator, KX_CameraActuator, KX_ConstraintActuator, KX_SCA_DynamicActuator, KX_SCA_EndObjectActuator, KX_GameActuator, KX_IpoActuator, KX_NetworkMessageActuator, KX_ObjectActuator, KX_ParentActuator, SCA_PropertyActuator, SCA_RandomActuator, KX_SCA_ReplaceMeshActuator, KX_SceneActuator, BL_ShapeActionActuator, KX_SoundActuator, KX_StateActuator, KX_TrackToActuator, KX_VisibilityActuator
@group Controllers: SCA_ANDController, SCA_NANDController, SCA_NORController, SCA_ORController, SCA_PythonController, SCA_XNORController, SCA_XORController
"""
@@ -1023,12 +1023,6 @@ class CListValue(CPropValue):
Return the value matching key, or the default value if its not found.
@return: The key value or a default.
"""
- def has_key(key):
- """
- Return True if the key is found.
- @rtype: boolean
- @return: The key value or a default.
- """
def from_id(id):
"""
This is a funtion especially for the game engine to return a value with a spesific id.
@@ -1106,59 +1100,6 @@ class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial)
@return: the material's index
"""
-class KX_CDActuator(SCA_IActuator):
- """
- CD Controller actuator.
- @ivar volume: controls the volume to set the CD to. 0.0 = silent, 1.0 = max volume.
- @type volume: float
- @ivar track: the track selected to be played
- @type track: integer
- @ivar gain: the gain (volume) of the CD between 0.0 and 1.0.
- @type gain: float
- """
- def startCD():
- """
- Starts the CD playing.
- """
- def stopCD():
- """
- Stops the CD playing.
- """
- def pauseCD():
- """
- Pauses the CD.
- """
- def resumeCD():
- """
- Resumes the CD after a pause.
- """
- def playAll():
- """
- Plays the CD from the beginning.
- """
- def playTrack(trackNumber):
- """
- Plays the track selected.
- """
-#{ Deprecated
- def setGain(gain):
- """
- Sets the gain (volume) of the CD.
-
- @deprecated: Use the L{volume} property.
- @type gain: float
- @param gain: the gain to set the CD to. 0.0 = silent, 1.0 = max volume.
- """
- def getGain():
- """
- Gets the current gain (volume) of the CD.
-
- @deprecated: Use the L{volume} property.
- @rtype: float
- @return: Between 0.0 (silent) and 1.0 (max volume)
- """
-#}
-
class KX_CameraActuator(SCA_IActuator):
"""
Applies changes to a camera.
@@ -1635,17 +1576,21 @@ class KX_GameObject(SCA_IObject):
@ivar childrenRecursive: all children of this object including childrens children, (read-only).
@type childrenRecursive: L{CListValue} of L{KX_GameObject}'s
@group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh, getChildren, getChildrenRecursive
- @group Property Access: get, has_key, attrDict, getPropertyNames
+ @group Property Access: get, attrDict, getPropertyNames
"""
def endObject():
"""
Delete this object, can be used inpace of the EndObject Actuator.
The actual removal of the object from the scene is delayed.
"""
- def replaceMesh(mesh):
+ def replaceMesh(mesh, useDisplayMesh=True, usePhysicsMesh=False):
"""
Replace the mesh of this object with a new mesh. This works the same was as the actuator.
@type mesh: L{KX_MeshProxy} or mesh name
+ @type useDisplayMesh: bool
+ @param useDisplayMesh: when enabled the display mesh will be replaced (optional argument).
+ @type usePhysicsMesh: bool
+ @param usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument).
"""
def getVisible():
"""
@@ -2103,12 +2048,6 @@ class KX_GameObject(SCA_IObject):
Return the value matching key, or the default value if its not found.
@return: The key value or a default.
"""
- def has_key(key):
- """
- Return True if the key is found.
- @rtype: boolean
- @return: The key value or a default.
- """
class KX_IpoActuator(SCA_IActuator):
@@ -2468,6 +2407,8 @@ class KX_MouseFocusSensor(SCA_MouseSensor):
@type hitPosition: list (vector of 3 floats)
@ivar hitNormal: the worldspace normal from the face at point of intersection.
@type hitNormal: list (normalized vector of 3 floats)
+ @ivar usePulseFocus: When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set)
+ @type usePulseFocus: bool
"""
#{ Deprecated
def getHitNormal():
@@ -2529,7 +2470,7 @@ class KX_TouchSensor(SCA_ISensor):
@ivar useMaterial: Determines if the sensor is looking for a property or material.
KX_True = Find material; KX_False = Find property
@type useMaterial: boolean
- @ivar usePulseCollision: The last collided object.
+ @ivar usePulseCollision: When enabled, changes to the set of colliding objects generate a pulse.
@type usePulseCollision: bool
@ivar hitObject: The last collided object. (read-only)
@type hitObject: L{KX_GameObject} or None
@@ -3791,6 +3732,11 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator):
@ivar mesh: L{KX_MeshProxy} or the name of the mesh that will replace the current one
Set to None to disable actuator
@type mesh: L{KX_MeshProxy} or None if no mesh is set
+
+ @ivar useDisplayMesh: when true the displayed mesh is replaced.
+ @type useDisplayMesh: boolean
+ @ivar usePhysicsMesh: when true the physics mesh is replaced.
+ @type usePhysicsMesh: boolean
"""
def setMesh(name):
"""
@@ -3910,6 +3856,12 @@ class KX_Scene(PyObjectPlus):
@rtype: L{KX_GameObject}
"""
+
+ def get(key, default=None):
+ """
+ Return the value matching key, or the default value if its not found.
+ @return: The key value or a default.
+ """
class KX_SceneActuator(SCA_IActuator):
"""
@@ -5781,7 +5733,7 @@ for name, val in locals().items():
# Store the mappings to new attributes in a list (because there
# could be collisions).
- if not depAttrs.has_key(attrName):
+ if attrName not in depAttrs:
depAttrs[attrName] = {}
mapping = depAttrs[attrName]
@@ -5806,7 +5758,7 @@ for name, val in locals().items():
# Another mapping, from a conversion tuple to lists of class
# names.
conversion = (func, newAttrName)
- if not mapping.has_key(conversion):
+ if conversion not in mapping:
mapping[conversion] = []
mapping[conversion].append(name)
break
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h
index 6a420a974d4..99d4ea595ab 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h
@@ -30,6 +30,10 @@
#define MAX_RENDER_PASS 100
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class RAS_2DFilterManager
{
private:
@@ -97,5 +101,12 @@ public:
void RenderFilters(RAS_ICanvas* canvas);
void EnableFilter(vector<STR_String>& propNames, void* gameObj, RAS_2DFILTER_MODE mode, int pass, STR_String& text);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_2DFilterManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index 200b1c6c89f..8b3c4990a7a 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -126,10 +126,7 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList
RAS_MaterialBucket* bucket = *bit;
RAS_MeshSlot* ms;
// remove the mesh slot form the list, it culls them automatically for next frame
- for(ms = bucket->GetNextActiveMeshSlot();
- ms!= NULL;
- ms = bucket->GetNextActiveMeshSlot())
- {
+ while((ms = bucket->GetNextActiveMeshSlot())) {
slots[i++].set(ms, bucket, pnorm);
}
}
@@ -179,9 +176,7 @@ void RAS_BucketManager::RenderSolidBuckets(
RAS_MaterialBucket* bucket = *bit;
RAS_MeshSlot* ms;
// remove the mesh slot form the list, it culls them automatically for next frame
- for(ms = bucket->GetNextActiveMeshSlot();
- ms!= NULL;
- ms = bucket->GetNextActiveMeshSlot())
+ while((ms = bucket->GetNextActiveMeshSlot()))
{
rendertools->SetClientObject(rasty, ms->m_clientObj);
while (bucket->ActivateMaterial(cameratrans, rasty, rendertools))
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h
index 2b81ddd3c82..dcac41ab6e9 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.h
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.h
@@ -67,6 +67,12 @@ private:
RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
void RenderAlphaBuckets(const MT_Transform& cameratrans,
RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_BucketManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_BUCKETMANAGER
diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h
index 75c0dcd1eeb..6f4cd425c6c 100644
--- a/source/gameengine/Rasterizer/RAS_Deformer.h
+++ b/source/gameengine/Rasterizer/RAS_Deformer.h
@@ -37,6 +37,10 @@
#include <stdlib.h>
#include "GEN_Map.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
struct DerivedMesh;
class RAS_MeshObject;
@@ -82,6 +86,12 @@ public:
protected:
class RAS_MeshObject *m_pMesh;
bool m_bDynamic;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Deformer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h
index 4398e2d00c3..3ae794c430a 100644
--- a/source/gameengine/Rasterizer/RAS_FramingManager.h
+++ b/source/gameengine/Rasterizer/RAS_FramingManager.h
@@ -29,6 +29,10 @@
#ifndef RAS_FRAMINGMANAGER_H
#define RAS_FRAMINGMANAGER_H
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class RAS_Rect;
/**
@@ -55,7 +59,6 @@ class RAS_Rect;
class RAS_FrameSettings
{
public :
-
/**
* enum defining the policy to use
* in each axis.
@@ -154,6 +157,13 @@ private :
float m_bar_b;
unsigned int m_design_aspect_width;
unsigned int m_design_aspect_height;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FrameSettings"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
struct RAS_FrameFrustum
@@ -274,6 +284,13 @@ private :
RAS_FramingManager(
const RAS_FramingManager &
);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FramingManager"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h
index f3f817a943d..dae4fb3f4d2 100644
--- a/source/gameengine/Rasterizer/RAS_ICanvas.h
+++ b/source/gameengine/Rasterizer/RAS_ICanvas.h
@@ -33,6 +33,10 @@
* 2D rendering device context. The connection from 3d rendercontext to 2d surface.
*/
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class RAS_Rect;
@@ -173,6 +177,13 @@ public:
MakeScreenShot(
const char* filename
)=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ICanvas"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_ICANVAS
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
index 6af00d63c2d..033daabc48f 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
@@ -46,8 +46,7 @@ void RAS_IPolyMaterial::Initialize(
int mode,
int transp,
bool alpha,
- bool zsort,
- int lightlayer)
+ bool zsort)
{
m_texturename = texname;
m_materialname = matname;
@@ -59,7 +58,6 @@ void RAS_IPolyMaterial::Initialize(
m_transp = transp;
m_alpha = alpha;
m_zsort = zsort;
- //m_lightlayer = lightlayer;
m_polymatid = m_newpolymatid++;
m_flag = 0;
m_multimode = 0;
@@ -72,7 +70,6 @@ void RAS_IPolyMaterial::Initialize(
RAS_IPolyMaterial::RAS_IPolyMaterial()
: m_texturename("__Dummy_Texture_Name__"),
m_materialname("__Dummy_Material_Name__"),
- m_materialindex(0),
m_tile(0),
m_tilexrep(0),
m_tileyrep(0),
@@ -80,7 +77,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial()
m_transp(0),
m_alpha(false),
m_zsort(false),
- //m_lightlayer(0),
+ m_materialindex(0),
m_polymatid(0),
m_flag(0),
m_multimode(0)
@@ -100,11 +97,9 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname,
int mode,
int transp,
bool alpha,
- bool zsort,
- int lightlayer)
+ bool zsort)
: m_texturename(texname),
m_materialname(matname),
- m_materialindex(materialindex),
m_tile(tile),
m_tilexrep(tilexrep),
m_tileyrep(tileyrep),
@@ -112,7 +107,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname,
m_transp(transp),
m_alpha(alpha),
m_zsort(zsort),
- //m_lightlayer(lightlayer),
+ m_materialindex(materialindex),
m_polymatid(m_newpolymatid++),
m_flag(0),
m_multimode(0)
@@ -172,11 +167,6 @@ bool RAS_IPolyMaterial::Less(const RAS_IPolyMaterial& rhs) const
return m_polymatid < rhs.m_polymatid;
}
-//int RAS_IPolyMaterial::GetLightLayer() const
-//{
-// return m_lightlayer;
-//}
-
bool RAS_IPolyMaterial::IsAlpha() const
{
return m_alpha || m_zsort;
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
index e19db35ccb5..af909dfa731 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
@@ -38,6 +38,10 @@
#include "MT_Vector3.h"
#include "STR_HashedString.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class RAS_IRasterizer;
struct MTFace;
struct Material;
@@ -73,7 +77,6 @@ protected:
int m_transp;
bool m_alpha;
bool m_zsort;
- //int m_lightlayer;
int m_materialindex;
unsigned int m_polymatid;
@@ -83,7 +86,6 @@ protected:
unsigned int m_flag;//MaterialProps
int m_multimode; // sum of values
public:
-
MT_Vector3 m_diffuse;
float m_shininess;
MT_Vector3 m_specular;
@@ -110,8 +112,7 @@ public:
int mode,
int transp,
bool alpha,
- bool zsort,
- int lightlayer);
+ bool zsort);
void Initialize(const STR_String& texname,
const STR_String& matname,
int materialindex,
@@ -121,8 +122,7 @@ public:
int mode,
int transp,
bool alpha,
- bool zsort,
- int lightlayer);
+ bool zsort);
virtual ~RAS_IPolyMaterial() {};
/**
@@ -168,6 +168,13 @@ public:
* PreCalculate texture gen
*/
virtual void OnConstruction(int layer){}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IPolyMaterial"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
inline bool operator ==( const RAS_IPolyMaterial & rhs,const RAS_IPolyMaterial & lhs)
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index dc8c3c1ebf8..05406413941 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -43,6 +43,10 @@
#include <vector>
using namespace std;
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class RAS_ICanvas;
class RAS_IPolyMaterial;
@@ -57,7 +61,6 @@ typedef vector< KX_IndexArray* > vecIndexArrays;
class RAS_IRasterizer
{
public:
-
RAS_IRasterizer(RAS_ICanvas* canv){};
virtual ~RAS_IRasterizer(){};
/**
@@ -407,6 +410,13 @@ public:
virtual void SetBlendingMode(int blendmode)=0;
virtual void SetFrontFace(bool ccw)=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRasterizer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_IRASTERIZER
diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h
index 52f6397cf6c..5d52ddc9688 100644
--- a/source/gameengine/Rasterizer/RAS_IRenderTools.h
+++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h
@@ -36,6 +36,10 @@
#include <vector>
#include <algorithm>
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class RAS_IPolyMaterial;
struct RAS_LightObject;
@@ -180,6 +184,13 @@ public:
virtual
void
Render2DFilters(RAS_ICanvas* canvas)=0;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRenderTools"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_IRENDERTOOLS
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
index 8db75b8b735..dc9abbfbddf 100644
--- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h
+++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
@@ -79,8 +79,11 @@ class RAS_DisplayArray
public:
vector<RAS_TexVert> m_vertex;
vector<unsigned short> m_index;
+ /* LINE currently isnt used */
enum { LINE = 2, TRIANGLE = 3, QUAD = 4 } m_type;
//RAS_MeshSlot *m_origSlot;
+
+ /* Number of RAS_MeshSlot using this array */
int m_users;
enum { BUCKET_MAX_INDEX = 65535 };
@@ -169,6 +172,13 @@ public:
bool IsCulled() { return m_bCulled; }
#endif
void SetCulled(bool culled) { m_bCulled = culled; }
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshSlot"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
/* Used by RAS_MeshObject, to point to it's slots in a bucket */
@@ -179,6 +189,13 @@ public:
RAS_MeshSlot *m_baseslot;
class RAS_MaterialBucket *m_bucket;
GEN_Map<GEN_HashedPtr,RAS_MeshSlot*> m_slots;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshMaterial"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
/* Contains a list of display arrays with the same material,
@@ -232,6 +249,12 @@ private:
RAS_IPolyMaterial* m_material;
SG_DList m_activeMeshSlotsHead; // only those which must be rendered
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MaterialBucket"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_MATERIAL_BUCKET
diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp
index 0ae6ad9d7ea..0995d5acdd5 100644
--- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp
+++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp
@@ -90,9 +90,8 @@ struct RAS_MeshObject::fronttoback
STR_String RAS_MeshObject::s_emptyname = "";
-RAS_MeshObject::RAS_MeshObject(Mesh* mesh, int lightlayer)
- : //m_lightlayer(lightlayer),
- m_bModified(true),
+RAS_MeshObject::RAS_MeshObject(Mesh* mesh)
+ : m_bModified(true),
m_bMeshModified(true),
m_mesh(mesh),
m_bDeformed(false)
diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h
index bf9c0f7b682..1738423c4f3 100644
--- a/source/gameengine/Rasterizer/RAS_MeshObject.h
+++ b/source/gameengine/Rasterizer/RAS_MeshObject.h
@@ -55,7 +55,6 @@ class RAS_MeshObject
{
private:
unsigned int m_debugcolor;
- //int m_lightlayer;
bool m_bModified;
bool m_bMeshModified;
@@ -77,7 +76,7 @@ protected:
public:
// for now, meshes need to be in a certain layer (to avoid sorting on lights in realtime)
- RAS_MeshObject(Mesh* mesh, int lightlayer);
+ RAS_MeshObject(Mesh* mesh);
virtual ~RAS_MeshObject();
@@ -174,6 +173,13 @@ public:
};
vector<vector<SharedVertex> > m_sharedvertex_map;
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshObject"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_MESHOBJECT
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
index fe358808e4a..cff48081f02 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
@@ -66,6 +66,13 @@ public:
virtual void SetDrawingMode(int drawingmode);
virtual bool QueryLists(){return true;}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ListRasterizer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index e3422394e9e..db0f97bf46f 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -289,6 +289,13 @@ public:
virtual void SetBlendingMode(int blendmode);
virtual void SetFrontFace(bool ccw);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_OpenGLRasterizer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_OPENGLRASTERIZER
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
index 766bbfbed0e..6112c1a4d98 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
@@ -58,6 +58,12 @@ private:
//virtual bool QueryArrays(){return true;}
//virtual bool QueryLists(){return m_Lock;}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_VAOpenGLRasterizer"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__KX_VERTEXARRAYOPENGLRASTERIZER
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
index e206c90ea25..b1e5289c14c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
@@ -8,10 +8,4 @@ incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC']
incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel'
incs += ' #intern/guardedalloc #source/blender/blenlib'
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350, 115], cxx_compileflags = cxxflags )
+env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Rasterizer/RAS_Polygon.cpp b/source/gameengine/Rasterizer/RAS_Polygon.cpp
index eacc1285166..87c5118c5fb 100644
--- a/source/gameengine/Rasterizer/RAS_Polygon.cpp
+++ b/source/gameengine/Rasterizer/RAS_Polygon.cpp
@@ -31,6 +31,7 @@
#endif
#include "RAS_Polygon.h"
+#include "RAS_MeshObject.h" /* only for GetVertexOffsetAbs */
RAS_Polygon::RAS_Polygon(RAS_MaterialBucket* bucket, RAS_DisplayArray *darray, int numvert)
{
@@ -63,6 +64,20 @@ int RAS_Polygon::GetVertexOffset(int i)
return m_offset[i];
}
+int RAS_Polygon::GetVertexOffsetAbs(RAS_MeshObject *mesh, int i)
+{
+ /* hack that only works because there can only ever be 2 different
+ * GetDisplayArray's per mesh. if this uses a different display array to the first
+ * then its incices are offset.
+ * if support for edges is added back this would need to be changed. */
+ RAS_DisplayArray* darray= mesh->GetPolygon(0)->GetDisplayArray();
+
+ if(m_darray != darray)
+ return m_offset[i] + darray->m_vertex.size();
+
+ return m_offset[i];
+}
+
/*
int RAS_Polygon::GetEdgeCode()
{
diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h
index 41eaa6bdd4a..bd8cfe0be28 100644
--- a/source/gameengine/Rasterizer/RAS_Polygon.h
+++ b/source/gameengine/Rasterizer/RAS_Polygon.h
@@ -35,6 +35,10 @@
#include <vector>
using namespace std;
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/* polygon flags */
class RAS_Polygon
@@ -68,6 +72,7 @@ public:
void SetVertexOffset(int i, unsigned short offset);
int GetVertexOffset(int i);
+ int GetVertexOffsetAbs(RAS_MeshObject *mesh, int i); /* accounts for quad and tri arrays, slower, for python */
// each bit is for a visible edge, starting with bit 1 for the first edge, bit 2 for second etc.
// - Not used yet!
@@ -85,6 +90,12 @@ public:
RAS_MaterialBucket* GetMaterial();
RAS_DisplayArray* GetDisplayArray();
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Polygon"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/Rasterizer/RAS_Rect.h b/source/gameengine/Rasterizer/RAS_Rect.h
index 4cd0c636cfd..ca7435673c9 100644
--- a/source/gameengine/Rasterizer/RAS_Rect.h
+++ b/source/gameengine/Rasterizer/RAS_Rect.h
@@ -30,6 +30,10 @@
#ifndef _RAS_RECT
#define _RAS_RECT
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/**
* @section interface class.
* RAS_Rect just encodes a simple rectangle.
@@ -89,6 +93,12 @@ public:
{
m_y2 = y2;
}
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Rect"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif // _RAS_RECT
diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h
index 811867f3579..b93078f4712 100644
--- a/source/gameengine/Rasterizer/RAS_TexVert.h
+++ b/source/gameengine/Rasterizer/RAS_TexVert.h
@@ -34,6 +34,10 @@
#include "MT_Point2.h"
#include "MT_Transform.h"
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
static MT_Point3 g_pt3;
static MT_Point2 g_pt2;
@@ -134,6 +138,12 @@ public:
// compare two vertices, to test if they can be shared, used for
// splitting up based on uv's, colors, etc
bool closeTo(const RAS_TexVert* other);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_TexVert"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__RAS_TEXVERT
diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript
index 255131f9a44..064736bcc88 100644
--- a/source/gameengine/Rasterizer/SConscript
+++ b/source/gameengine/Rasterizer/SConscript
@@ -7,10 +7,4 @@ sources = env.Glob('*.cpp')
incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna'
incs += ' ' + env['BF_PYTHON_INC']
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,115], cxx_compileflags = cxxflags )
+env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/SceneGraph/SConscript b/source/gameengine/SceneGraph/SConscript
index b3db50117f1..79bf3033fa1 100644
--- a/source/gameengine/SceneGraph/SConscript
+++ b/source/gameengine/SceneGraph/SConscript
@@ -6,10 +6,4 @@ sources = env.Glob('*.cpp')
incs = '. #intern/moto/include'
-cxxflags = []
-if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
-
-env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core','player'], priority=[325,125], cxx_compileflags = cxxflags )
+env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core'], priority=[325], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h
index c39ad268e25..8dbb9869dae 100644
--- a/source/gameengine/SceneGraph/SG_BBox.h
+++ b/source/gameengine/SceneGraph/SG_BBox.h
@@ -38,6 +38,10 @@
#include <vector>
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
class SG_Node;
/**
@@ -128,6 +132,12 @@ public:
friend class SG_Tree;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_BBox"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif /* __SG_BBOX_H__ */
diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h
index c32885b915f..db9d7bdb464 100644
--- a/source/gameengine/SceneGraph/SG_Controller.h
+++ b/source/gameengine/SceneGraph/SG_Controller.h
@@ -40,6 +40,12 @@
class SG_Controller
{
public:
+
+#ifdef WITH_CXX_GUARDEDALLOC
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
+
SG_Controller(
) :
m_pObject(NULL) {
diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h
index 7bef13cc9e3..3e17fb55dc0 100644
--- a/source/gameengine/SceneGraph/SG_DList.h
+++ b/source/gameengine/SceneGraph/SG_DList.h
@@ -31,6 +31,10 @@
#include <stdlib.h>
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
/**
* Double circular linked list
*/
@@ -155,6 +159,13 @@ public:
{
return this;
}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_DList"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__SG_DLIST
diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h
index 8f448a0e890..23e6c1e9c99 100644
--- a/source/gameengine/SceneGraph/SG_IObject.h
+++ b/source/gameengine/SceneGraph/SG_IObject.h
@@ -160,8 +160,6 @@ private :
SGControllerList m_SGcontrollers;
public:
-
-
virtual ~SG_IObject();
@@ -338,6 +336,11 @@ protected :
);
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_IObject"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__SG_IOBJECT
diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h
index 7c6ef92f670..4281bcd11f6 100644
--- a/source/gameengine/SceneGraph/SG_Node.h
+++ b/source/gameengine/SceneGraph/SG_Node.h
@@ -40,7 +40,6 @@ typedef std::vector<SG_Node*> NodeList;
class SG_Node : public SG_Spatial
{
public:
-
SG_Node(
void* clientobj,
void* clientinfo,
@@ -260,6 +259,12 @@ private:
*/
SG_Node* m_SGparent;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Node"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__SG_NODE_H
diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h
index 8f45df09b27..a6a43c19115 100644
--- a/source/gameengine/SceneGraph/SG_ParentRelation.h
+++ b/source/gameengine/SceneGraph/SG_ParentRelation.h
@@ -55,7 +55,6 @@ class SG_Spatial;
class SG_ParentRelation {
public :
-
/**
* Update the childs local and global coordinates
* based upon the parents global coordinates.
@@ -128,6 +127,13 @@ protected :
SG_ParentRelation(
const SG_ParentRelation &
);
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_ParentRelation"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif
diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h
index d8afc33ea4f..6399111d80b 100644
--- a/source/gameengine/SceneGraph/SG_QList.h
+++ b/source/gameengine/SceneGraph/SG_QList.h
@@ -151,6 +151,13 @@ public:
{
return m_bqlink;
}
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_QList"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__SG_QLIST
diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h
index 6e274487c9d..a818c8c81f7 100644
--- a/source/gameengine/SceneGraph/SG_Spatial.h
+++ b/source/gameengine/SceneGraph/SG_Spatial.h
@@ -66,7 +66,6 @@ protected:
bool m_ogldirty; // true if the openGL matrix for this object must be recomputed
public:
-
inline void ClearModified()
{
m_modified = false;
@@ -284,6 +283,12 @@ protected:
bool& parentUpdated
);
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Spatial"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif //__SG_SPATIAL_H
diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h
index 4741af83aae..6ca3307920e 100644
--- a/source/gameengine/SceneGraph/SG_Tree.h
+++ b/source/gameengine/SceneGraph/SG_Tree.h
@@ -111,6 +111,13 @@ public:
}
};
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Tree"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
@@ -148,6 +155,12 @@ public:
SG_Tree* MakeTree();
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_TreeFactory"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
#endif /* __SG_BBOX_H__ */
diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt
index 9d1bb89d2ca..255d0907101 100644
--- a/source/gameengine/VideoTexture/CMakeLists.txt
+++ b/source/gameengine/VideoTexture/CMakeLists.txt
@@ -47,7 +47,6 @@ SET(INC
../../../intern/string
../../../intern/moto/include
../../../intern/guardedalloc
- ../../../intern/SoundSystem
../../../extern/glew/include
${PYTHON_INC}
)
diff --git a/source/gameengine/VideoTexture/Exception.cpp b/source/gameengine/VideoTexture/Exception.cpp
index 8704d49f2a7..35d335b5981 100644
--- a/source/gameengine/VideoTexture/Exception.cpp
+++ b/source/gameengine/VideoTexture/Exception.cpp
@@ -21,7 +21,7 @@ http://www.gnu.org/copyleft/lesser.txt.
*/
-#include <strstream>
+#include <sstream>
#include <fstream>
#include <PyObjectPlus.h>
@@ -170,11 +170,11 @@ void Exception::setXptDesc (void)
// length of result code
const size_t rsltSize = 11;
// delimit description
- const char delimRslt[] = ": ";
+ //const char delimRslt[] = ": ";
// set text of description
char rsltTxt[rsltSize];
- std::ostrstream os(rsltTxt, rsltSize);
- os << std::hex << m_hRslt << delimRslt << '\0';
+ std::ostringstream os;
+ os << std::hex << m_hRslt << ": " << '\0';
// copy result to description
m_desc.insert(0, rsltTxt);
// copy exception description to last exception string
diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.cpp b/source/gameengine/VideoTexture/FilterBlueScreen.cpp
index 6d26e5b6d35..2a624b2ccaa 100644
--- a/source/gameengine/VideoTexture/FilterBlueScreen.cpp
+++ b/source/gameengine/VideoTexture/FilterBlueScreen.cpp
@@ -135,13 +135,7 @@ static PyGetSetDef filterBSGetSets[] =
// define python type
PyTypeObject FilterBlueScreenType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterBlueScreen", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/FilterColor.cpp b/source/gameengine/VideoTexture/FilterColor.cpp
index eb86f520e02..e5d479747c4 100644
--- a/source/gameengine/VideoTexture/FilterColor.cpp
+++ b/source/gameengine/VideoTexture/FilterColor.cpp
@@ -41,13 +41,7 @@ static PyGetSetDef filterGrayGetSets[] =
// define python type
PyTypeObject FilterGrayType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterGray", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -178,13 +172,7 @@ static PyGetSetDef filterColorGetSets[] =
// define python type
PyTypeObject FilterColorType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterColor", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -317,13 +305,7 @@ static PyGetSetDef filterLevelGetSets[] =
// define python type
PyTypeObject FilterLevelType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterLevel", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/FilterNormal.cpp b/source/gameengine/VideoTexture/FilterNormal.cpp
index 002be6c3189..d755e6294c9 100644
--- a/source/gameengine/VideoTexture/FilterNormal.cpp
+++ b/source/gameengine/VideoTexture/FilterNormal.cpp
@@ -124,13 +124,7 @@ static PyGetSetDef filterNormalGetSets[] =
// define python type
PyTypeObject FilterNormalType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterNormal", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/FilterSource.cpp b/source/gameengine/VideoTexture/FilterSource.cpp
index 4c75e14bbac..4b67785edb3 100644
--- a/source/gameengine/VideoTexture/FilterSource.cpp
+++ b/source/gameengine/VideoTexture/FilterSource.cpp
@@ -36,13 +36,7 @@ http://www.gnu.org/copyleft/lesser.txt.
// define python type
PyTypeObject FilterRGB24Type =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterRGB24", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -87,13 +81,7 @@ PyTypeObject FilterRGB24Type =
// define python type
PyTypeObject FilterRGBA32Type =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterRGBA32", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -138,13 +126,7 @@ PyTypeObject FilterRGBA32Type =
// define python type
PyTypeObject FilterBGR24Type =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.FilterBGR24", /*tp_name*/
sizeof(PyFilter), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp
index 5e2841271a6..0740afed2c6 100644
--- a/source/gameengine/VideoTexture/ImageBase.cpp
+++ b/source/gameengine/VideoTexture/ImageBase.cpp
@@ -219,15 +219,17 @@ bool ImageBase::checkSourceSizes (void)
// get size of current source
short * curSize = (*it)->getSize();
// if size is available and is not empty
- if (curSize[0] != 0 && curSize[1] != 0)
+ if (curSize[0] != 0 && curSize[1] != 0) {
// if reference size is not set
- if (refSize == NULL)
+ if (refSize == NULL) {
// set current size as reference
refSize = curSize;
// otherwise check with current size
- else if (curSize[0] != refSize[0] || curSize[1] != refSize[1])
+ } else if (curSize[0] != refSize[0] || curSize[1] != refSize[1]) {
// if they don't match, report it
return false;
+ }
+ }
}
// all sizes match
return true;
diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp
index c7185660e83..9cd661a2422 100644
--- a/source/gameengine/VideoTexture/ImageBuff.cpp
+++ b/source/gameengine/VideoTexture/ImageBuff.cpp
@@ -122,13 +122,7 @@ static PyGetSetDef imageBuffGetSets[] =
// define python type
PyTypeObject ImageBuffType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.ImageBuff", /*tp_name*/
sizeof(PyImage), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/ImageMix.cpp b/source/gameengine/VideoTexture/ImageMix.cpp
index 067143e57bb..2560467c3db 100644
--- a/source/gameengine/VideoTexture/ImageMix.cpp
+++ b/source/gameengine/VideoTexture/ImageMix.cpp
@@ -166,13 +166,7 @@ static PyGetSetDef imageMixGetSets[] =
// define python type
PyTypeObject ImageMixType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.ImageMix", /*tp_name*/
sizeof(PyImage), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index d8be08e0eb5..6e70bfb14a0 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -376,13 +376,7 @@ static PyGetSetDef imageRenderGetSets[] =
// define python type
PyTypeObject ImageRenderType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.ImageRender", /*tp_name*/
sizeof(PyImage), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -715,13 +709,7 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj
// define python type
PyTypeObject ImageMirrorType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.ImageMirror", /*tp_name*/
sizeof(PyImage), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp
index 55b14396280..691a983970a 100644
--- a/source/gameengine/VideoTexture/ImageViewport.cpp
+++ b/source/gameengine/VideoTexture/ImageViewport.cpp
@@ -289,13 +289,7 @@ static PyGetSetDef imageViewportGetSets[] =
// define python type
PyTypeObject ImageViewportType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.ImageViewport", /*tp_name*/
sizeof(PyImage), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/Makefile b/source/gameengine/VideoTexture/Makefile
index 8677ed5c177..90457df720f 100644
--- a/source/gameengine/VideoTexture/Makefile
+++ b/source/gameengine/VideoTexture/Makefile
@@ -42,7 +42,6 @@ CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
CPPFLAGS += -I../../blender/python
CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../Rasterizer/RAS_OpenGLRasterizer
CPPFLAGS += -I../Rasterizer -I../GameLogic -I../SceneGraph
diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript
index fdf46f70ad7..0b35c019178 100644
--- a/source/gameengine/VideoTexture/SConscript
+++ b/source/gameengine/VideoTexture/SConscript
@@ -12,19 +12,13 @@ incs += ' #source/gameengine/BlenderRoutines'
incs += ' #source/blender/editors/include #source/blender/blenlib #source/blender/blenkernel'
incs += ' #source/blender/makesdna #source/blender/imbuf #source/blender/python'
incs += ' #source/blender/gpu #source/kernel/gen_system #intern/string #intern/moto/include'
-incs += ' #intern/guardedalloc #intern/SoundSystem'
-incs += ' #extern/glew/include'
+incs += ' #intern/guardedalloc #extern/glew/include'
defs = []
-cxxflags = []
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
- cxxflags.append ('/GR')
- cxxflags.append ('/O2')
- cxxflags.append ('/EHsc')
if env['BF_DEBUG']:
defs.append('_DEBUG')
-
incs += ' ' + env['BF_PYTHON_INC']
#incs += ' ' + env['BF_OPENGL_INC']
@@ -33,4 +27,4 @@ if env['WITH_BF_FFMPEG']:
incs += ' ' + env['BF_FFMPEG_INC'] + ' ' + env['BF_PTHREADS_INC']
defs.append('__STDC_CONSTANT_MACROS')
-env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300, 72], cxx_compileflags = cxxflags )
+env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core'], priority=[300], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp
index f4105652f80..04b39f0b05c 100644
--- a/source/gameengine/VideoTexture/Texture.cpp
+++ b/source/gameengine/VideoTexture/Texture.cpp
@@ -434,13 +434,7 @@ static PyGetSetDef textureGetSets[] =
// class Texture declaration
PyTypeObject TextureType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.Texture", /*tp_name*/
sizeof(Texture), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index cf4ea88c1b5..f21555a95c9 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -1160,13 +1160,7 @@ static PyGetSetDef videoGetSets[] =
// python type declaration
PyTypeObject VideoFFmpegType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.VideoFFmpeg", /*tp_name*/
sizeof(PyImage), /*tp_basicsize*/
0, /*tp_itemsize*/
@@ -1284,13 +1278,7 @@ static PyGetSetDef imageGetSets[] =
// python type declaration
PyTypeObject ImageFFmpegType =
{
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"VideoTexture.ImageFFmpeg", /*tp_name*/
sizeof(PyImage), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp
index 22171f69321..998d63506b0 100644
--- a/source/gameengine/VideoTexture/blendVideoTex.cpp
+++ b/source/gameengine/VideoTexture/blendVideoTex.cpp
@@ -159,8 +159,6 @@ static void registerAllTypes(void)
pyFilterTypes.add(&FilterBGR24Type, "FilterBGR24");
}
-
-#if (PY_VERSION_HEX >= 0x03000000)
static struct PyModuleDef VideoTexture_module_def = {
{}, /* m_base */
"VideoTexture", /* m_name */
@@ -172,7 +170,6 @@ static struct PyModuleDef VideoTexture_module_def = {
0, /* m_clear */
0, /* m_free */
};
-#endif
PyObject* initVideoTexture(void)
{
@@ -202,14 +199,8 @@ PyObject* initVideoTexture(void)
else {
PyErr_Clear();
-#if (PY_VERSION_HEX >= 0x03000000)
m = PyModule_Create(&VideoTexture_module_def);
PyDict_SetItemString(PySys_GetObject("modules"), VideoTexture_module_def.m_name, m);
-#else
- m = Py_InitModule4("VideoTexture", moduleMethods,
- "Module that allows to play video files on textures in GameBlender.",
- (PyObject*)NULL,PYTHON_API_VERSION);
-#endif
}
if (m == NULL)
diff --git a/source/icons/SConscript b/source/icons/SConscript
index 1471a06c09d..c929729f05b 100644
--- a/source/icons/SConscript
+++ b/source/icons/SConscript
@@ -3,4 +3,4 @@ Import ('env')
source = 'winblender.rcscons'
-env.BlenderRes('winresource', source, ['core', 'player'], priority=[95 , 100]) \ No newline at end of file
+env.BlenderRes('winresource', source, ['core'], priority=[95])
diff --git a/source/kernel/SConscript b/source/kernel/SConscript
index 908e059ceab..746fb60d4ff 100644
--- a/source/kernel/SConscript
+++ b/source/kernel/SConscript
@@ -7,4 +7,4 @@ sources += ' gen_system/SYS_System.cpp'
incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include #/source/blender/blenloader '
-env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core', 'player'], priority = [400, 150] )
+env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core'], priority = [400] )
diff --git a/source/kernel/gen_system/SYS_SingletonSystem.cpp b/source/kernel/gen_system/SYS_SingletonSystem.cpp
index 47e35cf84d8..43d70a94ae1 100644
--- a/source/kernel/gen_system/SYS_SingletonSystem.cpp
+++ b/source/kernel/gen_system/SYS_SingletonSystem.cpp
@@ -95,6 +95,6 @@ void SYS_SingletonSystem::SYS_WriteCommandLineString(const char *paramname, cons
m_string_commandlineparms.insert(paramname, value);
}
-SYS_SingletonSystem::SYS_SingletonSystem() : m_soundfilecache(NULL)
+SYS_SingletonSystem::SYS_SingletonSystem()
{
}
diff --git a/source/kernel/gen_system/SYS_SingletonSystem.h b/source/kernel/gen_system/SYS_SingletonSystem.h
index 175656ac4ed..b72070c4e23 100644
--- a/source/kernel/gen_system/SYS_SingletonSystem.h
+++ b/source/kernel/gen_system/SYS_SingletonSystem.h
@@ -56,7 +56,6 @@ private:
GEN_Map<STR_HashedString,int> m_int_commandlineparms;
GEN_Map<STR_HashedString,float> m_float_commandlineparms;
GEN_Map<STR_HashedString,STR_String> m_string_commandlineparms;
- void* m_soundfilecache;
};
#endif //__SINGLETONSYSTEM_H
diff --git a/source/nan_compile.mk b/source/nan_compile.mk
index bc264fe5c1d..c62b4f2681b 100644
--- a/source/nan_compile.mk
+++ b/source/nan_compile.mk
@@ -39,11 +39,9 @@ CPPFLAGS ?= $(NAN_CPPFLAGS)
# Uncomment next lines to enable integrated game engine
ifneq ($(NAN_NO_KETSJI), true)
CFLAGS += -DGAMEBLENDER=1
- CFLAGS += -DUSE_SUMO_SOLID
- CCFLAGS += -DUSE_SUMO_SOLID
ifeq ($(NAN_USE_BULLET), true)
- CFLAGS += -DUSE_BULLET -DWITH_BULLET
- CCFLAGS += -DUSE_BULLET -DWITH_BULLET
+ CFLAGS += -DUSE_BULLET
+ CCFLAGS += -DUSE_BULLET
endif
else
CPPFLAGS += -DNO_KETSJI
diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk
index fc0f3a7aa19..f8afc7f3fa6 100644
--- a/source/nan_definitions.mk
+++ b/source/nan_definitions.mk
@@ -81,24 +81,15 @@ ifndef CONFIG_GUESS
endif
export NAN_MOTO ?= $(LCGDIR)/moto
-ifeq ($(FREE_WINDOWS), true)
- export NAN_SOLID ?= $(LCGDIR)/gcc/solid
- export NAN_QHULL ?= $(LCGDIR)/gcc/qhull
-else
- export NAN_SOLID ?= $(LCGDIR)/solid
- export NAN_QHULL ?= $(LCGDIR)/qhull
-endif
export BF_PROFILE ?= false
export NAN_USE_BULLET ?= true
export NAN_BULLET2 ?= $(LCGDIR)/bullet2
- export NAN_FUZZICS ?= $(SRCHOME)/gameengine/Physics/Sumo/Fuzzics
- export NAN_BLENKEY ?= $(LCGDIR)/blenkey
export NAN_DECIMATION ?= $(LCGDIR)/decimation
export NAN_GUARDEDALLOC ?= $(LCGDIR)/guardedalloc
export NAN_IKSOLVER ?= $(LCGDIR)/iksolver
export NAN_BSP ?= $(LCGDIR)/bsp
export NAN_BOOLOP ?= $(LCGDIR)/boolop
- export NAN_SOUNDSYSTEM ?= $(LCGDIR)/SoundSystem
+ export NAN_AUDASPACE ?= $(LCGDIR)/audaspace
export NAN_STRING ?= $(LCGDIR)/string
export NAN_MEMUTIL ?= $(LCGDIR)/memutil
export NAN_CONTAINER ?= $(LCGDIR)/container
@@ -107,6 +98,7 @@ endif
export NAN_TEST_VERBOSITY ?= 1
export NAN_OPENNL ?= $(LCGDIR)/opennl
export NAN_ELBEEM ?= $(LCGDIR)/elbeem
+ export NAN_SMOKE ?= $(LCGDIR)/smoke
export NAN_SUPERLU ?= $(LCGDIR)/superlu
export NAN_GLEW ?= $(LCGDIR)/glew
ifeq ($(FREE_WINDOWS), true)
@@ -121,7 +113,29 @@ endif
export WITH_OPENEXR ?= true
export WITH_DDS ?= true
export WITH_OPENJPEG ?= true
+ export WITH_LZO ?= true
+ export WITH_LZMA ?= true
+ export NAN_LZO ?= $(LCGDIR)/lzo
+ export NAN_LZMA ?= $(LCGDIR)/lzma
+ export WITH_OPENAL ?= false
+ export WITH_JACK ?= false
+ export WITH_SNDFILE ?= false
+
+ ifeq ($(WITH_OPENAL), true)
+ export NAN_OPENAL ?= /usr
+ endif
+ ifeq ($(WITH_JACK), true)
+ export NAN_JACK ?= /usr
+ export NAN_JACKCFLAGS ?= -I$(NAN_JACK)/include/jack
+ export NAN_JACKLIBS ?= $(NAN_JACK)/lib/libjack.a
+ endif
+
+ ifeq ($(WITH_SNDFILE),true)
+ export NAN_SNDFILE ?= /usr
+ export NAN_SNDFILECFLAGS ?= -I$(NAN_SNDFILE)/include
+ export NAN_SNDFILELIBS ?= $(NAN_SNDFILE)/lib/libsndfile.a $(NAN_SNDFILE)/lib/libFLAC.a $(NAN_SNDFILE)/lib/libogg.a
+ endif
ifeq ($(NAN_USE_FFMPEG_CONFIG), true)
export NAN_FFMPEG ?= $(shell ffmpeg-config --prefix)
@@ -135,25 +149,30 @@ endif
export ID = $(shell whoami)
export HOST = $(shell hostname -s)
- export PY_FRAMEWORK ?= 1
+ export NAN_PYTHON_VERSION = 3.1
- ifdef PY_FRAMEWORK
- export NAN_PYTHON ?= /System/Library/Frameworks/Python.framework/Versions/2.3
- export NAN_PYTHON_VERSION ?= 2.3
- export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
- export NAN_PYTHON_LIB ?= -framework Python
+ ifeq ($(NAN_PYTHON_VERSION),3.1)
+ export PY_FRAMEWORK ?= 0
+ export NAN_PYTHON ?= $(LCGDIR)/python
+ export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/libpython$(NAN_PYTHON_VERSION).a
else
- export NAN_PYTHON ?= /sw
- export NAN_PYTHON_VERSION ?= 2.3
- export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
- export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
+ export PY_FRAMEWORK ?= 1
+ ifdef PY_FRAMEWORK
+ export NAN_PYTHON ?= /System/Library/Frameworks/Python.framework/Versions/2.5
+ export NAN_PYTHON_VERSION ?= 2.5
+ export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
+ export NAN_PYTHON_LIB ?= -framework Python
+ else
+ export NAN_PYTHON ?= /sw
+ export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
+ export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
+ endif
endif
export NAN_OPENAL ?= $(LCGDIR)/openal
export NAN_JPEG ?= $(LCGDIR)/jpeg
export NAN_PNG ?= $(LCGDIR)/png
export NAN_TIFF ?= $(LCGDIR)/tiff
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
export NAN_MESA ?= /usr/src/Mesa-3.1
export NAN_ZLIB ?= $(LCGDIR)/zlib
@@ -170,20 +189,14 @@ endif
export NAN_OPENEXR ?= $(LCGDIR)/openexr
export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/OpenEXR
- ifeq ($(CPU),powerpc)
- export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a
- else
- export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a
- endif
-
- # export NAN_NO_KETSJI=true
+ export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a
+
+ export NAN_NO_KETSJI=false
ifeq ($(CPU), i386)
- export NAN_NO_OPENAL=true
+ export WITH_OPENAL=false
endif
- # Uncomment the following line to use Mozilla inplace of netscape
- # CPPFLAGS +=-DMOZ_NOT_NET
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -200,6 +213,9 @@ endif
# enable l10n
export INTERNATIONAL ?= true
+ export NAN_SAMPLERATE ?= $(LCGDIR)/samplerate
+ export NAN_SAMPLERATE_LIBS ?= $(NAN_SAMPLERATE)/lib/libsamplerate.a
+
else
ifeq ($(OS),freebsd)
@@ -208,14 +224,13 @@ endif
export FREEDESKTOP ?= true
export NAN_PYTHON ?= /usr/local
- export NAN_PYTHON_VERSION ?= 2.5
+ export NAN_PYTHON_VERSION ?= 3.1
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
export NAN_OPENAL ?= /usr/local
export NAN_JPEG ?= /usr/local
export NAN_PNG ?= /usr/local
export NAN_TIFF ?= /usr/local
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
export NAN_MESA ?= /usr/src/Mesa-3.1
export NAN_ZLIB ?= /usr
@@ -226,8 +241,6 @@ endif
export NAN_SDLLIBS ?= $(shell sdl-config --libs)
export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
- # Uncomment the following line to use Mozilla inplace of netscape
- # CPPFLAGS +=-DMOZ_NOT_NET
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -248,7 +261,7 @@ endif
export HOST = $(shell /usr/bsd/hostname -s)
#export NAN_NO_KETSJI=true
export NAN_JUST_BLENDERDYNAMIC=true
- export NAN_PYTHON_VERSION ?= 2.5
+ export NAN_PYTHON_VERSION ?= 3.1
ifeq ($(IRIX_USE_GCC), true)
export NAN_PYTHON ?= $(LCGDIR)/python_gcc
else
@@ -260,7 +273,6 @@ endif
export NAN_JPEG ?= $(LCGDIR)/jpeg
export NAN_PNG ?= $(LCGDIR)/png
export NAN_TIFF ?= $(LCGDIR)/tiff
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
export NAN_MESA ?= /usr/src/Mesa-3.1
export NAN_ZLIB ?= $(LCGDIR)/zlib
@@ -284,8 +296,6 @@ endif
export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/OpenEXR
export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a
- # Uncomment the following line to use Mozilla inplace of netscape
- # CPPFLAGS +=-DMOZ_NOT_NET
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -307,14 +317,14 @@ endif
export FREEDESKTOP ?= true
export NAN_PYTHON ?= /usr
- export NAN_PYTHON_VERSION ?= 2.6
+ export NAN_PYTHON_VERSION ?= 3.1
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
- export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
+ # Next line if for static python, nan_link.mk uses -lpython$(NAN_PYTHON_VERSION)
+ #export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
export NAN_OPENAL ?= /usr
export NAN_JPEG ?= /usr
export NAN_PNG ?= /usr
export NAN_TIFF ?= /usr
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
export NAN_MESA ?= /usr
export NAN_ZLIB ?= /usr
@@ -324,6 +334,7 @@ endif
export NAN_SDL ?= $(shell sdl-config --prefix)
export NAN_SDLLIBS ?= $(shell sdl-config --libs)
export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
+ export NAN_SAMPLERATE ?= /usr
ifneq ($(NAN_USE_FFMPEG_CONFIG), true)
export NAN_FFMPEG ?= /usr
@@ -338,7 +349,7 @@ endif
endif
# Uncomment the following line to use Mozilla inplace of netscape
- export CPPFLAGS += -DMOZ_NOT_NET
+
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= /usr/include/mozilla
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -367,14 +378,13 @@ endif
export FREEDESKTOP ?= true
export NAN_PYTHON ?= $(LCGDIR)/python
- export NAN_PYTHON_VERSION ?= 2.3
+ export NAN_PYTHON_VERSION ?= 3.1
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
export NAN_OPENAL ?= $(LCGDIR)/openal
export NAN_JPEG ?= $(LCGDIR)/jpeg
export NAN_PNG ?= $(LCGDIR)/png
export NAN_TIFF ?= $(LCGDIR)/tiff
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
export NAN_MESA ?= /usr/src/Mesa-3.1
export NAN_ZLIB ?= $(LCGDIR)/zlib
@@ -385,8 +395,6 @@ endif
export NAN_SDLLIBS ?= $(shell sdl-config --libs)
export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
- # Uncomment the following line to use Mozilla inplace of netscape
- # CPPFLAGS +=-DMOZ_NOT_NET
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -406,14 +414,13 @@ endif
export ID = $(shell /usr/ucb/whoami)
export HOST = $(shell hostname)
export NAN_PYTHON ?= $(LCGDIR)/python
- export NAN_PYTHON_VERSION ?= 2.5
+ export NAN_PYTHON_VERSION ?= 3.1
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
export NAN_OPENAL ?= $(LCGDIR)/openal
export NAN_JPEG ?= $(LCGDIR)/jpeg
export NAN_PNG ?= $(LCGDIR)/png
export NAN_TIFF ?= /usr
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?=
export NAN_MESA ?= /usr/X11
export NAN_ZLIB ?= $(LCGDIR)/zlib
@@ -430,8 +437,6 @@ endif
export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/OpenEXR
export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a -lrt
- # Uncomment the following line to use Mozilla inplace of netscape
- # CPPFLAGS +=-DMOZ_NOT_NET
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -451,7 +456,7 @@ endif
export ID = $(LOGNAME)
export NAN_PYTHON ?= $(LCGDIR)/python
export NAN_ICONV ?= $(LCGDIR)/iconv
- export NAN_PYTHON_VERSION ?= 2.5
+ export NAN_PYTHON_VERSION ?= 3.1
export NAN_OPENAL ?= $(LCGDIR)/openal
export NAN_JPEG ?= $(LCGDIR)/jpeg
export NAN_PNG ?= $(LCGDIR)/png
@@ -466,7 +471,6 @@ endif
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/lib25_vs2005/libpython25.a
export NAN_FREETYPE ?= $(LCGDIR)/gcc/freetype
- export NAN_ODE ?= $(LCGDIR)/gcc/ode
export NAN_SDL ?= $(LCGDIR)/gcc/sdl
export NAN_OPENEXR ?= $(LCGDIR)/gcc/openexr
export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/OpenEXR
@@ -477,7 +481,6 @@ endif
export NAN_PYTHON_BINARY ?= python
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python23.lib
export NAN_FREETYPE ?= $(LCGDIR)/freetype
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_SDL ?= $(LCGDIR)/sdl
export NAN_OPENEXR ?= $(LCGDIR)/openexr
export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/IlmImf -I$(NAN_OPENEXR)/include/Imath -I$(NAN_OPENEXR)/include/Iex
@@ -486,8 +489,7 @@ endif
export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include
export NAN_WINTAB ?= $(LCGDIR)/wintab
- # Uncomment the following line to use Mozilla inplace of netscape
- # CPPFLAGS +=-DMOZ_NOT_NET
+
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -507,7 +509,7 @@ endif
else # Platform not listed above
export NAN_PYTHON ?= $(LCGDIR)/python
- export NAN_PYTHON_VERSION ?= 2.3
+ export NAN_PYTHON_VERSION ?= 3.1
export NAN_PYTHON_BINARY ?= python
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
@@ -516,7 +518,6 @@ endif
export NAN_PNG ?= $(LCGDIR)/png
export NAN_TIFF ?= $(LCGDIR)/tiff
export NAN_SDL ?= $(LCGDIR)/sdl
- export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
export NAN_MESA ?= /usr/src/Mesa-3.1
export NAN_ZLIB ?= $(LCGDIR)/zlib
@@ -527,8 +528,6 @@ endif
export NAN_SDLLIBS ?= $(shell sdl-config --libs)
export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
- # Uncomment the following line to use Mozilla inplace of netscape
- # CPPFLAGS +=-DMOZ_NOT_NET
# Location of MOZILLA/Netscape header files...
export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include
export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/
@@ -555,5 +554,4 @@ endif # CONFIG_GUESS
# Don't want to build the gameengine?
ifeq ($(NAN_NO_KETSJI), true)
export NAN_JUST_BLENDERDYNAMIC=true
- export NAN_NO_OPENAL=true
endif
diff --git a/source/nan_link.mk b/source/nan_link.mk
index 63c9a578498..7211ba21e48 100644
--- a/source/nan_link.mk
+++ b/source/nan_link.mk
@@ -36,7 +36,7 @@ ifdef NAN_DEBUG
LDFLAGS += $(NAN_DEBUG)
endif
-DBG_LDFLAGS += -g
+DBG_LDFLAGS += -g
ifneq (x$(DEBUG_DIR), x)
LDFLAGS+=$(DBG_LDFLAGS)
@@ -97,7 +97,7 @@ ifeq ($(OS),linux)
COMMENT = "MESA 3.1"
LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
LLIBS += -lutil -lc -lm -ldl -lpthread
-# LLIBS += -L$(NAN_ODE)/lib -lode
+ LLIBS += -lpython$(NAN_PYTHON_VERSION)
LOPTS = -export-dynamic
DADD = -lGL -lGLU
SADD = $(NAN_MESA)/lib/libGL.a $(NAN_MESA)/lib/libGLU.a
@@ -126,28 +126,28 @@ endif
ifeq ($(OS),windows)
EXT = .exe
- SOEXT = .dll
- ifeq ($(FREE_WINDOWS),true)
- MINGWLIB = /usr/lib/w32api
- LDFLAGS += -mwindows -mno-cygwin -mconsole
- DADD += -L/usr/lib/w32api -lnetapi32 -lopengl32 -lglu32 -lshfolder
- DADD += -L/usr/lib/w32api -lwinmm -lwsock32
+ SOEXT = .dll
+ ifeq ($(FREE_WINDOWS),true)
+ MINGWLIB = /usr/lib/w32api
+ LDFLAGS += -mwindows -mno-cygwin -mconsole
+ DADD += -L/usr/lib/w32api -lnetapi32 -lopengl32 -lglu32 -lshfolder
+ DADD += -L/usr/lib/w32api -lwinmm -lwsock32
else
- DADD = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
- DADD += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
- DADD += vfw32.lib winmm.lib opengl32.lib glu32.lib largeint.lib dxguid.lib
- DADD += libcmt.lib
- LOPTS = /link
- LOPTS += /NODEFAULTLIB:"libc"
- LOPTS += /NODEFAULTLIB:"libcd"
- LOPTS += /NODEFAULTLIB:"libcp"
- LOPTS += /NODEFAULTLIB:"libcpd"
- LOPTS += /NODEFAULTLIB:"python20"
- LOPTS += /NODEFAULTLIB:"msvcrt"
- LOPTS += /SUBSYSTEM:CONSOLE
- LDFLAGS += /MT
- DYNLDFLAGS = /LD
- endif
+ DADD = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
+ DADD += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
+ DADD += vfw32.lib winmm.lib opengl32.lib glu32.lib largeint.lib dxguid.lib
+ DADD += libcmt.lib
+ LOPTS = /link
+ LOPTS += /NODEFAULTLIB:"libc"
+ LOPTS += /NODEFAULTLIB:"libcd"
+ LOPTS += /NODEFAULTLIB:"libcp"
+ LOPTS += /NODEFAULTLIB:"libcpd"
+ LOPTS += /NODEFAULTLIB:"python20"
+ LOPTS += /NODEFAULTLIB:"msvcrt"
+ LOPTS += /SUBSYSTEM:CONSOLE
+ LDFLAGS += /MT
+ DYNLDFLAGS = /LD
+ endif
endif
ifneq ($(OS), irix)
diff --git a/tools/Blender.py b/tools/Blender.py
index 8432541b673..10ce35f98b7 100644
--- a/tools/Blender.py
+++ b/tools/Blender.py
@@ -101,7 +101,10 @@ def create_blender_liblist(lenv = None, libtype = None):
sortlist.sort()
for sk in sortlist:
v = curlib[sk]
- target = os.path.abspath(os.getcwd() + os.sep + root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
+ if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
+ target = os.path.abspath(os.getcwd() + os.sep + root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
+ else:
+ target = os.path.abspath(root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
lst.append(target)
return lst
@@ -117,6 +120,7 @@ def setup_staticlibs(lenv):
lenv['BF_JPEG_LIBPATH'],
lenv['BF_PNG_LIBPATH'],
lenv['BF_ZLIB_LIBPATH'],
+ lenv['BF_LIBSAMPLERATE_LIBPATH'],
lenv['BF_ICONV_LIBPATH']
]
@@ -127,10 +131,16 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_SDL_LIBPATH'])
if lenv['WITH_BF_FFMPEG']:
libincs += Split(lenv['BF_FFMPEG_LIBPATH'])
+ if lenv['WITH_BF_JACK']:
+ libincs += Split(lenv['BF_JACK_LIBPATH'])
+ if lenv['WITH_BF_SNDFILE']:
+ libincs += Split(lenv['BF_SNDFILE_LIBPATH'])
if lenv['WITH_BF_OPENEXR']:
libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
if lenv['WITH_BF_STATICOPENEXR']:
statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
+ if lenv['WITH_BF_FFTW3']:
+ libincs += Split(lenv['BF_FFTW3_LIBPATH'])
if lenv['WITH_BF_INTERNATIONAL']:
libincs += Split(lenv['BF_GETTEXT_LIBPATH'])
if lenv['WITH_BF_OPENAL']:
@@ -162,7 +172,8 @@ def setup_syslibs(lenv):
lenv['BF_JPEG_LIB'],
lenv['BF_PNG_LIB'],
- lenv['BF_ZLIB_LIB']
+ lenv['BF_ZLIB_LIB'],
+ lenv['BF_LIBSAMPLERATE_LIB']
]
syslibs += Split(lenv['BF_FREETYPE_LIB'])
@@ -190,6 +201,12 @@ def setup_syslibs(lenv):
syslibs += Split(lenv['BF_FFMPEG_LIB'])
if lenv['WITH_BF_OGG']:
syslibs += Split(lenv['BF_OGG_LIB'])
+ if lenv['WITH_BF_JACK']:
+ syslibs += Split(lenv['BF_JACK_LIB'])
+ if lenv['WITH_BF_SNDFILE']:
+ syslibs += Split(lenv['BF_SNDFILE_LIB'])
+ if lenv['WITH_BF_FFTW3']:
+ syslibs += Split(lenv['BF_FFTW3_LIB'])
if lenv['WITH_BF_SDL']:
syslibs += Split(lenv['BF_SDL_LIB'])
if not lenv['WITH_BF_STATICOPENGL']:
@@ -385,6 +402,48 @@ def AppIt(target=None, source=None, env=None):
cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(builddir, binary)
commands.getoutput(cmd)
+# extract copy system python, be sure to update other build systems
+# when making changes to the files that are copied.
+def my_pyinst_print(target, source, env):
+ pass
+
+def PyInstall(target=None, source=None, env=None):
+ # Any Unix except osx
+ #-- .blender/python/lib/python3.1
+
+ import commands
+
+ def run(cmd):
+ print 'Install command:', cmd
+ commands.getoutput(cmd)
+
+ py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
+ py_target = env.subst( env['BF_INSTALLDIR'] + '/.blender/python/lib/python'+env['BF_PYTHON_VERSION'] )
+
+ # Copied from source/creator/CMakeLists.txt, keep in sync.
+ print 'Install python from:'
+ print '\t"%s" into...' % py_src
+ print '\t"%s"\n' % py_target
+
+ run('rm -rf "%s"' % py_target)
+ try: os.makedirs(os.path.dirname(py_target)) # the final part is copied
+ except:pass
+
+ run('cp -R "%s" "%s"' % (py_src, os.path.dirname(py_target)))
+ run('rm -rf "%s/distutils"' % py_target)
+ run('rm -rf "%s/lib2to3"' % py_target)
+ run('rm -rf "%s/idlelib"' % py_target)
+ run('rm -rf "%s/tkinter"' % py_target)
+ run('rm -rf "%s/config"' % py_target)
+
+ run('rm -rf "%s/site-packages"' % py_target)
+ run('mkdir "%s/site-packages"' % py_target) # python needs it.'
+
+ run('rm "%s/lib-dynload/_tkinter.so"' % py_target)
+ run('find "%s" -name "test" -prune -exec rm -rf {} \;' % py_target)
+ run('find "%s" -name "*.py?" -exec rm -rf {} \;' % py_target)
+ run('find "%s" -name "*.so"-exec strip -s {} \;' % py_target)
+
#### END ACTION STUFF #########
def bsc(env, target, source):
@@ -421,7 +480,11 @@ class BlenderEnvironment(SConsEnvironment):
print bc.HEADER+'Configuring resource '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC
lenv = self.Clone()
- res = lenv.RES('#'+root_build_dir+'lib/'+libname, source)
+ if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
+ res = lenv.RES('#'+root_build_dir+'lib/'+libname, source)
+ else:
+ res = lenv.RES(root_build_dir+'lib/'+libname, source)
+
SConsEnvironment.Default(self, res)
resources.append(res)
@@ -545,6 +608,11 @@ class BlenderEnvironment(SConsEnvironment):
if lenv['OURPLATFORM']=='darwin':
lenv['BINARYKIND'] = binarykind
lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print))
+ elif os.sep == '/': # any unix
+ if lenv['WITH_BF_PYTHON']:
+ if not lenv['WITHOUT_BF_INSTALL'] and not lenv['WITHOUT_BF_PYTHON_INSTALL']:
+ lenv.AddPostAction(prog,Action(PyInstall,strfunction=my_pyinst_print))
+
return prog
def Glob(lenv, pattern):
diff --git a/tools/btools.py b/tools/btools.py
index 347bb54b467..dbb2be699de 100755
--- a/tools/btools.py
+++ b/tools/btools.py
@@ -30,6 +30,9 @@ def validate_arguments(args, bc):
'WITH_BF_PYTHON', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC',
'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_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH',
+ 'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH',
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
'WITH_BF_DDS',
@@ -48,6 +51,7 @@ def validate_arguments(args, bc):
'BF_WINTAB', 'BF_WINTAB_INC',
'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
+ 'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH',
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH',
'WITH_BF_PLAYER',
@@ -57,8 +61,8 @@ def validate_arguments(args, bc):
'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC',
'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
'WITHOUT_BF_INSTALL',
+ 'WITHOUT_BF_PYTHON_INSTALL',
'WITH_BF_OPENMP',
- 'WITHOUT_BF_INSTALL',
'BF_FANCY', 'BF_QUIET',
'BF_X264_CONFIG',
'BF_XVIDCORE_CONFIG',
@@ -74,6 +78,7 @@ def validate_arguments(args, bc):
'BF_OPENGL_LINKFLAGS',
'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS',
'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS',
+ 'BGE_CXXFLAGS',
'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
'C_WARN', 'CC_WARN', 'CXX_WARN',
@@ -169,10 +174,27 @@ def read_opts(cfg, args):
(BoolVariable('WITH_BF_SDL', 'Use SDL if true', False)),
('BF_SDL', 'SDL base path', ''),
- ('BF_SDL_INC', 'SDL include path', ''), #$(shell $(BF_SDL)/bin/sdl-config --cflags)
- ('BF_SDL_LIB', 'SDL library', ''), #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+ ('BF_SDL_INC', 'SDL include path', ''),
+ ('BF_SDL_LIB', 'SDL library', ''),
('BF_SDL_LIBPATH', 'SDL library path', ''),
+ ('BF_LIBSAMPLERATE', 'libsamplerate aka SRC base path', ''),
+ ('BF_LIBSAMPLERATE_INC', 'libsamplerate aka SRC include path', ''),
+ ('BF_LIBSAMPLERATE_LIB', 'libsamplerate aka SRC library', ''),
+ ('BF_LIBSAMPLERATE_LIBPATH', 'libsamplerate aka SRC library path', ''),
+
+ (BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
+ ('BF_JACK', 'jack base path', ''),
+ ('BF_JACK_INC', 'jack include path', ''),
+ ('BF_JACK_LIB', 'jack library', ''),
+ ('BF_JACK_LIBPATH', 'jack library path', ''),
+
+ (BoolVariable('WITH_BF_SNDFILE', 'Enable sndfile support if true', True)),
+ ('BF_SNDFILE', 'sndfile base path', ''),
+ ('BF_SNDFILE_INC', 'sndfile include path', ''),
+ ('BF_SNDFILE_LIB', 'sndfile library', ''),
+ ('BF_SNDFILE_LIBPATH', 'sndfile library path', ''),
+
('BF_PTHREADS', 'Pthreads base path', ''),
('BF_PTHREADS_INC', 'Pthreads include path', ''),
('BF_PTHREADS_LIB', 'Pthreads library', ''),
@@ -292,6 +314,12 @@ def read_opts(cfg, args):
('BF_QUICKTIME_INC', 'QuickTime include path', ''),
('BF_QUICKTIME_LIB', 'QuickTime library', ''),
('BF_QUICKTIME_LIBPATH', 'QuickTime library path', ''),
+
+ (BoolVariable('WITH_BF_FFTW3', 'Use FFTW3 if true', False)),
+ ('BF_FFTW3', 'FFTW3 base path', ''),
+ ('BF_FFTW3_INC', 'FFTW3 include path', ''),
+ ('BF_FFTW3_LIB', 'FFTW3 library', ''),
+ ('BF_FFTW3_LIBPATH', 'FFTW3 library path', ''),
(BoolVariable('WITH_BF_STATICOPENGL', 'Use MESA if true', True)),
('BF_OPENGL', 'OpenGL base path', ''),
@@ -322,6 +350,7 @@ def read_opts(cfg, args):
('CFLAGS', 'C only flags', ''),
('CCFLAGS', 'Generic C and C++ flags', ''),
('CXXFLAGS', 'C++ only flags', ''),
+ ('BGE_CXXFLAGS', 'C++ only flags for BGE', ''),
('CPPFLAGS', 'Defines', ''),
('REL_CFLAGS', 'C only release flags', ''),
('REL_CCFLAGS', 'Generic C and C++ release flags', ''),
@@ -359,6 +388,7 @@ def read_opts(cfg, args):
(BoolVariable('BF_TWEAK_MODE', 'Enable tweak mode if true', False)),
(BoolVariable('BF_SPLIT_SRC', 'Split src lib into several chunks if true', False)),
(BoolVariable('WITHOUT_BF_INSTALL', 'dont install if true', False)),
+ (BoolVariable('WITHOUT_BF_PYTHON_INSTALL', 'dont install Python modules if true', False)),
(BoolVariable('BF_FANCY', 'Enable fancy output if true', True)),
(BoolVariable('BF_QUIET', 'Enable silent output if true', True)),
(BoolVariable('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', False)),